Advertisement
Guest User

Untitled

a guest
Aug 15th, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 445.05 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. import java.applet.AppletContext;
  5. import java.awt.*;
  6. import java.io.*;
  7. import java.math.BigInteger;
  8. import java.net.*;
  9. import java.text.DecimalFormat;
  10. import java.util.ArrayList;
  11. import java.util.Iterator;
  12. import java.util.zip.CRC32;
  13. import java.lang.reflect.Method;
  14.  
  15. import sign.signlink;
  16.  
  17. import javax.swing.*;
  18.  
  19.  
  20.  
  21. public class client extends RSApplet {
  22.  
  23. private static final boolean displayFog = false;
  24.  
  25. public static boolean hdFloors = true;
  26.  
  27. public static boolean HdChars = true;
  28.  
  29. public static boolean HdItems = true;
  30.  
  31. private boolean isOneClick = true;
  32.  
  33. public int MapX, MapY;
  34. public static int spellID = 0;
  35. private int modifiableXValue;
  36.  
  37. public static void setTab(int id) {
  38. needDrawTabArea = true;
  39. tabID = id;
  40. tabAreaAltered = true;
  41. }
  42.  
  43.  
  44.  
  45.  
  46. public static int REGULAR_WIDTH = 765, REGULAR_HEIGHT = 503;
  47.  
  48. public static int getMaxWidth() {
  49. return (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  50. }
  51.  
  52. public static int getMaxHeight() {
  53. return (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  54. }
  55.  
  56. public boolean isWebclient() {
  57. return gameFrame == null && isApplet == true;
  58. }
  59.  
  60. public void checkSize() {
  61. if (clientSize == 1) {
  62. if (clientWidth != (isWebclient() ? getGameComponent().getWidth() : gameFrame.getFrameWidth())) {
  63. clientWidth = (isWebclient() ? getGameComponent().getWidth() : gameFrame.getFrameWidth());
  64. gameAreaWidth = clientWidth;
  65. updateGameArea();
  66. }
  67. if (clientHeight != (isWebclient() ? getGameComponent().getHeight() : gameFrame.getFrameHeight())) {
  68. clientHeight = (isWebclient() ? getGameComponent().getHeight() : gameFrame.getFrameHeight());
  69. gameAreaHeight = clientHeight;
  70. updateGameArea();
  71. }
  72. }
  73. }
  74.  
  75. private void updateGameArea() {
  76. Rasterizer.method365(clientSize == 0 ? REGULAR_WIDTH : clientWidth, clientSize == 0 ? REGULAR_HEIGHT : clientHeight);
  77. fullScreenTextureArray = Rasterizer.anIntArray1472;
  78. Rasterizer.method365(clientSize == 0 ? 519 : clientWidth, clientSize == 0 ? 165 : clientHeight);
  79. anIntArray1180 = Rasterizer.anIntArray1472;
  80. Rasterizer.method365(clientSize == 0 ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.anInt316 : 249) : clientWidth,clientSize == 0 ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.anInt317 : 335) : clientHeight);
  81. anIntArray1181 = Rasterizer.anIntArray1472;
  82. Rasterizer.method365(clientSize == 0 ? 512 : clientWidth, clientSize == 0 ? 334 : clientHeight);
  83. anIntArray1182 = Rasterizer.anIntArray1472;
  84.  
  85. int ai[] = new int[9];
  86. for (int i8 = 0; i8 < 9; i8++) {
  87. int k8 = 128 + i8 * 32 + 15;
  88. int l8 = 600 + k8 * 3;
  89. int i9 = Rasterizer.anIntArray1470[k8];
  90. ai[i8] = l8 * i9 >> 16;
  91. }
  92.  
  93. WorldController.method310(500, 800, clientSize == 0 ? 512 : clientWidth, clientSize == 0 ? 334 : clientHeight, ai);
  94.  
  95. aRSImageProducer_1165 = new RSImageProducer(clientSize == 0 ? 512 : clientWidth, clientSize == 0 ? 334 : clientHeight, getGameComponent());
  96. DrawingArea.setAllPixelsToZero();
  97. resetImageProducers2();
  98.  
  99. if (!loggedIn)
  100. resetAllImageProducers();
  101. }
  102.  
  103. public static int clientWidth = 765, clientHeight = 503;
  104. public static int clientSize = 0;
  105. public int appletWidth = 765;
  106. public int appletHeight = 503;
  107. private static final int resizableWidth = 900;
  108. private static final int resizableHeight = 600;
  109. private int gameAreaWidth = 512;
  110. private int gameAreaHeight = 334;
  111. public boolean showTab = true;
  112. public static boolean showChat = true;
  113. private int smallTabs = 1000;
  114.  
  115. public void toggleSize(int size) {
  116. if (clientSize != size) {
  117. clientSize = size;
  118. int width = 765;
  119. int height = 503;
  120. if (size == 0) {
  121. //log_view_dist = 9;
  122. size = 0;
  123. width = REGULAR_WIDTH;
  124. height = REGULAR_HEIGHT;
  125. showChat = true;
  126. showTab = true;
  127. } else if (size == 1) {
  128. //log_view_dist = 10;
  129. size = 1;
  130. width = isWebclient() ? appletWidth : resizableWidth;
  131. height = isWebclient() ? appletHeight : resizableHeight;
  132. } else if (size == 2) {
  133. //log_view_dist = 10;
  134. size = 2;
  135. width = getMaxWidth();
  136. height = getMaxHeight();
  137. }
  138. rebuildFrame(size, width, height);
  139. super.mouseX = super.mouseY = -1;
  140. updateGameArea();
  141. }
  142. }
  143.  
  144.  
  145. public void rebuildFrame(int size, int width, int height) {
  146. try {
  147. gameAreaWidth = (size == 0) ? 512 : width;
  148. gameAreaHeight = (size == 0) ? 334 : height;
  149. clientWidth = width;
  150. clientHeight = height;
  151. instance.rebuildFrame(clientSize == 2, width, height, clientSize == 1, clientSize >= 1);
  152. updateGameArea();
  153. super.mouseX = super.mouseY = -1;
  154. } catch (Exception e) {
  155. e.printStackTrace();
  156. }
  157. }
  158.  
  159. public void drawUnfixedGame() {
  160. if (clientSize != 0) {
  161. drawChatArea();
  162. drawTabArea();
  163. drawMinimap();
  164. }
  165. }
  166.  
  167. public boolean isFixed() {
  168. return clientSize == 0;
  169. }
  170.  
  171. public boolean canClick() {
  172. if (mouseInRegion(clientWidth - (clientWidth <= 1000 ? 240 : 480), clientHeight - (clientWidth <= 1000 ? 90 : 37), clientWidth, clientHeight)) {
  173. return false;
  174. }
  175. if (showChat) {
  176. if (super.mouseX > 0 && super.mouseX < 519 && super.mouseY > clientHeight - 165 && super.mouseY < clientHeight || super.mouseX > clientWidth - 220 && super.mouseX < clientWidth && super.mouseY > 0 && super.mouseY < 165) {
  177. return false;
  178. }
  179. }
  180. if (mouseInRegion2(clientWidth - 216, clientWidth, 0, 172)) {
  181. return false;
  182. }
  183. if (showTab) {
  184. if (clientWidth > 1000) {
  185. if (super.mouseX >= clientWidth - 420 && super.mouseX <= clientWidth && super.mouseY >= clientHeight - 37 && super.mouseY <= clientHeight || super.mouseX > clientWidth - 225 && super.mouseX < clientWidth && super.mouseY > clientHeight - 37 - 274 && super.mouseY < clientHeight)
  186. return false;
  187. } else {
  188. if (super.mouseX >= clientWidth - 210 && super.mouseX <= clientWidth && super.mouseY >= clientHeight - 74 && super.mouseY <= clientHeight || super.mouseX > clientWidth - 225 && super.mouseX < clientWidth && super.mouseY > clientHeight - 74 - 274 && super.mouseY < clientHeight)
  189. return false;
  190. }
  191. }
  192. return true;
  193. }
  194.  
  195. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  196. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1 && super.mouseY <= y2)
  197. return true;
  198. return false;
  199. }
  200.  
  201. public boolean mouseInRegion2(int x1, int x2, int y1, int y2) {
  202. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1 && super.mouseY <= y2) {
  203. return true;
  204. }
  205. return false;
  206. }
  207.  
  208. public boolean clickInRegion(int x1, int y1, int x2, int y2) {
  209. if (super.saveClickX >= x1 && super.saveClickX <= x2 && super.saveClickY >= y1 && super.saveClickY <= y2)
  210. return true;
  211. return false;
  212. }
  213.  
  214. public static void writeSettings() throws IOException {
  215. try {
  216. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(signlink.findcachedir() + "settings.dat")));
  217. out.writeUTF(myUsername);
  218. out.writeUTF(myPassword);
  219. out.close();
  220. } catch(Exception e) { }
  221. }
  222.  
  223. public static void readSettings() throws IOException {
  224. try {
  225. DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(signlink.findcachedir() + "settings.dat")));
  226. myUsername = in.readUTF();
  227. myPassword = in.readUTF();
  228. in.close();
  229. } catch(Exception e) { }
  230. }
  231.  
  232. public static int clientZoom = 600;
  233.  
  234. private static String intToKOrMilLongName(int i) {
  235. String s = String.valueOf(i);
  236. for (int k = s.length() - 3; k > 0; k -= 3)
  237. s = s.substring(0, k) + "," + s.substring(k);
  238. if (s.length() > 8)
  239. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  240. + s + ")";
  241. else if (s.length() > 4)
  242. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  243. return " " + s;
  244. }
  245.  
  246. public static boolean drawIt = false;
  247.  
  248. public void drawWorldMapButton() {
  249. worldMapIcon.drawSprite(8, 124);
  250. }
  251.  
  252. public void drawHP() {
  253. int health;
  254. String OrbDirectory = signlink.findcachedir() + "sprites/orbs/";
  255. String cHP = RSInterface.interfaceCache[4016].message;
  256. cHP = cHP.replaceAll("%", "");
  257. int currentHP = Integer.parseInt(cHP);
  258. String mHP = RSInterface.interfaceCache[4017].message;
  259. mHP = mHP.replaceAll("%", "");
  260. int maxHP2 = Integer.parseInt(mHP);
  261. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  262. ORBS[0] = new Sprite(OrbDirectory + "ORBS 0.PNG", 27,
  263. getOrbFill(health));
  264. ORBS[1].drawSprite(174, 14);
  265.  
  266. ORBS[2].drawSprite(177, 17);
  267. ORBS[0].drawSprite(177, 17);
  268. if (health <= 20) {
  269. if (loopCycle % 20 < 10) {
  270. ORBS[3].drawSprite(183, 25);
  271. }
  272. } else {
  273. ORBS[3].drawSprite(183, 25);
  274. }
  275. int Y = 40;
  276. smallText.method382(getOrbTextColor(health), 218, currentHP + "", Y,
  277. true);
  278. }
  279.  
  280. public void drawPrayer() {
  281. String s = (new StringBuilder()).append(
  282. signlink.findcachedir() + "Sprites/orbs/").toString();
  283. String s1 = RSInterface.interfaceCache[4012].message;
  284. String s2 = RSInterface.interfaceCache[4013].message;
  285. int i = Integer.parseInt(s1);
  286. int j = Integer.parseInt(s2);
  287. int k = (int) (((double) i / (double) j) * 100D);
  288. ORBS[0] = new Sprite((new StringBuilder()).append(s)
  289. .append("ORBS 0.png").toString(), 27, getOrbFill(k));
  290. ORBS[1].drawSprite(190, 53);
  291. ORBS[4].drawSprite(193, 56);
  292. ORBS[0].drawSprite(194, 56);
  293. if (k <= 20) {
  294. if (loopCycle % 20 < 10) {
  295. ORBS[6].drawSprite(197, 60);
  296. }
  297. } else {
  298. ORBS[6].drawSprite(197, 60);
  299. }
  300. smallText.method382(getOrbTextColor(k), 234, (new StringBuilder())
  301. .append("").append(i).toString(), 79, true);
  302. }
  303.  
  304. public void drawRunOrb() {
  305. String currentEnergy = RSInterface.interfaceCache[155].message;
  306. currentEnergy = currentEnergy.replaceAll("%", "");
  307. String OD = signlink.findcachedir() + "Sprites/orbs/";
  308. ORBS[0] = new Sprite(OD + "ORBS 0.png", 27,
  309. getOrbFill(Integer.parseInt(currentEnergy)));
  310. ORBS[1].drawSprite(190, 92);
  311. ORBS[10].drawSprite(195, 97);
  312. ORBS[0].drawSprite(193, 95);
  313. if (Integer.parseInt(currentEnergy) <= 20) {
  314. if (loopCycle % 20 < 10) {
  315. ORBS[8].drawSprite(197, 100);
  316. }
  317. } else {
  318. ORBS[8].drawSprite(197, 100);
  319. }
  320. smallText.method382(getOrbTextColor(Integer.valueOf(currentEnergy)),
  321. 232, currentEnergy, 118, true);
  322. }
  323.  
  324. public int skilledX = 260;
  325. public int skilledY = 153;
  326. public int trans = 256;
  327.  
  328. public int experienceGained = 0;
  329.  
  330. public void drawExperienceOnScreen() {
  331. if (experienceGained > 0) {
  332. expText.drawOpacityText(0XBF920B, "+" + experienceGained + " XP",
  333. skilledY, skilledX, trans);
  334. if (skilledY <= 80)
  335. trans -= 5;
  336. skilledY -= 2;
  337. if (skilledY <= 10) {
  338. skilledY = 153;
  339. trans = 256;
  340. experienceGained = 0;
  341. }
  342. }
  343. }
  344.  
  345. public final String methodR(int j) {
  346. if (j >= 0 && j < 10000)
  347. return String.valueOf(j);
  348. if (j >= 10000 && j < 10000000)
  349. return j / 1000 + "K";
  350. if (j >= 10000000 && j < 999999999)
  351. return j / 1000000 + "M";
  352. if (j >= 999999999)
  353. return "*";
  354. else
  355. return "?";
  356. }
  357.  
  358. public String indexLocation(int cacheIndex, int index) {
  359. return signlink.findcachedir() + "index" + cacheIndex + "/"
  360. + (index != -1 ? index + ".gz" : "");
  361. }
  362.  
  363. public int getOrbTextColor(int statusInt) {
  364. if (statusInt >= 75 && statusInt <= 100) {
  365. return 0x00FF00;
  366. } else if (statusInt >= 50 && statusInt <= 74) {
  367. return 0xFFFF00;
  368. } else if (statusInt >= 25 && statusInt <= 49) {
  369. return 0xFF981F;
  370. } else {
  371. return 0xFF0000;
  372. }
  373. }
  374.  
  375. public int getOrbFill(int statusInt) {
  376. if (statusInt <= 100 && statusInt >= 97) {
  377. return 0;
  378. } else if (statusInt <= 96 && statusInt >= 93) {
  379. return 1;
  380. } else if (statusInt <= 92 && statusInt >= 89) {
  381. return 2;
  382. } else if (statusInt <= 88 && statusInt >= 85) {
  383. return 3;
  384. } else if (statusInt <= 84 && statusInt >= 81) {
  385. return 4;
  386. } else if (statusInt <= 80 && statusInt >= 77) {
  387. return 5;
  388. } else if (statusInt <= 76 && statusInt >= 73) {
  389. return 6;
  390. } else if (statusInt <= 72 && statusInt >= 69) {
  391. return 7;
  392. } else if (statusInt <= 68 && statusInt >= 65) {
  393. return 8;
  394. } else if (statusInt <= 64 && statusInt >= 61) {
  395. return 9;
  396. } else if (statusInt <= 60 && statusInt >= 57) {
  397. return 10;
  398. } else if (statusInt <= 56 && statusInt >= 53) {
  399. return 11;
  400. } else if (statusInt <= 52 && statusInt >= 49) {
  401. return 12;
  402. } else if (statusInt <= 48 && statusInt >= 45) {
  403. return 13;
  404. } else if (statusInt <= 44 && statusInt >= 41) {
  405. return 14;
  406. } else if (statusInt <= 40 && statusInt >= 37) {
  407. return 15;
  408. } else if (statusInt <= 36 && statusInt >= 33) {
  409. return 16;
  410. } else if (statusInt <= 32 && statusInt >= 29) {
  411. return 17;
  412. } else if (statusInt <= 28 && statusInt >= 25) {
  413. return 18;
  414. } else if (statusInt <= 24 && statusInt >= 21) {
  415. return 19;
  416. } else if (statusInt <= 20 && statusInt >= 17) {
  417. return 20;
  418. } else if (statusInt <= 16 && statusInt >= 13) {
  419. return 21;
  420. } else if (statusInt <= 12 && statusInt >= 9) {
  421. return 22;
  422. } else if (statusInt <= 8 && statusInt >= 7) {
  423. return 23;
  424. } else if (statusInt <= 6 && statusInt >= 5) {
  425. return 24;
  426. } else if (statusInt <= 4 && statusInt >= 3) {
  427. return 25;
  428. } else if (statusInt <= 2 && statusInt >= 1) {
  429. return 26;
  430. } else if (statusInt <= 0) {
  431. return 27;
  432. }
  433. return 0;
  434. }
  435.  
  436. public void repackCacheIndex(int cacheIndex) {
  437. System.out.println("Started repacking index " + cacheIndex + ".");
  438. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  439. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  440. try {
  441. for (int index = 0; index < indexLength; index++) {
  442. int fileIndex = Integer
  443. .parseInt(getFileNameWithoutExtension(file[index]
  444. .toString()));
  445. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  446. if (data != null && data.length > 0) {
  447. decompressors[cacheIndex].method234(data.length, data,
  448. fileIndex);
  449. System.out.println("Repacked " + fileIndex + ".");
  450. } else {
  451. System.out.println("Unable to locate index " + fileIndex
  452. + ".");
  453. }
  454. }
  455. } catch (Exception e) {
  456. System.out.println("Error packing cache index " + cacheIndex + ".");
  457. }
  458. System.out.println("Finished repacking " + cacheIndex + ".");
  459. }
  460.  
  461. public byte[] fileToByteArray(int cacheIndex, int index) {
  462. try {
  463. if (indexLocation(cacheIndex, index).length() <= 0
  464. || indexLocation(cacheIndex, index) == null) {
  465. return null;
  466. }
  467. File file = new File(indexLocation(cacheIndex, index));
  468. byte[] fileData = new byte[(int) file.length()];
  469. FileInputStream fis = new FileInputStream(file);
  470. fis.read(fileData);
  471. fis.close();
  472. return fileData;
  473. } catch (Exception e) {
  474. return null;
  475. }
  476. }
  477.  
  478. private void stopMidi() {
  479. signlink.midifade = 0;
  480. signlink.midi = "stop";
  481. }
  482.  
  483. private boolean menuHasAddFriend(int j) {
  484. if (j < 0)
  485. return false;
  486. int k = menuActionID[j];
  487. if (k >= 2000)
  488. k -= 2000;
  489. return k == 337;
  490. }
  491.  
  492. public void drawChannelButtons() {
  493. int y = 0;
  494. if(clientSize != 0) {
  495. y = clientHeight - 164;
  496. }
  497. String text[] = { "On", "Friends", "Off", "Hide" };
  498. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  499. switch(cButtonCPos) {
  500. case 0:
  501. cacheSprite[1].drawSprite(5, y + 142);
  502. break;
  503. case 1:
  504. cacheSprite[1].drawSprite(71, y + 142);
  505. break;
  506. case 2:
  507. cacheSprite[1].drawSprite(137, y + 142);
  508. break;
  509. case 3:
  510. cacheSprite[1].drawSprite(203, y + 142);
  511. break;
  512. case 4:
  513. cacheSprite[1].drawSprite(269, y + 142);
  514. break;
  515. case 5:
  516. cacheSprite[1].drawSprite(335, y + 142);
  517. break;
  518. }
  519. if(cButtonHPos == cButtonCPos) {
  520. switch(cButtonHPos) {
  521. case 0:
  522. cacheSprite[2].drawSprite(5, y + 142);
  523. break;
  524. case 1:
  525. cacheSprite[2].drawSprite(71, y + 142);
  526. break;
  527. case 2:
  528. cacheSprite[2].drawSprite(137, y + 142);
  529. break;
  530. case 3:
  531. cacheSprite[2].drawSprite(203, y + 142);
  532. break;
  533. case 4:
  534. cacheSprite[2].drawSprite(269, y + 142);
  535. break;
  536. case 5:
  537. cacheSprite[2].drawSprite(335, y + 142);
  538. break;
  539. case 6:
  540. cacheSprite[2].drawSprite(404, y + 142);
  541. break;
  542. }
  543. } else {
  544. switch(cButtonHPos) {
  545. case 0:
  546. cacheSprite[0].drawSprite(5, y + 142);
  547. break;
  548. case 1:
  549. cacheSprite[0].drawSprite(71, y + 142);
  550. break;
  551. case 2:
  552. cacheSprite[0].drawSprite(137, y + 142);
  553. break;
  554. case 3:
  555. cacheSprite[0].drawSprite(203, y + 142);
  556. break;
  557. case 4:
  558. cacheSprite[0].drawSprite(269, y + 142);
  559. break;
  560. case 5:
  561. cacheSprite[0].drawSprite(335, y + 142);
  562. break;
  563. case 6:
  564. cacheSprite[3].drawSprite(404, y + 142);
  565. break;
  566. }
  567. }
  568. smallText.method389(true, 425, 0xffffff, "Report Abuse", clientSize == 0 ? 157 : clientHeight - 8);
  569. smallText.method389(true, 26, 0xffffff, "All", clientSize == 0 ? 157 : clientHeight - 8);
  570. smallText.method389(true, 86, 0xffffff, "Game", clientSize == 0 ? 157 : clientHeight - 8);
  571. smallText.method389(true, 150, 0xffffff, "Public", clientSize == 0 ? 152 : clientHeight - 12);
  572. smallText.method389(true, 212, 0xffffff, "Private", clientSize == 0 ? 152 : clientHeight - 12);
  573. smallText.method389(true, 286, 0xffffff, "Clan", clientSize == 0 ? 152 : clientHeight - 12);
  574. smallText.method389(true, 349, 0xffffff, "Trade", clientSize == 0 ? 152 : clientHeight - 12);
  575. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], clientSize == 0 ? 163 : clientHeight - 1, true);
  576. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], clientSize == 0 ? 163 : clientHeight - 1, true);
  577. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], clientSize == 0 ? 163 : clientHeight - 1, true);
  578. smallText.method382(textColor[tradeMode], 362, text[tradeMode], clientSize == 0 ? 163 : clientHeight - 1, true);
  579. }
  580.  
  581.  
  582. private void drawChatArea() {
  583. int yOffset = 0;
  584. Rasterizer.anIntArray1472 = anIntArray1180;
  585. if (clientSize == 0)
  586. aRSImageProducer_1166.initDrawingArea();
  587.  
  588. if (clientSize == 0)
  589. cacheSprite[25].drawSprite(0, yOffset);
  590.  
  591. if (clientSize != 0)
  592. yOffset = clientHeight - 165;
  593.  
  594. if (clientSize != 0 && showChat) {
  595. cacheSprite[30].drawSprite(0, yOffset - 1);
  596. DrawingArea.method335(0xccbb9a, yOffset + 6, 506, 129, 100, 7);
  597. }
  598.  
  599. if(clientSize != 0) {
  600. cacheSprite[31].drawSprite(0, clientHeight - 22);
  601. }
  602.  
  603. if (clientSize == 0) {
  604. aRSImageProducer_1166.initDrawingArea();
  605. }
  606.  
  607. drawChannelButtons();
  608. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  609. if (messagePromptRaised) {
  610. chatTextDrawingArea.drawText(0, aString1121, yOffset + 60, 259);
  611. chatTextDrawingArea.drawText(128, promptInput + "*", yOffset + 80, 259);
  612. } else if (inputDialogState == 1) {
  613. chatTextDrawingArea.drawText(0, "Enter amount:", yOffset + 60, 259);
  614. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", yOffset + 80,
  615. 259);
  616. } else if (inputDialogState == 2) {
  617. chatTextDrawingArea.drawText(0, "Enter name:", yOffset + 60, 259);
  618. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", yOffset + 80,
  619. 259);
  620. } else if (aString844 != null) {
  621. chatTextDrawingArea.drawText(0, aString844, yOffset + 60, 259);
  622. chatTextDrawingArea.drawText(128, "Click to continue",yOffset + 80, 259);
  623. } else if (backDialogID != -1) {
  624. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID],
  625. yOffset + 20);
  626. } else if (dialogID != -1) {
  627. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], yOffset + 20);
  628. } else if (showChat || clientSize == 0) {
  629. int shadow = -1;
  630. int amountOfMessages = 0;
  631. DrawingArea.setDrawingArea(121 + yOffset, 7, 498, 7 + yOffset);
  632. boolean changeChatArea = false;
  633. for (int k = 0; k < 500; k++) {
  634. if (chatMessages[k] != null) {
  635. String title;
  636. title = "";
  637.  
  638. int chatType = chatTypes[k];
  639. int yPos = (114 - amountOfMessages * 14) + 3 + chatScrollPos;
  640. String s1 = chatNames[k];
  641. byte playerRights = 0;
  642. if (s1 != null && s1.startsWith("@cr")) {
  643. int test1 = Integer.parseInt("" + s1.charAt(3));
  644. if (s1.charAt(4) != '@') {
  645. test1 = Integer.parseInt(s1.charAt(3) + "" + s1.charAt(4));
  646. s1 = s1.substring(6);
  647. } else {
  648. s1 = s1.substring(5);
  649. }
  650. playerRights = (byte) test1;
  651. }
  652. if (chatType == 0) {
  653. if (chatTypeView == 5 || chatTypeView == 0) {
  654. newRegularFont.drawBasicString(chatMessages[k], 11, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  655. amountOfMessages++;
  656. //j77++;
  657. }
  658. }
  659. if ((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  660. if (chatTypeView == 1 || chatTypeView == 0) {
  661. int xPos = 11;
  662. if (playerRights >= 1) {
  663. modIcons[playerRights - 1].drawSprite(xPos, yPos - 12 + yOffset);
  664. xPos += 16;
  665. }
  666. newRegularFont.drawBasicString(title + s1 + ":", xPos - 3, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  667. xPos += newRegularFont.getTextWidth(title + s1) + 8;
  668. newRegularFont.drawBasicString(chatMessages[k], xPos - 8, yPos + yOffset, changeChatArea ? 0x7FA9FF : 255, shadow);
  669. amountOfMessages++;
  670. //j77++;
  671. }
  672. }
  673. if ((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  674. if (chatTypeView == 2 || chatTypeView == 0) {
  675. int k1 = 11;
  676. newRegularFont.drawBasicString("From", k1, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  677. k1 += textDrawingArea.getTextWidth("From ");
  678. if (playerRights >= 1) {
  679. modIcons[playerRights - 1].drawSprite(k1, yPos - 12 + yOffset);
  680. k1 += 12;
  681. }
  682. newRegularFont.drawBasicString(s1 + ":", k1, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  683. k1 += textDrawingArea.getTextWidth(s1) + 8;
  684. newRegularFont.drawBasicString(chatMessages[k], k1, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  685. amountOfMessages++;
  686. //j77++;
  687. }
  688. }
  689. if (chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  690. if (chatTypeView == 3 || chatTypeView == 0) {
  691. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800080, shadow);
  692. amountOfMessages++;
  693. //j77++;
  694. }
  695. }
  696. if (chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  697. if (chatTypeView == 2 || chatTypeView == 0) {
  698. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 8, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  699. amountOfMessages++;
  700. //j77++;
  701. }
  702. }
  703. if (chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  704. if (chatTypeView == 2 || chatTypeView == 0) {
  705. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  706. newRegularFont.drawBasicString(chatMessages[k], 15 + textDrawingArea.getTextWidth("To :" + s1), yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  707. amountOfMessages++;
  708. //j77++;
  709. }
  710. }
  711. if (chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  712. if (chatTypeView == 3 || chatTypeView == 0) {
  713. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  714. amountOfMessages++;
  715. //j77++;
  716. }
  717. }
  718. if (chatType == 11) {
  719. if (chatTypeView == 11) {
  720. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 8, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  721. amountOfMessages++;
  722. //j77++;
  723. }
  724. }
  725. }
  726. }
  727. DrawingArea.defaultDrawingAreaSize();
  728.  
  729.  
  730.  
  731. chatScrollMax = amountOfMessages * 14 + 7 + 5;
  732. if(chatScrollMax < 111)
  733. chatScrollMax = 111;
  734. drawScrollbar(114, chatScrollMax - chatScrollPos - 114, 7 + (clientSize == 0 ? 0 : clientHeight - 165), 496, chatScrollMax);
  735.  
  736. String title;
  737. if (myPlayer != null && myPlayer.title != null) {
  738. title = "<col=" + myPlayer.titleColor + ">" + myPlayer.title + " </col>";
  739. } else {
  740. title = "";
  741. }
  742. String playerName;
  743. if (myPlayer != null && myPlayer.name != null) {
  744. playerName = myPlayer.name;
  745. } else {
  746. playerName = TextClass.fixName(myUsername);
  747. }
  748. DrawingArea.setDrawingArea(140 + yOffset, 8, 509, 120 + yOffset);
  749. int xPos = 0;
  750. int yPos = 0;
  751. newRegularFont.drawBasicString(playerName + "", 8, 136 + yOffset - 2, changeChatArea ? 0xFFFFFF : 0, changeChatArea ? 0 : -1);
  752. textDrawingArea.method385(changeChatArea ? 0xFFFFFF : 0, ": ", 136 + yOffset - 2, 8 + textDrawingArea.getTextWidth(playerName));
  753. newRegularFont.drawBasicString(inputString + "*", 10 + textDrawingArea.getTextWidth(playerName + ": "), 136 + yOffset - 2, changeChatArea ? 0x7FA9FF : 255, changeChatArea ? 0 : -1);
  754. DrawingArea.defaultDrawingAreaSize();
  755. for (int i = 0; i < 505; i++) {
  756. int opacity = 100 - (int) (i / 5.05);
  757. DrawingArea.method340(0, 1, 121 + yOffset, opacity + 5, 7 + i);
  758. }
  759. }
  760. if (menuOpen) {
  761. drawMenu(0, clientSize == 0 ? 338 : 0);
  762. }
  763. if (clientSize == 0) {
  764. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  765. }
  766. aRSImageProducer_1165.initDrawingArea();
  767. Rasterizer.anIntArray1472 = anIntArray1182;
  768. }
  769.  
  770.  
  771.  
  772.  
  773. private String clanUsername;
  774. private String clanMessage;
  775. private String clanTitle;
  776. private final String[] clanTitles;
  777. private int channelRights;
  778.  
  779. public void init() {
  780. try {
  781. nodeID = 10;
  782. portOff = 0;
  783. setHighMem();
  784. isMembers = true;
  785. signlink.storeid = 32;
  786. signlink.startpriv(InetAddress.getLocalHost());
  787. initClientFrame(503, 765);
  788. readSettings();
  789. } catch (Exception exception) {
  790. return;
  791. }
  792. }
  793.  
  794. public void startRunnable(Runnable runnable, int i) {
  795. if (i > 10)
  796. i = 10;
  797. if (signlink.mainapp != null) {
  798. signlink.startthread(runnable, i);
  799. } else {
  800. super.startRunnable(runnable, i);
  801. }
  802. }
  803.  
  804. public Socket openSocket(int port) throws IOException {
  805. return new Socket(InetAddress.getByName(server), port);
  806. }
  807.  
  808. private void processMenuClick() {
  809. if(activeInterfaceType != 0)
  810. return;
  811. int j = super.clickMode3;
  812. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  813. j = 0;
  814. if(menuOpen) {
  815. if(j != 1) {
  816. int k = super.mouseX;
  817. int j1 = super.mouseY;
  818. if(menuScreenArea == 0) {
  819. k -= 4;
  820. j1 -= 4;
  821. }
  822. if(menuScreenArea == 1) {
  823. k -= 519;
  824. j1 -= 168;
  825. }
  826. if(menuScreenArea == 2) {
  827. k -= 17;
  828. j1 -= 338;
  829. }
  830. if(menuScreenArea == 3) {
  831. k -= 519;
  832. j1 -= 0;
  833. }
  834. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  835. menuOpen = false;
  836. if(menuScreenArea == 1) {
  837. }
  838. if(menuScreenArea == 2)
  839. inputTaken = true;
  840. }
  841. }
  842. if(j == 1) {
  843. int l = menuOffsetX;
  844. int k1 = menuOffsetY;
  845. int i2 = menuWidth;
  846. int k2 = super.saveClickX;
  847. int l2 = super.saveClickY;
  848. switch (menuScreenArea) {
  849. case 0:
  850. k2 -= 4;
  851. l2 -= 4;
  852. break;
  853. case 1:
  854. k2 -= 519;
  855. l2 -= 168;
  856. break;
  857. case 2:
  858. k2 -= 5;
  859. l2 -= 338;
  860. break;
  861. case 3:
  862. k2 -= 519;
  863. l2 -= 0;
  864. break;
  865. }
  866. int i3 = -1;
  867. for(int j3 = 0; j3 < menuActionRow; j3++) {
  868. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  869. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  870. i3 = j3;
  871. }
  872. if(i3 != -1)
  873. doAction(i3);
  874. menuOpen = false;
  875. if(menuScreenArea == 1) {
  876. }
  877. if(menuScreenArea == 2) {
  878. inputTaken = true;
  879. }
  880. }
  881. } else {
  882. if(j == 1 && menuActionRow > 0) {
  883. int i1 = menuActionID[menuActionRow - 1];
  884. 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) {
  885. int l1 = menuActionCmd2[menuActionRow - 1];
  886. int j2 = menuActionCmd3[menuActionRow - 1];
  887. RSInterface class9 = RSInterface.interfaceCache[j2];
  888. if(class9.aBoolean259 || class9.aBoolean235) {
  889. aBoolean1242 = false;
  890. anInt989 = 0;
  891. anInt1084 = j2;
  892. anInt1085 = l1;
  893. activeInterfaceType = 2;
  894. anInt1087 = super.saveClickX;
  895. anInt1088 = super.saveClickY;
  896. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  897. activeInterfaceType = 1;
  898. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  899. activeInterfaceType = 3;
  900. return;
  901. }
  902. }
  903. }
  904. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  905. j = 2;
  906. if(j == 1 && menuActionRow > 0)
  907. doAction(menuActionRow - 1);
  908. if(j == 2 && menuActionRow > 0)
  909. determineMenuSize();
  910.  
  911. processMainScreenClick();
  912. processTabClick();
  913. processChatModeClick();
  914. minimapHovers();
  915. }
  916. }
  917.  
  918. public byte[] getModel(int index) {
  919. try {
  920. File model = new File("./Models/" + index + ".gz");
  921. byte[] aByte = new byte[(int) model.length()];
  922. FileInputStream Fis = new FileInputStream(model);
  923. Fis.read(aByte);
  924. pushMessage("aByte = [" + aByte + "]!", 0, "");
  925. Fis.close();
  926. return aByte;
  927. } catch (Exception e) {
  928. return null;
  929. }
  930. }
  931.  
  932. public static int totalRead = 0;
  933.  
  934. public static String getFileNameWithoutExtension(String fileName) {
  935. File tmpFile = new File(fileName);
  936. tmpFile.getName();
  937. int whereDot = tmpFile.getName().lastIndexOf('.');
  938. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  939. return tmpFile.getName().substring(0, whereDot);
  940. }
  941. return "";
  942. }
  943.  
  944. public static final byte[] ReadFile(String s) {
  945. try {
  946. byte abyte0[];
  947. File file = new File(s);
  948. int i = (int) file.length();
  949. abyte0 = new byte[i];
  950. DataInputStream datainputstream = new DataInputStream(
  951. new BufferedInputStream(new FileInputStream(s)));
  952. datainputstream.readFully(abyte0, 0, i);
  953. datainputstream.close();
  954. totalRead++;
  955. return abyte0;
  956. } catch (Exception e) {
  957. System.out.println((new StringBuilder()).append("Read Error: ")
  958. .append(s).toString());
  959. return null;
  960. }
  961. }
  962.  
  963. public void models() {
  964. for (int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  965. byte[] abyte0 = getModel(ModelIndex);
  966. if (abyte0 != null && abyte0.length > 0) {
  967. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  968. pushMessage("Model added successfully!", 0, "");
  969. }
  970. }
  971. }
  972.  
  973. private void saveMidi(boolean flag, byte abyte0[]) {
  974. signlink.midifade = flag ? 1 : 0;
  975. signlink.midisave(abyte0, abyte0.length);
  976. }
  977.  
  978. private void method22() {
  979. try {
  980. anInt985 = -1;
  981. aClass19_1056.removeAll();
  982. aClass19_1013.removeAll();
  983. Rasterizer.method366();
  984. unlinkMRUNodes();
  985. worldController.initToNull();
  986. System.gc();
  987. for (int i = 0; i < 4; i++)
  988. aClass11Array1230[i].method210();
  989.  
  990. for (int l = 0; l < 4; l++) {
  991. for (int k1 = 0; k1 < 104; k1++) {
  992. for (int j2 = 0; j2 < 104; j2++)
  993. byteGroundArray[l][k1][j2] = 0;
  994.  
  995. }
  996.  
  997. }
  998.  
  999. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  1000. intGroundArray);
  1001. int k2 = aByteArrayArray1183.length;
  1002. stream.createFrame(0);
  1003. if (!aBoolean1159) {
  1004. for (int i3 = 0; i3 < k2; i3++) {
  1005. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1006. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1007. byte abyte0[] = aByteArrayArray1183[i3];
  1008. if (abyte0 != null)
  1009. objectManager.method180(abyte0, k5, i4,
  1010. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  1011. aClass11Array1230);
  1012. }
  1013.  
  1014. for (int j4 = 0; j4 < k2; j4++) {
  1015. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  1016. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  1017. byte abyte2[] = aByteArrayArray1183[j4];
  1018. if (abyte2 == null && anInt1070 < 800)
  1019. objectManager.method174(k7, 64, 64, l5);
  1020. }
  1021.  
  1022. anInt1097++;
  1023. if (anInt1097 > 160) {
  1024. anInt1097 = 0;
  1025. stream.createFrame(238);
  1026. stream.writeWordBigEndian(96);
  1027. }
  1028. stream.createFrame(0);
  1029. for (int i6 = 0; i6 < k2; i6++) {
  1030. byte abyte1[] = aByteArrayArray1247[i6];
  1031. if (abyte1 != null) {
  1032. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1033. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1034. objectManager.method190(l8, aClass11Array1230, k9,
  1035. worldController, abyte1);
  1036. }
  1037. }
  1038.  
  1039. }
  1040. if (aBoolean1159) {
  1041. for (int j3 = 0; j3 < 4; j3++) {
  1042. for (int k4 = 0; k4 < 13; k4++) {
  1043. for (int j6 = 0; j6 < 13; j6++) {
  1044. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1045. if (l7 != -1) {
  1046. int i9 = l7 >> 24 & 3;
  1047. int l9 = l7 >> 1 & 3;
  1048. int j10 = l7 >> 14 & 0x3ff;
  1049. int l10 = l7 >> 3 & 0x7ff;
  1050. int j11 = (j10 / 8 << 8) + l10 / 8;
  1051. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1052. if (anIntArray1234[l11] != j11
  1053. || aByteArrayArray1183[l11] == null)
  1054. continue;
  1055. objectManager.method179(i9, l9,
  1056. aClass11Array1230, k4 * 8,
  1057. (j10 & 7) * 8,
  1058. aByteArrayArray1183[l11],
  1059. (l10 & 7) * 8, j3, j6 * 8);
  1060. break;
  1061. }
  1062.  
  1063. }
  1064. }
  1065.  
  1066. }
  1067.  
  1068. }
  1069.  
  1070. for (int l4 = 0; l4 < 13; l4++) {
  1071. for (int k6 = 0; k6 < 13; k6++) {
  1072. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1073. if (i8 == -1)
  1074. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1075. }
  1076.  
  1077. }
  1078.  
  1079. stream.createFrame(0);
  1080. for (int l6 = 0; l6 < 4; l6++) {
  1081. for (int j8 = 0; j8 < 13; j8++) {
  1082. for (int j9 = 0; j9 < 13; j9++) {
  1083. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1084. if (i10 != -1) {
  1085. int k10 = i10 >> 24 & 3;
  1086. int i11 = i10 >> 1 & 3;
  1087. int k11 = i10 >> 14 & 0x3ff;
  1088. int i12 = i10 >> 3 & 0x7ff;
  1089. int j12 = (k11 / 8 << 8) + i12 / 8;
  1090. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1091. if (anIntArray1234[k12] != j12
  1092. || aByteArrayArray1247[k12] == null)
  1093. continue;
  1094. objectManager.method183(aClass11Array1230,
  1095. worldController, k10, j8 * 8,
  1096. (i12 & 7) * 8, l6,
  1097. aByteArrayArray1247[k12],
  1098. (k11 & 7) * 8, i11, j9 * 8);
  1099. break;
  1100. }
  1101.  
  1102. }
  1103. }
  1104.  
  1105. }
  1106.  
  1107. }
  1108.  
  1109. }
  1110. stream.createFrame(0);
  1111. objectManager.method171(aClass11Array1230, worldController);
  1112. aRSImageProducer_1165.initDrawingArea();
  1113. stream.createFrame(0);
  1114. int k3 = ObjectManager.anInt145;
  1115. if (k3 > plane)
  1116. k3 = plane;
  1117. if (k3 < plane - 1)
  1118. k3 = plane - 1;
  1119. if (lowMem)
  1120. worldController.method275(ObjectManager.anInt145);
  1121. else
  1122. worldController.method275(0);
  1123. for (int i5 = 0; i5 < 104; i5++) {
  1124. for (int i7 = 0; i7 < 104; i7++)
  1125. spawnGroundItem(i5, i7);
  1126.  
  1127. }
  1128.  
  1129. anInt1051++;
  1130. if (anInt1051 > 98) {
  1131. anInt1051 = 0;
  1132. stream.createFrame(150);
  1133. }
  1134. method63();
  1135. } catch (Exception exception) {
  1136. }
  1137. ObjectDef.mruNodes1.unlinkAll();
  1138. if (super.gameFrame != null) {
  1139. stream.createFrame(210);
  1140. stream.writeDWord(0x3f008edd);
  1141. }
  1142. if (lowMem && signlink.cache_dat != null) {
  1143. //int j = onDemandFetcher.getVersionCount(0);
  1144. //for (int i1 = 0; i1 < j; i1++) {
  1145. //int l1 = onDemandFetcher.getModelIndex(i1);
  1146. // if ((l1 & 0x79) == 0)
  1147. // Model.method461(i1);
  1148. //}
  1149.  
  1150. }
  1151. System.gc();
  1152. Rasterizer.method367();
  1153. onDemandFetcher.method566();
  1154. int k = (anInt1069 - 6) / 8 - 1;
  1155. int j1 = (anInt1069 + 6) / 8 + 1;
  1156. int i2 = (anInt1070 - 6) / 8 - 1;
  1157. int l2 = (anInt1070 + 6) / 8 + 1;
  1158. if (aBoolean1141) {
  1159. k = 49;
  1160. j1 = 50;
  1161. i2 = 49;
  1162. l2 = 50;
  1163. }
  1164. for (int l3 = k; l3 <= j1; l3++) {
  1165. for (int j5 = i2; j5 <= l2; j5++)
  1166. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1167. int j7 = onDemandFetcher.method562(0, j5, l3);
  1168. if (j7 != -1)
  1169. onDemandFetcher.method560(j7, 3);
  1170. int k8 = onDemandFetcher.method562(1, j5, l3);
  1171. if (k8 != -1)
  1172. onDemandFetcher.method560(k8, 3);
  1173. }
  1174.  
  1175. }
  1176.  
  1177. }
  1178.  
  1179. private void unlinkMRUNodes() {
  1180. ObjectDef.mruNodes1.unlinkAll();
  1181. ObjectDef.mruNodes2.unlinkAll();
  1182. EntityDef.mruNodes.unlinkAll();
  1183. ItemDef.mruNodes2.unlinkAll();
  1184. ItemDef.mruNodes1.unlinkAll();
  1185. Player.mruNodes.unlinkAll();
  1186. SpotAnim.aMRUNodes_415.unlinkAll();
  1187. }
  1188.  
  1189. private void method24(int i) {
  1190. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1191. int j = ai.length;
  1192. for (int k = 0; k < j; k++)
  1193. ai[k] = 0;
  1194.  
  1195. for (int l = 1; l < 103; l++) {
  1196. int i1 = 24628 + (103 - l) * 512 * 4;
  1197. for (int k1 = 1; k1 < 103; k1++) {
  1198. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1199. worldController.method309(ai, i1, i, k1, l);
  1200. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1201. worldController.method309(ai, i1, i + 1, k1, l);
  1202. i1 += 4;
  1203. }
  1204.  
  1205. }
  1206.  
  1207. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16)
  1208. + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  1209. + ((238 + (int) (Math.random() * 20D)) - 10);
  1210. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  1211. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1212. for (int i2 = 1; i2 < 103; i2++) {
  1213. for (int j2 = 1; j2 < 103; j2++) {
  1214. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1215. method50(i2, j1, j2, l1, i);
  1216. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1217. method50(i2, j1, j2, l1, i + 1);
  1218. }
  1219.  
  1220. }
  1221.  
  1222. aRSImageProducer_1165.initDrawingArea();
  1223. anInt1071 = 0;
  1224. for (int k2 = 0; k2 < 104; k2++) {
  1225. for (int l2 = 0; l2 < 104; l2++) {
  1226. int i3 = worldController.method303(plane, k2, l2);
  1227. if (i3 != 0) {
  1228. i3 = i3 >> 14 & 0x7fff;
  1229. int j3 = ObjectDef.forID(i3).anInt746;
  1230. if (j3 >= 0) {
  1231. int k3 = k2;
  1232. int l3 = l2;
  1233. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36
  1234. && j3 != 46 && j3 != 47 && j3 != 48) {
  1235. byte byte0 = 104;
  1236. byte byte1 = 104;
  1237. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1238. for (int i4 = 0; i4 < 10; i4++) {
  1239. int j4 = (int) (Math.random() * 4D);
  1240. if (j4 == 0 && k3 > 0 && k3 > k2 - 3
  1241. && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1242. k3--;
  1243. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3
  1244. && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1245. k3++;
  1246. if (j4 == 2 && l3 > 0 && l3 > l2 - 3
  1247. && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1248. l3--;
  1249. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3
  1250. && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1251. l3++;
  1252. }
  1253.  
  1254. }
  1255. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1256. anIntArray1072[anInt1071] = k3;
  1257. anIntArray1073[anInt1071] = l3;
  1258. anInt1071++;
  1259. }
  1260. }
  1261. }
  1262.  
  1263. }
  1264.  
  1265. }
  1266.  
  1267. private void spawnGroundItem(int i, int j) {
  1268. NodeList class19 = groundArray[plane][i][j];
  1269. if (class19 == null) {
  1270. worldController.method295(plane, i, j);
  1271. return;
  1272. }
  1273. int k = 0xfa0a1f01;
  1274. Object obj = null;
  1275. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1276. .reverseGetNext()) {
  1277. ItemDef itemDef = ItemDef.forID(item.ID);
  1278. int l = itemDef.value;
  1279. if (itemDef.stackable)
  1280. l *= item.anInt1559 + 1;
  1281. // notifyItemSpawn(item, i + baseX, j + baseY);
  1282. if (l > k) {
  1283. k = l;
  1284. obj = item;
  1285. }
  1286. }
  1287.  
  1288. class19.insertTail(((Node) (obj)));
  1289. Object obj1 = null;
  1290. Object obj2 = null;
  1291. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1292. .reverseGetNext()) {
  1293. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1294. && obj1 == null)
  1295. obj1 = class30_sub2_sub4_sub2_1;
  1296. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1297. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1298. && obj2 == null)
  1299. obj2 = class30_sub2_sub4_sub2_1;
  1300. }
  1301.  
  1302. int i1 = i + (j << 7) + 0x60000000;
  1303. worldController.method281(i, i1, ((Animable) (obj1)),
  1304. method42(plane, j * 128 + 64, i * 128 + 64),
  1305. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1306. }
  1307.  
  1308. private void method26(boolean flag) {
  1309. for (int j = 0; j < npcCount; j++) {
  1310. NPC npc = npcArray[npcIndices[j]];
  1311. int k = 0x20000000 + (npcIndices[j] << 14);
  1312. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1313. continue;
  1314. int l = npc.x >> 7;
  1315. int i1 = npc.y >> 7;
  1316. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1317. continue;
  1318. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1319. && (npc.y & 0x7f) == 64) {
  1320. if (anIntArrayArray929[l][i1] == anInt1265)
  1321. continue;
  1322. anIntArrayArray929[l][i1] = anInt1265;
  1323. }
  1324. if (!npc.desc.aBoolean84)
  1325. k += 0x80000000;
  1326. worldController
  1327. .method285(plane, npc.anInt1552,
  1328. method42(plane, npc.y, npc.x), k, npc.y,
  1329. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1330. npc.aBoolean1541);
  1331. }
  1332. }
  1333.  
  1334. private boolean replayWave() {
  1335. return signlink.wavereplay();
  1336. }
  1337.  
  1338. private void loadError() {
  1339. String s = "ondemand"; // was a constant parameter
  1340. System.out.println(s);
  1341. try {
  1342. getAppletContext().showDocument(
  1343. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1344. } catch (Exception exception) {
  1345. exception.printStackTrace();
  1346. }
  1347. do
  1348. try {
  1349. Thread.sleep(1000L);
  1350. } catch (Exception _ex) {
  1351. }
  1352. while (true);
  1353. }
  1354.  
  1355. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
  1356. int i1, int j1) {
  1357. if (class9.type != 0 || class9.children == null
  1358. || class9.isMouseoverTriggered)
  1359. return;
  1360. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1361. return;
  1362. int k1 = class9.children.length;
  1363. for (int l1 = 0; l1 < k1; l1++) {
  1364. int i2 = class9.childX[l1] + i;
  1365. int j2 = (class9.childY[l1] + l) - j1;
  1366. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1367. i2 += class9_1.anInt263;
  1368. j2 += class9_1.anInt265;
  1369. if ((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0)
  1370. && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1371. && i1 < j2 + class9_1.height)
  1372. if (class9_1.mOverInterToTrigger >= 0)
  1373. anInt886 = class9_1.mOverInterToTrigger;
  1374. else
  1375. anInt886 = class9_1.id;
  1376. if (class9_1.type == 8 && k >= i2 && i1 >= j2
  1377. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1378. anInt1315 = class9_1.id;
  1379. }
  1380. if (class9_1.type == 0) {
  1381. buildInterfaceMenu(i2, class9_1, k, j2, i1,
  1382. class9_1.scrollPosition);
  1383. if (class9_1.scrollMax > class9_1.height)
  1384. method65(i2 + class9_1.width, class9_1.height, k, i1,
  1385. class9_1, j2, true, class9_1.scrollMax);
  1386. } else {
  1387. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
  1388. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1389. boolean flag = false;
  1390. if (class9_1.contentType != 0)
  1391. flag = buildFriendsListMenu(class9_1);
  1392. if (!flag) {
  1393. // System.out.println("1"+class9_1.tooltip + ", " +
  1394. // class9_1.interfaceID);
  1395. menuActionName[menuActionRow] = class9_1.tooltip;
  1396. menuActionID[menuActionRow] = 315;
  1397. menuActionCmd3[menuActionRow] = class9_1.id;
  1398. menuActionRow++;
  1399. }
  1400. }
  1401. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
  1402. && i1 >= j2 && k < i2 + class9_1.width
  1403. && i1 < j2 + class9_1.height) {
  1404. String s = class9_1.selectedActionName;
  1405. if (s.indexOf(" ") != -1)
  1406. s = s.substring(0, s.indexOf(" "));
  1407. menuActionName[menuActionRow] = s + " @gre@"
  1408. + class9_1.spellName;
  1409. menuActionID[menuActionRow] = 626;
  1410. menuActionCmd3[menuActionRow] = class9_1.id;
  1411. menuActionRow++;
  1412. }
  1413. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
  1414. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1415. menuActionName[menuActionRow] = "Close";
  1416. menuActionID[menuActionRow] = 200;
  1417. menuActionCmd3[menuActionRow] = class9_1.id;
  1418. menuActionRow++;
  1419. }
  1420. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
  1421. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1422. // System.out.println("2"+class9_1.tooltip + ", " +
  1423. // class9_1.interfaceID);
  1424. menuActionName[menuActionRow] = class9_1.tooltip + ", "
  1425. + class9_1.id;
  1426. menuActionID[menuActionRow] = 169;
  1427. menuActionCmd3[menuActionRow] = class9_1.id;
  1428. menuActionRow++;
  1429. }
  1430. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
  1431. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1432. // System.out.println("3"+class9_1.tooltip + ", " +
  1433. // class9_1.interfaceID);
  1434. menuActionName[menuActionRow] = class9_1.tooltip + ", "
  1435. + class9_1.id;
  1436. menuActionID[menuActionRow] = 646;
  1437. menuActionCmd3[menuActionRow] = class9_1.id;
  1438. menuActionRow++;
  1439. }
  1440. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
  1441. && i1 >= j2 && k < i2 + class9_1.width
  1442. && i1 < j2 + class9_1.height) {
  1443. // System.out.println("4"+class9_1.tooltip + ", " +
  1444. // class9_1.interfaceID);
  1445. menuActionName[menuActionRow] = class9_1.tooltip + ", "
  1446. + class9_1.id;
  1447. menuActionID[menuActionRow] = 679;
  1448. menuActionCmd3[menuActionRow] = class9_1.id;
  1449. menuActionRow++;
  1450. }
  1451. if (k >= i2 && i1 >= j2
  1452. && k < i2 + (class9_1.type == 4 ? 100 : class9_1.width)
  1453. && i1 < j2 + class9_1.height) {
  1454. if (class9_1.actions != null) {
  1455. if ((class9_1.type == 4 && class9_1.message.length() > 0)
  1456. || class9_1.type == 5) {
  1457. for (int action = class9_1.actions.length - 1; action >= 0; action--) {
  1458. if (class9_1.actions[action] != null) {
  1459. menuActionName[menuActionRow] = class9_1.actions[action]
  1460. + (class9_1.type == 4 ? " "
  1461. + class9_1.message : "");
  1462. menuActionID[menuActionRow] = 647;
  1463. menuActionCmd2[menuActionRow] = action;
  1464. menuActionCmd3[menuActionRow] = class9_1.id;
  1465. menuActionRow++;
  1466. }
  1467. }
  1468. }
  1469. }
  1470. }
  1471. if (class9_1.type == 2) {
  1472. int k2 = 0;
  1473. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1474. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1475. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1476. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1477. if (k2 < 20) {
  1478. j3 += class9_1.spritesX[k2];
  1479. k3 += class9_1.spritesY[k2];
  1480. }
  1481. if (k >= j3 && i1 >= k3 && k < j3 + 32
  1482. && i1 < k3 + 32) {
  1483. mouseInvInterfaceIndex = k2;
  1484. lastActiveInvInterface = class9_1.id;
  1485. if (class9_1.inv[k2] > 0) {
  1486. ItemDef itemDef = ItemDef
  1487. .forID(class9_1.inv[k2] - 1);
  1488. if (itemSelected == 1
  1489. && class9_1.isInventoryInterface) {
  1490. if (class9_1.id != anInt1284
  1491. || k2 != anInt1283) {
  1492. menuActionName[menuActionRow] = "Use "
  1493. + selectedItemName
  1494. + " with @lre@"
  1495. + itemDef.name;
  1496. menuActionID[menuActionRow] = 870;
  1497. menuActionCmd1[menuActionRow] = itemDef.id;
  1498. menuActionCmd2[menuActionRow] = k2;
  1499. menuActionCmd3[menuActionRow] = class9_1.id;
  1500. menuActionRow++;
  1501. }
  1502. } else if (spellSelected == 1
  1503. && class9_1.isInventoryInterface) {
  1504. if ((spellUsableOn & 0x10) == 16) {
  1505. menuActionName[menuActionRow] = spellTooltip
  1506. + " @lre@" + itemDef.name;
  1507. menuActionID[menuActionRow] = 543;
  1508. menuActionCmd1[menuActionRow] = itemDef.id;
  1509. menuActionCmd2[menuActionRow] = k2;
  1510. menuActionCmd3[menuActionRow] = class9_1.id;
  1511. menuActionRow++;
  1512. }
  1513. } else {
  1514. if (class9_1.isInventoryInterface) {
  1515. for (int l3 = 4; l3 >= 3; l3--)
  1516. if (itemDef.actions != null
  1517. && itemDef.actions[l3] != null) {
  1518. menuActionName[menuActionRow] = itemDef.actions[l3]
  1519. + " @lre@"
  1520. + itemDef.name;
  1521. if (l3 == 3)
  1522. menuActionID[menuActionRow] = 493;
  1523. if (l3 == 4)
  1524. menuActionID[menuActionRow] = 847;
  1525. menuActionCmd1[menuActionRow] = itemDef.id;
  1526. menuActionCmd2[menuActionRow] = k2;
  1527. menuActionCmd3[menuActionRow] = class9_1.id;
  1528. menuActionRow++;
  1529. } else if (l3 == 4) {
  1530. menuActionName[menuActionRow] = "Drop @lre@"
  1531. + itemDef.name;
  1532. menuActionID[menuActionRow] = 847;
  1533. menuActionCmd1[menuActionRow] = itemDef.id;
  1534. menuActionCmd2[menuActionRow] = k2;
  1535. menuActionCmd3[menuActionRow] = class9_1.id;
  1536. menuActionRow++;
  1537. }
  1538.  
  1539. }
  1540. if (class9_1.usableItemInterface) {
  1541. menuActionName[menuActionRow] = "Use @lre@"
  1542. + itemDef.name;
  1543. menuActionID[menuActionRow] = 447;
  1544. menuActionCmd1[menuActionRow] = itemDef.id;
  1545. menuActionCmd2[menuActionRow] = k2;
  1546. menuActionCmd3[menuActionRow] = class9_1.id;
  1547. menuActionRow++;
  1548. }
  1549. if (class9_1.isInventoryInterface
  1550. && itemDef.actions != null) {
  1551. for (int i4 = 2; i4 >= 0; i4--)
  1552. if (itemDef.actions[i4] != null) {
  1553. menuActionName[menuActionRow] = itemDef.actions[i4]
  1554. + " @lre@"
  1555. + itemDef.name;
  1556. if (i4 == 0)
  1557. menuActionID[menuActionRow] = 74;
  1558. if (i4 == 1)
  1559. menuActionID[menuActionRow] = 454;
  1560. if (i4 == 2)
  1561. menuActionID[menuActionRow] = 539;
  1562. menuActionCmd1[menuActionRow] = itemDef.id;
  1563. menuActionCmd2[menuActionRow] = k2;
  1564. menuActionCmd3[menuActionRow] = class9_1.id;
  1565. menuActionRow++;
  1566. }
  1567.  
  1568. }
  1569. if (class9_1.actions != null) {
  1570. for (int j4 = 6; j4 >= 0; j4--) {
  1571. if (j4 > class9_1.actions.length - 1)
  1572. continue;
  1573. if (class9_1.actions[j4] != null) {
  1574. if (class9_1.parentID == 5292) {
  1575. if (modifiableXValue > 0) {
  1576. if (class9_1.actions.length < 7) {
  1577. class9_1.actions = new String[] {
  1578. "Withdraw 1",
  1579. "Withdraw 5",
  1580. "Withdraw 10",
  1581. "Withdraw All",
  1582. "Withdraw X",
  1583. "Withdraw "
  1584. + modifiableXValue,
  1585. "Withdraw All but one" };
  1586. }
  1587. class9_1.actions[5] = "Withdraw "
  1588. + modifiableXValue;
  1589. }
  1590. }
  1591. menuActionName[menuActionRow] = class9_1.actions[j4]
  1592. + " @lre@"
  1593. + itemDef.name;
  1594. if (j4 == 0)
  1595. menuActionID[menuActionRow] = 632;
  1596. if (j4 == 1)
  1597. menuActionID[menuActionRow] = 78;
  1598. if (j4 == 2)
  1599. menuActionID[menuActionRow] = 867;
  1600. if (j4 == 3)
  1601. menuActionID[menuActionRow] = 431;
  1602. if (j4 == 4)
  1603. menuActionID[menuActionRow] = 53;
  1604. if (class9_1.parentID == 5292) {
  1605. if (class9_1.actions.length < 7) {
  1606. if (j4 == 5)
  1607. menuActionID[menuActionRow] = 291;
  1608. } else {
  1609. if (j4 == 5)
  1610. menuActionID[menuActionRow] = 300;
  1611. if (j4 == 6)
  1612. menuActionID[menuActionRow] = 291;
  1613. }
  1614. }
  1615. menuActionCmd1[menuActionRow] = itemDef.id;
  1616. menuActionCmd2[menuActionRow] = k2;
  1617. menuActionCmd3[menuActionRow] = class9_1.id;
  1618. menuActionRow++;
  1619. }
  1620. }
  1621. }
  1622. menuActionName[menuActionRow] = "Examine @lre@"
  1623. + itemDef.name;
  1624. menuActionID[menuActionRow] = 1125;
  1625. menuActionCmd1[menuActionRow] = itemDef.id;
  1626. menuActionCmd2[menuActionRow] = k2;
  1627. menuActionCmd3[menuActionRow] = class9_1.id;
  1628. menuActionRow++;
  1629. }
  1630. }
  1631. }
  1632. k2++;
  1633. }
  1634.  
  1635. }
  1636.  
  1637. }
  1638. }
  1639. }
  1640.  
  1641. }
  1642.  
  1643. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1644. scrollBar1.drawSprite(i1, l);
  1645. scrollBar2.drawSprite(i1, (l + j) - 16);
  1646. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1647. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1648. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1649. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1650. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1651. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1652. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1653. int k1 = ((j - 32) * j) / j1;
  1654. if (k1 < 8)
  1655. k1 = 8;
  1656. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1657. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1658. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1659. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1660. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1661. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1662. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1663. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1664. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1665. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1666. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1667. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1668. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1669. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1670. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1671. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1672. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1673. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1674. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1675. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1676. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1677. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1678. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1679. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1680. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1681. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1682. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1683. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1684. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1685. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1686. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1687. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1688. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1689. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1690. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1691. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1692. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1693. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1694. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1695. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1696. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1697. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1698. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1699. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1700. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1701. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1702. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1703. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1704. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1705. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1706. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1707. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1708. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1709. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1710. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1711. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1712. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1713. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1714. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1715. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1716. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1717. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1718. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1719. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1720. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1721. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1722. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1723. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1724. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1725. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1726. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1727. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1728. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1729. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1730. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1731. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1732. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1733. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1734. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1735. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1736. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1737. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1738. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1739. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1740. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1741. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1742. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1743. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1744. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1745. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1746. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1747. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1748. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1749. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1750. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1751. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1752. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1753. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1754. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1755. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1756. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1757. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1758. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1759. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1760. }
  1761.  
  1762. private void updateNPCs(Stream stream, int i) {
  1763. anInt839 = 0;
  1764. anInt893 = 0;
  1765. method139(stream);
  1766. method46(i, stream);
  1767. method86(stream);
  1768. for (int k = 0; k < anInt839; k++) {
  1769. int l = anIntArray840[k];
  1770. if (npcArray[l].anInt1537 != loopCycle) {
  1771. npcArray[l].desc = null;
  1772. npcArray[l] = null;
  1773. }
  1774. }
  1775.  
  1776. if (stream.currentOffset != i) {
  1777. signlink.reporterror(myUsername
  1778. + " size mismatch in getnpcpos - pos:"
  1779. + stream.currentOffset + " psize:" + i);
  1780. throw new RuntimeException("eek");
  1781. }
  1782. for (int i1 = 0; i1 < npcCount; i1++)
  1783. if (npcArray[npcIndices[i1]] == null) {
  1784. signlink.reporterror(myUsername
  1785. + " null entry in npc list - pos:" + i1 + " size:"
  1786. + npcCount);
  1787. throw new RuntimeException("eek");
  1788. }
  1789.  
  1790. }
  1791.  
  1792. private int cButtonHPos;
  1793. private int cButtonCPos;
  1794.  
  1795. public int channel;
  1796.  
  1797. private void processChatModeClick() {
  1798. int y = 0;
  1799. if(clientSize != 0) {
  1800. y = clientHeight - 503;
  1801. }
  1802. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  1803. cButtonHPos = 0;
  1804. inputTaken = true;
  1805. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  1806. cButtonHPos = 1;
  1807. inputTaken = true;
  1808. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  1809. cButtonHPos = 2;
  1810. inputTaken = true;
  1811. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  1812. cButtonHPos = 3;
  1813. inputTaken = true;
  1814. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  1815. cButtonHPos = 4;
  1816. inputTaken = true;
  1817. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  1818. cButtonHPos = 5;
  1819. inputTaken = true;
  1820. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  1821. cButtonHPos = 6;
  1822. inputTaken = true;
  1823. } else {
  1824. cButtonHPos = -1;
  1825. inputTaken = true;
  1826. }
  1827. if(super.clickMode3 == 1) {
  1828. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= y + 482 && super.saveClickY <= y + 505) {
  1829. if (clientSize != 0) {
  1830. if (channel != 0) {
  1831. cButtonCPos = 0;
  1832. chatTypeView = 0;
  1833. inputTaken = true;
  1834. channel = 0;
  1835. } else {
  1836. showChat = showChat ? false : true;
  1837. }
  1838. } else {
  1839. cButtonCPos = 0;
  1840. chatTypeView = 0;
  1841. inputTaken = true;
  1842. channel = 0;
  1843. }
  1844. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= y + 482 && super.saveClickY <= y + 505) {
  1845. if (clientSize != 0) {
  1846. if (channel != 1 && clientSize != 0) {
  1847. cButtonCPos = 1;
  1848. chatTypeView = 5;
  1849. inputTaken = true;
  1850. channel = 1;
  1851. } else {
  1852. showChat = showChat ? false : true;
  1853. }
  1854. } else {
  1855. cButtonCPos = 1;
  1856. chatTypeView = 5;
  1857. inputTaken = true;
  1858. channel = 1;
  1859. }
  1860. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= y + 482 && super.saveClickY <= y + 505) {
  1861. if (clientSize != 0) {
  1862. if (channel != 2 && clientSize != 0) {
  1863. cButtonCPos = 2;
  1864. chatTypeView = 1;
  1865. inputTaken = true;
  1866. channel = 2;
  1867. } else {
  1868. showChat = showChat ? false : true;
  1869. }
  1870. } else {
  1871. cButtonCPos = 2;
  1872. chatTypeView = 1;
  1873. inputTaken = true;
  1874. channel = 2;
  1875. }
  1876. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= y + 482 && super.saveClickY <= y + 505) {
  1877. if (clientSize != 0) {
  1878. if (channel != 3 && clientSize != 0) {
  1879. cButtonCPos = 3;
  1880. chatTypeView = 2;
  1881. inputTaken = true;
  1882. channel = 3;
  1883. } else {
  1884. showChat = showChat ? false : true;
  1885. }
  1886. } else {
  1887. cButtonCPos = 3;
  1888. chatTypeView = 2;
  1889. inputTaken = true;
  1890. channel = 3;
  1891. }
  1892. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= y + 482 && super.saveClickY <= y + 505) {
  1893. if (clientSize != 0) {
  1894. if (channel != 4 && clientSize != 0) {
  1895. cButtonCPos = 4;
  1896. chatTypeView = 11;
  1897. inputTaken = true;
  1898. channel = 4;
  1899. } else {
  1900. showChat = showChat ? false : true;
  1901. }
  1902. } else {
  1903. cButtonCPos = 4;
  1904. chatTypeView = 11;
  1905. inputTaken = true;
  1906. channel = 4;
  1907. }
  1908. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= y + 482 && super.saveClickY <= y + 505) {
  1909. if (clientSize != 0) {
  1910. if (channel != 5 && clientSize != 0) {
  1911. cButtonCPos = 5;
  1912. chatTypeView = 3;
  1913. inputTaken = true;
  1914. channel = 5;
  1915. } else {
  1916. showChat = showChat ? false : true;
  1917. }
  1918. } else {
  1919. cButtonCPos = 5;
  1920. chatTypeView = 3;
  1921. inputTaken = true;
  1922. channel = 5;
  1923. }
  1924. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= y + 482 && super.saveClickY <= y + 505) {
  1925. if(openInterfaceID == -1) {
  1926. clearTopInterfaces();
  1927. reportAbuseInput = "";
  1928. canMute = false;
  1929. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1930. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1931. continue;
  1932. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1933. break;
  1934. }
  1935. } else {
  1936. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1937. }
  1938. }
  1939. }
  1940. }
  1941.  
  1942. private void method33(int i) {
  1943. int j = Varp.cache[i].anInt709;
  1944. if (j == 0)
  1945. return;
  1946. int k = variousSettings[i];
  1947. if (j == 1) {
  1948. if (k == 1)
  1949. Rasterizer.method372(0.90000000000000002D);
  1950. if (k == 2)
  1951. Rasterizer.method372(0.80000000000000004D);
  1952. if (k == 3)
  1953. Rasterizer.method372(0.69999999999999996D);
  1954. if (k == 4)
  1955. Rasterizer.method372(0.59999999999999998D);
  1956. ItemDef.mruNodes1.unlinkAll();
  1957. welcomeScreenRaised = true;
  1958. }
  1959. if (j == 3) {
  1960. boolean flag1 = musicEnabled;
  1961. if (k == 0) {
  1962. adjustVolume(musicEnabled, 0);
  1963. musicEnabled = true;
  1964. }
  1965. if (k == 1) {
  1966. adjustVolume(musicEnabled, -400);
  1967. musicEnabled = true;
  1968. }
  1969. if (k == 2) {
  1970. adjustVolume(musicEnabled, -800);
  1971. musicEnabled = true;
  1972. }
  1973. if (k == 3) {
  1974. adjustVolume(musicEnabled, -1200);
  1975. musicEnabled = true;
  1976. }
  1977. if (k == 4)
  1978. musicEnabled = false;
  1979. if (musicEnabled != flag1 && !lowMem) {
  1980. if (musicEnabled) {
  1981. nextSong = currentSong;
  1982. songChanging = true;
  1983. onDemandFetcher.method558(2, nextSong);
  1984. } else {
  1985. stopMidi();
  1986. }
  1987. prevSong = 0;
  1988. }
  1989. }
  1990. if (j == 4) {
  1991. if (k == 0) {
  1992. aBoolean848 = true;
  1993. setWaveVolume(0);
  1994. }
  1995. if (k == 1) {
  1996. aBoolean848 = true;
  1997. setWaveVolume(-400);
  1998. }
  1999. if (k == 2) {
  2000. aBoolean848 = true;
  2001. setWaveVolume(-800);
  2002. }
  2003. if (k == 3) {
  2004. aBoolean848 = true;
  2005. setWaveVolume(-1200);
  2006. }
  2007. if (k == 4)
  2008. aBoolean848 = false;
  2009. }
  2010. if (j == 5)
  2011. anInt1253 = k;
  2012. if (j == 6)
  2013. anInt1249 = k;
  2014. if (j == 8) {
  2015. splitPrivateChat = k;
  2016. inputTaken = true;
  2017. }
  2018. if (j == 9)
  2019. anInt913 = k;
  2020. }
  2021.  
  2022. public int opacity = 230;
  2023.  
  2024. public boolean doIt = false;
  2025.  
  2026. private void updateEntities() {
  2027. try {
  2028. int anInt974 = 0;
  2029. for (int j = -1; j < playerCount + npcCount; j++) {
  2030. Object obj;
  2031. if (j == -1)
  2032. obj = myPlayer;
  2033. else if (j < playerCount)
  2034. obj = playerArray[playerIndices[j]];
  2035. else
  2036. obj = npcArray[npcIndices[j - playerCount]];
  2037. if (obj == null || !((Entity) (obj)).isVisible())
  2038. continue;
  2039. if (obj instanceof NPC) {
  2040. EntityDef entityDef = ((NPC) obj).desc;
  2041. if (entityDef.childrenIDs != null)
  2042. entityDef = entityDef.method161();
  2043. if (entityDef == null)
  2044. continue;
  2045. }
  2046. if (j < playerCount) {
  2047. int l = 30;
  2048. Player player = (Player) obj;
  2049. if (player.headIcon >= 0) {
  2050. npcScreenPos(((Entity) (obj)),
  2051. ((Entity) (obj)).height + 15);
  2052. if (spriteDrawX > -1) {
  2053. if (player.skullIcon < 2) {
  2054. skullIcons[player.skullIcon].drawSprite(
  2055. spriteDrawX - 12, spriteDrawY - l);
  2056. l += 25;
  2057. }
  2058. if (player.headIcon < 7) {
  2059. headIcons[player.headIcon].drawSprite(
  2060. spriteDrawX - 12, spriteDrawY - l);
  2061. l += 18;
  2062. }
  2063. }
  2064. }
  2065. if (j >= 0 && anInt855 == 10
  2066. && anInt933 == playerIndices[j]) {
  2067. npcScreenPos(((Entity) (obj)),
  2068. ((Entity) (obj)).height + 15);
  2069. if (spriteDrawX > -1)
  2070. headIconsHint[player.hintIcon].drawSprite(
  2071. spriteDrawX - 12, spriteDrawY - l);
  2072. }
  2073. } else {
  2074. EntityDef entityDef_1 = ((NPC) obj).desc;
  2075. if (entityDef_1.anInt75 >= 0
  2076. && entityDef_1.anInt75 < headIcons.length) {
  2077. npcScreenPos(((Entity) (obj)),
  2078. ((Entity) (obj)).height + 15);
  2079. if (spriteDrawX > -1)
  2080. headIcons[entityDef_1.anInt75].drawSprite(
  2081. spriteDrawX - 12, spriteDrawY - 30);
  2082. }
  2083. if (anInt855 == 1
  2084. && anInt1222 == npcIndices[j - playerCount]
  2085. && loopCycle % 20 < 10) {
  2086. npcScreenPos(((Entity) (obj)),
  2087. ((Entity) (obj)).height + 15);
  2088. if (spriteDrawX > -1)
  2089. headIconsHint[0].drawSprite(spriteDrawX - 12,
  2090. spriteDrawY - 28);
  2091. }
  2092. }
  2093. if (((Entity) (obj)).textSpoken != null
  2094. && (j >= playerCount || publicChatMode == 0
  2095. || publicChatMode == 3 || publicChatMode == 1
  2096. && isFriendOrSelf(((Player) obj).name))) {
  2097. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2098. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2099. anIntArray979[anInt974] = chatTextDrawingArea
  2100. .method384(((Entity) (obj)).textSpoken) / 2;
  2101. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2102. anIntArray976[anInt974] = spriteDrawX;
  2103. anIntArray977[anInt974] = spriteDrawY;
  2104. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2105. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2106. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2107. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2108. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  2109. && ((Entity) (obj)).anInt1531 <= 3) {
  2110. anIntArray978[anInt974] += 10;
  2111. anIntArray977[anInt974] += 5;
  2112. }
  2113. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2114. anIntArray979[anInt974] = 60;
  2115. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2116. anIntArray978[anInt974] += 5;
  2117. }
  2118. }
  2119. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2120. try {
  2121. npcScreenPos(((Entity) (obj)),
  2122. ((Entity) (obj)).height + 15);
  2123. if (spriteDrawX > -1) {
  2124. int i1 = (((Entity) (obj)).currentHealth * 30)
  2125. / ((Entity) (obj)).maxHealth;
  2126. if (i1 > 30)
  2127. i1 = 30;
  2128. int HpPercent = (((Entity) (obj)).currentHealth * 56)
  2129. / ((Entity) (obj)).maxHealth;
  2130. if (HpPercent > 56)
  2131. HpPercent = 56;
  2132. HPBarEmpty.drawSprite(spriteDrawX - 28,
  2133. spriteDrawY - 5);
  2134. HPBarFull = new Sprite(signlink.findcachedir()
  2135. + "Sprites/Player/HP 0.png", HpPercent, 7);
  2136. HPBarFull.drawSprite(spriteDrawX - 28,
  2137. spriteDrawY - 5);
  2138. }
  2139. } catch (Exception e) {
  2140. }
  2141. }
  2142. for (int j2 = 0; j2 < 4; j2++) {
  2143. if (((Entity) (obj)).hitsLoopCycle[j2] > loopCycle) {
  2144. npcScreenPos(((Entity) (obj)),
  2145. ((Entity) (obj)).height / 2);
  2146. if (spriteDrawX > -1) {
  2147. if (j2 == 0 && ((Entity) (obj)).hitArray[j2] > 99)
  2148. ((Entity) (obj)).hitMarkTypes[j2] = 3;
  2149. else if (j2 == 1
  2150. && ((Entity) (obj)).hitArray[j2] > 99)
  2151. ((Entity) (obj)).hitMarkTypes[j2] = 3;
  2152. else if (j2 == 2
  2153. && ((Entity) (obj)).hitArray[j2] > 99)
  2154. ((Entity) (obj)).hitMarkTypes[j2] = 3;
  2155. else if (j2 == 3
  2156. && ((Entity) (obj)).hitArray[j2] > 99)
  2157. ((Entity) (obj)).hitMarkTypes[j2] = 3;
  2158. if (j2 == 1) {
  2159. spriteDrawY -= 20;
  2160. }
  2161. if (j2 == 2) {
  2162. spriteDrawX -= (((Entity) (obj)).hitArray[j2] > 99 ? 30
  2163. : 20);
  2164. spriteDrawY -= 10;
  2165. }
  2166. if (j2 == 3) {
  2167. spriteDrawX += (((Entity) (obj)).hitArray[j2] > 99 ? 30
  2168. : 20);
  2169. spriteDrawY -= 10;
  2170. }
  2171. if (((Entity) (obj)).hitMarkTypes[j2] == 3) {
  2172. spriteDrawX -= 8;
  2173. }
  2174. hitMarks562[((Entity) (obj)).hitMarkTypes[j2]]
  2175. .draw24BitSprite(spriteDrawX - 12,
  2176. spriteDrawY - 12);
  2177. smallText
  2178. .drawText(
  2179. 0xffffff,
  2180. String.valueOf(((Entity) (obj)).hitArray[j2]),
  2181. spriteDrawY + 3,
  2182. (((Entity) (obj)).hitMarkTypes[j2] == 3 ? spriteDrawX + 7
  2183. : spriteDrawX - 1));
  2184. }
  2185. }
  2186. }
  2187. }
  2188. for (int k = 0; k < anInt974; k++) {
  2189. int k1 = anIntArray976[k];
  2190. int l1 = anIntArray977[k];
  2191. int j2 = anIntArray979[k];
  2192. int k2 = anIntArray978[k];
  2193. boolean flag = true;
  2194. while (flag) {
  2195. flag = false;
  2196. for (int l2 = 0; l2 < k; l2++)
  2197. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2]
  2198. && l1 - k2 < anIntArray977[l2] + 2
  2199. && k1 - j2 < anIntArray976[l2]
  2200. + anIntArray979[l2]
  2201. && k1 + j2 > anIntArray976[l2]
  2202. - anIntArray979[l2]
  2203. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  2204. l1 = anIntArray977[l2] - anIntArray978[l2];
  2205. flag = true;
  2206. }
  2207.  
  2208. }
  2209. spriteDrawX = anIntArray976[k];
  2210. spriteDrawY = anIntArray977[k] = l1;
  2211. String s = aStringArray983[k];
  2212. if (anInt1249 == 0) {
  2213. int i3 = 0xffff00;
  2214. if (anIntArray980[k] < 6)
  2215. i3 = anIntArray965[anIntArray980[k]];
  2216. if (anIntArray980[k] == 6)
  2217. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2218. if (anIntArray980[k] == 7)
  2219. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2220. if (anIntArray980[k] == 8)
  2221. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2222. if (anIntArray980[k] == 9) {
  2223. int j3 = 150 - anIntArray982[k];
  2224. if (j3 < 50)
  2225. i3 = 0xff0000 + 1280 * j3;
  2226. else if (j3 < 100)
  2227. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2228. else if (j3 < 150)
  2229. i3 = 65280 + 5 * (j3 - 100);
  2230. }
  2231. if (anIntArray980[k] == 10) {
  2232. int k3 = 150 - anIntArray982[k];
  2233. if (k3 < 50)
  2234. i3 = 0xff0000 + 5 * k3;
  2235. else if (k3 < 100)
  2236. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2237. else if (k3 < 150)
  2238. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2239. }
  2240. if (anIntArray980[k] == 11) {
  2241. int l3 = 150 - anIntArray982[k];
  2242. if (l3 < 50)
  2243. i3 = 0xffffff - 0x50005 * l3;
  2244. else if (l3 < 100)
  2245. i3 = 65280 + 0x50005 * (l3 - 50);
  2246. else if (l3 < 150)
  2247. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2248. }
  2249. if (anIntArray981[k] == 0) {
  2250. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2251. spriteDrawX);
  2252. chatTextDrawingArea.drawText(i3, s, spriteDrawY,
  2253. spriteDrawX);
  2254. }
  2255. if (anIntArray981[k] == 1) {
  2256. chatTextDrawingArea.method386(0, s, spriteDrawX,
  2257. anInt1265, spriteDrawY + 1);
  2258. chatTextDrawingArea.method386(i3, s, spriteDrawX,
  2259. anInt1265, spriteDrawY);
  2260. }
  2261. if (anIntArray981[k] == 2) {
  2262. chatTextDrawingArea.method387(spriteDrawX, s,
  2263. anInt1265, spriteDrawY + 1, 0);
  2264. chatTextDrawingArea.method387(spriteDrawX, s,
  2265. anInt1265, spriteDrawY, i3);
  2266. }
  2267. if (anIntArray981[k] == 3) {
  2268. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2269. s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2270. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2271. s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2272. }
  2273. if (anIntArray981[k] == 4) {
  2274. int i4 = chatTextDrawingArea.method384(s);
  2275. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2276. DrawingArea.setDrawingArea(334, spriteDrawX - 50,
  2277. spriteDrawX + 50, 0);
  2278. chatTextDrawingArea.method385(0, s, spriteDrawY + 1,
  2279. (spriteDrawX + 50) - k4);
  2280. chatTextDrawingArea.method385(i3, s, spriteDrawY,
  2281. (spriteDrawX + 50) - k4);
  2282. DrawingArea.defaultDrawingAreaSize();
  2283. }
  2284. if (anIntArray981[k] == 5) {
  2285. int j4 = 150 - anIntArray982[k];
  2286. int l4 = 0;
  2287. if (j4 < 25)
  2288. l4 = j4 - 25;
  2289. else if (j4 > 125)
  2290. l4 = j4 - 125;
  2291. DrawingArea
  2292. .setDrawingArea(spriteDrawY + 5, 0, 512,
  2293. spriteDrawY
  2294. - chatTextDrawingArea.anInt1497
  2295. - 1);
  2296. chatTextDrawingArea.drawText(0, s,
  2297. spriteDrawY + 1 + l4, spriteDrawX);
  2298. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4,
  2299. spriteDrawX);
  2300. DrawingArea.defaultDrawingAreaSize();
  2301. }
  2302. } else {
  2303. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2304. spriteDrawX);
  2305. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY,
  2306. spriteDrawX);
  2307. }
  2308. }
  2309. } catch (Exception e) {
  2310. }
  2311. }
  2312.  
  2313. private void delFriend(long l) {
  2314. try {
  2315. if (l == 0L)
  2316. return;
  2317. for (int i = 0; i < friendsCount; i++) {
  2318. if (friendsListAsLongs[i] != l)
  2319. continue;
  2320. friendsCount--;
  2321. needDrawTabArea = true;
  2322. for (int j = i; j < friendsCount; j++) {
  2323. friendsList[j] = friendsList[j + 1];
  2324. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2325. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2326. }
  2327.  
  2328. stream.createFrame(215);
  2329. stream.writeQWord(l);
  2330. break;
  2331. }
  2332. } catch (RuntimeException runtimeexception) {
  2333. signlink.reporterror("18622, " + false + ", " + l + ", "
  2334. + runtimeexception.toString());
  2335. throw new RuntimeException();
  2336. }
  2337. }
  2338.  
  2339. public void drawSideIcons() {
  2340. if (clientSize == 0) {
  2341. int[] id = {
  2342. 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
  2343. };
  2344. int[] tab = {
  2345. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
  2346. };
  2347. int[] positionX = {
  2348. 17, 49, 83, 114, 147, 180, 214, 14, 49, 82, 116, 148, 184, 216
  2349. };
  2350. int[] positionY = {
  2351. 9, 7, 7, 5, 2, 3, 7, 303, 306, 306, 302, 304, 302, 303
  2352. };
  2353. for (int i = 0; i < 14; i++) {
  2354. if (tabInterfaceIDs[tab[i]] != -1) {
  2355. if (id[i] != -1) {
  2356. cacheSprite[id[i]].drawSprite(positionX[i], positionY[i]);
  2357. }
  2358. }
  2359. }
  2360. } else if (clientSize != 0) {
  2361. if(clientWidth < smallTabs) {
  2362. int[] id = {
  2363. 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
  2364. };
  2365. int[] tab = {
  2366. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
  2367. };
  2368. int [] positionX = {
  2369. 231, 198, 165, 134, 100, 67, 32,
  2370. 232, 198, 164, 131, 98, 64, 32,
  2371. };
  2372. int [] positionY = {
  2373. 65, 67, 66, 68, 71, 70, 65,
  2374. 32, 30, 30, 33, 31, 32, 32
  2375. };
  2376. for (int i = 0; i < 14; i++) {
  2377. if (tabInterfaceIDs[tab[i]] != -1) {
  2378. if (id[i] != -1) {
  2379. cacheSprite[id[i]].drawSprite(clientWidth - positionX[i], clientHeight - positionY[i]);
  2380. }
  2381. }
  2382. }
  2383. } else if(clientWidth >= smallTabs) {
  2384. int[] id = {
  2385. 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
  2386. };
  2387. int[] tab = {
  2388. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
  2389. };
  2390. int [] positionX = {
  2391. 455, 423, 389, 359, 325, 292, 258,
  2392. 226, 193, 160, 126, 95, 61, 29,
  2393. };
  2394. int [] positionY = {
  2395. 29, 31, 29, 32, 34, 34, 31,
  2396. 32, 30, 30, 33, 31, 32, 32
  2397. };
  2398. for (int i = 0; i < 14; i++) {
  2399. if (tabInterfaceIDs[tab[i]] != -1) {
  2400. if (id[i] != -1) {
  2401. cacheSprite[id[i]].drawSprite(clientWidth - positionX[i], clientHeight - positionY[i]);
  2402. }
  2403. }
  2404. }
  2405. }
  2406. }
  2407. }
  2408.  
  2409. public void drawRedStones() {
  2410. if(clientSize == 0) {
  2411. if(tabInterfaceIDs[tabID] != -1) {
  2412. switch(tabID) {
  2413. case 0:
  2414. cacheSprite[4].drawSprite(6, 0);
  2415. break;
  2416. case 1:
  2417. cacheSprite[8].drawSprite(44, 0);
  2418. break;
  2419. case 2:
  2420. cacheSprite[8].drawSprite(77, 0);
  2421. break;
  2422. case 3:
  2423. cacheSprite[8].drawSprite(110, 0);
  2424. break;
  2425. case 4:
  2426. cacheSprite[8].drawSprite(143, 0);
  2427. break;
  2428. case 5:
  2429. cacheSprite[8].drawSprite(176, 0);
  2430. break;
  2431. case 6:
  2432. cacheSprite[5].drawSprite(209, 0);
  2433. break;
  2434. case 7:
  2435. cacheSprite[6].drawSprite(6, 298);
  2436. break;
  2437. case 8:
  2438. cacheSprite[8].drawSprite(44, 298);
  2439. break;
  2440. case 9:
  2441. cacheSprite[8].drawSprite(77, 298);
  2442. break;
  2443. case 10:
  2444. cacheSprite[8].drawSprite(110, 298);
  2445. break;
  2446. case 11:
  2447. cacheSprite[8].drawSprite(143, 298);
  2448. break;
  2449. case 12:
  2450. cacheSprite[8].drawSprite(176, 298);
  2451. break;
  2452. case 13:
  2453. cacheSprite[7].drawSprite(209, 298);
  2454. break;
  2455. }
  2456. }
  2457. } else if (clientSize != 0) {
  2458. if(clientWidth < smallTabs) {
  2459. if(tabInterfaceIDs[tabID] != -1) {
  2460. if(!showTab){
  2461. return;
  2462. }
  2463. switch(tabID) {
  2464. case 0:
  2465. cacheSprite[4].drawSprite(clientWidth - 241, clientHeight - 73);
  2466. break;
  2467. case 1:
  2468. cacheSprite[8].drawSprite(clientWidth - 202, clientHeight - 73);
  2469. break;
  2470. case 2:
  2471. cacheSprite[8].drawSprite(clientWidth - 170, clientHeight - 73);
  2472. break;
  2473. case 3:
  2474. cacheSprite[8].drawSprite(clientWidth - 138, clientHeight - 73);
  2475. break;
  2476. case 4:
  2477. cacheSprite[8].drawSprite(clientWidth - 104, clientHeight - 73);
  2478. break;
  2479. case 5:
  2480. cacheSprite[8].drawSprite(clientWidth - 71, clientHeight - 73);
  2481. break;
  2482. case 6:
  2483. cacheSprite[5].drawSprite(clientWidth - 38, clientHeight - 73);
  2484. break;
  2485. case 7:
  2486. cacheSprite[6].drawSprite(clientWidth - 241, clientHeight - 37);
  2487. break;
  2488. case 8:
  2489. cacheSprite[8].drawSprite(clientWidth - 202, clientHeight - 37);
  2490. break;
  2491. case 9:
  2492. cacheSprite[8].drawSprite(clientWidth - 170, clientHeight - 37);
  2493. break;
  2494. case 10:
  2495. cacheSprite[8].drawSprite(clientWidth - 138, clientHeight - 37);
  2496. break;
  2497. case 11:
  2498. cacheSprite[8].drawSprite(clientWidth - 104, clientHeight - 37);
  2499. break;
  2500. case 12:
  2501. cacheSprite[8].drawSprite(clientWidth - 71, clientHeight - 37);
  2502. break;
  2503. case 13:
  2504. cacheSprite[7].drawSprite(clientWidth - 38, clientHeight - 37);
  2505. break;
  2506. }
  2507. }
  2508. } else if (clientWidth >= smallTabs) {
  2509. if(tabInterfaceIDs[tabID] != -1) {
  2510. if(!showTab){
  2511. return;
  2512. }
  2513. switch(tabID) {
  2514. case 0:
  2515. cacheSprite[8].drawSprite(clientWidth - 462, clientHeight - 36);
  2516. break;
  2517. case 1:
  2518. cacheSprite[8].drawSprite(clientWidth - 429, clientHeight - 36);
  2519. break;
  2520. case 2:
  2521. cacheSprite[8].drawSprite(clientWidth - 396, clientHeight - 36);
  2522. break;
  2523. case 3:
  2524. cacheSprite[8].drawSprite(clientWidth - 363, clientHeight - 36);
  2525. break;
  2526. case 4:
  2527. cacheSprite[8].drawSprite(clientWidth - 330, clientHeight - 36);
  2528. break;
  2529. case 5:
  2530. cacheSprite[8].drawSprite(clientWidth - 297, clientHeight - 36);
  2531. break;
  2532. case 6:
  2533. cacheSprite[8].drawSprite(clientWidth - 264, clientHeight - 36);
  2534. break;
  2535. case 7:
  2536. cacheSprite[8].drawSprite(clientWidth - 231, clientHeight - 36);
  2537. break;
  2538. case 8:
  2539. cacheSprite[8].drawSprite(clientWidth - 198, clientHeight - 36);
  2540. break;
  2541. case 9:
  2542. cacheSprite[8].drawSprite(clientWidth - 165, clientHeight - 36);
  2543. break;
  2544. case 10:
  2545. cacheSprite[8].drawSprite(clientWidth - 132, clientHeight - 36);
  2546. break;
  2547. case 11:
  2548. cacheSprite[8].drawSprite(clientWidth - 99, clientHeight - 36);
  2549. break;
  2550. case 12:
  2551. cacheSprite[8].drawSprite(clientWidth - 66, clientHeight - 36);
  2552. break;
  2553. case 13:
  2554. cacheSprite[8].drawSprite(clientWidth - 33, clientHeight - 36);
  2555. break;
  2556. }
  2557. }
  2558. }
  2559. }
  2560. }
  2561.  
  2562. private void drawTabArea() {
  2563. if (clientSize == 0) {
  2564. aRSImageProducer_1163.initDrawingArea();
  2565. }
  2566. if(clientSize == 0) {
  2567. cacheSprite[23].drawSprite(0, 0);
  2568. }
  2569. Rasterizer.anIntArray1472 = anIntArray1181;
  2570. int y = clientWidth >= smallTabs ? 37 : 74;
  2571. if(clientSize != 0) {
  2572. if(clientWidth >= smallTabs) {
  2573. cacheSprite[27].drawSprite(clientWidth - 461, clientHeight - 36);
  2574. } else {
  2575. cacheSprite[28].drawSprite(clientWidth - 241, clientHeight - 73);
  2576. }
  2577. }
  2578. if (showTab) {
  2579. if(clientWidth >= smallTabs) {
  2580. cacheSprite[29].drawSprite(clientWidth - 204, clientHeight - 310);
  2581. DrawingArea.method335(0x50463C, clientHeight - 303, 190, 260, 100, clientWidth - 197);
  2582. } else {
  2583. cacheSprite[29].drawSprite(clientWidth - 222, clientHeight - 346);
  2584. DrawingArea.method335(0x50463C, clientHeight - 339, 190, 260, 100, clientWidth - 216);
  2585. }
  2586. }
  2587. int x1 = 0, y1 = 0;
  2588. if(clientSize != 0) {
  2589. x1 = clientWidth - 225;
  2590. y1 = clientHeight - 340;
  2591. }
  2592. if(clientSize == 0) {
  2593. if (invOverlayInterfaceID != -1) {
  2594. drawInterface(0, 32,
  2595. RSInterface.interfaceCache[invOverlayInterfaceID], 36);
  2596. } else if (tabInterfaceIDs[tabID] != -1) {
  2597. drawInterface(0, 32,
  2598. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 36);
  2599. }
  2600. } else if (clientSize != 0 && showTab) {
  2601. if (invOverlayInterfaceID != -1) {
  2602. drawInterface(0, (clientWidth >= smallTabs ? x1 + 28 : clientWidth - 214),
  2603. RSInterface.interfaceCache[invOverlayInterfaceID], (clientWidth >= smallTabs ? y1 + 37 : clientHeight - y - 265));
  2604. } else if (tabInterfaceIDs[tabID] != -1) {
  2605. drawInterface(0, (clientWidth >= smallTabs ? x1 + 28 : clientWidth - 214),
  2606. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], (clientWidth >= smallTabs ? y1 + 37 : clientHeight - y - 265));
  2607. }
  2608. }
  2609.  
  2610. if(invOverlayInterfaceID == -1) {
  2611. drawRedStones();
  2612. drawSideIcons();
  2613. }
  2614. if(menuOpen && clientSize == 0) {
  2615. drawMenu(516, 168);
  2616. } else if (menuOpen && menuScreenArea == 1 && clientSize != 0) {
  2617. drawMenu(516, 168);
  2618. }
  2619. if (clientSize == 0)
  2620. aRSImageProducer_1163.drawGraphics(168, super.graphics, 516);
  2621. aRSImageProducer_1165.initDrawingArea();
  2622. Rasterizer.anIntArray1472 = anIntArray1182;
  2623. }
  2624.  
  2625.  
  2626.  
  2627. public boolean newclickInRegion(int x1, int y1, Sprite drawnSprite) {
  2628. if (super.saveClickX >= x1 && super.saveClickX <= x1 + drawnSprite.myWidth && super.saveClickY >= y1 && super.saveClickY <= y1 + drawnSprite.myHeight)
  2629. return true;
  2630. return false;
  2631. }
  2632.  
  2633. public boolean newmouseInRegion(int x1, int y1, Sprite drawnSprite) {
  2634. if (super.mouseX >= x1 && super.mouseX <= x1 + drawnSprite.myWidth && super.mouseY >= y1
  2635. && super.mouseY <= y1 + drawnSprite.myHeight)
  2636. return true;
  2637. return false;
  2638. }
  2639.  
  2640. private void method37(int j) {
  2641. if (!lowMem) {
  2642. if (Rasterizer.anIntArray1480[17] >= j) {
  2643. Background background = Rasterizer.aBackgroundArray1474s[17];
  2644. int k = background.anInt1452 * background.anInt1453 - 1;
  2645. int j1 = background.anInt1452 * anInt945 * 2;
  2646. byte abyte0[] = background.aByteArray1450;
  2647. byte abyte3[] = aByteArray912;
  2648. for (int i2 = 0; i2 <= k; i2++)
  2649. abyte3[i2] = abyte0[i2 - j1 & k];
  2650.  
  2651. background.aByteArray1450 = abyte3;
  2652. aByteArray912 = abyte0;
  2653. Rasterizer.method370(17);
  2654. anInt854++;
  2655. if (anInt854 > 1235) {
  2656. anInt854 = 0;
  2657. stream.createFrame(226);
  2658. stream.writeWordBigEndian(0);
  2659. int l2 = stream.currentOffset;
  2660. stream.writeWord(58722);
  2661. stream.writeWordBigEndian(240);
  2662. stream.writeWord((int) (Math.random() * 65536D));
  2663. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2664. if ((int) (Math.random() * 2D) == 0)
  2665. stream.writeWord(51825);
  2666. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2667. stream.writeWord((int) (Math.random() * 65536D));
  2668. stream.writeWord(7130);
  2669. stream.writeWord((int) (Math.random() * 65536D));
  2670. stream.writeWord(61657);
  2671. stream.writeBytes(stream.currentOffset - l2);
  2672. }
  2673. }
  2674. if (Rasterizer.anIntArray1480[24] >= j) {
  2675. Background background_1 = Rasterizer.aBackgroundArray1474s[24];
  2676. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2677. int k1 = background_1.anInt1452 * anInt945 * 2;
  2678. byte abyte1[] = background_1.aByteArray1450;
  2679. byte abyte4[] = aByteArray912;
  2680. for (int j2 = 0; j2 <= l; j2++)
  2681. abyte4[j2] = abyte1[j2 - k1 & l];
  2682.  
  2683. background_1.aByteArray1450 = abyte4;
  2684. aByteArray912 = abyte1;
  2685. Rasterizer.method370(24);
  2686. }
  2687. if (Rasterizer.anIntArray1480[34] >= j) {
  2688. Background background_2 = Rasterizer.aBackgroundArray1474s[34];
  2689. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2690. int l1 = background_2.anInt1452 * anInt945 * 2;
  2691. byte abyte2[] = background_2.aByteArray1450;
  2692. byte abyte5[] = aByteArray912;
  2693. for (int k2 = 0; k2 <= i1; k2++)
  2694. abyte5[k2] = abyte2[k2 - l1 & i1];
  2695.  
  2696. background_2.aByteArray1450 = abyte5;
  2697. aByteArray912 = abyte2;
  2698. Rasterizer.method370(34);
  2699. }
  2700. if(Rasterizer.anIntArray1480[40] >= j);
  2701. {
  2702. Background background_2 = Rasterizer.aBackgroundArray1474s[40];
  2703. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2704. int l1 = background_2.anInt1452 * anInt945 * 2;
  2705. byte abyte2[] = background_2.aByteArray1450;
  2706. byte abyte5[] = aByteArray912;
  2707. for (int k2 = 0; k2 <= i1; k2++)
  2708. abyte5[k2] = abyte2[k2 - l1 & i1];
  2709.  
  2710. background_2.aByteArray1450 = abyte5;
  2711. aByteArray912 = abyte2;
  2712. Rasterizer.method370(40);
  2713. }
  2714. }
  2715. }
  2716.  
  2717. private void method38() {
  2718. for (int i = -1; i < playerCount; i++) {
  2719. int j;
  2720. if (i == -1)
  2721. j = myPlayerIndex;
  2722. else
  2723. j = playerIndices[i];
  2724. Player player = playerArray[j];
  2725. if (player != null && player.textCycle > 0) {
  2726. player.textCycle--;
  2727. if (player.textCycle == 0)
  2728. player.textSpoken = null;
  2729. }
  2730. }
  2731. for (int k = 0; k < npcCount; k++) {
  2732. int l = npcIndices[k];
  2733. NPC npc = npcArray[l];
  2734. if (npc != null && npc.textCycle > 0) {
  2735. npc.textCycle--;
  2736. if (npc.textCycle == 0)
  2737. npc.textSpoken = null;
  2738. }
  2739. }
  2740. }
  2741.  
  2742. private void calcCameraPos() {
  2743. int i = anInt1098 * 128 + 64;
  2744. int j = anInt1099 * 128 + 64;
  2745. int k = method42(plane, j, i) - anInt1100;
  2746. if (xCameraPos < i) {
  2747. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2748. if (xCameraPos > i)
  2749. xCameraPos = i;
  2750. }
  2751. if (xCameraPos > i) {
  2752. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2753. if (xCameraPos < i)
  2754. xCameraPos = i;
  2755. }
  2756. if (zCameraPos < k) {
  2757. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2758. if (zCameraPos > k)
  2759. zCameraPos = k;
  2760. }
  2761. if (zCameraPos > k) {
  2762. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2763. if (zCameraPos < k)
  2764. zCameraPos = k;
  2765. }
  2766. if (yCameraPos < j) {
  2767. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2768. if (yCameraPos > j)
  2769. yCameraPos = j;
  2770. }
  2771. if (yCameraPos > j) {
  2772. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2773. if (yCameraPos < j)
  2774. yCameraPos = j;
  2775. }
  2776. i = anInt995 * 128 + 64;
  2777. j = anInt996 * 128 + 64;
  2778. k = method42(plane, j, i) - anInt997;
  2779. int l = i - xCameraPos;
  2780. int i1 = k - zCameraPos;
  2781. int j1 = j - yCameraPos;
  2782. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2783. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2784. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2785. if (l1 < 128)
  2786. l1 = 128;
  2787. if (l1 > 383)
  2788. l1 = 383;
  2789. if (yCameraCurve < l1) {
  2790. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2791. if (yCameraCurve > l1)
  2792. yCameraCurve = l1;
  2793. }
  2794. if (yCameraCurve > l1) {
  2795. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2796. if (yCameraCurve < l1)
  2797. yCameraCurve = l1;
  2798. }
  2799. int j2 = i2 - xCameraCurve;
  2800. if (j2 > 1024)
  2801. j2 -= 2048;
  2802. if (j2 < -1024)
  2803. j2 += 2048;
  2804. if (j2 > 0) {
  2805. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2806. xCameraCurve &= 0x7ff;
  2807. }
  2808. if (j2 < 0) {
  2809. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2810. xCameraCurve &= 0x7ff;
  2811. }
  2812. int k2 = i2 - xCameraCurve;
  2813. if (k2 > 1024)
  2814. k2 -= 2048;
  2815. if (k2 < -1024)
  2816. k2 += 2048;
  2817. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2818. xCameraCurve = i2;
  2819. }
  2820.  
  2821.  
  2822. private void addFriend(long l) {
  2823. try {
  2824. if (l == 0L)
  2825. return;
  2826. if (friendsCount >= 100 && anInt1046 != 1) {
  2827. pushMessage(
  2828. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2829. 0, "");
  2830. return;
  2831. }
  2832. if (friendsCount >= 200) {
  2833. pushMessage(
  2834. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2835. 0, "");
  2836. return;
  2837. }
  2838. String s = TextClass.fixName(TextClass.nameForLong(l));
  2839. for (int i = 0; i < friendsCount; i++)
  2840. if (friendsListAsLongs[i] == l) {
  2841. pushMessage(s + " is already on your friend list", 0, "");
  2842. return;
  2843. }
  2844. for (int j = 0; j < ignoreCount; j++)
  2845. if (ignoreListAsLongs[j] == l) {
  2846. pushMessage("Please remove " + s
  2847. + " from your ignore list first", 0, "");
  2848. return;
  2849. }
  2850.  
  2851. if (s.equals(myPlayer.name)) {
  2852. return;
  2853. } else {
  2854. friendsList[friendsCount] = s;
  2855. friendsListAsLongs[friendsCount] = l;
  2856. friendsNodeIDs[friendsCount] = 0;
  2857. friendsCount++;
  2858. needDrawTabArea = true;
  2859. stream.createFrame(188);
  2860. stream.writeQWord(l);
  2861. return;
  2862. }
  2863. } catch (RuntimeException runtimeexception) {
  2864. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  2865. + runtimeexception.toString());
  2866. }
  2867. throw new RuntimeException();
  2868. }
  2869.  
  2870. private int method42(int i, int j, int k) {
  2871. int l = k >> 7;
  2872. int i1 = j >> 7;
  2873. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2874. return 0;
  2875. int j1 = i;
  2876. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2877. j1++;
  2878. int k1 = k & 0x7f;
  2879. int l1 = j & 0x7f;
  2880. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  2881. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2882. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  2883. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2884. return i2 * (128 - l1) + j2 * l1 >> 7;
  2885. }
  2886.  
  2887. private static String intToKOrMil(int j) {
  2888. if (j < 0x186a0)
  2889. return String.valueOf(j);
  2890. if (j < 0x989680)
  2891. return j / 1000 + "K";
  2892. else
  2893. return j / 0xf4240 + "M";
  2894. }
  2895.  
  2896. private void resetLogout() {
  2897. try {
  2898. if (socketStream != null)
  2899. socketStream.close();
  2900. } catch (Exception _ex) {
  2901. }
  2902. socketStream = null;
  2903. loggedIn = false;
  2904. loginScreenState = 0;
  2905. toggleSize(0);
  2906. // myUsername = "";
  2907. // myPassword = "";
  2908. unlinkMRUNodes();
  2909. worldController.initToNull();
  2910. for (int i = 0; i < 4; i++)
  2911. aClass11Array1230[i].method210();
  2912. System.gc();
  2913. stopMidi();
  2914. currentSong = -1;
  2915. nextSong = -1;
  2916. prevSong = 0;
  2917. }
  2918.  
  2919. private void method45() {
  2920. aBoolean1031 = true;
  2921. for (int j = 0; j < 7; j++) {
  2922. anIntArray1065[j] = -1;
  2923. for (int k = 0; k < IDK.length; k++) {
  2924. if (IDK.cache[k].aBoolean662
  2925. || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2926. continue;
  2927. anIntArray1065[j] = k;
  2928. break;
  2929. }
  2930. }
  2931. }
  2932.  
  2933. private void method46(int i, Stream stream) {
  2934. while (stream.bitPosition + 21 < i * 8) {
  2935. int k = stream.readBits(14);
  2936. if (k == 16383)
  2937. break;
  2938. if (npcArray[k] == null)
  2939. npcArray[k] = new NPC();
  2940. NPC npc = npcArray[k];
  2941. npcIndices[npcCount++] = k;
  2942. npc.anInt1537 = loopCycle;
  2943. int l = stream.readBits(5);
  2944. if (l > 15)
  2945. l -= 32;
  2946. int i1 = stream.readBits(5);
  2947. if (i1 > 15)
  2948. i1 -= 32;
  2949. int j1 = stream.readBits(1);
  2950. npc.desc = EntityDef.forID(stream.readBits(14));
  2951. int k1 = stream.readBits(1);
  2952. if (k1 == 1)
  2953. anIntArray894[anInt893++] = k;
  2954. npc.anInt1540 = npc.desc.aByte68;
  2955. npc.anInt1504 = npc.desc.anInt79;
  2956. npc.anInt1554 = npc.desc.walkAnim;
  2957. npc.anInt1555 = npc.desc.anInt58;
  2958. npc.anInt1556 = npc.desc.anInt83;
  2959. npc.anInt1557 = npc.desc.anInt55;
  2960. npc.anInt1511 = npc.desc.standAnim;
  2961. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2962. }
  2963. stream.finishBitAccess();
  2964. }
  2965.  
  2966. public void processGameLoop() {
  2967. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2968. return;
  2969. loopCycle++;
  2970. if (!loggedIn)
  2971. processLoginScreenInput();
  2972. else
  2973. mainGameProcessor();
  2974. processOnDemandQueue();
  2975. }
  2976.  
  2977. private void method47(boolean flag) {
  2978. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2979. destX = 0;
  2980. int j = playerCount;
  2981. if (flag)
  2982. j = 1;
  2983. for (int l = 0; l < j; l++) {
  2984. Player player;
  2985. int i1;
  2986. if (flag) {
  2987. player = myPlayer;
  2988. i1 = myPlayerIndex << 14;
  2989. } else {
  2990. player = playerArray[playerIndices[l]];
  2991. i1 = playerIndices[l] << 14;
  2992. }
  2993. if (player == null || !player.isVisible())
  2994. continue;
  2995. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  2996. && !flag && player.anInt1517 == player.anInt1511;
  2997. int j1 = player.x >> 7;
  2998. int k1 = player.y >> 7;
  2999. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3000. continue;
  3001. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  3002. && loopCycle < player.anInt1708) {
  3003. player.aBoolean1699 = false;
  3004. player.anInt1709 = method42(plane, player.y, player.x);
  3005. worldController.method286(plane, player.y, player,
  3006. player.anInt1552, player.anInt1722, player.x,
  3007. player.anInt1709, player.anInt1719, player.anInt1721,
  3008. i1, player.anInt1720);
  3009. continue;
  3010. }
  3011. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3012. if (anIntArrayArray929[j1][k1] == anInt1265)
  3013. continue;
  3014. anIntArrayArray929[j1][k1] = anInt1265;
  3015. }
  3016. player.anInt1709 = method42(plane, player.y, player.x);
  3017. worldController.method285(plane, player.anInt1552,
  3018. player.anInt1709, i1, player.y, 60, player.x, player,
  3019. player.aBoolean1541);
  3020. }
  3021. }
  3022.  
  3023. private boolean promptUserForInput(RSInterface class9) {
  3024. int j = class9.contentType;
  3025. if (anInt900 == 2) {
  3026. if (j == 201) {
  3027. inputTaken = true;
  3028. inputDialogState = 0;
  3029. messagePromptRaised = true;
  3030. promptInput = "";
  3031. friendsListAction = 1;
  3032. aString1121 = "Enter name of friend to add to list";
  3033. }
  3034. if (j == 202) {
  3035. inputTaken = true;
  3036. inputDialogState = 0;
  3037. messagePromptRaised = true;
  3038. promptInput = "";
  3039. friendsListAction = 2;
  3040. aString1121 = "Enter name of friend to delete from list";
  3041. }
  3042. }
  3043. if (j == 205) {
  3044. anInt1011 = 250;
  3045. return true;
  3046. }
  3047. if (j == 501) {
  3048. inputTaken = true;
  3049. inputDialogState = 0;
  3050. messagePromptRaised = true;
  3051. promptInput = "";
  3052. friendsListAction = 4;
  3053. aString1121 = "Enter name of player to add to list";
  3054. }
  3055. if (j == 502) {
  3056. inputTaken = true;
  3057. inputDialogState = 0;
  3058. messagePromptRaised = true;
  3059. promptInput = "";
  3060. friendsListAction = 5;
  3061. aString1121 = "Enter name of player to delete from list";
  3062. }
  3063. if (j == 550) {
  3064. inputTaken = true;
  3065. inputDialogState = 0;
  3066. messagePromptRaised = true;
  3067. promptInput = "";
  3068. aString1121 = "Enter the name of the chat you wish to join";
  3069. }
  3070. if (j >= 300 && j <= 313) {
  3071. int k = (j - 300) / 2;
  3072. int j1 = j & 1;
  3073. int i2 = anIntArray1065[k];
  3074. if (i2 != -1) {
  3075. do {
  3076. if (j1 == 0 && --i2 < 0)
  3077. i2 = IDK.length - 1;
  3078. if (j1 == 1 && ++i2 >= IDK.length)
  3079. i2 = 0;
  3080. } while (IDK.cache[i2].aBoolean662
  3081. || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3082. anIntArray1065[k] = i2;
  3083. aBoolean1031 = true;
  3084. }
  3085. }
  3086. if (j >= 314 && j <= 323) {
  3087. int l = (j - 314) / 2;
  3088. int k1 = j & 1;
  3089. int j2 = anIntArray990[l];
  3090. if (k1 == 0 && --j2 < 0)
  3091. j2 = anIntArrayArray1003[l].length - 1;
  3092. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3093. j2 = 0;
  3094. anIntArray990[l] = j2;
  3095. aBoolean1031 = true;
  3096. }
  3097. if (j == 324 && !aBoolean1047) {
  3098. aBoolean1047 = true;
  3099. method45();
  3100. }
  3101. if (j == 325 && aBoolean1047) {
  3102. aBoolean1047 = false;
  3103. method45();
  3104. }
  3105. if (j == 326) {
  3106. stream.createFrame(101);
  3107. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3108. for (int i1 = 0; i1 < 7; i1++)
  3109. stream.writeWordBigEndian(anIntArray1065[i1]);
  3110.  
  3111. for (int l1 = 0; l1 < 5; l1++)
  3112. stream.writeWordBigEndian(anIntArray990[l1]);
  3113.  
  3114. return true;
  3115. }
  3116. if (j == 613)
  3117. canMute = !canMute;
  3118. if (j >= 601 && j <= 612) {
  3119. clearTopInterfaces();
  3120. if (reportAbuseInput.length() > 0) {
  3121. stream.createFrame(218);
  3122. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3123. stream.writeWordBigEndian(j - 601);
  3124. stream.writeWordBigEndian(canMute ? 1 : 0);
  3125. }
  3126. }
  3127. return false;
  3128. }
  3129.  
  3130. private void method49(Stream stream) {
  3131. for (int j = 0; j < anInt893; j++) {
  3132. int k = anIntArray894[j];
  3133. Player player = playerArray[k];
  3134. int l = stream.readUnsignedByte();
  3135. if ((l & 0x40) != 0)
  3136. l += stream.readUnsignedByte() << 8;
  3137. method107(l, k, stream, player);
  3138. }
  3139. }
  3140.  
  3141. private void method50(int i, int k, int l, int i1, int j1) {
  3142. int k1 = worldController.method300(j1, l, i);
  3143. if (k1 != 0) {
  3144. int l1 = worldController.method304(j1, l, i, k1);
  3145. int k2 = l1 >> 6 & 3;
  3146. int i3 = l1 & 0x1f;
  3147. int k3 = k;
  3148. if (k1 > 0)
  3149. k3 = i1;
  3150. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3151. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3152. int i5 = k1 >> 14 & 0x7fff;
  3153. ObjectDef class46_2 = ObjectDef.forID(i5);
  3154. if (class46_2.anInt758 != -1) {
  3155. Background background_2 = mapScenes[class46_2.anInt758];
  3156. if (background_2 != null) {
  3157. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3158. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3159. background_2.drawBackground(48 + l * 4 + i6, 48
  3160. + (104 - i - class46_2.anInt761) * 4 + j6);
  3161. }
  3162. } else {
  3163. if (i3 == 0 || i3 == 2)
  3164. if (k2 == 0) {
  3165. ai[k4] = k3;
  3166. ai[k4 + 512] = k3;
  3167. ai[k4 + 1024] = k3;
  3168. ai[k4 + 1536] = k3;
  3169. } else if (k2 == 1) {
  3170. ai[k4] = k3;
  3171. ai[k4 + 1] = k3;
  3172. ai[k4 + 2] = k3;
  3173. ai[k4 + 3] = k3;
  3174. } else if (k2 == 2) {
  3175. ai[k4 + 3] = k3;
  3176. ai[k4 + 3 + 512] = k3;
  3177. ai[k4 + 3 + 1024] = k3;
  3178. ai[k4 + 3 + 1536] = k3;
  3179. } else if (k2 == 3) {
  3180. ai[k4 + 1536] = k3;
  3181. ai[k4 + 1536 + 1] = k3;
  3182. ai[k4 + 1536 + 2] = k3;
  3183. ai[k4 + 1536 + 3] = k3;
  3184. }
  3185. if (i3 == 3)
  3186. if (k2 == 0)
  3187. ai[k4] = k3;
  3188. else if (k2 == 1)
  3189. ai[k4 + 3] = k3;
  3190. else if (k2 == 2)
  3191. ai[k4 + 3 + 1536] = k3;
  3192. else if (k2 == 3)
  3193. ai[k4 + 1536] = k3;
  3194. if (i3 == 2)
  3195. if (k2 == 3) {
  3196. ai[k4] = k3;
  3197. ai[k4 + 512] = k3;
  3198. ai[k4 + 1024] = k3;
  3199. ai[k4 + 1536] = k3;
  3200. } else if (k2 == 0) {
  3201. ai[k4] = k3;
  3202. ai[k4 + 1] = k3;
  3203. ai[k4 + 2] = k3;
  3204. ai[k4 + 3] = k3;
  3205. } else if (k2 == 1) {
  3206. ai[k4 + 3] = k3;
  3207. ai[k4 + 3 + 512] = k3;
  3208. ai[k4 + 3 + 1024] = k3;
  3209. ai[k4 + 3 + 1536] = k3;
  3210. } else if (k2 == 2) {
  3211. ai[k4 + 1536] = k3;
  3212. ai[k4 + 1536 + 1] = k3;
  3213. ai[k4 + 1536 + 2] = k3;
  3214. ai[k4 + 1536 + 3] = k3;
  3215. }
  3216. }
  3217. }
  3218. k1 = worldController.method302(j1, l, i);
  3219. if (k1 != 0) {
  3220. int i2 = worldController.method304(j1, l, i, k1);
  3221. int l2 = i2 >> 6 & 3;
  3222. int j3 = i2 & 0x1f;
  3223. int l3 = k1 >> 14 & 0x7fff;
  3224. ObjectDef class46_1 = ObjectDef.forID(l3);
  3225. if (class46_1.anInt758 != -1) {
  3226. Background background_1 = mapScenes[class46_1.anInt758];
  3227. if (background_1 != null) {
  3228. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3229. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3230. background_1.drawBackground(48 + l * 4 + j5, 48
  3231. + (104 - i - class46_1.anInt761) * 4 + k5);
  3232. }
  3233. } else if (j3 == 9) {
  3234. int l4 = 0xeeeeee;
  3235. if (k1 > 0)
  3236. l4 = 0xee0000;
  3237. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3238. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3239. if (l2 == 0 || l2 == 2) {
  3240. ai1[l5 + 1536] = l4;
  3241. ai1[l5 + 1024 + 1] = l4;
  3242. ai1[l5 + 512 + 2] = l4;
  3243. ai1[l5 + 3] = l4;
  3244. } else {
  3245. ai1[l5] = l4;
  3246. ai1[l5 + 512 + 1] = l4;
  3247. ai1[l5 + 1024 + 2] = l4;
  3248. ai1[l5 + 1536 + 3] = l4;
  3249. }
  3250. }
  3251. }
  3252. k1 = worldController.method303(j1, l, i);
  3253. if (k1 != 0) {
  3254. int j2 = k1 >> 14 & 0x7fff;
  3255. ObjectDef class46 = ObjectDef.forID(j2);
  3256. if (class46.anInt758 != -1) {
  3257. Background background = mapScenes[class46.anInt758];
  3258. if (background != null) {
  3259. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3260. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3261. background.drawBackground(48 + l * 4 + i4, 48
  3262. + (104 - i - class46.anInt761) * 4 + j4);
  3263. }
  3264. }
  3265. }
  3266. }
  3267.  
  3268. private void loadTitleScreen() {
  3269. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  3270. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  3271. aBackgroundArray1152s = new Background[12];
  3272. int j = 0;
  3273. try {
  3274. j = Integer.parseInt(getParameter("fl_icon"));
  3275. } catch (Exception _ex) {
  3276. }
  3277. if (j == 0) {
  3278. for (int k = 0; k < 12; k++)
  3279. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3280. "runes", k);
  3281.  
  3282. } else {
  3283. for (int l = 0; l < 12; l++)
  3284. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3285. "runes", 12 + (l & 3));
  3286.  
  3287. }
  3288. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3289. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3290. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0,
  3291. aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3292.  
  3293. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0,
  3294. aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3295.  
  3296. anIntArray851 = new int[256];
  3297. for (int k1 = 0; k1 < 64; k1++)
  3298. anIntArray851[k1] = k1 * 0x40000;
  3299.  
  3300. for (int l1 = 0; l1 < 64; l1++)
  3301. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3302.  
  3303. for (int i2 = 0; i2 < 64; i2++)
  3304. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3305.  
  3306. for (int j2 = 0; j2 < 64; j2++)
  3307. anIntArray851[j2 + 192] = 0xffffff;
  3308.  
  3309. anIntArray852 = new int[256];
  3310. for (int k2 = 0; k2 < 64; k2++)
  3311. anIntArray852[k2] = k2 * 1024;
  3312.  
  3313. for (int l2 = 0; l2 < 64; l2++)
  3314. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3315.  
  3316. for (int i3 = 0; i3 < 64; i3++)
  3317. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3318.  
  3319. for (int j3 = 0; j3 < 64; j3++)
  3320. anIntArray852[j3 + 192] = 0xffffff;
  3321.  
  3322. anIntArray853 = new int[256];
  3323. for (int k3 = 0; k3 < 64; k3++)
  3324. anIntArray853[k3] = k3 * 4;
  3325.  
  3326. for (int l3 = 0; l3 < 64; l3++)
  3327. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3328.  
  3329. for (int i4 = 0; i4 < 64; i4++)
  3330. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3331.  
  3332. for (int j4 = 0; j4 < 64; j4++)
  3333. anIntArray853[j4 + 192] = 0xffffff;
  3334.  
  3335. anIntArray850 = new int[256];
  3336. anIntArray1190 = new int[32768];
  3337. anIntArray1191 = new int[32768];
  3338. randomizeBackground(null);
  3339. anIntArray828 = new int[32768];
  3340. anIntArray829 = new int[32768];
  3341. drawLoadingText(10, "Connecting to fileserver");
  3342. if (!aBoolean831) {
  3343. drawFlames = true;
  3344. aBoolean831 = true;
  3345. startRunnable(this, 2);
  3346. }
  3347. }
  3348.  
  3349. private static void setHighMem() {
  3350. WorldController.lowMem = false;
  3351. Rasterizer.lowMem = false;
  3352. lowMem = false;
  3353. ObjectManager.lowMem = false;
  3354. ObjectDef.lowMem = false;
  3355. }
  3356.  
  3357. public static void main(String args[]) {
  3358. try {
  3359. nodeID = 10;
  3360. portOff = 0;
  3361. setHighMem();
  3362. isMembers = true;
  3363. signlink.storeid = 32;
  3364. signlink.startpriv(InetAddress.getLocalHost());
  3365. instance = new client();
  3366. instance.createClientFrame(clientWidth, clientHeight);
  3367. } catch (Exception exception) {
  3368. }
  3369. }
  3370.  
  3371. public static client instance;
  3372.  
  3373. private void loadingStages() {
  3374. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3375. aRSImageProducer_1165.initDrawingArea();
  3376. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151,
  3377. 257);
  3378. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.",
  3379. 150, 256);
  3380. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3381. loadingStage = 1;
  3382. aLong824 = System.currentTimeMillis();
  3383. }
  3384. if (loadingStage == 1) {
  3385. int j = method54();
  3386. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3387. signlink.reporterror(myUsername + " glcfb " + aLong1215 + ","
  3388. + j + "," + lowMem + "," + decompressors[0] + ","
  3389. + onDemandFetcher.getNodeCount() + "," + plane + ","
  3390. + anInt1069 + "," + anInt1070);
  3391. aLong824 = System.currentTimeMillis();
  3392. }
  3393. }
  3394. if (loadingStage == 2 && plane != anInt985) {
  3395. anInt985 = plane;
  3396. method24(plane);
  3397. }
  3398. }
  3399.  
  3400. private int method54() {
  3401. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3402. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3403. return -1;
  3404. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3405. return -2;
  3406. }
  3407. boolean flag = true;
  3408. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3409. byte abyte0[] = aByteArrayArray1247[j];
  3410. if (abyte0 != null) {
  3411. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3412. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3413. if (aBoolean1159) {
  3414. k = 10;
  3415. l = 10;
  3416. }
  3417. flag &= ObjectManager.method189(k, abyte0, l);
  3418. }
  3419. }
  3420. if (!flag)
  3421. return -3;
  3422. if (aBoolean1080) {
  3423. return -4;
  3424. } else {
  3425. loadingStage = 2;
  3426. ObjectManager.anInt131 = plane;
  3427. method22();
  3428. stream.createFrame(121);
  3429. return 0;
  3430. }
  3431. }
  3432.  
  3433. private void method55() {
  3434. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3435. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3436. .reverseGetNext())
  3437. if (class30_sub2_sub4_sub4.anInt1597 != plane
  3438. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3439. class30_sub2_sub4_sub4.unlink();
  3440. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3441. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3442. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3443. if (npc != null && npc.x >= 0 && npc.x < 13312
  3444. && npc.y >= 0 && npc.y < 13312)
  3445. class30_sub2_sub4_sub4.method455(
  3446. loopCycle,
  3447. npc.y,
  3448. method42(class30_sub2_sub4_sub4.anInt1597,
  3449. npc.y, npc.x)
  3450. - class30_sub2_sub4_sub4.anInt1583,
  3451. npc.x);
  3452. }
  3453. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3454. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3455. Player player;
  3456. if (j == unknownInt10)
  3457. player = myPlayer;
  3458. else
  3459. player = playerArray[j];
  3460. if (player != null && player.x >= 0 && player.x < 13312
  3461. && player.y >= 0 && player.y < 13312)
  3462. class30_sub2_sub4_sub4.method455(
  3463. loopCycle,
  3464. player.y,
  3465. method42(class30_sub2_sub4_sub4.anInt1597,
  3466. player.y, player.x)
  3467. - class30_sub2_sub4_sub4.anInt1583,
  3468. player.x);
  3469. }
  3470. class30_sub2_sub4_sub4.method456(anInt945);
  3471. worldController.method285(plane,
  3472. class30_sub2_sub4_sub4.anInt1595,
  3473. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  3474. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  3475. (int) class30_sub2_sub4_sub4.aDouble1585,
  3476. class30_sub2_sub4_sub4, false);
  3477. }
  3478.  
  3479. }
  3480.  
  3481. public AppletContext getAppletContext() {
  3482. if (signlink.mainapp != null)
  3483. return signlink.mainapp.getAppletContext();
  3484. else
  3485. return super.getAppletContext();
  3486. }
  3487.  
  3488. public static String capitalize(String s) {
  3489. for (int i = 0; i < s.length(); i++) {
  3490. if (i == 0) {
  3491. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)),
  3492. s.substring(1));
  3493. }
  3494. if (!Character.isLetterOrDigit(s.charAt(i))) {
  3495. if (i + 1 < s.length()) {
  3496. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  3497. Character.toUpperCase(s.charAt(i + 1)),
  3498. s.substring(i + 2));
  3499. }
  3500. }
  3501. }
  3502. return s;
  3503. }
  3504.  
  3505. private void drawLogo() {
  3506. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3507. Sprite sprite = new Sprite(abyte0, this);
  3508. aRSImageProducer_1110.initDrawingArea();
  3509. sprite.method346(0, 0);
  3510. aRSImageProducer_1111.initDrawingArea();
  3511. sprite.method346(-637, 0);
  3512. aRSImageProducer_1107.initDrawingArea();
  3513. sprite.method346(-128, 0);
  3514. aRSImageProducer_1108.initDrawingArea();
  3515. sprite.method346(-202, -371);
  3516. aRSImageProducer_1109.initDrawingArea();
  3517. sprite.method346(-202, -171);
  3518. aRSImageProducer_1112.initDrawingArea();
  3519. sprite.method346(0, -265);
  3520. aRSImageProducer_1113.initDrawingArea();
  3521. sprite.method346(-562, -265);
  3522. aRSImageProducer_1114.initDrawingArea();
  3523. sprite.method346(-128, -171);
  3524. aRSImageProducer_1115.initDrawingArea();
  3525. sprite.method346(-562, -171);
  3526.  
  3527. int backgroundPixels[] = new int[sprite.myWidth];
  3528. for (int j = 0; j < sprite.myHeight; j++) {
  3529. for (int k = 0; k < sprite.myWidth; k++)
  3530. backgroundPixels[k] = sprite.myPixels[(sprite.myWidth - k - 1)
  3531. + sprite.myWidth * j];
  3532.  
  3533. System.arraycopy(backgroundPixels, 0, sprite.myPixels,
  3534. sprite.myWidth * j, sprite.myWidth);
  3535.  
  3536. }
  3537. sprite = null;
  3538. System.gc();
  3539. }
  3540.  
  3541. private void processOnDemandQueue() {
  3542. do {
  3543. OnDemandData onDemandData;
  3544. do {
  3545. onDemandData = onDemandFetcher.getNextNode();
  3546. if(onDemandData == null)
  3547. return;
  3548. if(onDemandData.dataType == 0)
  3549. {
  3550. Model.method460(onDemandData.buffer, onDemandData.ID);
  3551. if(backDialogID != -1)
  3552. inputTaken = true;
  3553. }
  3554. if (onDemandData.dataType == 1)
  3555. Class36.method529(onDemandData.ID, onDemandData.buffer);
  3556. //if (onDemandData.dataType == 1)//Animations never gets here tho.
  3557. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3558. saveMidi(songChanging, onDemandData.buffer);
  3559. if(onDemandData.dataType == 3 && loadingStage == 1) {
  3560. for(int i = 0; i < aByteArrayArray1183.length; i++)
  3561. {
  3562. if(anIntArray1235[i] == onDemandData.ID)
  3563. {
  3564. aByteArrayArray1183[i] = onDemandData.buffer;
  3565. if(onDemandData.buffer == null) {
  3566. anIntArray1235[i] = -1;
  3567. }
  3568. break;
  3569. }
  3570. if(anIntArray1236[i] != onDemandData.ID)
  3571. continue;
  3572. aByteArrayArray1247[i] = onDemandData.buffer;
  3573. if(onDemandData.buffer == null) {
  3574. anIntArray1236[i] = -1;
  3575. }
  3576. break;
  3577. }
  3578.  
  3579. }
  3580. if (onDemandData.dataType == 4)
  3581. Texture.decode(onDemandData.ID, onDemandData.buffer);
  3582. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3583. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3584. } while(true);
  3585. }
  3586.  
  3587. private void calcFlamesPosition() {
  3588. char c = '\u0100';
  3589. for (int j = 10; j < 117; j++) {
  3590. int k = (int) (Math.random() * 100D);
  3591. if (k < 50)
  3592. anIntArray828[j + (c - 2 << 7)] = 255;
  3593. }
  3594. for (int l = 0; l < 100; l++) {
  3595. int i1 = (int) (Math.random() * 124D) + 2;
  3596. int k1 = (int) (Math.random() * 128D) + 128;
  3597. int k2 = i1 + (k1 << 7);
  3598. anIntArray828[k2] = 192;
  3599. }
  3600.  
  3601. for (int j1 = 1; j1 < c - 1; j1++) {
  3602. for (int l1 = 1; l1 < 127; l1++) {
  3603. int l2 = l1 + (j1 << 7);
  3604. anIntArray829[l2] = (anIntArray828[l2 - 1]
  3605. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3606. }
  3607.  
  3608. }
  3609.  
  3610. anInt1275 += 128;
  3611. if (anInt1275 > anIntArray1190.length) {
  3612. anInt1275 -= anIntArray1190.length;
  3613. int i2 = (int) (Math.random() * 12D);
  3614. randomizeBackground(aBackgroundArray1152s[i2]);
  3615. }
  3616. for (int j2 = 1; j2 < c - 1; j2++) {
  3617. for (int i3 = 1; i3 < 127; i3++) {
  3618. int k3 = i3 + (j2 << 7);
  3619. int i4 = anIntArray829[k3 + 128]
  3620. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  3621. - 1] / 5;
  3622. if (i4 < 0)
  3623. i4 = 0;
  3624. anIntArray828[k3] = i4;
  3625. }
  3626.  
  3627. }
  3628.  
  3629. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3630.  
  3631. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D
  3632. + Math.sin((double) loopCycle / 15D) * 14D + Math
  3633. .sin((double) loopCycle / 16D) * 12D);
  3634. if (anInt1040 > 0)
  3635. anInt1040 -= 4;
  3636. if (anInt1041 > 0)
  3637. anInt1041 -= 4;
  3638. if (anInt1040 == 0 && anInt1041 == 0) {
  3639. int l3 = (int) (Math.random() * 2000D);
  3640. if (l3 == 0)
  3641. anInt1040 = 1024;
  3642. if (l3 == 1)
  3643. anInt1041 = 1024;
  3644. }
  3645. }
  3646.  
  3647. private boolean saveWave(byte abyte0[], int i) {
  3648. return abyte0 == null || signlink.wavesave(abyte0, i);
  3649. }
  3650.  
  3651. private void method60(int i) {
  3652. RSInterface class9 = RSInterface.interfaceCache[i];
  3653. for (int j = 0; j < class9.children.length; j++) {
  3654. if (class9.children[j] == -1)
  3655. break;
  3656. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3657. if (class9_1.type == 1)
  3658. method60(class9_1.id);
  3659. class9_1.anInt246 = 0;
  3660. class9_1.anInt208 = 0;
  3661. }
  3662. }
  3663.  
  3664. private void drawHeadIcon() {
  3665. if (anInt855 != 2)
  3666. return;
  3667. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2,
  3668. (anInt935 - baseY << 7) + anInt938);
  3669. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  3670. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3671. }
  3672.  
  3673.  
  3674. private void mainGameProcessor()
  3675. {
  3676. checkSize();
  3677. if(anInt1104 > 1)
  3678. anInt1104--;
  3679. if(anInt1011 > 0)
  3680. anInt1011--;
  3681. for(int j = 0; j < 5; j++)
  3682. if(!parsePacket())
  3683. break;
  3684.  
  3685. if(!loggedIn)
  3686. return;
  3687.  
  3688. if(anInt1016 > 0)
  3689. anInt1016--;
  3690. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3691. aBoolean1017 = true;
  3692. if(aBoolean1017 && anInt1016 <= 0)
  3693. {
  3694. anInt1016 = 20;
  3695. aBoolean1017 = false;
  3696. stream.createFrame(86);
  3697. stream.writeWord(anInt1184);
  3698. stream.method432(minimapInt1);
  3699. }
  3700. if(super.awtFocus && !aBoolean954)
  3701. {
  3702. aBoolean954 = true;
  3703. stream.createFrame(3);
  3704. stream.writeWordBigEndian(1);
  3705. }
  3706. if(!super.awtFocus && aBoolean954)
  3707. {
  3708. aBoolean954 = false;
  3709. stream.createFrame(3);
  3710. stream.writeWordBigEndian(0);
  3711. }
  3712. loadingStages();
  3713. method115();
  3714. anInt1009++;
  3715. if(anInt1009 > 750)
  3716. dropClient();
  3717. method114();
  3718. method95();
  3719. method38();
  3720. anInt945++;
  3721. if(crossType != 0)
  3722. {
  3723. crossIndex += 20;
  3724. if(crossIndex >= 400)
  3725. crossType = 0;
  3726. }
  3727. if(atInventoryInterfaceType != 0)
  3728. {
  3729. atInventoryLoopCycle++;
  3730. if(atInventoryLoopCycle >= 15)
  3731. {
  3732. if(atInventoryInterfaceType == 2) {
  3733. }
  3734. if(atInventoryInterfaceType == 3)
  3735. inputTaken = true;
  3736. atInventoryInterfaceType = 0;
  3737. }
  3738. }
  3739. if(activeInterfaceType != 0)
  3740. {
  3741. anInt989++;
  3742. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3743. aBoolean1242 = true;
  3744. if(super.clickMode2 == 0)
  3745. {
  3746. if(activeInterfaceType == 2) {
  3747. }
  3748. if(activeInterfaceType == 3)
  3749. inputTaken = true;
  3750. activeInterfaceType = 0;
  3751. if(aBoolean1242 && anInt989 >= 15)
  3752. {
  3753. lastActiveInvInterface = -1;
  3754. processRightClick();
  3755. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3756. {
  3757. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3758. int j1 = 0;
  3759. if(anInt913 == 1 && class9.contentType == 206)
  3760. j1 = 1;
  3761. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3762. j1 = 0;
  3763. if(class9.aBoolean235)
  3764. {
  3765. int l2 = anInt1085;
  3766. int l3 = mouseInvInterfaceIndex;
  3767. class9.inv[l3] = class9.inv[l2];
  3768. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3769. class9.inv[l2] = -1;
  3770. class9.invStackSizes[l2] = 0;
  3771. } else
  3772. if(j1 == 1)
  3773. {
  3774. int i3 = anInt1085;
  3775. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3776. if(i3 > i4)
  3777. {
  3778. class9.swapInventoryItems(i3, i3 - 1);
  3779. i3--;
  3780. } else
  3781. if(i3 < i4)
  3782. {
  3783. class9.swapInventoryItems(i3, i3 + 1);
  3784. i3++;
  3785. }
  3786.  
  3787. } else
  3788. {
  3789. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3790. }
  3791. stream.createFrame(214);
  3792. stream.method433(anInt1084);
  3793. stream.method424(j1);
  3794. stream.method433(anInt1085);
  3795. stream.method431(mouseInvInterfaceIndex);
  3796. }
  3797. } else
  3798. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3799. determineMenuSize();
  3800. else
  3801. if(menuActionRow > 0)
  3802. doAction(menuActionRow - 1);
  3803. atInventoryLoopCycle = 10;
  3804. super.clickMode3 = 0;
  3805. }
  3806. }
  3807. if(WorldController.anInt470 != -1)
  3808. {
  3809. int k = WorldController.anInt470;
  3810. int k1 = WorldController.anInt471;
  3811. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3812. WorldController.anInt470 = -1;
  3813. if(flag)
  3814. {
  3815. crossX = super.saveClickX;
  3816. crossY = super.saveClickY;
  3817. crossType = 1;
  3818. crossIndex = 0;
  3819. }
  3820. }
  3821. if(super.clickMode3 == 1 && aString844 != null)
  3822. {
  3823. aString844 = null;
  3824. inputTaken = true;
  3825. super.clickMode3 = 0;
  3826. }
  3827. processMenuClick();
  3828. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3829. anInt1213++;
  3830. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3831. if (anInt1501 < 0 && !menuOpen) {
  3832. anInt1501++;
  3833. if (anInt1501 == 0) {
  3834. if (anInt1500 != 0) {
  3835. inputTaken = true;
  3836. }
  3837. if (anInt1044 != 0) {
  3838. }
  3839. }
  3840. }
  3841. } else if (anInt1501 > 0) {
  3842. anInt1501--;
  3843. }
  3844. if(loadingStage == 2)
  3845. method108();
  3846. if(loadingStage == 2 && aBoolean1160)
  3847. calcCameraPos();
  3848. for(int i1 = 0; i1 < 5; i1++)
  3849. anIntArray1030[i1]++;
  3850.  
  3851. method73();
  3852. super.idleTime++;
  3853. if(super.idleTime > 4500)
  3854. {
  3855. anInt1011 = 250;
  3856. super.idleTime -= 500;
  3857. stream.createFrame(202);
  3858. }
  3859. anInt1010++;
  3860. if(anInt1010 > 50)
  3861. stream.createFrame(0);
  3862. try
  3863. {
  3864. if(socketStream != null && stream.currentOffset > 0)
  3865. {
  3866. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3867. stream.currentOffset = 0;
  3868. anInt1010 = 0;
  3869. }
  3870. }
  3871. catch(IOException _ex)
  3872. {
  3873. dropClient();
  3874. }
  3875. catch(Exception exception)
  3876. {
  3877. resetLogout();
  3878. }
  3879. }
  3880.  
  3881.  
  3882. private void method63() {
  3883. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  3884. .reverseGetFirst();
  3885. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  3886. .reverseGetNext())
  3887. if (class30_sub1.anInt1294 == -1) {
  3888. class30_sub1.anInt1302 = 0;
  3889. method89(class30_sub1);
  3890. } else {
  3891. class30_sub1.unlink();
  3892. }
  3893.  
  3894. }
  3895.  
  3896. private void resetImageProducers() {
  3897. if (aRSImageProducer_1107 != null)
  3898. return;
  3899. super.fullGameScreen = null;
  3900. aRSImageProducer_1166 = null;
  3901. aRSImageProducer_1164 = null;
  3902. aRSImageProducer_1163 = null;
  3903. aRSImageProducer_1165 = null;
  3904. aRSImageProducer_1125 = null;
  3905. aRSImageProducer_1110 = new RSImageProducer(128, 265,
  3906. getGameComponent());
  3907. DrawingArea.setAllPixelsToZero();
  3908. aRSImageProducer_1111 = new RSImageProducer(128, 265,
  3909. getGameComponent());
  3910. DrawingArea.setAllPixelsToZero();
  3911. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  3912. getGameComponent());
  3913. DrawingArea.setAllPixelsToZero();
  3914. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  3915. getGameComponent());
  3916. DrawingArea.setAllPixelsToZero();
  3917. aRSImageProducer_1109 = new RSImageProducer(765, 503,
  3918. getGameComponent());
  3919. DrawingArea.setAllPixelsToZero();
  3920. aRSImageProducer_1112 = new RSImageProducer(202, 238,
  3921. getGameComponent());
  3922. DrawingArea.setAllPixelsToZero();
  3923. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  3924. getGameComponent());
  3925. DrawingArea.setAllPixelsToZero();
  3926. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3927. DrawingArea.setAllPixelsToZero();
  3928. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3929. DrawingArea.setAllPixelsToZero();
  3930. if (titleStreamLoader != null) {
  3931. drawLogo();
  3932. loadTitleScreen();
  3933. }
  3934. welcomeScreenRaised = true;
  3935. }
  3936.  
  3937. void drawLoadingText(int i, String s) {
  3938. anInt1079 = i;
  3939. aString1049 = s;
  3940. resetImageProducers();
  3941. if (titleStreamLoader == null) {
  3942. super.drawLoadingText(i, s);
  3943. return;
  3944. }
  3945. aRSImageProducer_1109.initDrawingArea();
  3946. char c = '\u0168';
  3947. char c1 = '\310';
  3948. byte byte1 = 20;
  3949. chatTextDrawingArea.drawText(0xffffff,
  3950. "Phantom PKs is loading - please wait...", c1 / 2 - 26
  3951. - byte1, c / 2);
  3952. int j = c1 / 2 - 18 - byte1;
  3953. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x002D00, j);
  3954. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3955. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x002D00, i * 3);
  3956. DrawingArea
  3957. .drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3958. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3959. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3960. if (welcomeScreenRaised) {
  3961. welcomeScreenRaised = false;
  3962. if (!aBoolean831) {
  3963. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3964. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3965. }
  3966. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3967. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3968. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3969. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3970. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3971. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3972. }
  3973. }
  3974.  
  3975. private void method65(int i, int j, int k, int l, RSInterface class9,
  3976. int i1, boolean flag, int j1) {
  3977. int anInt992;
  3978. if (aBoolean972)
  3979. anInt992 = 32;
  3980. else
  3981. anInt992 = 0;
  3982. aBoolean972 = false;
  3983. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3984. class9.scrollPosition -= anInt1213 * 4;
  3985. if (flag) {
  3986. needDrawTabArea = true;
  3987. }
  3988. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3989. class9.scrollPosition += anInt1213 * 4;
  3990. if (flag) {
  3991. needDrawTabArea = true;
  3992. }
  3993. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  3994. && l < (i1 + j) - 16 && anInt1213 > 0) {
  3995. int l1 = ((j - 32) * j) / j1;
  3996. if (l1 < 8)
  3997. l1 = 8;
  3998. int i2 = l - i1 - 16 - l1 / 2;
  3999. int j2 = j - 32 - l1;
  4000. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4001. if (flag)
  4002. needDrawTabArea = true;
  4003. aBoolean972 = true;
  4004. }
  4005. }
  4006.  
  4007. private boolean method66(int i, int j, int k) {
  4008. int i1 = i >> 14 & 0x7fff;
  4009. int j1 = worldController.method304(plane, k, j, i);
  4010. if (j1 == -1)
  4011. return false;
  4012. int k1 = j1 & 0x1f;
  4013. int l1 = j1 >> 6 & 3;
  4014. if (k1 == 10 || k1 == 11 || k1 == 22) {
  4015. ObjectDef class46 = ObjectDef.forID(i1);
  4016. int i2;
  4017. int j2;
  4018. if (l1 == 0 || l1 == 2) {
  4019. i2 = class46.anInt744;
  4020. j2 = class46.anInt761;
  4021. } else {
  4022. i2 = class46.anInt761;
  4023. j2 = class46.anInt744;
  4024. }
  4025. int k2 = class46.anInt768;
  4026. if (l1 != 0)
  4027. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4028. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j,
  4029. myPlayer.smallX[0], false, k);
  4030. } else {
  4031. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j,
  4032. myPlayer.smallX[0], false, k);
  4033. }
  4034. crossX = super.saveClickX;
  4035. crossY = super.saveClickY;
  4036. crossType = 2;
  4037. crossIndex = 0;
  4038. return true;
  4039. }
  4040.  
  4041. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  4042. int k) {
  4043. byte abyte0[] = null;
  4044. int l = 5;
  4045. try {
  4046. if (decompressors[0] != null)
  4047. abyte0 = decompressors[0].decompress(i);
  4048. } catch (Exception _ex) {
  4049. }
  4050. if (abyte0 != null) {
  4051. // aCRC32_930.reset();
  4052. // aCRC32_930.update(abyte0);
  4053. // int i1 = (int)aCRC32_930.getValue();
  4054. // if(i1 != j)
  4055. }
  4056. if (abyte0 != null) {
  4057. StreamLoader streamLoader = new StreamLoader(abyte0);
  4058. return streamLoader;
  4059. }
  4060. int j1 = 0;
  4061. while (abyte0 == null) {
  4062. String s2 = "Unknown error";
  4063. drawLoadingText(k, "Requesting " + s);
  4064. try {
  4065. int k1 = 0;
  4066. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  4067. byte abyte1[] = new byte[6];
  4068. datainputstream.readFully(abyte1, 0, 6);
  4069. Stream stream = new Stream(abyte1);
  4070. stream.currentOffset = 3;
  4071. int i2 = stream.read3Bytes() + 6;
  4072. int j2 = 6;
  4073. abyte0 = new byte[i2];
  4074. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  4075.  
  4076. while (j2 < i2) {
  4077. int l2 = i2 - j2;
  4078. if (l2 > 1000)
  4079. l2 = 1000;
  4080. int j3 = datainputstream.read(abyte0, j2, l2);
  4081. if (j3 < 0) {
  4082. s2 = "Length error: " + j2 + "/" + i2;
  4083. throw new IOException("EOF");
  4084. }
  4085. j2 += j3;
  4086. int k3 = (j2 * 100) / i2;
  4087. if (k3 != k1)
  4088. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  4089. k1 = k3;
  4090. }
  4091. datainputstream.close();
  4092. try {
  4093. if (decompressors[0] != null)
  4094. decompressors[0].method234(abyte0.length, abyte0, i);
  4095. } catch (Exception _ex) {
  4096. decompressors[0] = null;
  4097. }
  4098. /*
  4099. * if(abyte0 != null) { aCRC32_930.reset();
  4100. * aCRC32_930.update(abyte0); int i3 =
  4101. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  4102. * j1++; s2 = "Checksum error: " + i3; } }
  4103. */
  4104. } catch (IOException ioexception) {
  4105. if (s2.equals("Unknown error"))
  4106. s2 = "Connection error";
  4107. abyte0 = null;
  4108. } catch (NullPointerException _ex) {
  4109. s2 = "Null error";
  4110. abyte0 = null;
  4111. if (!signlink.reporterror)
  4112. return null;
  4113. } catch (ArrayIndexOutOfBoundsException _ex) {
  4114. s2 = "Bounds error";
  4115. abyte0 = null;
  4116. if (!signlink.reporterror)
  4117. return null;
  4118. } catch (Exception _ex) {
  4119. s2 = "Unexpected error";
  4120. abyte0 = null;
  4121. if (!signlink.reporterror)
  4122. return null;
  4123. }
  4124. if (abyte0 == null) {
  4125. for (int l1 = l; l1 > 0; l1--) {
  4126. if (j1 >= 3) {
  4127. drawLoadingText(k, "Game updated - please reload page");
  4128. l1 = 10;
  4129. } else {
  4130. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4131. }
  4132. try {
  4133. Thread.sleep(1000L);
  4134. } catch (Exception _ex) {
  4135. }
  4136. }
  4137.  
  4138. l *= 2;
  4139. if (l > 60)
  4140. l = 60;
  4141. aBoolean872 = !aBoolean872;
  4142. }
  4143.  
  4144. }
  4145.  
  4146. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  4147. return streamLoader_1;
  4148. }
  4149.  
  4150. public void sendStringAsLong(String string) {
  4151. stream.createFrame(60);
  4152. stream.writeQWord(TextClass.longForName(string));
  4153. }
  4154.  
  4155. public void sendString(int identifier, String text) {
  4156. text = identifier + "," + text;
  4157. stream.createFrame(127);
  4158. stream.writeWordBigEndian(text.length() + 1);
  4159. stream.writeString(text);
  4160. }
  4161.  
  4162. private void dropClient() {
  4163. if (anInt1011 > 0) {
  4164. resetLogout();
  4165. return;
  4166. }
  4167. aRSImageProducer_1165.initDrawingArea();
  4168. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  4169. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  4170. aTextDrawingArea_1271.drawText(0,
  4171. "Please wait - attempting to reestablish", 159, 257);
  4172. aTextDrawingArea_1271.drawText(0xffffff,
  4173. "Please wait - attempting to reestablish", 158, 256);
  4174. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4175. anInt1021 = 0;
  4176. destX = 0;
  4177. RSSocket rsSocket = socketStream;
  4178. loggedIn = false;
  4179. loginFailures = 0;
  4180. login(myUsername, myPassword, true);
  4181. if (!loggedIn)
  4182. resetLogout();
  4183. try {
  4184. rsSocket.close();
  4185. } catch (Exception _ex) {
  4186. }
  4187. }
  4188.  
  4189. private void doAction(int i) {
  4190. if (i < 0)
  4191. return;
  4192. if (inputDialogState != 0) {
  4193. inputDialogState = 0;
  4194. inputTaken = true;
  4195. }
  4196. int j = menuActionCmd2[i];
  4197. int k = menuActionCmd3[i];
  4198. int l = menuActionID[i];
  4199. int i1 = menuActionCmd1[i];
  4200. if (l >= 2000)
  4201. l -= 2000;
  4202. if (l == 582) {
  4203. NPC npc = npcArray[i1];
  4204. if (npc != null) {
  4205. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  4206. myPlayer.smallX[0], false, npc.smallX[0]);
  4207. crossX = super.saveClickX;
  4208. crossY = super.saveClickY;
  4209. crossType = 2;
  4210. crossIndex = 0;
  4211. stream.createFrame(57);
  4212. stream.method432(anInt1285);
  4213. stream.method432(i1);
  4214. stream.method431(anInt1283);
  4215. stream.method432(anInt1284);
  4216. }
  4217. }
  4218. if (l == 234) {
  4219. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4220. myPlayer.smallX[0], false, j);
  4221. if (!flag1)
  4222. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4223. myPlayer.smallX[0], false, j);
  4224. crossX = super.saveClickX;
  4225. crossY = super.saveClickY;
  4226. crossType = 2;
  4227. crossIndex = 0;
  4228. stream.createFrame(236);
  4229. stream.method431(k + baseY);
  4230. stream.writeWord(i1);
  4231. stream.method431(j + baseX);
  4232. }
  4233. if (l == 62 && method66(i1, k, j)) {
  4234. stream.createFrame(192);
  4235. stream.writeWord(anInt1284);
  4236. stream.method431(i1 >> 14 & 0x7fff);
  4237. stream.method433(k + baseY);
  4238. stream.method431(anInt1283);
  4239. stream.method433(j + baseX);
  4240. stream.writeWord(anInt1285);
  4241. }
  4242. if (l == 300) {
  4243. stream.createFrame(141);
  4244. stream.method432(j);
  4245. stream.writeWord(k);
  4246. stream.method432(i1);
  4247. stream.writeDWord(modifiableXValue);
  4248. }
  4249. if (l == 291) {
  4250. stream.createFrame(140);
  4251. stream.method433(k);
  4252. stream.method433(i1);
  4253. stream.method431(j);
  4254. atInventoryLoopCycle = 0;
  4255. atInventoryInterface = k;
  4256. atInventoryIndex = j;
  4257. atInventoryInterfaceType = 2;
  4258. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4259. atInventoryInterfaceType = 1;
  4260. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4261. atInventoryInterfaceType = 3;
  4262. }
  4263. if (l == 511) {
  4264. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4265. myPlayer.smallX[0], false, j);
  4266. if (!flag2)
  4267. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4268. myPlayer.smallX[0], false, j);
  4269. crossX = super.saveClickX;
  4270. crossY = super.saveClickY;
  4271. crossType = 2;
  4272. crossIndex = 0;
  4273. stream.createFrame(25);
  4274. stream.method431(anInt1284);
  4275. stream.method432(anInt1285);
  4276. stream.writeWord(i1);
  4277. stream.method432(k + baseY);
  4278. stream.method433(anInt1283);
  4279. stream.writeWord(j + baseX);
  4280. }
  4281. if (l == 74) {
  4282. stream.createFrame(122);
  4283. stream.method433(k);
  4284. stream.method432(j);
  4285. stream.method431(i1);
  4286. atInventoryLoopCycle = 0;
  4287. atInventoryInterface = k;
  4288. atInventoryIndex = j;
  4289. atInventoryInterfaceType = 2;
  4290. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4291. atInventoryInterfaceType = 1;
  4292. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4293. atInventoryInterfaceType = 3;
  4294. }
  4295. if (l == 315) {
  4296. RSInterface class9 = RSInterface.interfaceCache[k];
  4297. boolean flag8 = true;
  4298. if (class9.contentType > 0)
  4299. flag8 = promptUserForInput(class9);
  4300. System.out.println(k);
  4301. if (flag8) {
  4302. switch (k) { /* Client-sided button clicking */
  4303. case 27653:
  4304. sendFrame248(15106, 3213);
  4305. method60(15106);
  4306. inputTaken = true;
  4307. break;
  4308.  
  4309. case 1668:
  4310. sendFrame248(17500, 3213);
  4311. break;
  4312.  
  4313. default:
  4314. stream.createFrame(185);
  4315. stream.writeWord(k);
  4316. break;
  4317. }
  4318. }
  4319. }
  4320. if (l == 561) {
  4321. Player player = playerArray[i1];
  4322. if (player != null) {
  4323. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4324. player.smallY[0], myPlayer.smallX[0], false,
  4325. player.smallX[0]);
  4326. crossX = super.saveClickX;
  4327. crossY = super.saveClickY;
  4328. crossType = 2;
  4329. crossIndex = 0;
  4330. anInt1188 += i1;
  4331. if (anInt1188 >= 90) {
  4332. stream.createFrame(136);
  4333. anInt1188 = 0;
  4334. }
  4335. stream.createFrame(128);
  4336. stream.writeWord(i1);
  4337. }
  4338. }
  4339. if (l == 20) {
  4340. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4341. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4342. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4343. class30_sub2_sub4_sub1_sub1_1.smallY[0],
  4344. myPlayer.smallX[0], false,
  4345. class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  4346. crossX = super.saveClickX;
  4347. crossY = super.saveClickY;
  4348. crossType = 2;
  4349. crossIndex = 0;
  4350. stream.createFrame(155);
  4351. stream.method431(i1);
  4352. }
  4353. }
  4354. if (l == 779) {
  4355. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4356. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4357. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4358. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  4359. myPlayer.smallX[0], false,
  4360. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  4361. crossX = super.saveClickX;
  4362. crossY = super.saveClickY;
  4363. crossType = 2;
  4364. crossIndex = 0;
  4365. stream.createFrame(153);
  4366. stream.method431(i1);
  4367. }
  4368. }
  4369. if (l == 516)
  4370. if (!menuOpen)
  4371. worldController.method312(super.saveClickY - 4,
  4372. super.saveClickX - 4);
  4373. else
  4374. worldController.method312(k - 4, j - 4);
  4375. if (l == 1062) {
  4376. anInt924 += baseX;
  4377. if (anInt924 >= 113) {
  4378. stream.createFrame(183);
  4379. stream.writeDWordBigEndian(0xe63271);
  4380. anInt924 = 0;
  4381. }
  4382. method66(i1, k, j);
  4383. stream.createFrame(228);
  4384. stream.method432(i1 >> 14 & 0x7fff);
  4385. stream.method432(k + baseY);
  4386. stream.writeWord(j + baseX);
  4387. }
  4388. if (l == 679 && !aBoolean1149) {
  4389. stream.createFrame(40);
  4390. stream.writeWord(k);
  4391. aBoolean1149 = true;
  4392. }
  4393. if (l == 431) {
  4394. stream.createFrame(129);
  4395. stream.method432(j);
  4396. stream.writeWord(k);
  4397. stream.method432(i1);
  4398. atInventoryLoopCycle = 0;
  4399. atInventoryInterface = k;
  4400. atInventoryIndex = j;
  4401. atInventoryInterfaceType = 2;
  4402. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4403. atInventoryInterfaceType = 1;
  4404. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4405. atInventoryInterfaceType = 3;
  4406. }
  4407. if (l == 337 || l == 42 || l == 792 || l == 322) {
  4408. String s = menuActionName[i];
  4409. int k1 = s.indexOf("@whi@");
  4410. if (k1 != -1) {
  4411. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4412. if (l == 337)
  4413. addFriend(l3);
  4414. if (l == 42)
  4415. addIgnore(l3);
  4416. if (l == 792)
  4417. delFriend(l3);
  4418. if (l == 322)
  4419. delIgnore(l3);
  4420. }
  4421. }
  4422. if (l == 53) {
  4423. stream.createFrame(135);
  4424. stream.method431(j);
  4425. stream.method432(k);
  4426. stream.method431(i1);
  4427. atInventoryLoopCycle = 0;
  4428. atInventoryInterface = k;
  4429. atInventoryIndex = j;
  4430. atInventoryInterfaceType = 2;
  4431. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4432. atInventoryInterfaceType = 1;
  4433. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4434. atInventoryInterfaceType = 3;
  4435. }
  4436. if (l == 539) {
  4437. stream.createFrame(16);
  4438. stream.method432(i1);
  4439. stream.method433(j);
  4440. stream.method433(k);
  4441. atInventoryLoopCycle = 0;
  4442. atInventoryInterface = k;
  4443. atInventoryIndex = j;
  4444. atInventoryInterfaceType = 2;
  4445. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4446. atInventoryInterfaceType = 1;
  4447. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4448. atInventoryInterfaceType = 3;
  4449. }
  4450. if (l == 484 || l == 6) {
  4451. String s1 = menuActionName[i];
  4452. int l1 = s1.indexOf("@whi@");
  4453. if (l1 != -1) {
  4454. s1 = s1.substring(l1 + 5).trim();
  4455. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass
  4456. .longForName(s1)));
  4457. boolean flag9 = false;
  4458. for (int j3 = 0; j3 < playerCount; j3++) {
  4459. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4460. if (class30_sub2_sub4_sub1_sub2_7 == null
  4461. || class30_sub2_sub4_sub1_sub2_7.name == null
  4462. || !class30_sub2_sub4_sub1_sub2_7.name
  4463. .equalsIgnoreCase(s7))
  4464. continue;
  4465. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4466. class30_sub2_sub4_sub1_sub2_7.smallY[0],
  4467. myPlayer.smallX[0], false,
  4468. class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  4469. if (l == 484) {
  4470. stream.createFrame(139);
  4471. stream.method431(playerIndices[j3]);
  4472. }
  4473. if (l == 6) {
  4474. anInt1188 += i1;
  4475. if (anInt1188 >= 90) {
  4476. stream.createFrame(136);
  4477. anInt1188 = 0;
  4478. }
  4479. stream.createFrame(128);
  4480. stream.writeWord(playerIndices[j3]);
  4481. }
  4482. flag9 = true;
  4483. break;
  4484. }
  4485.  
  4486. if (!flag9)
  4487. pushMessage("Unable to find " + s7, 0, "");
  4488. }
  4489. }
  4490. if (l == 870) {
  4491. stream.createFrame(53);
  4492. stream.writeWord(j);
  4493. stream.method432(anInt1283);
  4494. stream.method433(i1);
  4495. stream.writeWord(anInt1284);
  4496. stream.method431(anInt1285);
  4497. stream.writeWord(k);
  4498. atInventoryLoopCycle = 0;
  4499. atInventoryInterface = k;
  4500. atInventoryIndex = j;
  4501. atInventoryInterfaceType = 2;
  4502. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4503. atInventoryInterfaceType = 1;
  4504. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4505. atInventoryInterfaceType = 3;
  4506. }
  4507. if (l == 847) {
  4508. stream.createFrame(87);
  4509. stream.method432(i1);
  4510. stream.writeWord(k);
  4511. stream.method432(j);
  4512. atInventoryLoopCycle = 0;
  4513. atInventoryInterface = k;
  4514. atInventoryIndex = j;
  4515. atInventoryInterfaceType = 2;
  4516. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4517. atInventoryInterfaceType = 1;
  4518. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4519. atInventoryInterfaceType = 3;
  4520. }
  4521. if (l == 626) {
  4522. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4523. spellSelected = 1;
  4524. spellID = class9_1.id;
  4525. anInt1137 = k;
  4526. spellUsableOn = class9_1.spellUsableOn;
  4527. itemSelected = 0;
  4528. needDrawTabArea = true;
  4529. spellID = class9_1.id;
  4530. String s4 = class9_1.selectedActionName;
  4531. if (s4.indexOf(" ") != -1)
  4532. s4 = s4.substring(0, s4.indexOf(" "));
  4533. String s8 = class9_1.selectedActionName;
  4534. if (s8.indexOf(" ") != -1)
  4535. s8 = s8.substring(s8.indexOf(" ") + 1);
  4536. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4537. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4538. // 0xffffff);
  4539. // class9_1.sprite1.drawSprite(200,200);
  4540. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4541. if (spellUsableOn == 16) {
  4542. needDrawTabArea = true;
  4543. tabID = 3;
  4544. tabAreaAltered = true;
  4545. }
  4546. return;
  4547. }
  4548. if (l == 78) {
  4549. stream.createFrame(117);
  4550. stream.method433(k);
  4551. stream.method433(i1);
  4552. stream.method431(j);
  4553. atInventoryLoopCycle = 0;
  4554. atInventoryInterface = k;
  4555. atInventoryIndex = j;
  4556. atInventoryInterfaceType = 2;
  4557. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4558. atInventoryInterfaceType = 1;
  4559. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4560. atInventoryInterfaceType = 3;
  4561. }
  4562. if (l == 27) {
  4563. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4564. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4565. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4566. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  4567. myPlayer.smallX[0], false,
  4568. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4569. crossX = super.saveClickX;
  4570. crossY = super.saveClickY;
  4571. crossType = 2;
  4572. crossIndex = 0;
  4573. anInt986 += i1;
  4574. if (anInt986 >= 54) {
  4575. stream.createFrame(189);
  4576. stream.writeWordBigEndian(234);
  4577. anInt986 = 0;
  4578. }
  4579. stream.createFrame(73);
  4580. stream.method431(i1);
  4581. }
  4582. }
  4583. if (l == 213) {
  4584. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4585. myPlayer.smallX[0], false, j);
  4586. if (!flag3)
  4587. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4588. myPlayer.smallX[0], false, j);
  4589. crossX = super.saveClickX;
  4590. crossY = super.saveClickY;
  4591. crossType = 2;
  4592. crossIndex = 0;
  4593. stream.createFrame(79);
  4594. stream.method431(k + baseY);
  4595. stream.writeWord(i1);
  4596. stream.method432(j + baseX);
  4597. }
  4598. if (l == 632) {
  4599. stream.createFrame(145);
  4600. stream.method432(k);
  4601. stream.method432(j);
  4602. stream.method432(i1);
  4603. atInventoryLoopCycle = 0;
  4604. atInventoryInterface = k;
  4605. atInventoryIndex = j;
  4606. atInventoryInterfaceType = 2;
  4607. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4608. atInventoryInterfaceType = 1;
  4609. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4610. atInventoryInterfaceType = 3;
  4611. }
  4612. if (l == 1004) {
  4613. if (tabInterfaceIDs[10] != -1) {
  4614. needDrawTabArea = true;
  4615. tabID = 10;
  4616. tabAreaAltered = true;
  4617. }
  4618. }
  4619. if (l == 1003) {
  4620. clanChatMode = 2;
  4621. inputTaken = true;
  4622. }
  4623. if (l == 1002) {
  4624. clanChatMode = 1;
  4625. inputTaken = true;
  4626. }
  4627. if (l == 1001) {
  4628. clanChatMode = 0;
  4629. inputTaken = true;
  4630. }
  4631. if (l == 1000) {
  4632. cButtonCPos = 4;
  4633. chatTypeView = 11;
  4634. inputTaken = true;
  4635. }
  4636. if (l == 999) {
  4637. cButtonCPos = 0;
  4638. chatTypeView = 0;
  4639. inputTaken = true;
  4640. }
  4641. if (l == 998) {
  4642. cButtonCPos = 1;
  4643. chatTypeView = 5;
  4644. inputTaken = true;
  4645. }
  4646. if (l == 997) {
  4647. publicChatMode = 3;
  4648. inputTaken = true;
  4649. }
  4650. if (l == 996) {
  4651. publicChatMode = 2;
  4652. inputTaken = true;
  4653. }
  4654. if (l == 995) {
  4655. publicChatMode = 1;
  4656. inputTaken = true;
  4657. }
  4658. if (l == 994) {
  4659. publicChatMode = 0;
  4660. inputTaken = true;
  4661. }
  4662. if (l == 993) {
  4663. cButtonCPos = 2;
  4664. chatTypeView = 1;
  4665. inputTaken = true;
  4666. }
  4667. if (l == 992) {
  4668. privateChatMode = 2;
  4669. inputTaken = true;
  4670. }
  4671. if (l == 991) {
  4672. privateChatMode = 1;
  4673. inputTaken = true;
  4674. }
  4675. if (l == 990) {
  4676. privateChatMode = 0;
  4677. inputTaken = true;
  4678. }
  4679. if (l == 989) {
  4680. cButtonCPos = 3;
  4681. chatTypeView = 2;
  4682. inputTaken = true;
  4683. }
  4684. if (l == 987) {
  4685. tradeMode = 2;
  4686. inputTaken = true;
  4687. }
  4688. if (l == 986) {
  4689. tradeMode = 1;
  4690. inputTaken = true;
  4691. }
  4692. if (l == 985) {
  4693. tradeMode = 0;
  4694. inputTaken = true;
  4695. }
  4696. if (l == 984) {
  4697. cButtonCPos = 5;
  4698. chatTypeView = 3;
  4699. inputTaken = true;
  4700. }
  4701. if (l == 983) {
  4702. duelMode = 2;
  4703. inputTaken = true;
  4704. }
  4705. if (l == 982) {
  4706. duelMode = 1;
  4707. inputTaken = true;
  4708. }
  4709. if (l == 981) {
  4710. duelMode = 0;
  4711. inputTaken = true;
  4712. }
  4713. if (l == 980) {
  4714. cButtonCPos = 6;
  4715. chatTypeView = 4;
  4716. inputTaken = true;
  4717. }
  4718. if (l == 647) {
  4719. stream.createFrame(213);
  4720. stream.writeWord(k);
  4721. stream.writeWord(j);
  4722. switch (k) {
  4723. case 18304:
  4724. if (j == 0) {
  4725. inputTaken = true;
  4726. inputDialogState = 0;
  4727. messagePromptRaised = true;
  4728. promptInput = "";
  4729. friendsListAction = 8;
  4730. aString1121 = "Enter your clan chat title";
  4731. }
  4732. break;
  4733. }
  4734. }
  4735. if (l == 493) {
  4736. stream.createFrame(75);
  4737. stream.method433(k);
  4738. stream.method431(j);
  4739. stream.method432(i1);
  4740. atInventoryLoopCycle = 0;
  4741. atInventoryInterface = k;
  4742. atInventoryIndex = j;
  4743. atInventoryInterfaceType = 2;
  4744. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4745. atInventoryInterfaceType = 1;
  4746. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4747. atInventoryInterfaceType = 3;
  4748. }
  4749. if (l == 652) {
  4750. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4751. myPlayer.smallX[0], false, j);
  4752. if (!flag4)
  4753. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4754. myPlayer.smallX[0], false, j);
  4755. crossX = super.saveClickX;
  4756. crossY = super.saveClickY;
  4757. crossType = 2;
  4758. crossIndex = 0;
  4759. stream.createFrame(156);
  4760. stream.method432(j + baseX);
  4761. stream.method431(k + baseY);
  4762. stream.method433(i1);
  4763. }
  4764. if (l == 94) {
  4765. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4766. myPlayer.smallX[0], false, j);
  4767. if (!flag5)
  4768. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4769. myPlayer.smallX[0], false, j);
  4770. crossX = super.saveClickX;
  4771. crossY = super.saveClickY;
  4772. crossType = 2;
  4773. crossIndex = 0;
  4774. stream.createFrame(181);
  4775. stream.method431(k + baseY);
  4776. stream.writeWord(i1);
  4777. stream.method431(j + baseX);
  4778. stream.method432(anInt1137);
  4779. }
  4780. if (l == 646) {
  4781. stream.createFrame(185);
  4782. stream.writeWord(k);
  4783. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4784. if (class9_2.valueIndexArray != null
  4785. && class9_2.valueIndexArray[0][0] == 5) {
  4786. int i2 = class9_2.valueIndexArray[0][1];
  4787. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  4788. variousSettings[i2] = class9_2.anIntArray212[0];
  4789. method33(i2);
  4790. needDrawTabArea = true;
  4791. }
  4792. }
  4793. switch (k) {
  4794. // clan chat
  4795. case 18129:
  4796. if (RSInterface.interfaceCache[18135].message.toLowerCase()
  4797. .contains("join")) {
  4798. inputTaken = true;
  4799. inputDialogState = 0;
  4800. messagePromptRaised = true;
  4801. promptInput = "";
  4802. friendsListAction = 6;
  4803. aString1121 = "Enter the name of the chat you wish to join";
  4804. } else {
  4805. sendString(0, "");
  4806. }
  4807. break;
  4808. case 18132:
  4809. openInterfaceID = 18300;
  4810. break;
  4811. case 18526:
  4812. inputTaken = true;
  4813. inputDialogState = 0;
  4814. messagePromptRaised = true;
  4815. promptInput = "";
  4816. friendsListAction = 9;
  4817. aString1121 = "Enter a name to add";
  4818. break;
  4819. case 18527:
  4820. inputTaken = true;
  4821. inputDialogState = 0;
  4822. messagePromptRaised = true;
  4823. promptInput = "";
  4824. friendsListAction = 10;
  4825. aString1121 = "Enter a name to add";
  4826. break;
  4827. }
  4828. }
  4829. if (l == 225) {
  4830. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4831. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4832. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4833. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  4834. myPlayer.smallX[0], false,
  4835. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4836. crossX = super.saveClickX;
  4837. crossY = super.saveClickY;
  4838. crossType = 2;
  4839. crossIndex = 0;
  4840. anInt1226 += i1;
  4841. if (anInt1226 >= 85) {
  4842. stream.createFrame(230);
  4843. stream.writeWordBigEndian(239);
  4844. anInt1226 = 0;
  4845. }
  4846. stream.createFrame(17);
  4847. stream.method433(i1);
  4848. }
  4849. }
  4850. if (l == 965) {
  4851. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4852. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4853. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4854. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  4855. myPlayer.smallX[0], false,
  4856. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4857. crossX = super.saveClickX;
  4858. crossY = super.saveClickY;
  4859. crossType = 2;
  4860. crossIndex = 0;
  4861. anInt1134++;
  4862. if (anInt1134 >= 96) {
  4863. stream.createFrame(152);
  4864. stream.writeWordBigEndian(88);
  4865. anInt1134 = 0;
  4866. }
  4867. stream.createFrame(21);
  4868. stream.writeWord(i1);
  4869. }
  4870. }
  4871. if (l == 413) {
  4872. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4873. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4874. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4875. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  4876. myPlayer.smallX[0], false,
  4877. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4878. crossX = super.saveClickX;
  4879. crossY = super.saveClickY;
  4880. crossType = 2;
  4881. crossIndex = 0;
  4882. stream.createFrame(131);
  4883. stream.method433(i1);
  4884. stream.method432(anInt1137);
  4885. }
  4886. }
  4887. if (l == 200)
  4888. clearTopInterfaces();
  4889. if (l == 1025) {
  4890. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4891. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4892. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4893. if (entityDef.childrenIDs != null)
  4894. entityDef = entityDef.method161();
  4895. if (entityDef != null) {
  4896. String s9;
  4897. if (entityDef.description != null)
  4898. s9 = new String(entityDef.description);
  4899. else
  4900. s9 = "It's a " + entityDef.name + ".";
  4901. pushMessage(s9, 0, "");
  4902. }
  4903. }
  4904. }
  4905. if (l == 900) {
  4906. method66(i1, k, j);
  4907. stream.createFrame(252);
  4908. stream.method433(i1 >> 14 & 0x7fff);
  4909. stream.method431(k + baseY);
  4910. stream.method432(j + baseX);
  4911. }
  4912. if (l == 412) {
  4913. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4914. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4915. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4916. class30_sub2_sub4_sub1_sub1_6.smallY[0],
  4917. myPlayer.smallX[0], false,
  4918. class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  4919. crossX = super.saveClickX;
  4920. crossY = super.saveClickY;
  4921. crossType = 2;
  4922. crossIndex = 0;
  4923. stream.createFrame(72);
  4924. stream.method432(i1);
  4925. }
  4926. }
  4927. if (l == 365) {
  4928. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4929. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4930. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4931. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  4932. myPlayer.smallX[0], false,
  4933. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4934. crossX = super.saveClickX;
  4935. crossY = super.saveClickY;
  4936. crossType = 2;
  4937. crossIndex = 0;
  4938. stream.createFrame(249);
  4939. stream.method432(i1);
  4940. stream.method431(anInt1137);
  4941. }
  4942. }
  4943. if (l == 729) {
  4944. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4945. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4946. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4947. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  4948. myPlayer.smallX[0], false,
  4949. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4950. crossX = super.saveClickX;
  4951. crossY = super.saveClickY;
  4952. crossType = 2;
  4953. crossIndex = 0;
  4954. stream.createFrame(39);
  4955. stream.method431(i1);
  4956. }
  4957. }
  4958. if (l == 577) {
  4959. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4960. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4961. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4962. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  4963. myPlayer.smallX[0], false,
  4964. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4965. crossX = super.saveClickX;
  4966. crossY = super.saveClickY;
  4967. crossType = 2;
  4968. crossIndex = 0;
  4969. stream.createFrame(139);
  4970. stream.method431(i1);
  4971. }
  4972. }
  4973. if (l == 956 && method66(i1, k, j)) {
  4974. stream.createFrame(35);
  4975. stream.method431(j + baseX);
  4976. stream.method432(anInt1137);
  4977. stream.method432(k + baseY);
  4978. stream.method431(i1 >> 14 & 0x7fff);
  4979. }
  4980. if (l == 567) {
  4981. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4982. myPlayer.smallX[0], false, j);
  4983. if (!flag6)
  4984. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4985. myPlayer.smallX[0], false, j);
  4986. crossX = super.saveClickX;
  4987. crossY = super.saveClickY;
  4988. crossType = 2;
  4989. crossIndex = 0;
  4990. stream.createFrame(23);
  4991. stream.method431(k + baseY);
  4992. stream.method431(i1);
  4993. stream.method431(j + baseX);
  4994. }
  4995. if (l == 867) {
  4996. if ((i1 & 3) == 0)
  4997. anInt1175++;
  4998. if (anInt1175 >= 59) {
  4999. stream.createFrame(200);
  5000. stream.writeWord(25501);
  5001. anInt1175 = 0;
  5002. }
  5003. stream.createFrame(43);
  5004. stream.method431(k);
  5005. stream.method432(i1);
  5006. stream.method432(j);
  5007. atInventoryLoopCycle = 0;
  5008. atInventoryInterface = k;
  5009. atInventoryIndex = j;
  5010. atInventoryInterfaceType = 2;
  5011. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5012. atInventoryInterfaceType = 1;
  5013. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5014. atInventoryInterfaceType = 3;
  5015. }
  5016. if (l == 543) {
  5017. stream.createFrame(237);
  5018. stream.writeWord(j);
  5019. stream.method432(i1);
  5020. stream.writeWord(k);
  5021. stream.method432(anInt1137);
  5022. atInventoryLoopCycle = 0;
  5023. atInventoryInterface = k;
  5024. atInventoryIndex = j;
  5025. atInventoryInterfaceType = 2;
  5026. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5027. atInventoryInterfaceType = 1;
  5028. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5029. atInventoryInterfaceType = 3;
  5030. }
  5031. if (l == 606) {
  5032. String s2 = menuActionName[i];
  5033. int j2 = s2.indexOf("@whi@");
  5034. if (j2 != -1)
  5035. if (openInterfaceID == -1) {
  5036. clearTopInterfaces();
  5037. reportAbuseInput = s2.substring(j2 + 5).trim();
  5038. canMute = false;
  5039. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  5040. if (RSInterface.interfaceCache[i3] == null
  5041. || RSInterface.interfaceCache[i3].contentType != 600)
  5042. continue;
  5043. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5044. break;
  5045. }
  5046.  
  5047. } else {
  5048. pushMessage(
  5049. "Please close the interface you have open before using 'report abuse'",
  5050. 0, "");
  5051. }
  5052. }
  5053. if (l == 491) {
  5054. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5055. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  5056. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5057. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  5058. myPlayer.smallX[0], false,
  5059. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  5060. crossX = super.saveClickX;
  5061. crossY = super.saveClickY;
  5062. crossType = 2;
  5063. crossIndex = 0;
  5064. stream.createFrame(14);
  5065. stream.method432(anInt1284);
  5066. stream.writeWord(i1);
  5067. stream.writeWord(anInt1285);
  5068. stream.method431(anInt1283);
  5069. }
  5070. }
  5071. if (l == 639) {
  5072. String s3 = menuActionName[i];
  5073. int k2 = s3.indexOf("@whi@");
  5074. if (k2 != -1) {
  5075. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5076. int k3 = -1;
  5077. for (int i4 = 0; i4 < friendsCount; i4++) {
  5078. if (friendsListAsLongs[i4] != l4)
  5079. continue;
  5080. k3 = i4;
  5081. break;
  5082. }
  5083.  
  5084. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  5085. inputTaken = true;
  5086. inputDialogState = 0;
  5087. messagePromptRaised = true;
  5088. promptInput = "";
  5089. friendsListAction = 3;
  5090. aLong953 = friendsListAsLongs[k3];
  5091. aString1121 = "Enter message to send to " + friendsList[k3];
  5092. }
  5093. }
  5094. }
  5095. if (l == 454) {
  5096. stream.createFrame(41);
  5097. stream.writeWord(i1);
  5098. stream.method432(j);
  5099. stream.method432(k);
  5100. atInventoryLoopCycle = 0;
  5101. atInventoryInterface = k;
  5102. atInventoryIndex = j;
  5103. atInventoryInterfaceType = 2;
  5104. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5105. atInventoryInterfaceType = 1;
  5106. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5107. atInventoryInterfaceType = 3;
  5108. }
  5109. if (l == 478) {
  5110. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5111. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  5112. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5113. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  5114. myPlayer.smallX[0], false,
  5115. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  5116. crossX = super.saveClickX;
  5117. crossY = super.saveClickY;
  5118. crossType = 2;
  5119. crossIndex = 0;
  5120. if ((i1 & 3) == 0)
  5121. anInt1155++;
  5122. if (anInt1155 >= 53) {
  5123. stream.createFrame(85);
  5124. stream.writeWordBigEndian(66);
  5125. anInt1155 = 0;
  5126. }
  5127. stream.createFrame(18);
  5128. stream.method431(i1);
  5129. }
  5130. }
  5131. if (l == 113) {
  5132. method66(i1, k, j);
  5133. stream.createFrame(70);
  5134. stream.method431(j + baseX);
  5135. stream.writeWord(k + baseY);
  5136. stream.method433(i1 >> 14 & 0x7fff);
  5137. }
  5138. if (l == 872) {
  5139. method66(i1, k, j);
  5140. stream.createFrame(234);
  5141. stream.method433(j + baseX);
  5142. stream.method432(i1 >> 14 & 0x7fff);
  5143. stream.method433(k + baseY);
  5144. }
  5145. if (l == 502) {
  5146. method66(i1, k, j);
  5147. stream.createFrame(132);
  5148. stream.method433(j + baseX);
  5149. stream.writeWord(i1 >> 14 & 0x7fff);
  5150. stream.method432(k + baseY);
  5151. }
  5152. if (l == 1125) {
  5153. ItemDef itemDef = ItemDef.forID(i1);
  5154. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5155. String s5;
  5156. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5157. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5158. else if (itemDef.description != null)
  5159. s5 = new String(itemDef.description);
  5160. else
  5161. s5 = "It's a " + itemDef.name + ".";
  5162. pushMessage(s5, 0, "");
  5163. }
  5164. if (l == 169) {
  5165. stream.createFrame(185);
  5166. stream.writeWord(k);
  5167. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5168. if (class9_3.valueIndexArray != null
  5169. && class9_3.valueIndexArray[0][0] == 5) {
  5170. int l2 = class9_3.valueIndexArray[0][1];
  5171. variousSettings[l2] = 1 - variousSettings[l2];
  5172. method33(l2);
  5173. needDrawTabArea = true;
  5174. }
  5175. }
  5176. if (l == 447) {
  5177. itemSelected = 1;
  5178. anInt1283 = j;
  5179. anInt1284 = k;
  5180. anInt1285 = i1;
  5181. selectedItemName = ItemDef.forID(i1).name;
  5182. spellSelected = 0;
  5183. needDrawTabArea = true;
  5184. return;
  5185. }
  5186. if (l == 1226) {
  5187. int j1 = i1 >> 14 & 0x7fff;
  5188. ObjectDef class46 = ObjectDef.forID(j1);
  5189. String s10;
  5190. if (class46.description != null)
  5191. s10 = new String(class46.description);
  5192. else
  5193. s10 = "It's a " + class46.name + ".";
  5194. pushMessage(s10, 0, "");
  5195. }
  5196. if (l == 244) {
  5197. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5198. myPlayer.smallX[0], false, j);
  5199. if (!flag7)
  5200. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5201. myPlayer.smallX[0], false, j);
  5202. crossX = super.saveClickX;
  5203. crossY = super.saveClickY;
  5204. crossType = 2;
  5205. crossIndex = 0;
  5206. stream.createFrame(253);
  5207. stream.method431(j + baseX);
  5208. stream.method433(k + baseY);
  5209. stream.method432(i1);
  5210. }
  5211. if (l == 1448) {
  5212. ItemDef itemDef_1 = ItemDef.forID(i1);
  5213. String s6;
  5214. if (itemDef_1.description != null)
  5215. s6 = new String(itemDef_1.description);
  5216. else
  5217. s6 = "It's a " + itemDef_1.name + ".";
  5218. pushMessage(s6, 0, "");
  5219. }
  5220. itemSelected = 0;
  5221. spellSelected = 0;
  5222. needDrawTabArea = true;
  5223.  
  5224. }
  5225.  
  5226. private void method70() {
  5227. anInt1251 = 0;
  5228. int j = (myPlayer.x >> 7) + baseX;
  5229. int k = (myPlayer.y >> 7) + baseY;
  5230. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5231. anInt1251 = 1;
  5232. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5233. anInt1251 = 1;
  5234. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5235. anInt1251 = 0;
  5236. }
  5237.  
  5238. public void run() {
  5239. if (drawFlames) {
  5240. drawFlames();
  5241. } else {
  5242. super.run();
  5243. }
  5244. }
  5245.  
  5246. private void build3dScreenMenu() {
  5247. if (itemSelected == 0 && spellSelected == 0) {
  5248. menuActionName[menuActionRow] = "Walk here";
  5249. menuActionID[menuActionRow] = 516;
  5250. menuActionCmd2[menuActionRow] = super.mouseX;
  5251. menuActionCmd3[menuActionRow] = super.mouseY;
  5252. menuActionRow++;
  5253. }
  5254. int j = -1;
  5255. for (int k = 0; k < Model.anInt1687; k++) {
  5256. int l = Model.anIntArray1688[k];
  5257. int i1 = l & 0x7f;
  5258. int j1 = l >> 7 & 0x7f;
  5259. int k1 = l >> 29 & 3;
  5260. int l1 = l >> 14 & 0x7fff;
  5261. if (l == j)
  5262. continue;
  5263. j = l;
  5264. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5265. ObjectDef class46 = ObjectDef.forID(l1);
  5266. if (class46.childrenIDs != null)
  5267. class46 = class46.method580();
  5268. if (class46 == null)
  5269. continue;
  5270. if (itemSelected == 1) {
  5271. menuActionName[menuActionRow] = "Use " + selectedItemName
  5272. + " with @cya@" + class46.name;
  5273. menuActionID[menuActionRow] = 62;
  5274. menuActionCmd1[menuActionRow] = l;
  5275. menuActionCmd2[menuActionRow] = i1;
  5276. menuActionCmd3[menuActionRow] = j1;
  5277. menuActionRow++;
  5278. } else if (spellSelected == 1) {
  5279. if ((spellUsableOn & 4) == 4) {
  5280. menuActionName[menuActionRow] = spellTooltip + " @cya@"
  5281. + class46.name;
  5282. menuActionID[menuActionRow] = 956;
  5283. menuActionCmd1[menuActionRow] = l;
  5284. menuActionCmd2[menuActionRow] = i1;
  5285. menuActionCmd3[menuActionRow] = j1;
  5286. menuActionRow++;
  5287. }
  5288. } else {
  5289. if (class46.actions != null) {
  5290. for (int i2 = 4; i2 >= 0; i2--)
  5291. if (class46.actions[i2] != null) {
  5292. menuActionName[menuActionRow] = class46.actions[i2]
  5293. + " @cya@" + class46.name;
  5294. if (i2 == 0)
  5295. menuActionID[menuActionRow] = 502;
  5296. if (i2 == 1)
  5297. menuActionID[menuActionRow] = 900;
  5298. if (i2 == 2)
  5299. menuActionID[menuActionRow] = 113;
  5300. if (i2 == 3)
  5301. menuActionID[menuActionRow] = 872;
  5302. if (i2 == 4)
  5303. menuActionID[menuActionRow] = 1062;
  5304. menuActionCmd1[menuActionRow] = l;
  5305. menuActionCmd2[menuActionRow] = i1;
  5306. menuActionCmd3[menuActionRow] = j1;
  5307. menuActionRow++;
  5308. }
  5309.  
  5310. }
  5311. // menuActionName[menuActionRow] = "Examine @cya@" +
  5312. // class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" +
  5313. // (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  5314. menuActionName[menuActionRow] = "Examine @cya@"
  5315. + class46.name;
  5316. menuActionID[menuActionRow] = 1226;
  5317. menuActionCmd1[menuActionRow] = class46.type << 14;
  5318. menuActionCmd2[menuActionRow] = i1;
  5319. menuActionCmd3[menuActionRow] = j1;
  5320. menuActionRow++;
  5321. }
  5322. }
  5323. if (k1 == 1) {
  5324. NPC npc = npcArray[l1];
  5325. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64
  5326. && (npc.y & 0x7f) == 64) {
  5327. for (int j2 = 0; j2 < npcCount; j2++) {
  5328. NPC npc2 = npcArray[npcIndices[j2]];
  5329. if (npc2 != null && npc2 != npc
  5330. && npc2.desc.aByte68 == 1 && npc2.x == npc.x
  5331. && npc2.y == npc.y)
  5332. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5333. }
  5334.  
  5335. for (int l2 = 0; l2 < playerCount; l2++) {
  5336. Player player = playerArray[playerIndices[l2]];
  5337. if (player != null && player.x == npc.x
  5338. && player.y == npc.y)
  5339. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5340. }
  5341.  
  5342. }
  5343. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5344. }
  5345. if (k1 == 0) {
  5346. Player player = playerArray[l1];
  5347. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  5348. for (int k2 = 0; k2 < npcCount; k2++) {
  5349. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5350. if (class30_sub2_sub4_sub1_sub1_2 != null
  5351. && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1
  5352. && class30_sub2_sub4_sub1_sub1_2.x == player.x
  5353. && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  5354. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc,
  5355. npcIndices[k2], j1, i1);
  5356. }
  5357.  
  5358. for (int i3 = 0; i3 < playerCount; i3++) {
  5359. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5360. if (class30_sub2_sub4_sub1_sub2_2 != null
  5361. && class30_sub2_sub4_sub1_sub2_2 != player
  5362. && class30_sub2_sub4_sub1_sub2_2.x == player.x
  5363. && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  5364. buildAtPlayerMenu(i1, playerIndices[i3],
  5365. class30_sub2_sub4_sub1_sub2_2, j1);
  5366. }
  5367.  
  5368. }
  5369. buildAtPlayerMenu(i1, l1, player, j1);
  5370. }
  5371. if (k1 == 3) {
  5372. NodeList class19 = groundArray[plane][i1][j1];
  5373. if (class19 != null) {
  5374. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19
  5375. .getNext()) {
  5376. ItemDef itemDef = ItemDef.forID(item.ID);
  5377. if (itemSelected == 1) {
  5378. menuActionName[menuActionRow] = "Use "
  5379. + selectedItemName + " with @lre@"
  5380. + itemDef.name;
  5381. menuActionID[menuActionRow] = 511;
  5382. menuActionCmd1[menuActionRow] = item.ID;
  5383. menuActionCmd2[menuActionRow] = i1;
  5384. menuActionCmd3[menuActionRow] = j1;
  5385. menuActionRow++;
  5386. } else if (spellSelected == 1) {
  5387. if ((spellUsableOn & 1) == 1) {
  5388. menuActionName[menuActionRow] = spellTooltip
  5389. + " @lre@" + itemDef.name;
  5390. menuActionID[menuActionRow] = 94;
  5391. menuActionCmd1[menuActionRow] = item.ID;
  5392. menuActionCmd2[menuActionRow] = i1;
  5393. menuActionCmd3[menuActionRow] = j1;
  5394. menuActionRow++;
  5395. }
  5396. } else {
  5397. for (int j3 = 4; j3 >= 0; j3--)
  5398. if (itemDef.groundActions != null
  5399. && itemDef.groundActions[j3] != null) {
  5400. menuActionName[menuActionRow] = itemDef.groundActions[j3]
  5401. + " @lre@" + itemDef.name;
  5402. if (j3 == 0)
  5403. menuActionID[menuActionRow] = 652;
  5404. if (j3 == 1)
  5405. menuActionID[menuActionRow] = 567;
  5406. if (j3 == 2)
  5407. menuActionID[menuActionRow] = 234;
  5408. if (j3 == 3)
  5409. menuActionID[menuActionRow] = 244;
  5410. if (j3 == 4)
  5411. menuActionID[menuActionRow] = 213;
  5412. menuActionCmd1[menuActionRow] = item.ID;
  5413. menuActionCmd2[menuActionRow] = i1;
  5414. menuActionCmd3[menuActionRow] = j1;
  5415. menuActionRow++;
  5416. } else if (j3 == 2) {
  5417. menuActionName[menuActionRow] = "Take @lre@"
  5418. + itemDef.name;
  5419. menuActionID[menuActionRow] = 234;
  5420. menuActionCmd1[menuActionRow] = item.ID;
  5421. menuActionCmd2[menuActionRow] = i1;
  5422. menuActionCmd3[menuActionRow] = j1;
  5423. menuActionRow++;
  5424. }
  5425.  
  5426. // menuActionName[menuActionRow] = "Examine @lre@" +
  5427. // itemDef.name + " @gre@(@whi@" + item.ID +
  5428. // "@gre@)";
  5429. menuActionName[menuActionRow] = "Examine @lre@"
  5430. + itemDef.name;
  5431. menuActionID[menuActionRow] = 1448;
  5432. menuActionCmd1[menuActionRow] = item.ID;
  5433. menuActionCmd2[menuActionRow] = i1;
  5434. menuActionCmd3[menuActionRow] = j1;
  5435. menuActionRow++;
  5436. }
  5437. }
  5438.  
  5439. }
  5440. }
  5441. }
  5442. }
  5443.  
  5444. public void cleanUpForQuit() {
  5445.  
  5446. signlink.reporterror = false;
  5447. try {
  5448. if (socketStream != null)
  5449. socketStream.close();
  5450. } catch (Exception _ex) {
  5451. }
  5452. socketStream = null;
  5453. stopMidi();
  5454. if (mouseDetection != null)
  5455. mouseDetection.running = false;
  5456. mouseDetection = null;
  5457. onDemandFetcher.disable();
  5458. onDemandFetcher = null;
  5459. aStream_834 = null;
  5460. stream = null;
  5461. aStream_847 = null;
  5462. inStream = null;
  5463. anIntArray1234 = null;
  5464. aByteArrayArray1183 = null;
  5465. aByteArrayArray1247 = null;
  5466. anIntArray1235 = null;
  5467. anIntArray1236 = null;
  5468. intGroundArray = null;
  5469. byteGroundArray = null;
  5470. worldController = null;
  5471. aClass11Array1230 = null;
  5472. anIntArrayArray901 = null;
  5473. anIntArrayArray825 = null;
  5474. bigX = null;
  5475. bigY = null;
  5476. aByteArray912 = null;
  5477. aRSImageProducer_1163 = null;
  5478. mapEdgeIP = null;
  5479. leftFrame = null;
  5480. topFrame = null;
  5481. rightFrame = null;
  5482. aRSImageProducer_1164 = null;
  5483. aRSImageProducer_1165 = null;
  5484. aRSImageProducer_1166 = null;
  5485. aRSImageProducer_1125 = null; /* Null pointers for custom sprites */
  5486. multiOverlay = null;
  5487. cacheSprite = null;
  5488. chatArea = null;
  5489. chatButtons = null;
  5490. cacheSprite = null;
  5491. tabArea = null;
  5492. mapArea = null;
  5493. hitMarks562 = null; /**/
  5494. // mapBack = null;
  5495. sideIcons = null;
  5496. redStones = null;
  5497. compass = null;
  5498. hitMarks = null;
  5499. headIcons = null;
  5500. skullIcons = null;
  5501. headIconsHint = null;
  5502. crosses = null;
  5503. mapDotItem = null;
  5504. mapDotNPC = null;
  5505. mapDotPlayer = null;
  5506. mapDotFriend = null;
  5507. mapDotTeam = null;
  5508. mapScenes = null;
  5509. mapFunctions = null;
  5510. anIntArrayArray929 = null;
  5511. playerArray = null;
  5512. playerIndices = null;
  5513. anIntArray894 = null;
  5514. aStreamArray895s = null;
  5515. anIntArray840 = null;
  5516. npcArray = null;
  5517. npcIndices = null;
  5518. groundArray = null;
  5519. aClass19_1179 = null;
  5520. aClass19_1013 = null;
  5521. aClass19_1056 = null;
  5522. menuActionCmd2 = null;
  5523. menuActionCmd3 = null;
  5524. menuActionID = null;
  5525. menuActionCmd1 = null;
  5526. menuActionName = null;
  5527. variousSettings = null;
  5528. anIntArray1072 = null;
  5529. anIntArray1073 = null;
  5530. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5531. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5532. friendsList = null;
  5533. friendsListAsLongs = null;
  5534. friendsNodeIDs = null;
  5535. aRSImageProducer_1110 = null;
  5536. aRSImageProducer_1111 = null;
  5537. aRSImageProducer_1107 = null;
  5538. aRSImageProducer_1108 = null;
  5539. aRSImageProducer_1109 = null;
  5540. aRSImageProducer_1112 = null;
  5541. aRSImageProducer_1113 = null;
  5542. aRSImageProducer_1114 = null;
  5543. aRSImageProducer_1115 = null;
  5544. nullLoader();
  5545. ObjectDef.nullLoader();
  5546. EntityDef.nullLoader();
  5547. ItemDef.nullLoader();
  5548. Flo.floor = null;
  5549. IDK.cache = null;
  5550. RSInterface.interfaceCache = null;
  5551. DummyClass.cache = null;
  5552. Animation.anims = null;
  5553. SpotAnim.cache = null;
  5554. SpotAnim.aMRUNodes_415 = null;
  5555. Varp.cache = null;
  5556. super.fullGameScreen = null;
  5557. Player.mruNodes = null;
  5558. Rasterizer.nullLoader();
  5559. WorldController.nullLoader();
  5560. Model.nullLoader();
  5561. Class36.nullLoader();
  5562. System.gc();
  5563. }
  5564.  
  5565. private void printDebug() {
  5566. System.out.println("============");
  5567. System.out.println("flame-cycle:" + anInt1208);
  5568. if (onDemandFetcher != null)
  5569. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5570. System.out.println("loop-cycle:" + loopCycle);
  5571. System.out.println("draw-cycle:" + anInt1061);
  5572. System.out.println("ptype:" + pktType);
  5573. System.out.println("psize:" + pktSize);
  5574. if (socketStream != null)
  5575. socketStream.printDebug();
  5576. super.shouldDebug = true;
  5577. }
  5578.  
  5579. Component getGameComponent() {
  5580. if (signlink.mainapp != null)
  5581. return signlink.mainapp;
  5582. if (super.gameFrame != null)
  5583. return super.gameFrame;
  5584. else
  5585. return this;
  5586. }
  5587.  
  5588. private void method73() {
  5589. do {
  5590. int j = readChar(-796);
  5591. if (j == -1)
  5592. break;
  5593. if (openInterfaceID != -1
  5594. && openInterfaceID == reportAbuseInterfaceID) {
  5595. if (j == 8 && reportAbuseInput.length() > 0)
  5596. reportAbuseInput = reportAbuseInput.substring(0,
  5597. reportAbuseInput.length() - 1);
  5598. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48
  5599. && j <= 57 || j == 32)
  5600. && reportAbuseInput.length() < 12)
  5601. reportAbuseInput += (char) j;
  5602. } else if (messagePromptRaised) {
  5603. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  5604. promptInput += (char) j;
  5605. inputTaken = true;
  5606. }
  5607. if (j == 8 && promptInput.length() > 0) {
  5608. promptInput = promptInput.substring(0,
  5609. promptInput.length() - 1);
  5610. inputTaken = true;
  5611. }
  5612. if (j == 13 || j == 10) {
  5613. messagePromptRaised = false;
  5614. inputTaken = true;
  5615. if (friendsListAction == 1) {
  5616. long l = TextClass.longForName(promptInput);
  5617. addFriend(l);
  5618. }
  5619. if (friendsListAction == 2 && friendsCount > 0) {
  5620. long l1 = TextClass.longForName(promptInput);
  5621. delFriend(l1);
  5622. }
  5623. if (friendsListAction == 3 && promptInput.length() > 0) {
  5624. stream.createFrame(126);
  5625. stream.writeWordBigEndian(0);
  5626. int k = stream.currentOffset;
  5627. stream.writeQWord(aLong953);
  5628. TextInput.method526(promptInput, stream);
  5629. stream.writeBytes(stream.currentOffset - k);
  5630. promptInput = TextInput.processText(promptInput);
  5631. // promptInput = Censor.doCensor(promptInput);
  5632. pushMessage(promptInput, 6, TextClass.fixName(TextClass
  5633. .nameForLong(aLong953)));
  5634. if (privateChatMode == 2) {
  5635. privateChatMode = 1;
  5636. stream.createFrame(95);
  5637. stream.writeWordBigEndian(publicChatMode);
  5638. stream.writeWordBigEndian(privateChatMode);
  5639. stream.writeWordBigEndian(tradeMode);
  5640. }
  5641. }
  5642. if (friendsListAction == 4 && ignoreCount < 100) {
  5643. long l2 = TextClass.longForName(promptInput);
  5644. addIgnore(l2);
  5645. }
  5646. if (friendsListAction == 5 && ignoreCount > 0) {
  5647. long l3 = TextClass.longForName(promptInput);
  5648. delIgnore(l3);
  5649. }
  5650. // clan chat
  5651. if (friendsListAction == 6) {
  5652. sendStringAsLong(promptInput);
  5653. } else if (friendsListAction == 8) {
  5654. sendString(1, promptInput);
  5655. } else if (friendsListAction == 9) {
  5656. sendString(2, promptInput);
  5657. } else if (friendsListAction == 10) {
  5658. sendString(3, promptInput);
  5659. }
  5660. }
  5661. } else if (inputDialogState == 1) {
  5662. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5663. amountOrNameInput += (char) j;
  5664. inputTaken = true;
  5665. }
  5666. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  5667. amountOrNameInput += (char) j;
  5668. inputTaken = true;
  5669. }
  5670. if (j == 8 && amountOrNameInput.length() > 0) {
  5671. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5672. inputTaken = true;
  5673. }
  5674. if (j == 13 || j == 10) {
  5675. if (amountOrNameInput.length() > 0) {
  5676. if (amountOrNameInput.length() > 0) {
  5677. if (amountOrNameInput.toLowerCase().contains("k")) {
  5678. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  5679. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  5680. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  5681. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  5682. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  5683. }
  5684. int amount = 0;
  5685. amount = Integer.parseInt(amountOrNameInput);
  5686. stream.createFrame(208);
  5687. stream.writeDWord(amount);
  5688. modifiableXValue = amount;
  5689. }
  5690. inputDialogState = 0;
  5691. inputTaken = true;
  5692. }
  5693. }
  5694. } else if (inputDialogState == 2) {
  5695. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5696. amountOrNameInput += (char) j;
  5697. inputTaken = true;
  5698. }
  5699. if (j == 8 && amountOrNameInput.length() > 0) {
  5700. amountOrNameInput = amountOrNameInput.substring(0,
  5701. amountOrNameInput.length() - 1);
  5702. inputTaken = true;
  5703. }
  5704. if (j == 13 || j == 10) {
  5705. if (amountOrNameInput.length() > 0) {
  5706. stream.createFrame(60);
  5707. stream.writeQWord(TextClass
  5708. .longForName(amountOrNameInput));
  5709. }
  5710. inputDialogState = 0;
  5711. inputTaken = true;
  5712. }
  5713. } else if (backDialogID == -1) {
  5714. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  5715. inputString += (char) j;
  5716. inputTaken = true;
  5717. }
  5718. if (j == 8 && inputString.length() > 0) {
  5719. inputString = inputString.substring(0,
  5720. inputString.length() - 1);
  5721. inputTaken = true;
  5722. }
  5723. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5724. if (inputString.startsWith("/"))
  5725. inputString = "::" + inputString;
  5726. if (inputString.equals("::hd"))
  5727. hdFloors = !hdFloors;
  5728. if(inputString.equals("::items"))
  5729. HdItems = !HdItems;
  5730. if(inputString.equals("::fixed"))
  5731. toggleSize(0);
  5732. if(inputString.equals("::screen"))
  5733. toggleSize(1);
  5734. if(inputString.equals("::screenfull"))
  5735. toggleSize(2);
  5736. if (inputString.startsWith("//setspecto")) {
  5737. int amt = Integer.parseInt(inputString
  5738. .substring(12));
  5739. anIntArray1045[300] = amt;
  5740. if (variousSettings[300] != amt) {
  5741. variousSettings[300] = amt;
  5742. method33(300);
  5743. needDrawTabArea = true;
  5744. if (dialogID != -1)
  5745. inputTaken = true;
  5746. }
  5747. }
  5748. if (inputString.equals("clientdrop"))
  5749. dropClient();
  5750. if (inputString.startsWith("full")) {
  5751. try {
  5752. String[] args = inputString.split(" ");
  5753. int id1 = Integer.parseInt(args[1]);
  5754. int id2 = Integer.parseInt(args[2]);
  5755. fullscreenInterfaceID = id1;
  5756. openInterfaceID = id2;
  5757. pushMessage("Opened Interface", 0, "");
  5758. } catch (Exception e) {
  5759. pushMessage("Interface Failed to load", 0, "");
  5760. }
  5761. }
  5762. if (inputString.equals("::lag"))
  5763. printDebug();
  5764. if (inputString.equals("::prefetchmusic")) {
  5765. //for (int j1 = 0; j1 < onDemandFetcher
  5766. //.getVersionCount(2); j1++)
  5767. //onDemandFetcher.method563((byte) 1, 2, j1);
  5768.  
  5769. }
  5770. if (inputString.equals("::fpson"))
  5771. fpsOn = true;
  5772. if (inputString.equals("::fpsoff"))
  5773. fpsOn = false;
  5774. if (inputString.equals("::dataon"))
  5775. clientData = true;
  5776. if (inputString.equals("::dataoff"))
  5777. clientData = false;
  5778. if (inputString.equals("::xpdrop")) {
  5779. if (drawIt) {
  5780. drawIt = false;
  5781. } else {
  5782. drawIt = true;
  5783. }
  5784. if (inputString.equals("::noclip")) {
  5785. for (int k1 = 0; k1 < 4; k1++) {
  5786. for (int i2 = 1; i2 < 103; i2++) {
  5787. for (int k2 = 1; k2 < 103; k2++)
  5788. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5789.  
  5790. }
  5791. }
  5792. }
  5793. }
  5794. if (inputString.equals("add model")) {
  5795. try {
  5796. int ModelIndex = Integer.parseInt(JOptionPane
  5797. .showInputDialog(this, "Enter model ID",
  5798. "Model", 3));
  5799. byte[] abyte0 = getModel(ModelIndex);
  5800. if (abyte0 != null && abyte0.length > 0) {
  5801. decompressors[1].method234(abyte0.length,
  5802. abyte0, ModelIndex);
  5803. pushMessage("Model: [" + ModelIndex
  5804. + "] added successfully!", 0, "");
  5805. } else {
  5806. pushMessage("Unable to find the model. "
  5807. + ModelIndex, 0, "");
  5808. }
  5809. } catch (Exception e) {
  5810. pushMessage("Syntax - ::add model <path>", 0, "");
  5811. }
  5812. }
  5813. if (inputString.startsWith("::")) {
  5814. stream.createFrame(103);
  5815. stream.writeWordBigEndian(inputString.length() - 1);
  5816. stream.writeString(inputString.substring(2));
  5817. } else {
  5818. String s = inputString.toLowerCase();
  5819. int j2 = 0;
  5820. if (s.startsWith("yellow:")) {
  5821. j2 = 0;
  5822. inputString = inputString.substring(7);
  5823. } else if (s.startsWith("red:")) {
  5824. j2 = 1;
  5825. inputString = inputString.substring(4);
  5826. } else if (s.startsWith("green:")) {
  5827. j2 = 2;
  5828. inputString = inputString.substring(6);
  5829. } else if (s.startsWith("cyan:")) {
  5830. j2 = 3;
  5831. inputString = inputString.substring(5);
  5832. } else if (s.startsWith("purple:")) {
  5833. j2 = 4;
  5834. inputString = inputString.substring(7);
  5835. } else if (s.startsWith("white:")) {
  5836. j2 = 5;
  5837. inputString = inputString.substring(6);
  5838. } else if (s.startsWith("flash1:")) {
  5839. j2 = 6;
  5840. inputString = inputString.substring(7);
  5841. } else if (s.startsWith("flash2:")) {
  5842. j2 = 7;
  5843. inputString = inputString.substring(7);
  5844. } else if (s.startsWith("flash3:")) {
  5845. j2 = 8;
  5846. inputString = inputString.substring(7);
  5847. } else if (s.startsWith("glow1:")) {
  5848. j2 = 9;
  5849. inputString = inputString.substring(6);
  5850. } else if (s.startsWith("glow2:")) {
  5851. j2 = 10;
  5852. inputString = inputString.substring(6);
  5853. } else if (s.startsWith("glow3:")) {
  5854. j2 = 11;
  5855. inputString = inputString.substring(6);
  5856. }
  5857. s = inputString.toLowerCase();
  5858. int i3 = 0;
  5859. if (s.startsWith("wave:")) {
  5860. i3 = 1;
  5861. inputString = inputString.substring(5);
  5862. } else if (s.startsWith("wave2:")) {
  5863. i3 = 2;
  5864. inputString = inputString.substring(6);
  5865. } else if (s.startsWith("shake:")) {
  5866. i3 = 3;
  5867. inputString = inputString.substring(6);
  5868. } else if (s.startsWith("scroll:")) {
  5869. i3 = 4;
  5870. inputString = inputString.substring(7);
  5871. } else if (s.startsWith("slide:")) {
  5872. i3 = 5;
  5873. inputString = inputString.substring(6);
  5874. }
  5875. stream.createFrame(4);
  5876. stream.writeWordBigEndian(0);
  5877. int j3 = stream.currentOffset;
  5878. stream.method425(i3);
  5879. stream.method425(j2);
  5880. aStream_834.currentOffset = 0;
  5881. TextInput.method526(inputString, aStream_834);
  5882. stream.method441(0, aStream_834.buffer,
  5883. aStream_834.currentOffset);
  5884. stream.writeBytes(stream.currentOffset - j3);
  5885. inputString = TextInput.processText(inputString);
  5886. // inputString = Censor.doCensor(inputString);
  5887. myPlayer.textSpoken = inputString;
  5888. myPlayer.anInt1513 = j2;
  5889. myPlayer.anInt1531 = i3;
  5890. myPlayer.textCycle = 150;
  5891. String cr = "";
  5892. if (myPrivilege == 10)
  5893. cr = "@cr10@";
  5894. if (myPrivilege == 9)
  5895. cr = "@cr9@";
  5896. if (myPrivilege == 8)
  5897. cr = "@cr8@";
  5898. if (myPrivilege == 7)
  5899. cr = "@cr7@";
  5900. if (myPrivilege == 6)
  5901. cr = "@cr6@";
  5902. if (myPrivilege == 5)
  5903. cr = "@cr5@";
  5904. if (myPrivilege == 4)
  5905. cr = "@cr4@";
  5906. if (myPrivilege == 3)
  5907. cr = "@cr3@";
  5908. if (myPrivilege == 2)
  5909. cr = "@cr2@";
  5910. if (myPrivilege == 1)
  5911. cr = "@cr1@"; // crowns works fine for yourself, its
  5912. // other people who sees it
  5913. // differently ok
  5914.  
  5915. pushMessage(myPlayer.textSpoken, 2, cr + "<col="
  5916. + titleColor(myPlayer.titleColor, 0) + ">"
  5917. + myPlayer.title + "</col> " + myPlayer.name);
  5918. // myself
  5919. if (publicChatMode == 2) {
  5920. publicChatMode = 3;
  5921. stream.createFrame(95);
  5922. stream.writeWordBigEndian(publicChatMode);
  5923. stream.writeWordBigEndian(privateChatMode);
  5924. stream.writeWordBigEndian(tradeMode);
  5925. }
  5926. }
  5927. inputString = "";
  5928. inputTaken = true;
  5929. }
  5930. }
  5931. } while (true);
  5932. }
  5933.  
  5934. public final String titleColor(final int i, int type) {
  5935. String titleChatbox = "", titleRightclick = "";
  5936. switch (i) {
  5937.  
  5938. case 0:
  5939. // orange
  5940. titleChatbox = "A67711";
  5941. titleRightclick = "or0";
  5942. break;
  5943.  
  5944. case 1:
  5945. // purple
  5946. titleChatbox = "FF00CD";
  5947. titleRightclick = "pur";
  5948. break;
  5949.  
  5950. case 2:
  5951. // red
  5952. titleChatbox = "ff0000";
  5953. titleRightclick = "red";
  5954. break;
  5955.  
  5956. case 3:
  5957. // green
  5958. titleChatbox = "148200";
  5959. titleRightclick = "gr0";
  5960. break;
  5961.  
  5962. case 4:
  5963. // black
  5964. titleChatbox = "0";
  5965. titleRightclick = "bla";
  5966. break;
  5967.  
  5968. case 5:
  5969. // yellow
  5970. titleChatbox = "ffff00";
  5971. titleRightclick = "yel";
  5972. break;
  5973.  
  5974. case 6:
  5975. // cyan
  5976. titleChatbox = "65535";
  5977. titleRightclick = "cya";
  5978. break;
  5979.  
  5980. case 7:
  5981. // white
  5982. titleChatbox = "ffffff";
  5983. titleRightclick = "whi";
  5984. break;
  5985. }
  5986. if (type == 0)
  5987. return titleChatbox;
  5988. else
  5989. return titleRightclick;
  5990. }
  5991.  
  5992. private void buildPublicChat(int j) {
  5993. int l = 0;
  5994. for (int i1 = 0; i1 < 500; i1++) {
  5995. if (chatMessages[i1] == null)
  5996. continue;
  5997. if (chatTypeView != 1)
  5998. continue;
  5999. int j1 = chatTypes[i1];
  6000. String s = chatNames[i1];
  6001. int k1 = (70 - l * 14 + 42) + chatScrollPos + 4 + 5;
  6002. if (k1 < -23)
  6003. break;
  6004. if (s != null && s.startsWith("@cr"))
  6005. s = s.substring(5);
  6006. if (s != null && s.startsWith("<col=")) {
  6007. s = s.substring(s.indexOf("</col>") + 6);
  6008. }
  6009. if (s != null && s.startsWith("@cr1@"))
  6010. s = s.substring(5);
  6011. if (s != null && s.startsWith("@cr2@"))
  6012. s = s.substring(5);
  6013. if (s != null && s.startsWith("@cr3@"))
  6014. s = s.substring(5);
  6015. if (s != null && s.startsWith("@cr4@"))
  6016. s = s.substring(5);
  6017. if (s != null && s.startsWith("@cr5@"))
  6018. s = s.substring(5);
  6019. if (s != null && s.startsWith("@cr6@"))
  6020. s = s.substring(5);
  6021. if (s != null && s.startsWith("@cr7@"))
  6022. s = s.substring(5);
  6023. if (s != null && s.startsWith("@cr8@"))
  6024. s = s.substring(5);
  6025. if (s != null && s.startsWith("@cr9@"))
  6026. s = s.substring(5);
  6027. if (s != null && s.startsWith("@cr10@"))
  6028. s = s.substring(6);
  6029. if ((j1 == 1 || j1 == 2)
  6030. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6031. && isFriendOrSelf(s))) {
  6032. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6033. if (myPrivilege >= 1) {
  6034. menuActionName[menuActionRow] = "Report abuse @whi@"
  6035. + s;
  6036. menuActionID[menuActionRow] = 606;
  6037. menuActionRow++;
  6038. }
  6039. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6040. menuActionID[menuActionRow] = 42;
  6041. menuActionRow++;
  6042. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6043. menuActionID[menuActionRow] = 337;
  6044. menuActionRow++;
  6045. }
  6046. l++;
  6047. }
  6048. }
  6049. }
  6050.  
  6051. private void buildFriendChat(int j) {
  6052. int l = 0;
  6053. for (int i1 = 0; i1 < 500; i1++) {
  6054. if (chatMessages[i1] == null)
  6055. continue;
  6056. if (chatTypeView != 2)
  6057. continue;
  6058. int j1 = chatTypes[i1];
  6059. String s = chatNames[i1];
  6060. int k1 = (70 - l * 14 + 42) + chatScrollPos + 4 + 5;
  6061. if (k1 < -23)
  6062. break;
  6063. if (s != null && s.startsWith("@cr1@"))
  6064. s = s.substring(5);
  6065. if (s != null && s.startsWith("@cr2@"))
  6066. s = s.substring(5);
  6067. if (s != null && s.startsWith("@cr3@"))
  6068. s = s.substring(5);
  6069. if (s != null && s.startsWith("@cr4@"))
  6070. s = s.substring(5);
  6071. if (s != null && s.startsWith("@cr5@"))
  6072. s = s.substring(5);
  6073. if (s != null && s.startsWith("@cr6@"))
  6074. s = s.substring(5);
  6075. if ((j1 == 5 || j1 == 6)
  6076. && (splitPrivateChat == 0 || chatTypeView == 2)
  6077. && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1
  6078. && isFriendOrSelf(s)))
  6079. l++;
  6080. if ((j1 == 3 || j1 == 7)
  6081. && (splitPrivateChat == 0 || chatTypeView == 2)
  6082. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6083. && isFriendOrSelf(s))) {
  6084. if (j > k1 - 14 && j <= k1) {
  6085. if (myPrivilege >= 1) {
  6086. menuActionName[menuActionRow] = "Report abuse @whi@"
  6087. + s;
  6088. menuActionID[menuActionRow] = 606;
  6089. menuActionRow++;
  6090. }
  6091. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6092. menuActionID[menuActionRow] = 42;
  6093. menuActionRow++;
  6094. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6095. menuActionID[menuActionRow] = 337;
  6096. menuActionRow++;
  6097. }
  6098. l++;
  6099. }
  6100. }
  6101. }
  6102.  
  6103. private void buildDuelorTrade(int j) {
  6104. int l = 0;
  6105. for (int i1 = 0; i1 < 500; i1++) {
  6106. if (chatMessages[i1] == null)
  6107. continue;
  6108. if (chatTypeView != 3 && chatTypeView != 4)
  6109. continue;
  6110. int j1 = chatTypes[i1];
  6111. String s = chatNames[i1];
  6112. int k1 = (70 - l * 14 + 42) + chatScrollPos + 4 + 5;
  6113. if (k1 < -23)
  6114. break;
  6115. if (s != null && s.startsWith("@cr1@"))
  6116. s = s.substring(5);
  6117. if (s != null && s.startsWith("@cr2@"))
  6118. s = s.substring(5);
  6119. if (s != null && s.startsWith("@cr3@"))
  6120. s = s.substring(5);
  6121. if (s != null && s.startsWith("@cr4@"))
  6122. s = s.substring(5);
  6123. if (s != null && s.startsWith("@cr5@"))
  6124. s = s.substring(5);
  6125. if (s != null && s.startsWith("@cr6@"))
  6126. s = s.substring(5);
  6127. if (s != null && s.startsWith("@cr7@"))
  6128. s = s.substring(5);
  6129. if (s != null && s.startsWith("@cr8@"))
  6130. s = s.substring(5);
  6131. if (s != null && s.startsWith("@cr9@"))
  6132. s = s.substring(5);
  6133. if (s != null && s.startsWith("@cr10@"))
  6134. s = s.substring(6);
  6135. if (chatTypeView == 3 && j1 == 4
  6136. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6137. if (j > k1 - 14 && j <= k1) {
  6138. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6139. menuActionID[menuActionRow] = 484;
  6140. menuActionRow++;
  6141. }
  6142. l++;
  6143. }
  6144. if (chatTypeView == 4 && j1 == 8
  6145. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6146. if (j > k1 - 14 && j <= k1) {
  6147. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6148. + s;
  6149. menuActionID[menuActionRow] = 6;
  6150. menuActionRow++;
  6151. }
  6152. l++;
  6153. }
  6154. if (j1 == 12) {
  6155. if (j > k1 - 14 && j <= k1) {
  6156. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6157. menuActionID[menuActionRow] = 915;
  6158. menuActionRow++;
  6159. }
  6160. l++;
  6161. }
  6162. }
  6163. }
  6164.  
  6165. private void buildChatAreaMenu(int j) {
  6166. int l = 0;
  6167. for (int i1 = 0; i1 < 500; i1++) {
  6168. if (chatMessages[i1] == null)
  6169. continue;
  6170. int j1 = chatTypes[i1];
  6171. int k1 = (70 - l * 14 + 42) + chatScrollPos + 4 + 5;
  6172. if (k1 < -23)
  6173. break;
  6174. String s = chatNames[i1];
  6175. if (chatTypeView == 1) {
  6176. buildPublicChat(j);
  6177. break;
  6178. }
  6179. if (chatTypeView == 2) {
  6180. buildFriendChat(j);
  6181. break;
  6182. }
  6183. if (chatTypeView == 3 || chatTypeView == 4) {
  6184. buildDuelorTrade(j);
  6185. break;
  6186. }
  6187. if (chatTypeView == 5) {
  6188. break;
  6189. }
  6190. if (s != null && s.startsWith("@cr1@")) {
  6191. s = s.substring(5);
  6192. }
  6193. if (s != null && s.startsWith("@cr2@")) {
  6194. s = s.substring(5);
  6195. }
  6196. if (s != null && s.startsWith("@cr3@")) {
  6197. s = s.substring(5);
  6198. }
  6199. if (s != null && s.startsWith("@cr4@")) {
  6200. s = s.substring(5);
  6201. }
  6202. if (s != null && s.startsWith("@cr5@")) {
  6203. s = s.substring(5);
  6204. }
  6205. if (s != null && s.startsWith("@cr6@")) {
  6206. s = s.substring(5);
  6207. }
  6208. if (s != null && s.startsWith("@cr7@")) {
  6209. s = s.substring(5);
  6210. }
  6211. if (s != null && s.startsWith("@cr8@")) {
  6212. s = s.substring(5);
  6213. }
  6214. if (s != null && s.startsWith("@cr9@")) {
  6215. s = s.substring(5);
  6216. }
  6217. if (s != null && s.startsWith("@cr10@")) {
  6218. s = s.substring(6);
  6219. }
  6220. if (s != null && s.startsWith("<col=")) {
  6221. s = s.substring(s.indexOf("</col>") + 6);
  6222. }
  6223. if (j1 == 0)
  6224. l++;
  6225. if ((j1 == 1 || j1 == 2)
  6226. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6227. && isFriendOrSelf(s))) {
  6228. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6229. if (myPrivilege >= 1) {
  6230. menuActionName[menuActionRow] = "Report abuse @whi@"
  6231. + s;
  6232. menuActionID[menuActionRow] = 606;
  6233. menuActionRow++;
  6234. }
  6235. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6236. menuActionID[menuActionRow] = 42;
  6237. menuActionRow++;
  6238. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6239. menuActionID[menuActionRow] = 337;
  6240. menuActionRow++;
  6241. }
  6242. l++;
  6243. }
  6244. if ((j1 == 3 || j1 == 7)
  6245. && splitPrivateChat == 0
  6246. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6247. && isFriendOrSelf(s))) {
  6248. if (j > k1 - 14 && j <= k1) {
  6249. if (myPrivilege >= 1) {
  6250. menuActionName[menuActionRow] = "Report abuse @whi@"
  6251. + s;
  6252. menuActionID[menuActionRow] = 606;
  6253. menuActionRow++;
  6254. }
  6255. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6256. menuActionID[menuActionRow] = 42;
  6257. menuActionRow++;
  6258. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6259. menuActionID[menuActionRow] = 337;
  6260. menuActionRow++;
  6261. }
  6262. l++;
  6263. }
  6264. if (j1 == 4
  6265. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6266. if (j > k1 - 14 && j <= k1) {
  6267. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6268. menuActionID[menuActionRow] = 484;
  6269. menuActionRow++;
  6270. }
  6271. l++;
  6272. }
  6273. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0
  6274. && privateChatMode < 2)
  6275. l++;
  6276. if (j1 == 8
  6277. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6278. if (j > k1 - 14 && j <= k1) {
  6279. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6280. + s;
  6281. menuActionID[menuActionRow] = 6;
  6282. menuActionRow++;
  6283. }
  6284. l++;
  6285. }
  6286. }
  6287. }
  6288.  
  6289. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6290. int j = class9.contentType;
  6291. if (j >= 205 && j <= 205 + 25) {
  6292. j -= 206;
  6293. class9.message = setMessage(j);
  6294. return;
  6295. }
  6296. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6297. if (j == 1 && anInt900 == 0) {
  6298. class9.message = "Loading friend list";
  6299. class9.atActionType = 0;
  6300. return;
  6301. }
  6302. if (j == 1 && anInt900 == 1) {
  6303. class9.message = "Connecting to friendserver";
  6304. class9.atActionType = 0;
  6305. return;
  6306. }
  6307. if (j == 2 && anInt900 != 2) {
  6308. class9.message = "Please wait...";
  6309. class9.atActionType = 0;
  6310. return;
  6311. }
  6312. int k = friendsCount;
  6313. if (anInt900 != 2)
  6314. k = 0;
  6315. if (j > 700)
  6316. j -= 601;
  6317. else
  6318. j--;
  6319. if (j >= k) {
  6320. class9.message = "";
  6321. class9.atActionType = 0;
  6322. return;
  6323. } else {
  6324. class9.message = friendsList[j];
  6325. class9.atActionType = 1;
  6326. return;
  6327. }
  6328. }
  6329. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6330. int l = friendsCount;
  6331. if (anInt900 != 2)
  6332. l = 0;
  6333. if (j > 800)
  6334. j -= 701;
  6335. else
  6336. j -= 101;
  6337. if (j >= l) {
  6338. class9.message = "";
  6339. class9.atActionType = 0;
  6340. return;
  6341. }
  6342. if (friendsNodeIDs[j] == 0)
  6343. class9.message = "@red@Offline";
  6344. else if (friendsNodeIDs[j] == nodeID)
  6345. class9.message = "@gre@Online" /* + (friendsNodeIDs[j] - 9) */
  6346. ;
  6347. else
  6348. class9.message = "@red@Offline" /* + (friendsNodeIDs[j] - 9) */
  6349. ;
  6350. class9.atActionType = 1;
  6351. return;
  6352. }
  6353. if (j == 203) {
  6354. int i1 = friendsCount;
  6355. if (anInt900 != 2)
  6356. i1 = 0;
  6357. class9.scrollMax = i1 * 15 + 20;
  6358. if (class9.scrollMax <= class9.height)
  6359. class9.scrollMax = class9.height + 1;
  6360. return;
  6361. }
  6362. if (j >= 401 && j <= 500) {
  6363. if ((j -= 401) == 0 && anInt900 == 0) {
  6364. class9.message = "Loading ignore list";
  6365. class9.atActionType = 0;
  6366. return;
  6367. }
  6368. if (j == 1 && anInt900 == 0) {
  6369. class9.message = "Please wait...";
  6370. class9.atActionType = 0;
  6371. return;
  6372. }
  6373. int j1 = ignoreCount;
  6374. if (anInt900 == 0)
  6375. j1 = 0;
  6376. if (j >= j1) {
  6377. class9.message = "";
  6378. class9.atActionType = 0;
  6379. return;
  6380. } else {
  6381. class9.message = TextClass.fixName(TextClass
  6382. .nameForLong(ignoreListAsLongs[j]));
  6383. class9.atActionType = 1;
  6384. return;
  6385. }
  6386. }
  6387. if (j == 503) {
  6388. class9.scrollMax = ignoreCount * 15 + 20;
  6389. if (class9.scrollMax <= class9.height)
  6390. class9.scrollMax = class9.height + 1;
  6391. return;
  6392. }
  6393. if (j == 327) {
  6394. class9.modelRotation1 = 150;
  6395. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6396. if (aBoolean1031) {
  6397. for (int k1 = 0; k1 < 7; k1++) {
  6398. int l1 = anIntArray1065[k1];
  6399. if (l1 >= 0 && !IDK.cache[l1].method537())
  6400. return;
  6401. }
  6402.  
  6403. aBoolean1031 = false;
  6404. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6405. int i2 = 0;
  6406. for (int j2 = 0; j2 < 7; j2++) {
  6407. int k2 = anIntArray1065[j2];
  6408. if (k2 >= 0)
  6409. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  6410. .method538();
  6411. }
  6412.  
  6413. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6414. for (int l2 = 0; l2 < 5; l2++)
  6415. if (anIntArray990[l2] != 0) {
  6416. model.method476(anIntArrayArray1003[l2][0],
  6417. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6418. if (l2 == 1)
  6419. model.method476(anIntArray1204[0],
  6420. anIntArray1204[anIntArray990[l2]]);
  6421. }
  6422.  
  6423. model.method469();
  6424. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6425. model.method479(64, 850, -30, -50, -30, true);
  6426. class9.anInt233 = 5;
  6427. class9.mediaID = 0;
  6428. RSInterface.method208(aBoolean994, model);
  6429. }
  6430. return;
  6431. }
  6432. if (j == 328) {
  6433. RSInterface rsInterface = class9;
  6434. int verticleTilt = 150;
  6435. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6436. rsInterface.modelRotation1 = verticleTilt;
  6437. rsInterface.modelRotation2 = animationSpeed;
  6438. if (aBoolean1031) {
  6439. Model characterDisplay = myPlayer.method452();
  6440. for (int l2 = 0; l2 < 5; l2++)
  6441. if (anIntArray990[l2] != 0) {
  6442. characterDisplay.method476(anIntArrayArray1003[l2][0],
  6443. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6444. if (l2 == 1)
  6445. characterDisplay.method476(anIntArray1204[0],
  6446. anIntArray1204[anIntArray990[l2]]);
  6447. }
  6448. int staticFrame = myPlayer.anInt1511;
  6449. characterDisplay.method469();
  6450. characterDisplay
  6451. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  6452. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6453. rsInterface.anInt233 = 5;
  6454. rsInterface.mediaID = 0;
  6455. RSInterface.method208(aBoolean994, characterDisplay);
  6456. }
  6457. return;
  6458. }
  6459. if (j == 324) {
  6460. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6461. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6462. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6463. }
  6464. if (aBoolean1047) {
  6465. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6466. return;
  6467. } else {
  6468. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6469. return;
  6470. }
  6471. }
  6472. if (j == 325) {
  6473. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6474. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6475. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6476. }
  6477. if (aBoolean1047) {
  6478. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6479. return;
  6480. } else {
  6481. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6482. return;
  6483. }
  6484. }
  6485. if (j == 600) {
  6486. class9.message = reportAbuseInput;
  6487. if (loopCycle % 20 < 10) {
  6488. class9.message += "|";
  6489. return;
  6490. } else {
  6491. class9.message += " ";
  6492. return;
  6493. }
  6494. }
  6495. if (j == 613)
  6496. if (myPrivilege >= 1) {
  6497. if (canMute) {
  6498. class9.textColor = 0xff0000;
  6499. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  6500. } else {
  6501. class9.textColor = 0xffffff;
  6502. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  6503. }
  6504. } else {
  6505. class9.message = "";
  6506. }
  6507. if (j == 650 || j == 655)
  6508. if (anInt1193 != 0) {
  6509. String s;
  6510. if (daysSinceLastLogin == 0)
  6511. s = "earlier today";
  6512. else if (daysSinceLastLogin == 1)
  6513. s = "yesterday";
  6514. else
  6515. s = daysSinceLastLogin + " days ago";
  6516. class9.message = "You last logged in " + s + " from: "
  6517. + signlink.dns;
  6518. } else {
  6519. class9.message = "";
  6520. }
  6521. if (j == 651) {
  6522. if (unreadMessages == 0) {
  6523. class9.message = "0 unread messages";
  6524. class9.textColor = 0xffff00;
  6525. }
  6526. if (unreadMessages == 1) {
  6527. class9.message = "1 unread message";
  6528. class9.textColor = 65280;
  6529. }
  6530. if (unreadMessages > 1) {
  6531. class9.message = unreadMessages + " unread messages";
  6532. class9.textColor = 65280;
  6533. }
  6534. }
  6535. if (j == 652)
  6536. if (daysSinceRecovChange == 201) {
  6537. if (membersInt == 1)
  6538. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6539. else
  6540. class9.message = "";
  6541. } else if (daysSinceRecovChange == 200) {
  6542. class9.message = "You have not yet set any password recovery questions.";
  6543. } else {
  6544. String s1;
  6545. if (daysSinceRecovChange == 0)
  6546. s1 = "Earlier today";
  6547. else if (daysSinceRecovChange == 1)
  6548. s1 = "Yesterday";
  6549. else
  6550. s1 = daysSinceRecovChange + " days ago";
  6551. class9.message = s1 + " you changed your recovery questions";
  6552. }
  6553. if (j == 653)
  6554. if (daysSinceRecovChange == 201) {
  6555. if (membersInt == 1)
  6556. class9.message = "@whi@recommend you use a members world instead. You may use";
  6557. else
  6558. class9.message = "";
  6559. } else if (daysSinceRecovChange == 200)
  6560. class9.message = "We strongly recommend you do so now to secure your account.";
  6561. else
  6562. class9.message = "If you do not remember making this change then cancel it immediately";
  6563. if (j == 654) {
  6564. if (daysSinceRecovChange == 201)
  6565. if (membersInt == 1) {
  6566. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6567. return;
  6568. } else {
  6569. class9.message = "";
  6570. return;
  6571. }
  6572. if (daysSinceRecovChange == 200) {
  6573. class9.message = "Do this from the 'account management' area on our front webpage";
  6574. return;
  6575. }
  6576. class9.message = "Do this from the 'account management' area on our front webpage";
  6577. }
  6578. }
  6579.  
  6580. private void drawSplitPrivateChat() {
  6581. if (splitPrivateChat == 0)
  6582. return;
  6583. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6584. int i = 0;
  6585. if (anInt1104 != 0)
  6586. i = 1;
  6587. for (int j = 0; j < 100; j++)
  6588. if (chatMessages[j] != null) {
  6589. int k = chatTypes[j];
  6590. String s = chatNames[j];
  6591. byte byte1 = 0;
  6592. if (s != null && s.startsWith("@cr1@")) {
  6593. s = s.substring(5);
  6594. byte1 = 1;
  6595. }
  6596. if (s != null && s.startsWith("@cr2@")) {
  6597. s = s.substring(5);
  6598. byte1 = 2;
  6599. }
  6600. if (s != null && s.startsWith("@cr3@")) {
  6601. s = s.substring(5);
  6602. byte1 = 3;
  6603. }
  6604. if (s != null && s.startsWith("@cr4@")) {
  6605. s = s.substring(5);
  6606. byte1 = 4;
  6607. }
  6608. if (s != null && s.startsWith("@cr5@")) {
  6609. s = s.substring(5);
  6610. byte1 = 5;
  6611. }
  6612. if (s != null && s.startsWith("@cr6@")) {
  6613. s = s.substring(5);
  6614. byte1 = 6;
  6615. }
  6616. if ((k == 3 || k == 7)
  6617. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  6618. && isFriendOrSelf(s))) {
  6619. int l = 329 - i * 13;
  6620. int k1 = 4;
  6621. textDrawingArea.method385(0, "From", l, k1);
  6622. textDrawingArea.method385(65535, "From", l - 1, k1);
  6623. k1 += textDrawingArea.getTextWidth("From ");
  6624. if (byte1 == 1) {
  6625. modIcons[0].drawSprite(k1, l - 12);
  6626. k1 += 12;
  6627. }
  6628. if (byte1 == 2) {
  6629. modIcons[1].drawSprite(k1, l - 12);
  6630. k1 += 12;
  6631. }
  6632. if (byte1 == 3) {
  6633. modIcons[2].drawSprite(k1, l - 12);
  6634. k1 += 12;
  6635. }
  6636. if (byte1 == 4) {
  6637. modIcons[3].drawSprite(k1, l - 12);
  6638. k1 += 12;
  6639. }
  6640. if (byte1 == 5) {
  6641. modIcons[4].drawSprite(k1, l - 12);
  6642. k1 += 12;
  6643. }
  6644. if (byte1 == 6) {
  6645. modIcons[5].drawSprite(k1, l - 12);
  6646. k1 += 12;
  6647. }
  6648. if (byte1 == 7) {
  6649. modIcons[6].drawSprite(k1, l - 12);
  6650. k1 += 12;
  6651. }
  6652. if (byte1 == 4) {
  6653. emoticons[0].drawSprite(k1, l - 12);
  6654. k1 += 12;
  6655. }
  6656. textDrawingArea.method385(0, s + ": " + chatMessages[j], l,
  6657. k1);
  6658. textDrawingArea.method385(65535,
  6659. s + ": " + chatMessages[j], l - 1, k1);
  6660. if (++i >= 5)
  6661. return;
  6662. }
  6663. if (k == 5 && privateChatMode < 2) {
  6664. int i1 = 329 - i * 13;
  6665. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6666. textDrawingArea
  6667. .method385(65535, chatMessages[j], i1 - 1, 4);
  6668. if (++i >= 5)
  6669. return;
  6670. }
  6671. if (k == 6 && privateChatMode < 2) {
  6672. int j1 = 329 - i * 13;
  6673. textDrawingArea.method385(0, "To " + s + ": "
  6674. + chatMessages[j], j1, 4);
  6675. textDrawingArea.method385(65535, "To " + s + ": "
  6676. + chatMessages[j], j1 - 1, 4);
  6677. if (++i >= 5)
  6678. return;
  6679. }
  6680. }
  6681.  
  6682. }
  6683.  
  6684. public void pushMessage(String s, int i, String s1) {
  6685.  
  6686. if (s.contains("test"))// sec
  6687. {
  6688. System.out.println(s1);
  6689. }
  6690. if (i == 0 && dialogID != -1) {
  6691. aString844 = s;
  6692. super.clickMode3 = 0;
  6693. }
  6694. if (backDialogID == -1)
  6695. inputTaken = true;
  6696. for (int j = 499; j > 0; j--) {
  6697. chatTypes[j] = chatTypes[j - 1];
  6698. chatNames[j] = chatNames[j - 1];
  6699. chatMessages[j] = chatMessages[j - 1];
  6700. chatRights[j] = chatRights[j - 1];
  6701. clanTitles[j] = clanTitles[j - 1];
  6702. }
  6703. chatTypes[0] = i;
  6704. chatNames[0] = s1;
  6705. chatMessages[0] = s;
  6706. chatRights[0] = channelRights;
  6707. clanTitles[0] = clanTitle;
  6708. }
  6709.  
  6710. private void processTabClick() {
  6711. int[] tab = {
  6712. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
  6713. };
  6714. if(clientSize == 0) {
  6715. if(super.clickMode3 == 1) {
  6716. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6717. {
  6718. needDrawTabArea = true;
  6719. tabID = 0;
  6720. tabAreaAltered = true;
  6721. }
  6722. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6723. {
  6724. needDrawTabArea = true;
  6725. tabID = 1;
  6726. tabAreaAltered = true;
  6727. }
  6728. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6729. {
  6730. needDrawTabArea = true;
  6731. tabID = 2;
  6732. tabAreaAltered = true;
  6733. }
  6734. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6735. {
  6736. needDrawTabArea = true;
  6737. tabID = 3;
  6738. tabAreaAltered = true;
  6739. }
  6740. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6741. {
  6742. needDrawTabArea = true;
  6743. tabID = 4;
  6744. tabAreaAltered = true;
  6745. }
  6746. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6747. {
  6748. needDrawTabArea = true;
  6749. tabID = 5;
  6750. tabAreaAltered = true;
  6751. }
  6752. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6753. {
  6754. needDrawTabArea = true;
  6755. tabID = 6;
  6756. tabAreaAltered = true;
  6757. }
  6758. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6759. {
  6760. needDrawTabArea = true;
  6761. tabID = 7;
  6762. tabAreaAltered = true;
  6763. }
  6764. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6765. {
  6766. needDrawTabArea = true;
  6767. tabID = 8;
  6768. tabAreaAltered = true;
  6769. }
  6770. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6771. {
  6772. needDrawTabArea = true;
  6773. tabID = 9;
  6774. tabAreaAltered = true;
  6775. }
  6776. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6777. {
  6778. needDrawTabArea = true;
  6779. tabID = 10;
  6780. tabAreaAltered = true;
  6781. }
  6782. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6783. {
  6784. needDrawTabArea = true;
  6785. tabID = 11;
  6786. tabAreaAltered = true;
  6787. }
  6788. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6789. {
  6790. needDrawTabArea = true;
  6791. tabID = 12;
  6792. tabAreaAltered = true;
  6793. }
  6794. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6795. {
  6796. needDrawTabArea = true;
  6797. tabID = 13;
  6798. tabAreaAltered = true;
  6799. }
  6800. }
  6801. } else if (clientSize != 0) {
  6802. if(clientWidth < smallTabs) {
  6803. if(super.clickMode3 == 1) {
  6804. if (super.saveClickX >= clientWidth - 241
  6805. && super.saveClickX <= clientWidth - 204
  6806. && super.saveClickY >= clientHeight - 72
  6807. && super.saveClickY < clientHeight - 40
  6808. && tabInterfaceIDs[0] != -1) {
  6809. if (tabID == tab[0]) {
  6810. showTab = !showTab;
  6811. } else {
  6812. showTab = true;
  6813. }
  6814. tabID = tab[0];
  6815. needDrawTabArea = true;
  6816. tabAreaAltered = true;
  6817.  
  6818. }
  6819. if (super.saveClickX >= clientWidth - 202
  6820. && super.saveClickX <= clientWidth - 171
  6821. && super.saveClickY >= clientHeight - 72
  6822. && super.saveClickY < clientHeight - 40
  6823. && tabInterfaceIDs[1] != -1) {
  6824. if (tabID == tab[1]) {
  6825. showTab = !showTab;
  6826. } else {
  6827. showTab = true;
  6828. }
  6829. tabID = tab[1];
  6830. needDrawTabArea = true;
  6831. tabAreaAltered = true;
  6832.  
  6833. }
  6834. if (super.saveClickX >= clientWidth - 170
  6835. && super.saveClickX <= clientWidth - 139
  6836. && super.saveClickY >= clientHeight - 72
  6837. && super.saveClickY < clientHeight - 40
  6838. && tabInterfaceIDs[2] != -1) {
  6839. if (tabID == tab[2]) {
  6840. showTab = !showTab;
  6841. } else {
  6842. showTab = true;
  6843. }
  6844. tabID = tab[2];
  6845. needDrawTabArea = true;
  6846. tabAreaAltered = true;
  6847.  
  6848. }
  6849. if (super.saveClickX >= clientWidth - 138
  6850. && super.saveClickX <= clientWidth - 105
  6851. && super.saveClickY >= clientHeight - 72
  6852. && super.saveClickY < clientHeight - 40
  6853. && tabInterfaceIDs[3] != -1) {
  6854. if (tabID == tab[3]) {
  6855. showTab = !showTab;
  6856. } else {
  6857. showTab = true;
  6858. }
  6859. tabID = tab[3];
  6860. needDrawTabArea = true;
  6861. tabAreaAltered = true;
  6862.  
  6863. }
  6864. if (super.saveClickX >= clientWidth - 104
  6865. && super.saveClickX <= clientWidth - 72
  6866. && super.saveClickY >= clientHeight - 72
  6867. && super.saveClickY < clientHeight - 40
  6868. && tabInterfaceIDs[4] != -1) {
  6869. if (tabID == tab[4]) {
  6870. showTab = !showTab;
  6871. } else {
  6872. showTab = true;
  6873. }
  6874. tabID = tab[4];
  6875. needDrawTabArea = true;
  6876. tabAreaAltered = true;
  6877.  
  6878. }
  6879. if (super.saveClickX >= clientWidth - 71
  6880. && super.saveClickX <= clientWidth - 39
  6881. && super.saveClickY >= clientHeight - 72
  6882. && super.saveClickY < clientHeight - 40
  6883. && tabInterfaceIDs[5] != -1) {
  6884. if (tabID == tab[5]) {
  6885. showTab = !showTab;
  6886. } else {
  6887. showTab = true;
  6888. }
  6889. tabID = tab[5];
  6890. needDrawTabArea = true;
  6891. tabAreaAltered = true;
  6892.  
  6893. }
  6894. if (super.saveClickX >= clientWidth - 38
  6895. && super.saveClickX <= clientWidth - 0
  6896. && super.saveClickY >= clientHeight - 72
  6897. && super.saveClickY < clientHeight - 40
  6898. && tabInterfaceIDs[6] != -1) {
  6899. if (tabID == tab[6]) {
  6900. showTab = !showTab;
  6901. } else {
  6902. showTab = true;
  6903. }
  6904. tabID = tab[6];
  6905. needDrawTabArea = true;
  6906. tabAreaAltered = true;
  6907.  
  6908. }
  6909. if (super.saveClickX >= clientWidth - 241
  6910. && super.saveClickX <= clientWidth - 204
  6911. && super.saveClickY >= clientHeight - 37
  6912. && super.saveClickY < clientHeight - 0
  6913. && tabInterfaceIDs[7] != -1) {
  6914. if (tabID == tab[7]) {
  6915. showTab = !showTab;
  6916. } else {
  6917. showTab = true;
  6918. }
  6919. tabID = tab[7];
  6920. needDrawTabArea = true;
  6921. tabAreaAltered = true;
  6922.  
  6923. }
  6924. if (super.saveClickX >= clientWidth - 202
  6925. && super.saveClickX <= clientWidth - 171
  6926. && super.saveClickY >= clientHeight - 37
  6927. && super.saveClickY < clientHeight - 0
  6928. && tabInterfaceIDs[8] != -1) {
  6929. if (tabID == tab[8]) {
  6930. showTab = !showTab;
  6931. } else {
  6932. showTab = true;
  6933. }
  6934. tabID = tab[8];
  6935. needDrawTabArea = true;
  6936. tabAreaAltered = true;
  6937.  
  6938. }
  6939. if (super.saveClickX >= clientWidth - 170
  6940. && super.saveClickX <= clientWidth - 139
  6941. && super.saveClickY >= clientHeight - 37
  6942. && super.saveClickY < clientHeight - 0
  6943. && tabInterfaceIDs[9] != -1) {
  6944. if (tabID == tab[9]) {
  6945. showTab = !showTab;
  6946. } else {
  6947. showTab = true;
  6948. }
  6949. tabID = tab[9];
  6950. needDrawTabArea = true;
  6951. tabAreaAltered = true;
  6952.  
  6953. }
  6954. if (super.saveClickX >= clientWidth - 138
  6955. && super.saveClickX <= clientWidth - 105
  6956. && super.saveClickY >= clientHeight - 37
  6957. && super.saveClickY < clientHeight - 0
  6958. && tabInterfaceIDs[10] != -1) {
  6959. if (tabID == tab[10]) {
  6960. showTab = !showTab;
  6961. } else {
  6962. showTab = true;
  6963. }
  6964. tabID = tab[10];
  6965. needDrawTabArea = true;
  6966. tabAreaAltered = true;
  6967.  
  6968. }
  6969. if (super.saveClickX >= clientWidth - 104
  6970. && super.saveClickX <= clientWidth - 72
  6971. && super.saveClickY >= clientHeight - 37
  6972. && super.saveClickY < clientHeight - 0
  6973. && tabInterfaceIDs[11] != -1) {
  6974. if (tabID == tab[11]) {
  6975. showTab = !showTab;
  6976. } else {
  6977. showTab = true;
  6978. }
  6979. tabID = tab[11];
  6980. needDrawTabArea = true;
  6981. tabAreaAltered = true;
  6982.  
  6983. }
  6984. if (super.saveClickX >= clientWidth - 71
  6985. && super.saveClickX <= clientWidth - 39
  6986. && super.saveClickY >= clientHeight - 37
  6987. && super.saveClickY < clientHeight - 0
  6988. && tabInterfaceIDs[12] != -1) {
  6989. if (tabID == tab[12]) {
  6990. showTab = !showTab;
  6991. } else {
  6992. showTab = true;
  6993. }
  6994. tabID = tab[12];
  6995. needDrawTabArea = true;
  6996. tabAreaAltered = true;
  6997.  
  6998. }
  6999. if (super.saveClickX >= clientWidth - 38
  7000. && super.saveClickX <= clientWidth - 0
  7001. && super.saveClickY >= clientHeight - 37
  7002. && super.saveClickY < clientHeight - 0
  7003. && tabInterfaceIDs[13] != -1) {
  7004. if (tabID == tab[13]) {
  7005. showTab = !showTab;
  7006. } else {
  7007. showTab = true;
  7008. }
  7009. tabID = tab[13];
  7010. needDrawTabArea = true;
  7011. tabAreaAltered = true;
  7012.  
  7013. }
  7014. }
  7015. }
  7016. } if(clientWidth >= smallTabs) {
  7017. if(super.clickMode3 == 1) {
  7018. if (super.saveClickX >= clientWidth - 462
  7019. && super.saveClickX <= clientWidth - 429
  7020. && super.saveClickY >= clientHeight - 37
  7021. && super.saveClickY < clientHeight - 0
  7022. && tabInterfaceIDs[0] != -1) {
  7023. if (tabID == tab[0]) {
  7024. showTab = !showTab;
  7025. } else {
  7026. showTab = true;
  7027. }
  7028. tabID = tab[0];
  7029. needDrawTabArea = true;
  7030. tabAreaAltered = true;
  7031.  
  7032. }
  7033. if (super.saveClickX >= clientWidth - 429
  7034. && super.saveClickX <= clientWidth - 396
  7035. && super.saveClickY >= clientHeight - 37
  7036. && super.saveClickY < clientHeight - 0
  7037. && tabInterfaceIDs[1] != -1) {
  7038. if (tabID == tab[1]) {
  7039. showTab = !showTab;
  7040. } else {
  7041. showTab = true;
  7042. }
  7043. tabID = tab[1];
  7044. needDrawTabArea = true;
  7045. tabAreaAltered = true;
  7046.  
  7047. }
  7048. if (super.saveClickX >= clientWidth - 396
  7049. && super.saveClickX <= clientWidth - 363
  7050. && super.saveClickY >= clientHeight - 37
  7051. && super.saveClickY < clientHeight - 0
  7052. && tabInterfaceIDs[2] != -1) {
  7053. if (tabID == tab[2]) {
  7054. showTab = !showTab;
  7055. } else {
  7056. showTab = true;
  7057. }
  7058. tabID = tab[2];
  7059. needDrawTabArea = true;
  7060. tabAreaAltered = true;
  7061.  
  7062. }
  7063. if (super.saveClickX >= clientWidth - 363
  7064. && super.saveClickX <= clientWidth - 330
  7065. && super.saveClickY >= clientHeight - 37
  7066. && super.saveClickY < clientHeight - 0
  7067. && tabInterfaceIDs[3] != -1) {
  7068. if (tabID == tab[3]) {
  7069. showTab = !showTab;
  7070. } else {
  7071. showTab = true;
  7072. }
  7073. tabID = tab[3];
  7074. needDrawTabArea = true;
  7075. tabAreaAltered = true;
  7076.  
  7077. }
  7078. if (super.saveClickX >= clientWidth - 330
  7079. && super.saveClickX <= clientWidth - 297
  7080. && super.saveClickY >= clientHeight - 37
  7081. && super.saveClickY < clientHeight - 0
  7082. && tabInterfaceIDs[4] != -1) {
  7083. if (tabID == tab[4]) {
  7084. showTab = !showTab;
  7085. } else {
  7086. showTab = true;
  7087. }
  7088. tabID = tab[4];
  7089. needDrawTabArea = true;
  7090. tabAreaAltered = true;
  7091.  
  7092. }
  7093. if (super.saveClickX >= clientWidth - 297
  7094. && super.saveClickX <= clientWidth - 264
  7095. && super.saveClickY >= clientHeight - 37
  7096. && super.saveClickY < clientHeight - 0
  7097. && tabInterfaceIDs[5] != -1) {
  7098. if (tabID == tab[5]) {
  7099. showTab = !showTab;
  7100. } else {
  7101. showTab = true;
  7102. }
  7103. tabID = tab[5];
  7104. needDrawTabArea = true;
  7105. tabAreaAltered = true;
  7106.  
  7107. }
  7108. if (super.saveClickX >= clientWidth - 264
  7109. && super.saveClickX <= clientWidth - 231
  7110. && super.saveClickY >= clientHeight - 37
  7111. && super.saveClickY < clientHeight - 0
  7112. && tabInterfaceIDs[6] != -1) {
  7113. if (tabID == tab[6]) {
  7114. showTab = !showTab;
  7115. } else {
  7116. showTab = true;
  7117. }
  7118. tabID = tab[6];
  7119. needDrawTabArea = true;
  7120. tabAreaAltered = true;
  7121.  
  7122. }
  7123. if (super.saveClickX >= clientWidth - 231
  7124. && super.saveClickX <= clientWidth - 198
  7125. && super.saveClickY >= clientHeight - 37
  7126. && super.saveClickY < clientHeight - 0
  7127. && tabInterfaceIDs[7] != -1) {
  7128. if (tabID == tab[7]) {
  7129. showTab = !showTab;
  7130. } else {
  7131. showTab = true;
  7132. }
  7133. tabID = tab[7];
  7134. needDrawTabArea = true;
  7135. tabAreaAltered = true;
  7136.  
  7137. }
  7138. if (super.saveClickX >= clientWidth - 198
  7139. && super.saveClickX <= clientWidth - 165
  7140. && super.saveClickY >= clientHeight - 37
  7141. && super.saveClickY < clientHeight - 0
  7142. && tabInterfaceIDs[8] != -1) {
  7143. if (tabID == tab[8]) {
  7144. showTab = !showTab;
  7145. } else {
  7146. showTab = true;
  7147. }
  7148. tabID = tab[8];
  7149. needDrawTabArea = true;
  7150. tabAreaAltered = true;
  7151.  
  7152. }
  7153. if (super.saveClickX >= clientWidth - 165
  7154. && super.saveClickX <= clientWidth - 132
  7155. && super.saveClickY >= clientHeight - 37
  7156. && super.saveClickY < clientHeight - 0
  7157. && tabInterfaceIDs[9] != -1) {
  7158. if (tabID == tab[9]) {
  7159. showTab = !showTab;
  7160. } else {
  7161. showTab = true;
  7162. }
  7163. tabID = tab[9];
  7164. needDrawTabArea = true;
  7165. tabAreaAltered = true;
  7166.  
  7167. }
  7168. if (super.saveClickX >= clientWidth - 132
  7169. && super.saveClickX <= clientWidth - 99
  7170. && super.saveClickY >= clientHeight - 37
  7171. && super.saveClickY < clientHeight - 0
  7172. && tabInterfaceIDs[10] != -1) {
  7173. if (tabID == tab[10]) {
  7174. showTab = !showTab;
  7175. } else {
  7176. showTab = true;
  7177. }
  7178. tabID = tab[10];
  7179. needDrawTabArea = true;
  7180. tabAreaAltered = true;
  7181.  
  7182. }
  7183. if (super.saveClickX >= clientWidth - 99
  7184. && super.saveClickX <= clientWidth - 66
  7185. && super.saveClickY >= clientHeight - 37
  7186. && super.saveClickY < clientHeight - 0
  7187. && tabInterfaceIDs[11] != -1) {
  7188. if (tabID == tab[11]) {
  7189. showTab = !showTab;
  7190. } else {
  7191. showTab = true;
  7192. }
  7193. tabID = tab[11];
  7194. needDrawTabArea = true;
  7195. tabAreaAltered = true;
  7196.  
  7197. }
  7198. if (super.saveClickX >= clientWidth - 66
  7199. && super.saveClickX <= clientWidth - 33
  7200. && super.saveClickY >= clientHeight - 37
  7201. && super.saveClickY < clientHeight - 0
  7202. && tabInterfaceIDs[12] != -1) {
  7203. if (tabID == tab[12]) {
  7204. showTab = !showTab;
  7205. } else {
  7206. showTab = true;
  7207. }
  7208. tabID = tab[12];
  7209. needDrawTabArea = true;
  7210. tabAreaAltered = true;
  7211.  
  7212. }
  7213. if (super.saveClickX >= clientWidth - 33
  7214. && super.saveClickX <= clientWidth - 0
  7215. && super.saveClickY >= clientHeight - 37
  7216. && super.saveClickY < clientHeight - 0
  7217. && tabInterfaceIDs[13] != -1) {
  7218. if (tabID == tab[13]) {
  7219. showTab = !showTab;
  7220. } else {
  7221. showTab = true;
  7222. }
  7223. tabID = tab[13];
  7224. needDrawTabArea = true;
  7225. tabAreaAltered = true;
  7226. }
  7227. }
  7228. }
  7229. }
  7230.  
  7231. private void resetImageProducers2() {
  7232. if (aRSImageProducer_1166 != null)
  7233. return;
  7234. nullLoader();
  7235. super.fullGameScreen = null;
  7236. aRSImageProducer_1107 = null;
  7237. aRSImageProducer_1108 = null;
  7238. aRSImageProducer_1109 = null;
  7239. aRSImageProducer_1110 = null;
  7240. aRSImageProducer_1111 = null;
  7241. aRSImageProducer_1112 = null;
  7242. aRSImageProducer_1113 = null;
  7243. aRSImageProducer_1114 = null;
  7244. aRSImageProducer_1115 = null;
  7245. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  7246. getGameComponent());
  7247. aRSImageProducer_1164 = new RSImageProducer(246, 168,
  7248. getGameComponent());
  7249. DrawingArea.setAllPixelsToZero();
  7250. mapArea.drawSprite(0, 0);
  7251. aRSImageProducer_1163 = new RSImageProducer(249, 335,
  7252. getGameComponent());
  7253. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  7254. getGameComponent());
  7255. DrawingArea.setAllPixelsToZero();
  7256. new RSImageProducer(496, 50, getGameComponent());
  7257. new RSImageProducer(269, 37, getGameComponent());
  7258. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7259. welcomeScreenRaised = true;
  7260. }
  7261.  
  7262. public String getDocumentBaseHost() {
  7263. if (signlink.mainapp != null) {
  7264. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7265. }
  7266. if (super.gameFrame != null) {
  7267. return ""; // runescape.com <- removed for Jframe to work
  7268. } else {
  7269. return ""; // super.getDocumentBase().getHost().toLowerCase() <-
  7270. // removed for Jframe to work
  7271. }
  7272. }
  7273.  
  7274. private void method81(Sprite sprite, int j, int k) {
  7275. int l = k * k + j * j;
  7276. if(l > 4225 && l < 0x15f90) {
  7277. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  7278. int j1 = Model.modelIntArray1[i1];
  7279. int k1 = Model.modelIntArray2[i1];
  7280. j1 = (j1 * 256) / (minimapInt3 + 256);
  7281. k1 = (k1 * 256) / (minimapInt3 + 256);
  7282. int l1 = j * j1 + k * k1 >> 16;
  7283. int i2 = j * k1 - k * j1 >> 16;
  7284. double d = Math.atan2(l1, i2);
  7285. int j2 = (int)(Math.sin(d) * 63D);
  7286. int k2 = (int)(Math.cos(d) * 57D);
  7287. mapEdge.method353((clientSize == 0 ? 86 : 89) - k2 - 20, d, ((clientSize == 0 ? 131 : clientWidth + 131 - 238) + j2) - 10 - 5);
  7288. } else {
  7289. markMinimap(sprite, k, j);
  7290. }
  7291. }
  7292.  
  7293. private void rightClickChatButtons() {
  7294. int y = 0;
  7295. if (clientSize != 0) {
  7296. y = clientHeight - 503;
  7297. }
  7298. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7299. menuActionName[1] = "View All";
  7300. menuActionID[1] = 999;
  7301. menuActionRow = 2;
  7302. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7303. menuActionName[1] = "View Game";
  7304. menuActionID[1] = 998;
  7305. menuActionRow = 2;
  7306. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7307. menuActionName[1] = "Hide public";
  7308. menuActionID[1] = 997;
  7309. menuActionName[2] = "Off public";
  7310. menuActionID[2] = 996;
  7311. menuActionName[3] = "Friends public";
  7312. menuActionID[3] = 995;
  7313. menuActionName[4] = "On public";
  7314. menuActionID[4] = 994;
  7315. menuActionName[5] = "View public";
  7316. menuActionID[5] = 993;
  7317. menuActionRow = 6;
  7318. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7319. menuActionName[1] = "Off private";
  7320. menuActionID[1] = 992;
  7321. menuActionName[2] = "Friends private";
  7322. menuActionID[2] = 991;
  7323. menuActionName[3] = "On private";
  7324. menuActionID[3] = 990;
  7325. menuActionName[4] = "View private";
  7326. menuActionID[4] = 989;
  7327. menuActionRow = 5;
  7328. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7329. menuActionName[1] = "Off clan chat";
  7330. menuActionID[1] = 1003;
  7331. menuActionName[2] = "Friends clan chat";
  7332. menuActionID[2] = 1002;
  7333. menuActionName[3] = "On clan chat";
  7334. menuActionID[3] = 1001;
  7335. menuActionName[4] = "View clan chat";
  7336. menuActionID[4] = 1000;
  7337. menuActionRow = 5;
  7338. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7339. menuActionName[1] = "Off trade";
  7340. menuActionID[1] = 987;
  7341. menuActionName[2] = "Friends trade";
  7342. menuActionID[2] = 986;
  7343. menuActionName[3] = "On trade";
  7344. menuActionID[3] = 985;
  7345. menuActionName[4] = "View trade";
  7346. menuActionID[4] = 984;
  7347. menuActionRow = 5;
  7348. }
  7349. }
  7350.  
  7351.  
  7352. public void processRightClick() {
  7353. if (activeInterfaceType != 0) {
  7354. return;
  7355. }
  7356. menuActionName[0] = "Cancel";
  7357. menuActionID[0] = 1107;
  7358. menuActionRow = 1;
  7359. if (fullscreenInterfaceID != -1) {
  7360. anInt886 = 0;
  7361. anInt1315 = 0;
  7362. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  7363. if (anInt886 != anInt1026) {
  7364. anInt1026 = anInt886;
  7365. }
  7366. if (anInt1315 != anInt1129) {
  7367. anInt1129 = anInt1315;
  7368. }
  7369. return;
  7370. }
  7371. buildSplitPrivateChatMenu();
  7372. anInt886 = 0;
  7373. anInt1315 = 0;
  7374. if (clientSize == 0) {
  7375. if (super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516 && super.mouseY < 338)
  7376. if (openInterfaceID != -1)
  7377. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7378. else
  7379. build3dScreenMenu();
  7380. } else if (clientSize != 0) {
  7381. if (canClick())
  7382. if (super.mouseX > (clientWidth / 2) - 356 && super.mouseY > (clientHeight / 2) - 230 && super.mouseX < ((clientWidth / 2) + 356) && super.mouseY < (clientHeight / 2) + 230 && openInterfaceID != -1)
  7383. buildInterfaceMenu((clientWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], super.mouseX, (clientHeight / 2) - 230, super.mouseY, 0);
  7384. else
  7385. build3dScreenMenu();
  7386. }
  7387. if (anInt886 != anInt1026) {
  7388. anInt1026 = anInt886;
  7389. }
  7390. if (anInt1315 != anInt1129) {
  7391. anInt1129 = anInt1315;
  7392. }
  7393. anInt886 = 0;
  7394. anInt1315 = 0;
  7395. if (clientSize == 0) {
  7396. if (super.mouseX > clientWidth - 218 && super.mouseY > clientHeight - 298 && super.mouseX < clientWidth - 25 && super.mouseY < clientHeight - 35) {
  7397. if (invOverlayInterfaceID != -1)
  7398. buildInterfaceMenu(clientWidth - 218, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, clientHeight - 298, super.mouseY, 0);
  7399. else if (tabInterfaceIDs[tabID] != -1)
  7400. buildInterfaceMenu(clientWidth - 218, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, clientHeight - 298, super.mouseY, 0);
  7401. }
  7402. } else if (clientSize != 0) {
  7403. int y = clientWidth > 1000 ? 37 : 74;
  7404. if(clientWidth > 1000) {
  7405. if (super.mouseX > clientWidth - 197 && super.mouseY > clientHeight - y - 267 && super.mouseX < clientWidth - 7 && super.mouseY < clientHeight - y - 7 && showTab) {
  7406. if (invOverlayInterfaceID != -1) {
  7407. buildInterfaceMenu(clientWidth - 197,
  7408. RSInterface.interfaceCache[invOverlayInterfaceID],
  7409. super.mouseX, clientHeight - 304, super.mouseY,
  7410. 0);
  7411. } else if (tabInterfaceIDs[tabID] != -1) {
  7412. buildInterfaceMenu(clientWidth - 197,
  7413. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  7414. super.mouseX, clientHeight - 304, super.mouseY,
  7415. 0);
  7416. }
  7417. }
  7418. } if(clientWidth <= 1000) {
  7419. if (super.mouseX > clientWidth - 211 && super.mouseY > clientHeight - y - 267 && super.mouseX < clientWidth - 7 && super.mouseY < clientHeight - y - 7 && showTab) {
  7420. if (invOverlayInterfaceID != -1) {
  7421. buildInterfaceMenu(clientWidth - 211,
  7422. RSInterface.interfaceCache[invOverlayInterfaceID],
  7423. super.mouseX, clientHeight - y - 267, super.mouseY,
  7424. 0);
  7425. } else if (tabInterfaceIDs[tabID] != -1) {
  7426. buildInterfaceMenu(clientWidth - 211,
  7427. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  7428. super.mouseX, clientHeight - y - 267, super.mouseY,
  7429. 0);
  7430. }
  7431. }
  7432. }
  7433. }
  7434. if (anInt886 != anInt1048) {
  7435. needDrawTabArea = true;
  7436. tabAreaAltered = true;
  7437. anInt1048 = anInt886;
  7438. }
  7439. if (anInt1315 != anInt1044) {
  7440. needDrawTabArea = true;
  7441. tabAreaAltered = true;
  7442. anInt1044 = anInt1315;
  7443. }
  7444. anInt886 = 0;
  7445. anInt1315 = 0;
  7446. if (super.mouseX > 0 && super.mouseY > (clientSize == 0 ? 338 : clientHeight - 165) && super.mouseX < 490 && super.mouseY < (clientSize == 0 ? 463 : clientHeight - 40) && showChat) {
  7447. if (backDialogID != -1) {
  7448. buildInterfaceMenu(20,
  7449. RSInterface.interfaceCache[backDialogID], super.mouseX, (clientSize == 0 ? 358 : clientHeight - 145),
  7450. super.mouseY, 0);
  7451. } else if (super.mouseY < (clientSize == 0 ? 463 : clientHeight - 40) && super.mouseX < 490) {
  7452. buildChatAreaMenu(super.mouseY - (clientSize == 0 ? 338 : clientHeight - 165));
  7453. }
  7454. }
  7455. if (backDialogID != -1 && anInt886 != anInt1039) {
  7456. inputTaken = true;
  7457. anInt1039 = anInt886;
  7458. }
  7459. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7460. inputTaken = true;
  7461. anInt1500 = anInt1315;
  7462. }
  7463. if (super.mouseX > 0 && super.mouseY > clientHeight - 165 && super.mouseX < 519 && super.mouseY < clientHeight)
  7464. rightClickChatButtons();
  7465. boolean flag = false;
  7466. while (!flag) {
  7467. flag = true;
  7468. for (int j = 0; j < menuActionRow - 1; j++) {
  7469. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7470. String s = menuActionName[j];
  7471. menuActionName[j] = menuActionName[j + 1];
  7472. menuActionName[j + 1] = s;
  7473. int k = menuActionID[j];
  7474. menuActionID[j] = menuActionID[j + 1];
  7475. menuActionID[j + 1] = k;
  7476. k = menuActionCmd2[j];
  7477. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7478. menuActionCmd2[j + 1] = k;
  7479. k = menuActionCmd3[j];
  7480. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7481. menuActionCmd3[j + 1] = k;
  7482. k = menuActionCmd1[j];
  7483. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7484. menuActionCmd1[j + 1] = k;
  7485. flag = false;
  7486. }
  7487. }
  7488. }
  7489. }
  7490.  
  7491. private int method83(int i, int j, int k) {
  7492. int l = 256 - k;
  7493. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  7494. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7495. }
  7496.  
  7497. private void login(String s, String s1, boolean flag) {
  7498. signlink.errorname = s;
  7499. try {
  7500. if(RemberMeSelected == 1) {
  7501. writeSettings();
  7502. }
  7503. if (!flag) {
  7504. loginMessage1 = "";
  7505. loginMessage2 = "Connecting to server...";
  7506. drawLoginScreen(true);
  7507. }
  7508. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7509. long l = TextClass.longForName(s);
  7510. int i = (int) (l >> 16 & 31L);
  7511. stream.currentOffset = 0;
  7512. stream.writeWordBigEndian(14);
  7513. stream.writeWordBigEndian(i);
  7514. socketStream.queueBytes(2, stream.buffer);
  7515. for (int j = 0; j < 8; j++)
  7516. socketStream.read();
  7517.  
  7518. int k = socketStream.read();
  7519. int i1 = k;
  7520. if (k == 0) {
  7521. socketStream.flushInputStream(inStream.buffer, 8);
  7522. inStream.currentOffset = 0;
  7523. aLong1215 = inStream.readQWord();
  7524. int ai[] = new int[4];
  7525. ai[0] = (int) (Math.random() * 99999999D);
  7526. ai[1] = (int) (Math.random() * 99999999D);
  7527. ai[2] = (int) (aLong1215 >> 32);
  7528. ai[3] = (int) aLong1215;
  7529. stream.currentOffset = 0;
  7530. stream.writeWordBigEndian(10);
  7531. stream.writeDWord(ai[0]);
  7532. stream.writeDWord(ai[1]);
  7533. stream.writeDWord(ai[2]);
  7534. stream.writeDWord(ai[3]);
  7535. stream.writeDWord(signlink.uid);
  7536. stream.writeString(s);
  7537. stream.writeString(s1);
  7538. stream.doKeys();
  7539. aStream_847.currentOffset = 0;
  7540. if (flag)
  7541. aStream_847.writeWordBigEndian(18);
  7542. else
  7543. aStream_847.writeWordBigEndian(16);
  7544. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  7545. + 1 + 2);
  7546. aStream_847.writeWordBigEndian(255);
  7547. aStream_847.writeWord(signlink.clientVersion);
  7548. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7549. for (int l1 = 0; l1 < 9; l1++)
  7550. aStream_847.writeDWord(expectedCRCs[l1]);
  7551.  
  7552. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7553. stream.encryption = new ISAACRandomGen(ai);
  7554. for (int j2 = 0; j2 < 4; j2++)
  7555. ai[j2] += 50;
  7556.  
  7557. encryption = new ISAACRandomGen(ai);
  7558. socketStream.queueBytes(aStream_847.currentOffset,
  7559. aStream_847.buffer);
  7560. k = socketStream.read();
  7561. }
  7562. if (k == 1) {
  7563. try {
  7564. Thread.sleep(2000L);
  7565. } catch (Exception _ex) {
  7566. }
  7567. login(s, s1, flag);
  7568. return;
  7569. }
  7570. if (k == 2) {
  7571. myPrivilege = socketStream.read();
  7572. flagged = socketStream.read() == 1;
  7573. aLong1220 = 0L;
  7574. anInt1022 = 0;
  7575. mouseDetection.coordsIndex = 0;
  7576. super.awtFocus = true;
  7577. aBoolean954 = true;
  7578. loggedIn = true;
  7579. stream.currentOffset = 0;
  7580. inStream.currentOffset = 0;
  7581. pktType = -1;
  7582. anInt841 = -1;
  7583. anInt842 = -1;
  7584. anInt843 = -1;
  7585. pktSize = 0;
  7586. anInt1009 = 0;
  7587. anInt1104 = 0;
  7588. anInt1011 = 0;
  7589. anInt855 = 0;
  7590. menuActionRow = 0;
  7591. menuOpen = false;
  7592. super.idleTime = 0;
  7593. for (int j1 = 0; j1 < 100; j1++)
  7594. chatMessages[j1] = null;
  7595.  
  7596. itemSelected = 0;
  7597. spellSelected = 0;
  7598. loadingStage = 0;
  7599. anInt1062 = 0;
  7600. anInt1278 = (int) (Math.random() * 100D) - 50;
  7601. anInt1131 = (int) (Math.random() * 110D) - 55;
  7602. anInt896 = (int) (Math.random() * 80D) - 40;
  7603. minimapInt2 = (int) (Math.random() * 120D) - 60;
  7604. minimapInt3 = (int) (Math.random() * 30D) - 20;
  7605. minimapInt1 = (int) (Math.random() * 20D) - 10 & 0x7ff;
  7606. anInt1021 = 0;
  7607. anInt985 = -1;
  7608. destX = 0;
  7609. destY = 0;
  7610. playerCount = 0;
  7611. npcCount = 0;
  7612. for (int i2 = 0; i2 < maxPlayers; i2++) {
  7613. playerArray[i2] = null;
  7614. aStreamArray895s[i2] = null;
  7615. }
  7616.  
  7617. for (int k2 = 0; k2 < 16384; k2++)
  7618. npcArray[k2] = null;
  7619.  
  7620. myPlayer = playerArray[myPlayerIndex] = new Player();
  7621. aClass19_1013.removeAll();
  7622. aClass19_1056.removeAll();
  7623. for (int l2 = 0; l2 < 4; l2++) {
  7624. for (int i3 = 0; i3 < 104; i3++) {
  7625. for (int k3 = 0; k3 < 104; k3++)
  7626. groundArray[l2][i3][k3] = null;
  7627.  
  7628. }
  7629.  
  7630. }
  7631.  
  7632. aClass19_1179 = new NodeList();
  7633. fullscreenInterfaceID = -1;
  7634. anInt900 = 0;
  7635. friendsCount = 0;
  7636. dialogID = -1;
  7637. backDialogID = -1;
  7638. openInterfaceID = -1;
  7639. invOverlayInterfaceID = -1;
  7640. anInt1018 = -1;
  7641. aBoolean1149 = false;
  7642. tabID = 3;
  7643. inputDialogState = 0;
  7644. menuOpen = false;
  7645. messagePromptRaised = false;
  7646. aString844 = null;
  7647. anInt1055 = 0;
  7648. anInt1054 = -1;
  7649. aBoolean1047 = true;
  7650. method45();
  7651. for (int j3 = 0; j3 < 5; j3++)
  7652. anIntArray990[j3] = 0;
  7653.  
  7654. for (int l3 = 0; l3 < 5; l3++) {
  7655. atPlayerActions[l3] = null;
  7656. atPlayerArray[l3] = false;
  7657. }
  7658.  
  7659. anInt1175 = 0;
  7660. anInt1134 = 0;
  7661. anInt986 = 0;
  7662. anInt1288 = 0;
  7663. anInt924 = 0;
  7664. anInt1188 = 0;
  7665. anInt1155 = 0;
  7666. anInt1226 = 0;
  7667. resetImageProducers2();
  7668. return;
  7669. }
  7670. if (k == 3) {
  7671. loginMessage1 = "";
  7672. loginMessage2 = "Invalid username or password.";
  7673. return;
  7674. }
  7675. if (k == 4) {
  7676. loginMessage1 = "Your account has been disabled.";
  7677. loginMessage2 = "Please check your message-center for details.";
  7678. return;
  7679. }
  7680. if (k == 5) {
  7681. loginMessage1 = "Your account is already logged in.";
  7682. loginMessage2 = "Try again in 60 secs...";
  7683. return;
  7684. }
  7685. if (k == 6) {
  7686. loginMessage1 = "Phantom PKs has been updated!";
  7687. loginMessage2 = "Please reload this page.";
  7688. return;
  7689. }
  7690. if (k == 7) {
  7691. loginMessage1 = "This world is full.";
  7692. loginMessage2 = "Please use a different world.";
  7693. return;
  7694. }
  7695. if (k == 8) {
  7696. loginMessage1 = "Unable to connect.";
  7697. loginMessage2 = "Login server offline.";
  7698. return;
  7699. }
  7700. if (k == 9) {
  7701. loginMessage1 = "Login limit exceeded.";
  7702. loginMessage2 = "Too many connections from your address.";
  7703. return;
  7704. }
  7705. if (k == 10) {
  7706. loginMessage1 = "Unable to connect.";
  7707. loginMessage2 = "Bad session id.";
  7708. return;
  7709. }
  7710. if (k == 11) {
  7711. loginMessage2 = "Login server rejected session.";
  7712. loginMessage2 = "Please try again.";
  7713. return;
  7714. }
  7715. if (k == 12) {
  7716. loginMessage1 = "You need a members account to login to this world.";
  7717. loginMessage2 = "Please subscribe, or use a different world.";
  7718. return;
  7719. }
  7720. if (k == 13) {
  7721. loginMessage1 = "Could not complete login.";
  7722. loginMessage2 = "Please try using a different world.";
  7723. return;
  7724. }
  7725. if (k == 14) {
  7726. loginMessage1 = "The server is being updated.";
  7727. loginMessage2 = "Please wait 1 minute and try again.";
  7728. return;
  7729. }
  7730. if (k == 15) {
  7731. loggedIn = true;
  7732. stream.currentOffset = 0;
  7733. inStream.currentOffset = 0;
  7734. pktType = -1;
  7735. anInt841 = -1;
  7736. anInt842 = -1;
  7737. anInt843 = -1;
  7738. pktSize = 0;
  7739. anInt1009 = 0;
  7740. anInt1104 = 0;
  7741. menuActionRow = 0;
  7742. menuOpen = false;
  7743. aLong824 = System.currentTimeMillis();
  7744. return;
  7745. }
  7746. if (k == 16) {
  7747. loginMessage1 = "Login attempts exceeded.";
  7748. loginMessage2 = "Please wait 1 minute and try again.";
  7749. return;
  7750. }
  7751. if (k == 17) {
  7752. loginMessage1 = "You are standing in a members-only area.";
  7753. loginMessage2 = "To play on this world move to a free area first";
  7754. return;
  7755. }
  7756. if (k == 20) {
  7757. loginMessage1 = "Invalid loginserver requested";
  7758. loginMessage2 = "Please try using a different world.";
  7759. return;
  7760. }
  7761. if (k == 21) {
  7762. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  7763. loginMessage1 = "You have only just left another world";
  7764. loginMessage2 = "Your profile will be transferred in: "
  7765. + k1 + " seconds";
  7766. drawLoginScreen(true);
  7767. try {
  7768. Thread.sleep(1000L);
  7769. } catch (Exception _ex) {
  7770. }
  7771. }
  7772.  
  7773. login(s, s1, flag);
  7774. return;
  7775. }
  7776. if (k == -1) {
  7777. if (i1 == 0) {
  7778. if (loginFailures < 2) {
  7779. try {
  7780. Thread.sleep(2000L);
  7781. } catch (Exception _ex) {
  7782. }
  7783. loginFailures++;
  7784. login(s, s1, flag);
  7785. return;
  7786. } else {
  7787. loginMessage1 = "No response from loginserver";
  7788. loginMessage2 = "Please wait 1 minute and try again.";
  7789. return;
  7790. }
  7791. } else {
  7792. loginMessage1 = "No response from server";
  7793. loginMessage2 = "Please try using a different world.";
  7794. return;
  7795. }
  7796. } else {
  7797. System.out.println("response:" + k);
  7798. loginMessage1 = "Unexpected server response";
  7799. loginMessage2 = "Please try using a different world.";
  7800. return;
  7801. }
  7802. } catch (IOException _ex) {
  7803. loginMessage1 = "";
  7804. }
  7805. loginMessage2 = "Error connecting to server.";
  7806. }
  7807.  
  7808. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  7809. int l1, int i2, int j2, boolean flag, int k2) {
  7810. byte byte0 = 104;
  7811. byte byte1 = 104;
  7812. for (int l2 = 0; l2 < byte0; l2++) {
  7813. for (int i3 = 0; i3 < byte1; i3++) {
  7814. anIntArrayArray901[l2][i3] = 0;
  7815. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7816. }
  7817. }
  7818. int j3 = j2;
  7819. int k3 = j1;
  7820. anIntArrayArray901[j2][j1] = 99;
  7821. anIntArrayArray825[j2][j1] = 0;
  7822. int l3 = 0;
  7823. int i4 = 0;
  7824. bigX[l3] = j2;
  7825. bigY[l3++] = j1;
  7826. boolean flag1 = false;
  7827. int j4 = bigX.length;
  7828. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7829. while (i4 != l3) {
  7830. j3 = bigX[i4];
  7831. k3 = bigY[i4];
  7832. i4 = (i4 + 1) % j4;
  7833. if (j3 == k2 && k3 == i2) {
  7834. flag1 = true;
  7835. break;
  7836. }
  7837. if (i1 != 0) {
  7838. if ((i1 < 5 || i1 == 10)
  7839. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  7840. i1 - 1, i2)) {
  7841. flag1 = true;
  7842. break;
  7843. }
  7844. if (i1 < 10
  7845. && aClass11Array1230[plane].method220(k2, i2, k3,
  7846. i1 - 1, j, j3)) {
  7847. flag1 = true;
  7848. break;
  7849. }
  7850. }
  7851. if (k1 != 0
  7852. && k != 0
  7853. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  7854. k1, k3)) {
  7855. flag1 = true;
  7856. break;
  7857. }
  7858. int l4 = anIntArrayArray825[j3][k3] + 1;
  7859. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  7860. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  7861. bigX[l3] = j3 - 1;
  7862. bigY[l3] = k3;
  7863. l3 = (l3 + 1) % j4;
  7864. anIntArrayArray901[j3 - 1][k3] = 2;
  7865. anIntArrayArray825[j3 - 1][k3] = l4;
  7866. }
  7867. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  7868. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  7869. bigX[l3] = j3 + 1;
  7870. bigY[l3] = k3;
  7871. l3 = (l3 + 1) % j4;
  7872. anIntArrayArray901[j3 + 1][k3] = 8;
  7873. anIntArrayArray825[j3 + 1][k3] = l4;
  7874. }
  7875. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  7876. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7877. bigX[l3] = j3;
  7878. bigY[l3] = k3 - 1;
  7879. l3 = (l3 + 1) % j4;
  7880. anIntArrayArray901[j3][k3 - 1] = 1;
  7881. anIntArrayArray825[j3][k3 - 1] = l4;
  7882. }
  7883. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  7884. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7885. bigX[l3] = j3;
  7886. bigY[l3] = k3 + 1;
  7887. l3 = (l3 + 1) % j4;
  7888. anIntArrayArray901[j3][k3 + 1] = 4;
  7889. anIntArrayArray825[j3][k3 + 1] = l4;
  7890. }
  7891. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  7892. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  7893. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7894. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7895. bigX[l3] = j3 - 1;
  7896. bigY[l3] = k3 - 1;
  7897. l3 = (l3 + 1) % j4;
  7898. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7899. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7900. }
  7901. if (j3 < byte0 - 1 && k3 > 0
  7902. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  7903. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  7904. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7905. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7906. bigX[l3] = j3 + 1;
  7907. bigY[l3] = k3 - 1;
  7908. l3 = (l3 + 1) % j4;
  7909. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7910. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7911. }
  7912. if (j3 > 0 && k3 < byte1 - 1
  7913. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  7914. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  7915. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7916. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7917. bigX[l3] = j3 - 1;
  7918. bigY[l3] = k3 + 1;
  7919. l3 = (l3 + 1) % j4;
  7920. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7921. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7922. }
  7923. if (j3 < byte0 - 1 && k3 < byte1 - 1
  7924. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  7925. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  7926. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7927. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7928. bigX[l3] = j3 + 1;
  7929. bigY[l3] = k3 + 1;
  7930. l3 = (l3 + 1) % j4;
  7931. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7932. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7933. }
  7934. }
  7935. anInt1264 = 0;
  7936. if (!flag1) {
  7937. if (flag) {
  7938. int i5 = 100;
  7939. for (int k5 = 1; k5 < 2; k5++) {
  7940. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  7941. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7942. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  7943. && anIntArrayArray825[i6][l6] < i5) {
  7944. i5 = anIntArrayArray825[i6][l6];
  7945. j3 = i6;
  7946. k3 = l6;
  7947. anInt1264 = 1;
  7948. flag1 = true;
  7949. }
  7950.  
  7951. }
  7952.  
  7953. if (flag1)
  7954. break;
  7955. }
  7956.  
  7957. }
  7958. if (!flag1)
  7959. return false;
  7960. }
  7961. i4 = 0;
  7962. bigX[i4] = j3;
  7963. bigY[i4++] = k3;
  7964. int l5;
  7965. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  7966. if (j5 != l5) {
  7967. l5 = j5;
  7968. bigX[i4] = j3;
  7969. bigY[i4++] = k3;
  7970. }
  7971. if ((j5 & 2) != 0)
  7972. j3++;
  7973. else if ((j5 & 8) != 0)
  7974. j3--;
  7975. if ((j5 & 1) != 0)
  7976. k3++;
  7977. else if ((j5 & 4) != 0)
  7978. k3--;
  7979. }
  7980. // if(cancelWalk) { return i4 > 0; }
  7981. if (i4 > 0) {
  7982. int k4 = i4;
  7983. if (k4 > 25)
  7984. k4 = 25;
  7985. i4--;
  7986. int k6 = bigX[i4];
  7987. int i7 = bigY[i4];
  7988. anInt1288 += k4;
  7989. if (anInt1288 >= 92) {
  7990. stream.createFrame(36);
  7991. stream.writeDWord(0);
  7992. anInt1288 = 0;
  7993. }
  7994. if (i == 0) {
  7995. stream.createFrame(164);
  7996. stream.writeWordBigEndian(k4 + k4 + 3);
  7997. }
  7998. if (i == 1) {
  7999. stream.createFrame(248);
  8000. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8001. }
  8002. if (i == 2) {
  8003. stream.createFrame(98);
  8004. stream.writeWordBigEndian(k4 + k4 + 3);
  8005. }
  8006. stream.method433(k6 + baseX);
  8007. destX = bigX[0];
  8008. destY = bigY[0];
  8009. for (int j7 = 1; j7 < k4; j7++) {
  8010. i4--;
  8011. stream.writeWordBigEndian(bigX[i4] - k6);
  8012. stream.writeWordBigEndian(bigY[i4] - i7);
  8013. }
  8014.  
  8015. stream.method431(i7 + baseY);
  8016. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8017. return true;
  8018. }
  8019. return i != 1;
  8020. }
  8021.  
  8022. private void method86(Stream stream) {
  8023. for (int j = 0; j < anInt893; j++) {
  8024. int k = anIntArray894[j];
  8025. NPC npc = npcArray[k];
  8026. int l = stream.readUnsignedByte();
  8027. if ((l & 0x10) != 0) {
  8028. int i1 = stream.method434();
  8029. if (i1 == 65535)
  8030. i1 = -1;
  8031. int i2 = stream.readUnsignedByte();
  8032. if (i1 == npc.anim && i1 != -1) {
  8033. int l2 = Animation.anims[i1].anInt365;
  8034. if (l2 == 1) {
  8035. npc.anInt1527 = 0;
  8036. npc.anInt1528 = 0;
  8037. npc.anInt1529 = i2;
  8038. npc.anInt1530 = 0;
  8039. }
  8040. if (l2 == 2)
  8041. npc.anInt1530 = 0;
  8042. } else if (i1 == -1
  8043. || npc.anim == -1
  8044. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  8045. npc.anim = i1;
  8046. npc.anInt1527 = 0;
  8047. npc.anInt1528 = 0;
  8048. npc.anInt1529 = i2;
  8049. npc.anInt1530 = 0;
  8050. npc.anInt1542 = npc.smallXYIndex;
  8051. }
  8052. }
  8053. if ((l & 8) != 0) {
  8054. int j1 = stream.method426();
  8055. int j2 = stream.method427();
  8056. npc.updateHitData(j2, j1, loopCycle);
  8057. npc.loopCycleStatus = loopCycle + 300;
  8058. npc.currentHealth = stream.method426();
  8059. npc.maxHealth = stream.readUnsignedByte();
  8060. }
  8061. if ((l & 0x80) != 0) {
  8062. npc.anInt1520 = stream.readUnsignedWord();
  8063. int k1 = stream.readDWord();
  8064. npc.anInt1524 = k1 >> 16;
  8065. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8066. npc.anInt1521 = 0;
  8067. npc.anInt1522 = 0;
  8068. if (npc.anInt1523 > loopCycle)
  8069. npc.anInt1521 = -1;
  8070. if (npc.anInt1520 == 65535)
  8071. npc.anInt1520 = -1;
  8072. }
  8073. if ((l & 0x20) != 0) {
  8074. npc.interactingEntity = stream.readUnsignedWord();
  8075. if (npc.interactingEntity == 65535)
  8076. npc.interactingEntity = -1;
  8077. }
  8078. if ((l & 1) != 0) {
  8079. npc.textSpoken = stream.readString();
  8080. npc.textCycle = 100;
  8081. // entityMessage(npc);
  8082. }
  8083. if ((l & 0x40) != 0) {
  8084. int l1 = stream.method427();
  8085. int k2 = stream.method428();
  8086. npc.updateHitData(k2, l1, loopCycle);
  8087. npc.loopCycleStatus = loopCycle + 300;
  8088. npc.currentHealth = stream.method428();
  8089. npc.maxHealth = stream.method427();
  8090. }
  8091. if ((l & 2) != 0) {
  8092. npc.desc = EntityDef.forID(stream.method436());
  8093. npc.anInt1540 = npc.desc.aByte68;
  8094. npc.anInt1504 = npc.desc.anInt79;
  8095. npc.anInt1554 = npc.desc.walkAnim;
  8096. npc.anInt1555 = npc.desc.anInt58;
  8097. npc.anInt1556 = npc.desc.anInt83;
  8098. npc.anInt1557 = npc.desc.anInt55;
  8099. npc.anInt1511 = npc.desc.standAnim;
  8100. }
  8101. if ((l & 4) != 0) {
  8102. npc.anInt1538 = stream.method434();
  8103. npc.anInt1539 = stream.method434();
  8104. }
  8105. }
  8106. }
  8107.  
  8108. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  8109. if (menuActionRow >= 400)
  8110. return;
  8111. if (entityDef.childrenIDs != null)
  8112. entityDef = entityDef.method161();
  8113. if (entityDef == null)
  8114. return;
  8115. if (!entityDef.aBoolean84)
  8116. return;
  8117. String s = entityDef.name;
  8118. if (entityDef.combatLevel != 0)
  8119. s = s
  8120. + combatDiffColor(myPlayer.combatLevel,
  8121. entityDef.combatLevel) + " (level-"
  8122. + entityDef.combatLevel + ")";
  8123. if (itemSelected == 1) {
  8124. menuActionName[menuActionRow] = "Use " + selectedItemName
  8125. + " with @yel@" + s;
  8126. menuActionID[menuActionRow] = 582;
  8127. menuActionCmd1[menuActionRow] = i;
  8128. menuActionCmd2[menuActionRow] = k;
  8129. menuActionCmd3[menuActionRow] = j;
  8130. menuActionRow++;
  8131. return;
  8132. }
  8133. if (spellSelected == 1) {
  8134. if ((spellUsableOn & 2) == 2) {
  8135. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8136. menuActionID[menuActionRow] = 413;
  8137. menuActionCmd1[menuActionRow] = i;
  8138. menuActionCmd2[menuActionRow] = k;
  8139. menuActionCmd3[menuActionRow] = j;
  8140. menuActionRow++;
  8141. }
  8142. } else {
  8143. if (entityDef.actions != null) {
  8144. for (int l = 4; l >= 0; l--)
  8145. if (entityDef.actions[l] != null
  8146. && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  8147. menuActionName[menuActionRow] = entityDef.actions[l]
  8148. + " @yel@" + s;
  8149. if (l == 0)
  8150. menuActionID[menuActionRow] = 20;
  8151. if (l == 1)
  8152. menuActionID[menuActionRow] = 412;
  8153. if (l == 2)
  8154. menuActionID[menuActionRow] = 225;
  8155. if (l == 3)
  8156. menuActionID[menuActionRow] = 965;
  8157. if (l == 4)
  8158. menuActionID[menuActionRow] = 478;
  8159. menuActionCmd1[menuActionRow] = i;
  8160. menuActionCmd2[menuActionRow] = k;
  8161. menuActionCmd3[menuActionRow] = j;
  8162. menuActionRow++;
  8163. }
  8164.  
  8165. }
  8166. if (entityDef.actions != null) {
  8167. for (int i1 = 4; i1 >= 0; i1--)
  8168. if (entityDef.actions[i1] != null
  8169. && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  8170. char c = '\0';
  8171. if (!isOneClick) {
  8172. if (entityDef.combatLevel > myPlayer.combatLevel)
  8173. c = '\u07D0';
  8174. }
  8175. menuActionName[menuActionRow] = entityDef.actions[i1]
  8176. + " @yel@" + s;
  8177. if (i1 == 0)
  8178. menuActionID[menuActionRow] = 20 + c;
  8179. if (i1 == 1)
  8180. menuActionID[menuActionRow] = 412 + c;
  8181. if (i1 == 2)
  8182. menuActionID[menuActionRow] = 225 + c;
  8183. if (i1 == 3)
  8184. menuActionID[menuActionRow] = 965 + c;
  8185. if (i1 == 4)
  8186. menuActionID[menuActionRow] = 478 + c;
  8187. menuActionCmd1[menuActionRow] = i;
  8188. menuActionCmd2[menuActionRow] = k;
  8189. menuActionCmd3[menuActionRow] = j;
  8190. menuActionRow++;
  8191. }
  8192.  
  8193. }
  8194. // menuActionName[menuActionRow] = "Examine @yel@" + s +
  8195. // " @gre@(@whi@" + entityDef.type + "@gre@)";
  8196. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8197. menuActionID[menuActionRow] = 1025;
  8198. menuActionCmd1[menuActionRow] = i;
  8199. menuActionCmd2[menuActionRow] = k;
  8200. menuActionCmd3[menuActionRow] = j;
  8201. menuActionRow++;
  8202. }
  8203. }
  8204.  
  8205. public void buildAtPlayerMenu(int i, int j, Player player, int k) {
  8206. if (player == myPlayer)
  8207. return;
  8208. if (menuActionRow >= 400)
  8209. return;
  8210. String s;
  8211. if (player.title.length() < 0)
  8212. s = player.name
  8213. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8214. + " (level: " + player.combatLevel + ")";
  8215. else if (player.title.length() != 0)
  8216. s = "@" + titleColor(player.titleColor, 1) + "@" + player.title
  8217. + "@whi@ " + player.name
  8218. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8219. + " (level: " + player.combatLevel + ")";
  8220. else
  8221. s = player.name
  8222. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8223. + " (level: " + player.combatLevel + ")";
  8224. if (itemSelected == 1) {
  8225. menuActionName[menuActionRow] = "Use " + selectedItemName
  8226. + " with @whi@" + s;
  8227. menuActionID[menuActionRow] = 491;
  8228. menuActionCmd1[menuActionRow] = j;
  8229. menuActionCmd2[menuActionRow] = i;
  8230. menuActionCmd3[menuActionRow] = k;
  8231. menuActionRow++;
  8232. } else if (spellSelected == 1) {
  8233. if ((spellUsableOn & 8) == 8) {
  8234. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8235. menuActionID[menuActionRow] = 365;
  8236. menuActionCmd1[menuActionRow] = j;
  8237. menuActionCmd2[menuActionRow] = i;
  8238. menuActionCmd3[menuActionRow] = k;
  8239. menuActionRow++;
  8240. }
  8241. } else {
  8242. for (int l = 4; l >= 0; l--)
  8243. if (atPlayerActions[l] != null) {
  8244. menuActionName[menuActionRow] = atPlayerActions[l]
  8245. + " @whi@" + s;
  8246. char c = '\0';
  8247. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  8248. if (!isOneClick) {
  8249. if (player.combatLevel > myPlayer.combatLevel)
  8250. c = '\u07D0';
  8251. }
  8252. if (myPlayer.team != 0 && player.team != 0)
  8253. if (myPlayer.team == player.team)
  8254. c = '\u07D0';
  8255. else
  8256. c = '\0';
  8257. } else if (atPlayerArray[l])
  8258. c = '\u07D0';
  8259. if (l == 0)
  8260. menuActionID[menuActionRow] = 561 + c;
  8261. if (l == 1)
  8262. menuActionID[menuActionRow] = 779 + c;
  8263. if (l == 2)
  8264. menuActionID[menuActionRow] = 27 + c;
  8265. if (l == 3)
  8266. menuActionID[menuActionRow] = 577 + c;
  8267. if (l == 4)
  8268. menuActionID[menuActionRow] = 729 + c;
  8269. menuActionCmd1[menuActionRow] = j;
  8270. menuActionCmd2[menuActionRow] = i;
  8271. menuActionCmd3[menuActionRow] = k;
  8272. menuActionRow++;
  8273. }
  8274.  
  8275. }
  8276. for (int i1 = 0; i1 < menuActionRow; i1++)
  8277. if (menuActionID[i1] == 516) {
  8278. menuActionName[i1] = "Walk here @whi@" + s;
  8279. return;
  8280. }
  8281.  
  8282. }
  8283.  
  8284. private void method89(Class30_Sub1 class30_sub1) {
  8285. int i = 0;
  8286. int j = -1;
  8287. int k = 0;
  8288. int l = 0;
  8289. if (class30_sub1.anInt1296 == 0)
  8290. i = worldController.method300(class30_sub1.anInt1295,
  8291. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8292. if (class30_sub1.anInt1296 == 1)
  8293. i = worldController.method301(class30_sub1.anInt1295,
  8294. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8295. if (class30_sub1.anInt1296 == 2)
  8296. i = worldController.method302(class30_sub1.anInt1295,
  8297. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8298. if (class30_sub1.anInt1296 == 3)
  8299. i = worldController.method303(class30_sub1.anInt1295,
  8300. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8301. if (i != 0) {
  8302. int i1 = worldController.method304(class30_sub1.anInt1295,
  8303. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8304. j = i >> 14 & 0x7fff;
  8305. k = i1 & 0x1f;
  8306. l = i1 >> 6;
  8307. }
  8308. class30_sub1.anInt1299 = j;
  8309. class30_sub1.anInt1301 = k;
  8310. class30_sub1.anInt1300 = l;
  8311. }
  8312.  
  8313. private void method90() {
  8314. for (int i = 0; i < anInt1062; i++)
  8315. if (anIntArray1250[i] <= 0) {
  8316. boolean flag1 = false;
  8317. try {
  8318. if (anIntArray1207[i] == anInt874
  8319. && anIntArray1241[i] == anInt1289) {
  8320. if (!replayWave())
  8321. flag1 = true;
  8322. } else {
  8323. Stream stream = Sounds.method241(anIntArray1241[i],
  8324. anIntArray1207[i]);
  8325. if (System.currentTimeMillis()
  8326. + (long) (stream.currentOffset / 22) > aLong1172
  8327. + (long) (anInt1257 / 22)) {
  8328. anInt1257 = stream.currentOffset;
  8329. aLong1172 = System.currentTimeMillis();
  8330. if (saveWave(stream.buffer, stream.currentOffset)) {
  8331. anInt874 = anIntArray1207[i];
  8332. anInt1289 = anIntArray1241[i];
  8333. } else {
  8334. flag1 = true;
  8335. }
  8336. }
  8337. }
  8338. } catch (Exception exception) {
  8339. }
  8340. if (!flag1 || anIntArray1250[i] == -5) {
  8341. anInt1062--;
  8342. for (int j = i; j < anInt1062; j++) {
  8343. anIntArray1207[j] = anIntArray1207[j + 1];
  8344. anIntArray1241[j] = anIntArray1241[j + 1];
  8345. anIntArray1250[j] = anIntArray1250[j + 1];
  8346. }
  8347.  
  8348. i--;
  8349. } else {
  8350. anIntArray1250[i] = -5;
  8351. }
  8352. } else {
  8353. anIntArray1250[i]--;
  8354. }
  8355.  
  8356. if (prevSong > 0) {
  8357. prevSong -= 20;
  8358. if (prevSong < 0)
  8359. prevSong = 0;
  8360. if (prevSong == 0 && musicEnabled && !lowMem) {
  8361. nextSong = currentSong;
  8362. songChanging = true;
  8363. onDemandFetcher.method558(2, nextSong);
  8364. }
  8365. }
  8366. }
  8367.  
  8368.  
  8369. public Sprite[] cacheSprite;
  8370.  
  8371. public Sprite[] cacheSprite2;
  8372.  
  8373. public static boolean loadOrbs = true;
  8374.  
  8375. private void drawSpecialOrb() {
  8376. if(loadOrbs) {
  8377. String value = RSInterface.interfaceCache[155].message;
  8378. int spec = Integer.parseInt(value);
  8379. if (specialHover) {
  8380. cacheSprite2[56].drawSprite(clientSize == 0 ? 153 : clientWidth - 63, clientSize == 0 ? 131 : 150);
  8381. } else {
  8382. cacheSprite2[42].drawSprite(clientSize == 0 ? 154 : clientWidth - 62, clientSize == 0 ? 132 : 151);
  8383. }
  8384. cacheSprite2[5].myHeight = (int) (spec * 27 / 100);
  8385. cacheSprite2[5].drawSprite(clientSize == 0 ? 157 : clientWidth - 58, clientSize == 0 ? 135 : 155);
  8386. cacheSprite2[14].drawSprite(clientSize == 0 ? 157 : clientWidth - 58, clientSize == 0 ? 135 : 155);
  8387. cacheSprite2[55].drawSprite(clientSize == 0 ? 162 : clientWidth - 53, clientSize == 0 ? 140 : 160);
  8388. smallText.method382(getOrbTextColor(spec), clientSize == 0 ? 198 : clientWidth - 19, Integer.toString(spec), clientSize == 0 ? 158 : 177, true);
  8389. }
  8390. }
  8391.  
  8392. private void processMinimapActions() {
  8393. final boolean fixed = clientSize == 0;
  8394. if (fixed ? super.mouseX >= 542 && super.mouseX <= 579 && super.mouseY >= 2 && super.mouseY <= 38 :
  8395. super.mouseX >= clientWidth - 180 && super.mouseX <= clientWidth - 139 && super.mouseY >= 0 && super.mouseY <= 40) {
  8396. menuActionName[1] = "Face North";
  8397. menuActionID[1] = 696;
  8398. menuActionRow = 2;
  8399. }
  8400. if (counterHover && loadOrbs) {
  8401. menuActionName[2] = counterOn ? "Toggle XP Display" : "Show XP Display";
  8402. menuActionID[2] = 474;
  8403. menuActionName[1] = "Reset XP Total";
  8404. menuActionID[1] = 475;
  8405. menuActionRow = 3;
  8406. }
  8407. if (specialHover && loadOrbs) {
  8408. menuActionName[1] = "Use Special Attack";
  8409. menuActionID[1] = 851;
  8410. menuActionRow = 2;
  8411. }
  8412. if (prayHover && loadOrbs) {
  8413. menuActionName[2] = prayClicked ? "Turn quick-prayers off" : "Turn quick-prayers on";
  8414. menuActionID[2] = 1500;
  8415. menuActionRow = 2;
  8416. menuActionName[1] = "Select quick-prayers";
  8417. menuActionID[1] = 1506;
  8418. menuActionRow = 3;
  8419. }
  8420. if (runHover && loadOrbs) {
  8421. menuActionName[1] = !runClicked ? "Turn run mode on" : "Turn run mode off";
  8422. menuActionID[1] = 1050;
  8423. menuActionRow = 2;
  8424. }
  8425. }
  8426.  
  8427. private boolean runHover, prayHover, hpHover, prayClicked, counterOn, sumHover, sumActive, counterHover, specialHover, worldHover, autocast, runClicked = true;
  8428.  
  8429.  
  8430. private final void minimapHovers() {
  8431. final boolean fixed = clientSize == 0;
  8432. hpHover = fixed ? super.mouseX >= 690 && super.mouseX <= 745 && super.mouseY >= 13 && super.mouseY < 47 : super.mouseX >= clientWidth - 216 && super.mouseX <= 159 && super.mouseY >= 13 && super.mouseY < 47;
  8433. prayHover = fixed ? super.mouseX >= 525 && super.mouseX <= 581 && super.mouseY >= 105 && super.mouseY < 139 : super.mouseX >= clientWidth - 207 && super.mouseX <= clientWidth - 151 && super.mouseY >= 105 && super.mouseY < 139;
  8434. runHover = fixed ? super.mouseX >= 558 && super.mouseX <= 613 && super.mouseY >= 132 && super.mouseY < 165 : super.mouseX >= clientWidth - 174 && super.mouseX <= clientWidth - 120 && super.mouseY >= 132 && super.mouseY < 165;
  8435. counterHover = fixed ? super.mouseX >= 518 && super.mouseX <= 542 && super.mouseY >= 45 && super.mouseY <= 69 : super.mouseX >= clientWidth - 186 && super.mouseX <= clientWidth - 158 && super.mouseY >= 41 && super.mouseY <= 65;
  8436. worldHover = fixed ? super.mouseX >= 718 && super.mouseX <= 748 && super.mouseY >= 22 && super.mouseY <= 50 : super.mouseX >= clientWidth - 117 && super.mouseX <= clientWidth - 86 && super.mouseY >= 153 && super.mouseY <= 186;
  8437. specialHover = fixed ? super.mouseX >= 670 && super.mouseX <= 727 && super.mouseY >= 133 && super.mouseY <= 164 : super.mouseX >= clientWidth - 62 && super.mouseX <= clientWidth - 5 && super.mouseY >= 151 && super.mouseY <= 184;
  8438. }
  8439.  
  8440. public boolean runEnergy = false;
  8441.  
  8442. public final int[]
  8443. orbX = { 1, 9, 41 },
  8444. orbY = { 68, 105, 132 },
  8445. orbTextX = { 16, 25, 57 },
  8446. orbTextY = { 94, 131, 158 },
  8447. coloredOrbX = { 28, 36, 68 },
  8448. coloredOrbY = { 72, 109, 136 },
  8449. currentInterface = { 4016, 4012, 149 },
  8450. maximumInterface = { 4017, 4013, 149 },
  8451. orbIconX = { 34, 39, 75 },
  8452. orbIconY = { 78, 112, 140 };
  8453.  
  8454. private boolean newDamage = false;
  8455.  
  8456. private void loadAllOrbs(int xOffset) {
  8457. drawSpecialOrb();
  8458. boolean isPoisoned = false;
  8459. boolean clickedQuickPrayers = false;
  8460. int[]
  8461. spriteID = { isPoisoned && hpHover ? 8 : 7, prayHover ? 8 : 7, runHover ? 8 : 7, sumActive && sumHover ? 8 : 7 },
  8462. coloredOrbSprite = { 0, clickedQuickPrayers ? 2 : 1, runClicked ? 4 : 3, sumActive ? 6 : 5 },
  8463. orbSprite = { 9, 10, (runClicked ? 12 : 11), 13 };
  8464. String cEnergy = RSInterface.interfaceCache[149].message.replaceAll("%", "");
  8465. String hp = RSInterface.interfaceCache[4016].message.replaceAll("%", "");
  8466. int currentHP = Integer.parseInt(hp), currentEnergy = Integer.parseInt(cEnergy);
  8467. for (int i = 0; i < 3; i++) {
  8468. String currentStats = RSInterface.interfaceCache[currentInterface[i]].message.replaceAll("%", ""), maxStats = RSInterface.interfaceCache[maximumInterface[i]].message.replaceAll("%", "");
  8469. int currentLevel = Integer.parseInt(currentStats), maxLevel = Integer.parseInt(maxStats), level = (int) (((double) currentLevel / (double) maxLevel) * 100D);
  8470. cacheSprite2[spriteID[i]].drawSprite(orbX[i] + xOffset, orbY[i]);
  8471. cacheSprite2[coloredOrbSprite[i]].drawSprite(coloredOrbX[i] + xOffset, coloredOrbY[i]);
  8472. double percent = (i == 2 ? runEnergy ? currentEnergy / 100D : 100 : level / 100D), fillHp = 26 * percent, fillPrayer = 26 * percent, fillRun = 26 * percent;
  8473. double[] fill = { fillHp, fillPrayer, fillRun};
  8474. int depleteFill = 26 - (int) fill[i];
  8475. cacheSprite2[14].myHeight = depleteFill;
  8476. try {
  8477. cacheSprite2[14].drawSprite(coloredOrbX[i] + xOffset, coloredOrbY[i]);
  8478. } catch (Exception e) { }
  8479. cacheSprite2[orbSprite[i]].drawSprite(orbIconX[i] + xOffset, orbIconY[i]);
  8480. smallText.method382(getOrbTextColor(i == 2 ? runEnergy ? currentEnergy : 100 : level), orbTextX[i] + xOffset, "" + (i == 2 ? runEnergy ? cEnergy : 100 : i == 0 && newDamage ? currentHP * 10 : RSInterface.interfaceCache[currentInterface[i]].message.replaceAll("%", "")), orbTextY[i], true);
  8481. }
  8482. }
  8483.  
  8484. void startUp() {
  8485. drawLoadingText(20, "Starting up");
  8486. new CacheDownloader(this).downloadCache();
  8487. if (signlink.sunjava)
  8488. super.minDelay = 5;
  8489. if (aBoolean993) {
  8490. // rsAlreadyLoaded = true;
  8491. // return;
  8492. }
  8493. aBoolean993 = true;
  8494. getDocumentBaseHost();
  8495. if (signlink.cache_dat != null) {
  8496. for (int i = 0; i < 6; i++)
  8497. decompressors[i] = new Decompressor(signlink.cache_dat,
  8498. signlink.cache_idx[i], i + 1);
  8499. }
  8500. try {
  8501. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  8502. expectedCRCs[1], 25);
  8503. smallText = new TextDrawingArea(false, "p11_full",
  8504. titleStreamLoader);
  8505. expText = new TextDrawingArea(false, "rschat_full",
  8506. titleStreamLoader);
  8507. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full",
  8508. titleStreamLoader);
  8509. for (int i = 0; i < skillText.length; i++) {
  8510. skillText[i] = new TextDrawingArea(false, "p12_full",
  8511. titleStreamLoader);
  8512. }
  8513. chatTextDrawingArea = new TextDrawingArea(false, "b12_full",
  8514. titleStreamLoader);
  8515. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true,
  8516. "q8_full", titleStreamLoader);
  8517. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  8518. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  8519. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  8520. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  8521. drawLogo();
  8522. loadTitleScreen();
  8523. StreamLoader streamLoader = streamLoaderForName(2, "config",
  8524. "config", expectedCRCs[2], 30);
  8525. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  8526. "interface", expectedCRCs[3], 35);
  8527. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  8528. "media", expectedCRCs[4], 40);
  8529. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  8530. "textures", expectedCRCs[6], 45);
  8531. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  8532. "wordenc", expectedCRCs[7], 50);
  8533. StreamLoader streamLoader_5 = streamLoaderForName(8,
  8534. "sound effects", "sounds", expectedCRCs[8], 55);
  8535. try {
  8536. SpriteLoader.loadSprites(streamLoader_2);
  8537. cacheSprite = SpriteLoader.sprites;
  8538. } catch (Exception e) {
  8539. System.out.println("Unable to load sprite cache.");
  8540. }
  8541. byteGroundArray = new byte[4][104][104];
  8542. intGroundArray = new int[4][105][105];
  8543. worldController = new WorldController(intGroundArray);
  8544. for (int j = 0; j < 4; j++)
  8545. aClass11Array1230[j] = new Class11();
  8546.  
  8547. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  8548. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  8549. "versionlist", expectedCRCs[5], 60);
  8550. drawLoadingText(60, "Connecting to update server");
  8551. onDemandFetcher = new OnDemandFetcher();
  8552. onDemandFetcher.start(streamLoader_6, this);
  8553. Class36.method528(onDemandFetcher.getAnimCount());
  8554. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8555. // repackCacheIndex(1);
  8556. // repackCacheIndex(5);
  8557. /**
  8558. * Unpack images from cache
  8559. */
  8560. drawLoadingText(80, "Unpacking media"); /* Custom sprite unpacking */
  8561. worldMapIcon = new Sprite("worldicon");
  8562. File[] file = new File(signlink.findcachedir() + "/sprites/sprites2/").listFiles();
  8563. int size = file.length;
  8564. cacheSprite2 = new Sprite[size];
  8565. System.out.println("Images Loaded: "+size);
  8566. for (int i = 0; i < size; i ++) {
  8567. cacheSprite2[i] = new Sprite("Sprites2/" + i);
  8568. }
  8569. background = new Sprite("login/background");
  8570. titleBox = new Sprite("login/titlebox");
  8571. titleButton = new Sprite("login/titlebutton");
  8572. titleButtonHover = new Sprite("login/titleButtonHover");
  8573. titleButtonHover_1 = new Sprite("login/titleButtonHover1");
  8574. titleButton_1 = new Sprite("login/titlebutton1");
  8575. twitter = new Sprite("login/twitter");
  8576. twitterHover = new Sprite("login/twitterHover");
  8577. youtubeHover = new Sprite("login/youtubeHover");
  8578. facebookeHover = new Sprite("login/facebookHover");
  8579. youtube = new Sprite("login/youtube");
  8580. facebook = new Sprite("login/facebook");
  8581. passwordHover = new Sprite("login/password");
  8582. usernameHover = new Sprite("login/username");
  8583. saveButton = new Sprite("login/saveButton");
  8584. saveButton1 = new Sprite("login/saveButton1");
  8585. chatArea = new Sprite("chatarea");
  8586. tabArea = new Sprite("tabarea");
  8587. mapArea = new Sprite("maparea");
  8588. achievementBar = new Sprite("achievement/bar");
  8589. achievementIcon = new Sprite("achievement/icon");
  8590. for (int index = 0; index < skillImage.length; index++) {
  8591. skillImage[index] = new Sprite("Player/skilldrop/" + index);
  8592. }
  8593. for (int s562 = 0; s562 < 4; s562++) {
  8594. hitMarks562[s562] = new Sprite("hitmarks/SPLAT_" + s562);
  8595. }
  8596. for (int index = 0; index < 4; index++) {
  8597. xpIcon[index] = new Sprite("xp " + index);
  8598. }
  8599. for (int i = 1; i <= 15; i++) {
  8600. ORBS[i] = new Sprite("orbs/ORBS " + i + "");
  8601. }
  8602. Sprite[] clanIcons = new Sprite[9];
  8603. for (int index = 0; index < clanIcons.length; index++) {
  8604. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);
  8605. }
  8606. HPBarFull = new Sprite("Player/HP 0");
  8607. HPBarEmpty = new Sprite("Player/HP 1"); /**/
  8608. for (int m1 = 0; m1 <= 1; m1++)
  8609. mapBack[m1] = new Background(streamLoader_2, "mapback", m1);
  8610. for (int c1 = 0; c1 <= 3; c1++)
  8611. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  8612. for (int j3 = 0; j3 <= 14; j3++)
  8613. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  8614. for (int r1 = 0; r1 < 5; r1++)
  8615. redStones[r1] = new Sprite("redstones " + r1);
  8616. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8617. RSFont.unpackImages(modIcons, clanIcons);
  8618. compass = new Sprite(streamLoader_2, "compass", 0);
  8619. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  8620. mapEdge.method345();
  8621. try {
  8622. for (int k3 = 0; k3 < 100; k3++)
  8623. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  8624. k3);
  8625. } catch (Exception _ex) {
  8626. }
  8627. try {
  8628. for (int l3 = 0; l3 < 100; l3++)
  8629. mapFunctions[l3] = new Sprite(streamLoader_2,
  8630. "mapfunction", l3);
  8631. } catch (Exception _ex) {
  8632. }
  8633. try {
  8634. for (int i4 = 0; i4 < 20; i4++)
  8635. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8636. } catch (Exception _ex) {
  8637. }
  8638. try {
  8639. for (int h1 = 0; h1 < 6; h1++)
  8640. headIconsHint[h1] = new Sprite(streamLoader_2,
  8641. "headicons_hint", h1);
  8642. } catch (Exception _ex) {
  8643. }
  8644. try {
  8645. for (int j4 = 0; j4 < 8; j4++)
  8646. headIcons[j4] = new Sprite(streamLoader_2,
  8647. "headicons_prayer", j4);
  8648. for (int j45 = 0; j45 < 3; j45++)
  8649. skullIcons[j45] = new Sprite(streamLoader_2,
  8650. "headicons_pk", j45);
  8651. } catch (Exception _ex) {
  8652. }
  8653. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8654. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8655. for (int k4 = 0; k4 < 8; k4++)
  8656. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8657.  
  8658. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8659. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8660. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8661. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8662. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8663. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  8664. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8665. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8666.  
  8667. for (int l4 = 0; l4 < 10; l4++)
  8668. modIcons[l4] = new Sprite(streamLoader_2, "mod_icons", l4);
  8669.  
  8670. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8671. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  8672. getGameComponent());
  8673. sprite.method346(0, 0);
  8674. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8675. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  8676. getGameComponent());
  8677. sprite.method346(0, 0);
  8678. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  8679. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  8680. getGameComponent());
  8681. sprite.method346(0, 0);
  8682. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  8683. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  8684. getGameComponent());
  8685. sprite.method346(0, 0);
  8686.  
  8687. int i5 = (int) (Math.random() * 21D) - 10;
  8688. int j5 = (int) (Math.random() * 21D) - 10;
  8689. int k5 = (int) (Math.random() * 21D) - 10;
  8690. int l5 = (int) (Math.random() * 41D) - 20;
  8691. for (int i6 = 0; i6 < 100; i6++) {
  8692. if (mapFunctions[i6] != null)
  8693. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8694. if (mapScenes[i6] != null)
  8695. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8696. }
  8697.  
  8698. drawLoadingText(83, "Unpacking textures");
  8699. Rasterizer.method368(streamLoader_3);
  8700. Rasterizer.method372(0.80000000000000004D);
  8701. Rasterizer.method367();
  8702. drawLoadingText(86, "Unpacking config");
  8703. Animation.unpackConfig(streamLoader);
  8704. ObjectDef.unpackConfig(streamLoader);
  8705. Flo.unpackConfig(streamLoader);
  8706. FloorOverlay.unpackConfig(streamLoader);
  8707. OverLayFlo317.unpackConfig(streamLoader);
  8708. ItemDef.unpackConfig(streamLoader);
  8709. EntityDef.unpackConfig(streamLoader);
  8710. IDK.unpackConfig(streamLoader);
  8711. SpotAnim.unpackConfig(streamLoader);
  8712. Varp.unpackConfig(streamLoader);
  8713. VarBit.unpackConfig(streamLoader);
  8714. ItemDef.isMembers = isMembers;
  8715. preloadModels();
  8716. if (!lowMem) {
  8717. drawLoadingText(90, "Unpacking sounds");
  8718. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  8719. Stream stream = new Stream(abyte0);
  8720. Sounds.unpack(stream);
  8721. }
  8722. drawLoadingText(95, "Unpacking interfaces");
  8723. TextDrawingArea allFonts[] = { smallText, aTextDrawingArea_1271,
  8724. chatTextDrawingArea, aTextDrawingArea_1273 };
  8725. RSInterface.unpack(streamLoader_1, allFonts, streamLoader_2);
  8726. drawLoadingText(100, "Preparing game engine");
  8727. for (int j6 = 0; j6 < 33; j6++) {
  8728. int k6 = 999;
  8729. int i7 = 0;
  8730. for (int k7 = 0; k7 < 34; k7++) {
  8731. if (mapBack[0].aByteArray1450[k7 + j6
  8732. * mapBack[0].anInt1452] == 0) {
  8733. if (k6 == 999)
  8734. k6 = k7;
  8735. continue;
  8736. }
  8737. if (k6 == 999)
  8738. continue;
  8739. i7 = k7;
  8740. break;
  8741. }
  8742.  
  8743. anIntArray968[j6] = k6;
  8744. anIntArray1057[j6] = i7 - k6;
  8745. }
  8746.  
  8747. for (int l6 = 5; l6 < 156; l6++) {
  8748. int j7 = 999;
  8749. int l7 = 0;
  8750. for (int j8 = 25; j8 < 172; j8++) {
  8751. if (mapBack[0].aByteArray1450[j8 + l6
  8752. * mapBack[0].anInt1452] == 0
  8753. && (j8 > 34 || l6 > 34)) {
  8754. if (j7 == 999)
  8755. j7 = j8;
  8756. continue;
  8757. }
  8758. if (j7 == 999)
  8759. continue;
  8760. l7 = j8;
  8761. break;
  8762. }
  8763.  
  8764. anIntArray1052[l6 - 5] = j7 - 25;
  8765. anIntArray1229[l6 - 5] = l7 - j7;
  8766. }
  8767.  
  8768. updateGameArea();
  8769. Censor.loadConfig(streamLoader_4);
  8770. mouseDetection = new MouseDetection(this);
  8771. startRunnable(mouseDetection, 10);
  8772. Animable_Sub5.clientInstance = this;
  8773. ObjectDef.clientInstance = this;
  8774. EntityDef.clientInstance = this;
  8775. return;
  8776. } catch (Exception exception) {
  8777. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8778. }
  8779. loadingError = true;
  8780. }
  8781.  
  8782. private void method91(Stream stream, int i) {
  8783. while (stream.bitPosition + 10 < i * 8) {
  8784. int j = stream.readBits(11);
  8785. if (j == 2047)
  8786. break;
  8787. if (playerArray[j] == null) {
  8788. playerArray[j] = new Player();
  8789. if (aStreamArray895s[j] != null)
  8790. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8791. }
  8792. playerIndices[playerCount++] = j;
  8793. Player player = playerArray[j];
  8794. player.anInt1537 = loopCycle;
  8795. int k = stream.readBits(1);
  8796. if (k == 1)
  8797. anIntArray894[anInt893++] = j;
  8798. int l = stream.readBits(1);
  8799. int i1 = stream.readBits(5);
  8800. if (i1 > 15)
  8801. i1 -= 32;
  8802. int j1 = stream.readBits(5);
  8803. if (j1 > 15)
  8804. j1 -= 32;
  8805. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  8806. l == 1);
  8807. }
  8808. stream.finishBitAccess();
  8809. }
  8810.  
  8811. public boolean inCircle(int circleX, int circleY, int clickX, int clickY, int radius) {
  8812. return java.lang.Math.pow((circleX + radius - clickX), 2) + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math.pow(radius, 2);
  8813. }
  8814.  
  8815.  
  8816. public boolean canClickMap() {
  8817. if (super.mouseX >= clientWidth - 21 && super.mouseX <= clientWidth && super.mouseY >= 0 && super.mouseY <= 21)
  8818. return false;
  8819. return true;
  8820. }
  8821.  
  8822.  
  8823. private void processMainScreenClick() {
  8824. if(anInt1021 != 0)
  8825. return;
  8826. if(super.clickMode3 == 1) {
  8827. int i = (clientSize == 0 ? super.saveClickX - 25 - 545 : super.saveClickX - clientWidth + 183);
  8828. int j = (clientSize == 0 ? super.saveClickY - 9 : super.saveClickY - 10);
  8829. if (i >= 0 && j >= 0 && i < 146 && j < 151 && canClickMap()) {
  8830. if(inCircle(0, 0, i, j, 77)) {
  8831. i -= 73;
  8832. j -= 75;
  8833. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8834. int i1 = Rasterizer.anIntArray1470[k];
  8835. int j1 = Rasterizer.anIntArray1471[k];
  8836. i1 = i1 * (minimapInt3 + 256) >> 8;
  8837. j1 = j1 * (minimapInt3 + 256) >> 8;
  8838. int k1 = j * i1 + i * j1 >> 11;
  8839. int l1 = j * j1 - i * i1 >> 11;
  8840. int i2 = myPlayer.x + k1 >> 7;
  8841. int j2 = myPlayer.y - l1 >> 7;
  8842. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8843. if(flag1) {
  8844. stream.writeWordBigEndian(i);
  8845. stream.writeWordBigEndian(j);
  8846. stream.writeWord(minimapInt1);
  8847. stream.writeWordBigEndian(57);
  8848. stream.writeWordBigEndian(minimapInt2);
  8849. stream.writeWordBigEndian(minimapInt3);
  8850. stream.writeWordBigEndian(89);
  8851. stream.writeWord(myPlayer.x);
  8852. stream.writeWord(myPlayer.y);
  8853. stream.writeWordBigEndian(anInt1264);
  8854. stream.writeWordBigEndian(63);
  8855. }
  8856. }
  8857. anInt1117++;
  8858. if(anInt1117 > 1151) {
  8859. anInt1117 = 0;
  8860. stream.createFrame(246);
  8861. stream.writeWordBigEndian(0);
  8862. int l = stream.currentOffset;
  8863. if((int)(Math.random() * 2D) == 0)
  8864. stream.writeWordBigEndian(101);
  8865. stream.writeWordBigEndian(197);
  8866. stream.writeWord((int)(Math.random() * 65536D));
  8867. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8868. stream.writeWordBigEndian(67);
  8869. stream.writeWord(14214);
  8870. if((int)(Math.random() * 2D) == 0)
  8871. stream.writeWord(29487);
  8872. stream.writeWord((int)(Math.random() * 65536D));
  8873. if((int)(Math.random() * 2D) == 0)
  8874. stream.writeWordBigEndian(220);
  8875. stream.writeWordBigEndian(180);
  8876. stream.writeBytes(stream.currentOffset - l);
  8877. }
  8878. }
  8879. }
  8880. }
  8881.  
  8882.  
  8883. private String interfaceIntToString(int j) {
  8884. if (j < 0x3b9ac9ff)
  8885. return String.valueOf(j);
  8886. else
  8887. return "*";
  8888. }
  8889.  
  8890. private void showErrorScreen() {
  8891. Graphics g = getGameComponent().getGraphics();
  8892. g.setColor(Color.black);
  8893. g.fillRect(0, 0, 765, 503);
  8894. method4(1);
  8895. if (loadingError) {
  8896. aBoolean831 = false;
  8897. g.setFont(new Font("Helvetica", 1, 16));
  8898. g.setColor(Color.yellow);
  8899. int k = 35;
  8900. g.drawString(
  8901. "Sorry, an error has occured whilst loading Phantom PKs",
  8902. 30, k);
  8903. k += 50;
  8904. g.setColor(Color.white);
  8905. g.drawString("To fix this try the following (in order):", 30, k);
  8906. k += 50;
  8907. g.setColor(Color.white);
  8908. g.setFont(new Font("Helvetica", 1, 12));
  8909. g.drawString(
  8910. "1: Try closing ALL open web-browser windows, and reloading",
  8911. 30, k);
  8912. k += 30;
  8913. g.drawString(
  8914. "2: Try clearing your web-browsers cache from tools->internet options",
  8915. 30, k);
  8916. k += 30;
  8917. g.drawString("3: Try using a different game-world", 30, k);
  8918. k += 30;
  8919. g.drawString("4: Try rebooting your computer", 30, k);
  8920. k += 30;
  8921. g.drawString(
  8922. "5: Try selecting a different version of Java from the play-game menu",
  8923. 30, k);
  8924. }
  8925. if (genericLoadingError) {
  8926. aBoolean831 = false;
  8927. g.setFont(new Font("Helvetica", 1, 20));
  8928. g.setColor(Color.white);
  8929. g.drawString("Error - unable to load game!", 50, 50);
  8930. g.drawString("To play Phantom PKs make sure you play from", 50,
  8931. 100);
  8932. g.drawString("http://www.subculturegaming.com", 50, 150);
  8933. }
  8934. if (rsAlreadyLoaded) {
  8935. aBoolean831 = false;
  8936. g.setColor(Color.yellow);
  8937. int l = 35;
  8938. g.drawString(
  8939. "Error a copy of Phantom PKs already appears to be loaded",
  8940. 30, l);
  8941. l += 50;
  8942. g.setColor(Color.white);
  8943. g.drawString("To fix this try the following (in order):", 30, l);
  8944. l += 50;
  8945. g.setColor(Color.white);
  8946. g.setFont(new Font("Helvetica", 1, 12));
  8947. g.drawString(
  8948. "1: Try closing ALL open web-browser windows, and reloading",
  8949. 30, l);
  8950. l += 30;
  8951. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8952. l += 30;
  8953. }
  8954. }
  8955.  
  8956. public URL getCodeBase() {
  8957. try {
  8958. return new URL(server + ":" + (80 + portOff));
  8959. } catch (Exception _ex) {
  8960. }
  8961. return null;
  8962. }
  8963.  
  8964. private void method95() {
  8965. for (int j = 0; j < npcCount; j++) {
  8966. int k = npcIndices[j];
  8967. NPC npc = npcArray[k];
  8968. if (npc != null)
  8969. method96(npc);
  8970. }
  8971. }
  8972.  
  8973. private void method96(Entity entity) {
  8974. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  8975. || entity.y >= 13184) {
  8976. entity.anim = -1;
  8977. entity.anInt1520 = -1;
  8978. entity.anInt1547 = 0;
  8979. entity.anInt1548 = 0;
  8980. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8981. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8982. entity.method446();
  8983. }
  8984. if (entity == myPlayer
  8985. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  8986. entity.anim = -1;
  8987. entity.anInt1520 = -1;
  8988. entity.anInt1547 = 0;
  8989. entity.anInt1548 = 0;
  8990. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8991. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8992. entity.method446();
  8993. }
  8994. if (entity.anInt1547 > loopCycle)
  8995. method97(entity);
  8996. else if (entity.anInt1548 >= loopCycle)
  8997. method98(entity);
  8998. else
  8999. method99(entity);
  9000. method100(entity);
  9001. method101(entity);
  9002. }
  9003.  
  9004. private void method97(Entity entity) {
  9005. int i = entity.anInt1547 - loopCycle;
  9006. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9007. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9008. entity.x += (j - entity.x) / i;
  9009. entity.y += (k - entity.y) / i;
  9010. entity.anInt1503 = 0;
  9011. if (entity.anInt1549 == 0)
  9012. entity.turnDirection = 1024;
  9013. if (entity.anInt1549 == 1)
  9014. entity.turnDirection = 1536;
  9015. if (entity.anInt1549 == 2)
  9016. entity.turnDirection = 0;
  9017. if (entity.anInt1549 == 3)
  9018. entity.turnDirection = 512;
  9019. }
  9020.  
  9021. private void method98(Entity entity) {
  9022. if (entity.anInt1548 == loopCycle
  9023. || entity.anim == -1
  9024. || entity.anInt1529 != 0
  9025. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  9026. .method258(entity.anInt1527)) {
  9027. int i = entity.anInt1548 - entity.anInt1547;
  9028. int j = loopCycle - entity.anInt1547;
  9029. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9030. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9031. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9032. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9033. entity.x = (k * (i - j) + i1 * j) / i;
  9034. entity.y = (l * (i - j) + j1 * j) / i;
  9035. }
  9036. entity.anInt1503 = 0;
  9037. if (entity.anInt1549 == 0)
  9038. entity.turnDirection = 1024;
  9039. if (entity.anInt1549 == 1)
  9040. entity.turnDirection = 1536;
  9041. if (entity.anInt1549 == 2)
  9042. entity.turnDirection = 0;
  9043. if (entity.anInt1549 == 3)
  9044. entity.turnDirection = 512;
  9045. entity.anInt1552 = entity.turnDirection;
  9046. }
  9047.  
  9048. private void method99(Entity entity) {
  9049. entity.anInt1517 = entity.anInt1511;
  9050. if (entity.smallXYIndex == 0) {
  9051. entity.anInt1503 = 0;
  9052. return;
  9053. }
  9054. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9055. Animation animation = Animation.anims[entity.anim];
  9056. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  9057. entity.anInt1503++;
  9058. return;
  9059. }
  9060. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  9061. entity.anInt1503++;
  9062. return;
  9063. }
  9064. }
  9065. int i = entity.x;
  9066. int j = entity.y;
  9067. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9068. * 64;
  9069. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9070. * 64;
  9071. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  9072. entity.x = k;
  9073. entity.y = l;
  9074. return;
  9075. }
  9076. if (i < k) {
  9077. if (j < l)
  9078. entity.turnDirection = 1280;
  9079. else if (j > l)
  9080. entity.turnDirection = 1792;
  9081. else
  9082. entity.turnDirection = 1536;
  9083. } else if (i > k) {
  9084. if (j < l)
  9085. entity.turnDirection = 768;
  9086. else if (j > l)
  9087. entity.turnDirection = 256;
  9088. else
  9089. entity.turnDirection = 512;
  9090. } else if (j < l)
  9091. entity.turnDirection = 1024;
  9092. else
  9093. entity.turnDirection = 0;
  9094. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9095. if (i1 > 1024)
  9096. i1 -= 2048;
  9097. int j1 = entity.anInt1555;
  9098. if (i1 >= -256 && i1 <= 256)
  9099. j1 = entity.anInt1554;
  9100. else if (i1 >= 256 && i1 < 768)
  9101. j1 = entity.anInt1557;
  9102. else if (i1 >= -768 && i1 <= -256)
  9103. j1 = entity.anInt1556;
  9104. if (j1 == -1)
  9105. j1 = entity.anInt1554;
  9106. entity.anInt1517 = j1;
  9107. int k1 = 4;
  9108. if (entity.anInt1552 != entity.turnDirection
  9109. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9110. k1 = 2;
  9111. if (entity.smallXYIndex > 2)
  9112. k1 = 6;
  9113. if (entity.smallXYIndex > 3)
  9114. k1 = 8;
  9115. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  9116. k1 = 8;
  9117. entity.anInt1503--;
  9118. }
  9119. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9120. k1 <<= 1;
  9121. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  9122. && entity.anInt1505 != -1)
  9123. entity.anInt1517 = entity.anInt1505;
  9124. if (i < k) {
  9125. entity.x += k1;
  9126. if (entity.x > k)
  9127. entity.x = k;
  9128. } else if (i > k) {
  9129. entity.x -= k1;
  9130. if (entity.x < k)
  9131. entity.x = k;
  9132. }
  9133. if (j < l) {
  9134. entity.y += k1;
  9135. if (entity.y > l)
  9136. entity.y = l;
  9137. } else if (j > l) {
  9138. entity.y -= k1;
  9139. if (entity.y < l)
  9140. entity.y = l;
  9141. }
  9142. if (entity.x == k && entity.y == l) {
  9143. entity.smallXYIndex--;
  9144. if (entity.anInt1542 > 0)
  9145. entity.anInt1542--;
  9146. }
  9147. }
  9148.  
  9149. private void method100(Entity entity) {
  9150. if (entity.anInt1504 == 0)
  9151. return;
  9152. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  9153. NPC npc = npcArray[entity.interactingEntity];
  9154. if (npc != null) {
  9155. int i1 = entity.x - npc.x;
  9156. int k1 = entity.y - npc.y;
  9157. if (i1 != 0 || k1 != 0)
  9158. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9159. }
  9160. }
  9161. if (entity.interactingEntity >= 32768) {
  9162. int j = entity.interactingEntity - 32768;
  9163. if (j == unknownInt10)
  9164. j = myPlayerIndex;
  9165. Player player = playerArray[j];
  9166. if (player != null) {
  9167. int l1 = entity.x - player.x;
  9168. int i2 = entity.y - player.y;
  9169. if (l1 != 0 || i2 != 0)
  9170. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9171. }
  9172. }
  9173. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  9174. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  9175. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9176. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9177. if (k != 0 || j1 != 0)
  9178. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9179. entity.anInt1538 = 0;
  9180. entity.anInt1539 = 0;
  9181. }
  9182. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9183. if (l != 0) {
  9184. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9185. entity.anInt1552 = entity.turnDirection;
  9186. else if (l > 1024)
  9187. entity.anInt1552 -= entity.anInt1504;
  9188. else
  9189. entity.anInt1552 += entity.anInt1504;
  9190. entity.anInt1552 &= 0x7ff;
  9191. if (entity.anInt1517 == entity.anInt1511
  9192. && entity.anInt1552 != entity.turnDirection) {
  9193. if (entity.anInt1512 != -1) {
  9194. entity.anInt1517 = entity.anInt1512;
  9195. return;
  9196. }
  9197. entity.anInt1517 = entity.anInt1554;
  9198. }
  9199. }
  9200. }
  9201.  
  9202. private void method101(Entity entity) {
  9203. try {
  9204. if (entity.anInt1517 > 13798) {
  9205. entity.anInt1517 = -1;
  9206. }
  9207. entity.aBoolean1541 = false;
  9208. if (entity.anInt1517 != -1) {
  9209. Animation animation = Animation.anims[entity.anInt1517];
  9210. entity.anInt1519++;
  9211. if (entity.anInt1518 < animation.anInt352
  9212. && entity.anInt1519 > animation
  9213. .method258(entity.anInt1518)) {
  9214. entity.anInt1519 = 1;
  9215. entity.anInt1518++;
  9216. }
  9217. if (entity.anInt1518 >= animation.anInt352) {
  9218. entity.anInt1519 = 0;
  9219. entity.anInt1518 = 0;
  9220. }
  9221. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  9222. if (entity.nextIdleAnimFrame >= animation.anInt352) {
  9223. entity.nextIdleAnimFrame = -1;
  9224. }
  9225. }
  9226. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  9227. if (entity.anInt1521 < 0)
  9228. entity.anInt1521 = 0;
  9229. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9230. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  9231. && entity.anInt1522 > animation_1
  9232. .method258(entity.anInt1521); entity.anInt1521++)
  9233. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9234.  
  9235. if (entity.anInt1521 >= animation_1.anInt352
  9236. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352)) {
  9237. entity.anInt1520 = -1;
  9238. }
  9239. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  9240. if (entity.nextSpotAnimFrame >= animation_1.anInt352) {
  9241. entity.nextSpotAnimFrame = -1;
  9242. }
  9243. }
  9244. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  9245. Animation animation_2 = Animation.anims[entity.anim];
  9246. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  9247. && entity.anInt1547 <= loopCycle
  9248. && entity.anInt1548 < loopCycle) {
  9249. entity.anInt1529 = 1;
  9250. return;
  9251. }
  9252. }
  9253. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9254. Animation animation_3 = Animation.anims[entity.anim];
  9255. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  9256. && entity.anInt1528 > animation_3
  9257. .method258(entity.anInt1527); entity.anInt1527++)
  9258. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9259.  
  9260. if (entity.anInt1527 >= animation_3.anInt352) {
  9261. entity.anInt1527 -= animation_3.anInt356;
  9262. entity.anInt1530++;
  9263. if (entity.anInt1530 >= animation_3.anInt362)
  9264. entity.anim = -1;
  9265. if (entity.anInt1527 < 0
  9266. || entity.anInt1527 >= animation_3.anInt352)
  9267. entity.anim = -1;
  9268. }
  9269. entity.nextAnimFrame = entity.anInt1527 + 1;
  9270. if (entity.nextAnimFrame >= animation_3.anInt352) {
  9271. entity.nextAnimFrame = -1;
  9272. }
  9273. entity.aBoolean1541 = animation_3.aBoolean358;
  9274. }
  9275. if (entity.anInt1529 > 0)
  9276. entity.anInt1529--;
  9277. } catch (Exception e) {
  9278.  
  9279. }
  9280. }
  9281.  
  9282.  
  9283. public void moveScroller(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag, int j1)
  9284. {
  9285. int anInt992;
  9286. if (aBoolean972)
  9287. anInt992 = 32;
  9288. else
  9289. anInt992 = 0;
  9290. aBoolean972 = false;
  9291. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  9292. {
  9293. class9.scrollPosition -= anInt1213 * 4;
  9294. if (flag)
  9295. {
  9296. needDrawTabArea = true;
  9297. }
  9298. }
  9299. else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  9300. {
  9301. class9.scrollPosition += anInt1213 * 4;
  9302. if (flag)
  9303. {
  9304. needDrawTabArea = true;
  9305. }
  9306. // free scrolling
  9307. }
  9308. else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  9309. {
  9310. int l1 = ((j - 32) * j) / j1;
  9311. if (l1 < 8)
  9312. l1 = 8;
  9313. int i2 = l - i1 - 16 - l1 / 2;
  9314. int j2 = j - 32 - l1;
  9315. class9.scrollPosition = (short) (((j1 - j) * i2) / j2);
  9316. if (flag)
  9317. needDrawTabArea = true;
  9318. aBoolean972 = true;
  9319. }
  9320. }
  9321.  
  9322.  
  9323. private void drawMenu(int xOffSet, int yOffSet) {
  9324. int xPos = menuOffsetX - (xOffSet - 4);
  9325. int yPos = (-yOffSet + 4) + menuOffsetY;
  9326. int menuW = menuWidth;
  9327. int menuH = menuHeight + 1;
  9328. inputTaken = true;
  9329. tabAreaAltered = true;
  9330. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  9331. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e, menuW - 2);
  9332. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  9333. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822, menuW - 6);
  9334. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822, menuW - 4);
  9335. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822, menuW - 2);
  9336. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d, menuW - 4);
  9337. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d, menuW - 6);
  9338. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c, menuW - 6);
  9339. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  9340. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  9341. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  9342. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  9343. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  9344. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  9345. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  9346. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  9347. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  9348. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  9349. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  9350. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  9351. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  9352. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  9353. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  9354. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  9355. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  9356. chatTextDrawingArea.method385(0xc6b895, "Choose Option", yPos + 14, xPos + 3);
  9357. int mouseX = super.mouseX - (xOffSet);
  9358. int mouseY = (-yOffSet) + super.mouseY;
  9359. for (int l1 = 0; l1 < menuActionRow; l1++) {
  9360. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  9361. int disColor = 0xc6b895;
  9362. if (mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  9363. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  9364. disColor = 0xeee5c6;
  9365. }
  9366. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  9367. }
  9368. }
  9369.  
  9370.  
  9371. static int chatScrollMax;
  9372. public static int chatScrollPos;
  9373.  
  9374.  
  9375. private void drawGameScreen()
  9376. {
  9377. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  9378. if (loadingStage == 2) {
  9379. method119(anInt945, fullscreenInterfaceID);
  9380. if (openInterfaceID != -1) {
  9381. method119(anInt945, openInterfaceID);
  9382. }
  9383. anInt945 = 0;
  9384. resetAllImageProducers();
  9385. super.fullGameScreen.initDrawingArea();
  9386. Rasterizer.anIntArray1472 = fullScreenTextureArray;
  9387. DrawingArea.setAllPixelsToZero();
  9388. welcomeScreenRaised = true;
  9389. if (openInterfaceID != -1) {
  9390. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  9391. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  9392. rsInterface_1.width = (clientSize == 0 ? 765 : clientWidth);
  9393. rsInterface_1.height = (clientSize == 0 ? 503 : clientHeight);
  9394. }
  9395. drawInterface(0, clientSize == 0 ? 0 : (clientWidth / 2) - 765 / 2, rsInterface_1,
  9396. clientSize == 0 ? 8 : (clientHeight / 2) - 503 / 2);
  9397. }
  9398. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9399. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  9400. rsInterface.width = (clientSize == 0 ? 765 : clientWidth);
  9401. rsInterface.height = (clientSize == 0 ? 503 : clientHeight);
  9402. }
  9403. drawInterface(0, clientSize == 0 ? 0 : (clientWidth / 2) - 765 / 2, rsInterface,
  9404. clientSize == 0 ? 8 : (clientHeight / 2) - 503 / 2);
  9405. }
  9406. drawCount++;
  9407. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9408. return;
  9409. } else {
  9410. if (drawCount != 0) {
  9411. resetImageProducers2();
  9412. }
  9413. }
  9414. if(welcomeScreenRaised) {
  9415. welcomeScreenRaised = false;
  9416. if (clientSize == 0) {
  9417. topFrame.drawGraphics(0, super.graphics, 0);
  9418. leftFrame.drawGraphics(4, super.graphics, 0);
  9419. }
  9420. needDrawTabArea = true;
  9421. inputTaken = true;
  9422. tabAreaAltered = true;
  9423. if(loadingStage != 2) {
  9424. if (clientSize == 0) {
  9425. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  9426. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  9427. } else {
  9428. aRSImageProducer_1165.drawGraphics(0, super.graphics, 0);
  9429. }
  9430. }
  9431. }
  9432. if (!menuOpen) {
  9433. processRightClick();
  9434. drawTooltip();
  9435. } else {
  9436. drawMenu(4, 4);
  9437. }
  9438. if(menuOpen && menuScreenArea == 1) {
  9439. }
  9440. if(invOverlayInterfaceID != -1) {
  9441. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9442. if(flag1) {
  9443. }
  9444. }
  9445. if(atInventoryInterfaceType == 2) {
  9446. }
  9447. if(activeInterfaceType == 2) {
  9448. }
  9449. drawTabArea();
  9450. if (backDialogID == -1)
  9451. {
  9452. aClass9_1059.scrollPosition = (short) (chatScrollMax - chatScrollPos - 114);
  9453. if (clientSize == 0)
  9454. {
  9455. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  9456. moveScroller(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, chatScrollMax);
  9457. }
  9458. else
  9459. if (super.mouseX >= 460 && super.mouseX <= 513 && super.mouseY >= clientHeight - 158 && super.mouseY <= clientHeight - 44)
  9460. {
  9461. moveScroller(496 - 16, 114, super.mouseX - 16, super.mouseY, aClass9_1059, clientHeight - 158, false, chatScrollMax);
  9462. }
  9463. int i = chatScrollMax - 114 - aClass9_1059.scrollPosition;
  9464. if (i < 0)
  9465. i = 0;
  9466. if (i > chatScrollMax - 114)
  9467. i = chatScrollMax - 114;
  9468. if (chatScrollPos != i)
  9469. {
  9470. chatScrollPos = i;
  9471. inputTaken = true;
  9472. }
  9473. }
  9474. if(backDialogID != -1) {
  9475. boolean flag2 = method119(anInt945, backDialogID);
  9476. if(flag2)
  9477. inputTaken = true;
  9478. }
  9479. if(atInventoryInterfaceType == 3)
  9480. inputTaken = true;
  9481. if(activeInterfaceType == 3)
  9482. inputTaken = true;
  9483. if(aString844 != null)
  9484. inputTaken = true;
  9485. if(menuOpen && menuScreenArea == 2)
  9486. inputTaken = true;
  9487. if(inputTaken) {
  9488. drawChatArea();
  9489. }
  9490. if(loadingStage == 2)
  9491. method146();
  9492. if(loadingStage == 2) {
  9493. if (clientSize == 0) {
  9494. drawMinimap();
  9495. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  9496. }
  9497. }
  9498. if(anInt1054 != -1)
  9499. tabAreaAltered = true;
  9500. if(tabAreaAltered)
  9501. {
  9502. if(anInt1054 != -1 && anInt1054 == tabID)
  9503. {
  9504. anInt1054 = -1;
  9505. stream.createFrame(120);
  9506. stream.writeWordBigEndian(tabID);
  9507. }
  9508. tabAreaAltered = false;
  9509. aRSImageProducer_1125.initDrawingArea();
  9510. aRSImageProducer_1165.initDrawingArea();
  9511. }
  9512. anInt945 = 0;
  9513. }
  9514.  
  9515. private boolean buildFriendsListMenu(RSInterface class9) {
  9516. int i = class9.contentType;
  9517. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  9518. if (i >= 801)
  9519. i -= 701;
  9520. else if (i >= 701)
  9521. i -= 601;
  9522. else if (i >= 101)
  9523. i -= 101;
  9524. else
  9525. i--;
  9526. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9527. menuActionID[menuActionRow] = 792;
  9528. menuActionRow++;
  9529. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9530. menuActionID[menuActionRow] = 639;
  9531. menuActionRow++;
  9532. return true;
  9533. }
  9534. if (i >= 401 && i <= 500) {
  9535. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  9536. menuActionID[menuActionRow] = 322;
  9537. menuActionRow++;
  9538. return true;
  9539. } else {
  9540. return false;
  9541. }
  9542. }
  9543.  
  9544. private void method104() {
  9545. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  9546. .reverseGetFirst();
  9547. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  9548. .reverseGetNext())
  9549. if (class30_sub2_sub4_sub3.anInt1560 != plane
  9550. || class30_sub2_sub4_sub3.aBoolean1567)
  9551. class30_sub2_sub4_sub3.unlink();
  9552. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  9553. class30_sub2_sub4_sub3.method454(anInt945);
  9554. if (class30_sub2_sub4_sub3.aBoolean1567)
  9555. class30_sub2_sub4_sub3.unlink();
  9556. else
  9557. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  9558. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  9559. class30_sub2_sub4_sub3.anInt1562, 60,
  9560. class30_sub2_sub4_sub3.anInt1561,
  9561. class30_sub2_sub4_sub3, false);
  9562. }
  9563.  
  9564. }
  9565.  
  9566. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9567. if (class9.type != 0 || class9.children == null)
  9568. return;
  9569. if (class9.isMouseoverTriggered && anInt1026 != class9.id
  9570. && anInt1048 != class9.id && anInt1039 != class9.id)
  9571. return;
  9572. int i1 = DrawingArea.topX;
  9573. int j1 = DrawingArea.topY;
  9574. int k1 = DrawingArea.bottomX;
  9575. int l1 = DrawingArea.bottomY;
  9576. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9577. int i2 = class9.children.length;
  9578. for (int j2 = 0; j2 < i2; j2++) {
  9579. int k2 = class9.childX[j2] + k;
  9580. int l2 = (class9.childY[j2] + l) - j;
  9581. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9582. k2 += class9_1.anInt263;
  9583. l2 += class9_1.anInt265;
  9584. if (class9_1.contentType > 0)
  9585. drawFriendsListOrWelcomeScreen(class9_1);
  9586. // here
  9587. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  9588. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  9589. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  9590. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  9591. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  9592. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  9593. 12436, 12446, 12456, 6004, 18471, /* Ancients */
  9594. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  9595. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  9596. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  9597. for (int m5 = 0; m5 < IDs.length; m5++) {
  9598. if (class9_1.id == IDs[m5] + 1) {
  9599. if (m5 > 61)
  9600. drawBlackBox(k2 + 1, l2);
  9601. else
  9602. drawBlackBox(k2, l2 + 1);
  9603. }
  9604. }
  9605. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  9606. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  9607. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  9608. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  9609. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  9610. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  9611. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  9612. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  9613. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  9614. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  9615. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  9616. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  9617. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  9618. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  9619. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  9620. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  9621. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  9622. for (int r = 0; r < runeChildren.length; r++)
  9623. if (class9_1.id == runeChildren[r])
  9624. class9_1.modelZoom = 775;
  9625. if (class9_1.type == 0) {
  9626. if (class9_1.scrollPosition > class9_1.scrollMax
  9627. - class9_1.height)
  9628. class9_1.scrollPosition = class9_1.scrollMax
  9629. - class9_1.height;
  9630. if (class9_1.scrollPosition < 0)
  9631. class9_1.scrollPosition = 0;
  9632. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9633. if (class9_1.scrollMax > class9_1.height) {
  9634. // clan chat
  9635. if (class9_1.id == 18143) {
  9636. int clanMates = 0;
  9637. for (int i = 18155; i < 18244; i++) {
  9638. RSInterface line = RSInterface.interfaceCache[i];
  9639. if (line.message.length() > 0) {
  9640. clanMates++;
  9641. }
  9642. }
  9643. class9_1.scrollMax = (clanMates * 14) + class9_1.height
  9644. + 1;
  9645. }
  9646. if (class9_1.id == 18322 || class9_1.id == 18423) {
  9647. int members = 0;
  9648. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  9649. RSInterface line = RSInterface.interfaceCache[i];
  9650. if (line != null && line.message != null) {
  9651. if (line.message.length() > 0) {
  9652. members++;
  9653. }
  9654. }
  9655. }
  9656. class9_1.scrollMax = (members * 14) + 1;
  9657. }
  9658. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2,
  9659. k2 + class9_1.width, class9_1.scrollMax);
  9660. }
  9661. } else if (class9_1.type != 1)
  9662. if (class9_1.type == 2) {
  9663. int i3 = 0;
  9664. for (int l3 = 0; l3 < class9_1.height; l3++) {
  9665. for (int l4 = 0; l4 < class9_1.width; l4++) {
  9666. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9667. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9668. if (i3 < 20) {
  9669. k5 += class9_1.spritesX[i3];
  9670. j6 += class9_1.spritesY[i3];
  9671. }
  9672. if (class9_1.inv[i3] > 0) {
  9673. int k6 = 0;
  9674. int j7 = 0;
  9675. int j9 = class9_1.inv[i3] - 1;
  9676. if (k5 > DrawingArea.topX - 32
  9677. && k5 < DrawingArea.bottomX
  9678. && j6 > DrawingArea.topY - 32
  9679. && j6 < DrawingArea.bottomY
  9680. || activeInterfaceType != 0
  9681. && anInt1085 == i3) {
  9682. int l9 = 0;
  9683. if (itemSelected == 1 && anInt1283 == i3
  9684. && anInt1284 == class9_1.id)
  9685. l9 = 0xffffff;
  9686. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  9687. .getSprite(j9,
  9688. class9_1.invStackSizes[i3],
  9689. l9);
  9690. if (class30_sub2_sub1_sub1_2 != null) {
  9691. if (activeInterfaceType != 0
  9692. && anInt1085 == i3
  9693. && anInt1084 == class9_1.id) {
  9694. k6 = super.mouseX - anInt1087;
  9695. j7 = super.mouseY - anInt1088;
  9696. if (k6 < 5 && k6 > -5)
  9697. k6 = 0;
  9698. if (j7 < 5 && j7 > -5)
  9699. j7 = 0;
  9700. if (anInt989 < 10) {
  9701. k6 = 0;
  9702. j7 = 0;
  9703. }
  9704. class30_sub2_sub1_sub1_2
  9705. .drawSprite1(k5 + k6, j6
  9706. + j7);
  9707. if (j6 + j7 < DrawingArea.topY
  9708. && class9.scrollPosition > 0) {
  9709. int i10 = (anInt945 * (DrawingArea.topY
  9710. - j6 - j7)) / 3;
  9711. if (i10 > anInt945 * 10)
  9712. i10 = anInt945 * 10;
  9713. if (i10 > class9.scrollPosition)
  9714. i10 = class9.scrollPosition;
  9715. class9.scrollPosition -= i10;
  9716. anInt1088 += i10;
  9717. }
  9718. if (j6 + j7 + 32 > DrawingArea.bottomY
  9719. && class9.scrollPosition < class9.scrollMax
  9720. - class9.height) {
  9721. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9722. if (j10 > anInt945 * 10)
  9723. j10 = anInt945 * 10;
  9724. if (j10 > class9.scrollMax
  9725. - class9.height
  9726. - class9.scrollPosition)
  9727. j10 = class9.scrollMax
  9728. - class9.height
  9729. - class9.scrollPosition;
  9730. class9.scrollPosition += j10;
  9731. anInt1088 -= j10;
  9732. }
  9733. } else if (atInventoryInterfaceType != 0
  9734. && atInventoryIndex == i3
  9735. && atInventoryInterface == class9_1.id)
  9736. class30_sub2_sub1_sub1_2
  9737. .drawSprite1(k5, j6);
  9738. else
  9739. class30_sub2_sub1_sub1_2
  9740. .drawSprite(k5, j6);
  9741. if (class30_sub2_sub1_sub1_2.anInt1444 == 33
  9742. || class9_1.invStackSizes[i3] != 1) {
  9743. int k10 = class9_1.invStackSizes[i3];
  9744. smallText.method385(0,
  9745. intToKOrMil(k10), j6 + 10
  9746. + j7, k5 + 1 + k6);
  9747. if (k10 > 99999 && k10 < 10000000) {
  9748. smallText.method385(0xFFFFFF,
  9749. intToKOrMil(k10), j6
  9750. + 9 + j7, k5
  9751. + k6);
  9752. } else if (k10 > 9999999) {
  9753. smallText.method385(0x00ff80,
  9754. intToKOrMil(k10), j6
  9755. + 9 + j7, k5
  9756. + k6);
  9757. } else {
  9758. smallText.method385(0xFFFF00,
  9759. intToKOrMil(k10), j6
  9760. + 9 + j7, k5
  9761. + k6);
  9762. }
  9763. }
  9764. }
  9765. }
  9766. } else if (class9_1.sprites != null && i3 < 20) {
  9767. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9768. if (class30_sub2_sub1_sub1_1 != null)
  9769. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9770. }
  9771. i3++;
  9772. }
  9773. }
  9774. } else if (class9_1.type == 3) {
  9775. boolean flag = false;
  9776. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  9777. || anInt1026 == class9_1.id)
  9778. flag = true;
  9779. int j3;
  9780. if (interfaceIsSelected(class9_1)) {
  9781. j3 = class9_1.anInt219;
  9782. if (flag && class9_1.anInt239 != 0)
  9783. j3 = class9_1.anInt239;
  9784. } else {
  9785. j3 = class9_1.textColor;
  9786. if (flag && class9_1.anInt216 != 0)
  9787. j3 = class9_1.anInt216;
  9788. }
  9789. if (class9_1.aByte254 == 0) {
  9790. if (class9_1.aBoolean227)
  9791. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  9792. class9_1.width);
  9793. else
  9794. DrawingArea.fillPixels(k2, class9_1.width,
  9795. class9_1.height, j3, l2);
  9796. } else if (class9_1.aBoolean227)
  9797. DrawingArea.method335(j3, l2, class9_1.width,
  9798. class9_1.height,
  9799. 256 - (class9_1.aByte254 & 0xff), k2);
  9800. else
  9801. DrawingArea.method338(l2, class9_1.height,
  9802. 256 - (class9_1.aByte254 & 0xff), j3,
  9803. class9_1.width, k2);
  9804. } else if (class9_1.type == 4) {
  9805. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9806. String s = class9_1.message;
  9807. boolean flag1 = false;
  9808. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  9809. || anInt1026 == class9_1.id)
  9810. flag1 = true;
  9811. int i4;
  9812. if (interfaceIsSelected(class9_1)) {
  9813. i4 = class9_1.anInt219;
  9814. if (flag1 && class9_1.anInt239 != 0)
  9815. i4 = class9_1.anInt239;
  9816. if (class9_1.aString228.length() > 0)
  9817. s = class9_1.aString228;
  9818. } else {
  9819. i4 = class9_1.textColor;
  9820. if (flag1 && class9_1.anInt216 != 0)
  9821. i4 = class9_1.anInt216;
  9822. }
  9823. if (class9_1.atActionType == 6 && aBoolean1149) {
  9824. s = "Please wait...";
  9825. i4 = class9_1.textColor;
  9826. }
  9827. if (DrawingArea.width == 519) {
  9828. if (i4 == 0xffff00)
  9829. i4 = 255;
  9830. if (i4 == 49152)
  9831. i4 = 0xffffff;
  9832. }
  9833. if ((class9_1.parentID == 1151)
  9834. || (class9_1.parentID == 12855)) {
  9835. switch (i4) {
  9836. case 16773120:
  9837. i4 = 0xFE981F;
  9838. break;
  9839. case 7040819:
  9840. i4 = 0xAF6A1A;
  9841. break;
  9842. }
  9843. }
  9844. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  9845. if (s.indexOf("%") != -1) {
  9846. do {
  9847. int k7 = s.indexOf("%1");
  9848. if (k7 == -1)
  9849. break;
  9850. if (class9_1.id < 4000 || class9_1.id > 5000
  9851. && class9_1.id != 13921
  9852. && class9_1.id != 13922
  9853. && class9_1.id != 12171
  9854. && class9_1.id != 12172)
  9855. s = s.substring(0, k7)
  9856. + methodR(extractInterfaceValues(
  9857. class9_1, 0))
  9858. + s.substring(k7 + 2);
  9859. else
  9860. s = s.substring(0, k7)
  9861. + interfaceIntToString(extractInterfaceValues(
  9862. class9_1, 0))
  9863. + s.substring(k7 + 2);
  9864. } while (true);
  9865. do {
  9866. int l7 = s.indexOf("%2");
  9867. if (l7 == -1)
  9868. break;
  9869. s = s.substring(0, l7)
  9870. + interfaceIntToString(extractInterfaceValues(
  9871. class9_1, 1))
  9872. + s.substring(l7 + 2);
  9873. } while (true);
  9874. do {
  9875. int i8 = s.indexOf("%3");
  9876. if (i8 == -1)
  9877. break;
  9878. s = s.substring(0, i8)
  9879. + interfaceIntToString(extractInterfaceValues(
  9880. class9_1, 2))
  9881. + s.substring(i8 + 2);
  9882. } while (true);
  9883. do {
  9884. int j8 = s.indexOf("%4");
  9885. if (j8 == -1)
  9886. break;
  9887. s = s.substring(0, j8)
  9888. + interfaceIntToString(extractInterfaceValues(
  9889. class9_1, 3))
  9890. + s.substring(j8 + 2);
  9891. } while (true);
  9892. do {
  9893. int k8 = s.indexOf("%5");
  9894. if (k8 == -1)
  9895. break;
  9896. s = s.substring(0, k8)
  9897. + interfaceIntToString(extractInterfaceValues(
  9898. class9_1, 4))
  9899. + s.substring(k8 + 2);
  9900. } while (true);
  9901. }
  9902. int l8 = s.indexOf("\\n");
  9903. String s1;
  9904. if (l8 != -1) {
  9905. s1 = s.substring(0, l8);
  9906. s = s.substring(l8 + 2);
  9907. } else {
  9908. s1 = s;
  9909. s = "";
  9910. }
  9911. if (class9_1.centerText) {
  9912. newSmallFont.drawCenteredString(s1, k2
  9913. + class9_1.width / 2, l6, i4,
  9914. class9_1.textShadow ? 0 : -1);
  9915. } else {
  9916. newSmallFont.drawBasicString(s1, k2, l6, i4,
  9917. class9_1.textShadow ? 0 : -1);
  9918. }
  9919. }
  9920. } else if (class9_1.type == 5) {
  9921. //
  9922. Sprite sprite;
  9923. if (interfaceIsSelected(class9_1))
  9924. sprite = class9_1.sprite2;
  9925. else
  9926. sprite = class9_1.sprite1;
  9927. if (spellSelected == 1 && class9_1.id == spellID
  9928. && spellID != 0 && sprite != null) {
  9929. sprite.drawSprite(k2, l2, 0xffffff);
  9930. } else {
  9931. if (sprite != null)
  9932. sprite.drawSprite(k2, l2);
  9933. }
  9934. /*
  9935. * if(Autocast && class9_1.id == spellID && class9_1.id ==
  9936. * autocastId) { magicAuto.drawSprite(k2-3, l2-3); }
  9937. * sprite.drawSprite(k2, l2);
  9938. */
  9939. } else if (class9_1.type == 6) {
  9940. int k3 = Rasterizer.textureInt1;
  9941. int j4 = Rasterizer.textureInt2;
  9942. Rasterizer.textureInt1 = k2 + class9_1.width / 2;
  9943. Rasterizer.textureInt2 = l2 + class9_1.height / 2;
  9944. int i5 = Rasterizer.anIntArray1470[class9_1.modelRotation1]
  9945. * class9_1.modelZoom >> 16;
  9946. int l5 = Rasterizer.anIntArray1471[class9_1.modelRotation1]
  9947. * class9_1.modelZoom >> 16;
  9948. boolean flag2 = interfaceIsSelected(class9_1);
  9949. int i7;
  9950. if (flag2)
  9951. i7 = class9_1.anInt258;
  9952. else
  9953. i7 = class9_1.anInt257;
  9954. Model model;
  9955. if (i7 == -1) {
  9956. model = class9_1.method209(-1, -1, flag2);
  9957. } else {
  9958. Animation animation = Animation.anims[i7];
  9959. model = class9_1.method209(
  9960. animation.anIntArray354[class9_1.anInt246],
  9961. animation.anIntArray353[class9_1.anInt246],
  9962. flag2);
  9963. }
  9964. if (model != null)
  9965. model.method482(class9_1.modelRotation2, 0,
  9966. class9_1.modelRotation1, 0, i5, l5);
  9967. Rasterizer.textureInt1 = k3;
  9968. Rasterizer.textureInt2 = j4;
  9969. } else if (class9_1.type == 7) {
  9970. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9971. int k4 = 0;
  9972. for (int j5 = 0; j5 < class9_1.height; j5++) {
  9973. for (int i6 = 0; i6 < class9_1.width; i6++) {
  9974. if (class9_1.inv[k4] > 0) {
  9975. ItemDef itemDef = ItemDef
  9976. .forID(class9_1.inv[k4] - 1);
  9977. String s2 = itemDef.name;
  9978. if (itemDef.stackable
  9979. || class9_1.invStackSizes[k4] != 1)
  9980. s2 = s2
  9981. + " x"
  9982. + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9983. int i9 = k2 + i6
  9984. * (115 + class9_1.invSpritePadX);
  9985. int k9 = l2 + j5
  9986. * (12 + class9_1.invSpritePadY);
  9987. if (class9_1.centerText)
  9988. textDrawingArea_1.method382(
  9989. class9_1.textColor, i9
  9990. + class9_1.width / 2, s2,
  9991. k9, class9_1.textShadow);
  9992. else
  9993. textDrawingArea_1.method389(
  9994. class9_1.textShadow, i9,
  9995. class9_1.textColor, s2, k9);
  9996. }
  9997. k4++;
  9998. }
  9999. }
  10000. } else if (class9_1.type == 8
  10001. && (anInt1500 == class9_1.id
  10002. || anInt1044 == class9_1.id || anInt1129 == class9_1.id)
  10003. && anInt1501 == 50) {
  10004. int boxWidth = 0;
  10005. int boxHeight = 0;
  10006. TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
  10007. for (String s1 = class9_1.message; s1.length() > 0;) {
  10008. if (s1.indexOf("%") != -1) {
  10009. do {
  10010. int k7 = s1.indexOf("%1");
  10011. if (k7 == -1)
  10012. break;
  10013. s1 = s1.substring(0, k7)
  10014. + interfaceIntToString(extractInterfaceValues(
  10015. class9_1, 0))
  10016. + s1.substring(k7 + 2);
  10017. } while (true);
  10018. do {
  10019. int l7 = s1.indexOf("%2");
  10020. if (l7 == -1)
  10021. break;
  10022. s1 = s1.substring(0, l7)
  10023. + interfaceIntToString(extractInterfaceValues(
  10024. class9_1, 1))
  10025. + s1.substring(l7 + 2);
  10026. } while (true);
  10027. do {
  10028. int i8 = s1.indexOf("%3");
  10029. if (i8 == -1)
  10030. break;
  10031. s1 = s1.substring(0, i8)
  10032. + interfaceIntToString(extractInterfaceValues(
  10033. class9_1, 2))
  10034. + s1.substring(i8 + 2);
  10035. } while (true);
  10036. do {
  10037. int j8 = s1.indexOf("%4");
  10038. if (j8 == -1)
  10039. break;
  10040. s1 = s1.substring(0, j8)
  10041. + interfaceIntToString(extractInterfaceValues(
  10042. class9_1, 3))
  10043. + s1.substring(j8 + 2);
  10044. } while (true);
  10045. do {
  10046. int k8 = s1.indexOf("%5");
  10047. if (k8 == -1)
  10048. break;
  10049. s1 = s1.substring(0, k8)
  10050. + interfaceIntToString(extractInterfaceValues(
  10051. class9_1, 4))
  10052. + s1.substring(k8 + 2);
  10053. } while (true);
  10054. }
  10055. int l7 = s1.indexOf("\\n");
  10056. String s4;
  10057. if (l7 != -1) {
  10058. s4 = s1.substring(0, l7);
  10059. s1 = s1.substring(l7 + 2);
  10060. } else {
  10061. s4 = s1;
  10062. s1 = "";
  10063. }
  10064. int j10 = textDrawingArea_2.getTextWidth(s4);
  10065. if (j10 > boxWidth) {
  10066. boxWidth = j10;
  10067. }
  10068. boxHeight += textDrawingArea_2.anInt1497 + 1;
  10069. }
  10070. boxWidth += 6;
  10071. boxHeight += 7;
  10072. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  10073. int yPos = l2 + class9_1.height + 5;
  10074. if (xPos < k2 + 5)
  10075. xPos = k2 + 5;
  10076. if (xPos + boxWidth > k + class9.width)
  10077. xPos = (k + class9.width) - boxWidth;
  10078. if (yPos + boxHeight > l + class9.height)
  10079. yPos = (l2 - boxHeight);
  10080. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0,
  10081. boxWidth);
  10082. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  10083. String s2 = class9_1.message;
  10084. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2
  10085. .length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) { // anInt1497
  10086. if (s2.indexOf("%") != -1) {
  10087. do {
  10088. int k7 = s2.indexOf("%1");
  10089. if (k7 == -1)
  10090. break;
  10091. s2 = s2.substring(0, k7)
  10092. + interfaceIntToString(extractInterfaceValues(
  10093. class9_1, 0))
  10094. + s2.substring(k7 + 2);
  10095. } while (true);
  10096. do {
  10097. int l7 = s2.indexOf("%2");
  10098. if (l7 == -1)
  10099. break;
  10100. s2 = s2.substring(0, l7)
  10101. + interfaceIntToString(extractInterfaceValues(
  10102. class9_1, 1))
  10103. + s2.substring(l7 + 2);
  10104. } while (true);
  10105. do {
  10106. int i8 = s2.indexOf("%3");
  10107. if (i8 == -1)
  10108. break;
  10109. s2 = s2.substring(0, i8)
  10110. + interfaceIntToString(extractInterfaceValues(
  10111. class9_1, 2))
  10112. + s2.substring(i8 + 2);
  10113. } while (true);
  10114. do {
  10115. int j8 = s2.indexOf("%4");
  10116. if (j8 == -1)
  10117. break;
  10118. s2 = s2.substring(0, j8)
  10119. + interfaceIntToString(extractInterfaceValues(
  10120. class9_1, 3))
  10121. + s2.substring(j8 + 2);
  10122. } while (true);
  10123. do {
  10124. int k8 = s2.indexOf("%5");
  10125. if (k8 == -1)
  10126. break;
  10127. s2 = s2.substring(0, k8)
  10128. + interfaceIntToString(extractInterfaceValues(
  10129. class9_1, 4))
  10130. + s2.substring(k8 + 2);
  10131. } while (true);
  10132. }
  10133. int l11 = s2.indexOf("\\n");
  10134. String s5;
  10135. if (l11 != -1) {
  10136. s5 = s2.substring(0, l11);
  10137. s2 = s2.substring(l11 + 2);
  10138. } else {
  10139. s5 = s2;
  10140. s2 = "";
  10141. }
  10142. if (class9_1.centerText) {
  10143. textDrawingArea_2.method382(yPos, xPos
  10144. + class9_1.width / 2, s5, j11, false);
  10145. } else {
  10146. if (s5.contains("\\r")) {
  10147. String text = s5
  10148. .substring(0, s5.indexOf("\\r"));
  10149. String text2 = s5
  10150. .substring(s5.indexOf("\\r") + 2);
  10151. textDrawingArea_2.method389(false, xPos + 3, 0,
  10152. text, j11);
  10153. int rightX = boxWidth + xPos
  10154. - textDrawingArea_2.getTextWidth(text2)
  10155. - 2;
  10156. textDrawingArea_2.method389(false, rightX, 0,
  10157. text2, j11);
  10158. System.out.println("Box: " + boxWidth + "");
  10159. } else
  10160. textDrawingArea_2.method389(false, xPos + 3, 0,
  10161. s5, j11);
  10162. }
  10163. }
  10164. }
  10165. if (class9_1.type == 12) {
  10166. Sprite sprite;
  10167. if (interfaceIsSelected(class9_1))
  10168. sprite = class9_1.sprite2;
  10169. else
  10170. sprite = class9_1.sprite1;
  10171. if (sprite != null)
  10172. sprite.drawAdvancedSprite(k2, l2);
  10173. } else if (class9_1.type == 9) {
  10174. drawHoverBox(k2, l2, class9_1.message);
  10175. }
  10176. }
  10177. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10178. }
  10179.  
  10180. public void drawBlackBox(int xPos, int yPos) {
  10181. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  10182. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  10183. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  10184. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  10185. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  10186. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  10187. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  10188. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  10189. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  10190. }
  10191.  
  10192. public void drawHoverBox(int xPos, int yPos, String text) {
  10193. String[] results = text.split("\n");
  10194. int height = (results.length * 16) + 3;
  10195. int width;
  10196. width = smallText.getTextWidth(results[0]) + 6;
  10197. for (int i = 1; i < results.length; i++)
  10198. if (width <= smallText.getTextWidth(results[i]) + 6)
  10199. width = smallText.getTextWidth(results[i]) + 6;
  10200. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  10201. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  10202. yPos += 14;
  10203. for (int i = 0; i < results.length; i++) {
  10204. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  10205. yPos += 16;
  10206. }
  10207. }
  10208.  
  10209. private void randomizeBackground(Background background) {
  10210. int j = 256;
  10211. for (int k = 0; k < anIntArray1190.length; k++)
  10212. anIntArray1190[k] = 0;
  10213.  
  10214. for (int l = 0; l < 5000; l++) {
  10215. int i1 = (int) (Math.random() * 128D * (double) j);
  10216. anIntArray1190[i1] = (int) (Math.random() * 256D);
  10217. }
  10218. for (int j1 = 0; j1 < 20; j1++) {
  10219. for (int k1 = 1; k1 < j - 1; k1++) {
  10220. for (int i2 = 1; i2 < 127; i2++) {
  10221. int k2 = i2 + (k1 << 7);
  10222. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  10223. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10224. }
  10225.  
  10226. }
  10227. int ai[] = anIntArray1190;
  10228. anIntArray1190 = anIntArray1191;
  10229. anIntArray1191 = ai;
  10230. }
  10231. if (background != null) {
  10232. int l1 = 0;
  10233. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  10234. for (int l2 = 0; l2 < background.anInt1452; l2++)
  10235. if (background.aByteArray1450[l1++] != 0) {
  10236. int i3 = l2 + 16 + background.anInt1454;
  10237. int j3 = j2 + 16 + background.anInt1455;
  10238. int k3 = i3 + (j3 << 7);
  10239. anIntArray1190[k3] = 0;
  10240. }
  10241. }
  10242. }
  10243. }
  10244.  
  10245. private void method107(int i, int j, Stream stream, Player player) {
  10246. if ((i & 0x400) != 0) {
  10247. player.anInt1543 = stream.method428();
  10248. player.anInt1545 = stream.method428();
  10249. player.anInt1544 = stream.method428();
  10250. player.anInt1546 = stream.method428();
  10251. player.anInt1547 = stream.method436() + loopCycle;
  10252. player.anInt1548 = stream.method435() + loopCycle;
  10253. player.anInt1549 = stream.method428();
  10254. player.method446();
  10255. }
  10256. if ((i & 0x100) != 0) {
  10257. player.anInt1520 = stream.method434();
  10258. int k = stream.readDWord();
  10259. player.anInt1524 = k >> 16;
  10260. player.anInt1523 = loopCycle + (k & 0xffff);
  10261. player.anInt1521 = 0;
  10262. player.anInt1522 = 0;
  10263. if (player.anInt1523 > loopCycle)
  10264. player.anInt1521 = -1;
  10265. if (player.anInt1520 == 65535)
  10266. player.anInt1520 = -1;
  10267. }
  10268. if ((i & 8) != 0) {
  10269. int l = stream.method434();
  10270. if (l == 65535)
  10271. l = -1;
  10272. int i2 = stream.method427();
  10273. if (l == player.anim && l != -1) {
  10274. int i3 = Animation.anims[l].anInt365;
  10275. if (i3 == 1) {
  10276. player.anInt1527 = 0;
  10277. player.anInt1528 = 0;
  10278. player.anInt1529 = i2;
  10279. player.anInt1530 = 0;
  10280. }
  10281. if (i3 == 2)
  10282. player.anInt1530 = 0;
  10283. } else if (l == -1
  10284. || player.anim == -1
  10285. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  10286. player.anim = l;
  10287. player.anInt1527 = 0;
  10288. player.anInt1528 = 0;
  10289. player.anInt1529 = i2;
  10290. player.anInt1530 = 0;
  10291. player.anInt1542 = player.smallXYIndex;
  10292. }
  10293. }
  10294. if ((i & 4) != 0) {
  10295. player.textSpoken = stream.readString();
  10296. if (player.textSpoken.charAt(0) == '~') {
  10297. player.textSpoken = player.textSpoken.substring(1);
  10298. pushMessage(player.textSpoken, 2, player.name);
  10299. } else if (player == myPlayer)
  10300. pushMessage(player.textSpoken, 2, player.name);
  10301. player.anInt1513 = 0;
  10302. player.anInt1531 = 0;
  10303. player.textCycle = 150;
  10304. }
  10305. if ((i & 0x80) != 0) {
  10306. int i1 = stream.method434();
  10307. int j2 = stream.readUnsignedByte();
  10308. int j3 = stream.method427();
  10309. int k3 = stream.currentOffset;
  10310. if (player.name != null && player.visible) {
  10311. long l3 = TextClass.longForName(player.name);
  10312. boolean flag = false;
  10313. if (j2 <= 1) {
  10314. for (int i4 = 0; i4 < ignoreCount; i4++) {
  10315. if (ignoreListAsLongs[i4] != l3)
  10316. continue;
  10317. flag = true;
  10318. break;
  10319. }
  10320.  
  10321. }
  10322. if (!flag && anInt1251 == 0)
  10323. try {
  10324. aStream_834.currentOffset = 0;
  10325. stream.method442(j3, 0, aStream_834.buffer);
  10326. aStream_834.currentOffset = 0;
  10327. String s = TextInput.method525(j3, aStream_834);
  10328. // s = Censor.doCensor(s);
  10329. player.textSpoken = s;
  10330. player.anInt1513 = i1 >> 8;
  10331. player.privelage = j2;
  10332.  
  10333. System.out.println("Other authority: " + j2 + ", "
  10334. + player.name);
  10335. player.anInt1531 = i1 & 0xff;
  10336. player.textCycle = 150;
  10337. String cr = "";
  10338. if (j2 == 10)
  10339. cr = "@cr10@";
  10340. if (j2 == 9)
  10341. cr = "@cr9@";
  10342. if (j2 == 8)
  10343. cr = "@cr8@";
  10344. if (j2 == 7)
  10345. cr = "@cr7@";
  10346. if (j2 == 6)
  10347. cr = "@cr6@";
  10348. if (j2 == 5)
  10349. cr = "@cr5@";
  10350. if (j2 == 4)
  10351. cr = "@cr4@";
  10352. if (j2 == 3)
  10353. cr = "@cr3@";
  10354. if (j2 == 2)
  10355. cr = "@cr2@";
  10356. if (j2 == 1)
  10357. cr = "@cr1@";
  10358.  
  10359. // others
  10360. pushMessage(s, 1,
  10361. cr + "<col=" + titleColor(player.titleColor, 0)
  10362. + ">" + player.title + "</col> "
  10363. + player.name);
  10364. } catch (Exception exception) {
  10365. signlink.reporterror("cde2");
  10366. }
  10367. }
  10368. stream.currentOffset = k3 + j3;
  10369. }
  10370. if ((i & 1) != 0) {
  10371. player.interactingEntity = stream.method434();
  10372. if (player.interactingEntity == 65535)
  10373. player.interactingEntity = -1;
  10374. }
  10375. if ((i & 0x10) != 0) {
  10376. int j1 = stream.method427();
  10377. byte abyte0[] = new byte[j1];
  10378. Stream stream_1 = new Stream(abyte0);
  10379. stream.readBytes(j1, 0, abyte0);
  10380. aStreamArray895s[j] = stream_1;
  10381. player.updatePlayer(stream_1);
  10382. }
  10383. if ((i & 2) != 0) {
  10384. player.anInt1538 = stream.method436();
  10385. player.anInt1539 = stream.method434();
  10386. }
  10387. if ((i & 0x20) != 0) {
  10388. int k1 = stream.readUnsignedByte();
  10389. int k2 = stream.method426();
  10390. player.updateHitData(k2, k1, loopCycle);
  10391. player.loopCycleStatus = loopCycle + 300;
  10392. player.currentHealth = stream.method427();
  10393. player.maxHealth = stream.readUnsignedByte();
  10394. }
  10395. if ((i & 0x200) != 0) {
  10396. int l1 = stream.readUnsignedByte();
  10397. int l2 = stream.method428();
  10398. player.updateHitData(l2, l1, loopCycle);
  10399. player.loopCycleStatus = loopCycle + 300;
  10400. player.currentHealth = stream.readUnsignedByte();
  10401. player.maxHealth = stream.method427();
  10402. }
  10403. }
  10404.  
  10405. private void method108() {
  10406. try {
  10407. int j = myPlayer.x + anInt1278;
  10408. int k = myPlayer.y + anInt1131;
  10409. if (anInt1014 - j < -500 || anInt1014 - j > 500
  10410. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  10411. anInt1014 = j;
  10412. anInt1015 = k;
  10413. }
  10414. if (anInt1014 != j)
  10415. anInt1014 += (j - anInt1014) / 16;
  10416. if (anInt1015 != k)
  10417. anInt1015 += (k - anInt1015) / 16;
  10418. if (super.keyArray[1] == 1)
  10419. anInt1186 += (-24 - anInt1186) / 2;
  10420. else if (super.keyArray[2] == 1)
  10421. anInt1186 += (24 - anInt1186) / 2;
  10422. else
  10423. anInt1186 /= 2;
  10424. if (super.keyArray[3] == 1)
  10425. anInt1187 += (12 - anInt1187) / 2;
  10426. else if (super.keyArray[4] == 1)
  10427. anInt1187 += (-12 - anInt1187) / 2;
  10428. else
  10429. anInt1187 /= 2;
  10430. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  10431. anInt1184 += anInt1187 / 2;
  10432. if (anInt1184 < 128)
  10433. anInt1184 = 128;
  10434. if (anInt1184 > 383)
  10435. anInt1184 = 383;
  10436. int l = anInt1014 >> 7;
  10437. int i1 = anInt1015 >> 7;
  10438. int j1 = method42(plane, anInt1015, anInt1014);
  10439. int k1 = 0;
  10440. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  10441. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  10442. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  10443. int l2 = plane;
  10444. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10445. l2++;
  10446. int i3 = j1 - intGroundArray[l2][l1][k2];
  10447. if (i3 > k1)
  10448. k1 = i3;
  10449. }
  10450.  
  10451. }
  10452.  
  10453. }
  10454. anInt1005++;
  10455. if (anInt1005 > 1512) {
  10456. anInt1005 = 0;
  10457. stream.createFrame(77);
  10458. stream.writeWordBigEndian(0);
  10459. int i2 = stream.currentOffset;
  10460. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10461. stream.writeWordBigEndian(101);
  10462. stream.writeWordBigEndian(233);
  10463. stream.writeWord(45092);
  10464. if ((int) (Math.random() * 2D) == 0)
  10465. stream.writeWord(35784);
  10466. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10467. stream.writeWordBigEndian(64);
  10468. stream.writeWordBigEndian(38);
  10469. stream.writeWord((int) (Math.random() * 65536D));
  10470. stream.writeWord((int) (Math.random() * 65536D));
  10471. stream.writeBytes(stream.currentOffset - i2);
  10472. }
  10473. int j2 = k1 * 192;
  10474. if (j2 > 0x17f00)
  10475. j2 = 0x17f00;
  10476. if (j2 < 32768)
  10477. j2 = 32768;
  10478. if (j2 > anInt984) {
  10479. anInt984 += (j2 - anInt984) / 24;
  10480. return;
  10481. }
  10482. if (j2 < anInt984) {
  10483. anInt984 += (j2 - anInt984) / 80;
  10484. }
  10485. } catch (Exception _ex) {
  10486. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  10487. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  10488. + anInt1070 + "," + baseX + "," + baseY);
  10489. throw new RuntimeException("eek");
  10490. }
  10491. }
  10492.  
  10493. public void processDrawing() {
  10494. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  10495. showErrorScreen();
  10496. return;
  10497. }
  10498. anInt1061++;
  10499. if (!loggedIn)
  10500. drawLoginScreen(false);
  10501. else
  10502. drawGameScreen();
  10503. anInt1213 = 0;
  10504. }
  10505.  
  10506. private boolean isFriendOrSelf(String s) {
  10507. if (s == null)
  10508. return false;
  10509. for (int i = 0; i < friendsCount; i++)
  10510. if (s.equalsIgnoreCase(friendsList[i]))
  10511. return true;
  10512. return s.equalsIgnoreCase(myPlayer.name);
  10513. }
  10514.  
  10515. private static String combatDiffColor(int i, int j) {
  10516. int k = i - j;
  10517. if (k < -9)
  10518. return "@red@";
  10519. if (k < -6)
  10520. return "@or3@";
  10521. if (k < -3)
  10522. return "@or2@";
  10523. if (k < 0)
  10524. return "@or1@";
  10525. if (k > 9)
  10526. return "@gre@";
  10527. if (k > 6)
  10528. return "@gr3@";
  10529. if (k > 3)
  10530. return "@gr2@";
  10531. if (k > 0)
  10532. return "@gr1@";
  10533. else
  10534. return "@yel@";
  10535. }
  10536.  
  10537. private void setWaveVolume(int i) {
  10538. signlink.wavevol = i;
  10539. }
  10540.  
  10541. private void draw3dScreen() {
  10542. if (showChat)
  10543. drawSplitPrivateChat();
  10544.  
  10545. if (crossType == 1)
  10546. {
  10547. crosses[crossIndex / 100].drawSprite(crossX - 8 - (clientSize == 0 ? 4 : 0), crossY - 8 - (clientSize == 0 ? 4 : 0));
  10548. }
  10549. if (crossType == 2)
  10550. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - (clientSize == 0 ? 4 : 0), crossY - 8 - (clientSize == 0 ? 4 : 0));
  10551. if (anInt1055 == 1)
  10552. multiOverlay.drawSprite((clientSize == 0 ? 472 : (anInt1018 == 197 ? clientWidth - 268 : clientWidth - 255)), (clientSize == 0 ? 296 : (anInt1018 == 197 ? 48 : 20)));
  10553. if (anInt1018 != -1)
  10554. {
  10555. method119(anInt945, anInt1018);
  10556.  
  10557. if (anInt1018 == 11146 && clientSize != 0)
  10558. {
  10559. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], -5);
  10560. }
  10561. else if ((anInt1018 == 2804 || anInt1018 == 11479) && clientSize != 0)
  10562. {
  10563. drawInterface(0, clientWidth / 2 - 256, RSInterface.interfaceCache[anInt1018], -5);
  10564. }
  10565. else if (anInt1018 == 4535 && clientSize != 0)
  10566. {
  10567. drawInterface(0, -418, RSInterface.interfaceCache[anInt1018], -285);
  10568. }
  10569. else if ((anInt1018 == 15892 || anInt1018 == 15917 || anInt1018 == 15931 || anInt1018 == 15962) && clientSize != 0)
  10570. {
  10571. drawInterface(0, (anInt1018 == 15892 ? -325 : -349), RSInterface.interfaceCache[anInt1018], 25);
  10572. }
  10573. else
  10574. drawInterface(0, clientSize == 0 ? 0 : (clientWidth / 2) - -80, RSInterface.interfaceCache[anInt1018], clientSize == 0 ? 0 : (clientHeight / 2) - 550);
  10575. }
  10576. if (openInterfaceID != -1)
  10577. {
  10578. method119(anInt945, openInterfaceID);
  10579. drawInterface(0, clientSize == 0 ? 0 : (clientWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], clientSize == 0 ? 0 : (clientHeight / 2) - 230);
  10580. }
  10581. method70();
  10582. if (!menuOpen)
  10583. {
  10584. processRightClick();
  10585. drawTooltip();
  10586. }
  10587. else
  10588. drawMenu((clientSize == 0 ? 4 : 0), (clientSize == 0 ? 4 : 0));
  10589. /*drawSplitPrivateChat();
  10590. if(crossType == 1)
  10591. {
  10592. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10593. anInt1142++;
  10594. if(anInt1142 > 67)
  10595. {
  10596. anInt1142 = 0;
  10597. stream.createFrame(78);
  10598. }
  10599. }
  10600. if(crossType == 2)
  10601. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10602. if(anInt1018 != -1)
  10603. {
  10604. method119(anInt945, anInt1018);
  10605. drawInterface(0, clientSize == 0 ? 0 : (clientWidth / 2) - -80, RSInterface.interfaceCache[anInt1018], clientSize == 0 ? 0 : (clientHeight / 2) - 550);
  10606. //drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  10607. }
  10608. if(openInterfaceID != -1)
  10609. {
  10610. method119(anInt945, openInterfaceID);
  10611. drawInterface(0, clientSize == 0 ? 0 : (clientWidth / 2) - 256, RSInterface.interfaceCache[openInterfaceID], clientSize == 0 ? 0 : (clientHeight / 2) - 167);
  10612. //drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  10613. }
  10614. method70();
  10615. if(!menuOpen)
  10616. {
  10617.  
  10618. processRightClick();
  10619.  
  10620. drawTooltip();
  10621. } else
  10622. if(menuScreenArea == 0)
  10623. drawMenu(4, 4);
  10624. if(anInt1055 == 1)
  10625. headIcons[1].drawSprite(472, 296);*/
  10626. if(fpsOn)
  10627. {
  10628. char c = '\u01FB';
  10629. int k = 20;
  10630. int i1 = 0xffff00;
  10631. if(super.fps < 15)
  10632. i1 = 0xff0000;
  10633. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  10634. k += 15;
  10635. Runtime runtime = Runtime.getRuntime();
  10636. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10637. i1 = 0xffff00;
  10638. if(j1 > 0x2000000 && lowMem)
  10639. i1 = 0xff0000;
  10640. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10641. k += 15;
  10642. }
  10643. int x = baseX + (myPlayer.x - 6 >> 7);
  10644. int y = baseY + (myPlayer.y - 6 >> 7);
  10645. if (clientData) {
  10646. int calculateWidth = clientWidth - super.mouseX;
  10647. int calculateHeight = clientHeight - super.mouseY;
  10648. aTextDrawingArea_1271.method385(0xffff00, "Dimensions: " + clientWidth + " x " + clientHeight, clientSize == 0 ? 225 : showChat ? clientHeight - 277 : clientHeight - 140, 5);
  10649. aTextDrawingArea_1271.method385(0xffff00, "Mouse Positions: " + "clientWidth - " + calculateWidth + ", " + "clientHeight - " + calculateHeight, clientSize == 0 ? 240 : showChat ? clientHeight - 262 : clientHeight - 125, 5);
  10650.  
  10651. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, clientSize == 0 ? 285 : showChat ? clientHeight - 217 : clientHeight - 80, 5);
  10652. Runtime runtime = Runtime.getRuntime();
  10653. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10654. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", clientSize == 0 ? 299 : showChat ? clientHeight - 202 : clientHeight - 65, 5);
  10655. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, clientSize == 0 ? 314 : showChat ? clientHeight - 187 : clientHeight - 50, 5);
  10656. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, clientSize == 0 ? 329 : showChat ? clientHeight - 172 : clientHeight - 35, 5);
  10657. }
  10658. if(anInt1104 != 0)
  10659. {
  10660. int j = anInt1104 / 50;
  10661. int l = j / 60;
  10662. j %= 60;
  10663. if(j < 10)
  10664. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  10665. else
  10666. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  10667. anInt849++;
  10668. if(anInt849 > 75)
  10669. {
  10670. anInt849 = 0;
  10671. stream.createFrame(148);
  10672. }
  10673. }
  10674. }
  10675.  
  10676. private void addIgnore(long l) {
  10677. try {
  10678. if (l == 0L)
  10679. return;
  10680. if (ignoreCount >= 100) {
  10681. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10682. return;
  10683. }
  10684. String s = TextClass.fixName(TextClass.nameForLong(l));
  10685. for (int j = 0; j < ignoreCount; j++)
  10686. if (ignoreListAsLongs[j] == l) {
  10687. pushMessage(s + " is already on your ignore list", 0, "");
  10688. return;
  10689. }
  10690. for (int k = 0; k < friendsCount; k++)
  10691. if (friendsListAsLongs[k] == l) {
  10692. pushMessage("Please remove " + s
  10693. + " from your friend list first", 0, "");
  10694. return;
  10695. }
  10696.  
  10697. ignoreListAsLongs[ignoreCount++] = l;
  10698. needDrawTabArea = true;
  10699. stream.createFrame(133);
  10700. stream.writeQWord(l);
  10701. return;
  10702. } catch (RuntimeException runtimeexception) {
  10703. signlink.reporterror("45688, " + l + ", " + 4 + ", "
  10704. + runtimeexception.toString());
  10705. }
  10706. throw new RuntimeException();
  10707. }
  10708.  
  10709. private void method114() {
  10710. for (int i = -1; i < playerCount; i++) {
  10711. int j;
  10712. if (i == -1)
  10713. j = myPlayerIndex;
  10714. else
  10715. j = playerIndices[i];
  10716. Player player = playerArray[j];
  10717. if (player != null)
  10718. method96(player);
  10719. }
  10720.  
  10721. }
  10722.  
  10723. private void method115() {
  10724. if (loadingStage == 2) {
  10725. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  10726. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  10727. .reverseGetNext()) {
  10728. if (class30_sub1.anInt1294 > 0)
  10729. class30_sub1.anInt1294--;
  10730. if (class30_sub1.anInt1294 == 0) {
  10731. if (class30_sub1.anInt1299 < 0
  10732. || ObjectManager.method178(class30_sub1.anInt1299,
  10733. class30_sub1.anInt1301)) {
  10734. method142(class30_sub1.anInt1298,
  10735. class30_sub1.anInt1295, class30_sub1.anInt1300,
  10736. class30_sub1.anInt1301, class30_sub1.anInt1297,
  10737. class30_sub1.anInt1296, class30_sub1.anInt1299);
  10738. class30_sub1.unlink();
  10739. }
  10740. } else {
  10741. if (class30_sub1.anInt1302 > 0)
  10742. class30_sub1.anInt1302--;
  10743. if (class30_sub1.anInt1302 == 0
  10744. && class30_sub1.anInt1297 >= 1
  10745. && class30_sub1.anInt1298 >= 1
  10746. && class30_sub1.anInt1297 <= 102
  10747. && class30_sub1.anInt1298 <= 102
  10748. && (class30_sub1.anInt1291 < 0 || ObjectManager
  10749. .method178(class30_sub1.anInt1291,
  10750. class30_sub1.anInt1293))) {
  10751. method142(class30_sub1.anInt1298,
  10752. class30_sub1.anInt1295, class30_sub1.anInt1292,
  10753. class30_sub1.anInt1293, class30_sub1.anInt1297,
  10754. class30_sub1.anInt1296, class30_sub1.anInt1291);
  10755. class30_sub1.anInt1302 = -1;
  10756. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10757. && class30_sub1.anInt1299 == -1)
  10758. class30_sub1.unlink();
  10759. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10760. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  10761. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10762. class30_sub1.unlink();
  10763. }
  10764. }
  10765. }
  10766.  
  10767. }
  10768. }
  10769.  
  10770. private void determineMenuSize() {
  10771. int boxLength = chatTextDrawingArea.getTextWidth("Choose option");
  10772. for(int row = 0; row < menuActionRow; row++) {
  10773. int actionLength = chatTextDrawingArea.getTextWidth(menuActionName[row]);
  10774. if(actionLength > boxLength)
  10775. boxLength = actionLength;
  10776. }
  10777. boxLength += 8;
  10778. int offset = 15 * menuActionRow + 21;
  10779. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < 765 && super.saveClickY < 503) {
  10780. int xClick = super.saveClickX - boxLength / 2;
  10781. if(xClick + boxLength > 761) {
  10782. xClick = 761 - boxLength;
  10783. }
  10784. if(xClick < 0){
  10785. xClick = 0;
  10786. }
  10787. int yClick = super.saveClickY - 0;
  10788. if(yClick + offset > 497) {
  10789. yClick = 497 - offset;
  10790. }
  10791. if(yClick < 0) {
  10792. yClick = 0;
  10793. }
  10794. menuOpen = true;
  10795. menuOffsetX = xClick;
  10796. menuOffsetY = yClick;
  10797. menuWidth = boxLength;
  10798. menuHeight = 15 * menuActionRow + 22;
  10799. }
  10800. if (clientSize != 0) {
  10801. if (super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < clientWidth && super.saveClickY < clientHeight) {
  10802. int i1 = super.saveClickX - 0 - boxLength / 2;
  10803. if (i1 + boxLength > clientWidth)
  10804. i1 = clientWidth - boxLength;
  10805. if (i1 < 0)
  10806. i1 = 0;
  10807. int l1 = super.saveClickY - 0;
  10808. if (l1 + offset > clientHeight)
  10809. l1 = clientHeight - offset;
  10810. if (l1 < 0)
  10811. l1 = 0;
  10812. menuOpen = true;
  10813. menuScreenArea = 0;
  10814. menuOffsetX = i1;
  10815. menuOffsetY = l1;
  10816. menuWidth = boxLength;
  10817. menuHeight = 15 * menuActionRow + 22;
  10818. }
  10819. }
  10820. }
  10821.  
  10822. private void method117(Stream stream) {
  10823. stream.initBitAccess();
  10824. int j = stream.readBits(1);
  10825. if (j == 0)
  10826. return;
  10827. int k = stream.readBits(2);
  10828. if (k == 0) {
  10829. anIntArray894[anInt893++] = myPlayerIndex;
  10830. return;
  10831. }
  10832. if (k == 1) {
  10833. int l = stream.readBits(3);
  10834. myPlayer.moveInDir(false, l);
  10835. int k1 = stream.readBits(1);
  10836. if (k1 == 1)
  10837. anIntArray894[anInt893++] = myPlayerIndex;
  10838. return;
  10839. }
  10840. if (k == 2) {
  10841. int i1 = stream.readBits(3);
  10842. myPlayer.moveInDir(true, i1);
  10843. int l1 = stream.readBits(3);
  10844. myPlayer.moveInDir(true, l1);
  10845. int j2 = stream.readBits(1);
  10846. if (j2 == 1)
  10847. anIntArray894[anInt893++] = myPlayerIndex;
  10848. return;
  10849. }
  10850. if (k == 3) {
  10851. plane = stream.readBits(2);
  10852. int j1 = stream.readBits(1);
  10853. int i2 = stream.readBits(1);
  10854. if (i2 == 1)
  10855. anIntArray894[anInt893++] = myPlayerIndex;
  10856. int k2 = stream.readBits(7);
  10857. int l2 = stream.readBits(7);
  10858. myPlayer.setPos(l2, k2, j1 == 1);
  10859. }
  10860. }
  10861.  
  10862. private void nullLoader() {
  10863. aBoolean831 = false;
  10864. while (drawingFlames) {
  10865. aBoolean831 = false;
  10866. try {
  10867. Thread.sleep(50L);
  10868. } catch (Exception _ex) {
  10869. }
  10870. }
  10871. aBackground_967 = null;
  10872. aBackgroundArray1152s = null;
  10873. anIntArray850 = null;
  10874. anIntArray851 = null;
  10875. anIntArray852 = null;
  10876. anIntArray853 = null;
  10877. anIntArray1190 = null;
  10878. anIntArray1191 = null;
  10879. anIntArray828 = null;
  10880. anIntArray829 = null;
  10881. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10882. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10883. }
  10884.  
  10885. private boolean method119(int i, int j) {
  10886. boolean flag1 = false;
  10887. RSInterface class9 = RSInterface.interfaceCache[j];
  10888. for (int k = 0; k < class9.children.length; k++) {
  10889. if (class9.children[k] == -1)
  10890. break;
  10891. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10892. if (class9_1.type == 1)
  10893. flag1 |= method119(i, class9_1.id);
  10894. if (class9_1.type == 6
  10895. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  10896. boolean flag2 = interfaceIsSelected(class9_1);
  10897. int l;
  10898. if (flag2)
  10899. l = class9_1.anInt258;
  10900. else
  10901. l = class9_1.anInt257;
  10902. if (l != -1) {
  10903. Animation animation = Animation.anims[l];
  10904. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  10905. .method258(class9_1.anInt246);) {
  10906. class9_1.anInt208 -= animation
  10907. .method258(class9_1.anInt246) + 1;
  10908. class9_1.anInt246++;
  10909. if (class9_1.anInt246 >= animation.anInt352) {
  10910. class9_1.anInt246 -= animation.anInt356;
  10911. if (class9_1.anInt246 < 0
  10912. || class9_1.anInt246 >= animation.anInt352)
  10913. class9_1.anInt246 = 0;
  10914. }
  10915. flag1 = true;
  10916. }
  10917.  
  10918. }
  10919. }
  10920. }
  10921.  
  10922. return flag1;
  10923. }
  10924.  
  10925. private int method120() {
  10926. int j = 3;
  10927. if (yCameraCurve < 310) {
  10928. int k = xCameraPos >> 7;
  10929. int l = yCameraPos >> 7;
  10930. int i1 = myPlayer.x >> 7;
  10931. int j1 = myPlayer.y >> 7;
  10932. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10933. j = plane;
  10934. int k1;
  10935. if (i1 > k)
  10936. k1 = i1 - k;
  10937. else
  10938. k1 = k - i1;
  10939. int l1;
  10940. if (j1 > l)
  10941. l1 = j1 - l;
  10942. else
  10943. l1 = l - j1;
  10944. if (k1 > l1) {
  10945. int i2 = (l1 * 0x10000) / k1;
  10946. int k2 = 32768;
  10947. while (k != i1) {
  10948. if (k < i1)
  10949. k++;
  10950. else if (k > i1)
  10951. k--;
  10952. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10953. j = plane;
  10954. k2 += i2;
  10955. if (k2 >= 0x10000) {
  10956. k2 -= 0x10000;
  10957. if (l < j1)
  10958. l++;
  10959. else if (l > j1)
  10960. l--;
  10961. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10962. j = plane;
  10963. }
  10964. }
  10965. } else {
  10966. int j2 = (k1 * 0x10000) / l1;
  10967. int l2 = 32768;
  10968. while (l != j1) {
  10969. if (l < j1)
  10970. l++;
  10971. else if (l > j1)
  10972. l--;
  10973. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10974. j = plane;
  10975. l2 += j2;
  10976. if (l2 >= 0x10000) {
  10977. l2 -= 0x10000;
  10978. if (k < i1)
  10979. k++;
  10980. else if (k > i1)
  10981. k--;
  10982. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10983. j = plane;
  10984. }
  10985. }
  10986. }
  10987. }
  10988. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10989. j = plane;
  10990. return j;
  10991. }
  10992.  
  10993. private int method121() {
  10994. int j = method42(plane, yCameraPos, xCameraPos);
  10995. if (j - zCameraPos < 800
  10996. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10997. return plane;
  10998. else
  10999. return 3;
  11000. }
  11001.  
  11002. private void delIgnore(long l) {
  11003. try {
  11004. if (l == 0L)
  11005. return;
  11006. for (int j = 0; j < ignoreCount; j++)
  11007. if (ignoreListAsLongs[j] == l) {
  11008. ignoreCount--;
  11009. needDrawTabArea = true;
  11010. System.arraycopy(ignoreListAsLongs, j + 1,
  11011. ignoreListAsLongs, j, ignoreCount - j);
  11012.  
  11013. stream.createFrame(74);
  11014. stream.writeQWord(l);
  11015. return;
  11016. }
  11017.  
  11018. return;
  11019. } catch (RuntimeException runtimeexception) {
  11020. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  11021. + runtimeexception.toString());
  11022. }
  11023. throw new RuntimeException();
  11024. }
  11025.  
  11026. public String getParameter(String s) {
  11027. if (signlink.mainapp != null)
  11028. return signlink.mainapp.getParameter(s);
  11029. else
  11030. return super.getParameter(s);
  11031. }
  11032.  
  11033. private void adjustVolume(boolean flag, int i) {
  11034. signlink.midivol = i;
  11035. if (flag)
  11036. signlink.midi = "voladjust";
  11037. }
  11038.  
  11039. private int extractInterfaceValues(RSInterface class9, int j) {
  11040. if (class9.valueIndexArray == null
  11041. || j >= class9.valueIndexArray.length)
  11042. return -2;
  11043. try {
  11044. int ai[] = class9.valueIndexArray[j];
  11045. int k = 0;
  11046. int l = 0;
  11047. int i1 = 0;
  11048. do {
  11049. int j1 = ai[l++];
  11050. int k1 = 0;
  11051. byte byte0 = 0;
  11052. if (j1 == 0)
  11053. return k;
  11054. if (j1 == 1)
  11055. k1 = currentStats[ai[l++]];
  11056. if (j1 == 2)
  11057. k1 = maxStats[ai[l++]];
  11058. if (j1 == 3)
  11059. k1 = currentExp[ai[l++]];
  11060. if (j1 == 4) {
  11061. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  11062. int k2 = ai[l++];
  11063. if (k2 >= 0 && k2 < ItemDef.totalItems
  11064. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  11065. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  11066. if (class9_1.inv[j3] == k2 + 1)
  11067. k1 += class9_1.invStackSizes[j3];
  11068.  
  11069. }
  11070. }
  11071. if (j1 == 5)
  11072. k1 = variousSettings[ai[l++]];
  11073. if (j1 == 6)
  11074. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  11075. if (j1 == 7)
  11076. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11077. if (j1 == 8)
  11078. k1 = myPlayer.combatLevel;
  11079. if (j1 == 9) {
  11080. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  11081. if (Skills.skillEnabled[l1])
  11082. k1 += maxStats[l1];
  11083.  
  11084. }
  11085. if (j1 == 10) {
  11086. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11087. int l2 = ai[l++] + 1;
  11088. if (l2 >= 0 && l2 < ItemDef.totalItems
  11089. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  11090. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  11091. if (class9_2.inv[k3] != l2)
  11092. continue;
  11093. k1 = 0x3b9ac9ff;
  11094. break;
  11095. }
  11096.  
  11097. }
  11098. }
  11099. if (j1 == 11)
  11100. k1 = energy;
  11101. if (j1 == 12)
  11102. k1 = weight;
  11103. if (j1 == 13) {
  11104. int i2 = variousSettings[ai[l++]];
  11105. int i3 = ai[l++];
  11106. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11107. }
  11108. if (j1 == 14) {
  11109. int j2 = ai[l++];
  11110. VarBit varBit = VarBit.cache[j2];
  11111. int l3 = varBit.anInt648;
  11112. int i4 = varBit.anInt649;
  11113. int j4 = varBit.anInt650;
  11114. int k4 = anIntArray1232[j4 - i4];
  11115. k1 = variousSettings[l3] >> i4 & k4;
  11116. }
  11117. if (j1 == 15)
  11118. byte0 = 1;
  11119. if (j1 == 16)
  11120. byte0 = 2;
  11121. if (j1 == 17)
  11122. byte0 = 3;
  11123. if (j1 == 18)
  11124. k1 = (myPlayer.x >> 7) + baseX;
  11125. if (j1 == 19)
  11126. k1 = (myPlayer.y >> 7) + baseY;
  11127. if (j1 == 20)
  11128. k1 = ai[l++];
  11129. if (byte0 == 0) {
  11130. if (i1 == 0)
  11131. k += k1;
  11132. if (i1 == 1)
  11133. k -= k1;
  11134. if (i1 == 2 && k1 != 0)
  11135. k /= k1;
  11136. if (i1 == 3)
  11137. k *= k1;
  11138. i1 = 0;
  11139. } else {
  11140. i1 = byte0;
  11141. }
  11142. } while (true);
  11143. } catch (Exception _ex) {
  11144. return -1;
  11145. }
  11146. }
  11147.  
  11148. private void drawTooltip() {
  11149. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11150. return;
  11151. String s;
  11152. if (itemSelected == 1 && menuActionRow < 2)
  11153. s = "Use " + selectedItemName + " with...";
  11154. else if (spellSelected == 1 && menuActionRow < 2)
  11155. s = spellTooltip + "...";
  11156. else
  11157. s = menuActionName[menuActionRow - 1];
  11158. if (menuActionRow > 2)
  11159. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11160. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11161. }
  11162.  
  11163. private void drawMinimap() {
  11164. if(clientSize == 0) {
  11165. aRSImageProducer_1164.initDrawingArea();
  11166. }
  11167. if(clientSize != 0) {
  11168. for(int i = 0; i < 76; i++) {
  11169. int amt = (int)(Math.sqrt(Math.pow(77, 2) - Math.pow(75-i, 2)));
  11170. anIntArray1229[i] = 2 * amt + 2;
  11171. anIntArray1229[150-i] = 2 * amt + 2;
  11172. anIntArray1052[i] = -amt + 73;
  11173. anIntArray1052[150-i] = -amt + 73;
  11174. }
  11175. }
  11176. if(anInt1021 == 2) {
  11177.  
  11178. if (clientSize == 0) {
  11179. cacheSprite[32].drawSprite(0, 0);
  11180. } else {
  11181. cacheSprite[33].drawSprite(clientWidth - 238, 3);
  11182. }
  11183. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, (clientSize == 0 ? 4 : 4 + 3), (clientSize == 0 ? 34 - 5 : clientWidth + 34 - 5 - 238), 33, 25);
  11184. if (loadOrbs)
  11185. loadAllOrbs(clientSize == 0 ? 0 : clientWidth - 217);
  11186. aRSImageProducer_1165.initDrawingArea();
  11187. return;
  11188. }
  11189. int i = minimapInt1 + minimapInt2 & 0x7ff;
  11190. int j = 48 + myPlayer.x / 32;
  11191. int l2 = 464 - myPlayer.y / 32;
  11192.  
  11193. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, (clientSize == 0 ? 9 : 12), (clientSize == 0 ? 59 - 5 : clientWidth + 59 - 5 - 238), 146, j);
  11194. for(int j5 = 0; j5 < anInt1071; j5++) {
  11195. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11196. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11197. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  11198. }
  11199. for(int k5 = 0; k5 < 104; k5++) {
  11200. for(int l5 = 0; l5 < 104; l5++) {
  11201. NodeList class19 = groundArray[plane][k5][l5];
  11202. if(class19 != null) {
  11203. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11204. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11205. markMinimap(mapDotItem, l, j3);
  11206. }
  11207. }
  11208. }
  11209. for(int i6 = 0; i6 < npcCount; i6++) {
  11210. NPC npc = npcArray[npcIndices[i6]];
  11211. if(npc != null && npc.isVisible()) {
  11212. EntityDef entityDef = npc.desc;
  11213. if(entityDef.childrenIDs != null)
  11214. entityDef = entityDef.method161();
  11215. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  11216. int i1 = npc.x / 32 - myPlayer.x / 32;
  11217. int k3 = npc.y / 32 - myPlayer.y / 32;
  11218. markMinimap(mapDotNPC, i1, k3);
  11219. }
  11220. }
  11221. }
  11222. for (int j6 = 0; j6 < playerCount; j6++) {
  11223. Player player = playerArray[playerIndices[j6]];
  11224. if (player != null && player.isVisible()) {
  11225. int j1 = player.x / 32 - myPlayer.x / 32;
  11226. int l3 = player.y / 32 - myPlayer.y / 32;
  11227. boolean flag1 = false;
  11228. boolean flag3 = false;
  11229. for (int j3 = 0; j3 < clanList.length; j3++) {
  11230. if (clanList[j3] == null)
  11231. continue;
  11232. if (!clanList[j3].equalsIgnoreCase(player.name))
  11233. continue;
  11234. flag3 = true;
  11235. break;
  11236. }
  11237. long l6 = TextClass.longForName(player.name);
  11238. for (int k6 = 0; k6 < friendsCount; k6++) {
  11239. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  11240. continue;
  11241. flag1 = true;
  11242. break;
  11243. }
  11244. boolean flag2 = false;
  11245. if (myPlayer.team != 0 && player.team != 0
  11246. && myPlayer.team == player.team)
  11247. flag2 = true;
  11248. if (flag1)
  11249. markMinimap(mapDotFriend, j1, l3);
  11250. else if (flag3)
  11251. markMinimap(mapDotClan, j1, l3);
  11252. else if (flag2)
  11253. markMinimap(mapDotTeam, j1, l3);
  11254. else
  11255. markMinimap(mapDotPlayer, j1, l3);
  11256. }
  11257. }
  11258. if(anInt855 != 0 && loopCycle % 20 < 10) {
  11259. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  11260. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11261. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  11262. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  11263. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  11264. method81(mapMarker, i4, k1);
  11265. }
  11266. }
  11267. if(anInt855 == 2) {
  11268. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11269. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11270. method81(mapMarker, j4, l1);
  11271. }
  11272. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  11273. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11274. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  11275. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  11276. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  11277. method81(mapMarker, k4, i2);
  11278. }
  11279. }
  11280. }
  11281. if(destX != 0) {
  11282. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11283. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11284. markMinimap(mapFlag, j2, l4);
  11285. }
  11286.  
  11287. if(clientSize != 0) {
  11288. cacheSprite[33].drawSprite(clientWidth - 238, 3);
  11289. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, (clientSize == 0 ? 4 : 4 + 3), (clientSize == 0 ? 34 - 5 : clientWidth + 34 - 5 - 238), 33, 25);
  11290. }
  11291.  
  11292. DrawingArea.drawPixels(3, (clientSize == 0 ? 9 : 12) + 74, (clientSize == 0 ? 130 - 5 : clientWidth + 130 - 5 - 238), 0xffffff, 3);
  11293.  
  11294. if (clientSize == 0) {
  11295. cacheSprite[24].drawSprite(0, 0);
  11296. cacheSprite[26].method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 4, 29, 33, 25);
  11297. }
  11298. if (loadOrbs )
  11299. loadAllOrbs(clientSize == 0 ? 0 : clientWidth - 250);
  11300. if(menuOpen && clientSize == 0)
  11301. drawMenu(516, 0);
  11302. else if (menuOpen && menuScreenArea == 3 && clientSize != 0)
  11303. drawMenu(516, 0);
  11304.  
  11305.  
  11306. aRSImageProducer_1165.initDrawingArea();
  11307. }
  11308.  
  11309. private void npcScreenPos(Entity entity, int i) {
  11310. calcEntityScreenPos(entity.x, i, entity.y);
  11311. }
  11312.  
  11313. private void calcEntityScreenPos(int i, int j, int l) {
  11314. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  11315. spriteDrawX = -1;
  11316. spriteDrawY = -1;
  11317. return;
  11318. }
  11319. int i1 = method42(plane, l, i) - j;
  11320. i -= xCameraPos;
  11321. i1 -= zCameraPos;
  11322. l -= yCameraPos;
  11323. int j1 = Model.modelIntArray1[yCameraCurve];
  11324. int k1 = Model.modelIntArray2[yCameraCurve];
  11325. int l1 = Model.modelIntArray1[xCameraCurve];
  11326. int i2 = Model.modelIntArray2[xCameraCurve];
  11327. int j2 = l * l1 + i * i2 >> 16;
  11328. l = l * i2 - i * l1 >> 16;
  11329. i = j2;
  11330. j2 = i1 * k1 - l * j1 >> 16;
  11331. l = i1 * j1 + l * k1 >> 16;
  11332. i1 = j2;
  11333. if (l >= 50) {
  11334. spriteDrawX = Rasterizer.textureInt1 + (i << 9) / l;
  11335. spriteDrawY = Rasterizer.textureInt2 + (i1 << 9) / l;
  11336. } else {
  11337. spriteDrawX = -1;
  11338. spriteDrawY = -1;
  11339. }
  11340. }
  11341.  
  11342. private void buildSplitPrivateChatMenu() {
  11343. if (splitPrivateChat == 0)
  11344. return;
  11345. int i = 0;
  11346. if (anInt1104 != 0)
  11347. i = 1;
  11348. for (int j = 0; j < 100; j++)
  11349. if (chatMessages[j] != null) {
  11350. int k = chatTypes[j];
  11351. String s = chatNames[j];
  11352. if (s != null && s.startsWith("@cr1@")) {
  11353. s = s.substring(5);
  11354. }
  11355. if (s != null && s.startsWith("@cr2@")) {
  11356. s = s.substring(5);
  11357. }
  11358. if (s != null && s.startsWith("@cr3@")) {
  11359. s = s.substring(5);
  11360. }
  11361. if (s != null && s.startsWith("@cr4@")) {
  11362. s = s.substring(5);
  11363. }
  11364. if (s != null && s.startsWith("@cr5@")) {
  11365. s = s.substring(5);
  11366. }
  11367. if (s != null && s.startsWith("@cr6@")) {
  11368. s = s.substring(5);
  11369. }
  11370. if (s != null && s.startsWith("@cr7@")) {
  11371. s = s.substring(5);
  11372. }
  11373. if (s != null && s.startsWith("@cr8@")) {
  11374. s = s.substring(5);
  11375. }
  11376. if (s != null && s.startsWith("@cr9@")) {
  11377. s = s.substring(5);
  11378. }
  11379. if (s != null && s.startsWith("@cr10@")) {
  11380. s = s.substring(6);
  11381. }
  11382. if ((k == 3 || k == 7)
  11383. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  11384. && isFriendOrSelf(s))) {
  11385. int l = 329 - i * 13;
  11386. if (super.mouseX > 4 && super.mouseY - 4 > l - 10
  11387. && super.mouseY - 4 <= l + 3) {
  11388. int i1 = aTextDrawingArea_1271.getTextWidth("From: "
  11389. + s + chatMessages[j]) + 25;
  11390. if (i1 > 450)
  11391. i1 = 450;
  11392. if (super.mouseX < 4 + i1) {
  11393. if (myPrivilege >= 1) {
  11394. menuActionName[menuActionRow] = "Report abuse @whi@"
  11395. + s;
  11396. menuActionID[menuActionRow] = 2606;
  11397. menuActionRow++;
  11398. }
  11399. menuActionName[menuActionRow] = "Add ignore @whi@"
  11400. + s;
  11401. menuActionID[menuActionRow] = 2042;
  11402. menuActionRow++;
  11403. menuActionName[menuActionRow] = "Add friend @whi@"
  11404. + s;
  11405. menuActionID[menuActionRow] = 2337;
  11406. menuActionRow++;
  11407. }
  11408. }
  11409. if (++i >= 5)
  11410. return;
  11411. }
  11412. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11413. return;
  11414. }
  11415.  
  11416. }
  11417.  
  11418. private void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  11419. int i2, int j2) {
  11420. Class30_Sub1 class30_sub1 = null;
  11421. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11422. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11423. .reverseGetNext()) {
  11424. if (class30_sub1_1.anInt1295 != l1
  11425. || class30_sub1_1.anInt1297 != i2
  11426. || class30_sub1_1.anInt1298 != j1
  11427. || class30_sub1_1.anInt1296 != i1)
  11428. continue;
  11429. class30_sub1 = class30_sub1_1;
  11430. break;
  11431. }
  11432.  
  11433. if (class30_sub1 == null) {
  11434. class30_sub1 = new Class30_Sub1();
  11435. class30_sub1.anInt1295 = l1;
  11436. class30_sub1.anInt1296 = i1;
  11437. class30_sub1.anInt1297 = i2;
  11438. class30_sub1.anInt1298 = j1;
  11439. method89(class30_sub1);
  11440. aClass19_1179.insertHead(class30_sub1);
  11441. }
  11442. class30_sub1.anInt1291 = k;
  11443. class30_sub1.anInt1293 = k1;
  11444. class30_sub1.anInt1292 = l;
  11445. class30_sub1.anInt1302 = j2;
  11446. class30_sub1.anInt1294 = j;
  11447. }
  11448.  
  11449. private boolean interfaceIsSelected(RSInterface class9) {
  11450. if (class9.anIntArray245 == null)
  11451. return false;
  11452. for (int i = 0; i < class9.anIntArray245.length; i++) {
  11453. int j = extractInterfaceValues(class9, i);
  11454. int k = class9.anIntArray212[i];
  11455. if (class9.anIntArray245[i] == 2) {
  11456. if (j >= k)
  11457. return false;
  11458. } else if (class9.anIntArray245[i] == 3) {
  11459. if (j <= k)
  11460. return false;
  11461. } else if (class9.anIntArray245[i] == 4) {
  11462. if (j == k)
  11463. return false;
  11464. } else if (j != k)
  11465. return false;
  11466. }
  11467.  
  11468. return true;
  11469. }
  11470.  
  11471. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  11472. // if(!aBoolean872)
  11473. // if(signlink.mainapp != null)
  11474. // return signlink.openurl(s);
  11475. // else
  11476. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11477. if (aSocket832 != null) {
  11478. try {
  11479. aSocket832.close();
  11480. } catch (Exception _ex) {
  11481. }
  11482. aSocket832 = null;
  11483. }
  11484. aSocket832 = openSocket(43595);
  11485. aSocket832.setSoTimeout(10000);
  11486. java.io.InputStream inputstream = aSocket832.getInputStream();
  11487. OutputStream outputstream = aSocket832.getOutputStream();
  11488. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11489. return new DataInputStream(inputstream);
  11490. }
  11491.  
  11492. private void doFlamesDrawing() {
  11493. char c = '\u0100';
  11494. if (anInt1040 > 0) {
  11495. for (int i = 0; i < 256; i++)
  11496. if (anInt1040 > 768)
  11497. anIntArray850[i] = method83(anIntArray851[i],
  11498. anIntArray852[i], 1024 - anInt1040);
  11499. else if (anInt1040 > 256)
  11500. anIntArray850[i] = anIntArray852[i];
  11501. else
  11502. anIntArray850[i] = method83(anIntArray852[i],
  11503. anIntArray851[i], 256 - anInt1040);
  11504.  
  11505. } else if (anInt1041 > 0) {
  11506. for (int j = 0; j < 256; j++)
  11507. if (anInt1041 > 768)
  11508. anIntArray850[j] = method83(anIntArray851[j],
  11509. anIntArray853[j], 1024 - anInt1041);
  11510. else if (anInt1041 > 256)
  11511. anIntArray850[j] = anIntArray853[j];
  11512. else
  11513. anIntArray850[j] = method83(anIntArray853[j],
  11514. anIntArray851[j], 256 - anInt1041);
  11515.  
  11516. } else {
  11517. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11518.  
  11519. }
  11520. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  11521. aRSImageProducer_1110.anIntArray315, 0, 33920);
  11522.  
  11523. int i1 = 0;
  11524. int j1 = 1152;
  11525. for (int k1 = 1; k1 < c - 1; k1++) {
  11526. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11527. int j2 = 22 + l1;
  11528. if (j2 < 0)
  11529. j2 = 0;
  11530. i1 += j2;
  11531. for (int l2 = j2; l2 < 128; l2++) {
  11532. int j3 = anIntArray828[i1++];
  11533. if (j3 != 0) {
  11534. int l3 = j3;
  11535. int j4 = 256 - j3;
  11536. j3 = anIntArray850[j3];
  11537. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  11538. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  11539. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  11540. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11541. } else {
  11542. j1++;
  11543. }
  11544. }
  11545.  
  11546. j1 += j2;
  11547. }
  11548.  
  11549. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  11550. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  11551. aRSImageProducer_1111.anIntArray315, 0, 33920);
  11552.  
  11553. i1 = 0;
  11554. j1 = 1176;
  11555. for (int k2 = 1; k2 < c - 1; k2++) {
  11556. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11557. int k3 = 103 - i3;
  11558. j1 += i3;
  11559. for (int i4 = 0; i4 < k3; i4++) {
  11560. int k4 = anIntArray828[i1++];
  11561. if (k4 != 0) {
  11562. int i5 = k4;
  11563. int j5 = 256 - k4;
  11564. k4 = anIntArray850[k4];
  11565. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  11566. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  11567. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  11568. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11569. } else {
  11570. j1++;
  11571. }
  11572. }
  11573.  
  11574. i1 += 128 - k3;
  11575. j1 += 128 - k3 - i3;
  11576. }
  11577.  
  11578. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11579. }
  11580.  
  11581. private void method134(Stream stream) {
  11582. int j = stream.readBits(8);
  11583. if (j < playerCount) {
  11584. for (int k = j; k < playerCount; k++)
  11585. anIntArray840[anInt839++] = playerIndices[k];
  11586.  
  11587. }
  11588. if (j > playerCount) {
  11589. signlink.reporterror(myUsername + " Too many players");
  11590. throw new RuntimeException("eek");
  11591. }
  11592. playerCount = 0;
  11593. for (int l = 0; l < j; l++) {
  11594. int i1 = playerIndices[l];
  11595. Player player = playerArray[i1];
  11596. int j1 = stream.readBits(1);
  11597. if (j1 == 0) {
  11598. playerIndices[playerCount++] = i1;
  11599. player.anInt1537 = loopCycle;
  11600. } else {
  11601. int k1 = stream.readBits(2);
  11602. if (k1 == 0) {
  11603. playerIndices[playerCount++] = i1;
  11604. player.anInt1537 = loopCycle;
  11605. anIntArray894[anInt893++] = i1;
  11606. } else if (k1 == 1) {
  11607. playerIndices[playerCount++] = i1;
  11608. player.anInt1537 = loopCycle;
  11609. int l1 = stream.readBits(3);
  11610. player.moveInDir(false, l1);
  11611. int j2 = stream.readBits(1);
  11612. if (j2 == 1)
  11613. anIntArray894[anInt893++] = i1;
  11614. } else if (k1 == 2) {
  11615. playerIndices[playerCount++] = i1;
  11616. player.anInt1537 = loopCycle;
  11617. int i2 = stream.readBits(3);
  11618. player.moveInDir(true, i2);
  11619. int k2 = stream.readBits(3);
  11620. player.moveInDir(true, k2);
  11621. int l2 = stream.readBits(1);
  11622. if (l2 == 1)
  11623. anIntArray894[anInt893++] = i1;
  11624. } else if (k1 == 3)
  11625. anIntArray840[anInt839++] = i1;
  11626. }
  11627. }
  11628. }
  11629.  
  11630. public Sprite Background = new Sprite("Login/Background");
  11631. public Sprite CheckedBox = new Sprite("Login/CheckedBox");
  11632. public Sprite LoginBox = new Sprite("Login/LoginBox");
  11633. public Sprite FeildN = new Sprite("Login/FeildN");
  11634. public Sprite FeildH = new Sprite("Login/FeildH");
  11635. public Sprite Tick = new Sprite("Login/tick");
  11636. public Sprite UnCheckedBox = new Sprite("Login/UnCheckedBox");
  11637. public Sprite LoginN = new Sprite("Login/LoginN");
  11638. public Sprite LoginH = new Sprite("Login/LoginH");
  11639.  
  11640. private void drawLoginScreen(boolean flag) {
  11641. try {
  11642. resetImageProducers();
  11643. aRSImageProducer_1109.initDrawingArea();
  11644. if (loginScreenState == 0) {
  11645. Background.drawSprite(0, 0);
  11646. LoginBox.drawAdvancedSprite(170, 150);
  11647. FeildN.drawHoverSprite(320, 230,FeildH);
  11648. CheckedBox.drawHoverSprite(230, 323,UnCheckedBox);
  11649. if(RemberMeSelected == 1) {
  11650. Tick.drawAdvancedSprite(232, 327);
  11651. }
  11652. FeildN.drawHoverSprite(320, 280,FeildH);
  11653. LoginN.drawHoverSprite(460, 325,LoginH);
  11654. this.smallText.method382(16777215, 415, this.loginMessage1,375, true);
  11655. this.smallText.method382(16777215, 420, this.loginMessage2,395, true);
  11656. this.aTextDrawingArea_1271.method389(false,340,16777215,new StringBuilder().append("").append(capitalize(myUsername)).append(((this.loginScreenCursorPos == 0 ? 1: 0) & (loopCycle % 40 < 20 ? 1: 0)) != 0 ? "|" : "").toString(), 253);
  11657. this.aTextDrawingArea_1271.method389(true,340,16777215,new StringBuilder().append("").append(TextClass.passwordAsterisks(myPassword)).append(((this.loginScreenCursorPos == 1 ? 1: 0) & (loopCycle % 40 < 20 ? 1: 0)) != 0 ? "|" : "").toString(), 305);
  11658. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  11659. if (welcomeScreenRaised) {
  11660. }
  11661. }
  11662. } catch (Exception e) {
  11663.  
  11664. }
  11665. }
  11666.  
  11667. private void drawFlames() {
  11668. }
  11669.  
  11670. public void raiseWelcomeScreen() {
  11671. welcomeScreenRaised = true;
  11672. }
  11673.  
  11674. private void method137(Stream stream, int j) {
  11675. if (j == 84) {
  11676. int k = stream.readUnsignedByte();
  11677. int j3 = anInt1268 + (k >> 4 & 7);
  11678. int i6 = anInt1269 + (k & 7);
  11679. int l8 = stream.readUnsignedWord();
  11680. int k11 = stream.readUnsignedWord();
  11681. int l13 = stream.readUnsignedWord();
  11682. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  11683. NodeList class19_1 = groundArray[plane][j3][i6];
  11684. if (class19_1 != null) {
  11685. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  11686. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  11687. .reverseGetNext()) {
  11688. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11689. continue;
  11690. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11691. break;
  11692. }
  11693.  
  11694. spawnGroundItem(j3, i6);
  11695. }
  11696. }
  11697. return;
  11698. }
  11699. if (j == 105) {
  11700. int l = stream.readUnsignedByte();
  11701. int k3 = anInt1268 + (l >> 4 & 7);
  11702. int j6 = anInt1269 + (l & 7);
  11703. int i9 = stream.readUnsignedWord();
  11704. int l11 = stream.readUnsignedByte();
  11705. int i14 = l11 >> 4 & 0xf;
  11706. int i16 = l11 & 7;
  11707. if (myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14
  11708. && myPlayer.smallX[0] <= j6 + i14 && aBoolean848 && !lowMem && anInt1062 < 50) {
  11709. anIntArray1207[anInt1062] = i9;
  11710. anIntArray1241[anInt1062] = i16;
  11711. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11712. anInt1062++;
  11713. }
  11714. }
  11715. if (j == 215) {
  11716. int i1 = stream.method435();
  11717. int l3 = stream.method428();
  11718. int k6 = anInt1268 + (l3 >> 4 & 7);
  11719. int j9 = anInt1269 + (l3 & 7);
  11720. int i12 = stream.method435();
  11721. int j14 = stream.readUnsignedWord();
  11722. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10) {
  11723. Item class30_sub2_sub4_sub2_2 = new Item();
  11724. class30_sub2_sub4_sub2_2.ID = i1;
  11725. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11726. if (groundArray[plane][k6][j9] == null)
  11727. groundArray[plane][k6][j9] = new NodeList();
  11728. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11729. spawnGroundItem(k6, j9);
  11730. }
  11731. return;
  11732. }
  11733. if (j == 156) {
  11734. int j1 = stream.method426();
  11735. int i4 = anInt1268 + (j1 >> 4 & 7);
  11736. int l6 = anInt1269 + (j1 & 7);
  11737. int k9 = stream.readUnsignedWord();
  11738. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  11739. NodeList class19 = groundArray[plane][i4][l6];
  11740. if (class19 != null) {
  11741. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  11742. .reverseGetNext()) {
  11743. if (item.ID != (k9 & 0x7fff))
  11744. continue;
  11745. item.unlink();
  11746. break;
  11747. }
  11748.  
  11749. if (class19.reverseGetFirst() == null)
  11750. groundArray[plane][i4][l6] = null;
  11751. spawnGroundItem(i4, l6);
  11752. }
  11753. }
  11754. return;
  11755. }
  11756. if (j == 160) {
  11757. int k1 = stream.method428();
  11758. int j4 = anInt1268 + (k1 >> 4 & 7);
  11759. int i7 = anInt1269 + (k1 & 7);
  11760. int l9 = stream.method428();
  11761. int j12 = l9 >> 2;
  11762. int k14 = l9 & 3;
  11763. int j16 = anIntArray1177[j12];
  11764. int j17 = stream.method435();
  11765. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  11766. int j18 = intGroundArray[plane][j4][i7];
  11767. int i19 = intGroundArray[plane][j4 + 1][i7];
  11768. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11769. int k20 = intGroundArray[plane][j4][i7 + 1];
  11770. if (j16 == 0) {
  11771. Object1 class10 = worldController.method296(plane, j4, i7);
  11772. if (class10 != null) {
  11773. int k21 = class10.uid >> 14 & 0x7fff;
  11774. if (j12 == 2) {
  11775. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  11776. false);
  11777. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  11778. j17, false);
  11779. } else {
  11780. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17,
  11781. false);
  11782. }
  11783. }
  11784. }
  11785. if (j16 == 1) {
  11786. Object2 class26 = worldController.method297(j4, i7, plane);
  11787. if (class26 != null)
  11788. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  11789. j18, k20, j17, false);
  11790. }
  11791. if (j16 == 2) {
  11792. Object5 class28 = worldController.method298(j4, i7, plane);
  11793. if (j12 == 11)
  11794. j12 = 10;
  11795. if (class28 != null)
  11796. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19,
  11797. l19, j18, k20, j17, false);
  11798. }
  11799. if (j16 == 3) {
  11800. GroundDecoration class49 = worldController.method299(i7, j4, plane);
  11801. if (class49 != null)
  11802. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19,
  11803. l19, j18, k20, j17, false);
  11804. }
  11805. }
  11806. return;
  11807. }
  11808. if (j == 147) {
  11809. int l1 = stream.method428();
  11810. int k4 = anInt1268 + (l1 >> 4 & 7);
  11811. int j7 = anInt1269 + (l1 & 7);
  11812. int i10 = stream.readUnsignedWord();
  11813. byte byte0 = stream.method430();
  11814. int l14 = stream.method434();
  11815. byte byte1 = stream.method429();
  11816. int k17 = stream.readUnsignedWord();
  11817. int k18 = stream.method428();
  11818. int j19 = k18 >> 2;
  11819. int i20 = k18 & 3;
  11820. int l20 = anIntArray1177[j19];
  11821. byte byte2 = stream.readSignedByte();
  11822. int l21 = stream.readUnsignedWord();
  11823. byte byte3 = stream.method429();
  11824. Player player;
  11825. if (i10 == unknownInt10)
  11826. player = myPlayer;
  11827. else
  11828. player = playerArray[i10];
  11829. if (player != null) {
  11830. ObjectDef class46 = ObjectDef.forID(l21);
  11831. int i22 = intGroundArray[plane][k4][j7];
  11832. int j22 = intGroundArray[plane][k4 + 1][j7];
  11833. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11834. int l22 = intGroundArray[plane][k4][j7 + 1];
  11835. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11836. if (model != null) {
  11837. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11838. player.anInt1707 = l14 + loopCycle;
  11839. player.anInt1708 = k17 + loopCycle;
  11840. player.aModel_1714 = model;
  11841. int i23 = class46.anInt744;
  11842. int j23 = class46.anInt761;
  11843. if (i20 == 1 || i20 == 3) {
  11844. i23 = class46.anInt761;
  11845. j23 = class46.anInt744;
  11846. }
  11847. player.anInt1711 = k4 * 128 + i23 * 64;
  11848. player.anInt1713 = j7 * 128 + j23 * 64;
  11849. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11850. if (byte2 > byte0) {
  11851. byte byte4 = byte2;
  11852. byte2 = byte0;
  11853. byte0 = byte4;
  11854. }
  11855. if (byte3 > byte1) {
  11856. byte byte5 = byte3;
  11857. byte3 = byte1;
  11858. byte1 = byte5;
  11859. }
  11860. player.anInt1719 = k4 + byte2;
  11861. player.anInt1721 = k4 + byte0;
  11862. player.anInt1720 = j7 + byte3;
  11863. player.anInt1722 = j7 + byte1;
  11864. }
  11865. }
  11866. }
  11867. if (j == 151) {
  11868. int i2 = stream.method426();
  11869. int l4 = anInt1268 + (i2 >> 4 & 7);
  11870. int k7 = anInt1269 + (i2 & 7);
  11871. int j10 = stream.method434();
  11872. int k12 = stream.method428();
  11873. int i15 = k12 >> 2;
  11874. int k16 = k12 & 3;
  11875. int l17 = anIntArray1177[i15];
  11876. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104) {
  11877. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11878. }
  11879. //System.out.println("Packet 151: " + i2 + ", " + j10 + ", " + k12);
  11880. return;
  11881. }
  11882. if (j == 4) {
  11883. int j2 = stream.readUnsignedByte();
  11884. int i5 = anInt1268 + (j2 >> 4 & 7);
  11885. int l7 = anInt1269 + (j2 & 7);
  11886. int k10 = stream.readUnsignedWord();
  11887. int l12 = stream.readUnsignedByte();
  11888. int j15 = stream.readUnsignedWord();
  11889. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  11890. i5 = i5 * 128 + 64;
  11891. l7 = l7 * 128 + 64;
  11892. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10,
  11893. method42(plane, l7, i5) - l12, l7, i5);
  11894. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11895. }
  11896. return;
  11897. }
  11898. if (j == 44) {
  11899. int k2 = stream.method436();
  11900. int j5 = stream.readUnsignedWord();
  11901. int i8 = stream.readUnsignedByte();
  11902. int l10 = anInt1268 + (i8 >> 4 & 7);
  11903. int i13 = anInt1269 + (i8 & 7);
  11904. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  11905. Item class30_sub2_sub4_sub2_1 = new Item();
  11906. class30_sub2_sub4_sub2_1.ID = k2;
  11907. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11908. if (groundArray[plane][l10][i13] == null)
  11909. groundArray[plane][l10][i13] = new NodeList();
  11910. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11911. spawnGroundItem(l10, i13);
  11912. }
  11913. return;
  11914. }
  11915. if (j == 101) {
  11916. int l2 = stream.method427();
  11917. int k5 = l2 >> 2;
  11918. int j8 = l2 & 3;
  11919. int i11 = anIntArray1177[k5];
  11920. int j13 = stream.readUnsignedByte();
  11921. int k15 = anInt1268 + (j13 >> 4 & 7);
  11922. int l16 = anInt1269 + (j13 & 7);
  11923. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11924. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11925. return;
  11926. }
  11927. if (j == 117) {
  11928. int i3 = stream.readUnsignedByte();
  11929. int l5 = anInt1268 + (i3 >> 4 & 7);
  11930. int k8 = anInt1269 + (i3 & 7);
  11931. int j11 = l5 + stream.readSignedByte();
  11932. int k13 = k8 + stream.readSignedByte();
  11933. int l15 = stream.readSignedWord();
  11934. int i17 = stream.readUnsignedWord();
  11935. int i18 = stream.readUnsignedByte() * 4;
  11936. int l18 = stream.readUnsignedByte() * 4;
  11937. int k19 = stream.readUnsignedWord();
  11938. int j20 = stream.readUnsignedWord();
  11939. int i21 = stream.readUnsignedByte();
  11940. int j21 = stream.readUnsignedByte();
  11941. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104
  11942. && i17 != 65535) {
  11943. l5 = l5 * 128 + 64;
  11944. k8 = k8 * 128 + 64;
  11945. j11 = j11 * 128 + 64;
  11946. k13 = k13 * 128 + 64;
  11947. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21, l18, k19 + loopCycle, j20 + loopCycle,
  11948. j21, plane, method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  11949. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  11950. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11951. }
  11952. }
  11953. }
  11954.  
  11955. private static void setLowMem() {
  11956. WorldController.lowMem = true;
  11957. Rasterizer.lowMem = true;
  11958. lowMem = true;
  11959. ObjectManager.lowMem = true;
  11960. ObjectDef.lowMem = true;
  11961. }
  11962.  
  11963. private void method139(Stream stream) {
  11964. stream.initBitAccess();
  11965. int k = stream.readBits(8);
  11966. if (k < npcCount) {
  11967. for (int l = k; l < npcCount; l++)
  11968. anIntArray840[anInt839++] = npcIndices[l];
  11969.  
  11970. }
  11971. if (k > npcCount) {
  11972. signlink.reporterror(myUsername + " Too many npcs");
  11973. throw new RuntimeException("eek");
  11974. }
  11975. npcCount = 0;
  11976. for (int i1 = 0; i1 < k; i1++) {
  11977. int j1 = npcIndices[i1];
  11978. NPC npc = npcArray[j1];
  11979. int k1 = stream.readBits(1);
  11980. if (k1 == 0) {
  11981. npcIndices[npcCount++] = j1;
  11982. npc.anInt1537 = loopCycle;
  11983. } else {
  11984. int l1 = stream.readBits(2);
  11985. if (l1 == 0) {
  11986. npcIndices[npcCount++] = j1;
  11987. npc.anInt1537 = loopCycle;
  11988. anIntArray894[anInt893++] = j1;
  11989. } else if (l1 == 1) {
  11990. npcIndices[npcCount++] = j1;
  11991. npc.anInt1537 = loopCycle;
  11992. int i2 = stream.readBits(3);
  11993. npc.moveInDir(false, i2);
  11994. int k2 = stream.readBits(1);
  11995. if (k2 == 1)
  11996. anIntArray894[anInt893++] = j1;
  11997. } else if (l1 == 2) {
  11998. npcIndices[npcCount++] = j1;
  11999. npc.anInt1537 = loopCycle;
  12000. int j2 = stream.readBits(3);
  12001. npc.moveInDir(true, j2);
  12002. int l2 = stream.readBits(3);
  12003. npc.moveInDir(true, l2);
  12004. int i3 = stream.readBits(1);
  12005. if (i3 == 1)
  12006. anIntArray894[anInt893++] = j1;
  12007. } else if (l1 == 3)
  12008. anIntArray840[anInt839++] = j1;
  12009. }
  12010. }
  12011.  
  12012. }
  12013.  
  12014. public int RemberMeSelected = 0;
  12015.  
  12016. private void processLoginScreenInput() {
  12017. if (this.loginScreenState == 0) {
  12018. if(super.clickMode3 == 1 && newclickInRegion(320, 230,FeildH)) {
  12019. loginScreenCursorPos = 0;
  12020. }
  12021. if(super.clickMode3 == 1 && newclickInRegion(320, 280,FeildH)) {
  12022. loginScreenCursorPos = 1;
  12023. }
  12024. if(super.clickMode3 == 1 && newclickInRegion(230, 323,UnCheckedBox)) {
  12025. RemberMeSelected = 1;
  12026. }
  12027. if (super.clickMode3 == 1 && newclickInRegion(460, 325,LoginH)) {
  12028. loginFailures = 0;
  12029. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  12030. login(myUsername, myPassword, false);
  12031. } else {
  12032. this.loginScreenCursorPos = 0;
  12033. this.loginMessage1 = "Username & Password";
  12034. this.loginMessage2 = "Must be more than 1 character";
  12035. }
  12036. if (this.loggedIn)
  12037. return;
  12038. }
  12039. do {
  12040. int l1 = readChar(-796);
  12041. if (l1 == -1)
  12042. break;
  12043. boolean flag1 = false;
  12044. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  12045. if (l1 != validUserPassChars.charAt(i2))
  12046. continue;
  12047. flag1 = true;
  12048. break;
  12049. }
  12050.  
  12051. if (loginScreenCursorPos == 0) {
  12052. if (l1 == 8 && myUsername.length() > 0)
  12053. myUsername = myUsername.substring(0,
  12054. myUsername.length() - 1);
  12055. if (l1 == 9 || l1 == 10 || l1 == 13)
  12056. loginScreenCursorPos = 1;
  12057. if (flag1)
  12058. myUsername += (char) l1;
  12059. if (myUsername.length() > 12)
  12060. myUsername = myUsername.substring(0, 12);
  12061. } else if (loginScreenCursorPos == 1) {
  12062. if (l1 == 8 && myPassword.length() > 0)
  12063. myPassword = myPassword.substring(0,
  12064. myPassword.length() - 1);
  12065. if (l1 == 9 || l1 == 10 || l1 == 13)
  12066. loginScreenCursorPos = 0;
  12067. if (flag1)
  12068. myPassword += (char) l1;
  12069. if (myPassword.length() > 20)
  12070. myPassword = myPassword.substring(0, 20);
  12071. }
  12072. } while (true);
  12073. return;
  12074. }
  12075. }
  12076.  
  12077. private void markMinimap(Sprite sprite, int i, int j) {
  12078. int k = minimapInt1 + minimapInt2 & 0x7ff;
  12079. int l = sprite.myWidth + sprite.myHeight + i * i + j * j;
  12080. if (l > 4850 && clientSize != 0)
  12081. return;
  12082. int sine = Model.modelIntArray1[k];
  12083. int cosine = Model.modelIntArray2[k];
  12084. sine = (sine * 256) / (minimapInt3 + 256);
  12085. cosine = (cosine * 256) / (minimapInt3 + 256);
  12086. int k1 = j * sine + i * cosine >> 16;
  12087. int l1 = j * cosine - i * sine >> 16;
  12088. sprite.drawSprite((((clientSize == 0 ? 129 - 5 : clientWidth + 129 - 5 - 238) + k1) - sprite.anInt1444 / 2) + 4, (clientSize == 0 ? 88 : 88 + 3) - l1 - sprite.anInt1445 / 2 - 4);
  12089. }
  12090.  
  12091. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  12092. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  12093. if (lowMem && j != plane)
  12094. return;
  12095. int i2 = 0;
  12096. if (j1 == 0)
  12097. i2 = worldController.method300(j, i1, i);
  12098. if (j1 == 1)
  12099. i2 = worldController.method301(j, i1, i);
  12100. if (j1 == 2)
  12101. i2 = worldController.method302(j, i1, i);
  12102. if (j1 == 3)
  12103. i2 = worldController.method303(j, i1, i);
  12104. if (i2 != 0) {
  12105. int i3 = worldController.method304(j, i1, i, i2);
  12106. int j2 = i2 >> 14 & 0x7fff;
  12107. int k2 = i3 & 0x1f;
  12108. int l2 = i3 >> 6;
  12109. if (j1 == 0) {
  12110. worldController.method291(i1, j, i, (byte) -119);
  12111. ObjectDef class46 = ObjectDef.forID(j2);
  12112. if (class46.aBoolean767)
  12113. aClass11Array1230[j].method215(l2, k2,
  12114. class46.aBoolean757, i1, i);
  12115. }
  12116. if (j1 == 1)
  12117. worldController.method292(i, j, i1);
  12118. if (j1 == 2) {
  12119. worldController.method293(j, i1, i);
  12120. ObjectDef class46_1 = ObjectDef.forID(j2);
  12121. if (i1 + class46_1.anInt744 > 103
  12122. || i + class46_1.anInt744 > 103
  12123. || i1 + class46_1.anInt761 > 103
  12124. || i + class46_1.anInt761 > 103)
  12125. return;
  12126. if (class46_1.aBoolean767)
  12127. aClass11Array1230[j].method216(l2, class46_1.anInt744,
  12128. i1, i, class46_1.anInt761,
  12129. class46_1.aBoolean757);
  12130. }
  12131. if (j1 == 3) {
  12132. worldController.method294(j, i, i1);
  12133. ObjectDef class46_2 = ObjectDef.forID(j2);
  12134. if (class46_2.aBoolean767 && class46_2.hasActions)
  12135. aClass11Array1230[j].method218(i, i1);
  12136. }
  12137. }
  12138. if (k1 >= 0) {
  12139. int j3 = j;
  12140. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  12141. j3++;
  12142. ObjectManager.method188(worldController, k, i, l, j3,
  12143. aClass11Array1230[j], intGroundArray, i1, k1, j);
  12144. }
  12145. }
  12146. }
  12147.  
  12148. private void updatePlayers(int i, Stream stream) {
  12149. anInt839 = 0;
  12150. anInt893 = 0;
  12151. method117(stream);
  12152. method134(stream);
  12153. method91(stream, i);
  12154. method49(stream);
  12155. for (int k = 0; k < anInt839; k++) {
  12156. int l = anIntArray840[k];
  12157. if (playerArray[l].anInt1537 != loopCycle)
  12158. playerArray[l] = null;
  12159. }
  12160.  
  12161. if (stream.currentOffset != i) {
  12162. signlink.reporterror("Error packet size mismatch in getplayer pos:"
  12163. + stream.currentOffset + " psize:" + i);
  12164. throw new RuntimeException("eek");
  12165. }
  12166. for (int i1 = 0; i1 < playerCount; i1++)
  12167. if (playerArray[playerIndices[i1]] == null) {
  12168. signlink.reporterror(myUsername
  12169. + " null entry in pl list - pos:" + i1 + " size:"
  12170. + playerCount);
  12171. throw new RuntimeException("eek");
  12172. }
  12173.  
  12174. }
  12175.  
  12176. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  12177. int l1 = 2048 - k & 0x7ff;
  12178. int i2 = 2048 - j1 & 0x7ff;
  12179. int j2 = 0;
  12180. int k2 = 0;
  12181. int l2 = j;
  12182. if (l1 != 0) {
  12183. int i3 = Model.modelIntArray1[l1];
  12184. int k3 = Model.modelIntArray2[l1];
  12185. int i4 = k2 * k3 - l2 * i3 >> 16;
  12186. l2 = k2 * i3 + l2 * k3 >> 16;
  12187. k2 = i4;
  12188. }
  12189. if (i2 != 0) {
  12190. /*
  12191. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  12192. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  12193. * l2 = fwdbwd; }
  12194. */
  12195. int j3 = Model.modelIntArray1[i2];
  12196. int l3 = Model.modelIntArray2[i2];
  12197. int j4 = l2 * j3 + j2 * l3 >> 16;
  12198. l2 = l2 * l3 - j2 * j3 >> 16;
  12199. j2 = j4;
  12200. }
  12201. xCameraPos = l - j2;
  12202. zCameraPos = i1 - k2;
  12203. yCameraPos = k1 - l2;
  12204. yCameraCurve = k;
  12205. xCameraCurve = j1;
  12206. }
  12207.  
  12208. public void updateStrings(String str, int i) {
  12209. switch (i) {
  12210. case 1675:
  12211. sendFrame126(str, 17508);
  12212. break; // Stab
  12213. case 1676:
  12214. sendFrame126(str, 17509);
  12215. break; // Slash
  12216. case 1677:
  12217. sendFrame126(str, 17510);
  12218. break; // Cursh
  12219. case 1678:
  12220. sendFrame126(str, 17511);
  12221. break; // Magic
  12222. case 1679:
  12223. sendFrame126(str, 17512);
  12224. break; // Range
  12225. case 1680:
  12226. sendFrame126(str, 17513);
  12227. break; // Stab
  12228. case 1681:
  12229. sendFrame126(str, 17514);
  12230. break; // Slash
  12231. case 1682:
  12232. sendFrame126(str, 17515);
  12233. break; // Crush
  12234. case 1683:
  12235. sendFrame126(str, 17516);
  12236. break; // Magic
  12237. case 1684:
  12238. sendFrame126(str, 17517);
  12239. break; // Range
  12240. case 1686:
  12241. sendFrame126(str, 17518);
  12242. break; // Strength
  12243. case 1687:
  12244. sendFrame126(str, 17519);
  12245. break; // Prayer
  12246. }
  12247. }
  12248.  
  12249. public void sendFrame126(String str, int i) {
  12250. RSInterface.interfaceCache[i].message = str;
  12251. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  12252. needDrawTabArea = true;
  12253. }
  12254.  
  12255. public void sendPacket185(int button, int toggle, int type) {
  12256. switch (type) {
  12257. case 135:
  12258. RSInterface class9 = RSInterface.interfaceCache[button];
  12259. boolean flag8 = true;
  12260. if (class9.contentType > 0)
  12261. flag8 = promptUserForInput(class9);
  12262. if (flag8) {
  12263. stream.createFrame(185);
  12264. stream.writeWord(button);
  12265. }
  12266. break;
  12267. case 646:
  12268. stream.createFrame(185);
  12269. stream.writeWord(button);
  12270. RSInterface class9_2 = RSInterface.interfaceCache[button];
  12271. if (class9_2.valueIndexArray != null
  12272. && class9_2.valueIndexArray[0][0] == 5) {
  12273. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  12274. variousSettings[toggle] = class9_2.anIntArray212[0];
  12275. method33(toggle);
  12276. needDrawTabArea = true;
  12277. }
  12278. }
  12279. break;
  12280. case 169:
  12281. stream.createFrame(185);
  12282. stream.writeWord(button);
  12283. RSInterface class9_3 = RSInterface.interfaceCache[button];
  12284. if (class9_3.valueIndexArray != null
  12285. && class9_3.valueIndexArray[0][0] == 5) {
  12286. variousSettings[toggle] = 1 - variousSettings[toggle];
  12287. method33(toggle);
  12288. needDrawTabArea = true;
  12289. }
  12290. switch (button) {
  12291. case 19136:
  12292. System.out.println("toggle = " + toggle);
  12293. if (toggle == 0)
  12294. sendFrame36(173, toggle);
  12295. if (toggle == 1)
  12296. sendPacket185(153, 173, 646);
  12297. break;
  12298. }
  12299. break;
  12300. }
  12301. }
  12302.  
  12303. public void sendFrame36(int id, int state) {
  12304. anIntArray1045[id] = state;
  12305. if (variousSettings[id] != state) {
  12306. variousSettings[id] = state;
  12307. method33(id);
  12308. needDrawTabArea = true;
  12309. if (dialogID != -1)
  12310. inputTaken = true;
  12311. }
  12312. }
  12313.  
  12314. public void sendFrame219() {
  12315. if (invOverlayInterfaceID != -1) {
  12316. invOverlayInterfaceID = -1;
  12317. needDrawTabArea = true;
  12318. tabAreaAltered = true;
  12319. }
  12320. if (backDialogID != -1) {
  12321. backDialogID = -1;
  12322. inputTaken = true;
  12323. }
  12324. if (inputDialogState != 0) {
  12325. inputDialogState = 0;
  12326. inputTaken = true;
  12327. }
  12328. openInterfaceID = -1;
  12329. aBoolean1149 = false;
  12330. }
  12331.  
  12332. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  12333. if (backDialogID != -1) {
  12334. backDialogID = -1;
  12335. inputTaken = true;
  12336. }
  12337. if (inputDialogState != 0) {
  12338. inputDialogState = 0;
  12339. inputTaken = true;
  12340. }
  12341. openInterfaceID = interfaceID;
  12342. invOverlayInterfaceID = sideInterfaceID;
  12343. needDrawTabArea = true;
  12344. tabAreaAltered = true;
  12345. aBoolean1149 = false;
  12346. }
  12347.  
  12348. private boolean parsePacket() {
  12349. if (socketStream == null)
  12350. return false;
  12351. try {
  12352. int i = socketStream.available();
  12353. if (i == 0)
  12354. return false;
  12355. if (pktType == -1) {
  12356. socketStream.flushInputStream(inStream.buffer, 1);
  12357. pktType = inStream.buffer[0] & 0xff;
  12358. if (encryption != null)
  12359. pktType = pktType - encryption.getNextKey() & 0xff;
  12360. pktSize = SizeConstants.packetSizes[pktType];
  12361. i--;
  12362. }
  12363. if (pktSize == -1)
  12364. if (i > 0) {
  12365. socketStream.flushInputStream(inStream.buffer, 1);
  12366. pktSize = inStream.buffer[0] & 0xff;
  12367. i--;
  12368. } else {
  12369. return false;
  12370. }
  12371. if (pktSize == -2)
  12372. if (i > 1) {
  12373. socketStream.flushInputStream(inStream.buffer, 2);
  12374. inStream.currentOffset = 0;
  12375. pktSize = inStream.readUnsignedWord();
  12376. i -= 2;
  12377. } else {
  12378. return false;
  12379. }
  12380. if (i < pktSize)
  12381. return false;
  12382. inStream.currentOffset = 0;
  12383. socketStream.flushInputStream(inStream.buffer, pktSize);
  12384. anInt1009 = 0;
  12385. anInt843 = anInt842;
  12386. anInt842 = anInt841;
  12387. anInt841 = pktType;
  12388. switch (pktType) {
  12389. case 81:
  12390. updatePlayers(pktSize, inStream);
  12391. aBoolean1080 = false;
  12392. pktType = -1;
  12393. return true;
  12394.  
  12395. case 176:
  12396. daysSinceRecovChange = inStream.method427();
  12397. unreadMessages = inStream.method435();
  12398. membersInt = inStream.readUnsignedByte();
  12399. anInt1193 = inStream.method440();
  12400. daysSinceLastLogin = inStream.readUnsignedWord();
  12401. if (anInt1193 != 0 && openInterfaceID == -1) {
  12402. signlink.dnslookup(TextClass.method586(anInt1193));
  12403. clearTopInterfaces();
  12404. char c = '\u028A';
  12405. if (daysSinceRecovChange != 201 || membersInt == 1)
  12406. c = '\u028F';
  12407. reportAbuseInput = "";
  12408. canMute = false;
  12409. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  12410. if (RSInterface.interfaceCache[k9] == null
  12411. || RSInterface.interfaceCache[k9].contentType != c)
  12412. continue;
  12413. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  12414.  
  12415. }
  12416. }
  12417. pktType = -1;
  12418. return true;
  12419.  
  12420. case 64:
  12421. anInt1268 = inStream.method427();
  12422. anInt1269 = inStream.method428();
  12423. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  12424. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  12425. if (groundArray[plane][j][l9] != null) {
  12426. groundArray[plane][j][l9] = null;
  12427. spawnGroundItem(j, l9);
  12428. }
  12429. }
  12430. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  12431. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  12432. .reverseGetNext())
  12433. if (class30_sub1.anInt1297 >= anInt1268
  12434. && class30_sub1.anInt1297 < anInt1268 + 8
  12435. && class30_sub1.anInt1298 >= anInt1269
  12436. && class30_sub1.anInt1298 < anInt1269 + 8
  12437. && class30_sub1.anInt1295 == plane)
  12438. class30_sub1.anInt1294 = 0;
  12439. pktType = -1;
  12440. return true;
  12441.  
  12442. case 185:
  12443. int k = inStream.method436();
  12444. RSInterface.interfaceCache[k].anInt233 = 3;
  12445. if (myPlayer.desc == null)
  12446. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  12447. + (myPlayer.anIntArray1700[4] << 20)
  12448. + (myPlayer.equipment[0] << 15)
  12449. + (myPlayer.equipment[8] << 10)
  12450. + (myPlayer.equipment[11] << 5)
  12451. + myPlayer.equipment[1];
  12452. else
  12453. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.type);
  12454. pktType = -1;
  12455. return true;
  12456.  
  12457. /* Clan message packet */
  12458. case 217:
  12459. try {
  12460. clanUsername = inStream.readString();
  12461. clanMessage = TextInput.processText(inStream.readString());
  12462. clanTitle = inStream.readString();
  12463. channelRights = inStream.readUnsignedWord();
  12464. pushMessage(clanMessage, 12, clanUsername);
  12465. } catch (Exception e) {
  12466. e.printStackTrace();
  12467. }
  12468. pktType = -1;
  12469. return true;
  12470.  
  12471. case 107:
  12472. aBoolean1160 = false;
  12473. for (int l = 0; l < 5; l++)
  12474. aBooleanArray876[l] = false;
  12475. pktType = -1;
  12476. return true;
  12477.  
  12478. case 72:
  12479. int i1 = inStream.method434();
  12480. RSInterface class9 = RSInterface.interfaceCache[i1];
  12481. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  12482. class9.inv[k15] = -1;
  12483. class9.inv[k15] = 0;
  12484. }
  12485. pktType = -1;
  12486. return true;
  12487.  
  12488. case 214:
  12489. ignoreCount = pktSize / 8;
  12490. for (int j1 = 0; j1 < ignoreCount; j1++)
  12491. ignoreListAsLongs[j1] = inStream.readQWord();
  12492. pktType = -1;
  12493. return true;
  12494.  
  12495. case 166:
  12496. aBoolean1160 = true;
  12497. anInt1098 = inStream.readUnsignedByte();
  12498. anInt1099 = inStream.readUnsignedByte();
  12499. anInt1100 = inStream.readUnsignedWord();
  12500. anInt1101 = inStream.readUnsignedByte();
  12501. anInt1102 = inStream.readUnsignedByte();
  12502. if (anInt1102 >= 100) {
  12503. xCameraPos = anInt1098 * 128 + 64;
  12504. yCameraPos = anInt1099 * 128 + 64;
  12505. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  12506. - anInt1100;
  12507. }
  12508. pktType = -1;
  12509. return true;
  12510.  
  12511. case 134:
  12512. needDrawTabArea = true;
  12513. int k1 = inStream.readUnsignedByte();
  12514. int i10 = inStream.method439();
  12515. int l15 = inStream.readUnsignedByte();
  12516. int xp = currentExp[k1];
  12517. currentExp[k1] = i10;
  12518. currentStats[k1] = l15;
  12519. maxStats[k1] = 1;
  12520. if (experienceGained <= 0) {
  12521. experienceGained = currentExp[k1] - xp;
  12522. }
  12523. for (int k20 = 0; k20 < 98; k20++)
  12524. if (i10 >= anIntArray1019[k20])
  12525. maxStats[k1] = k20 + 2;
  12526. pktType = -1;
  12527. return true;
  12528.  
  12529. case 71:
  12530. int l1 = inStream.readUnsignedWord();
  12531. int j10 = inStream.method426();
  12532. if (l1 == 65535)
  12533. l1 = -1;
  12534. tabInterfaceIDs[j10] = l1;
  12535. needDrawTabArea = true;
  12536. tabAreaAltered = true;
  12537. pktType = -1;
  12538. return true;
  12539.  
  12540. case 74:
  12541. int i2 = inStream.method434();
  12542. if (i2 == 65535)
  12543. i2 = -1;
  12544. if (i2 != currentSong && musicEnabled && !lowMem
  12545. && prevSong == 0) {
  12546. nextSong = i2;
  12547. songChanging = true;
  12548. onDemandFetcher.method558(2, nextSong);
  12549. }
  12550. currentSong = i2;
  12551. pktType = -1;
  12552. return true;
  12553.  
  12554. case 121:
  12555. int j2 = inStream.method436();
  12556. int k10 = inStream.method435();
  12557. if (musicEnabled && !lowMem) {
  12558. nextSong = j2;
  12559. songChanging = false;
  12560. onDemandFetcher.method558(2, nextSong);
  12561. prevSong = k10;
  12562. }
  12563. pktType = -1;
  12564. return true;
  12565.  
  12566. case 109:
  12567. resetLogout();
  12568. pktType = -1;
  12569. return false;
  12570.  
  12571. case 70:
  12572. int k2 = inStream.readSignedWord();
  12573. int l10 = inStream.method437();
  12574. int i16 = inStream.method434();
  12575. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  12576. class9_5.anInt263 = k2;
  12577. class9_5.anInt265 = l10;
  12578. pktType = -1;
  12579. return true;
  12580.  
  12581. case 186:
  12582. inStream.readString();
  12583. pktType = -1;
  12584. return true;
  12585.  
  12586. case 184:
  12587. String spellIcon = inStream.readString();
  12588. RSInterface.magicSpellIcon = spellIcon;
  12589. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(
  12590. true, "q8_full", titleStreamLoader);
  12591. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText,
  12592. aTextDrawingArea_1271, chatTextDrawingArea,
  12593. aTextDrawingArea_1273 };
  12594. RSInterface.aMRUNodes_238 = new MRUNodes(50000);
  12595. RSInterface.Sidebar0d(328, 331, "Bash", "Pound", "Focus", 42,
  12596. 66, 39, 101, 41, 136, 40, 120, 40, 50, 40, 85,
  12597. aclass30_sub2_sub1_sub4s);
  12598. RSInterface.aMRUNodes_238 = null;
  12599. needDrawTabArea = true;
  12600. pktType = -1;
  12601. return true;
  12602.  
  12603. case 73:
  12604. case 241:
  12605. int l2 = anInt1069;
  12606. int i11 = anInt1070;
  12607. if (pktType == 73) {
  12608. l2 = inStream.method435();
  12609. i11 = inStream.readUnsignedWord();
  12610. aBoolean1159 = false;
  12611. }
  12612. if (pktType == 241) {
  12613. i11 = inStream.method435();
  12614. inStream.initBitAccess();
  12615. for (int j16 = 0; j16 < 4; j16++) {
  12616. for (int l20 = 0; l20 < 13; l20++) {
  12617. for (int j23 = 0; j23 < 13; j23++) {
  12618. int i26 = inStream.readBits(1);
  12619. if (i26 == 1)
  12620. anIntArrayArrayArray1129[j16][l20][j23] = inStream
  12621. .readBits(26);
  12622. else
  12623. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12624. }
  12625. }
  12626. }
  12627. inStream.finishBitAccess();
  12628. l2 = inStream.readUnsignedWord();
  12629. aBoolean1159 = true;
  12630. }
  12631. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12632. pktType = -1;
  12633. return true;
  12634. }
  12635. anInt1069 = l2;
  12636. anInt1070 = i11;
  12637. baseX = (anInt1069 - 6) * 8;
  12638. baseY = (anInt1070 - 6) * 8;
  12639. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49)
  12640. && anInt1070 / 8 == 48;
  12641. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12642. aBoolean1141 = true;
  12643. loadingStage = 1;
  12644. aLong824 = System.currentTimeMillis();
  12645. aRSImageProducer_1165.initDrawingArea();
  12646. aTextDrawingArea_1271.drawText(0, "Loading - please wait.",
  12647. 151, 257);
  12648. aTextDrawingArea_1271.drawText(0xffffff,
  12649. "Loading - please wait.", 150, 256);
  12650. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12651. if (pktType == 73) {
  12652. int k16 = 0;
  12653. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12654. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12655. k16++;
  12656. }
  12657. aByteArrayArray1183 = new byte[k16][];
  12658. aByteArrayArray1247 = new byte[k16][];
  12659. anIntArray1234 = new int[k16];
  12660. anIntArray1235 = new int[k16];
  12661. anIntArray1236 = new int[k16];
  12662. k16 = 0;
  12663. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12664. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12665. anIntArray1234[k16] = (l23 << 8) + j26;
  12666. if (aBoolean1141
  12667. && (j26 == 49 || j26 == 149 || j26 == 147
  12668. || l23 == 50 || l23 == 49
  12669. && j26 == 47)) {
  12670. anIntArray1235[k16] = -1;
  12671. anIntArray1236[k16] = -1;
  12672. k16++;
  12673. } else {
  12674. int k28 = anIntArray1235[k16] = onDemandFetcher
  12675. .method562(0, j26, l23);
  12676. if (k28 != -1)
  12677. onDemandFetcher.method558(3, k28);
  12678. int j30 = anIntArray1236[k16] = onDemandFetcher
  12679. .method562(1, j26, l23);
  12680. if (j30 != -1)
  12681. onDemandFetcher.method558(3, j30);
  12682. k16++;
  12683. }
  12684. }
  12685. }
  12686. }
  12687. if (pktType == 241) {
  12688. int l16 = 0;
  12689. int ai[] = new int[676];
  12690. for (int i24 = 0; i24 < 4; i24++) {
  12691. for (int k26 = 0; k26 < 13; k26++) {
  12692. for (int l28 = 0; l28 < 13; l28++) {
  12693. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12694. if (k30 != -1) {
  12695. int k31 = k30 >> 14 & 0x3ff;
  12696. int i32 = k30 >> 3 & 0x7ff;
  12697. int k32 = (k31 / 8 << 8) + i32 / 8;
  12698. for (int j33 = 0; j33 < l16; j33++) {
  12699. if (ai[j33] != k32)
  12700. continue;
  12701. k32 = -1;
  12702.  
  12703. }
  12704. if (k32 != -1)
  12705. ai[l16++] = k32;
  12706. }
  12707. }
  12708. }
  12709. }
  12710. aByteArrayArray1183 = new byte[l16][];
  12711. aByteArrayArray1247 = new byte[l16][];
  12712. anIntArray1234 = new int[l16];
  12713. anIntArray1235 = new int[l16];
  12714. anIntArray1236 = new int[l16];
  12715. for (int l26 = 0; l26 < l16; l26++) {
  12716. int i29 = anIntArray1234[l26] = ai[l26];
  12717. int l30 = i29 >> 8 & 0xff;
  12718. int l31 = i29 & 0xff;
  12719. int j32 = anIntArray1235[l26] = onDemandFetcher
  12720. .method562(0, l31, l30);
  12721. if (j32 != -1)
  12722. onDemandFetcher.method558(3, j32);
  12723. int i33 = anIntArray1236[l26] = onDemandFetcher
  12724. .method562(1, l31, l30);
  12725. if (i33 != -1)
  12726. onDemandFetcher.method558(3, i33);
  12727. }
  12728. }
  12729. int i17 = baseX - anInt1036;
  12730. int j21 = baseY - anInt1037;
  12731. anInt1036 = baseX;
  12732. anInt1037 = baseY;
  12733. for (int j24 = 0; j24 < 16384; j24++) {
  12734. NPC npc = npcArray[j24];
  12735. if (npc != null) {
  12736. for (int j29 = 0; j29 < 10; j29++) {
  12737. npc.smallX[j29] -= i17;
  12738. npc.smallY[j29] -= j21;
  12739. }
  12740. npc.x -= i17 * 128;
  12741. npc.y -= j21 * 128;
  12742. }
  12743. }
  12744. for (int i27 = 0; i27 < maxPlayers; i27++) {
  12745. Player player = playerArray[i27];
  12746. if (player != null) {
  12747. for (int i31 = 0; i31 < 10; i31++) {
  12748. player.smallX[i31] -= i17;
  12749. player.smallY[i31] -= j21;
  12750. }
  12751. player.x -= i17 * 128;
  12752. player.y -= j21 * 128;
  12753. }
  12754. }
  12755. aBoolean1080 = true;
  12756. byte byte1 = 0;
  12757. byte byte2 = 104;
  12758. byte byte3 = 1;
  12759. if (i17 < 0) {
  12760. byte1 = 103;
  12761. byte2 = -1;
  12762. byte3 = -1;
  12763. }
  12764. byte byte4 = 0;
  12765. byte byte5 = 104;
  12766. byte byte6 = 1;
  12767. if (j21 < 0) {
  12768. byte4 = 103;
  12769. byte5 = -1;
  12770. byte6 = -1;
  12771. }
  12772. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  12773. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  12774. int i34 = k33 + i17;
  12775. int j34 = l33 + j21;
  12776. for (int k34 = 0; k34 < 4; k34++)
  12777. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12778. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12779. else
  12780. groundArray[k34][k33][l33] = null;
  12781. }
  12782. }
  12783. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12784. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12785. .reverseGetNext()) {
  12786. class30_sub1_1.anInt1297 -= i17;
  12787. class30_sub1_1.anInt1298 -= j21;
  12788. if (class30_sub1_1.anInt1297 < 0
  12789. || class30_sub1_1.anInt1298 < 0
  12790. || class30_sub1_1.anInt1297 >= 104
  12791. || class30_sub1_1.anInt1298 >= 104)
  12792. class30_sub1_1.unlink();
  12793. }
  12794. if (destX != 0) {
  12795. destX -= i17;
  12796. destY -= j21;
  12797. }
  12798. aBoolean1160 = false;
  12799. pktType = -1;
  12800. return true;
  12801.  
  12802. case 208:
  12803. int i3 = inStream.method437();
  12804. if (i3 >= 0)
  12805. method60(i3);
  12806. anInt1018 = i3;
  12807. pktType = -1;
  12808. return true;
  12809.  
  12810. case 99:
  12811. anInt1021 = inStream.readUnsignedByte();
  12812. pktType = -1;
  12813. return true;
  12814.  
  12815. case 75:
  12816. int j3 = inStream.method436();
  12817. int j11 = inStream.method436();
  12818. RSInterface.interfaceCache[j11].anInt233 = 2;
  12819. RSInterface.interfaceCache[j11].mediaID = j3;
  12820. pktType = -1;
  12821. return true;
  12822.  
  12823. case 114:
  12824. anInt1104 = inStream.method434() * 30;
  12825. pktType = -1;
  12826. return true;
  12827.  
  12828. case 60:
  12829. anInt1269 = inStream.readUnsignedByte();
  12830. anInt1268 = inStream.method427();
  12831. while (inStream.currentOffset < pktSize) {
  12832. int k3 = inStream.readUnsignedByte();
  12833. method137(inStream, k3);
  12834. }
  12835. pktType = -1;
  12836. return true;
  12837.  
  12838. case 35:
  12839. int l3 = inStream.readUnsignedByte();
  12840. int k11 = inStream.readUnsignedByte();
  12841. int j17 = inStream.readUnsignedByte();
  12842. int k21 = inStream.readUnsignedByte();
  12843. aBooleanArray876[l3] = true;
  12844. anIntArray873[l3] = k11;
  12845. anIntArray1203[l3] = j17;
  12846. anIntArray928[l3] = k21;
  12847. anIntArray1030[l3] = 0;
  12848. pktType = -1;
  12849. return true;
  12850.  
  12851. case 174:
  12852. int i4 = inStream.readUnsignedWord();
  12853. int l11 = inStream.readUnsignedByte();
  12854. int k17 = inStream.readUnsignedWord();
  12855. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  12856. anIntArray1207[anInt1062] = i4;
  12857. anIntArray1241[anInt1062] = l11;
  12858. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  12859. anInt1062++;
  12860. }
  12861. pktType = -1;
  12862. return true;
  12863.  
  12864. case 104:
  12865. int j4 = inStream.method427();
  12866. int i12 = inStream.method426();
  12867. String s6 = inStream.readString();
  12868. if (j4 >= 1 && j4 <= 5) {
  12869. if (s6.equalsIgnoreCase("null"))
  12870. s6 = null;
  12871. atPlayerActions[j4 - 1] = s6;
  12872. atPlayerArray[j4 - 1] = i12 == 0;
  12873. }
  12874. pktType = -1;
  12875. return true;
  12876.  
  12877. case 78:
  12878. destX = 0;
  12879. pktType = -1;
  12880. return true;
  12881.  
  12882. case 253:
  12883. String s = inStream.readString();
  12884. if (s.endsWith(":tradereq:")) {
  12885. String s3 = s.substring(0, s.indexOf(":"));
  12886. long l17 = TextClass.longForName(s3);
  12887. boolean flag2 = false;
  12888. for (int j27 = 0; j27 < ignoreCount; j27++) {
  12889. if (ignoreListAsLongs[j27] != l17)
  12890. continue;
  12891. flag2 = true;
  12892.  
  12893. }
  12894. if (!flag2 && anInt1251 == 0)
  12895. pushMessage("wishes to trade with you.", 4, s3);
  12896. } else if (s.endsWith(":clan:")) {
  12897. String s4 = s.substring(0, s.indexOf(":"));
  12898. TextClass.longForName(s4);
  12899. pushMessage("Clan: ", 8, s4);
  12900. } else if (s.endsWith("#url#")) {
  12901. String link = s.substring(0, s.indexOf("#"));
  12902. pushMessage("Join us at: ", 9, link);
  12903. } else if (s.endsWith(":duelreq:")) {
  12904. String s4 = s.substring(0, s.indexOf(":"));
  12905. long l18 = TextClass.longForName(s4);
  12906. boolean flag3 = false;
  12907. for (int k27 = 0; k27 < ignoreCount; k27++) {
  12908. if (ignoreListAsLongs[k27] != l18)
  12909. continue;
  12910. flag3 = true;
  12911.  
  12912. }
  12913. if (!flag3 && anInt1251 == 0)
  12914. pushMessage("wishes to duel with you.", 8, s4);
  12915. } else if (s.endsWith(":chalreq:")) {
  12916. String s5 = s.substring(0, s.indexOf(":"));
  12917. long l19 = TextClass.longForName(s5);
  12918. boolean flag4 = false;
  12919. for (int l27 = 0; l27 < ignoreCount; l27++) {
  12920. if (ignoreListAsLongs[l27] != l19)
  12921. continue;
  12922. flag4 = true;
  12923.  
  12924. }
  12925. if (!flag4 && anInt1251 == 0) {
  12926. String s8 = s.substring(s.indexOf(":") + 1,
  12927. s.length() - 9);
  12928. pushMessage(s8, 8, s5);
  12929. }
  12930. } else {
  12931. pushMessage(s, 0, "");
  12932. }
  12933. pktType = -1;
  12934. return true;
  12935.  
  12936. case 1:
  12937. for (int k4 = 0; k4 < playerArray.length; k4++)
  12938. if (playerArray[k4] != null)
  12939. playerArray[k4].anim = -1;
  12940. for (int j12 = 0; j12 < npcArray.length; j12++)
  12941. if (npcArray[j12] != null)
  12942. npcArray[j12].anim = -1;
  12943. pktType = -1;
  12944. return true;
  12945.  
  12946. case 50:
  12947. long l4 = inStream.readQWord();
  12948. int i18 = inStream.readUnsignedByte();
  12949. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12950. for (int k24 = 0; k24 < friendsCount; k24++) {
  12951. if (l4 != friendsListAsLongs[k24])
  12952. continue;
  12953. if (friendsNodeIDs[k24] != i18) {
  12954. friendsNodeIDs[k24] = i18;
  12955. needDrawTabArea = true;
  12956. if (i18 >= 2) {
  12957. pushMessage(s7 + " has logged in.", 5, "");
  12958. }
  12959. if (i18 <= 1) {
  12960. pushMessage(s7 + " has logged out.", 5, "");
  12961. }
  12962. }
  12963. s7 = null;
  12964.  
  12965. }
  12966. if (s7 != null && friendsCount < 200) {
  12967. friendsListAsLongs[friendsCount] = l4;
  12968. friendsList[friendsCount] = s7;
  12969. friendsNodeIDs[friendsCount] = i18;
  12970. friendsCount++;
  12971. needDrawTabArea = true;
  12972. }
  12973. for (boolean flag6 = false; !flag6;) {
  12974. flag6 = true;
  12975. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  12976. if (friendsNodeIDs[k29] != nodeID
  12977. && friendsNodeIDs[k29 + 1] == nodeID
  12978. || friendsNodeIDs[k29] == 0
  12979. && friendsNodeIDs[k29 + 1] != 0) {
  12980. int j31 = friendsNodeIDs[k29];
  12981. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12982. friendsNodeIDs[k29 + 1] = j31;
  12983. String s10 = friendsList[k29];
  12984. friendsList[k29] = friendsList[k29 + 1];
  12985. friendsList[k29 + 1] = s10;
  12986. long l32 = friendsListAsLongs[k29];
  12987. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12988. friendsListAsLongs[k29 + 1] = l32;
  12989. needDrawTabArea = true;
  12990. flag6 = false;
  12991. }
  12992. }
  12993. pktType = -1;
  12994. return true;
  12995.  
  12996. case 110:
  12997. if (tabID == 12)
  12998. needDrawTabArea = true;
  12999. energy = inStream.readUnsignedByte();
  13000. pktType = -1;
  13001. return true;
  13002.  
  13003. case 254:
  13004. anInt855 = inStream.readUnsignedByte();
  13005. if (anInt855 == 1)
  13006. anInt1222 = inStream.readUnsignedWord();
  13007. if (anInt855 >= 2 && anInt855 <= 6) {
  13008. if (anInt855 == 2) {
  13009. anInt937 = 64;
  13010. anInt938 = 64;
  13011. }
  13012. if (anInt855 == 3) {
  13013. anInt937 = 0;
  13014. anInt938 = 64;
  13015. }
  13016. if (anInt855 == 4) {
  13017. anInt937 = 128;
  13018. anInt938 = 64;
  13019. }
  13020. if (anInt855 == 5) {
  13021. anInt937 = 64;
  13022. anInt938 = 0;
  13023. }
  13024. if (anInt855 == 6) {
  13025. anInt937 = 64;
  13026. anInt938 = 128;
  13027. }
  13028. anInt855 = 2;
  13029. anInt934 = inStream.readUnsignedWord();
  13030. anInt935 = inStream.readUnsignedWord();
  13031. anInt936 = inStream.readUnsignedByte();
  13032. }
  13033. if (anInt855 == 10)
  13034. anInt933 = inStream.readUnsignedWord();
  13035. pktType = -1;
  13036. return true;
  13037.  
  13038. case 248:
  13039. int i5 = inStream.method435();
  13040. int k12 = inStream.readUnsignedWord();
  13041. if (backDialogID != -1) {
  13042. backDialogID = -1;
  13043. inputTaken = true;
  13044. }
  13045. if (inputDialogState != 0) {
  13046. inputDialogState = 0;
  13047. inputTaken = true;
  13048. }
  13049. openInterfaceID = i5;
  13050. invOverlayInterfaceID = k12;
  13051. needDrawTabArea = true;
  13052. tabAreaAltered = true;
  13053. aBoolean1149 = false;
  13054. pktType = -1;
  13055. return true;
  13056.  
  13057. case 79:
  13058. int j5 = inStream.method434();
  13059. int l12 = inStream.method435();
  13060. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  13061. if (class9_3 != null && class9_3.type == 0) {
  13062. if (l12 < 0)
  13063. l12 = 0;
  13064. if (l12 > class9_3.scrollMax - class9_3.height)
  13065. l12 = class9_3.scrollMax - class9_3.height;
  13066. class9_3.scrollPosition = l12;
  13067. }
  13068. pktType = -1;
  13069. return true;
  13070.  
  13071. case 68:
  13072. for (int k5 = 0; k5 < variousSettings.length; k5++)
  13073. if (variousSettings[k5] != anIntArray1045[k5]) {
  13074. variousSettings[k5] = anIntArray1045[k5];
  13075. method33(k5);
  13076. needDrawTabArea = true;
  13077. }
  13078. pktType = -1;
  13079. return true;
  13080.  
  13081. case 196:
  13082. long l5 = inStream.readQWord();
  13083. inStream.readDWord();
  13084. int l21 = inStream.readUnsignedByte();
  13085. boolean flag5 = false;
  13086. if (l21 <= 1) {
  13087. for (int l29 = 0; l29 < ignoreCount; l29++) {
  13088. if (ignoreListAsLongs[l29] != l5)
  13089. continue;
  13090. flag5 = true;
  13091.  
  13092. }
  13093. }
  13094. if (!flag5 && anInt1251 == 0)
  13095. try {
  13096. String s9 = TextInput.method525(pktSize - 13, inStream);
  13097. switch (l21) {
  13098. case 1:
  13099. pushMessage(
  13100. s9,
  13101. 7,
  13102. "@cr1@"
  13103. + TextClass.fixName(TextClass
  13104. .nameForLong(l5)));
  13105. break;
  13106. case 2:
  13107. pushMessage(
  13108. s9,
  13109. 7,
  13110. "@cr2@"
  13111. + TextClass.fixName(TextClass
  13112. .nameForLong(l5)));
  13113. break;
  13114. case 3:
  13115. pushMessage(
  13116. s9,
  13117. 7,
  13118. "@cr3@"
  13119. + TextClass.fixName(TextClass
  13120. .nameForLong(l5)));
  13121. break;
  13122. case 4:
  13123. pushMessage(
  13124. s9,
  13125. 7,
  13126. "@cr4@"
  13127. + TextClass.fixName(TextClass
  13128. .nameForLong(l5)));
  13129. break;
  13130. case 5:
  13131. pushMessage(
  13132. s9,
  13133. 7,
  13134. "@cr5@"
  13135. + TextClass.fixName(TextClass
  13136. .nameForLong(l5)));
  13137. break;
  13138. case 6:
  13139. pushMessage(
  13140. s9,
  13141. 7,
  13142. "@cr6@"
  13143. + TextClass.fixName(TextClass
  13144. .nameForLong(l5)));
  13145. break;
  13146. case 7:
  13147. pushMessage(
  13148. s9,
  13149. 7,
  13150. "@cr7@"
  13151. + TextClass.fixName(TextClass
  13152. .nameForLong(l5)));
  13153. break;
  13154. case 8:
  13155. pushMessage(
  13156. s9,
  13157. 7,
  13158. "@cr8@"
  13159. + TextClass.fixName(TextClass
  13160. .nameForLong(l5)));
  13161. break;
  13162. case 9:
  13163. pushMessage(
  13164. s9,
  13165. 7,
  13166. "@cr9@"
  13167. + TextClass.fixName(TextClass
  13168. .nameForLong(l5)));
  13169. break;
  13170. case 10:
  13171. pushMessage(
  13172. s9,
  13173. 7,
  13174. "@cr10@"
  13175. + TextClass.fixName(TextClass
  13176. .nameForLong(l5)));
  13177. break;
  13178. default:
  13179. pushMessage(s9, 3, TextClass.fixName(TextClass
  13180. .nameForLong(l5)));
  13181. }
  13182. } catch (Exception exception1) {
  13183. signlink.reporterror("cde1");
  13184. }
  13185. pktType = -1;
  13186. return true;
  13187.  
  13188. case 85:
  13189. anInt1269 = inStream.method427();
  13190. anInt1268 = inStream.method427();
  13191. pktType = -1;
  13192. return true;
  13193.  
  13194. case 24:
  13195. anInt1054 = inStream.method428();
  13196. if (anInt1054 == tabID) {
  13197. if (anInt1054 == 3)
  13198. tabID = 1;
  13199. else
  13200. tabID = 3;
  13201. needDrawTabArea = true;
  13202. }
  13203. pktType = -1;
  13204. return true;
  13205.  
  13206. case 246:
  13207. int i6 = inStream.method434();
  13208. int i13 = inStream.readUnsignedWord();
  13209. int k18 = inStream.readUnsignedWord();
  13210. if (k18 == 65535) {
  13211. RSInterface.interfaceCache[i6].anInt233 = 0;
  13212. pktType = -1;
  13213. return true;
  13214. } else {
  13215. ItemDef itemDef = ItemDef.forID(k18);
  13216. RSInterface.interfaceCache[i6].anInt233 = 4;
  13217. RSInterface.interfaceCache[i6].mediaID = k18;
  13218. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  13219. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  13220. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100)
  13221. / i13;
  13222. pktType = -1;
  13223. return true;
  13224. }
  13225.  
  13226. case 171:
  13227. boolean flag1 = inStream.readUnsignedByte() == 1;
  13228. int j13 = inStream.readUnsignedWord();
  13229. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  13230. pktType = -1;
  13231. return true;
  13232.  
  13233. case 142:
  13234. int j6 = inStream.method434();
  13235. method60(j6);
  13236. if (backDialogID != -1) {
  13237. backDialogID = -1;
  13238. inputTaken = true;
  13239. }
  13240. if (inputDialogState != 0) {
  13241. inputDialogState = 0;
  13242. inputTaken = true;
  13243. }
  13244. invOverlayInterfaceID = j6;
  13245. needDrawTabArea = true;
  13246. tabAreaAltered = true;
  13247. openInterfaceID = -1;
  13248. aBoolean1149 = false;
  13249. pktType = -1;
  13250. return true;
  13251.  
  13252. case 126:
  13253. String text = inStream.readString();
  13254. int frame = inStream.method435();
  13255. if (text.startsWith("www.")) {
  13256. launchURL(text);
  13257. pktType = -1;
  13258. return true;
  13259. }
  13260. updateStrings(text, frame);
  13261. sendFrame126(text, frame);
  13262. if (frame >= 18144 && frame <= 18244) {
  13263. clanList[frame - 18144] = text;
  13264. }
  13265. pktType = -1;
  13266. return true;
  13267.  
  13268. case 206:
  13269. publicChatMode = inStream.readUnsignedByte();
  13270. privateChatMode = inStream.readUnsignedByte();
  13271. tradeMode = inStream.readUnsignedByte();
  13272. inputTaken = true;
  13273. pktType = -1;
  13274. return true;
  13275.  
  13276. case 240:
  13277. if (tabID == 12)
  13278. needDrawTabArea = true;
  13279. weight = inStream.readSignedWord();
  13280. pktType = -1;
  13281. return true;
  13282.  
  13283. case 8:
  13284. int k6 = inStream.method436();
  13285. int l13 = inStream.readUnsignedWord();
  13286. RSInterface.interfaceCache[k6].anInt233 = 1;
  13287. RSInterface.interfaceCache[k6].mediaID = l13;
  13288. pktType = -1;
  13289. return true;
  13290.  
  13291. case 122:
  13292. int l6 = inStream.method436();
  13293. int i14 = inStream.method436();
  13294. int i19 = i14 >> 10 & 0x1f;
  13295. int i22 = i14 >> 5 & 0x1f;
  13296. int l24 = i14 & 0x1f;
  13297. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  13298. + (i22 << 11) + (l24 << 3);
  13299. pktType = -1;
  13300. return true;
  13301.  
  13302. case 53:
  13303. needDrawTabArea = true;
  13304. int i7 = inStream.readUnsignedWord();
  13305. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  13306. int j19 = inStream.readUnsignedWord();
  13307. for (int j22 = 0; j22 < j19; j22++) {
  13308. int i25 = inStream.readUnsignedByte();
  13309. if (i25 == 255)
  13310. i25 = inStream.method440();
  13311. class9_1.inv[j22] = inStream.method436();
  13312. class9_1.invStackSizes[j22] = i25;
  13313. }
  13314. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  13315. class9_1.inv[j25] = 0;
  13316. class9_1.invStackSizes[j25] = 0;
  13317. }
  13318. pktType = -1;
  13319. return true;
  13320.  
  13321. case 230:
  13322. int j7 = inStream.method435();
  13323. int j14 = inStream.readUnsignedWord();
  13324. int k19 = inStream.readUnsignedWord();
  13325. int k22 = inStream.method436();
  13326. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  13327. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  13328. RSInterface.interfaceCache[j14].modelZoom = j7;
  13329. pktType = -1;
  13330. return true;
  13331.  
  13332. case 221:
  13333. anInt900 = inStream.readUnsignedByte();
  13334. needDrawTabArea = true;
  13335. pktType = -1;
  13336. return true;
  13337.  
  13338. case 177:
  13339. aBoolean1160 = true;
  13340. anInt995 = inStream.readUnsignedByte();
  13341. anInt996 = inStream.readUnsignedByte();
  13342. anInt997 = inStream.readUnsignedWord();
  13343. anInt998 = inStream.readUnsignedByte();
  13344. anInt999 = inStream.readUnsignedByte();
  13345. if (anInt999 >= 100) {
  13346. int k7 = anInt995 * 128 + 64;
  13347. int k14 = anInt996 * 128 + 64;
  13348. int i20 = method42(plane, k14, k7) - anInt997;
  13349. int l22 = k7 - xCameraPos;
  13350. int k25 = i20 - zCameraPos;
  13351. int j28 = k14 - yCameraPos;
  13352. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  13353. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  13354. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  13355. if (yCameraCurve < 128)
  13356. yCameraCurve = 128;
  13357. if (yCameraCurve > 383)
  13358. yCameraCurve = 383;
  13359. }
  13360. pktType = -1;
  13361. return true;
  13362.  
  13363. case 249:
  13364. anInt1046 = inStream.method426();
  13365. unknownInt10 = inStream.method436();
  13366. pktType = -1;
  13367. return true;
  13368.  
  13369. case 65:
  13370. updateNPCs(inStream, pktSize);
  13371. pktType = -1;
  13372. return true;
  13373.  
  13374. case 27:
  13375. messagePromptRaised = false;
  13376. inputDialogState = 1;
  13377. amountOrNameInput = "";
  13378. inputTaken = true;
  13379. pktType = -1;
  13380. return true;
  13381.  
  13382. case 187:
  13383. messagePromptRaised = false;
  13384. inputDialogState = 2;
  13385. amountOrNameInput = "";
  13386. inputTaken = true;
  13387. pktType = -1;
  13388. return true;
  13389.  
  13390. case 97:
  13391. int l7 = inStream.readUnsignedWord();
  13392. method60(l7);
  13393. if (invOverlayInterfaceID != -1) {
  13394. invOverlayInterfaceID = -1;
  13395. needDrawTabArea = true;
  13396. tabAreaAltered = true;
  13397. }
  13398. if (backDialogID != -1) {
  13399. backDialogID = -1;
  13400. inputTaken = true;
  13401. }
  13402. if (inputDialogState != 0) {
  13403. inputDialogState = 0;
  13404. inputTaken = true;
  13405. }
  13406. openInterfaceID = l7;
  13407. aBoolean1149 = false;
  13408. pktType = -1;
  13409. return true;
  13410.  
  13411. case 218:
  13412. int i8 = inStream.method438();
  13413. dialogID = i8;
  13414. inputTaken = true;
  13415. pktType = -1;
  13416. return true;
  13417.  
  13418. case 87:
  13419. int j8 = inStream.method434();
  13420. int l14 = inStream.method439();
  13421. anIntArray1045[j8] = l14;
  13422. if (variousSettings[j8] != l14) {
  13423. variousSettings[j8] = l14;
  13424. method33(j8);
  13425. needDrawTabArea = true;
  13426. if (dialogID != -1)
  13427. inputTaken = true;
  13428. }
  13429. pktType = -1;
  13430. return true;
  13431.  
  13432. case 36:
  13433. try {
  13434. int k8 = inStream.method434();
  13435. byte byte0 = inStream.readSignedByte();
  13436. anIntArray1045[k8] = byte0;
  13437. if (variousSettings[k8] != byte0) {
  13438. variousSettings[k8] = byte0;
  13439. method33(k8);
  13440. needDrawTabArea = true;
  13441. if (dialogID != -1)
  13442. inputTaken = true;
  13443. }
  13444. pktType = -1;
  13445. } catch (Exception e) {
  13446. }
  13447. return true;
  13448.  
  13449. case 61:
  13450. anInt1055 = inStream.readUnsignedByte();
  13451. pktType = -1;
  13452. return true;
  13453.  
  13454. case 200:
  13455. int l8 = inStream.readUnsignedWord();
  13456. int i15 = inStream.readSignedWord();
  13457. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  13458. class9_4.anInt257 = i15;
  13459. class9_4.modelZoom = 1600;
  13460. if (i15 == -1) {
  13461. class9_4.anInt246 = 0;
  13462. class9_4.anInt208 = 0;
  13463. }
  13464. pktType = -1;
  13465. return true;
  13466.  
  13467. case 219:
  13468. if (invOverlayInterfaceID != -1) {
  13469. invOverlayInterfaceID = -1;
  13470. needDrawTabArea = true;
  13471. tabAreaAltered = true;
  13472. }
  13473. if (backDialogID != -1) {
  13474. backDialogID = -1;
  13475. inputTaken = true;
  13476. }
  13477. if (inputDialogState != 0) {
  13478. inputDialogState = 0;
  13479. inputTaken = true;
  13480. }
  13481. openInterfaceID = -1;
  13482. aBoolean1149 = false;
  13483. pktType = -1;
  13484. return true;
  13485.  
  13486. case 34:
  13487. needDrawTabArea = true;
  13488. int i9 = inStream.readUnsignedWord();
  13489. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  13490. while (inStream.currentOffset < pktSize) {
  13491. int j20 = inStream.method422();
  13492. int i23 = inStream.readUnsignedWord();
  13493. int l25 = inStream.readUnsignedByte();
  13494. if (l25 == 255)
  13495. l25 = inStream.readDWord();
  13496. if (j20 >= 0 && j20 < class9_2.inv.length) {
  13497. class9_2.inv[j20] = i23;
  13498. class9_2.invStackSizes[j20] = l25;
  13499. }
  13500. }
  13501. pktType = -1;
  13502. return true;
  13503.  
  13504. case 4:
  13505. case 44:
  13506. case 84:
  13507. case 101:
  13508. case 105:
  13509. case 117:
  13510. case 147:
  13511. case 151:
  13512. case 156:
  13513. case 160:
  13514. case 215:
  13515. method137(inStream, pktType);
  13516. pktType = -1;
  13517. return true;
  13518.  
  13519. case 106:
  13520. tabID = inStream.method427();
  13521. needDrawTabArea = true;
  13522. tabAreaAltered = true;
  13523. pktType = -1;
  13524. return true;
  13525.  
  13526. case 164:
  13527. int j9 = inStream.method434();
  13528. method60(j9);
  13529. if (invOverlayInterfaceID != -1) {
  13530. invOverlayInterfaceID = -1;
  13531. needDrawTabArea = true;
  13532. tabAreaAltered = true;
  13533. }
  13534. backDialogID = j9;
  13535. inputTaken = true;
  13536. openInterfaceID = -1;
  13537. aBoolean1149 = false;
  13538. pktType = -1;
  13539. return true;
  13540.  
  13541. }
  13542. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  13543. + anInt842 + "," + anInt843);
  13544. resetLogout();
  13545. } catch (IOException _ex) {
  13546. dropClient();
  13547. } catch (Exception exception) {
  13548. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  13549. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  13550. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  13551. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  13552. s2 = s2 + inStream.buffer[j15] + ",";
  13553. signlink.reporterror(s2);
  13554. resetLogout();
  13555. }
  13556. return true;
  13557. }
  13558.  
  13559.  
  13560. public final int[] write(int var1, int var2, int var3, int var4, int var5) {
  13561. if (var1 >= 128 && var3 >= 128 && var1 <= 13056 && var3 <= 13056) {
  13562. int var6 = method42(plane, var3, var1) - var2;
  13563. var1 -= xCameraPos;
  13564. var6 -= zCameraPos;
  13565. var3 -= yCameraPos;
  13566. int var7 = Model.modelIntArray1[yCameraCurve];
  13567. int var8 = Model.modelIntArray2[yCameraCurve];
  13568. int var9 = Model.modelIntArray1[xCameraCurve];
  13569. int var10 = Model.modelIntArray2[xCameraCurve];
  13570. int var11 = var3 * var9 + var1 * var10 >> 16;
  13571. var3 = var3 * var10 - var1 * var9 >> 16;
  13572. var1 = var11;
  13573. var11 = var6 * var8 - var3 * var7 >> 16;
  13574. var3 = var6 * var7 + var3 * var8 >> 16;
  13575. return var3 >= 50 && var3 <= 3500 ? new int[] { Rasterizer.textureInt1 + (var1 << 9) / var3,
  13576. Rasterizer.textureInt2 + (var11 << 9) / var3, var3,
  13577. Rasterizer.textureInt1 + (var1 - var4 / 2 << 9) / var3,
  13578. Rasterizer.textureInt2 + (var11 - var5 / 2 << 9) / var3,
  13579. Rasterizer.textureInt1 + (var1 + var4 / 2 << 9) / var3,
  13580. Rasterizer.textureInt2 + (var11 + var5 / 2 << 9) / var3 }
  13581.  
  13582. : new int[] { 0, 0, 0, 0, 0, 0, 0 };
  13583. } else {
  13584. return new int[] { 0, 0, 0, 0, 0, 0, 0 };
  13585. }
  13586. }
  13587.  
  13588. public boolean displayParticles = true;
  13589.  
  13590. private void method146() {
  13591. anInt1265++;
  13592. method47(true);
  13593. method26(true);
  13594. method47(false);
  13595. method26(false);
  13596. method55();
  13597. method104();
  13598. if (!aBoolean1160) {
  13599. int i = anInt1184;
  13600. if (anInt984 / 256 > i)
  13601. i = anInt984 / 256;
  13602. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  13603. i = anIntArray1203[4] + 128;
  13604. int k = minimapInt1 + anInt896 & 0x7ff;
  13605. setCameraPos(clientZoom + i * 3, i, anInt1014,
  13606. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  13607. }
  13608. int j;
  13609. if (!aBoolean1160)
  13610. j = method120();
  13611. else
  13612. j = method121();
  13613. int l = xCameraPos;
  13614. int i1 = zCameraPos;
  13615. int j1 = yCameraPos;
  13616. int k1 = yCameraCurve;
  13617. int l1 = xCameraCurve;
  13618. for (int i2 = 0; i2 < 5; i2++)
  13619. if (aBooleanArray876[i2]) {
  13620. int j2 = (int) ((Math.random()
  13621. * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  13622. .sin((double) anIntArray1030[i2]
  13623. * ((double) anIntArray928[i2] / 100D))
  13624. * (double) anIntArray1203[i2]);
  13625. if (i2 == 0)
  13626. xCameraPos += j2;
  13627. if (i2 == 1)
  13628. zCameraPos += j2;
  13629. if (i2 == 2)
  13630. yCameraPos += j2;
  13631. if (i2 == 3)
  13632. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  13633. if (i2 == 4) {
  13634. yCameraCurve += j2;
  13635. if (yCameraCurve < 128)
  13636. yCameraCurve = 128;
  13637. if (yCameraCurve > 383)
  13638. yCameraCurve = 383;
  13639. }
  13640. }
  13641. int k2 = Rasterizer.anInt1481;
  13642. Model.aBoolean1684 = true;
  13643. Model.anInt1687 = 0;
  13644. Model.anInt1685 = super.mouseX - 4;
  13645. Model.anInt1686 = super.mouseY - 4;
  13646. DrawingArea.setAllPixelsToZero();
  13647. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  13648. zCameraPos, j, yCameraCurve,displayFog);
  13649. Iterator<ParticleDisplay> iterator;
  13650. ParticleDisplay particle;
  13651. if (displayParticles) {
  13652. iterator = displayedParticles.iterator();
  13653. while (iterator.hasNext()) {
  13654. particle = iterator.next();
  13655. if (particle != null) {
  13656. particle.C();
  13657. if (particle.Z()) {
  13658. particlesToBeRemoved.add(particle);
  13659. } else {
  13660. Particle var16 = particle.B();
  13661. int var40 = particle.D().getX();
  13662. int var41 = particle.D().getY();
  13663. int var42 = particle.D().getZ();
  13664. int var43;
  13665. int var44;
  13666. if (var16.getImage() == null) {
  13667. var43 = 8;
  13668. var44 = 8;
  13669. } else {
  13670. var43 = var16.getImage().width / 4;
  13671. var44 = var16.getImage().height / 4;
  13672. }
  13673. var43 = (int) (var43 * particle.S());
  13674. var44 = (int) (var44 * particle.S());
  13675. int[] var13 = write(var40, var41, var42, var43, var44);
  13676. var43 = var13[5] - var13[3];
  13677. var44 = var13[6] - var13[4];
  13678. int alpha = (int) (particle.getAlpha() * 255.0F);
  13679. int var21 = (int) (4.0F * particle.S());
  13680. int srcAlpha = 256 - alpha;
  13681. int srcR = (particle.getRgb() >> 16 & 255) * alpha;
  13682. int srcG = (particle.getRgb() >> 8 & 255) * alpha;
  13683. int srcB = (particle.getRgb() & 255) * alpha;
  13684. int var26 = var13[1] - var21;
  13685. if (var26 < 0) {
  13686. var26 = 0;
  13687. }
  13688. int var27 = var13[1] + var21;
  13689. if (var27 >= Rasterizer.height) {
  13690. var27 = Rasterizer.height - 1;
  13691. }
  13692. for (int var28 = var26; var28 <= var27; ++var28) {
  13693. int var29 = var28 - var13[1];
  13694. int var30 = (int) Math.sqrt(var21 * var21 - var29 * var29);
  13695. int var31 = var13[0] - var30;
  13696. if (var31 < 0) {
  13697. var31 = 0;
  13698. }
  13699. int var32 = var13[0] + var30;
  13700. if (var32 >= Rasterizer.width) {
  13701. var32 = Rasterizer.width - 1;
  13702. }
  13703. int pixel = var31 + var28 * Rasterizer.width;
  13704. int var34;
  13705. if (var16.getImage() != null) {
  13706. if (DrawingArea.depthBuffer != null) {
  13707. if (DrawingArea.depthBuffer[pixel++] >= particle.F()) {
  13708. var16.getImage().drawTransparentSprite(var13[0], var13[1], alpha);
  13709. }
  13710. }
  13711. } else {
  13712. try {
  13713. int particleDepth = particle.F();
  13714. Float closestObject = DrawingArea.depthBuffer[pixel++];
  13715. if (closestObject >= particleDepth) {
  13716. for (var34 = var31; var34 <= var32; ++var34) {
  13717. int dstR = (aRSImageProducer_1165.anIntArray315[pixel] >> 16 & 255)
  13718. * srcAlpha;
  13719. int dstG = (aRSImageProducer_1165.anIntArray315[pixel] >> 8 & 255)
  13720. * srcAlpha;
  13721. int dstB = (aRSImageProducer_1165.anIntArray315[pixel] & 255) * srcAlpha;
  13722. int rgb = (srcR + dstR >> 8 << 16) + (srcG + dstG >> 8 << 8)
  13723. + (srcB + dstB >> 8);
  13724. aRSImageProducer_1165.anIntArray315[pixel++] = rgb;
  13725. }
  13726. }
  13727. } catch (Exception exception) {
  13728.  
  13729. }
  13730. }
  13731. }
  13732. }
  13733. }
  13734. }
  13735. } else {
  13736. iterator = displayedParticles.iterator();
  13737. while (iterator.hasNext()) {
  13738. particle = iterator.next();
  13739. if (particle != null) {
  13740. particle.C();
  13741. if (particle.Z()) {
  13742. particlesToBeRemoved.add(particle);
  13743. }
  13744. }
  13745. }
  13746. displayedParticles.removeAll(particlesToBeRemoved);
  13747. particlesToBeRemoved.clear();
  13748. }
  13749. displayedParticles.removeAll(particlesToBeRemoved);
  13750. particlesToBeRemoved.clear();
  13751. worldController.clearObj5Cache();
  13752. updateEntities();
  13753. drawHeadIcon();
  13754. method37(k2);
  13755. if (loggedIn) {
  13756. drawUnfixedGame();
  13757. draw3dScreen();
  13758. }
  13759. if (loggedIn) {
  13760. aRSImageProducer_1165.drawGraphics(clientSize == 0 ? 4 : 0, super.graphics, clientSize == 0 ? 4 : 0);
  13761. }
  13762. xCameraPos = l;
  13763. zCameraPos = i1;
  13764. yCameraPos = j1;
  13765. yCameraCurve = k1;
  13766. xCameraCurve = l1;
  13767. }
  13768.  
  13769.  
  13770. public int mixColors(Color color1, Color color2, float i) {
  13771. float ratio = i / 100;
  13772. int red = (int) (color2.getRed() * ratio + color1.getRed()
  13773. * (1 - ratio));
  13774. int green = (int) (color2.getGreen() * ratio + color1.getGreen()
  13775. * (1 - ratio));
  13776. int blue = (int) (color2.getBlue() * ratio + color1.getBlue()
  13777. * (1 - ratio));
  13778. return new Color(red, green, blue).getRGB();
  13779. }
  13780. static int step = 1;
  13781. public static int currentFogColor = 0xc6bfa6;
  13782. public static int fadingTo;
  13783. static boolean switching = false;
  13784.  
  13785.  
  13786. private ArrayList<ParticleDisplay> displayedParticles;
  13787. private ArrayList<ParticleDisplay> particlesToBeRemoved;
  13788.  
  13789. public final void I(ParticleDisplay var1) {
  13790. displayedParticles.add(var1);
  13791. }
  13792.  
  13793.  
  13794. public void preloadModels() {
  13795. File file = new File(signlink.findcachedir() + "/models/");
  13796. File afile[] = file.listFiles();
  13797. for (int i = 0; i < afile.length; i++) {
  13798. String s = afile[i].getName();
  13799. byte abyte0[] = ReadFile(signlink.findcachedir() + "/models/" + s);
  13800. Model.method460(abyte0,
  13801. Integer.parseInt(getFileNameWithoutExtension(s)));
  13802. }
  13803.  
  13804. }
  13805.  
  13806. public void clearTopInterfaces() {
  13807. stream.createFrame(130);
  13808. if (invOverlayInterfaceID != -1) {
  13809. invOverlayInterfaceID = -1;
  13810. needDrawTabArea = true;
  13811. aBoolean1149 = false;
  13812. tabAreaAltered = true;
  13813. }
  13814. if (backDialogID != -1) {
  13815. backDialogID = -1;
  13816. inputTaken = true;
  13817. aBoolean1149 = false;
  13818. }
  13819. openInterfaceID = -1;
  13820. fullscreenInterfaceID = -1;
  13821. }
  13822.  
  13823. public int totalItemResults;
  13824. public String itemResultNames[] = new String[100];
  13825. public int itemResultIDs[] = new int[100];
  13826. public int itemResultScrollPos;
  13827. public void itemSearch(String itemName) {
  13828. if (itemName == null || itemName.length() == 0) {
  13829. totalItemResults = 0;
  13830. return;
  13831. }
  13832. String searchName = itemName;
  13833. String searchParts[] = new String[100];
  13834. int totalResults = 0;
  13835. do {
  13836. int regex = searchName.indexOf(" ");
  13837. if (regex == -1) {
  13838. break;
  13839. }
  13840. String part = searchName.substring(0, regex).trim();
  13841. if (part.length() > 0) {
  13842. searchParts[totalResults++] = part.toLowerCase();
  13843. }
  13844. searchName = searchName.substring(regex + 1);
  13845. } while (true);
  13846. searchName = searchName.trim();
  13847. if (searchName.length() > 0) {
  13848. searchParts[totalResults++] = searchName.toLowerCase();
  13849. }
  13850. totalItemResults = 0;
  13851. label0: for (int id = 0; id < ItemDef.totalItems; id++) {
  13852. ItemDef item = ItemDef.forID(id);
  13853. if (item.certTemplateID != -1 || item.name == null) {
  13854. continue;
  13855. }
  13856. String resultName = item.name.toLowerCase();
  13857. for (int index = 0; index < totalResults; index++) {
  13858. if (resultName.indexOf(searchParts[index]) == -1) {
  13859. continue label0;
  13860. }
  13861. }
  13862. System.out.println(resultName);
  13863. itemResultNames[totalItemResults] = resultName;
  13864. itemResultIDs[totalItemResults] = id;
  13865. totalItemResults++;
  13866. if (totalItemResults >= itemResultNames.length) {
  13867. return;
  13868. }
  13869. }
  13870. }
  13871.  
  13872. public client() {
  13873. displayedParticles = new ArrayList<ParticleDisplay>(10000);
  13874. particlesToBeRemoved = new ArrayList<ParticleDisplay>();
  13875. mapBack = new Background[2];
  13876. fullscreenInterfaceID = -1;
  13877. chatRights = new int[500];
  13878. chatTypeView = 0;
  13879. clanTitles = new String[500];
  13880. clanChatMode = 0;
  13881. cButtonHPos = -1;
  13882. cButtonCPos = 0;
  13883. //server = "127.0.0.1";
  13884. server = "phantom-pkz.servegame.com";
  13885. anIntArrayArray825 = new int[104][104];
  13886. friendsNodeIDs = new int[200];
  13887. groundArray = new NodeList[4][104][104];
  13888. aBoolean831 = false;
  13889. aStream_834 = new Stream(new byte[5000]);
  13890. npcArray = new NPC[16384];
  13891. npcIndices = new int[16384];
  13892. anIntArray840 = new int[1000];
  13893. aStream_847 = Stream.create();
  13894. aBoolean848 = true;
  13895. openInterfaceID = -1;
  13896. currentExp = new int[Skills.skillsCount];
  13897. aBoolean872 = false;
  13898. anIntArray873 = new int[5];
  13899. anInt874 = -1;
  13900. aBooleanArray876 = new boolean[5];
  13901. drawFlames = false;
  13902. reportAbuseInput = "";
  13903. unknownInt10 = -1;
  13904. menuOpen = false;
  13905. inputString = "";
  13906. maxPlayers = 2048;
  13907. myPlayerIndex = 2047;
  13908. playerArray = new Player[maxPlayers];
  13909. playerIndices = new int[maxPlayers];
  13910. anIntArray894 = new int[maxPlayers];
  13911. aStreamArray895s = new Stream[maxPlayers];
  13912. anInt897 = 1;
  13913. anIntArrayArray901 = new int[104][104];
  13914. aByteArray912 = new byte[16384];
  13915. currentStats = new int[Skills.skillsCount];
  13916. ignoreListAsLongs = new long[100];
  13917. loadingError = false;
  13918. anIntArray928 = new int[5];
  13919. anIntArrayArray929 = new int[104][104];
  13920. chatTypes = new int[500];
  13921. chatNames = new String[500];
  13922. chatMessages = new String[500];
  13923. chatButtons = new Sprite[4];
  13924. hitMarks562 = new Sprite[4];
  13925. sideIcons = new Sprite[15];
  13926. redStones = new Sprite[5];
  13927. aBoolean954 = true;
  13928. friendsListAsLongs = new long[200];
  13929. currentSong = -1;
  13930. drawingFlames = false;
  13931. spriteDrawX = -1;
  13932. spriteDrawY = -1;
  13933. anIntArray968 = new int[33];
  13934. anIntArray969 = new int[256];
  13935. decompressors = new Decompressor[6];
  13936. variousSettings = new int[2000];
  13937. aBoolean972 = false;
  13938. anInt975 = 50;
  13939. anIntArray976 = new int[anInt975];
  13940. anIntArray977 = new int[anInt975];
  13941. anIntArray978 = new int[anInt975];
  13942. anIntArray979 = new int[anInt975];
  13943. anIntArray980 = new int[anInt975];
  13944. anIntArray981 = new int[anInt975];
  13945. anIntArray982 = new int[anInt975];
  13946. aStringArray983 = new String[anInt975];
  13947. anInt985 = -1;
  13948. hitMarks = new Sprite[20];
  13949. anIntArray990 = new int[5];
  13950. aBoolean994 = false;
  13951. amountOrNameInput = "";
  13952. aClass19_1013 = new NodeList();
  13953. aBoolean1017 = false;
  13954. anInt1018 = -1;
  13955. anIntArray1030 = new int[5];
  13956. aBoolean1031 = false;
  13957. mapFunctions = new Sprite[100];
  13958. dialogID = -1;
  13959. maxStats = new int[Skills.skillsCount];
  13960. anIntArray1045 = new int[2000];
  13961. aBoolean1047 = true;
  13962. anIntArray1052 = new int[151];
  13963. anInt1054 = -1;
  13964. aClass19_1056 = new NodeList();
  13965. anIntArray1057 = new int[33];
  13966. aClass9_1059 = new RSInterface();
  13967. mapScenes = new Background[100];
  13968. barFillColor = 0x4d4233;
  13969. anIntArray1065 = new int[7];
  13970. anIntArray1072 = new int[1000];
  13971. anIntArray1073 = new int[1000];
  13972. aBoolean1080 = false;
  13973. friendsList = new String[200];
  13974. inStream = Stream.create();
  13975. expectedCRCs = new int[9];
  13976. menuActionCmd2 = new int[500];
  13977. menuActionCmd3 = new int[500];
  13978. menuActionID = new int[500];
  13979. menuActionCmd1 = new int[500];
  13980. headIcons = new Sprite[20];
  13981. skullIcons = new Sprite[20];
  13982. headIconsHint = new Sprite[20];
  13983. tabAreaAltered = false;
  13984. aString1121 = "";
  13985. atPlayerActions = new String[5];
  13986. atPlayerArray = new boolean[5];
  13987. anIntArrayArrayArray1129 = new int[4][13][13];
  13988. anInt1132 = 2;
  13989. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13990. aBoolean1141 = false;
  13991. aBoolean1149 = false;
  13992. crosses = new Sprite[8];
  13993. musicEnabled = true;
  13994. needDrawTabArea = false;
  13995. loggedIn = false;
  13996. canMute = false;
  13997. aBoolean1159 = false;
  13998. aBoolean1160 = false;
  13999. anInt1171 = 1;
  14000. myUsername = "";
  14001. myPassword = "";
  14002. genericLoadingError = false;
  14003. reportAbuseInterfaceID = -1;
  14004. aClass19_1179 = new NodeList();
  14005. anInt1184 = 128;
  14006. invOverlayInterfaceID = -1;
  14007. stream = Stream.create();
  14008. menuActionName = new String[500];
  14009. anIntArray1203 = new int[5];
  14010. anIntArray1207 = new int[50];
  14011. anInt1210 = 2;
  14012. chatScrollMax = 78;
  14013. anInt1211 = 78;
  14014. promptInput = "";
  14015. modIcons = new Sprite[10];
  14016. tabID = 3;
  14017. inputTaken = false;
  14018. songChanging = true;
  14019. anIntArray1229 = new int[151];
  14020. aClass11Array1230 = new Class11[4];
  14021. anIntArray1241 = new int[50];
  14022. aBoolean1242 = false;
  14023. anIntArray1250 = new int[50];
  14024. rsAlreadyLoaded = false;
  14025. welcomeScreenRaised = false;
  14026. messagePromptRaised = false;
  14027. loginMessage1 = "";
  14028. loginMessage2 = "";
  14029. backDialogID = -1;
  14030. anInt1279 = 2;
  14031. bigX = new int[4000];
  14032. bigY = new int[4000];
  14033. anInt1289 = -1;
  14034. }
  14035.  
  14036. void mouseWheelDragged(int i, int j) {
  14037. if (!mouseWheelDown)
  14038. return;
  14039. this.anInt1186 += i * 3;
  14040. this.anInt1187 += (j << 1);
  14041. }
  14042.  
  14043. public int rights;
  14044. public String name;
  14045. public String message;
  14046. public String clanname;
  14047. private final int[] chatRights;
  14048. public int chatTypeView;
  14049. public int clanChatMode;
  14050. public int duelMode; /* Declare custom sprites */
  14051. public Sprite multiOverlay;
  14052.  
  14053. private Sprite chatArea;
  14054. private Sprite worldMapIcon;
  14055. private Sprite[] hitMarks562;
  14056. private Sprite[] chatButtons;
  14057. private Sprite tabArea;
  14058. private Sprite mapArea;
  14059. private Sprite HPBarFull;
  14060. private Sprite HPBarEmpty;
  14061. private Sprite achievementBar;
  14062. private Sprite achievementIcon;
  14063. private Sprite[] xpIcon = new Sprite[4];
  14064. private RSImageProducer leftFrame;
  14065. private RSImageProducer topFrame;
  14066. private RSImageProducer rightFrame;
  14067. private int ignoreCount;
  14068. private long aLong824;
  14069. private int[][] anIntArrayArray825;
  14070. private int[] friendsNodeIDs;
  14071. private NodeList[][][] groundArray;
  14072. private int[] anIntArray828;
  14073. private int[] anIntArray829;
  14074. private volatile boolean aBoolean831;
  14075. private Socket aSocket832;
  14076. private int loginScreenState;
  14077. private Stream aStream_834;
  14078. private NPC[] npcArray;
  14079. private int npcCount;
  14080. private int[] npcIndices;
  14081. private int anInt839;
  14082. private int[] anIntArray840;
  14083. private int anInt841;
  14084. private int anInt842;
  14085. private int anInt843;
  14086. private String aString844;
  14087. private int privateChatMode;
  14088. private Stream aStream_847;
  14089. private boolean aBoolean848;
  14090. private static int anInt849;
  14091. private int[] anIntArray850;
  14092. private int[] anIntArray851;
  14093. private int[] anIntArray852;
  14094. private int[] anIntArray853;
  14095. private static int anInt854;
  14096. private int anInt855;
  14097. static int openInterfaceID;
  14098. int xCameraPos;
  14099. int zCameraPos;
  14100. int yCameraPos;
  14101. private int yCameraCurve;
  14102. private int xCameraCurve;
  14103. private int myPrivilege;
  14104. private final int[] currentExp;
  14105. private Sprite[] redStones;
  14106. private Sprite mapFlag;
  14107. private Sprite mapMarker;
  14108. private boolean aBoolean872;
  14109. private final int[] anIntArray873;
  14110. private int anInt874;
  14111. private final boolean[] aBooleanArray876;
  14112. private int weight;
  14113. private MouseDetection mouseDetection;
  14114. private volatile boolean drawFlames;
  14115. private String reportAbuseInput;
  14116. private int unknownInt10;
  14117. private boolean menuOpen;
  14118. private int anInt886;
  14119. private String inputString;
  14120. private final int maxPlayers;
  14121. private final int myPlayerIndex;
  14122. private Player[] playerArray;
  14123. private int playerCount;
  14124. private int[] playerIndices;
  14125. private int anInt893;
  14126. private int[] anIntArray894;
  14127. private Stream[] aStreamArray895s;
  14128. private int anInt896;
  14129. private int anInt897;
  14130. private int friendsCount;
  14131. private int anInt900;
  14132. private int[][] anIntArrayArray901;
  14133. private byte[] aByteArray912;
  14134. private int anInt913;
  14135. private int crossX;
  14136. private int crossY;
  14137. private int crossIndex;
  14138. private int crossType;
  14139. private int plane;
  14140. private final int[] currentStats;
  14141. private static int anInt924;
  14142. private final long[] ignoreListAsLongs;
  14143. private boolean loadingError;
  14144. private final int[] anIntArray928;
  14145. private int[][] anIntArrayArray929;
  14146. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  14147. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  14148. private int anInt933;
  14149. private int anInt934;
  14150. private int anInt935;
  14151. private int anInt936;
  14152. private int anInt937;
  14153. private int anInt938;
  14154. private final int[] chatTypes;
  14155. private final String[] chatNames;
  14156. private final String[] chatMessages;
  14157. private int anInt945;
  14158. private WorldController worldController;
  14159. private Sprite[] sideIcons;
  14160. private int menuScreenArea;
  14161. private int menuOffsetX;
  14162. private int menuOffsetY;
  14163. private int menuWidth;
  14164. private int menuHeight;
  14165. private long aLong953;
  14166. private boolean aBoolean954;
  14167. private long[] friendsListAsLongs;
  14168. private int currentSong;
  14169. private static int nodeID = 10;
  14170. static int portOff;
  14171. static boolean clientData;
  14172. private static boolean isMembers = true;
  14173. private static boolean lowMem;
  14174. private volatile boolean drawingFlames;
  14175. private int spriteDrawX;
  14176. private int spriteDrawY;
  14177. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  14178. 0xff00ff, 0xffffff };
  14179. private Background aBackground_966;
  14180. private Background aBackground_967;
  14181. private final int[] anIntArray968;
  14182. private final int[] anIntArray969;
  14183. final Decompressor[] decompressors;
  14184. public int variousSettings[];
  14185. private boolean aBoolean972;
  14186. private final int anInt975;
  14187. private final int[] anIntArray976;
  14188. private final int[] anIntArray977;
  14189. private final int[] anIntArray978;
  14190. private final int[] anIntArray979;
  14191. private final int[] anIntArray980;
  14192. private final int[] anIntArray981;
  14193. private final int[] anIntArray982;
  14194. private final String[] aStringArray983;
  14195. private int anInt984;
  14196. private int anInt985;
  14197. private static int anInt986;
  14198. private Sprite[] hitMarks;
  14199. private int anInt988;
  14200. private int anInt989;
  14201. private final int[] anIntArray990;
  14202. private static boolean aBoolean993;
  14203. private final boolean aBoolean994;
  14204. private int anInt995;
  14205. private int anInt996;
  14206. private int anInt997;
  14207. private int anInt998;
  14208. private int anInt999;
  14209. private ISAACRandomGen encryption;
  14210. private Sprite mapEdge;
  14211. static final int[][] anIntArrayArray1003 = {
  14212. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  14213. 54193 },
  14214. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  14215. 56621, 4783, 1341, 16578, 35003, 25239 },
  14216. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  14217. 10153, 56621, 4783, 1341, 16578, 35003 },
  14218. { 4626, 11146, 6439, 12, 4758, 10270 },
  14219. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  14220. private String amountOrNameInput;
  14221. private static int anInt1005;
  14222. private int daysSinceLastLogin;
  14223. private int pktSize;
  14224. private int pktType;
  14225. private int anInt1009;
  14226. private int anInt1010;
  14227. private int anInt1011;
  14228. private NodeList aClass19_1013;
  14229. private int anInt1014;
  14230. private int anInt1015;
  14231. private int anInt1016;
  14232. private boolean aBoolean1017;
  14233. private int anInt1018;
  14234. private static final int[] anIntArray1019;
  14235. private int anInt1021;
  14236. private int anInt1022;
  14237. private int loadingStage;
  14238. private Sprite scrollBar1;
  14239. private Sprite scrollBar2;
  14240. private int anInt1026;
  14241. private final int[] anIntArray1030;
  14242. private boolean aBoolean1031;
  14243. private Sprite[] mapFunctions;
  14244. static int baseX;
  14245. static int baseY;
  14246. private int anInt1036;
  14247. private int anInt1037;
  14248. private int loginFailures;
  14249. private int anInt1039;
  14250. private int anInt1040;
  14251. private int anInt1041;
  14252. private int dialogID;
  14253. private final int[] maxStats;
  14254. private final int[] anIntArray1045;
  14255. private int anInt1046;
  14256. private boolean aBoolean1047;
  14257. private int anInt1048;
  14258. private String aString1049;
  14259. private static int anInt1051;
  14260. private final int[] anIntArray1052;
  14261. private StreamLoader titleStreamLoader;
  14262. private int anInt1054;
  14263. private int anInt1055;
  14264. private NodeList aClass19_1056;
  14265. private final int[] anIntArray1057;
  14266. public final RSInterface aClass9_1059;
  14267. private Background[] mapScenes;
  14268. private static int anInt1061;
  14269. private int anInt1062;
  14270. private final int barFillColor;
  14271. private int friendsListAction;
  14272. private final int[] anIntArray1065;
  14273. private int mouseInvInterfaceIndex;
  14274. private int lastActiveInvInterface;
  14275. public static OnDemandFetcher onDemandFetcher;
  14276. private int anInt1069;
  14277. private int anInt1070;
  14278. private int anInt1071;
  14279. private int[] anIntArray1072;
  14280. private int[] anIntArray1073;
  14281. private Sprite mapDotItem;
  14282. private Sprite mapDotNPC;
  14283. private Sprite mapDotPlayer;
  14284. private Sprite mapDotFriend;
  14285. private Sprite mapDotTeam;
  14286. private Sprite mapDotClan;
  14287. private int anInt1079;
  14288. private boolean aBoolean1080;
  14289. private String[] friendsList;
  14290. private Stream inStream;
  14291. private int anInt1084;
  14292. private int anInt1085;
  14293. private int activeInterfaceType;
  14294. private int anInt1087;
  14295. private int anInt1088;
  14296. private final int[] expectedCRCs;
  14297. private int[] menuActionCmd2;
  14298. private int[] menuActionCmd3;
  14299. private int[] menuActionID;
  14300. private int[] menuActionCmd1;
  14301. private Sprite[] headIcons;
  14302. private Sprite[] skullIcons;
  14303. private Sprite[] headIconsHint;
  14304. private static int anInt1097;
  14305. private int anInt1098;
  14306. private int anInt1099;
  14307. private int anInt1100;
  14308. private int anInt1101;
  14309. private int anInt1102;
  14310. static boolean tabAreaAltered;
  14311. private int anInt1104;
  14312. private RSImageProducer aRSImageProducer_1107;
  14313. private RSImageProducer aRSImageProducer_1108;
  14314. private RSImageProducer aRSImageProducer_1109;
  14315. private RSImageProducer aRSImageProducer_1110;
  14316. private RSImageProducer aRSImageProducer_1111;
  14317. private RSImageProducer aRSImageProducer_1112;
  14318. private RSImageProducer aRSImageProducer_1113;
  14319. private RSImageProducer aRSImageProducer_1114;
  14320. private RSImageProducer aRSImageProducer_1115;
  14321. private static int anInt1117;
  14322. private int membersInt;
  14323. private String aString1121;
  14324. private Sprite compass;
  14325. private RSImageProducer aRSImageProducer_1125;
  14326. public static Player myPlayer;
  14327. private final String[] atPlayerActions;
  14328. private final boolean[] atPlayerArray;
  14329. private final int[][][] anIntArrayArrayArray1129;
  14330. final static int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
  14331. -1, -1, -1, -1, -1, -1 };
  14332. private int anInt1131;
  14333. private int anInt1132;
  14334. private int menuActionRow;
  14335. private static int anInt1134;
  14336. private int spellSelected;
  14337. private int anInt1137;
  14338. private int spellUsableOn;
  14339. private String spellTooltip;
  14340. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  14341. private boolean aBoolean1141;
  14342. private static int anInt1142;
  14343. private int energy;
  14344. private boolean aBoolean1149;
  14345. private Sprite[] crosses;
  14346. private boolean musicEnabled;
  14347. private Background[] aBackgroundArray1152s;
  14348. static boolean needDrawTabArea;
  14349. private int unreadMessages;
  14350. private static int anInt1155;
  14351. private static boolean fpsOn;
  14352. public boolean loggedIn;
  14353. private boolean canMute;
  14354. private boolean aBoolean1159;
  14355. private boolean aBoolean1160;
  14356. static int loopCycle;
  14357. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  14358. private RSImageProducer aRSImageProducer_1163;
  14359. private RSImageProducer mapEdgeIP;
  14360. private RSImageProducer aRSImageProducer_1164;
  14361. private RSImageProducer aRSImageProducer_1165;
  14362. private RSImageProducer aRSImageProducer_1166;
  14363. private int daysSinceRecovChange;
  14364. private RSSocket socketStream;
  14365. private int minimapInt3;
  14366. private int anInt1171;
  14367. private long aLong1172;
  14368. private static String myUsername;
  14369. private static String myPassword;
  14370. private static int anInt1175;
  14371. private boolean genericLoadingError;
  14372. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  14373. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  14374. private int reportAbuseInterfaceID;
  14375. private NodeList aClass19_1179;
  14376. private int[] anIntArray1180;
  14377. private int[] anIntArray1181;
  14378. private int[] anIntArray1182;
  14379. private byte[][] aByteArrayArray1183;
  14380. private int anInt1184;
  14381. private int minimapInt1;
  14382. private int anInt1186;
  14383. private int anInt1187;
  14384. private static int anInt1188;
  14385. private int invOverlayInterfaceID;
  14386. private int[] anIntArray1190;
  14387. private int[] anIntArray1191;
  14388. private Stream stream;
  14389. private int anInt1193;
  14390. private int splitPrivateChat;
  14391. private String[] clanList = new String[100];
  14392. private final Background[] mapBack;
  14393. private String[] menuActionName;
  14394. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  14395. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  14396. private final int[] anIntArray1203;
  14397. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  14398. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  14399. private static boolean flagged;
  14400. private final int[] anIntArray1207;
  14401. private int anInt1208;
  14402. private int minimapInt2;
  14403. private int anInt1210;
  14404. static int anInt1211;
  14405. private String promptInput;
  14406. private int anInt1213;
  14407. private int[][][] intGroundArray;
  14408. private long aLong1215;
  14409. private int loginScreenCursorPos;
  14410. private final Sprite[] modIcons;
  14411. private long aLong1220;
  14412. static int tabID;
  14413. private int anInt1222;
  14414. public static boolean inputTaken;
  14415. private int inputDialogState;
  14416. private static int anInt1226;
  14417. private int nextSong;
  14418. private boolean songChanging;
  14419. private final int[] anIntArray1229;
  14420. private Class11[] aClass11Array1230;
  14421. public static int anIntArray1232[];
  14422. private int[] anIntArray1234;
  14423. private int[] anIntArray1235;
  14424. private int[] anIntArray1236;
  14425. private int anInt1237;
  14426. private int anInt1238;
  14427. public final int anInt1239 = 100;
  14428. private final int[] anIntArray1241;
  14429. private boolean aBoolean1242;
  14430. private int atInventoryLoopCycle;
  14431. private int atInventoryInterface;
  14432. private int atInventoryIndex;
  14433. private int atInventoryInterfaceType;
  14434. private byte[][] aByteArrayArray1247;
  14435. private int tradeMode;
  14436. private int anInt1249;
  14437. private final int[] anIntArray1250;
  14438. private int anInt1251;
  14439. private final boolean rsAlreadyLoaded;
  14440. private int anInt1253;
  14441. private int anInt1254;
  14442. private boolean welcomeScreenRaised;
  14443. private boolean messagePromptRaised;
  14444. private int anInt1257;
  14445. private byte[][][] byteGroundArray;
  14446. private int prevSong;
  14447. private int destX;
  14448. private int destY;
  14449. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  14450. private int anInt1264;
  14451. private int anInt1265;
  14452. private String loginMessage1;
  14453. private String loginMessage2;
  14454. private int anInt1268;
  14455. private int anInt1269;
  14456. private TextDrawingArea smallText;
  14457. private TextDrawingArea expText;
  14458. private TextDrawingArea aTextDrawingArea_1271;
  14459. private RSFont aTextDrawingArea_12711;
  14460. private TextDrawingArea chatTextDrawingArea;
  14461. public TextDrawingArea aTextDrawingArea_1273;
  14462. public RSFont newSmallFont;
  14463. public RSFont newRegularFont;
  14464. public RSFont newBoldFont;
  14465. public RSFont newFancyFont;
  14466. private TextDrawingArea[] skillText = new TextDrawingArea[7];
  14467. private int anInt1275;
  14468. private int backDialogID;
  14469. private int anInt1278;
  14470. private int anInt1279;
  14471. private int[] bigX;
  14472. private int[] bigY;
  14473. private int itemSelected;
  14474. private int anInt1283;
  14475. private int anInt1284;
  14476. private int anInt1285;
  14477. private String selectedItemName;
  14478. private int publicChatMode;
  14479. private static int anInt1288;
  14480. private int anInt1289;
  14481. public static int anInt1290;
  14482. public String server = "";
  14483. public int drawCount;
  14484. public int fullscreenInterfaceID;
  14485. public int anInt1044; // 377
  14486. public int anInt1129; // 377
  14487. public int anInt1315; // 377
  14488. public int anInt1500; // 377
  14489. public int anInt1501; // 377
  14490. public int[] fullScreenTextureArray;
  14491. private Sprite[] skillImage = new Sprite[7];
  14492. public TextDrawingArea myFont;
  14493.  
  14494. /**
  14495. * New login box
  14496. */
  14497. private Sprite background;
  14498. private Sprite titleBox;
  14499. private Sprite titleButton;
  14500. private Sprite titleButtonHover;
  14501. private Sprite titleButtonHover_1;
  14502. private Sprite titleButton_1;
  14503. private Sprite twitter;
  14504. private Sprite twitterHover;
  14505. private Sprite youtubeHover;
  14506. private Sprite facebookeHover;
  14507. private Sprite youtube;
  14508. private Sprite facebook;
  14509. private Sprite passwordHover;
  14510. private Sprite usernameHover;
  14511. private Sprite saveButton;
  14512. private Sprite saveButton1;
  14513. private Sprite[] ORBS = new Sprite[16];
  14514.  
  14515. private Sprite[] emoticons = new Sprite[100];
  14516.  
  14517. public void resetAllImageProducers() {
  14518. if (super.fullGameScreen != null) {
  14519. return;
  14520. }
  14521. aRSImageProducer_1166 = null;
  14522. aRSImageProducer_1164 = null;
  14523. aRSImageProducer_1163 = null;
  14524. aRSImageProducer_1165 = null;
  14525. aRSImageProducer_1125 = null;
  14526. aRSImageProducer_1107 = null;
  14527. aRSImageProducer_1108 = null;
  14528. aRSImageProducer_1109 = null;
  14529. aRSImageProducer_1110 = null;
  14530. aRSImageProducer_1111 = null;
  14531. aRSImageProducer_1112 = null;
  14532. aRSImageProducer_1113 = null;
  14533. aRSImageProducer_1114 = null;
  14534. aRSImageProducer_1115 = null;
  14535. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  14536. welcomeScreenRaised = true;
  14537. }
  14538.  
  14539. public void launchURL(String url) {
  14540. String osName = System.getProperty("os.name");
  14541. try {
  14542. if (osName.startsWith("Mac OS")) {
  14543. @SuppressWarnings("rawtypes")
  14544. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  14545. @SuppressWarnings("unchecked")
  14546. Method openURL = fileMgr.getDeclaredMethod("openURL",
  14547. new Class[] { String.class });
  14548. openURL.invoke(null, new Object[] { url });
  14549. } else if (osName.startsWith("Windows"))
  14550. Runtime.getRuntime().exec(
  14551. "rundll32 url.dll,FileProtocolHandler " + url);
  14552. else { // assume Unix or Linux
  14553. String[] browsers = { "firefox", "opera", "konqueror",
  14554. "epiphany", "mozilla", "netscape", "safari" };
  14555. String browser = null;
  14556. for (int count = 0; count < browsers.length && browser == null; count++)
  14557. if (Runtime.getRuntime()
  14558. .exec(new String[] { "which", browsers[count] })
  14559. .waitFor() == 0)
  14560. browser = browsers[count];
  14561. if (browser == null) {
  14562. throw new Exception("Could not find web browser");
  14563. } else
  14564. Runtime.getRuntime().exec(new String[] { browser, url });
  14565. }
  14566. } catch (Exception e) {
  14567. pushMessage("Failed to open URL.", 0, "");
  14568. }
  14569. }
  14570.  
  14571. public int getXPForLevel(int level) {
  14572. int points = 0;
  14573. int output = 0;
  14574. for (int lvl = 1; lvl <= level; lvl++) {
  14575. points += Math.floor(lvl + 300.0 * Math.pow(2.0, lvl / 7.0));
  14576. if (lvl >= level) {
  14577. return output;
  14578. }
  14579. output = (int) Math.floor(points / 4);
  14580. }
  14581. return 0;
  14582. }
  14583.  
  14584. public String[] skillNames = { "Attack", "Hitpoints", "Mining", "Strength",
  14585. "Agility", "Smithing", "Defence", "Herblore", "Fishing", "Range",
  14586. "Thieving", "Cooking", "Prayer", "Crafting", "Firemaking", "Magic",
  14587. "Fletching", "Woodcutting", "Rune", "Slayer", "Farming",
  14588. "Construction", "Hunter", "Summoning", "Dungeoneering" };
  14589.  
  14590. private static DecimalFormat decimal = new DecimalFormat("#,###.##");
  14591.  
  14592. public static boolean distanceFog = false;
  14593.  
  14594. public String setMessage(int level) {
  14595. String[] messages = new String[4];
  14596. String message = "";
  14597. int maxLevel = 99;
  14598. if (maxStats[level] > maxLevel) {
  14599. if (level != 24) {
  14600. maxStats[level] = 99;
  14601. } else if (maxStats[level] > 120) {
  14602. maxStats[level] = 120;
  14603. }
  14604. }
  14605. int[] stuff = { 0, 3, 14, 2, 16, 13, 1, 15, 10, 4, 17, 7, 5, 12, 11, 6,
  14606. 9, 8, 20, 18, 19, 21, 22, 23, 24 };
  14607. messages[0] = skillNames[level] + ": " + currentStats[stuff[level]]
  14608. + "/" + maxStats[stuff[level]] + "\\n";
  14609. messages[1] = "Current XP: "
  14610. + decimal.format(getXPForLevel(maxStats[stuff[level]])) + "\\n";
  14611. messages[2] = "Next level: "
  14612. + decimal
  14613. .format((getXPForLevel(maxStats[stuff[level]] + 1) - getXPForLevel(maxStats[stuff[level]])))
  14614. + "\\n";
  14615. messages[3] = "Remainder: "
  14616. + decimal.format(getXPForLevel(maxStats[stuff[level]] + 1));
  14617. message = messages[0] + messages[1] + messages[2] + messages[3];
  14618. return message;
  14619. }
  14620.  
  14621.  
  14622.  
  14623. static {
  14624. anIntArray1019 = new int[99];
  14625. int i = 0;
  14626. for (int j = 0; j < 99; j++) {
  14627. int l = j + 1;
  14628. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  14629. i += i1;
  14630. anIntArray1019[j] = i / 4;
  14631. }
  14632. anIntArray1232 = new int[32];
  14633. i = 2;
  14634. for (int k = 0; k < 32; k++) {
  14635. anIntArray1232[k] = i - 1;
  14636. i += i;
  14637. }
  14638. }
  14639. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement