Advertisement
Guest User

Untitled

a guest
Sep 8th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 483.45 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 java.awt.Desktop;
  14. import javax.swing.*;
  15. import java.util.regex.*;
  16. import java.io.*;
  17.  
  18. public class client extends RSApplet {
  19. public RSFont newSmallFont;
  20. public MP3 mp3;
  21. public MID mid;
  22. public RSFont newRegularFont;
  23. public RSFont newBoldFont;
  24. public RSFont newFancyFont;
  25. public Sprite[] chatImages = new Sprite[2];
  26. public AlertHandler alertHandler;
  27. public Sprite alertBack;
  28. public Sprite alertBorder;
  29. public Sprite alertBorderH;
  30. public Sprite coinOrb;
  31. public Sprite coinPart;
  32. public boolean coinToggle = false;
  33. public Sprite coinOrbPart;
  34. public int frontLight = 68;
  35. public int backLight = 820;
  36. public int rightLight = 0;
  37. public int middleLight = -1; // Cannot be 0
  38. public int leftLight = 0;
  39. public String indexLocation(int cacheIndex, int index) {
  40. return signlink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  41. }
  42.  
  43.  
  44. public void repackCacheIndex(int cacheIndex) {
  45. System.out.println("Started repacking index " + cacheIndex + ".");
  46. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  47. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  48. try {
  49. for (int index = 0; index < indexLength; index++) {
  50. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  51. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  52. if(data != null && data.length > 0) {
  53. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  54. System.out.println("Repacked " + fileIndex + ".");
  55. } else {
  56. System.out.println("Unable to locate index " + fileIndex + ".");
  57. }
  58. }
  59. } catch(Exception e) {
  60. System.out.println("Error packing cache index " + cacheIndex + ".");
  61. }
  62. System.out.println("Finished repacking " + cacheIndex + ".");
  63. }
  64.  
  65. public byte[] fileToByteArray(int cacheIndex, int index) {
  66. try {
  67. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  68. return null;
  69. }
  70. File file = new File(indexLocation(cacheIndex, index));
  71. byte[] fileData = new byte[(int)file.length()];
  72. FileInputStream fis = new FileInputStream(file);
  73. fis.read(fileData);
  74. fis.close();
  75. return fileData;
  76. } catch(Exception e) {
  77. return null;
  78. }
  79. }
  80. public int positions[] = new int[2000];
  81. public int landScapes[] = new int[2000];
  82. public int objects[] = new int[2000];
  83.  
  84. public static String getFileNameWithoutExtension(String fileName) {
  85. File tmpFile = new File(fileName);
  86. tmpFile.getName();
  87. int whereDot = tmpFile.getName().lastIndexOf('.');
  88. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  89. return tmpFile.getName().substring(0, whereDot);
  90. }
  91. return "";
  92. }
  93.  
  94. public String getRank(int i){
  95. switch(i){
  96. case 1:
  97. return "Lord ";
  98. case 2:
  99. return "Sir ";
  100. case 3:
  101. return "Lionheart ";
  102. case 4:
  103. return "Desperado ";
  104. case 5:
  105. return "Bandito ";
  106. case 6:
  107. return "King ";
  108. case 7:
  109. return "Big Cheese ";
  110. case 8:
  111. return "Wunderkind ";
  112. case 9:
  113. return "Crusader ";
  114. case 10:
  115. return "Overlord ";
  116. case 11:
  117. return "Bigwig ";
  118. case 12:
  119. return "Count ";
  120. case 13:
  121. return "Duderino ";
  122. case 14:
  123. return "Hell Raiser ";
  124. case 15:
  125. return "Baron ";
  126. case 16:
  127. return "Duke ";
  128. case 17:
  129. return "Lady ";
  130. case 18:
  131. return "Dame ";
  132. case 19:
  133. return "Dudette ";
  134. case 20:
  135. return "Baroness ";
  136. case 21:
  137. return "Countess ";
  138. case 22:
  139. return "Overlordess ";
  140. case 23:
  141. return "Duchess ";
  142. case 24:
  143. return "Queen ";
  144. case 25:
  145. return "Donator ";
  146. case 26:
  147. return "Super Donator ";
  148. case 27:
  149. return "Veteran ";
  150. case 28:
  151. return "Owner ";
  152. case 29:
  153. return "Co-Owner ";
  154. case 30:
  155. return "Trusted-Dicer ";
  156. case 31:
  157. return "Master ";
  158. case 32:
  159. return "Dicer ";
  160. case 33:
  161. return "Mistress ";
  162. }
  163. return "";
  164. }
  165.  
  166. public void setNewMaps() {
  167. try {
  168. BufferedReader in = new BufferedReader(new FileReader(signlink.findcachedir()+"Data/Maps/mapConfig.txt"));
  169. String s;
  170. int D = 0; //Open your czache please
  171. while ((s = in.readLine()) != null) {
  172. positions[D] = Integer.parseInt(s.substring(s.indexOf("=")+1,s.indexOf("(")));
  173. landScapes[D] = Integer.parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")));
  174. objects[D] = Integer.parseInt(s.substring(s.indexOf("[")+1,s.indexOf("]")));
  175. D++;
  176. }
  177. } catch (IOException e) {
  178. e.printStackTrace();
  179. }
  180. }
  181.  
  182. public void maps() {
  183. for(int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  184. byte[] abyte0 = GetMap(MapIndex);
  185. if(abyte0 != null && abyte0.length > 0) {
  186. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  187. }
  188. }
  189. }
  190.  
  191. public byte[] GetMap(int Index) {
  192. try {
  193. File Map = new File(signlink.findcachedir());
  194. byte[] aByte = new byte[(int)Map.length()];
  195. FileInputStream Fis = new FileInputStream(Map);
  196. Fis.read(aByte);
  197. System.out.println(""+Index+" aByte = ["+aByte+"]!");
  198. Fis.close();
  199. return aByte;
  200. } catch(Exception e) {
  201. return null;
  202. }
  203. }
  204.  
  205. private void setAutoCastOff() {
  206. autoCast = false;
  207. autocastId = 0;
  208. sendPacket185(6666,-1,135);
  209. pushMessage("Autocast spell cleared.", 0, "");
  210. }
  211.  
  212. private void sendData(String inputString) {
  213. stream.createFrame(103);
  214. stream.writeWordBigEndian(inputString.length() - 1);
  215. stream.writeString(inputString.substring(2));
  216. }
  217.  
  218. public void preloadModels() {
  219. File file = new File(signlink.findcachedir() + "/raw/");
  220. File afile[] = file.listFiles();
  221. for(int i = 0; i < afile.length; i++) {
  222. String s = afile[i].getName();
  223. byte abyte0[] = ReadFile(signlink.findcachedir() + "/raw/" + s);
  224. Model.method460(abyte0, Integer.parseInt(getFileNameWithoutExtension(s)));
  225. }
  226.  
  227. }
  228.  
  229. private static void openUpWebSite(String url) {
  230. Desktop d = Desktop.getDesktop();
  231. try {
  232. d.browse(new URI(url));
  233. } catch (Exception e) {
  234.  
  235. }
  236. }
  237.  
  238. public void hitmarkDraw(Entity e, int hitLength, int markType, int icon, int damage, int move, int opacity, int focusPlayer, int focusNPC) {
  239. hitLength *= 2;
  240. if (damage > 0) {
  241. if(icon > 0 && icon < hitMarkIcons.length)
  242. hitMarkIcons[icon].drawSprite1(spriteDrawX - 34, spriteDrawY - 14 + move, opacity);
  243. int focusType = (e == myPlayer || (focusPlayer != 0 && e == playerArray[focusPlayer]) || (focusNPC != 0 && e == npcArray[focusNPC])) ? 0 : 1;
  244. hitMarkBacks[markType][focusType][0].drawSprite1(spriteDrawX - 12, spriteDrawY - 12 + move, opacity);
  245. for (int i = 1; i <= hitLength; i++)
  246. hitMarkBacks[markType][focusType][1].drawSprite1(spriteDrawX - 12 + i*4, spriteDrawY - 12 + move, opacity);
  247. hitMarkBacks[markType][focusType][2].drawSprite1(spriteDrawX - 8 + hitLength*4, spriteDrawY - 12 + move, opacity);
  248.  
  249. if(hitLength == 6)
  250. normalFont.drawText(0xffffff, String.valueOf(damage), spriteDrawY + 3 + move, spriteDrawX+4);
  251. else if(hitLength == 4)
  252. normalFont.drawText(0xffffff, String.valueOf(damage), spriteDrawY + 3 + move, spriteDrawX);
  253. else
  254. normalFont.drawText(0xffffff, String.valueOf(damage), spriteDrawY + 3 + move, spriteDrawX-4);
  255. } else {
  256. hitMarkIcons[0].drawSprite1(spriteDrawX - 12, spriteDrawY - 14 + move, opacity);
  257. }
  258. }
  259.  
  260. private void drawGameFrameOnFullScreen() {
  261. if(toggleFullscreen) {
  262. drawChatArea(main3DArea,xPaddingchatBackImage,yPaddingchatBackImage + getChatBackIncreaseY());
  263. drawMinimap(main3DArea,xPaddingmapBackImage + getMapIncreaseX(),yPaddingmapBackImage + getMapIncreaseY());
  264. drawTabArea(main3DArea,xPaddingtabBack + getTabIncreaseX(),yPaddingtabBack + getTabIncreaseY());
  265. if (!contextMenuOpen) {
  266. processRightClick();
  267. drawTooltip();
  268. } else {
  269. drawMenu(4,4);
  270. }
  271. }
  272. }
  273.  
  274. private void load3DArea() {
  275. Texture.method365(getScreenWidth(), getScreenHeight());
  276. fullScreenTextureArray = Texture.anIntArray1472;
  277. Texture.method365(519, 165);
  278. anIntArray1180 = Texture.anIntArray1472;
  279. Texture.method365(246, 335);
  280. anIntArray1181 = Texture.anIntArray1472;
  281. Texture.method365(main3DAreaWidth, main3DAreaHeight);
  282. anIntArray1182 = Texture.anIntArray1472;
  283. int ai[] = new int[9];
  284. for(int i8 = 0; i8 < 9; i8++)
  285. {
  286. int k8 = 128 + i8 * 32 + 15;
  287. int l8 = 600 + k8 * 3;
  288. int i9 = Texture.anIntArray1470[k8];
  289. ai[i8] = l8 * i9 >> 16;
  290. }
  291.  
  292. WorldController.method310(600, 900, main3DAreaWidth, main3DAreaHeight, ai);
  293. }
  294.  
  295. private void switchToNormal() {
  296. toggleFullscreen = false;
  297. sendFrame36(652,0);
  298. recreateClientFrame(false,765,503,false,1,false);
  299. welcomeScreenRaised = true;
  300. }
  301.  
  302. private void switchToFull() {
  303. sendFrame36(652,1);
  304. recreateClientFrame(true,getScreenWidth(),getScreenHeight(),false,0,true);
  305. toggleFullscreen = true;
  306. }
  307.  
  308. private void switchToFullScreen() {
  309. toggleFullscreen = !toggleFullscreen;
  310. sendFrame36(652,toggleFullscreen ? 1 : 0);
  311. if(toggleFullscreen)
  312. recreateClientFrame(true,getScreenWidth(),getScreenHeight(),false,0,true);
  313. else {
  314. recreateClientFrame(false,765,503,false,1,false);
  315. welcomeScreenRaised = true;
  316. }
  317.  
  318. //System.out.println("Got here: switchToFullScreen, (getScreenWidth():" + getScreenWidth() + ", getScreenHeight(): " + getScreenHeight() + ")");
  319. }
  320.  
  321. public void recreateClientFrame(boolean undecorative, int width, int height, boolean resizable, int displayMode, boolean toggle) {
  322. main3DAreaWidth = (displayMode == 1) ? 512 : instance.getScreenWidth();
  323. main3DAreaHeight = (displayMode == 1) ? 334 : instance.getScreenHeight();
  324. load3DArea();
  325. instance.recreateClientFrame(undecorative,width,height,resizable);
  326. System.out.println("displayMode: " + displayMode);
  327.  
  328. main3DArea = new RSImageProducer(main3DAreaWidth, main3DAreaHeight, getGameComponent());
  329.  
  330. super.mouseX = super.mouseY = -1;
  331. }
  332.  
  333. public static int getChatBackIncreaseY() {
  334. return chatIncreaseY = toggleFullscreen ? (getScreenHeight() - 503) : 0;
  335. }
  336.  
  337. private int getMapIncreaseX() {
  338. return mapIncreaseX = toggleFullscreen ? (getScreenWidth() - 765 + 52) : 0;
  339. }
  340.  
  341. private int getMapIncreaseY() {
  342. return mapIncreaseY = toggleFullscreen ? 4 : 0;
  343. }
  344.  
  345. private int getTabIncreaseX() {
  346. return tabIncreaseX = toggleFullscreen ? (getScreenWidth() - 765) : 0;
  347. }
  348.  
  349. private int getTabIncreaseY() {
  350. return tabIncreaseY = toggleFullscreen ? (getScreenHeight() - 503) : 0;
  351. }
  352.  
  353. private int getScreenWidth() {
  354. int i = 0;
  355. if(toggleFullscreen) {
  356. toolkit = Toolkit.getDefaultToolkit();
  357. screenSize = toolkit.getScreenSize();
  358. i = (int)screenSize.getWidth();
  359. } else {
  360. i = 765;
  361. }
  362. return i;
  363. }
  364.  
  365. private static int getScreenHeight() {
  366. int i = 0;
  367. if(toggleFullscreen) {
  368. toolkit = Toolkit.getDefaultToolkit();
  369. screenSize = toolkit.getScreenSize();
  370. i = (int)screenSize.getHeight();
  371. } else {
  372. i = 503;
  373. }
  374. return i;
  375. }
  376.  
  377. private int yPaddingchatBackImage = 338, xPaddingchatBackImage = 0;
  378. private int yPaddingmapBackImage = 0, xPaddingmapBackImage = 516;
  379. private int xPaddingtabBack = 519, yPaddingtabBack = 168;
  380. private int mapIncreaseY = 0, mapIncreaseX = 0;
  381. public static int chatIncreaseY = 0, chatIncreaseX = 0;
  382. private int tabIncreaseY = 0, tabIncreaseX = 0;
  383. public static boolean toggleFullscreen;
  384. private static Toolkit toolkit;
  385. private static Dimension screenSize;
  386. private static int screenWidth;
  387. private static int screenHeight;
  388. private int main3DAreaWidth = 512, main3DAreaHeight = 334;
  389. public static client instance;
  390. //
  391.  
  392. public Sprite magicAuto;
  393. public boolean autoCast = false;
  394. private int autocastId = 0;
  395. //private int[] autoCastButtons = {
  396.  
  397. //};
  398. public int MapX, MapY;
  399. public static int spellID = 0;
  400. // public static String serverip = "nrs3server317.no-ip.biz";
  401. public static String defaultServerIP = "ruinedscape.no-ip.biz";
  402. public static String serverip = ""+defaultServerIP+"";
  403. public static int port = 43594;
  404. //int port = 34459;
  405. //
  406.  
  407. private static String intToKOrMilLongName(int i) {
  408. String s = String.valueOf(i);
  409. for(int k = s.length() - 3; k > 0; k -= 3)
  410. s = s.substring(0, k) + "," + s.substring(k);
  411.  
  412. //if(j != 0)
  413. // aBoolean1224 = !aBoolean1224;
  414. if(s.length() > 8)
  415. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  416. else
  417. if(s.length() > 4)
  418. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  419. return " " + s;
  420. }
  421. public final String methodR(int j) {
  422. if(j >= 0 && j < 10000)
  423. return String.valueOf(j);
  424. if(j >= 10000 && j < 10000000)
  425. return j / 1000 + "K";
  426. if(j >= 10000000 && j < 1000000000)
  427. return j / 1000000 + "M";
  428. else
  429. return "?";
  430. }
  431.  
  432. public static final byte[] ReadFile(String s) {
  433. try {
  434. byte abyte0[];
  435. File file = new File(s);
  436. int i = (int)file.length();
  437. abyte0 = new byte[i];
  438. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  439. datainputstream.readFully(abyte0, 0, i);
  440. datainputstream.close();
  441. return abyte0;
  442. } catch(Exception e) {
  443. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  444. return null;
  445. }
  446. }
  447.  
  448. public void models() {
  449. for(int ModelIndex = 0; ModelIndex < 60000; ModelIndex++) {
  450. byte[] abyte0 = getModel(ModelIndex);
  451. if(abyte0 != null && abyte0.length > 0) {
  452. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  453. pushMessage("Model added successfully!", 0, "");
  454. }
  455. }
  456. }
  457. public byte[] getModel(int Index) {
  458. try {
  459. File Model = new File("signlink.findcachedir()/modelz/"+Index+".gz");
  460. byte[] aByte = new byte[(int)Model.length()];
  461. FileInputStream fis = new FileInputStream(Model);
  462. fis.read(aByte);
  463. pushMessage("aByte = ["+aByte+"]!", 0, "");
  464. fis.close();
  465. return aByte;
  466. }
  467. catch(Exception e)
  468. {return null;}
  469. }
  470.  
  471. public void models2() {
  472. for(int ModelIndex = 0; ModelIndex < 90000; ModelIndex++) {
  473. byte[] abyte0 = getModel2(ModelIndex);
  474. if(abyte0 != null && abyte0.length > 0) {
  475. decompressors[2].method234(abyte0.length, abyte0, ModelIndex);
  476. pushMessage("Model added successfully!", 0, "");
  477. }
  478. }
  479. }
  480. public byte[] getModel2(int Index) {
  481. try {
  482. File Model = new File(signlink.findcachedir() + "/raw/"+Index+".dat");//Gets Models by hack3r
  483. byte[] aByte = new byte[(int)Model.length()];
  484. FileInputStream fis = new FileInputStream(Model);
  485. fis.read(aByte);
  486. pushMessage("aByte = ["+aByte+"]!", 0, "");
  487. fis.close();
  488.  
  489. return aByte;
  490. }
  491. catch(Exception e)
  492. {return null;}
  493. }
  494. public static final byte[] ReadFile2(String s, boolean antiLeech) {
  495. try {
  496. byte abyte0[];
  497. File file = new File(s);
  498. int i = (int)file.length();
  499. abyte0 = new byte[i];
  500. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  501. datainputstream.readFully(abyte0, 0, i);
  502. datainputstream.close();
  503. return abyte0;
  504. } catch(Exception e) {
  505. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  506. return null;
  507. }
  508. }
  509.  
  510.  
  511. private void stopMidi() {
  512. if (SoundProvider.getSingleton().midiSequencer.isRunning())
  513. SoundProvider.getSingleton().midiSequencer.stop();
  514. signlink.midifade = 0;
  515. signlink.midi = "stop";
  516. }
  517.  
  518. private boolean menuHasAddFriend(int j) {
  519. if(j < 0)
  520. return false;
  521. int k = menuActionID[j];
  522. if(k >= 2000)
  523. k -= 2000;
  524. return k == 337;
  525. }
  526.  
  527. public void drawChannelButtons(int paddingX, int paddingY) {
  528. if(toggleFullscreen)
  529. chatArea[2].drawSprite(5 + paddingX, 142 + paddingY);
  530.  
  531. String text[] = { "On", "Friends", "Off", "Hide" };
  532. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  533. switch(cButtonCPos) {
  534. case 0:
  535. chatButtons[1].drawSprite(5 + paddingX, 142 + paddingY);
  536. break;
  537. case 1:
  538. chatButtons[1].drawSprite(71 + paddingX, 142 + paddingY);
  539. break;
  540. case 2:
  541.  
  542. chatButtons[1].drawSprite(137 + paddingX, 142 + paddingY);
  543. break;
  544. case 3:
  545. chatButtons[1].drawSprite(203 + paddingX, 142 + paddingY);
  546. break;
  547. case 4:
  548. chatButtons[1].drawSprite(269 + paddingX, 142 + paddingY);
  549. break;
  550. case 5:
  551. chatButtons[1].drawSprite(335 + paddingX, 142 + paddingY);
  552. break;
  553. }
  554. if(cButtonHPos == cButtonCPos) {
  555. switch(cButtonHPos) {
  556. case 0:
  557. chatButtons[2].drawSprite(5 + paddingX, 142 + paddingY);
  558. break;
  559. case 1:
  560. chatButtons[2].drawSprite(71 + paddingX, 142 + paddingY);
  561. break;
  562. case 2:
  563. chatButtons[2].drawSprite(137 + paddingX, 142 + paddingY);
  564. break;
  565. case 3:
  566. chatButtons[2].drawSprite(203 + paddingX, 142 + paddingY);
  567. break;
  568. case 4:
  569. chatButtons[2].drawSprite(269 + paddingX, 142 + paddingY);
  570. break;
  571. case 5:
  572. chatButtons[2].drawSprite(335 + paddingX, 142 + paddingY);
  573. break;
  574. case 6:
  575. chatButtons[3].drawSprite(404 + paddingX, 142 + paddingY);
  576. break;
  577. }
  578. } else {
  579. switch(cButtonHPos) {
  580. case 0:
  581. chatButtons[0].drawSprite(5 + paddingX, 142 + paddingY);
  582. break;
  583. case 1:
  584. chatButtons[0].drawSprite(71 + paddingX, 142 + paddingY);
  585. break;
  586. case 2:
  587. chatButtons[0].drawSprite(137 + paddingX, 142 + paddingY);
  588. break;
  589. case 3:
  590. chatButtons[0].drawSprite(203 + paddingX, 142 + paddingY);
  591. break;
  592. case 4:
  593. chatButtons[0].drawSprite(269 + paddingX, 142 + paddingY);
  594. break;
  595. case 5:
  596. chatButtons[0].drawSprite(335 + paddingX, 142 + paddingY);
  597. break;
  598. case 6:
  599. chatButtons[3].drawSprite(404 + paddingX, 142 + paddingY);
  600. break;
  601. }
  602. }
  603. smallFont.method389(true, 425 + paddingX, 0xffffff, "Staff Pannel", 157 + paddingY);
  604. smallFont.method389(true, 26 + paddingX, 0xffffff, "All", 157 + paddingY);
  605. smallFont.method389(true, 86 + paddingX, 0xffffff, "Game", 157 + paddingY);
  606.  
  607. smallFont.method389(true, 150 + paddingX, 0xffffff, "Public", 152 + paddingY);
  608. smallFont.method389(true, 212 + paddingX, 0xffffff, "Private", 152 + paddingY);
  609. smallFont.method389(true, 286 + paddingX, 0xffffff, "Clan", 152 + paddingY);
  610. smallFont.method389(true, 349 + paddingX, 0xffffff, "Trade", 152 + paddingY);
  611. smallFont.method382(textColor[publicChatMode], 164 + paddingX, text[publicChatMode], 163 + paddingY, true);
  612. smallFont.method382(textColor[privateChatMode], 230 + paddingX, text[privateChatMode], 163 + paddingY, true);
  613. smallFont.method382(textColor[clanChatMode], 296 + paddingX, text[clanChatMode], 163 + paddingY, true);
  614. smallFont.method382(textColor[tradeMode], 362 + paddingX, text[tradeMode], 163 + paddingY, true);
  615. }
  616.  
  617. public static String capitalize(String s) {
  618.  
  619. for (int i = 0; i < s.length(); i++) {
  620. if (i == 0) {
  621. s = String.format( "%s%s",
  622. Character.toUpperCase(s.charAt(0)),
  623. s.substring(1) );
  624. }
  625. if (!Character.isLetterOrDigit(s.charAt(i))) {
  626. if (i + 1 < s.length()) {
  627. s = String.format( "%s%s%s",
  628. s.subSequence(0, i+1),
  629. Character.toUpperCase(s.charAt(i + 1)),
  630. s.substring(i+2) );
  631. }
  632. }
  633. }
  634. return s;
  635. }
  636.  
  637. private void drawChatArea(RSImageProducer chatback, int paddingX, int paddingY) {
  638. int maximumScrollRange = 210;
  639. byte minimumScrollRange = 0;
  640. chatback.initDrawingArea();
  641. Texture.anIntArray1472 = anIntArray1180;
  642. if(toggleFullscreen) {
  643. if(!messagePromptRaised && aString844 == null && backDialogID == -1 && dialogID == -1 && inputDialogState == 0)
  644. DrawingArea.drawAlphaGradient(7 + paddingX, 7 + paddingY,505, 130, 0xB5B5B5, 0, 70);
  645. else
  646. chatArea[1].drawSprite1(paddingX, paddingY,128);
  647. } else
  648. chatArea[0].drawSprite(paddingX, paddingY);
  649.  
  650. drawChannelButtons(paddingX, paddingY);
  651. RSFont textDrawingArea = newRegularFont;
  652. if(messagePromptRaised) {
  653. boldFont.drawText(0, aString1121, 60 + paddingY, 259);
  654. boldFont.drawText(128, promptInput + "*", 80 + paddingY, 259);
  655. } else if(inputDialogState == 1) {
  656. boldFont.drawText(0, "Enter amount:", 60 + paddingY, 259);
  657. boldFont.drawText(128, amountOrNameInput + "*", 80 + paddingY, 259);
  658. } else if(inputDialogState == 2) {
  659. boldFont.drawText(0, "Enter name:", 60 + paddingY, 259);
  660. boldFont.drawText(128, amountOrNameInput + "*", 80 + paddingY, 259);
  661. } else if(aString844 != null) {
  662. boldFont.drawText(0, aString844, 60 + paddingY, 259);
  663. boldFont.drawText(128, "Click to continue", 80 + paddingY, 259);
  664. } else if(backDialogID != -1) {
  665. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20 + paddingY);
  666. } else if(dialogID != -1) {
  667. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20 + paddingY);
  668. } else {
  669. int totalLines = 0;
  670. DrawingArea.setDrawingArea(122 + paddingY, 8 + paddingX, 497 + paddingX, 7 + paddingY);
  671. for(int k = 0; k < 500; k++)
  672. if(chatMessages[k] != null) {
  673. int chatType = chatTypes[k];
  674. int yPos = (70 - (totalLines - 3) * 14) + anInt1089 + 5;
  675. String s1 = chatNames[k];
  676. byte byte0 = 0;
  677. if(s1 != null && s1.startsWith("@cr"))
  678. {
  679. String rightID = s1.substring(3,4);
  680. s1 = s1.substring(5);
  681. byte0 = (byte)Integer.parseInt(rightID);
  682. }
  683. if(chatType == 0) {
  684. if (chatTypeView == 5 || chatTypeView == 0) {
  685. if(yPos > minimumScrollRange && yPos < maximumScrollRange) {
  686. textDrawingArea.drawBasicString(chatMessages[k], 11, yPos+paddingY, 0, -1);
  687. //(false, 11, 0, chatMessages[k], yPos + paddingY);//chat color enabled
  688. }
  689. totalLines++;
  690. }
  691. }
  692. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  693. if (chatTypeView == 1 || chatTypeView == 0) {
  694. if(yPos > minimumScrollRange && yPos < maximumScrollRange) {
  695. int xPos = 11;
  696. if(byte0 > 0) {
  697. modIcons[byte0-1].drawBackground(xPos + 1, yPos - 12 + paddingY);
  698. xPos += 14;
  699. } else if(byte0 == 5) {
  700. CrownName.drawSprite(xPos + 1, yPos - 12);
  701. xPos += 14;
  702. }
  703. textDrawingArea.drawBasicString(s1 + ":", xPos, yPos+paddingY, toggleFullscreen ? 0xffffff : 0, -1);
  704. //textDrawingArea.method385(toggleFullscreen ? 0xffffff : 0, s1 + ":", yPos + paddingY, xPos);
  705. xPos += textDrawingArea.getTextWidth(s1) + 8;
  706. textDrawingArea.drawBasicString(chatMessages[k], xPos, yPos+paddingY, toggleFullscreen ? 0xffffff : 255, -1);
  707.  
  708.  
  709. //textDrawingArea.method389(false, xPos, toggleFullscreen ? 0xffffff : 255, chatMessages[k], yPos + paddingY);
  710. }
  711. totalLines++;
  712. }
  713. }
  714. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  715. if (chatTypeView == 2 || chatTypeView == 0) {
  716. if(yPos > minimumScrollRange && yPos < maximumScrollRange) {
  717. int k1 = 11;
  718. textDrawingArea.drawBasicString("From", k1, yPos+paddingY, 0, -1);
  719. k1 += textDrawingArea.getTextWidth("From ");
  720. if(byte0 > 0) {
  721. modIcons[byte0-1].drawBackground(k1 + 1, yPos - 12 + paddingY);
  722. k1 += 12;
  723. }
  724. textDrawingArea.drawBasicString(s1 + ":", k1, yPos+paddingY, 0, -1);
  725. //textDrawingArea.method385(0, s1 + ":", yPos + paddingY, k1);
  726. k1 += textDrawingArea.getTextWidth(s1) + 8;
  727. textDrawingArea.drawBasicString(chatMessages[k], k1, yPos+paddingY, toggleFullscreen ? 0xFF5256 : 0x800000, -1);
  728. //textDrawingArea.method385(toggleFullscreen ? 0xFF5256 : 0x800000, chatMessages[k], yPos + paddingY, k1);
  729. }
  730. totalLines++;
  731. }
  732. }
  733. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  734. if (chatTypeView == 3 || chatTypeView == 0) {
  735. if(yPos > minimumScrollRange && yPos < maximumScrollRange) {
  736. //textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos + paddingY, 11);
  737. textDrawingArea.drawBasicString(s1 + " "+ chatMessages[k], 11, yPos + paddingY, 0x800080, -1);
  738. }
  739. totalLines++;
  740. }
  741. }
  742. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  743. if (chatTypeView == 2 || chatTypeView == 0) {
  744. if(yPos > minimumScrollRange && yPos < maximumScrollRange) {
  745. //textDrawingArea.method385(toggleFullscreen ? 0xFF5256 : 0x800000, chatMessages[k], yPos + paddingY, 11);
  746. textDrawingArea.drawBasicString(chatMessages[k], 11, yPos+paddingY, toggleFullscreen ? 0xFF5256 : 0x800000, -1);
  747. }
  748. totalLines++;
  749. }
  750. }
  751. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  752. if (chatTypeView == 2 || chatTypeView == 0) {
  753. if(yPos > minimumScrollRange && yPos < maximumScrollRange) {
  754. //textDrawingArea.method385(0, "To " + s1 + ":", yPos + paddingY, 11);
  755. textDrawingArea.drawBasicString("To " + s1 + ":", 11, yPos+paddingY, 0, -1);
  756. //textDrawingArea.method385(toggleFullscreen ? 0xFF5256 : 0x800000, chatMessages[k], yPos + paddingY, 15 + textDrawingArea.getTextWidth("To :" + s1));
  757. textDrawingArea.drawBasicString(chatMessages[k], 15 + textDrawingArea.getTextWidth("To :" + s1), yPos+paddingY, toggleFullscreen ? 0xFF5256 : 0x800000, -1);
  758. }
  759. totalLines++;
  760. }
  761. }
  762. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  763. if (chatTypeView == 3 || chatTypeView == 0) {
  764. if(yPos > minimumScrollRange && yPos < maximumScrollRange) {
  765. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos + paddingY, 11);
  766. textDrawingArea.drawBasicString(s1 + " " + chatMessages[k], 11, yPos+paddingY, 0x7e3200, -1);
  767. }
  768. totalLines++;
  769. }
  770. if(chatType == 11 && (clanChatMode == 0)) {
  771. if (chatTypeView == 11) {
  772. if(yPos > minimumScrollRange && yPos < maximumScrollRange) {
  773. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos + paddingY, 11);
  774. textDrawingArea.drawBasicString(s1 + " " + chatMessages[k], 11, yPos+paddingY, 0x7e3200, -1);
  775. }
  776. totalLines++;
  777. }
  778. if(chatType == 12) {
  779. if(yPos > minimumScrollRange && yPos < maximumScrollRange)
  780. //textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos + paddingY, 11);
  781. textDrawingArea.drawBasicString(chatMessages[k] + " @blu@" + s1, 11, yPos+paddingY, 0x7e3200, -1);
  782. }
  783. totalLines++;
  784. }
  785. }
  786. if(chatType == 9) {
  787. if(yPos > minimumScrollRange && yPos < maximumScrollRange) {
  788. //textDrawingArea.method385(toggleFullscreen ? 0x7FA9FE : 0x314952, "[" + chatMessages[k] + "]", yPos + paddingY, 11);
  789. textDrawingArea.drawBasicString("[" + chatMessages[k] + "]", 11, yPos+paddingY, toggleFullscreen ? 0x7FA9FE : 0x314952, -1);
  790. }
  791. totalLines++;
  792. }
  793. if(chatType == 16) {
  794. if((chatTypeView == 11 || chatTypeView == 0) && clanChatMode == 0) {
  795. if(yPos > minimumScrollRange && yPos < maximumScrollRange){
  796. int k1 = 11;
  797. try {
  798. if(Integer.parseInt(s1) > 0) {
  799. if(modIcons.length > Integer.parseInt(s1) -1) {
  800. modIcons[Integer.parseInt(s1)-1].drawBackground(k1 + 1, yPos - 12 + paddingY);
  801. }
  802. k1 += 14;
  803. }
  804.  
  805. } catch(NumberFormatException ex) {
  806.  
  807. }
  808.  
  809. //textDrawingArea.method389(false, k1, toggleFullscreen ? 0xffffff : 0, chatMessages[k], yPos + paddingY);
  810. textDrawingArea.drawBasicString(chatMessages[k], k1, yPos+paddingY, toggleFullscreen ? 0xffffff : 0, -1);
  811.  
  812. }
  813. totalLines++;
  814. }
  815. }
  816. }
  817. DrawingArea.defaultDrawingAreaSize();
  818. chatScrollTotalLength = totalLines * 14 + 7 + 5;
  819.  
  820. if(chatScrollTotalLength < 111)
  821. chatScrollTotalLength = 111;
  822.  
  823. drawScrollbar(113, chatScrollTotalLength - anInt1089 - 113, 7 + paddingY, 497, chatScrollTotalLength,true);
  824. String s;
  825. if(myPlayer != null && myPlayer.name != null)
  826. s = myPlayer.name;
  827. else
  828. s = myUsername;
  829. textDrawingArea.drawBasicString(s + ":", 11, 133 + paddingY, toggleFullscreen ? 0xffffff : 0, -1);
  830. //textDrawingArea.method385(toggleFullscreen ? 0xffffff : 0, s + ":", 133 + paddingY, 11);
  831. textDrawingArea.drawBasicString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": "), 133 + paddingY, toggleFullscreen ? 0x7FA9FF : 255, -1);
  832. //textDrawingArea.drawChatInput(toggleFullscreen ? 0x7FA9FF : 255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133 + paddingY, false);
  833. DrawingArea.method339(121 + paddingY, toggleFullscreen ? 0xffffff : 0x807660, 506, 7);
  834. }
  835. if(contextMenuOpen && !toggleFullscreen) {
  836. drawMenu(0, 338);
  837. }
  838. main3DArea.initDrawingArea();
  839. Texture.anIntArray1472 = anIntArray1182;
  840. }
  841.  
  842. public static void main(String args[]) {
  843. try {
  844. nodeID = 10;//friends list order
  845. portOff = 0;
  846. setHighMem();//sets high or low detail
  847. isMembers = true;
  848. signlink.storeid = 32;
  849. signlink.startpriv(InetAddress.getLocalHost());
  850. instance = new client();
  851. instance.createClientFrame(503, 765);//client frame size
  852. } catch(Exception e) {
  853. e.printStackTrace();
  854. }
  855. }
  856.  
  857. public void init() {
  858. try {
  859. nodeID = 10;//friends list order
  860. portOff = 0;
  861. setHighMem();//sets high or low detail
  862. isMembers = true;
  863. signlink.storeid = 32;
  864. signlink.startpriv(InetAddress.getLocalHost());
  865. instance = this;
  866. initClientFrame(503, 765);//this it? 510 770
  867. } catch (Exception e) {
  868. e.printStackTrace();
  869. }
  870. }
  871.  
  872. public void startRunnable(Runnable runnable, int i) {
  873. if(i > 10)
  874. i = 10;
  875. if(signlink.mainapp != null) {
  876. signlink.startthread(runnable, i);
  877. } else {
  878. super.startRunnable(runnable, i);
  879. }
  880. }
  881.  
  882. public Socket openSocket(int port) throws IOException {
  883. return new Socket(InetAddress.getByName(serverip), port);
  884. }
  885.  
  886. private void processMenuClick() {
  887. if(activeInterfaceType != 0)
  888. return;
  889. int j = super.clickMode3;
  890. if(spellSelected == 1 && super.saveClickX >= 503 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  891. j = 0;
  892. if(contextMenuOpen) {
  893. if(j != 1) {
  894. int k = super.mouseX;
  895. int j1 = super.mouseY;
  896. if(menuScreenArea == 0) {
  897. k -= 4;
  898. j1 -= 4;
  899. }
  900. if(menuScreenArea == 1) {
  901. k -= 519;//519
  902. j1 -= 168;
  903. }
  904. if(menuScreenArea == 2) {
  905. k -= 5;
  906. j1 -= 338;
  907. }
  908. if(menuScreenArea == 3) {
  909. k -= 519;//519
  910. j1 -= 0;
  911. }
  912. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  913. contextMenuOpen = false;
  914. if(menuScreenArea == 1)
  915. needDrawTabArea = true;
  916. if(menuScreenArea == 2)
  917. inputTaken = true;
  918. }
  919. }
  920. if(j == 1) {
  921. int l = menuOffsetX;
  922. int k1 = menuOffsetY;
  923. int i2 = menuWidth;
  924. int k2 = super.saveClickX;
  925. int l2 = super.saveClickY;
  926. if(menuScreenArea == 0) {
  927. k2 -= 4;
  928. l2 -= 4;
  929. }
  930. if(menuScreenArea == 1) {
  931. k2 -= 519;//519
  932. l2 -= 168;
  933. }
  934. if(menuScreenArea == 2) {
  935. k2 -= 5;//17
  936. l2 -= 338;
  937. }
  938. if(menuScreenArea == 3) {
  939. k2 -= 519;//519
  940. l2 -= 0;
  941. }
  942. int i3 = -1;
  943. for(int j3 = 0; j3 < menuActionRow; j3++) {
  944. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  945. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  946. i3 = j3;
  947. }
  948. System.out.println(i3);
  949. if(i3 != -1)
  950. doAction(i3);
  951. contextMenuOpen = false;
  952. if(menuScreenArea == 1)
  953. needDrawTabArea = true;
  954. if(menuScreenArea == 2) {
  955. inputTaken = true;
  956. }
  957. }
  958. } else {
  959. if(j == 1 && menuActionRow > 0) {
  960. int i1 = menuActionID[menuActionRow - 1];
  961. 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) {
  962. int l1 = menuActionCmd2[menuActionRow - 1];
  963. int j2 = menuActionCmd3[menuActionRow - 1];
  964. RSInterface class9 = RSInterface.interfaceCache[j2];
  965. if(class9.aBoolean259 || class9.aBoolean235) {
  966. aBoolean1242 = false;
  967. anInt989 = 0;
  968. anInt1084 = j2;
  969. anInt1085 = l1;
  970. activeInterfaceType = 2;
  971. anInt1087 = super.saveClickX;
  972. anInt1088 = super.saveClickY;
  973. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  974. activeInterfaceType = 1;
  975. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  976. activeInterfaceType = 3;
  977. return;
  978. }
  979. }
  980. }
  981. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  982. j = 2;
  983. if(j == 1 && menuActionRow > 0)
  984. doAction(menuActionRow - 1);
  985. if(j == 2 && menuActionRow > 0)
  986. determineMenuSize();
  987.  
  988. }
  989. }
  990.  
  991.  
  992. public static int totalRead = 0;
  993.  
  994.  
  995.  
  996. private void saveMidi(boolean flag, byte abyte0[])
  997. {
  998. signlink.midifade = flag ? 1 : 0;
  999. signlink.midisave(abyte0, abyte0.length);
  1000. }
  1001.  
  1002. public void method22() {
  1003. try {
  1004. anInt985 = -1;
  1005. aClass19_1056.removeAll();
  1006. aClass19_1013.removeAll();
  1007. Texture.method366();
  1008. unlinkMRUNodes();
  1009. worldController.initToNull();
  1010. System.gc();
  1011. for (int i = 0; i < 4; i++) {
  1012. aClass11Array1230[i].method210();
  1013. }
  1014. for (int l = 0; l < 4; l++) {
  1015. for (int k1 = 0; k1 < 104; k1++) {
  1016. for (int j2 = 0; j2 < 104; j2++) {
  1017. byteGroundArray[l][k1][j2] = 0;
  1018. }
  1019. }
  1020. }
  1021. ObjectManager objectManager = new ObjectManager(byteGroundArray,intGroundArray);
  1022. int k2 = aByteArrayArray1183.length;
  1023. for (int i1 = 0; i1 < k2; i1++) {
  1024. for (int i2 = 0; i2 < 2000; i2++) {
  1025. if (anIntArray1234[i1] == positions[i2]) {
  1026. anIntArray1235[i1] = landScapes[i2];
  1027. anIntArray1236[i1] = objects[i2];
  1028. }
  1029. }
  1030. }
  1031. stream.createFrame(0);
  1032. if (!aBoolean1159) {
  1033. for (int i3 = 0; i3 < k2; i3++) {
  1034. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1035. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1036. byte abyte0[] = aByteArrayArray1183[i3];
  1037. if (FileOperations.FileExists(signlink.findcachedir() + "Data/Maps/" + anIntArray1235[i3] + ".dat"))
  1038. abyte0 = FileOperations.ReadFile(signlink.findcachedir() + "Data/Maps/" + anIntArray1235[i3] + ".dat");
  1039. if (abyte0 != null)
  1040. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  1041. }
  1042. for (int j4 = 0; j4 < k2; j4++) {
  1043. int l5 = (anIntArray1234[j4] >> 8) * 62 - baseX;
  1044. int k7 = (anIntArray1234[j4] & 0xff) * 62 - baseY;
  1045. byte abyte2[] = aByteArrayArray1183[j4];
  1046. if (abyte2 == null && anInt1070 < 800)
  1047. objectManager.method174(k7, 64, 64, l5);
  1048. }
  1049. anInt1097++;
  1050. if (anInt1097 > 160) {
  1051. anInt1097 = 0;
  1052. stream.createFrame(238);
  1053. stream.writeWordBigEndian(96);
  1054. }
  1055. stream.createFrame(0);
  1056. for (int i6 = 0; i6 < k2; i6++) {
  1057. byte abyte1[] = aByteArrayArray1247[i6];
  1058. if (FileOperations.FileExists(signlink.findcachedir() + "Data/Maps/" + anIntArray1236[i6] + ".dat"))
  1059. abyte1 = FileOperations.ReadFile(signlink.findcachedir() + "Data/Maps/" + anIntArray1236[i6] + ".dat");
  1060. if (abyte1 != null) {
  1061. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1062. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1063. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  1064. }
  1065. }
  1066. }
  1067. if (aBoolean1159) {
  1068. for (int j3 = 0; j3 < 4; j3++) {
  1069. for (int k4 = 0; k4 < 13; k4++) {
  1070. for (int j6 = 0; j6 < 13; j6++) {
  1071. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1072. if (l7 != -1) {
  1073. int i9 = l7 >> 24 & 3;
  1074. int l9 = l7 >> 1 & 3;
  1075. int j10 = l7 >> 14 & 0x3ff;
  1076. int l10 = l7 >> 3 & 0x7ff;
  1077. int j11 = (j10 / 8 << 8) + l10 / 8;
  1078. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1079. if (anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  1080. continue;
  1081. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  1082. break;
  1083. }
  1084. }
  1085. }
  1086. }
  1087. }
  1088. for (int l4 = 0; l4 < 13; l4++) {
  1089. for (int k6 = 0; k6 < 13; k6++) {
  1090. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1091. if (i8 == -1)
  1092. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1093. }
  1094. }
  1095. stream.createFrame(0);
  1096. for (int l6 = 0; l6 < 4; l6++) {
  1097. for (int j8 = 0; j8 < 13; j8++) {
  1098. for (int j9 = 0; j9 < 13; j9++) {
  1099. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1100. if (i10 != -1) {
  1101. int k10 = i10 >> 24 & 3;
  1102. int i11 = i10 >> 1 & 3;
  1103. int k11 = i10 >> 14 & 0x3ff;
  1104. int i12 = i10 >> 3 & 0x7ff;
  1105. int j12 = (k11 / 8 << 8) + i12 / 8;
  1106. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1107. if (anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  1108. continue;
  1109. byte abyte0[] = aByteArrayArray1247[k12];
  1110. if (FileOperations.FileExists(signlink.findcachedir() + "Data/Maps/" + anIntArray1235[k12] + ".dat"))
  1111. abyte0 = FileOperations.ReadFile(signlink.findcachedir() + "Data/Maps/" + anIntArray1235[k12] + ".dat");
  1112. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1113. break;
  1114. }
  1115. }
  1116. }
  1117. }
  1118. }
  1119. }
  1120. stream.createFrame(0);
  1121. objectManager.method171(aClass11Array1230, worldController);
  1122. main3DArea.initDrawingArea();
  1123. stream.createFrame(0);
  1124. int k3 = ObjectManager.anInt145;
  1125. if (k3 > plane)
  1126. k3 = plane;
  1127. if (k3 < plane - 1)
  1128. k3 = plane - 1;
  1129. if (lowMem)
  1130. worldController.method275(ObjectManager.anInt145);
  1131. else
  1132. worldController.method275(0);
  1133. for (int i5 = 0; i5 < 104; i5++) {
  1134. for (int i7 = 0; i7 < 104; i7++)
  1135. spawnGroundItem(i5, i7);
  1136. }
  1137. anInt1051++;
  1138. if (anInt1051 > 98) {
  1139. anInt1051 = 0;
  1140. stream.createFrame(150);
  1141. }
  1142. method63();
  1143. } catch (Exception exception) {
  1144. }
  1145. ObjectDef.mruNodes1.unlinkAll();
  1146. if (super.gameFrame != null) {
  1147. stream.createFrame(210);
  1148. stream.writeDWord(0x3f008edd);
  1149. }
  1150. if (lowMem && signlink.cache_dat != null) {
  1151. int j = onDemandFetcher.getVersionCount(0);
  1152. for (int i1 = 0; i1 < j; i1++) {
  1153. int l1 = onDemandFetcher.getModelIndex(i1);
  1154. if ((l1 & 0x79) == 0)
  1155. Model.method461(i1);
  1156. }
  1157. }
  1158. System.gc();
  1159. Texture.method367();
  1160. onDemandFetcher.method566();
  1161. int k = (anInt1069 - 6) / 8 - 1;
  1162. int j1 = (anInt1069 + 6) / 8 + 1;
  1163. int i2 = (anInt1070 - 6) / 8 - 1;
  1164. int l2 = (anInt1070 + 6) / 8 + 1;
  1165. if (aBoolean1141) {
  1166. k = 49;
  1167. j1 = 50;
  1168. i2 = 49;
  1169. l2 = 50;
  1170. }
  1171. for (int l3 = k; l3 <= j1; l3++) {
  1172. for (int j5 = i2; j5 <= l2; j5++) {
  1173. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1174. int j7 = onDemandFetcher.method562(0, j5, l3);
  1175. if (j7 != -1)
  1176. onDemandFetcher.method560(j7, 3);
  1177. int k8 = onDemandFetcher.method562(1, j5, l3);
  1178. if (k8 != -1)
  1179. onDemandFetcher.method560(k8, 3);
  1180. }
  1181. }
  1182. }
  1183. }
  1184.  
  1185.  
  1186. private void unlinkMRUNodes()
  1187. {
  1188. ObjectDef.mruNodes1.unlinkAll();
  1189. ObjectDef.mruNodes2.unlinkAll();
  1190. EntityDef.mruNodes.unlinkAll();
  1191. ItemDef.mruNodes2.unlinkAll();
  1192. ItemDef.mruNodes1.unlinkAll();
  1193. Player.mruNodes.unlinkAll();
  1194. SpotAnim.aMRUNodes_415.unlinkAll();
  1195. }
  1196.  
  1197. private void method24(int i)
  1198. {
  1199. int ai[] = miniMapImage.myPixels;
  1200. int j = ai.length;
  1201. for(int k = 0; k < j; k++)
  1202. ai[k] = 0;
  1203.  
  1204. for(int l = 1; l < 103; l++)
  1205. {
  1206. int i1 = 24628 + (103 - l) * 512 * 4;
  1207. for(int k1 = 1; k1 < 103; k1++)
  1208. {
  1209. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1210. worldController.method309(ai, i1, i, k1, l);
  1211. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1212. worldController.method309(ai, i1, i + 1, k1, l);
  1213. i1 += 4;
  1214. }
  1215.  
  1216. }
  1217.  
  1218. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1219. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1220. miniMapImage.method343();
  1221. for(int i2 = 1; i2 < 103; i2++)
  1222. {
  1223. for(int j2 = 1; j2 < 103; j2++)
  1224. {
  1225. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1226. method50(i2, j1, j2, l1, i);
  1227. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1228. method50(i2, j1, j2, l1, i + 1);
  1229. }
  1230.  
  1231. }
  1232. try {
  1233. main3DArea.initDrawingArea();
  1234. totalMapFunctions = 0;
  1235. for(int k2 = 0; k2 < 104; k2++)
  1236. {
  1237. for(int l2 = 0; l2 < 104; l2++)
  1238. {
  1239. int i3 = worldController.method303(plane, k2, l2);
  1240. if(i3 != 0)
  1241. {
  1242. i3 = i3 >> 14 & 0x7fff;
  1243. int j3 = ObjectDef.forID(i3).anInt746;
  1244. if(j3 >= 0)
  1245. {
  1246. int k3 = k2;
  1247. int l3 = l2;
  1248. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1249. {
  1250. byte byte0 = 104;
  1251. byte byte1 = 104;
  1252. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1253. for(int i4 = 0; i4 < 10; i4++)
  1254. {
  1255. int j4 = (int)(Math.random() * 4D);
  1256. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1257. k3--;
  1258. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1259. k3++;
  1260. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1261. l3--;
  1262. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1263. l3++;
  1264. }
  1265.  
  1266. }
  1267. currentMapFunctions[totalMapFunctions] = mapFunctions[j3];
  1268. mapFunctionX[totalMapFunctions] = k3;
  1269. mapFunctionY[totalMapFunctions] = l3;
  1270. totalMapFunctions++;
  1271. }
  1272. }
  1273. }
  1274.  
  1275. }
  1276. } catch (NullPointerException ex) {
  1277.  
  1278. }
  1279. }
  1280.  
  1281. private void spawnGroundItem(int i, int j)
  1282. {
  1283. NodeList class19 = groundArray[plane][i][j];
  1284. if(class19 == null)
  1285. {
  1286. worldController.method295(plane, i, j);
  1287. return;
  1288. }
  1289. int k = 0xfa0a1f01;
  1290. Object obj = null;
  1291. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1292. {
  1293. ItemDef itemDef = ItemDef.forID(item.ID);
  1294. int l = itemDef.value;
  1295. if(itemDef.stackable)
  1296. l *= item.anInt1559 + 1;
  1297. // notifyItemSpawn(item, i + baseX, j + baseY);
  1298.  
  1299. if(l > k)
  1300. {
  1301. k = l;
  1302. obj = item;
  1303. }
  1304. }
  1305.  
  1306. class19.insertTail(((Node) (obj)));
  1307. Object obj1 = null;
  1308. Object obj2 = null;
  1309. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1310. {
  1311. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1312. obj1 = class30_sub2_sub4_sub2_1;
  1313. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1314. obj2 = class30_sub2_sub4_sub2_1;
  1315. }
  1316.  
  1317. int i1 = i + (j << 7) + 0x60000000;
  1318. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1319. }
  1320.  
  1321. private void method26(boolean flag)
  1322. {
  1323. for(int j = 0; j < npcCount; j++)
  1324. {
  1325. NPC npc = npcArray[npcIndices[j]];
  1326. int k = 0x20000000 + (npcIndices[j] << 14);
  1327. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1328. continue;
  1329. int l = npc.x >> 7;
  1330. int i1 = npc.y >> 7;
  1331. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1332. continue;
  1333. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1334. {
  1335. if(anIntArrayArray929[l][i1] == anInt1265)
  1336. continue;
  1337. anIntArrayArray929[l][i1] = anInt1265;
  1338. }
  1339. if(!npc.desc.aBoolean84)
  1340. k += 0x80000000;
  1341. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1342. }
  1343. }
  1344.  
  1345.  
  1346.  
  1347. private void loadError()
  1348. {
  1349. String s = "ondemand";//was a constant parameter
  1350. System.out.println(s);
  1351. try
  1352. {
  1353. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1354. }
  1355. catch(Exception exception)
  1356. {
  1357. exception.printStackTrace();
  1358. }
  1359. do
  1360. try
  1361. {
  1362. Thread.sleep(1000L);
  1363. }
  1364. catch(Exception _ex) { }
  1365. while(true);
  1366. }
  1367.  
  1368. private int hoverSpriteId = -1;
  1369. private void buildInterfaceMenu(int xPadding, RSInterface rsinterface, int xPos, int yPadding, int yPos, int yScrollPoint) {
  1370. try {
  1371. if(rsinterface.type != 0 || rsinterface.children == null || rsinterface.isMouseoverTriggered)
  1372. return;
  1373. if(xPos < xPadding || yPos < yPadding || xPos > xPadding + rsinterface.width || yPos > yPadding + rsinterface.height)
  1374. return;
  1375. int totalChildren = rsinterface.children.length;
  1376. for(int childIndex = 0; childIndex < totalChildren; childIndex++) {
  1377. int xSpritePos = rsinterface.childX[childIndex] + xPadding;
  1378. int ySpritePos = (rsinterface.childY[childIndex] + yPadding) - yScrollPoint;
  1379. RSInterface rsinterfacechildren = RSInterface.interfaceCache[rsinterface.children[childIndex]];
  1380. xSpritePos += rsinterfacechildren.anInt263;
  1381. ySpritePos += rsinterfacechildren.anInt265;
  1382. if((rsinterfacechildren.mOverInterToTrigger >= 0 || rsinterfacechildren.textHoverColour != 0)
  1383. && xPos >= xSpritePos
  1384. && xPos < xSpritePos + rsinterfacechildren.width
  1385. && yPos >= ySpritePos
  1386. && yPos < ySpritePos + rsinterfacechildren.height) {
  1387. if(rsinterfacechildren.mOverInterToTrigger >= 0) {
  1388. hoverChildId = rsinterfacechildren.mOverInterToTrigger;
  1389. hoverSpriteId = hoverChildId;
  1390. } else {
  1391. hoverChildId = rsinterfacechildren.id;
  1392. hoverSpriteId = hoverChildId;
  1393. }
  1394. }
  1395. if (rsinterfacechildren.type == 8 && xPos >= xSpritePos && xPos < xSpritePos + rsinterfacechildren.width && yPos >= ySpritePos && yPos < ySpritePos + rsinterfacechildren.height) {
  1396. hoverToggleChildId = rsinterfacechildren.id;//
  1397. }
  1398.  
  1399. if(rsinterfacechildren.type == 0)
  1400. {
  1401. buildInterfaceMenu(xSpritePos, rsinterfacechildren, xPos, ySpritePos, yPos, rsinterfacechildren.scrollPosition);
  1402. if(rsinterfacechildren.scrollMax > rsinterfacechildren.height)
  1403. method65(xSpritePos + rsinterfacechildren.width, rsinterfacechildren.height, xPos, yPos, rsinterfacechildren, ySpritePos, true, rsinterfacechildren.scrollMax);
  1404. } else
  1405. {
  1406. if(rsinterfacechildren.atActionType == 1 && xPos >= xSpritePos && yPos >= ySpritePos && xPos < xSpritePos + rsinterfacechildren.width && yPos < ySpritePos + rsinterfacechildren.height)
  1407. {
  1408. boolean flag = false;
  1409. if(rsinterfacechildren.contentType != 0)
  1410. flag = buildFriendsListMenu(rsinterfacechildren);
  1411. if(!flag)
  1412. {
  1413. menuActionName[menuActionRow] = rsinterfacechildren.tooltip + ((myPrivilege != 0) ? ", @gre@(@whi@" + rsinterfacechildren.id + "@gre@)" : "");
  1414. menuActionID[menuActionRow] = 315;
  1415. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1416. menuActionRow++;
  1417. }
  1418. }
  1419. if(rsinterfacechildren.atActionType == 2 && spellSelected == 0 && xPos >= xSpritePos && yPos >= ySpritePos && xPos < xSpritePos + rsinterfacechildren.width && yPos < ySpritePos + rsinterfacechildren.height) {
  1420. String s = rsinterfacechildren.selectedActionName;
  1421. if(s.indexOf(" ") != -1)
  1422. s = s.substring(0, s.indexOf(" "));
  1423. if (rsinterfacechildren.spellName.endsWith("Rush")
  1424. || rsinterfacechildren.spellName.endsWith("Burst")
  1425. || rsinterfacechildren.spellName.endsWith("Blitz")
  1426. || rsinterfacechildren.spellName.endsWith("Barrage") && !rsinterfacechildren.spellName.equals("Miasmic Barrage")) {
  1427. menuActionName[menuActionRow] = "Autocast @gre@" + rsinterfacechildren.spellName + ((myPrivilege != 0) ? ", " + rsinterfacechildren.id : "");
  1428. menuActionID[menuActionRow] = 104;
  1429. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1430. menuActionRow++;
  1431. }
  1432. menuActionName[menuActionRow] = s + " @gre@" + rsinterfacechildren.spellName + ((myPrivilege != 0) ? ", " + rsinterfacechildren.id : "");
  1433. menuActionID[menuActionRow] = 626;
  1434. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1435. menuActionRow++;
  1436. if (rsinterfacechildren.spellName.endsWith("strike")
  1437. || rsinterfacechildren.spellName.endsWith("bolt")
  1438. || rsinterfacechildren.spellName.equals("Crumble undead")
  1439. || rsinterfacechildren.spellName.endsWith("blast")
  1440. || rsinterfacechildren.spellName.endsWith("wave")
  1441. || rsinterfacechildren.spellName.equals("Claws of Guthix")
  1442. || rsinterfacechildren.spellName.equals("Flames of Zamorak")
  1443. || rsinterfacechildren.spellName.equals("Magic Dart")) {
  1444. menuActionName[menuActionRow] = "Autocast @gre@" + rsinterfacechildren.spellName + ((myPrivilege != 0) ? ", " + rsinterfacechildren.id : "");
  1445. menuActionID[menuActionRow] = 104;
  1446. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1447. menuActionRow++;
  1448. }
  1449. }
  1450. if(rsinterfacechildren.atActionType == 3 && xPos >= xSpritePos && yPos >= ySpritePos && xPos < xSpritePos + rsinterfacechildren.width && yPos < ySpritePos + rsinterfacechildren.height)
  1451. {
  1452. menuActionName[menuActionRow] = "Close" + ((myPrivilege != 0) ? ", " + rsinterfacechildren.id : "");
  1453. menuActionID[menuActionRow] = 200;
  1454. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1455. menuActionRow++;
  1456. }
  1457. if(rsinterfacechildren.atActionType == 4 && xPos >= xSpritePos && yPos >= ySpritePos && xPos < xSpritePos + rsinterfacechildren.width && yPos < ySpritePos + rsinterfacechildren.height) {
  1458. menuActionName[menuActionRow] = rsinterfacechildren.tooltip + ((myPrivilege != 0) ? ", @gre@(@whi@" + rsinterfacechildren.id + "@gre@)" : "");
  1459. menuActionID[menuActionRow] = 169;
  1460. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1461. menuActionRow++;
  1462. if (rsinterfacechildren.hoverText != null) {
  1463. //drawHoverBox(xPos, yPadding, rsinterfacechildren.hoverText);
  1464. //System.out.println("DRAWING INTERFACE: " + rsinterfacechildren.hoverText);
  1465. }
  1466. }
  1467. if(rsinterfacechildren.atActionType == 5 && xPos >= xSpritePos && yPos >= ySpritePos && xPos < xSpritePos + rsinterfacechildren.width && yPos < ySpritePos + rsinterfacechildren.height) {
  1468. if(rsinterfacechildren.tooltip.toLowerCase().startsWith("transform")) {
  1469. rsinterfacechildren.itemActions = new String[5];
  1470. rsinterfacechildren.itemActions[0] = "Transform";
  1471. rsinterfacechildren.itemActions[1] = "Transform-5";
  1472. rsinterfacechildren.itemActions[2] = "Transform-10";
  1473. rsinterfacechildren.itemActions[3] = "Transform-all";
  1474. rsinterfacechildren.itemActions[4] = "Transform-X";
  1475. if(rsinterfacechildren.itemActions != null) {
  1476. for(int j4 = 4; j4 >= 0; j4--)
  1477. if(rsinterfacechildren.itemActions[j4] != null) {
  1478. menuActionName[menuActionRow] = rsinterfacechildren.tooltip.replaceAll("Transform",rsinterfacechildren.itemActions[j4]);
  1479. if(j4 == 0)
  1480. menuActionID[menuActionRow] = 632;//1
  1481. if(j4 == 1)
  1482. menuActionID[menuActionRow] = 78;//5
  1483. if(j4 == 2)
  1484. menuActionID[menuActionRow] = 867;//10
  1485. if(j4 == 3)
  1486. menuActionID[menuActionRow] = 431;//all
  1487. if(j4 == 4)
  1488. menuActionID[menuActionRow] = 53;//x
  1489. menuActionCmd1[menuActionRow] = rsinterfacechildren.itemSpriteId1;
  1490. menuActionCmd2[menuActionRow] = rsinterfacechildren.itemSpriteIndex;
  1491. menuActionCmd3[menuActionRow] = rsinterfacechildren.parentID;
  1492. menuActionRow++;
  1493. }
  1494. }
  1495. } else {
  1496. menuActionName[menuActionRow] = rsinterfacechildren.tooltip + ((myPrivilege != 0) ? ", @gre@(@whi@" + rsinterfacechildren.id + "@gre@)" : "");
  1497. menuActionID[menuActionRow] = 646;
  1498. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1499. menuActionRow++;
  1500. }
  1501. }
  1502. if(rsinterfacechildren.atActionType == 6 && !aBoolean1149 && xPos >= xSpritePos && yPos >= ySpritePos && xPos < xSpritePos + rsinterfacechildren.width && yPos < ySpritePos + rsinterfacechildren.height)
  1503. {
  1504. menuActionName[menuActionRow] = rsinterfacechildren.tooltip + ((myPrivilege != 0) ? ", @gre@(@whi@" + rsinterfacechildren.id + "@gre@)" : "");
  1505. menuActionID[menuActionRow] = 679;
  1506. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1507. menuActionRow++;
  1508. }
  1509. if(rsinterfacechildren.type == 2)
  1510. {
  1511. int k2 = 0;
  1512. for(int l2 = 0; l2 < rsinterfacechildren.height; l2++)
  1513. {
  1514. for(int i3 = 0; i3 < rsinterfacechildren.width; i3++)
  1515. {
  1516. int j3 = xSpritePos + i3 * (32 + rsinterfacechildren.invSpritePadX);
  1517. int k3 = ySpritePos + l2 * (32 + rsinterfacechildren.invSpritePadY);
  1518. if(k2 < 20)
  1519. {
  1520. j3 += rsinterfacechildren.spritesX[k2];
  1521. k3 += rsinterfacechildren.spritesY[k2];
  1522. }
  1523. if(xPos >= j3 && yPos >= k3 && xPos < j3 + 32 && yPos < k3 + 32)
  1524. {
  1525. mouseInvInterfaceIndex = k2;
  1526. lastActiveInvInterface = rsinterfacechildren.id;
  1527. if(rsinterfacechildren.inv[k2] > 0)
  1528. {
  1529. ItemDef itemDef = ItemDef.forID(rsinterfacechildren.inv[k2] - 1);
  1530. if(itemSelected == 1 && rsinterfacechildren.isInventoryInterface)
  1531. {
  1532. if(rsinterfacechildren.id != anInt1284 || k2 != itemSlotUsedOn)
  1533. {
  1534. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1535. menuActionID[menuActionRow] = 870;
  1536. menuActionCmd1[menuActionRow] = itemDef.id;
  1537. menuActionCmd2[menuActionRow] = k2;
  1538. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1539. menuActionRow++;
  1540. }
  1541. } else
  1542. if(spellSelected == 1 && rsinterfacechildren.isInventoryInterface)
  1543. {
  1544. if((spellUsableOn & 0x10) == 16)
  1545. {
  1546. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1547. menuActionID[menuActionRow] = 543;
  1548. menuActionCmd1[menuActionRow] = itemDef.id;
  1549. menuActionCmd2[menuActionRow] = k2;
  1550. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1551. menuActionRow++;
  1552. }
  1553. } else
  1554. {
  1555. if(rsinterfacechildren.isInventoryInterface)
  1556. {
  1557. for(int l3 = 4; l3 >= 3; l3--)
  1558. if(itemDef.itemActions != null && itemDef.itemActions[l3] != null)
  1559. {
  1560. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1561. if(l3 == 3)
  1562. menuActionID[menuActionRow] = 493;
  1563. if(l3 == 4)
  1564. menuActionID[menuActionRow] = 847;
  1565. menuActionCmd1[menuActionRow] = itemDef.id;
  1566. menuActionCmd2[menuActionRow] = k2;
  1567. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1568. menuActionRow++;
  1569. } else
  1570. if(l3 == 4)
  1571. {
  1572. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1573. menuActionID[menuActionRow] = 847;
  1574. menuActionCmd1[menuActionRow] = itemDef.id;
  1575. menuActionCmd2[menuActionRow] = k2;
  1576. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1577. menuActionRow++;
  1578. }
  1579.  
  1580. }
  1581. if(rsinterfacechildren.usableItemInterface)
  1582. {
  1583. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1584. menuActionID[menuActionRow] = 447;
  1585. menuActionCmd1[menuActionRow] = itemDef.id;
  1586. //k2 = inventory spot
  1587. //System.out.println(k2);
  1588. menuActionCmd2[menuActionRow] = k2;
  1589. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1590. menuActionRow++;
  1591. }
  1592. if(rsinterfacechildren.isInventoryInterface && itemDef.itemActions != null)
  1593. {
  1594. for(int i4 = 2; i4 >= 0; i4--)
  1595. if(itemDef.itemActions[i4] != null)
  1596. {
  1597. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1598. if(i4 == 0)
  1599. menuActionID[menuActionRow] = 74;
  1600. if(i4 == 1)
  1601. menuActionID[menuActionRow] = 454;
  1602. if(i4 == 2)
  1603. menuActionID[menuActionRow] = 539;
  1604. menuActionCmd1[menuActionRow] = itemDef.id;
  1605. menuActionCmd2[menuActionRow] = k2;
  1606. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1607. menuActionRow++;
  1608. }
  1609.  
  1610. }
  1611. if(rsinterfacechildren.itemActions != null)
  1612. {
  1613. for(int j4 = 4; j4 >= 0; j4--)
  1614. if(rsinterfacechildren.itemActions[j4] != null)
  1615. {
  1616. menuActionName[menuActionRow] = rsinterfacechildren.itemActions[j4] + " @lre@" + itemDef.name;
  1617. if(j4 == 0)
  1618. menuActionID[menuActionRow] = 632;//1
  1619. if(j4 == 1)
  1620. menuActionID[menuActionRow] = 78;//5
  1621. if(j4 == 2)
  1622. menuActionID[menuActionRow] = 867;//10
  1623. if(j4 == 3)
  1624. menuActionID[menuActionRow] = 431;//all
  1625. if(j4 == 4)
  1626. menuActionID[menuActionRow] = 53;//x
  1627. menuActionCmd1[menuActionRow] = itemDef.id;
  1628. menuActionCmd2[menuActionRow] = k2;
  1629. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1630. menuActionRow++;
  1631. }
  1632.  
  1633. }
  1634. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + ((myPrivilege != 0) ? ", @gre@(@whi@" + (rsinterfacechildren.inv[k2] - 1) + "@gre@)" : "");
  1635. menuActionID[menuActionRow] = 1125;
  1636. menuActionCmd1[menuActionRow] = itemDef.id;
  1637. menuActionCmd2[menuActionRow] = k2;
  1638. menuActionCmd3[menuActionRow] = rsinterfacechildren.id;
  1639. menuActionRow++;
  1640. }
  1641. }
  1642. }
  1643. k2++;
  1644. }
  1645.  
  1646. }
  1647.  
  1648. }
  1649. }
  1650. }
  1651. } catch(NullPointerException ex) {
  1652.  
  1653. }
  1654. }
  1655.  
  1656. public void drawScrollbar(int totalHeight, int currentPos, int yPos, int xPos, int ScrollsTotalLength,boolean hdStyle) {
  1657. double repeats = (totalHeight - 32) / 5;
  1658. for(int i = 0; i <= repeats; i++)
  1659. scrollBar[0 + (hdStyle && toggleFullscreen ? 4 : 0)].drawSprite(xPos, (yPos + 16) + (i * 5));
  1660.  
  1661. int scrollLength = ((totalHeight - 32) * totalHeight) / ScrollsTotalLength;
  1662. if(scrollLength < 8)
  1663. scrollLength = 8;
  1664. int calcScrollPos = ((totalHeight - 32 - scrollLength) * currentPos) / (ScrollsTotalLength - totalHeight);
  1665.  
  1666. int frontStartY = (yPos + 16 + calcScrollPos);
  1667. int frontFinishY = (yPos + 16 + calcScrollPos + scrollLength - 5);
  1668. for(int frontY = frontStartY; frontY < frontFinishY; frontY += 5)
  1669. scrollBar[2 + (hdStyle && toggleFullscreen ? 4 : 0)].drawSprite(xPos, frontY);
  1670.  
  1671. scrollBar[1 + (hdStyle && toggleFullscreen ? 4 : 0)].drawSprite(xPos,frontStartY);
  1672. scrollBar[3 + (hdStyle && toggleFullscreen ? 4 : 0)].drawSprite(xPos,frontFinishY);
  1673. scrollArrow[0 + (hdStyle && toggleFullscreen ? 2 : 0)].drawSprite(xPos, yPos);
  1674. scrollArrow[1 + (hdStyle && toggleFullscreen ? 2 : 0)].drawSprite(xPos, (yPos + totalHeight) - 16);
  1675. }
  1676.  
  1677. private void updateNPCs(Stream stream, int i)
  1678. {
  1679. anInt839 = 0;
  1680. anInt893 = 0;
  1681. method139(stream);
  1682. method46(i, stream);
  1683. method86(stream);
  1684. for(int k = 0; k < anInt839; k++)
  1685. {
  1686. int l = anIntArray840[k];
  1687. if(npcArray[l].anInt1537 != loopCycle)
  1688. {
  1689. npcArray[l].desc = null;
  1690. npcArray[l] = null;
  1691. }
  1692. }
  1693.  
  1694. if(stream.currentOffset != i)
  1695. {
  1696. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1697. throw new RuntimeException("eek");
  1698. }
  1699. for(int i1 = 0; i1 < npcCount; i1++)
  1700. if(npcArray[npcIndices[i1]] == null)
  1701. {
  1702. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1703. throw new RuntimeException("eek");
  1704. }
  1705.  
  1706. }
  1707.  
  1708. private int cButtonHPos;
  1709. private int cButtonHCPos;
  1710. private int cButtonCPos;
  1711.  
  1712. private void processChatModeClick(int paddingX,int paddingY) {
  1713. int clickX = super.saveClickX - paddingX;
  1714. int clickY = super.saveClickY - paddingY;
  1715. int mouseX = super.mouseX - paddingX;
  1716. int mouseY = super.mouseY - paddingY;
  1717. if(mouseX >= 5 && mouseX <= 61 && mouseY >= 482 && mouseY <= 503) {
  1718. cButtonHPos = 0;
  1719. aBoolean1233 = true;
  1720. inputTaken = true;
  1721. } else if(mouseX >= 71 && mouseX <= 127 && mouseY >= 482 && mouseY <= 503) {
  1722. cButtonHPos = 1;
  1723. aBoolean1233 = true;
  1724. inputTaken = true;
  1725. } else if(mouseX >= 137 && mouseX <= 193 && mouseY >= 482 && mouseY <= 503) {
  1726. cButtonHPos = 2;
  1727. aBoolean1233 = true;
  1728. inputTaken = true;
  1729. } else if(mouseX >= 203 && mouseX <= 259 && mouseY >= 482 && mouseY <= 503) {
  1730. cButtonHPos = 3;
  1731. aBoolean1233 = true;
  1732. inputTaken = true;
  1733. } else if(mouseX >= 269 && mouseX <= 325 && mouseY >= 482 && mouseY <= 503) {
  1734. cButtonHPos = 4;
  1735. aBoolean1233 = true;
  1736. inputTaken = true;
  1737. } else if(mouseX >= 335 && mouseX <= 391 && mouseY >= 482 && mouseY <= 503) {
  1738. cButtonHPos = 5;
  1739. aBoolean1233 = true;
  1740. inputTaken = true;
  1741. } else if(mouseX >= 404 && mouseX <= 515 && mouseY >= 482 && mouseY <= 503) {
  1742. cButtonHPos = 6;
  1743. aBoolean1233 = true;
  1744. inputTaken = true;
  1745. } else {
  1746. cButtonHPos = -1;
  1747. aBoolean1233 = true;
  1748. inputTaken = true;
  1749. }
  1750. if(super.clickMode3 == 1) {
  1751. if(clickX >= 5 && clickX <= 61 && clickY >= 482 && clickY <= 505) {
  1752. cButtonCPos = 0;
  1753. chatTypeView = 0;
  1754. aBoolean1233 = true;
  1755. inputTaken = true;
  1756. } else if(clickX >= 71 && clickX <= 127 && clickY >= 482 && clickY <= 505) {
  1757. cButtonCPos = 1;
  1758. chatTypeView = 5;
  1759. aBoolean1233 = true;
  1760. inputTaken = true;
  1761. } else if(clickX >= 137 && clickX <= 193 && clickY >= 482 && clickY <= 505) {
  1762. cButtonCPos = 2;
  1763. chatTypeView = 1;
  1764. aBoolean1233 = true;
  1765. inputTaken = true;
  1766. } else if(clickX >= 203 && clickX <= 259 && clickY >= 482 && clickY <= 505) {
  1767. cButtonCPos = 3;
  1768. chatTypeView = 2;
  1769. aBoolean1233 = true;
  1770. inputTaken = true;
  1771. } else if(clickX >= 269 && clickX <= 325 && clickY >= 482 && clickY <= 505) {
  1772. cButtonCPos = 4;
  1773. chatTypeView = 11;
  1774. aBoolean1233 = true;
  1775. inputTaken = true;
  1776. } else if(clickX >= 335 && clickX <= 391 && clickY >= 482 && clickY <= 505) {
  1777. cButtonCPos = 5;
  1778. chatTypeView = 3;
  1779. aBoolean1233 = true;
  1780. inputTaken = true;
  1781. } else if(clickX >= 404 && clickX <= 515 && clickY >= 482 && clickY <= 505) {
  1782. if(openInterfaceID == -1 && myPrivilege >= 1) {
  1783. clearTopInterfaces();
  1784. reportAbuseInput = "";
  1785. canMute = false;
  1786. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1787. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1788. continue;
  1789. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1790. break;
  1791. }
  1792. } else {
  1793. pushMessage("Staff Pannel Is Disabled for you! Sorry :L", 0, "");
  1794. }
  1795. }
  1796. }
  1797. }
  1798.  
  1799. private void method33(int i)
  1800. {
  1801. int j = Varp.cache[i].anInt709;
  1802. if(j == 0)
  1803. return;
  1804. int k = variousSettings[i];
  1805. if(j == 1)
  1806. {
  1807. if(k == 1)
  1808. Texture.method372(0.90000000000000002D);
  1809. if(k == 2)
  1810. Texture.method372(0.80000000000000004D);
  1811. if(k == 3)
  1812. Texture.method372(0.69999999999999996D);
  1813. if(k == 4)
  1814. Texture.method372(0.59999999999999998D);
  1815. ItemDef.mruNodes1.unlinkAll();
  1816. welcomeScreenRaised = true;
  1817. }
  1818. if(j == 3)
  1819. {
  1820. boolean flag1 = musicEnabled;
  1821. if(k == 0)
  1822. {
  1823. adjustVolume(musicEnabled, 0);
  1824. musicEnabled = true;
  1825. }
  1826. if(k == 1)
  1827. {
  1828. adjustVolume(musicEnabled, -400);
  1829. musicEnabled = true;
  1830. }
  1831. if(k == 2)
  1832. {
  1833. adjustVolume(musicEnabled, -800);
  1834. musicEnabled = true;
  1835. }
  1836. if(k == 3)
  1837. {
  1838. adjustVolume(musicEnabled, -1200);
  1839. musicEnabled = true;
  1840. }
  1841. if(k == 4)
  1842. musicEnabled = false;
  1843. if(musicEnabled != flag1 && !lowMem)
  1844. {
  1845. if(musicEnabled)
  1846. {
  1847. nextSong = currentSong;
  1848. songChanging = true;
  1849. onDemandFetcher.method558(2, nextSong);
  1850. } else
  1851. {
  1852. stopMidi();
  1853. }
  1854. prevSong = 0;
  1855. }
  1856. }
  1857. if(j == 4)
  1858. {
  1859. if(k == 0)
  1860. {
  1861. aBoolean848 = true;
  1862. setWaveVolume(0);
  1863. }
  1864. if(k == 1)
  1865. {
  1866. aBoolean848 = true;
  1867. setWaveVolume(-400);
  1868. }
  1869. if(k == 2)
  1870. {
  1871. aBoolean848 = true;
  1872. setWaveVolume(-800);
  1873. }
  1874. if(k == 3)
  1875. {
  1876. aBoolean848 = true;
  1877. setWaveVolume(-1200);
  1878. }
  1879. if(k == 4)
  1880. aBoolean848 = false;
  1881. }
  1882. if(j == 5)
  1883. anInt1253 = k;
  1884. if(j == 6)
  1885. anInt1249 = k;
  1886. if(j == 8)
  1887. {
  1888. splitPrivateChat = k;
  1889. inputTaken = true;
  1890. }
  1891. if(j == 9)
  1892. anInt913 = k;
  1893. }
  1894.  
  1895. private void updateEntities() {
  1896. try{
  1897. int anInt974 = 0;
  1898. for(int j = -1; j < playerCount + npcCount; j++) {
  1899. Object obj;
  1900. if(j == -1)
  1901. obj = myPlayer;
  1902. else
  1903. if(j < playerCount)
  1904. obj = playerArray[playerIndices[j]];
  1905. else
  1906. obj = npcArray[npcIndices[j - playerCount]];
  1907. if(obj == null || !((Entity) (obj)).isVisible())
  1908. continue;
  1909. if(obj instanceof NPC) {
  1910. EntityDef entityDef = ((NPC)obj).desc;
  1911. if(entityDef.childrenIDs != null)
  1912. entityDef = entityDef.method161();
  1913. if(entityDef == null)
  1914. continue;
  1915. }
  1916. if(j < playerCount) {
  1917. int l = 30;
  1918. Player player = (Player)obj;
  1919. if(player.headIcon >= 0) {
  1920. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1921. if(spriteDrawX > -1) {
  1922. if (player.skullIcon < 2) {
  1923. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1924. l += 25;
  1925. }
  1926. if (player.headIcon < 18) {
  1927. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1928. l += 18;
  1929. }
  1930. }
  1931. }
  1932. if(j >= 0 && hintType == 10 && hintArrowPlayerID == playerIndices[j]) {
  1933. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1934. if(spriteDrawX > -1)
  1935. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1936. }
  1937. } else {
  1938. EntityDef entityDef_1 = ((NPC)obj).desc;
  1939. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1940. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1941. if(spriteDrawX > -1)
  1942. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1943. }
  1944. if(hintType == 1 && hintArrowNPCID == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1945. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1946. if(spriteDrawX > -1)
  1947. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1948. }
  1949. }
  1950. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1951. {
  1952. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1953. if(spriteDrawX > -1 && anInt974 < anInt975)
  1954. {
  1955. anIntArray979[anInt974] = boldFont.method384(((Entity) (obj)).textSpoken) / 2;
  1956. anIntArray978[anInt974] = boldFont.anInt1497;
  1957. anIntArray976[anInt974] = spriteDrawX;
  1958. anIntArray977[anInt974] = spriteDrawY;
  1959. anIntArray980[anInt974] = ((Entity)(Entity)obj).anInt1513;
  1960. anIntArray981[anInt974] = ((Entity)(Entity)obj).anInt1531;
  1961. anIntArray982[anInt974] = ((Entity)(Entity)obj).textCycle;
  1962. aStringArray983[anInt974++] = ((Entity)(Entity)obj).textSpoken;
  1963. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1964. {
  1965. anIntArray978[anInt974] += 10;
  1966. anIntArray977[anInt974] += 5;
  1967. }
  1968. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1969. anIntArray979[anInt974] = 60;
  1970. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1971. anIntArray978[anInt974] += 5;
  1972. }
  1973. }
  1974. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1975. {
  1976. try{
  1977. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1978. if(spriteDrawX > -1)
  1979. {
  1980. if(healthBars) {
  1981. int amount = 56;
  1982. int j2 = (((Entity)(Entity)obj).currentHealth * amount) / ((Entity)(Entity)obj).maxHealth;
  1983. if(j2 > amount)
  1984. j2 = amount;
  1985. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  1986. HPBarFull = new Sprite("HITPOINTS_0", j2, 7);
  1987. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  1988. } else {
  1989. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1990. if(i1 > 30)
  1991. i1 = 30;
  1992. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1993. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1994. }
  1995. }
  1996. }catch(Exception ex){ }
  1997. }
  1998. for(int j1 = 0; j1 < 4; j1++)
  1999. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2000. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2001. if(spriteDrawX > -1) {
  2002. //spriteDrawY = 20 +
  2003. switch (j1) {
  2004. case 1:
  2005. spriteDrawY += 20;
  2006. break;
  2007. case 2:
  2008. spriteDrawY += 25;
  2009. break;
  2010. case 3:
  2011. spriteDrawY += 45;
  2012. break;
  2013. }
  2014. Entity e = ((Entity) (obj));
  2015. if (e.hitmarkMove[j1] > -30) {
  2016. e.hitmarkMove[j1]--;
  2017. if (e.hitmarkTrans[j1] > 0)
  2018. e.hitmarkTrans[j1] -= 5;
  2019. hitmarkDraw(e,String.valueOf(e.hitMarkDamage[j1]).length(), e.hitMarkTypes[j1], e.hitmarkIcon[j1], e.hitMarkDamage[j1], e.hitmarkMove[j1], e.hitmarkTrans[j1], e.hitMarkFocusPlayer[j1], e.hitMarkFocusNPC[j1]);
  2020. }
  2021. }
  2022. }
  2023. }
  2024. for(int k = 0; k < anInt974; k++) {
  2025. int k1 = anIntArray976[k];
  2026. int l1 = anIntArray977[k];
  2027. int j2 = anIntArray979[k];
  2028. int k2 = anIntArray978[k];
  2029. boolean flag = true;
  2030. while(flag)
  2031. {
  2032. flag = false;
  2033. for(int l2 = 0; l2 < k; l2++)
  2034. 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)
  2035. {
  2036. l1 = anIntArray977[l2] - anIntArray978[l2];
  2037. flag = true;
  2038. }
  2039.  
  2040. }
  2041. spriteDrawX = anIntArray976[k];
  2042. spriteDrawY = anIntArray977[k] = l1;
  2043. String s = aStringArray983[k];
  2044. if(anInt1249 == 0)
  2045. {
  2046. int i3 = 0xffff00;
  2047. if(anIntArray980[k] < 6)
  2048. i3 = anIntArray965[anIntArray980[k]];
  2049. if(anIntArray980[k] == 6)
  2050. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2051. if(anIntArray980[k] == 7)
  2052. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2053. if(anIntArray980[k] == 8)
  2054. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2055. if(anIntArray980[k] == 9) {
  2056. int j3 = 150 - anIntArray982[k];
  2057. if(j3 < 50)
  2058. i3 = 0xff0000 + 1280 * j3;
  2059. else
  2060. if(j3 < 100)
  2061. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2062. else
  2063. if(j3 < 150)
  2064. i3 = 65280 + 5 * (j3 - 100);
  2065. }
  2066. if(anIntArray980[k] == 10) {
  2067. int k3 = 150 - anIntArray982[k];
  2068. if(k3 < 50)
  2069. i3 = 0xff0000 + 5 * k3;
  2070. else
  2071. if(k3 < 100)
  2072. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2073. else
  2074. if(k3 < 150)
  2075. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2076. }
  2077. if(anIntArray980[k] == 11) {
  2078. int l3 = 150 - anIntArray982[k];
  2079. if(l3 < 50)
  2080. i3 = 0xffffff - 0x50005 * l3;
  2081. else
  2082. if(l3 < 100)
  2083. i3 = 65280 + 0x50005 * (l3 - 50);
  2084. else
  2085. if(l3 < 150)
  2086. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2087. }
  2088. if(anIntArray981[k] == 0) {
  2089. boldFont.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2090. boldFont.drawText(i3, s, spriteDrawY, spriteDrawX);
  2091. }
  2092. if(anIntArray981[k] == 1) {
  2093. boldFont.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2094. boldFont.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2095. }
  2096. if(anIntArray981[k] == 2) {
  2097. boldFont.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2098. boldFont.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2099. }
  2100. if(anIntArray981[k] == 3) {
  2101. boldFont.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2102. boldFont.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2103. }
  2104. if(anIntArray981[k] == 4) {
  2105. int i4 = boldFont.method384(s);
  2106. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2107. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2108. boldFont.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2109. boldFont.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2110. DrawingArea.defaultDrawingAreaSize();
  2111. }
  2112. if(anIntArray981[k] == 5) {
  2113. int j4 = 150 - anIntArray982[k];
  2114. int l4 = 0;
  2115. if(j4 < 25)
  2116. l4 = j4 - 25;
  2117. else
  2118. if(j4 > 125)
  2119. l4 = j4 - 125;
  2120. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - boldFont.anInt1497 - 1);
  2121. boldFont.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2122. boldFont.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2123. DrawingArea.defaultDrawingAreaSize();
  2124. }
  2125. } else {
  2126. boldFont.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2127. boldFont.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2128. }
  2129. }
  2130. } catch(Exception e){ }
  2131. }
  2132.  
  2133. private void delFriend(long l)
  2134. {
  2135. try
  2136. {
  2137. if(l == 0L)
  2138. return;
  2139. for(int i = 0; i < friendsCount; i++)
  2140. {
  2141. if(friendsListAsLongs[i] != l)
  2142. continue;
  2143. friendsCount--;
  2144. needDrawTabArea = true;
  2145. for(int j = i; j < friendsCount; j++)
  2146. {
  2147. friendsList[j] = friendsList[j + 1];
  2148. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2149. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2150. }
  2151.  
  2152. stream.createFrame(215);
  2153. stream.writeQWord(l);
  2154. break;
  2155. }
  2156. }
  2157. catch(RuntimeException runtimeexception)
  2158. {
  2159. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2160. throw new RuntimeException();
  2161. }
  2162. }
  2163.  
  2164. private void drawIventoryStones(int paddingX,int paddingY) {
  2165. paddingX = paddingX + 2;//tabSpace
  2166. if(toggleFullscreen) {
  2167. inventoryStones[2].drawSprite(1 + paddingX, 261 + paddingY);
  2168. inventoryStones[2].drawSprite(31 + paddingX, 261 + paddingY);
  2169. inventoryStones[2].drawSprite(61 + paddingX, 261 + paddingY);
  2170. inventoryStones[2].drawSprite(91 + paddingX, 261 + paddingY);
  2171. inventoryStones[2].drawSprite(121 + paddingX, 261 + paddingY);
  2172. inventoryStones[2].drawSprite(151 + paddingX, 261 + paddingY);
  2173. inventoryStones[2].drawSprite(181 + paddingX, 261 + paddingY);
  2174. inventoryStones[2].drawSprite(211 + paddingX, 261 + paddingY);
  2175.  
  2176. inventoryStones[2].drawSprite(1 + paddingX, 298 + paddingY);
  2177. inventoryStones[2].drawSprite(31 + paddingX, 298 + paddingY);
  2178. inventoryStones[2].drawSprite(61 + paddingX, 298 + paddingY);
  2179. inventoryStones[2].drawSprite(91 + paddingX, 298 + paddingY);
  2180. inventoryStones[2].drawSprite(121 + paddingX, 298 + paddingY);
  2181. inventoryStones[2].drawSprite(151 + paddingX, 298 + paddingY);
  2182. inventoryStones[2].drawSprite(181 + paddingX,298 + paddingY);
  2183. inventoryStones[2].drawSprite(211 + paddingX, 298 + paddingY);
  2184. }
  2185. //if(!contextMenuOpen) {
  2186. if(tabInterfaceIDs[0] != -1)
  2187. inventoryStones[tabIDHover == 0 ? 1 : 2].drawSprite(1 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2188. if(tabInterfaceIDs[14] != -1)
  2189. inventoryStones[tabIDHover == 1 ? 1 : 2].drawSprite(31 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2190. if(tabInterfaceIDs[1] != -1)
  2191. inventoryStones[tabIDHover == 2 ? 1 : 2].drawSprite(61 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2192. if(tabInterfaceIDs[2] != -1)
  2193. inventoryStones[tabIDHover == 3 ? 1 : 2].drawSprite(91 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2194. if(tabInterfaceIDs[3] != -1)
  2195. inventoryStones[tabIDHover == 4 ? 1 : 2].drawSprite(121 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2196. if(tabInterfaceIDs[4] != -1)
  2197. inventoryStones[tabIDHover == 5 ? 1 : 2].drawSprite(151 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2198. if(tabInterfaceIDs[5] != -1)
  2199. inventoryStones[tabIDHover == 6 ? 1 : 2].drawSprite(181 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2200. if(tabInterfaceIDs[6] != -1)
  2201. inventoryStones[tabIDHover == 7 ? 1 : 2].drawSprite(211 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2202.  
  2203. if(tabInterfaceIDs[16] != -1)
  2204. inventoryStones[tabIDHover == 14 ? 1 : 2].drawSprite(1 + paddingX, 298 + paddingY);
  2205. if(tabInterfaceIDs[9] != -1)
  2206. inventoryStones[tabIDHover == 8 ? 1 : 2].drawSprite(31 + paddingX, 298 + paddingY);
  2207. if(tabInterfaceIDs[8] != -1)
  2208. inventoryStones[tabIDHover == 9 ? 1 : 2].drawSprite(61 + paddingX, 298 + paddingY);
  2209. if(tabInterfaceIDs[7] != -1)
  2210. inventoryStones[tabIDHover == 10 ? 1 : 2].drawSprite(91 + paddingX, 298 + paddingY);
  2211. if(tabInterfaceIDs[11] != -1)
  2212. inventoryStones[tabIDHover == 11 ? 1 : 2].drawSprite(121 + paddingX, 298 + paddingY);
  2213. if(tabInterfaceIDs[12] != -1)
  2214. inventoryStones[tabIDHover == 12 ? 1 : 2].drawSprite(151 + paddingX, 298 + paddingY);
  2215. if(tabInterfaceIDs[13] != -1)
  2216. inventoryStones[tabIDHover == 13 ? 1 : 2].drawSprite(181 + paddingX,298 + paddingY);
  2217. if(tabInterfaceIDs[15] != -1)
  2218. inventoryStones[tabIDHover == 15 ? 1 : 2].drawSprite(211 + paddingX, 298 + paddingY);
  2219. //}
  2220. if(invOverlayInterfaceID == -1 && focusTab != -1) {
  2221. try {
  2222. if(tabInterfaceIDs[tabID] != -1) {
  2223. if(tabID == 0)
  2224. inventoryStones[0].drawSprite(1 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2225. if(tabID == 14)
  2226. inventoryStones[0].drawSprite(31 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2227. if(tabID == 1)
  2228. inventoryStones[0].drawSprite(61 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2229. if(tabID == 2)
  2230. inventoryStones[0].drawSprite(91 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2231. if(tabID == 3)
  2232. inventoryStones[0].drawSprite(121 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2233. if(tabID == 4)
  2234. inventoryStones[0].drawSprite(151 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2235. if(tabID == 5)
  2236. inventoryStones[0].drawSprite(181 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2237. if(tabID == 6)
  2238. inventoryStones[0].drawSprite(211 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  2239. if(tabID == 16)
  2240. inventoryStones[0].drawSprite(1 + paddingX, 298 + paddingY);
  2241. if(tabID == 8)
  2242. inventoryStones[0].drawSprite(31 + paddingX, 298 + paddingY);
  2243. if(tabID == 9)
  2244. inventoryStones[0].drawSprite(61 + paddingX, 298 + paddingY);
  2245. if(tabID == 7)
  2246. inventoryStones[0].drawSprite(91 + paddingX, 298 + paddingY);
  2247. if(tabID == 11)
  2248. inventoryStones[0].drawSprite(121 + paddingX, 298 + paddingY);
  2249. if(tabID == 12)
  2250. inventoryStones[0].drawSprite(151 + paddingX, 298 + paddingY);
  2251. if(tabID == 13)
  2252. inventoryStones[0].drawSprite(181 + paddingX, 298 + paddingY);
  2253. if(tabID == 15)
  2254. inventoryStones[0].drawSprite(211 + paddingX, 298 + paddingY);
  2255. }
  2256. } catch(Exception e) { tabID = 1; }
  2257. }
  2258. }
  2259.  
  2260. private void drawSideIcons(int paddingX, int paddingY) {
  2261. if(tabIconFlash != -1)
  2262. tabAreaAltered = true;
  2263. if(tabAreaAltered) {
  2264. if(tabIconFlash != -1 && tabIconFlash == tabID) {
  2265. tabIconFlash = -1;
  2266. stream.createFrame(120);
  2267. stream.writeWordBigEndian(tabID);
  2268. }
  2269. tabAreaAltered = false;
  2270. }
  2271. if(invOverlayInterfaceID == -1) {
  2272. if(tabInterfaceIDs[0] != -1 && (tabIconFlash != 0 || loopCycle % 20 < 10))
  2273. sideIcons[0].drawSprite(3 + 5 + paddingX, (toggleFullscreen ? 261 : 0) + 9 + paddingY);//Combat
  2274. if(tabInterfaceIDs[14] != -1 && (tabIconFlash != 1 || loopCycle % 20 < 10))
  2275. sideIcons[3].drawSprite(33 + 4 + paddingX, (toggleFullscreen ? 261 : 0) + 9 + paddingY);//skills
  2276. if(tabInterfaceIDs[1] != -1 && (tabIconFlash != 2 || loopCycle % 20 < 10))
  2277. sideIcons[1].drawSprite(63 + 4 + paddingX, (toggleFullscreen ? 261 : 0) + 8 + paddingY);//quests
  2278. if(tabInterfaceIDs[2] != -1 && (tabIconFlash != 14 || loopCycle % 20 < 10))
  2279. sideIcons[2].drawSprite(93 + 4 + paddingX, (toggleFullscreen ? 261 : 0) + 8 + paddingY);//task system
  2280. if(tabInterfaceIDs[3] != -1 && (tabIconFlash != 3 || loopCycle % 20 < 10))
  2281. sideIcons[4].drawSprite(123 + 4 + paddingX, (toggleFullscreen ? 261 : 0) + 9 + paddingY);//inventory
  2282. if(tabInterfaceIDs[4] != -1 && (tabIconFlash != 4 || loopCycle % 20 < 10))
  2283. sideIcons[5].drawSprite(153 + 6 + paddingX, (toggleFullscreen ? 261 : 0) + 8 + paddingY);//equipment
  2284. if(tabInterfaceIDs[5] != -1 && (tabIconFlash != 5 || loopCycle % 20 < 10))
  2285. sideIcons[6].drawSprite(183 + 4 + paddingX, (toggleFullscreen ? 261 : 0) + 9 + paddingY);//prayer
  2286. if(tabInterfaceIDs[6] != -1 && (tabIconFlash != 6 || loopCycle % 20 < 10))
  2287. sideIcons[7].drawSprite(213 + 4 + paddingX, (toggleFullscreen ? 261 : 0) + 9 + paddingY);//magic
  2288.  
  2289. if(tabInterfaceIDs[14] != -1 && (tabIconFlash != 7 || loopCycle % 20 < 10))
  2290. sideIcons[8].drawSprite(3 + 4 + paddingX, 298 + 10 + paddingY);//Guide
  2291. if(tabInterfaceIDs[9] != -1 && (tabIconFlash != 9 || loopCycle % 20 < 10))
  2292. sideIcons[9].drawSprite(33 + 5 + paddingX, 298 + 9 + paddingY);//friends
  2293. if(tabInterfaceIDs[8] != -1 && (tabIconFlash != 8 || loopCycle % 20 < 10))
  2294. sideIcons[10].drawSprite(63 + 7 + paddingX, 298 + 9 + paddingY);//ignore
  2295. if(tabInterfaceIDs[7] != -1 && (tabIconFlash != 7 || loopCycle % 20 < 10))
  2296. sideIcons[11].drawSprite(93 + 4 + paddingX, 298 + 10 + paddingY);//clan
  2297. if(tabInterfaceIDs[11] != -1 && (tabIconFlash != 11 || loopCycle % 20 < 10))
  2298. sideIcons[12].drawSprite(123 + 4 + paddingX, 298 + 9 + paddingY);//option
  2299. if(tabInterfaceIDs[12] != -1 && (tabIconFlash != 12 || loopCycle % 20 < 10))
  2300. sideIcons[13].drawSprite(153 + 4 + paddingX, 298 + 9 + paddingY);//emotes
  2301. if(tabInterfaceIDs[13] != -1 && (tabIconFlash != 13 || loopCycle % 20 < 10))
  2302. sideIcons[14].drawSprite(183 + 3 + paddingX, 298 + 8 + paddingY);//music
  2303. if(tabInterfaceIDs[15] != -1 && (tabIconFlash != 15 || loopCycle % 20 < 10))
  2304. sideIcons[15].drawSprite(213 + 4 + paddingX, 298 + 11 + paddingY);//notes
  2305. }
  2306. }
  2307.  
  2308. private void drawTabArea(RSImageProducer tabImage, int paddingX,int paddingY) {
  2309. tabImage.initDrawingArea();
  2310. Texture.anIntArray1472 = anIntArray1181;
  2311. if(toggleFullscreen) {
  2312. if(focusTab != -1)
  2313. tabAreaSprite[1].drawSprite1(45-23 + paddingX ,55-23 + paddingY - (toggleFullscreen ? 46 : 0),192);
  2314. } else
  2315. tabAreaSprite[0].drawSprite(0 + paddingX,0 + paddingY);
  2316.  
  2317. drawIventoryStones(paddingX,paddingY);
  2318. drawSideIcons(paddingX,paddingY);
  2319.  
  2320. if(invOverlayInterfaceID != -1)
  2321. drawInterface(0, 28 + paddingX, RSInterface.interfaceCache[invOverlayInterfaceID], 37 - (toggleFullscreen ? 46 : 0) + paddingY);
  2322. else if(tabInterfaceIDs[tabID] != -1 && focusTab != -1)
  2323. drawInterface(0, 28 + paddingX, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37 - (toggleFullscreen ? 46 : 0) + paddingY);
  2324. if(contextMenuOpen && !toggleFullscreen)
  2325. drawMenu(519, 168);//Tab area
  2326. Texture.anIntArray1472 = anIntArray1182;
  2327. }
  2328.  
  2329. private void drawRightFrameArea() {
  2330. rightFrame.initDrawingArea();
  2331. rightFrameSprite.drawSprite(0,0);
  2332. if(contextMenuOpen && !toggleFullscreen) {
  2333. drawMenu(516, 168);
  2334. }
  2335. rightFrame.drawGraphics(168, super.graphics, 516);
  2336. main3DArea.initDrawingArea();
  2337. }
  2338.  
  2339. private void method37(int j) {
  2340. if(Texture.anIntArray1480[17] >= j) {
  2341. Background background = Texture.aBackgroundArray1474s[17];
  2342. int k = background.anInt1452 * background.anInt1453 - 1;
  2343. //fire cape apparently?
  2344. int j1 = background.anInt1452 * anInt945 * 2;
  2345. byte abyte0[] = background.aByteArray1450;
  2346. byte abyte3[] = aByteArray912;
  2347. for(int i2 = 0; i2 <= k; i2++)
  2348. abyte3[i2] = abyte0[i2 - j1 & k];
  2349.  
  2350. background.aByteArray1450 = abyte3;
  2351. aByteArray912 = abyte0;
  2352. Texture.method370(17);
  2353. anInt854++;
  2354. if(anInt854 > 1235) {
  2355. anInt854 = 0;
  2356. stream.createFrame(226);
  2357. stream.writeWordBigEndian(0);
  2358. int l2 = stream.currentOffset;
  2359. stream.writeWord(58722);
  2360. stream.writeWordBigEndian(240);
  2361. stream.writeWord((int)(Math.random() * 65536D));
  2362. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2363. if((int)(Math.random() * 2D) == 0)
  2364. stream.writeWord(51825);
  2365. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2366. stream.writeWord((int)(Math.random() * 65536D));
  2367. stream.writeWord(7130);
  2368. stream.writeWord((int)(Math.random() * 65536D));
  2369. stream.writeWord(61657);
  2370. stream.writeBytes(stream.currentOffset - l2);
  2371. }
  2372. }
  2373. if(Texture.anIntArray1480[24] >= j) {
  2374. Background background_1 = Texture.aBackgroundArray1474s[24];
  2375. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2376. int k1 = background_1.anInt1452 * anInt945 * 2;
  2377. byte abyte1[] = background_1.aByteArray1450;
  2378. byte abyte4[] = aByteArray912;
  2379. for(int j2 = 0; j2 <= l; j2++)
  2380. abyte4[j2] = abyte1[j2 - k1 & l];
  2381.  
  2382. background_1.aByteArray1450 = abyte4;
  2383. aByteArray912 = abyte1;
  2384. Texture.method370(24);
  2385. }
  2386. if(Texture.anIntArray1480[34] >= j) {
  2387. Background background_2 = Texture.aBackgroundArray1474s[34];
  2388. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2389. int l1 = background_2.anInt1452 * anInt945 * 2;
  2390. byte abyte2[] = background_2.aByteArray1450;
  2391. byte abyte5[] = aByteArray912;
  2392. for(int k2 = 0; k2 <= i1; k2++)
  2393. abyte5[k2] = abyte2[k2 - l1 & i1];
  2394.  
  2395. background_2.aByteArray1450 = abyte5;
  2396. aByteArray912 = abyte2;
  2397. Texture.method370(34);
  2398. }
  2399. if(Texture.anIntArray1480[40] >= j)
  2400. {
  2401. Background background_2 = Texture.aBackgroundArray1474s[40];
  2402. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2403. int l1 = background_2.anInt1452 * anInt945 * 1;
  2404. byte abyte2[] = background_2.aByteArray1450;
  2405. byte abyte5[] = aByteArray912;
  2406. for(int k2 = 0; k2 <= i1; k2++)
  2407. abyte5[k2] = abyte2[k2 - l1 & i1];
  2408.  
  2409. background_2.aByteArray1450 = abyte5;
  2410. aByteArray912 = abyte2;
  2411. Texture.method370(40);
  2412. }
  2413.  
  2414. }
  2415.  
  2416. private void method38() {
  2417. for(int i = -1; i < playerCount; i++) {
  2418. int j;
  2419. if(i == -1)
  2420. j = myPlayerIndex;
  2421. else
  2422. j = playerIndices[i];
  2423. Player player = playerArray[j];
  2424. if(player != null && player.textCycle > 0) {
  2425. player.textCycle--;
  2426. if(player.textCycle == 0)
  2427. player.textSpoken = null;
  2428. }
  2429. }
  2430. for(int k = 0; k < npcCount; k++) {
  2431. int l = npcIndices[k];
  2432. NPC npc = npcArray[l];
  2433. if(npc != null && npc.textCycle > 0) {
  2434. npc.textCycle--;
  2435. if(npc.textCycle == 0)
  2436. npc.textSpoken = null;
  2437. }
  2438. }
  2439. }
  2440.  
  2441. private void calcCameraPos() {
  2442. int i = anInt1098 * 128 + 64;
  2443. int j = anInt1099 * 128 + 64;
  2444. int k = method42(plane, j, i) - anInt1100;
  2445. if(xCameraPos < i) {
  2446. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2447. if(xCameraPos > i)
  2448. xCameraPos = i;
  2449. }
  2450. if(xCameraPos > i) {
  2451. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2452. if(xCameraPos < i)
  2453. xCameraPos = i;
  2454. }
  2455. if(zCameraPos < k) {
  2456. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2457. if(zCameraPos > k)
  2458. zCameraPos = k;
  2459. }
  2460. if(zCameraPos > k) {
  2461. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2462. if(zCameraPos < k)
  2463. zCameraPos = k;
  2464. }
  2465. if(yCameraPos < j) {
  2466. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2467. if(yCameraPos > j)
  2468. yCameraPos = j;
  2469. }
  2470. if(yCameraPos > j) {
  2471. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2472. if(yCameraPos < j)
  2473. yCameraPos = j;
  2474. }
  2475. i = anInt995 * 128 + 64;
  2476. j = anInt996 * 128 + 64;
  2477. k = method42(plane, j, i) - anInt997;
  2478. int l = i - xCameraPos;
  2479. int i1 = k - zCameraPos;
  2480. int j1 = j - yCameraPos;
  2481. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2482. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2483. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2484. if(l1 < 128)
  2485. l1 = 128;
  2486. if(l1 > 383)
  2487. l1 = 383;
  2488. if(yCameraCurve < l1) {
  2489. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2490. if(yCameraCurve > l1)
  2491. yCameraCurve = l1;
  2492. }
  2493. if(yCameraCurve > l1) {
  2494. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2495. if(yCameraCurve < l1)
  2496. yCameraCurve = l1;
  2497. }
  2498. int j2 = i2 - xCameraCurve;
  2499. if(j2 > 1024)
  2500. j2 -= 2048;
  2501. if(j2 < -1024)
  2502. j2 += 2048;
  2503. if(j2 > 0) {
  2504. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2505. xCameraCurve &= 0x7ff;
  2506. }
  2507. if(j2 < 0) {
  2508. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2509. xCameraCurve &= 0x7ff;
  2510. }
  2511. int k2 = i2 - xCameraCurve;
  2512. if(k2 > 1024)
  2513. k2 -= 2048;
  2514. if(k2 < -1024)
  2515. k2 += 2048;
  2516. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2517. xCameraCurve = i2;
  2518. }
  2519.  
  2520. private void drawMenu(int xOffSet, int yOffSet) {
  2521. int xPos = menuOffsetX - (xOffSet - 4);
  2522. int yPos = (-yOffSet + 4) + menuOffsetY;
  2523. int menuW = menuWidth;
  2524. int menuH = menuHeight + 1;
  2525. needDrawTabArea = true;
  2526. inputTaken = true;
  2527. tabAreaAltered = true;
  2528. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2529. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2530. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  2531. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e, menuW - 2);
  2532. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  2533. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822, menuW - 6);
  2534. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822, menuW - 4);
  2535. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822, menuW - 2);
  2536. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d, menuW - 4);
  2537. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d, menuW - 6);
  2538. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c, menuW - 6);
  2539. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  2540. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  2541. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  2542. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  2543. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  2544. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  2545. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  2546. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  2547. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  2548. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  2549. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  2550. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  2551. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  2552. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  2553. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  2554. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  2555. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  2556. boldFont.method385(0xc6b895, "Choose Option", yPos + 14, xPos + 3);
  2557. int j1 = super.mouseX;
  2558. int k1 = super.mouseY;
  2559. int mouseX = super.mouseX - (xOffSet);
  2560. int mouseY = (-yOffSet) + super.mouseY;
  2561. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2562. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  2563. int disColor = 0xc6b895;
  2564. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  2565. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  2566. disColor = 0xeee5c6;
  2567. }
  2568. boldFont.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  2569. }
  2570. }
  2571.  
  2572. private void addFriend(long l) {
  2573. try {
  2574. if(l == 0L)
  2575. return;
  2576. if(friendsCount >= 100 && anInt1046 != 1) {
  2577. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2578. return;
  2579. }
  2580. if(friendsCount >= 200) {
  2581. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2582. return;
  2583. }
  2584. String s = TextClass.fixName(TextClass.nameForLong(l));
  2585. for(int i = 0; i < friendsCount; i++)
  2586. if(friendsListAsLongs[i] == l) {
  2587. pushMessage(s + " is already on your friend list", 0, "");
  2588. return;
  2589. }
  2590. for(int j = 0; j < ignoreCount; j++)
  2591. if(ignoreListAsLongs[j] == l) {
  2592. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2593. return;
  2594. }
  2595.  
  2596. if(s.equals(myPlayer.name)) {
  2597. return;
  2598. } else {
  2599. friendsList[friendsCount] = s;
  2600. friendsListAsLongs[friendsCount] = l;
  2601. friendsNodeIDs[friendsCount] = 0;
  2602. friendsCount++;
  2603. needDrawTabArea = true;
  2604. stream.createFrame(188);
  2605. stream.writeQWord(l);
  2606. return;
  2607. }
  2608. } catch(RuntimeException runtimeexception) {
  2609. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2610. }
  2611. throw new RuntimeException();
  2612. }
  2613.  
  2614. private int method42(int i, int j, int k) {
  2615. int l = k >> 7;
  2616. int i1 = j >> 7;
  2617. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2618. return 0;
  2619. int j1 = i;
  2620. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2621. j1++;
  2622. int k1 = k & 0x7f;
  2623. int l1 = j & 0x7f;
  2624. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2625. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2626. return i2 * (128 - l1) + j2 * l1 >> 7;
  2627. }
  2628.  
  2629. private static String intToKOrMil(int j) {
  2630. if(j < 0x186a0)
  2631. return String.valueOf(j);
  2632. if(j < 0x989680)
  2633. return j / 1000 + "K";
  2634. else
  2635. return j / 0xf4240 + "M";
  2636. }
  2637.  
  2638. private void resetLogout() {
  2639. try {
  2640. if(socketStream != null)
  2641. socketStream.close();
  2642. }
  2643. catch(Exception _ex) { }
  2644. socketStream = null;
  2645. loggedIn = false;
  2646. alertHandler.alert = null;
  2647. loginScreenState = 0;
  2648. //myUsername = "";
  2649. //myPassword = "";
  2650. unlinkMRUNodes();
  2651. worldController.initToNull();
  2652. for(int i = 0; i < 4; i++)
  2653. aClass11Array1230[i].method210();
  2654. System.gc();
  2655. stopMidi();
  2656. currentSong = -1;
  2657. nextSong = -1;
  2658. prevSong = 0;
  2659. autocastId = 0;
  2660. autoCast = false;
  2661. turnOffPrayers();
  2662. orbToggle[1] = false;
  2663. if(toggleFullscreen)
  2664. switchToNormal();
  2665. }
  2666.  
  2667. private void method45() {
  2668. aBoolean1031 = true;
  2669. for(int j = 0; j < 7; j++) {
  2670. anIntArray1065[j] = -1;
  2671. for(int k = 0; k < IDK.length; k++) {
  2672. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2673. continue;
  2674. anIntArray1065[j] = k;
  2675. break;
  2676. }
  2677. }
  2678. }
  2679.  
  2680. private void method46(int i, Stream stream) {
  2681. while(stream.bitPosition + 21 < i * 8) {
  2682. int k = stream.readBits(14);
  2683. if(k == 16383)
  2684. break;
  2685. if(npcArray[k] == null)
  2686. npcArray[k] = new NPC();
  2687. NPC npc = npcArray[k];
  2688. npcIndices[npcCount++] = k;
  2689. npc.anInt1537 = loopCycle;
  2690. int l = stream.readBits(5);
  2691. if(l > 15)
  2692. l -= 32;
  2693. int i1 = stream.readBits(5);
  2694. if(i1 > 15)
  2695. i1 -= 32;
  2696. int j1 = stream.readBits(1);
  2697. npc.desc = EntityDef.forID(stream.readBits(14));
  2698. int k1 = stream.readBits(1);
  2699. if(k1 == 1)
  2700. anIntArray894[anInt893++] = k;
  2701. npc.anInt1540 = npc.desc.aByte68;
  2702. npc.anInt1504 = npc.desc.anInt79;
  2703. npc.anInt1554 = npc.desc.walkAnim;
  2704. npc.anInt1555 = npc.desc.anInt58;
  2705. npc.anInt1556 = npc.desc.anInt83;
  2706. npc.anInt1557 = npc.desc.anInt55;
  2707. npc.anInt1511 = npc.desc.standAnim;
  2708. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2709. }
  2710. stream.finishBitAccess();
  2711. }
  2712.  
  2713. public void processGameLoop() {
  2714. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2715. return;
  2716. loopCycle++;
  2717. if(!loggedIn)
  2718. processLoginScreenInput();
  2719. else
  2720. mainGameProcessor();
  2721. processOnDemandQueue();
  2722. }
  2723.  
  2724. private void method47(boolean flag) {
  2725. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2726. destX = 0;
  2727. int j = playerCount;
  2728. if(flag)
  2729. j = 1;
  2730. for(int l = 0; l < j; l++) {
  2731. Player player;
  2732. int i1;
  2733. if(flag) {
  2734. player = myPlayer;
  2735. i1 = myPlayerIndex << 14;
  2736. } else {
  2737. player = playerArray[playerIndices[l]];
  2738. i1 = playerIndices[l] << 14;
  2739. }
  2740. if(player == null || !player.isVisible())
  2741. continue;
  2742. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2743. int j1 = player.x >> 7;
  2744. int k1 = player.y >> 7;
  2745. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2746. continue;
  2747. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2748. player.aBoolean1699 = false;
  2749. player.anInt1709 = method42(plane, player.y, player.x);
  2750. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2751. continue;
  2752. }
  2753. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2754. if(anIntArrayArray929[j1][k1] == anInt1265)
  2755. continue;
  2756. anIntArrayArray929[j1][k1] = anInt1265;
  2757. }
  2758. player.anInt1709 = method42(plane, player.y, player.x);
  2759. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2760. }
  2761. }
  2762.  
  2763. private boolean promptUserForInput(RSInterface class9) {
  2764. int j = class9.contentType;
  2765. if(anInt900 == 2) {
  2766. if(j == 201) {
  2767. inputTaken = true;
  2768. inputDialogState = 0;
  2769. messagePromptRaised = true;
  2770. promptInput = "";
  2771. friendsListAction = 1;
  2772. aString1121 = "Enter name of friend to add to list";
  2773. }
  2774. if(j == 202) {
  2775. inputTaken = true;
  2776. inputDialogState = 0;
  2777. messagePromptRaised = true;
  2778. promptInput = "";
  2779. friendsListAction = 2;
  2780. aString1121 = "Enter name of friend to delete from list";
  2781. }
  2782. }
  2783. if(j == 205) {
  2784. anInt1011 = 250;
  2785. return true;
  2786. }
  2787. if(j == 501) {
  2788. inputTaken = true;
  2789. inputDialogState = 0;
  2790. messagePromptRaised = true;
  2791. promptInput = "";
  2792. friendsListAction = 4;
  2793. aString1121 = "Enter name of player to add to list";
  2794. }
  2795. if(j == 502) {
  2796. inputTaken = true;
  2797. inputDialogState = 0;
  2798. messagePromptRaised = true;
  2799. promptInput = "";
  2800. friendsListAction = 5;
  2801. aString1121 = "Enter name of player to delete from list";
  2802. }
  2803. if(j == 550) {
  2804. inputTaken = true;
  2805. inputDialogState = 0;
  2806. messagePromptRaised = true;
  2807. promptInput = "";
  2808. friendsListAction = 6;
  2809. aString1121 = "Enter the name of the chat you wish to join";
  2810. }
  2811. if(j >= 300 && j <= 313) {
  2812. int k = (j - 300) / 2;
  2813. int j1 = j & 1;
  2814. int i2 = anIntArray1065[k];
  2815. if(i2 != -1) {
  2816. do {
  2817. if(j1 == 0 && --i2 < 0)
  2818. i2 = IDK.length - 1;
  2819. if(j1 == 1 && ++i2 >= IDK.length)
  2820. i2 = 0;
  2821. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2822. anIntArray1065[k] = i2;
  2823. aBoolean1031 = true;
  2824. }
  2825. }
  2826. if(j >= 314 && j <= 323) {
  2827. int l = (j - 314) / 2;
  2828. int k1 = j & 1;
  2829. int j2 = anIntArray990[l];
  2830. if(k1 == 0 && --j2 < 0)
  2831. j2 = anIntArrayArray1003[l].length - 1;
  2832. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2833. j2 = 0;
  2834. anIntArray990[l] = j2;
  2835. aBoolean1031 = true;
  2836. }
  2837. if(j == 324 && !aBoolean1047) {
  2838. aBoolean1047 = true;
  2839. method45();
  2840. }
  2841. if(j == 325 && aBoolean1047) {
  2842. aBoolean1047 = false;
  2843. method45();
  2844. }
  2845. if(j == 326) {
  2846. stream.createFrame(101);
  2847. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2848. for(int i1 = 0; i1 < 7; i1++)
  2849. stream.writeWordBigEndian(anIntArray1065[i1]);
  2850.  
  2851. for(int l1 = 0; l1 < 5; l1++)
  2852. stream.writeWordBigEndian(anIntArray990[l1]);
  2853.  
  2854. return true;
  2855. }
  2856. System.out.println(""+j);
  2857. if(j == 612)
  2858. canMute = !canMute;
  2859. if(j == 613)
  2860. canBan = !canBan;
  2861. if(j >= 602 && j <= 616) {
  2862. clearTopInterfaces();
  2863. if(reportAbuseInput.length() > 0 && myPrivilege > 0) {
  2864.  
  2865. String[] commands = {"mute","unmute","jail","unjail","ban","unban","","ipmute","unipmute","ipban","unipban"};
  2866. String inputString = "::"+(commands[j-602])+" "+reportAbuseInput;
  2867. stream.createFrame(103);
  2868. stream.writeWordBigEndian(inputString.length() - 1);
  2869. stream.writeString(inputString.substring(2));
  2870. }
  2871.  
  2872. }
  2873. return false;
  2874. }
  2875. private void method49(Stream stream) {
  2876. for(int j = 0; j < anInt893; j++) {
  2877. int k = anIntArray894[j];
  2878. Player player = playerArray[k];
  2879. int l = stream.readUnsignedByte();
  2880. if((l & 0x40) != 0)
  2881. l += stream.readUnsignedByte() << 8;
  2882. method107(l, k, stream, player);
  2883. }
  2884. }
  2885.  
  2886. private void method50(int i, int k, int l, int i1, int j1) {
  2887. int k1 = worldController.method300(j1, l, i);
  2888. if(k1 != 0) {
  2889. int l1 = worldController.method304(j1, l, i, k1);
  2890. int k2 = l1 >> 6 & 3;
  2891. int i3 = l1 & 0x1f;
  2892. int k3 = k;
  2893. if(k1 > 0)
  2894. k3 = i1;
  2895. int ai[] = miniMapImage.myPixels;
  2896. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2897. int i5 = k1 >> 14 & 0x7fff;
  2898. ObjectDef class46_2 = ObjectDef.forID(i5);
  2899. if(class46_2.anInt758 != -1) {
  2900. Background background_2 = mapScenes[class46_2.anInt758];
  2901. if(background_2 != null) {
  2902. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2903. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2904. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2905. }
  2906. } else {
  2907. if(i3 == 0 || i3 == 2)
  2908. if(k2 == 0) {
  2909. ai[k4] = k3;
  2910. ai[k4 + 512] = k3;
  2911. ai[k4 + 1024] = k3;
  2912. ai[k4 + 1536] = k3;
  2913. } else if(k2 == 1) {
  2914. ai[k4] = k3;
  2915. ai[k4 + 1] = k3;
  2916. ai[k4 + 2] = k3;
  2917. ai[k4 + 3] = k3;
  2918. } else if(k2 == 2) {
  2919. ai[k4 + 3] = k3;
  2920. ai[k4 + 3 + 512] = k3;
  2921. ai[k4 + 3 + 1024] = k3;
  2922. ai[k4 + 3 + 1536] = k3;
  2923. } else if(k2 == 3) {
  2924. ai[k4 + 1536] = k3;
  2925. ai[k4 + 1536 + 1] = k3;
  2926. ai[k4 + 1536 + 2] = k3;
  2927. ai[k4 + 1536 + 3] = k3;
  2928. }
  2929. if(i3 == 3)
  2930. if(k2 == 0)
  2931. ai[k4] = k3;
  2932. else if(k2 == 1)
  2933. ai[k4 + 3] = k3;
  2934. else if(k2 == 2)
  2935. ai[k4 + 3 + 1536] = k3;
  2936. else if(k2 == 3)
  2937. ai[k4 + 1536] = k3;
  2938. if(i3 == 2)
  2939. if(k2 == 3) {
  2940. ai[k4] = k3;
  2941. ai[k4 + 512] = k3;
  2942. ai[k4 + 1024] = k3;
  2943. ai[k4 + 1536] = k3;
  2944. } else if(k2 == 0) {
  2945. ai[k4] = k3;
  2946. ai[k4 + 1] = k3;
  2947. ai[k4 + 2] = k3;
  2948. ai[k4 + 3] = k3;
  2949. } else if(k2 == 1) {
  2950. ai[k4 + 3] = k3;
  2951. ai[k4 + 3 + 512] = k3;
  2952. ai[k4 + 3 + 1024] = k3;
  2953. ai[k4 + 3 + 1536] = k3;
  2954. } else if(k2 == 2) {
  2955. ai[k4 + 1536] = k3;
  2956. ai[k4 + 1536 + 1] = k3;
  2957. ai[k4 + 1536 + 2] = k3;
  2958. ai[k4 + 1536 + 3] = k3;
  2959. }
  2960. }
  2961. }
  2962. k1 = worldController.method302(j1, l, i);
  2963. if(k1 != 0) {
  2964. int i2 = worldController.method304(j1, l, i, k1);
  2965. int l2 = i2 >> 6 & 3;
  2966. int j3 = i2 & 0x1f;
  2967. int l3 = k1 >> 14 & 0x7fff;
  2968. ObjectDef class46_1 = ObjectDef.forID(l3);
  2969. if(class46_1.anInt758 != -1) {
  2970. Background background_1 = mapScenes[class46_1.anInt758];
  2971. if(background_1 != null) {
  2972. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2973. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2974. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2975. }
  2976. } else if(j3 == 9) {
  2977. int l4 = 0xeeeeee;
  2978. if(k1 > 0)
  2979. l4 = 0xee0000;
  2980. int ai1[] = miniMapImage.myPixels;
  2981. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2982. if(l2 == 0 || l2 == 2) {
  2983. ai1[l5 + 1536] = l4;
  2984. ai1[l5 + 1024 + 1] = l4;
  2985. ai1[l5 + 512 + 2] = l4;
  2986. ai1[l5 + 3] = l4;
  2987. } else {
  2988. ai1[l5] = l4;
  2989. ai1[l5 + 512 + 1] = l4;
  2990. ai1[l5 + 1024 + 2] = l4;
  2991. ai1[l5 + 1536 + 3] = l4;
  2992. }
  2993. }
  2994. }
  2995. k1 = worldController.method303(j1, l, i);
  2996. if(k1 != 0) {
  2997. int j2 = k1 >> 14 & 0x7fff;
  2998. ObjectDef class46 = ObjectDef.forID(j2);
  2999. if(class46.anInt758 != -1) {
  3000. Background background = mapScenes[class46.anInt758];
  3001. if(background != null) {
  3002. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3003. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3004. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3005. }
  3006. }
  3007. }
  3008. }
  3009.  
  3010. private void loadTitleScreen() {
  3011.  
  3012. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  3013. aBackgroundArray1152s = new Background[12];
  3014. int j = 0;
  3015. try {
  3016. j = Integer.parseInt(getParameter("fl_icon"));
  3017. } catch(Exception _ex) {
  3018. }
  3019. if(j == 0) {
  3020. for(int k = 0; k < 12; k++)
  3021. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3022.  
  3023. } else {
  3024. for(int l = 0; l < 12; l++)
  3025. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3026.  
  3027. }
  3028. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3029. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3030. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3031.  
  3032. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3033.  
  3034. anIntArray851 = new int[256];
  3035. for(int k1 = 0; k1 < 64; k1++)
  3036. anIntArray851[k1] = k1 * 0x40000;
  3037.  
  3038. for(int l1 = 0; l1 < 64; l1++)
  3039. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3040.  
  3041. for(int i2 = 0; i2 < 64; i2++)
  3042. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3043.  
  3044. for(int j2 = 0; j2 < 64; j2++)
  3045. anIntArray851[j2 + 192] = 0xffffff;
  3046.  
  3047. anIntArray852 = new int[256];
  3048. for(int k2 = 0; k2 < 64; k2++)
  3049. anIntArray852[k2] = k2 * 1024;
  3050.  
  3051. for(int l2 = 0; l2 < 64; l2++)
  3052. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3053.  
  3054. for(int i3 = 0; i3 < 64; i3++)
  3055. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3056.  
  3057. for(int j3 = 0; j3 < 64; j3++)
  3058. anIntArray852[j3 + 192] = 0xffffff;
  3059.  
  3060. anIntArray853 = new int[256];
  3061. for(int k3 = 0; k3 < 64; k3++)
  3062. anIntArray853[k3] = k3 * 4;
  3063.  
  3064. for(int l3 = 0; l3 < 64; l3++)
  3065. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3066.  
  3067. for(int i4 = 0; i4 < 64; i4++)
  3068. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3069.  
  3070. for(int j4 = 0; j4 < 64; j4++)
  3071. anIntArray853[j4 + 192] = 0xffffff;
  3072.  
  3073. anIntArray850 = new int[256];
  3074. anIntArray1190 = new int[32768];
  3075. anIntArray1191 = new int[32768];
  3076. randomizeBackground(null);
  3077. anIntArray828 = new int[32768];
  3078. anIntArray829 = new int[32768];
  3079. drawLoadingText(10, "");
  3080. if(!aBoolean831) {
  3081. //drawFlames = true;
  3082. //aBoolean831 = true;
  3083. //startRunnable(this, 2);
  3084. }
  3085. }
  3086.  
  3087. private static void setHighMem() {
  3088. WorldController.lowMem = false;
  3089. Texture.lowMem = false;
  3090. lowMem = false;
  3091. ObjectManager.lowMem = false;
  3092. ObjectDef.lowMem = false;
  3093. }
  3094.  
  3095. private void loadingStages() {
  3096. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3097. main3DArea.initDrawingArea();
  3098. normalFont.drawText(0, "Loading - please wait.", 151, 257);
  3099. normalFont.drawText(0xffffff, "Loading - please wait.", 150, 256);
  3100. main3DArea.drawGraphics(toggleFullscreen ? 0 : 4, super.graphics, toggleFullscreen ? 0 : 4);
  3101. loadingStage = 1;
  3102. aLong824 = System.currentTimeMillis();
  3103. }
  3104. if(loadingStage == 1) {
  3105. int j = method54();
  3106. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3107. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3108. aLong824 = System.currentTimeMillis();
  3109. }
  3110. }
  3111. if(loadingStage == 2 && plane != anInt985) {
  3112. anInt985 = plane;
  3113. method24(plane);
  3114. }
  3115. }
  3116.  
  3117. private int method54() {
  3118. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  3119. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3120. return -1;
  3121. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3122. return -2;
  3123. }
  3124. boolean flag = true;
  3125. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  3126. byte abyte0[] = aByteArrayArray1247[j];
  3127. if(abyte0 != null) {
  3128. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3129. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3130. if(aBoolean1159) {
  3131. k = 10;
  3132. l = 10;
  3133. }
  3134. flag &= ObjectManager.method189(k, abyte0, l);
  3135. }
  3136. }
  3137. if(!flag)
  3138. return -3;
  3139. if(aBoolean1080) {
  3140. return -4;
  3141. } else {
  3142. loadingStage = 2;
  3143. ObjectManager.anInt131 = plane;
  3144. method22();
  3145. stream.createFrame(121);
  3146. return 0;
  3147. }
  3148. }
  3149.  
  3150. private void method55()
  3151. {
  3152. 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())
  3153. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3154. class30_sub2_sub4_sub4.unlink();
  3155. else
  3156. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  3157. {
  3158. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  3159. {
  3160. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3161. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3162. 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);
  3163. }
  3164. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  3165. {
  3166. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3167. Player player;
  3168. if(j == unknownInt10)
  3169. player = myPlayer;
  3170. else
  3171. player = playerArray[j];
  3172. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3173. 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);
  3174. }
  3175. class30_sub2_sub4_sub4.method456(anInt945);
  3176. 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);
  3177. }
  3178.  
  3179. }
  3180.  
  3181. public AppletContext getAppletContext()
  3182. {
  3183. if(signlink.mainapp != null)
  3184. return signlink.mainapp.getAppletContext();
  3185. else
  3186. return super.getAppletContext();
  3187. }
  3188.  
  3189. private void drawLogo() {
  3190. Sprite sprite = new Sprite("background");
  3191. aRSImageProducer_1110.initDrawingArea();
  3192. sprite.method346(0, 0);
  3193. aRSImageProducer_1111.initDrawingArea();
  3194. sprite.method346(-637, 0);
  3195. aRSImageProducer_1107.initDrawingArea();
  3196. sprite.method346(-128, 0);
  3197. aRSImageProducer_1108.initDrawingArea();
  3198. sprite.method346(-202, -371);
  3199. aRSImageProducer_1109.initDrawingArea();
  3200. sprite.method346(-202, -171);
  3201. aRSImageProducer_1112.initDrawingArea();
  3202. sprite.method346(0, -265);
  3203. aRSImageProducer_1113.initDrawingArea();
  3204. sprite.method346(-562, -265);
  3205. aRSImageProducer_1114.initDrawingArea();
  3206. sprite.method346(-128, -171);
  3207. aRSImageProducer_1115.initDrawingArea();
  3208. sprite.method346(-562, -171);
  3209.  
  3210. aRSImageProducer_1110.initDrawingArea();
  3211. aRSImageProducer_1111.initDrawingArea();
  3212. aRSImageProducer_1107.initDrawingArea();
  3213. aRSImageProducer_1108.initDrawingArea();
  3214. aRSImageProducer_1109.initDrawingArea();
  3215. aRSImageProducer_1112.initDrawingArea();
  3216. aRSImageProducer_1113.initDrawingArea();
  3217. aRSImageProducer_1114.initDrawingArea();
  3218. aRSImageProducer_1115.initDrawingArea();
  3219. /*sprite = new Sprite(titleStreamLoader, "logo", 0);
  3220. aRSImageProducer_1107.initDrawingArea();
  3221. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3222. */
  3223.  
  3224. sprite = null;
  3225. Object obj = null;
  3226. Object obj1 = null;
  3227. System.gc();
  3228. }
  3229. private void processOnDemandQueue()
  3230. {
  3231. do
  3232. {
  3233. OnDemandData onDemandData;
  3234. do
  3235. {
  3236. onDemandData = onDemandFetcher.getNextNode();
  3237. if(onDemandData == null)
  3238. return;
  3239. if(onDemandData.dataType == 0)
  3240. {
  3241. Model.method460(onDemandData.buffer, onDemandData.ID);
  3242. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  3243. {
  3244. needDrawTabArea = true;
  3245. if(backDialogID != -1)
  3246. inputTaken = true;
  3247. }
  3248. }
  3249. //if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  3250. //Class36.method529(onDemandData.buffer);
  3251. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3252. SoundProvider.getSingleton().playMIDI(onDemandData.buffer);
  3253. if(onDemandData.dataType == 3 && loadingStage == 1)
  3254. {
  3255. //System.out.println("Mapdata Region: "+onDemandData.ID);
  3256. try {
  3257. writeFile(onDemandData.buffer, "./maps/" + onDemandData.ID + ".dat");
  3258. } catch (Exception e) {}
  3259. for(int i = 0; i < aByteArrayArray1183.length; i++)
  3260. {
  3261. if(anIntArray1235[i] == onDemandData.ID)
  3262. {
  3263. aByteArrayArray1183[i] = onDemandData.buffer;
  3264. if(onDemandData.buffer == null)
  3265. anIntArray1235[i] = -1;
  3266. break;
  3267. }
  3268. if(anIntArray1236[i] != onDemandData.ID)
  3269. continue;
  3270. aByteArrayArray1247[i] = onDemandData.buffer;
  3271. if(onDemandData.buffer == null)
  3272. anIntArray1236[i] = -1;
  3273. break;
  3274. }
  3275.  
  3276. }
  3277. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3278. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3279. } while(true);
  3280. }
  3281.  
  3282. public static void writeFile(byte[] data, String fileName) throws IOException{
  3283. OutputStream out = new FileOutputStream(fileName);
  3284. out.write(data);
  3285. out.close();
  3286. }
  3287.  
  3288. private void calcFlamesPosition()
  3289. {
  3290. char c = '\u0100';
  3291. for(int j = 10; j < 117; j++)
  3292. {
  3293. int k = (int)(Math.random() * 100D);
  3294. if(k < 50)
  3295. anIntArray828[j + (c - 2 << 7)] = 255;
  3296. }
  3297. for(int l = 0; l < 100; l++)
  3298. {
  3299. int i1 = (int)(Math.random() * 124D) + 2;
  3300. int k1 = (int)(Math.random() * 128D) + 128;
  3301. int k2 = i1 + (k1 << 7);
  3302. anIntArray828[k2] = 192;
  3303. }
  3304.  
  3305. for(int j1 = 1; j1 < c - 1; j1++)
  3306. {
  3307. for(int l1 = 1; l1 < 127; l1++)
  3308. {
  3309. int l2 = l1 + (j1 << 7);
  3310. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3311. }
  3312.  
  3313. }
  3314.  
  3315. anInt1275 += 128;
  3316. if(anInt1275 > anIntArray1190.length)
  3317. {
  3318. anInt1275 -= anIntArray1190.length;
  3319. int i2 = (int)(Math.random() * 12D);
  3320. randomizeBackground(aBackgroundArray1152s[i2]);
  3321. }
  3322. for(int j2 = 1; j2 < c - 1; j2++)
  3323. {
  3324. for(int i3 = 1; i3 < 127; i3++)
  3325. {
  3326. int k3 = i3 + (j2 << 7);
  3327. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3328. if(i4 < 0)
  3329. i4 = 0;
  3330. anIntArray828[k3] = i4;
  3331. }
  3332.  
  3333. }
  3334.  
  3335. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3336.  
  3337. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  3338. if(anInt1040 > 0)
  3339. anInt1040 -= 4;
  3340. if(anInt1041 > 0)
  3341. anInt1041 -= 4;
  3342. if(anInt1040 == 0 && anInt1041 == 0)
  3343. {
  3344. int l3 = (int)(Math.random() * 2000D);
  3345. if(l3 == 0)
  3346. anInt1040 = 1024;
  3347. if(l3 == 1)
  3348. anInt1041 = 1024;
  3349. }
  3350. }
  3351.  
  3352. private void method60(int i)
  3353. {
  3354. RSInterface class9 = RSInterface.interfaceCache[i];
  3355. for(int j = 0; j < class9.children.length; j++)
  3356. {
  3357. if(class9.children[j] == -1)
  3358. break;
  3359. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3360. if(class9_1.type == 1)
  3361. method60(class9_1.id);
  3362. class9_1.anInt246 = 0;
  3363. class9_1.anInt208 = 0;
  3364. }
  3365. }
  3366.  
  3367. private void drawHeadIcon()
  3368. {
  3369. if(hintType != 2)
  3370. return;
  3371. calcEntityScreenPos((hintArrowX - baseX << 7) + anInt937, anInt936 * 2, (hintArrowY - baseY << 7) + anInt938);
  3372. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3373. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3374. }
  3375.  
  3376. private void mainGameProcessor()
  3377. {
  3378. if(systemUpdatetime > 1)
  3379. systemUpdatetime--;
  3380. if(anInt1011 > 0)
  3381. anInt1011--;
  3382. for(int j = 0; j < 5; j++)
  3383. if(!parsePacket())
  3384. break;
  3385.  
  3386. if(!loggedIn)
  3387. return;
  3388. synchronized(mouseDetection.syncObject)
  3389. {
  3390. if(flagged)
  3391. {
  3392. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  3393. {
  3394. stream.createFrame(45);
  3395. stream.writeWordBigEndian(0);
  3396. int j2 = stream.currentOffset;
  3397. int j3 = 0;
  3398. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  3399. {
  3400. if(j2 - stream.currentOffset >= 240)
  3401. break;
  3402. j3++;
  3403. int l4 = mouseDetection.coordsY[j4];
  3404. if(l4 < 0)
  3405. l4 = 0;
  3406. else
  3407. if(l4 > 502)
  3408. l4 = 502;
  3409. int k5 = mouseDetection.coordsX[j4];
  3410. if(k5 < 0)
  3411. k5 = 0;
  3412. else
  3413. if(k5 > 764)
  3414. k5 = 764;
  3415. int i6 = l4 * 765 + k5;
  3416. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3417. {
  3418. k5 = -1;
  3419. l4 = -1;
  3420. i6 = 0x7ffff;
  3421. }
  3422. if(k5 == anInt1237 && l4 == anInt1238)
  3423. {
  3424. if(anInt1022 < 2047)
  3425. anInt1022++;
  3426. } else
  3427. {
  3428. int j6 = k5 - anInt1237;
  3429. anInt1237 = k5;
  3430. int k6 = l4 - anInt1238;
  3431. anInt1238 = l4;
  3432. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3433. {
  3434. j6 += 32;
  3435. k6 += 32;
  3436. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3437. anInt1022 = 0;
  3438. } else
  3439. if(anInt1022 < 8)
  3440. {
  3441. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3442. anInt1022 = 0;
  3443. } else
  3444. {
  3445. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3446. anInt1022 = 0;
  3447. }
  3448. }
  3449. }
  3450.  
  3451. stream.writeBytes(stream.currentOffset - j2);
  3452. if(j3 >= mouseDetection.coordsIndex)
  3453. {
  3454. mouseDetection.coordsIndex = 0;
  3455. } else
  3456. {
  3457. mouseDetection.coordsIndex -= j3;
  3458. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3459. {
  3460. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3461. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3462. }
  3463.  
  3464. }
  3465. }
  3466. } else
  3467. {
  3468. mouseDetection.coordsIndex = 0;
  3469. }
  3470. }
  3471. if(super.clickMode3 != 0)
  3472. {
  3473. long l = (super.aLong29 - aLong1220) / 50L;
  3474. if(l > 4095L)
  3475. l = 4095L;
  3476. aLong1220 = super.aLong29;
  3477. int k2 = super.saveClickY;
  3478. if(k2 < 0)
  3479. k2 = 0;
  3480. else
  3481. if(k2 > 502)
  3482. k2 = 502;
  3483. int k3 = super.saveClickX;
  3484. if(k3 < 0)
  3485. k3 = 0;
  3486. else
  3487. if(k3 > 764)
  3488. k3 = 764;
  3489. int k4 = k2 * 765 + k3;
  3490. int j5 = 0;
  3491. if(super.clickMode3 == 2)
  3492. j5 = 1;
  3493. int l5 = (int)l;
  3494. stream.createFrame(241);
  3495. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3496. }
  3497. if(anInt1016 > 0)
  3498. anInt1016--;
  3499. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3500. aBoolean1017 = true;
  3501. if(aBoolean1017 && anInt1016 <= 0)
  3502. {
  3503. anInt1016 = 20;
  3504. aBoolean1017 = false;
  3505. stream.createFrame(86);
  3506. stream.writeWord(anInt1184);
  3507. stream.method432(compassRotation);
  3508. }
  3509. if(super.awtFocus && !aBoolean954)
  3510. {
  3511. aBoolean954 = true;
  3512. stream.createFrame(3);
  3513. stream.writeWordBigEndian(1);
  3514. }
  3515. if(!super.awtFocus && aBoolean954)
  3516. {
  3517. aBoolean954 = false;
  3518. stream.createFrame(3);
  3519. stream.writeWordBigEndian(0);
  3520. }
  3521. loadingStages();
  3522. method115();
  3523. method90();
  3524. anInt1009++;
  3525. if(anInt1009 > 750)
  3526. dropClient();
  3527. method114();
  3528. method95();
  3529. method38();
  3530. anInt945++;
  3531. if(crossType != 0)
  3532. {
  3533. crossIndex += 20;
  3534. if(crossIndex >= 400)
  3535. crossType = 0;
  3536. }
  3537. if(atInventoryInterfaceType != 0)
  3538. {
  3539. atInventoryLoopCycle++;
  3540. if(atInventoryLoopCycle >= 15)
  3541. {
  3542. if(atInventoryInterfaceType == 2)
  3543. needDrawTabArea = true;
  3544. if(atInventoryInterfaceType == 3)
  3545. inputTaken = true;
  3546. atInventoryInterfaceType = 0;
  3547. }
  3548. }
  3549. if(activeInterfaceType != 0)
  3550. {
  3551. anInt989++;
  3552. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3553. aBoolean1242 = true;
  3554. if(super.clickMode2 == 0)
  3555. {
  3556. if(activeInterfaceType == 2)
  3557. needDrawTabArea = true;
  3558. if(activeInterfaceType == 3)
  3559. inputTaken = true;
  3560. activeInterfaceType = 0;
  3561. if(aBoolean1242 && anInt989 >= 10)
  3562. {
  3563. lastActiveInvInterface = -1;
  3564. processRightClick();
  3565. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3566. {
  3567. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3568. int j1 = 0;
  3569. if(anInt913 == 1 && class9.contentType == 206)
  3570. j1 = 1;
  3571. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3572. j1 = 0;
  3573. if(class9.aBoolean235)
  3574. {
  3575. int l2 = anInt1085;
  3576. int l3 = mouseInvInterfaceIndex;
  3577. class9.inv[l3] = class9.inv[l2];
  3578. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3579. class9.inv[l2] = -1;
  3580. class9.invStackSizes[l2] = 0;
  3581. } else
  3582. if(j1 == 1)
  3583. {
  3584. int i3 = anInt1085;
  3585. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3586. if(i3 > i4)
  3587. {
  3588. class9.swapInventoryItems(i3, i3 - 1);
  3589. i3--;
  3590. } else
  3591. if(i3 < i4)
  3592. {
  3593. class9.swapInventoryItems(i3, i3 + 1);
  3594. i3++;
  3595. }
  3596.  
  3597. } else
  3598. {
  3599. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3600. }
  3601. stream.createFrame(214);
  3602. stream.method433(anInt1084);
  3603. stream.method424(j1);
  3604. stream.method433(anInt1085);
  3605. stream.method431(mouseInvInterfaceIndex);
  3606. }
  3607. } else
  3608. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3609. determineMenuSize();
  3610. else
  3611. if(menuActionRow > 0)
  3612. doAction(menuActionRow - 1);
  3613. atInventoryLoopCycle = 10;
  3614. super.clickMode3 = 0;
  3615. }
  3616. }
  3617. if(WorldController.anInt470 != -1)
  3618. {
  3619. int k = WorldController.anInt470;
  3620. int k1 = WorldController.anInt471;
  3621. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3622. WorldController.anInt470 = -1;
  3623. if(flag)
  3624. {
  3625. crossX = super.saveClickX;
  3626. crossY = super.saveClickY;
  3627. crossType = 1;
  3628. crossIndex = 0;
  3629. }
  3630. }
  3631. if(super.clickMode3 == 1 && aString844 != null)
  3632. {
  3633. aString844 = null;
  3634. inputTaken = true;
  3635. super.clickMode3 = 0;
  3636. }
  3637.  
  3638. if(!contextMenuOpen) {
  3639. processMinimapClick(getMapIncreaseX(),getMapIncreaseY());
  3640. processChatModeClick(0,getChatBackIncreaseY());
  3641. }
  3642. processMenuClick();
  3643.  
  3644. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3645. anInt1213++;
  3646. if (anInt1500 != 0 || anInt1044 != 0 || lastHoverToggleChildId != 0) {
  3647. if (anInt1501 < 100) {
  3648. anInt1501++;
  3649. if (anInt1501 == 100) {
  3650. if (anInt1500 != 0) {
  3651. inputTaken = true;
  3652. }
  3653. if (anInt1044 != 0) {
  3654. needDrawTabArea = true;
  3655. }
  3656. }
  3657. }
  3658. } else if (anInt1501 > 0) {
  3659. anInt1501--;
  3660. }
  3661. if(loadingStage == 2)
  3662. method108();
  3663. if(loadingStage == 2 && aBoolean1160)
  3664. calcCameraPos();
  3665. for(int i1 = 0; i1 < 5; i1++)
  3666. anIntArray1030[i1]++;
  3667.  
  3668. method73();
  3669. super.idleTime++;
  3670. if(super.idleTime > 4500)
  3671. {
  3672. anInt1011 = 250;
  3673. super.idleTime -= 500;
  3674. stream.createFrame(202);
  3675. }
  3676. anInt988++;
  3677. if(anInt988 > 500)
  3678. {
  3679. anInt988 = 0;
  3680. int l1 = (int)(Math.random() * 8D);
  3681. if((l1 & 1) == 1)
  3682. anInt1278 += anInt1279;
  3683. if((l1 & 2) == 2)
  3684. anInt1131 += anInt1132;
  3685. if((l1 & 4) == 4)
  3686. anInt896 += anInt897;
  3687. }
  3688. if(anInt1278 < -50)
  3689. anInt1279 = 2;
  3690. if(anInt1278 > 50)
  3691. anInt1279 = -2;
  3692. if(anInt1131 < -55)
  3693. anInt1132 = 2;
  3694. if(anInt1131 > 55)
  3695. anInt1132 = -2;
  3696. if(anInt896 < -40)
  3697. anInt897 = 1;
  3698. if(anInt896 > 40)
  3699. anInt897 = -1;
  3700. mapTimedProcessCounter++;
  3701. if(mapTimedProcessCounter > 500)
  3702. {
  3703. mapTimedProcessCounter = 0;
  3704. int i2 = (int)(Math.random() * 8D);
  3705. if((i2 & 1) == 1)
  3706. mapAmtDiffRotation += mapAmtCounterRotation;
  3707. if((i2 & 2) == 2)
  3708. mapAmtDiffZoom += mapAmtCounterZoom;
  3709. }
  3710. if(mapAmtDiffRotation < -60)
  3711. mapAmtCounterRotation = 2;
  3712. if(mapAmtDiffRotation > 60)
  3713. mapAmtCounterRotation = -2;
  3714. if(mapAmtDiffZoom < -20)
  3715. mapAmtCounterZoom = 1;
  3716. if(mapAmtDiffZoom > 10)
  3717. mapAmtCounterZoom = -1;
  3718. anInt1010++;
  3719. if(anInt1010 > 50)
  3720. stream.createFrame(0);
  3721. try
  3722. {
  3723. if(socketStream != null && stream.currentOffset > 0)
  3724. {
  3725. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3726. stream.currentOffset = 0;
  3727. anInt1010 = 0;
  3728. }
  3729. }
  3730. catch(IOException _ex)
  3731. {
  3732. dropClient();
  3733. }
  3734. catch(Exception exception)
  3735. {
  3736. resetLogout();
  3737. }
  3738. }
  3739.  
  3740. private void method63()
  3741. {
  3742. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3743. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3744. if(class30_sub1.anInt1294 == -1)
  3745. {
  3746. class30_sub1.anInt1302 = 0;
  3747. method89(class30_sub1);
  3748. } else
  3749. {
  3750. class30_sub1.unlink();
  3751. }
  3752.  
  3753. }
  3754.  
  3755. private void resetImageProducers()
  3756. {
  3757. if(aRSImageProducer_1107 != null)
  3758. return;
  3759. super.fullGameScreen = null;
  3760. rightFrame = null;
  3761. chatBackImage = null;
  3762. mapBackImage = null;
  3763. sideTabArea = null;
  3764. main3DArea = null;
  3765. aRSImageProducer_1123 = null;
  3766. aRSImageProducer_1124 = null;
  3767. aRSImageProducer_1125 = null;
  3768. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3769. DrawingArea.setAllPixelsToZero();
  3770. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3771. DrawingArea.setAllPixelsToZero();
  3772. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3773. DrawingArea.setAllPixelsToZero();
  3774. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3775. DrawingArea.setAllPixelsToZero();
  3776. aRSImageProducer_1109 = new RSImageProducer(360, 233, getGameComponent());
  3777. DrawingArea.setAllPixelsToZero();
  3778. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3779. DrawingArea.setAllPixelsToZero();
  3780. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3781. DrawingArea.setAllPixelsToZero();
  3782. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3783. DrawingArea.setAllPixelsToZero();
  3784. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3785. DrawingArea.setAllPixelsToZero();
  3786. if(titleStreamLoader != null)
  3787. {
  3788. drawLogo();
  3789. loadTitleScreen();
  3790. }
  3791. welcomeScreenRaised = true;
  3792. }
  3793.  
  3794. void drawLoadingText(int i, String s)
  3795. {
  3796. anInt1079 = i;
  3797. aString1049 = s;
  3798. resetImageProducers();
  3799. if(titleStreamLoader == null) {
  3800. super.drawLoadingText(i, s);
  3801. return;
  3802. }
  3803. aRSImageProducer_1109.initDrawingArea();
  3804. loadingBarEmpty = new Sprite("Configuration/empty");
  3805. loadingBarFull = new Sprite("Configuration/full");
  3806. char c = '\u0168';
  3807. char c1 = '\310';
  3808. byte byte1 = 20;
  3809. int j = c1 / 2 - 18 - byte1;
  3810. loadingBarEmpty.drawSprite(20, 60);
  3811. loadingBarFull.drawSprite(86, 84);
  3812. DrawingArea.drawPixels(13, 84, (196 + i), 0x302e2c, (86 - i));
  3813. if (i == 194) {
  3814. smallFont.drawText(0xffffff, s + "RuinedScape is Loading - Please Wait.. 100%", 76, 180);
  3815. } else {
  3816. smallFont.drawText(0xffffff, s + "RuinedScape is Loading - Please Wait.." + i + "%", 76, 180);
  3817. }
  3818. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3819. if(welcomeScreenRaised) {
  3820. welcomeScreenRaised = false;
  3821. if(!aBoolean831) {
  3822. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3823. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3824. }
  3825. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3826. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3827. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3828. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3829. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3830. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3831. }
  3832. }
  3833.  
  3834. private void method65(int i, int j, int k, int l, RSInterface rsinterface, int i1, boolean flag, int j1) {
  3835. byte byte0;
  3836. if(aBoolean972)
  3837. byte0 = 32;
  3838. else
  3839. byte0 = 0;
  3840. aBoolean972 = false;
  3841. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3842. rsinterface.scrollPosition -= anInt1213 * 4;
  3843. if(flag)
  3844. needDrawTabArea = true;
  3845. } else if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3846. rsinterface.scrollPosition += anInt1213 * 4;
  3847. if(flag)
  3848. needDrawTabArea = true;
  3849. } else if(k >= i - byte0 && k < i + 16 + byte0 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0) {
  3850. int k1 = ((j - 32) * j) / j1;
  3851. if(k1 < 8)
  3852. k1 = 8;
  3853. int l1 = l - i1 - 16 - k1 / 2;
  3854. int i2 = j - 32 - k1;
  3855. rsinterface.scrollPosition = ((j1 - j) * l1) / i2;
  3856. if(flag)
  3857. needDrawTabArea = true;
  3858. aBoolean972 = true;
  3859. }
  3860. }
  3861.  
  3862. private boolean method66(int i, int j, int k)
  3863. {
  3864. int i1 = i >> 14 & 0x7fff;
  3865. int j1 = worldController.method304(plane, k, j, i);
  3866. if(j1 == -1)
  3867. return false;
  3868. int k1 = j1 & 0x1f;
  3869. int l1 = j1 >> 6 & 3;
  3870. if(k1 == 10 || k1 == 11 || k1 == 22)
  3871. {
  3872. ObjectDef class46 = ObjectDef.forID(i1);
  3873. int i2;
  3874. int j2;
  3875. if(l1 == 0 || l1 == 2)
  3876. {
  3877. i2 = class46.anInt744;
  3878. j2 = class46.anInt761;
  3879. } else
  3880. {
  3881. i2 = class46.anInt761;
  3882. j2 = class46.anInt744;
  3883. }
  3884. int k2 = class46.anInt768;
  3885. if(l1 != 0)
  3886. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3887. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3888. } else
  3889. {
  3890. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3891. }
  3892. crossX = super.saveClickX;
  3893. crossY = super.saveClickY;
  3894. crossType = 2;
  3895. crossIndex = 0;
  3896. return true;
  3897. }
  3898.  
  3899. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3900. {
  3901. byte abyte0[] = null;
  3902. int l = 5;
  3903. try
  3904. {
  3905. if(decompressors[0] != null)
  3906. abyte0 = decompressors[0].decompress(i);
  3907. }
  3908. catch(Exception _ex) { }
  3909. if(abyte0 != null)
  3910. {
  3911. // aCRC32_930.reset();
  3912. // aCRC32_930.update(abyte0);
  3913. // int i1 = (int)aCRC32_930.getValue();
  3914. // if(i1 != j)
  3915. }
  3916. if(abyte0 != null)
  3917. {
  3918. StreamLoader streamLoader = new StreamLoader(abyte0);
  3919. return streamLoader;
  3920. }
  3921. int j1 = 0;
  3922. while(abyte0 == null)
  3923. {
  3924. String s2 = "Unknown error";
  3925. drawLoadingText(k, "Requesting " + s);
  3926. Object obj = null;
  3927. try
  3928. {
  3929. int k1 = 0;
  3930. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3931. byte abyte1[] = new byte[6];
  3932. datainputstream.readFully(abyte1, 0, 6);
  3933. Stream stream = new Stream(abyte1);
  3934. stream.currentOffset = 3;
  3935. int i2 = stream.read3Bytes() + 6;
  3936. int j2 = 6;
  3937. abyte0 = new byte[i2];
  3938. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3939.  
  3940. while(j2 < i2)
  3941. {
  3942. int l2 = i2 - j2;
  3943. if(l2 > 1000)
  3944. l2 = 1000;
  3945. int j3 = datainputstream.read(abyte0, j2, l2);
  3946. if(j3 < 0)
  3947. {
  3948. s2 = "Length error: " + j2 + "/" + i2;
  3949. throw new IOException("EOF");
  3950. }
  3951. j2 += j3;
  3952. int k3 = (j2 * 100) / i2;
  3953. if(k3 != k1)
  3954. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3955. k1 = k3;
  3956. }
  3957. datainputstream.close();
  3958. try
  3959. {
  3960. if(decompressors[0] != null)
  3961. decompressors[0].method234(abyte0.length, abyte0, i);
  3962. }
  3963. catch(Exception _ex)
  3964. {
  3965. decompressors[0] = null;
  3966. }
  3967. /* if(abyte0 != null)
  3968. {
  3969. aCRC32_930.reset();
  3970. aCRC32_930.update(abyte0);
  3971. int i3 = (int)aCRC32_930.getValue();
  3972. if(i3 != j)
  3973. {
  3974. abyte0 = null;
  3975. j1++;
  3976. s2 = "Checksum error: " + i3;
  3977. }
  3978. }
  3979. */
  3980. }
  3981. catch(IOException ioexception)
  3982. {
  3983. if(s2.equals("Unknown error"))
  3984. s2 = "Connection error";
  3985. abyte0 = null;
  3986. }
  3987. catch(NullPointerException _ex)
  3988. {
  3989. s2 = "Null error";
  3990. abyte0 = null;
  3991. if(!signlink.reporterror)
  3992. return null;
  3993. }
  3994. catch(ArrayIndexOutOfBoundsException _ex)
  3995. {
  3996. s2 = "Bounds error";
  3997. abyte0 = null;
  3998. if(!signlink.reporterror)
  3999. return null;
  4000. }
  4001. catch(Exception _ex)
  4002. {
  4003. s2 = "Unexpected error";
  4004. abyte0 = null;
  4005. if(!signlink.reporterror)
  4006. return null;
  4007. }
  4008. if(abyte0 == null)
  4009. {
  4010. for(int l1 = l; l1 > 0; l1--)
  4011. {
  4012. if(j1 >= 3)
  4013. {
  4014. drawLoadingText(k, "Game updated - please reload page");
  4015. l1 = 10;
  4016. } else
  4017. {
  4018. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4019. }
  4020. try
  4021. {
  4022. Thread.sleep(1000L);
  4023. }
  4024. catch(Exception _ex) { }
  4025. }
  4026.  
  4027. l *= 2;
  4028. if(l > 60)
  4029. l = 60;
  4030. aBoolean872 = !aBoolean872;
  4031. }
  4032.  
  4033. }
  4034.  
  4035. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  4036. return streamLoader_1;
  4037. }
  4038.  
  4039. private void dropClient()
  4040. {
  4041. if(anInt1011 > 0)
  4042. {
  4043. resetLogout();
  4044. return;
  4045. }
  4046. try {
  4047. main3DArea.initDrawingArea();
  4048. normalFont.drawText(0, "Connection lost", 144, 257);
  4049. normalFont.drawText(0xffffff, "Connection lost", 143, 256);
  4050. normalFont.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  4051. normalFont.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  4052. main3DArea.drawGraphics(toggleFullscreen ? 0 : 4, super.graphics, toggleFullscreen ? 0 : 4);
  4053. } catch (NullPointerException ex) {
  4054.  
  4055. }
  4056. minimapCover = 0;
  4057. destX = 0;
  4058. RSSocket rsSocket = socketStream;
  4059. loggedIn = false;
  4060. loginFailures = 0;
  4061. login(myUsername, myPassword, true);
  4062. if(!loggedIn)
  4063. resetLogout();
  4064. try
  4065. {
  4066. rsSocket.close();
  4067. }
  4068. catch(Exception _ex)
  4069. {
  4070. }
  4071. }
  4072.  
  4073. private void drawXPCounter(int paddingX,int paddingY) {
  4074. int x = 0 + (toggleFullscreen ? paddingX - 22 : paddingX);
  4075. int y = 46 + (toggleFullscreen ? paddingY - 39 : paddingY);
  4076. XPcounterSprite[(counterOn || isOnXPCounter(paddingX,paddingY)) ? 1 : 0].drawSprite(x, y);
  4077. }
  4078.  
  4079. private void processXPCounterClick(int paddingX,int paddingY) {
  4080. if (isOnXPCounter(paddingX,paddingY)) {
  4081. menuActionName[menuActionRow] = "Reset XP Total";
  4082. menuActionID[menuActionRow] = 475;
  4083. menuActionRow++;
  4084. menuActionName[menuActionRow] = "Toggle XP Total";
  4085. menuActionID[menuActionRow] = 474;
  4086. menuActionRow++;
  4087. /*menuActionName[1] = xpLock ? "Unlock XP" : "Lock XP";
  4088. menuActionID[1] = 476;
  4089. menuActionRow = 4;*/
  4090. }
  4091. }
  4092.  
  4093. private boolean isOnXPCounter(int paddingX,int paddingY) {
  4094. int x = 0 + (toggleFullscreen ? paddingX - 22 : paddingX);
  4095. int y = 46 + (toggleFullscreen ? paddingY - 39 : paddingY);
  4096. if ((super.mouseX >= xPaddingmapBackImage + x) && (super.mouseX <= xPaddingmapBackImage + x + XPcounterSprite[0].myWidth) && (super.mouseY >= yPaddingmapBackImage + y) && (super.mouseY <= yPaddingmapBackImage + y + XPcounterSprite[0].myHeight))
  4097. return true;
  4098. else
  4099. return false;
  4100. }
  4101.  
  4102. private void drawCounterOnScreen(int paddingX,int paddingY) {
  4103. int x = xPaddingmapBackImage + (toggleFullscreen ? paddingX - 22 : paddingX);
  4104. int y = 46 + (toggleFullscreen ? paddingY - 39 : paddingY);
  4105. XPcounterSprite[2].drawSprite(x-110, y+8);
  4106. int i = normalFont.getTextWidth(Integer.toString(xpCounter));
  4107. normalFont.drawText(0xffffff, "XP:", y+21, x-99);
  4108. normalFont.method385(0xffffff, Integer.toString(xpCounter), y+21, x-15 - i);
  4109. if (expAdded != 0) {
  4110. i = smallFont.getTextWidth(Integer.toString(expAdded)+"xp");
  4111. smallFont.drawText(0xff9933, Integer.toString(expAdded)+"xp", y+21+18+xpAddedPos, x-12-i);
  4112. XPcounterSprite[3].drawSprite(x-12-i -50, y+18+xpAddedPos);
  4113. xpAddedPos += 2;
  4114. if (xpAddedPos >= 50) {
  4115. xpAddedPos = 0;
  4116. expAdded = 0;
  4117. }
  4118. }
  4119. }
  4120.  
  4121. private void doAction(int i)
  4122. {
  4123.  
  4124. if(i < 0)
  4125. return;
  4126. summoningAttack = false;
  4127. if(inputDialogState != 0)
  4128. {
  4129. inputDialogState = 0;
  4130. inputTaken = true;
  4131. }
  4132. int i1 = menuActionCmd1[i];
  4133. int j = menuActionCmd2[i];
  4134. int k = menuActionCmd3[i];
  4135. int l = menuActionID[i];
  4136. if(l >= 2000)
  4137. l -= 2000;
  4138. if (l == 476) {
  4139. alertHandler.close();
  4140. }
  4141. //System.out.println("action-ID: " + l);
  4142. if (l == 474) {//On / Off
  4143. counterOn = !counterOn;// can u open the client.java of ur old client? yeh
  4144. }
  4145. if (l == 475) {//Reset
  4146. xpCounter = 0;
  4147. }
  4148. if (l == 712) {
  4149. //Toggle
  4150. coinToggle = !coinToggle;
  4151. }
  4152. if (l == 713) {
  4153. //withdraw action
  4154. inputTaken = true;
  4155. messagePromptRaised = true;
  4156. amountOrNameInput = "";
  4157. inputDialogState = 0;
  4158. interfaceButtonAction = 557;
  4159. aString1121 = "Enter amount";
  4160. }
  4161. if (l == 714) {
  4162. //add examine option here
  4163. pushMessage(new StringBuilder().append("Your money pouch currently contains ").append(RSInterface.interfaceCache[8135].message).append(" coins.").toString(), 0, "");
  4164. }
  4165. if (l == 715) {
  4166. //add price check action here
  4167. pushMessage("Price Check Coming soon..?", 0, "");
  4168. }
  4169. if(l == 582)
  4170. {
  4171. NPC npc = npcArray[i1];
  4172. if(npc != null)
  4173. {
  4174. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4175. crossX = super.saveClickX;
  4176. crossY = super.saveClickY;
  4177. crossType = 2;
  4178. crossIndex = 0;
  4179. stream.createFrame(57);
  4180. stream.method432(anInt1285);
  4181. stream.method432(i1);
  4182. stream.method431(itemSlotUsedOn);
  4183. stream.method432(anInt1284);
  4184. }
  4185. }
  4186. if(l == 234)
  4187. {
  4188. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4189. if(!flag1)
  4190. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4191. crossX = super.saveClickX;
  4192. crossY = super.saveClickY;
  4193. crossType = 2;
  4194. crossIndex = 0;
  4195. stream.createFrame(236);
  4196. stream.method431(k + baseY);
  4197. stream.writeWord(i1);
  4198. stream.method431(j + baseX);
  4199. }
  4200. if(l == 62 && method66(i1, k, j))
  4201. {
  4202. stream.createFrame(192);
  4203. stream.writeWord(anInt1284);
  4204. stream.method431(i1 >> 14 & 0x7fff);
  4205. stream.method433(k + baseY);
  4206. stream.method431(itemSlotUsedOn);
  4207. stream.method433(j + baseX);
  4208. stream.writeWord(anInt1285);
  4209. }
  4210. if(l == 104) {
  4211. RSInterface rsInterface = RSInterface.interfaceCache[k];
  4212. spellID = rsInterface.id;
  4213. if(!interfaceIsSelected(rsInterface)) {
  4214. pushMessage("You need the correct Magic level and rune requirements to use this spell.", 0, "");
  4215. } else {
  4216. if(!autoCast || (autocastId != spellID)) {
  4217. autoCast = true;
  4218. autocastId = spellID;
  4219. sendPacket185(autocastId,-1,135);
  4220. pushMessage("Autocast spell selected.", 0, "");
  4221. } else if(autocastId == spellID) {
  4222. setAutoCastOff();
  4223. }
  4224. }
  4225. }
  4226. if(l == 511)
  4227. {
  4228. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4229. if(!flag2)
  4230. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4231. crossX = super.saveClickX;
  4232. crossY = super.saveClickY;
  4233. crossType = 2;
  4234. crossIndex = 0;
  4235. stream.createFrame(25);
  4236. stream.method431(anInt1284);
  4237. stream.method432(anInt1285);
  4238. stream.writeWord(i1);
  4239. stream.method432(k + baseY);
  4240. stream.method433(itemSlotUsedOn);
  4241. stream.writeWord(j + baseX);
  4242. }
  4243. if(l == 74)
  4244. {
  4245. stream.createFrame(122);
  4246. stream.method433(k);
  4247. stream.method432(j);
  4248. stream.method431(i1);
  4249. atInventoryLoopCycle = 0;
  4250. atInventoryInterface = k;
  4251. atInventoryIndex = j;
  4252. atInventoryInterfaceType = 2;
  4253. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4254. atInventoryInterfaceType = 1;
  4255. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4256. atInventoryInterfaceType = 3;
  4257. }
  4258. if (l == 315) {
  4259. sendPacket185(k,-1,135);
  4260. }
  4261. if(l == 561)
  4262. {
  4263. Player player = playerArray[i1];
  4264. if(player != null)
  4265. {
  4266. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4267. crossX = super.saveClickX;
  4268. crossY = super.saveClickY;
  4269. crossType = 2;
  4270. crossIndex = 0;
  4271. anInt1188 += i1;
  4272. if(anInt1188 >= 90)
  4273. {
  4274. stream.createFrame(136);
  4275. anInt1188 = 0;
  4276. }
  4277. stream.createFrame(128);
  4278. stream.writeWord(i1);
  4279. }
  4280. }
  4281. if(l == 20)
  4282. {
  4283. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4284. if(class30_sub2_sub4_sub1_sub1_1 != null)
  4285. {
  4286. 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]);
  4287. crossX = super.saveClickX;
  4288. crossY = super.saveClickY;
  4289. crossType = 2;
  4290. crossIndex = 0;
  4291. stream.createFrame(155);
  4292. stream.method431(i1);
  4293. }
  4294. }
  4295. if(l == 779)
  4296. {
  4297. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4298. if(class30_sub2_sub4_sub1_sub2_1 != null)
  4299. {
  4300. 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]);
  4301. crossX = super.saveClickX;
  4302. crossY = super.saveClickY;
  4303. crossType = 2;
  4304. crossIndex = 0;
  4305. stream.createFrame(153);
  4306. stream.method431(i1);
  4307. }
  4308. }
  4309. if(l == 516)
  4310. if(!contextMenuOpen)
  4311. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4312. else
  4313. worldController.method312(k - 4, j - 4);
  4314. if(l == 1062)
  4315. {
  4316. anInt924 += baseX;
  4317. if(anInt924 >= 113)
  4318. {
  4319. stream.createFrame(183);
  4320. stream.writeDWordBigEndian(0xe63271);
  4321. anInt924 = 0;
  4322. }
  4323. method66(i1, k, j);
  4324. stream.createFrame(228);
  4325. stream.method432(i1 >> 14 & 0x7fff);
  4326. stream.method432(k + baseY);
  4327. stream.writeWord(j + baseX);
  4328. }
  4329. if(l == 679 && !aBoolean1149)
  4330. {
  4331. stream.createFrame(40);
  4332. stream.writeWord(k);
  4333. aBoolean1149 = true;
  4334. }
  4335. if(l == 431)
  4336. {
  4337. stream.createFrame(129);
  4338. stream.method432(j);
  4339. stream.writeWord(k);
  4340. stream.method432(i1);
  4341. atInventoryLoopCycle = 0;
  4342. atInventoryInterface = k;
  4343. atInventoryIndex = j;
  4344. atInventoryInterfaceType = 2;
  4345. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4346. atInventoryInterfaceType = 1;
  4347. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4348. atInventoryInterfaceType = 3;
  4349. }
  4350. if(l == 337 || l == 42 || l == 792 || l == 322)
  4351. {
  4352. String s = menuActionName[i];
  4353. int k1 = s.indexOf("@whi@");
  4354. if(k1 != -1)
  4355. {
  4356. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4357. if(l == 337)
  4358. addFriend(l3);
  4359. if(l == 42)
  4360. addIgnore(l3);
  4361. if(l == 792)
  4362. delFriend(l3);
  4363. if(l == 322)
  4364. delIgnore(l3);
  4365. }
  4366. }
  4367. if(l == 53)
  4368. {
  4369. stream.createFrame(135);
  4370. stream.method431(j);
  4371. stream.method432(k);
  4372. stream.method431(i1);
  4373. atInventoryLoopCycle = 0;
  4374. atInventoryInterface = k;
  4375. atInventoryIndex = j;
  4376. atInventoryInterfaceType = 2;
  4377. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4378. atInventoryInterfaceType = 1;
  4379. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4380. atInventoryInterfaceType = 3;
  4381. }
  4382. if(l == 539)
  4383. {
  4384. stream.createFrame(16);
  4385. stream.method432(i1);
  4386. stream.method433(j);
  4387. stream.method433(k);
  4388. atInventoryLoopCycle = 0;
  4389. atInventoryInterface = k;
  4390. atInventoryIndex = j;
  4391. atInventoryInterfaceType = 2;
  4392. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4393. atInventoryInterfaceType = 1;
  4394. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4395. atInventoryInterfaceType = 3;
  4396. }
  4397. if(l == 484 || l == 6)
  4398. {
  4399. String s1 = menuActionName[i];
  4400. int l1 = s1.indexOf("@whi@");
  4401. if(l1 != -1)
  4402. {
  4403. s1 = s1.substring(l1 + 5).trim();
  4404. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4405. boolean flag9 = false;
  4406. for(int j3 = 0; j3 < playerCount; j3++)
  4407. {
  4408. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4409. 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))
  4410. continue;
  4411. 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]);
  4412. if(l == 484)
  4413. {
  4414. stream.createFrame(139);
  4415. stream.method431(playerIndices[j3]);
  4416. }
  4417. if(l == 6)
  4418. {
  4419. anInt1188 += i1;
  4420. if(anInt1188 >= 90)
  4421. {
  4422. stream.createFrame(136);
  4423. anInt1188 = 0;
  4424. }
  4425. stream.createFrame(128);
  4426. stream.writeWord(playerIndices[j3]);
  4427. }
  4428. flag9 = true;
  4429. break;
  4430. }
  4431.  
  4432. if(!flag9)
  4433. pushMessage("Unable to find " + s7, 0, "");
  4434. }
  4435. }
  4436. if(l == 485) {
  4437. openUpWebSite(linkInText);
  4438. }
  4439. if(l == 870)
  4440. {
  4441. stream.createFrame(53);
  4442. stream.writeWord(j);
  4443. stream.method432(itemSlotUsedOn);
  4444. stream.method433(i1);
  4445. stream.writeWord(anInt1284);
  4446. stream.method431(anInt1285);
  4447. stream.writeWord(k);
  4448. atInventoryLoopCycle = 0;
  4449. atInventoryInterface = k;
  4450. atInventoryIndex = j;
  4451. atInventoryInterfaceType = 2;
  4452. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4453. atInventoryInterfaceType = 1;
  4454. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4455. atInventoryInterfaceType = 3;
  4456. }
  4457. if(l == 847)
  4458. {
  4459. stream.createFrame(87);
  4460. stream.method432(i1);
  4461. stream.writeWord(k);
  4462. stream.method432(j);
  4463. atInventoryLoopCycle = 0;
  4464. atInventoryInterface = k;
  4465. atInventoryIndex = j;
  4466. atInventoryInterfaceType = 2;
  4467. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4468. atInventoryInterfaceType = 1;
  4469. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4470. atInventoryInterfaceType = 3;
  4471. }
  4472. if(l == 626)
  4473. {
  4474. RSInterface rsInterface = RSInterface.interfaceCache[k];
  4475. spellSelected = 1;
  4476. spellID = rsInterface.id;
  4477. anInt1137 = k;
  4478. spellUsableOn = rsInterface.spellUsableOn;
  4479. itemSelected = 0;
  4480. needDrawTabArea = true;
  4481. String s4 = rsInterface.selectedActionName;
  4482. if(s4.indexOf(" ") != -1)
  4483. s4 = s4.substring(0, s4.indexOf(" "));
  4484. String s8 = rsInterface.selectedActionName;
  4485. if(s8.indexOf(" ") != -1)
  4486. s8 = s8.substring(s8.indexOf(" ") + 1);
  4487. spellTooltip = s4 + " " + rsInterface.spellName + " " + s8;
  4488. if(spellUsableOn == 16)
  4489. {
  4490. needDrawTabArea = true;
  4491. tabID = 3;
  4492. tabAreaAltered = true;
  4493. }
  4494. return;
  4495. }
  4496. if (l == 1053) {
  4497. stream.createFrame(185);
  4498. stream.writeWord(9999);
  4499. }
  4500. if(l == 78)
  4501. {
  4502. stream.createFrame(117);
  4503. stream.method433(k);
  4504. stream.method433(i1);
  4505. stream.method431(j);
  4506. atInventoryLoopCycle = 0;
  4507. atInventoryInterface = k;
  4508. atInventoryIndex = j;
  4509. atInventoryInterfaceType = 2;
  4510. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4511. atInventoryInterfaceType = 1;
  4512. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4513. atInventoryInterfaceType = 3;
  4514. }
  4515. if(l == 27)
  4516. {
  4517. Player player = playerArray[i1];
  4518. if(player != null)
  4519. {
  4520. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4521. crossX = super.saveClickX;
  4522. crossY = super.saveClickY;
  4523. crossType = 2;
  4524. crossIndex = 0;
  4525. anInt986 += i1;
  4526. if(anInt986 >= 54)
  4527. {
  4528. stream.createFrame(189);
  4529. stream.writeWordBigEndian(234);
  4530. anInt986 = 0;
  4531. }
  4532. stream.createFrame(73);
  4533. stream.method431(i1);
  4534. }
  4535. }
  4536. if(l == 213)
  4537. {
  4538. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4539. if(!flag3)
  4540. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4541. crossX = super.saveClickX;
  4542. crossY = super.saveClickY;
  4543. crossType = 2;
  4544. crossIndex = 0;
  4545. stream.createFrame(79);
  4546. stream.method431(k + baseY);
  4547. stream.writeWord(i1);
  4548. stream.method432(j + baseX);
  4549. }
  4550. if(l == 632)
  4551. {
  4552. stream.createFrame(145);
  4553. stream.method432(k);
  4554. stream.method432(j);
  4555. stream.method432(i1);
  4556. System.out.println("k: " + k + ", j: " + j + ", i1: " + i1);
  4557. atInventoryLoopCycle = 0;
  4558. atInventoryInterface = k;
  4559. atInventoryIndex = j;
  4560. atInventoryInterfaceType = 2;
  4561. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4562. atInventoryInterfaceType = 1;
  4563. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4564. atInventoryInterfaceType = 3;
  4565. }
  4566. if(l == 1011) {//combat
  4567. setTab(0);
  4568. }
  4569. if(l == 1012) {//skills
  4570. setTab(1);
  4571. }
  4572. if(l == 1013) {//quests
  4573. setTab(2);
  4574. }
  4575. if(l == 1014) {//quests
  4576. setTab(3);
  4577. }
  4578. if(l == 1015) {//worn
  4579. setTab(4);
  4580. }
  4581. if(l == 1016) {//prayer
  4582. setTab(5);
  4583. }
  4584. if(l == 1017) {//Modern - 1151
  4585. setTab(6);
  4586. }
  4587. if(l == 1018) {//Clan chat
  4588. setTab(7);
  4589. }
  4590. if(l == 1019) {//friends
  4591. setTab(8);
  4592. }
  4593. if(l == 1020) {//ignore
  4594. setTab(9);
  4595. }
  4596. if(l == 1021) {//logout
  4597. setTab(10);
  4598. }
  4599. if(l == 1022) {//Options
  4600. setTab(11);
  4601. }
  4602. if(l == 1023) {//Emotes
  4603. setTab(12);
  4604. }
  4605. if(l == 1024) {//Music
  4606. setTab(13);
  4607. }
  4608. if(l == 1042) {//Task system
  4609. setTab(14);
  4610. }
  4611. if(l == 1043) {//Objectives
  4612. setTab(16);
  4613. }
  4614. if(l == 1044) {//Notes
  4615. setTab(15);
  4616. }
  4617. if(l == 1045) {//Toggle quick prayers / curses
  4618. if(openInterfaceID != -1)
  4619. pushMessage("Please close the window first.", 0, "");
  4620. else {
  4621. if(getOrbValues(1,null)[0] > 0)
  4622. handleQuickAidsActive();
  4623. else
  4624. pushMessage("You need to recharge your Prayer at an alter.", 0, "");
  4625. }
  4626. }
  4627. if(l == 1046) {//Select quick prayers / curses
  4628. if(!loadTickSelection) {
  4629. turnOffPrayers();
  4630. turnOffCurses();
  4631. turnOffQuickTicks();
  4632. configureQuickTicks();
  4633. loadTickSelection = true;
  4634. }
  4635. toggleQuickAidsSelection();
  4636. }
  4637. if(l == 1047) {//Toggle run mode
  4638. if(getOrbValues(2,null)[0] > 0)
  4639. orbToggle[2] = !orbToggle[2];
  4640. else
  4641. pushMessage("You don't have enough energy left to run!", 0, "");
  4642. sendPacket185(152,173,169);
  4643. }
  4644. if(l == 1048) {//Rest
  4645. pushMessage("<col=225>Type ::rest To rest", 0, "");
  4646. }
  4647. if(l == 1049) {//compass
  4648. compassRotation = 0;
  4649. }
  4650. if(l == 1050) {//world map
  4651. launchURL("http://img707.imageshack.us/img707/9984/317rsmapreal.jpg");
  4652. pushMessage("<col=225>You open the world map...", 0, "");
  4653. }
  4654. if(l == 1051) {//Advisor
  4655. launchURL("www.ruinedscape.webs.com");
  4656. pushMessage("<col=225>For Advice Ask For Help On The Forums.", 0, "");
  4657. }
  4658. if(l == 1052 && orbToggle[0]) {//cure me
  4659. pushMessage("<col=225>Coming soon!", 0, "");
  4660. }/*
  4661. if(l == 1053) {//summoning - Select left-click option DISABLED CUZ CRASH
  4662. stream.createFrame(185);
  4663. stream.writeWord(9993);
  4664. }
  4665. if(l == 1054) {//summoning - Call Follower
  4666. stream.createFrame(185);
  4667. stream.writeWord(9994);
  4668. }
  4669. if(l == 1055) {//summoning - Dismiss
  4670. stream.createFrame(185);
  4671. stream.writeWord(9995);
  4672. }
  4673. if(l == 1056) {//summoning - Take BoB
  4674. stream.createFrame(185);
  4675. stream.writeWord(9996);
  4676. }
  4677. if(l == 1057) {//summoning - Renew Familiar
  4678. stream.createFrame(185);
  4679. stream.writeWord(9997);
  4680. }
  4681. if(l == 1058) {//summoning - Attack
  4682. stream.createFrame(185);
  4683. stream.writeWord(9998);
  4684. }
  4685. if(l == 1059) {//summoning - Follower Details
  4686. stream.createFrame(185);
  4687. stream.writeWord(9999);
  4688. }*/
  4689. if(l == 1003) {
  4690. clanChatMode = 2;
  4691. aBoolean1233 = true;
  4692. inputTaken = true;
  4693. }
  4694. if(l == 1002) {
  4695. clanChatMode = 1;
  4696. aBoolean1233 = true;
  4697. inputTaken = true;
  4698. }
  4699. if(l == 1001) {
  4700. clanChatMode = 0;
  4701. aBoolean1233 = true;
  4702. inputTaken = true;
  4703. }
  4704. if(l == 1000) {
  4705. cButtonCPos = 4;
  4706. chatTypeView = 11;
  4707. aBoolean1233 = true;
  4708. inputTaken = true;
  4709. }
  4710. if(l == 999) {
  4711. cButtonCPos = 0;
  4712. chatTypeView = 0;
  4713. aBoolean1233 = true;
  4714. inputTaken = true;
  4715. }
  4716. if(l == 998) {
  4717. cButtonCPos = 1;
  4718. chatTypeView = 5;
  4719. aBoolean1233 = true;
  4720. inputTaken = true;
  4721. }
  4722. if(l == 997) {
  4723. publicChatMode = 3;
  4724. aBoolean1233 = true;
  4725. inputTaken = true;
  4726. }
  4727. if(l == 996) {
  4728. publicChatMode = 2;
  4729. aBoolean1233 = true;
  4730. inputTaken = true;
  4731. }
  4732. if(l == 995) {
  4733. publicChatMode = 1;
  4734. aBoolean1233 = true;
  4735. inputTaken = true;
  4736. }
  4737. if(l == 994) {
  4738. publicChatMode = 0;
  4739. aBoolean1233 = true;
  4740. inputTaken = true;
  4741. }
  4742. if(l == 993) {
  4743. cButtonCPos = 2;
  4744. chatTypeView = 1;
  4745. aBoolean1233 = true;
  4746. inputTaken = true;
  4747. }
  4748. if(l == 992) {
  4749. privateChatMode = 2;
  4750. aBoolean1233 = true;
  4751. inputTaken = true;
  4752. }
  4753. if(l == 991) {
  4754. privateChatMode = 1;
  4755. aBoolean1233 = true;
  4756. inputTaken = true;
  4757. }
  4758. if(l == 990) {
  4759. privateChatMode = 0;
  4760. aBoolean1233 = true;
  4761. inputTaken = true;
  4762. }
  4763. if(l == 989) {
  4764. cButtonCPos = 3;
  4765. chatTypeView = 2;
  4766. aBoolean1233 = true;
  4767. inputTaken = true;
  4768. }
  4769. if(l == 987) {
  4770. tradeMode = 2;
  4771. aBoolean1233 = true;
  4772. inputTaken = true;
  4773. }
  4774. if(l == 986) {
  4775. tradeMode = 1;
  4776. aBoolean1233 = true;
  4777. inputTaken = true;
  4778. }
  4779. if(l == 985) {
  4780. tradeMode = 0;
  4781. aBoolean1233 = true;
  4782. inputTaken = true;
  4783. }
  4784. if(l == 984) {
  4785. cButtonCPos = 5;
  4786. chatTypeView = 3;
  4787. aBoolean1233 = true;
  4788. inputTaken = true;
  4789. }
  4790. if(l == 983) {
  4791. duelMode = 2;
  4792. aBoolean1233 = true;
  4793. inputTaken = true;
  4794. }
  4795. if(l == 982) {
  4796. duelMode = 1;
  4797. aBoolean1233 = true;
  4798. inputTaken = true;
  4799. }
  4800. if(l == 981) {
  4801. duelMode = 0;
  4802. aBoolean1233 = true;
  4803. inputTaken = true;
  4804. }
  4805. if(l == 980) {
  4806. cButtonCPos = 6;
  4807. chatTypeView = 4;
  4808. aBoolean1233 = true;
  4809. inputTaken = true;
  4810. }
  4811. if(l == 493)
  4812. {
  4813. stream.createFrame(75);
  4814. stream.method433(k);
  4815. stream.method431(j);
  4816. stream.method432(i1);
  4817. atInventoryLoopCycle = 0;
  4818. atInventoryInterface = k;
  4819. atInventoryIndex = j;
  4820. atInventoryInterfaceType = 2;
  4821. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4822. atInventoryInterfaceType = 1;
  4823. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4824. atInventoryInterfaceType = 3;
  4825. }
  4826. if(l == 652)
  4827. {
  4828. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4829. if(!flag4)
  4830. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4831. crossX = super.saveClickX;
  4832. crossY = super.saveClickY;
  4833. crossType = 2;
  4834. crossIndex = 0;
  4835. stream.createFrame(156);
  4836. stream.method432(j + baseX);
  4837. stream.method431(k + baseY);
  4838. stream.method433(i1);
  4839. }
  4840. if(l == 94)
  4841. {
  4842. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4843. if(!flag5)
  4844. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4845. crossX = super.saveClickX;
  4846. crossY = super.saveClickY;
  4847. crossType = 2;
  4848. crossIndex = 0;
  4849. stream.createFrame(181);
  4850. stream.method431(k + baseY);
  4851. stream.writeWord(i1);
  4852. stream.method431(j + baseX);
  4853. stream.method432(anInt1137);
  4854. }
  4855. if(l == 646) {
  4856. sendPacket185(k,-1,646);
  4857. }
  4858. if(l == 225)
  4859. {
  4860. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4861. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4862. {
  4863. 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]);
  4864. crossX = super.saveClickX;
  4865. crossY = super.saveClickY;
  4866. crossType = 2;
  4867. crossIndex = 0;
  4868. anInt1226 += i1;
  4869. if(anInt1226 >= 85)
  4870. {
  4871. stream.createFrame(230);
  4872. stream.writeWordBigEndian(239);
  4873. anInt1226 = 0;
  4874. }
  4875. stream.createFrame(17);
  4876. stream.method433(i1);
  4877. }
  4878. }
  4879. if(l == 965)
  4880. {
  4881. NPC npc = npcArray[i1];
  4882. if(npc != null)
  4883. {
  4884. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4885. crossX = super.saveClickX;
  4886. crossY = super.saveClickY;
  4887. crossType = 2;
  4888. crossIndex = 0;
  4889. anInt1134++;
  4890. if(anInt1134 >= 96)
  4891. {
  4892. stream.createFrame(152);
  4893. stream.writeWordBigEndian(88);
  4894. anInt1134 = 0;
  4895. }
  4896. stream.createFrame(21);
  4897. stream.writeWord(i1);
  4898. }
  4899. }
  4900. if(l == 413)
  4901. {
  4902. NPC npc = npcArray[i1];
  4903. if(npc != null)
  4904. {
  4905. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4906. crossX = super.saveClickX;
  4907. crossY = super.saveClickY;
  4908. crossType = 2;
  4909. crossIndex = 0;
  4910. stream.createFrame(131);
  4911. stream.method433(i1);
  4912. stream.method432(anInt1137);
  4913. }
  4914. }
  4915. if(l == 200)
  4916. clearTopInterfaces();
  4917. if(l == 1025)
  4918. {
  4919. NPC npc = npcArray[i1];
  4920. if(npc != null)
  4921. {
  4922. EntityDef entityDef = npc.desc;
  4923. if(entityDef.childrenIDs != null)
  4924. entityDef = entityDef.method161();
  4925. if(entityDef != null)
  4926. {
  4927. String s9;
  4928. if(entityDef.description != null)
  4929. s9 = new String(entityDef.description);
  4930. else
  4931. s9 = "It's a " + entityDef.name + ".";
  4932. pushMessage(s9, 0, "");
  4933. }
  4934. }
  4935. }
  4936. if(l == 900)
  4937. {
  4938. method66(i1, k, j);
  4939. stream.createFrame(252);
  4940. stream.method433(i1 >> 14 & 0x7fff);
  4941. stream.method431(k + baseY);
  4942. stream.method432(j + baseX);
  4943. }
  4944. if(l == 412)
  4945. {
  4946. NPC npc = npcArray[i1];
  4947. if(npc != null)
  4948. {
  4949. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4950. crossX = super.saveClickX;
  4951. crossY = super.saveClickY;
  4952. crossType = 2;
  4953. crossIndex = 0;
  4954. stream.createFrame(72);
  4955. stream.method432(i1);
  4956. //System.out.println("i1: " + i1);
  4957. }
  4958. }
  4959. if(l == 365)
  4960. {
  4961. Player player = playerArray[i1];
  4962. if(player != null)
  4963. {
  4964. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4965. crossX = super.saveClickX;
  4966. crossY = super.saveClickY;
  4967. crossType = 2;
  4968. crossIndex = 0;
  4969. stream.createFrame(249);
  4970. stream.method432(i1);
  4971. stream.method431(anInt1137);
  4972. }
  4973. }
  4974. if(l == 729)
  4975. {
  4976. Player player = playerArray[i1];
  4977. if(player != null)
  4978. {
  4979. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4980. crossX = super.saveClickX;
  4981. crossY = super.saveClickY;
  4982. crossType = 2;
  4983. crossIndex = 0;
  4984. stream.createFrame(39);
  4985. stream.method431(i1);
  4986. }
  4987. }
  4988. if(l == 577)
  4989. {
  4990. Player player = playerArray[i1];
  4991. if(player != null)
  4992. {
  4993. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4994. crossX = super.saveClickX;
  4995. crossY = super.saveClickY;
  4996. crossType = 2;
  4997. crossIndex = 0;
  4998. stream.createFrame(139);
  4999. stream.method431(i1);
  5000. }
  5001. }
  5002. if(l == 956 && method66(i1, k, j))
  5003. {
  5004. stream.createFrame(35);
  5005. stream.method431(j + baseX);
  5006. stream.method432(anInt1137);
  5007. stream.method432(k + baseY);
  5008. stream.method431(i1 >> 14 & 0x7fff);
  5009. }
  5010. if(l == 567)
  5011. {
  5012. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5013. if(!flag6)
  5014. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5015. crossX = super.saveClickX;
  5016. crossY = super.saveClickY;
  5017. crossType = 2;
  5018. crossIndex = 0;
  5019. stream.createFrame(23);
  5020. stream.method431(k + baseY);
  5021. stream.method431(i1);
  5022. stream.method431(j + baseX);
  5023. }
  5024. if(l == 867)
  5025. {
  5026. if((i1 & 3) == 0)
  5027. anInt1175++;
  5028. if(anInt1175 >= 59)
  5029. {
  5030. stream.createFrame(200);
  5031. stream.writeWord(25501);
  5032. anInt1175 = 0;
  5033. }
  5034. stream.createFrame(43);
  5035. stream.method431(k);
  5036. stream.method432(i1);
  5037. stream.method432(j);
  5038. atInventoryLoopCycle = 0;
  5039. atInventoryInterface = k;
  5040. atInventoryIndex = j;
  5041. atInventoryInterfaceType = 2;
  5042. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5043. atInventoryInterfaceType = 1;
  5044. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5045. atInventoryInterfaceType = 3;
  5046. }
  5047. if(l == 543)
  5048. {
  5049. stream.createFrame(237);
  5050. stream.writeWord(j);
  5051. stream.method432(i1);
  5052. stream.writeWord(k);
  5053. stream.method432(anInt1137);
  5054. System.out.println("j: " + j + ", i1: " + i1 + ", k: " + k + ", anInt1137: " + anInt1137);
  5055. atInventoryLoopCycle = 0;
  5056. atInventoryInterface = k;
  5057. atInventoryIndex = j;
  5058. atInventoryInterfaceType = 2;
  5059. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5060. atInventoryInterfaceType = 1;
  5061. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5062. atInventoryInterfaceType = 3;
  5063. }
  5064. if(l == 606)
  5065. {
  5066. String s2 = menuActionName[i];
  5067. int j2 = s2.indexOf("@whi@");
  5068. if(j2 != -1)
  5069. if(openInterfaceID == -1)
  5070. {
  5071. clearTopInterfaces();
  5072. reportAbuseInput = s2.substring(j2 + 5).trim();
  5073. canMute = false;
  5074. canBan = false;
  5075. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  5076. {
  5077. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  5078. continue;
  5079. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5080. break;
  5081. }
  5082.  
  5083. } else
  5084. {
  5085. pushMessage("You Need to Be A staff Member to View Staff Control Pannel.", 0, "");
  5086. }
  5087. }
  5088. if(l == 491)
  5089. {
  5090. Player player = playerArray[i1];
  5091. if(player != null)
  5092. {
  5093. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  5094. crossX = super.saveClickX;
  5095. crossY = super.saveClickY;
  5096. crossType = 2;
  5097. crossIndex = 0;
  5098. stream.createFrame(14);
  5099. stream.method432(anInt1284);
  5100. stream.writeWord(i1);
  5101. stream.writeWord(anInt1285);
  5102. stream.method431(itemSlotUsedOn);
  5103. }
  5104. }
  5105. if(l == 639)
  5106. {
  5107. String s3 = menuActionName[i];
  5108. int k2 = s3.indexOf("@whi@");
  5109. if(k2 != -1)
  5110. {
  5111. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5112. int k3 = -1;
  5113. for(int i4 = 0; i4 < friendsCount; i4++)
  5114. {
  5115. if(friendsListAsLongs[i4] != l4 && l != 640)
  5116. continue;
  5117. k3 = i4;
  5118. break;
  5119. }
  5120. System.out.println("k3: " + k3);
  5121. if(k3 != -1)
  5122. {
  5123. inputTaken = true;
  5124. inputDialogState = 0;
  5125. messagePromptRaised = true;
  5126. promptInput = "";
  5127. friendsListAction = 3;
  5128. aLong953 = friendsListAsLongs[k3];
  5129. aString1121 = "Enter message to send to " + friendsList[k3];
  5130. }
  5131. }
  5132. }
  5133. if(l == 454)
  5134. {
  5135. stream.createFrame(41);
  5136. stream.writeWord(i1);
  5137. stream.method432(j);
  5138. stream.method432(k);
  5139. atInventoryLoopCycle = 0;
  5140. atInventoryInterface = k;
  5141. atInventoryIndex = j;
  5142. atInventoryInterfaceType = 2;
  5143. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5144. atInventoryInterfaceType = 1;
  5145. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5146. atInventoryInterfaceType = 3;
  5147. }
  5148. if(l == 478)
  5149. {
  5150. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5151. if(class30_sub2_sub4_sub1_sub1_7 != null)
  5152. {
  5153. 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]);
  5154. crossX = super.saveClickX;
  5155. crossY = super.saveClickY;
  5156. crossType = 2;
  5157. crossIndex = 0;
  5158. if((i1 & 3) == 0)
  5159. anInt1155++;
  5160. if(anInt1155 >= 53)
  5161. {
  5162. stream.createFrame(85);
  5163. stream.writeWordBigEndian(66);
  5164. anInt1155 = 0;
  5165. }
  5166. stream.createFrame(18);
  5167. stream.method431(i1);
  5168. }
  5169. }
  5170. if(l == 113)
  5171. {
  5172. method66(i1, k, j);
  5173. stream.createFrame(70);
  5174. stream.method431(j + baseX);
  5175. stream.writeWord(k + baseY);
  5176. stream.method433(i1 >> 14 & 0x7fff);
  5177. }
  5178. if(l == 872)
  5179. {
  5180. method66(i1, k, j);
  5181. stream.createFrame(234);
  5182. stream.method433(j + baseX);
  5183. stream.method432(i1 >> 14 & 0x7fff);
  5184. stream.method433(k + baseY);
  5185. }
  5186. if(l == 502)
  5187. {
  5188. method66(i1, k, j);
  5189. stream.createFrame(132);
  5190. stream.method433(j + baseX);
  5191. stream.writeWord(i1 >> 14 & 0x7fff);
  5192. stream.method432(k + baseY);
  5193. }
  5194. if(l == 1125)
  5195. {
  5196. ItemDef itemDef = ItemDef.forID(i1);
  5197. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5198. String s5;
  5199. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5200. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5201. else
  5202. if(itemDef.description != null)
  5203. s5 = new String(itemDef.description);
  5204. else
  5205. s5 = "It's a " + itemDef.name + " ModelId: " + itemDef.modelID + " .";
  5206. pushMessage(s5, 0, "");
  5207. }
  5208. if(l == 169) {
  5209. sendPacket185(k,-1,169);
  5210. }
  5211. if(l == 447)
  5212. {
  5213. itemSelected = 1;
  5214. itemSlotUsedOn = j;
  5215. anInt1284 = k;
  5216. anInt1285 = i1;
  5217. selectedItemName = ItemDef.forID(i1).name;
  5218. spellSelected = 0;
  5219. summoningAttack = false;
  5220. needDrawTabArea = true;
  5221. return;
  5222. }
  5223. if(l == 1226)
  5224. {
  5225. int j1 = i1 >> 14 & 0x7fff;
  5226. ObjectDef class46 = ObjectDef.forID(j1);
  5227. String s10;
  5228. if(class46.description != null)
  5229. s10 = new String(class46.description);
  5230. else
  5231. s10 = "It's a " + class46.name + ".";
  5232. pushMessage(s10, 0, "");
  5233. }
  5234. if(l == 244)
  5235. {
  5236. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5237. if(!flag7)
  5238. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5239. crossX = super.saveClickX;
  5240. crossY = super.saveClickY;
  5241. crossType = 2;
  5242. crossIndex = 0;
  5243. stream.createFrame(253);
  5244. stream.method431(j + baseX);
  5245. stream.method433(k + baseY);
  5246. stream.method432(i1);
  5247. }
  5248. if(l == 1448)
  5249. {
  5250. ItemDef itemDef_1 = ItemDef.forID(i1);
  5251. String s6;
  5252. if(itemDef_1.description != null)
  5253. s6 = new String(itemDef_1.description);
  5254. else
  5255. s6 = "It's a " + itemDef_1.name + ".";
  5256. pushMessage(s6, 0, "");
  5257. }
  5258. itemSelected = 0;
  5259. spellSelected = 0;
  5260. needDrawTabArea = true;
  5261.  
  5262. }
  5263.  
  5264. private void method70()
  5265. {
  5266. anInt1251 = 0;
  5267. int j = (myPlayer.x >> 7) + baseX;
  5268. int k = (myPlayer.y >> 7) + baseY;
  5269. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5270. anInt1251 = 1;
  5271. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5272. anInt1251 = 1;
  5273. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5274. anInt1251 = 0;
  5275. }
  5276.  
  5277. public void run() {
  5278. if(drawFlames) {
  5279. drawFlames();
  5280. } else {
  5281. super.run();
  5282. }
  5283. }
  5284.  
  5285. private void build3dScreenMenu()
  5286. {
  5287. if(itemSelected == 0 && spellSelected == 0)
  5288. {
  5289. menuActionName[menuActionRow] = "Walk here";
  5290. menuActionID[menuActionRow] = 516;
  5291. menuActionCmd2[menuActionRow] = super.mouseX;
  5292. menuActionCmd3[menuActionRow] = super.mouseY;
  5293. menuActionRow++;
  5294. }
  5295. int j = -1;
  5296. for(int k = 0; k < Model.anInt1687; k++)
  5297. {
  5298. int l = Model.anIntArray1688[k];
  5299. int i1 = l & 0x7f;
  5300. int j1 = l >> 7 & 0x7f;
  5301. int k1 = l >> 29 & 3;
  5302. int l1 = l >> 14 & 0x7fff;
  5303. if(l == j)
  5304. continue;
  5305. j = l;
  5306. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  5307. {
  5308. ObjectDef class46 = ObjectDef.forID(l1);
  5309. if(class46.childrenIDs != null)
  5310. class46 = class46.method580();
  5311. if(class46 == null)
  5312. continue;
  5313. if(itemSelected == 1)
  5314. {
  5315. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  5316. menuActionID[menuActionRow] = 62;
  5317. menuActionCmd1[menuActionRow] = l;
  5318. menuActionCmd2[menuActionRow] = i1;
  5319. menuActionCmd3[menuActionRow] = j1;
  5320. menuActionRow++;
  5321. } else
  5322. if(spellSelected == 1)
  5323. {
  5324. if((spellUsableOn & 4) == 4)
  5325. {
  5326. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5327. menuActionID[menuActionRow] = 956;
  5328. menuActionCmd1[menuActionRow] = l;
  5329. menuActionCmd2[menuActionRow] = i1;
  5330. menuActionCmd3[menuActionRow] = j1;
  5331. menuActionRow++;
  5332. }
  5333. } else
  5334. {
  5335. if(class46.itemActions != null)
  5336. {
  5337. for(int i2 = 4; i2 >= 0; i2--)
  5338. if(class46.itemActions[i2] != null)
  5339. {
  5340. menuActionName[menuActionRow] = class46.itemActions[i2] + " @cya@" + class46.name;
  5341. if(i2 == 0)
  5342. menuActionID[menuActionRow] = 502;
  5343. if(i2 == 1)
  5344. menuActionID[menuActionRow] = 900;
  5345. if(i2 == 2)
  5346. menuActionID[menuActionRow] = 113;
  5347. if(i2 == 3)
  5348. menuActionID[menuActionRow] = 872;
  5349. if(i2 == 4)
  5350. menuActionID[menuActionRow] = 1062;
  5351. menuActionCmd1[menuActionRow] = l;
  5352. menuActionCmd2[menuActionRow] = i1;
  5353. menuActionCmd3[menuActionRow] = j1;
  5354. menuActionRow++;
  5355. }
  5356.  
  5357. }
  5358. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + ((myPrivilege != 0) ? ", " + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)" : "");
  5359. menuActionID[menuActionRow] = 1226;
  5360. menuActionCmd1[menuActionRow] = class46.type << 14;
  5361. menuActionCmd2[menuActionRow] = i1;
  5362. menuActionCmd3[menuActionRow] = j1;
  5363. menuActionRow++;
  5364. }
  5365. }
  5366. if(k1 == 1)
  5367. {
  5368. NPC npc = npcArray[l1];
  5369. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  5370. {
  5371. for(int j2 = 0; j2 < npcCount; j2++)
  5372. {
  5373. NPC npc2 = npcArray[npcIndices[j2]];
  5374. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5375. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5376. }
  5377.  
  5378. for(int l2 = 0; l2 < playerCount; l2++)
  5379. {
  5380. Player player = playerArray[playerIndices[l2]];
  5381. if(player != null && player.x == npc.x && player.y == npc.y)
  5382. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5383. }
  5384.  
  5385. }
  5386. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5387. }
  5388. if(k1 == 0)
  5389. {
  5390. Player player = playerArray[l1];
  5391. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  5392. {
  5393. for(int k2 = 0; k2 < npcCount; k2++)
  5394. {
  5395. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5396. 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)
  5397. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5398. }
  5399.  
  5400. for(int i3 = 0; i3 < playerCount; i3++)
  5401. {
  5402. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5403. 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)
  5404. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5405. }
  5406.  
  5407. }
  5408. buildAtPlayerMenu(i1, l1, player, j1);
  5409. }
  5410. if(k1 == 3)
  5411. {
  5412. NodeList class19 = groundArray[plane][i1][j1];
  5413. if(class19 != null)
  5414. {
  5415. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5416. {
  5417. ItemDef itemDef = ItemDef.forID(item.ID);
  5418. if(itemSelected == 1)
  5419. {
  5420. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5421. menuActionID[menuActionRow] = 511;
  5422. menuActionCmd1[menuActionRow] = item.ID;
  5423. menuActionCmd2[menuActionRow] = i1;
  5424. menuActionCmd3[menuActionRow] = j1;
  5425. menuActionRow++;
  5426. } else
  5427. if(spellSelected == 1)
  5428. {
  5429. if((spellUsableOn & 1) == 1)
  5430. {
  5431. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5432. menuActionID[menuActionRow] = 94;
  5433. menuActionCmd1[menuActionRow] = item.ID;
  5434. menuActionCmd2[menuActionRow] = i1;
  5435. menuActionCmd3[menuActionRow] = j1;
  5436. menuActionRow++;
  5437. }
  5438. } else
  5439. {
  5440. for(int j3 = 4; j3 >= 0; j3--)
  5441. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5442. {
  5443. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5444. if(j3 == 0)
  5445. menuActionID[menuActionRow] = 652;
  5446. if(j3 == 1)
  5447. menuActionID[menuActionRow] = 567;
  5448. if(j3 == 2)
  5449. menuActionID[menuActionRow] = 234;
  5450. if(j3 == 3)
  5451. menuActionID[menuActionRow] = 244;
  5452. if(j3 == 4)
  5453. menuActionID[menuActionRow] = 213;
  5454. menuActionCmd1[menuActionRow] = item.ID;
  5455. menuActionCmd2[menuActionRow] = i1;
  5456. menuActionCmd3[menuActionRow] = j1;
  5457. menuActionRow++;
  5458. } else
  5459. if(j3 == 2)
  5460. {
  5461. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5462. menuActionID[menuActionRow] = 234;
  5463. menuActionCmd1[menuActionRow] = item.ID;
  5464. menuActionCmd2[menuActionRow] = i1;
  5465. menuActionCmd3[menuActionRow] = j1;
  5466. menuActionRow++;
  5467. }
  5468.  
  5469. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + ((myPrivilege != 0) ? ", @gre@(@whi@" + item.ID + "@gre@)" : "");
  5470. menuActionID[menuActionRow] = 1448;
  5471. menuActionCmd1[menuActionRow] = item.ID;
  5472. menuActionCmd2[menuActionRow] = i1;
  5473. menuActionCmd3[menuActionRow] = j1;
  5474. menuActionRow++;
  5475. }
  5476. }
  5477.  
  5478. }
  5479. }
  5480. }
  5481. }
  5482.  
  5483. public void cleanUpForQuit()
  5484. {
  5485. HPBarFull = null;
  5486. HPBarEmpty = null;
  5487. signlink.reporterror = false;
  5488. try
  5489. {
  5490. if(socketStream != null)
  5491. socketStream.close();
  5492. }
  5493. catch(Exception _ex) { }
  5494. socketStream = null;
  5495. stopMidi();
  5496. if(mouseDetection != null)
  5497. mouseDetection.running = false;
  5498. mouseDetection = null;
  5499. onDemandFetcher.disable();
  5500. onDemandFetcher = null;
  5501. aStream_834 = null;
  5502. stream = null;
  5503. aStream_847 = null;
  5504. inStream = null;
  5505. anIntArray1234 = null;
  5506. aByteArrayArray1183 = null;
  5507. aByteArrayArray1247 = null;
  5508. anIntArray1235 = null;
  5509. anIntArray1236 = null;
  5510. intGroundArray = null;
  5511. byteGroundArray = null;
  5512. worldController = null;
  5513. aClass11Array1230 = null;
  5514. anIntArrayArray901 = null;
  5515. anIntArrayArray825 = null;
  5516. bigX = null;
  5517. bigY = null;
  5518. aByteArray912 = null;
  5519. sideTabArea = null;
  5520. mapEdgeIP = null;
  5521. leftFrame = null;
  5522. topFrame = null;
  5523. rightFrame = null;
  5524. mapBackImage = null;
  5525. main3DArea = null;
  5526. chatBackImage = null;
  5527. aRSImageProducer_1123 = null;
  5528. aRSImageProducer_1124 = null;
  5529. aRSImageProducer_1125 = null;
  5530. /* Null pointers for custom sprites */
  5531. backgroundFix = null;
  5532. loadingBarFull = null;
  5533. loadingBarEmpty = null;
  5534. alertBack = null;
  5535. alertBorder = null;
  5536. alertBorderH = null;
  5537. chatArea = null;
  5538. chatButtons = null;
  5539. tabArea = null;
  5540. mapArea = null;
  5541. magicAuto = null;
  5542. /**/
  5543. emptyOrb = null;
  5544. emptyFOrb = null;
  5545. hoveredEmpty = null;
  5546. hoveredFEmpty = null;
  5547. runIcon1 = null;
  5548. runIcon2 = null;
  5549. runOrb1 = null;
  5550. runOrb2 = null;
  5551. hitPointsFill = null;
  5552. hitPointsIcon = null;
  5553. prayerFill = null;
  5554. prayerIcon = null;
  5555. sideIcons = null;
  5556. compass = null;
  5557. headIcons = null;
  5558. cursesIcons = null;
  5559. skullIcons = null;
  5560. headIconsHint = null;
  5561. crosses = null;
  5562. mapDotItem = null;
  5563. mapDotNPC = null;
  5564. mapDotPlayer = null;
  5565. mapDotFriend = null;
  5566. mapDotTeam = null;
  5567. mapScenes = null;
  5568. mapFunctions = null;
  5569. anIntArrayArray929 = null;
  5570. playerArray = null;
  5571. playerIndices = null;
  5572. anIntArray894 = null;
  5573. aStreamArray895s = null;
  5574. anIntArray840 = null;
  5575. npcArray = null;
  5576. npcIndices = null;
  5577. groundArray = null;
  5578. aClass19_1179 = null;
  5579. aClass19_1013 = null;
  5580. aClass19_1056 = null;
  5581. menuActionCmd2 = null;
  5582. menuActionCmd3 = null;
  5583. menuActionID = null;
  5584. menuActionCmd1 = null;
  5585. menuActionName = null;
  5586. variousSettings = null;
  5587. mapFunctionX = null;
  5588. mapFunctionY = null;
  5589. currentMapFunctions = null;
  5590. miniMapImage = null;
  5591. friendsList = null;
  5592. friendsListAsLongs = null;
  5593. friendsNodeIDs = null;
  5594. aRSImageProducer_1110 = null;
  5595. aRSImageProducer_1111 = null;
  5596. aRSImageProducer_1107 = null;
  5597. aRSImageProducer_1108 = null;
  5598. aRSImageProducer_1109 = null;
  5599. aRSImageProducer_1112 = null;
  5600. aRSImageProducer_1113 = null;
  5601. aRSImageProducer_1114 = null;
  5602. aRSImageProducer_1115 = null;
  5603. multiOverlay = null;
  5604. nullLoader();
  5605. ObjectDef.nullLoader();
  5606. EntityDef.nullLoader();
  5607. ItemDef.nullLoader();
  5608. Flo.cache = null;
  5609. IDK.cache = null;
  5610. RSInterface.interfaceCache = null;
  5611. DummyClass.cache = null;
  5612. Animation.anims = null;
  5613. SpotAnim.cache = null;
  5614. SpotAnim.aMRUNodes_415 = null;
  5615. Varp.cache = null;
  5616. super.fullGameScreen = null;
  5617. Player.mruNodes = null;
  5618. Texture.nullLoader();
  5619. WorldController.nullLoader();
  5620. Model.nullLoader();
  5621. Class36.nullLoader();
  5622. System.gc();
  5623. }
  5624. public boolean openBOX = false;
  5625. public String donatorPayment = "";
  5626. private void printDebug()
  5627. {
  5628. System.out.println("============");
  5629. System.out.println("flame-cycle:" + anInt1208);
  5630. if(onDemandFetcher != null)
  5631. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5632. System.out.println("loop-cycle:" + loopCycle);
  5633. System.out.println("draw-cycle:" + anInt1061);
  5634. System.out.println("ptype:" + pktType);
  5635. System.out.println("psize:" + pktSize);
  5636. if(socketStream != null)
  5637. socketStream.printDebug();
  5638. super.shouldDebug = true;
  5639. }
  5640.  
  5641. Component getGameComponent() {
  5642. if(signlink.mainapp != null)
  5643. return signlink.mainapp;
  5644. if(super.gameFrame != null)
  5645. return super.gameFrame;
  5646. else
  5647. return this;
  5648. }
  5649.  
  5650. private void method73() {
  5651. do {
  5652. int j = readCharacter();
  5653. if(j == -1)
  5654. break;
  5655. if(openInterfaceID != -1 && openInterfaceID == 22595) {//newPasswordString
  5656. boolean flag1 = false;
  5657. for(int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  5658. if(j != validUserPassChars.charAt(i2))
  5659. continue;
  5660. flag1 = true;
  5661. break;
  5662. }
  5663.  
  5664. if(j == 8 && newPasswordString.length() > 0) {
  5665. newPasswordString = newPasswordString.substring(0, newPasswordString.length() - 1);
  5666. sendFrame126("Password Strength: " + strengthCheck(newPasswordString),22601);
  5667. }
  5668. if(flag1 && newPasswordString.length() < 20) {
  5669. newPasswordString += (char)j;
  5670. newPasswordString = newPasswordString.toLowerCase();
  5671. sendFrame126("Password Strength: " + strengthCheck(newPasswordString),22601);
  5672. }
  5673. if(newPasswordString.length() > 20)
  5674. newPasswordString = newPasswordString.substring(0, 20);
  5675. if(j == 13 || j == 10)
  5676. changePasswordSubmit();
  5677. } else if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5678. if(j == 8 && reportAbuseInput.length() > 0)
  5679. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5680. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5681. reportAbuseInput += (char)j;
  5682. } else if(messagePromptRaised) {
  5683. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5684. promptInput += (char)j;
  5685. inputTaken = true;
  5686. }
  5687. if(j == 8 && promptInput.length() > 0) {
  5688. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5689. inputTaken = true;
  5690. }
  5691. if(j == 13 || j == 10) {
  5692. messagePromptRaised = false;
  5693. inputTaken = true;
  5694. if(friendsListAction == 1) {
  5695. long l = TextClass.longForName(promptInput);
  5696. addFriend(l);
  5697. }
  5698. if(friendsListAction == 2 && friendsCount > 0) {
  5699. long l1 = TextClass.longForName(promptInput);
  5700. delFriend(l1);
  5701. }
  5702. if(friendsListAction == 3 && promptInput.length() > 0) {
  5703. stream.createFrame(126);
  5704. stream.writeWordBigEndian(0);
  5705. int k = stream.currentOffset;
  5706. stream.writeQWord(aLong953);
  5707. TextInput.method526(promptInput, stream);
  5708. stream.writeBytes(stream.currentOffset - k);
  5709. promptInput = TextInput.processText(promptInput);
  5710. //promptInput = Censor.doCensor(promptInput);
  5711. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5712. if(privateChatMode == 2) {
  5713. privateChatMode = 1;
  5714. aBoolean1233 = true;
  5715. stream.createFrame(95);
  5716. stream.writeWordBigEndian(publicChatMode);
  5717. stream.writeWordBigEndian(privateChatMode);
  5718. stream.writeWordBigEndian(tradeMode);
  5719. }
  5720. }
  5721. if(friendsListAction == 4 && ignoreCount < 100) {
  5722. long l2 = TextClass.longForName(promptInput);
  5723. addIgnore(l2);
  5724. }
  5725. if(interfaceButtonAction == 557 && promptInput.length() > 0) {
  5726. inputString = "::withdraw "+promptInput;
  5727. sendPacket(103);
  5728. }
  5729. if(friendsListAction == 5 && ignoreCount > 0) {
  5730. long l3 = TextClass.longForName(promptInput);
  5731. delIgnore(l3);
  5732. }
  5733. if(friendsListAction == 6) {
  5734. long l3 = TextClass.longForName(promptInput);
  5735. chatJoin(l3);
  5736. }
  5737. }
  5738. } else if(inputDialogState == 1) {
  5739. j = (int)Character.toLowerCase((char)j);
  5740. String s = "" + (char)j;
  5741. if((amountOrNameInput.matches("(\\d+)?") && s.matches("[\\dkmb]")) || amountOrNameInput.matches("\\d+[kmb]") && amountOrNameInput.matches("\\d")) {
  5742. amountOrNameInput += (char)j;
  5743. inputTaken = true;
  5744. }
  5745. if(j == 8 && amountOrNameInput.length() > 0) {//delete
  5746. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5747. inputTaken = true;
  5748. }
  5749. if(j == 13 || j == 10) {//enter
  5750. if(amountOrNameInput.length() > 0) {
  5751. int amount = 0;
  5752. int multiplier = 0;
  5753. for(int i = 0; i < amountOrNameInput.length(); i++) {
  5754. if(amountOrNameInput.charAt(i) == 'k')
  5755. multiplier = 1000;
  5756. else if(amountOrNameInput.charAt(i) == 'm')
  5757. multiplier = 1000000;
  5758. else if(amountOrNameInput.charAt(i) == 'b')
  5759. multiplier = 1000000000;
  5760. if(multiplier != 0)
  5761. break;
  5762. }
  5763. System.out.println("amount: " + amount + " , amountOrNameInput: "+ amountOrNameInput);
  5764. try {
  5765. if(multiplier != 0) {
  5766. if(multiplier == 1000000000 && Integer.parseInt(amountOrNameInput.replaceAll("[^0-9]", "")) >= 3)
  5767. amount = Integer.parseInt("2147") * multiplier;
  5768. else
  5769. amount = Integer.parseInt(amountOrNameInput.replaceAll("[^0-9]", "")) * multiplier;
  5770. } else
  5771. amount = Integer.parseInt(amountOrNameInput);
  5772. } catch(Exception _ex) {
  5773.  
  5774. }
  5775. System.out.println("2amount: " + amount + " , amountOrNameInput: "+ amountOrNameInput);
  5776. stream.createFrame(208);
  5777. stream.writeDWord(amount);
  5778. }
  5779. inputDialogState = 0;
  5780. inputTaken = true;
  5781. }
  5782. } else if(inputDialogState == 2) {
  5783. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5784. amountOrNameInput += (char)j;
  5785. inputTaken = true;
  5786. }
  5787. if(j == 8 && amountOrNameInput.length() > 0) {
  5788. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5789. inputTaken = true;
  5790. }
  5791. if(j == 13 || j == 10) {
  5792. if(amountOrNameInput.length() > 0) {
  5793. stream.createFrame(60);
  5794. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5795. }
  5796. inputDialogState = 0;
  5797. inputTaken = true;
  5798. }
  5799. } else if(backDialogID == -1) {
  5800. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5801. inputString += (char)j;
  5802. inputTaken = true;
  5803. }
  5804. if(j == 8 && inputString.length() > 0) {
  5805. inputString = inputString.substring(0, inputString.length() - 1);
  5806. inputTaken = true;
  5807. }
  5808. if((j == 13 || j == 10) && inputString.length() > 0) {
  5809. if(inputString.startsWith("::interface")&& myPrivilege == 2) {
  5810. try {
  5811. String[] args = inputString.split(" ");
  5812. pushMessage("Opening interface " + args[1] + ".",0,"");
  5813. openInterfaceID = Integer.parseInt(args[1]);
  5814. //invOverlayInterfaceID = Integer.parseInt(args[1]);
  5815. } catch(ArrayIndexOutOfBoundsException ex) {
  5816. pushMessage("please use as ::interface ID.",0,"");
  5817. }
  5818. }
  5819. if(inputString.startsWith("::walkable")) {
  5820. try {
  5821. String[] args = inputString.split(" ");
  5822. pushMessage("Opening interface " + args[1] + ".",0,"");
  5823. walkableInterfaceID = Integer.parseInt(args[1]);
  5824. } catch(ArrayIndexOutOfBoundsException ex) {
  5825. pushMessage("please use as ::interface ID.",0,"");
  5826. }
  5827. }
  5828. if(inputString.equals("::donate")){
  5829. launchURL("www.ruinedscape.createaforum.com");
  5830. }
  5831. if(inputString.equals("::vote4cash")) {
  5832. launchURL("http://www.runelocus.com/toplist/details-13233-RuinedScape_247__Webclient.html");
  5833. }
  5834. if(inputString.equals("::forums")) {
  5835. launchURL("www.ruinedscape.createaforum.com");
  5836. }
  5837. if(inputString.equals("::forum")) {
  5838. launchURL("www.ruinedscape.createaforum.com");
  5839. }
  5840. if(inputString.equals("::site")) {
  5841. launchURL("www.ruinedscape.createaforum.com");
  5842. }
  5843. if(inputString.equals("::donat")) {
  5844. launchURL("www.ruinedscape.createaforum.com");
  5845. }
  5846. if(inputString.equals("::vote")) {
  5847. launchURL("http://www.runelocus.com/toplist/details-13233-RuinedScape_247__Webclient.html");
  5848. }
  5849. if(inputString.equals("::vot")) {
  5850. launchURL("http://www.runelocus.com/toplist/details-13233-RuinedScape_247__Webclient.html");
  5851. }
  5852. if(inputString.equals("::votee")) {
  5853. launchURL("http://www.runelocus.com/toplist/details-13233-RuinedScape_247__Webclient.html");
  5854. }
  5855. if(inputString.equals("::VOTE")) {
  5856. launchURL("http://www.runelocus.com/toplist/details-13233-RuinedScape_247__Webclient.html");
  5857. }
  5858. if(inputString.equals("::highscores")) {
  5859. launchURL("www.ruinedscape.createaforum.com");
  5860. }
  5861. if(inputString.equals("::hiscore")) {
  5862. launchURL("www.ruinedscape.createaforum.com");
  5863. }
  5864. if(inputString.equals("youtube")) {
  5865. launchURL("www.youtube.com/user/addictivepkz");
  5866. }
  5867. if(inputString.equals("::sub")) {
  5868. launchURL("http://www.youtube.com/user/addictivepkz");
  5869. }
  5870. if(inputString.equals("::subscribe")) {
  5871. launchURL("http://www.youtube.com/user/addictivepkz");
  5872. }
  5873. if(inputString.equals("::hiscore")) {
  5874. launchURL("www.ruinedscape.createaforum.com");
  5875. }
  5876.  
  5877. if(inputString.startsWith("::back")) {
  5878. try {
  5879. String[] args = inputString.split(" ");
  5880. pushMessage("Opening interface " + args[1] + ".",0,"");
  5881. backDialogID = Integer.parseInt(args[1]);
  5882. } catch(ArrayIndexOutOfBoundsException ex) {
  5883. pushMessage("please use as ::interface ID.",0,"");
  5884. }
  5885. }
  5886. if(myPrivilege == 2 || serverip.equals("127.0.0.1") || 1 == 1/*to remove*/) {
  5887. if(inputString.startsWith("//setspecto")) {
  5888. int amt = Integer.parseInt(inputString.substring(12));
  5889. anIntArray1045[300] = amt;
  5890. if(variousSettings[300] != amt) {
  5891. variousSettings[300] = amt;
  5892. method33(300);
  5893. needDrawTabArea = true;
  5894. if(dialogID != -1)
  5895. inputTaken = true;
  5896. }
  5897. }
  5898. if (inputString.startsWith("::swat"))
  5899. {
  5900. for(int i = 12535; i < 20072; i++)
  5901. {
  5902. System.out.println("i:"+i);
  5903. ItemDef.forID(i);
  5904. }
  5905. for(int i = 0; i < 20072; i++)
  5906. {
  5907. System.out.println("e:"+i);
  5908. EntityDef.forID(i);
  5909. }
  5910. }
  5911.  
  5912. if(inputString.equals("clientdrop") && myPrivilege == 2)
  5913. dropClient();
  5914. if(inputString.equals("::lag") && myPrivilege == 2)
  5915. printDebug();
  5916. if(inputString.equals("::prefetchmusic") && myPrivilege == 2) {
  5917. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5918. onDemandFetcher.method563((byte)1, 2, j1);
  5919.  
  5920. }
  5921. if(inputString.equals("::fpson") && myPrivilege == 2)
  5922. fpsOn = true;
  5923. if(inputString.equals("::fpsoff") && myPrivilege == 2)
  5924. fpsOn = false;
  5925. if(inputString.equals("::dataon") && myPrivilege == 2)
  5926. clientData = true;
  5927. if(inputString.equals("::dataoff") && myPrivilege == 2)
  5928. clientData = false;
  5929. if(inputString.equals("::noclip") && myPrivilege == 3) {
  5930. for(int k1 = 0; k1 < 4; k1++) {
  5931. for(int i2 = 1; i2 < 103; i2++) {
  5932. for(int k2 = 1; k2 < 103; k2++)
  5933. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5934.  
  5935. }
  5936. }
  5937. }
  5938. if(inputString.equalsIgnoreCase("::tabs")) {
  5939. if(functionKeys) {
  5940. functionKeys = false;
  5941. pushMessage("You are now using the new tab system!", 0, "");
  5942. pushMessage("F1 - Inventory F2 - Equipment F3 - Prayer F4 - Mage F5 - Combat", 0, "");
  5943. } else {
  5944. functionKeys = true;
  5945. pushMessage("You are now using the old tab system!", 0, "");
  5946. pushMessage("F1 - Combat F2 - Skills F3 - Quest F4 - Inventory F5 - Equipment", 0, "");
  5947. pushMessage("F6 - Prayer F7 - Mage F8 - Clan F9 - Friend F10 - Ignore ", 0, "");
  5948. }
  5949. }
  5950. if(inputString.equalsIgnoreCase("::hits")) {
  5951. if(newDamage) {
  5952. newDamage = false;
  5953. pushMessage("Old school hits activated", 0, "");
  5954. } else {
  5955. newDamage = true;
  5956. pushMessage("Newer hits activated", 0, "");
  5957. }
  5958. }
  5959. //if(inputString.equalsIgnoreCase("::hits")) {
  5960.  
  5961.  
  5962. if(inputString.equals("::dump")) {
  5963. for(int k1 = 0; k1 < 40000; k1++) {
  5964. System.out.println(""+k1);
  5965. ItemDef.forID(k1);
  5966. }
  5967. for(int k1 = 0; k1 < 6000; k1++) {
  5968. System.out.println(""+k1);
  5969. EntityDef.forID(k1);
  5970. }
  5971. }
  5972.  
  5973. }
  5974.  
  5975. if(inputString.startsWith("/"))
  5976. inputString = "::" + inputString;
  5977. if(inputString.equals("add model")) {
  5978. try {
  5979. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5980. byte[] abyte0 = getModel(ModelIndex);
  5981. if(abyte0 != null && abyte0.length > 0) {
  5982. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5983. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5984. } else {
  5985. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5986. }
  5987. } catch(Exception e) {
  5988. pushMessage("Syntax - ::add model <path>", 0, "");
  5989. }
  5990. }
  5991. if(inputString.startsWith("::getcode"))
  5992. inputString = "::getcode "+donatorPayment;
  5993. if(inputString.startsWith("::setcode"))
  5994. openBOX = true;
  5995. else
  5996. if(inputString.startsWith("::")) {
  5997. if(inputString.startsWith("::changepassword")) {
  5998. try {
  5999. String arg = inputString.substring(17);
  6000. newPasswordString = (inputString.length() > 17) ? arg : "";
  6001. } catch (StringIndexOutOfBoundsException ex) {
  6002. newPasswordString = "";
  6003. }
  6004. openInterfaceID = 22595;
  6005. sendFrame126("Password Strength: " + strengthCheck(newPasswordString),22601);
  6006. pushMessage("Type your new password, be sure to not make spelling mistakes.", 0, "");
  6007. } else {
  6008. stream.createFrame(103);
  6009. stream.writeWordBigEndian(inputString.length() - 1);
  6010. stream.writeString(inputString.substring(2));
  6011. }
  6012. } else {
  6013. String s = inputString.toLowerCase();
  6014. int j2 = 0;
  6015. if(s.startsWith("yellow:"))
  6016. {
  6017. j2 = 0;
  6018. inputString = inputString.substring(7);
  6019. } else if(s.startsWith("red:"))
  6020. {
  6021. j2 = 1;
  6022. inputString = inputString.substring(4);
  6023. } else if(s.startsWith("green:"))
  6024. {
  6025. j2 = 2;
  6026. inputString = inputString.substring(6);
  6027. } else if(s.startsWith("cyan:"))
  6028. {
  6029. j2 = 3;
  6030. inputString = inputString.substring(5);
  6031. } else if(s.startsWith("purple:"))
  6032. {
  6033. j2 = 4;
  6034. inputString = inputString.substring(7);
  6035. } else if(s.startsWith("white:"))
  6036. {
  6037. j2 = 5;
  6038. inputString = inputString.substring(6);
  6039. } else if(s.startsWith("flash1:"))
  6040. {
  6041. j2 = 6;
  6042. inputString = inputString.substring(7);
  6043. } else if(s.startsWith("flash2:"))
  6044. {
  6045. j2 = 7;
  6046. inputString = inputString.substring(7);
  6047. } else if(s.startsWith("flash3:"))
  6048. {
  6049. j2 = 8;
  6050. inputString = inputString.substring(7);
  6051. } else if(s.startsWith("glow1:"))
  6052. {
  6053. j2 = 9;
  6054. inputString = inputString.substring(6);
  6055. } else if(s.startsWith("glow2:"))
  6056. {
  6057. j2 = 10;
  6058. inputString = inputString.substring(6);
  6059. } else if(s.startsWith("glow3:"))
  6060. {
  6061. j2 = 11;
  6062. inputString = inputString.substring(6);
  6063. }
  6064. s = inputString.toLowerCase();
  6065. int i3 = 0;
  6066. if(s.startsWith("wave:"))
  6067. {
  6068. i3 = 1;
  6069. inputString = inputString.substring(5);
  6070. } else if(s.startsWith("wave2:"))
  6071. {
  6072. i3 = 2;
  6073. inputString = inputString.substring(6);
  6074. } else if(s.startsWith("shake:"))
  6075. {
  6076. i3 = 3;
  6077. inputString = inputString.substring(6);
  6078. } else if(s.startsWith("scroll:"))
  6079. {
  6080. i3 = 4;
  6081. inputString = inputString.substring(7);
  6082. } else if(s.startsWith("slide:"))
  6083. {
  6084. i3 = 5;
  6085. inputString = inputString.substring(6);
  6086. }
  6087. stream.createFrame(4);
  6088. stream.writeWordBigEndian(0);
  6089. int j3 = stream.currentOffset;
  6090. stream.method425(i3);
  6091. stream.method425(j2);
  6092. aStream_834.currentOffset = 0;
  6093. TextInput.method526(inputString, aStream_834);
  6094. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  6095. stream.writeBytes(stream.currentOffset - j3);
  6096. inputString = TextInput.processText(inputString);
  6097. //inputString = Censor.doCensor(inputString);
  6098. myPlayer.textSpoken = inputString;
  6099. myPlayer.anInt1513 = j2;
  6100. myPlayer.anInt1531 = i3;
  6101. myPlayer.textCycle = 150;
  6102. if(myPrivilege != 0 && myPrivilege <= modIcons.length)
  6103. pushMessage(myPlayer.textSpoken, 2, "@cr" + myPrivilege + "@" + myPlayer.name);
  6104. else
  6105. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  6106. if(publicChatMode == 2)
  6107. {
  6108. publicChatMode = 3;
  6109. aBoolean1233 = true;
  6110. stream.createFrame(95);
  6111. stream.writeWordBigEndian(publicChatMode);
  6112. stream.writeWordBigEndian(privateChatMode);
  6113. stream.writeWordBigEndian(tradeMode);
  6114. }
  6115. }
  6116. inputString = "";
  6117. inputTaken = true;
  6118. }
  6119. }
  6120. } while(true);
  6121. }
  6122. public static boolean functionKeys = true;
  6123. public static boolean healthBars = true;
  6124. public static boolean newDamage = true;
  6125.  
  6126. private void buildPublicChat(int j)
  6127. {
  6128. int l = 0;
  6129. for(int i1 = 0; i1 < 500; i1++)
  6130. {
  6131. if(chatMessages[i1] == null)
  6132. continue;
  6133. if(chatTypeView != 1)
  6134. continue;
  6135. int j1 = chatTypes[i1];
  6136. String s = chatNames[i1];
  6137. String ct = chatMessages[i1];
  6138. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6139. if(k1 < -23)
  6140. break;
  6141. if(s != null && s.startsWith("@cr")) {
  6142. String rightID = s.substring(3,4);
  6143. s = s.substring(5);
  6144. }
  6145. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6146. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6147. if(myPrivilege >= 1) {
  6148. menuActionName[menuActionRow] = "Staff Pannel @whi@" + s;
  6149. menuActionID[menuActionRow] = 606;
  6150. menuActionRow++;
  6151. }
  6152. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6153. menuActionID[menuActionRow] = 42;
  6154. menuActionRow++;
  6155. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6156. menuActionID[menuActionRow] = 337;
  6157. menuActionRow++;
  6158. }
  6159. l++;
  6160. }
  6161. }
  6162. }
  6163.  
  6164. private void buildFriendChat(int j)
  6165. {
  6166. int l = 0;
  6167. for(int i1 = 0; i1 < 500; i1++) {
  6168. if(chatMessages[i1] == null)
  6169. continue;
  6170. if(chatTypeView != 2)
  6171. continue;
  6172. int j1 = chatTypes[i1];
  6173. String s = chatNames[i1];
  6174. String ct = chatMessages[i1];
  6175. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6176. if(k1 < -23)
  6177. break;
  6178. if(s != null && s.startsWith("@cr")) {
  6179. String rightID = s.substring(3,4);
  6180. s = s.substring(5);
  6181. }
  6182. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6183. l++;
  6184. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6185. {
  6186. if(j > k1 - 14 && j <= k1) {
  6187. if(myPrivilege >= 1) {
  6188. menuActionName[menuActionRow] = "Staff Pannel @whi@" + s;
  6189. menuActionID[menuActionRow] = 606;
  6190. menuActionRow++;
  6191. }
  6192. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6193. menuActionID[menuActionRow] = 42;
  6194. menuActionRow++;
  6195. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6196. menuActionID[menuActionRow] = 337;
  6197. menuActionRow++;
  6198. }
  6199. l++;
  6200. }
  6201. }
  6202. }
  6203.  
  6204. private void buildDuelorTrade(int j) {
  6205. int l = 0;
  6206. for(int i1 = 0; i1 < 500; i1++) {
  6207. if(chatMessages[i1] == null)
  6208. continue;
  6209. if(chatTypeView != 3 && chatTypeView != 4)
  6210. continue;
  6211. int j1 = chatTypes[i1];
  6212. String s = chatNames[i1];
  6213. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6214. if(k1 < -23)
  6215. break;
  6216. if(s != null && s.startsWith("@cr")) {
  6217. String rightID = s.substring(3,4);
  6218. s = s.substring(5);
  6219. }
  6220. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6221. if(j > k1 - 14 && j <= k1) {
  6222. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6223. menuActionID[menuActionRow] = 484;
  6224. menuActionRow++;
  6225. }
  6226. l++;
  6227. }
  6228. if(j1 == 9)
  6229. {
  6230. if(j > k1 - 14 && j <= k1)
  6231. {
  6232. String displayLink = ((s.length() > 30) ? (s.substring(0,25) + "...") : (s));
  6233. menuActionName[menuActionRow] = "Open page: " + displayLink;
  6234. menuActionID[menuActionRow] = 485;
  6235. menuActionRow++;
  6236. linkInText = s;
  6237. }
  6238. l++;
  6239. }
  6240.  
  6241. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6242. if(j > k1 - 14 && j <= k1) {
  6243. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6244. menuActionID[menuActionRow] = 6;
  6245. menuActionRow++;
  6246. }
  6247. l++;
  6248. }
  6249. if(j1 == 12) {
  6250. if(j > k1 - 14 && j <= k1) {
  6251. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6252. menuActionID[menuActionRow] = 915;
  6253. menuActionRow++;
  6254. }
  6255. l++;
  6256. }
  6257. }
  6258. }
  6259.  
  6260. private void buildChatAreaMenu(int paddingY) {
  6261. int totalLines = 0;
  6262. int test = 0;
  6263. for(int typeIndex = 0; typeIndex < 500; typeIndex++) {
  6264. if(chatMessages[typeIndex] == null)
  6265. continue;
  6266. int chatType = chatTypes[typeIndex];
  6267. int scrollYPos = (70 - totalLines * 14 + 42) + anInt1089 + 4 + 5;
  6268. if(scrollYPos < -23)
  6269. break;
  6270. String name = chatNames[typeIndex];
  6271. String type = chatMessages[typeIndex];
  6272. boolean flag = false;
  6273. if(chatTypeView == 1) {
  6274. buildPublicChat(paddingY);
  6275. break;
  6276. }
  6277. if(chatTypeView == 2) {
  6278. buildFriendChat(paddingY);
  6279. break;
  6280. }
  6281. if(chatTypeView == 3 || chatTypeView == 4) {
  6282. buildDuelorTrade(paddingY);
  6283. break;
  6284. }
  6285. if(chatTypeView == 5) {
  6286. break;
  6287. }
  6288. if(name != null && name.startsWith("@cr")) {
  6289. String rightID = name.substring(3,4);
  6290. name = name.substring(5);
  6291. }
  6292. if(chatType == 0)
  6293. totalLines++;
  6294. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(name))) {
  6295. if(paddingY > scrollYPos - 14 && paddingY <= scrollYPos && !name.equals(myPlayer.name)) {
  6296. if(myPrivilege >= 1) {
  6297. menuActionName[menuActionRow] = "Staff Pannel @whi@" + name;
  6298. menuActionID[menuActionRow] = 606;
  6299. menuActionRow++;
  6300. }
  6301. menuActionName[menuActionRow] = "Add ignore @whi@" + name;
  6302. menuActionID[menuActionRow] = 42;
  6303. menuActionRow++;
  6304. menuActionName[menuActionRow] = "Add friend @whi@" + name;
  6305. menuActionID[menuActionRow] = 337;
  6306. menuActionRow++;
  6307. }
  6308. totalLines++;
  6309. }
  6310. if((chatType == 3 || chatType == 7) && splitPrivateChat == 0 && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(name))) {
  6311. if(paddingY > scrollYPos - 14 && paddingY <= scrollYPos) {
  6312. if(myPrivilege >= 1) {
  6313. menuActionName[menuActionRow] = "Staff Pannel @whi@" + name;
  6314. menuActionID[menuActionRow] = 606;
  6315. menuActionRow++;
  6316. }
  6317. menuActionName[menuActionRow] = "Add ignore @whi@" + name;
  6318. menuActionID[menuActionRow] = 42;
  6319. menuActionRow++;
  6320. menuActionName[menuActionRow] = "Add friend @whi@" + name;
  6321. menuActionID[menuActionRow] = 337;
  6322. menuActionRow++;
  6323. }
  6324. totalLines++;
  6325. }
  6326. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(name))) {
  6327. if(paddingY > scrollYPos - 14 && paddingY <= scrollYPos) {
  6328. menuActionName[menuActionRow] = "Accept trade @whi@" + name;
  6329. menuActionID[menuActionRow] = 484;
  6330. menuActionRow++;
  6331. }
  6332. totalLines++;
  6333. }
  6334. if(chatType == 9) {
  6335. if(paddingY > scrollYPos - 14 && paddingY <= scrollYPos) {
  6336. String displayLink = ((name.length() > 30) ? (name.substring(0,25) + "...") : (name));
  6337. menuActionName[menuActionRow] = "Open page: " + displayLink;
  6338. menuActionID[menuActionRow] = 485;
  6339. menuActionRow++;
  6340. linkInText = name;
  6341. }
  6342. totalLines++;
  6343. }
  6344. if((chatType == 5 || chatType == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6345. totalLines++;
  6346. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(name))) {
  6347. if(paddingY > scrollYPos - 14 && paddingY <= scrollYPos) {
  6348. menuActionName[menuActionRow] = "Accept challenge @whi@" + name;
  6349. menuActionID[menuActionRow] = 6;
  6350. menuActionRow++;
  6351. }
  6352. totalLines++;
  6353. }
  6354. }
  6355. }
  6356.  
  6357. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  6358. {
  6359. int j = class9.contentType;
  6360. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  6361. {
  6362. if(j == 1 && anInt900 == 0)
  6363. {
  6364. class9.message = "Loading friend list";
  6365. class9.atActionType = 0;
  6366. return;
  6367. }
  6368. if(j == 1 && anInt900 == 1)
  6369. {
  6370. class9.message = "Connecting to friendserver";
  6371. class9.atActionType = 0;
  6372. return;
  6373. }
  6374. if(j == 2 && anInt900 != 2)
  6375. {
  6376. class9.message = "Please wait...";
  6377. class9.atActionType = 0;
  6378. return;
  6379. }
  6380. int k = friendsCount;
  6381. if(anInt900 != 2)
  6382. k = 0;
  6383. if(j > 700)
  6384. j -= 601;
  6385. else
  6386. j--;
  6387. if(j >= k)
  6388. {
  6389. class9.message = "";
  6390. class9.atActionType = 0;
  6391. return;
  6392. } else
  6393. {
  6394. class9.message = friendsList[j];
  6395. class9.atActionType = 1;
  6396. return;
  6397. }
  6398. }
  6399. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  6400. {
  6401. int l = friendsCount;
  6402. if(anInt900 != 2)
  6403. l = 0;
  6404. if(j > 800)
  6405. j -= 701;
  6406. else
  6407. j -= 101;
  6408. if(j >= l)
  6409. {
  6410. class9.message = "";
  6411. class9.atActionType = 0;
  6412. return;
  6413. }
  6414. if(friendsNodeIDs[j] == 0)
  6415. class9.message = "@red@Offline";
  6416. else if(friendsNodeIDs[j] == nodeID)
  6417. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  6418. else
  6419. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  6420. class9.atActionType = 1;
  6421. return;
  6422. }
  6423. if(j == 203)
  6424. {
  6425. int i1 = friendsCount;
  6426. if(anInt900 != 2)
  6427. i1 = 0;
  6428. class9.scrollMax = i1 * 15 + 20;
  6429. if(class9.scrollMax <= class9.height)
  6430. class9.scrollMax = class9.height + 1;
  6431. return;
  6432. }
  6433. if(j >= 401 && j <= 500)
  6434. {
  6435. if((j -= 401) == 0 && anInt900 == 0)
  6436. {
  6437. class9.message = "Loading ignore list";
  6438. class9.atActionType = 0;
  6439. return;
  6440. }
  6441. if(j == 1 && anInt900 == 0)
  6442. {
  6443. class9.message = "Please wait...";
  6444. class9.atActionType = 0;
  6445. return;
  6446. }
  6447. int j1 = ignoreCount;
  6448. if(anInt900 == 0)
  6449. j1 = 0;
  6450. if(j >= j1)
  6451. {
  6452. class9.message = "";
  6453. class9.atActionType = 0;
  6454. return;
  6455. } else
  6456. {
  6457. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  6458. class9.atActionType = 1;
  6459. return;
  6460. }
  6461. }
  6462. if(j == 503)
  6463. {
  6464. class9.scrollMax = ignoreCount * 15 + 20;
  6465. if(class9.scrollMax <= class9.height)
  6466. class9.scrollMax = class9.height + 1;
  6467. return;
  6468. }
  6469. if(j == 327)
  6470. {
  6471. class9.modelRotation1 = 150;
  6472. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6473. if(aBoolean1031)
  6474. {
  6475. for(int k1 = 0; k1 < 7; k1++)
  6476. {
  6477. int l1 = anIntArray1065[k1];
  6478. if(l1 >= 0 && !IDK.cache[l1].method537())
  6479. return;
  6480. }
  6481.  
  6482. aBoolean1031 = false;
  6483. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6484. int i2 = 0;
  6485. for(int j2 = 0; j2 < 7; j2++)
  6486. {
  6487. int k2 = anIntArray1065[j2];
  6488. if(k2 >= 0)
  6489. {
  6490. //Model.readAndDump(IDK.cache[k2].method538().modelID);
  6491. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  6492.  
  6493. }
  6494. }
  6495.  
  6496. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6497. for(int l2 = 0; l2 < 5; l2++)
  6498. if(anIntArray990[l2] != 0)
  6499. {
  6500. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6501. if(l2 == 1)
  6502. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6503. }
  6504.  
  6505. model.method469();
  6506. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6507. model.method479(64, 850, -30, -50, -30, true);
  6508. class9.anInt233 = 5;
  6509. class9.mediaID = 0;
  6510. RSInterface.method208(aBoolean994, model);
  6511. }
  6512. return;
  6513. }
  6514. if(j == 328) {
  6515. RSInterface rsInterface = class9;
  6516. int verticleTilt = 150;
  6517. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6518. rsInterface.modelRotation1 = verticleTilt;
  6519. rsInterface.modelRotation2 = animationSpeed;
  6520. if(aBoolean1031) {
  6521. Model characterDisplay = myPlayer.method452();
  6522. for(int l2 = 0; l2 < 5; l2++)
  6523. if(anIntArray990[l2] != 0) {
  6524. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6525. if(l2 == 1)
  6526. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6527. }
  6528. int staticFrame = myPlayer.anInt1511;
  6529. characterDisplay.method469();
  6530. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  6531. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  6532. rsInterface.anInt233 = 5;
  6533. rsInterface.mediaID = 0;
  6534. RSInterface.method208(aBoolean994, characterDisplay);
  6535. }
  6536. return;
  6537. }
  6538. if(j == 324)
  6539. {
  6540. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6541. {
  6542. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6543. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6544. }
  6545. if(aBoolean1047)
  6546. {
  6547. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6548. return;
  6549. } else
  6550. {
  6551. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6552. return;
  6553. }
  6554. }
  6555. if(j == 325)
  6556. {
  6557. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6558. {
  6559. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6560. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6561. }
  6562. if(aBoolean1047)
  6563. {
  6564. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6565. return;
  6566. } else
  6567. {
  6568. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6569. return;
  6570. }
  6571. }
  6572. if(j == 600)
  6573. {
  6574. class9.message = reportAbuseInput;
  6575. if(loopCycle % 20 < 10)
  6576. {
  6577. class9.message += "|";
  6578. return;
  6579. } else
  6580. {
  6581. class9.message += " ";
  6582. return;
  6583. }
  6584. }
  6585. if(j > 600 && j < 621)
  6586. {
  6587. int id = j-601;
  6588. String[] mod_options = {
  6589. "Moderator Options:",
  6590. "Mute user",
  6591. "Un-Mute user",
  6592. "Jail user",
  6593. "Un-Jail user",
  6594. "Ban user",
  6595. "Un-Ban user"
  6596. };
  6597. String[] admin_options = {
  6598. "Admin Options:",
  6599. "Mute users IP",
  6600. "Un-Mute users IP",
  6601. "Ban users IP",
  6602. "Un-Ban users IP",
  6603. };
  6604. if(id < mod_options.length)
  6605. if(id == 0)
  6606. class9.message = mod_options[id];
  6607. else
  6608. class9.message = (id)+": "+mod_options[id];
  6609. else if(id < mod_options.length+admin_options.length && myPrivilege > 1)
  6610. if(id-mod_options.length == 0)
  6611. class9.message = admin_options[id-mod_options.length];
  6612. else
  6613. class9.message = (id-mod_options.length)+": "+admin_options[id-mod_options.length];
  6614. }
  6615. if(j == 650 || j == 655)
  6616. if(anInt1193 != 0)
  6617. {
  6618. String s;
  6619. if(daysSinceLastLogin == 0)
  6620. s = "earlier today";
  6621. else
  6622. if(daysSinceLastLogin == 1)
  6623. s = "yesterday";
  6624. else
  6625. s = daysSinceLastLogin + " days ago";
  6626. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  6627. } else
  6628. {
  6629. class9.message = "";
  6630. }
  6631. if(j == 651)
  6632. {
  6633. if(unreadMessages == 0)
  6634. {
  6635. class9.message = "0 unread messages";
  6636. class9.textColor = 0xffff00;
  6637. }
  6638. if(unreadMessages == 1)
  6639. {
  6640. class9.message = "1 unread message";
  6641. class9.textColor = 65280;
  6642. }
  6643. if(unreadMessages > 1)
  6644. {
  6645. class9.message = unreadMessages + " unread messages";
  6646. class9.textColor = 65280;
  6647. }
  6648. }
  6649. if(j == 652)
  6650. if(daysSinceRecovChange == 201)
  6651. {
  6652. if(membersInt == 1)
  6653. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6654. else
  6655. class9.message = "";
  6656. } else
  6657. if(daysSinceRecovChange == 200)
  6658. {
  6659. class9.message = "You have not yet set any password recovery questions.";
  6660. } else
  6661. {
  6662. String s1;
  6663. if(daysSinceRecovChange == 0)
  6664. s1 = "Earlier today";
  6665. else
  6666. if(daysSinceRecovChange == 1)
  6667. s1 = "Yesterday";
  6668. else
  6669. s1 = daysSinceRecovChange + " days ago";
  6670. class9.message = s1 + " you changed your recovery questions";
  6671. }
  6672. if(j == 653)
  6673. if(daysSinceRecovChange == 201)
  6674. {
  6675. if(membersInt == 1)
  6676. class9.message = "@whi@recommend you use a members world instead. You may use";
  6677. else
  6678. class9.message = "";
  6679. } else
  6680. if(daysSinceRecovChange == 200)
  6681. class9.message = "We strongly recommend you do so now to secure your account.";
  6682. else
  6683. class9.message = "If you do not remember making this change then cancel it immediately";
  6684. if(j == 654)
  6685. {
  6686. if(daysSinceRecovChange == 201)
  6687. if(membersInt == 1)
  6688. {
  6689. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6690. return;
  6691. } else
  6692. {
  6693. class9.message = "";
  6694. return;
  6695. }
  6696. if(daysSinceRecovChange == 200)
  6697. {
  6698. class9.message = "Do this from the 'account management' area on our front webpage";
  6699. return;
  6700. }
  6701. class9.message = "Do this from the 'account management' area on our front webpage";
  6702. }
  6703. }
  6704.  
  6705. private void drawSplitPrivateChat(int paddingX, int paddingY) {
  6706. if(splitPrivateChat == 0)
  6707. return;
  6708. TextDrawingArea textdrawingarea = normalFont;
  6709. int i = 0 ;
  6710. if(systemUpdatetime != 0)
  6711. i = 1;
  6712. for(int j = 0; j < 100; j++)
  6713. if(chatMessages[j] != null)
  6714. {
  6715. int k = chatTypes[j];
  6716. String s = chatNames[j];
  6717. byte byte1 = 0;
  6718. if(s != null && s.startsWith("@cr")) {
  6719. String rightID = s.substring(3,4);
  6720. s = s.substring(5);
  6721. byte1 = (byte)Integer.parseInt(rightID);
  6722. }
  6723. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6724. {
  6725. int l = (329 + paddingY) - i * 13;
  6726. int k1 = 4;
  6727. textdrawingarea.method385(0, "From", l, k1);
  6728. textdrawingarea.method385(65535, "From", l - 1, k1);
  6729. k1 += textdrawingarea.getTextWidth("From ");
  6730. if(byte1 > 0) {
  6731. if(byte1-1 > 2) {
  6732. return; //Fixes crash
  6733. }
  6734. modIcons[byte1-1].drawBackground(k1, l - 12);
  6735. k1 += 14;
  6736. }
  6737. textdrawingarea.method385(0, s + ": " + chatMessages[j], l, k1);
  6738. textdrawingarea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  6739. if(++i >= 5)
  6740. return;
  6741. }
  6742. if(k == 5 && privateChatMode < 2)
  6743. {
  6744. try
  6745. {
  6746. int i1 = (329 + paddingY) - i * 13;
  6747. textdrawingarea.method385(0, chatMessages[j], i1, 4);
  6748. textdrawingarea.method385(65535, chatMessages[j], i1 - 1, 4);
  6749. if(++i >= 5)
  6750. return;
  6751. } catch(ArrayIndexOutOfBoundsException ex) {
  6752.  
  6753. }
  6754. }
  6755. if(k != 6 || privateChatMode >= 2)
  6756. continue;
  6757. int j1 = (329 + paddingY) - i * 13;
  6758. textdrawingarea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6759. textdrawingarea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6760. if(++i >= 5)
  6761. return;
  6762. }
  6763.  
  6764. }
  6765.  
  6766. public void pushMessage(String s, int i, String s1) {
  6767. if(i == 0 && dialogID != -1) {
  6768. aString844 = s;
  6769. super.clickMode3 = 0;
  6770. }
  6771. if(backDialogID == -1)
  6772. inputTaken = true;
  6773. for(int j = 499; j > 0; j--) {
  6774. chatTypes[j] = chatTypes[j - 1];
  6775. chatNames[j] = chatNames[j - 1];
  6776. chatMessages[j] = chatMessages[j - 1];
  6777. chatRights[j] = chatRights[j - 1];
  6778. }
  6779. chatTypes[0] = i;
  6780. chatNames[0] = s1;
  6781. chatMessages[0] = s;
  6782. chatRights[0] = rights;
  6783. }
  6784.  
  6785. static int focusTab = 3;
  6786. public static void setTab(int id) {
  6787. if(focusTab == id && toggleFullscreen)
  6788. focusTab = -1;
  6789. else
  6790. focusTab = id;
  6791. needDrawTabArea = true;
  6792. tabID = id;
  6793. tabAreaAltered = true;
  6794. }
  6795.  
  6796. private void processTabClick(int paddingX, int paddingY) {
  6797. if(invOverlayInterfaceID == -1) {
  6798. if(super.mouseX >= 521 + paddingX && super.mouseX <= 550 + paddingX && super.mouseY >= 169 + (toggleFullscreen ? 261 : 0) + paddingY && super.mouseY < 205 + (toggleFullscreen ? 261 : 0) + paddingY && tabInterfaceIDs[0] != -1) {
  6799. //setTab(0);
  6800. menuActionName[1] = "Combat Styles";
  6801. menuActionID[1] = 1011;
  6802. menuActionRow = 2;
  6803. tabIDHover = 0;
  6804. } else if(super.mouseX >= 552 + paddingX && super.mouseX <= 581 + paddingX && super.mouseY >= 168 + (toggleFullscreen ? 261 : 0) + paddingY && super.mouseY < 205 + (toggleFullscreen ? 261 : 0) + paddingY && tabInterfaceIDs[14] != -1) {
  6805. //setTab(14);
  6806. menuActionName[1] = "Stats";
  6807. menuActionID[1] = 1042;//needs changing.
  6808. menuActionRow = 2;
  6809. tabIDHover = 1;
  6810. } else if(super.mouseX >= 582 + paddingX && super.mouseX <= 611 + paddingX && super.mouseY >= 168 + (toggleFullscreen ? 261 : 0) + paddingY && super.mouseY < 205 + (toggleFullscreen ? 261 : 0) + paddingY && tabInterfaceIDs[1] != -1) {
  6811. //setTab(1);
  6812. menuActionName[1] = "Quest Tab";
  6813. menuActionID[1] = 1012;
  6814. menuActionRow = 2;
  6815. tabIDHover = 2;
  6816. } else if(super.mouseX >= 612 + paddingX && super.mouseX <= 641 + paddingX && super.mouseY >= 168 + (toggleFullscreen ? 261 : 0) + paddingY && super.mouseY < 203 + (toggleFullscreen ? 261 : 0) + paddingY && tabInterfaceIDs[2] != -1) {
  6817. //setTab(2);
  6818. menuActionName[1] = "Achievements";
  6819. menuActionID[1] = 1013;
  6820. menuActionRow = 2;
  6821. tabIDHover = 3;
  6822. } else if(super.mouseX >= 642 + paddingX && super.mouseX <= 671 + paddingX && super.mouseY >= 168 + (toggleFullscreen ? 261 : 0) + paddingY && super.mouseY < 205 + (toggleFullscreen ? 261 : 0) + paddingY && tabInterfaceIDs[3] != -1) {
  6823. //setTab(3);
  6824. menuActionName[1] = "Inventory";
  6825. menuActionID[1] = 1014;
  6826. menuActionRow = 2;
  6827. tabIDHover = 4;
  6828. } else if(super.mouseX >= 672 + paddingX && super.mouseX <= 701 + paddingX && super.mouseY >= 168 + (toggleFullscreen ? 261 : 0) + paddingY && super.mouseY < 205 + (toggleFullscreen ? 261 : 0) + paddingY && tabInterfaceIDs[4] != -1) {
  6829. //setTab(4);
  6830. menuActionName[1] = "Worn Equipment";
  6831. menuActionID[1] = 1015;
  6832. menuActionRow = 2;
  6833. tabIDHover = 5;
  6834. } else if(super.mouseX >= 702 + paddingX && super.mouseX <= 731 + paddingX && super.mouseY >= 169 + (toggleFullscreen ? 261 : 0) + paddingY && super.mouseY < 205 + (toggleFullscreen ? 261 : 0) + paddingY && tabInterfaceIDs[5] != -1) {
  6835. //setTab(5);
  6836. menuActionName[1] = "Prayer List";
  6837. menuActionID[1] = 1016;
  6838. menuActionRow = 2;
  6839. tabIDHover = 6;
  6840. } else if(super.mouseX >= 732 + paddingX && super.mouseX <= 761 + paddingX && super.mouseY >= 169 + (toggleFullscreen ? 261 : 0) + paddingY && super.mouseY < 205 + (toggleFullscreen ? 261 : 0) + paddingY && tabInterfaceIDs[6] != -1) {
  6841. //setTab(6);
  6842. menuActionName[1] = "Magic Spellbook";
  6843. menuActionID[1] = 1017;
  6844. menuActionRow = 2;
  6845. tabIDHover = 7;
  6846. } else if(super.mouseX >= 522 + paddingX && super.mouseX <= 551 + paddingX && super.mouseY >= 466 + paddingY && super.mouseY < 503 + paddingY && tabInterfaceIDs[16] != -1) {
  6847. //setTab(16);
  6848. menuActionName[1] = "Squeel of Fortune";
  6849. menuActionID[1] = 1043;
  6850. menuActionRow = 2;
  6851. tabIDHover = 14;
  6852. } else if(super.mouseX >= 552 + paddingX && super.mouseX <= 581 + paddingX && super.mouseY >= 466 + paddingY && super.mouseY < 503 + paddingY && tabInterfaceIDs[8] != -1) {
  6853. //setTab(8);
  6854. menuActionName[1] = "Friends List";
  6855. menuActionID[1] = 1019;
  6856. menuActionRow = 2;
  6857. tabIDHover = 8;
  6858. } else if(super.mouseX >= 582 + paddingX && super.mouseX <= 611 + paddingX && super.mouseY >= 466 + paddingY && super.mouseY < 503 + paddingY && tabInterfaceIDs[9] != -1) {
  6859. //setTab(9);
  6860. menuActionName[1] = "Ignore List";
  6861. menuActionID[1] = 1020;
  6862. menuActionRow = 2;
  6863. tabIDHover = 9;
  6864. } else if(super.mouseX >= 612 + paddingX && super.mouseX <= 641 + paddingX && super.mouseY >= 466 + paddingY && super.mouseY < 503 + paddingY && tabInterfaceIDs[7] != -1) {
  6865. //setTab(7);
  6866. menuActionName[1] = "Clan Chat";
  6867. menuActionID[1] = 1018;
  6868. menuActionRow = 2;
  6869. tabIDHover = 10;
  6870. } else if(super.mouseX >= 642 + paddingX && super.mouseX <= 671 + paddingX && super.mouseY >= 466 + paddingY && super.mouseY < 503 + paddingY && tabInterfaceIDs[11] != -1) {
  6871. //setTab(11);
  6872. menuActionName[1] = "Options";
  6873. menuActionID[1] = 1022;
  6874. menuActionRow = 2;
  6875. tabIDHover = 11;
  6876. } else if(super.mouseX >= 672 + paddingX && super.mouseX <= 701 + paddingX && super.mouseY >= 466 + paddingY && super.mouseY < 503 + paddingY && tabInterfaceIDs[12] != -1) {
  6877. //setTab(12);
  6878. menuActionName[1] = "Emotes";
  6879. menuActionID[1] = 1023;
  6880. menuActionRow = 2;
  6881. tabIDHover = 12;
  6882. } else if(super.mouseX >= 702 + paddingX && super.mouseX <= 731 + paddingX && super.mouseY >= 466 + paddingY && super.mouseY < 502 + paddingY && tabInterfaceIDs[13] != -1) {
  6883. //setTab(13);
  6884. menuActionName[1] = "Summoning";
  6885. menuActionID[1] = 1024;
  6886. menuActionRow = 2;
  6887. tabIDHover = 13;
  6888. } else if(super.mouseX >= 732 + paddingX && super.mouseX <= 761 + paddingX && super.mouseY >= 466 + paddingY && super.mouseY < 502 + paddingY && tabInterfaceIDs[15] != -1) {
  6889. //setTab(15);
  6890. menuActionName[1] = "Information";
  6891. menuActionID[1] = 1044;
  6892. menuActionRow = 2;
  6893. tabIDHover = 15;
  6894. } else {
  6895. tabIDHover = -1;
  6896. needDrawTabArea = true;
  6897. tabAreaAltered = true;
  6898. }
  6899. }
  6900. }
  6901.  
  6902. private void resetImageProducers2() {
  6903. if(chatBackImage != null)
  6904. return;
  6905. nullLoader();
  6906. rightFrame = null;
  6907. super.fullGameScreen = null;
  6908. aRSImageProducer_1107 = null;
  6909. aRSImageProducer_1108 = null;
  6910. aRSImageProducer_1109 = null;
  6911. aRSImageProducer_1110 = null;
  6912. aRSImageProducer_1111 = null;
  6913. aRSImageProducer_1112 = null;
  6914. aRSImageProducer_1113 = null;
  6915. aRSImageProducer_1114 = null;
  6916. aRSImageProducer_1115 = null;
  6917. chatBackImage = new RSImageProducer(xPaddingtabBack, yPaddingtabBack, getGameComponent());
  6918. mapBackImage = new RSImageProducer(miniMapWidth, miniMapHeight, getGameComponent());
  6919. DrawingArea.setAllPixelsToZero();
  6920. mapBack[0].drawBackground(0, 0);
  6921. rightFrame = new RSImageProducer(3, 170, getGameComponent());
  6922. sideTabArea = new RSImageProducer(246, 335, getGameComponent());
  6923. main3DArea = new RSImageProducer(512, 334, getGameComponent());
  6924. DrawingArea.setAllPixelsToZero();
  6925. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6926. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6927. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6928. welcomeScreenRaised = true;
  6929. }
  6930.  
  6931. public String getDocumentBaseHost() {
  6932. if (signlink.mainapp != null) {
  6933. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6934. }
  6935. if (super.gameFrame != null) {
  6936. return ""; // runescape.com <- removed for Jframe to work
  6937. } else {
  6938. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6939. }
  6940. }
  6941.  
  6942. private void drawMapSprites(Sprite sprite, int x, int y) {
  6943. if (sprite == null)
  6944. return;
  6945. try {
  6946. int xPadding = 0, yPadding = 0;
  6947. if(toggleFullscreen) {
  6948. xPadding = xPaddingmapBackImage + getMapIncreaseX();
  6949. yPadding = yPaddingmapBackImage + getMapIncreaseY();
  6950. }
  6951. int rotation = compassRotation + mapAmtDiffRotation & 0x7ff;
  6952. int distance = x * x + y * y;
  6953. if(distance > 6400)
  6954. return;
  6955. int spriteX = (Model.modelIntArray1[rotation] * 256) / (mapAmtDiffZoom + 256);
  6956. int spriteY = (Model.modelIntArray2[rotation] * 256) / (mapAmtDiffZoom + 256);
  6957. int drawX = y * spriteX + x * spriteY >> 16;
  6958. int drawY = y * spriteY - x * spriteX >> 16;
  6959. int finalX = ((mapSpritesX + drawX) - sprite.maxWidth / 2) + 4;
  6960. int finalY = ((mapSpritesY - drawY) - sprite.maxHeight / 2) - 4;//86
  6961. //if(distance > 2500) {
  6962. //sprite.drawWithinSprite(finalX, finalY, (toggleFullscreen ? miniMapBack[2] : miniMapBack[1]));
  6963. //} else {
  6964. sprite.drawSprite(finalX + xPadding, finalY + yPadding);
  6965. //}
  6966. } catch(ArrayIndexOutOfBoundsException ex) {
  6967.  
  6968. }
  6969. }
  6970.  
  6971. private void drawMapArrows(Sprite sprite, int x, int y) {
  6972. int distance = x * x + y * y;
  6973. int xPadding = 0, yPadding = 0;
  6974. if(toggleFullscreen) {
  6975. xPadding = xPaddingmapBackImage + getMapIncreaseX();
  6976. yPadding = yPaddingmapBackImage + getMapIncreaseY();
  6977. }
  6978. if(distance > 4225 && distance < 90000) {
  6979. int mapRotation = compassRotation + mapAmtDiffRotation & 0x7ff;
  6980. int spriteX = (Model.modelIntArray1[mapRotation] * 256) / (mapAmtDiffZoom + 256);
  6981. int spriteY = (Model.modelIntArray2[mapRotation] * 256) / (mapAmtDiffZoom + 256);
  6982. int drawX = y * spriteX + x * spriteY >> 16;
  6983. int drawY = y * spriteY - x * spriteX >> 16;
  6984. double spriteRotation = Math.atan2(drawX, drawY);
  6985. int finalX = (int)(Math.sin(spriteRotation) * 63D);
  6986. int finalY = (int)(Math.cos(spriteRotation) * 57D);
  6987. //mapEdge.drawRotatableSprite((mapSpritesX + finalX + 4) - 10,mapSpritesY - finalY - 20, spriteRotation);
  6988. } else {
  6989. drawMapSprites(sprite, x + xPadding, y + yPadding);
  6990. }
  6991. }
  6992.  
  6993. public boolean isInArea(int clickX, int clickY, int width, int height)
  6994. {
  6995. if(super.mouseX > clickX && super.mouseY > clickY && super.mouseX < clickX + width && super.mouseY < clickY + height)
  6996. return true;
  6997. else
  6998. return false;
  6999. }
  7000.  
  7001. public boolean clickInArea(int clickX, int clickY, int width, int height)
  7002. {
  7003. if(super.saveClickX > clickX && super.saveClickY > clickY && super.saveClickX < clickX + width && super.saveClickY < clickY + height)
  7004. return true;
  7005. else
  7006. return false;
  7007. }
  7008.  
  7009. public boolean inCircle(int circleX, int circleY, int radius)
  7010. {
  7011. return java.lang.Math.pow((circleX+radius - super.mouseX),2) + java.lang.Math.pow((circleY+radius - super.mouseY),2) < java.lang.Math.pow(radius,2);
  7012. }
  7013.  
  7014. private void rightClickMapArea(int paddingX, int paddingY) {
  7015. if(!coinToggle){
  7016. if (super.mouseX >= 512 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118) {
  7017. menuActionName[4] = coinToggle ? "Toggle money pouch" : "Toggle money pouch";
  7018. menuActionID[4] = 712;
  7019. menuActionName[3] = "Withdraw money pouch";
  7020. menuActionID[3] = 713;
  7021. menuActionName[2] = "Examine money pouch";
  7022. menuActionID[2] = 714;
  7023. menuActionName[1] = "Price checker";
  7024. menuActionID[1] = 715;
  7025. menuActionRow = 5;
  7026. }
  7027. } else if(coinToggle){
  7028. if (super.mouseX >= 436 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118) {
  7029. menuActionName[4] = coinToggle ? "Toggle money pouch" : "Toggle money pouch";
  7030. menuActionID[4] = 712;
  7031. menuActionName[3] = "Withdraw money pouch";
  7032. menuActionID[3] = 713;
  7033. menuActionName[2] = "Examine money pouch";
  7034. menuActionID[2] = 714;
  7035. menuActionName[1] = "Price checker";
  7036. menuActionID[1] = 715;
  7037. menuActionRow = 5;
  7038. }
  7039. }
  7040.  
  7041. if(!contextMenuOpen) {
  7042. processXPCounterClick(getMapIncreaseX(),getMapIncreaseY());
  7043. if(isInArea(xPaddingmapBackImage + (toggleFullscreen ? 207-52 : 207) + paddingX,0 + paddingY,21,21)) {
  7044. menuActionName[menuActionRow] = "Advisor";
  7045. menuActionID[menuActionRow] = 1051;
  7046. menuActionRow++;
  7047. advisorHover = (super.clickMode2 == 1) ? 2: 1;
  7048. } else {
  7049. advisorHover = 0;
  7050. }
  7051. if(isInArea(xPaddingmapBackImage + (toggleFullscreen ? 228-52 : 228) + paddingX,0 + paddingY,21,21) && (tabInterfaceIDs[10] != -1 && invOverlayInterfaceID == -1)) {
  7052. menuActionName[menuActionRow] = "Exit";
  7053. menuActionID[menuActionRow] = 1021;
  7054. menuActionRow++;
  7055. exitHover = (super.clickMode2 == 1) ? 2: 1;
  7056. } else {
  7057. exitHover = 0;
  7058. }
  7059. if(isInArea(xPaddingmapBackImage + (toggleFullscreen ? -44 : 145) + mapMovedX + paddingX,yPaddingmapBackImage + (toggleFullscreen ? 38 : 10) + mapMovedY + paddingY,57,34) && orbToggle[0]) {
  7060. menuActionName[menuActionRow] = "Use cure (p)";
  7061. menuActionID[menuActionRow] = 1052;
  7062. menuActionRow++;
  7063. orbHover = 0;
  7064. } else if(isInArea(xPaddingmapBackImage + (toggleFullscreen ? -47 : 161) + mapMovedX + paddingX,yPaddingmapBackImage + (toggleFullscreen ? 72 : 49) + mapMovedY + paddingY,57,34)) {
  7065. String prayerType = (prayerInterfaceType == 5608) ? "prayers" : "curses";
  7066. boolean inProcess = (tabInterfaceIDs[5] == 17200 || tabInterfaceIDs[5] == 17234);
  7067. menuActionName[menuActionRow] = (inProcess ? "Finish" : "Select") + " " + "quick " + prayerType + (inProcess ? " selection" : "");
  7068. menuActionID[menuActionRow] = 1046;
  7069. menuActionRow++;
  7070. menuActionName[menuActionRow] = "Turn quick " + prayerType + " " + (orbToggle[1] ? "off" : "on");
  7071. menuActionID[menuActionRow] = 1045;
  7072. menuActionRow++;
  7073. orbHover = 1;
  7074. } else if(isInArea(xPaddingmapBackImage + (toggleFullscreen ? -35 : 161) + mapMovedX + paddingX,yPaddingmapBackImage + (toggleFullscreen ? 106 : 88) + mapMovedY + paddingY,57,34)) {
  7075. menuActionName[menuActionRow] = "Rest";
  7076. menuActionID[menuActionRow] = 1048;
  7077. menuActionRow++;
  7078. menuActionName[menuActionRow] = "Turn run mode " + (orbToggle[2] ? "off" : "on");
  7079. menuActionID[menuActionRow] = 1047;
  7080. menuActionRow++;
  7081. orbHover = 2;
  7082. } else if(isInArea(xPaddingmapBackImage + (toggleFullscreen ? -12 : 145) + mapMovedX + paddingX,yPaddingmapBackImage + (toggleFullscreen ? 135 : 127) + mapMovedY + paddingY,57,34)) {
  7083. menuActionName[menuActionRow] = "Select left-click option";
  7084. menuActionID[menuActionRow] = 1053;
  7085. menuActionRow++;
  7086. menuActionName[menuActionRow] = "Call Follower";
  7087. menuActionID[menuActionRow] = 1054;
  7088. menuActionRow++;
  7089. menuActionName[menuActionRow] = "Dismiss";
  7090. menuActionID[menuActionRow] = 1055;
  7091. menuActionRow++;
  7092. menuActionName[menuActionRow] = "Take BoB";
  7093. menuActionID[menuActionRow] = 1056;
  7094. menuActionRow++;
  7095. menuActionName[menuActionRow] = "Renew Familiar";
  7096. menuActionID[menuActionRow] = 1057;
  7097. menuActionRow++;
  7098. menuActionName[menuActionRow] = "Attack";
  7099. menuActionID[menuActionRow] = 1058;
  7100. menuActionRow++;
  7101. menuActionName[menuActionRow] = "Follower Details";
  7102. menuActionID[menuActionRow] = 1059;
  7103. menuActionRow++;
  7104. orbHover = 3;
  7105. } else {
  7106. if(orbHover != -1)
  7107. orbHover = -1;
  7108. }
  7109. if(inCircle(xPaddingmapBackImage + (toggleFullscreen ? 30 : 11) + paddingX,yPaddingmapBackImage + (toggleFullscreen ? 9 : 8) + paddingY,17)) {
  7110. menuActionName[menuActionRow] = "Face north";
  7111. menuActionID[menuActionRow] = 1049;
  7112. menuActionRow++;
  7113. }
  7114. if(inCircle((toggleFullscreen ? 670 : 526) + paddingX,(toggleFullscreen ? 138 : 124),17)) {
  7115. menuActionName[menuActionRow] = "World map";
  7116. menuActionID[menuActionRow] = 1050;
  7117. menuActionRow++;
  7118. mapHover = 1;
  7119. } else {
  7120. mapHover = 0;
  7121. }
  7122. }
  7123. }
  7124.  
  7125. private void processChatButtonClick(int paddingX, int paddingY)
  7126. {
  7127. if(super.mouseX >= 5 + paddingX && super.mouseX <= 61 + paddingX && super.mouseY >= 482 + paddingY && super.mouseY <= 503 + paddingY)
  7128. {
  7129. menuActionName[menuActionRow] = "View All";
  7130. menuActionID[menuActionRow] = 999;
  7131. menuActionRow++;
  7132. } else if(super.mouseX >= 71 + paddingX && super.mouseX <= 127 + paddingX && super.mouseY >= 482 + paddingY && super.mouseY <= 503 + paddingY)
  7133. {
  7134. menuActionName[menuActionRow] = "View Game";
  7135. menuActionID[menuActionRow] = 998;
  7136. menuActionRow++;
  7137. } else if(super.mouseX >= 137 + paddingX && super.mouseX <= 193 + paddingX && super.mouseY >= 482 + paddingY && super.mouseY <= 503 + paddingY)
  7138. {
  7139. menuActionName[menuActionRow] = "Hide public";
  7140. menuActionID[menuActionRow] = 997;
  7141. menuActionRow++;
  7142. menuActionName[menuActionRow] = "Off public";
  7143. menuActionID[menuActionRow] = 996;
  7144. menuActionRow++;
  7145. menuActionName[menuActionRow] = "Friends public";
  7146. menuActionID[menuActionRow] = 995;
  7147. menuActionRow++;
  7148. menuActionName[menuActionRow] = "On public";
  7149. menuActionID[menuActionRow] = 994;
  7150. menuActionRow++;
  7151. menuActionName[menuActionRow] = "View public";
  7152. menuActionID[menuActionRow] = 993;
  7153. menuActionRow++;
  7154. } else if(super.mouseX >= 203 + paddingX && super.mouseX <= 259 + paddingX && super.mouseY >= 482 + paddingY && super.mouseY <= 503 + paddingY)
  7155. {
  7156. menuActionName[menuActionRow] = "Off private";
  7157. menuActionID[menuActionRow] = 992;
  7158. menuActionRow++;
  7159. menuActionName[menuActionRow] = "Friends private";
  7160. menuActionID[menuActionRow] = 991;
  7161. menuActionRow++;
  7162. menuActionName[menuActionRow] = "On private";
  7163. menuActionID[menuActionRow] = 990;
  7164. menuActionRow++;
  7165. menuActionName[menuActionRow] = "View private";
  7166. menuActionID[menuActionRow] = 989;
  7167. menuActionRow++;
  7168. } else if(super.mouseX >= 269 + paddingX && super.mouseX <= 325 + paddingX && super.mouseY >= 482 + paddingY && super.mouseY <= 503 + paddingY)
  7169. {
  7170. menuActionName[menuActionRow] = "Off clan chat";
  7171. menuActionID[menuActionRow] = 1003;
  7172. menuActionRow++;
  7173. menuActionName[menuActionRow] = "Friends clan chat";
  7174. menuActionID[menuActionRow] = 1002;
  7175. menuActionRow++;
  7176. menuActionName[menuActionRow] = "On clan chat";
  7177. menuActionID[menuActionRow] = 1001;
  7178. menuActionRow++;
  7179. menuActionName[menuActionRow] = "View clan chat";
  7180. menuActionID[menuActionRow] = 1000;
  7181. menuActionRow++;
  7182. } else if(super.mouseX >= 335 + paddingX && super.mouseX <= 391 + paddingX && super.mouseY >= 482 + paddingY && super.mouseY <= 503 + paddingY)
  7183. {
  7184. menuActionName[menuActionRow] = "Off trade";
  7185. menuActionID[menuActionRow] = 987;
  7186. menuActionRow++;
  7187. menuActionName[menuActionRow] = "Friends trade";
  7188. menuActionID[menuActionRow] = 986;
  7189. menuActionName[menuActionRow] = "On trade";
  7190. menuActionID[menuActionRow] = 985;
  7191. menuActionRow++;
  7192. menuActionName[menuActionRow] = "View trade";
  7193. menuActionID[menuActionRow] = 984;
  7194. menuActionRow++;
  7195. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 + paddingY && super.mouseY <= 501 + paddingY) {
  7196. menuActionName[menuActionRow] = "Staff Pannel";
  7197. menuActionID[menuActionRow] = 606;
  7198. menuActionRow++;
  7199. }
  7200. }
  7201.  
  7202. public void processRightClick() {
  7203. if (activeInterfaceType != 0) {
  7204. return;
  7205. }
  7206. menuActionName[0] = "Cancel";
  7207. menuActionID[0] = 1107;
  7208. menuActionRow = 1;
  7209. if (fullscreenInterfaceID != -1) {
  7210. hoverChildId = 0;
  7211. hoverToggleChildId = 0;
  7212. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  7213. if (hoverChildId != lastHoverChildId) {
  7214. lastHoverChildId = hoverChildId;
  7215. }
  7216. if (hoverToggleChildId != lastHoverToggleChildId) {
  7217. lastHoverToggleChildId = hoverToggleChildId;
  7218. }
  7219. return;
  7220. }
  7221. buildSplitPrivateChatMenu(0,getChatBackIncreaseY());
  7222. hoverChildId = 0;
  7223. hoverToggleChildId = 0;
  7224. int width = toggleFullscreen ? getScreenWidth() : 516;
  7225. int height = toggleFullscreen ? getScreenHeight() : 338;
  7226. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < width && super.mouseY < height
  7227. && !(!toggleFullscreen && super.mouseX > 519 + getTabIncreaseX() && super.mouseY > 168 + getTabIncreaseY() && super.mouseX < 519 + 246 + getTabIncreaseX() && super.mouseY < 168 + 335 + getTabIncreaseY())//Is not in inventory
  7228. && !(toggleFullscreen && focusTab != -1
  7229. //X end and Y start
  7230. && super.mouseX > (45-23 + xPaddingtabBack + getTabIncreaseX())
  7231. && super.mouseY > (55-23-46 + yPaddingtabBack + getTabIncreaseY())
  7232. && super.mouseX < (45-23 + xPaddingtabBack + getTabIncreaseX() + 204)
  7233. && super.mouseY < (55-23-46 + yPaddingtabBack + getTabIncreaseY() + 275)
  7234. )//Is not in inventory
  7235. && !(super.mouseX > 0 && super.mouseY > 338 + getChatBackIncreaseY() && super.mouseX < 517 && super.mouseY < 503 + getChatBackIncreaseY())//Is not in chat area
  7236. && !(super.mouseX > xPaddingmapBackImage + getMapIncreaseX() + (toggleFullscreen ? -25 : 0) && super.mouseY > 0 && super.mouseX < xPaddingmapBackImage + getMapIncreaseX() + 249 && super.mouseY < yPaddingmapBackImage + getMapIncreaseY() + 168)//Is not in map
  7237. ) {
  7238. if (openInterfaceID != -1) {
  7239. RSInterface rsInterface = RSInterface.interfaceCache[openInterfaceID];
  7240. if(toggleFullscreen) {
  7241. int interfaceWidth = toggleFullscreen ? getScreenWidth() : 516;
  7242. int interfaceHeight = toggleFullscreen ? getScreenHeight() : 338;
  7243. buildInterfaceMenu(4 + (interfaceWidth - rsInterface.width) / 2, rsInterface, super.mouseX, 4 + (interfaceHeight - rsInterface.height) / 2, super.mouseY, 0);
  7244. } else
  7245. buildInterfaceMenu(4, rsInterface, super.mouseX, 4, super.mouseY, 0);
  7246. } else {
  7247. build3dScreenMenu();
  7248. }
  7249. }
  7250. if (hoverChildId != lastHoverChildId) {
  7251. lastHoverChildId = hoverChildId;
  7252. }
  7253. if (hoverToggleChildId != lastHoverToggleChildId) {
  7254. lastHoverToggleChildId = hoverToggleChildId;
  7255. }
  7256. hoverChildId = 0;
  7257. hoverToggleChildId = 0;
  7258. if(super.mouseX > 548 + getTabIncreaseX() && super.mouseY > 207 - (toggleFullscreen ? 46 : 0) + getTabIncreaseY() && super.mouseX < 740 + getTabIncreaseX() && super.mouseY < 468 + getTabIncreaseY()) {
  7259. if(invOverlayInterfaceID != -1) {
  7260. buildInterfaceMenu(547 + getTabIncreaseX(), RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 205 - (toggleFullscreen ? 46 : 0) + getTabIncreaseY(), super.mouseY, 0);
  7261. } else if(tabInterfaceIDs[tabID] != -1) {
  7262. if(focusTab != -1)
  7263. buildInterfaceMenu(547 + getTabIncreaseX(), RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 205 - (toggleFullscreen ? 46 : 0) + getTabIncreaseY(), super.mouseY, 0);
  7264. }
  7265. }
  7266. if (hoverChildId != anInt1048) {
  7267. needDrawTabArea = true;
  7268. tabAreaAltered = true;
  7269. anInt1048 = hoverChildId;
  7270. }
  7271. if (hoverToggleChildId != anInt1044) {
  7272. needDrawTabArea = true;
  7273. tabAreaAltered = true;
  7274. anInt1044 = hoverToggleChildId;
  7275. }
  7276. hoverChildId = 0;
  7277. hoverToggleChildId = 0;
  7278. if(super.mouseX > 0 && super.mouseY > 338 + getChatBackIncreaseY() && super.mouseX < 490 && super.mouseY < 503 + getChatBackIncreaseY()) {
  7279. if(backDialogID != -1) {
  7280. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358 + getChatBackIncreaseY(), super.mouseY, 0);
  7281. } else if(super.mouseY < 503 + getChatBackIncreaseY() && super.mouseX < 490 + getChatBackIncreaseY()) {
  7282. buildChatAreaMenu(super.mouseY - (yPaddingchatBackImage + getChatBackIncreaseY()));
  7283. }
  7284. }
  7285. if (backDialogID != -1 && hoverChildId != anInt1039) {
  7286. inputTaken = true;
  7287. anInt1039 = hoverChildId;
  7288. }
  7289. if (backDialogID != -1 && hoverToggleChildId != anInt1500) {
  7290. inputTaken = true;
  7291. anInt1500 = hoverToggleChildId;
  7292. }
  7293. /* Enable custom right click areas */
  7294.  
  7295. processChatButtonClick(0, getChatBackIncreaseY());
  7296. rightClickMapArea(getMapIncreaseX(),getMapIncreaseY());
  7297. processTabClick(getTabIncreaseX(),getTabIncreaseY());
  7298. alertHandler.processMouse(super.mouseX, super.mouseY);
  7299. /**/
  7300. boolean flag = false;
  7301. while (!flag) {
  7302. flag = true;
  7303. for (int j = 0; j < menuActionRow - 1; j++) {
  7304. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7305. String s = menuActionName[j];
  7306. menuActionName[j] = menuActionName[j + 1];
  7307. menuActionName[j + 1] = s;
  7308. int k = menuActionID[j];
  7309. menuActionID[j] = menuActionID[j + 1];
  7310. menuActionID[j + 1] = k;
  7311. k = menuActionCmd2[j];
  7312. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7313. menuActionCmd2[j + 1] = k;
  7314. k = menuActionCmd3[j];
  7315. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7316. menuActionCmd3[j + 1] = k;
  7317. k = menuActionCmd1[j];
  7318. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7319. menuActionCmd1[j + 1] = k;
  7320. flag = false;
  7321. }
  7322. }
  7323. }
  7324. }
  7325. public void WhatWorldIsWhatIp () { // Fixes both worlds
  7326. if(world == 1){
  7327. serverip = "ruinedscape.no-ip.biz";
  7328. port = 43594;
  7329. } else {
  7330. if(world == 2){
  7331. serverip = "127.0.0.1";
  7332. port = 43594;
  7333. }
  7334. }
  7335. }
  7336.  
  7337. private int method83(int i, int j, int k)
  7338. {
  7339. int l = 256 - k;
  7340. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7341. }
  7342.  
  7343. private void login(String s, String s1, boolean flag) {
  7344. signlink.errorname = s;
  7345. String s2 = "error";
  7346. try {
  7347.  
  7348. if (!flag) {
  7349. loginMessage1 = "";
  7350. loginMessage2 = "@whi@Connecting to server...";
  7351. drawLoginScreen(true);
  7352. }
  7353. //socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7354. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7355. WhatWorldIsWhatIp();
  7356. long l = TextClass.longForName(s2);
  7357. int i = (int) (l >> 16 & 31L);
  7358. stream.currentOffset = 0;
  7359. stream.writeWordBigEndian(14);
  7360. stream.writeWordBigEndian(i);
  7361. socketStream.queueBytes(2, stream.buffer);
  7362. for (int j = 0; j < 8; j++)
  7363. socketStream.read();
  7364.  
  7365. int k = socketStream.read();
  7366. int i1 = k;
  7367. if (k == 0) {
  7368. socketStream.flushInputStream(inStream.buffer, 8);
  7369. inStream.currentOffset = 0;
  7370. aLong1215 = inStream.readQWord();
  7371. int ai[] = new int[4];
  7372. ai[0] = (int) (Math.random() * 99999999D);
  7373. ai[1] = (int) (Math.random() * 99999999D);
  7374. ai[2] = (int) (aLong1215 >> 32);
  7375. ai[3] = (int) aLong1215;
  7376. stream.currentOffset = 0;
  7377. stream.writeWordBigEndian(10);
  7378. stream.writeDWord(ai[0]);
  7379. stream.writeDWord(ai[1]);
  7380. stream.writeDWord(ai[2]);
  7381. stream.writeDWord(ai[3]);
  7382. stream.writeDWord(99140);
  7383. stream.writeString(s);
  7384. stream.writeString(s1);
  7385. stream.doKeys();
  7386. aStream_847.currentOffset = 0;
  7387. if (flag)
  7388. aStream_847.writeWordBigEndian(18);
  7389. else
  7390. aStream_847.writeWordBigEndian(16);
  7391. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  7392. + 1 + 2);
  7393. aStream_847.writeWordBigEndian(558);
  7394. aStream_847.writeWord(1);
  7395. aStream_847.writeWordBigEndian(6);
  7396. for (int l1 = 0; l1 < 9; l1++)
  7397. aStream_847.writeDWord(expectedCRCs[l1]);
  7398.  
  7399. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7400. stream.encryption = new ISAACRandomGen(ai);
  7401. for (int j2 = 0; j2 < 4; j2++)
  7402. ai[j2] += 50;
  7403.  
  7404. encryption = new ISAACRandomGen(ai);
  7405. socketStream.queueBytes(aStream_847.currentOffset,
  7406. aStream_847.buffer);
  7407. k = socketStream.read();
  7408. }
  7409. if (k == 1) {
  7410. try {
  7411. Thread.sleep(2000L);
  7412. } catch (Exception _ex) {
  7413. }
  7414. login(s, s1, flag);
  7415. return;
  7416. }
  7417. if(k == 2)
  7418. {
  7419. setDetails();
  7420. myPrivilege = socketStream.read();
  7421. flagged = socketStream.read() == 1;
  7422. aLong1220 = 0L;
  7423. anInt1022 = 0;
  7424. mouseDetection.coordsIndex = 0;
  7425. super.awtFocus = true;
  7426. aBoolean954 = true;
  7427. loggedIn = true;
  7428. stream.currentOffset = 0;
  7429. inStream.currentOffset = 0;
  7430. pktType = -1;
  7431. anInt841 = -1;
  7432. anInt842 = -1;
  7433. anInt843 = -1;
  7434. pktSize = 0;
  7435. anInt1009 = 0;
  7436. systemUpdatetime = 0;
  7437. anInt1011 = 0;
  7438. hintType = 0;
  7439. menuActionRow = 0;
  7440. contextMenuOpen = false;
  7441. super.idleTime = 0;
  7442. for(int j1 = 0; j1 < 100; j1++)
  7443. chatMessages[j1] = null;
  7444. summoningAttack = false;
  7445. itemSelected = 0;
  7446. spellSelected = 0;
  7447. loadingStage = 0;
  7448. anInt1062 = 0;
  7449. anInt1278 = (int)(Math.random() * 100D) - 50;
  7450. anInt1131 = (int)(Math.random() * 110D) - 55;
  7451. anInt896 = (int)(Math.random() * 80D) - 40;
  7452. mapAmtDiffRotation = (int)(Math.random() * 120D) - 60;
  7453. mapAmtDiffZoom = (int)(Math.random() * 30D) - 20;
  7454. compassRotation = (int)(Math.random() * 20D) - 10 & 0x7ff;
  7455. minimapCover = 0;
  7456. anInt985 = -1;
  7457. destX = 0;
  7458. destY = 0;
  7459. playerCount = 0;
  7460. npcCount = 0;
  7461. for (int i2 = 0; i2 < maxPlayers; i2++) {
  7462. playerArray[i2] = null;
  7463. aStreamArray895s[i2] = null;
  7464. }
  7465.  
  7466. for (int k2 = 0; k2 < 16384; k2++)
  7467. npcArray[k2] = null;
  7468.  
  7469. myPlayer = playerArray[myPlayerIndex] = new Player();
  7470. aClass19_1013.removeAll();
  7471. aClass19_1056.removeAll();
  7472. for (int l2 = 0; l2 < 4; l2++) {
  7473. for (int i3 = 0; i3 < 104; i3++) {
  7474. for (int k3 = 0; k3 < 104; k3++)
  7475. groundArray[l2][i3][k3] = null;
  7476.  
  7477. }
  7478.  
  7479. }
  7480.  
  7481. aClass19_1179 = new NodeList();
  7482. fullscreenInterfaceID = -1;
  7483. anInt900 = 0;
  7484. friendsCount = 0;
  7485. dialogID = -1;
  7486. backDialogID = -1;
  7487. openInterfaceID = -1;
  7488. invOverlayInterfaceID = -1;
  7489. walkableInterfaceID = -1;
  7490. aBoolean1149 = false;
  7491. tabID = 3;
  7492. inputDialogState = 0;
  7493. contextMenuOpen = false;
  7494. messagePromptRaised = false;
  7495. aString844 = null;
  7496. displayOverLayIcon = 0;
  7497. tabIconFlash = -1;
  7498. aBoolean1047 = true;
  7499. method45();
  7500. for (int j3 = 0; j3 < 5; j3++)
  7501. anIntArray990[j3] = 0;
  7502.  
  7503. for (int l3 = 0; l3 < 5; l3++) {
  7504. atPlayerActions[l3] = null;
  7505. atPlayerArray[l3] = false;
  7506. }
  7507.  
  7508. anInt1175 = 0;
  7509. anInt1134 = 0;
  7510. anInt986 = 0;
  7511. anInt1288 = 0;
  7512. anInt924 = 0;
  7513. anInt1188 = 0;
  7514. anInt1155 = 0;
  7515. anInt1226 = 0;
  7516. @SuppressWarnings("unused")
  7517. int anInt941 = 0;
  7518. @SuppressWarnings("unused")
  7519. int anInt1260 = 0;
  7520. resetImageProducers2();
  7521. return;
  7522. }
  7523. if (k == 3) {
  7524. loginMessage1 = "";
  7525. loginMessage2 = "@whi@Invalid username or password.";
  7526. return;
  7527. }
  7528. if (k == 4) {
  7529. loginMessage1 = "@whi@Your account has been Banned.";
  7530. loginMessage2 = "@whi@Please Appeal For Unban on Forums";
  7531. return;
  7532. }
  7533. if (k == 5) {
  7534. loginMessage1 = "@whi@Your account is already logged in.";
  7535. loginMessage2 = "@whi@If you have just left another world be patient.";
  7536. return;
  7537. }
  7538. if (k == 6) {
  7539. loginMessage1 = "@whi@RuinedScape has been updated!";
  7540. loginMessage2 = "@whi@Please reload this page.";
  7541. return;
  7542. }
  7543. if (k == 7) {
  7544. loginMessage1 = "@whi@This world is full.";
  7545. loginMessage2 = "@whi@Please use a different world.";
  7546. return;
  7547. }
  7548. if (k == 8) {
  7549. loginMessage1 = "@whi@Unable to connect.";
  7550. loginMessage2 = "@whi@Login server offline.";
  7551. return;
  7552. }
  7553. if (k == 9) {
  7554. loginMessage1 = "@whi@Login limit exceeded.";
  7555. loginMessage2 = "@whi@Too many connections from your address.";
  7556. return;
  7557. }
  7558. if (k == 10) {
  7559. loginMessage1 = "@whi@Unable to connect.";
  7560. loginMessage2 = "@whi@Bad session id.";
  7561. return;
  7562. }
  7563. if (k == 11) {
  7564. loginMessage1 = "@whi@Login server rejected session.";
  7565. loginMessage2 = "@whi@Please try again.";
  7566. return;
  7567. }
  7568. if (k == 12) {
  7569. loginMessage1 = "@whi@You need a members account to login to this world.";
  7570. loginMessage2 = "@whi@Please subscribe, or use a different world.";
  7571. return;
  7572. }
  7573. if (k == 13) {
  7574. loginMessage1 = "@whi@Could not complete login.";
  7575. loginMessage2 = "@whi@Please try using a different world.";
  7576. return;
  7577. }
  7578. if (k == 14) {
  7579. loginMessage1 = "@whi@The server is being updated.";
  7580. loginMessage2 = "@whi@Please wait 1 minute and try again.";
  7581. return;
  7582. }
  7583. if(k == 15)
  7584. {
  7585. loggedIn = true;
  7586. stream.currentOffset = 0;
  7587. inStream.currentOffset = 0;
  7588. pktType = -1;
  7589. anInt841 = -1;
  7590. anInt842 = -1;
  7591. anInt843 = -1;
  7592. pktSize = 0;
  7593. anInt1009 = 0;
  7594. systemUpdatetime = 0;
  7595. menuActionRow = 0;
  7596. contextMenuOpen = false;
  7597. aLong824 = System.currentTimeMillis();
  7598. return;
  7599. }
  7600. if (k == 16) {
  7601. loginMessage1 = "@whi@Login attempts exceeded.";
  7602. loginMessage2 = "@whi@Please wait 1 minute and try again.";
  7603. return;
  7604. }
  7605. if (k == 17) {
  7606. loginMessage1 = "@whi@You are standing in a members-only area.";
  7607. loginMessage2 = "@whi@To play on this world move to a free area first";
  7608. return;
  7609. }
  7610. if (k == 20) {
  7611. loginMessage1 = "@whi@Invalid loginserver requested";
  7612. loginMessage2 = "@whi@Please try using a different world.";
  7613. return;
  7614. }
  7615. if (k == 21) {
  7616. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  7617. loginMessage1 = "@whi@You have only just left another world";
  7618. loginMessage2 = "@whi@Your profile will be transferred in: "
  7619. + k1 + " seconds";
  7620. drawLoginScreen(true);
  7621. try {
  7622. Thread.sleep(1000L);
  7623. } catch (Exception _ex) {
  7624. }
  7625. }
  7626.  
  7627. login(s, s1, flag);
  7628. return;
  7629. }
  7630. if (k == -1) {
  7631. if (i1 == 0) {
  7632. if (loginFailures < 2) {
  7633. try {
  7634. Thread.sleep(2000L);
  7635. } catch (Exception _ex) {
  7636. }
  7637. loginFailures++;
  7638. login(s, s1, flag);
  7639. return;
  7640. } else {
  7641. loginMessage1 = "@whi@No response from loginserver";
  7642. loginMessage2 = "@whi@Reload Browser or Wait 1 Min";
  7643. return;
  7644. }
  7645. } else {
  7646. loginMessage1 = "@whi@No response from server";
  7647. loginMessage2 = "@whi@Reload Browser or use Diff World";
  7648. return;
  7649. }
  7650. } else {
  7651. // System.out.println("response:" + k);
  7652. loginMessage1 = "@whi@Unexpected server response";
  7653. loginMessage2 = "@whi@Reload Browser or use Diff World";
  7654. return;
  7655. }
  7656. } catch (IOException _ex) {
  7657. loginMessage1 = "";
  7658. }
  7659. loginMessage2 = "@whi@Error connecting to server.";
  7660. }
  7661.  
  7662. 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) {
  7663. byte byte0 = 104;
  7664. byte byte1 = 104;
  7665. for(int l2 = 0; l2 < byte0; l2++) {
  7666. for(int i3 = 0; i3 < byte1; i3++) {
  7667. anIntArrayArray901[l2][i3] = 0;
  7668. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7669. }
  7670. }
  7671. int j3 = j2;
  7672. int k3 = j1;
  7673. anIntArrayArray901[j2][j1] = 99;
  7674. anIntArrayArray825[j2][j1] = 0;
  7675. int l3 = 0;
  7676. int i4 = 0;
  7677. bigX[l3] = j2;
  7678. bigY[l3++] = j1;
  7679. boolean flag1 = false;
  7680. int j4 = bigX.length;
  7681. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7682. while(i4 != l3)
  7683. {
  7684. j3 = bigX[i4];
  7685. k3 = bigY[i4];
  7686. i4 = (i4 + 1) % j4;
  7687. if(j3 == k2 && k3 == i2)
  7688. {
  7689. flag1 = true;
  7690. break;
  7691. }
  7692. if(i1 != 0)
  7693. {
  7694. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  7695. {
  7696. flag1 = true;
  7697. break;
  7698. }
  7699. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  7700. {
  7701. flag1 = true;
  7702. break;
  7703. }
  7704. }
  7705. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  7706. {
  7707. flag1 = true;
  7708. break;
  7709. }
  7710. int l4 = anIntArrayArray825[j3][k3] + 1;
  7711. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  7712. {
  7713. bigX[l3] = j3 - 1;
  7714. bigY[l3] = k3;
  7715. l3 = (l3 + 1) % j4;
  7716. anIntArrayArray901[j3 - 1][k3] = 2;
  7717. anIntArrayArray825[j3 - 1][k3] = l4;
  7718. }
  7719. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  7720. {
  7721. bigX[l3] = j3 + 1;
  7722. bigY[l3] = k3;
  7723. l3 = (l3 + 1) % j4;
  7724. anIntArrayArray901[j3 + 1][k3] = 8;
  7725. anIntArrayArray825[j3 + 1][k3] = l4;
  7726. }
  7727. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  7728. {
  7729. bigX[l3] = j3;
  7730. bigY[l3] = k3 - 1;
  7731. l3 = (l3 + 1) % j4;
  7732. anIntArrayArray901[j3][k3 - 1] = 1;
  7733. anIntArrayArray825[j3][k3 - 1] = l4;
  7734. }
  7735. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  7736. {
  7737. bigX[l3] = j3;
  7738. bigY[l3] = k3 + 1;
  7739. l3 = (l3 + 1) % j4;
  7740. anIntArrayArray901[j3][k3 + 1] = 4;
  7741. anIntArrayArray825[j3][k3 + 1] = l4;
  7742. }
  7743. 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)
  7744. {
  7745. bigX[l3] = j3 - 1;
  7746. bigY[l3] = k3 - 1;
  7747. l3 = (l3 + 1) % j4;
  7748. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7749. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7750. }
  7751. 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)
  7752. {
  7753. bigX[l3] = j3 + 1;
  7754. bigY[l3] = k3 - 1;
  7755. l3 = (l3 + 1) % j4;
  7756. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7757. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7758. }
  7759. 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)
  7760. {
  7761. bigX[l3] = j3 - 1;
  7762. bigY[l3] = k3 + 1;
  7763. l3 = (l3 + 1) % j4;
  7764. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7765. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7766. }
  7767. 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)
  7768. {
  7769. bigX[l3] = j3 + 1;
  7770. bigY[l3] = k3 + 1;
  7771. l3 = (l3 + 1) % j4;
  7772. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7773. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7774. }
  7775. }
  7776. anInt1264 = 0;
  7777. if(!flag1)
  7778. {
  7779. if(flag)
  7780. {
  7781. int i5 = 100;
  7782. for(int k5 = 1; k5 < 2; k5++)
  7783. {
  7784. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  7785. {
  7786. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7787. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  7788. {
  7789. i5 = anIntArrayArray825[i6][l6];
  7790. j3 = i6;
  7791. k3 = l6;
  7792. anInt1264 = 1;
  7793. flag1 = true;
  7794. }
  7795.  
  7796. }
  7797.  
  7798. if(flag1)
  7799. break;
  7800. }
  7801.  
  7802. }
  7803. if(!flag1)
  7804. return false;
  7805. }
  7806. i4 = 0;
  7807. bigX[i4] = j3;
  7808. bigY[i4++] = k3;
  7809. int l5;
  7810. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  7811. {
  7812. if(j5 != l5)
  7813. {
  7814. l5 = j5;
  7815. bigX[i4] = j3;
  7816. bigY[i4++] = k3;
  7817. }
  7818. if((j5 & 2) != 0)
  7819. j3++;
  7820. else
  7821. if((j5 & 8) != 0)
  7822. j3--;
  7823. if((j5 & 1) != 0)
  7824. k3++;
  7825. else
  7826. if((j5 & 4) != 0)
  7827. k3--;
  7828. }
  7829. // if(cancelWalk) { return i4 > 0; }
  7830.  
  7831.  
  7832. if(i4 > 0)
  7833. {
  7834. int k4 = i4;
  7835. if(k4 > 25)
  7836. k4 = 25;
  7837. i4--;
  7838. int k6 = bigX[i4];
  7839. int i7 = bigY[i4];
  7840. anInt1288 += k4;
  7841. if(anInt1288 >= 92)
  7842. {
  7843. stream.createFrame(36);
  7844. stream.writeDWord(0);
  7845. anInt1288 = 0;
  7846. }
  7847. if(i == 0)
  7848. {
  7849. stream.createFrame(164);
  7850. stream.writeWordBigEndian(k4 + k4 + 3);
  7851. }
  7852. if(i == 1)
  7853. {
  7854. stream.createFrame(248);
  7855. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7856. }
  7857. if(i == 2)
  7858. {
  7859. stream.createFrame(98);
  7860. stream.writeWordBigEndian(k4 + k4 + 3);
  7861. }
  7862. stream.method433(k6 + baseX);
  7863. destX = bigX[0];
  7864. destY = bigY[0];
  7865. for(int j7 = 1; j7 < k4; j7++)
  7866. {
  7867. i4--;
  7868. stream.writeWordBigEndian(bigX[i4] - k6);
  7869. stream.writeWordBigEndian(bigY[i4] - i7);
  7870. }
  7871.  
  7872. stream.method431(i7 + baseY);
  7873. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7874. return true;
  7875. }
  7876. return i != 1;
  7877. }
  7878.  
  7879. private void method86(Stream stream)
  7880. {
  7881. for(int j = 0; j < anInt893; j++)
  7882. {
  7883. int k = anIntArray894[j];
  7884. NPC npc = npcArray[k];
  7885. int l = stream.readUnsignedByte();
  7886. if((l & 0x10) != 0)
  7887. {
  7888. int i1 = stream.method434();
  7889. if(i1 == 65535)
  7890. i1 = -1;
  7891. int i2 = stream.readUnsignedByte();
  7892. if(i1 == npc.anim && i1 != -1)
  7893. {
  7894. int l2 = Animation.anims[i1].anInt365;
  7895. if(l2 == 1)
  7896. {
  7897. npc.anInt1527 = 0;
  7898. npc.anInt1528 = 0;
  7899. npc.anInt1529 = i2;
  7900. npc.anInt1530 = 0;
  7901. }
  7902. if(l2 == 2)
  7903. npc.anInt1530 = 0;
  7904. } else
  7905. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  7906. {
  7907. npc.anim = i1;
  7908. npc.anInt1527 = 0;
  7909. npc.anInt1528 = 0;
  7910. npc.anInt1529 = i2;
  7911. npc.anInt1530 = 0;
  7912. npc.anInt1542 = npc.smallXYIndex;
  7913. }
  7914. }
  7915. if((l & 8) != 0)
  7916. {
  7917. int damage = stream.method426();
  7918. int type = stream.method427();
  7919. int icon = stream.readUnsignedByte();
  7920. int focusNPC = stream.readUnsignedByte();
  7921. npc.updateHitData(type, damage, loopCycle, icon, 0, focusNPC);
  7922. npc.loopCycleStatus = loopCycle + 300;
  7923. npc.currentHealth = stream.method426();
  7924. npc.maxHealth = stream.readUnsignedByte();
  7925. }
  7926. if((l & 0x80) != 0)
  7927. {
  7928. npc.anInt1520 = stream.readUnsignedWord();
  7929. int k1 = stream.readDWord();
  7930. npc.anInt1524 = k1 >> 16;
  7931. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7932. npc.anInt1521 = 0;
  7933. npc.anInt1522 = 0;
  7934. if(npc.anInt1523 > loopCycle)
  7935. npc.anInt1521 = -1;
  7936. if(npc.anInt1520 == 65535)
  7937. npc.anInt1520 = -1;
  7938. }
  7939. if((l & 0x20) != 0)
  7940. {
  7941. npc.interactingEntity = stream.readUnsignedWord();
  7942. if(npc.interactingEntity == 65535)
  7943. npc.interactingEntity = -1;
  7944. }
  7945. if((l & 1) != 0)
  7946. {
  7947. npc.textSpoken = stream.readString();
  7948. npc.textCycle = 100;
  7949. //entityMessage(npc);
  7950. }
  7951. if((l & 0x40) != 0)
  7952. {
  7953. int damage = stream.method427();
  7954. int type = stream.method428();
  7955. int icon = stream.readUnsignedByte();
  7956. int focusNPC = stream.readUnsignedByte();
  7957. npc.updateHitData(type, damage, loopCycle, icon, 0, focusNPC);
  7958. npc.loopCycleStatus = loopCycle + 300;
  7959. npc.currentHealth = stream.method428();
  7960. npc.maxHealth = stream.method427();
  7961. }
  7962. if((l & 2) != 0)
  7963. {
  7964. npc.desc = EntityDef.forID(stream.method436());
  7965. npc.anInt1540 = npc.desc.aByte68;
  7966. npc.anInt1504 = npc.desc.anInt79;
  7967. npc.anInt1554 = npc.desc.walkAnim;
  7968. npc.anInt1555 = npc.desc.anInt58;
  7969. npc.anInt1556 = npc.desc.anInt83;
  7970. npc.anInt1557 = npc.desc.anInt55;
  7971. npc.anInt1511 = npc.desc.standAnim;
  7972. }
  7973. if((l & 4) != 0)
  7974. {
  7975. npc.anInt1538 = stream.method434();
  7976. npc.anInt1539 = stream.method434();
  7977. }
  7978. }
  7979. }
  7980.  
  7981. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  7982. {
  7983. if(menuActionRow >= 400)
  7984. return;
  7985. if(entityDef.childrenIDs != null)
  7986. entityDef = entityDef.method161();
  7987. if(entityDef == null)
  7988. return;
  7989. if(!entityDef.aBoolean84)
  7990. return;
  7991. String s = entityDef.name;
  7992. if(entityDef.combatLevel != 0)
  7993. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level:" + entityDef.combatLevel + ")";
  7994. if(summoningAttack) {
  7995. menuActionName[menuActionRow] = "Use familiar attack with @whi@" + s;
  7996. menuActionID[menuActionRow] = 582;
  7997. menuActionCmd1[menuActionRow] = i;
  7998. menuActionCmd2[menuActionRow] = k;
  7999. menuActionCmd3[menuActionRow] = j;
  8000. menuActionRow++;
  8001. return;
  8002. }
  8003. if(itemSelected == 1)
  8004. {
  8005. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  8006. menuActionID[menuActionRow] = 582;
  8007. menuActionCmd1[menuActionRow] = i;
  8008. menuActionCmd2[menuActionRow] = k;
  8009. menuActionCmd3[menuActionRow] = j;
  8010. menuActionRow++;
  8011. return;
  8012. }
  8013. if(spellSelected == 1)
  8014. {
  8015. if((spellUsableOn & 2) == 2)
  8016. {
  8017. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8018. menuActionID[menuActionRow] = 413;
  8019. menuActionCmd1[menuActionRow] = i;
  8020. menuActionCmd2[menuActionRow] = k;
  8021. menuActionCmd3[menuActionRow] = j;
  8022. menuActionRow++;
  8023. }
  8024. } else
  8025. {
  8026. if(entityDef.itemActions != null)
  8027. {
  8028. for(int l = 4; l >= 0; l--)
  8029. if(entityDef.itemActions[l] != null && !entityDef.itemActions[l].equalsIgnoreCase("attack"))
  8030. {
  8031. menuActionName[menuActionRow] = entityDef.itemActions[l] + " @yel@" + s;
  8032. if(l == 0)
  8033. menuActionID[menuActionRow] = 20;
  8034. if(l == 1)
  8035. menuActionID[menuActionRow] = 412;
  8036. if(l == 2)
  8037. menuActionID[menuActionRow] = 225;
  8038. if(l == 3)
  8039. menuActionID[menuActionRow] = 965;
  8040. if(l == 4)
  8041. menuActionID[menuActionRow] = 478;
  8042. menuActionCmd1[menuActionRow] = i;
  8043. menuActionCmd2[menuActionRow] = k;
  8044. menuActionCmd3[menuActionRow] = j;
  8045. menuActionRow++;
  8046. }
  8047.  
  8048. }
  8049. if(entityDef.itemActions != null)
  8050. {
  8051. for(int i1 = 4; i1 >= 0; i1--)
  8052. if(entityDef.itemActions[i1] != null && entityDef.itemActions[i1].equalsIgnoreCase("attack"))
  8053. {
  8054. char c = '\0';
  8055. if(entityDef.combatLevel > myPlayer.combatLevel)
  8056. c = '\u07D0';
  8057. menuActionName[menuActionRow] = entityDef.itemActions[i1] + " @yel@" + s;
  8058. if(i1 == 0)
  8059. menuActionID[menuActionRow] = 20 + c;
  8060. if(i1 == 1)
  8061. menuActionID[menuActionRow] = 412 + c;
  8062. if(i1 == 2)
  8063. menuActionID[menuActionRow] = 225 + c;
  8064. if(i1 == 3)
  8065. menuActionID[menuActionRow] = 965 + c;
  8066. if(i1 == 4)
  8067. menuActionID[menuActionRow] = 478 + c;
  8068. menuActionCmd1[menuActionRow] = i;
  8069. menuActionCmd2[menuActionRow] = k;
  8070. menuActionCmd3[menuActionRow] = j;
  8071. menuActionRow++;
  8072. }
  8073.  
  8074. }
  8075. menuActionName[menuActionRow] = "Examine @yel@" + s + ((myPrivilege != 0) ? ", @gre@(@whi@" + entityDef.type + "@gre@)" : "");
  8076. menuActionID[menuActionRow] = 1025;
  8077. menuActionCmd1[menuActionRow] = i;
  8078. menuActionCmd2[menuActionRow] = k;
  8079. menuActionCmd3[menuActionRow] = j;
  8080. menuActionRow++;
  8081. }
  8082. }
  8083.  
  8084. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  8085. {
  8086. if(player == myPlayer)
  8087. return;
  8088. if(menuActionRow >= 400)
  8089. return;
  8090. String s;
  8091. if (player.skill == 0) {
  8092. s = player.name
  8093. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8094. + " (level-" + player.combatLevel + ")";
  8095. } else {
  8096. s = "@or2@" + getRank(player.skill) + "@whi@ " + player.name
  8097. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8098. + " (level-" + player.combatLevel + ")";
  8099. }
  8100. if(summoningAttack) {
  8101. menuActionName[menuActionRow] = "Use familiar attack with @whi@" + s;
  8102. menuActionID[menuActionRow] = 491;
  8103. menuActionCmd1[menuActionRow] = j;
  8104. menuActionCmd2[menuActionRow] = i;
  8105. menuActionCmd3[menuActionRow] = k;
  8106. menuActionRow++;
  8107. }
  8108. if(itemSelected == 1)
  8109. {
  8110. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  8111. menuActionID[menuActionRow] = 491;
  8112. menuActionCmd1[menuActionRow] = j;
  8113. menuActionCmd2[menuActionRow] = i;
  8114. menuActionCmd3[menuActionRow] = k;
  8115. menuActionRow++;
  8116. } else
  8117. {
  8118. for(int index = 4; index >= 0; index--)
  8119. if(atPlayerActions[index] != null)
  8120. {
  8121. menuActionName[menuActionRow] = atPlayerActions[index] + " @whi@" + s;
  8122. char c = '\0';
  8123. if(atPlayerActions[index].equalsIgnoreCase("attack"))
  8124. {
  8125. if(player.combatLevel > myPlayer.combatLevel)
  8126. c = '\u07D0';
  8127. if(myPlayer.team != 0 && player.team != 0)
  8128. if(myPlayer.team == player.team)
  8129. c = '\u07D0';
  8130. else
  8131. c = '\0';
  8132. } else
  8133. if(atPlayerArray[index])
  8134. c = '\u07D0';
  8135. if(index == 0)
  8136. menuActionID[menuActionRow] = 561 + c;
  8137. if(index == 1)
  8138. menuActionID[menuActionRow] = 779 + c;
  8139. if(index == 2)
  8140. menuActionID[menuActionRow] = 27 + c;
  8141. if(index == 3)
  8142. menuActionID[menuActionRow] = 577 + c;
  8143. if(index == 4)
  8144. menuActionID[menuActionRow] = 729 + c;
  8145. menuActionCmd1[menuActionRow] = j;
  8146. menuActionCmd2[menuActionRow] = i;
  8147. menuActionCmd3[menuActionRow] = k;
  8148. menuActionRow++;
  8149. }
  8150. if(spellSelected == 1)
  8151. {
  8152. if((spellUsableOn & 8) == 8)
  8153. {
  8154. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8155. menuActionID[menuActionRow] = 365;
  8156. menuActionCmd1[menuActionRow] = j;
  8157. menuActionCmd2[menuActionRow] = i;
  8158. menuActionCmd3[menuActionRow] = k;
  8159. menuActionRow++;
  8160. }
  8161. }
  8162. }
  8163. for(int i1 = 0; i1 < menuActionRow; i1++)
  8164. if(menuActionID[i1] == 516)
  8165. {
  8166. menuActionName[i1] = "Walk here @whi@" + s;
  8167. return;
  8168. }
  8169.  
  8170. }
  8171.  
  8172. private void method89(Class30_Sub1 class30_sub1)
  8173. {
  8174. int i = 0;
  8175. int j = -1;
  8176. int k = 0;
  8177. int l = 0;
  8178. if(class30_sub1.anInt1296 == 0)
  8179. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8180. if(class30_sub1.anInt1296 == 1)
  8181. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8182. if(class30_sub1.anInt1296 == 2)
  8183. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8184. if(class30_sub1.anInt1296 == 3)
  8185. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8186. if(i != 0)
  8187. {
  8188. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8189. j = i >> 14 & 0x7fff;
  8190. k = i1 & 0x1f;
  8191. l = i1 >> 6;
  8192. }
  8193. class30_sub1.anInt1299 = j;
  8194. class30_sub1.anInt1301 = k;
  8195. class30_sub1.anInt1300 = l;
  8196. }
  8197.  
  8198. private void method90() {
  8199. for (int i = 0; i < anInt1062; i++)
  8200. if (anIntArray1250[i] <= 0) {
  8201. boolean flag1 = false;
  8202. try {
  8203. if (anIntArray1207[i] == anInt874
  8204. && anIntArray1241[i] == anInt1289) {
  8205. if (!replayWave())
  8206. flag1 = true;
  8207. } else {
  8208. Stream stream = Sounds.method241(anIntArray1241[i],
  8209. anIntArray1207[i]);
  8210. if (System.currentTimeMillis()
  8211. + (long) (stream.currentOffset / 22) > aLong1172
  8212. + (long) (anInt1257 / 22)) {
  8213. anInt1257 = stream.currentOffset;
  8214. aLong1172 = System.currentTimeMillis();
  8215. if (saveWave(stream.buffer, stream.currentOffset)) {
  8216. anInt874 = anIntArray1207[i];
  8217. anInt1289 = anIntArray1241[i];
  8218. } else {
  8219. flag1 = true;
  8220. }
  8221. }
  8222. }
  8223. } catch (Exception exception) {
  8224. }
  8225. if (!flag1 || anIntArray1250[i] == -5) {
  8226. anInt1062--;
  8227. for (int j = i; j < anInt1062; j++) {
  8228. anIntArray1207[j] = anIntArray1207[j + 1];
  8229. anIntArray1241[j] = anIntArray1241[j + 1];
  8230. anIntArray1250[j] = anIntArray1250[j + 1];
  8231. }
  8232.  
  8233. i--;
  8234. } else {
  8235. anIntArray1250[i] = -5;
  8236. }
  8237. } else {
  8238. anIntArray1250[i]--;
  8239. }
  8240.  
  8241. if (prevSong > 0) {
  8242. prevSong -= 20;
  8243. if (prevSong < 0)
  8244. prevSong = 0;
  8245. if (prevSong == 0 && musicEnabled && !lowMem) {
  8246. nextSong = currentSong;
  8247. songChanging = true;
  8248. onDemandFetcher.method558(2, nextSong);
  8249. }
  8250. }
  8251. }
  8252.  
  8253. private boolean replayWave() {
  8254. return signlink.wavereplay();
  8255. }
  8256.  
  8257. private boolean saveWave(byte abyte0[], int i) {
  8258. return abyte0 == null || signlink.wavesave(abyte0, i);
  8259. }
  8260.  
  8261. void startUp()
  8262. {
  8263. drawLoadingText(20, "Starting Client - Hold on..");
  8264. new CacheDownloader(this).downloadCache();
  8265. setNewMaps();
  8266. //maps();
  8267. //drawLoadingText(40, "Checking models");
  8268.  
  8269. if(signlink.sunjava)
  8270. super.minDelay = 5;
  8271. if(aBoolean993)
  8272. {
  8273. // rsAlreadyLoaded = true;
  8274. // return;
  8275. }
  8276. aBoolean993 = true;
  8277. boolean flag = true;
  8278. String s = getDocumentBaseHost();
  8279. if(signlink.cache_dat != null)
  8280. {
  8281. for(int i = 0; i < 5; i++)
  8282. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  8283. }
  8284. try {
  8285.  
  8286. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  8287. smallFont = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8288. normalFont = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8289. boldFont = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8290. fancyFont = new TextDrawingArea(true, "q8_full", titleStreamLoader);//new CLIENT*/
  8291.  
  8292.  
  8293. bigHit = new TextDrawingArea(true, "critical_full", titleStreamLoader);
  8294. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  8295. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  8296. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  8297. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  8298. newSmallFont.unpackChatImages(chatImages);
  8299. newRegularFont.unpackChatImages(chatImages);
  8300. newBoldFont.unpackChatImages(chatImages);
  8301. newFancyFont.unpackChatImages(chatImages);
  8302. drawLogo();
  8303. loadTitleScreen();
  8304. StreamLoader configArchive = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8305. StreamLoader interfaceArchive = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8306. StreamLoader mediaArchive = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8307. StreamLoader textureArchive = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8308. StreamLoader chatFilterArchive = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8309. StreamLoader soundArchive = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8310. for (int l4 = 0; l4 < 2; l4++) {
  8311. chatImages[l4] = new Sprite(mediaArchive, "mod_icons", l4);
  8312. }
  8313. byteGroundArray = new byte[4][104][104];
  8314. intGroundArray = new int[4][105][105];
  8315. worldController = new WorldController(intGroundArray);
  8316. for(int j = 0; j < 4; j++)
  8317. aClass11Array1230[j] = new Class11();
  8318. miniMapImage = new Sprite(512, 512);
  8319. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  8320. drawLoadingText(60, "");
  8321.  
  8322. // maps();
  8323. // repackCacheIndex(4);
  8324. onDemandFetcher = new OnDemandFetcher();
  8325. onDemandFetcher.start(streamLoader_6, this);
  8326. Class36.method528(onDemandFetcher.getAnimCount());
  8327. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8328. preloadModels();
  8329. if(!lowMem) {
  8330. //nextSong = 0;
  8331. //try {
  8332. // nextSong = Integer.parseInt(getParameter("music"));
  8333. // stopMidi();
  8334. //}
  8335.  
  8336. //catch(Exception _ex) { }
  8337. //songChanging = true;
  8338. //onDemandFetcher.method558(2, nextSong);
  8339. //stopMidi();
  8340. while(onDemandFetcher.getNodeCount() > 0) {
  8341. processOnDemandQueue();
  8342. try {
  8343. Thread.sleep(100L);
  8344. } catch(Exception _ex) {
  8345.  
  8346. }
  8347. if(onDemandFetcher.anInt1349 > 3) {
  8348. loadError();
  8349. return;
  8350. }
  8351. }
  8352. }
  8353. drawLoadingText(65, "");
  8354. DataBase.loadAnimations();
  8355. drawLoadingText(70, "");
  8356. //models();
  8357. //DataBase.loadObjects(); //Just checking somthing
  8358. //DataBase.loadModels();
  8359. drawLoadingText(80, "");
  8360. /* Custom sprite unpacking */
  8361. loginBox = new Sprite("title");
  8362. loginBoxHover = new Sprite("box_hover");
  8363. loginHover = new Sprite("login_hover");
  8364. CrownName = new Sprite("CrownName");
  8365. loginHoverWorld = new Sprite("login_hover2");
  8366. infinityIcon = new Sprite("infinity");
  8367. for(int ig = 0; ig < chatArea.length; ig++)
  8368. chatArea[ig] = new Sprite("chatarea " + ig);
  8369. for(int iiig = 0; iiig < tabArea.length; iiig++)
  8370. tabArea[iiig] = new Sprite("tabarea " + iiig);
  8371.  
  8372. HPBarFull = new Sprite("HITPOINTS_0");
  8373. HPBarEmpty = new Sprite("HITPOINTS_1");
  8374.  
  8375. mapArea = new Sprite("maparea");
  8376. backgroundFix = new Sprite("background");
  8377. magicAuto = new Sprite("autocast");
  8378. loadOrbs();
  8379. multiOverlay = new Sprite(mediaArchive, "overlay_multiway", 0);
  8380. /**/
  8381. for(int i = 0; i < mapBack.length; i++)
  8382. mapBack[i] = new Background(mediaArchive, "mapback", i);
  8383.  
  8384. for(int j5 = 0; j5 < tabAreaSprite.length; j5++)
  8385. tabAreaSprite[j5] = new Sprite("tabarea " + j5);
  8386.  
  8387. for(int c1 = 0; c1 <= 3; c1++)
  8388. chatButtons[c1] = new Sprite(mediaArchive, "chatbuttons", c1);
  8389.  
  8390. for(int loop = 0; loop < inventoryStones.length; loop++)
  8391. inventoryStones[loop] = new Sprite("sideicon/inventorystones " + loop);
  8392.  
  8393. for(int j3 = 0; j3 < sideIcons.length; j3++)
  8394. sideIcons[j3] = new Sprite("sideicon/sideicons " + j3);
  8395. compass = new Sprite(mediaArchive, "compass", 0);
  8396.  
  8397. for(int j78 = 0; j78 < exitButton.length; j78++)
  8398. exitButton[j78] = new Sprite("exit " + j78);
  8399.  
  8400. for(int j79 = 0; j79 < advisorButton.length; j79++)
  8401. advisorButton[j79] = new Sprite("advisor " + j79);
  8402.  
  8403. for(int ghtr = 0; ghtr < worldMapIcon.length; ghtr++)
  8404. worldMapIcon[ghtr] = new Sprite("mapIcon " + ghtr);
  8405.  
  8406. for(int i4 = 0; i4 < hitMarkBacks.length; i4++)
  8407. for(int i5 = 0; i5 < hitMarkBacks[0].length; i5++)
  8408. for(int i6 = 0; i6 < hitMarkBacks[0][0].length; i6++)
  8409. hitMarkBacks[i4][i5][i6] = new Sprite("/hits/back/" + i4 + "/"+ i5 +"/hit " + i6);
  8410.  
  8411. for(int i4 = 0; i4 < hitMarkIcons.length; i4++)
  8412. hitMarkIcons[i4] = new Sprite("/Hits/icons/icon " + i4);
  8413.  
  8414. emptyOrb = new Sprite("emptyorb");
  8415. emptyFOrb = new Sprite("emptyforb");
  8416. hoveredEmpty = new Sprite("hoveredempty");
  8417. hoveredFEmpty = new Sprite("hoveredfempty");
  8418. runIcon1 = new Sprite("runicon1");
  8419. runIcon2 = new Sprite("runicon2");
  8420. runOrb1 = new Sprite("runorb1");
  8421. runOrb2 = new Sprite("runorb2");
  8422. hitPointsFill = new Sprite("hitpointsfill");
  8423. hitPointsIcon = new Sprite("hitpointsicon");
  8424. prayerFill = new Sprite("prayerfill");
  8425. prayerIcon = new Sprite("prayericon");
  8426. mapEdge = new Sprite(mediaArchive, "mapedge", 0);
  8427. mapEdge.method345();
  8428. try
  8429. {
  8430. for(int i = 0; i < XPcounterSprite.length; i++)
  8431. XPcounterSprite[i] = new Sprite("xp/XP " + i);
  8432. }
  8433. catch(Exception _ex) {}
  8434. try
  8435. {
  8436. for(int k3 = 0; k3 < 100; k3++)
  8437. mapScenes[k3] = new Background(mediaArchive, "mapscene", k3);
  8438. }
  8439. catch(Exception _ex) { }
  8440. try
  8441. {
  8442. for(int l3 = 0; l3 < 100; l3++)
  8443. mapFunctions[l3] = new Sprite(mediaArchive, "mapfunction", l3);
  8444. }
  8445. catch(Exception _ex) { }
  8446. try
  8447. {
  8448. for(int h1 = 0; h1 < 6; h1++)
  8449. headIconsHint[h1] = new Sprite(mediaArchive, "headicons_hint", h1);
  8450. } catch(Exception _ex) { }
  8451. try {
  8452. for(int j4 = 0; j4 < 18; j4++)
  8453. //headIcons[j4] = new Sprite(mediaArchive, "headicons_prayer", j4);
  8454. headIcons[j4] = new Sprite("curses/Prayer "+j4);
  8455. for(int j45 = 0; j45 < 3; j45++)
  8456. skullIcons[j45] = new Sprite(mediaArchive, "headicons_pk", j45 );
  8457. for(int j45 = 9; j45 < 17; j45++)
  8458. cursesIcons[j45] = new Sprite("curses/Prayer "+j45);
  8459.  
  8460. }
  8461. catch(Exception _ex) { }
  8462. mapFlag = new Sprite(mediaArchive, "mapmarker", 0);
  8463. mapMarker = new Sprite(mediaArchive, "mapmarker", 1);
  8464. for(int k4 = 0; k4 < 8; k4++)
  8465. crosses[k4] = new Sprite(mediaArchive, "cross", k4);
  8466.  
  8467. mapDotItem = new Sprite(mediaArchive, "mapdots", 0);
  8468. mapDotNPC = new Sprite(mediaArchive, "mapdots", 1);
  8469. mapDotPlayer = new Sprite(mediaArchive, "mapdots", 2);
  8470. mapDotFriend = new Sprite(mediaArchive, "mapdots", 3);
  8471. mapDotTeam = new Sprite(mediaArchive, "mapdots", 4);
  8472. mapDotClan = new Sprite(mediaArchive, "mapdots", 5);
  8473. alertBack = new Sprite("alertback");
  8474. alertBorder = new Sprite("alertborder");
  8475. alertBorderH = new Sprite("alertborderh");
  8476.  
  8477. for(int loop = 0; loop < scrollBar.length; loop++)
  8478. scrollBar[loop] = new Sprite("./scrollbar/scrollbar " + loop);
  8479.  
  8480. for(int loop = 0; loop < scrollArrow.length; loop++)
  8481. scrollArrow[loop] = new Sprite("./scrollbar/scrollArrow " + loop);
  8482.  
  8483. rightFrameSprite = new Sprite(mediaArchive, "screenframe", 2);
  8484.  
  8485. for(int l4 = 0; l4 < modIcons.length; l4++)
  8486. modIcons[l4] = new Background(mediaArchive, "mod_icons", l4);
  8487.  
  8488. Sprite sprite = new Sprite(mediaArchive, "screenframe", 0);
  8489. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8490. sprite.method346(0, 0);
  8491. sprite = new Sprite(mediaArchive, "screenframe", 1);
  8492. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8493. sprite.method346(0, 0);
  8494. sprite = new Sprite(mediaArchive, "mapedge", 0);
  8495. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8496. sprite.method346(0, 0);
  8497.  
  8498. int i5 = (int)(Math.random() * 21D) - 10;
  8499. int j5 = (int)(Math.random() * 21D) - 10;
  8500. int k5 = (int)(Math.random() * 21D) - 10;
  8501. int l5 = (int)(Math.random() * 41D) - 20;
  8502. for(int functionIndex = 0; functionIndex < 100; functionIndex++) {
  8503. if(mapFunctions[functionIndex] != null)
  8504. mapFunctions[functionIndex].method344(i5 + l5, j5 + l5, k5 + l5);
  8505. if(mapScenes[functionIndex] != null)
  8506. mapScenes[functionIndex].method360(i5 + l5, j5 + l5, k5 + l5);
  8507. }
  8508. drawLoadingText(82, "");
  8509. drawLoadingText(86, "");
  8510. Texture.method368(textureArchive);
  8511. Texture.method372(0.80000000000000004D);
  8512. Texture.method367();
  8513. drawLoadingText(88, "");
  8514. Animation.unpackConfig(configArchive);
  8515. ObjectDef.unpackConfig(configArchive);
  8516. Flo.unpackConfig(configArchive);
  8517. ItemDef.unpackConfig(configArchive);
  8518. EntityDef.unpackConfig(configArchive);
  8519. IDK.unpackConfig(configArchive);
  8520. SpotAnim.unpackConfig(configArchive);
  8521. Varp.unpackConfig(configArchive);
  8522. VarBit.unpackConfig(configArchive);
  8523. ItemDef.isMembers = isMembers;
  8524. if(!lowMem)
  8525. {
  8526. drawLoadingText(90, "");
  8527. byte abyte0[] = soundArchive.getDataForName("sounds.dat");
  8528.  
  8529. Stream stream = new Stream(abyte0);
  8530. Sounds.unpack(stream);
  8531.  
  8532. }
  8533. drawLoadingText(93, "");
  8534. TextDrawingArea allFonts[] = {
  8535. smallFont, normalFont, boldFont, fancyFont
  8536. };
  8537. /*RSFont allFonts[] = { NEW INTERFACES TEXT ENGINE
  8538. newSmallFont, newRegularFont, newBoldFont, newFancyFont
  8539. };*/
  8540. RSInterface.fonts = allFonts;
  8541. RSInterface.unpack(interfaceArchive, allFonts, mediaArchive);
  8542. drawLoadingText(97, "");
  8543. RSInterface.unpackCustom(interfaceArchive, allFonts);
  8544. /*
  8545. //Taken this out, causing seirous lag -.-
  8546. for(int derp = 0; derp < 25000; derp++)
  8547. {
  8548. ItemDef itemdef = ItemDef.forID(derp);
  8549. writeTemp(itemdef.name);
  8550. }*/
  8551. drawLoadingText(100, "");
  8552. readDetails();
  8553. renderMapAndCompassHalfs();
  8554. load3DArea();
  8555. Censor.loadConfig(chatFilterArchive);
  8556. mouseDetection = new MouseDetection(this);
  8557. startRunnable(mouseDetection, 10);
  8558. Animable_Sub5.clientInstance = this;
  8559. ObjectDef.clientInstance = this;
  8560. EntityDef.clientInstance = this;
  8561. System.gc();
  8562. return;
  8563. } catch(Exception exception) {
  8564. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8565. exception.printStackTrace();
  8566. }
  8567. loadingError = true;
  8568. }
  8569.  
  8570. public void renderMapAndCompassHalfs() {
  8571. for(int loopHeight = 0; loopHeight < 33; loopHeight++) {
  8572. int k6 = 999;
  8573. int loopWidth = 0;
  8574. for(; loopWidth < 33; loopWidth++) {
  8575. if(mapBack[2].aByteArray1450[loopWidth + loopHeight * 33] == 0) {
  8576. if(k6 == 999)
  8577. k6 = loopWidth;
  8578. continue;
  8579. }
  8580. if(k6 == 999)
  8581. continue;
  8582. break;
  8583. }
  8584. compassPixelCutLeft[loopHeight] = k6;//left ( it's heigth)
  8585. compassPixelCutRight[loopHeight] = loopWidth - k6;//right (it's width)
  8586. }
  8587. for(int loopHeight = 0; loopHeight < 152; loopHeight++) {
  8588. int j7 = 999;
  8589. int finalWidth = 0;
  8590. for(int loopWidth = 0; loopWidth < 152; loopWidth++) {
  8591. if(mapBack[1].aByteArray1450[loopWidth + loopHeight * 152] == 0) {
  8592. if(j7 == 999)
  8593. j7 = loopWidth;
  8594. continue;
  8595. }
  8596. if(j7 == 999)
  8597. continue;
  8598. finalWidth = loopWidth;//999 - 999 = 0
  8599. break;
  8600. }
  8601.  
  8602. mapImagePixelCutLeft[loopHeight - 0] = j7 - 0;
  8603. if((finalWidth - j7) == 0) {
  8604. finalWidth = 152;
  8605. j7 = 0;
  8606. }
  8607. mapImagePixelCutRight[loopHeight - 0] = finalWidth - j7;
  8608. }
  8609. }
  8610.  
  8611. public static void writeTemp(String tempData) {
  8612. try {
  8613. BufferedWriter bw = new BufferedWriter(new FileWriter("./derp.txt", true));
  8614. bw.write(tempData);
  8615. bw.newLine();
  8616. bw.flush();
  8617. } catch(IOException IOE) {}
  8618. }
  8619.  
  8620. private void method91(Stream stream, int i)
  8621. {
  8622. while(stream.bitPosition + 10 < i * 8)
  8623. {
  8624. int j = stream.readBits(11);
  8625. if(j == 2047)
  8626. break;
  8627. if(playerArray[j] == null)
  8628. {
  8629. playerArray[j] = new Player();
  8630. if(aStreamArray895s[j] != null)
  8631. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8632. }
  8633. playerIndices[playerCount++] = j;
  8634. Player player = playerArray[j];
  8635. player.anInt1537 = loopCycle;
  8636. int k = stream.readBits(1);
  8637. if(k == 1)
  8638. anIntArray894[anInt893++] = j;
  8639. int l = stream.readBits(1);
  8640. int i1 = stream.readBits(5);
  8641. if(i1 > 15)
  8642. i1 -= 32;
  8643. int j1 = stream.readBits(5);
  8644. if(j1 > 15)
  8645. j1 -= 32;
  8646. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  8647. }
  8648. stream.finishBitAccess();
  8649. }
  8650.  
  8651. private int mapDrawAreaX = 0;
  8652. private int mapDrawAreaY = 516;
  8653. private int mapPaddingFromTop = toggleFullscreen ? 5 : 9;
  8654. private int mapPaddingFromLeft = toggleFullscreen ? 5 : 35;
  8655. private int mapPaddingFromBottom = toggleFullscreen ? 5 : 7;
  8656. private int mapPaddingFromRight = toggleFullscreen ? 5 : 62;
  8657. private int miniMapWidth = toggleFullscreen ? 163 : 249;//172
  8658. private int miniMapHeight = toggleFullscreen ? 163 : 168;//156
  8659. private int mapSpritesX = 107;
  8660. private int mapSpritesY = 88;
  8661. private int mapMovedX = 29;
  8662. private int mapMovedY = 4;
  8663.  
  8664. int mapInnerSizeWidth = miniMapWidth - (mapPaddingFromLeft + mapPaddingFromRight);
  8665. int mapInnerSizeHeight = miniMapHeight - (mapPaddingFromTop + mapPaddingFromBottom);
  8666.  
  8667. private void processMinimapClick(int paddingX,int paddingY) {
  8668. if(minimapCover != 0)
  8669. return;
  8670. if(super.clickMode3 == 1)
  8671. {
  8672. int mapClickX = super.saveClickX - mapPaddingFromLeft - mapDrawAreaY - paddingX;
  8673. int mapClickY = super.saveClickY - mapPaddingFromTop - mapDrawAreaX - paddingY;
  8674. if(mapClickX >= 0 && mapClickY >= 0 && mapClickX < mapInnerSizeWidth && mapClickY < mapInnerSizeHeight)
  8675. {
  8676. mapClickX -= 73;
  8677. mapClickY -= 75;
  8678. int k = compassRotation + mapAmtDiffRotation & 0x7ff;
  8679. int i1 = Texture.anIntArray1470[k];
  8680. int j1 = Texture.anIntArray1471[k];
  8681. i1 = i1 * (mapAmtDiffZoom + 256) >> 8;
  8682. j1 = j1 * (mapAmtDiffZoom + 256) >> 8;
  8683. int k1 = mapClickY * i1 + mapClickX * j1 >> 11;
  8684. int l1 = mapClickY * j1 - mapClickX * i1 >> 11;
  8685. int i2 = myPlayer.x + k1 >> 7;
  8686. int j2 = myPlayer.y - l1 >> 7;
  8687. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8688. if(flag1)
  8689. {
  8690. stream.writeWordBigEndian(mapClickX);
  8691. stream.writeWordBigEndian(mapClickY);
  8692. stream.writeWord(compassRotation);
  8693. stream.writeWordBigEndian(57);
  8694. stream.writeWordBigEndian(mapAmtDiffRotation);
  8695. stream.writeWordBigEndian(mapAmtDiffZoom);
  8696. stream.writeWordBigEndian(89);
  8697. stream.writeWord(myPlayer.x);
  8698. stream.writeWord(myPlayer.y);
  8699. stream.writeWordBigEndian(anInt1264);
  8700. stream.writeWordBigEndian(63);
  8701. }
  8702. }
  8703. anInt1117++;
  8704. if(anInt1117 > 1151)
  8705. {
  8706. anInt1117 = 0;
  8707. stream.createFrame(246);
  8708. stream.writeWordBigEndian(0);
  8709. int l = stream.currentOffset;
  8710. if((int)(Math.random() * 2D) == 0)
  8711. stream.writeWordBigEndian(101);
  8712. stream.writeWordBigEndian(197);
  8713. stream.writeWord((int)(Math.random() * 65536D));
  8714. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8715. stream.writeWordBigEndian(67);
  8716. stream.writeWord(14214);
  8717. if((int)(Math.random() * 2D) == 0)
  8718. stream.writeWord(29487);
  8719. stream.writeWord((int)(Math.random() * 65536D));
  8720. if((int)(Math.random() * 2D) == 0)
  8721. stream.writeWordBigEndian(220);
  8722. stream.writeWordBigEndian(180);
  8723. stream.writeBytes(stream.currentOffset - l);
  8724. }
  8725. }
  8726. }
  8727.  
  8728. private String interfaceIntToString(int j) {
  8729. if(j < 0x3b9ac9ff)
  8730. return String.valueOf(j);
  8731. else
  8732. return "*";
  8733. }
  8734.  
  8735. private void showErrorScreen()
  8736. {
  8737. Graphics g = getGameComponent().getGraphics();
  8738. g.setColor(Color.black);
  8739. g.fillRect(0, 0, 765, 503);
  8740. method4(1);
  8741. if(loadingError)
  8742. {
  8743. aBoolean831 = false;
  8744. g.setFont(new Font("Helvetica", 1, 16));
  8745. g.setColor(Color.yellow);
  8746. int k = 35;
  8747. g.drawString("Sorry, an error has occured whilst loading RuinedScape", 30, k);
  8748. k += 50;
  8749. g.setColor(Color.white);
  8750. g.drawString("To fix this try the following (in order):", 30, k);
  8751. k += 50;
  8752. g.setColor(Color.white);
  8753. g.setFont(new Font("Helvetica", 1, 12));
  8754. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  8755. k += 30;
  8756. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  8757. k += 30;
  8758. g.drawString("3: Try using a different game-world", 30, k);
  8759. k += 30;
  8760. g.drawString("4: Try rebooting your computer", 30, k);
  8761. k += 30;
  8762. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  8763. }
  8764. if(genericLoadingError)
  8765. {
  8766. aBoolean831 = false;
  8767. g.setFont(new Font("Helvetica", 1, 20));
  8768. g.setColor(Color.white);
  8769. g.drawString("Error - unable to load game!", 50, 50);
  8770. g.drawString("To play RuinedScape make sure you play from", 50, 100);
  8771. g.drawString("http://www.Ruinedscape.createaforum.com", 50, 150);
  8772. }
  8773. if(rsAlreadyLoaded)
  8774. {
  8775. aBoolean831 = false;
  8776. g.setColor(Color.yellow);
  8777. int l = 35;
  8778. g.drawString("Error a copy of RuinedScape already appears to be loaded", 30, l);
  8779. l += 50;
  8780. g.setColor(Color.white);
  8781. g.drawString("To fix this try the following (in order):", 30, l);
  8782. l += 50;
  8783. g.setColor(Color.white);
  8784. g.setFont(new Font("Helvetica", 1, 12));
  8785. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  8786. l += 30;
  8787. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8788. l += 30;
  8789. }
  8790. }
  8791.  
  8792. public URL getCodeBase() {
  8793. try {
  8794. return new URL(serverip +":" + (80 + portOff));
  8795. } catch(Exception _ex) {
  8796. }
  8797. return null;
  8798. }
  8799.  
  8800. private void method95() {
  8801. for(int j = 0; j < npcCount; j++) {
  8802. int k = npcIndices[j];
  8803. NPC npc = npcArray[k];
  8804. if(npc != null)
  8805. method96(npc);
  8806. }
  8807. }
  8808.  
  8809. private void method96(Entity entity)
  8810. {
  8811. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  8812. {
  8813. entity.anim = -1;
  8814. entity.anInt1520 = -1;
  8815. entity.anInt1547 = 0;
  8816. entity.anInt1548 = 0;
  8817. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8818. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8819. entity.method446();
  8820. }
  8821. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  8822. {
  8823. entity.anim = -1;
  8824. entity.anInt1520 = -1;
  8825. entity.anInt1547 = 0;
  8826. entity.anInt1548 = 0;
  8827. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8828. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8829. entity.method446();
  8830. }
  8831. if(entity.anInt1547 > loopCycle)
  8832. method97(entity);
  8833. else
  8834. if(entity.anInt1548 >= loopCycle)
  8835. method98(entity);
  8836. else
  8837. method99(entity);
  8838. method100(entity);
  8839. method101(entity);
  8840. }
  8841.  
  8842. private void method97(Entity entity)
  8843. {
  8844. int i = entity.anInt1547 - loopCycle;
  8845. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8846. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8847. entity.x += (j - entity.x) / i;
  8848. entity.y += (k - entity.y) / i;
  8849. entity.anInt1503 = 0;
  8850. if(entity.anInt1549 == 0)
  8851. entity.turnDirection = 1024;
  8852. if(entity.anInt1549 == 1)
  8853. entity.turnDirection = 1536;
  8854. if(entity.anInt1549 == 2)
  8855. entity.turnDirection = 0;
  8856. if(entity.anInt1549 == 3)
  8857. entity.turnDirection = 512;
  8858. }
  8859.  
  8860. private void method98(Entity entity)
  8861. {
  8862. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  8863. {
  8864. int i = entity.anInt1548 - entity.anInt1547;
  8865. int j = loopCycle - entity.anInt1547;
  8866. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8867. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8868. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8869. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8870. entity.x = (k * (i - j) + i1 * j) / i;
  8871. entity.y = (l * (i - j) + j1 * j) / i;
  8872. }
  8873. entity.anInt1503 = 0;
  8874. if(entity.anInt1549 == 0)
  8875. entity.turnDirection = 1024;
  8876. if(entity.anInt1549 == 1)
  8877. entity.turnDirection = 1536;
  8878. if(entity.anInt1549 == 2)
  8879. entity.turnDirection = 0;
  8880. if(entity.anInt1549 == 3)
  8881. entity.turnDirection = 512;
  8882. entity.anInt1552 = entity.turnDirection;
  8883. }
  8884.  
  8885. private void method99(Entity entity)
  8886. {
  8887. entity.anInt1517 = entity.anInt1511;
  8888. if(entity.smallXYIndex == 0)
  8889. {
  8890. entity.anInt1503 = 0;
  8891. return;
  8892. }
  8893. if(entity.anim != -1 && entity.anInt1529 == 0)
  8894. {
  8895. Animation animation = Animation.anims[entity.anim];
  8896. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  8897. {
  8898. entity.anInt1503++;
  8899. return;
  8900. }
  8901. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  8902. {
  8903. entity.anInt1503++;
  8904. return;
  8905. }
  8906. }
  8907. int i = entity.x;
  8908. int j = entity.y;
  8909. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8910. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8911. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  8912. {
  8913. entity.x = k;
  8914. entity.y = l;
  8915. return;
  8916. }
  8917. if(i < k)
  8918. {
  8919. if(j < l)
  8920. entity.turnDirection = 1280;
  8921. else
  8922. if(j > l)
  8923. entity.turnDirection = 1792;
  8924. else
  8925. entity.turnDirection = 1536;
  8926. } else
  8927. if(i > k)
  8928. {
  8929. if(j < l)
  8930. entity.turnDirection = 768;
  8931. else
  8932. if(j > l)
  8933. entity.turnDirection = 256;
  8934. else
  8935. entity.turnDirection = 512;
  8936. } else
  8937. if(j < l)
  8938. entity.turnDirection = 1024;
  8939. else
  8940. entity.turnDirection = 0;
  8941. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8942. if(i1 > 1024)
  8943. i1 -= 2048;
  8944. int j1 = entity.anInt1555;
  8945. if(i1 >= -256 && i1 <= 256)
  8946. j1 = entity.anInt1554;
  8947. else
  8948. if(i1 >= 256 && i1 < 768)
  8949. j1 = entity.anInt1557;
  8950. else
  8951. if(i1 >= -768 && i1 <= -256)
  8952. j1 = entity.anInt1556;
  8953. if(j1 == -1)
  8954. j1 = entity.anInt1554;
  8955. entity.anInt1517 = j1;
  8956. int k1 = 4;
  8957. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8958. k1 = 2;
  8959. if(entity.smallXYIndex > 2)
  8960. k1 = 6;
  8961. if(entity.smallXYIndex > 3)
  8962. k1 = 8;
  8963. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  8964. {
  8965. k1 = 8;
  8966. entity.anInt1503--;
  8967. }
  8968. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8969. k1 <<= 1;
  8970. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8971. entity.anInt1517 = entity.anInt1505;
  8972. if(i < k)
  8973. {
  8974. entity.x += k1;
  8975. if(entity.x > k)
  8976. entity.x = k;
  8977. } else
  8978. if(i > k)
  8979. {
  8980. entity.x -= k1;
  8981. if(entity.x < k)
  8982. entity.x = k;
  8983. }
  8984. if(j < l)
  8985. {
  8986. entity.y += k1;
  8987. if(entity.y > l)
  8988. entity.y = l;
  8989. } else
  8990. if(j > l)
  8991. {
  8992. entity.y -= k1;
  8993. if(entity.y < l)
  8994. entity.y = l;
  8995. }
  8996. if(entity.x == k && entity.y == l)
  8997. {
  8998. entity.smallXYIndex--;
  8999. if(entity.anInt1542 > 0)
  9000. entity.anInt1542--;
  9001. }
  9002. }
  9003.  
  9004. private void method100(Entity entity)
  9005. {
  9006. if(entity.anInt1504 == 0)
  9007. return;
  9008. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  9009. {
  9010. NPC npc = npcArray[(entity.interactingEntity > npcArray.length) ? (npcArray.length-1) : entity.interactingEntity];
  9011. if(npc != null)
  9012. {
  9013. int i1 = entity.x - npc.x;
  9014. int k1 = entity.y - npc.y;
  9015. if(i1 != 0 || k1 != 0)
  9016. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9017. }
  9018. }
  9019. if(entity.interactingEntity >= 32768)
  9020. {
  9021. int j = entity.interactingEntity - 32768;
  9022. if(j == unknownInt10)
  9023. j = myPlayerIndex;
  9024. Player player = playerArray[j];
  9025. if(player != null)
  9026. {
  9027. int l1 = entity.x - player.x;
  9028. int i2 = entity.y - player.y;
  9029. if(l1 != 0 || i2 != 0)
  9030. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9031. }
  9032. }
  9033. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  9034. {
  9035. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9036. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9037. if(k != 0 || j1 != 0)
  9038. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9039. entity.anInt1538 = 0;
  9040. entity.anInt1539 = 0;
  9041. }
  9042. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9043. if(l != 0)
  9044. {
  9045. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9046. entity.anInt1552 = entity.turnDirection;
  9047. else
  9048. if(l > 1024)
  9049. entity.anInt1552 -= entity.anInt1504;
  9050. else
  9051. entity.anInt1552 += entity.anInt1504;
  9052. entity.anInt1552 &= 0x7ff;
  9053. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  9054. {
  9055. if(entity.anInt1512 != -1)
  9056. {
  9057. entity.anInt1517 = entity.anInt1512;
  9058. return;
  9059. }
  9060. entity.anInt1517 = entity.anInt1554;
  9061. }
  9062. }
  9063. }
  9064.  
  9065. private void method101(Entity entity)
  9066. {
  9067. try {
  9068. entity.aBoolean1541 = false;
  9069. if(entity.anInt1517 != -1)
  9070. {
  9071. Animation animation = Animation.anims[entity.anInt1517];
  9072. entity.anInt1519++;
  9073. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  9074. {
  9075. entity.anInt1519 = 0;
  9076. entity.anInt1518++;
  9077. }
  9078. if(entity.anInt1518 >= animation.anInt352)
  9079. {
  9080. entity.anInt1519 = 0;
  9081. entity.anInt1518 = 0;
  9082. }
  9083. }
  9084. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  9085. {
  9086. if(entity.anInt1521 < 0)
  9087. entity.anInt1521 = 0;
  9088. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9089. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  9090. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9091.  
  9092. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9093. entity.anInt1520 = -1;
  9094. }
  9095. if(entity.anim != -1 && entity.anInt1529 <= 1)
  9096. {
  9097. Animation animation_2 = Animation.anims[entity.anim];
  9098. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  9099. {
  9100. entity.anInt1529 = 1;
  9101. return;
  9102. }
  9103. }
  9104. if(entity.anim != -1 && entity.anInt1529 == 0)
  9105. {
  9106. Animation animation_3 = Animation.anims[entity.anim];
  9107. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  9108. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9109.  
  9110. if(entity.anInt1527 >= animation_3.anInt352)
  9111. {
  9112. entity.anInt1527 -= animation_3.anInt356;
  9113. entity.anInt1530++;
  9114. if(entity.anInt1530 >= animation_3.anInt362)
  9115. entity.anim = -1;
  9116. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  9117. entity.anim = -1;
  9118. }
  9119. entity.aBoolean1541 = animation_3.aBoolean358;
  9120. }
  9121. if(entity.anInt1529 > 0)
  9122. entity.anInt1529--;
  9123. } catch(NullPointerException ex) {
  9124.  
  9125. }
  9126. }
  9127.  
  9128. private void drawGameScreen()
  9129. {
  9130. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  9131. if (loadingStage == 2) {
  9132. method119(anInt945, fullscreenInterfaceID);
  9133. if (openInterfaceID != -1) {
  9134. method119(anInt945, openInterfaceID);
  9135. }
  9136. anInt945 = 0;
  9137. resetAllImageProducers();
  9138. super.fullGameScreen.initDrawingArea();
  9139. Texture.anIntArray1472 = fullScreenTextureArray;
  9140. DrawingArea.setAllPixelsToZero();
  9141. welcomeScreenRaised = true;
  9142. if (openInterfaceID != -1) {
  9143. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  9144. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  9145. rsInterface_1.width = 765;
  9146. rsInterface_1.height = 503;
  9147. }
  9148. drawInterface(0, 0, rsInterface_1, 8);//used for fullscreen
  9149. }
  9150. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9151. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  9152. rsInterface.width = 765;
  9153. rsInterface.height = 503;
  9154. }
  9155. drawInterface(0, 0, rsInterface, 8);
  9156.  
  9157. if (!contextMenuOpen) {
  9158. processRightClick();
  9159. drawTooltip();
  9160. } else {
  9161. drawMenu(4,4);
  9162. }
  9163. }
  9164. drawCount++;
  9165. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9166. return;
  9167. } else {
  9168. if (drawCount != 0) {
  9169. resetImageProducers2();
  9170. }
  9171. }
  9172. if(welcomeScreenRaised) {
  9173. welcomeScreenRaised = false;
  9174. if(!toggleFullscreen) {
  9175. topFrame.drawGraphics(0, super.graphics, 0);
  9176. leftFrame.drawGraphics(4, super.graphics, 0);
  9177. }
  9178. //mapAreaIP.drawGraphics(0, super.graphics, 519);
  9179. //mapEdgeIP.drawGraphics(0, super.graphics, 519);
  9180. needDrawTabArea = true;
  9181. inputTaken = true;
  9182. tabAreaAltered = true;
  9183. aBoolean1233 = true;
  9184. if(loadingStage != 2) {
  9185. main3DArea.drawGraphics(toggleFullscreen ? 0 : 4, super.graphics, toggleFullscreen ? 0 : 4);
  9186. mapBackImage.drawGraphics(mapDrawAreaX, super.graphics, mapDrawAreaY);
  9187. }
  9188. }
  9189. if(contextMenuOpen)
  9190. drawMenu(4,4);
  9191. if(contextMenuOpen && menuScreenArea == 1)
  9192. needDrawTabArea = true;
  9193. if(invOverlayInterfaceID != -1)
  9194. {
  9195. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9196. if(flag1)
  9197. needDrawTabArea = true;
  9198. }
  9199. if(atInventoryInterfaceType == 2)
  9200. needDrawTabArea = true;
  9201. if(activeInterfaceType == 2)
  9202. needDrawTabArea = true;
  9203. if(!toggleFullscreen) {
  9204. drawRightFrameArea();
  9205. drawTabArea(sideTabArea,0,0);
  9206. sideTabArea.drawGraphics(yPaddingtabBack, super.graphics, xPaddingtabBack);//519
  9207. main3DArea.initDrawingArea();
  9208. }
  9209. if(backDialogID == -1)
  9210. {
  9211. aClass9_1059.scrollPosition = chatScrollTotalLength - anInt1089 - 110;
  9212. if(super.mouseX > 497 && super.mouseX < 512 && super.mouseY > 342 + getChatBackIncreaseY())
  9213. method65(494, 110, super.mouseX - 0, super.mouseY - 348 - getChatBackIncreaseY(), aClass9_1059, 0, false, chatScrollTotalLength);
  9214. int i = chatScrollTotalLength - 110 - aClass9_1059.scrollPosition;
  9215. if(i < 0)
  9216. i = 0;
  9217. if(i > chatScrollTotalLength - 110)
  9218. i = chatScrollTotalLength - 110;
  9219. if(anInt1089 != i) {
  9220. anInt1089 = i;
  9221. inputTaken = true;
  9222. }
  9223. }
  9224. if(backDialogID != -1) {
  9225. boolean flag2 = method119(anInt945, backDialogID);
  9226. if(flag2)
  9227. inputTaken = true;
  9228. }
  9229. if(atInventoryInterfaceType == 3)
  9230. inputTaken = true;
  9231. if(activeInterfaceType == 3)
  9232. inputTaken = true;
  9233. if(aString844 != null)
  9234. inputTaken = true;
  9235. if(contextMenuOpen && menuScreenArea == 2)
  9236. inputTaken = true;
  9237. if(inputTaken) {
  9238. if(!toggleFullscreen) {
  9239. drawChatArea(toggleFullscreen ? main3DArea : chatBackImage,0,0);
  9240. chatBackImage.drawGraphics(yPaddingchatBackImage, super.graphics, xPaddingchatBackImage);
  9241. main3DArea.initDrawingArea();
  9242. }
  9243. inputTaken = false;
  9244. }
  9245. if(loadingStage == 2)
  9246. method146();
  9247. if(loadingStage == 2) {
  9248. if(!toggleFullscreen) {
  9249. drawMinimap(mapBackImage,0,0);
  9250. mapBackImage.drawGraphics(yPaddingmapBackImage + getMapIncreaseY(), super.graphics, xPaddingmapBackImage + getMapIncreaseX());//545
  9251. }
  9252. }
  9253. if(tabIconFlash != -1)
  9254. tabAreaAltered = true;
  9255. if(tabAreaAltered)
  9256. {
  9257. if(tabIconFlash != -1 && tabIconFlash == tabID)
  9258. {
  9259. tabIconFlash = -1;
  9260. stream.createFrame(120);
  9261. stream.writeWordBigEndian(tabID);
  9262. }
  9263. tabAreaAltered = false;
  9264. aRSImageProducer_1125.initDrawingArea();
  9265. main3DArea.initDrawingArea();
  9266. }
  9267. anInt945 = 0;
  9268. }
  9269.  
  9270. private boolean buildFriendsListMenu(RSInterface class9)
  9271. {
  9272. int i = class9.contentType;
  9273. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  9274. {
  9275. if(i >= 801)
  9276. i -= 701;
  9277. else
  9278. if(i >= 701)
  9279. i -= 601;
  9280. else
  9281. if(i >= 101)
  9282. i -= 101;
  9283. else
  9284. i--;
  9285. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9286. menuActionID[menuActionRow] = 792;
  9287. menuActionRow++;
  9288. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9289. menuActionID[menuActionRow] = 639;
  9290. menuActionRow++;
  9291. return true;
  9292. }
  9293. if(i >= 401 && i <= 500)
  9294. {
  9295. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  9296. menuActionID[menuActionRow] = 322;
  9297. menuActionRow++;
  9298. return true;
  9299. } else
  9300. {
  9301. return false;
  9302. }
  9303. }
  9304.  
  9305. private void method104()
  9306. {
  9307. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  9308. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  9309. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  9310. class30_sub2_sub4_sub3.unlink();
  9311. else
  9312. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  9313. {
  9314. class30_sub2_sub4_sub3.method454(anInt945);
  9315. if(class30_sub2_sub4_sub3.aBoolean1567)
  9316. class30_sub2_sub4_sub3.unlink();
  9317. else
  9318. 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);
  9319. }
  9320.  
  9321. }
  9322.  
  9323. public void drawBlackBox(int xPos, int yPos) {
  9324. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  9325. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  9326. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  9327. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  9328. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  9329. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  9330. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  9331. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  9332. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  9333. }
  9334.  
  9335. /* NEW INTERFACE TEXT ENGINE - private void drawInterface(int yScrollPoint, int xPadding, RSInterface rsInterface, int yPadding) {
  9336. try {
  9337. if(rsInterface.type != 0 || rsInterface.children == null)
  9338. return;
  9339. if(rsInterface.isMouseoverTriggered && lastHoverChildId != rsInterface.id && anInt1048 != rsInterface.id && anInt1039 != rsInterface.id)
  9340. return;
  9341. int xTopPos = DrawingArea.topX;
  9342. int yTopPos = DrawingArea.topY;
  9343. int xBottomPos = DrawingArea.bottomX;
  9344. int yBottomPos = DrawingArea.bottomY;
  9345. DrawingArea.setDrawingArea(yPadding + rsInterface.height, xPadding, xPadding + rsInterface.width, yPadding);
  9346. int totalChildren = rsInterface.children.length;
  9347. for(int childIndex = 0; childIndex < totalChildren; childIndex++) {
  9348. int xSpritePos = rsInterface.childX[childIndex] + xPadding;
  9349. int ySpritePos = (rsInterface.childY[childIndex] + yPadding) - yScrollPoint;
  9350. RSInterface rsChildren = RSInterface.interfaceCache[rsInterface.children[childIndex]];
  9351. xSpritePos += rsChildren.anInt263;
  9352. ySpritePos += rsChildren.anInt265;
  9353. if(rsChildren.contentType > 0)
  9354. drawFriendsListOrWelcomeScreen(rsChildren);
  9355. //here
  9356. int[] IDs = {
  9357. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  9358. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  9359. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  9360. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  9361. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  9362. /* Ancients *
  9363. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  9364. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9365. };
  9366. for(int m5 = 0; m5 < IDs.length; m5++) {
  9367. if(rsChildren.id == IDs[m5] + 1) {
  9368. if(m5 > 61)
  9369. drawBlackBox(xSpritePos + 1, ySpritePos);
  9370. else
  9371. drawBlackBox(xSpritePos, ySpritePos + 1);
  9372. }
  9373. }
  9374. int[] runeChildren = {
  9375. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  9376. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  9377. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  9378. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  9379. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  9380. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  9381. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  9382. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  9383. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  9384. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  9385. 15885, 18474, 18475, 18478
  9386. };
  9387. for(int r = 0; r < runeChildren.length; r++)
  9388. if(rsChildren.id == runeChildren[r])
  9389. rsChildren.modelZoom = 775;
  9390. if(rsChildren.type == 0) {
  9391. if(rsChildren.scrollPosition > rsChildren.scrollMax - rsChildren.height)
  9392. rsChildren.scrollPosition = rsChildren.scrollMax - rsChildren.height;
  9393. if(rsChildren.scrollPosition < 0)
  9394. rsChildren.scrollPosition = 0;
  9395. drawInterface(rsChildren.scrollPosition, xSpritePos, rsChildren, ySpritePos);
  9396. if(rsChildren.scrollMax > rsChildren.height)
  9397. drawScrollbar(rsChildren.height, rsChildren.scrollPosition, ySpritePos, xSpritePos + rsChildren.width, rsChildren.scrollMax,false);
  9398. } else if(rsChildren.type != 1)
  9399. if(rsChildren.type == 2) {
  9400. int spriteIndex = 0;
  9401. for(int l3 = 0; l3 < rsChildren.height; l3++) {
  9402. for(int l4 = 0; l4 < rsChildren.width; l4++) {
  9403. int k5 = xSpritePos + l4 * (32 + rsChildren.invSpritePadX);
  9404. int j6 = ySpritePos + l3 * (32 + rsChildren.invSpritePadY);
  9405. if(spriteIndex < 20) {
  9406. k5 += rsChildren.spritesX[spriteIndex];
  9407. j6 += rsChildren.spritesY[spriteIndex];
  9408. }
  9409. if(rsChildren.inv[spriteIndex] > 0) {
  9410. int k6 = 0;
  9411. int j7 = 0;
  9412. int inventoryItemId = rsChildren.inv[spriteIndex] - 1;
  9413. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == spriteIndex) {
  9414. int selectedColour = 0;
  9415. if(itemSelected == 1 && itemSlotUsedOn == spriteIndex && anInt1284 == rsChildren.id)
  9416. selectedColour = 0xffffff;
  9417. Sprite itemSprite = ItemDef.getSprite(inventoryItemId, rsChildren.invStackSizes[spriteIndex], selectedColour);
  9418. if(itemSprite != null) {
  9419. if(activeInterfaceType != 0 && anInt1085 == spriteIndex && anInt1084 == rsChildren.id) {
  9420. k6 = super.mouseX - anInt1087;
  9421. j7 = super.mouseY - anInt1088;
  9422. if(k6 < 5 && k6 > -5)
  9423. k6 = 0;
  9424. if(j7 < 5 && j7 > -5)
  9425. j7 = 0;
  9426. if(anInt989 < 5) {
  9427. k6 = 0;
  9428. j7 = 0;
  9429. }
  9430. itemSprite.drawSprite1(k5 + k6, j6 + j7, 128);
  9431. if(j6 + j7 < DrawingArea.topY && rsInterface.scrollPosition > 0) {
  9432. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9433. if(i10 > anInt945 * 10)
  9434. i10 = anInt945 * 10;
  9435. if(i10 > rsInterface.scrollPosition)
  9436. i10 = rsInterface.scrollPosition;
  9437. rsInterface.scrollPosition -= i10;
  9438. anInt1088 += i10;
  9439. }
  9440. if(j6 + j7 + 32 > DrawingArea.bottomY && rsInterface.scrollPosition < rsInterface.scrollMax - rsInterface.height) {
  9441. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9442. if(j10 > anInt945 * 10)
  9443. j10 = anInt945 * 10;
  9444. if(j10 > rsInterface.scrollMax - rsInterface.height - rsInterface.scrollPosition)
  9445. j10 = rsInterface.scrollMax - rsInterface.height - rsInterface.scrollPosition;
  9446. rsInterface.scrollPosition += j10;
  9447. anInt1088 -= j10;
  9448. }
  9449. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == spriteIndex && atInventoryInterface == rsChildren.id)
  9450. itemSprite.drawSprite1(k5, j6, 128);
  9451. else
  9452. itemSprite.drawSprite(k5, j6);
  9453. if(rsChildren.parentID == 3824) {
  9454. infinityIcon.drawSprite(k5, j6);
  9455. } else if(itemSprite.maxWidth == 33 || rsChildren.invStackSizes[spriteIndex] != 1) {
  9456. int k10 = rsChildren.invStackSizes[spriteIndex];
  9457. if(k10 >= 1)
  9458. newSmallFont.drawBasicString(intToKOrMil(k10), k5 + k6, j6 + 9 + j7, 0xFFFF00, 0);
  9459. if(k10 >= 100000)
  9460. newSmallFont.drawBasicString(intToKOrMil(k10), k5 + k6, j6 + 9 + j7, 0xFFFFFF, 0);
  9461. if(k10 >= 10000000)
  9462. newSmallFont.drawBasicString(intToKOrMil(k10), k5 + k6, j6 + 9 + j7, 0x00FF80, 0);
  9463. if(k10 >= 1000000000)
  9464. newSmallFont.drawBasicString(intToKOrMil(k10), k5 + k6, j6 + 9 + j7, 0xFF0000, 0);
  9465. }
  9466. }
  9467. }
  9468. } else if(rsChildren.sprites != null && spriteIndex < 20) {
  9469. Sprite sprite = rsChildren.sprites[spriteIndex];
  9470. if(sprite != null)
  9471. sprite.drawSprite(k5, j6);
  9472. }
  9473. spriteIndex++;
  9474. }
  9475. }
  9476. } else if(rsChildren.type == 3) {
  9477. boolean flag = false;
  9478. if(anInt1039 == rsChildren.id || anInt1048 == rsChildren.id || lastHoverChildId == rsChildren.id)
  9479. flag = true;
  9480. int j3;
  9481. if(interfaceIsSelected(rsChildren)) {
  9482. j3 = rsChildren.anInt219;
  9483. if(flag && rsChildren.anInt239 != 0)
  9484. j3 = rsChildren.anInt239;
  9485. } else {
  9486. j3 = rsChildren.textColor;
  9487. if(flag && rsChildren.textHoverColour != 0)
  9488. j3 = rsChildren.textHoverColour;
  9489. }
  9490. if(rsChildren.opacity == 0) {
  9491. if(rsChildren.aBoolean227)
  9492. DrawingArea.drawPixels(rsChildren.height, ySpritePos, xSpritePos, j3, rsChildren.width);
  9493. else
  9494. DrawingArea.fillPixels(xSpritePos, rsChildren.width, rsChildren.height, j3, ySpritePos);
  9495. } else if(rsChildren.aBoolean227)
  9496. DrawingArea.method335(j3, ySpritePos, rsChildren.width, rsChildren.height, 256 - (rsChildren.opacity & 0xff), xSpritePos);
  9497. else
  9498. DrawingArea.method338(ySpritePos, rsChildren.height, 256 - (rsChildren.opacity & 0xff), j3, rsChildren.width, xSpritePos);
  9499. } else if(rsChildren.type == 4) {
  9500. RSFont textDrawingArea = rsChildren.textDrawingAreas;
  9501. String s = rsChildren.message;
  9502. boolean flag1 = false;
  9503. if(anInt1039 == rsChildren.id || anInt1048 == rsChildren.id || lastHoverChildId == rsChildren.id)
  9504. flag1 = true;
  9505. int i4;
  9506. if(interfaceIsSelected(rsChildren)) {
  9507. i4 = rsChildren.anInt219;
  9508. if(flag1 && rsChildren.anInt239 != 0)
  9509. i4 = rsChildren.anInt239;
  9510. if(rsChildren.disabledText.length() > 0)
  9511. s = rsChildren.disabledText;
  9512. } else {
  9513. i4 = rsChildren.textColor;
  9514. if(flag1 && rsChildren.textHoverColour != 0)
  9515. i4 = rsChildren.textHoverColour;
  9516. }
  9517. if(rsChildren.atActionType == 6 && aBoolean1149) {
  9518. s = "Please wait...";
  9519. i4 = rsChildren.textColor;
  9520. }
  9521. if(DrawingArea.width == 519) {
  9522. if(i4 == 0xffff00)
  9523. i4 = 255;
  9524. if(i4 == 49152)
  9525. i4 = 0xffffff;
  9526. }
  9527. if((rsChildren.parentID == 1151) || (rsChildren.parentID == 12855)) {
  9528. switch (i4) {
  9529. case 16773120: i4 = 0xFE981F; break;
  9530. case 7040819: i4 = 0xAF6A1A; break;
  9531. }
  9532. }
  9533. for(int l6 = ySpritePos + textDrawingArea.baseCharacterHeight; s.length() > 0; l6 += textDrawingArea.baseCharacterHeight) {
  9534. if(s.indexOf("%") != -1) {
  9535. do {
  9536. int k7 = s.indexOf("%1");
  9537. if(k7 == -1)
  9538. break;
  9539. if(rsChildren.id < 4000 || rsChildren.id > 5000 && rsChildren.id !=13921 && rsChildren.id !=13922 && rsChildren.id !=12171 && rsChildren.id !=12172)
  9540. s = s.substring(0, k7) + methodR(extractInterfaceValues(rsChildren, 0)) + s.substring(k7 + 2);
  9541. else
  9542. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(rsChildren, 0)) + s.substring(k7 + 2);
  9543. } while(true);
  9544. do {
  9545. int l7 = s.indexOf("%2");
  9546. if(l7 == -1)
  9547. break;
  9548. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(rsChildren, 1)) + s.substring(l7 + 2);
  9549. } while(true);
  9550. do {
  9551. int i8 = s.indexOf("%3");
  9552. if(i8 == -1)
  9553. break;
  9554. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(rsChildren, 2)) + s.substring(i8 + 2);
  9555. } while(true);
  9556. do {
  9557. int j8 = s.indexOf("%4");
  9558. if(j8 == -1)
  9559. break;
  9560. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(rsChildren, 3)) + s.substring(j8 + 2);
  9561. } while(true);
  9562. do {
  9563. int k8 = s.indexOf("%5");
  9564. if(k8 == -1)
  9565. break;
  9566. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(rsChildren, 4)) + s.substring(k8 + 2);
  9567. } while(true);
  9568. }
  9569. int l8 = s.indexOf("\\n");
  9570. String s1;
  9571. if(l8 != -1) {
  9572. s1 = s.substring(0, l8);
  9573. s = s.substring(l8 + 2);
  9574. } else {
  9575. s1 = s;
  9576. s = "";
  9577. }
  9578. if(rsChildren.centerText){
  9579. //textDrawingArea.method382(i4, xSpritePos + rsChildren.width / 2, s1, l6, rsChildren.textShadow);
  9580. textDrawingArea.drawCenteredString(s1, xSpritePos + rsChildren.width / 2, l6, i4,(rsChildren.textShadow? 0: -1));
  9581. } else {
  9582. //textDrawingArea.method389(rsChildren.textShadow, xSpritePos, i4, s1, l6);
  9583. textDrawingArea.drawBasicString(s1, xSpritePos , l6, i4,(rsChildren.textShadow? 0: -1));
  9584. }
  9585.  
  9586. }
  9587. } else if(rsChildren.type == 5 || rsChildren.type == 10) {
  9588. Sprite sprite = null;
  9589. if(rsChildren.itemSpriteId1 != -1 && rsChildren.sprite1 == null) {
  9590. rsChildren.sprite1 = ItemDef.getSprite(rsChildren.itemSpriteId1, 1, (rsChildren.itemSpriteZoom1 == -1) ? 0 : -1,rsChildren.itemSpriteZoom1);
  9591. rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, 1, (rsChildren.itemSpriteZoom2 == -1) ? 0 : -1,rsChildren.itemSpriteZoom2);
  9592. //rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, rsChildren.invStackSizes[spriteIndex], selectedColour);
  9593. if(rsChildren.greyScale)
  9594. rsChildren.sprite1.greyScale();
  9595. }
  9596. if(interfaceIsSelected(rsChildren) || hoverSpriteId == rsChildren.id)
  9597. sprite = rsChildren.sprite2;
  9598. else
  9599. sprite = rsChildren.sprite1;
  9600. if(spellSelected == 1 && rsChildren.id == spellID && spellID != 0 && sprite != null) {
  9601. sprite.drawSprite(xSpritePos, ySpritePos, 0xffffff);
  9602. } else {
  9603. if (sprite != null)
  9604. if(rsChildren.type == 5)
  9605. sprite.drawSprite(xSpritePos, ySpritePos);
  9606. else
  9607. sprite.drawSprite1(xSpritePos, ySpritePos, rsChildren.opacity);
  9608. }
  9609. if(autoCast && rsChildren.id == autocastId)
  9610. magicAuto.drawSprite(xSpritePos-3, ySpritePos-2);
  9611. } else if(rsChildren.type == 6) {
  9612. int k3 = Texture.textureInt1;
  9613. int j4 = Texture.textureInt2;
  9614. Texture.textureInt1 = xSpritePos + rsChildren.width / 2;
  9615. Texture.textureInt2 = ySpritePos + rsChildren.height / 2;
  9616. int i5 = Texture.anIntArray1470[rsChildren.modelRotation1] * rsChildren.modelZoom >> 16;
  9617. int l5 = Texture.anIntArray1471[rsChildren.modelRotation1] * rsChildren.modelZoom >> 16;
  9618. boolean flag2 = interfaceIsSelected(rsChildren);
  9619. int i7;
  9620. if(flag2)
  9621. i7 = rsChildren.anInt258;
  9622. else
  9623. i7 = rsChildren.anInt257;
  9624. Model model;
  9625. if(i7 == -1) {
  9626. model = rsChildren.method209(-1, -1, flag2);
  9627. } else {
  9628. Animation animation = Animation.anims[i7];
  9629. model = rsChildren.method209(animation.anIntArray354[rsChildren.anInt246], animation.anIntArray353[rsChildren.anInt246], flag2);
  9630. }
  9631. if(model != null)
  9632. model.method482(rsChildren.modelRotation2, 0, rsChildren.modelRotation1, 0, i5, l5);
  9633. Texture.textureInt1 = k3;
  9634. Texture.textureInt2 = j4;
  9635.  
  9636. } else if(rsChildren.type == 7) {
  9637. RSFont textDrawingArea_1 = rsChildren.textDrawingAreas;
  9638. int k4 = 0;
  9639. for(int j5 = 0; j5 < rsChildren.height; j5++) {
  9640. for(int i6 = 0; i6 < rsChildren.width; i6++) {
  9641. if(rsChildren.inv[k4] > 0) {
  9642. ItemDef itemDef = ItemDef.forID(rsChildren.inv[k4] - 1);
  9643. String s2 = itemDef.name;
  9644. if(itemDef.stackable || rsChildren.invStackSizes[k4] != 1)
  9645. s2 = s2 + " x" + intToKOrMilLongName(rsChildren.invStackSizes[k4]);
  9646. int i9 = xSpritePos + i6 * (115 + rsChildren.invSpritePadX);
  9647. int k9 = ySpritePos + j5 * (12 + rsChildren.invSpritePadY);
  9648. if(rsChildren.centerText)
  9649. textDrawingArea_1.drawCenteredString(s2, i9 + rsChildren.width / 2, k9, rsChildren.textColor, (rsChildren.textShadow ? 0: -1));
  9650. else
  9651. textDrawingArea_1.drawBasicString(s2, i9, k9, rsChildren.textColor,(rsChildren.textShadow ? 0: -1));
  9652. }
  9653. k4++;
  9654. }
  9655. }
  9656. } else if (rsChildren.type == 8 && (anInt1500 == rsChildren.id || anInt1044 == rsChildren.id || lastHoverToggleChildId == rsChildren.id) && anInt1501 == 100) {
  9657. int boxWidth = 0;
  9658. int boxHeight = 0;
  9659. TextDrawingArea textDrawingArea_2 = normalFont;
  9660. for (String s1 = rsChildren.message; s1.length() > 0;) {
  9661. int l7 = s1.indexOf("\\n");
  9662. String s4;
  9663. if (l7 != -1) {
  9664. s4 = s1.substring(0, l7);
  9665. s1 = s1.substring(l7 + 2);
  9666. } else {
  9667. s4 = s1;
  9668. s1 = "";
  9669. }
  9670. int j10 = textDrawingArea_2.getTextWidth(s4);
  9671. if (j10 > boxWidth) {
  9672. boxWidth = j10;
  9673. }
  9674. boxHeight += textDrawingArea_2.anInt1497 + 1;
  9675. }
  9676. boxWidth += 6;
  9677. boxHeight += 7;
  9678. int xPos = (ySpritePos + rsChildren.width) - 5 - boxWidth;
  9679. int yPos = xSpritePos + rsChildren.height + 5;
  9680. if (xPos < ySpritePos + 5) {
  9681. xPos = ySpritePos + 5;
  9682. }
  9683. if (xPos + boxWidth > yScrollPoint + rsInterface.width) {
  9684. xPos = (yScrollPoint + rsInterface.width) - boxWidth;
  9685. }
  9686. if (yPos + boxHeight > xPadding + rsInterface.height) {
  9687. yPos = (xPadding + rsInterface.height) - boxHeight;
  9688. }
  9689. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  9690. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  9691. String s2 = rsChildren.message;
  9692. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
  9693. int newLineIndex = s2.indexOf("\\n");
  9694. String s5;
  9695. if (newLineIndex != -1) {
  9696. s5 = s2.substring(0, newLineIndex);
  9697. s2 = s2.substring(newLineIndex + 2);
  9698. } else {
  9699. s5 = s2;
  9700. s2 = "";
  9701. }
  9702. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  9703. }
  9704. } else if (rsChildren.type == 9) {
  9705. drawHoverBox(xSpritePos, ySpritePos, rsChildren.message);
  9706. }
  9707. }
  9708. DrawingArea.setDrawingArea(yBottomPos, xTopPos, xBottomPos, yTopPos);
  9709. } catch(NullPointerException ex) {
  9710.  
  9711. }
  9712. }*/
  9713.  
  9714. private void drawInterface(int yScrollPoint, int xPadding, RSInterface rsInterface, int yPadding) {
  9715. try {
  9716. if(rsInterface.type != 0 || rsInterface.children == null)
  9717. return;
  9718. if(rsInterface.isMouseoverTriggered && lastHoverChildId != rsInterface.id && anInt1048 != rsInterface.id && anInt1039 != rsInterface.id)
  9719. return;
  9720. int xTopPos = DrawingArea.topX;
  9721. int yTopPos = DrawingArea.topY;
  9722. int xBottomPos = DrawingArea.bottomX;
  9723. int yBottomPos = DrawingArea.bottomY;
  9724. DrawingArea.setDrawingArea(yPadding + rsInterface.height, xPadding, xPadding + rsInterface.width, yPadding);
  9725. int totalChildren = rsInterface.children.length;
  9726. for(int childIndex = 0; childIndex < totalChildren; childIndex++) {
  9727. int xSpritePos = rsInterface.childX[childIndex] + xPadding;
  9728. int ySpritePos = (rsInterface.childY[childIndex] + yPadding) - yScrollPoint;
  9729. RSInterface rsChildren = RSInterface.interfaceCache[rsInterface.children[childIndex]];
  9730. xSpritePos += rsChildren.anInt263;
  9731. ySpritePos += rsChildren.anInt265;
  9732. if(rsChildren.contentType > 0)
  9733. drawFriendsListOrWelcomeScreen(rsChildren);
  9734. //here
  9735. int[] IDs = {
  9736. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  9737. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  9738. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  9739. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  9740. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  9741. /* Ancients */
  9742. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  9743. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9744. };
  9745. for(int m5 = 0; m5 < IDs.length; m5++) {
  9746. if(rsChildren.id == IDs[m5] + 1) {
  9747. if(m5 > 61)
  9748. drawBlackBox(xSpritePos + 1, ySpritePos);
  9749. else
  9750. drawBlackBox(xSpritePos, ySpritePos + 1);
  9751. }
  9752. }
  9753. int[] runeChildren = {
  9754. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  9755. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  9756. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  9757. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  9758. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  9759. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  9760. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  9761. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  9762. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  9763. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  9764. 15885, 18474, 18475, 18478
  9765. };
  9766. for(int r = 0; r < runeChildren.length; r++)
  9767. if(rsChildren.id == runeChildren[r])
  9768. rsChildren.modelZoom = 775;
  9769. if(rsChildren.type == 0) {
  9770. if(rsChildren.scrollPosition > rsChildren.scrollMax - rsChildren.height)
  9771. rsChildren.scrollPosition = rsChildren.scrollMax - rsChildren.height;
  9772. if(rsChildren.scrollPosition < 0)
  9773. rsChildren.scrollPosition = 0;
  9774. drawInterface(rsChildren.scrollPosition, xSpritePos, rsChildren, ySpritePos);
  9775. if(rsChildren.scrollMax > rsChildren.height)
  9776. drawScrollbar(rsChildren.height, rsChildren.scrollPosition, ySpritePos, xSpritePos + rsChildren.width, rsChildren.scrollMax,false);
  9777. } else if(rsChildren.type != 1)
  9778. if(rsChildren.type == 2) {
  9779. int spriteIndex = 0;
  9780. for(int l3 = 0; l3 < rsChildren.height; l3++) {
  9781. for(int l4 = 0; l4 < rsChildren.width; l4++) {
  9782. int k5 = xSpritePos + l4 * (32 + rsChildren.invSpritePadX);
  9783. int j6 = ySpritePos + l3 * (32 + rsChildren.invSpritePadY);
  9784. if(spriteIndex < 20) {
  9785. k5 += rsChildren.spritesX[spriteIndex];
  9786. j6 += rsChildren.spritesY[spriteIndex];
  9787. }
  9788. if(rsChildren.inv[spriteIndex] > 0) {
  9789. int k6 = 0;
  9790. int j7 = 0;
  9791. int inventoryItemId = rsChildren.inv[spriteIndex] - 1;
  9792. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == spriteIndex) {
  9793. int selectedColour = 0;
  9794. if(itemSelected == 1 && itemSlotUsedOn == spriteIndex && anInt1284 == rsChildren.id)
  9795. selectedColour = 0xffffff;
  9796. Sprite itemSprite = ItemDef.getSprite(inventoryItemId, rsChildren.invStackSizes[spriteIndex], selectedColour);
  9797. if(itemSprite != null) {
  9798. if(activeInterfaceType != 0 && anInt1085 == spriteIndex && anInt1084 == rsChildren.id) {
  9799. k6 = super.mouseX - anInt1087;
  9800. j7 = super.mouseY - anInt1088;
  9801. if(k6 < 5 && k6 > -5)
  9802. k6 = 0;
  9803. if(j7 < 5 && j7 > -5)
  9804. j7 = 0;
  9805. if(anInt989 < 10) {
  9806. k6 = 0;
  9807. j7 = 0;
  9808. }
  9809. itemSprite.drawSprite1(k5 + k6, j6 + j7, 128);
  9810. if(j6 + j7 < DrawingArea.topY && rsInterface.scrollPosition > 0) {
  9811. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9812. if(i10 > anInt945 * 10)
  9813. i10 = anInt945 * 10;
  9814. if(i10 > rsInterface.scrollPosition)
  9815. i10 = rsInterface.scrollPosition;
  9816. rsInterface.scrollPosition -= i10;
  9817. anInt1088 += i10;
  9818. }
  9819. if(j6 + j7 + 32 > DrawingArea.bottomY && rsInterface.scrollPosition < rsInterface.scrollMax - rsInterface.height) {
  9820. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9821. if(j10 > anInt945 * 10)
  9822. j10 = anInt945 * 10;
  9823. if(j10 > rsInterface.scrollMax - rsInterface.height - rsInterface.scrollPosition)
  9824. j10 = rsInterface.scrollMax - rsInterface.height - rsInterface.scrollPosition;
  9825. rsInterface.scrollPosition += j10;
  9826. anInt1088 -= j10;
  9827. }
  9828. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == spriteIndex && atInventoryInterface == rsChildren.id)
  9829. itemSprite.drawSprite1(k5, j6, 128);
  9830. else
  9831. itemSprite.drawSprite(k5, j6);
  9832. if(rsChildren.parentID == 3824) {
  9833. infinityIcon.drawSprite(k5, j6);
  9834. } else if(itemSprite.maxWidth == 33 || rsChildren.invStackSizes[spriteIndex] != 1) {
  9835. int k10 = rsChildren.invStackSizes[spriteIndex];
  9836. smallFont.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);//this is the shadow
  9837. if(k10 >= 1)
  9838. smallFont.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9839. if(k10 >= 100000)
  9840. smallFont.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9841. if(k10 >= 10000000)
  9842. smallFont.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9843. }
  9844. }
  9845. }
  9846. } else if(rsChildren.sprites != null && spriteIndex < 20) {
  9847. Sprite sprite = rsChildren.sprites[spriteIndex];
  9848. if(sprite != null)
  9849. sprite.drawSprite(k5, j6);
  9850. }
  9851. spriteIndex++;
  9852. }
  9853. }
  9854. } else if(rsChildren.type == 3) {
  9855. boolean flag = false;
  9856. if(anInt1039 == rsChildren.id || anInt1048 == rsChildren.id || lastHoverChildId == rsChildren.id)
  9857. flag = true;
  9858. int j3;
  9859. if(interfaceIsSelected(rsChildren)) {
  9860. j3 = rsChildren.anInt219;
  9861. if(flag && rsChildren.anInt239 != 0)
  9862. j3 = rsChildren.anInt239;
  9863. } else {
  9864. j3 = rsChildren.textColor;
  9865. if(flag && rsChildren.textHoverColour != 0)
  9866. j3 = rsChildren.textHoverColour;
  9867. }
  9868. if(rsChildren.opacity == 0) {
  9869. if(rsChildren.aBoolean227)
  9870. DrawingArea.drawPixels(rsChildren.height, ySpritePos, xSpritePos, j3, rsChildren.width);
  9871. else
  9872. DrawingArea.fillPixels(xSpritePos, rsChildren.width, rsChildren.height, j3, ySpritePos);
  9873. } else if(rsChildren.aBoolean227)
  9874. DrawingArea.method335(j3, ySpritePos, rsChildren.width, rsChildren.height, 256 - (rsChildren.opacity & 0xff), xSpritePos);
  9875. else
  9876. DrawingArea.method338(ySpritePos, rsChildren.height, 256 - (rsChildren.opacity & 0xff), j3, rsChildren.width, xSpritePos);
  9877. } else if(rsChildren.type == 4) {
  9878. TextDrawingArea textDrawingArea = rsChildren.textDrawingAreas;
  9879. String s = rsChildren.message;
  9880. boolean flag1 = false;
  9881. if(anInt1039 == rsChildren.id || anInt1048 == rsChildren.id || lastHoverChildId == rsChildren.id)
  9882. flag1 = true;
  9883. int i4;
  9884. if(interfaceIsSelected(rsChildren)) {
  9885. i4 = rsChildren.anInt219;
  9886. if(flag1 && rsChildren.anInt239 != 0)
  9887. i4 = rsChildren.anInt239;
  9888. if(rsChildren.disabledText.length() > 0)
  9889. s = rsChildren.disabledText;
  9890. } else {
  9891. i4 = rsChildren.textColor;
  9892. if(flag1 && rsChildren.textHoverColour != 0)
  9893. i4 = rsChildren.textHoverColour;
  9894. }
  9895. if(rsChildren.atActionType == 6 && aBoolean1149) {
  9896. s = "Please wait...";
  9897. i4 = rsChildren.textColor;
  9898. }
  9899. if(DrawingArea.width == 519) {
  9900. if(i4 == 0xffff00)
  9901. i4 = 255;
  9902. if(i4 == 49152)
  9903. i4 = 0xffffff;
  9904. }
  9905. if((rsChildren.parentID == 1151) || (rsChildren.parentID == 12855)) {
  9906. switch (i4) {
  9907. case 16773120: i4 = 0xFE981F; break;
  9908. case 7040819: i4 = 0xAF6A1A; break;
  9909. }
  9910. }
  9911. for(int l6 = ySpritePos + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  9912. if(s.indexOf("%") != -1) {
  9913. do {
  9914. int k7 = s.indexOf("%1");
  9915. if(k7 == -1)
  9916. break;
  9917. if(rsChildren.id < 4000 || rsChildren.id > 5000 && rsChildren.id !=13921 && rsChildren.id !=13922 && rsChildren.id !=12171 && rsChildren.id !=12172)
  9918. s = s.substring(0, k7) + methodR(extractInterfaceValues(rsChildren, 0)) + s.substring(k7 + 2);
  9919. else
  9920. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(rsChildren, 0)) + s.substring(k7 + 2);
  9921. } while(true);
  9922. do {
  9923. int l7 = s.indexOf("%2");
  9924. if(l7 == -1)
  9925. break;
  9926. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(rsChildren, 1)) + s.substring(l7 + 2);
  9927. } while(true);
  9928. do {
  9929. int i8 = s.indexOf("%3");
  9930. if(i8 == -1)
  9931. break;
  9932. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(rsChildren, 2)) + s.substring(i8 + 2);
  9933. } while(true);
  9934. do {
  9935. int j8 = s.indexOf("%4");
  9936. if(j8 == -1)
  9937. break;
  9938. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(rsChildren, 3)) + s.substring(j8 + 2);
  9939. } while(true);
  9940. do {
  9941. int k8 = s.indexOf("%5");
  9942. if(k8 == -1)
  9943. break;
  9944. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(rsChildren, 4)) + s.substring(k8 + 2);
  9945. } while(true);
  9946. }
  9947. int l8 = s.indexOf("\\n");
  9948. String s1;
  9949. if(l8 != -1) {
  9950. s1 = s.substring(0, l8);
  9951. s = s.substring(l8 + 2);
  9952. } else {
  9953. s1 = s;
  9954. s = "";
  9955. }
  9956. if(rsChildren.centerText)
  9957. textDrawingArea.method382(i4, xSpritePos + rsChildren.width / 2, s1, l6, rsChildren.textShadow);
  9958. else
  9959. textDrawingArea.method389(rsChildren.textShadow, xSpritePos, i4, s1, l6);
  9960. }
  9961. } else if(rsChildren.type == 5 || rsChildren.type == 10) {
  9962. Sprite sprite = null;
  9963. if(rsChildren.itemSpriteId1 != -1 && rsChildren.sprite1 == null) {
  9964. rsChildren.sprite1 = ItemDef.getSprite(rsChildren.itemSpriteId1, 1, (rsChildren.itemSpriteZoom1 == -1) ? 0 : -1,rsChildren.itemSpriteZoom1);
  9965. rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, 1, (rsChildren.itemSpriteZoom2 == -1) ? 0 : -1,rsChildren.itemSpriteZoom2);
  9966. //rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, rsChildren.invStackSizes[spriteIndex], selectedColour);
  9967. if(rsChildren.greyScale)
  9968. rsChildren.sprite1.greyScale();
  9969. }
  9970. if(interfaceIsSelected(rsChildren) || hoverSpriteId == rsChildren.id)
  9971. sprite = rsChildren.sprite2;
  9972. else
  9973. sprite = rsChildren.sprite1;
  9974. if(spellSelected == 1 && rsChildren.id == spellID && spellID != 0 && sprite != null) {
  9975. sprite.drawSprite(xSpritePos, ySpritePos, 0xffffff);
  9976. } else {
  9977. if (sprite != null)
  9978. if(rsChildren.type == 5)
  9979. sprite.drawSprite(xSpritePos, ySpritePos);
  9980. else
  9981. sprite.drawSprite1(xSpritePos, ySpritePos, rsChildren.opacity);
  9982. }
  9983. if(autoCast && rsChildren.id == autocastId)
  9984. magicAuto.drawSprite(xSpritePos-3, ySpritePos-2);
  9985. } else if(rsChildren.type == 6) {
  9986. int k3 = Texture.textureInt1;
  9987. int j4 = Texture.textureInt2;
  9988. Texture.textureInt1 = xSpritePos + rsChildren.width / 2;
  9989. Texture.textureInt2 = ySpritePos + rsChildren.height / 2;
  9990. int i5 = Texture.anIntArray1470[rsChildren.modelRotation1] * rsChildren.modelZoom >> 16;
  9991. int l5 = Texture.anIntArray1471[rsChildren.modelRotation1] * rsChildren.modelZoom >> 16;
  9992. boolean flag2 = interfaceIsSelected(rsChildren);
  9993. int i7;
  9994. if(flag2)
  9995. i7 = rsChildren.anInt258;
  9996. else
  9997. i7 = rsChildren.anInt257;
  9998. Model model;
  9999. if(i7 == -1) {
  10000. model = rsChildren.method209(-1, -1, flag2);
  10001. } else {
  10002. Animation animation = Animation.anims[i7];
  10003. model = rsChildren.method209(animation.anIntArray354[rsChildren.anInt246], animation.anIntArray353[rsChildren.anInt246], flag2);
  10004. }
  10005. if(model != null)
  10006. model.method482(rsChildren.modelRotation2, 0, rsChildren.modelRotation1, 0, i5, l5);
  10007. Texture.textureInt1 = k3;
  10008. Texture.textureInt2 = j4;
  10009.  
  10010. } else if(rsChildren.type == 7) {
  10011. TextDrawingArea textDrawingArea_1 = rsChildren.textDrawingAreas;
  10012. int k4 = 0;
  10013. for(int j5 = 0; j5 < rsChildren.height; j5++) {
  10014. for(int i6 = 0; i6 < rsChildren.width; i6++) {
  10015. if(rsChildren.inv[k4] > 0) {
  10016. ItemDef itemDef = ItemDef.forID(rsChildren.inv[k4] - 1);
  10017. String s2 = itemDef.name;
  10018. if(itemDef.stackable || rsChildren.invStackSizes[k4] != 1)
  10019. s2 = s2 + " x" + intToKOrMilLongName(rsChildren.invStackSizes[k4]);
  10020. int i9 = xSpritePos + i6 * (115 + rsChildren.invSpritePadX);
  10021. int k9 = ySpritePos + j5 * (12 + rsChildren.invSpritePadY);
  10022. if(rsChildren.centerText)
  10023. textDrawingArea_1.method382(rsChildren.textColor, i9 + rsChildren.width / 2, s2, k9, rsChildren.textShadow);
  10024. else
  10025. textDrawingArea_1.method389(rsChildren.textShadow, i9, rsChildren.textColor, s2, k9);
  10026. }
  10027. k4++;
  10028. }
  10029. }
  10030. } else if (rsChildren.type == 8 && (anInt1500 == rsChildren.id || anInt1044 == rsChildren.id || lastHoverToggleChildId == rsChildren.id) && anInt1501 == 100) {
  10031. int boxWidth = 0;
  10032. int boxHeight = 0;
  10033. TextDrawingArea textDrawingArea_2 = normalFont;
  10034. for (String s1 = rsChildren.message; s1.length() > 0;) {
  10035. int l7 = s1.indexOf("\\n");
  10036. String s4;
  10037. if (l7 != -1) {
  10038. s4 = s1.substring(0, l7);
  10039. s1 = s1.substring(l7 + 2);
  10040. } else {
  10041. s4 = s1;
  10042. s1 = "";
  10043. }
  10044. int j10 = textDrawingArea_2.getTextWidth(s4);
  10045. if (j10 > boxWidth) {
  10046. boxWidth = j10;
  10047. }
  10048. boxHeight += textDrawingArea_2.anInt1497 + 1;
  10049. }
  10050. boxWidth += 6;
  10051. boxHeight += 7;
  10052. int xPos = (ySpritePos + rsChildren.width) - 5 - boxWidth;
  10053. int yPos = xSpritePos + rsChildren.height + 5;
  10054. if (xPos < ySpritePos + 5) {
  10055. xPos = ySpritePos + 5;
  10056. }
  10057. if (xPos + boxWidth > yScrollPoint + rsInterface.width) {
  10058. xPos = (yScrollPoint + rsInterface.width) - boxWidth;
  10059. }
  10060. if (yPos + boxHeight > xPadding + rsInterface.height) {
  10061. yPos = (xPadding + rsInterface.height) - boxHeight;
  10062. }
  10063. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  10064. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  10065. String s2 = rsChildren.message;
  10066. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
  10067. int newLineIndex = s2.indexOf("\\n");
  10068. String s5;
  10069. if (newLineIndex != -1) {
  10070. s5 = s2.substring(0, newLineIndex);
  10071. s2 = s2.substring(newLineIndex + 2);
  10072. } else {
  10073. s5 = s2;
  10074. s2 = "";
  10075. }
  10076. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  10077. }
  10078. } else if (rsChildren.type == 9) {
  10079. drawHoverBox(xSpritePos, ySpritePos, rsChildren.message);
  10080. }
  10081. }
  10082. DrawingArea.setDrawingArea(yBottomPos, xTopPos, xBottomPos, yTopPos);
  10083. } catch(NullPointerException ex) {
  10084.  
  10085. }
  10086. }
  10087.  
  10088. public void drawHoverBox(int xPos, int yPos, String text) {
  10089. String[] results = text.split("\n");
  10090. int height = (results.length * 16) + 6;
  10091. int width;
  10092. width = smallFont.getTextWidth(results[0]) + 6;
  10093. for(int i = 1; i < results.length; i++)
  10094. if(width <= smallFont.getTextWidth(results[i]) + 6)
  10095. width = smallFont.getTextWidth(results[i]) + 6;
  10096. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  10097. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  10098. yPos += 14;
  10099. for(int i = 0; i < results.length; i++) {
  10100. smallFont.method389(false, xPos + 3, 0, results[i], yPos);
  10101. yPos += 16;
  10102. }
  10103. }
  10104.  
  10105. private void randomizeBackground(Background background) {
  10106. int j = 256;
  10107. for(int k = 0; k < anIntArray1190.length; k++)
  10108. anIntArray1190[k] = 0;
  10109.  
  10110. for(int l = 0; l < 5000; l++) {
  10111. int i1 = (int)(Math.random() * 128D * (double)j);
  10112. anIntArray1190[i1] = (int)(Math.random() * 256D);
  10113. }
  10114. for(int j1 = 0; j1 < 20; j1++) {
  10115. for(int k1 = 1; k1 < j - 1; k1++) {
  10116. for(int i2 = 1; i2 < 127; i2++) {
  10117. int k2 = i2 + (k1 << 7);
  10118. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10119. }
  10120.  
  10121. }
  10122. int ai[] = anIntArray1190;
  10123. anIntArray1190 = anIntArray1191;
  10124. anIntArray1191 = ai;
  10125. }
  10126. if(background != null) {
  10127. int l1 = 0;
  10128. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  10129. for(int l2 = 0; l2 < background.anInt1452; l2++)
  10130. if(background.aByteArray1450[l1++] != 0) {
  10131. int i3 = l2 + 16 + background.anInt1454;
  10132. int j3 = j2 + 16 + background.anInt1455;
  10133. int k3 = i3 + (j3 << 7);
  10134. anIntArray1190[k3] = 0;
  10135. }
  10136. }
  10137. }
  10138. }
  10139.  
  10140. private void method107(int i, int j, Stream stream, Player player)
  10141. {
  10142. if((i & 0x400) != 0)
  10143. {
  10144. player.anInt1543 = stream.method428();
  10145. player.anInt1545 = stream.method428();
  10146. player.anInt1544 = stream.method428();
  10147. player.anInt1546 = stream.method428();
  10148. player.anInt1547 = stream.method436() + loopCycle;
  10149. player.anInt1548 = stream.method435() + loopCycle;
  10150. player.anInt1549 = stream.method428();
  10151. player.method446();
  10152. }
  10153. if((i & 0x100) != 0)
  10154. {
  10155. player.anInt1520 = stream.method434();
  10156. int k = stream.readDWord();
  10157. player.anInt1524 = k >> 16;
  10158. player.anInt1523 = loopCycle + (k & 0xffff);
  10159. player.anInt1521 = 0;
  10160. player.anInt1522 = 0;
  10161. if(player.anInt1523 > loopCycle)
  10162. player.anInt1521 = -1;
  10163. if(player.anInt1520 == 65535)
  10164. player.anInt1520 = -1;
  10165. }
  10166. if((i & 8) != 0)
  10167. {
  10168. int l = stream.method434();
  10169. if(l == 65535)
  10170. l = -1;
  10171. int i2 = stream.method427();
  10172. if(l == player.anim && l != -1)
  10173. {
  10174. int i3 = Animation.anims[l].anInt365;
  10175. if(i3 == 1)
  10176. {
  10177. player.anInt1527 = 0;
  10178. player.anInt1528 = 0;
  10179. player.anInt1529 = i2;
  10180. player.anInt1530 = 0;
  10181. }
  10182. if(i3 == 2)
  10183. player.anInt1530 = 0;
  10184. } else
  10185. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  10186. {
  10187. player.anim = l;
  10188. player.anInt1527 = 0;
  10189. player.anInt1528 = 0;
  10190. player.anInt1529 = i2;
  10191. player.anInt1530 = 0;
  10192. player.anInt1542 = player.smallXYIndex;
  10193. }
  10194. }
  10195. if((i & 4) != 0)
  10196. {
  10197. player.textSpoken = stream.readString();
  10198. if(player.textSpoken.charAt(0) == '~')
  10199. {
  10200. player.textSpoken = player.textSpoken.substring(1);
  10201. pushMessage(player.textSpoken, 2, player.name);
  10202. } else
  10203. if(player == myPlayer)
  10204. pushMessage(player.textSpoken, 2, player.name);
  10205. player.anInt1513 = 0;
  10206. player.anInt1531 = 0;
  10207. player.textCycle = 150;
  10208. }
  10209. if((i & 0x80) != 0)
  10210. {
  10211. //right fucking here
  10212. int i1 = stream.method434();
  10213. int myPrivilege = stream.readUnsignedByte();
  10214. int j3 = stream.method427();
  10215. int k3 = stream.currentOffset;
  10216. if(player.name != null && player.visible)
  10217. {
  10218. long l3 = TextClass.longForName(player.name);
  10219. boolean flag = false;
  10220. if(myPrivilege <= 1)
  10221. {
  10222. for(int i4 = 0; i4 < ignoreCount; i4++)
  10223. {
  10224. if(ignoreListAsLongs[i4] != l3)
  10225. continue;
  10226. flag = true;
  10227. break;
  10228. }
  10229.  
  10230. }
  10231. if(!flag && anInt1251 == 0)
  10232. try
  10233. {
  10234. aStream_834.currentOffset = 0;
  10235. stream.method442(j3, 0, aStream_834.buffer);
  10236. aStream_834.currentOffset = 0;
  10237. String s = TextInput.method525(j3, aStream_834);
  10238. //s = Censor.doCensor(s);
  10239. player.textSpoken = s;
  10240. player.anInt1513 = i1 >> 8;
  10241. player.privelage = myPrivilege;
  10242. player.anInt1531 = i1 & 0xff;
  10243. player.textCycle = 150;
  10244. if(myPrivilege == 0){
  10245. pushMessage(s, 2, "<col=13132800>"+getRank(player.skill)+"</col>" + player.name);
  10246. } else if(myPrivilege == 1){
  10247. pushMessage(s, 2, "@cr1@<col=13132800>"+getRank(player.skill)+"</col>" + player.name);
  10248. } else if(myPrivilege == 2 || myPrivilege == 3){
  10249. pushMessage(s, 2, "@cr2@<col=13132800>"+getRank(player.skill)+"</col>" + player.name);
  10250. } else if(myPrivilege == 4){
  10251. pushMessage(s, 2, "@cr3@<col=13132800>"+getRank(player.skill)+"</col>" + player.name);
  10252. }
  10253. else
  10254. pushMessage(myPlayer.textSpoken, 2,
  10255. myPlayer.name);
  10256. } catch(Exception exception) {
  10257. signlink.reporterror("cde2");
  10258. }
  10259. }
  10260. stream.currentOffset = k3 + j3;
  10261. }
  10262. if((i & 1) != 0)
  10263. {
  10264. player.interactingEntity = stream.method434();
  10265. if(player.interactingEntity == 65535)
  10266. player.interactingEntity = -1;
  10267. }
  10268. if((i & 0x10) != 0)
  10269. {
  10270. int j1 = stream.method427();
  10271. byte abyte0[] = new byte[j1];
  10272. Stream stream_1 = new Stream(abyte0);
  10273. stream.readBytes(j1, 0, abyte0);
  10274. aStreamArray895s[j] = stream_1;
  10275. player.updatePlayer(stream_1);
  10276. }
  10277. if((i & 2) != 0)
  10278. {
  10279. player.anInt1538 = stream.method436();
  10280. player.anInt1539 = stream.method434();
  10281. }
  10282.  
  10283. if((i & 0x20) != 0)
  10284. {
  10285. int damage = stream.readUnsignedByte();
  10286. int type = stream.method426();
  10287. int icon = stream.readUnsignedByte();
  10288. int focusPlayer = stream.readUnsignedByte();
  10289. player.updateHitData(type, damage, loopCycle, icon, focusPlayer, 0);
  10290. player.loopCycleStatus = loopCycle + 300;
  10291. player.currentHealth = stream.method427();
  10292. player.maxHealth = stream.readUnsignedByte();
  10293. }
  10294. if((i & 0x200) != 0)
  10295. {
  10296. int damage = stream.readUnsignedByte();
  10297. int type = stream.method428();
  10298. int icon = stream.readUnsignedByte();
  10299. int focusPlayer = stream.readUnsignedByte();
  10300. player.updateHitData(type, damage, loopCycle, icon, focusPlayer, 0);
  10301. player.loopCycleStatus = loopCycle + 300;
  10302. player.currentHealth = stream.readUnsignedByte();
  10303. player.maxHealth = stream.method427();
  10304. }
  10305. }
  10306.  
  10307. private void method108()
  10308. {
  10309. try
  10310. {
  10311. int j = myPlayer.x + anInt1278;
  10312. int k = myPlayer.y + anInt1131;
  10313. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  10314. {
  10315. anInt1014 = j;
  10316. anInt1015 = k;
  10317. }
  10318. if(anInt1014 != j)
  10319. anInt1014 += (j - anInt1014) / 16;
  10320. if(anInt1015 != k)
  10321. anInt1015 += (k - anInt1015) / 16;
  10322. if(super.keyArray[1] == 1)
  10323. anInt1186 += (-24 - anInt1186) / 2;
  10324. else
  10325. if(super.keyArray[2] == 1)
  10326. anInt1186 += (24 - anInt1186) / 2;
  10327. else
  10328. anInt1186 /= 2;
  10329. if(super.keyArray[3] == 1)
  10330. anInt1187 += (12 - anInt1187) / 2;
  10331. else
  10332. if(super.keyArray[4] == 1)
  10333. anInt1187 += (-12 - anInt1187) / 2;
  10334. else
  10335. anInt1187 /= 2;
  10336. compassRotation = compassRotation + anInt1186 / 2 & 0x7ff;
  10337. anInt1184 += anInt1187 / 2;
  10338. if(anInt1184 < 128)
  10339. anInt1184 = 128;
  10340. if(anInt1184 > 383)
  10341. anInt1184 = 383;
  10342. int l = anInt1014 >> 7;
  10343. int i1 = anInt1015 >> 7;
  10344. int j1 = method42(plane, anInt1015, anInt1014);
  10345. int k1 = 0;
  10346. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  10347. {
  10348. for(int l1 = l - 4; l1 <= l + 4; l1++)
  10349. {
  10350. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  10351. {
  10352. int l2 = plane;
  10353. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10354. l2++;
  10355. int i3 = j1 - intGroundArray[l2][l1][k2];
  10356. if(i3 > k1)
  10357. k1 = i3;
  10358. }
  10359.  
  10360. }
  10361.  
  10362. }
  10363. anInt1005++;
  10364. if(anInt1005 > 1512)
  10365. {
  10366. anInt1005 = 0;
  10367. stream.createFrame(77);
  10368. stream.writeWordBigEndian(0);
  10369. int i2 = stream.currentOffset;
  10370. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10371. stream.writeWordBigEndian(101);
  10372. stream.writeWordBigEndian(233);
  10373. stream.writeWord(45092);
  10374. if((int)(Math.random() * 2D) == 0)
  10375. stream.writeWord(35784);
  10376. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10377. stream.writeWordBigEndian(64);
  10378. stream.writeWordBigEndian(38);
  10379. stream.writeWord((int)(Math.random() * 65536D));
  10380. stream.writeWord((int)(Math.random() * 65536D));
  10381. stream.writeBytes(stream.currentOffset - i2);
  10382. }
  10383. int j2 = k1 * 192;
  10384. if(j2 > 0x17f00)
  10385. j2 = 0x17f00;
  10386. if(j2 < 32768)
  10387. j2 = 32768;
  10388. if(j2 > anInt984)
  10389. {
  10390. anInt984 += (j2 - anInt984) / 24;
  10391. return;
  10392. }
  10393. if(j2 < anInt984)
  10394. {
  10395. anInt984 += (j2 - anInt984) / 80;
  10396. }
  10397. }
  10398. catch(Exception _ex)
  10399. {
  10400. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  10401. throw new RuntimeException("eek");
  10402. }
  10403. }
  10404.  
  10405. public void processDrawing()
  10406. {
  10407. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  10408. {
  10409. showErrorScreen();
  10410. return;
  10411. }
  10412. anInt1061++;
  10413. if(!loggedIn)
  10414. drawLoginScreen(false);
  10415. else
  10416. drawGameScreen();
  10417. anInt1213 = 0;
  10418. }
  10419.  
  10420. private boolean isFriendOrSelf(String s)
  10421. {
  10422. if(s == null)
  10423. return false;
  10424. for(int i = 0; i < friendsCount; i++)
  10425. if(s.equalsIgnoreCase(friendsList[i]))
  10426. return true;
  10427. return s.equalsIgnoreCase(myPlayer.name);
  10428. }
  10429.  
  10430. private static String combatDiffColor(int i, int j)
  10431. {
  10432. int k = i - j;
  10433. if(k < -9)
  10434. return "@red@";
  10435. if(k < -6)
  10436. return "@or3@";
  10437. if(k < -3)
  10438. return "@or2@";
  10439. if(k < 0)
  10440. return "@or1@";
  10441. if(k > 9)
  10442. return "@gre@";
  10443. if(k > 6)
  10444. return "@gr3@";
  10445. if(k > 3)
  10446. return "@gr2@";
  10447. if(k > 0)
  10448. return "@gr1@";
  10449. else
  10450. return "@yel@";
  10451. }
  10452.  
  10453. private void setWaveVolume(int i)
  10454. {
  10455. signlink.wavevol = i;
  10456. }
  10457.  
  10458. private void draw3dScreen()
  10459. {
  10460. alertHandler.processAlerts();
  10461. drawSplitPrivateChat(0,getChatBackIncreaseY());
  10462. if(crossType == 1)
  10463. {
  10464. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10465. anInt1142++;
  10466. if(anInt1142 > 67)
  10467. {
  10468. anInt1142 = 0;
  10469. stream.createFrame(78);
  10470. }
  10471. }
  10472. if(crossType == 2)
  10473. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10474. if(walkableInterfaceID != -1) {
  10475. method119(anInt945, walkableInterfaceID);
  10476. if(walkableInterfaceID == 197 && toggleFullscreen)
  10477. drawInterface(0, 0 + getMapIncreaseX() , RSInterface.interfaceCache[walkableInterfaceID], 0 - 255 + 50 + getMapIncreaseY());
  10478. else
  10479. drawInterface(0, 0, RSInterface.interfaceCache[walkableInterfaceID], 0);
  10480. }
  10481. if(openInterfaceID != -1) {
  10482. method119(anInt945, openInterfaceID);
  10483. RSInterface rsInterface = RSInterface.interfaceCache[openInterfaceID];
  10484. int width = toggleFullscreen ? getScreenWidth() : 516;
  10485. int height = toggleFullscreen ? getScreenHeight() : 338;
  10486. if(toggleFullscreen)
  10487. drawInterface(0, 0 + (width - rsInterface.width) / 2, rsInterface, 0 + (height - rsInterface.height) / 2);
  10488. else
  10489. drawInterface(0, 0, rsInterface, 0);//first 1
  10490. }
  10491. method70();
  10492. if(displayOverLayIcon == 1)
  10493. multiOverlay.drawSprite(toggleFullscreen ? xPaddingmapBackImage + getMapIncreaseX() - 50 : 472, toggleFullscreen ? 1 : 296 + getMapIncreaseY());
  10494. if(openBOX)
  10495. {
  10496. openBOX = false;
  10497. donatorPayment = inputbox();
  10498. }
  10499. if(fpsOn)
  10500. {
  10501. char c = '\u01FB';
  10502. int k = 20;
  10503. int i1 = 0xffff00;
  10504. if(super.fps < 15)
  10505. i1 = 0xff0000;
  10506. normalFont.method380("Fps:" + super.fps, c, i1, k);
  10507. k += 15;
  10508. Runtime runtime = Runtime.getRuntime();
  10509. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10510. i1 = 0xffff00;
  10511. if(j1 > 0x2000000 && lowMem)
  10512. i1 = 0xff0000;
  10513. normalFont.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10514. k += 15;
  10515. }
  10516. int i1 = 0xffff00;
  10517. int x = baseX + (myPlayer.x - 6 >> 7);
  10518. int y = baseY + (myPlayer.y - 6 >> 7);
  10519. if (clientData)
  10520. {
  10521. char c = '\u01FB';
  10522. int k = 20;
  10523. if(super.fps < 15)
  10524. i1 = 0xff0000;
  10525. normalFont.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  10526. Runtime runtime = Runtime.getRuntime();
  10527. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10528. i1 = 0xffff00;
  10529. if(j1 > 0x2000000 && lowMem)
  10530. i1 = 0xff0000;
  10531. k += 15;
  10532. normalFont.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  10533. normalFont.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  10534. normalFont.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  10535. }
  10536. if(systemUpdatetime != 0)
  10537. {
  10538. int j = systemUpdatetime / 50;
  10539. int l = j / 60;
  10540. j %= 60;
  10541. if(j < 10)
  10542. normalFont.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  10543. else
  10544. normalFont.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  10545. anInt849++;
  10546. if(anInt849 > 75)
  10547. {
  10548. anInt849 = 0;
  10549. stream.createFrame(148);
  10550. }
  10551. }
  10552. if(openInterfaceID == 22595) {//
  10553. normalFont.method385(0xffffff, newPasswordString + ((loopCycle % 20 < 10) ? "|" : " "), (334-149)/2 + 70, (512-370- normalFont.getTextWidth(newPasswordString + " ") )/2 + 221);
  10554. }
  10555. if(counterOn)
  10556. drawCounterOnScreen(getMapIncreaseX(),getMapIncreaseY());
  10557. if(!contextMenuOpen) {
  10558. processRightClick();
  10559. drawTooltip();
  10560. } else
  10561. drawMenu(4,4);
  10562. }
  10563.  
  10564. private void addIgnore(long l)
  10565. {
  10566. try
  10567. {
  10568. if(l == 0L)
  10569. return;
  10570. if(ignoreCount >= 100)
  10571. {
  10572. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10573. return;
  10574. }
  10575. String s = TextClass.fixName(TextClass.nameForLong(l));
  10576. for(int j = 0; j < ignoreCount; j++)
  10577. if(ignoreListAsLongs[j] == l)
  10578. {
  10579. pushMessage(s + " is already on your ignore list", 0, "");
  10580. return;
  10581. }
  10582. for(int k = 0; k < friendsCount; k++)
  10583. if(friendsListAsLongs[k] == l)
  10584. {
  10585. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  10586. return;
  10587. }
  10588.  
  10589. ignoreListAsLongs[ignoreCount++] = l;
  10590. needDrawTabArea = true;
  10591. stream.createFrame(133);
  10592. stream.writeQWord(l);
  10593. return;
  10594. }
  10595. catch(RuntimeException runtimeexception)
  10596. {
  10597. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  10598. }
  10599. throw new RuntimeException();
  10600. }
  10601.  
  10602. private void method114()
  10603. {
  10604. for(int i = -1; i < playerCount; i++)
  10605. {
  10606. int j;
  10607. if(i == -1)
  10608. j = myPlayerIndex;
  10609. else
  10610. j = playerIndices[i];
  10611. Player player = playerArray[j];
  10612. if(player != null)
  10613. method96(player);
  10614. }
  10615.  
  10616. }
  10617.  
  10618. private void method115()
  10619. {
  10620. if(loadingStage == 2)
  10621. {
  10622. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10623. {
  10624. if(class30_sub1.anInt1294 > 0)
  10625. class30_sub1.anInt1294--;
  10626. if(class30_sub1.anInt1294 == 0)
  10627. {
  10628. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  10629. {
  10630. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  10631. class30_sub1.unlink();
  10632. }
  10633. } else
  10634. {
  10635. if(class30_sub1.anInt1302 > 0)
  10636. class30_sub1.anInt1302--;
  10637. 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)))
  10638. {
  10639. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  10640. class30_sub1.anInt1302 = -1;
  10641. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  10642. class30_sub1.unlink();
  10643. else
  10644. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10645. class30_sub1.unlink();
  10646. }
  10647. }
  10648. }
  10649.  
  10650. }
  10651. }
  10652.  
  10653.  
  10654. //stops the click from going over sprite - idiots wrong (sigex)
  10655. private void determineMenuSize() {
  10656. int i = boldFont.getTextWidth("Choose Option");
  10657. for(int j = 0; j < menuActionRow; j++)
  10658. {
  10659. int k = boldFont.getTextWidth(menuActionName[j]);
  10660. if(k > i)
  10661. i = k;
  10662. }
  10663. i += 8;
  10664. int l = 15 * menuActionRow + 21;
  10665. int paddingRight = 8;
  10666. int paddingBottom = 8;
  10667. int width = toggleFullscreen ? getScreenWidth() : 765;
  10668. int height = toggleFullscreen ? getScreenHeight() : 503;
  10669. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < width && super.saveClickY < height) {
  10670. int x = super.saveClickX - 0 - i / 2;
  10671. if(x < 0){
  10672. x = 0;
  10673. } else if(x + i > width - paddingRight)
  10674. x = width - paddingRight - i;
  10675. int y = super.saveClickY - 0;
  10676. if(y + l > width) {
  10677. y = width - l;
  10678. }
  10679. if(y < 0) {
  10680. y = 0;
  10681. } else if(y + l > height - paddingBottom)
  10682. y = height - paddingBottom - l;
  10683. if(l > height)
  10684. y = 0;
  10685. contextMenuOpen = true;
  10686. menuOffsetX = x;
  10687. menuOffsetY = y;
  10688. menuWidth = i;
  10689. menuHeight = 15 * menuActionRow + 22;
  10690. }
  10691. }
  10692.  
  10693. private void method117(Stream stream)
  10694. {
  10695. stream.initBitAccess();
  10696. int j = stream.readBits(1);
  10697. if(j == 0)
  10698. return;
  10699. int k = stream.readBits(2);
  10700. if(k == 0)
  10701. {
  10702. anIntArray894[anInt893++] = myPlayerIndex;
  10703. return;
  10704. }
  10705. if(k == 1)
  10706. {
  10707. int l = stream.readBits(3);
  10708. myPlayer.moveInDir(false, l);
  10709. int k1 = stream.readBits(1);
  10710. if(k1 == 1)
  10711. anIntArray894[anInt893++] = myPlayerIndex;
  10712. return;
  10713. }
  10714. if(k == 2)
  10715. {
  10716. int i1 = stream.readBits(3);
  10717. myPlayer.moveInDir(true, i1);
  10718. int l1 = stream.readBits(3);
  10719. myPlayer.moveInDir(true, l1);
  10720. int j2 = stream.readBits(1);
  10721. if(j2 == 1)
  10722. anIntArray894[anInt893++] = myPlayerIndex;
  10723. return;
  10724. }
  10725. if(k == 3)
  10726. {
  10727. plane = stream.readBits(2);
  10728. int j1 = stream.readBits(1);
  10729. int i2 = stream.readBits(1);
  10730. if(i2 == 1)
  10731. anIntArray894[anInt893++] = myPlayerIndex;
  10732. int k2 = stream.readBits(7);
  10733. int l2 = stream.readBits(7);
  10734. myPlayer.setPos(l2, k2, j1 == 1);
  10735. }
  10736. }
  10737.  
  10738. private void nullLoader()
  10739. {
  10740. aBoolean831 = false;
  10741. while(drawingFlames)
  10742. {
  10743. aBoolean831 = false;
  10744. try
  10745. {
  10746. Thread.sleep(50L);
  10747. }
  10748. catch(Exception _ex) { }
  10749. }
  10750. aBackground_966 = null;
  10751. aBackground_967 = null;
  10752. aBackgroundArray1152s = null;
  10753. anIntArray850 = null;
  10754. anIntArray851 = null;
  10755. anIntArray852 = null;
  10756. anIntArray853 = null;
  10757. anIntArray1190 = null;
  10758. anIntArray1191 = null;
  10759. anIntArray828 = null;
  10760. anIntArray829 = null;
  10761. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10762. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10763. }
  10764.  
  10765. private boolean method119(int i, int j)
  10766. {
  10767. boolean flag1 = false;
  10768. RSInterface class9 = RSInterface.interfaceCache[j];
  10769. if(class9 != null)
  10770. try {
  10771. for(int k = 0; k < class9.children.length; k++)
  10772. {
  10773. if(class9.children[k] == -1)
  10774. break;
  10775. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10776. if(class9_1.type == 1)
  10777. flag1 |= method119(i, class9_1.id);
  10778. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  10779. {
  10780. boolean flag2 = interfaceIsSelected(class9_1);
  10781. int l;
  10782. if(flag2)
  10783. l = class9_1.anInt258;
  10784. else
  10785. l = class9_1.anInt257;
  10786. if(l != -1)
  10787. {
  10788. Animation animation = Animation.anims[l];
  10789. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  10790. {
  10791. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  10792. class9_1.anInt246++;
  10793. if(class9_1.anInt246 >= animation.anInt352)
  10794. {
  10795. class9_1.anInt246 -= animation.anInt356;
  10796. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  10797. class9_1.anInt246 = 0;
  10798. }
  10799. flag1 = true;
  10800. }
  10801.  
  10802. }
  10803. }
  10804. }
  10805. return flag1;
  10806. } catch(NullPointerException ex) {
  10807. return flag1;
  10808. }
  10809. else
  10810. return flag1;
  10811. }
  10812.  
  10813. private int method120()
  10814. {
  10815. int j = 3;
  10816. if(yCameraCurve < 310)
  10817. {
  10818. int k = xCameraPos >> 7;
  10819. int l = yCameraPos >> 7;
  10820. int i1 = myPlayer.x >> 7;
  10821. int j1 = myPlayer.y >> 7;
  10822. if((byteGroundArray[plane][k][l] & 4) != 0)
  10823. j = plane;
  10824. int k1;
  10825. if(i1 > k)
  10826. k1 = i1 - k;
  10827. else
  10828. k1 = k - i1;
  10829. int l1;
  10830. if(j1 > l)
  10831. l1 = j1 - l;
  10832. else
  10833. l1 = l - j1;
  10834. if(k1 > l1)
  10835. {
  10836. int i2 = (l1 * 0x10000) / k1;
  10837. int k2 = 32768;
  10838. while(k != i1)
  10839. {
  10840. if(k < i1)
  10841. k++;
  10842. else
  10843. if(k > i1)
  10844. k--;
  10845. if((byteGroundArray[plane][k][l] & 4) != 0)
  10846. j = plane;
  10847. k2 += i2;
  10848. if(k2 >= 0x10000)
  10849. {
  10850. k2 -= 0x10000;
  10851. if(l < j1)
  10852. l++;
  10853. else
  10854. if(l > j1)
  10855. l--;
  10856. if((byteGroundArray[plane][k][l] & 4) != 0)
  10857. j = plane;
  10858. }
  10859. }
  10860. } else
  10861. {
  10862. int j2 = (k1 * 0x10000) / l1;
  10863. int l2 = 32768;
  10864. while(l != j1)
  10865. {
  10866. if(l < j1)
  10867. l++;
  10868. else
  10869. if(l > j1)
  10870. l--;
  10871. if((byteGroundArray[plane][k][l] & 4) != 0)
  10872. j = plane;
  10873. l2 += j2;
  10874. if(l2 >= 0x10000)
  10875. {
  10876. l2 -= 0x10000;
  10877. if(k < i1)
  10878. k++;
  10879. else
  10880. if(k > i1)
  10881. k--;
  10882. if((byteGroundArray[plane][k][l] & 4) != 0)
  10883. j = plane;
  10884. }
  10885. }
  10886. }
  10887. }
  10888. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10889. j = plane;
  10890. return j;
  10891. }
  10892.  
  10893. private int method121()
  10894. {
  10895. int j = method42(plane, yCameraPos, xCameraPos);
  10896. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10897. return plane;
  10898. else
  10899. return 3;
  10900. }
  10901.  
  10902. private void delIgnore(long l)
  10903. {
  10904. try
  10905. {
  10906. if(l == 0L)
  10907. return;
  10908. for(int j = 0; j < ignoreCount; j++)
  10909. if(ignoreListAsLongs[j] == l)
  10910. {
  10911. ignoreCount--;
  10912. needDrawTabArea = true;
  10913. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10914.  
  10915. stream.createFrame(74);
  10916. stream.writeQWord(l);
  10917. return;
  10918. }
  10919.  
  10920. return;
  10921. }
  10922. catch(RuntimeException runtimeexception)
  10923. {
  10924. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10925. }
  10926. throw new RuntimeException();
  10927. }
  10928.  
  10929.  
  10930. private void chatJoin(long l) {
  10931. try {
  10932. if(l == 0L)
  10933. return;
  10934. stream.createFrame(60);
  10935. stream.writeQWord(l);
  10936. return;
  10937. }
  10938. catch(RuntimeException runtimeexception)
  10939. {
  10940. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10941. }
  10942. throw new RuntimeException();
  10943.  
  10944. }
  10945.  
  10946. public String getParameter(String s)
  10947. {
  10948. if(signlink.mainapp != null)
  10949. return signlink.mainapp.getParameter(s);
  10950. else
  10951. return super.getParameter(s);
  10952. }
  10953.  
  10954. private void adjustVolume(boolean flag, int i)
  10955. {
  10956. signlink.midivol = i;
  10957. if(flag)
  10958. signlink.midi = "voladjust";
  10959. }
  10960.  
  10961. private int extractInterfaceValues(RSInterface class9, int j)
  10962. {
  10963. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10964. return -2;
  10965. try
  10966. {
  10967. int ai[] = class9.valueIndexArray[j];
  10968. int k = 0;
  10969. int l = 0;
  10970. int i1 = 0;
  10971. do
  10972. {
  10973. int j1 = ai[l++];
  10974. int k1 = 0;
  10975. byte byte0 = 0;
  10976. if(j1 == 0)
  10977. return k;
  10978. if(j1 == 1)
  10979. k1 = currentStats[ai[l++]];
  10980. if(j1 == 2)
  10981. k1 = maxStats[ai[l++]];
  10982. if(j1 == 3)
  10983. k1 = currentExp[ai[l++]];
  10984. if(j1 == 4)
  10985. {
  10986. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10987. int k2 = ai[l++];
  10988. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  10989. {
  10990. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  10991. if(class9_1.inv[j3] == k2 + 1)
  10992. k1 += class9_1.invStackSizes[j3];
  10993.  
  10994. }
  10995. }
  10996. if(j1 == 5)
  10997. k1 = variousSettings[ai[l++]];
  10998. if(j1 == 6)
  10999. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  11000. if(j1 == 7)
  11001. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11002. if(j1 == 8)
  11003. k1 = myPlayer.combatLevel;
  11004. if(j1 == 9)
  11005. {
  11006. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  11007. if(Skills.skillEnabled[l1])
  11008. k1 += maxStats[l1];
  11009.  
  11010. }
  11011. if(j1 == 10)
  11012. {
  11013. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11014. int l2 = ai[l++] + 1;
  11015. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  11016. {
  11017. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  11018. {
  11019. if(class9_2.inv[k3] != l2)
  11020. continue;
  11021. k1 = 0x3b9ac9ff;
  11022. break;
  11023. }
  11024.  
  11025. }
  11026. }
  11027. if(j1 == 11)
  11028. k1 = energy;
  11029. if(j1 == 12)
  11030. k1 = weight;
  11031. if(j1 == 13)
  11032. {
  11033. int i2 = variousSettings[ai[l++]];
  11034. int i3 = ai[l++];
  11035. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11036. }
  11037. if(j1 == 14)
  11038. {
  11039. int j2 = ai[l++];
  11040. VarBit varBit = VarBit.cache[j2];
  11041. int l3 = varBit.anInt648;
  11042. int i4 = varBit.anInt649;
  11043. int j4 = varBit.anInt650;
  11044. int k4 = anIntArray1232[j4 - i4];
  11045. k1 = variousSettings[l3] >> i4 & k4;
  11046. }
  11047. if(j1 == 15)
  11048. byte0 = 1;
  11049. if(j1 == 16)
  11050. byte0 = 2;
  11051. if(j1 == 17)
  11052. byte0 = 3;
  11053. if(j1 == 18)
  11054. k1 = (myPlayer.x >> 7) + baseX;
  11055. if(j1 == 19)
  11056. k1 = (myPlayer.y >> 7) + baseY;
  11057. if(j1 == 20)
  11058. k1 = ai[l++];
  11059. if(byte0 == 0)
  11060. {
  11061. if(i1 == 0)
  11062. k += k1;
  11063. if(i1 == 1)
  11064. k -= k1;
  11065. if(i1 == 2 && k1 != 0)
  11066. k /= k1;
  11067. if(i1 == 3)
  11068. k *= k1;
  11069. i1 = 0;
  11070. } else
  11071. {
  11072. i1 = byte0;
  11073. }
  11074. } while(true);
  11075. }
  11076. catch(Exception _ex)
  11077. {
  11078. return -1;
  11079. }
  11080. }
  11081.  
  11082. private void drawTooltip() {
  11083. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11084. return;
  11085. String s;
  11086. if(itemSelected == 1 && menuActionRow < 2)
  11087. s = "Use " + selectedItemName + " with...";
  11088. else if(spellSelected == 1 && menuActionRow < 2)
  11089. s = spellTooltip + "...";
  11090. else
  11091. s = menuActionName[menuActionRow - 1];
  11092. if(menuActionRow > 2)
  11093. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11094. boldFont.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11095. }
  11096.  
  11097. public Sprite[] backingOrb = new Sprite[4];
  11098. public Sprite[] genericOrbs = new Sprite[7];
  11099. public Sprite[] healthOrbs = new Sprite[3];
  11100. public Sprite[] prayerOrbs = new Sprite[3];
  11101. public Sprite[] energyOrbs = new Sprite[7];
  11102. public Sprite[] summoningOrbs = new Sprite[4];
  11103. public boolean[] orbToggle = new boolean[4];
  11104. private int orbHover = -1, lastOrbID = -1;
  11105. private double[] lastOrbAmount = new double[4];
  11106. public void loadOrbs() {
  11107.  
  11108. for(int i = 0; i < genericOrbs.length; i++)
  11109. genericOrbs[i] = new Sprite("Minimap Orbs/orb " + i);
  11110.  
  11111. for(int i = 0; i < healthOrbs.length; i++)
  11112. healthOrbs[i] = new Sprite("Minimap Orbs/health/orb " + i);
  11113.  
  11114. for(int i = 0; i < prayerOrbs.length; i++)
  11115. prayerOrbs[i] = new Sprite("Minimap Orbs/prayer/orb " + i);
  11116.  
  11117. for(int i = 0; i < energyOrbs.length; i++)
  11118. energyOrbs[i] = new Sprite("Minimap Orbs/energy/orb " + i);
  11119.  
  11120. for(int i = 0; i < summoningOrbs.length; i++)
  11121. summoningOrbs[i] = new Sprite("Minimap Orbs/summoning/orb " + i);
  11122.  
  11123. }
  11124.  
  11125. private void drawOrbs(int paddingX, int paddingY) {
  11126. createOrbs((toggleFullscreen ? -44 : 145) + mapMovedX + paddingX,(toggleFullscreen ? 38 : 10) + mapMovedY + paddingY,0, healthOrbs);
  11127. createOrbs((toggleFullscreen ? -47 : 161) + mapMovedX + paddingX,(toggleFullscreen ? 72 : 49) + mapMovedY + paddingY,1, prayerOrbs);
  11128. createOrbs((toggleFullscreen ? -35 : 161) + mapMovedX + paddingX,(toggleFullscreen ? 106 : 88) + mapMovedY + paddingY,2, energyOrbs);
  11129. // SUMMONING ORB CAUSES CRASH
  11130. createOrbs((toggleFullscreen ? -12 : 145) + mapMovedX + paddingX,(toggleFullscreen ? 135 : 127) + mapMovedY + paddingY,3, summoningOrbs); // - this is summ show me your actual orb? in cache or wut, no th whole method
  11131. }
  11132.  
  11133. private void createOrbs(int xdraw, int ydraw, int orbID, Sprite[] orbSprites) { // this creates the orb
  11134. int orbIconID = ((orbToggle[orbID] && orbID == 2) || (orbID == 3 && summoningAttack)) ? 3 : 0;
  11135. int current = getOrbValues(orbID,orbSprites[orbIconID])[0];
  11136. int total = getOrbValues(orbID,orbSprites[orbIconID])[1];
  11137. double percentage = (current * 100 / total);
  11138. double pixelPercent = 27 - (percentage * 27 / 100);
  11139. int backingSprite = (orbID == 0) ? ((orbToggle[0]) ? 4 : 3) : 2;
  11140. int textColour = getOrbTextColor(percentage);
  11141.  
  11142. if(orbToggle[orbID] && getOrbValues(orbID,null)[0] <= 0)
  11143. orbToggle[orbID] = false;
  11144.  
  11145. genericOrbs[(orbHover == orbID ? 1 : 0) + (toggleFullscreen ? 5: 0)].drawSprite(xdraw, ydraw);
  11146. smallFont.method382(textColour, xdraw + (toggleFullscreen ? 13 : 41), "" + current, ydraw + 26, true);
  11147.  
  11148. if((percentage != lastOrbAmount[orbID])) {
  11149. backingOrb[orbID] = new Sprite("Minimap Orbs/orb " + backingSprite, genericOrbs[backingSprite].myWidth,(int)pixelPercent);
  11150. lastOrbAmount[orbID] = percentage;
  11151. }
  11152. orbSprites[orbToggle[orbID] ? 2 : 1].drawSprite((toggleFullscreen ? 24 : 0) +xdraw + 3, ydraw + 3);
  11153. if(backingOrb[orbID] != null)
  11154. backingOrb[orbID].drawSprite((toggleFullscreen ? 24 : 0) +xdraw + 3, ydraw + 3);
  11155. orbSprites[orbIconID].drawSprite1((toggleFullscreen ? 24 : 0) +xdraw, ydraw,(textColour == 0xff0000 && current != 0) ? ((loopCycle % 40 < 20) ? (64 + (loopCycle % 128)) : 0) : (256));
  11156. }
  11157.  
  11158. private int[] getOrbValues(int type, Sprite orbSprite) {
  11159. int[] values = new int[2];
  11160. int offsetX = 0, offsetY = 0;
  11161. switch(type) {
  11162. case 0://Health
  11163. values[0] = Integer.parseInt(RSInterface.interfaceCache[4016].message);
  11164. values[1] = Integer.parseInt(RSInterface.interfaceCache[4017].message.replaceAll("%", ""));
  11165. offsetX = 9;
  11166. offsetY = 10;
  11167. break;
  11168.  
  11169. case 1://Prayer
  11170. values[0] = Integer.parseInt(RSInterface.interfaceCache[4012].message);
  11171. values[1] = Integer.parseInt(RSInterface.interfaceCache[4013].message.replaceAll("%", ""));
  11172. offsetX = 7;
  11173. offsetY = 7;
  11174. break;
  11175.  
  11176. case 2://Energy
  11177. values[0] = Integer.parseInt(RSInterface.interfaceCache[149].message.replaceAll("%", ""));
  11178. values[1] = 100;
  11179. offsetX = 10;
  11180. offsetY = 8;
  11181. break;
  11182. case 3://Summoning
  11183. values[0] = Integer.parseInt(RSInterface.interfaceCache[19178].message);; // 29800
  11184. values[1] = Integer.parseInt(RSInterface.interfaceCache[19179].message);; //29801
  11185. offsetX = 7;
  11186. offsetY = 7;
  11187. break;
  11188.  
  11189. default:
  11190. return null;
  11191. }
  11192. try {
  11193. if(offsetX > 0 && offsetY > 0) {
  11194. orbSprite.configXDrawOffset(offsetX);
  11195. orbSprite.configYDrawOffset(offsetY);
  11196. }
  11197. } catch(NullPointerException ex) {
  11198.  
  11199. }
  11200. return values;
  11201. }
  11202.  
  11203. public int getOrbTextColor(double percentage) {
  11204. if(percentage >= 75)
  11205. return 65280;
  11206. if(percentage >= 50 && percentage <= 74)
  11207. return 0xffff00;
  11208. return (percentage < 25 || percentage > 49) ? 0xff0000 : 0xff981f;
  11209. }
  11210.  
  11211. private void drawMinimap(RSImageProducer mapImage, int paddingX, int paddingY) {
  11212. mapImage.initDrawingArea();
  11213.  
  11214. int mapRotation = compassRotation + mapAmtDiffRotation & 2047;
  11215. int mapCenterX = 48 + myPlayer.x / 32;
  11216. int mapCenterY = 464 - myPlayer.y / 32;
  11217.  
  11218. switch(minimapCover) {
  11219. case 2:
  11220. compass.drawRotatableSprite(33, compassRotation, compassPixelCutRight, 256, compassPixelCutLeft, 25, (toggleFullscreen ? 9 : 8) + paddingY, (toggleFullscreen ? 30 : 11) + paddingX, 33, 25);
  11221. main3DArea.initDrawingArea();
  11222. return;
  11223. }
  11224. miniMapImage.drawRotatableSprite(mapInnerSizeHeight, mapRotation, mapImagePixelCutRight, 256 + mapAmtDiffZoom, mapImagePixelCutLeft, mapCenterY, mapPaddingFromTop + paddingY, mapPaddingFromLeft + paddingX, mapInnerSizeWidth, mapCenterX);
  11225. for(int loopIndex = 0; loopIndex < totalMapFunctions; loopIndex++) {
  11226. int x = (mapFunctionX[loopIndex] * 4 + 2) - myPlayer.x / 32;
  11227. int y = (mapFunctionY[loopIndex] * 4 + 2) - myPlayer.y / 32;
  11228. drawMapSprites(currentMapFunctions[loopIndex], x, y);
  11229. }
  11230. for(int loopXIndex = 0; loopXIndex < 104; loopXIndex++) {
  11231. for(int loopYIndex = 0; loopYIndex < 104; loopYIndex++) {
  11232. NodeList nodeList = groundArray[plane][loopXIndex][loopYIndex];
  11233. if(nodeList != null) {
  11234. int x = (loopXIndex * 4 + 2) - myPlayer.x / 32;
  11235. int y = (loopYIndex * 4 + 2) - myPlayer.y / 32;
  11236. drawMapSprites(mapDotItem, x, y);
  11237. }
  11238. }
  11239. }
  11240. for(int loopIndex = 0; loopIndex < npcCount; loopIndex++) {
  11241. NPC npc = npcArray[npcIndices[loopIndex]];
  11242. if(npc != null && npc.isVisible()) {
  11243. EntityDef entityDef = npc.desc;
  11244. if(entityDef.childrenIDs != null)
  11245. entityDef = entityDef.method161();
  11246. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  11247. int x = npc.x / 32 - myPlayer.x / 32;
  11248. int y = npc.y / 32 - myPlayer.y / 32;
  11249. drawMapSprites(mapDotNPC, x, y);
  11250. }
  11251. }
  11252. }
  11253. for(int playerIndex = 0; playerIndex < playerCount; playerIndex++) {
  11254. Player player = playerArray[playerIndices[playerIndex]];
  11255. if(player != null && player.isVisible()) {
  11256. int x = player.x / 32 - myPlayer.x / 32;
  11257. int y = player.y / 32 - myPlayer.y / 32;
  11258. boolean isInFriends = false;
  11259. boolean isInClan = false;
  11260. for (int clanIndex = 0; clanIndex < clanList.length; clanIndex++) {
  11261. if (clanList[clanIndex] == null)
  11262. continue;
  11263. if (!clanList[clanIndex].equalsIgnoreCase(player.name))
  11264. continue;
  11265. isInClan = true;
  11266. break;
  11267. }
  11268. long playerNameLong = TextClass.longForName(player.name);
  11269. for(int friendIndex = 0; friendIndex < friendsCount; friendIndex++) {
  11270. if(playerNameLong != friendsListAsLongs[friendIndex] || friendsNodeIDs[friendIndex] == 0)
  11271. continue;
  11272. isInFriends = true;
  11273. break;
  11274. }
  11275. boolean isInTeam = false;
  11276. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  11277. isInTeam = true;
  11278. if(isInFriends)
  11279. drawMapSprites(mapDotFriend, x, y);
  11280. else if(isInClan)
  11281. drawMapSprites(mapDotClan, x, y);
  11282. else if(isInTeam)
  11283. drawMapSprites(mapDotTeam, x, y);
  11284. else
  11285. drawMapSprites(mapDotPlayer, x, y);
  11286. }
  11287. }
  11288. if(hintType != 0 && loopCycle % 20 < 10) {
  11289. if(hintType == 1 && hintArrowNPCID >= 0 && hintArrowNPCID < npcArray.length) {
  11290. NPC npc = npcArray[hintArrowNPCID];
  11291. if(npc != null) {
  11292. int cordX = npc.x / 32 - myPlayer.x / 32;
  11293. int cordY = npc.y / 32 - myPlayer.y / 32;
  11294. drawMapArrows(mapMarker, cordY, cordX);
  11295. }
  11296. }
  11297. if(hintType == 2) {
  11298. int cordX = ((hintArrowX - baseX) * 4 + 2) - myPlayer.x / 32;
  11299. int cordY = ((hintArrowY - baseY) * 4 + 2) - myPlayer.y / 32;
  11300. drawMapArrows(mapMarker, cordY, cordX);
  11301. }
  11302. if(hintType == 10 && hintArrowPlayerID >= 0 && hintArrowPlayerID < playerArray.length) {
  11303. Player player = playerArray[hintArrowPlayerID];
  11304. if(player != null) {
  11305. int cordX = player.x / 32 - myPlayer.x / 32;
  11306. int cordY = player.y / 32 - myPlayer.y / 32;
  11307. drawMapArrows(mapMarker, cordY, cordX);
  11308. }
  11309. }
  11310. }
  11311. if(destX != 0) {
  11312. int walkingToX = (destX * 4 + 2) - myPlayer.x / 32;
  11313. int walkingToY = (destY * 4 + 2) - myPlayer.y / 32;
  11314. drawMapSprites(mapFlag, walkingToX, walkingToY);
  11315. }
  11316. if(!toggleFullscreen)
  11317. mapBack[0].drawBackground(paddingX, paddingY);
  11318. else {
  11319. mapBack[3].drawBackground(30 + paddingX, 4 + paddingY);
  11320. mapBack[4].drawBackground(25 + paddingX, 4 + paddingY);
  11321. mapBack[4].drawBackground(150 + paddingX, 133 + paddingY);
  11322. }
  11323. compass.drawRotatableSprite(33, compassRotation, compassPixelCutRight, 256, compassPixelCutLeft, 25, (toggleFullscreen ? 9 : 8) + paddingY, (toggleFullscreen ? 30 : 11) + paddingX, 33, 25);
  11324. drawOrbs(paddingX,paddingY);
  11325. drawCoinOrb();
  11326. advisorButton[advisorHover].drawSprite((toggleFullscreen ? 207-52 : 207) + paddingX,(toggleFullscreen ? 4 : 0) + paddingY);
  11327. drawXPCounter(paddingX,paddingY);
  11328. if(tabInterfaceIDs[10] != -1 && invOverlayInterfaceID == -1)
  11329. exitButton[exitHover].drawSprite((toggleFullscreen ? 228-52 : 228) + paddingX,(toggleFullscreen ? 4 : 0) + paddingY);
  11330. worldMapIcon[mapHover].drawSprite((toggleFullscreen ? 154 : 10) + paddingX,(toggleFullscreen ? 138 : 124) + paddingY);
  11331.  
  11332. DrawingArea.drawPixels(3, 76 + mapPaddingFromTop + paddingY, 76 + mapPaddingFromLeft + paddingX, 0xffffff, 3);
  11333. if(contextMenuOpen && !toggleFullscreen)
  11334. drawMenu(516, 0);
  11335. main3DArea.initDrawingArea();
  11336. }
  11337.  
  11338.  
  11339.  
  11340. private void npcScreenPos(Entity entity, int i) {
  11341. calcEntityScreenPos(entity.x, i, entity.y);
  11342. }
  11343.  
  11344. private void calcEntityScreenPos(int i, int j, int l) {
  11345. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  11346. spriteDrawX = -1;
  11347. spriteDrawY = -1;
  11348. return;
  11349. }
  11350. int i1 = method42(plane, l, i) - j;
  11351. i -= xCameraPos;
  11352. i1 -= zCameraPos;
  11353. l -= yCameraPos;
  11354. int j1 = Model.modelIntArray1[yCameraCurve];
  11355. int k1 = Model.modelIntArray2[yCameraCurve];
  11356. int l1 = Model.modelIntArray1[xCameraCurve];
  11357. int i2 = Model.modelIntArray2[xCameraCurve];
  11358. int j2 = l * l1 + i * i2 >> 16;
  11359. l = l * i2 - i * l1 >> 16;
  11360. i = j2;
  11361. j2 = i1 * k1 - l * j1 >> 16;
  11362. l = i1 * j1 + l * k1 >> 16;
  11363. i1 = j2;
  11364. if(l >= 50) {
  11365. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  11366. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  11367. } else {
  11368. spriteDrawX = -1;
  11369. spriteDrawY = -1;
  11370. }
  11371. }
  11372.  
  11373. private void buildSplitPrivateChatMenu(int paddingX, int paddingY)
  11374. {
  11375. if(splitPrivateChat == 0)
  11376. return;
  11377. int drawLineY = 0;
  11378. if(systemUpdatetime != 0)
  11379. drawLineY = 1;
  11380. for(int indexLine = 0; indexLine < 100; indexLine++)
  11381. {
  11382. if(chatMessages[indexLine] == null)
  11383. continue;
  11384. int type = chatTypes[indexLine];
  11385. String name = chatNames[indexLine];
  11386. boolean flag = false;
  11387. if(name != null && name.startsWith("@cr"))
  11388. name = name.substring(5);
  11389.  
  11390. if((type == 3 || type == 7) && (type == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(name)))
  11391. {
  11392. int l = (329 - drawLineY * 13) - paddingY;
  11393. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11394. {
  11395. int textWidth = normalFont.getTextWidth("From: " + name + chatMessages[indexLine]) + 25;
  11396. if(textWidth > 450)
  11397. textWidth = 450;
  11398. if(super.mouseX < 4 + textWidth)
  11399. {
  11400. if(myPrivilege >= 1)
  11401. {
  11402. menuActionName[menuActionRow] = "Staff Pannel @whi@" + name;
  11403. menuActionID[menuActionRow] = 606;
  11404. menuActionRow++;
  11405. }
  11406. menuActionName[menuActionRow] = "Add ignore @whi@" + name;
  11407. menuActionID[menuActionRow] = 2042;
  11408. menuActionRow++;
  11409. menuActionName[menuActionRow] = "Add friend @whi@" + name;
  11410. menuActionID[menuActionRow] = 2337;
  11411. menuActionRow++;
  11412. menuActionName[menuActionRow] = "Message @whi@" + name;
  11413. menuActionID[menuActionRow] = 639;
  11414. menuActionRow++;
  11415. }
  11416. }
  11417. if(++drawLineY >= 5)
  11418. return;
  11419. }
  11420. if((type == 5 || type == 6) && privateChatMode < 2 && ++drawLineY >= 5)
  11421. return;
  11422. }
  11423.  
  11424. }
  11425.  
  11426. private void method130(int j, int k, int l, int i1, int j1, int k1,
  11427. int l1, int i2, int j2)
  11428. {
  11429. Class30_Sub1 class30_sub1 = null;
  11430. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11431. {
  11432. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  11433. continue;
  11434. class30_sub1 = class30_sub1_1;
  11435. break;
  11436. }
  11437.  
  11438. if(class30_sub1 == null)
  11439. {
  11440. class30_sub1 = new Class30_Sub1();
  11441. class30_sub1.anInt1295 = l1;
  11442. class30_sub1.anInt1296 = i1;
  11443. class30_sub1.anInt1297 = i2;
  11444. class30_sub1.anInt1298 = j1;
  11445. method89(class30_sub1);
  11446. aClass19_1179.insertHead(class30_sub1);
  11447. }
  11448. class30_sub1.anInt1291 = k;
  11449. class30_sub1.anInt1293 = k1;
  11450. class30_sub1.anInt1292 = l;
  11451. class30_sub1.anInt1302 = j2;
  11452. class30_sub1.anInt1294 = j;
  11453. }
  11454.  
  11455. private boolean interfaceIsSelected(RSInterface class9)
  11456. {
  11457. if(class9.valueCompareType == null)
  11458. return false;
  11459. for(int i = 0; i < class9.valueCompareType.length; i++)
  11460. {
  11461. int j = extractInterfaceValues(class9, i);
  11462. int k = class9.requiredValues[i];
  11463. if(class9.valueCompareType[i] == 2)
  11464. {
  11465. if(j >= k)
  11466. return false;
  11467. } else
  11468. if(class9.valueCompareType[i] == 3)
  11469. {
  11470. if(j <= k)
  11471. return false;
  11472. } else
  11473. if(class9.valueCompareType[i] == 4)
  11474. {
  11475. if(j == k)
  11476. return false;
  11477. } else
  11478. if(j != k)
  11479. return false;
  11480. }
  11481.  
  11482. return true;
  11483. }
  11484.  
  11485. private DataInputStream openJagGrabInputStream(String s)
  11486. throws IOException
  11487. {
  11488. // if(!aBoolean872)
  11489. // if(signlink.mainapp != null)
  11490. // return signlink.openurl(s);
  11491. // else
  11492. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11493. if(aSocket832 != null)
  11494. {
  11495. try
  11496. {
  11497. aSocket832.close();
  11498. }
  11499. catch(Exception _ex) { }
  11500. aSocket832 = null;
  11501. }
  11502. aSocket832 = openSocket(43594);
  11503. aSocket832.setSoTimeout(10000);
  11504. java.io.InputStream inputstream = aSocket832.getInputStream();
  11505. OutputStream outputstream = aSocket832.getOutputStream();
  11506. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11507. return new DataInputStream(inputstream);
  11508. }
  11509.  
  11510. private void doFlamesDrawing()
  11511. {
  11512. char c = '\u0100';
  11513. if(anInt1040 > 0)
  11514. {
  11515. for(int i = 0; i < 256; i++)
  11516. if(anInt1040 > 768)
  11517. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  11518. else
  11519. if(anInt1040 > 256)
  11520. anIntArray850[i] = anIntArray852[i];
  11521. else
  11522. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  11523.  
  11524. } else
  11525. if(anInt1041 > 0)
  11526. {
  11527. for(int j = 0; j < 256; j++)
  11528. if(anInt1041 > 768)
  11529. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  11530. else
  11531. if(anInt1041 > 256)
  11532. anIntArray850[j] = anIntArray853[j];
  11533. else
  11534. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  11535.  
  11536. } else
  11537. {
  11538. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11539.  
  11540. }
  11541. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  11542.  
  11543. int i1 = 0;
  11544. int j1 = 1152;
  11545. for(int k1 = 1; k1 < c - 1; k1++)
  11546. {
  11547. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11548. int j2 = 22 + l1;
  11549. if(j2 < 0)
  11550. j2 = 0;
  11551. i1 += j2;
  11552. for(int l2 = j2; l2 < 128; l2++)
  11553. {
  11554. int j3 = anIntArray828[i1++];
  11555. if(j3 != 0)
  11556. {
  11557. int l3 = j3;
  11558. int j4 = 256 - j3;
  11559. j3 = anIntArray850[j3];
  11560. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  11561. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11562. } else
  11563. {
  11564. j1++;
  11565. }
  11566. }
  11567.  
  11568. j1 += j2;
  11569. }
  11570.  
  11571. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  11572. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  11573.  
  11574. i1 = 0;
  11575. j1 = 1176;
  11576. for(int k2 = 1; k2 < c - 1; k2++)
  11577. {
  11578. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11579. int k3 = 103 - i3;
  11580. j1 += i3;
  11581. for(int i4 = 0; i4 < k3; i4++)
  11582. {
  11583. int k4 = anIntArray828[i1++];
  11584. if(k4 != 0)
  11585. {
  11586. int i5 = k4;
  11587. int j5 = 256 - k4;
  11588. k4 = anIntArray850[k4];
  11589. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  11590. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11591. } else
  11592. {
  11593. j1++;
  11594. }
  11595. }
  11596.  
  11597. i1 += 128 - k3;
  11598. j1 += 128 - k3 - i3;
  11599. }
  11600.  
  11601. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11602. }
  11603.  
  11604. private void method134(Stream stream)
  11605. {
  11606. int j = stream.readBits(8);
  11607. if(j < playerCount)
  11608. {
  11609. for(int k = j; k < playerCount; k++)
  11610. anIntArray840[anInt839++] = playerIndices[k];
  11611.  
  11612. }
  11613. if(j > playerCount)
  11614. {
  11615. signlink.reporterror(myUsername + " Too many players");
  11616. throw new RuntimeException("eek");
  11617. }
  11618. playerCount = 0;
  11619. for(int l = 0; l < j; l++)
  11620. {
  11621. int i1 = playerIndices[l];
  11622. Player player = playerArray[i1];
  11623. int j1 = stream.readBits(1);
  11624. if(j1 == 0)
  11625. {
  11626. playerIndices[playerCount++] = i1;
  11627. player.anInt1537 = loopCycle;
  11628. } else
  11629. {
  11630. int k1 = stream.readBits(2);
  11631. if(k1 == 0)
  11632. {
  11633. playerIndices[playerCount++] = i1;
  11634. player.anInt1537 = loopCycle;
  11635. anIntArray894[anInt893++] = i1;
  11636. } else
  11637. if(k1 == 1)
  11638. {
  11639. playerIndices[playerCount++] = i1;
  11640. player.anInt1537 = loopCycle;
  11641. int l1 = stream.readBits(3);
  11642. player.moveInDir(false, l1);
  11643. int j2 = stream.readBits(1);
  11644. if(j2 == 1)
  11645. anIntArray894[anInt893++] = i1;
  11646. } else
  11647. if(k1 == 2)
  11648. {
  11649. playerIndices[playerCount++] = i1;
  11650. player.anInt1537 = loopCycle;
  11651. int i2 = stream.readBits(3);
  11652. player.moveInDir(true, i2);
  11653. int k2 = stream.readBits(3);
  11654. player.moveInDir(true, k2);
  11655. int l2 = stream.readBits(1);
  11656. if(l2 == 1)
  11657. anIntArray894[anInt893++] = i1;
  11658. } else
  11659. if(k1 == 3)
  11660. anIntArray840[anInt839++] = i1;
  11661. }
  11662. }
  11663. }
  11664.  
  11665. public int world = 1;
  11666. public String spec = "@red@Normal World";
  11667. private void drawLoginScreen(boolean flag) {
  11668. resetImageProducers();
  11669. aRSImageProducer_1109.initDrawingArea();
  11670. int x = 49;
  11671. loginBox.drawSprite(0 + x, 0);
  11672. char c = '\u0168';
  11673. char c1 = '\310';
  11674. int l = c / 2 - 80;
  11675. int k1 = c1 / 2 + 20;
  11676.  
  11677. boldFont.method382(0xffff00, 130 + x, "@whi@World: @red@" + spec,k1 + 22, true);
  11678. if (loginScreenState == 0) {
  11679. if (screenHover[0]) {
  11680. loginBoxHover.drawSprite(22 + x, 58);
  11681. }
  11682. if (screenHover[1]) {
  11683. loginBoxHover.drawSprite(l - 78 + x, k1 - 16);
  11684. }
  11685. if (screenHover[2]) {
  11686. loginHover.drawSprite(l - 78 + x, k1 + 42);
  11687. }
  11688. if (screenHover[3]) {
  11689. loginHoverWorld.drawSprite(l + 116 + x, k1 + 42);
  11690. }
  11691. boldFont.method382(0xffff00, 132 + x, loginMessage1,
  11692. k1 + 41 + 40, true);
  11693. boldFont.method382(0xffff00, 132 + x, loginMessage2,
  11694. k1 + 41 + 55
  11695. , true);
  11696. if (loginScreenCursorPos != 0 && loginScreenCursorPos != 1)
  11697. loginScreenCursorPos = 0;
  11698. int j = c1 / 2 - 23;
  11699. boldFont.method389(true, c / 2 - 154 + x, 0xffffff, ""
  11700. + myUsername
  11701. + ((loginScreenCursorPos == 0)
  11702. & (loopCycle % 40 < 20) ? "@whi@|" : ""), j);
  11703. j += 47;
  11704. boldFont.method389(true, c / 2 - 154 + x, 0xffffff,
  11705. ""
  11706. + TextClass.passwordAsterisks(myPassword)
  11707. + ((loginScreenCursorPos == 1)
  11708. & (loopCycle % 40 < 20) ? "@whi@|"
  11709. : ""), j);
  11710. }
  11711. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  11712. if (welcomeScreenRaised) {
  11713. welcomeScreenRaised = false;
  11714. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  11715. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11716. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  11717. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  11718. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  11719. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  11720. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  11721. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  11722. }
  11723. }
  11724.  
  11725. private void drawFlames()
  11726. {
  11727. }
  11728.  
  11729. public void raiseWelcomeScreen() {
  11730. welcomeScreenRaised = true;
  11731. }
  11732.  
  11733. private void method137(Stream stream, int j)
  11734. {
  11735. if(j == 84)
  11736. {
  11737. int k = stream.readUnsignedByte();
  11738. int j3 = anInt1268 + (k >> 4 & 7);
  11739. int i6 = anInt1269 + (k & 7);
  11740. int l8 = stream.readUnsignedWord();
  11741. int k11 = stream.readUnsignedWord();
  11742. int l13 = stream.readUnsignedWord();
  11743. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  11744. {
  11745. NodeList class19_1 = groundArray[plane][j3][i6];
  11746. if(class19_1 != null)
  11747. {
  11748. 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())
  11749. {
  11750. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11751. continue;
  11752. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11753. break;
  11754. }
  11755.  
  11756. spawnGroundItem(j3, i6);
  11757. }
  11758. }
  11759. return;
  11760. }
  11761. if(j == 105)
  11762. {
  11763. int l = stream.readUnsignedByte();
  11764. int k3 = anInt1268 + (l >> 4 & 7);
  11765. int j6 = anInt1269 + (l & 7);
  11766. int i9 = stream.readUnsignedWord();
  11767. int l11 = stream.readUnsignedByte();
  11768. int i14 = l11 >> 4 & 0xf;
  11769. int i16 = l11 & 7;
  11770. 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)
  11771. {
  11772. anIntArray1207[anInt1062] = i9;
  11773. anIntArray1241[anInt1062] = i16;
  11774. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11775. anInt1062++;
  11776. }
  11777. }
  11778. if(j == 215)
  11779. {
  11780. int i1 = stream.method435();
  11781. int l3 = stream.method428();
  11782. int k6 = anInt1268 + (l3 >> 4 & 7);
  11783. int j9 = anInt1269 + (l3 & 7);
  11784. int i12 = stream.method435();
  11785. int j14 = stream.readUnsignedWord();
  11786. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  11787. {
  11788. Item class30_sub2_sub4_sub2_2 = new Item();
  11789. class30_sub2_sub4_sub2_2.ID = i1;
  11790. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11791. if(groundArray[plane][k6][j9] == null)
  11792. groundArray[plane][k6][j9] = new NodeList();
  11793. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11794. spawnGroundItem(k6, j9);
  11795. }
  11796. return;
  11797. }
  11798. if(j == 156)
  11799. {
  11800. int j1 = stream.method426();
  11801. int i4 = anInt1268 + (j1 >> 4 & 7);
  11802. int l6 = anInt1269 + (j1 & 7);
  11803. int k9 = stream.readUnsignedWord();
  11804. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  11805. {
  11806. NodeList class19 = groundArray[plane][i4][l6];
  11807. if(class19 != null)
  11808. {
  11809. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  11810. {
  11811. if(item.ID != (k9 & 0x7fff))
  11812. continue;
  11813. item.unlink();
  11814. break;
  11815. }
  11816.  
  11817. if(class19.reverseGetFirst() == null)
  11818. groundArray[plane][i4][l6] = null;
  11819. spawnGroundItem(i4, l6);
  11820. }
  11821. }
  11822. return;
  11823. }
  11824. if(j == 160)
  11825. {
  11826. int k1 = stream.method428();
  11827. int j4 = anInt1268 + (k1 >> 4 & 7);
  11828. int i7 = anInt1269 + (k1 & 7);
  11829. int l9 = stream.method428();
  11830. int j12 = l9 >> 2;
  11831. int k14 = l9 & 3;
  11832. int j16 = anIntArray1177[j12];
  11833. int j17 = stream.method435();
  11834. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  11835. {
  11836. int j18 = intGroundArray[plane][j4][i7];
  11837. int i19 = intGroundArray[plane][j4 + 1][i7];
  11838. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11839. int k20 = intGroundArray[plane][j4][i7 + 1];
  11840. if(j16 == 0)
  11841. {
  11842. Object1 class10 = worldController.method296(plane, j4, i7);
  11843. if(class10 != null)
  11844. {
  11845. int k21 = class10.uid >> 14 & 0x7fff;
  11846. if(j12 == 2)
  11847. {
  11848. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11849. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11850. } else
  11851. {
  11852. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11853. }
  11854. }
  11855. }
  11856. if(j16 == 1)
  11857. {
  11858. Object2 class26 = worldController.method297(j4, i7, plane);
  11859. if(class26 != null)
  11860. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11861. }
  11862. if(j16 == 2)
  11863. {
  11864. Object5 class28 = worldController.method298(j4, i7, plane);
  11865. if(j12 == 11)
  11866. j12 = 10;
  11867. if(class28 != null)
  11868. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11869. }
  11870. if(j16 == 3)
  11871. {
  11872. Object3 class49 = worldController.method299(i7, j4, plane);
  11873. if(class49 != null)
  11874. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11875. }
  11876. }
  11877. return;
  11878. }
  11879. if(j == 147)
  11880. {
  11881. int l1 = stream.method428();
  11882. int k4 = anInt1268 + (l1 >> 4 & 7);
  11883. int j7 = anInt1269 + (l1 & 7);
  11884. int i10 = stream.readUnsignedWord();
  11885. byte byte0 = stream.method430();
  11886. int l14 = stream.method434();
  11887. byte byte1 = stream.method429();
  11888. int k17 = stream.readUnsignedWord();
  11889. int k18 = stream.method428();
  11890. int j19 = k18 >> 2;
  11891. int i20 = k18 & 3;
  11892. int l20 = anIntArray1177[j19];
  11893. byte byte2 = stream.readSignedByte();
  11894. int l21 = stream.readUnsignedWord();
  11895. byte byte3 = stream.method429();
  11896. Player player;
  11897. if(i10 == unknownInt10)
  11898. player = myPlayer;
  11899. else
  11900. player = playerArray[i10];
  11901. if(player != null)
  11902. {
  11903. ObjectDef class46 = ObjectDef.forID(l21);
  11904. int i22 = intGroundArray[plane][k4][j7];
  11905. int j22 = intGroundArray[plane][k4 + 1][j7];
  11906. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11907. int l22 = intGroundArray[plane][k4][j7 + 1];
  11908. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11909. if(model != null)
  11910. {
  11911. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11912. player.anInt1707 = l14 + loopCycle;
  11913. player.anInt1708 = k17 + loopCycle;
  11914. player.aModel_1714 = model;
  11915. int i23 = class46.anInt744;
  11916. int j23 = class46.anInt761;
  11917. if(i20 == 1 || i20 == 3)
  11918. {
  11919. i23 = class46.anInt761;
  11920. j23 = class46.anInt744;
  11921. }
  11922. player.anInt1711 = k4 * 128 + i23 * 64;
  11923. player.anInt1713 = j7 * 128 + j23 * 64;
  11924. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11925. if(byte2 > byte0)
  11926. {
  11927. byte byte4 = byte2;
  11928. byte2 = byte0;
  11929. byte0 = byte4;
  11930. }
  11931. if(byte3 > byte1)
  11932. {
  11933. byte byte5 = byte3;
  11934. byte3 = byte1;
  11935. byte1 = byte5;
  11936. }
  11937. player.anInt1719 = k4 + byte2;
  11938. player.anInt1721 = k4 + byte0;
  11939. player.anInt1720 = j7 + byte3;
  11940. player.anInt1722 = j7 + byte1;
  11941. }
  11942. }
  11943. }
  11944. if(j == 151)
  11945. {
  11946. int i2 = stream.method426();
  11947. int l4 = anInt1268 + (i2 >> 4 & 7);
  11948. int k7 = anInt1269 + (i2 & 7);
  11949. int j10 = stream.method434();
  11950. int k12 = stream.method428();
  11951. int i15 = k12 >> 2;
  11952. int k16 = k12 & 3;
  11953. int l17 = anIntArray1177[i15];
  11954. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11955. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11956. return;
  11957. }
  11958. if(j == 4)
  11959. {
  11960. int j2 = stream.readUnsignedByte();
  11961. int i5 = anInt1268 + (j2 >> 4 & 7);
  11962. int l7 = anInt1269 + (j2 & 7);
  11963. int k10 = stream.readUnsignedWord();
  11964. int l12 = stream.readUnsignedByte();
  11965. int j15 = stream.readUnsignedWord();
  11966. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  11967. {
  11968. i5 = i5 * 128 + 64;
  11969. l7 = l7 * 128 + 64;
  11970. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11971. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11972. }
  11973. return;
  11974. }
  11975. if(j == 44)
  11976. {
  11977. int k2 = stream.method436();
  11978. int j5 = stream.readUnsignedWord();
  11979. int i8 = stream.readUnsignedByte();
  11980. int l10 = anInt1268 + (i8 >> 4 & 7);
  11981. int i13 = anInt1269 + (i8 & 7);
  11982. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  11983. {
  11984. Item class30_sub2_sub4_sub2_1 = new Item();
  11985. class30_sub2_sub4_sub2_1.ID = k2;
  11986. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11987. if(groundArray[plane][l10][i13] == null)
  11988. groundArray[plane][l10][i13] = new NodeList();
  11989. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11990. spawnGroundItem(l10, i13);
  11991. }
  11992. return;
  11993. }
  11994. if(j == 101)
  11995. {
  11996. int l2 = stream.method427();
  11997. int k5 = l2 >> 2;
  11998. int j8 = l2 & 3;
  11999. int i11 = anIntArray1177[k5];
  12000. int j13 = stream.readUnsignedByte();
  12001. int k15 = anInt1268 + (j13 >> 4 & 7);
  12002. int l16 = anInt1269 + (j13 & 7);
  12003. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  12004. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  12005. return;
  12006. }
  12007. if(j == 117)
  12008. {
  12009. int i3 = stream.readUnsignedByte();
  12010. int l5 = anInt1268 + (i3 >> 4 & 7);
  12011. int k8 = anInt1269 + (i3 & 7);
  12012. int j11 = l5 + stream.readSignedByte();
  12013. int k13 = k8 + stream.readSignedByte();
  12014. int l15 = stream.readSignedWord();
  12015. int i17 = stream.readUnsignedWord();
  12016. int i18 = stream.readUnsignedByte() * 4;
  12017. int l18 = stream.readUnsignedByte() * 4;
  12018. int k19 = stream.readUnsignedWord();
  12019. int j20 = stream.readUnsignedWord();
  12020. int i21 = stream.readUnsignedByte();
  12021. int j21 = stream.readUnsignedByte();
  12022. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  12023. {
  12024. l5 = l5 * 128 + 64;
  12025. k8 = k8 * 128 + 64;
  12026. j11 = j11 * 128 + 64;
  12027. k13 = k13 * 128 + 64;
  12028. 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);
  12029. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  12030. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  12031. }
  12032. }
  12033. }
  12034.  
  12035. private static void setLowMem()
  12036. {
  12037. WorldController.lowMem = true;
  12038. Texture.lowMem = true;
  12039. lowMem = true;
  12040. ObjectManager.lowMem = true;
  12041. ObjectDef.lowMem = true;
  12042. }
  12043.  
  12044. private void method139(Stream stream)
  12045. {
  12046. stream.initBitAccess();
  12047. int k = stream.readBits(8);
  12048. if(k < npcCount)
  12049. {
  12050. for(int l = k; l < npcCount; l++)
  12051. anIntArray840[anInt839++] = npcIndices[l];
  12052.  
  12053. }
  12054. if(k > npcCount)
  12055. {
  12056. signlink.reporterror(myUsername + " Too many npcs");
  12057. throw new RuntimeException("eek");
  12058. }
  12059. npcCount = 0;
  12060. for(int i1 = 0; i1 < k; i1++)
  12061. {
  12062. int j1 = npcIndices[i1];
  12063. NPC npc = npcArray[j1];
  12064. int k1 = stream.readBits(1);
  12065. if(k1 == 0)
  12066. {
  12067. npcIndices[npcCount++] = j1;
  12068. npc.anInt1537 = loopCycle;
  12069. } else
  12070. {
  12071. int l1 = stream.readBits(2);
  12072. if(l1 == 0)
  12073. {
  12074. npcIndices[npcCount++] = j1;
  12075. npc.anInt1537 = loopCycle;
  12076. anIntArray894[anInt893++] = j1;
  12077. } else
  12078. if(l1 == 1)
  12079. {
  12080. npcIndices[npcCount++] = j1;
  12081. npc.anInt1537 = loopCycle;
  12082. int i2 = stream.readBits(3);
  12083. npc.moveInDir(false, i2);
  12084. int k2 = stream.readBits(1);
  12085. if(k2 == 1)
  12086. anIntArray894[anInt893++] = j1;
  12087. } else
  12088. if(l1 == 2)
  12089. {
  12090. npcIndices[npcCount++] = j1;
  12091. npc.anInt1537 = loopCycle;
  12092. int j2 = stream.readBits(3);
  12093. npc.moveInDir(true, j2);
  12094. int l2 = stream.readBits(3);
  12095. npc.moveInDir(true, l2);
  12096. int i3 = stream.readBits(1);
  12097. if(i3 == 1)
  12098. anIntArray894[anInt893++] = j1;
  12099. } else
  12100. if(l1 == 3)
  12101. anIntArray840[anInt839++] = j1;
  12102. }
  12103. }
  12104.  
  12105. }
  12106.  
  12107. public void handleStupidWorldSwitch() {
  12108. if(world > 1){ //STOPS MORE THAN 2 WORLD RE-WRITE LATER
  12109. world = 1;
  12110. }else{
  12111. world += 1;
  12112. }
  12113. if(world == 1){
  12114. serverip = "ruinedscape.no-ip.biz";
  12115. port = 43594;
  12116. spec ="@red@Normal World";
  12117. signlink.setuid();
  12118. } else {
  12119. if(world == 2){
  12120. serverip = "127.0.0.1";
  12121. port = 43594;
  12122. signlink.setuid();
  12123. spec =" @red@Developers World";
  12124. }
  12125. }
  12126. if(world < 0 || world > 7)
  12127. spec = " Invalid world";
  12128. }
  12129.  
  12130.  
  12131. private void processLoginScreenInput() {
  12132. if(loginMessage2.equals("@whi@Error connecting to server.")){ // fixes the client login lagg, by Gabbe.
  12133. loginMessage2 = "@whi@Error connecting to server.";
  12134. }
  12135. if (loginScreenState == 0) {
  12136. int l = super.myHeight / 2 + 20;
  12137. int yoffset = 36;
  12138. screenHover[0] = super.mouseX >= 273 && super.mouseX <= 490 && super.mouseY >= 194 + yoffset && super.mouseY <= 219 + yoffset;
  12139. screenHover[1] = super.mouseX >= 273 && super.mouseX <= 490 && super.mouseY >= 240 + yoffset && super.mouseY <= 265 + yoffset;
  12140. screenHover[2] = super.mouseX >= 253 && super.mouseX <= 454 && super.mouseY >= 296 + yoffset && super.mouseY <= 321 + yoffset;
  12141. screenHover[3] = super.mouseX >= 455 && super.mouseX <= 600 && super.mouseY >= 296 + yoffset && super.mouseY <= 321 + yoffset;
  12142. if (super.clickMode3 == 1 && super.saveClickX >= 273
  12143. && super.saveClickX <= 490 && super.saveClickY >= 194 + yoffset
  12144. && super.saveClickY <= 219 + yoffset)
  12145. loginScreenCursorPos = 0;
  12146. if (super.clickMode3 == 1 && super.mouseX >= 273
  12147. && super.mouseX <= 490 && super.mouseY >= 240 + yoffset
  12148. && super.mouseY <= 265 + yoffset)
  12149. loginScreenCursorPos = 1;
  12150. if (super.clickMode3 == 1 && super.saveClickX >= 253
  12151. && super.saveClickX <= 454 && super.saveClickY >= 296 + yoffset
  12152. && super.saveClickY <= 321 + yoffset) {
  12153. loginFailures = 0;
  12154. login(myUsername, myPassword, false);
  12155. if (loggedIn)
  12156. return;
  12157. }
  12158. if (super.clickMode3 == 1 && super.saveClickX >= 455
  12159. && super.saveClickX <= 600 && super.saveClickY >= 296 + yoffset
  12160. && super.saveClickY <= 321 + yoffset) {
  12161. int x = 49;
  12162. loginBox.drawSprite(0 + x, 0);
  12163. char c = '\u0168';
  12164. char c1 = '\310';
  12165. int k1 = c1 / 2 + 20;
  12166. handleStupidWorldSwitch();
  12167.  
  12168. /*aTextDrawingArea_1271.method382(0xffff00, 130 + x, "@whi@World selected: @red@" + world,
  12169. k1 + 22
  12170. , true);*/
  12171. }
  12172. do {
  12173. int l1 = readChar(-796);
  12174. if (l1 == -1)
  12175. break;
  12176. boolean flag1 = false;
  12177. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  12178. if (l1 != validUserPassChars.charAt(i2))
  12179. continue;
  12180. flag1 = true;
  12181. break;
  12182. }
  12183.  
  12184. if (loginScreenCursorPos == 0) {
  12185. if (l1 == 8 && myUsername.length() > 0)
  12186. myUsername = myUsername.substring(0,
  12187. myUsername.length() - 1);
  12188. if (l1 == 9 || l1 == 10 || l1 == 13) {
  12189. loginScreenCursorPos = 1;
  12190. }
  12191. if (flag1)
  12192. myUsername += (char) l1;
  12193. if (myUsername.length() > 12)
  12194. myUsername = myUsername.substring(0, 12);
  12195. } else if (loginScreenCursorPos == 1) {
  12196. if (l1 == 8 && myPassword.length() > 0)
  12197. myPassword = myPassword.substring(0,
  12198. myPassword.length() - 1);
  12199. if (l1 == 9 || l1 == 10 || l1 == 13) {
  12200. if (myPassword.length() > 0
  12201. && myUsername.length() > 0) {
  12202. login(myUsername, myPassword, false);
  12203. } else {
  12204. loginScreenCursorPos = 0;
  12205. }
  12206. }
  12207. if (flag1)
  12208. myPassword += (char) l1;
  12209. if (myPassword.length() > 20)
  12210. myPassword = myPassword.substring(0, 20);
  12211. }
  12212. } while (true);
  12213. return;
  12214. }
  12215. }
  12216.  
  12217. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  12218. )
  12219. {
  12220. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  12221. {
  12222. if(lowMem && j != plane)
  12223. return;
  12224. int i2 = 0;
  12225. if(j1 == 0)
  12226. i2 = worldController.method300(j, i1, i);
  12227. if(j1 == 1)
  12228. i2 = worldController.method301(j, i1, i);
  12229. if(j1 == 2)
  12230. i2 = worldController.method302(j, i1, i);
  12231. if(j1 == 3)
  12232. i2 = worldController.method303(j, i1, i);
  12233. if(i2 != 0)
  12234. {
  12235. int i3 = worldController.method304(j, i1, i, i2);
  12236. int j2 = i2 >> 14 & 0x7fff;
  12237. int k2 = i3 & 0x1f;
  12238. int l2 = i3 >> 6;
  12239. if(j1 == 0)
  12240. {
  12241. worldController.method291(i1, j, i, (byte)-119);
  12242. ObjectDef class46 = ObjectDef.forID(j2);
  12243. if(class46.aBoolean767)
  12244. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  12245. }
  12246. if(j1 == 1)
  12247. worldController.method292(i, j, i1);
  12248. if(j1 == 2)
  12249. {
  12250. worldController.method293(j, i1, i);
  12251. ObjectDef class46_1 = ObjectDef.forID(j2);
  12252. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  12253. return;
  12254. if(class46_1.aBoolean767)
  12255. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  12256. }
  12257. if(j1 == 3)
  12258. {
  12259. worldController.method294(j, i, i1);
  12260. ObjectDef class46_2 = ObjectDef.forID(j2);
  12261. if(class46_2.aBoolean767 && class46_2.hasActions)
  12262. aClass11Array1230[j].method218(i, i1);
  12263. }
  12264. }
  12265. if(k1 >= 0)
  12266. {
  12267. int j3 = j;
  12268. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  12269. j3++;
  12270. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  12271. }
  12272. }
  12273. }
  12274.  
  12275. private void updatePlayers(int i, Stream stream)
  12276. {
  12277. anInt839 = 0;
  12278. anInt893 = 0;
  12279. method117(stream);
  12280. method134(stream);
  12281. method91(stream, i);
  12282. method49(stream);
  12283. for(int k = 0; k < anInt839; k++)
  12284. {
  12285. int l = anIntArray840[k];
  12286. if(playerArray[l].anInt1537 != loopCycle)
  12287. playerArray[l] = null;
  12288. }
  12289.  
  12290. if(stream.currentOffset != i)
  12291. {
  12292. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  12293. throw new RuntimeException("eek");
  12294. }
  12295. for(int i1 = 0; i1 < playerCount; i1++)
  12296. if(playerArray[playerIndices[i1]] == null)
  12297. {
  12298. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  12299. throw new RuntimeException("eek");
  12300. }
  12301.  
  12302. }
  12303.  
  12304. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  12305. {
  12306. int l1 = 2048 - k & 0x7ff;
  12307. int i2 = 2048 - j1 & 0x7ff;
  12308. int j2 = 0;
  12309. int k2 = 0;
  12310. int l2 = j;
  12311. if(l1 != 0)
  12312. {
  12313. int i3 = Model.modelIntArray1[l1];
  12314. int k3 = Model.modelIntArray2[l1];
  12315. int i4 = k2 * k3 - l2 * i3 >> 16;
  12316. l2 = k2 * i3 + l2 * k3 >> 16;
  12317. k2 = i4;
  12318. }
  12319. if(i2 != 0)
  12320. {
  12321. /* xxx if(cameratoggle){
  12322. if(zoom == 0)
  12323. zoom = k2;
  12324. if(lftrit == 0)
  12325. lftrit = j2;
  12326. if(fwdbwd == 0)
  12327. fwdbwd = l2;
  12328. k2 = zoom;
  12329. j2 = lftrit;
  12330. l2 = fwdbwd;
  12331. }
  12332. */
  12333. int j3 = Model.modelIntArray1[i2];
  12334. int l3 = Model.modelIntArray2[i2];
  12335. int j4 = l2 * j3 + j2 * l3 >> 16;
  12336. l2 = l2 * l3 - j2 * j3 >> 16;
  12337. j2 = j4;
  12338. }
  12339. xCameraPos = l - j2;
  12340. zCameraPos = i1 - k2;
  12341. yCameraPos = k1 - l2;
  12342. yCameraCurve = k;
  12343. xCameraCurve = j1;
  12344. }
  12345.  
  12346. public void updateStrings(String str, int i) {
  12347. switch(i) {
  12348. case 1675: sendFrame126(str, 17508); break;//Stab
  12349. case 1676: sendFrame126(str, 17509); break;//Slash
  12350. case 1677: sendFrame126(str, 17510); break;//Cursh
  12351. case 1678: sendFrame126(str, 17511); break;//Magic
  12352. case 1679: sendFrame126(str, 17512); break;//Range
  12353. case 1680: sendFrame126(str, 17513); break;//Stab
  12354. case 1681: sendFrame126(str, 17514); break;//Slash
  12355. case 1682: sendFrame126(str, 17515); break;//Crush
  12356. case 1683: sendFrame126(str, 17516); break;//Magic
  12357. case 1684: sendFrame126(str, 17517); break;//Range
  12358. case 1686: sendFrame126(str, 17518); break;//Strength
  12359. case 1687: sendFrame126(str, 17519); break;//Prayer
  12360. }
  12361. }
  12362.  
  12363. private void changePasswordSubmit() {
  12364. if(newPasswordString.length() <= 0)
  12365. pushMessage("Please type the new password you would like first.", 0 ," ");
  12366. else if(newPasswordString == myPassword) {
  12367. pushMessage("This is your current password, no changes where made.", 0 ," ");
  12368. } else {
  12369. sendData("::changepassword " + newPasswordString);
  12370. myPassword = newPasswordString;
  12371. openInterfaceID = -1;
  12372. setDetails();
  12373. }
  12374. }
  12375.  
  12376. public String strengthCheck(String newPassword) {
  12377. Pattern[] pattern = new Pattern[3];
  12378. Matcher matcher;
  12379. pattern[0] = Pattern.compile("[a-zA-Z]");
  12380. pattern[1] = Pattern.compile("\\d");
  12381. pattern[2] = Pattern.compile("[^a-zA-Z0-9]");
  12382. int level = 0, i = 0;
  12383. // find the strength
  12384. while(i != 3) {
  12385. matcher = pattern[i].matcher(newPassword);
  12386. if(matcher.find())
  12387. level++;
  12388. i++;
  12389. }
  12390. String strength = "None";
  12391. if(level == 1 && newPassword.length() < 6)
  12392. strength = "@red@Very weak";
  12393. else if (level == 1 && newPassword.length() < 9)
  12394. strength = "@or2@Weak";
  12395. else if (level == 1 && newPassword.length() >= 9 || level == 2 && newPassword.length() < 9)
  12396. strength = "@or3@Medium";
  12397. else if (level == 2 && newPassword.length() >= 9 || level == 3 && newPassword.length() < 6)
  12398. strength = "@yel@Strong";
  12399. else if (level == 3 && newPassword.length() < 9)
  12400. strength = "@gre@Very strong";
  12401. else if (level == 3 && newPassword.length() >= 9)
  12402. strength = "@blu@Best";
  12403. // check for sequences
  12404. pattern[0] = Pattern.compile("[a-zA-Z]{3,}");
  12405. pattern[1] = Pattern.compile("[0-9]{3,}");
  12406. boolean sequence = false;
  12407. i = 0;
  12408. while (i != 2) {
  12409. matcher = pattern[i].matcher(newPassword);
  12410. while(matcher.find()) {
  12411. if(sequenceCheck(matcher.group(),i)) {
  12412. sequence = true;
  12413. break;
  12414. }
  12415. }
  12416. i++;
  12417. System.out.println(i);
  12418. }
  12419. return strength + "." + (sequence ? "@whi@Tip: Don't use easy sequences." : "");
  12420. }
  12421.  
  12422. boolean sequenceCheck(String s,int n) {
  12423. s = s.toLowerCase();
  12424. String sequence;
  12425. if(n == 0)
  12426. sequence = "abcdefghijklmnopqrstuvwxyz";
  12427. else
  12428. sequence = "0123456789";
  12429. Pattern pattern;
  12430. Matcher matcher;
  12431. int b = 0,e = 3;
  12432. while(!s.substring(b,e).equals("")) {
  12433. pattern = Pattern.compile(s.substring(b,e));
  12434. matcher = pattern.matcher(sequence);
  12435. if (matcher.find())
  12436. return true;
  12437. b++;
  12438. e++;
  12439. if(e > s.length())
  12440. return false;
  12441. }
  12442. return false;
  12443. }
  12444.  
  12445. public void sendFrame126(String str,int i) {
  12446. RSInterface.interfaceCache[i].message = str;
  12447. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  12448. needDrawTabArea = true;
  12449. }
  12450.  
  12451. public void sendPacket185(int button,int toggle,int type) {
  12452. switch(type) {
  12453. case 135:
  12454. RSInterface class9 = RSInterface.interfaceCache[button];
  12455. boolean flag8 = true;
  12456. if(class9.contentType > 0)
  12457. flag8 = promptUserForInput(class9);
  12458. if(flag8) {
  12459. if(button >= 17202 && button <= 17227)
  12460. togglePrayerState(button);
  12461. switch(button) {
  12462. case 22597:
  12463. changePasswordSubmit();
  12464. break;
  12465. case 17231://Quick prayr confirm
  12466. saveQuickSelection();
  12467. break;
  12468. case 19144:
  12469. sendFrame248(15106,3213);
  12470. method60(15106);
  12471. inputTaken = true;
  12472. break;
  12473. case 22762:
  12474. openInterfaceID = 23471;//Pouch interface
  12475. break;
  12476. case 23475:
  12477. openInterfaceID = 22760;//Scroll interface
  12478. break;
  12479. default:
  12480. stream.createFrame(185);
  12481. stream.writeWord(button);
  12482. break;
  12483.  
  12484. }
  12485. }
  12486. break;
  12487. case 646:
  12488. stream.createFrame(185);
  12489. stream.writeWord(button);
  12490. RSInterface class9_2 = RSInterface.interfaceCache[button];
  12491. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  12492. toggle = class9_2.valueIndexArray[0][1];
  12493. if(variousSettings[toggle] != class9_2.requiredValues[0]) {
  12494. variousSettings[toggle] = class9_2.requiredValues[0];
  12495. method33(toggle);
  12496. needDrawTabArea = true;
  12497. }
  12498. }
  12499. break;
  12500. case 169:
  12501. stream.createFrame(185);
  12502. stream.writeWord(button);
  12503. RSInterface class9_3 = RSInterface.interfaceCache[button];
  12504. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  12505. toggle = class9_3.valueIndexArray[0][1];
  12506. variousSettings[toggle] = 1 - variousSettings[toggle];
  12507. method33(toggle);
  12508. needDrawTabArea = true;
  12509. if(button >= 25000 && button <= 25050) {
  12510. handePrayerCorrection(button);
  12511. }
  12512. switch(button) {
  12513. //functionKeys
  12514. case 26007://Toggle function keys
  12515. functionKeys = !functionKeys;
  12516. setDetails();
  12517. break;
  12518. case 26008://Toggle halth bars
  12519. healthBars = !healthBars;
  12520. setDetails();
  12521. break;
  12522. case 26010://Toggle x10 damage
  12523. newDamage = !newDamage;
  12524. setDetails();
  12525. break;
  12526. case 152:
  12527. if(variousSettings[toggle] == 1)
  12528. orbToggle[2] = true;
  12529. else
  12530. orbToggle[2] = false;
  12531. break;
  12532. case 19136:
  12533. if(toggle == 0)
  12534. sendFrame36(173,toggle);
  12535. if(toggle == 1)
  12536. sendPacket185(153,173,646);
  12537. break;
  12538. case 25842://More options
  12539. toggle = (openInterfaceID == 26000) ? 0 : 1;
  12540. sendFrame36(175,toggle);
  12541. if(toggle == 1)
  12542. openInterfaceID = 26000;
  12543. else
  12544. openInterfaceID = -1;
  12545. break;
  12546. case 25837://Fullscreen
  12547. switchToFullScreen();
  12548. break;
  12549. case 26012://Fullscreen
  12550. switchToFullScreen();
  12551. break;
  12552. }
  12553. }
  12554. break;
  12555. }
  12556. System.out.println("button: " + button + ", toggle: " + toggle + ", type: " + type);
  12557. }
  12558.  
  12559. private void configureQuickTicks() {
  12560. if(prayerInterfaceType == 5608) {
  12561. if(getQuickPrayersSet() > 0) {
  12562. for(int index = 0; index < quickPrayers.length; index++) {
  12563. if(quickPrayers[index] == 1) {
  12564. if(index >= 0 && index <= 25) {
  12565. if(getOrbValues(1,null)[1] >= prayerLevelRequirements[index]) {
  12566. int[] types = getPrayerTypeForIndex(index);
  12567. if(types != null) {
  12568. for(int g = 0; g < rangeAndMagePray.length; g++) {
  12569. if(index == rangeAndMagePray[g]) {
  12570. types = rangeAndMagePrayOff;
  12571. }
  12572. }
  12573. for(int i = 0; i < types.length; i++) {
  12574. if(index != types[i]) {
  12575. if(index == 24 || index == 25) {
  12576. types = superiorPray;
  12577. }
  12578. quickPrayers[types[i]] = 0;
  12579. variousSettings[quickConfigIDs[types[i]]] = 0;
  12580. method33(quickConfigIDs[types[i]]);
  12581. needDrawTabArea = true;
  12582. if(dialogID != -1)
  12583. inputTaken = true;
  12584. } else {
  12585. quickPrayers[index] = 1;
  12586. variousSettings[quickConfigIDs[index]] = quickPrayers[index];
  12587. method33(quickConfigIDs[index]);
  12588. needDrawTabArea = true;
  12589. if(dialogID != -1)
  12590. inputTaken = true;
  12591. }
  12592. }
  12593. } else {
  12594. quickPrayers[index] = 1;
  12595. variousSettings[quickConfigIDs[index]] = quickPrayers[index];
  12596. method33(quickConfigIDs[index]);
  12597. needDrawTabArea = true;
  12598. if(dialogID != -1)
  12599. inputTaken = true;
  12600. }
  12601. }
  12602. }
  12603. }
  12604. }
  12605. }
  12606. } else if(prayerInterfaceType == 22500) {
  12607. if(getQuickCursesSet() > 0) {
  12608. for(int index = 0; index < quickCurses.length; index++) {
  12609. if(quickCurses[index] == 1) {
  12610. if(index >= 0 && index <= 20) {
  12611. if(getOrbValues(1,null)[1] >= curseLevelRequirements[index]) {
  12612. System.out.println("woop: " + getQuickCursesSet() + ", index: " + index);
  12613. int[] types = getCurseTypeForIndex(index);
  12614. if(types != null) {
  12615. for(int i = 0; i < types.length; i++) {
  12616. if(index != types[i]) {
  12617. quickCurses[types[i]] = 0;
  12618. variousSettings[quickConfigIDs[types[i]]] = 0;
  12619. method33(quickConfigIDs[types[i]]);
  12620. needDrawTabArea = true;
  12621. if(dialogID != -1)
  12622. inputTaken = true;
  12623. }
  12624. }
  12625. }
  12626. quickCurses[index] = 1;
  12627. variousSettings[quickConfigIDs[index]] = quickCurses[index];
  12628. method33(quickConfigIDs[index]);
  12629. needDrawTabArea = true;
  12630. if(dialogID != -1)
  12631. inputTaken = true;
  12632. }
  12633. }
  12634. }
  12635. }
  12636. }
  12637. }
  12638. }
  12639.  
  12640. public void readDetails()
  12641. {
  12642. String line = "";
  12643. String token = "";
  12644. String token2 = "";
  12645. int ReadMode = 0;
  12646. boolean EndOfFile = false;
  12647. String[] token3 = new String[30];
  12648. BufferedReader details = null;
  12649. try
  12650. {
  12651. details = new BufferedReader(new FileReader(signlink.findcachedir() + "/saveuser.ini"));
  12652. try
  12653. {
  12654. line = details.readLine();
  12655. } catch(IOException ioexception)
  12656. {
  12657. System.out.println("Error reading saveuser.ini");
  12658. }
  12659. while(EndOfFile == false && line != null)
  12660. {
  12661. line = line.trim();
  12662. int spot = line.indexOf("=");
  12663. if(spot > -1)
  12664. {
  12665. token = line.substring(0, spot);
  12666. token = token.trim();
  12667. token2 = line.substring(spot + 1);
  12668. token2 = token2.trim();
  12669. token3 = token2.split("\t");
  12670. switch(ReadMode)
  12671. {
  12672. case 1:
  12673. if(token.equals("username")) {
  12674. myUsername = token2;
  12675. }
  12676. if(token.equals("password"))
  12677. myPassword = token2;
  12678. //if(token.equals("server"))
  12679. // serverip = token2;
  12680. if(token.equals("keys"))
  12681. functionKeys = token2.equals("0") ? false : true;
  12682. if(token.equals("health"))
  12683. healthBars = token2.equals("0") ? false : true;
  12684. if(token.equals("damage"))
  12685. newDamage = token2.equals("0") ? false : true;
  12686. break;
  12687. case 2:
  12688. if (token.equals("prayer")) {
  12689. for (int j = 0; j < token3.length; j++) {
  12690. quickPrayers[j] = Integer.parseInt(token3[j]);
  12691. }
  12692. }
  12693. break;
  12694. case 3:
  12695. if (token.equals("curse")) {
  12696. for (int j = 0; j < token3.length; j++) {
  12697. quickCurses[j] = Integer.parseInt(token3[j]);
  12698. }
  12699. }
  12700. break;
  12701.  
  12702. }
  12703. } else {
  12704. if(line.equals("[ACCOUNT]"))
  12705. ReadMode = 1;
  12706. else if(line.equals("[PRAYERS]"))
  12707. ReadMode = 2;
  12708. else if(line.equals("[CURSES]"))
  12709. ReadMode = 3;
  12710. if(line.equals("[EOF]"))
  12711. try {
  12712. details.close();
  12713. } catch(IOException ioexception)
  12714. {
  12715. ioexception.printStackTrace();
  12716. }
  12717. }
  12718. try
  12719. {
  12720. line = details.readLine();
  12721. } catch(IOException ioexception1)
  12722. {
  12723. EndOfFile = true;
  12724. }
  12725. }
  12726. } catch(FileNotFoundException file) {
  12727. System.out.println("Couldn't find saveuser.ini");
  12728. }
  12729. try {
  12730. if(details != null)
  12731. details.close();
  12732. } catch(NullPointerException ex) {
  12733. ex.printStackTrace();
  12734. } catch(IOException ioexception) {
  12735. ioexception.printStackTrace();
  12736. }
  12737. }
  12738.  
  12739. public void setDetails()
  12740. {
  12741. BufferedWriter details = null;
  12742. try
  12743. {
  12744. details = new BufferedWriter(new FileWriter(signlink.findcachedir()+"/saveuser.ini"));
  12745. saveValue(details,"[ACCOUNT]","nothing",false);
  12746. saveValue(details,"username",myUsername,false);
  12747. saveValue(details,"password",myPassword,false);
  12748. //saveValue(details,"server",serverip,false);
  12749. saveValue(details,"keys",functionKeys ? "1" : "0",false);
  12750. saveValue(details,"health",healthBars ? "1" : "0",false);
  12751. saveValue(details,"damage",newDamage ? "1" : "0",true);
  12752.  
  12753. saveValue(details,"[PRAYERS]","nothing",false);
  12754. String stringSave = "";
  12755. for(int i = 0; i < quickPrayers.length; i++) {
  12756. stringSave = stringSave + quickPrayers[i] + "\t";
  12757. }
  12758. saveValue(details,"prayer",stringSave,true);
  12759.  
  12760. saveValue(details,"[CURSES]","nothing",false);
  12761. stringSave = "";
  12762. for(int i = 0; i < quickCurses.length; i++) {
  12763. stringSave = stringSave + quickCurses[i] + "\t";
  12764. }
  12765. saveValue(details,"curse",stringSave,true);
  12766.  
  12767. //Ends
  12768. details.newLine();
  12769. details.write("[EOF]", 0, 5);
  12770. details.newLine();
  12771. details.newLine();
  12772. details.close();
  12773. } catch(IOException io) {
  12774. (new File(signlink.findcachedir()+"/saveuser.ini")).delete();
  12775. System.out.println("Error while writing saveuser.ini");
  12776. }
  12777. }
  12778.  
  12779. private int[] quickPrayers = new int[26];
  12780. private int[] quickCurses = new int[20];
  12781. private boolean loadTickSelection = false;
  12782.  
  12783. public static void saveValue(BufferedWriter buffer, String value,String variable,boolean last)
  12784. {
  12785. try
  12786. {
  12787. if(value == null || variable.equals("null"))
  12788. System.out.println("Error: saveValue had no identifier.");
  12789. if(variable == null || variable.equals("null"))
  12790. variable = "0";
  12791. if(value.startsWith("[") && value.endsWith("]"))
  12792. {
  12793. buffer.write(value, 0, value.length());
  12794. } else {
  12795. value = value + " = ";
  12796. buffer.write(value, 0, value.length());
  12797. buffer.write(variable, 0, variable.length());
  12798. }
  12799. buffer.newLine();
  12800. if(last)
  12801. buffer.newLine();
  12802. }
  12803. catch(IOException ioexception) {
  12804. ioexception.printStackTrace();
  12805. }
  12806. catch(NullPointerException nullpointerexception)
  12807. {
  12808. nullpointerexception.printStackTrace();
  12809. }
  12810. }
  12811.  
  12812. public int[] oldPrayerButtons = {5609,5610,5611,18000,18002,5612,5613,5614,5615,5616,5617,18004,18006,5618,5619,5620,5621,5622,5623,18008,18010,683,684,685,18012,18014};
  12813. public void handePrayerCorrection(int button) {
  12814. int index = button - 25000;
  12815. if(index > 0)
  12816. index = index/2;
  12817. sendPacket185(oldPrayerButtons[index],-1,169);
  12818. }
  12819.  
  12820. private void saveQuickSelection() {
  12821. setDetails();
  12822. tabInterfaceIDs[5] = prayerInterfaceType;
  12823. }
  12824.  
  12825. private void handleQuickAidsActive() {
  12826. if(prayerInterfaceType == 5608) {
  12827. if(getQuickPrayersSet() > 0) {
  12828. if(!orbToggle[1])
  12829. for(int i = 0; i < quickPrayers.length; i++) {
  12830. if(quickPrayers[i] == 1) {
  12831. sendPacket185((i * 2) + 25000,-1,169);
  12832. }
  12833. }
  12834. else
  12835. turnOffPrayers();
  12836. orbToggle[1] = !orbToggle[1];
  12837. } else {
  12838. if(orbToggle[1]) {
  12839. turnOffPrayers();
  12840. orbToggle[1] = false;
  12841. } else {
  12842. pushMessage("You don't have any quick prayers selected.", 0, "");
  12843. pushMessage("Right-click the Prayer button next to the minimap to select some.", 0, "");
  12844. }
  12845. }
  12846. } else if(prayerInterfaceType == 22500) {
  12847. if(getQuickCursesSet() > 0) {
  12848. if(!orbToggle[1])
  12849. for(int i = 0; i < quickCurses.length; i++) {
  12850. if(quickCurses[i] == 1) {
  12851. sendPacket185((i * 2) + 22503,-1,169);
  12852. }
  12853. }
  12854. else
  12855. turnOffCurses();
  12856. orbToggle[1] = !orbToggle[1];
  12857. } else {
  12858. if(orbToggle[1]) {
  12859. turnOffCurses();
  12860. orbToggle[1] = false;
  12861. } else {
  12862. pushMessage("You don't have any quick curses selected.", 0, "");
  12863. pushMessage("Right-click the Curses button next to the minimap to select some.", 0, "");
  12864. }
  12865. }
  12866. }
  12867. }
  12868.  
  12869. private int getQuickPrayersSet() {
  12870. int amount = 0;
  12871. for(int i = 0; i < quickPrayers.length; i++)
  12872. if(quickPrayers[i] == 1) {
  12873. amount++;
  12874. }
  12875. return amount;
  12876. }
  12877.  
  12878. private int getQuickCursesSet() {
  12879. int amount = 0;
  12880. for(int i = 0; i < quickCurses.length; i++)
  12881. if(quickCurses[i] == 1) {
  12882. amount++;
  12883. }
  12884. return amount;
  12885. }
  12886.  
  12887. private void turnOffPrayers() {
  12888. int toggle = -1;
  12889. for(int i = 0; i < quickPrayers.length; i++) {
  12890. RSInterface rsInterface = RSInterface.interfaceCache[(i * 2) + 25000];
  12891. if(rsInterface.valueIndexArray != null && rsInterface.valueIndexArray[0][0] == 5) {
  12892. toggle = rsInterface.valueIndexArray[0][1];
  12893. if(variousSettings[toggle] == 1)
  12894. sendPacket185((i * 2) + 25000,-1,169);
  12895. }
  12896. }
  12897. }
  12898.  
  12899. private void turnOffCurses() {
  12900. int toggle = -1;
  12901. for(int i = 0; i < quickCurses.length; i++) {
  12902. RSInterface rsInterface = RSInterface.interfaceCache[(i * 2) + 22503];
  12903. if(rsInterface.valueIndexArray != null && rsInterface.valueIndexArray[0][0] == 5) {
  12904. toggle = rsInterface.valueIndexArray[0][1];
  12905. if(variousSettings[toggle] == 1)
  12906. sendPacket185((i * 2) + 22503,-1,169);
  12907. }
  12908. }
  12909. }
  12910.  
  12911. private void turnOffQuickTicks() {
  12912. int toggle = -1;
  12913. for(int i = 0; i < quickCurses.length; i++) {
  12914. RSInterface rsInterface = RSInterface.interfaceCache[17202 + i];
  12915. if(rsInterface.valueIndexArray != null && rsInterface.valueIndexArray[0][0] == 5) {
  12916. toggle = rsInterface.valueIndexArray[0][1];
  12917. if(variousSettings[toggle] == 1)
  12918. sendPacket185(17202 + i,-1,169);
  12919. }
  12920. }
  12921. }
  12922.  
  12923. public void toggleQuickAidsSelection() {
  12924. boolean inProcess = (tabInterfaceIDs[5] == 17200 || tabInterfaceIDs[5] == 17234);
  12925. if(inProcess)
  12926. saveQuickSelection();
  12927. else {
  12928. if(prayerInterfaceType == 5608) {
  12929. if(!inProcess) {
  12930. tabInterfaceIDs[5] = 17200;
  12931. needDrawTabArea = true;
  12932. tabAreaAltered = true;
  12933. } else {
  12934. tabInterfaceIDs[5] = 5608;
  12935. needDrawTabArea = true;
  12936. tabAreaAltered = true;
  12937. }
  12938. } else if(prayerInterfaceType == 22500) {
  12939. if(!inProcess) {
  12940. tabInterfaceIDs[5] = 17234;
  12941. needDrawTabArea = true;
  12942. tabAreaAltered = true;
  12943. } else {
  12944. tabInterfaceIDs[5] = 22500;
  12945. needDrawTabArea = true;
  12946. tabAreaAltered = true;
  12947. }
  12948. }
  12949. tabID = 5;
  12950. }
  12951. }
  12952.  
  12953. public final int[] curseLevelRequirements = {50,50,52,54,56,59,62,65,68,71,74,76,78,80,82,84,86,89,92,95};
  12954. public final String[] curseName = {
  12955. "Protect Item", "Sap Warrior", "Sap Ranger", "Sap Mage", "Sap Spirit",
  12956. "Berserker", "Deflect Summoning", "Deflect Magic","Deflect Missiles", "Deflect Melee",
  12957. "Leech Attack", "Leech Ranged", "Leech Magic", "Leech Defence", "Leech Strength",
  12958. "Leech Energy", "Leech Special Attack", "Wrath", "Soul Split", "Turmoil"
  12959. };
  12960. public int[] quickConfigIDs = {630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656};
  12961. public final int[] prayerLevelRequirements = {1,4,7,8,9,10,13,16,19,22,25,26,27,28,31,34,37,40,43,44,45,46,49,52,60,70};
  12962. public final String[] prayerName = {
  12963. "Thick Skin", "Burst of Strength", "Clarity of Thought", "Sharp Eye", "Mystic Will", "Rock Skin", "Superhuman Strength", "Improved Reflexes","Rapid Restore",
  12964. "Rapid Heal", "Protect Item", "Hawk Eye", "Mystic Lore", "Steel Skin", "Ultimate Strength", "Incredible Reflexes","Protect from Magic", "Protect from Missiles",
  12965. "Protect from Melee","Eagle Eye", "Mystic Might", "Retribution", "Redemption", "Smite", "Chivalry", "Piety"
  12966. };
  12967. private int[] defPray = {0,5,13,24,25};
  12968. private int[] strPray = {1,3,4,6,11,12,14,19,20,24,25};
  12969. private int[] atkPray = {2,3,4,7,11,12,15,19,20,24,25};
  12970. private int[] rangeAndMagePray = {3,4,11,12,19,20,24,25};
  12971. private int[] rangeAndMagePrayOff = {1,2,3,4,6,7,11,12,14,15,19,20,24,25};
  12972. private int[] headPray = {16,17,18,21,22,23};
  12973. private int[] superiorPray = {0,1,2,3,4,5,6,7,11,12,13,14,15,19,20,24,25};
  12974. private int[][] prayer = {defPray,strPray,atkPray,rangeAndMagePray,headPray};
  12975.  
  12976. private int[] getPrayerTypeForIndex(int index) {
  12977. int[] type = null;
  12978. for(int i = 0; i < prayer.length; i++) {
  12979. for(int il = 0; il < prayer[i].length; il++) {
  12980. if(index == prayer[i][il]) {
  12981. type = prayer[i];
  12982. }
  12983. }
  12984. }
  12985. return type;
  12986. }
  12987.  
  12988. private int[] sapCurse = {1,2,3,4,19};
  12989. private int[] leechCurse = {10,11,12,13,14,15,16,19};
  12990. private int[] deflectCurse = {7,8,9,17,18};
  12991.  
  12992. private int[] getCurseTypeForIndex(int index) {
  12993. int[] types = null;
  12994. for(int g = 0; g < leechCurse.length; g++) {
  12995. if(index == leechCurse[g])
  12996. types = sapCurse;
  12997. }
  12998. for(int g = 0; g < sapCurse.length; g++) {
  12999. if(index == sapCurse[g])
  13000. types = leechCurse;
  13001. }
  13002. for(int g = 0; g < deflectCurse.length; g++) {
  13003. if(index == deflectCurse[g])
  13004. types = deflectCurse;
  13005. }
  13006. if(index == 6) {
  13007. int[] type = {17,18};
  13008. types = type;
  13009. }
  13010. if(index == 17 || index == 18) {
  13011. int[] type = {6,7,8,9,17,18};
  13012. types = type;
  13013. }
  13014. if(index == 19) {
  13015. int[] turmoilCurseOff = {1,2,3,4,10,11,12,13,14,15,16,19};
  13016. types = turmoilCurseOff;
  13017. }
  13018. return types;
  13019. }
  13020.  
  13021. public void togglePrayerState(int button) {
  13022. int index = button - 17202;
  13023. if(prayerInterfaceType == 5608) {
  13024. if(getOrbValues(1,null)[1] >= prayerLevelRequirements[index]) {
  13025. int[] types = getPrayerTypeForIndex(index);
  13026. if(types != null) {
  13027. for(int g = 0; g < rangeAndMagePray.length; g++) {
  13028. if(index == rangeAndMagePray[g]) {
  13029. types = rangeAndMagePrayOff;
  13030. }
  13031. }
  13032. for(int i = 0; i < types.length; i++) {
  13033. if(index != types[i]) {
  13034. if(index == 24 || index == 25) {
  13035. types = superiorPray;
  13036. }
  13037. quickPrayers[types[i]] = 0;
  13038. variousSettings[quickConfigIDs[types[i]]] = 0;
  13039. method33(quickConfigIDs[types[i]]);
  13040. needDrawTabArea = true;
  13041. if(dialogID != -1)
  13042. inputTaken = true;
  13043. } else {
  13044. quickPrayers[index] = (quickPrayers[index] + 1) % 2;
  13045. variousSettings[quickConfigIDs[index]] = quickPrayers[index];
  13046. method33(quickConfigIDs[index]);
  13047. needDrawTabArea = true;
  13048. if(dialogID != -1)
  13049. inputTaken = true;
  13050. }
  13051. }
  13052. } else {
  13053. quickPrayers[index] = (quickPrayers[index] + 1) % 2;
  13054. variousSettings[quickConfigIDs[index]] = quickPrayers[index];
  13055. method33(quickConfigIDs[index]);
  13056. needDrawTabArea = true;
  13057. if(dialogID != -1)
  13058. inputTaken = true;
  13059. }
  13060. } else {
  13061. pushMessage("You need a Prayer level of atleast " + prayerLevelRequirements[index] + " to use " + prayerName[index] + ".", 0, "");
  13062. }
  13063. } else if(prayerInterfaceType == 22500) {
  13064. if(getOrbValues(1,null)[1] >= curseLevelRequirements[index]) {
  13065. int[] types = getCurseTypeForIndex(index);
  13066. if(types != null) {
  13067. for(int i = 0; i < types.length; i++) {
  13068. if(index != types[i]) {
  13069. quickCurses[types[i]] = 0;
  13070. variousSettings[quickConfigIDs[types[i]]] = 0;
  13071. method33(quickConfigIDs[types[i]]);
  13072. needDrawTabArea = true;
  13073. if(dialogID != -1)
  13074. inputTaken = true;
  13075. }
  13076. }
  13077. }
  13078. quickCurses[index] = (quickCurses[index] + 1) % 2;
  13079. variousSettings[quickConfigIDs[index]] = quickCurses[index];
  13080. method33(quickConfigIDs[index]);
  13081. needDrawTabArea = true;
  13082. if(dialogID != -1)
  13083. inputTaken = true;
  13084. } else {
  13085. pushMessage("You need a Prayer level of atleast " + curseLevelRequirements[index] + " to use " + curseName[index] + ".", 0, "");
  13086. }
  13087. }
  13088. }
  13089.  
  13090. public void sendFrame36(int id,int state) {
  13091. anIntArray1045[id] = state;
  13092. if(variousSettings[id] != state) {
  13093. variousSettings[id] = state;
  13094. method33(id);
  13095. needDrawTabArea = true;
  13096. if(dialogID != -1)
  13097. inputTaken = true;
  13098. }
  13099. }
  13100.  
  13101. public void sendFrame219() {
  13102. if(invOverlayInterfaceID != -1) {
  13103. invOverlayInterfaceID = -1;
  13104. needDrawTabArea = true;
  13105. tabAreaAltered = true;
  13106. }
  13107. if(backDialogID != -1) {
  13108. backDialogID = -1;
  13109. inputTaken = true;
  13110. }
  13111. if(inputDialogState != 0) {
  13112. inputDialogState = 0;
  13113. inputTaken = true;
  13114. }
  13115. openInterfaceID = -1;
  13116. aBoolean1149 = false;
  13117. }
  13118.  
  13119. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  13120. if(backDialogID != -1) {
  13121. backDialogID = -1;
  13122. inputTaken = true;
  13123. }
  13124. if(inputDialogState != 0) {
  13125. inputDialogState = 0;
  13126. inputTaken = true;
  13127. }
  13128. openInterfaceID = interfaceID;
  13129. invOverlayInterfaceID = sideInterfaceID;
  13130. needDrawTabArea = true;
  13131. tabAreaAltered = true;
  13132. aBoolean1149 = false;
  13133. }
  13134.  
  13135. private int editedTextFrame = 0;
  13136. private String newText = "";
  13137. private boolean parsePacket() {
  13138. if(socketStream == null)
  13139. return false;
  13140. try {
  13141. int i = socketStream.available();
  13142. if(i == 0)
  13143. return false;
  13144. if(pktType == -1) {
  13145. socketStream.flushInputStream(inStream.buffer, 1);
  13146. pktType = inStream.buffer[0] & 0xff;
  13147. if(encryption != null)
  13148. pktType = pktType - encryption.getNextKey() & 0xff;
  13149. pktSize = SizeConstants.packetSizes[pktType];
  13150. i--;
  13151. }
  13152. if(pktSize == -1)
  13153. if(i > 0) {
  13154. socketStream.flushInputStream(inStream.buffer, 1);
  13155. pktSize = inStream.buffer[0] & 0xff;
  13156. i--;
  13157. } else {
  13158. return false;
  13159. }
  13160. if(pktSize == -2)
  13161. if(i > 1) {
  13162. socketStream.flushInputStream(inStream.buffer, 2);
  13163. inStream.currentOffset = 0;
  13164. pktSize = inStream.readUnsignedWord();
  13165. i -= 2;
  13166. } else {
  13167. return false;
  13168. }
  13169. if(i < pktSize)
  13170. return false;
  13171. inStream.currentOffset = 0;
  13172. socketStream.flushInputStream(inStream.buffer, pktSize);
  13173. anInt1009 = 0;
  13174. anInt843 = anInt842;
  13175. anInt842 = anInt841;
  13176. anInt841 = pktType;
  13177. switch(pktType) {
  13178. case 81:
  13179. updatePlayers(pktSize, inStream);
  13180. if(openInterfaceID == 26000) {
  13181. sendFrame36(650,functionKeys ? 1 : 0);
  13182. sendFrame36(651,healthBars ? 1 : 0);
  13183. sendFrame36(652,newDamage ? 1 : 0);
  13184. }
  13185. sendFrame36(175,(openInterfaceID == 26000) ? 1 : 0);
  13186. sendFrame36(653,toggleFullscreen ? 1 : 0);
  13187. aBoolean1080 = false;
  13188. pktType = -1;
  13189. return true;
  13190.  
  13191. case 176:
  13192. daysSinceRecovChange = inStream.method427();
  13193. unreadMessages = inStream.method435();
  13194. membersInt = inStream.readUnsignedByte();
  13195. anInt1193 = inStream.method440();
  13196. daysSinceLastLogin = inStream.readUnsignedWord();
  13197. if(anInt1193 != 0 && openInterfaceID == -1) {
  13198. signlink.dnslookup(TextClass.method586(anInt1193));
  13199. clearTopInterfaces();
  13200. char c = '\u028A';
  13201. if(daysSinceRecovChange != 201 || membersInt == 1)
  13202. c = '\u028F';
  13203. reportAbuseInput = "";
  13204. canMute = false;
  13205. canBan = false;
  13206. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13207. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  13208. continue;
  13209. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13210.  
  13211. }
  13212. }
  13213. pktType = -1;
  13214. return true;
  13215.  
  13216. case 64:
  13217. anInt1268 = inStream.method427();
  13218. anInt1269 = inStream.method428();
  13219. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  13220. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  13221. if(groundArray[plane][j][l9] != null) {
  13222. groundArray[plane][j][l9] = null;
  13223. spawnGroundItem(j, l9);
  13224. }
  13225. }
  13226. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  13227. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  13228. class30_sub1.anInt1294 = 0;
  13229. pktType = -1;
  13230. return true;
  13231.  
  13232. case 185:
  13233. int k = inStream.method436();
  13234. RSInterface.interfaceCache[k].anInt233 = 3;
  13235. if(myPlayer.desc == null)
  13236. 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];
  13237. else
  13238. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  13239. pktType = -1;
  13240. return true;
  13241.  
  13242. /* Clan chat packet */
  13243. case 217:
  13244. try {
  13245. name = inStream.readString();
  13246. message = inStream.readString();
  13247. clanname = inStream.readString();
  13248. rights = inStream.readUnsignedWord();
  13249. //message = TextInput.processText(message);
  13250. //message = Censor.doCensor(message);
  13251. System.out.println(clanname);
  13252. pushMessage(message, 16, name);
  13253. } catch(Exception e) {
  13254. e.printStackTrace();
  13255. }
  13256. pktType = -1;
  13257. return true;
  13258.  
  13259. case 107:
  13260. aBoolean1160 = false;
  13261. for(int l = 0; l < 5; l++)
  13262. aBooleanArray876[l] = false;
  13263. pktType = -1;
  13264. return true;
  13265.  
  13266. case 72:
  13267. int i1 = inStream.method434();
  13268. RSInterface class9 = RSInterface.interfaceCache[i1];
  13269. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  13270. class9.inv[k15] = -1;
  13271. class9.inv[k15] = 0;
  13272. }
  13273. pktType = -1;
  13274. return true;
  13275.  
  13276. case 214:
  13277. ignoreCount = pktSize / 8;
  13278. for(int j1 = 0; j1 < ignoreCount; j1++)
  13279. ignoreListAsLongs[j1] = inStream.readQWord();
  13280. pktType = -1;
  13281. return true;
  13282.  
  13283. case 166:
  13284. aBoolean1160 = true;
  13285. anInt1098 = inStream.readUnsignedByte();
  13286. anInt1099 = inStream.readUnsignedByte();
  13287. anInt1100 = inStream.readUnsignedWord();
  13288. anInt1101 = inStream.readUnsignedByte();
  13289. anInt1102 = inStream.readUnsignedByte();
  13290. if(anInt1102 >= 100) {
  13291. xCameraPos = anInt1098 * 128 + 64;
  13292. yCameraPos = anInt1099 * 128 + 64;
  13293. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  13294. }
  13295. pktType = -1;
  13296. return true;
  13297.  
  13298. case 134:
  13299. needDrawTabArea = true;
  13300. int skillIndex = inStream.readUnsignedByte();
  13301. int i10 = inStream.method439();
  13302. int l15 = inStream.readUnsignedByte();
  13303. int xp = currentExp[skillIndex];
  13304. currentExp[skillIndex] = i10;
  13305. currentStats[skillIndex] = l15;
  13306. maxStats[skillIndex] = 1;
  13307. xpCounter += currentExp[skillIndex]-xp;
  13308. expAdded = currentExp[skillIndex]-xp;
  13309. for(int k20 = 0; k20 < 98; k20++)
  13310. if(i10 >= anIntArray1019[k20])
  13311. maxStats[skillIndex] = k20 + 2;
  13312. pktType = -1;
  13313. return true;
  13314.  
  13315. case 71:
  13316. int l1 = inStream.readUnsignedWord();
  13317. int j10 = inStream.method426();
  13318. if(l1 == 65535)
  13319. l1 = -1;
  13320. if(j10 == 5) {
  13321. loadTickSelection = false;
  13322. if(orbToggle[1] && prayerInterfaceType != l1) {
  13323. turnOffPrayers();
  13324. turnOffCurses();
  13325. turnOffQuickTicks();
  13326. orbToggle[1] = !orbToggle[1];
  13327. }
  13328. prayerInterfaceType = l1;
  13329. }
  13330. tabInterfaceIDs[j10] = l1;
  13331. needDrawTabArea = true;
  13332. tabAreaAltered = true;
  13333. pktType = -1;
  13334. return true;
  13335.  
  13336. case 74:
  13337. int i2 = inStream.method434();
  13338. if(i2 == 65535)
  13339. i2 = -1;
  13340. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  13341. nextSong = i2;
  13342. songChanging = true;
  13343. onDemandFetcher.method558(2, nextSong);
  13344. }
  13345. currentSong = i2;
  13346. pktType = -1;
  13347. return true;
  13348.  
  13349. case 121:
  13350. int j2 = inStream.method436();
  13351. int k10 = inStream.method435();
  13352. if(musicEnabled && !lowMem) {
  13353. nextSong = j2;
  13354. songChanging = false;
  13355. onDemandFetcher.method558(2, nextSong);
  13356. prevSong = k10;
  13357. }
  13358. pktType = -1;
  13359. return true;
  13360.  
  13361. case 109:
  13362. resetLogout();
  13363. pktType = -1;
  13364. return false;
  13365.  
  13366. case 70:
  13367. int k2 = inStream.readSignedWord();
  13368. int l10 = inStream.method437();
  13369. int i16 = inStream.method434();
  13370. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  13371. class9_5.anInt263 = k2;
  13372. class9_5.anInt265 = l10;
  13373. pktType = -1;
  13374. return true;
  13375.  
  13376. case 73:
  13377. case 241:
  13378. int l2 = anInt1069;
  13379. int i11 = anInt1070;
  13380. if(pktType == 73) {
  13381. l2 = inStream.method435();
  13382. i11 = inStream.readUnsignedWord();
  13383. aBoolean1159 = false;
  13384. }
  13385. if(pktType == 241) {
  13386. i11 = inStream.method435();
  13387. inStream.initBitAccess();
  13388. for(int j16 = 0; j16 < 4; j16++) {
  13389. for(int l20 = 0; l20 < 13; l20++) {
  13390. for(int j23 = 0; j23 < 13; j23++) {
  13391. int i26 = inStream.readBits(1);
  13392. if(i26 == 1)
  13393. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  13394. else
  13395. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  13396. }
  13397. }
  13398. }
  13399. inStream.finishBitAccess();
  13400. l2 = inStream.readUnsignedWord();
  13401. aBoolean1159 = true;
  13402. }
  13403. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  13404. pktType = -1;
  13405. return true;
  13406. }
  13407. anInt1069 = l2;
  13408. anInt1070 = i11;
  13409. baseX = (anInt1069 - 6) * 8;
  13410. baseY = (anInt1070 - 6) * 8;
  13411. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  13412. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  13413. aBoolean1141 = true;
  13414. loadingStage = 1;
  13415. aLong824 = System.currentTimeMillis();
  13416. main3DArea.initDrawingArea();
  13417. normalFont.drawText(0, "Loading RuinedScape - please wait.", 151, 257);
  13418. normalFont.drawText(0xffffff, "Loading RuinedScape - please wait.", 150, 256);
  13419. main3DArea.drawGraphics(toggleFullscreen ? 0 : 4, super.graphics, toggleFullscreen ? 0 : 4);
  13420. if(pktType == 73) {
  13421. int k16 = 0;
  13422. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  13423. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  13424. k16++;
  13425. }
  13426. aByteArrayArray1183 = new byte[k16][];
  13427. aByteArrayArray1247 = new byte[k16][];
  13428. anIntArray1234 = new int[k16];
  13429. anIntArray1235 = new int[k16];
  13430. anIntArray1236 = new int[k16];
  13431. k16 = 0;
  13432. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  13433. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  13434. anIntArray1234[k16] = (l23 << 8) + j26;
  13435. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  13436. anIntArray1235[k16] = -1;
  13437. anIntArray1236[k16] = -1;
  13438. k16++;
  13439. } else {
  13440. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  13441. if(k28 != -1)
  13442. onDemandFetcher.method558(3, k28);
  13443. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  13444. if(j30 != -1)
  13445. onDemandFetcher.method558(3, j30);
  13446. k16++;
  13447. }
  13448. }
  13449. }
  13450. }
  13451. if(pktType == 241) {
  13452. int l16 = 0;
  13453. int ai[] = new int[676];
  13454. for(int i24 = 0; i24 < 4; i24++) {
  13455. for(int k26 = 0; k26 < 13; k26++) {
  13456. for(int l28 = 0; l28 < 13; l28++) {
  13457. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  13458. if(k30 != -1) {
  13459. int k31 = k30 >> 14 & 0x3ff;
  13460. int i32 = k30 >> 3 & 0x7ff;
  13461. int k32 = (k31 / 8 << 8) + i32 / 8;
  13462. for(int j33 = 0; j33 < l16; j33++) {
  13463. if(ai[j33] != k32)
  13464. continue;
  13465. k32 = -1;
  13466.  
  13467. }
  13468. if(k32 != -1)
  13469. ai[l16++] = k32;
  13470. }
  13471. }
  13472. }
  13473. }
  13474. aByteArrayArray1183 = new byte[l16][];
  13475. aByteArrayArray1247 = new byte[l16][];
  13476. anIntArray1234 = new int[l16];
  13477. anIntArray1235 = new int[l16];
  13478. anIntArray1236 = new int[l16];
  13479. for(int l26 = 0; l26 < l16; l26++) {
  13480. int i29 = anIntArray1234[l26] = ai[l26];
  13481. int l30 = i29 >> 8 & 0xff;
  13482. int l31 = i29 & 0xff;
  13483. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  13484. if(j32 != -1)
  13485. onDemandFetcher.method558(3, j32);
  13486. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  13487. if(i33 != -1)
  13488. onDemandFetcher.method558(3, i33);
  13489. }
  13490. }
  13491. int i17 = baseX - anInt1036;
  13492. int j21 = baseY - anInt1037;
  13493. anInt1036 = baseX;
  13494. anInt1037 = baseY;
  13495. for(int j24 = 0; j24 < 16384; j24++) {
  13496. NPC npc = npcArray[j24];
  13497. if(npc != null) {
  13498. for(int j29 = 0; j29 < 10; j29++) {
  13499. npc.smallX[j29] -= i17;
  13500. npc.smallY[j29] -= j21;
  13501. }
  13502. npc.x -= i17 * 128;
  13503. npc.y -= j21 * 128;
  13504. }
  13505. }
  13506. for(int i27 = 0; i27 < maxPlayers; i27++) {
  13507. Player player = playerArray[i27];
  13508. if(player != null) {
  13509. for(int i31 = 0; i31 < 10; i31++) {
  13510. player.smallX[i31] -= i17;
  13511. player.smallY[i31] -= j21;
  13512. }
  13513. player.x -= i17 * 128;
  13514. player.y -= j21 * 128;
  13515. }
  13516. }
  13517. aBoolean1080 = true;
  13518. byte byte1 = 0;
  13519. byte byte2 = 104;
  13520. byte byte3 = 1;
  13521. if(i17 < 0) {
  13522. byte1 = 103;
  13523. byte2 = -1;
  13524. byte3 = -1;
  13525. }
  13526. byte byte4 = 0;
  13527. byte byte5 = 104;
  13528. byte byte6 = 1;
  13529. if(j21 < 0) {
  13530. byte4 = 103;
  13531. byte5 = -1;
  13532. byte6 = -1;
  13533. }
  13534. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  13535. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  13536. int i34 = k33 + i17;
  13537. int j34 = l33 + j21;
  13538. for(int k34 = 0; k34 < 4; k34++)
  13539. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  13540. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  13541. else
  13542. groundArray[k34][k33][l33] = null;
  13543. }
  13544. }
  13545. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  13546. class30_sub1_1.anInt1297 -= i17;
  13547. class30_sub1_1.anInt1298 -= j21;
  13548. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  13549. class30_sub1_1.unlink();
  13550. }
  13551. if(destX != 0) {
  13552. destX -= i17;
  13553. destY -= j21;
  13554. }
  13555. aBoolean1160 = false;
  13556. pktType = -1;
  13557. return true;
  13558.  
  13559. case 208:
  13560. int i3 = inStream.method437();
  13561. if(i3 >= 0)
  13562. method60(i3);
  13563. walkableInterfaceID = i3;
  13564. pktType = -1;
  13565. return true;
  13566.  
  13567. case 99:
  13568. minimapCover = inStream.readUnsignedByte();
  13569. pktType = -1;
  13570. return true;
  13571.  
  13572. case 75:
  13573. int j3 = inStream.method436();
  13574. int j11 = inStream.method436();
  13575. RSInterface.interfaceCache[j11].anInt233 = 2;
  13576. RSInterface.interfaceCache[j11].mediaID = j3;
  13577. pktType = -1;
  13578. return true;
  13579.  
  13580. case 114:
  13581. systemUpdatetime = inStream.method434() * 30;
  13582. pktType = -1;
  13583. return true;
  13584.  
  13585. case 60:
  13586. anInt1269 = inStream.readUnsignedByte();
  13587. anInt1268 = inStream.method427();
  13588. while(inStream.currentOffset < pktSize) {
  13589. int k3 = inStream.readUnsignedByte();
  13590. method137(inStream, k3);
  13591. }
  13592. pktType = -1;
  13593. return true;
  13594.  
  13595. case 35:
  13596. int l3 = inStream.readUnsignedByte();
  13597. int k11 = inStream.readUnsignedByte();
  13598. int j17 = inStream.readUnsignedByte();
  13599. int k21 = inStream.readUnsignedByte();
  13600. aBooleanArray876[l3] = true;
  13601. anIntArray873[l3] = k11;
  13602. anIntArray1203[l3] = j17;
  13603. anIntArray928[l3] = k21;
  13604. anIntArray1030[l3] = 0;
  13605. pktType = -1;
  13606. return true;
  13607.  
  13608. case 174:
  13609. int i4 = inStream.readUnsignedWord();
  13610. int l11 = inStream.readUnsignedByte();
  13611. int k17 = inStream.readUnsignedWord();
  13612. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  13613. anIntArray1207[anInt1062] = i4;
  13614. anIntArray1241[anInt1062] = l11;
  13615. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  13616. anInt1062++;
  13617. }
  13618. pktType = -1;
  13619. return true;
  13620.  
  13621. case 104:
  13622. int j4 = inStream.method427();
  13623. int i12 = inStream.method426();
  13624. String s6 = inStream.readString();
  13625. if(j4 >= 1 && j4 <= 5) {
  13626. if(s6.equalsIgnoreCase("null"))
  13627. s6 = null;
  13628. atPlayerActions[j4 - 1] = s6;
  13629. atPlayerArray[j4 - 1] = i12 == 0;
  13630. }
  13631. pktType = -1;
  13632. return true;
  13633.  
  13634. case 78:
  13635. destX = 0;
  13636. pktType = -1;
  13637. return true;
  13638.  
  13639. case 253:
  13640. String s = inStream.readString();
  13641. if(s.startsWith("Alert##")) {
  13642. String[] args = s.split("##");
  13643. if (args.length == 3) {
  13644. alertHandler.alert = new Alert("Notification", args[1], args[2]);
  13645. } else if (args.length == 4) {
  13646. alertHandler.alert = new Alert(args[1], args[2], args[3]);
  13647. }
  13648. pktType = -1;
  13649. return true;
  13650. }
  13651. if(s.toLowerCase().contains("oh dear you are dead!")) {
  13652. if(orbToggle[1]) {
  13653. turnOffPrayers();
  13654. turnOffCurses();
  13655. orbToggle[1] = false;
  13656. }
  13657. }
  13658. if(s.toLowerCase().contains("@autocastoff")) {
  13659. setAutoCastOff();
  13660. break;
  13661. }
  13662. if(s.toLowerCase().contains("you have been poisoned")) {
  13663. orbToggle[0] = true;
  13664. }
  13665. if(s.toLowerCase().contains("you are no longer poisoned") || s.toLowerCase().contains("your antipoison potion") || s.toLowerCase().contains("antidote")) {
  13666. System.out.println("s: " + s);
  13667. orbToggle[0] = false;
  13668. }
  13669. if(s.endsWith(":tradereq:")) {
  13670. String s3 = s.substring(0, s.indexOf(":"));
  13671. long l17 = TextClass.longForName(s3);
  13672. boolean flag2 = false;
  13673. for(int j27 = 0; j27 < ignoreCount; j27++) {
  13674. if(ignoreListAsLongs[j27] != l17)
  13675. continue;
  13676. flag2 = true;
  13677.  
  13678. }
  13679. if(!flag2 && anInt1251 == 0)
  13680. pushMessage("wishes to trade with you.", 4, s3);
  13681. } else if (s.endsWith(":ooo33:")) {
  13682. String s4 = s.substring(0, s.indexOf(":"));
  13683. long l18 = TextClass.longForName(s4);
  13684. pushMessage("Clan: ", 8, s4);
  13685. } else if(s.endsWith("#url#")) {
  13686. String link = s.substring(0, s.indexOf("#"));
  13687. pushMessage("Join us at: ", 9, link);
  13688. } else if(s.startsWith("#010#")) {
  13689. shoutYell = s.substring(5);
  13690. nameYell = "";
  13691. if(s.contains("@cr1@"))
  13692. nameYell = "1";
  13693. if(s.contains("@cr2@"))
  13694. nameYell = "2";
  13695. if(s.contains("@cr5@"))
  13696. nameYell = "5";
  13697.  
  13698. pushMessage(shoutYell, 16, nameYell);
  13699. } else if(s.contains("#link-") && s.endsWith("#")) {
  13700. int firstIndex = s.indexOf('-');
  13701. int lastIndex = s.lastIndexOf('#');
  13702. String link = s.substring(firstIndex + 1,lastIndex);
  13703. pushMessage(s.substring(0,s.indexOf('#')), 9, link);
  13704. } else if(s.endsWith(":duelreq:")) {
  13705. String s4 = s.substring(0, s.indexOf(":"));
  13706. long l18 = TextClass.longForName(s4);
  13707. boolean flag3 = false;
  13708. for(int k27 = 0; k27 < ignoreCount; k27++) {
  13709. if(ignoreListAsLongs[k27] != l18)
  13710. continue;
  13711. flag3 = true;
  13712.  
  13713. }
  13714. if(!flag3 && anInt1251 == 0)
  13715. pushMessage("wishes to duel with you.", 8, s4);
  13716. } else if(s.endsWith(":chalreq:")) {
  13717. String s5 = s.substring(0, s.indexOf(":"));
  13718. long l19 = TextClass.longForName(s5);
  13719. boolean flag4 = false;
  13720. for(int l27 = 0; l27 < ignoreCount; l27++) {
  13721. if(ignoreListAsLongs[l27] != l19)
  13722. continue;
  13723. flag4 = true;
  13724.  
  13725. }
  13726. if(!flag4 && anInt1251 == 0) {
  13727. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  13728. pushMessage(s8, 8, s5);
  13729. }
  13730. } else {
  13731. pushMessage(s, 0, "");
  13732. }
  13733. pktType = -1;
  13734. return true;
  13735.  
  13736. case 1:
  13737. for(int k4 = 0; k4 < playerArray.length; k4++)
  13738. if(playerArray[k4] != null)
  13739. playerArray[k4].anim = -1;
  13740. for(int j12 = 0; j12 < npcArray.length; j12++)
  13741. if(npcArray[j12] != null)
  13742. npcArray[j12].anim = -1;
  13743. pktType = -1;
  13744. return true;
  13745.  
  13746. case 50:
  13747. long l4 = inStream.readQWord();
  13748. int i18 = inStream.readUnsignedByte();
  13749. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  13750. for(int k24 = 0; k24 < friendsCount; k24++) {
  13751. if(l4 != friendsListAsLongs[k24])
  13752. continue;
  13753. if(friendsNodeIDs[k24] != i18) {
  13754. friendsNodeIDs[k24] = i18;
  13755. needDrawTabArea = true;
  13756. if(i18 >= 2) {
  13757. pushMessage(s7 + " has logged in.", 5, "");
  13758. }
  13759. if(i18 <= 1) {
  13760. pushMessage(s7 + " has logged out.", 5, "");
  13761. }
  13762. }
  13763. s7 = null;
  13764.  
  13765. }
  13766. if(s7 != null && friendsCount < 200) {
  13767. friendsListAsLongs[friendsCount] = l4;
  13768. friendsList[friendsCount] = s7;
  13769. friendsNodeIDs[friendsCount] = i18;
  13770. friendsCount++;
  13771. needDrawTabArea = true;
  13772. }
  13773. for(boolean flag6 = false; !flag6;) {
  13774. flag6 = true;
  13775. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  13776. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  13777. int j31 = friendsNodeIDs[k29];
  13778. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  13779. friendsNodeIDs[k29 + 1] = j31;
  13780. String s10 = friendsList[k29];
  13781. friendsList[k29] = friendsList[k29 + 1];
  13782. friendsList[k29 + 1] = s10;
  13783. long l32 = friendsListAsLongs[k29];
  13784. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  13785. friendsListAsLongs[k29 + 1] = l32;
  13786. needDrawTabArea = true;
  13787. flag6 = false;
  13788. }
  13789. }
  13790. pktType = -1;
  13791. return true;
  13792.  
  13793.  
  13794. case 110:
  13795. if(tabID == 12)
  13796. needDrawTabArea = true;
  13797. energy = inStream.readUnsignedByte();
  13798. pktType = -1;
  13799. return true;
  13800.  
  13801. case 254:
  13802. hintType = inStream.readUnsignedByte();
  13803. if(hintType == 1)
  13804. hintArrowNPCID = inStream.readUnsignedWord();
  13805. if(hintType >= 2 && hintType <= 6) {
  13806. if(hintType == 2) {
  13807. anInt937 = 64;
  13808. anInt938 = 64;
  13809. }
  13810. if(hintType == 3) {
  13811. anInt937 = 0;
  13812. anInt938 = 64;
  13813. }
  13814. if(hintType == 4) {
  13815. anInt937 = 128;
  13816. anInt938 = 64;
  13817. }
  13818. if(hintType == 5) {
  13819. anInt937 = 64;
  13820. anInt938 = 0;
  13821. }
  13822. if(hintType == 6) {
  13823. anInt937 = 64;
  13824. anInt938 = 128;
  13825. }
  13826. hintType = 2;
  13827. hintArrowX = inStream.readUnsignedWord();
  13828. hintArrowY = inStream.readUnsignedWord();
  13829. anInt936 = inStream.readUnsignedByte();
  13830. }
  13831. if(hintType == 10)
  13832. hintArrowPlayerID = inStream.readUnsignedWord();
  13833. pktType = -1;
  13834. return true;
  13835.  
  13836. case 248:
  13837. int i5 = inStream.method435();
  13838. int k12 = inStream.readUnsignedWord();
  13839. if(backDialogID != -1) {
  13840. backDialogID = -1;
  13841. inputTaken = true;
  13842. }
  13843. if(inputDialogState != 0) {
  13844. inputDialogState = 0;
  13845. inputTaken = true;
  13846. }
  13847. openInterfaceID = i5;
  13848. invOverlayInterfaceID = k12;
  13849. needDrawTabArea = true;
  13850. tabAreaAltered = true;
  13851. aBoolean1149 = false;
  13852. pktType = -1;
  13853. return true;
  13854.  
  13855. case 79:
  13856. int j5 = inStream.method434();
  13857. int l12 = inStream.method435();
  13858. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  13859. if(class9_3 != null && class9_3.type == 0) {
  13860. if(l12 < 0)
  13861. l12 = 0;
  13862. if(l12 > class9_3.scrollMax - class9_3.height)
  13863. l12 = class9_3.scrollMax - class9_3.height;
  13864. class9_3.scrollPosition = l12;
  13865. }
  13866. pktType = -1;
  13867. return true;
  13868.  
  13869. case 68:
  13870. for(int k5 = 0; k5 < variousSettings.length; k5++)
  13871. if(variousSettings[k5] != anIntArray1045[k5]) {
  13872. variousSettings[k5] = anIntArray1045[k5];
  13873. method33(k5);
  13874. needDrawTabArea = true;
  13875. }
  13876. pktType = -1;
  13877. return true;
  13878.  
  13879. case 196:
  13880. long longForName = inStream.readQWord();
  13881. int j18 = inStream.readDWord();
  13882. int rights = inStream.readUnsignedByte();
  13883. boolean flag5 = false;
  13884. if(rights <= 1) {
  13885. for(int l29 = 0; l29 < ignoreCount; l29++) {
  13886. if(ignoreListAsLongs[l29] != longForName)
  13887. continue;
  13888. flag5 = true;
  13889.  
  13890. }
  13891. }
  13892. if(!flag5 && anInt1251 == 0)
  13893. try {
  13894. anIntArray1240[anInt1169] = j18;
  13895. anInt1169 = (anInt1169 + 1) % 100;
  13896. String s9 = TextInput.method525(pktSize - 13, inStream);
  13897. //if(rights != 3)
  13898. //s9 = Censor.doCensor(s9);
  13899. if(rights != 0)
  13900. pushMessage(s9, 7, "@cr" + rights + "@" + TextClass.fixName(TextClass.nameForLong(longForName)));
  13901. else
  13902. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(longForName)));
  13903. } catch(Exception exception1) {
  13904. signlink.reporterror("cde1");
  13905. }
  13906. pktType = -1;
  13907. return true;
  13908.  
  13909. case 85:
  13910. anInt1269 = inStream.method427();
  13911. anInt1268 = inStream.method427();
  13912. pktType = -1;
  13913. return true;
  13914.  
  13915. case 24:
  13916. tabIconFlash = inStream.method428();
  13917. if(tabIconFlash == tabID) {
  13918. if(tabIconFlash == 3)
  13919. tabID = 1;
  13920. else
  13921. tabID = 3;
  13922. needDrawTabArea = true;
  13923. }
  13924. pktType = -1;
  13925. return true;
  13926.  
  13927. case 246:
  13928. int frameId = inStream.method434();
  13929. int zoom = inStream.readUnsignedWord();
  13930. int itemId = inStream.readUnsignedWord();
  13931. if(itemId == 65535) {
  13932. RSInterface.interfaceCache[frameId].anInt233 = 0;
  13933. pktType = -1;
  13934. return true;
  13935. } else {
  13936. ItemDef itemDef = ItemDef.forID(itemId);
  13937. RSInterface.interfaceCache[frameId].anInt233 = 4;
  13938. RSInterface.interfaceCache[frameId].mediaID = itemId;
  13939. RSInterface.interfaceCache[frameId].modelRotation1 = itemDef.modelRotation1;
  13940. RSInterface.interfaceCache[frameId].modelRotation2 = itemDef.modelRotation2;
  13941. RSInterface.interfaceCache[frameId].modelZoom = (itemDef.modelZoom * 100) / zoom;
  13942. pktType = -1;
  13943. return true;
  13944. }
  13945.  
  13946. case 171:
  13947. boolean flag1 = inStream.readUnsignedByte() == 1;
  13948. int j13 = inStream.readUnsignedWord();
  13949. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  13950. pktType = -1;
  13951. return true;
  13952.  
  13953. case 142:
  13954. int j6 = inStream.method434();
  13955. method60(j6);
  13956. if(backDialogID != -1) {
  13957. backDialogID = -1;
  13958. inputTaken = true;
  13959. }
  13960. if(inputDialogState != 0) {
  13961. inputDialogState = 0;
  13962. inputTaken = true;
  13963. }
  13964. invOverlayInterfaceID = j6;
  13965. needDrawTabArea = true;
  13966. tabAreaAltered = true;
  13967. openInterfaceID = -1;
  13968. aBoolean1149 = false;
  13969. pktType = -1;
  13970. return true;
  13971.  
  13972. case 126:
  13973. newText = inStream.readString();
  13974. String text = newText;
  13975. editedTextFrame = inStream.method435();
  13976. int frame = editedTextFrame;
  13977. if (text.startsWith(":mp3:")) {
  13978. String[] args = text.split(":mp3:");
  13979. MP3 mp3 = new MP3("signlink.findcachedir()/Mp3/"+args[1]+".mp3");
  13980. mp3.play();
  13981. pktType = -1;
  13982. return true;
  13983. }
  13984. if (text.startsWith("www.")) {
  13985. launchURL(text);
  13986. pktType = -1;
  13987. return true;
  13988. }
  13989. if(text.startsWith("full"))
  13990. {
  13991. String[] args = text.split(" ");
  13992. int id1 = Integer.parseInt(args[1]);
  13993. int id2 = Integer.parseInt(args[2]);
  13994. fullscreenInterfaceID = id1;
  13995. openInterfaceID = id2;
  13996. pktType = -1;
  13997. return true;
  13998. }
  13999. updateStrings(text, frame);
  14000. sendFrame126(text, frame);
  14001. if (frame >= 18144 && frame <= 18244) {
  14002. clanList[frame - 18144] = text;
  14003. }
  14004. pktType = -1;
  14005. return true;
  14006.  
  14007. case 206:
  14008. publicChatMode = inStream.readUnsignedByte();
  14009. privateChatMode = inStream.readUnsignedByte();
  14010. tradeMode = inStream.readUnsignedByte();
  14011. aBoolean1233 = true;
  14012. inputTaken = true;
  14013. pktType = -1;
  14014. return true;
  14015.  
  14016. case 240:
  14017. if(tabID == 12)
  14018. needDrawTabArea = true;
  14019. weight = inStream.readSignedWord();
  14020. pktType = -1;
  14021. return true;
  14022.  
  14023. case 8:
  14024. int k6 = inStream.method436();
  14025. int l13 = inStream.readUnsignedWord();
  14026. RSInterface.interfaceCache[k6].anInt233 = 1;
  14027. RSInterface.interfaceCache[k6].mediaID = l13;
  14028. pktType = -1;
  14029. return true;
  14030.  
  14031. case 122:
  14032. int l6 = inStream.method436();
  14033. int i14 = inStream.method436();
  14034. int i19 = i14 >> 10 & 0x1f;
  14035. int i22 = i14 >> 5 & 0x1f;
  14036. int l24 = i14 & 0x1f;
  14037. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  14038. pktType = -1;
  14039. return true;
  14040.  
  14041. case 53:
  14042. needDrawTabArea = true;
  14043. int i7 = inStream.readUnsignedWord();
  14044. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  14045. int j19 = inStream.readUnsignedWord();
  14046. for(int j22 = 0; j22 < j19; j22++) {
  14047. int i25 = inStream.readUnsignedByte();
  14048. if(i25 == 255)
  14049. i25 = inStream.method440();
  14050. class9_1.inv[j22] = inStream.method436();
  14051. class9_1.invStackSizes[j22] = i25;
  14052. }
  14053. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  14054. class9_1.inv[j25] = 0;
  14055. class9_1.invStackSizes[j25] = 0;
  14056. }
  14057. pktType = -1;
  14058. return true;
  14059.  
  14060. case 230:
  14061. int j7 = inStream.method435();
  14062. int j14 = inStream.readUnsignedWord();
  14063. int k19 = inStream.readUnsignedWord();
  14064. int k22 = inStream.method436();
  14065. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  14066. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  14067. RSInterface.interfaceCache[j14].modelZoom = j7;
  14068. pktType = -1;
  14069. return true;
  14070.  
  14071. case 221:
  14072. anInt900 = inStream.readUnsignedByte();
  14073. needDrawTabArea = true;
  14074. pktType = -1;
  14075. return true;
  14076.  
  14077. case 177:
  14078. aBoolean1160 = true;
  14079. anInt995 = inStream.readUnsignedByte();
  14080. anInt996 = inStream.readUnsignedByte();
  14081. anInt997 = inStream.readUnsignedWord();
  14082. anInt998 = inStream.readUnsignedByte();
  14083. anInt999 = inStream.readUnsignedByte();
  14084. if(anInt999 >= 100) {
  14085. int k7 = anInt995 * 128 + 64;
  14086. int k14 = anInt996 * 128 + 64;
  14087. int i20 = method42(plane, k14, k7) - anInt997;
  14088. int l22 = k7 - xCameraPos;
  14089. int k25 = i20 - zCameraPos;
  14090. int j28 = k14 - yCameraPos;
  14091. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  14092. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14093. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14094. if(yCameraCurve < 128)
  14095. yCameraCurve = 128;
  14096. if(yCameraCurve > 383)
  14097. yCameraCurve = 383;
  14098. }
  14099. pktType = -1;
  14100. return true;
  14101.  
  14102. case 249:
  14103. anInt1046 = inStream.method426();
  14104. unknownInt10 = inStream.method436();
  14105. pktType = -1;
  14106. return true;
  14107.  
  14108. case 65:
  14109. updateNPCs(inStream, pktSize);
  14110. pktType = -1;
  14111. return true;
  14112.  
  14113. case 27:
  14114. messagePromptRaised = false;
  14115. inputDialogState = 1;
  14116. amountOrNameInput = "";
  14117. inputTaken = true;
  14118. pktType = -1;
  14119. return true;
  14120.  
  14121. case 187:
  14122. messagePromptRaised = false;
  14123. inputDialogState = 2;
  14124. amountOrNameInput = "";
  14125. inputTaken = true;
  14126. pktType = -1;
  14127. return true;
  14128.  
  14129. case 97:
  14130. int l7 = inStream.readUnsignedWord();
  14131. method60(l7);
  14132. if(invOverlayInterfaceID != -1) {
  14133. invOverlayInterfaceID = -1;
  14134. needDrawTabArea = true;
  14135. tabAreaAltered = true;
  14136. }
  14137. if(backDialogID != -1) {
  14138. backDialogID = -1;
  14139. inputTaken = true;
  14140. }
  14141. if(inputDialogState != 0) {
  14142. inputDialogState = 0;
  14143. inputTaken = true;
  14144. }
  14145. openInterfaceID = l7;
  14146. aBoolean1149 = false;
  14147. pktType = -1;
  14148. return true;
  14149.  
  14150. case 218:
  14151. int i8 = inStream.method438();
  14152. dialogID = i8;
  14153. inputTaken = true;
  14154. pktType = -1;
  14155. return true;
  14156.  
  14157. case 87:
  14158. int j8 = inStream.method434();
  14159. int l14 = inStream.method439();
  14160. anIntArray1045[j8] = l14;
  14161. if(variousSettings[j8] != l14) {
  14162. variousSettings[j8] = l14;
  14163. method33(j8);
  14164. needDrawTabArea = true;
  14165. if(dialogID != -1)
  14166. inputTaken = true;
  14167. }
  14168. pktType = -1;
  14169. return true;
  14170.  
  14171. case 36:
  14172. int k8 = inStream.method434();
  14173. byte byte0 = inStream.readSignedByte();
  14174. anIntArray1045[k8] = byte0;
  14175. if(k8 == 152) {//running
  14176. if(byte0 == 1)
  14177. orbToggle[2] = true;
  14178. else
  14179. orbToggle[2] = false;
  14180. }
  14181. if(variousSettings[k8] != byte0) {
  14182. variousSettings[k8] = byte0;
  14183. method33(k8);
  14184. needDrawTabArea = true;
  14185. if(dialogID != -1)
  14186. inputTaken = true;
  14187. }
  14188. pktType = -1;
  14189. return true;
  14190.  
  14191. case 61:
  14192. displayOverLayIcon = inStream.readUnsignedByte();
  14193. pktType = -1;
  14194. return true;
  14195.  
  14196. case 200:
  14197. int l8 = inStream.readUnsignedWord();
  14198. int i15 = inStream.readSignedWord();
  14199. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14200. class9_4.anInt257 = i15;
  14201. if(i15 == -1) {
  14202. class9_4.anInt246 = 0;
  14203. class9_4.anInt208 = 0;
  14204. }
  14205. pktType = -1;
  14206. return true;
  14207.  
  14208. case 219:
  14209. if(invOverlayInterfaceID != -1) {
  14210. invOverlayInterfaceID = -1;
  14211. needDrawTabArea = true;
  14212. tabAreaAltered = true;
  14213. }
  14214. if(backDialogID != -1) {
  14215. backDialogID = -1;
  14216. inputTaken = true;
  14217. }
  14218. if(inputDialogState != 0) {
  14219. inputDialogState = 0;
  14220. inputTaken = true;
  14221. }
  14222. openInterfaceID = -1;
  14223. aBoolean1149 = false;
  14224. pktType = -1;
  14225. return true;
  14226.  
  14227. case 34:
  14228. needDrawTabArea = true;
  14229. int i9 = inStream.readUnsignedWord();
  14230. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14231. while(inStream.currentOffset < pktSize) {
  14232. int j20 = inStream.method422();
  14233. int i23 = inStream.readUnsignedWord();
  14234. int l25 = inStream.readUnsignedByte();
  14235. if(l25 == 255)
  14236. l25 = inStream.readDWord();
  14237. if(j20 >= 0 && j20 < class9_2.inv.length) {
  14238. class9_2.inv[j20] = i23;
  14239. class9_2.invStackSizes[j20] = l25;
  14240. }
  14241. }
  14242. pktType = -1;
  14243. return true;
  14244.  
  14245. case 4:
  14246. case 44:
  14247. case 84:
  14248. case 101:
  14249. case 105:
  14250. case 117:
  14251. case 147:
  14252. case 151:
  14253. case 156:
  14254. case 160:
  14255. case 215:
  14256. method137(inStream, pktType);
  14257. pktType = -1;
  14258. return true;
  14259.  
  14260. case 106:
  14261. tabID = inStream.method427();
  14262. needDrawTabArea = true;
  14263. tabAreaAltered = true;
  14264. pktType = -1;
  14265. return true;
  14266.  
  14267. case 164:
  14268. int j9 = inStream.method434();
  14269. method60(j9);
  14270. if(invOverlayInterfaceID != -1) {
  14271. invOverlayInterfaceID = -1;
  14272. needDrawTabArea = true;
  14273. tabAreaAltered = true;
  14274. }
  14275. backDialogID = j9;
  14276. inputTaken = true;
  14277. openInterfaceID = -1;
  14278. aBoolean1149 = false;
  14279. pktType = -1;
  14280. return true;
  14281. case 123:
  14282. pktType = -1;
  14283. return true;
  14284. }
  14285. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  14286. //resetLogout();
  14287. } catch(IOException _ex) {
  14288. dropClient();
  14289. } catch(Exception exception) {
  14290. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  14291. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  14292. s2 = s2 + inStream.buffer[j15] + ",";
  14293. signlink.reporterror(s2);
  14294. if(pktType == 126) {
  14295. System.out.println("Text editing packet send, but cant be received");
  14296. System.out.println("ID:"+editedTextFrame+", text:"+newText+"");
  14297. }
  14298. }
  14299. pktType = -1;
  14300. return true;
  14301. }
  14302.  
  14303. private void method146() {
  14304. anInt1265++;
  14305. method47(true);
  14306. method26(true);
  14307. method47(false);
  14308. method26(false);
  14309. method55();
  14310. method104();
  14311. if(!aBoolean1160) {
  14312. int i = anInt1184;
  14313. if(anInt984 / 256 > i)
  14314. i = anInt984 / 256;
  14315. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  14316. i = anIntArray1203[4] + 128;
  14317. int k = compassRotation + anInt896 & 0x7ff;
  14318. setCameraPos(600 + i * (toggleFullscreen ? 2 : 3), i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  14319. }
  14320. int j;
  14321. if(!aBoolean1160)
  14322. j = method120();
  14323. else
  14324. j = method121();
  14325. int l = xCameraPos;
  14326. int i1 = zCameraPos;
  14327. int j1 = yCameraPos;
  14328. int k1 = yCameraCurve;
  14329. int l1 = xCameraCurve;
  14330. for(int i2 = 0; i2 < 5; i2++)
  14331. if(aBooleanArray876[i2]) {
  14332. 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]);
  14333. if(i2 == 0)
  14334. xCameraPos += j2;
  14335. if(i2 == 1)
  14336. zCameraPos += j2;
  14337. if(i2 == 2)
  14338. yCameraPos += j2;
  14339. if(i2 == 3)
  14340. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  14341. if(i2 == 4) {
  14342. yCameraCurve += j2;
  14343. if(yCameraCurve < 128)
  14344. yCameraCurve = 128;
  14345. if(yCameraCurve > 383)
  14346. yCameraCurve = 383;
  14347. }
  14348. }
  14349. int k2 = Texture.anInt1481;
  14350. Model.aBoolean1684 = true;
  14351. Model.anInt1687 = 0;
  14352. Model.anInt1685 = super.mouseX - (toggleFullscreen ? 0 : 4);
  14353. Model.anInt1686 = super.mouseY - (toggleFullscreen ? 0 : 4);
  14354. DrawingArea.setAllPixelsToZero();
  14355. DrawingArea.drawPixels(getScreenHeight(), 0, 0, 0xC8C0A8, getScreenWidth());
  14356. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  14357. worldController.clearObj5Cache();
  14358. updateEntities();
  14359. drawHeadIcon();
  14360. method37(k2);
  14361. draw3dScreen();
  14362. drawCoinParts();
  14363. if(coinToggle){
  14364. int cash;
  14365. String Cash = RSInterface.interfaceCache[8135].message;
  14366. cash = Integer.parseInt(Cash);
  14367. coinPart.drawSprite(400+11+32, 87);
  14368. smallFont.method382(getMoneyOrbColor(cash), 485, new StringBuilder().append(RSInterface.interfaceCache[8134].message).append("").toString(), 102, true);
  14369. }
  14370. drawGameFrameOnFullScreen();
  14371. main3DArea.drawGraphics(toggleFullscreen ? 0 : 4, super.graphics, toggleFullscreen ? 0 : 4);
  14372. xCameraPos = l;
  14373. zCameraPos = i1;
  14374. yCameraPos = j1;
  14375. yCameraCurve = k1;
  14376. xCameraCurve = l1;
  14377. }
  14378. void sendPacket(int paramInt) {
  14379. if (paramInt == 103) {
  14380. stream.createFrame(103);
  14381. stream.writeWordBigEndian(this.inputString.length() - 1);
  14382. stream.writeString(this.inputString.substring(2));
  14383. inputString = "";
  14384. promptInput = "";
  14385. interfaceButtonAction = 0;
  14386. }
  14387. }
  14388.  
  14389. public void drawCoinParts(){
  14390. if(!coinToggle){
  14391. if(super.mouseX >= 512 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118){
  14392. coinOrbPart = new Sprite("Interfaces/Pouch/coinpart hover");
  14393. } else {
  14394. coinOrbPart = new Sprite("Interfaces/Pouch/coinpart normal");
  14395. }
  14396. }
  14397. coinOrbPart.drawSprite(505+4, 93-11);
  14398. }
  14399. public int getMoneyOrbColor(int cashAmount){
  14400. if(cashAmount >= 100000 && cashAmount <= 999999){
  14401. return 0xffffff;
  14402. } else {
  14403. return 65280;
  14404. }
  14405. }
  14406.  
  14407. public void drawCoinOrb(){//512 nontoggle
  14408. if(!coinToggle) {//436,87 534 x 118 y
  14409. if(super.mouseX >= 512 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118){
  14410. coinOrb = new Sprite("Interfaces/Pouch/coin simple hover");
  14411. } else {
  14412. coinOrb = new Sprite("Interfaces/Pouch/coin simple normal");
  14413. }
  14414. } else if(coinToggle) {
  14415. if(super.mouseX >= 436 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118){
  14416. coinOrb = new Sprite("Interfaces/Pouch/coin simple hover toggle");
  14417. coinPart = new Sprite("Interfaces/Pouch/coin complex hover toggle");
  14418. } else {
  14419. coinOrb = new Sprite("Interfaces/Pouch/coin simple normal toggle");
  14420. coinPart = new Sprite("Interfaces/Pouch/coin complex normal toggle");
  14421. }
  14422. }
  14423. coinOrb.drawSprite(520-300-200-20-4, 47+37);//+37
  14424.  
  14425. if(super.mouseX >= 436 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118) {
  14426. coinPart = new Sprite("Interfaces/Pouch/coin complex hover toggle");
  14427. coinOrb = new Sprite("Interfaces/Pouch/coin simple hover");
  14428. }
  14429. }
  14430.  
  14431. public void clearTopInterfaces() {
  14432. stream.createFrame(130);
  14433. if (invOverlayInterfaceID != -1) {
  14434. invOverlayInterfaceID = -1;
  14435. needDrawTabArea = true;
  14436. aBoolean1149 = false;
  14437. tabAreaAltered = true;
  14438. }
  14439. if (backDialogID != -1) {
  14440. backDialogID = -1;
  14441. inputTaken = true;
  14442. aBoolean1149 = false;
  14443. }
  14444. openInterfaceID = -1;
  14445. fullscreenInterfaceID = -1;
  14446. }
  14447.  
  14448. public client() {
  14449. alertHandler = new AlertHandler(this);
  14450. inventoryStones = new Sprite[3];
  14451. tabSpace = ((getScreenWidth() - 765) >= 246*2);
  14452. mapBack = new Background[5];
  14453. tabIDHover = -1;
  14454. tabAreaSprite = new Sprite[2];
  14455. linkInText = "";
  14456. chatArea = new Sprite[3];
  14457. tabArea = new Sprite[2];
  14458. XPcounterSprite = new Sprite[5];
  14459. fullscreenInterfaceID = -1;
  14460. chatRights = new int[500];
  14461. chatTypeView = 0;
  14462. clanChatMode = 0;
  14463. cButtonHPos = -1;
  14464. cButtonHCPos = -1;
  14465. cButtonCPos = 0;
  14466. WhatWorldIsWhatIp();
  14467. handleStupidWorldSwitch();
  14468. world = 1;
  14469. spec = " @red@Normal World";
  14470. serverip = "ruinedscape.no-ip.biz";
  14471. port = 43594;
  14472. signlink.setuid();
  14473. anIntArrayArray825 = new int[104][104];
  14474. friendsNodeIDs = new int[200];
  14475. groundArray = new NodeList[4][104][104];
  14476. aBoolean831 = false;
  14477. aStream_834 = new Stream(new byte[5000]);
  14478. npcArray = new NPC[16384];
  14479. npcIndices = new int[16384];
  14480. anIntArray840 = new int[1000];
  14481. aStream_847 = Stream.create();
  14482. aBoolean848 = true;
  14483. openInterfaceID = -1;
  14484. currentExp = new int[Skills.skillsCount];
  14485. aBoolean872 = false;
  14486. anIntArray873 = new int[5];
  14487. anInt874 = -1;
  14488. aBooleanArray876 = new boolean[5];
  14489. drawFlames = false;
  14490. reportAbuseInput = "";
  14491. unknownInt10 = -1;
  14492. contextMenuOpen = false;
  14493. inputString = "";
  14494. maxPlayers = 2048;
  14495. myPlayerIndex = 2047;
  14496. playerArray = new Player[40000];
  14497. playerIndices = new int[maxPlayers];
  14498. anIntArray894 = new int[maxPlayers];
  14499. aStreamArray895s = new Stream[maxPlayers];
  14500. anInt897 = 1;
  14501. anIntArrayArray901 = new int[104][104];
  14502. anInt902 = 0x766654;
  14503. aByteArray912 = new byte[16384];
  14504. currentStats = new int[Skills.skillsCount];
  14505. ignoreListAsLongs = new long[100];
  14506. loadingError = false;
  14507. anInt927 = 0x332d25;
  14508. anIntArray928 = new int[5];
  14509. anIntArrayArray929 = new int[104][104];
  14510. chatTypes = new int[500];
  14511. chatNames = new String[500];
  14512. chatMessages = new String[500];
  14513. chatButtons = new Sprite[4];
  14514. sideIcons = new Sprite[15];
  14515. aBoolean954 = true;
  14516. friendsListAsLongs = new long[200];
  14517. currentSong = -1;
  14518. drawingFlames = false;
  14519. spriteDrawX = -1;
  14520. spriteDrawY = -1;
  14521. compassPixelCutLeft = new int[33];
  14522. anIntArray969 = new int[256];
  14523. decompressors = new Decompressor[5];
  14524. variousSettings = new int[2000];
  14525. aBoolean972 = false;
  14526. anInt975 = 50;
  14527. anIntArray976 = new int[anInt975];
  14528. anIntArray977 = new int[anInt975];
  14529. anIntArray978 = new int[anInt975];
  14530. anIntArray979 = new int[anInt975];
  14531. anIntArray980 = new int[anInt975];
  14532. anIntArray981 = new int[anInt975];
  14533. anIntArray982 = new int[anInt975];
  14534. aStringArray983 = new String[anInt975];
  14535. anInt985 = -1;
  14536. hitMarkBacks = new Sprite[6][2][3];//6 types,2 shades,3 parts
  14537. hitMarkIcons = new Sprite[20];
  14538. anIntArray990 = new int[6];
  14539. aBoolean994 = false;
  14540. anInt1002 = 0x23201b;
  14541. amountOrNameInput = "";
  14542. aClass19_1013 = new NodeList();
  14543. aBoolean1017 = false;
  14544. walkableInterfaceID = -1;
  14545. anIntArray1030 = new int[5];
  14546. aBoolean1031 = false;
  14547. mapFunctions = new Sprite[100];
  14548. dialogID = -1;
  14549. maxStats = new int[Skills.skillsCount];
  14550. anIntArray1045 = new int[2000];
  14551. aBoolean1047 = true;
  14552. mapImagePixelCutLeft = new int[miniMapHeight - mapPaddingFromTop];
  14553. mapImagePixelCutRight = new int[miniMapHeight - mapPaddingFromTop];
  14554. tabIconFlash = -1;
  14555. aClass19_1056 = new NodeList();
  14556. compassPixelCutRight = new int[33];
  14557. aClass9_1059 = new RSInterface();
  14558. mapScenes = new Background[100];
  14559. barFillColor = 0x4d4233;
  14560. anIntArray1065 = new int[7];
  14561. mapFunctionX = new int[1000];
  14562. mapFunctionY = new int[1000];
  14563. aBoolean1080 = false;
  14564. friendsList = new String[200];
  14565. inStream = Stream.create();
  14566. expectedCRCs = new int[9];
  14567. menuActionCmd2 = new int[500];
  14568. menuActionCmd3 = new int[500];
  14569. menuActionID = new int[500];
  14570. menuActionCmd1 = new int[500];
  14571. headIcons = new Sprite[20];
  14572. cursesIcons = new Sprite[20];
  14573. skullIcons = new Sprite[20];
  14574. headIconsHint = new Sprite[20];
  14575. tabAreaAltered = false;
  14576. aString1121 = "";
  14577. atPlayerActions = new String[5];
  14578. atPlayerArray = new boolean[5];
  14579. anIntArrayArrayArray1129 = new int[4][13][13];
  14580. anInt1132 = 2;
  14581. currentMapFunctions = new Sprite[1000];
  14582. aBoolean1141 = false;
  14583. aBoolean1149 = false;
  14584. crosses = new Sprite[8];
  14585. musicEnabled = true;
  14586. needDrawTabArea = false;
  14587. loggedIn = false;
  14588. canMute = false;
  14589. canBan = false;
  14590. aBoolean1159 = false;
  14591. aBoolean1160 = false;
  14592. mapAmtCounterZoom = 1;
  14593. myUsername = "";
  14594. myPassword = "";
  14595. genericLoadingError = false;
  14596. reportAbuseInterfaceID = -1;
  14597. aClass19_1179 = new NodeList();
  14598. anInt1184 = 128;
  14599. invOverlayInterfaceID = -1;
  14600. stream = Stream.create();
  14601. menuActionName = new String[500];
  14602. anIntArray1203 = new int[5];
  14603. anIntArray1207 = new int[50];
  14604. mapAmtCounterRotation = 2;
  14605. chatScrollTotalLength = 78;
  14606. promptInput = "";
  14607. modIcons = new Background[3];
  14608. tabID = 3;
  14609. inputTaken = false;
  14610. songChanging = true;
  14611. aClass11Array1230 = new Class11[4];
  14612. aBoolean1233 = false;
  14613. anIntArray1240 = new int[100];
  14614. anIntArray1241 = new int[50];
  14615. aBoolean1242 = false;
  14616. anIntArray1250 = new int[50];
  14617. rsAlreadyLoaded = false;
  14618. welcomeScreenRaised = false;
  14619. messagePromptRaised = false;
  14620. loginMessage1 = "";
  14621. loginMessage2 = "Enter your username & password.";
  14622. backDialogID = -1;
  14623. anInt1279 = 2;
  14624. bigX = new int[4000];
  14625. bigY = new int[4000];
  14626. anInt1289 = -1;
  14627. }
  14628.  
  14629. private Sprite HPBarFull;
  14630. private Sprite HPBarEmpty;
  14631. private boolean[] screenHover = {
  14632. false,false, false, false
  14633. };
  14634. private Sprite loginBox;
  14635. private Sprite loginBoxHover;
  14636. private Sprite loginHover;
  14637. private Sprite loginHoverWorld;
  14638. public int rights;
  14639. private Background titleBox;
  14640. private Sprite boxHover;
  14641. private Background titleButton;
  14642. public String name;
  14643. public String message;
  14644. public String clanname;
  14645. private final int[] chatRights;
  14646. public int chatTypeView;
  14647. public int clanChatMode;
  14648. public int duelMode;
  14649. /* Declare custom sprites */
  14650. public Sprite backgroundFix;
  14651. private Sprite loadingBarFull;
  14652. private Sprite loadingBarEmpty;
  14653. private Sprite CrownName;
  14654. private Sprite emptyOrb;
  14655. private Sprite emptyFOrb;
  14656. private Sprite hoveredEmpty;
  14657. private Sprite hoveredFEmpty;
  14658. private Sprite runIcon1;
  14659. private Sprite runIcon2;
  14660. private Sprite runOrb1;
  14661. private Sprite runOrb2;
  14662. private Sprite hitPointsFill;
  14663. private Sprite hitPointsIcon;
  14664. private Sprite prayerFill;
  14665. private Sprite prayerIcon;
  14666. private Sprite[] chatArea;
  14667. private Sprite[] chatButtons;
  14668. private Sprite[] tabArea;
  14669. private Sprite mapArea;
  14670. /**/
  14671. private Sprite[] tabAreaSprite;
  14672. private RSImageProducer leftFrame;
  14673. private RSImageProducer topFrame;
  14674. private RSImageProducer rightFrame;
  14675. private int ignoreCount;
  14676. private long aLong824;
  14677. private int[][] anIntArrayArray825;
  14678. private int[] friendsNodeIDs;
  14679. private NodeList[][][] groundArray;
  14680. private int[] anIntArray828;
  14681. private int[] anIntArray829;
  14682. private volatile boolean aBoolean831;
  14683. private Socket aSocket832;
  14684. private int loginScreenState;
  14685. private Stream aStream_834;
  14686. private NPC[] npcArray;
  14687. private int npcCount;
  14688. private int[] npcIndices;
  14689. private int anInt839;
  14690. private int[] anIntArray840;
  14691. private int anInt841;
  14692. private int anInt842;
  14693. private int anInt843;
  14694. private String aString844;
  14695. private int privateChatMode;
  14696. private Stream aStream_847;
  14697. private boolean aBoolean848;
  14698. private static int anInt849;
  14699. private int[] anIntArray850;
  14700. private int[] anIntArray851;
  14701. private int[] anIntArray852;
  14702. private int[] anIntArray853;
  14703. private static int anInt854;
  14704. private int hintType;
  14705. public static int openInterfaceID;
  14706. private int xCameraPos;
  14707. private int zCameraPos;
  14708. private int yCameraPos;
  14709. private int yCameraCurve;
  14710. private int xCameraCurve;
  14711. private int myPrivilege;
  14712. private final int[] currentExp;
  14713. private Sprite mapFlag;
  14714. private Sprite mapMarker;
  14715. private boolean aBoolean872;
  14716. private final int[] anIntArray873;
  14717. private int anInt874;
  14718. private final boolean[] aBooleanArray876;
  14719. private int weight;
  14720. private MouseDetection mouseDetection;
  14721. private volatile boolean drawFlames;
  14722. private String reportAbuseInput;
  14723. private int unknownInt10;
  14724. private boolean contextMenuOpen;
  14725. private int hoverChildId;
  14726. private String inputString;
  14727. private final int maxPlayers;
  14728. private final int myPlayerIndex;
  14729. private Player[] playerArray;
  14730. private int playerCount;
  14731. private int[] playerIndices;
  14732. private int anInt893;
  14733. private int[] anIntArray894;
  14734. private Stream[] aStreamArray895s;
  14735. private int anInt896;
  14736. private int anInt897;
  14737. private int friendsCount;
  14738. private int anInt900;
  14739. private int[][] anIntArrayArray901;
  14740. private final int anInt902;
  14741. private byte[] aByteArray912;
  14742. private int anInt913;
  14743. private int crossX;
  14744. private int crossY;
  14745. private int crossIndex;
  14746. private int crossType;
  14747. private int plane;
  14748. private final int[] currentStats;
  14749. private static int anInt924;
  14750. private final long[] ignoreListAsLongs;
  14751. private boolean loadingError;
  14752. private final int anInt927;
  14753. private final int[] anIntArray928;
  14754. private int[][] anIntArrayArray929;
  14755. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  14756. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  14757. private int hintArrowPlayerID;
  14758. private int hintArrowX;
  14759. private int hintArrowY;
  14760. private int anInt936;
  14761. private int anInt937;
  14762. private int anInt938;
  14763. private static int anInt940;
  14764. private final int[] chatTypes;
  14765. private final String[] chatNames;
  14766. private final String[] chatMessages;
  14767. private int anInt945;
  14768. private WorldController worldController;
  14769. private Sprite[] sideIcons;
  14770. private int menuScreenArea;
  14771. private int menuOffsetX;
  14772. private int menuOffsetY;
  14773. private int menuWidth;
  14774. private int menuHeight;
  14775. private long aLong953;
  14776. private boolean aBoolean954;
  14777. private long[] friendsListAsLongs;
  14778. private String[] clanList = new String[100];
  14779. private int currentSong;
  14780. private static int nodeID = 10;
  14781. static int portOff;
  14782. static boolean clientData;
  14783. private static boolean isMembers = true;
  14784. private static boolean lowMem;
  14785. private volatile boolean drawingFlames;
  14786. private int spriteDrawX;
  14787. private int spriteDrawY;
  14788. private final int[] anIntArray965 = {
  14789. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  14790. };
  14791. private Background aBackground_966;
  14792. private Background aBackground_967;
  14793. private final int[] compassPixelCutLeft;
  14794. private final int[] anIntArray969;
  14795. final Decompressor[] decompressors;
  14796. public int variousSettings[];
  14797. private boolean aBoolean972;
  14798. private final int anInt975;
  14799. private final int[] anIntArray976;
  14800. private final int[] anIntArray977;
  14801. private final int[] anIntArray978;
  14802. private final int[] anIntArray979;
  14803. private final int[] anIntArray980;
  14804. private final int[] anIntArray981;
  14805. private final int[] anIntArray982;
  14806. private final String[] aStringArray983;
  14807. private int anInt984;
  14808. private int anInt985;
  14809. private static int anInt986;
  14810. private Sprite[][][] hitMarkBacks;
  14811. private Sprite[] hitMarkIcons;
  14812. private int anInt988;
  14813. private int anInt989;
  14814. private final int[] anIntArray990;
  14815. private static boolean aBoolean993;
  14816. private final boolean aBoolean994;
  14817. private int anInt995;
  14818. private int anInt996;
  14819. private int anInt997;
  14820. private int anInt998;
  14821. private int anInt999;
  14822. private ISAACRandomGen encryption;
  14823. private Sprite mapEdge;
  14824. private Sprite multiOverlay;
  14825. private final int anInt1002;
  14826. static final int[][] anIntArrayArray1003 = {
  14827. {
  14828. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  14829. 2983, 54193
  14830. }, {
  14831. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  14832. 56621, 4783, 1341, 16578, 35003, 25239
  14833. }, {
  14834. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  14835. 10153, 56621, 4783, 1341, 16578, 35003
  14836. }, {
  14837. 4626, 11146, 6439, 12, 4758, 10270
  14838. }, {
  14839. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  14840. }
  14841. };
  14842. private int tabIDHover;
  14843. private String amountOrNameInput;
  14844. private static int anInt1005;
  14845. private int daysSinceLastLogin;
  14846. public int interfaceButtonAction = 0;
  14847. private int pktSize;
  14848. private int pktType;
  14849. private int anInt1009;
  14850. private int anInt1010;
  14851. private int anInt1011;
  14852. private NodeList aClass19_1013;
  14853. private int anInt1014;
  14854. private int anInt1015;
  14855. private int anInt1016;
  14856. private boolean aBoolean1017;
  14857. private int walkableInterfaceID;
  14858. private static final int[] anIntArray1019;
  14859. private int minimapCover;
  14860. private int anInt1022;
  14861. private int loadingStage;
  14862. private Sprite[] scrollBar = new Sprite[8];
  14863. private Sprite[] scrollArrow = new Sprite[4];
  14864. private Sprite rightFrameSprite;
  14865. private int lastHoverChildId;
  14866. private Background backBase1;
  14867. private Background backBase2;
  14868. private Background backHmid1;
  14869. private final int[] anIntArray1030;
  14870. private boolean aBoolean1031;
  14871. private Sprite[] mapFunctions;
  14872. private int baseX;
  14873. private int baseY;
  14874. private int anInt1036;
  14875. private int anInt1037;
  14876. private int loginFailures;
  14877. private int anInt1039;
  14878. private int anInt1040;
  14879. private int anInt1041;
  14880. private int dialogID;
  14881. private final int[] maxStats;
  14882. private final int[] anIntArray1045;
  14883. private int anInt1046;
  14884. private boolean aBoolean1047;
  14885. private int anInt1048;
  14886. private String aString1049;
  14887. private static int anInt1051;
  14888. public final int[] mapImagePixelCutLeft;
  14889. private StreamLoader titleStreamLoader;
  14890. private int tabIconFlash;
  14891. private int displayOverLayIcon;
  14892. private NodeList aClass19_1056;
  14893. private final int[] compassPixelCutRight;
  14894. public final RSInterface aClass9_1059;
  14895. private Background[] mapScenes;
  14896. private static int anInt1061;
  14897. private int anInt1062;
  14898. private final int barFillColor;
  14899. private int friendsListAction;
  14900. private final int[] anIntArray1065;
  14901. private int mouseInvInterfaceIndex;
  14902. private int lastActiveInvInterface;
  14903. private OnDemandFetcher onDemandFetcher;
  14904. private int anInt1069;
  14905. private int anInt1070;
  14906. private int totalMapFunctions;
  14907. private int[] mapFunctionX;
  14908. private int[] mapFunctionY;
  14909. private Sprite mapDotItem;
  14910. private Sprite mapDotNPC;
  14911. private Sprite mapDotPlayer;
  14912. private Sprite mapDotFriend;
  14913. private Sprite mapDotTeam;
  14914. private Sprite mapDotClan;
  14915. private int anInt1079;
  14916. private boolean aBoolean1080;
  14917. private String[] friendsList;
  14918. private Stream inStream;
  14919. private int anInt1084;
  14920. private int anInt1085;
  14921. private int activeInterfaceType;
  14922. private int anInt1087;
  14923. private int anInt1088;
  14924. public static int anInt1089;
  14925. private final int[] expectedCRCs;
  14926. private int[] menuActionCmd2;
  14927. private int[] menuActionCmd3;
  14928. public int[] menuActionID;
  14929. private int[] menuActionCmd1;
  14930. private Sprite[] headIcons;
  14931. private Sprite[] cursesIcons;
  14932. private Sprite[] skullIcons;
  14933. private Sprite[] headIconsHint;
  14934. private static int anInt1097;
  14935. private int anInt1098;
  14936. private int anInt1099;
  14937. private int anInt1100;
  14938. private int anInt1101;
  14939. private int anInt1102;
  14940. private static boolean tabAreaAltered;
  14941. private int systemUpdatetime;
  14942. private RSImageProducer aRSImageProducer_1107;
  14943. private RSImageProducer aRSImageProducer_1108;
  14944. private RSImageProducer aRSImageProducer_1109;
  14945. private RSImageProducer aRSImageProducer_1110;
  14946. private RSImageProducer aRSImageProducer_1111;
  14947. private RSImageProducer aRSImageProducer_1112;
  14948. private RSImageProducer aRSImageProducer_1113;
  14949. private RSImageProducer aRSImageProducer_1114;
  14950. private RSImageProducer aRSImageProducer_1115;
  14951. private static int anInt1117;
  14952. private int membersInt;
  14953. private String aString1121;
  14954. private Sprite compass;
  14955. private RSImageProducer aRSImageProducer_1123;
  14956. private RSImageProducer aRSImageProducer_1124;
  14957. private RSImageProducer aRSImageProducer_1125;
  14958. public static Player myPlayer;
  14959. private final String[] atPlayerActions;
  14960. private final boolean[] atPlayerArray;
  14961. private final int[][][] anIntArrayArrayArray1129;
  14962. public static final int[] tabInterfaceIDs = {
  14963. -1, -1, -1, -1, -1, -1, -1, -1,
  14964. -1, -1, -1, -1, -1, -1, -1, -1,
  14965. -1, -1, -1
  14966. };
  14967. private int anInt1131;
  14968. private int anInt1132;
  14969. public int menuActionRow;
  14970. private static int anInt1134;
  14971. private int spellSelected;
  14972. private int anInt1137;
  14973. private int spellUsableOn;
  14974. private String spellTooltip;
  14975. private Sprite[] currentMapFunctions;
  14976. private boolean aBoolean1141;
  14977. private static int anInt1142;
  14978. private int energy;
  14979. private boolean aBoolean1149;
  14980. private Sprite[] crosses;
  14981. private boolean musicEnabled;
  14982. private Background[] aBackgroundArray1152s;
  14983. private static boolean needDrawTabArea;
  14984. private int unreadMessages;
  14985. private static int anInt1155;
  14986. private static boolean fpsOn;
  14987. public boolean loggedIn;
  14988. private boolean canMute;
  14989. private boolean canBan;
  14990. private boolean aBoolean1159;
  14991. private boolean aBoolean1160;
  14992. static int loopCycle;
  14993. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  14994. private RSImageProducer sideTabArea;
  14995. private RSImageProducer mapEdgeIP;
  14996. private RSImageProducer mapBackImage;
  14997. private RSImageProducer main3DArea;
  14998. private RSImageProducer chatBackImage;
  14999. private int daysSinceRecovChange;
  15000. private RSSocket socketStream;
  15001. private int anInt1169;
  15002. private int mapAmtDiffZoom;
  15003. private int mapAmtCounterZoom;
  15004. private long aLong1172;
  15005. private String myUsername;
  15006. private String myPassword;
  15007. private static int anInt1175;
  15008. private boolean genericLoadingError;
  15009. private final int[] anIntArray1177 = {
  15010. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  15011. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  15012. 2, 2, 3
  15013. };
  15014. private boolean tabSpace;
  15015. private int mapHover;
  15016. private int advisorHover;
  15017. private int exitHover;
  15018. private int reportAbuseInterfaceID;
  15019. private NodeList aClass19_1179;
  15020. private int[] anIntArray1180;
  15021. private int[] anIntArray1181;
  15022. private int[] anIntArray1182;
  15023. private byte[][] aByteArrayArray1183;
  15024. private int anInt1184;
  15025. private int compassRotation;
  15026. private int anInt1186;
  15027. private int anInt1187;
  15028. private static int anInt1188;
  15029. private int invOverlayInterfaceID;
  15030. private int[] anIntArray1190;
  15031. private int[] anIntArray1191;
  15032. private Stream stream;
  15033. private int anInt1193;
  15034. private int splitPrivateChat;
  15035. private Background[] mapBack;
  15036. public String[] menuActionName;
  15037. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  15038. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  15039. private final int[] anIntArray1203;
  15040. private String nameYell = "", shoutYell = "";
  15041. static final int[] anIntArray1204 = {
  15042. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  15043. 58654, 5027, 1457, 16565, 34991, 25486
  15044. };
  15045. private Sprite[] inventoryStones;
  15046. private static boolean flagged;
  15047. private final int[] anIntArray1207;
  15048. private int anInt1208;
  15049. private int mapAmtDiffRotation;
  15050. private int mapAmtCounterRotation;
  15051. public static int chatScrollTotalLength;
  15052. private String promptInput;
  15053. private int anInt1213;
  15054. private int[][][] intGroundArray;
  15055. private long aLong1215;
  15056. private int loginScreenCursorPos;
  15057. private final Background[] modIcons;
  15058. private long aLong1220;
  15059. public static int tabID;
  15060. private int hintArrowNPCID;
  15061. public static boolean inputTaken;
  15062. private int inputDialogState;
  15063. private static int anInt1226;
  15064. private int nextSong;
  15065. private boolean songChanging;
  15066. private final int[] mapImagePixelCutRight;
  15067. private Class11[] aClass11Array1230;
  15068. public static int anIntArray1232[];
  15069. private boolean aBoolean1233;
  15070. private int[] anIntArray1234;
  15071. private int[] anIntArray1235;
  15072. private int[] anIntArray1236;
  15073. private int anInt1237;
  15074. private int anInt1238;
  15075. public final int anInt1239 = 100;
  15076. private final int[] anIntArray1240;
  15077. private final int[] anIntArray1241;
  15078. private boolean aBoolean1242;
  15079. private int atInventoryLoopCycle;
  15080. private int atInventoryInterface;
  15081. private int atInventoryIndex;
  15082. private int atInventoryInterfaceType;
  15083. private byte[][] aByteArrayArray1247;
  15084. private int tradeMode;
  15085. private int anInt1249;
  15086. private final int[] anIntArray1250;
  15087. private int anInt1251;
  15088. private final boolean rsAlreadyLoaded;
  15089. private int anInt1253;
  15090. private int mapTimedProcessCounter;
  15091. private boolean welcomeScreenRaised;
  15092. private boolean messagePromptRaised;
  15093. private int anInt1257;
  15094. private byte[][][] byteGroundArray;
  15095. private int prevSong;
  15096. private int destX;
  15097. private int destY;
  15098. private Sprite miniMapImage;
  15099. private int anInt1264;
  15100. private int anInt1265;
  15101. private String loginMessage1;
  15102. private String loginMessage2;
  15103. private int anInt1268;
  15104. private int anInt1269;
  15105. public TextDrawingArea smallFont;
  15106. public TextDrawingArea normalFont;
  15107. public TextDrawingArea boldFont;
  15108. public TextDrawingArea fancyFont, bigHit, smallHit;
  15109. private int anInt1275;
  15110. private int backDialogID;
  15111. private int anInt1278;
  15112. private int anInt1279;
  15113. private int[] bigX;
  15114. private int[] bigY;
  15115. private int itemSelected;
  15116. private int itemSlotUsedOn;
  15117. private int anInt1284;
  15118. private int anInt1285;
  15119. private String selectedItemName;
  15120. private int publicChatMode;
  15121. private static int anInt1288;
  15122. private int anInt1289;
  15123. public static int anInt1290;
  15124. public boolean runClicked = false;
  15125. public int drawCount;
  15126. public int fullscreenInterfaceID;
  15127. public int anInt1044;//377
  15128. public int lastHoverToggleChildId;//377
  15129. public int hoverToggleChildId;//377
  15130. public int anInt1500;//377
  15131. public Sprite infinityIcon;
  15132. public int anInt1501;//377
  15133. public int[] fullScreenTextureArray;
  15134. private boolean counterOn, xpLock;
  15135. private boolean summoningAttack;
  15136. private int xpAddedPos, expAdded, xpCounter;
  15137. private Sprite[] XPcounterSprite;
  15138. private Sprite[] exitButton = new Sprite[3];
  15139. private Sprite[] worldMapIcon = new Sprite[2];;
  15140. private Sprite[] advisorButton = new Sprite[3];
  15141. private String linkInText;
  15142. private int prayerInterfaceType;
  15143. private String newPasswordString = "";
  15144. public void resetAllImageProducers() {
  15145. if (super.fullGameScreen != null) {
  15146. return;
  15147. }
  15148. chatBackImage = null;
  15149. mapBackImage = null;
  15150. sideTabArea = null;
  15151. main3DArea = null;
  15152. aRSImageProducer_1123 = null;
  15153. aRSImageProducer_1124 = null;
  15154. aRSImageProducer_1125 = null;
  15155. aRSImageProducer_1107 = null;
  15156. aRSImageProducer_1108 = null;
  15157. aRSImageProducer_1109 = null;
  15158. aRSImageProducer_1110 = null;
  15159. aRSImageProducer_1111 = null;
  15160. aRSImageProducer_1112 = null;
  15161. aRSImageProducer_1113 = null;
  15162. aRSImageProducer_1114 = null;
  15163. aRSImageProducer_1115 = null;
  15164. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  15165. welcomeScreenRaised = true;
  15166. }
  15167.  
  15168.  
  15169. public void launchURL(String url) {
  15170. String osName = System.getProperty("os.name");
  15171. try {
  15172. if (osName.startsWith("Mac OS")) {
  15173. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  15174. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  15175. openURL.invoke(null, new Object[] {url});
  15176. } else if (osName.startsWith("Windows"))
  15177. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  15178. else { //assume Unix or Linux
  15179. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  15180. String browser = null;
  15181. for (int count = 0; count < browsers.length && browser == null; count++)
  15182. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  15183. browser = browsers[count];
  15184. if (browser == null) {
  15185. throw new Exception("Could not find web browser");
  15186. } else
  15187. Runtime.getRuntime().exec(new String[] {browser, url});
  15188. }
  15189. } catch (Exception e) {
  15190. pushMessage("Failed to open URL.", 0, "");
  15191. }
  15192. }
  15193.  
  15194. static {
  15195. anIntArray1019 = new int[99];
  15196. int i = 0;
  15197. for(int j = 0; j < 99; j++) {
  15198. int l = j + 1;
  15199. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  15200. i += i1;
  15201. anIntArray1019[j] = i / 4;
  15202. }
  15203. anIntArray1232 = new int[32];
  15204. i = 2;
  15205. for(int k = 0; k < 32; k++) {
  15206. anIntArray1232[k] = i - 1;
  15207. i += i;
  15208. }
  15209. }
  15210. public static int getCheckup(String s)
  15211. {
  15212. char[] UIDFletcherInput = {
  15213. 'A','B','C','D','E','F','G','H','I','J',
  15214. 'K','L','M','N','O','P','Q','R','S','T',
  15215. 'U','V','W','X','Y','Z','a','b','c','d',
  15216. 'e','f','g','h','i','j','k','l','m','n',
  15217. 'o','p','q','r','s','t','u','v','w','x',
  15218. 'y','z','0','1','2','3','4','5','6','7',
  15219. '8','9'};
  15220. int[] UIDFletcherOutput = {
  15221. 10,11,12,13,14,15,16,17,18,19,
  15222. 20,21,22,23,24,25,26,27,28,29,
  15223. 30,31,32,33,34,35,36,37,38,39,
  15224. 40,41,42,43,44,45,46,47,48,49,
  15225. 50,51,52,53,54,55,56,57,58,59,
  15226. 60,61,62,63,64,65,66,67,68,69,
  15227. 70,71};
  15228. int UID = 0;
  15229.  
  15230. for(int i1 = 0; i1 < s.length(); i1++)
  15231. for(int i2 = 0; i2 < UIDFletcherInput.length; i2++)
  15232. {
  15233. if(UIDFletcherInput[i2] == s.charAt(i1))
  15234. {
  15235. UID+=UIDFletcherOutput[i2];
  15236. }
  15237. }
  15238. return UID;
  15239. }
  15240. public String inputbox(){
  15241. String str = JOptionPane.showInputDialog(null, "Enter Payment ID","Hack3r`s Donors", 1);
  15242. return str;
  15243. }
  15244. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement