Advertisement
RobloxGamerEvs

Private Server File

Jul 2nd, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 438.11 KB | None | 0 0
  1. import java.applet.AppletContext;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Font;
  5. import java.awt.Graphics;
  6. import java.awt.Toolkit;
  7. import java.io.BufferedInputStream;
  8. import java.io.DataInputStream;
  9. import java.io.File;
  10. import java.io.FileInputStream;
  11. import java.io.IOException;
  12. import java.io.OutputStream;
  13. import java.lang.reflect.Method;
  14. import java.net.InetAddress;
  15. import java.net.Socket;
  16. import java.net.URL;
  17. import java.text.NumberFormat;
  18. import java.util.ArrayList;
  19. import java.util.Arrays;
  20.  
  21. import javax.swing.JFrame;
  22.  
  23. @SuppressWarnings("serial")
  24. public class Client extends RSApplet {
  25.  
  26. public static int REGULAR_WIDTH = 765, REGULAR_HEIGHT = 503;
  27.  
  28. public int[] xpAddedPos = new int[5];
  29. public int[] expAdded = new int[5];
  30.  
  31. public int latest = 0;
  32. public boolean fog = false;
  33. public boolean counterOn = false;
  34. static JFrame frame;
  35.  
  36. public int getPrevious() {
  37. return latest == 0 ? 4 : latest - 1;
  38. }
  39.  
  40. public int lastLoadI;
  41.  
  42. ArrayList<RSInterface> parallelWidgetList = new ArrayList<RSInterface>();
  43.  
  44. private void drawParallelWidgets() {
  45. if (this.parallelWidgetList.size() <= 0)
  46. return;
  47. for (RSInterface widget : this.parallelWidgetList) {
  48. if (widget != null) {
  49. int xPosition = 512 / 2 - widget.width / 2;
  50. int yPosition = 334 / 2 - widget.height / 2;
  51. switch (widget.id) {
  52. case 28710:
  53. if (RSInterface.interfaceCache[28714].message.length() < 1)
  54. continue;
  55. xPosition = 392; // 392
  56. yPosition = 280;
  57. break;
  58. }
  59. drawInterface(0, xPosition, widget, yPosition);
  60. }
  61. }
  62. }
  63. private void SortTabs() {
  64. // try {
  65. if (openInterfaceID == 24959
  66. && RSInterface.interfaceCache[27000].message.equals("1")) {// Sent
  67. // on
  68. // bank
  69. // opening
  70. // etc,
  71. // refresh
  72. // tabs
  73. int tabs = Integer
  74. .parseInt(RSInterface.interfaceCache[27001].message);// # of
  75. // tabs
  76. // used
  77. int tab = Integer
  78. .parseInt(RSInterface.interfaceCache[27002].message);// current
  79. // tab
  80. // selected
  81. for (int i = 0; i <= tabs; i++) {
  82. RSInterface.interfaceCache[22025 + i].sprite1 = new Sprite(
  83. "interfaces/Bank/TAB 3");
  84. RSInterface.interfaceCache[22025 + i].tooltip = "Click here to select tab "
  85. + (int) (i + 1);
  86. }
  87. for (int i = tabs + 1; i <= 8; i++) {
  88. RSInterface.interfaceCache[22024 + i].sprite1 = new Sprite("");
  89. RSInterface.interfaceCache[22024 + i].tooltip = "";
  90. }
  91. if (tabs != 8) {
  92. RSInterface.interfaceCache[22025 + tabs].sprite1 = new Sprite(
  93. "interfaces/Bank/TAB 4");
  94. RSInterface.interfaceCache[22025 + tabs].tooltip = "Drag an item here to create a new tab";
  95. }
  96. // System.out.println(tab);
  97. if (tab == -1)// searching
  98. RSInterface.interfaceCache[22024].sprite1 = new Sprite(
  99. "interfaces/Bank/TAB 1");
  100. else if (tab > 0) {
  101. RSInterface.interfaceCache[22024 + tab].sprite1 = new Sprite(
  102. "interfaces/Bank/TAB 2");
  103. RSInterface.interfaceCache[22024].sprite1 = new Sprite(
  104. "interfaces/Bank/TAB 1");
  105. } else
  106. RSInterface.interfaceCache[22024].sprite1 = new Sprite(
  107. "interfaces/Bank/TAB 0");
  108. // TODO: Highlight first item in new tab... (NOT MAIN) ADD BELOW TO
  109. // RSINTERFACE
  110. // RSInterface.interfaceCache[22043].sprite1 = new Sprite("");
  111.  
  112. RSInterface.interfaceCache[27000].message = "0";
  113. }
  114. /*
  115. * } catch (Exception e) { //do w.e }
  116. */
  117. }
  118.  
  119. public void drawLoadingText(int i, String s) {
  120. if (i > lastLoadI) {
  121. for (int d = lastLoadI; d <= i; d++) {
  122. drawLoading(d, s);
  123. try {
  124. Thread.sleep(20);
  125. } catch (InterruptedException e) {
  126. e.printStackTrace();
  127. }
  128. }
  129. } else {
  130. drawLoading(i, s);
  131. }
  132. lastLoadI = i;
  133. }
  134.  
  135. public int getLatest() {
  136. if (latest == 5)
  137. latest = 0;
  138. xpAddedPos[latest] = xpAddedPos[getPrevious()] - 10;
  139. return latest;
  140. }
  141.  
  142. public static boolean isZoom = false;
  143.  
  144. private int digits;
  145.  
  146. private void drawCounterOnScreen() {
  147. int x = 500;
  148. int y = 46;
  149. digits = xpCounter == 0 ? 1 : 1 + (int) Math.floor(Math
  150. .log10(xpCounter));
  151. int lengthToRemove = Integer.toString(xpCounter).length();
  152. int i = aTextDrawingArea_1271.getTextWidth(Integer.toString(xpCounter))
  153. - aTextDrawingArea_1271.getTextWidth(Integer
  154. .toString(xpCounter)) / 2;
  155. int a = lengthToRemove == 1 ? 5 : ((lengthToRemove - 1) * 5);
  156. aTextDrawingArea_1271.method382(0xFFFFFD, x - 38 - i - digits - 12,
  157. "Total:", y - 34, true);
  158. if (xpCounter >= 0) {
  159. aTextDrawingArea_1271.method382(0xFFFFFD, x + 1 - i, "+"
  160. + NumberFormat.getIntegerInstance().format(xpCounter),
  161. y - 34, true);
  162. }
  163.  
  164. for (int d = 0; d < 5; d++) {
  165. if (expAdded[d] > 0) {
  166. a = smallText.getTextWidth(""
  167. + NumberFormat.getIntegerInstance().format(expAdded[d])
  168. + "xp");
  169.  
  170. smallText.method389(
  171. true,
  172. x - a + 12,
  173. 0xFFFFFD,
  174. "+"
  175. + NumberFormat.getIntegerInstance().format(
  176. expAdded[d]), y + 50 - xpAddedPos[d]);
  177.  
  178. xpAddedPos[d]++;
  179. if (xpAddedPos[d] >= 70) {
  180. xpAddedPos[d] = expAdded[d] = 0;
  181. }
  182. } else {
  183. expAdded[d] = 0;
  184. }
  185. }
  186. }
  187.  
  188. public int xpCounter;
  189.  
  190. public void tabToReplyPm() {
  191. String name = null;
  192. for (int k = 0; k < 100; k++) {
  193. if (chatMessages[k] == null) {
  194. continue;
  195. }
  196. int l = chatTypes[k];
  197. if (l == 3 || l == 7) {
  198. name = chatNames[k];
  199. break;
  200. }
  201. }
  202.  
  203. if (name == null) {
  204. pushMessage(
  205. "You haven't received any messages to which you can reply.",
  206. 0, "");
  207. return;
  208. }
  209.  
  210. if (name.startsWith("@cr")) {
  211. name = name.substring(5);
  212. }
  213.  
  214. long nameAsLong = TextClass.longForName(name.trim());
  215. int k3 = -1;
  216. for (int i4 = 0; i4 < friendsCount; i4++) {
  217. if (friendsListAsLongs[i4] != nameAsLong)
  218. continue;
  219. k3 = i4;
  220. break;
  221. }
  222.  
  223. if (k3 != -1) {
  224. if (friendsNodeIDs[k3] > 0) {
  225. inputTaken = true;
  226. inputDialogState = 0;
  227. messagePromptRaised = true;
  228. promptInput = "";
  229. friendsListAction = 3;
  230. aLong953 = friendsListAsLongs[k3];
  231. aString1121 = "Enter message to send to " + friendsList[k3];
  232. } else {
  233. pushMessage("That player is currently offline.", 0, "");
  234. }
  235. }
  236. }
  237.  
  238. private String[] customMapIcons = { "mapicons/teleport", "mapicons/prayer",
  239. "mapicons/shop", "mapicons/bank", "mapicons/bank",
  240. "mapicons/information", "mapicons/quest", "mapicons/food",
  241. "mapicons/slayer", "mapicons/minigame", "mapicons/donate",
  242. "mapicons/quest", "mapicons/teleport", "mapicons/bank",
  243. "mapicons/teleport", "mapicons/fishing", "mapicons/hunter",
  244. "mapicons/information", "mapicons/bank", "mapicons/shop",
  245. "mapicons/dungeon", "mapicons/minigame", "mapicons/teleport",
  246. "mapicons/slayer", "mapcions/information", "mapicons/quest",
  247. "mapicons/quest", "mapicons/quest", "mapicons/quest",
  248. "mapicons/quest", "mapicons/quest", "mapicons/quest",
  249. "mapicons/sword", "mapicons/quest", "mapicons/bank",
  250. "mapicons/thief" };
  251.  
  252. private int mapIconX[] = { 3091, 3087, 3090, 3085, 2790, 2785, 2775, 2778,
  253. 2774, 2737, 2515, 2820, 2856, 2846, 3106, 2194, 3092, 3087, 3210,
  254. 3095, 3112, 3117, 3103, 3109, 3069, 2698, 2885, 2914, 3422, 3220,
  255. 2242, 2175, 2199, 2207, 2192, 2802 };
  256.  
  257. private int mapIconY[] = { 3478, 3484, 3490, 3516, 10075, 10069, 10071,
  258. 10078, 10088, 3477, 10258, 3359, 3348, 3335, 3557, 3233, 3504,
  259. 3495, 3437, 3510, 3525, 3503, 3518, 3514, 3517, 9558, 9796, 9806,
  260. 3524, 3251, 3270, 3280, 3255, 3256, 3249, 10070 };
  261.  
  262. public final String[] TITLES = { "", "", "Champion", "Hero", "Legend",
  263. "Admin", "Mod", "The Mighty", "Queen", "the Ironman",
  264. "the Ironwoman", "the Completionist", "the Grandmaster",
  265. "the Collector", "the Dragonslayer", "the Warrior", "the Agile",
  266. "the Adventurer", "the Pussymagnet", "the Dogslayer",
  267. "of Lumbridge", "of Africa", "the Shiteater", "of Sweden",
  268. "the Ultimate Ironman", "the Ultimate Ironwoman" };// 25
  269.  
  270. public void preloadModels() {
  271. File file = new File(Signlink.findcachedir() + "Models/");
  272. File[] fileArray = file.listFiles();
  273. for (int y = 0; y < fileArray.length; y++) {
  274. String s = fileArray[y].getName();
  275. byte[] buffer = ReadFile(Signlink.findcachedir() + "Models/" + s);
  276. Model.method460(buffer,
  277. Integer.parseInt(getFileNameWithoutExtension(s)));
  278. System.out.println("Model loaded: "
  279. + getFileNameWithoutExtension(s));
  280. }
  281. }
  282.  
  283. public void checkSize() {
  284. if (clientSize == 1) {
  285. if (clientWidth != (isWebclient() ? getGameComponent().getWidth()
  286. : gameFrame.getFrameWidth())) {
  287. clientWidth = (isWebclient() ? getGameComponent().getWidth()
  288. : gameFrame.getFrameWidth());
  289. gameAreaWidth = clientWidth;
  290. updateGameArea();
  291. }
  292. if (clientHeight != (isWebclient() ? getGameComponent().getHeight()
  293. : gameFrame.getFrameHeight())) {
  294. clientHeight = (isWebclient() ? getGameComponent().getHeight()
  295. : gameFrame.getFrameHeight());
  296. gameAreaHeight = clientHeight;
  297. updateGameArea();
  298. }
  299. }
  300. }
  301.  
  302. private boolean runHover, prayHover, hpHover, runEnergy = false,
  303. isPoisoned, newDamage = false, sumHover, sumActive,
  304. clickedQuickPrayers, runClicked = false;
  305.  
  306. public final int[]
  307. /**
  308. * hp orb x = -1 y = -27
  309. */
  310. /**
  311. * prayer orb x = -9 y = -?
  312. */
  313. /**
  314. * hp orb x = - y = -
  315. */
  316. orbX = { 1, 1, 25 }, orbY = { 41, 85, 121 }, orbTextX = { 16, 16, 40 },
  317. orbTextY = { 67, 111, 147 }, coloredOrbX = { 28, 28, 52 },
  318. coloredOrbY = { 45, 89, 125 },
  319. currentInterface = { 4016, 4012, 149 }, maximumInterface = { 4017,
  320. 4013, 149 },
  321.  
  322. orbIconX = { 34, 32, 59 }, orbIconY = { 50, 92, 129 };
  323.  
  324. private void loadAllOrbs() {
  325. int[] spriteID = { isPoisoned && hpHover ? 43 : 42,
  326. prayHover ? 43 : 42, runHover ? 43 : 42,
  327. sumActive && sumHover ? 43 : 42 }, coloredOrbSprite = { 35,
  328. clickedQuickPrayers ? 37 : 36, runClicked ? 39 : 38,
  329. sumActive ? 41 : 40 }, orbSprite = { 44, 45,
  330. (runClicked ? 47 : 46), 48 };
  331. String cEnergy = RSInterface.interfaceCache[149].message.replaceAll(
  332. "%", "");
  333. String hp = RSInterface.interfaceCache[4016].message
  334. .replaceAll("%", "");
  335. int currentHP = Integer.parseInt(hp), currentEnergy = Integer
  336. .parseInt(cEnergy);
  337. for (int i = 0; i < 3; i++) {
  338. int x = getOrbX(i), y = getOrbY(i);
  339. int x2 = 0, y2 = 0;
  340. if (i == 0) {
  341. x2 = 3;
  342. y2 = 4;
  343. } else if (i == 2)
  344. x2 = 3;
  345. String currentStats = RSInterface.interfaceCache[currentInterface[i]].message
  346. .replaceAll("%", ""), maxStats = RSInterface.interfaceCache[maximumInterface[i]].message
  347. .replaceAll("%", "");
  348. int currentLevel = Integer.parseInt(currentStats), maxLevel = Integer
  349. .parseInt(maxStats), level = (int) (((double) currentLevel / (double) maxLevel) * 100D);
  350. cacheSprite[spriteID[i]].drawSprite(clientSize == 0 ? orbX[i] : x,
  351. clientSize == 0 ? orbY[i] : y);
  352. cacheSprite[coloredOrbSprite[i]].drawSprite(
  353. clientSize == 0 ? coloredOrbX[i] : x + 27,
  354. clientSize == 0 ? coloredOrbY[i] : y + 4);
  355. double percent = (i == 2 ? runEnergy ? currentEnergy / 100D : 100
  356. : level / 100D), fillHp = 26 * percent, fillPrayer = 26 * percent, fillRun = 26 * percent;
  357. double[] fill = { fillHp, fillPrayer, fillRun };
  358. int depleteFill = 27 - (int) fill[i];
  359. cacheSprite[49].myHeight = depleteFill;
  360. try {
  361. cacheSprite[49].drawSprite(clientSize == 0 ? coloredOrbX[i]
  362. : x + 27, clientSize == 0 ? coloredOrbY[i] : y + 5);
  363. } catch (Exception e) {
  364. }
  365. cacheSprite[orbSprite[i]].drawSprite(clientSize == 0 ? orbIconX[i]
  366. : x + (30 + x2), clientSize == 0 ? orbIconY[i] : y
  367. + (7 + y2));
  368. smallText
  369. .method382(
  370. getOrbTextColor(i == 2 ? runEnergy ? currentEnergy
  371. : 100 : level),
  372. clientSize == 0 ? orbTextX[i] : x + 15,
  373. ""
  374. + (i == 2 ? runEnergy ? cEnergy : 100
  375. : i == 0 && newDamage ? currentHP * 10
  376. : RSInterface.interfaceCache[currentInterface[i]].message
  377. .replaceAll("%", "")),
  378. clientSize == 0 ? orbTextY[i] : y + 26, true);
  379. }
  380. }
  381.  
  382. public int getOrbTextColor(int statusInt) {
  383. if (statusInt >= 75 && statusInt <= Integer.MAX_VALUE)
  384. return 0x00FF00;
  385. else if (statusInt >= 50 && statusInt <= 74)
  386. return 0xFFFF00;
  387. else if (statusInt >= 25 && statusInt <= 49)
  388. return 0xFF981F;
  389. else
  390. return 0xFF0000;
  391. }
  392.  
  393. public int getOrbFill(int statusInt) {
  394. if (statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  395. return 0;
  396. else if (statusInt <= 96 && statusInt >= 93)
  397. return 1;
  398. else if (statusInt <= 92 && statusInt >= 89)
  399. return 2;
  400. else if (statusInt <= 88 && statusInt >= 85)
  401. return 3;
  402. else if (statusInt <= 84 && statusInt >= 81)
  403. return 4;
  404. else if (statusInt <= 80 && statusInt >= 77)
  405. return 5;
  406. else if (statusInt <= 76 && statusInt >= 73)
  407. return 6;
  408. else if (statusInt <= 72 && statusInt >= 69)
  409. return 7;
  410. else if (statusInt <= 68 && statusInt >= 65)
  411. return 8;
  412. else if (statusInt <= 64 && statusInt >= 61)
  413. return 9;
  414. else if (statusInt <= 60 && statusInt >= 57)
  415. return 10;
  416. else if (statusInt <= 56 && statusInt >= 53)
  417. return 11;
  418. else if (statusInt <= 52 && statusInt >= 49)
  419. return 12;
  420. else if (statusInt <= 48 && statusInt >= 45)
  421. return 13;
  422. else if (statusInt <= 44 && statusInt >= 41)
  423. return 14;
  424. else if (statusInt <= 40 && statusInt >= 37)
  425. return 15;
  426. else if (statusInt <= 36 && statusInt >= 33)
  427. return 16;
  428. else if (statusInt <= 32 && statusInt >= 29)
  429. return 17;
  430. else if (statusInt <= 28 && statusInt >= 25)
  431. return 18;
  432. else if (statusInt <= 24 && statusInt >= 21)
  433. return 19;
  434. else if (statusInt <= 20 && statusInt >= 17)
  435. return 20;
  436. else if (statusInt <= 16 && statusInt >= 13)
  437. return 21;
  438. else if (statusInt <= 12 && statusInt >= 9)
  439. return 22;
  440. else if (statusInt <= 8 && statusInt >= 7)
  441. return 23;
  442. else if (statusInt <= 6 && statusInt >= 5)
  443. return 24;
  444. else if (statusInt <= 4 && statusInt >= 3)
  445. return 25;
  446. else if (statusInt <= 2 && statusInt >= 1)
  447. return 26;
  448. else if (statusInt <= 0)
  449. return 27;
  450. return 0;
  451. }
  452.  
  453. public int getOrbX(int orb) {
  454. switch (orb) {
  455. case 0:
  456. return clientSize != 0 ? clientWidth - 247 : 172;
  457. case 1:
  458. return clientSize != 0 ? clientWidth - 250 : 188;
  459. case 2:
  460. return clientSize != 0 ? clientWidth - 238 : 188;
  461. }
  462. return 0;
  463. }
  464.  
  465. public int getOrbY(int orb) {
  466. switch (orb) {
  467. case 0:
  468. return clientSize != 0 ? 45 : 15;
  469. case 1:
  470. return clientSize != 0 ? 80 : 54;
  471. case 2:
  472. return clientSize != 0 ? 114 : 93;
  473. }
  474. return 0;
  475. }
  476.  
  477. private void updateGameArea() {
  478. Texture.method365(clientSize == 0 ? REGULAR_WIDTH : clientWidth,
  479. clientSize == 0 ? REGULAR_HEIGHT : clientHeight);
  480. fullScreenTextureArray = Texture.anIntArray1472;
  481. Texture.method365(clientSize == 0 ? 516 : clientWidth,
  482. clientSize == 0 ? 165 : clientHeight);
  483. anIntArray1180 = Texture.anIntArray1472;
  484. Texture.method365(
  485. clientSize == 0 ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.anInt316
  486. : 250)
  487. : clientWidth,
  488. clientSize == 0 ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.anInt317
  489. : 335)
  490. : clientHeight);
  491. anIntArray1181 = Texture.anIntArray1472;
  492. Texture.method365(clientSize == 0 ? 512 : clientWidth,
  493. clientSize == 0 ? 334 : clientHeight);
  494. anIntArray1182 = Texture.anIntArray1472;
  495.  
  496. int ai[] = new int[9];
  497. for (int i8 = 0; i8 < 9; i8++) {
  498. int k8 = 128 + i8 * 32 + 15;
  499. int l8 = 600 + k8 * 3;
  500. int i9 = Texture.anIntArray1470[k8];
  501. ai[i8] = l8 * i9 >> 16;
  502. }
  503.  
  504. WorldController.method310(500, 800,
  505. clientSize == 0 ? 512 : clientWidth, clientSize == 0 ? 334
  506. : clientHeight, ai);
  507.  
  508. aRSImageProducer_1165 = new RSImageProducer(clientSize == 0 ? 512
  509. : clientWidth, clientSize == 0 ? 334 : clientHeight,
  510. getGameComponent());
  511. DrawingArea.setAllPixelsToZero();
  512. resetImageProducers2();
  513.  
  514. if (!loggedIn)
  515. resetAllImageProducers();
  516. }
  517.  
  518. public void toggleSize(int size) {
  519. if (clientSize != size) {
  520. clientSize = size;
  521. int width = 765;
  522. int height = 503;
  523. if (size == 0) {
  524. log_view_dist = 9;
  525. size = 0;
  526. width = REGULAR_WIDTH;
  527. height = REGULAR_HEIGHT;
  528. showChat = true;
  529. showTab = true;
  530. } else if (size == 1) {
  531. log_view_dist = 10;
  532. size = 1;
  533. width = isWebclient() ? appletWidth : resizableWidth;
  534. height = isWebclient() ? appletHeight : resizableHeight;
  535. } else if (size == 2) {
  536. log_view_dist = 10;
  537. size = 2;
  538. width = getMaxWidth();
  539. height = getMaxHeight();
  540. }
  541. rebuildFrame(size, width, height);
  542. updateGameArea();
  543. }
  544. }
  545.  
  546. public void rebuildFrame(int size, int width, int height) {
  547. try {
  548. gameAreaWidth = (size == 0) ? 512 : width;
  549. gameAreaHeight = (size == 0) ? 334 : height;
  550. clientWidth = width;
  551. clientHeight = height;
  552. instance.rebuildFrame(clientSize == 2, width, height,
  553. clientSize == 1, clientSize >= 1);
  554. updateGameArea();
  555. super.mouseX = super.mouseY = -1;
  556. } catch (Exception e) {
  557. e.printStackTrace();
  558. }
  559. }
  560.  
  561. public void drawUnfixedGame() {
  562. if (clientSize != 0) {
  563. drawChatArea();
  564. drawTabArea();
  565. drawMinimap();
  566. }
  567. }
  568.  
  569. public boolean isFixed() {
  570. return clientSize == 0;
  571. }
  572.  
  573. public boolean canClick() {
  574. if (mouseInRegion(clientWidth - (clientWidth <= 1000 ? 240 : 480),
  575. clientHeight - (clientWidth <= 1000 ? 90 : 37), clientWidth,
  576. clientHeight)) {
  577. return false;
  578. }
  579. if (showChat) {
  580. if (super.mouseX > 0 && super.mouseX < 519
  581. && super.mouseY > clientHeight - 165
  582. && super.mouseY < clientHeight
  583. || super.mouseX > clientWidth - 220
  584. && super.mouseX < clientWidth && super.mouseY > 0
  585. && super.mouseY < 165) {
  586. return false;
  587. }
  588. }
  589. if (mouseInRegion2(clientWidth - 216, clientWidth, 0, 172)) {
  590. return false;
  591. }
  592. if (showTab) {
  593. if (clientWidth > 1000) {
  594. if (super.mouseX >= clientWidth - 420
  595. && super.mouseX <= clientWidth
  596. && super.mouseY >= clientHeight - 37
  597. && super.mouseY <= clientHeight
  598. || super.mouseX > clientWidth - 225
  599. && super.mouseX < clientWidth
  600. && super.mouseY > clientHeight - 37 - 274
  601. && super.mouseY < clientHeight)
  602. return false;
  603. } else {
  604. if (super.mouseX >= clientWidth - 210
  605. && super.mouseX <= clientWidth
  606. && super.mouseY >= clientHeight - 74
  607. && super.mouseY <= clientHeight
  608. || super.mouseX > clientWidth - 225
  609. && super.mouseX < clientWidth
  610. && super.mouseY > clientHeight - 74 - 274
  611. && super.mouseY < clientHeight)
  612. return false;
  613. }
  614. }
  615. return true;
  616. }
  617.  
  618. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  619. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1
  620. && super.mouseY <= y2)
  621. return true;
  622. return false;
  623. }
  624.  
  625. public boolean mouseInRegion2(int x1, int x2, int y1, int y2) {
  626. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1
  627. && super.mouseY <= y2) {
  628. return true;
  629. }
  630. return false;
  631. }
  632.  
  633. public boolean clickInRegion(int x1, int y1, int x2, int y2) {
  634. if (super.saveClickX >= x1 && super.saveClickX <= x2
  635. && super.saveClickY >= y1 && super.saveClickY <= y2)
  636. return true;
  637. return false;
  638. }
  639.  
  640. public boolean canClickMap() {
  641. if (super.mouseX >= clientWidth - 21 && super.mouseX <= clientWidth
  642. && super.mouseY >= 0 && super.mouseY <= 21)
  643. return false;
  644. return true;
  645. }
  646.  
  647. private static String intToKOrMilLongName(int i) {
  648. String s = String.valueOf(i);
  649. for (int k = s.length() - 3; k > 0; k -= 3)
  650. s = s.substring(0, k) + "," + s.substring(k);
  651. if (s.length() > 8)
  652. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  653. + s + ")";
  654. else if (s.length() > 4)
  655. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  656. return " " + s;
  657. }
  658.  
  659. public final String methodR(int j) {
  660. if (j >= 0 && j < 10000)
  661. return String.valueOf(j);
  662. if (j >= 10000 && j < 10000000)
  663. return j / 1000 + "K";
  664. if (j >= 10000000 && j < 999999999)
  665. return j / 1000000 + "M";
  666. if (j >= 999999999)
  667. return "*";
  668. else
  669. return "?";
  670. }
  671.  
  672. public static final byte[] ReadFile(String s) {
  673. try {
  674. byte abyte0[];
  675. File file = new File(s);
  676. int i = (int) file.length();
  677. abyte0 = new byte[i];
  678. DataInputStream datainputstream = new DataInputStream(
  679. new BufferedInputStream(new FileInputStream(s)));
  680. datainputstream.readFully(abyte0, 0, i);
  681. datainputstream.close();
  682. return abyte0;
  683. } catch (Exception e) {
  684. System.out.println((new StringBuilder()).append("Read Error: ")
  685. .append(s).toString());
  686. return null;
  687. }
  688. }
  689.  
  690. private void stopMidi() {
  691. Signlink.fadeMidi = 0;
  692. Signlink.midi = "stop";
  693. }
  694.  
  695. private boolean menuHasAddFriend(int j) {
  696. if (j < 0)
  697. return false;
  698. int k = menuActionID[j];
  699. if (k >= 2000)
  700. k -= 2000;
  701. return k == 337;
  702. }
  703.  
  704. public void drawChannelButtons() {
  705. int y = 0;
  706. if (clientSize != 0) {
  707. y = clientHeight - 164;
  708. }
  709. String text[] = { "On", "Friends", "Off", "Hide" };
  710. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  711. switch (cButtonCPos) {
  712. case 0:
  713. cacheSprite[1].drawSprite(5, y + 142);
  714. break;
  715. case 1:
  716. cacheSprite[1].drawSprite(71, y + 142);
  717. break;
  718. case 2:
  719. cacheSprite[1].drawSprite(137, y + 142);
  720. break;
  721. case 3:
  722. cacheSprite[1].drawSprite(203, y + 142);
  723. break;
  724. case 4:
  725. cacheSprite[1].drawSprite(269, y + 142);
  726. break;
  727. case 5:
  728. cacheSprite[1].drawSprite(335, y + 142);
  729. break;
  730. }
  731. if (cButtonHPos == cButtonCPos) {
  732. switch (cButtonHPos) {
  733. case 0:
  734. cacheSprite[2].drawSprite(5, y + 142);
  735. break;
  736. case 1:
  737. cacheSprite[2].drawSprite(71, y + 142);
  738. break;
  739. case 2:
  740. cacheSprite[2].drawSprite(137, y + 142);
  741. break;
  742. case 3:
  743. cacheSprite[2].drawSprite(203, y + 142);
  744. break;
  745. case 4:
  746. cacheSprite[2].drawSprite(269, y + 142);
  747. break;
  748. case 5:
  749. cacheSprite[2].drawSprite(335, y + 142);
  750. break;
  751. case 6:
  752. cacheSprite[2].drawSprite(404, y + 142);
  753. break;
  754. }
  755. } else {
  756. switch (cButtonHPos) {
  757. case 0:
  758. cacheSprite[0].drawSprite(5, y + 142);
  759. break;
  760. case 1:
  761. cacheSprite[0].drawSprite(71, y + 142);
  762. break;
  763. case 2:
  764. cacheSprite[0].drawSprite(137, y + 142);
  765. break;
  766. case 3:
  767. cacheSprite[0].drawSprite(203, y + 142);
  768. break;
  769. case 4:
  770. cacheSprite[0].drawSprite(269, y + 142);
  771. break;
  772. case 5:
  773. cacheSprite[0].drawSprite(335, y + 142);
  774. break;
  775. case 6:
  776. cacheSprite[3].drawSprite(404, y + 142);
  777. break;
  778. }
  779. }
  780. smallText.method389(true, 425, 0xffffff, "Report Abuse",
  781. clientSize == 0 ? 157 : clientHeight - 8);
  782. smallText.method389(true, 26, 0xffffff, "All", clientSize == 0 ? 157
  783. : clientHeight - 8);
  784. smallText.method389(true, 86, 0xffffff, "Game", clientSize == 0 ? 157
  785. : clientHeight - 8);
  786. smallText.method389(true, 150, 0xffffff, "Public",
  787. clientSize == 0 ? 152 : clientHeight - 12);
  788. smallText.method389(true, 212, 0xffffff, "Private",
  789. clientSize == 0 ? 152 : clientHeight - 12);
  790. smallText.method389(true, 286, 0xffffff, "Clan", clientSize == 0 ? 152
  791. : clientHeight - 12);
  792. smallText.method389(true, 349, 0xffffff, "Trade", clientSize == 0 ? 152
  793. : clientHeight - 12);
  794. smallText.method382(textColor[publicChatMode], 164,
  795. text[publicChatMode], clientSize == 0 ? 163 : clientHeight - 1,
  796. true);
  797. smallText.method382(textColor[privateChatMode], 230,
  798. text[privateChatMode],
  799. clientSize == 0 ? 163 : clientHeight - 1, true);
  800. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode],
  801. clientSize == 0 ? 163 : clientHeight - 1, true);
  802. smallText.method382(textColor[tradeMode], 362, text[tradeMode],
  803. clientSize == 0 ? 163 : clientHeight - 1, true);
  804. }
  805.  
  806. private void drawChatArea() {
  807. int y = 0;
  808. Texture.anIntArray1472 = anIntArray1180;
  809. if (clientSize == 0)
  810. aRSImageProducer_1166.initDrawingArea();
  811.  
  812. if (clientSize == 0)
  813. cacheSprite[25].drawSprite(0, y);
  814.  
  815. if (clientSize != 0)
  816. y = clientHeight - 165;
  817.  
  818. if (clientSize != 0 && showChat) {
  819. cacheSprite[30].drawSprite(0, y - 1);
  820. DrawingArea.method335(0xccbb9a, y + 6, 506, 129, 100, 7);
  821. }
  822.  
  823. if (clientSize != 0) {
  824. cacheSprite[31].drawSprite(0, clientHeight - 22);
  825. }
  826.  
  827. if (clientSize == 0) {
  828. aRSImageProducer_1166.initDrawingArea();
  829. }
  830.  
  831. drawChannelButtons();
  832. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  833. if (messagePromptRaised) {
  834. chatTextDrawingArea.drawText(0, aString1121, y + 60, 259);
  835. chatTextDrawingArea.drawText(128, promptInput + "*", y + 80, 259);
  836. } else if (inputDialogState == 1) {
  837. chatTextDrawingArea.drawText(0, "Enter amount:", y + 60, 259);
  838. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", y + 80,
  839. 259);
  840. } else if (inputDialogState == 2) {
  841. chatTextDrawingArea.drawText(0, "Enter name:", y + 60, 259);
  842. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", y + 80,
  843. 259);
  844. } else if (aString844 != null) {
  845. chatTextDrawingArea.drawText(0, aString844, y + 60, 259);
  846. chatTextDrawingArea.drawText(128, "Click to continue", y + 80, 259);
  847. } else if (backDialogID != -1) {
  848. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID],
  849. y + 20);
  850. } else if (dialogID != -1) {
  851. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], y + 20);
  852. } else if (showChat || clientSize == 0) {
  853. // int j77 = -3;
  854. int amountOfMessages = 0;
  855. DrawingArea.setDrawingArea(y + 122, 8, 497, y + 7);
  856. for (int k = 0; k < 500; k++)
  857. if (chatMessages[k] != null) {
  858. int chatType = chatTypes[k];
  859. int yPos = (114 - amountOfMessages * 14) + 3
  860. + chatScrollPos;
  861. if (clientSize != 0)
  862. yPos += y;
  863. String s1 = chatNames[k];
  864. byte byte0 = 0;
  865. if (s1 != null && s1.startsWith("@cr1@")) {
  866. s1 = s1.substring(5);
  867. byte0 = 1;
  868. } else if (s1 != null && s1.startsWith("@cr2@")) {
  869. s1 = s1.substring(5);
  870. byte0 = 2;
  871. } else if (s1 != null && s1.startsWith("@cr3@")) {
  872. s1 = s1.substring(5);
  873. byte0 = 3;
  874. }
  875. if (chatType == 0) {
  876. if (chatTypeView == 5 || chatTypeView == 0) {
  877. if (yPos > y && yPos < y + 210)
  878. if (clientSize != 0)
  879. textDrawingArea.method389(false, 11, 0,
  880. chatMessages[k], yPos);// chat
  881. // color
  882. // enabled
  883. else
  884. textDrawingArea.method389(false, 11, 0,
  885. chatMessages[k], yPos);
  886. amountOfMessages++;
  887. // j77++;
  888. }
  889. }
  890. if ((chatType == 1 || chatType == 2)
  891. && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1
  892. && isFriendOrSelf(s1))) {
  893. if (chatTypeView == 1 || chatTypeView == 0) {
  894. if (yPos > y && yPos < y + 210) {
  895. int xPos = 11;
  896. if (byte0 == 1) {
  897. modIcons[0].drawBackground(xPos + 1,
  898. yPos - 12);
  899. xPos += 14;
  900. } else if (byte0 == 2) {
  901. modIcons[1].drawBackground(xPos + 1,
  902. yPos - 12);
  903. xPos += 14;
  904. } else if (byte0 == 3) {
  905. modIcons[2].drawBackground(xPos + 1,
  906. yPos - 12);
  907. xPos += 14;
  908. }
  909. textDrawingArea.method385(0, s1 + ":", yPos,
  910. xPos);
  911. xPos += textDrawingArea.getTextWidth(s1) + 8;
  912. textDrawingArea.method389(false, xPos, 255,
  913. chatMessages[k], yPos);
  914.  
  915. }
  916. amountOfMessages++;
  917. // j77++;
  918. }
  919. }
  920. if ((chatType == 3 || chatType == 7)
  921. && (splitPrivateChat == 0 || chatTypeView == 2)
  922. && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1
  923. && isFriendOrSelf(s1))) {
  924. if (chatTypeView == 2 || chatTypeView == 0) {
  925. if (yPos > y && yPos < y + 210) {
  926. int k1 = 11;
  927. if (clientSize == 0)
  928. textDrawingArea.method385(0, "From", yPos,
  929. k1);
  930. else
  931. textDrawingArea.method389(true, k1,
  932. 0xff5256, "From", yPos);
  933. k1 += textDrawingArea.getTextWidth("From ");
  934. if (byte0 == 1) {
  935. modIcons[0].drawBackground(k1, yPos - 12);
  936. k1 += 12;
  937. } else if (byte0 == 2) {
  938. modIcons[1].drawBackground(k1, yPos - 12);
  939. k1 += 12;
  940. } else if (byte0 == 3) {
  941. modIcons[2].drawBackground(k1, yPos - 12);
  942. k1 += 12;
  943. }
  944. if (clientSize != 0) {
  945. textDrawingArea.method389(true, k1,
  946. 0xff5256, s1 + ":", yPos);
  947. k1 += textDrawingArea.getTextWidth(s1) + 8;
  948. textDrawingArea.method389(true, k1,
  949. 0xff5256, chatMessages[k], yPos);
  950. } else {
  951. textDrawingArea.method385(0, s1 + ":",
  952. yPos, k1);
  953. k1 += textDrawingArea.getTextWidth(s1) + 8;
  954. textDrawingArea.method385(0x800000,
  955. chatMessages[k], yPos, k1);
  956. }
  957. }
  958. amountOfMessages++;
  959. // j77++;
  960. }
  961. }
  962. if (chatType == 4
  963. && (tradeMode == 0 || tradeMode == 1
  964. && isFriendOrSelf(s1))) {
  965. if (chatTypeView == 3 || chatTypeView == 0) {
  966. if (yPos > y && yPos < y + 210)
  967. if (clientSize != 0)
  968. textDrawingArea.method389(true, 11,
  969. 0xff5256, s1 + " "
  970. + chatMessages[k], yPos);
  971. else
  972. textDrawingArea.method385(0x800080, s1
  973. + " " + chatMessages[k], yPos, 11);
  974. amountOfMessages++;
  975. // j77++;
  976. }
  977. }
  978. if (chatType == 5 && splitPrivateChat == 0
  979. && privateChatMode < 2) {
  980. if (chatTypeView == 2 || chatTypeView == 0) {
  981. if (yPos > y && yPos < y + 210)
  982. if (clientSize != 0)
  983. textDrawingArea.method389(true, 11,
  984. 0xff5256, chatMessages[k], yPos);
  985. else
  986. textDrawingArea.method385(0x800000,
  987. chatMessages[k], yPos, 11);
  988. amountOfMessages++;
  989. // j77++;
  990. }
  991. }
  992. if (chatType == 6
  993. && (splitPrivateChat == 0 || chatTypeView == 2)
  994. && privateChatMode < 2) {
  995. if (chatTypeView == 2 || chatTypeView == 0) {
  996. if (yPos > y && yPos < y + 210) {
  997. if (clientSize != 0) {
  998. textDrawingArea.method389(true, 11,
  999. 0xff5256, "To " + s1 + ":", yPos);
  1000. textDrawingArea.method389(true,
  1001. 15 + textDrawingArea
  1002. .getTextWidth("To :" + s1),
  1003. 0xff5256, chatMessages[k], yPos);
  1004. } else {
  1005. textDrawingArea.method385(0, "To " + s1
  1006. + ":", yPos, 11);
  1007. textDrawingArea.method385(0x800000,
  1008. chatMessages[k], yPos,
  1009. 15 + textDrawingArea
  1010. .getTextWidth("To :" + s1));
  1011. }
  1012. }
  1013. amountOfMessages++;
  1014. // j77++;
  1015. }
  1016. }
  1017. if (chatType == 8
  1018. && (tradeMode == 0 || tradeMode == 1
  1019. && isFriendOrSelf(s1))) {
  1020. if (chatTypeView == 3 || chatTypeView == 0) {
  1021. if (yPos > y && yPos < y + 210)
  1022. if (clientSize != 0)
  1023. textDrawingArea.method389(true, 11,
  1024. 0x7e3200, s1 + " "
  1025. + chatMessages[k], yPos);
  1026. else
  1027. textDrawingArea.method385(0x7e3200, s1
  1028. + " " + chatMessages[k], yPos, 11);
  1029. amountOfMessages++;
  1030. // j77++;
  1031. }
  1032. if (chatType == 11 && (clanChatMode == 0)) {
  1033. if (chatTypeView == 11) {
  1034. if (yPos > y && yPos < y + 210)
  1035. if (clientSize != 0)
  1036. textDrawingArea
  1037. .method389(
  1038. true,
  1039. 11,
  1040. 0x7e3200,
  1041. s1
  1042. + " "
  1043. + chatMessages[k],
  1044. yPos);
  1045. else
  1046. textDrawingArea.method385(0x7e3200, s1
  1047. + " " + chatMessages[k], yPos,
  1048. 11);
  1049. amountOfMessages++;
  1050. // j77++;
  1051. }
  1052. if (chatType == 12) {
  1053. if (yPos > y && yPos < y + 210)
  1054. if (clientSize != 0)
  1055. textDrawingArea.method389(true, 11,
  1056. 0x7e3200, chatMessages[k]
  1057. + " @blu@" + s1, yPos);
  1058. else
  1059. textDrawingArea
  1060. .method385(
  1061. 0x7e3200,
  1062. chatMessages[k]
  1063. + " @blu@" + s1,
  1064. yPos, 11);
  1065. amountOfMessages++;
  1066. }
  1067. }
  1068. }
  1069.  
  1070. if (chatType == 16) {
  1071. int j2 = 40;
  1072. int clanNameWidth = textDrawingArea
  1073. .getTextWidth(clanname);
  1074. if (chatTypeView == 11 || chatTypeView == 0) {
  1075. if (yPos > y && yPos < y + 210)
  1076. switch (chatRights[k]) {
  1077. case 1:
  1078. j2 += clanNameWidth;
  1079. modIcons[0].drawBackground(j2 - 18,
  1080. yPos - 12);
  1081. j2 += 14;
  1082. break;
  1083.  
  1084. case 2:
  1085. j2 += clanNameWidth;
  1086. modIcons[1].drawBackground(j2 - 18,
  1087. yPos - 12);
  1088. j2 += 14;
  1089. break;
  1090.  
  1091. case 3:
  1092. j2 += clanNameWidth;
  1093. modIcons[2].drawBackground(j2 - 18,
  1094. yPos - 12);
  1095. j2 += 14;
  1096. break;
  1097.  
  1098. default:
  1099. j2 += clanNameWidth;
  1100. break;
  1101. }
  1102. textDrawingArea.method385(0, "[", yPos, 8);
  1103. textDrawingArea.method385(255, "" + clanname + "",
  1104. yPos, 14);
  1105. textDrawingArea.method385(0, "]", yPos,
  1106. clanNameWidth + 14);
  1107.  
  1108. textDrawingArea.method385(0, chatNames[k] + ":",
  1109. yPos, j2 - 17); // j2
  1110. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  1111. textDrawingArea.method385(0x800000,
  1112. chatMessages[k], yPos, j2 - 16);// j2
  1113. amountOfMessages++;
  1114. // j77++;
  1115. }
  1116. }
  1117. }
  1118. DrawingArea.defaultDrawingAreaSize();
  1119. chatScrollMax = amountOfMessages * 14 + 7 + 5;
  1120. if (chatScrollMax < 111)
  1121. chatScrollMax = 111;
  1122. drawScrollbar(114, chatScrollMax - chatScrollPos - 114,
  1123. 7 + (clientSize == 0 ? 0 : clientHeight - 165), 496,
  1124. chatScrollMax);
  1125. String s;
  1126. if (myPlayer != null && myPlayer.name != null) {
  1127.  
  1128. if (8 > myPlayer.skill)
  1129. s = TITLES[myPlayer.skill] + " " + myPlayer.name;
  1130. else
  1131. s = myPlayer.name + " " + TITLES[myPlayer.skill];
  1132.  
  1133. } else
  1134. s = TextClass.fixName(myUsername);
  1135. if (clientSize != 0) {
  1136. textDrawingArea.drawChatInput(0, 11, s + ":", y + 133, false);
  1137. textDrawingArea.drawChatInput(255,
  1138. 12 + textDrawingArea.getTextWidth(s + ": "),
  1139. inputString + "*", y + 133, false);
  1140. for (int i = 0; i < 505; i++) {
  1141. int opacity = 100 - (int) (i / 5.05);
  1142. DrawingArea.method340(0, 1, y + 6, opacity, 7 + i);
  1143. DrawingArea.method340(0, 1, y + 121, opacity, 7 + i);
  1144. }
  1145. } else {
  1146. textDrawingArea.method385(0, s + ":", y + 133, 11);
  1147. textDrawingArea.drawChatInput(255,
  1148. 12 + textDrawingArea.getTextWidth(s + ": "),
  1149. inputString + "*", y + 133, false);
  1150. DrawingArea.method339(y + 121, 0x807660, 506, 7);
  1151. }
  1152. }
  1153. if (menuOpen && clientSize == 0) {
  1154. drawMenu(0, 338);
  1155. } else if (menuOpen && menuScreenArea == 2 && clientSize != 0) {
  1156. drawMenu(0, 338);
  1157. }
  1158. if (clientSize == 0)
  1159. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  1160. aRSImageProducer_1165.initDrawingArea();
  1161. Texture.anIntArray1472 = anIntArray1182;
  1162. }
  1163.  
  1164. public void init() {
  1165. try {
  1166. nodeID = 10;
  1167. portOff = 0;
  1168. setHighMem();
  1169. clientSize = 0;
  1170. isMembers = true;
  1171. Signlink.storeid = 32;
  1172. Signlink.startpriv(InetAddress.getByName(server));
  1173. instance.initClientFrame(503, 765);
  1174. instance = this;
  1175. } catch (Exception exception) {
  1176. exception.printStackTrace();
  1177. }
  1178. }
  1179.  
  1180. public void startRunnable(Runnable runnable, int i) {
  1181. if (i > 10)
  1182. i = 10;
  1183. if (Signlink.mainapp != null) {
  1184. Signlink.startThread(runnable, i);
  1185. } else {
  1186. super.startRunnable(runnable, i);
  1187. }
  1188. }
  1189.  
  1190. public Socket openSocket(int port) throws IOException {
  1191. return new Socket(InetAddress.getByName(server), port);
  1192. }
  1193.  
  1194. private void processMenuClick() {
  1195. if (activeInterfaceType != 0)
  1196. return;
  1197. int j = super.clickMode3;
  1198. if (spellSelected == 1 && super.saveClickX >= 516
  1199. && super.saveClickY >= 160 && super.saveClickX <= 765
  1200. && super.saveClickY <= 205)
  1201. j = 0;
  1202. if (menuOpen) {
  1203. if (j != 1) {
  1204. int k = super.mouseX;
  1205. int j1 = super.mouseY;
  1206. if (menuScreenArea == 0) {
  1207. k -= 4;
  1208. j1 -= 4;
  1209. }
  1210. if (menuScreenArea == 1) {
  1211. k -= 519;
  1212. j1 -= 168;
  1213. }
  1214. if (menuScreenArea == 2) {
  1215. k -= 17;
  1216. j1 -= 338;
  1217. }
  1218. if (menuScreenArea == 3) {
  1219. k -= 519;
  1220. j1 -= 0;
  1221. }
  1222. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  1223. || j1 < menuOffsetY - 10
  1224. || j1 > menuOffsetY + menuHeight + 10) {
  1225. menuOpen = false;
  1226. if (menuScreenArea == 1) {
  1227. }
  1228. if (menuScreenArea == 2)
  1229. inputTaken = true;
  1230. }
  1231. }
  1232. if (j == 1) {
  1233. int l = menuOffsetX;
  1234. int k1 = menuOffsetY;
  1235. int i2 = menuWidth;
  1236. int k2 = super.saveClickX;
  1237. int l2 = super.saveClickY;
  1238. switch (menuScreenArea) {
  1239. case 0:
  1240. k2 -= 4;
  1241. l2 -= 4;
  1242. break;
  1243. case 1:
  1244. k2 -= 519;
  1245. l2 -= 168;
  1246. break;
  1247. case 2:
  1248. k2 -= 5;
  1249. l2 -= 338;
  1250. break;
  1251. case 3:
  1252. k2 -= 519;
  1253. l2 -= 0;
  1254. break;
  1255. }
  1256. int i3 = -1;
  1257. for (int j3 = 0; j3 < menuActionRow; j3++) {
  1258. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  1259. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  1260. i3 = j3;
  1261. }
  1262. if (i3 != -1)
  1263. doAction(i3);
  1264. menuOpen = false;
  1265. if (menuScreenArea == 1) {
  1266. }
  1267. if (menuScreenArea == 2) {
  1268. inputTaken = true;
  1269. }
  1270. }
  1271. } else {
  1272. if (j == 1 && menuActionRow > 0) {
  1273. int i1 = menuActionID[menuActionRow - 1];
  1274. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  1275. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  1276. || i1 == 847 || i1 == 447 || i1 == 1125) {
  1277. int l1 = menuActionCmd2[menuActionRow - 1];
  1278. int j2 = menuActionCmd3[menuActionRow - 1];
  1279. RSInterface class9 = RSInterface.interfaceCache[j2];
  1280. if (class9.aBoolean259 || class9.aBoolean235) {
  1281. aBoolean1242 = false;
  1282. anInt989 = 0;
  1283. anInt1084 = j2;
  1284. anInt1085 = l1;
  1285. activeInterfaceType = 2;
  1286. anInt1087 = super.saveClickX;
  1287. anInt1088 = super.saveClickY;
  1288. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  1289. activeInterfaceType = 1;
  1290. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  1291. activeInterfaceType = 3;
  1292. return;
  1293. }
  1294. }
  1295. }
  1296. if (j == 1
  1297. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  1298. && menuActionRow > 2)
  1299. j = 2;
  1300. if (j == 1 && menuActionRow > 0)
  1301. doAction(menuActionRow - 1);
  1302. if (j == 2 && menuActionRow > 0)
  1303. determineMenuSize();
  1304.  
  1305. processMainScreenClick();
  1306. processTabClick();
  1307. processChatModeClick();
  1308.  
  1309. }
  1310. }
  1311.  
  1312. public static String getFileNameWithoutExtension(String fileName) {
  1313. File tmpFile = new File(fileName);
  1314. tmpFile.getName();
  1315. int whereDot = tmpFile.getName().lastIndexOf('.');
  1316. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  1317. return tmpFile.getName().substring(0, whereDot);
  1318. }
  1319. return "";
  1320. }
  1321.  
  1322. public byte[] getModel(int index) {
  1323. try {
  1324. File model = new File(Signlink.findcachedir() + "pModels/" + index
  1325. + ".gz");
  1326. byte[] aByte = new byte[(int) model.length()];
  1327. FileInputStream Fis = new FileInputStream(model);
  1328. Fis.read(aByte);
  1329. pushMessage("aByte = [" + aByte + "]!", 0, "");
  1330. Fis.close();
  1331. return aByte;
  1332. } catch (Exception e) {
  1333. return null;
  1334. }
  1335. }
  1336.  
  1337. public void packModels() {
  1338. for (int modelIndex = 0; modelIndex < 100000; modelIndex++) {
  1339. byte[] abyte0 = getModel(modelIndex);
  1340. if (abyte0 != null && abyte0.length > 0) {
  1341. decompressors[1].method234(abyte0.length, abyte0, modelIndex);
  1342. }
  1343. }
  1344. }
  1345.  
  1346. public byte[] getMap(int index) {
  1347. try {
  1348. File map = new File(Signlink.findcachedir() + "pMaps/" + index
  1349. + ".gz");
  1350. byte[] aByte = new byte[(int) map.length()];
  1351. FileInputStream Fis = new FileInputStream(map);
  1352. Fis.read(aByte);
  1353. pushMessage("aByte = [" + aByte + "]!", 0, "");
  1354. Fis.close();
  1355. return aByte;
  1356. } catch (Exception e) {
  1357. return null;
  1358. }
  1359. }
  1360.  
  1361. public void packMaps() {
  1362. for (int mapIndex = 0; mapIndex < 100000; mapIndex++) {
  1363. byte[] abyte0 = getMap(mapIndex);
  1364. if (abyte0 != null && abyte0.length > 0) {
  1365. decompressors[4].method234(abyte0.length, abyte0, mapIndex);
  1366. }
  1367. }
  1368. }
  1369.  
  1370. private void method22() {
  1371. try {
  1372. anInt985 = -1;
  1373. aClass19_1056.removeAll();
  1374. aClass19_1013.removeAll();
  1375. Texture.method366();
  1376. unlinkMRUNodes();
  1377. worldController.initToNull();
  1378. System.gc();
  1379. for (int i = 0; i < 4; i++)
  1380. aClass11Array1230[i].method210();
  1381. for (int l = 0; l < 4; l++) {
  1382. for (int k1 = 0; k1 < 104; k1++) {
  1383. for (int j2 = 0; j2 < 104; j2++)
  1384. byteGroundArray[l][k1][j2] = 0;
  1385. }
  1386. }
  1387.  
  1388. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  1389. intGroundArray);
  1390. int k2 = aByteArrayArray1183.length;
  1391. stream.createFrame(0);
  1392. if (!aBoolean1159) {
  1393. for (int i3 = 0; i3 < k2; i3++) {
  1394. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1395. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1396. byte abyte0[] = aByteArrayArray1183[i3];
  1397. if (FileOperations.FileExists(Signlink.findcachedir()
  1398. + "maps/" + anIntArray1235[i3] + ".dat"))
  1399. abyte0 = FileOperations.ReadFile(Signlink
  1400. .findcachedir()
  1401. + "maps/"
  1402. + anIntArray1235[i3]
  1403. + ".dat");
  1404. if (abyte0 != null)
  1405. objectManager.method180(abyte0, k5, i4,
  1406. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  1407. aClass11Array1230);
  1408. }
  1409. for (int j4 = 0; j4 < k2; j4++) {
  1410. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  1411. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  1412. byte abyte2[] = aByteArrayArray1183[j4];
  1413. if (abyte2 == null && anInt1070 < 800)
  1414. objectManager.method174(k7, 64, 64, l5);
  1415. }
  1416. anInt1097++;
  1417. if (anInt1097 > 160) {
  1418. anInt1097 = 0;
  1419. stream.createFrame(238);
  1420. stream.writeWordBigEndian(96);
  1421. }
  1422. stream.createFrame(0);
  1423. for (int i6 = 0; i6 < k2; i6++) {
  1424. byte abyte1[] = aByteArrayArray1247[i6];
  1425. if (abyte1 != null) {
  1426. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1427. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1428. objectManager.method190(l8, aClass11Array1230, k9,
  1429. worldController, abyte1);
  1430. }
  1431. }
  1432.  
  1433. }
  1434. if (aBoolean1159) {
  1435. for (int j3 = 0; j3 < 4; j3++) {
  1436. for (int k4 = 0; k4 < 13; k4++) {
  1437. for (int j6 = 0; j6 < 13; j6++) {
  1438. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1439. if (l7 != -1) {
  1440. int i9 = l7 >> 24 & 3;
  1441. int l9 = l7 >> 1 & 3;
  1442. int j10 = l7 >> 14 & 0x3ff;
  1443. int l10 = l7 >> 3 & 0x7ff;
  1444. int j11 = (j10 / 8 << 8) + l10 / 8;
  1445. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1446. if (anIntArray1234[l11] != j11
  1447. || aByteArrayArray1183[l11] == null)
  1448. continue;
  1449. objectManager.method179(i9, l9,
  1450. aClass11Array1230, k4 * 8,
  1451. (j10 & 7) * 8,
  1452. aByteArrayArray1183[l11],
  1453. (l10 & 7) * 8, j3, j6 * 8);
  1454. break;
  1455. }
  1456.  
  1457. }
  1458. }
  1459. }
  1460. }
  1461. for (int l4 = 0; l4 < 13; l4++) {
  1462. for (int k6 = 0; k6 < 13; k6++) {
  1463. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1464. if (i8 == -1)
  1465. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1466. }
  1467. }
  1468.  
  1469. stream.createFrame(0);
  1470. for (int l6 = 0; l6 < 4; l6++) {
  1471. for (int j8 = 0; j8 < 13; j8++) {
  1472. for (int j9 = 0; j9 < 13; j9++) {
  1473. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1474. if (i10 != -1) {
  1475. int k10 = i10 >> 24 & 3;
  1476. int i11 = i10 >> 1 & 3;
  1477. int k11 = i10 >> 14 & 0x3ff;
  1478. int i12 = i10 >> 3 & 0x7ff;
  1479. int j12 = (k11 / 8 << 8) + i12 / 8;
  1480. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1481. if (anIntArray1234[k12] != j12
  1482. || aByteArrayArray1247[k12] == null)
  1483. continue;
  1484. if (FileOperations.FileExists(Signlink
  1485. .findcachedir()
  1486. + "maps/"
  1487. + anIntArray1235[k12] + ".dat"))
  1488. FileOperations.ReadFile(Signlink
  1489. .findcachedir()
  1490. + "maps/"
  1491. + anIntArray1235[k12] + ".dat");
  1492. objectManager.method183(aClass11Array1230,
  1493. worldController, k10, j8 * 8,
  1494. (i12 & 7) * 8, l6,
  1495. aByteArrayArray1247[k12],
  1496. (k11 & 7) * 8, i11, j9 * 8);
  1497. break;
  1498. }
  1499.  
  1500. }
  1501. }
  1502.  
  1503. }
  1504.  
  1505. }
  1506.  
  1507. }
  1508. stream.createFrame(0);
  1509. objectManager.method171(aClass11Array1230, worldController);
  1510. aRSImageProducer_1165.initDrawingArea();
  1511. stream.createFrame(0);
  1512. int k3 = ObjectManager.anInt145;
  1513. if (k3 > plane)
  1514. k3 = plane;
  1515. if (k3 < plane - 1)
  1516. k3 = plane - 1;
  1517. if (lowMem)
  1518. worldController.method275(ObjectManager.anInt145);
  1519. else
  1520. worldController.method275(0);
  1521. for (int i5 = 0; i5 < 104; i5++) {
  1522. for (int i7 = 0; i7 < 104; i7++)
  1523. spawnGroundItem(i5, i7);
  1524.  
  1525. }
  1526.  
  1527. anInt1051++;
  1528. if (anInt1051 > 98) {
  1529. anInt1051 = 0;
  1530. stream.createFrame(150);
  1531. }
  1532. method63();
  1533. } catch (Exception exception) {
  1534. }
  1535. ObjectDef.mruNodes1.unlinkAll();
  1536. if (super.gameFrame != null) {
  1537. stream.createFrame(210);
  1538. stream.writeDWord(0x3f008edd);
  1539. }
  1540. if (lowMem && Signlink.cache_dat != null) {
  1541. int j = onDemandFetcher.getVersionCount(0);
  1542. for (int i1 = 0; i1 < j; i1++) {
  1543. int l1 = onDemandFetcher.getModelIndex(i1);
  1544. if ((l1 & 0x79) == 0)
  1545. Model.method461(i1);
  1546. }
  1547.  
  1548. }
  1549. System.gc();
  1550. Texture.method367();
  1551. onDemandFetcher.method566();
  1552. int k = (anInt1069 - 6) / 8 - 1;
  1553. int j1 = (anInt1069 + 6) / 8 + 1;
  1554. int i2 = (anInt1070 - 6) / 8 - 1;
  1555. int l2 = (anInt1070 + 6) / 8 + 1;
  1556. if (aBoolean1141) {
  1557. k = 49;
  1558. j1 = 50;
  1559. i2 = 49;
  1560. l2 = 50;
  1561. }
  1562. for (int l3 = k; l3 <= j1; l3++) {
  1563. for (int j5 = i2; j5 <= l2; j5++)
  1564. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1565. int j7 = onDemandFetcher.method562(0, j5, l3);
  1566. if (j7 != -1)
  1567. onDemandFetcher.method560(j7, 3);
  1568. int k8 = onDemandFetcher.method562(1, j5, l3);
  1569. if (k8 != -1)
  1570. onDemandFetcher.method560(k8, 3);
  1571. }
  1572.  
  1573. }
  1574.  
  1575. }
  1576.  
  1577. private void unlinkMRUNodes() {
  1578. ObjectDef.mruNodes1.unlinkAll();
  1579. ObjectDef.mruNodes2.unlinkAll();
  1580. EntityDef.mruNodes.unlinkAll();
  1581. ItemDef.mruNodes2.unlinkAll();
  1582. ItemDef.mruNodes1.unlinkAll();
  1583. Player.mruNodes.unlinkAll();
  1584. SpotAnim.aMRUNodes_415.unlinkAll();
  1585. }
  1586.  
  1587. private void method24(int i) {
  1588. int ai[] = minimapImage.myPixels;
  1589. int j = ai.length;
  1590. for (int k = 0; k < j; k++)
  1591. ai[k] = 0;
  1592.  
  1593. for (int l = 1; l < 103; l++) {
  1594. int i1 = 24628 + (103 - l) * 512 * 4;
  1595. for (int k1 = 1; k1 < 103; k1++) {
  1596. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1597. worldController.method309(ai, i1, i, k1, l);
  1598. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1599. worldController.method309(ai, i1, i + 1, k1, l);
  1600. i1 += 4;
  1601. }
  1602.  
  1603. }
  1604.  
  1605. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16)
  1606. + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  1607. + ((238 + (int) (Math.random() * 20D)) - 10);
  1608. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  1609. minimapImage.method343();
  1610. for (int i2 = 1; i2 < 103; i2++) {
  1611. for (int j2 = 1; j2 < 103; j2++) {
  1612. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1613. method50(i2, j1, j2, l1, i);
  1614. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1615. method50(i2, j1, j2, l1, i + 1);
  1616. }
  1617.  
  1618. }
  1619.  
  1620. aRSImageProducer_1165.initDrawingArea();
  1621. anInt1071 = 0;
  1622. for (int k2 = 0; k2 < 104; k2++) {
  1623. for (int l2 = 0; l2 < 104; l2++) {
  1624. int i3 = worldController.method303(plane, k2, l2);
  1625. if (i3 != 0) {
  1626. i3 = i3 >> 14 & 0x7fff;
  1627. int j3 = ObjectDef.forID(i3).anInt746;
  1628. if (j3 >= 0) {
  1629. int k3 = k2;
  1630. int l3 = l2;
  1631. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36
  1632. && j3 != 46 && j3 != 47 && j3 != 48) {
  1633. byte byte0 = 104;
  1634. byte byte1 = 104;
  1635. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1636. for (int i4 = 0; i4 < 10; i4++) {
  1637. int j4 = (int) (Math.random() * 4D);
  1638. if (j4 == 0 && k3 > 0 && k3 > k2 - 3
  1639. && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1640. k3--;
  1641. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3
  1642. && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1643. k3++;
  1644. if (j4 == 2 && l3 > 0 && l3 > l2 - 3
  1645. && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1646. l3--;
  1647. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3
  1648. && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1649. l3++;
  1650. }
  1651.  
  1652. }
  1653. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1654. anIntArray1072[anInt1071] = k3;
  1655. anIntArray1073[anInt1071] = l3;
  1656. anInt1071++;
  1657. }
  1658. }
  1659. }
  1660.  
  1661. }
  1662.  
  1663. }
  1664.  
  1665. private void spawnGroundItem(int i, int j) {
  1666. NodeList class19 = groundArray[plane][i][j];
  1667. if (class19 == null) {
  1668. worldController.method295(plane, i, j);
  1669. return;
  1670. }
  1671. int k = 0xfa0a1f01;
  1672. Object obj = null;
  1673. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1674. .reverseGetNext()) {
  1675. ItemDef itemDef = ItemDef.forID(item.ID);
  1676. int l = itemDef.value;
  1677. if (itemDef.stackable)
  1678. l *= item.anInt1559 + 1;
  1679. // notifyItemSpawn(item, i + baseX, j + baseY);
  1680.  
  1681. if (l > k) {
  1682. k = l;
  1683. obj = item;
  1684. }
  1685. }
  1686.  
  1687. class19.insertTail(((Node) (obj)));
  1688. Object obj1 = null;
  1689. Object obj2 = null;
  1690. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1691. .reverseGetNext()) {
  1692. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1693. && obj1 == null)
  1694. obj1 = class30_sub2_sub4_sub2_1;
  1695. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1696. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1697. && obj2 == null)
  1698. obj2 = class30_sub2_sub4_sub2_1;
  1699. }
  1700.  
  1701. int i1 = i + (j << 7) + 0x60000000;
  1702. worldController.method281(i, i1, ((Animable) (obj1)),
  1703. method42(plane, j * 128 + 64, i * 128 + 64),
  1704. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1705. }
  1706.  
  1707. private void method26(boolean flag) {
  1708. for (int j = 0; j < npcCount; j++) {
  1709. NPC npc = npcArray[npcIndices[j]];
  1710. int k = 0x20000000 + (npcIndices[j] << 14);
  1711. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1712. continue;
  1713. int l = npc.x >> 7;
  1714. int i1 = npc.y >> 7;
  1715. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1716. continue;
  1717. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1718. && (npc.y & 0x7f) == 64) {
  1719. if (anIntArrayArray929[l][i1] == anInt1265)
  1720. continue;
  1721. anIntArrayArray929[l][i1] = anInt1265;
  1722. }
  1723. if (!npc.desc.aBoolean84)
  1724. k += 0x80000000;
  1725. worldController
  1726. .method285(plane, npc.anInt1552,
  1727. method42(plane, npc.y, npc.x), k, npc.y,
  1728. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1729. npc.aBoolean1541);
  1730. }
  1731. }
  1732.  
  1733. public void drawHoverBox(int xPos, int yPos, String text) {
  1734. String[] results = text.split("\n");
  1735. int height = (results.length * 16) + 6;
  1736. int width;
  1737. width = smallText.getTextWidth(results[0]) + 6;
  1738. for (int i = 1; i < results.length; i++)
  1739. if (width <= smallText.getTextWidth(results[i]) + 6)
  1740. width = smallText.getTextWidth(results[i]) + 6;
  1741. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1742. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1743. yPos += 14;
  1744. for (int i = 0; i < results.length; i++) {
  1745. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  1746. yPos += 16;
  1747. }
  1748. }
  1749.  
  1750. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
  1751. int i1, int j1) {
  1752. if (class9 == null)
  1753. class9 = RSInterface.interfaceCache[21356];
  1754. if (class9.type != 0 || class9.children == null
  1755. || class9.isMouseoverTriggered)
  1756. return;
  1757. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1758. return;
  1759. int k1 = class9.children.length;
  1760. for (int l1 = 0; l1 < k1; l1++) {
  1761. int i2 = class9.childX[l1] + i;
  1762. int j2 = (class9.childY[l1] + l) - j1;
  1763. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1764. i2 += class9_1.anInt263;
  1765. j2 += class9_1.anInt265;
  1766. if ((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2
  1767. && i1 >= j2 && k < i2 + class9_1.width
  1768. && i1 < j2 + class9_1.height)
  1769. if (class9_1.hoverType >= 0)
  1770. anInt886 = class9_1.hoverType;
  1771. else
  1772. anInt886 = class9_1.id;
  1773. if (class9_1.type == 8 && k >= i2 && i1 >= j2
  1774. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1775. anInt1315 = class9_1.id;
  1776. }
  1777. if (class9_1.type == 0) {
  1778. SortTabs();
  1779. buildInterfaceMenu(i2, class9_1, k, j2, i1,
  1780. class9_1.scrollPosition);
  1781. if (class9_1.scrollMax > class9_1.height)
  1782. moveScroller(i2 + class9_1.width, class9_1.height, k, i1,
  1783. class9_1, j2, true, class9_1.scrollMax);
  1784. } else {
  1785. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
  1786. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1787. boolean flag = false;
  1788. if (class9_1.contentType != 0)
  1789. flag = buildFriendsListMenu(class9_1);
  1790. if (!flag) {
  1791. menuActionName[menuActionRow] = class9_1.tooltip;
  1792. menuActionID[menuActionRow] = 315;
  1793. menuActionCmd3[menuActionRow] = class9_1.id;
  1794. menuActionRow++;
  1795. }
  1796. }
  1797. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
  1798. && i1 >= j2 && k < i2 + class9_1.width
  1799. && i1 < j2 + class9_1.height) {
  1800. String s = class9_1.selectedActionName;
  1801. if (s.indexOf(" ") != -1)
  1802. s = s.substring(0, s.indexOf(" "));
  1803. if (class9_1.spellName.endsWith("Rush")
  1804. || class9_1.spellName.endsWith("Burst")
  1805. || class9_1.spellName.endsWith("Blitz")
  1806. || class9_1.spellName.endsWith("Barrage")
  1807. || class9_1.spellName.endsWith("strike")
  1808. || class9_1.spellName.endsWith("bolt")
  1809. || class9_1.spellName.equals("Crumble undead")
  1810. || class9_1.spellName.endsWith("blast")
  1811. || class9_1.spellName.endsWith("wave")
  1812. || class9_1.spellName.equals("Claws of Guthix")
  1813. || class9_1.spellName.equals("Flames of Zamorak")
  1814. || class9_1.spellName.equals("Magic Dart")) {
  1815. menuActionName[menuActionRow] = "Autocast @gre@"
  1816. + class9_1.spellName;
  1817. menuActionID[menuActionRow] = 104;
  1818. menuActionCmd3[menuActionRow] = class9_1.id;
  1819. menuActionRow++;
  1820. }
  1821. menuActionName[menuActionRow] = s + " @gre@"
  1822. + class9_1.spellName;
  1823. menuActionID[menuActionRow] = 626;
  1824. menuActionCmd3[menuActionRow] = class9_1.id;
  1825. menuActionRow++;
  1826. }
  1827. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
  1828. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1829. menuActionName[menuActionRow] = "Close";
  1830. menuActionID[menuActionRow] = 200;
  1831. menuActionCmd3[menuActionRow] = class9_1.id;
  1832. menuActionRow++;
  1833. }
  1834. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
  1835. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1836. // System.out.println("2"+class9_1.tooltip + ", " +
  1837. // class9_1.interfaceID);
  1838. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1839. // class9_1.id;
  1840. menuActionName[menuActionRow] = class9_1.tooltip;
  1841. menuActionID[menuActionRow] = 169;
  1842. menuActionCmd3[menuActionRow] = class9_1.id;
  1843. menuActionRow++;
  1844. if (class9_1.hoverText != null) {
  1845. // drawHoverBox(k, l, class9_1.hoverText);
  1846. // System.out.println("DRAWING INTERFACE: " +
  1847. // class9_1.hoverText);
  1848. }
  1849. }
  1850. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
  1851. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1852. // System.out.println("3"+class9_1.tooltip + ", " +
  1853. // class9_1.interfaceID);
  1854. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1855. // class9_1.id;
  1856. menuActionName[menuActionRow] = class9_1.tooltip;
  1857. menuActionID[menuActionRow] = 646;
  1858. menuActionCmd3[menuActionRow] = class9_1.id;
  1859. menuActionRow++;
  1860. }
  1861. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
  1862. && i1 >= j2 && k < i2 + class9_1.width
  1863. && i1 < j2 + class9_1.height) {
  1864. // System.out.println("4"+class9_1.tooltip + ", " +
  1865. // class9_1.interfaceID);
  1866. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1867. // class9_1.id;
  1868. menuActionName[menuActionRow] = class9_1.tooltip;
  1869. menuActionID[menuActionRow] = 679;
  1870. menuActionCmd3[menuActionRow] = class9_1.id;
  1871. menuActionRow++;
  1872. }
  1873. if (class9_1.type == 2) {
  1874. int k2 = 0;
  1875. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1876. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1877. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1878. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1879. if (k2 < 20) {
  1880. j3 += class9_1.spritesX[k2];
  1881. k3 += class9_1.spritesY[k2];
  1882. }
  1883. if (k >= j3 && i1 >= k3 && k < j3 + 32
  1884. && i1 < k3 + 32) {
  1885. mouseInvInterfaceIndex = k2;
  1886. lastActiveInvInterface = class9_1.id;
  1887. if (class9_1.inv[k2] > 0) {
  1888. ItemDef itemDef = ItemDef
  1889. .forID(class9_1.inv[k2] - 1);
  1890. if (itemSelected == 1
  1891. && class9_1.isInventoryInterface) {
  1892. if (class9_1.id != anInt1284
  1893. || k2 != anInt1283) {
  1894. menuActionName[menuActionRow] = "Use "
  1895. + selectedItemName
  1896. + " with @lre@"
  1897. + itemDef.name;
  1898. menuActionID[menuActionRow] = 870;
  1899. menuActionCmd1[menuActionRow] = itemDef.id;
  1900. menuActionCmd2[menuActionRow] = k2;
  1901. menuActionCmd3[menuActionRow] = class9_1.id;
  1902. menuActionRow++;
  1903. }
  1904. } else if (spellSelected == 1
  1905. && class9_1.isInventoryInterface) {
  1906. if ((spellUsableOn & 0x10) == 16) {
  1907. menuActionName[menuActionRow] = spellTooltip
  1908. + " @lre@" + itemDef.name;
  1909. menuActionID[menuActionRow] = 543;
  1910. menuActionCmd1[menuActionRow] = itemDef.id;
  1911. menuActionCmd2[menuActionRow] = k2;
  1912. menuActionCmd3[menuActionRow] = class9_1.id;
  1913. menuActionRow++;
  1914. }
  1915. } else {
  1916. if (class9_1.isInventoryInterface) {
  1917. for (int l3 = 4; l3 >= 3; l3--)
  1918. if (itemDef.itemActions != null
  1919. && itemDef.itemActions[l3] != null) {
  1920. menuActionName[menuActionRow] = itemDef.itemActions[l3]
  1921. + " @lre@"
  1922. + itemDef.name;
  1923. if (l3 == 3)
  1924. menuActionID[menuActionRow] = 493;
  1925. if (l3 == 4)
  1926. menuActionID[menuActionRow] = 847;
  1927. menuActionCmd1[menuActionRow] = itemDef.id;
  1928. menuActionCmd2[menuActionRow] = k2;
  1929. menuActionCmd3[menuActionRow] = class9_1.id;
  1930. menuActionRow++;
  1931. } else if (l3 == 4) {
  1932. menuActionName[menuActionRow] = "Drop @lre@"
  1933. + itemDef.name;
  1934. menuActionID[menuActionRow] = 847;
  1935. menuActionCmd1[menuActionRow] = itemDef.id;
  1936. menuActionCmd2[menuActionRow] = k2;
  1937. menuActionCmd3[menuActionRow] = class9_1.id;
  1938. menuActionRow++;
  1939. }
  1940. }
  1941. if (class9_1.usableItemInterface) {
  1942. menuActionName[menuActionRow] = "Use @lre@"
  1943. + itemDef.name;
  1944. menuActionID[menuActionRow] = 447;
  1945. menuActionCmd1[menuActionRow] = itemDef.id;
  1946. menuActionCmd2[menuActionRow] = k2;
  1947. menuActionCmd3[menuActionRow] = class9_1.id;
  1948. menuActionRow++;
  1949. }
  1950. if (class9_1.isInventoryInterface
  1951. && itemDef.itemActions != null) {
  1952. for (int i4 = 2; i4 >= 0; i4--)
  1953. if (itemDef.itemActions[i4] != null) {
  1954. menuActionName[menuActionRow] = itemDef.itemActions[i4]
  1955. + " @lre@"
  1956. + itemDef.name;
  1957. if (i4 == 0)
  1958. menuActionID[menuActionRow] = 74;
  1959. if (i4 == 1)
  1960. menuActionID[menuActionRow] = 454;
  1961. if (i4 == 2)
  1962. menuActionID[menuActionRow] = 539;
  1963. menuActionCmd1[menuActionRow] = itemDef.id;
  1964. menuActionCmd2[menuActionRow] = k2;
  1965. menuActionCmd3[menuActionRow] = class9_1.id;
  1966. menuActionRow++;
  1967. }
  1968.  
  1969. }
  1970. if (class9_1.actions != null) {
  1971. for (int j4 = 4; j4 >= 0; j4--)
  1972. if (class9_1.actions[j4] != null) {
  1973. menuActionName[menuActionRow] = class9_1.actions[j4]
  1974. + " @lre@"
  1975. + itemDef.name;
  1976. if (j4 == 0)
  1977. menuActionID[menuActionRow] = 632;
  1978. if (j4 == 1)
  1979. menuActionID[menuActionRow] = 78;
  1980. if (j4 == 2)
  1981. menuActionID[menuActionRow] = 867;
  1982. if (j4 == 3)
  1983. menuActionID[menuActionRow] = 431;
  1984. if (j4 == 4)
  1985. menuActionID[menuActionRow] = 53;
  1986. menuActionCmd1[menuActionRow] = itemDef.id;
  1987. menuActionCmd2[menuActionRow] = k2;
  1988. menuActionCmd3[menuActionRow] = class9_1.id;
  1989. menuActionRow++;
  1990. }
  1991.  
  1992. }
  1993. // menuActionName[menuActionRow] =
  1994. // "Examine @lre@" + itemDef.name +
  1995. // " @gre@(@whi@" + (class9_1.inv[k2] -
  1996. // 1) + "@gre@)";
  1997. menuActionName[menuActionRow] = "Examine @lre@"
  1998. + itemDef.name;
  1999. menuActionID[menuActionRow] = 1125;
  2000. menuActionCmd1[menuActionRow] = itemDef.id;
  2001. menuActionCmd2[menuActionRow] = k2;
  2002. menuActionCmd3[menuActionRow] = class9_1.id;
  2003. menuActionRow++;
  2004. }
  2005. }
  2006. }
  2007. k2++;
  2008. }
  2009. }
  2010. }
  2011. }
  2012. }
  2013. }
  2014.  
  2015. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  2016. scrollBar1.drawSprite(i1, l);
  2017. scrollBar2.drawSprite(i1, (l + j) - 16);
  2018. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  2019. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  2020. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  2021. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  2022. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  2023. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  2024. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  2025. int k1 = ((j - 32) * j) / j1;
  2026. if (k1 < 8)
  2027. k1 = 8;
  2028. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  2029. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  2030. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  2031. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  2032. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  2033. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  2034. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  2035. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  2036. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  2037. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  2038. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  2039. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  2040. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  2041. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  2042. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  2043. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  2044. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  2045. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  2046. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  2047. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  2048. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  2049. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  2050. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  2051. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  2052. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  2053. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  2054. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  2055. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  2056. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  2057. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  2058. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  2059. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  2060. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  2061. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  2062. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  2063. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  2064. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  2065. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  2066. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  2067. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  2068. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  2069. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  2070. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  2071. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  2072. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  2073. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  2074. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  2075. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  2076. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  2077. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  2078. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  2079. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  2080. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  2081. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  2082. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  2083. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  2084. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  2085. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  2086. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  2087. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  2088. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  2089. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  2090. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  2091. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  2092. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  2093. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  2094. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  2095. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  2096. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  2097. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  2098. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  2099. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  2100. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  2101. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  2102. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  2103. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  2104. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  2105. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  2106. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  2107. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  2108. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  2109. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  2110. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  2111. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  2112. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  2113. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  2114. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  2115. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  2116. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  2117. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  2118. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  2119. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  2120. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  2121. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  2122. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  2123. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  2124. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  2125. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  2126. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  2127. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  2128. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  2129. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  2130. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  2131. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  2132. }
  2133.  
  2134. private void updateNPCs(Stream stream, int i) {
  2135. anInt839 = 0;
  2136. anInt893 = 0;
  2137. method139(stream);
  2138. method46(i, stream);
  2139. method86(stream);
  2140. for (int k = 0; k < anInt839; k++) {
  2141. int l = anIntArray840[k];
  2142. if (npcArray[l].anInt1537 != loopCycle) {
  2143. npcArray[l].desc = null;
  2144. npcArray[l] = null;
  2145. }
  2146. }
  2147.  
  2148. if (stream.currentOffset != i) {
  2149. Signlink.reporterror(myUsername
  2150. + " size mismatch in getnpcpos - pos:"
  2151. + stream.currentOffset + " psize:" + i);
  2152. throw new RuntimeException("eek");
  2153. }
  2154. for (int i1 = 0; i1 < npcCount; i1++)
  2155. if (npcArray[npcIndices[i1]] == null) {
  2156. Signlink.reporterror(myUsername
  2157. + " null entry in npc list - pos:" + i1 + " size:"
  2158. + npcCount);
  2159. throw new RuntimeException("eek");
  2160. }
  2161.  
  2162. }
  2163.  
  2164. private int cButtonHPos;
  2165. private int cButtonCPos;
  2166. public int channel;
  2167.  
  2168. private void processChatModeClick() {
  2169. int y = 0;
  2170. if (clientSize != 0) {
  2171. y = clientHeight - 503;
  2172. }
  2173. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= y + 482
  2174. && super.mouseY <= y + 503) {
  2175. cButtonHPos = 0;
  2176. inputTaken = true;
  2177. } else if (super.mouseX >= 71 && super.mouseX <= 127
  2178. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  2179. cButtonHPos = 1;
  2180. inputTaken = true;
  2181. } else if (super.mouseX >= 137 && super.mouseX <= 193
  2182. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  2183. cButtonHPos = 2;
  2184. inputTaken = true;
  2185. } else if (super.mouseX >= 203 && super.mouseX <= 259
  2186. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  2187. cButtonHPos = 3;
  2188. inputTaken = true;
  2189. } else if (super.mouseX >= 269 && super.mouseX <= 325
  2190. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  2191. cButtonHPos = 4;
  2192. inputTaken = true;
  2193. } else if (super.mouseX >= 335 && super.mouseX <= 391
  2194. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  2195. cButtonHPos = 5;
  2196. inputTaken = true;
  2197. } else if (super.mouseX >= 404 && super.mouseX <= 515
  2198. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  2199. cButtonHPos = 6;
  2200. inputTaken = true;
  2201. } else {
  2202. cButtonHPos = -1;
  2203. inputTaken = true;
  2204. }
  2205. if (super.clickMode3 == 1) {
  2206. if (super.saveClickX >= 5 && super.saveClickX <= 61
  2207. && super.saveClickY >= y + 482
  2208. && super.saveClickY <= y + 505) {
  2209. if (clientSize != 0) {
  2210. if (channel != 0) {
  2211. cButtonCPos = 0;
  2212. chatTypeView = 0;
  2213. inputTaken = true;
  2214. channel = 0;
  2215. } else {
  2216. showChat = showChat ? false : true;
  2217. }
  2218. } else {
  2219. cButtonCPos = 0;
  2220. chatTypeView = 0;
  2221. inputTaken = true;
  2222. channel = 0;
  2223. }
  2224. } else if (super.saveClickX >= 71 && super.saveClickX <= 127
  2225. && super.saveClickY >= y + 482
  2226. && super.saveClickY <= y + 505) {
  2227. if (clientSize != 0) {
  2228. if (channel != 1 && clientSize != 0) {
  2229. cButtonCPos = 1;
  2230. chatTypeView = 5;
  2231. inputTaken = true;
  2232. channel = 1;
  2233. } else {
  2234. showChat = showChat ? false : true;
  2235. }
  2236. } else {
  2237. cButtonCPos = 1;
  2238. chatTypeView = 5;
  2239. inputTaken = true;
  2240. channel = 1;
  2241. }
  2242. } else if (super.saveClickX >= 137 && super.saveClickX <= 193
  2243. && super.saveClickY >= y + 482
  2244. && super.saveClickY <= y + 505) {
  2245. if (clientSize != 0) {
  2246. if (channel != 2 && clientSize != 0) {
  2247. cButtonCPos = 2;
  2248. chatTypeView = 1;
  2249. inputTaken = true;
  2250. channel = 2;
  2251. } else {
  2252. showChat = showChat ? false : true;
  2253. }
  2254. } else {
  2255. cButtonCPos = 2;
  2256. chatTypeView = 1;
  2257. inputTaken = true;
  2258. channel = 2;
  2259. }
  2260. } else if (super.saveClickX >= 203 && super.saveClickX <= 259
  2261. && super.saveClickY >= y + 482
  2262. && super.saveClickY <= y + 505) {
  2263. if (clientSize != 0) {
  2264. if (channel != 3 && clientSize != 0) {
  2265. cButtonCPos = 3;
  2266. chatTypeView = 2;
  2267. inputTaken = true;
  2268. channel = 3;
  2269. } else {
  2270. showChat = showChat ? false : true;
  2271. }
  2272. } else {
  2273. cButtonCPos = 3;
  2274. chatTypeView = 2;
  2275. inputTaken = true;
  2276. channel = 3;
  2277. }
  2278. } else if (super.saveClickX >= 269 && super.saveClickX <= 325
  2279. && super.saveClickY >= y + 482
  2280. && super.saveClickY <= y + 505) {
  2281. if (clientSize != 0) {
  2282. if (channel != 4 && clientSize != 0) {
  2283. cButtonCPos = 4;
  2284. chatTypeView = 11;
  2285. inputTaken = true;
  2286. channel = 4;
  2287. } else {
  2288. showChat = showChat ? false : true;
  2289. }
  2290. } else {
  2291. cButtonCPos = 4;
  2292. chatTypeView = 11;
  2293. inputTaken = true;
  2294. channel = 4;
  2295. }
  2296. } else if (super.saveClickX >= 335 && super.saveClickX <= 391
  2297. && super.saveClickY >= y + 482
  2298. && super.saveClickY <= y + 505) {
  2299. if (clientSize != 0) {
  2300. if (channel != 5 && clientSize != 0) {
  2301. cButtonCPos = 5;
  2302. chatTypeView = 3;
  2303. inputTaken = true;
  2304. channel = 5;
  2305. } else {
  2306. showChat = showChat ? false : true;
  2307. }
  2308. } else {
  2309. cButtonCPos = 5;
  2310. chatTypeView = 3;
  2311. inputTaken = true;
  2312. channel = 5;
  2313. }
  2314. } else if (super.saveClickX >= 404 && super.saveClickX <= 515
  2315. && super.saveClickY >= y + 482
  2316. && super.saveClickY <= y + 505) {
  2317. if (openInterfaceID == -1) {
  2318. clearTopInterfaces();
  2319. reportAbuseInput = "";
  2320. canMute = false;
  2321. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2322. if (RSInterface.interfaceCache[i] == null
  2323. || RSInterface.interfaceCache[i].contentType != 600)
  2324. continue;
  2325. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2326. break;
  2327. }
  2328. } else {
  2329. pushMessage(
  2330. "Please close the interface you have open before using 'report abuse'",
  2331. 0, "");
  2332. }
  2333. }
  2334. }
  2335. }
  2336.  
  2337. private void method33(int i) {
  2338. try {
  2339. int j = Varp.cache[i].anInt709;
  2340. if (j == 0)
  2341. return;
  2342. int k = variousSettings[i];
  2343. if (j == 1) {
  2344. if (k == 1)
  2345. Texture.method372(0.90000000000000002D);
  2346. if (k == 2)
  2347. Texture.method372(0.80000000000000004D);
  2348. if (k == 3)
  2349. Texture.method372(0.69999999999999996D);
  2350. if (k == 4)
  2351. Texture.method372(0.59999999999999998D);
  2352. ItemDef.mruNodes1.unlinkAll();
  2353. welcomeScreenRaised = true;
  2354. }
  2355. if (j == 3) {
  2356. boolean flag1 = musicEnabled;
  2357. if (k == 0) {
  2358. adjustVolume(musicEnabled, 0);
  2359. musicEnabled = true;
  2360. }
  2361. if (k == 1) {
  2362. adjustVolume(musicEnabled, -400);
  2363. musicEnabled = true;
  2364. }
  2365. if (k == 2) {
  2366. adjustVolume(musicEnabled, -800);
  2367. musicEnabled = true;
  2368. }
  2369. if (k == 3) {
  2370. adjustVolume(musicEnabled, -1200);
  2371. musicEnabled = true;
  2372. }
  2373. if (k == 4)
  2374. musicEnabled = false;
  2375. if (musicEnabled != flag1 && !lowMem) {
  2376. if (musicEnabled) {
  2377. nextSong = currentSong;
  2378. songChanging = true;
  2379. onDemandFetcher.method558(2, nextSong);
  2380. } else {
  2381. stopMidi();
  2382. }
  2383. prevSong = 0;
  2384. }
  2385. }
  2386. if (j == 4) {
  2387. if (k == 0) {
  2388. aBoolean848 = true;
  2389. setWaveVolume(0);
  2390. }
  2391. if (k == 1) {
  2392. aBoolean848 = true;
  2393. setWaveVolume(-400);
  2394. }
  2395. if (k == 2) {
  2396. aBoolean848 = true;
  2397. setWaveVolume(-800);
  2398. }
  2399. if (k == 3) {
  2400. aBoolean848 = true;
  2401. setWaveVolume(-1200);
  2402. }
  2403. if (k == 4)
  2404. aBoolean848 = false;
  2405. }
  2406. if (j == 5)
  2407. anInt1253 = k;
  2408. if (j == 6)
  2409. anInt1249 = k;
  2410. if (j == 8) {
  2411. splitPrivateChat = k;
  2412. inputTaken = true;
  2413. }
  2414. if (j == 9)
  2415. anInt913 = k;
  2416. } catch (Exception e) {
  2417. }
  2418. }
  2419.  
  2420. public StreamLoader mediaStreamLoader;
  2421.  
  2422. public void updateEntities() {
  2423. try {
  2424. int anInt974 = 0;
  2425. for (int j = -1; j < playerCount + npcCount; j++) {
  2426. Object obj;
  2427. if (j == -1)
  2428. obj = myPlayer;
  2429. else if (j < playerCount)
  2430. obj = playerArray[playerIndices[j]];
  2431. else
  2432. obj = npcArray[npcIndices[j - playerCount]];
  2433. if (obj == null || !((Entity) (obj)).isVisible())
  2434. continue;
  2435. if (obj instanceof NPC) {
  2436. EntityDef entityDef = ((NPC) obj).desc;
  2437. if (entityDef.childrenIDs != null)
  2438. entityDef = entityDef.method161();
  2439. if (entityDef == null)
  2440. continue;
  2441. }
  2442. if (j < playerCount) {
  2443. int l = 30;
  2444. Player player = (Player) obj;
  2445. if (player.headIcon >= 0) {
  2446. npcScreenPos(((Entity) (obj)),
  2447. ((Entity) (obj)).height + 15);
  2448. if (spriteDrawX > -1) {
  2449. if (player.skullIcon < 2) {
  2450. skullIcons[player.skullIcon].drawSprite(
  2451. spriteDrawX - 12, spriteDrawY - l);
  2452. l += 25;
  2453. }
  2454. if (player.headIcon < 8) {
  2455. headIcons[player.headIcon].drawSprite(
  2456. spriteDrawX - 12, spriteDrawY - l);
  2457. l += 18;
  2458. }
  2459. }
  2460. }
  2461. if (j >= 0 && anInt855 == 10
  2462. && anInt933 == playerIndices[j]) {
  2463. npcScreenPos(((Entity) (obj)),
  2464. ((Entity) (obj)).height + 15);
  2465. if (spriteDrawX > -1)
  2466. headIconsHint[player.hintIcon].drawSprite(
  2467. spriteDrawX - 12, spriteDrawY - l);
  2468. }
  2469. } else {
  2470. EntityDef entityDef_1 = ((NPC) obj).desc;
  2471. if (entityDef_1.anInt75 >= 0
  2472. && entityDef_1.anInt75 < headIcons.length) {
  2473. npcScreenPos(((Entity) (obj)),
  2474. ((Entity) (obj)).height + 15);
  2475. if (spriteDrawX > -1)
  2476. headIcons[entityDef_1.anInt75].drawSprite(
  2477. spriteDrawX - 12, spriteDrawY - 30);
  2478. }
  2479. if (anInt855 == 1
  2480. && anInt1222 == npcIndices[j - playerCount]
  2481. && loopCycle % 20 < 10) {
  2482. npcScreenPos(((Entity) (obj)),
  2483. ((Entity) (obj)).height + 15);
  2484. if (spriteDrawX > -1)
  2485. headIconsHint[0].drawSprite(spriteDrawX - 12,
  2486. spriteDrawY - 28);
  2487. }
  2488. }
  2489. if (((Entity) (obj)).textSpoken != null
  2490. && (j >= playerCount || publicChatMode == 0
  2491. || publicChatMode == 3 || publicChatMode == 1
  2492. && isFriendOrSelf(((Player) obj).name))) {
  2493. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2494. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2495. anIntArray979[anInt974] = chatTextDrawingArea
  2496. .method384(((Entity) (obj)).textSpoken) / 2;
  2497. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2498. anIntArray976[anInt974] = spriteDrawX;
  2499. anIntArray977[anInt974] = spriteDrawY;
  2500. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2501. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2502. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2503. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2504. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  2505. && ((Entity) (obj)).anInt1531 <= 3) {
  2506. anIntArray978[anInt974] += 10;
  2507. anIntArray977[anInt974] += 5;
  2508. }
  2509. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2510. anIntArray979[anInt974] = 60;
  2511. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2512. anIntArray978[anInt974] += 5;
  2513. }
  2514. }
  2515. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2516. try {
  2517. npcScreenPos(((Entity) (obj)),
  2518. ((Entity) (obj)).height + 15);
  2519. if (spriteDrawX > -1) {
  2520. int i1 = (((Entity) (obj)).currentHealth * 30)
  2521. / ((Entity) (obj)).maxHealth;
  2522. if (i1 > 30)
  2523. i1 = 30;
  2524. DrawingArea.drawPixels(5, spriteDrawY - 3,
  2525. spriteDrawX - 15, 65280, i1);
  2526. DrawingArea.drawPixels(5, spriteDrawY - 3,
  2527. (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2528. }
  2529. } catch (Exception e) {
  2530. }
  2531. }
  2532. for (int j1 = 0; j1 < 4; j1++)
  2533. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2534. npcScreenPos(((Entity) (obj)),
  2535. ((Entity) (obj)).height / 2);
  2536. if (spriteDrawX > -1) {
  2537. if (j1 == 1)
  2538. spriteDrawY -= 20;
  2539. if (j1 == 2) {
  2540. spriteDrawX -= 15;
  2541. spriteDrawY -= 10;
  2542. }
  2543. if (j1 == 3) {
  2544. spriteDrawX += 15;
  2545. spriteDrawY -= 10;
  2546. }
  2547. hitMarks[((Entity) (obj)).hitMarkTypes[j1]]
  2548. .drawSprite(spriteDrawX - 12,
  2549. spriteDrawY - 12);
  2550. smallText.drawText(0, String
  2551. .valueOf(((Entity) (obj)).hitArray[j1]),
  2552. spriteDrawY + 4, spriteDrawX);
  2553. smallText.drawText(0xffffff, String
  2554. .valueOf(((Entity) (obj)).hitArray[j1]),
  2555. spriteDrawY + 3, spriteDrawX - 1);
  2556. }
  2557. }
  2558. }
  2559. for (int k = 0; k < anInt974; k++) {
  2560. int k1 = anIntArray976[k];
  2561. int l1 = anIntArray977[k];
  2562. int j2 = anIntArray979[k];
  2563. int k2 = anIntArray978[k];
  2564. boolean flag = true;
  2565. while (flag) {
  2566. flag = false;
  2567. for (int l2 = 0; l2 < k; l2++)
  2568. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2]
  2569. && l1 - k2 < anIntArray977[l2] + 2
  2570. && k1 - j2 < anIntArray976[l2]
  2571. + anIntArray979[l2]
  2572. && k1 + j2 > anIntArray976[l2]
  2573. - anIntArray979[l2]
  2574. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  2575. l1 = anIntArray977[l2] - anIntArray978[l2];
  2576. flag = true;
  2577. }
  2578.  
  2579. }
  2580. spriteDrawX = anIntArray976[k];
  2581. spriteDrawY = anIntArray977[k] = l1;
  2582. String s = aStringArray983[k];
  2583. if (anInt1249 == 0) {
  2584. int i3 = 0xffff00;
  2585. if (anIntArray980[k] < 6)
  2586. i3 = anIntArray965[anIntArray980[k]];
  2587. if (anIntArray980[k] == 6)
  2588. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2589. if (anIntArray980[k] == 7)
  2590. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2591. if (anIntArray980[k] == 8)
  2592. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2593. if (anIntArray980[k] == 9) {
  2594. int j3 = 150 - anIntArray982[k];
  2595. if (j3 < 50)
  2596. i3 = 0xff0000 + 1280 * j3;
  2597. else if (j3 < 100)
  2598. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2599. else if (j3 < 150)
  2600. i3 = 65280 + 5 * (j3 - 100);
  2601. }
  2602. if (anIntArray980[k] == 10) {
  2603. int k3 = 150 - anIntArray982[k];
  2604. if (k3 < 50)
  2605. i3 = 0xff0000 + 5 * k3;
  2606. else if (k3 < 100)
  2607. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2608. else if (k3 < 150)
  2609. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2610. }
  2611. if (anIntArray980[k] == 11) {
  2612. int l3 = 150 - anIntArray982[k];
  2613. if (l3 < 50)
  2614. i3 = 0xffffff - 0x50005 * l3;
  2615. else if (l3 < 100)
  2616. i3 = 65280 + 0x50005 * (l3 - 50);
  2617. else if (l3 < 150)
  2618. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2619. }
  2620. if (anIntArray981[k] == 0) {
  2621. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2622. spriteDrawX);
  2623. chatTextDrawingArea.drawText(i3, s, spriteDrawY,
  2624. spriteDrawX);
  2625. }
  2626. if (anIntArray981[k] == 1) {
  2627. chatTextDrawingArea.method386(0, s, spriteDrawX,
  2628. anInt1265, spriteDrawY + 1);
  2629. chatTextDrawingArea.method386(i3, s, spriteDrawX,
  2630. anInt1265, spriteDrawY);
  2631. }
  2632. if (anIntArray981[k] == 2) {
  2633. chatTextDrawingArea.method387(spriteDrawX, s,
  2634. anInt1265, spriteDrawY + 1, 0);
  2635. chatTextDrawingArea.method387(spriteDrawX, s,
  2636. anInt1265, spriteDrawY, i3);
  2637. }
  2638. if (anIntArray981[k] == 3) {
  2639. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2640. s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2641. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2642. s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2643. }
  2644. if (anIntArray981[k] == 4) {
  2645. int i4 = chatTextDrawingArea.method384(s);
  2646. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2647. DrawingArea.setDrawingArea(334, spriteDrawX - 50,
  2648. spriteDrawX + 50, 0);
  2649. chatTextDrawingArea.method385(0, s, spriteDrawY + 1,
  2650. (spriteDrawX + 50) - k4);
  2651. chatTextDrawingArea.method385(i3, s, spriteDrawY,
  2652. (spriteDrawX + 50) - k4);
  2653. DrawingArea.defaultDrawingAreaSize();
  2654. }
  2655. if (anIntArray981[k] == 5) {
  2656. int j4 = 150 - anIntArray982[k];
  2657. int l4 = 0;
  2658. if (j4 < 25)
  2659. l4 = j4 - 25;
  2660. else if (j4 > 125)
  2661. l4 = j4 - 125;
  2662. DrawingArea
  2663. .setDrawingArea(spriteDrawY + 5, 0, 512,
  2664. spriteDrawY
  2665. - chatTextDrawingArea.anInt1497
  2666. - 1);
  2667. chatTextDrawingArea.drawText(0, s,
  2668. spriteDrawY + 1 + l4, spriteDrawX);
  2669. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4,
  2670. spriteDrawX);
  2671. DrawingArea.defaultDrawingAreaSize();
  2672. }
  2673. } else {
  2674. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2675. spriteDrawX);
  2676. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY,
  2677. spriteDrawX);
  2678. }
  2679. }
  2680. } catch (Exception e) {
  2681. }
  2682. }
  2683.  
  2684. private void delFriend(long l) {
  2685. try {
  2686. if (l == 0L)
  2687. return;
  2688. for (int i = 0; i < friendsCount; i++) {
  2689. if (friendsListAsLongs[i] != l)
  2690. continue;
  2691. friendsCount--;
  2692. needDrawTabArea = true;
  2693. for (int j = i; j < friendsCount; j++) {
  2694. friendsList[j] = friendsList[j + 1];
  2695. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2696. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2697. }
  2698.  
  2699. stream.createFrame(215);
  2700. stream.writeQWord(l);
  2701. break;
  2702. }
  2703. } catch (RuntimeException runtimeexception) {
  2704. Signlink.reporterror("18622, " + false + ", " + l + ", "
  2705. + runtimeexception.toString());
  2706. throw new RuntimeException();
  2707. }
  2708. }
  2709.  
  2710. public void drawSideIcons() {
  2711. if (clientSize == 0) {
  2712. int[] id = { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 };
  2713. int[] tab = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
  2714. int[] positionX = { 17, 49, 83, 114, 147, 180, 214, 14, 49, 82,
  2715. 116, 148, 184, 216 };
  2716. int[] positionY = { 9, 7, 7, 5, 2, 3, 7, 303, 306, 306, 302, 304,
  2717. 302, 303 };
  2718. for (int i = 0; i < 14; i++) {
  2719. if (tabInterfaceIDs[tab[i]] != -1) {
  2720. if (id[i] != -1) {
  2721. cacheSprite[id[i]].drawSprite(positionX[i],
  2722. positionY[i]);
  2723. }
  2724. }
  2725. }
  2726. } else if (clientSize != 0) {
  2727. if (clientWidth < smallTabs) {
  2728. int[] id = { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
  2729. 22 };
  2730. int[] tab = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
  2731. int[] positionX = { 231, 198, 165, 134, 100, 67, 32, 232, 198,
  2732. 164, 131, 98, 64, 32, };
  2733. int[] positionY = { 65, 67, 66, 68, 71, 70, 65, 32, 30, 30, 33,
  2734. 31, 32, 32 };
  2735. for (int i = 0; i < 14; i++) {
  2736. if (tabInterfaceIDs[tab[i]] != -1) {
  2737. if (id[i] != -1) {
  2738. cacheSprite[id[i]]
  2739. .drawSprite(clientWidth - positionX[i],
  2740. clientHeight - positionY[i]);
  2741. }
  2742. }
  2743. }
  2744. } else if (clientWidth >= smallTabs) {
  2745. int[] id = { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
  2746. 22 };
  2747. int[] tab = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
  2748. int[] positionX = { 455, 423, 389, 359, 325, 292, 258, 226,
  2749. 193, 160, 126, 95, 61, 29, };
  2750. int[] positionY = { 29, 31, 29, 32, 34, 34, 31, 32, 30, 30, 33,
  2751. 31, 32, 32 };
  2752. for (int i = 0; i < 14; i++) {
  2753. if (tabInterfaceIDs[tab[i]] != -1) {
  2754. if (id[i] != -1) {
  2755. cacheSprite[id[i]]
  2756. .drawSprite(clientWidth - positionX[i],
  2757. clientHeight - positionY[i]);
  2758. }
  2759. }
  2760. }
  2761. }
  2762. }
  2763. }
  2764.  
  2765. public void drawRedStones() {
  2766. if (clientSize == 0) {
  2767. if (tabInterfaceIDs[tabID] != -1) {
  2768. switch (tabID) {
  2769. case 0:
  2770. cacheSprite[4].drawSprite(6, 0);
  2771. break;
  2772. case 1:
  2773. cacheSprite[8].drawSprite(44, 0);
  2774. break;
  2775. case 2:
  2776. cacheSprite[8].drawSprite(77, 0);
  2777. break;
  2778. case 3:
  2779. cacheSprite[8].drawSprite(110, 0);
  2780. break;
  2781. case 4:
  2782. cacheSprite[8].drawSprite(143, 0);
  2783. break;
  2784. case 5:
  2785. cacheSprite[8].drawSprite(176, 0);
  2786. break;
  2787. case 6:
  2788. cacheSprite[5].drawSprite(209, 0);
  2789. break;
  2790. case 7:
  2791. cacheSprite[6].drawSprite(6, 298);
  2792. break;
  2793. case 8:
  2794. cacheSprite[8].drawSprite(44, 298);
  2795. break;
  2796. case 9:
  2797. cacheSprite[8].drawSprite(77, 298);
  2798. break;
  2799. case 10:
  2800. cacheSprite[8].drawSprite(110, 298);
  2801. break;
  2802. case 11:
  2803. cacheSprite[8].drawSprite(143, 298);
  2804. break;
  2805. case 12:
  2806. cacheSprite[8].drawSprite(176, 298);
  2807. break;
  2808. case 13:
  2809. cacheSprite[7].drawSprite(209, 298);
  2810. break;
  2811. }
  2812. }
  2813. } else if (clientSize != 0) {
  2814. if (clientWidth < smallTabs) {
  2815. if (tabInterfaceIDs[tabID] != -1) {
  2816. if (!showTab) {
  2817. return;
  2818. }
  2819. switch (tabID) {
  2820. case 0:
  2821. cacheSprite[4].drawSprite(clientWidth - 241,
  2822. clientHeight - 73);
  2823. break;
  2824. case 1:
  2825. cacheSprite[8].drawSprite(clientWidth - 202,
  2826. clientHeight - 73);
  2827. break;
  2828. case 2:
  2829. cacheSprite[8].drawSprite(clientWidth - 170,
  2830. clientHeight - 73);
  2831. break;
  2832. case 3:
  2833. cacheSprite[8].drawSprite(clientWidth - 138,
  2834. clientHeight - 73);
  2835. break;
  2836. case 4:
  2837. cacheSprite[8].drawSprite(clientWidth - 104,
  2838. clientHeight - 73);
  2839. break;
  2840. case 5:
  2841. cacheSprite[8].drawSprite(clientWidth - 71,
  2842. clientHeight - 73);
  2843. break;
  2844. case 6:
  2845. cacheSprite[5].drawSprite(clientWidth - 38,
  2846. clientHeight - 73);
  2847. break;
  2848. case 7:
  2849. cacheSprite[6].drawSprite(clientWidth - 241,
  2850. clientHeight - 37);
  2851. break;
  2852. case 8:
  2853. cacheSprite[8].drawSprite(clientWidth - 202,
  2854. clientHeight - 37);
  2855. break;
  2856. case 9:
  2857. cacheSprite[8].drawSprite(clientWidth - 170,
  2858. clientHeight - 37);
  2859. break;
  2860. case 10:
  2861. cacheSprite[8].drawSprite(clientWidth - 138,
  2862. clientHeight - 37);
  2863. break;
  2864. case 11:
  2865. cacheSprite[8].drawSprite(clientWidth - 104,
  2866. clientHeight - 37);
  2867. break;
  2868. case 12:
  2869. cacheSprite[8].drawSprite(clientWidth - 71,
  2870. clientHeight - 37);
  2871. break;
  2872. case 13:
  2873. cacheSprite[7].drawSprite(clientWidth - 38,
  2874. clientHeight - 37);
  2875. break;
  2876. }
  2877. }
  2878. } else if (clientWidth >= smallTabs) {
  2879. if (tabInterfaceIDs[tabID] != -1) {
  2880. if (!showTab) {
  2881. return;
  2882. }
  2883. switch (tabID) {
  2884. case 0:
  2885. cacheSprite[8].drawSprite(clientWidth - 462,
  2886. clientHeight - 36);
  2887. break;
  2888. case 1:
  2889. cacheSprite[8].drawSprite(clientWidth - 429,
  2890. clientHeight - 36);
  2891. break;
  2892. case 2:
  2893. cacheSprite[8].drawSprite(clientWidth - 396,
  2894. clientHeight - 36);
  2895. break;
  2896. case 3:
  2897. cacheSprite[8].drawSprite(clientWidth - 363,
  2898. clientHeight - 36);
  2899. break;
  2900. case 4:
  2901. cacheSprite[8].drawSprite(clientWidth - 330,
  2902. clientHeight - 36);
  2903. break;
  2904. case 5:
  2905. cacheSprite[8].drawSprite(clientWidth - 297,
  2906. clientHeight - 36);
  2907. break;
  2908. case 6:
  2909. cacheSprite[8].drawSprite(clientWidth - 264,
  2910. clientHeight - 36);
  2911. break;
  2912. case 7:
  2913. cacheSprite[8].drawSprite(clientWidth - 231,
  2914. clientHeight - 36);
  2915. break;
  2916. case 8:
  2917. cacheSprite[8].drawSprite(clientWidth - 198,
  2918. clientHeight - 36);
  2919. break;
  2920. case 9:
  2921. cacheSprite[8].drawSprite(clientWidth - 165,
  2922. clientHeight - 36);
  2923. break;
  2924. case 10:
  2925. cacheSprite[8].drawSprite(clientWidth - 132,
  2926. clientHeight - 36);
  2927. break;
  2928. case 11:
  2929. cacheSprite[8].drawSprite(clientWidth - 99,
  2930. clientHeight - 36);
  2931. break;
  2932. case 12:
  2933. cacheSprite[8].drawSprite(clientWidth - 66,
  2934. clientHeight - 36);
  2935. break;
  2936. case 13:
  2937. cacheSprite[8].drawSprite(clientWidth - 33,
  2938. clientHeight - 36);
  2939. break;
  2940. }
  2941. }
  2942. }
  2943. }
  2944. }
  2945.  
  2946. private void drawTabArea() {
  2947. if (clientSize == 0) {
  2948. aRSImageProducer_1163.initDrawingArea();
  2949. }
  2950. if (clientSize == 0) {
  2951. cacheSprite[23].drawSprite(0, 0);
  2952. }
  2953. Texture.anIntArray1472 = anIntArray1181;
  2954. int y = clientWidth >= smallTabs ? 37 : 74;
  2955. if (clientSize != 0) {
  2956. if (clientWidth >= smallTabs) {
  2957. cacheSprite[27]
  2958. .drawSprite(clientWidth - 461, clientHeight - 36);
  2959. } else {
  2960. cacheSprite[28]
  2961. .drawSprite(clientWidth - 241, clientHeight - 73);
  2962. }
  2963. }
  2964. if (showTab) {
  2965. if (clientWidth >= smallTabs) {
  2966. cacheSprite[29].drawSprite(clientWidth - 204,
  2967. clientHeight - 310);
  2968. DrawingArea.method335(0x50463C, clientHeight - 303, 190, 260,
  2969. 100, clientWidth - 197);
  2970. } else {
  2971. cacheSprite[29].drawSprite(clientWidth - 222,
  2972. clientHeight - 346);
  2973. DrawingArea.method335(0x50463C, clientHeight - 339, 190, 260,
  2974. 100, clientWidth - 216);
  2975. }
  2976. }
  2977. int x1 = 0, y1 = 0;
  2978. if (clientSize != 0) {
  2979. x1 = clientWidth - 225;
  2980. y1 = clientHeight - 340;
  2981. }
  2982. if (clientSize == 0) {
  2983. if (invOverlayInterfaceID != -1) {
  2984. drawInterface(0, 32,
  2985. RSInterface.interfaceCache[invOverlayInterfaceID], 36);
  2986. } else if (tabInterfaceIDs[tabID] != -1) {
  2987. drawInterface(0, 32,
  2988. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 36);
  2989. }
  2990. } else if (clientSize != 0 && showTab) {
  2991. if (invOverlayInterfaceID != -1) {
  2992. drawInterface(0, (clientWidth >= smallTabs ? x1 + 28
  2993. : clientWidth - 214),
  2994. RSInterface.interfaceCache[invOverlayInterfaceID],
  2995. (clientWidth >= smallTabs ? y1 + 37 : clientHeight - y
  2996. - 265));
  2997. } else if (tabInterfaceIDs[tabID] != -1) {
  2998. drawInterface(0, (clientWidth >= smallTabs ? x1 + 28
  2999. : clientWidth - 214),
  3000. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  3001. (clientWidth >= smallTabs ? y1 + 37 : clientHeight - y
  3002. - 265));
  3003. }
  3004. }
  3005.  
  3006. if (invOverlayInterfaceID == -1) {
  3007. drawRedStones();
  3008. drawSideIcons();
  3009. }
  3010. if (menuOpen && clientSize == 0) {
  3011. drawMenu(516, 168);
  3012. } else if (menuOpen && menuScreenArea == 1 && clientSize != 0) {
  3013. drawMenu(516, 168);
  3014. }
  3015. if (clientSize == 0)
  3016. aRSImageProducer_1163.drawGraphics(168, super.graphics, 516);
  3017. aRSImageProducer_1165.initDrawingArea();
  3018. Texture.anIntArray1472 = anIntArray1182;
  3019. }
  3020.  
  3021. private void method37(int j) {
  3022. if (!lowMem) {
  3023. if (Texture.anIntArray1480[17] >= j) {
  3024. Background background = Texture.aBackgroundArray1474s[17];
  3025. int k = background.anInt1452 * background.anInt1453 - 1;
  3026. int j1 = background.anInt1452 * anInt945 * 2;
  3027. byte abyte0[] = background.aByteArray1450;
  3028. byte abyte3[] = aByteArray912;
  3029. for (int i2 = 0; i2 <= k; i2++)
  3030. abyte3[i2] = abyte0[i2 - j1 & k];
  3031.  
  3032. background.aByteArray1450 = abyte3;
  3033. aByteArray912 = abyte0;
  3034. Texture.method370(17);
  3035. anInt854++;
  3036. if (anInt854 > 1235) {
  3037. anInt854 = 0;
  3038. stream.createFrame(226);
  3039. stream.writeWordBigEndian(0);
  3040. int l2 = stream.currentOffset;
  3041. stream.writeWord(58722);
  3042. stream.writeWordBigEndian(240);
  3043. stream.writeWord((int) (Math.random() * 65536D));
  3044. stream.writeWordBigEndian((int) (Math.random() * 256D));
  3045. if ((int) (Math.random() * 2D) == 0)
  3046. stream.writeWord(51825);
  3047. stream.writeWordBigEndian((int) (Math.random() * 256D));
  3048. stream.writeWord((int) (Math.random() * 65536D));
  3049. stream.writeWord(7130);
  3050. stream.writeWord((int) (Math.random() * 65536D));
  3051. stream.writeWord(61657);
  3052. stream.writeBytes(stream.currentOffset - l2);
  3053. }
  3054. }
  3055. if (Texture.anIntArray1480[24] >= j) {
  3056. Background background_1 = Texture.aBackgroundArray1474s[24];
  3057. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  3058. int k1 = background_1.anInt1452 * anInt945 * 2;
  3059. byte abyte1[] = background_1.aByteArray1450;
  3060. byte abyte4[] = aByteArray912;
  3061. for (int j2 = 0; j2 <= l; j2++)
  3062. abyte4[j2] = abyte1[j2 - k1 & l];
  3063.  
  3064. background_1.aByteArray1450 = abyte4;
  3065. aByteArray912 = abyte1;
  3066. Texture.method370(24);
  3067. }
  3068. if (Texture.anIntArray1480[34] >= j) {
  3069. Background background_2 = Texture.aBackgroundArray1474s[34];
  3070. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3071. int l1 = background_2.anInt1452 * anInt945 * 2;
  3072. byte abyte2[] = background_2.aByteArray1450;
  3073. byte abyte5[] = aByteArray912;
  3074. for (int k2 = 0; k2 <= i1; k2++)
  3075. abyte5[k2] = abyte2[k2 - l1 & i1];
  3076.  
  3077. background_2.aByteArray1450 = abyte5;
  3078. aByteArray912 = abyte2;
  3079. Texture.method370(34);
  3080. }
  3081. if (Texture.anIntArray1480[40] >= j)
  3082. ;
  3083. {
  3084. Background background_2 = Texture.aBackgroundArray1474s[40];
  3085. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3086. int l1 = background_2.anInt1452 * anInt945 * 2;
  3087. byte abyte2[] = background_2.aByteArray1450;
  3088. byte abyte5[] = aByteArray912;
  3089. for (int k2 = 0; k2 <= i1; k2++)
  3090. abyte5[k2] = abyte2[k2 - l1 & i1];
  3091.  
  3092. background_2.aByteArray1450 = abyte5;
  3093. aByteArray912 = abyte2;
  3094. Texture.method370(40);
  3095. }
  3096. }
  3097. }
  3098.  
  3099. private void method38() {
  3100. for (int i = -1; i < playerCount; i++) {
  3101. int j;
  3102. if (i == -1)
  3103. j = myPlayerIndex;
  3104. else
  3105. j = playerIndices[i];
  3106. Player player = playerArray[j];
  3107. if (player != null && player.textCycle > 0) {
  3108. player.textCycle--;
  3109. if (player.textCycle == 0)
  3110. player.textSpoken = null;
  3111. }
  3112. }
  3113. for (int k = 0; k < npcCount; k++) {
  3114. int l = npcIndices[k];
  3115. NPC npc = npcArray[l];
  3116. if (npc != null && npc.textCycle > 0) {
  3117. npc.textCycle--;
  3118. if (npc.textCycle == 0)
  3119. npc.textSpoken = null;
  3120. }
  3121. }
  3122. }
  3123.  
  3124. private void calcCameraPos() {
  3125. int i = anInt1098 * 128 + 64;
  3126. int j = anInt1099 * 128 + 64;
  3127. int k = method42(plane, j, i) - anInt1100;
  3128. if (xCameraPos < i) {
  3129. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  3130. if (xCameraPos > i)
  3131. xCameraPos = i;
  3132. }
  3133. if (xCameraPos > i) {
  3134. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  3135. if (xCameraPos < i)
  3136. xCameraPos = i;
  3137. }
  3138. if (zCameraPos < k) {
  3139. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  3140. if (zCameraPos > k)
  3141. zCameraPos = k;
  3142. }
  3143. if (zCameraPos > k) {
  3144. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  3145. if (zCameraPos < k)
  3146. zCameraPos = k;
  3147. }
  3148. if (yCameraPos < j) {
  3149. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  3150. if (yCameraPos > j)
  3151. yCameraPos = j;
  3152. }
  3153. if (yCameraPos > j) {
  3154. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  3155. if (yCameraPos < j)
  3156. yCameraPos = j;
  3157. }
  3158. i = anInt995 * 128 + 64;
  3159. j = anInt996 * 128 + 64;
  3160. k = method42(plane, j, i) - anInt997;
  3161. int l = i - xCameraPos;
  3162. int i1 = k - zCameraPos;
  3163. int j1 = j - yCameraPos;
  3164. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  3165. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  3166. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  3167. if (l1 < 128)
  3168. l1 = 128;
  3169. if (l1 > 383)
  3170. l1 = 383;
  3171. if (yCameraCurve < l1) {
  3172. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  3173. if (yCameraCurve > l1)
  3174. yCameraCurve = l1;
  3175. }
  3176. if (yCameraCurve > l1) {
  3177. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  3178. if (yCameraCurve < l1)
  3179. yCameraCurve = l1;
  3180. }
  3181. int j2 = i2 - xCameraCurve;
  3182. if (j2 > 1024)
  3183. j2 -= 2048;
  3184. if (j2 < -1024)
  3185. j2 += 2048;
  3186. if (j2 > 0) {
  3187. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  3188. xCameraCurve &= 0x7ff;
  3189. }
  3190. if (j2 < 0) {
  3191. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  3192. xCameraCurve &= 0x7ff;
  3193. }
  3194. int k2 = i2 - xCameraCurve;
  3195. if (k2 > 1024)
  3196. k2 -= 2048;
  3197. if (k2 < -1024)
  3198. k2 += 2048;
  3199. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  3200. xCameraCurve = i2;
  3201. }
  3202.  
  3203. private void drawMenu(int xOffSet, int yOffSet) {
  3204. int xPos = menuOffsetX - (xOffSet - 4);
  3205. int yPos = (-yOffSet + 4) + menuOffsetY;
  3206. int menuW = menuWidth;
  3207. int menuH = menuHeight + 1;
  3208. inputTaken = true;
  3209. tabAreaAltered = true;
  3210. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  3211. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e,
  3212. menuW - 2);
  3213. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  3214. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822,
  3215. menuW - 6);
  3216. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822,
  3217. menuW - 4);
  3218. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822,
  3219. menuW - 2);
  3220. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d,
  3221. menuW - 4);
  3222. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d,
  3223. menuW - 6);
  3224. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c,
  3225. menuW - 6);
  3226.  
  3227. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  3228. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  3229. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  3230. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  3231. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  3232. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  3233. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  3234. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  3235. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  3236. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  3237. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  3238. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  3239. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  3240. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  3241. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  3242. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  3243. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  3244. chatTextDrawingArea.method385(0xc6b895, "Choose Option", yPos + 14,
  3245. xPos + 3);
  3246. int mouseX = super.mouseX - (xOffSet);
  3247. int mouseY = (-yOffSet) + super.mouseY;
  3248. for (int l1 = 0; l1 < menuActionRow; l1++) {
  3249. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  3250. int disColor = 0xc6b895;
  3251. if (mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13
  3252. && mouseY < textY + 3) {
  3253. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d,
  3254. menuWidth - 6);
  3255. disColor = 0xeee5c6;
  3256. }
  3257. chatTextDrawingArea.method389(true, xPos + 3, disColor,
  3258. menuActionName[l1], textY);
  3259. }
  3260. }
  3261.  
  3262. private void addFriend(long l) {
  3263. try {
  3264. if (l == 0L)
  3265. return;
  3266. if (friendsCount >= 100 && anInt1046 != 1) {
  3267. pushMessage(
  3268. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  3269. 0, "");
  3270. return;
  3271. }
  3272. if (friendsCount >= 200) {
  3273. pushMessage(
  3274. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  3275. 0, "");
  3276. return;
  3277. }
  3278. String s = TextClass.fixName(TextClass.nameForLong(l));
  3279. for (int i = 0; i < friendsCount; i++)
  3280. if (friendsListAsLongs[i] == l) {
  3281. pushMessage(s + " is already on your friend list", 0, "");
  3282. return;
  3283. }
  3284. for (int j = 0; j < ignoreCount; j++)
  3285. if (ignoreListAsLongs[j] == l) {
  3286. pushMessage("Please remove " + s
  3287. + " from your ignore list first", 0, "");
  3288. return;
  3289. }
  3290.  
  3291. if (s.equals(myPlayer.name)) {
  3292. return;
  3293. } else {
  3294. friendsList[friendsCount] = s;
  3295. friendsListAsLongs[friendsCount] = l;
  3296. friendsNodeIDs[friendsCount] = 0;
  3297. friendsCount++;
  3298. needDrawTabArea = true;
  3299. stream.createFrame(188);
  3300. stream.writeQWord(l);
  3301. return;
  3302. }
  3303. } catch (RuntimeException runtimeexception) {
  3304. Signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  3305. + runtimeexception.toString());
  3306. }
  3307. throw new RuntimeException();
  3308. }
  3309.  
  3310. private int method42(int i, int j, int k) {
  3311. int l = k >> 7;
  3312. int i1 = j >> 7;
  3313. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  3314. return 0;
  3315. int j1 = i;
  3316. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  3317. j1++;
  3318. int k1 = k & 0x7f;
  3319. int l1 = j & 0x7f;
  3320. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  3321. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  3322. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  3323. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  3324. return i2 * (128 - l1) + j2 * l1 >> 7;
  3325. }
  3326.  
  3327. private static String intToKOrMil(int j) {
  3328. if (j < 0x186a0)
  3329. return String.valueOf(j);
  3330. if (j < 0x989680)
  3331. return j / 1000 + "K";
  3332. else
  3333. return j / 0xf4240 + "M";
  3334. }
  3335.  
  3336. private void resetLogout() {
  3337. try {
  3338. if (socketStream != null)
  3339. socketStream.close();
  3340. } catch (Exception _ex) {
  3341. }
  3342. toggleSize(0);
  3343. socketStream = null;
  3344. loggedIn = false;
  3345. loginScreenState = 0;
  3346. // myUsername = "";
  3347. // myPassword = "";
  3348. unlinkMRUNodes();
  3349. worldController.initToNull();
  3350. for (int i = 0; i < 4; i++)
  3351. aClass11Array1230[i].method210();
  3352. System.gc();
  3353. stopMidi();
  3354. currentSong = -1;
  3355. nextSong = -1;
  3356. prevSong = 0;
  3357. }
  3358.  
  3359. private void method45() {
  3360. aBoolean1031 = true;
  3361. for (int j = 0; j < 7; j++) {
  3362. anIntArray1065[j] = -1;
  3363. for (int k = 0; k < IDK.length; k++) {
  3364. if (IDK.cache[k].aBoolean662
  3365. || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  3366. continue;
  3367. anIntArray1065[j] = k;
  3368. break;
  3369. }
  3370. }
  3371. }
  3372.  
  3373. private void method46(int i, Stream stream) {
  3374. while (stream.bitPosition + 21 < i * 8) {
  3375. int k = stream.readBits(14);
  3376. if (k == 16383)
  3377. break;
  3378. if (npcArray[k] == null)
  3379. npcArray[k] = new NPC();
  3380. NPC npc = npcArray[k];
  3381. npcIndices[npcCount++] = k;
  3382. npc.anInt1537 = loopCycle;
  3383. int l = stream.readBits(5);
  3384. if (l > 15)
  3385. l -= 32;
  3386. int i1 = stream.readBits(5);
  3387. if (i1 > 15)
  3388. i1 -= 32;
  3389. int j1 = stream.readBits(1);
  3390. npc.desc = EntityDef.forID(stream.readBits(14));
  3391. int k1 = stream.readBits(1);
  3392. if (k1 == 1)
  3393. anIntArray894[anInt893++] = k;
  3394. npc.anInt1540 = npc.desc.size;
  3395. npc.anInt1504 = npc.desc.anInt79;
  3396. npc.anInt1554 = npc.desc.walkAnim;
  3397. npc.anInt1555 = npc.desc.anInt58;
  3398. npc.anInt1556 = npc.desc.anInt83;
  3399. npc.anInt1557 = npc.desc.anInt55;
  3400. npc.anInt1511 = npc.desc.standAnim;
  3401. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  3402. }
  3403. stream.finishBitAccess();
  3404. }
  3405.  
  3406. public void processGameLoop() {
  3407. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  3408. return;
  3409. loopCycle++;
  3410. if (!loggedIn)
  3411. processLoginScreenInput();
  3412. else
  3413. mainGameProcessor();
  3414. processOnDemandQueue();
  3415. }
  3416.  
  3417. private void method47(boolean flag) {
  3418. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  3419. destX = 0;
  3420. int j = playerCount;
  3421. if (flag)
  3422. j = 1;
  3423. for (int l = 0; l < j; l++) {
  3424. Player player;
  3425. int i1;
  3426. if (flag) {
  3427. player = myPlayer;
  3428. i1 = myPlayerIndex << 14;
  3429. } else {
  3430. player = playerArray[playerIndices[l]];
  3431. i1 = playerIndices[l] << 14;
  3432. }
  3433. if (player == null || !player.isVisible())
  3434. continue;
  3435. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  3436. && !flag && player.anInt1517 == player.anInt1511;
  3437. int j1 = player.x >> 7;
  3438. int k1 = player.y >> 7;
  3439. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3440. continue;
  3441. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  3442. && loopCycle < player.anInt1708) {
  3443. player.aBoolean1699 = false;
  3444. player.anInt1709 = method42(plane, player.y, player.x);
  3445. worldController.method286(plane, player.y, player,
  3446. player.anInt1552, player.anInt1722, player.x,
  3447. player.anInt1709, player.anInt1719, player.anInt1721,
  3448. i1, player.anInt1720);
  3449. continue;
  3450. }
  3451. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3452. if (anIntArrayArray929[j1][k1] == anInt1265)
  3453. continue;
  3454. anIntArrayArray929[j1][k1] = anInt1265;
  3455. }
  3456. player.anInt1709 = method42(plane, player.y, player.x);
  3457. worldController.method285(plane, player.anInt1552,
  3458. player.anInt1709, i1, player.y, 60, player.x, player,
  3459. player.aBoolean1541);
  3460. }
  3461. }
  3462.  
  3463. private boolean promptUserForInput(RSInterface class9) {
  3464. int j = class9.contentType;
  3465. if (anInt900 == 2) {
  3466. if (j == 201) {
  3467. inputTaken = true;
  3468. inputDialogState = 0;
  3469. messagePromptRaised = true;
  3470. promptInput = "";
  3471. friendsListAction = 1;
  3472. aString1121 = "Enter name of friend to add to list";
  3473. }
  3474. if (j == 202) {
  3475. inputTaken = true;
  3476. inputDialogState = 0;
  3477. messagePromptRaised = true;
  3478. promptInput = "";
  3479. friendsListAction = 2;
  3480. aString1121 = "Enter name of friend to delete from list";
  3481. }
  3482. }
  3483. if (j == 205) {
  3484. anInt1011 = 250;
  3485. return true;
  3486. }
  3487. if (j == 501) {
  3488. inputTaken = true;
  3489. inputDialogState = 0;
  3490. messagePromptRaised = true;
  3491. promptInput = "";
  3492. friendsListAction = 4;
  3493. aString1121 = "Enter name of player to add to list";
  3494. }
  3495. if (j == 502) {
  3496. inputTaken = true;
  3497. inputDialogState = 0;
  3498. messagePromptRaised = true;
  3499. promptInput = "";
  3500. friendsListAction = 5;
  3501. aString1121 = "Enter name of player to delete from list";
  3502. }
  3503. if (j == 550) {
  3504. inputTaken = true;
  3505. inputDialogState = 0;
  3506. messagePromptRaised = true;
  3507. promptInput = "";
  3508. friendsListAction = 6;
  3509. aString1121 = "Enter the name of the chat you wish to join";
  3510. }
  3511. if (j >= 300 && j <= 313) {
  3512. int k = (j - 300) / 2;
  3513. int j1 = j & 1;
  3514. int i2 = anIntArray1065[k];
  3515. if (i2 != -1) {
  3516. do {
  3517. if (j1 == 0 && --i2 < 0)
  3518. i2 = IDK.length - 1;
  3519. if (j1 == 1 && ++i2 >= IDK.length)
  3520. i2 = 0;
  3521. } while (IDK.cache[i2].aBoolean662
  3522. || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3523. anIntArray1065[k] = i2;
  3524. aBoolean1031 = true;
  3525. }
  3526. }
  3527. if (j >= 314 && j <= 323) {
  3528. int l = (j - 314) / 2;
  3529. int k1 = j & 1;
  3530. int j2 = anIntArray990[l];
  3531. if (k1 == 0 && --j2 < 0)
  3532. j2 = anIntArrayArray1003[l].length - 1;
  3533. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3534. j2 = 0;
  3535. anIntArray990[l] = j2;
  3536. aBoolean1031 = true;
  3537. }
  3538. if (j == 324 && !aBoolean1047) {
  3539. aBoolean1047 = true;
  3540. method45();
  3541. }
  3542. if (j == 325 && aBoolean1047) {
  3543. aBoolean1047 = false;
  3544. method45();
  3545. }
  3546. if (j == 326) {
  3547. stream.createFrame(101);
  3548. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3549. for (int i1 = 0; i1 < 7; i1++)
  3550. stream.writeWordBigEndian(anIntArray1065[i1]);
  3551.  
  3552. for (int l1 = 0; l1 < 5; l1++)
  3553. stream.writeWordBigEndian(anIntArray990[l1]);
  3554.  
  3555. return true;
  3556. }
  3557. if (j == 613)
  3558. canMute = !canMute;
  3559. if (j >= 601 && j <= 612) {
  3560. clearTopInterfaces();
  3561. if (reportAbuseInput.length() > 0) {
  3562. stream.createFrame(218);
  3563. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3564. stream.writeWordBigEndian(j - 601);
  3565. stream.writeWordBigEndian(canMute ? 1 : 0);
  3566. }
  3567. }
  3568. return false;
  3569. }
  3570.  
  3571. private void method49(Stream stream) {
  3572. for (int j = 0; j < anInt893; j++) {
  3573. int k = anIntArray894[j];
  3574. Player player = playerArray[k];
  3575. int l = stream.readUnsignedByte();
  3576. if ((l & 0x40) != 0)
  3577. l += stream.readUnsignedByte() << 8;
  3578. method107(l, k, stream, player);
  3579. }
  3580. }
  3581.  
  3582. private void method50(int i, int k, int l, int i1, int j1) {
  3583. int k1 = worldController.method300(j1, l, i);
  3584. if (k1 != 0) {
  3585. int l1 = worldController.method304(j1, l, i, k1);
  3586. int k2 = l1 >> 6 & 3;
  3587. int i3 = l1 & 0x1f;
  3588. int k3 = k;
  3589. if (k1 > 0)
  3590. k3 = i1;
  3591. int ai[] = minimapImage.myPixels;
  3592. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3593. int i5 = k1 >> 14 & 0x7fff;
  3594. ObjectDef class46_2 = ObjectDef.forID(i5);
  3595. if (class46_2.anInt758 != -1) {
  3596. Background background_2 = mapScenes[class46_2.anInt758];
  3597. if (background_2 != null) {
  3598. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3599. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3600. background_2.drawBackground(48 + l * 4 + i6, 48
  3601. + (104 - i - class46_2.anInt761) * 4 + j6);
  3602. }
  3603. } else {
  3604. if (i3 == 0 || i3 == 2)
  3605. if (k2 == 0) {
  3606. ai[k4] = k3;
  3607. ai[k4 + 512] = k3;
  3608. ai[k4 + 1024] = k3;
  3609. ai[k4 + 1536] = k3;
  3610. } else if (k2 == 1) {
  3611. ai[k4] = k3;
  3612. ai[k4 + 1] = k3;
  3613. ai[k4 + 2] = k3;
  3614. ai[k4 + 3] = k3;
  3615. } else if (k2 == 2) {
  3616. ai[k4 + 3] = k3;
  3617. ai[k4 + 3 + 512] = k3;
  3618. ai[k4 + 3 + 1024] = k3;
  3619. ai[k4 + 3 + 1536] = k3;
  3620. } else if (k2 == 3) {
  3621. ai[k4 + 1536] = k3;
  3622. ai[k4 + 1536 + 1] = k3;
  3623. ai[k4 + 1536 + 2] = k3;
  3624. ai[k4 + 1536 + 3] = k3;
  3625. }
  3626. if (i3 == 3)
  3627. if (k2 == 0)
  3628. ai[k4] = k3;
  3629. else if (k2 == 1)
  3630. ai[k4 + 3] = k3;
  3631. else if (k2 == 2)
  3632. ai[k4 + 3 + 1536] = k3;
  3633. else if (k2 == 3)
  3634. ai[k4 + 1536] = k3;
  3635. if (i3 == 2)
  3636. if (k2 == 3) {
  3637. ai[k4] = k3;
  3638. ai[k4 + 512] = k3;
  3639. ai[k4 + 1024] = k3;
  3640. ai[k4 + 1536] = k3;
  3641. } else if (k2 == 0) {
  3642. ai[k4] = k3;
  3643. ai[k4 + 1] = k3;
  3644. ai[k4 + 2] = k3;
  3645. ai[k4 + 3] = k3;
  3646. } else if (k2 == 1) {
  3647. ai[k4 + 3] = k3;
  3648. ai[k4 + 3 + 512] = k3;
  3649. ai[k4 + 3 + 1024] = k3;
  3650. ai[k4 + 3 + 1536] = k3;
  3651. } else if (k2 == 2) {
  3652. ai[k4 + 1536] = k3;
  3653. ai[k4 + 1536 + 1] = k3;
  3654. ai[k4 + 1536 + 2] = k3;
  3655. ai[k4 + 1536 + 3] = k3;
  3656. }
  3657. }
  3658. }
  3659. k1 = worldController.method302(j1, l, i);
  3660. if (k1 != 0) {
  3661. int i2 = worldController.method304(j1, l, i, k1);
  3662. int l2 = i2 >> 6 & 3;
  3663. int j3 = i2 & 0x1f;
  3664. int l3 = k1 >> 14 & 0x7fff;
  3665. ObjectDef class46_1 = ObjectDef.forID(l3);
  3666. if (class46_1.anInt758 != -1) {
  3667. Background background_1 = mapScenes[class46_1.anInt758];
  3668. if (background_1 != null) {
  3669. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3670. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3671. background_1.drawBackground(48 + l * 4 + j5, 48
  3672. + (104 - i - class46_1.anInt761) * 4 + k5);
  3673. }
  3674. } else if (j3 == 9) {
  3675. int l4 = 0xeeeeee;
  3676. if (k1 > 0)
  3677. l4 = 0xee0000;
  3678. int ai1[] = minimapImage.myPixels;
  3679. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3680. if (l2 == 0 || l2 == 2) {
  3681. ai1[l5 + 1536] = l4;
  3682. ai1[l5 + 1024 + 1] = l4;
  3683. ai1[l5 + 512 + 2] = l4;
  3684. ai1[l5 + 3] = l4;
  3685. } else {
  3686. ai1[l5] = l4;
  3687. ai1[l5 + 512 + 1] = l4;
  3688. ai1[l5 + 1024 + 2] = l4;
  3689. ai1[l5 + 1536 + 3] = l4;
  3690. }
  3691. }
  3692. }
  3693. k1 = worldController.method303(j1, l, i);
  3694. if (k1 != 0) {
  3695. int j2 = k1 >> 14 & 0x7fff;
  3696. ObjectDef class46 = ObjectDef.forID(j2);
  3697. if (class46.anInt758 != -1) {
  3698. Background background = mapScenes[class46.anInt758];
  3699. if (background != null) {
  3700. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3701. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3702. background.drawBackground(48 + l * 4 + i4, 48
  3703. + (104 - i - class46.anInt761) * 4 + j4);
  3704. }
  3705. }
  3706. }
  3707. }
  3708.  
  3709. private void loadTitleScreen() {
  3710. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  3711. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  3712. aBackgroundArray1152s = new Background[12];
  3713. int j = 0;
  3714. try {
  3715. j = Integer.parseInt(getParameter("fl_icon"));
  3716. } catch (Exception _ex) {
  3717. }
  3718. if (j == 0) {
  3719. for (int k = 0; k < 12; k++)
  3720. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3721. "runes", k);
  3722.  
  3723. } else {
  3724. for (int l = 0; l < 12; l++)
  3725. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3726. "runes", 12 + (l & 3));
  3727.  
  3728. }
  3729. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3730. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3731. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0,
  3732. aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3733.  
  3734. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0,
  3735. aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3736.  
  3737. anIntArray851 = new int[256];
  3738. for (int k1 = 0; k1 < 64; k1++)
  3739. anIntArray851[k1] = k1 * 0x40000;
  3740.  
  3741. for (int l1 = 0; l1 < 64; l1++)
  3742. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3743.  
  3744. for (int i2 = 0; i2 < 64; i2++)
  3745. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3746.  
  3747. for (int j2 = 0; j2 < 64; j2++)
  3748. anIntArray851[j2 + 192] = 0xffffff;
  3749.  
  3750. anIntArray852 = new int[256];
  3751. for (int k2 = 0; k2 < 64; k2++)
  3752. anIntArray852[k2] = k2 * 1024;
  3753.  
  3754. for (int l2 = 0; l2 < 64; l2++)
  3755. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3756.  
  3757. for (int i3 = 0; i3 < 64; i3++)
  3758. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3759.  
  3760. for (int j3 = 0; j3 < 64; j3++)
  3761. anIntArray852[j3 + 192] = 0xffffff;
  3762.  
  3763. anIntArray853 = new int[256];
  3764. for (int k3 = 0; k3 < 64; k3++)
  3765. anIntArray853[k3] = k3 * 4;
  3766.  
  3767. for (int l3 = 0; l3 < 64; l3++)
  3768. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3769.  
  3770. for (int i4 = 0; i4 < 64; i4++)
  3771. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3772.  
  3773. for (int j4 = 0; j4 < 64; j4++)
  3774. anIntArray853[j4 + 192] = 0xffffff;
  3775.  
  3776. anIntArray850 = new int[256];
  3777. anIntArray1190 = new int[32768];
  3778. anIntArray1191 = new int[32768];
  3779. randomizeBackground(null);
  3780. anIntArray828 = new int[32768];
  3781. anIntArray829 = new int[32768];
  3782. drawLoadingText(10, "Connecting to fileserver");
  3783. if (!aBoolean831) {
  3784. drawFlames = true;
  3785. aBoolean831 = true;
  3786. startRunnable(this, 2);
  3787. }
  3788. }
  3789.  
  3790. private static void setHighMem() {
  3791. WorldController.lowMem = false;
  3792. Texture.lowMem = false;
  3793. lowMem = false;
  3794. ObjectManager.lowMem = false;
  3795. ObjectDef.lowMem = false;
  3796. }
  3797.  
  3798. public static Client getClient() {
  3799. return instance;
  3800. }
  3801.  
  3802. public static void main(String args[]) {
  3803. try {
  3804. nodeID = 10;
  3805. portOff = 0;
  3806. setHighMem();
  3807. isMembers = true;
  3808. Signlink.storeid = 32;
  3809. Signlink.startpriv(InetAddress.getLocalHost());
  3810. clientSize = 0;
  3811. instance = new Client();
  3812. instance.createClientFrame(clientWidth, clientHeight);
  3813. } catch (Exception exception) {
  3814. exception.printStackTrace();
  3815. }
  3816. }
  3817.  
  3818. public static Client instance;
  3819.  
  3820. public void loadingStages() {
  3821. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3822. aRSImageProducer_1165.initDrawingArea();
  3823. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151,
  3824. 257);
  3825. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.",
  3826. 150, 256);
  3827. aRSImageProducer_1165.drawGraphics(clientSize == 0 ? 4 : 0,
  3828. super.graphics, clientSize == 0 ? 4 : 0);
  3829. loadingStage = 1;
  3830. aLong824 = System.currentTimeMillis();
  3831. }
  3832. if (loadingStage == 1) {
  3833. int j = method54();
  3834. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3835. Signlink.reporterror(myUsername + " glcfb " + aLong1215 + ","
  3836. + j + "," + lowMem + "," + decompressors[0] + ","
  3837. + onDemandFetcher.getNodeCount() + "," + plane + ","
  3838. + anInt1069 + "," + anInt1070);
  3839. aLong824 = System.currentTimeMillis();
  3840. }
  3841. }
  3842. if (loadingStage == 2 && plane != anInt985) {
  3843. anInt985 = plane;
  3844. method24(plane);
  3845. }
  3846. }
  3847.  
  3848. private int method54() {
  3849. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3850. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3851. return -1;
  3852. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3853. return -2;
  3854. }
  3855. boolean flag = true;
  3856. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3857. byte abyte0[] = aByteArrayArray1247[j];
  3858. if (abyte0 != null) {
  3859. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3860. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3861. if (aBoolean1159) {
  3862. k = 10;
  3863. l = 10;
  3864. }
  3865. flag &= ObjectManager.method189(k, abyte0, l);
  3866. }
  3867. }
  3868. if (!flag)
  3869. return -3;
  3870. if (aBoolean1080) {
  3871. return -4;
  3872. } else {
  3873. loadingStage = 2;
  3874. ObjectManager.anInt131 = plane;
  3875. method22();
  3876. stream.createFrame(121);
  3877. return 0;
  3878. }
  3879. }
  3880.  
  3881. private void method55() {
  3882. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3883. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3884. .reverseGetNext())
  3885. if (class30_sub2_sub4_sub4.anInt1597 != plane
  3886. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3887. class30_sub2_sub4_sub4.unlink();
  3888. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3889. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3890. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3891. if (npc != null && npc.x >= 0 && npc.x < 13312
  3892. && npc.y >= 0 && npc.y < 13312)
  3893. class30_sub2_sub4_sub4.method455(
  3894. loopCycle,
  3895. npc.y,
  3896. method42(class30_sub2_sub4_sub4.anInt1597,
  3897. npc.y, npc.x)
  3898. - class30_sub2_sub4_sub4.anInt1583,
  3899. npc.x);
  3900. }
  3901. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3902. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3903. Player player;
  3904. if (j == unknownInt10)
  3905. player = myPlayer;
  3906. else
  3907. player = playerArray[j];
  3908. if (player != null && player.x >= 0 && player.x < 13312
  3909. && player.y >= 0 && player.y < 13312)
  3910. class30_sub2_sub4_sub4.method455(
  3911. loopCycle,
  3912. player.y,
  3913. method42(class30_sub2_sub4_sub4.anInt1597,
  3914. player.y, player.x)
  3915. - class30_sub2_sub4_sub4.anInt1583,
  3916. player.x);
  3917. }
  3918. class30_sub2_sub4_sub4.method456(anInt945);
  3919. worldController.method285(plane,
  3920. class30_sub2_sub4_sub4.anInt1595,
  3921. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  3922. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  3923. (int) class30_sub2_sub4_sub4.aDouble1585,
  3924. class30_sub2_sub4_sub4, false);
  3925. }
  3926.  
  3927. }
  3928.  
  3929. public AppletContext getAppletContext() {
  3930. if (Signlink.mainapp != null)
  3931. return Signlink.mainapp.getAppletContext();
  3932. else
  3933. return super.getAppletContext();
  3934. }
  3935.  
  3936. private void drawLogo() {
  3937. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3938. Sprite sprite = new Sprite(abyte0, this);
  3939. aRSImageProducer_1110.initDrawingArea();
  3940. sprite.method346(0, 0);
  3941. aRSImageProducer_1111.initDrawingArea();
  3942. sprite.method346(-637, 0);
  3943. aRSImageProducer_1107.initDrawingArea();
  3944. sprite.method346(-128, 0);
  3945. aRSImageProducer_1108.initDrawingArea();
  3946. sprite.method346(-202, -371);
  3947. aRSImageProducer_1109.initDrawingArea();
  3948. sprite.method346(-202, -171);
  3949. aRSImageProducer_1112.initDrawingArea();
  3950. sprite.method346(0, -265);
  3951. aRSImageProducer_1113.initDrawingArea();
  3952. sprite.method346(-562, -265);
  3953. aRSImageProducer_1114.initDrawingArea();
  3954. sprite.method346(-128, -171);
  3955. aRSImageProducer_1115.initDrawingArea();
  3956. sprite.method346(-562, -171);
  3957. int ai[] = new int[sprite.myWidth];
  3958. for (int j = 0; j < sprite.myHeight; j++) {
  3959. for (int k = 0; k < sprite.myWidth; k++)
  3960. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1)
  3961. + sprite.myWidth * j];
  3962.  
  3963. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j,
  3964. sprite.myWidth);
  3965. }/*
  3966. * aRSImageProducer_1110.initDrawingArea(); sprite.method346(382, 0);
  3967. * aRSImageProducer_1111.initDrawingArea(); sprite.method346(-255, 0);
  3968. * aRSImageProducer_1107.initDrawingArea(); sprite.method346(254, 0);
  3969. * aRSImageProducer_1108.initDrawingArea(); sprite.method346(180, -371);
  3970. * aRSImageProducer_1109.initDrawingArea(); sprite.method346(180, -171);
  3971. * aRSImageProducer_1112.initDrawingArea(); sprite.method346(382, -265);
  3972. * aRSImageProducer_1113.initDrawingArea(); sprite.method346(-180,
  3973. * -265); aRSImageProducer_1114.initDrawingArea(); sprite.method346(254,
  3974. * -171); aRSImageProducer_1115.initDrawingArea();
  3975. * sprite.method346(-180, -171); sprite = new Sprite(titleStreamLoader,
  3976. * "logo", 0); aRSImageProducer_1107.initDrawingArea();
  3977. * sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3978. */
  3979. sprite = null;
  3980. System.gc();
  3981. }
  3982.  
  3983. private void processOnDemandQueue() {
  3984. do {
  3985. OnDemandData onDemandData;
  3986. do {
  3987. onDemandData = onDemandFetcher.getNextNode();
  3988. if (onDemandData == null)
  3989. return;
  3990. if (onDemandData.dataType == 0) {
  3991. Model.method460(onDemandData.buffer, onDemandData.ID);
  3992. if (backDialogID != -1)
  3993. inputTaken = true;
  3994. }
  3995. if (onDemandData.dataType == 1 && onDemandData.buffer != null)
  3996. Class36.load(onDemandData.ID, onDemandData.buffer);
  3997. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3998. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3999. if (anIntArray1235[i] == onDemandData.ID) {
  4000. aByteArrayArray1183[i] = onDemandData.buffer;
  4001. if (onDemandData.buffer == null)
  4002. anIntArray1235[i] = -1;
  4003. break;
  4004. }
  4005. if (anIntArray1236[i] != onDemandData.ID)
  4006. continue;
  4007. aByteArrayArray1247[i] = onDemandData.buffer;
  4008. if (onDemandData.buffer == null)
  4009. anIntArray1236[i] = -1;
  4010. break;
  4011. }
  4012.  
  4013. }
  4014. } while (onDemandData.dataType != 93
  4015. || !onDemandFetcher.method564(onDemandData.ID));
  4016. ObjectManager.method173(new Stream(onDemandData.buffer),
  4017. onDemandFetcher);
  4018. } while (true);
  4019. }
  4020.  
  4021. private void calcFlamesPosition() {
  4022. char c = '\u0100';
  4023. for (int j = 10; j < 117; j++) {
  4024. int k = (int) (Math.random() * 100D);
  4025. if (k < 50)
  4026. anIntArray828[j + (c - 2 << 7)] = 255;
  4027. }
  4028. for (int l = 0; l < 100; l++) {
  4029. int i1 = (int) (Math.random() * 124D) + 2;
  4030. int k1 = (int) (Math.random() * 128D) + 128;
  4031. int k2 = i1 + (k1 << 7);
  4032. anIntArray828[k2] = 192;
  4033. }
  4034.  
  4035. for (int j1 = 1; j1 < c - 1; j1++) {
  4036. for (int l1 = 1; l1 < 127; l1++) {
  4037. int l2 = l1 + (j1 << 7);
  4038. anIntArray829[l2] = (anIntArray828[l2 - 1]
  4039. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  4040. }
  4041.  
  4042. }
  4043.  
  4044. anInt1275 += 128;
  4045. if (anInt1275 > anIntArray1190.length) {
  4046. anInt1275 -= anIntArray1190.length;
  4047. int i2 = (int) (Math.random() * 12D);
  4048. randomizeBackground(aBackgroundArray1152s[i2]);
  4049. }
  4050. for (int j2 = 1; j2 < c - 1; j2++) {
  4051. for (int i3 = 1; i3 < 127; i3++) {
  4052. int k3 = i3 + (j2 << 7);
  4053. int i4 = anIntArray829[k3 + 128]
  4054. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  4055. - 1] / 5;
  4056. if (i4 < 0)
  4057. i4 = 0;
  4058. anIntArray828[k3] = i4;
  4059. }
  4060.  
  4061. }
  4062.  
  4063. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  4064.  
  4065. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D
  4066. + Math.sin((double) loopCycle / 15D) * 14D + Math
  4067. .sin((double) loopCycle / 16D) * 12D);
  4068. if (anInt1040 > 0)
  4069. anInt1040 -= 4;
  4070. if (anInt1041 > 0)
  4071. anInt1041 -= 4;
  4072. if (anInt1040 == 0 && anInt1041 == 0) {
  4073. int l3 = (int) (Math.random() * 2000D);
  4074. if (l3 == 0)
  4075. anInt1040 = 1024;
  4076. if (l3 == 1)
  4077. anInt1041 = 1024;
  4078. }
  4079. }
  4080.  
  4081. private void method60(int i) {
  4082. RSInterface class9 = RSInterface.interfaceCache[i];
  4083. for (int j = 0; j < class9.children.length; j++) {
  4084. if (class9.children[j] == -1)
  4085. break;
  4086. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  4087. if (class9_1.type == 1)
  4088. method60(class9_1.id);
  4089. class9_1.anInt246 = 0;
  4090. class9_1.anInt208 = 0;
  4091. }
  4092. }
  4093.  
  4094. private void drawHeadIcon() {
  4095. if (anInt855 != 2)
  4096. return;
  4097. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2,
  4098. (anInt935 - baseY << 7) + anInt938);
  4099. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  4100. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  4101. }
  4102.  
  4103. private final boolean inDuelArenaFightArea(int x, int y) {
  4104. return ((x >= 3363 && x <= 3389 && y >= 3244 && y <= 3258)
  4105. || (x >= 3363 && x <= 3389 && y >= 3225 && y <= 3239)
  4106. || (x >= 3363 && x <= 3389 && y >= 3206 && y <= 3220)
  4107. || (x >= 3332 && x <= 3358 && y >= 3206 && y <= 3220)
  4108. || (x >= 3332 && x <= 3358 && y >= 3225 && y <= 3239) || (x >= 3332
  4109. && x <= 3358 && y >= 3244 && y <= 3258));
  4110. }
  4111.  
  4112. private final boolean inDuelArenaOutskirt(int x, int y) {
  4113. return (x >= 3328 && x <= 3395 && y >= 3200 && y <= 3287);
  4114. }
  4115.  
  4116. private final boolean inWilderness(int x, int y) {
  4117. return (x > 2941 && x < 3392 && y >= 3525 && y < 3970)
  4118. || (x > 2941 && x < 3392 && y > 9918 && y < 10366);
  4119. }
  4120.  
  4121. private final boolean inBarrows(int x, int y, int z) {
  4122. return (x > 3539 && x < 3582 && y >= 9675 && y < 9722);
  4123. }
  4124.  
  4125. private final boolean inFightPits(int x, int y) {
  4126. return (x > 2373 && x < 2424 && y >= 5126 && y < 5168);
  4127. }
  4128.  
  4129. private static boolean inMultiArea(int x, int y) {
  4130. return x >= 3029 && x <= 3374 && y >= 3759 && y <= 3903
  4131. || (x >= 2250 && x <= 2280 && y >= 4670 && y <= 4720)
  4132. || (x >= 3198 && x <= 3380 && y >= 3904 && y <= 3970)
  4133. || (x >= 3191 && x <= 3326 && y >= 3510 && y <= 3759)
  4134. || (x >= 2987 && x <= 3006 && y >= 3912 && y <= 3937)
  4135. || (x >= 2245 && x <= 2295 && y >= 4675 && y <= 4720)
  4136. || (x >= 2450 && x <= 3520 && y >= 9450 && y <= 9550)
  4137. || (x >= 3006 && x <= 3071 && y >= 3602 && y <= 3710)
  4138. || (x >= 3134 && x <= 3192 && y >= 3519 && y <= 3646)
  4139. || (x >= 2375 && x <= 2420 && y >= 5126 && y <= 5168);
  4140. }
  4141.  
  4142. public static int getWildernessLevel(int x, int y) {
  4143. return (((y > 6400 ? y - 6400 : y) - 3524) / 8) + 1;
  4144. }
  4145.  
  4146. public void sendString(String str, int i) {
  4147. RSInterface.interfaceCache[i].message = str;
  4148. needDrawTabArea = true;
  4149. inputTaken = true;
  4150. }
  4151.  
  4152. private void mainGameProcessor() {
  4153. checkSize();
  4154. if (anInt1104 > 1)
  4155. anInt1104--;
  4156. if (anInt1011 > 0)
  4157. anInt1011--;
  4158. for (int j = 0; j < 5; j++)
  4159. if (!parsePacket())
  4160. break;
  4161.  
  4162. if (!loggedIn)
  4163. return;
  4164. /**
  4165. * Wilderness levels & Multi areas
  4166. */
  4167. if (!walkableInterfaceMode) {
  4168. if (inWilderness(baseX + (myPlayer.x - 6 >> 7), baseY
  4169. + (myPlayer.y - 6 >> 7))) {
  4170. sendString(
  4171. "Level: "
  4172. + getWildernessLevel(baseX
  4173. + (myPlayer.x - 6 >> 7), baseY
  4174. + (myPlayer.y - 6 >> 7)), 199);
  4175. // atPlayerActions[0] = "Attack";
  4176. // atPlayerArray[0] = true;
  4177. // atPlayerActions[1] = null;
  4178. // atPlayerArray[1] = false;
  4179. anInt1018 = 197;
  4180. } else if (inFightPits(baseX + (myPlayer.x - 6 >> 7), baseY
  4181. + (myPlayer.y - 6 >> 7))) {
  4182. // atPlayerActions[0] = "Attack";
  4183. // atPlayerArray[0] = true;
  4184. // atPlayerActions[1] = null;
  4185. // atPlayerArray[1] = false;
  4186. anInt1018 = 2804;
  4187. } else if (inBarrows(baseX + (myPlayer.x - 6 >> 7), baseY
  4188. + (myPlayer.y - 6 >> 7), plane)) {
  4189. anInt1018 = 4535;
  4190. } else if (inDuelArenaOutskirt(baseX + (myPlayer.x - 6 >> 7), baseY
  4191. + (myPlayer.y - 6 >> 7))) {
  4192. if (inDuelArenaFightArea(baseX + (myPlayer.x - 6 >> 7), baseY
  4193. + (myPlayer.y - 6 >> 7))) {
  4194. // atPlayerActions[0] = "Fight";
  4195. // atPlayerArray[0] = false;
  4196. // atPlayerActions[1] = null;
  4197. // atPlayerArray[1] = false;
  4198. } else {
  4199. // atPlayerActions[0] = null;
  4200. // atPlayerArray[0] = false;
  4201. // atPlayerActions[1] = "Challenge";
  4202. // atPlayerArray[1] = true;
  4203. }
  4204. anInt1018 = 201;
  4205. } else {
  4206. atPlayerActions[0] = null;
  4207. atPlayerArray[0] = false;
  4208. atPlayerActions[1] = null;
  4209. atPlayerArray[1] = false;
  4210. anInt1018 = -1;
  4211. }
  4212. } else {
  4213. }
  4214.  
  4215. anInt1055 = (inMultiArea(baseX + (myPlayer.x - 6 >> 7), baseY
  4216. + (myPlayer.y - 6 >> 7)) ? 1 : 0);
  4217.  
  4218. if (anInt1016 > 0)
  4219. anInt1016--;
  4220. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  4221. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  4222. aBoolean1017 = true;
  4223. if (aBoolean1017 && anInt1016 <= 0) {
  4224. anInt1016 = 20;
  4225. aBoolean1017 = false;
  4226. stream.createFrame(86);
  4227. stream.writeWord(anInt1184);
  4228. stream.method432(minimapInt1);
  4229. }
  4230. if (super.awtFocus && !aBoolean954) {
  4231. aBoolean954 = true;
  4232. stream.createFrame(3);
  4233. stream.writeWordBigEndian(1);
  4234. }
  4235. if (!super.awtFocus && aBoolean954) {
  4236. aBoolean954 = false;
  4237. stream.createFrame(3);
  4238. stream.writeWordBigEndian(0);
  4239. }
  4240. loadingStages();
  4241. method115();
  4242. anInt1009++;
  4243. if (anInt1009 > 750)
  4244. dropClient();
  4245. method114();
  4246. method95();
  4247. method38();
  4248. anInt945++;
  4249. if (crossType != 0) {
  4250. crossIndex += 20;
  4251. if (crossIndex >= 400)
  4252. crossType = 0;
  4253. }
  4254. if (atInventoryInterfaceType != 0) {
  4255. atInventoryLoopCycle++;
  4256. if (atInventoryLoopCycle >= 15) {
  4257. if (atInventoryInterfaceType == 2) {
  4258. }
  4259. if (atInventoryInterfaceType == 3)
  4260. inputTaken = true;
  4261. atInventoryInterfaceType = 0;
  4262. }
  4263. }
  4264. if (activeInterfaceType != 0) {
  4265. anInt989++;
  4266. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  4267. || super.mouseY > anInt1088 + 5
  4268. || super.mouseY < anInt1088 - 5)
  4269. aBoolean1242 = true;
  4270. if (super.clickMode2 == 0) {
  4271. if (activeInterfaceType == 2) {
  4272. }
  4273. if (activeInterfaceType == 3)
  4274. inputTaken = true;
  4275. activeInterfaceType = 0;
  4276. if (aBoolean1242 && anInt989 >= 15) {
  4277. lastActiveInvInterface = -1;
  4278. processRightClick();
  4279. int x = !isFixed() ? 770 - clientHeight + 127 : 0;
  4280. int y = !isFixed() ? 483 - clientHeight + 73 : 0;
  4281. // System.out.println("x-"+x );
  4282. // System.out.println("y-"+y);
  4283. // System.out.println("x2-"+clientWidth );
  4284. // System.out.println("y2-"+clientHeight);
  4285. if (anInt1084 == 5382 && super.mouseY >= 43
  4286. && super.mouseY <= 79) { // check if bank interface
  4287. if (super.mouseX >= 62 && super.mouseX <= 100) { // tab
  4288. // 1
  4289. stream.createFrame(214);
  4290. stream.method433(5); // 5 = maintab
  4291. stream.method424(0);
  4292. stream.method433(anInt1085); // Selected item slot
  4293. stream.method431(mouseInvInterfaceIndex); // unused
  4294.  
  4295. }
  4296. if (super.mouseX >= 102 && super.mouseX <= 142) { // tab
  4297. // 1
  4298. stream.createFrame(214);
  4299. stream.method433(13); // tab # x 13 (originally
  4300. // movewindow)
  4301. stream.method424(0);
  4302. stream.method433(anInt1085); // Selected item slot
  4303. stream.method431(mouseInvInterfaceIndex); // unused
  4304.  
  4305. }
  4306. if (super.mouseX >= 143 && super.mouseX <= 179) { // tab
  4307. // 2
  4308. stream.createFrame(214);
  4309. stream.method433(26); // tab # x 13 (originally
  4310. // movewindow)
  4311. stream.method424(0);
  4312. stream.method433(anInt1085); // Selected item slot
  4313. stream.method431(mouseInvInterfaceIndex); // unused
  4314.  
  4315. }
  4316. if (super.mouseX >= 182 && super.mouseX <= 218) { // tab
  4317. // //come
  4318. // back
  4319. // 3
  4320. stream.createFrame(214);
  4321. stream.method433(39); // tab # x 13 (originally
  4322. // movewindow)
  4323. stream.method424(0);
  4324. stream.method433(anInt1085); // Selected item slot
  4325. stream.method431(mouseInvInterfaceIndex); // unused
  4326.  
  4327. }
  4328. if (super.mouseX >= 225 && super.mouseX <= 258) { // tab
  4329. // 4
  4330. stream.createFrame(214);
  4331. stream.method433(52); // tab # x 13 (originally
  4332. // movewindow)..dude let me work. u messed that on
  4333. // how? u were
  4334. // hovering over tab 5 instead of 4
  4335. stream.method424(0);
  4336. stream.method433(anInt1085); // Selected item slot
  4337. stream.method431(mouseInvInterfaceIndex); // unused
  4338.  
  4339. }
  4340. if (super.mouseX >= 263 && super.mouseX <= 299) { // tab
  4341. // 5
  4342. stream.createFrame(214);
  4343. stream.method433(65); // tab # x 13 (originally
  4344. // movewindow)
  4345. stream.method424(0);
  4346. stream.method433(anInt1085); // Selected item slot
  4347. stream.method431(mouseInvInterfaceIndex); // unused
  4348.  
  4349. }
  4350. if (super.mouseX >= 303 && super.mouseX <= 337) { // tab
  4351. // 6
  4352. stream.createFrame(214);
  4353. stream.method433(78); // tab # x 13 (originally
  4354. // movewindow)
  4355. stream.method424(0);
  4356. stream.method433(anInt1085); // Selected item slot
  4357. stream.method431(mouseInvInterfaceIndex); // unused
  4358.  
  4359. }
  4360. if (super.mouseX >= 343 && super.mouseX <= 378) { // tab
  4361. // 7
  4362. stream.createFrame(214);
  4363. stream.method433(91); // tab # x 13 (originally
  4364. // movewindow)
  4365. stream.method424(0);
  4366. stream.method433(anInt1085); // Selected item slot
  4367. stream.method431(mouseInvInterfaceIndex); // unused
  4368.  
  4369. }
  4370. if (super.mouseX >= 383 && super.mouseX <= 418) { // tab
  4371. // 8
  4372. stream.createFrame(214);
  4373. stream.method433(104); // tab # x 13 (originally
  4374. // movewindow)
  4375. stream.method424(0);
  4376. stream.method433(anInt1085); // Selected item slot
  4377. stream.method431(mouseInvInterfaceIndex); // unused
  4378.  
  4379. }
  4380. }
  4381. if (lastActiveInvInterface == anInt1084
  4382. && mouseInvInterfaceIndex != anInt1085) {
  4383. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4384. int j1 = 0;
  4385. if (anInt913 == 1 && class9.contentType == 206)
  4386. j1 = 1;
  4387. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  4388. j1 = 0;
  4389. if (class9.aBoolean235) {
  4390. int l2 = anInt1085;
  4391. int l3 = mouseInvInterfaceIndex;
  4392. class9.inv[l3] = class9.inv[l2];
  4393. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  4394. class9.inv[l2] = -1;
  4395. class9.invStackSizes[l2] = 0;
  4396. } else if (j1 == 1) {
  4397. int i3 = anInt1085;
  4398. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  4399. if (i3 > i4) {
  4400. class9.swapInventoryItems(i3, i3 - 1);
  4401. i3--;
  4402. } else if (i3 < i4) {
  4403. class9.swapInventoryItems(i3, i3 + 1);
  4404. i3++;
  4405. }
  4406.  
  4407. } else {
  4408. class9.swapInventoryItems(anInt1085,
  4409. mouseInvInterfaceIndex);
  4410. }
  4411. stream.createFrame(214);
  4412. stream.method433(anInt1084);
  4413. stream.method424(j1);
  4414. stream.method433(anInt1085);
  4415. stream.method431(mouseInvInterfaceIndex);
  4416. }
  4417. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  4418. && menuActionRow > 2)
  4419. determineMenuSize();
  4420. else if (menuActionRow > 0)
  4421. doAction(menuActionRow - 1);
  4422. atInventoryLoopCycle = 10;
  4423. super.clickMode3 = 0;
  4424. }
  4425. }
  4426. if (WorldController.anInt470 != -1) {
  4427. int k = WorldController.anInt470;
  4428. int k1 = WorldController.anInt471;
  4429. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  4430. myPlayer.smallX[0], true, k);
  4431. WorldController.anInt470 = -1;
  4432. if (flag) {
  4433. crossX = super.saveClickX;
  4434. crossY = super.saveClickY;
  4435. crossType = 1;
  4436. crossIndex = 0;
  4437. }
  4438. }
  4439. if (super.clickMode3 == 1 && aString844 != null) {
  4440. aString844 = null;
  4441. inputTaken = true;
  4442. super.clickMode3 = 0;
  4443. }
  4444. processMenuClick();
  4445. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  4446. anInt1213++;
  4447. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4448. if (anInt1501 < 0 && !menuOpen) {
  4449. anInt1501++;
  4450. if (anInt1501 == 0) {
  4451. if (anInt1500 != 0) {
  4452. inputTaken = true;
  4453. }
  4454. if (anInt1044 != 0) {
  4455. }
  4456. }
  4457. }
  4458. } else if (anInt1501 > 0) {
  4459. anInt1501--;
  4460. }
  4461. if (loadingStage == 2)
  4462. method108();
  4463. if (loadingStage == 2 && aBoolean1160)
  4464. calcCameraPos();
  4465. for (int i1 = 0; i1 < 5; i1++)
  4466. anIntArray1030[i1]++;
  4467.  
  4468. method73();
  4469. super.idleTime++;
  4470. if (super.idleTime > 4500) {
  4471. anInt1011 = 250;
  4472. super.idleTime -= 500;
  4473. stream.createFrame(202);
  4474. }
  4475. anInt1010++;
  4476. if (anInt1010 > 50)
  4477. stream.createFrame(0);
  4478. try {
  4479. if (socketStream != null && stream.currentOffset > 0) {
  4480. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  4481. stream.currentOffset = 0;
  4482. anInt1010 = 0;
  4483. }
  4484. } catch (IOException _ex) {
  4485. dropClient();
  4486. } catch (Exception exception) {
  4487. resetLogout();
  4488. }
  4489. }
  4490.  
  4491. private void method63() {
  4492. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  4493. .reverseGetFirst();
  4494. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  4495. .reverseGetNext())
  4496. if (class30_sub1.anInt1294 == -1) {
  4497. class30_sub1.anInt1302 = 0;
  4498. method89(class30_sub1);
  4499. } else {
  4500. class30_sub1.unlink();
  4501. }
  4502.  
  4503. }
  4504.  
  4505. private void resetImageProducers() {
  4506. if (aRSImageProducer_1107 != null)
  4507. return;
  4508. super.fullGameScreen = null;
  4509. aRSImageProducer_1166 = null;
  4510. aRSImageProducer_1164 = null;
  4511. aRSImageProducer_1163 = null;
  4512. aRSImageProducer_1165 = null;
  4513. aRSImageProducer_1123 = null;
  4514. aRSImageProducer_1124 = null;
  4515. aRSImageProducer_1125 = null;
  4516. aRSImageProducer_1110 = new RSImageProducer(128, 265,
  4517. getGameComponent());
  4518. DrawingArea.setAllPixelsToZero();
  4519. aRSImageProducer_1111 = new RSImageProducer(128, 265,
  4520. getGameComponent());
  4521. DrawingArea.setAllPixelsToZero();
  4522. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  4523. getGameComponent());
  4524. DrawingArea.setAllPixelsToZero();
  4525. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  4526. getGameComponent());
  4527. DrawingArea.setAllPixelsToZero();
  4528. aRSImageProducer_1109 = new RSImageProducer(360, 200,
  4529. getGameComponent());
  4530. DrawingArea.setAllPixelsToZero();
  4531. aRSImageProducer_1112 = new RSImageProducer(202, 238,
  4532. getGameComponent());
  4533. DrawingArea.setAllPixelsToZero();
  4534. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  4535. getGameComponent());
  4536. DrawingArea.setAllPixelsToZero();
  4537. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4538. DrawingArea.setAllPixelsToZero();
  4539. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4540. DrawingArea.setAllPixelsToZero();
  4541. if (titleStreamLoader != null) {
  4542. drawLogo();
  4543. loadTitleScreen();
  4544. }
  4545. welcomeScreenRaised = true;
  4546. }
  4547.  
  4548. void drawLoading(int i, String s) {
  4549. anInt1079 = i;
  4550. aString1049 = s;
  4551. resetImageProducers();
  4552. if (titleStreamLoader == null) {
  4553. super.drawLoadingText(i, s);
  4554. return;
  4555. }
  4556. aRSImageProducer_1109.initDrawingArea();
  4557. char c = '\u0168';
  4558. char c1 = '\310';
  4559. byte byte1 = 20;
  4560. chatTextDrawingArea.drawText(0xffffff,
  4561. "OwnXile is loading - please wait...", c1 / 2 - 26 - byte1,
  4562. c / 2);
  4563. int j = c1 / 2 - 18 - byte1;
  4564. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  4565. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  4566. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  4567. DrawingArea
  4568. .drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  4569. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  4570. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  4571. if (welcomeScreenRaised) {
  4572. welcomeScreenRaised = false;
  4573. if (!aBoolean831) {
  4574. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  4575. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  4576. }
  4577. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  4578. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  4579. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  4580. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  4581. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  4582. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  4583. }
  4584. }
  4585.  
  4586. public void moveScroller(int i, int j, int k, int l, RSInterface class9,
  4587. int i1, boolean flag, int j1) {
  4588. int anInt992;
  4589. if (aBoolean972)
  4590. anInt992 = 32;
  4591. else
  4592. anInt992 = 0;
  4593. aBoolean972 = false;
  4594. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  4595. class9.scrollPosition -= anInt1213 * 4;
  4596. if (flag) {
  4597. needDrawTabArea = true;
  4598. }
  4599. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  4600. class9.scrollPosition += anInt1213 * 4;
  4601. if (flag) {
  4602. needDrawTabArea = true;
  4603. }
  4604. // free scrolling
  4605. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  4606. && l < (i1 + j) - 16 && anInt1213 > 0) {
  4607. int l1 = ((j - 32) * j) / j1;
  4608. if (l1 < 8)
  4609. l1 = 8;
  4610. int i2 = l - i1 - 16 - l1 / 2;
  4611. int j2 = j - 32 - l1;
  4612. class9.scrollPosition = (short) (((j1 - j) * i2) / j2);
  4613. if (flag)
  4614. needDrawTabArea = true;
  4615. aBoolean972 = true;
  4616. }
  4617. }
  4618.  
  4619. private boolean method66(int i, int j, int k) {
  4620. int i1 = i >> 14 & 0x7fff;
  4621. int j1 = worldController.method304(plane, k, j, i);
  4622. if (j1 == -1)
  4623. return false;
  4624. int k1 = j1 & 0x1f;
  4625. int l1 = j1 >> 6 & 3;
  4626. if (k1 == 10 || k1 == 11 || k1 == 22) {
  4627. ObjectDef class46 = ObjectDef.forID(i1);
  4628. int i2;
  4629. int j2;
  4630. if (l1 == 0 || l1 == 2) {
  4631. i2 = class46.anInt744;
  4632. j2 = class46.anInt761;
  4633. } else {
  4634. i2 = class46.anInt761;
  4635. j2 = class46.anInt744;
  4636. }
  4637. int k2 = class46.anInt768;
  4638. if (l1 != 0)
  4639. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4640. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j,
  4641. myPlayer.smallX[0], false, k);
  4642. } else {
  4643. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j,
  4644. myPlayer.smallX[0], false, k);
  4645. }
  4646. crossX = super.saveClickX;
  4647. crossY = super.saveClickY;
  4648. crossType = 2;
  4649. crossIndex = 0;
  4650. return true;
  4651. }
  4652.  
  4653. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  4654. int k) {
  4655. byte abyte0[] = null;
  4656. int l = 5;
  4657. try {
  4658. if (decompressors[0] != null)
  4659. abyte0 = decompressors[0].decompress(i);
  4660. } catch (Exception _ex) {
  4661. }
  4662. if (abyte0 != null) {
  4663. // aCRC32_930.reset();
  4664. // aCRC32_930.update(abyte0);
  4665. // int i1 = (int)aCRC32_930.getValue();
  4666. // if(i1 != j)
  4667. }
  4668. if (abyte0 != null) {
  4669. StreamLoader streamLoader = new StreamLoader(abyte0);
  4670. return streamLoader;
  4671. }
  4672. int j1 = 0;
  4673. while (abyte0 == null) {
  4674. String s2 = "Unknown error";
  4675. drawLoadingText(k, "Requesting " + s);
  4676. try {
  4677. int k1 = 0;
  4678. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  4679. byte abyte1[] = new byte[6];
  4680. datainputstream.readFully(abyte1, 0, 6);
  4681. Stream stream = new Stream(abyte1);
  4682. stream.currentOffset = 3;
  4683. int i2 = stream.read3Bytes() + 6;
  4684. int j2 = 6;
  4685. abyte0 = new byte[i2];
  4686. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  4687.  
  4688. while (j2 < i2) {
  4689. int l2 = i2 - j2;
  4690. if (l2 > 1000)
  4691. l2 = 1000;
  4692. int j3 = datainputstream.read(abyte0, j2, l2);
  4693. if (j3 < 0) {
  4694. s2 = "Length error: " + j2 + "/" + i2;
  4695. throw new IOException("EOF");
  4696. }
  4697. j2 += j3;
  4698. int k3 = (j2 * 100) / i2;
  4699. if (k3 != k1)
  4700. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  4701. k1 = k3;
  4702. }
  4703. datainputstream.close();
  4704. try {
  4705. if (decompressors[0] != null)
  4706. decompressors[0].method234(abyte0.length, abyte0, i);
  4707. } catch (Exception _ex) {
  4708. decompressors[0] = null;
  4709. }
  4710. /*
  4711. * if(abyte0 != null) { aCRC32_930.reset();
  4712. * aCRC32_930.update(abyte0); int i3 =
  4713. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  4714. * j1++; s2 = "Checksum error: " + i3; } }
  4715. */
  4716. } catch (IOException ioexception) {
  4717. if (s2.equals("Unknown error"))
  4718. s2 = "Connection error";
  4719. abyte0 = null;
  4720. } catch (NullPointerException _ex) {
  4721. s2 = "Null error";
  4722. abyte0 = null;
  4723. if (!Signlink.reporterror)
  4724. return null;
  4725. } catch (ArrayIndexOutOfBoundsException _ex) {
  4726. s2 = "Bounds error";
  4727. abyte0 = null;
  4728. if (!Signlink.reporterror)
  4729. return null;
  4730. } catch (Exception _ex) {
  4731. s2 = "Unexpected error";
  4732. abyte0 = null;
  4733. if (!Signlink.reporterror)
  4734. return null;
  4735. }
  4736. if (abyte0 == null) {
  4737. for (int l1 = l; l1 > 0; l1--) {
  4738. if (j1 >= 3) {
  4739. drawLoadingText(k, "Game updated - please reload page");
  4740. l1 = 10;
  4741. } else {
  4742. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4743. }
  4744. try {
  4745. Thread.sleep(1000L);
  4746. } catch (Exception _ex) {
  4747. }
  4748. }
  4749.  
  4750. l *= 2;
  4751. if (l > 60)
  4752. l = 60;
  4753. aBoolean872 = !aBoolean872;
  4754. }
  4755.  
  4756. }
  4757.  
  4758. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  4759. return streamLoader_1;
  4760. }
  4761.  
  4762. private final void minimapHovers() {
  4763. // if(mouseInRegion(clientSize == 0 ? 584 : getOrbX(2), clientSize == 0
  4764. // ? 613 : getOrbY(2), clientSize == 0 ? 132 : getOrbX(2) + 57,
  4765. // clientSize == 0 ? 165 : getOrbY(2) + 34)) {
  4766. // mouseInRegion(clientSize == 0 ? 557 : getOrbX(2), clientSize == 0 ?
  4767. // 584 : getOrbY(2), clientSize == 0 ? 142 : getOrbX(2) + 57, clientSize
  4768. // == 0 ? 165 : getOrbY(2) + 34)
  4769. // }
  4770. if (clientSize == 0)
  4771. runHover = super.mouseX >= 584 && super.mouseX <= 613
  4772. && super.mouseY >= 121 && super.mouseY < 159
  4773. || super.mouseX >= 557 && super.mouseX <= 584
  4774. && super.mouseY >= 132 && super.mouseY < 159;
  4775. else
  4776. runHover = mouseInRegion(clientSize == 0 ? 584 : getOrbX(2),
  4777. clientSize == 0 ? 613 : getOrbY(2), clientSize == 0 ? 132
  4778. : getOrbX(2) + 57, clientSize == 0 ? 165
  4779. : getOrbY(2) + 34)
  4780. || mouseInRegion(clientSize == 0 ? 557 : getOrbX(2),
  4781. clientSize == 0 ? 584 : getOrbY(2),
  4782. clientSize == 0 ? 142 : getOrbX(2) + 57,
  4783. clientSize == 0 ? 165 : getOrbY(2) + 34);
  4784. }
  4785.  
  4786. private void processMinimapActions() {
  4787. if (runHover) {
  4788. menuActionName[1] = !runClicked ? "Turn run mode on"
  4789. : "Turn run mode off";
  4790. menuActionID[1] = 1050;
  4791. menuActionRow = 2;
  4792. }
  4793. }
  4794.  
  4795. private void dropClient() {
  4796. if (fullscreenInterfaceID >= 1) {
  4797. fullscreenInterfaceID = -1;
  4798. return;
  4799. }
  4800. aRSImageProducer_1165.initDrawingArea();
  4801. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2);
  4802. DrawingArea.drawPixels(37, 3, 3, 0, 227);
  4803. aTextDrawingArea_1271.drawText(0, "Connection lost.", 19, 120);
  4804. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost.", 18, 119);
  4805. aTextDrawingArea_1271.drawText(0,
  4806. "Please wait - attempting to reestablish.", 34, 117);
  4807. aTextDrawingArea_1271.drawText(0xffffff,
  4808. "Please wait - attempting to reestablish.", 34, 116);
  4809. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4810. anInt1021 = 0;
  4811. destX = 0;
  4812. RSSocket rsSocket = socketStream;
  4813. loggedIn = false;
  4814. loginFailures = 0;
  4815. login(myUsername, myPassword, true);
  4816. if (!loggedIn)
  4817. resetLogout();
  4818. try {
  4819. rsSocket.close();
  4820. } catch (Exception _ex) {
  4821. }
  4822. }
  4823.  
  4824. public void setNorth() {
  4825. anInt1278 = 0;
  4826. anInt1131 = 0;
  4827. anInt896 = 0;
  4828. minimapInt1 = 0;
  4829. minimapInt2 = 0;
  4830. minimapInt3 = 0;
  4831. }
  4832.  
  4833. private void doAction(int i) {
  4834. if (i < 0)
  4835. return;
  4836. if (inputDialogState != 0) {
  4837. inputDialogState = 0;
  4838. inputTaken = true;
  4839. }
  4840. int j = menuActionCmd2[i];
  4841. int k = menuActionCmd3[i];
  4842. int l = menuActionID[i];
  4843. int i1 = menuActionCmd1[i];
  4844. if (l >= 2000)
  4845. l -= 2000;
  4846. if (l == 696) {
  4847. setNorth();
  4848. }
  4849. if (l == 104) {
  4850. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4851. spellID = class9_1.id;
  4852. if (!autocast) {
  4853. autocast = true;
  4854. autoCastId = class9_1.id;
  4855. stream.createFrame(185);
  4856. stream.writeWord(class9_1.id);
  4857. } else if (autoCastId == class9_1.id) {
  4858. autocast = false;
  4859. autoCastId = 0;
  4860. stream.createFrame(185);
  4861. stream.writeWord(class9_1.id);
  4862. } else if (autoCastId != class9_1.id) {
  4863. autocast = true;
  4864. autoCastId = class9_1.id;
  4865. stream.createFrame(185);
  4866. stream.writeWord(class9_1.id);
  4867. }
  4868. }
  4869. if (l == 582) {
  4870. NPC npc = npcArray[i1];
  4871. if (npc != null) {
  4872. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  4873. myPlayer.smallX[0], false, npc.smallX[0]);
  4874. crossX = super.saveClickX;
  4875. crossY = super.saveClickY;
  4876. crossType = 2;
  4877. crossIndex = 0;
  4878. stream.createFrame(57);
  4879. stream.method432(anInt1285);
  4880. stream.method432(i1);
  4881. stream.method431(anInt1283);
  4882. stream.method432(anInt1284);
  4883. }
  4884. }
  4885. if (l == 234) {
  4886. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4887. myPlayer.smallX[0], false, j);
  4888. if (!flag1)
  4889. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4890. myPlayer.smallX[0], false, j);
  4891. crossX = super.saveClickX;
  4892. crossY = super.saveClickY;
  4893. crossType = 2;
  4894. crossIndex = 0;
  4895. stream.createFrame(236);
  4896. stream.method431(k + baseY);
  4897. stream.writeWord(i1);
  4898. stream.method431(j + baseX);
  4899. }
  4900. if (l == 62 && method66(i1, k, j)) {
  4901. stream.createFrame(192);
  4902. stream.writeWord(anInt1284);
  4903. stream.method431(i1 >> 14 & 0x7fff);
  4904. stream.method433(k + baseY);
  4905. stream.method431(anInt1283);
  4906. stream.method433(j + baseX);
  4907. stream.writeWord(anInt1285);
  4908. }
  4909. if (l == 511) {
  4910. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4911. myPlayer.smallX[0], false, j);
  4912. if (!flag2)
  4913. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4914. myPlayer.smallX[0], false, j);
  4915. crossX = super.saveClickX;
  4916. crossY = super.saveClickY;
  4917. crossType = 2;
  4918. crossIndex = 0;
  4919. stream.createFrame(25);
  4920. stream.method431(anInt1284);
  4921. stream.method432(anInt1285);
  4922. stream.writeWord(i1);
  4923. stream.method432(k + baseY);
  4924. stream.method433(anInt1283);
  4925. stream.writeWord(j + baseX);
  4926. }
  4927. if (l == 74) {
  4928. stream.createFrame(122);
  4929. stream.method433(k);
  4930. stream.method432(j);
  4931. stream.method431(i1);
  4932. atInventoryLoopCycle = 0;
  4933. atInventoryInterface = k;
  4934. atInventoryIndex = j;
  4935. atInventoryInterfaceType = 2;
  4936. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4937. atInventoryInterfaceType = 1;
  4938. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4939. atInventoryInterfaceType = 3;
  4940. }
  4941. if (l == 315) {
  4942. RSInterface class9 = RSInterface.interfaceCache[k];
  4943. boolean flag8 = true;
  4944. if (class9.contentType > 0)
  4945. flag8 = promptUserForInput(class9);
  4946. if (flag8) {
  4947.  
  4948. switch (k) {
  4949. case 15201:
  4950. openInterfaceID = 15106;
  4951. break;
  4952. case 36004:
  4953. toggleSize(0);
  4954. break;
  4955. case 36007:
  4956. toggleSize(1);
  4957. break;
  4958. case 36010:
  4959. toggleSize(2);
  4960. break;
  4961. case 19144:
  4962. sendFrame248(15106, 3213);
  4963. method60(15106);
  4964. inputTaken = true;
  4965. break;
  4966. case 29166:
  4967. class9.contentType = 1804;
  4968. break;
  4969. default:
  4970. stream.createFrame(185);
  4971. stream.writeWord(k);
  4972. break;
  4973.  
  4974. }
  4975. }
  4976. }
  4977. if (l == 561) {
  4978. Player player = playerArray[i1];
  4979. if (player != null) {
  4980. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4981. player.smallY[0], myPlayer.smallX[0], false,
  4982. player.smallX[0]);
  4983. crossX = super.saveClickX;
  4984. crossY = super.saveClickY;
  4985. crossType = 2;
  4986. crossIndex = 0;
  4987. anInt1188 += i1;
  4988. if (anInt1188 >= 90) {
  4989. stream.createFrame(136);
  4990. anInt1188 = 0;
  4991. }
  4992. stream.createFrame(128);
  4993. stream.writeWord(i1);
  4994. }
  4995. }
  4996. if (l == 20) {
  4997. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4998. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4999. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5000. class30_sub2_sub4_sub1_sub1_1.smallY[0],
  5001. myPlayer.smallX[0], false,
  5002. class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  5003. crossX = super.saveClickX;
  5004. crossY = super.saveClickY;
  5005. crossType = 2;
  5006. crossIndex = 0;
  5007. stream.createFrame(155);
  5008. stream.method431(i1);
  5009. }
  5010. }
  5011. if (l == 779) {
  5012. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  5013. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  5014. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5015. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  5016. myPlayer.smallX[0], false,
  5017. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  5018. crossX = super.saveClickX;
  5019. crossY = super.saveClickY;
  5020. crossType = 2;
  5021. crossIndex = 0;
  5022. stream.createFrame(153);
  5023. stream.method431(i1);
  5024. }
  5025. }
  5026. if (l == 519)
  5027. if (!menuOpen)
  5028. worldController.method312(super.saveClickY - 4,
  5029. super.saveClickX - 4);
  5030. else
  5031. worldController.method312(k - 4, j - 4);
  5032. if (l == 1062) {
  5033. anInt924 += baseX;
  5034. if (anInt924 >= 113) {
  5035. stream.createFrame(183);
  5036. stream.writeDWordBigEndian(0xe63271);
  5037. anInt924 = 0;
  5038. }
  5039. method66(i1, k, j);
  5040. stream.createFrame(228);
  5041. stream.method432(i1 >> 14 & 0x7fff);
  5042. stream.method432(k + baseY);
  5043. stream.writeWord(j + baseX);
  5044. }
  5045. if (l == 679 && !aBoolean1149) {
  5046. stream.createFrame(40);
  5047. stream.writeWord(k);
  5048. aBoolean1149 = true;
  5049. }
  5050. if (l == 431) {
  5051. stream.createFrame(129);
  5052. stream.method432(j);
  5053. stream.writeWord(k);
  5054. stream.method432(i1);
  5055. atInventoryLoopCycle = 0;
  5056. atInventoryInterface = k;
  5057. atInventoryIndex = j;
  5058. atInventoryInterfaceType = 2;
  5059. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5060. atInventoryInterfaceType = 1;
  5061. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5062. atInventoryInterfaceType = 3;
  5063. }
  5064. if (l == 337 || l == 42 || l == 792 || l == 322) {
  5065. String s = menuActionName[i];
  5066. int k1 = s.indexOf("@whi@");
  5067. if (k1 != -1) {
  5068. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  5069. if (l == 337)
  5070. addFriend(l3);
  5071. if (l == 42)
  5072. addIgnore(l3);
  5073. if (l == 792)
  5074. delFriend(l3);
  5075. if (l == 322)
  5076. delIgnore(l3);
  5077. }
  5078. }
  5079. if (l == 53) {
  5080. stream.createFrame(135);
  5081. stream.method431(j);
  5082. stream.method432(k);
  5083. stream.method431(i1);
  5084. atInventoryLoopCycle = 0;
  5085. atInventoryInterface = k;
  5086. atInventoryIndex = j;
  5087. atInventoryInterfaceType = 2;
  5088. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5089. atInventoryInterfaceType = 1;
  5090. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5091. atInventoryInterfaceType = 3;
  5092. }
  5093. if (l == 539) {
  5094. stream.createFrame(16);
  5095. stream.method432(i1);
  5096. stream.method433(j);
  5097. stream.method433(k);
  5098. atInventoryLoopCycle = 0;
  5099. atInventoryInterface = k;
  5100. atInventoryIndex = j;
  5101. atInventoryInterfaceType = 2;
  5102. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5103. atInventoryInterfaceType = 1;
  5104. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5105. atInventoryInterfaceType = 3;
  5106. }
  5107. if (l == 484 || l == 6) {
  5108. String s1 = menuActionName[i];
  5109. int l1 = s1.indexOf("@whi@");
  5110. if (l1 != -1) {
  5111. s1 = s1.substring(l1 + 5).trim();
  5112. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass
  5113. .longForName(s1)));
  5114. boolean flag9 = false;
  5115. for (int j3 = 0; j3 < playerCount; j3++) {
  5116. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  5117. if (class30_sub2_sub4_sub1_sub2_7 == null
  5118. || class30_sub2_sub4_sub1_sub2_7.name == null
  5119. || !class30_sub2_sub4_sub1_sub2_7.name
  5120. .equalsIgnoreCase(s7))
  5121. continue;
  5122. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5123. class30_sub2_sub4_sub1_sub2_7.smallY[0],
  5124. myPlayer.smallX[0], false,
  5125. class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  5126. if (l == 484) {
  5127. stream.createFrame(139);
  5128. stream.method431(playerIndices[j3]);
  5129. }
  5130. if (l == 6) {
  5131. anInt1188 += i1;
  5132. if (anInt1188 >= 90) {
  5133. stream.createFrame(136);
  5134. anInt1188 = 0;
  5135. }
  5136. stream.createFrame(128);
  5137. stream.writeWord(playerIndices[j3]);
  5138. }
  5139. flag9 = true;
  5140. break;
  5141. }
  5142.  
  5143. if (!flag9)
  5144. pushMessage("Unable to find " + s7, 0, "");
  5145. }
  5146. }
  5147. if (l == 870) {
  5148. stream.createFrame(53);
  5149. stream.writeWord(j);
  5150. stream.method432(anInt1283);
  5151. stream.method433(i1);
  5152. stream.writeWord(anInt1284);
  5153. stream.method431(anInt1285);
  5154. stream.writeWord(k);
  5155. atInventoryLoopCycle = 0;
  5156. atInventoryInterface = k;
  5157. atInventoryIndex = j;
  5158. atInventoryInterfaceType = 2;
  5159. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5160. atInventoryInterfaceType = 1;
  5161. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5162. atInventoryInterfaceType = 3;
  5163. }
  5164. if (l == 847) {
  5165. stream.createFrame(87);
  5166. stream.method432(i1);
  5167. stream.writeWord(k);
  5168. stream.method432(j);
  5169. atInventoryLoopCycle = 0;
  5170. atInventoryInterface = k;
  5171. atInventoryIndex = j;
  5172. atInventoryInterfaceType = 2;
  5173. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5174. atInventoryInterfaceType = 1;
  5175. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5176. atInventoryInterfaceType = 3;
  5177. }
  5178. if (l == 626) {
  5179. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5180. spellSelected = 1;
  5181. spellID = class9_1.id;
  5182. anInt1137 = k;
  5183. spellUsableOn = class9_1.spellUsableOn;
  5184. itemSelected = 0;
  5185. needDrawTabArea = true;
  5186. String s4 = class9_1.selectedActionName;
  5187. if (s4.indexOf(" ") != -1)
  5188. s4 = s4.substring(0, s4.indexOf(" "));
  5189. String s8 = class9_1.selectedActionName;
  5190. if (s8.indexOf(" ") != -1)
  5191. s8 = s8.substring(s8.indexOf(" ") + 1);
  5192. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  5193. if (spellUsableOn == 16) {
  5194. tabID = 3;
  5195. tabAreaAltered = true;
  5196. }
  5197. return;
  5198. }
  5199. if (l == 78) {
  5200. stream.createFrame(117);
  5201. stream.method433(k);
  5202. stream.method433(i1);
  5203. stream.method431(j);
  5204. atInventoryLoopCycle = 0;
  5205. atInventoryInterface = k;
  5206. atInventoryIndex = j;
  5207. atInventoryInterfaceType = 2;
  5208. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5209. atInventoryInterfaceType = 1;
  5210. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5211. atInventoryInterfaceType = 3;
  5212. }
  5213. if (l == 27) {
  5214. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  5215. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  5216. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5217. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  5218. myPlayer.smallX[0], false,
  5219. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  5220. crossX = super.saveClickX;
  5221. crossY = super.saveClickY;
  5222. crossType = 2;
  5223. crossIndex = 0;
  5224. anInt986 += i1;
  5225. if (anInt986 >= 54) {
  5226. stream.createFrame(189);
  5227. stream.writeWordBigEndian(234);
  5228. anInt986 = 0;
  5229. }
  5230. stream.createFrame(73);
  5231. stream.method431(i1);
  5232. }
  5233. }
  5234. if (l == 213) {
  5235. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5236. myPlayer.smallX[0], false, j);
  5237. if (!flag3)
  5238. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5239. myPlayer.smallX[0], false, j);
  5240. crossX = super.saveClickX;
  5241. crossY = super.saveClickY;
  5242. crossType = 2;
  5243. crossIndex = 0;
  5244. stream.createFrame(79);
  5245. stream.method431(k + baseY);
  5246. stream.writeWord(i1);
  5247. stream.method432(j + baseX);
  5248. }
  5249. if (l == 632) {
  5250. stream.createFrame(145);
  5251. stream.method432(k);
  5252. stream.method432(j);
  5253. stream.method432(i1);
  5254. atInventoryLoopCycle = 0;
  5255. atInventoryInterface = k;
  5256. atInventoryIndex = j;
  5257. atInventoryInterfaceType = 2;
  5258. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5259. atInventoryInterfaceType = 1;
  5260. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5261. atInventoryInterfaceType = 3;
  5262. }
  5263. if (l == 1506) { // Select quick prayers
  5264. stream.createFrame(185);
  5265. stream.writeWord(5001);
  5266. }
  5267. if (l == 1500) { // Toggle quick prayers
  5268. prayClicked = !prayClicked;
  5269. stream.createFrame(185);
  5270. stream.writeWord(5000);
  5271. }
  5272. if (l == 1050) {
  5273. int currentHP = Integer
  5274. .parseInt(RSInterface.interfaceCache[4016].message);
  5275. if (!(currentHP <= 0)) {
  5276. runClicked = !runClicked;
  5277. sendFrame36(429, runClicked ? 1 : 0);
  5278. stream.createFrame(185);
  5279. stream.writeWord(152);
  5280. }
  5281. }
  5282. if (menuActionName[i].contains("Toggle Run")) {
  5283. int currentHP = Integer
  5284. .parseInt(RSInterface.interfaceCache[4016].message);
  5285. if (!(currentHP <= 0)) {
  5286. runClicked = !runClicked;
  5287. sendFrame36(429, runClicked ? 0 : 1);
  5288. }
  5289. }
  5290. if (l == 1004) {
  5291. if (tabInterfaceIDs[10] != -1) {
  5292. needDrawTabArea = true;
  5293. tabID = 10;
  5294. tabAreaAltered = true;
  5295. }
  5296. }
  5297. if (l == 1003) {
  5298. clanChatMode = 2;
  5299. inputTaken = true;
  5300. }
  5301. if (l == 1002) {
  5302. clanChatMode = 1;
  5303. inputTaken = true;
  5304. }
  5305. if (l == 1001) {
  5306. clanChatMode = 0;
  5307. inputTaken = true;
  5308. }
  5309. if (l == 1000) {
  5310. cButtonCPos = 4;
  5311. chatTypeView = 11;
  5312. inputTaken = true;
  5313. }
  5314. if (l == 999) {
  5315. cButtonCPos = 0;
  5316. chatTypeView = 0;
  5317. inputTaken = true;
  5318. }
  5319. if (l == 998) {
  5320. cButtonCPos = 1;
  5321. chatTypeView = 5;
  5322. inputTaken = true;
  5323. }
  5324. if (l == 997) {
  5325. publicChatMode = 3;
  5326. inputTaken = true;
  5327. }
  5328. if (l == 996) {
  5329. publicChatMode = 2;
  5330. inputTaken = true;
  5331. }
  5332. if (l == 995) {
  5333. publicChatMode = 1;
  5334. inputTaken = true;
  5335. }
  5336. if (l == 994) {
  5337. publicChatMode = 0;
  5338. inputTaken = true;
  5339. }
  5340. if (l == 993) {
  5341. cButtonCPos = 2;
  5342. chatTypeView = 1;
  5343. inputTaken = true;
  5344. }
  5345. if (l == 992) {
  5346. privateChatMode = 2;
  5347. inputTaken = true;
  5348. }
  5349. if (l == 991) {
  5350. privateChatMode = 1;
  5351. inputTaken = true;
  5352. }
  5353. if (l == 990) {
  5354. privateChatMode = 0;
  5355. inputTaken = true;
  5356. }
  5357. if (l == 989) {
  5358. cButtonCPos = 3;
  5359. chatTypeView = 2;
  5360. inputTaken = true;
  5361. }
  5362. if (l == 987) {
  5363. tradeMode = 2;
  5364. inputTaken = true;
  5365. }
  5366. if (l == 986) {
  5367. tradeMode = 1;
  5368. inputTaken = true;
  5369. }
  5370. if (l == 985) {
  5371. tradeMode = 0;
  5372. inputTaken = true;
  5373. }
  5374. if (l == 984) {
  5375. cButtonCPos = 5;
  5376. chatTypeView = 3;
  5377. inputTaken = true;
  5378. }
  5379. if (l == 983) {
  5380. duelMode = 2;
  5381. inputTaken = true;
  5382. }
  5383. if (l == 982) {
  5384. duelMode = 1;
  5385. inputTaken = true;
  5386. }
  5387. if (l == 981) {
  5388. duelMode = 0;
  5389. inputTaken = true;
  5390. }
  5391. if (l == 980) {
  5392. cButtonCPos = 6;
  5393. chatTypeView = 4;
  5394. inputTaken = true;
  5395. }
  5396. if (l == 493) {
  5397. stream.createFrame(75);
  5398. stream.method433(k);
  5399. stream.method431(j);
  5400. stream.method432(i1);
  5401. atInventoryLoopCycle = 0;
  5402. atInventoryInterface = k;
  5403. atInventoryIndex = j;
  5404. atInventoryInterfaceType = 2;
  5405. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5406. atInventoryInterfaceType = 1;
  5407. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5408. atInventoryInterfaceType = 3;
  5409. }
  5410. if (l == 652) {
  5411. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5412. myPlayer.smallX[0], false, j);
  5413. if (!flag4)
  5414. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5415. myPlayer.smallX[0], false, j);
  5416. crossX = super.saveClickX;
  5417. crossY = super.saveClickY;
  5418. crossType = 2;
  5419. crossIndex = 0;
  5420. stream.createFrame(156);
  5421. stream.method432(j + baseX);
  5422. stream.method431(k + baseY);
  5423. stream.method433(i1);
  5424. }
  5425. if (l == 94) {
  5426. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5427. myPlayer.smallX[0], false, j);
  5428. if (!flag5)
  5429. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5430. myPlayer.smallX[0], false, j);
  5431. crossX = super.saveClickX;
  5432. crossY = super.saveClickY;
  5433. crossType = 2;
  5434. crossIndex = 0;
  5435. stream.createFrame(181);
  5436. stream.method431(k + baseY);
  5437. stream.writeWord(i1);
  5438. stream.method431(j + baseX);
  5439. stream.method432(anInt1137);
  5440. }
  5441. if (l == 646) {
  5442. stream.createFrame(185);
  5443. stream.writeWord(k);
  5444. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5445. if (class9_2.valueIndexArray != null
  5446. && class9_2.valueIndexArray[0][0] == 5) {
  5447. int i2 = class9_2.valueIndexArray[0][1];
  5448. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  5449. variousSettings[i2] = class9_2.anIntArray212[0];
  5450. method33(i2);
  5451. needDrawTabArea = true;
  5452. }
  5453. }
  5454. }
  5455. if (l == 225) {
  5456. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5457. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  5458. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5459. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  5460. myPlayer.smallX[0], false,
  5461. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  5462. crossX = super.saveClickX;
  5463. crossY = super.saveClickY;
  5464. crossType = 2;
  5465. crossIndex = 0;
  5466. anInt1226 += i1;
  5467. if (anInt1226 >= 85) {
  5468. stream.createFrame(230);
  5469. stream.writeWordBigEndian(239);
  5470. anInt1226 = 0;
  5471. }
  5472. stream.createFrame(17);
  5473. stream.method433(i1);
  5474. }
  5475. }
  5476. if (l == 965) {
  5477. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5478. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  5479. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5480. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  5481. myPlayer.smallX[0], false,
  5482. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  5483. crossX = super.saveClickX;
  5484. crossY = super.saveClickY;
  5485. crossType = 2;
  5486. crossIndex = 0;
  5487. anInt1134++;
  5488. if (anInt1134 >= 96) {
  5489. stream.createFrame(152);
  5490. stream.writeWordBigEndian(88);
  5491. anInt1134 = 0;
  5492. }
  5493. stream.createFrame(21);
  5494. stream.writeWord(i1);
  5495. }
  5496. }
  5497. if (l == 413) {
  5498. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5499. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  5500. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5501. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  5502. myPlayer.smallX[0], false,
  5503. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  5504. crossX = super.saveClickX;
  5505. crossY = super.saveClickY;
  5506. crossType = 2;
  5507. crossIndex = 0;
  5508. stream.createFrame(131);
  5509. stream.method433(i1);
  5510. stream.method432(anInt1137);
  5511. }
  5512. }
  5513. if (l == 200)
  5514. clearTopInterfaces();
  5515. if (l == 1025) {
  5516. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5517. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  5518. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5519. if (entityDef.childrenIDs != null)
  5520. entityDef = entityDef.method161();
  5521. if (entityDef != null) {
  5522. String s9;
  5523. if (entityDef.description != null)
  5524. s9 = new String(entityDef.description);
  5525. else
  5526. s9 = "It's a " + entityDef.name + ".";
  5527. pushMessage(s9, 0, "");
  5528. }
  5529. }
  5530. }
  5531. if (l == 900) {
  5532. method66(i1, k, j);
  5533. stream.createFrame(252);
  5534. stream.method433(i1 >> 14 & 0x7fff);
  5535. stream.method431(k + baseY);
  5536. stream.method432(j + baseX);
  5537. }
  5538. if (l == 412) {
  5539. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5540. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  5541. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5542. class30_sub2_sub4_sub1_sub1_6.smallY[0],
  5543. myPlayer.smallX[0], false,
  5544. class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  5545. crossX = super.saveClickX;
  5546. crossY = super.saveClickY;
  5547. crossType = 2;
  5548. crossIndex = 0;
  5549. stream.createFrame(72);
  5550. stream.method432(i1);
  5551. }
  5552. }
  5553. if (l == 365) {
  5554. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5555. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  5556. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5557. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  5558. myPlayer.smallX[0], false,
  5559. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  5560. crossX = super.saveClickX;
  5561. crossY = super.saveClickY;
  5562. crossType = 2;
  5563. crossIndex = 0;
  5564. stream.createFrame(249);
  5565. stream.method432(i1);
  5566. stream.method431(anInt1137);
  5567. }
  5568. }
  5569. if (l == 729) {
  5570. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5571. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  5572. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5573. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  5574. myPlayer.smallX[0], false,
  5575. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  5576. crossX = super.saveClickX;
  5577. crossY = super.saveClickY;
  5578. crossType = 2;
  5579. crossIndex = 0;
  5580. stream.createFrame(39);
  5581. stream.method431(i1);
  5582. }
  5583. }
  5584. if (l == 577) {
  5585. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5586. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  5587. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5588. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  5589. myPlayer.smallX[0], false,
  5590. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  5591. crossX = super.saveClickX;
  5592. crossY = super.saveClickY;
  5593. crossType = 2;
  5594. crossIndex = 0;
  5595. stream.createFrame(139);
  5596. stream.method431(i1);
  5597. }
  5598. }
  5599. if (l == 956 && method66(i1, k, j)) {
  5600. stream.createFrame(35);
  5601. stream.method431(j + baseX);
  5602. stream.method432(anInt1137);
  5603. stream.method432(k + baseY);
  5604. stream.method431(i1 >> 14 & 0x7fff);
  5605. }
  5606. if (l == 567) {
  5607. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5608. myPlayer.smallX[0], false, j);
  5609. if (!flag6)
  5610. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5611. myPlayer.smallX[0], false, j);
  5612. crossX = super.saveClickX;
  5613. crossY = super.saveClickY;
  5614. crossType = 2;
  5615. crossIndex = 0;
  5616. stream.createFrame(23);
  5617. stream.method431(k + baseY);
  5618. stream.method431(i1);
  5619. stream.method431(j + baseX);
  5620. }
  5621. if (l == 867) {
  5622. if ((i1 & 3) == 0)
  5623. anInt1175++;
  5624. if (anInt1175 >= 59) {
  5625. stream.createFrame(200);
  5626. stream.writeWord(25501);
  5627. anInt1175 = 0;
  5628. }
  5629. stream.createFrame(43);
  5630. stream.method431(k);
  5631. stream.method432(i1);
  5632. stream.method432(j);
  5633. atInventoryLoopCycle = 0;
  5634. atInventoryInterface = k;
  5635. atInventoryIndex = j;
  5636. atInventoryInterfaceType = 2;
  5637. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5638. atInventoryInterfaceType = 1;
  5639. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5640. atInventoryInterfaceType = 3;
  5641. }
  5642. if (l == 543) {
  5643. stream.createFrame(237);
  5644. stream.writeWord(j);
  5645. stream.method432(i1);
  5646. stream.writeWord(k);
  5647. stream.method432(anInt1137);
  5648. atInventoryLoopCycle = 0;
  5649. atInventoryInterface = k;
  5650. atInventoryIndex = j;
  5651. atInventoryInterfaceType = 2;
  5652. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5653. atInventoryInterfaceType = 1;
  5654. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5655. atInventoryInterfaceType = 3;
  5656. }
  5657. if (l == 606) {
  5658. String s2 = menuActionName[i];
  5659. int j2 = s2.indexOf("@whi@");
  5660. if (j2 != -1)
  5661. if (openInterfaceID == -1) {
  5662. clearTopInterfaces();
  5663. reportAbuseInput = s2.substring(j2 + 5).trim();
  5664. canMute = false;
  5665. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  5666. if (RSInterface.interfaceCache[i3] == null
  5667. || RSInterface.interfaceCache[i3].contentType != 600)
  5668. continue;
  5669. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5670. break;
  5671. }
  5672.  
  5673. } else {
  5674. pushMessage(
  5675. "Please close the interface you have open before using 'report abuse'",
  5676. 0, "");
  5677. }
  5678. }
  5679. if (l == 491) {
  5680. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5681. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  5682. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5683. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  5684. myPlayer.smallX[0], false,
  5685. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  5686. crossX = super.saveClickX;
  5687. crossY = super.saveClickY;
  5688. crossType = 2;
  5689. crossIndex = 0;
  5690. stream.createFrame(14);
  5691. stream.method432(anInt1284);
  5692. stream.writeWord(i1);
  5693. stream.writeWord(anInt1285);
  5694. stream.method431(anInt1283);
  5695. }
  5696. }
  5697. if (l == 639) {
  5698. String s3 = menuActionName[i];
  5699. int k2 = s3.indexOf("@whi@");
  5700. if (k2 != -1) {
  5701. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5702. int k3 = -1;
  5703. for (int i4 = 0; i4 < friendsCount; i4++) {
  5704. if (friendsListAsLongs[i4] != l4)
  5705. continue;
  5706. k3 = i4;
  5707. break;
  5708. }
  5709.  
  5710. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  5711. inputTaken = true;
  5712. inputDialogState = 0;
  5713. messagePromptRaised = true;
  5714. promptInput = "";
  5715. friendsListAction = 3;
  5716. aLong953 = friendsListAsLongs[k3];
  5717. aString1121 = "Enter message to send to " + friendsList[k3];
  5718. }
  5719. }
  5720. }
  5721. if (l == 454) {
  5722. stream.createFrame(41);
  5723. stream.writeWord(i1);
  5724. stream.method432(j);
  5725. stream.method432(k);
  5726. atInventoryLoopCycle = 0;
  5727. atInventoryInterface = k;
  5728. atInventoryIndex = j;
  5729. atInventoryInterfaceType = 2;
  5730. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5731. atInventoryInterfaceType = 1;
  5732. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5733. atInventoryInterfaceType = 3;
  5734. }
  5735. if (l == 478) {
  5736. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5737. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  5738. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5739. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  5740. myPlayer.smallX[0], false,
  5741. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  5742. crossX = super.saveClickX;
  5743. crossY = super.saveClickY;
  5744. crossType = 2;
  5745. crossIndex = 0;
  5746. if ((i1 & 3) == 0)
  5747. anInt1155++;
  5748. if (anInt1155 >= 53) {
  5749. stream.createFrame(85);
  5750. stream.writeWordBigEndian(66);
  5751. anInt1155 = 0;
  5752. }
  5753. stream.createFrame(18);
  5754. stream.method431(i1);
  5755. }
  5756. }
  5757. if (l == 113) {
  5758. method66(i1, k, j);
  5759. stream.createFrame(70);
  5760. stream.method431(j + baseX);
  5761. stream.writeWord(k + baseY);
  5762. stream.method433(i1 >> 14 & 0x7fff);
  5763. }
  5764. if (l == 872) {
  5765. method66(i1, k, j);
  5766. stream.createFrame(234);
  5767. stream.method433(j + baseX);
  5768. stream.method432(i1 >> 14 & 0x7fff);
  5769. stream.method433(k + baseY);
  5770. }
  5771. if (l == 502) {
  5772. method66(i1, k, j);
  5773. stream.createFrame(132);
  5774. stream.method433(j + baseX);
  5775. stream.writeWord(i1 >> 14 & 0x7fff);
  5776. stream.method432(k + baseY);
  5777. }
  5778. if (l == 1125) {
  5779. ItemDef itemDef = ItemDef.forID(i1);
  5780. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5781. String s5;
  5782. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5783. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5784. else if (itemDef.description != null)
  5785. s5 = new String(itemDef.description);
  5786. else
  5787. s5 = "It's a " + itemDef.name + ".";
  5788. pushMessage(s5, 0, "");
  5789. }
  5790. if (l == 169) {
  5791. stream.createFrame(185);
  5792. stream.writeWord(k);
  5793. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5794. if (class9_3.valueIndexArray != null
  5795. && class9_3.valueIndexArray[0][0] == 5) {
  5796. int l2 = class9_3.valueIndexArray[0][1];
  5797. variousSettings[l2] = 1 - variousSettings[l2];
  5798. method33(l2);
  5799. needDrawTabArea = true;
  5800. }
  5801. }
  5802. if (l == 447) {
  5803. itemSelected = 1;
  5804. anInt1283 = j;
  5805. anInt1284 = k;
  5806. anInt1285 = i1;
  5807. selectedItemName = ItemDef.forID(i1).name;
  5808. spellSelected = 0;
  5809. needDrawTabArea = true;
  5810. return;
  5811. }
  5812. if (l == 1226) {
  5813. int j1 = i1 >> 14 & 0x7fff;
  5814. ObjectDef class46 = ObjectDef.forID(j1);
  5815. String s10;
  5816. if (class46.description != null)
  5817. s10 = new String(class46.description);
  5818. else
  5819. s10 = "It's a " + class46.name + ".";
  5820. pushMessage(s10, 0, "");
  5821. }
  5822. if (l == 244) {
  5823. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5824. myPlayer.smallX[0], false, j);
  5825. if (!flag7)
  5826. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5827. myPlayer.smallX[0], false, j);
  5828. crossX = super.saveClickX;
  5829. crossY = super.saveClickY;
  5830. crossType = 2;
  5831. crossIndex = 0;
  5832. stream.createFrame(253);
  5833. stream.method431(j + baseX);
  5834. stream.method433(k + baseY);
  5835. stream.method432(i1);
  5836. }
  5837. if (l == 1448) {
  5838. ItemDef itemDef_1 = ItemDef.forID(i1);
  5839. String s6;
  5840. if (itemDef_1.description != null)
  5841. s6 = new String(itemDef_1.description);
  5842. else
  5843. s6 = "It's a " + itemDef_1.name + ".";
  5844. pushMessage(s6, 0, "");
  5845. }
  5846. itemSelected = 0;
  5847. spellSelected = 0;
  5848. needDrawTabArea = true;
  5849.  
  5850. }
  5851.  
  5852. private void method70() {
  5853. anInt1251 = 0;
  5854. int j = (myPlayer.x >> 7) + baseX;
  5855. int k = (myPlayer.y >> 7) + baseY;
  5856. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5857. anInt1251 = 1;
  5858. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5859. anInt1251 = 1;
  5860. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5861. anInt1251 = 0;
  5862. }
  5863.  
  5864. public void run() {
  5865. if (drawFlames) {
  5866. drawFlames();
  5867. } else {
  5868. super.run();
  5869. }
  5870. }
  5871.  
  5872. private void build3dScreenMenu() {
  5873. if (itemSelected == 0 && spellSelected == 0) {
  5874. menuActionName[menuActionRow] = "Walk here";
  5875. menuActionID[menuActionRow] = 519;
  5876. menuActionCmd2[menuActionRow] = super.mouseX;
  5877. menuActionCmd3[menuActionRow] = super.mouseY;
  5878. menuActionRow++;
  5879. }
  5880. int j = -1;
  5881. for (int k = 0; k < Model.anInt1687; k++) {
  5882. int l = Model.anIntArray1688[k];
  5883. int i1 = l & 0x7f;
  5884. int j1 = l >> 7 & 0x7f;
  5885. int k1 = l >> 29 & 3;
  5886. int l1 = l >> 14 & 0x7fff;
  5887. if (l == j)
  5888. continue;
  5889. j = l;
  5890. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5891. ObjectDef class46 = ObjectDef.forID(l1);
  5892. if (class46.childrenIDs != null)
  5893. class46 = class46.method580();
  5894. if (class46 == null)
  5895. continue;
  5896. if (itemSelected == 1) {
  5897. menuActionName[menuActionRow] = "Use " + selectedItemName
  5898. + " with @cya@" + class46.name;
  5899. menuActionID[menuActionRow] = 62;
  5900. menuActionCmd1[menuActionRow] = l;
  5901. menuActionCmd2[menuActionRow] = i1;
  5902. menuActionCmd3[menuActionRow] = j1;
  5903. menuActionRow++;
  5904. } else if (spellSelected == 1) {
  5905. if ((spellUsableOn & 4) == 4) {
  5906. menuActionName[menuActionRow] = spellTooltip + " @cya@"
  5907. + class46.name;
  5908. menuActionID[menuActionRow] = 956;
  5909. menuActionCmd1[menuActionRow] = l;
  5910. menuActionCmd2[menuActionRow] = i1;
  5911. menuActionCmd3[menuActionRow] = j1;
  5912. menuActionRow++;
  5913. }
  5914. } else {
  5915. if (class46.actions != null) {
  5916. for (int i2 = 4; i2 >= 0; i2--)
  5917. if (class46.actions[i2] != null) {
  5918. menuActionName[menuActionRow] = class46.actions[i2]
  5919. + " @cya@" + class46.name;
  5920. if (i2 == 0)
  5921. menuActionID[menuActionRow] = 502;
  5922. if (i2 == 1)
  5923. menuActionID[menuActionRow] = 900;
  5924. if (i2 == 2)
  5925. menuActionID[menuActionRow] = 113;
  5926. if (i2 == 3)
  5927. menuActionID[menuActionRow] = 872;
  5928. if (i2 == 4)
  5929. menuActionID[menuActionRow] = 1062;
  5930. menuActionCmd1[menuActionRow] = l;
  5931. menuActionCmd2[menuActionRow] = i1;
  5932. menuActionCmd3[menuActionRow] = j1;
  5933. menuActionRow++;
  5934. }
  5935.  
  5936. menuActionName[menuActionRow] = "Examine @cya@"
  5937. + class46.name;
  5938. menuActionID[menuActionRow] = 1226;
  5939. menuActionCmd1[menuActionRow] = class46.type << 14;
  5940. menuActionCmd2[menuActionRow] = i1;
  5941. menuActionCmd3[menuActionRow] = j1;
  5942. menuActionRow++;
  5943. }
  5944. // menuActionName[menuActionRow] = "Examine @cya@" +
  5945. // class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" +
  5946. // (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  5947. }
  5948. }
  5949. if (k1 == 1) {
  5950. NPC npc = npcArray[l1];
  5951. try {
  5952. if (npc.desc.size == 1 && (npc.x & 0x7f) == 64
  5953. && (npc.y & 0x7f) == 64) {
  5954. for (int j2 = 0; j2 < npcCount; j2++) {
  5955. NPC npc2 = npcArray[npcIndices[j2]];
  5956. if (npc2 != null && npc2 != npc
  5957. && npc2.desc.size == 1 && npc2.x == npc.x
  5958. && npc2.y == npc.y)
  5959. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1,
  5960. i1);
  5961. }
  5962. for (int l2 = 0; l2 < playerCount; l2++) {
  5963. Player player = playerArray[playerIndices[l2]];
  5964. if (player != null && player.x == npc.x
  5965. && player.y == npc.y)
  5966. buildAtPlayerMenu(i1, playerIndices[l2],
  5967. player, j1);
  5968. }
  5969. }
  5970. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5971. } catch (Exception e) {
  5972. }
  5973. }
  5974. if (k1 == 0) {
  5975. Player player = playerArray[l1];
  5976. if (player != null) {
  5977. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  5978. for (int k2 = 0; k2 < npcCount; k2++) {
  5979. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5980. if (class30_sub2_sub4_sub1_sub1_2 != null
  5981. && class30_sub2_sub4_sub1_sub1_2.desc.size == 1
  5982. && class30_sub2_sub4_sub1_sub1_2.x == player.x
  5983. && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  5984. buildAtNPCMenu(
  5985. class30_sub2_sub4_sub1_sub1_2.desc,
  5986. npcIndices[k2], j1, i1);
  5987. }
  5988.  
  5989. for (int i3 = 0; i3 < playerCount; i3++) {
  5990. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5991. if (class30_sub2_sub4_sub1_sub2_2 != null
  5992. && class30_sub2_sub4_sub1_sub2_2 != player
  5993. && class30_sub2_sub4_sub1_sub2_2.x == player.x
  5994. && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  5995. buildAtPlayerMenu(i1, playerIndices[i3],
  5996. class30_sub2_sub4_sub1_sub2_2, j1);
  5997. }
  5998.  
  5999. }
  6000. buildAtPlayerMenu(i1, l1, player, j1);
  6001. }
  6002. }
  6003. if (k1 == 3) {
  6004. NodeList class19 = groundArray[plane][i1][j1];
  6005. if (class19 != null) {
  6006. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19
  6007. .getNext()) {
  6008. ItemDef itemDef = ItemDef.forID(item.ID);
  6009. if (itemSelected == 1) {
  6010. menuActionName[menuActionRow] = "Use "
  6011. + selectedItemName + " with @lre@"
  6012. + itemDef.name;
  6013. menuActionID[menuActionRow] = 511;
  6014. menuActionCmd1[menuActionRow] = item.ID;
  6015. menuActionCmd2[menuActionRow] = i1;
  6016. menuActionCmd3[menuActionRow] = j1;
  6017. menuActionRow++;
  6018. } else if (spellSelected == 1) {
  6019. if ((spellUsableOn & 1) == 1) {
  6020. menuActionName[menuActionRow] = spellTooltip
  6021. + " @lre@" + itemDef.name;
  6022. menuActionID[menuActionRow] = 94;
  6023. menuActionCmd1[menuActionRow] = item.ID;
  6024. menuActionCmd2[menuActionRow] = i1;
  6025. menuActionCmd3[menuActionRow] = j1;
  6026. menuActionRow++;
  6027. }
  6028. } else {
  6029. for (int j3 = 4; j3 >= 0; j3--)
  6030. if (itemDef.groundActions != null
  6031. && itemDef.groundActions[j3] != null) {
  6032. menuActionName[menuActionRow] = itemDef.groundActions[j3]
  6033. + " @lre@" + itemDef.name;
  6034. if (j3 == 0)
  6035. menuActionID[menuActionRow] = 652;
  6036. if (j3 == 1)
  6037. menuActionID[menuActionRow] = 567;
  6038. if (j3 == 2)
  6039. menuActionID[menuActionRow] = 234;
  6040. if (j3 == 3)
  6041. menuActionID[menuActionRow] = 244;
  6042. if (j3 == 4)
  6043. menuActionID[menuActionRow] = 213;
  6044. menuActionCmd1[menuActionRow] = item.ID;
  6045. menuActionCmd2[menuActionRow] = i1;
  6046. menuActionCmd3[menuActionRow] = j1;
  6047. menuActionRow++;
  6048. } else if (j3 == 2) {
  6049. menuActionName[menuActionRow] = "Take @lre@"
  6050. + itemDef.name;
  6051. menuActionID[menuActionRow] = 234;
  6052. menuActionCmd1[menuActionRow] = item.ID;
  6053. menuActionCmd2[menuActionRow] = i1;
  6054. menuActionCmd3[menuActionRow] = j1;
  6055. menuActionRow++;
  6056. }
  6057. menuActionName[menuActionRow] = "Examine @lre@"
  6058. + itemDef.name;
  6059. menuActionID[menuActionRow] = 1448;
  6060. menuActionCmd1[menuActionRow] = item.ID;
  6061. menuActionCmd2[menuActionRow] = i1;
  6062. menuActionCmd3[menuActionRow] = j1;
  6063. menuActionRow++;
  6064. }
  6065. }
  6066.  
  6067. }
  6068. }
  6069. }
  6070. }
  6071.  
  6072. public void cleanUpForQuit() {
  6073. Signlink.reporterror = false;
  6074. try {
  6075. if (socketStream != null) {
  6076. socketStream.close();
  6077. }
  6078. } catch (Exception _ex) {
  6079. }
  6080. socketStream = null;
  6081. stopMidi();
  6082. if (mouseDetection != null)
  6083. mouseDetection.running = false;
  6084. mouseDetection = null;
  6085. onDemandFetcher.disable();
  6086. onDemandFetcher = null;
  6087. aStream_834 = null;
  6088. stream = null;
  6089. aStream_847 = null;
  6090. inStream = null;
  6091. anIntArray1234 = null;
  6092. aByteArrayArray1183 = null;
  6093. aByteArrayArray1247 = null;
  6094. anIntArray1235 = null;
  6095. anIntArray1236 = null;
  6096. intGroundArray = null;
  6097. byteGroundArray = null;
  6098. worldController = null;
  6099. aClass11Array1230 = null;
  6100. anIntArrayArray901 = null;
  6101. anIntArrayArray825 = null;
  6102. bigX = null;
  6103. bigY = null;
  6104. aByteArray912 = null;
  6105. aRSImageProducer_1163 = null;
  6106. mapEdgeIP = null;
  6107. leftFrame = null;
  6108. topFrame = null;
  6109. aRSImageProducer_1164 = null;
  6110. aRSImageProducer_1165 = null;
  6111. aRSImageProducer_1166 = null;
  6112. aRSImageProducer_1123 = null;
  6113. aRSImageProducer_1124 = null;
  6114. aRSImageProducer_1125 = null;
  6115. /* Null pointers for custom sprites */
  6116. cacheSprite = null;
  6117. cacheSprite2 = null;
  6118. mapBack = null;
  6119. sideIcons = null;
  6120. compass = null;
  6121. hitMarks = null;
  6122. headIcons = null;
  6123. skullIcons = null;
  6124. headIconsHint = null;
  6125. crosses = null;
  6126. mapDotItem = null;
  6127. mapDotNPC = null;
  6128. mapDotPlayer = null;
  6129. mapDotFriend = null;
  6130. mapDotTeam = null;
  6131. mapScenes = null;
  6132. mapFunctions = null;
  6133. anIntArrayArray929 = null;
  6134. playerArray = null;
  6135. playerIndices = null;
  6136. anIntArray894 = null;
  6137. aStreamArray895s = null;
  6138. anIntArray840 = null;
  6139. npcArray = null;
  6140. npcIndices = null;
  6141. groundArray = null;
  6142. aClass19_1179 = null;
  6143. aClass19_1013 = null;
  6144. aClass19_1056 = null;
  6145. menuActionCmd2 = null;
  6146. menuActionCmd3 = null;
  6147. menuActionID = null;
  6148. menuActionCmd1 = null;
  6149. menuActionName = null;
  6150. variousSettings = null;
  6151. anIntArray1072 = null;
  6152. anIntArray1073 = null;
  6153. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  6154. minimapImage = null;
  6155. friendsList = null;
  6156. friendsListAsLongs = null;
  6157. friendsNodeIDs = null;
  6158. aRSImageProducer_1110 = null;
  6159. aRSImageProducer_1111 = null;
  6160. aRSImageProducer_1107 = null;
  6161. aRSImageProducer_1108 = null;
  6162. aRSImageProducer_1109 = null;
  6163. aRSImageProducer_1112 = null;
  6164. aRSImageProducer_1113 = null;
  6165. aRSImageProducer_1114 = null;
  6166. aRSImageProducer_1115 = null;
  6167. multiOverlay = null;
  6168. nullLoader();
  6169. ObjectDef.nullLoader();
  6170. EntityDef.nullLoader();
  6171. ItemDef.nullLoader();
  6172. Flo.cache = null;
  6173. IDK.cache = null;
  6174. RSInterface.interfaceCache = null;
  6175. Animation.anims = null;
  6176. SpotAnim.cache = null;
  6177. SpotAnim.aMRUNodes_415 = null;
  6178. Varp.cache = null;
  6179. super.fullGameScreen = null;
  6180. Player.mruNodes = null;
  6181. Texture.nullLoader();
  6182. WorldController.nullLoader();
  6183. Model.nullLoader();
  6184. Class36.nullLoader();
  6185. System.gc();
  6186. }
  6187.  
  6188. Component getGameComponent() {
  6189. if (Signlink.mainapp != null)
  6190. return Signlink.mainapp;
  6191. if (super.gameFrame != null)
  6192. return super.gameFrame;
  6193. else
  6194. return this;
  6195. }
  6196.  
  6197. private void method73() {
  6198. do {
  6199. int j = readChar(-796);
  6200. if (j == -1)
  6201. break;
  6202. if (openInterfaceID != -1
  6203. && openInterfaceID == reportAbuseInterfaceID) {
  6204. if (j == 8 && reportAbuseInput.length() > 0)
  6205. reportAbuseInput = reportAbuseInput.substring(0,
  6206. reportAbuseInput.length() - 1);
  6207. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48
  6208. && j <= 57 || j == 32)
  6209. && reportAbuseInput.length() < 12)
  6210. reportAbuseInput += (char) j;
  6211. } else if (messagePromptRaised) {
  6212. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  6213. promptInput += (char) j;
  6214. inputTaken = true;
  6215. }
  6216. if (j == 8 && promptInput.length() > 0) {
  6217. promptInput = promptInput.substring(0,
  6218. promptInput.length() - 1);
  6219. inputTaken = true;
  6220. }
  6221. if (j == 13 || j == 10) {
  6222. messagePromptRaised = false;
  6223. inputTaken = true;
  6224. if (friendsListAction == 1) {
  6225. long l = TextClass.longForName(promptInput);
  6226. addFriend(l);
  6227. }
  6228. if (friendsListAction == 2 && friendsCount > 0) {
  6229. long l1 = TextClass.longForName(promptInput);
  6230. delFriend(l1);
  6231. }
  6232. if (friendsListAction == 3 && promptInput.length() > 0) {
  6233. stream.createFrame(126);
  6234. stream.writeWordBigEndian(0);
  6235. int k = stream.currentOffset;
  6236. stream.writeQWord(aLong953);
  6237. TextInput.method526(promptInput, stream);
  6238. stream.writeBytes(stream.currentOffset - k);
  6239. promptInput = TextInput.processText(promptInput);
  6240. // promptInput = Censor.doCensor(promptInput);
  6241. pushMessage(promptInput, 6, TextClass.fixName(TextClass
  6242. .nameForLong(aLong953)));
  6243. if (privateChatMode == 2) {
  6244. privateChatMode = 1;
  6245. stream.createFrame(95);
  6246. stream.writeWordBigEndian(publicChatMode);
  6247. stream.writeWordBigEndian(privateChatMode);
  6248. stream.writeWordBigEndian(tradeMode);
  6249. }
  6250. }
  6251. if (friendsListAction == 4 && ignoreCount < 100) {
  6252. long l2 = TextClass.longForName(promptInput);
  6253. addIgnore(l2);
  6254. }
  6255. if (friendsListAction == 5 && ignoreCount > 0) {
  6256. long l3 = TextClass.longForName(promptInput);
  6257. delIgnore(l3);
  6258. }
  6259. if (friendsListAction == 6) {
  6260. long l3 = TextClass.longForName(promptInput);
  6261. chatJoin(l3);
  6262. }
  6263. }
  6264. } else if (inputDialogState == 1) {
  6265. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6266. amountOrNameInput += (char) j;
  6267. inputTaken = true;
  6268. }
  6269. if (j == 8 && amountOrNameInput.length() > 0) {
  6270. amountOrNameInput = amountOrNameInput.substring(0,
  6271. amountOrNameInput.length() - 1);
  6272. inputTaken = true;
  6273. }
  6274. if (j == 13 || j == 10) {
  6275. if (amountOrNameInput.length() > 0) {
  6276. int i1 = 0;
  6277. try {
  6278. i1 = Integer.parseInt(amountOrNameInput);
  6279. } catch (Exception _ex) {
  6280. }
  6281. stream.createFrame(208);
  6282. stream.writeDWord(i1);
  6283. }
  6284. inputDialogState = 0;
  6285. inputTaken = true;
  6286. }
  6287. } else if (inputDialogState == 2) {
  6288. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6289. amountOrNameInput += (char) j;
  6290. inputTaken = true;
  6291. }
  6292. if (j == 8 && amountOrNameInput.length() > 0) {
  6293. amountOrNameInput = amountOrNameInput.substring(0,
  6294. amountOrNameInput.length() - 1);
  6295. inputTaken = true;
  6296. }
  6297. if (j == 13 || j == 10) {
  6298. if (amountOrNameInput.length() > 0) {
  6299. stream.createFrame(60);
  6300. stream.writeQWord(TextClass
  6301. .longForName(amountOrNameInput));
  6302. }
  6303. inputDialogState = 0;
  6304. inputTaken = true;
  6305. }
  6306. } else if (backDialogID == -1) {
  6307. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  6308. inputString += (char) j;
  6309. inputTaken = true;
  6310. }
  6311. if (j == 8 && inputString.length() > 0) {
  6312. inputString = inputString.substring(0,
  6313. inputString.length() - 1);
  6314. inputTaken = true;
  6315. }
  6316. if (j == 9)
  6317. tabToReplyPm();
  6318. if ((j == 13 || j == 10) && inputString.length() > 0) {
  6319. if (inputString.startsWith("//setspecto")) {
  6320. int amt = Integer.parseInt(inputString.substring(12));
  6321. anIntArray1045[300] = amt;
  6322. if (variousSettings[300] != amt) {
  6323. variousSettings[300] = amt;
  6324. method33(300);
  6325. needDrawTabArea = true;
  6326. if (dialogID != -1)
  6327. inputTaken = true;
  6328. }
  6329. }
  6330.  
  6331. if (inputString.equals("::maps"))
  6332. packMaps();
  6333.  
  6334. if (inputString.equals("::models"))
  6335. packModels();
  6336.  
  6337. if (inputString.equals("::regular"))
  6338. toggleSize(0);
  6339. if (inputString.equals("::resize"))
  6340. toggleSize(1);
  6341. if (inputString.equals("::fullscreen"))
  6342. toggleSize(2);
  6343.  
  6344. if (inputString.equalsIgnoreCase("::hs")) {
  6345. launchURL("http://ownxile.com/index.php?page=hs");
  6346. }
  6347. if (inputString.equalsIgnoreCase("::counter")) {
  6348. this.counterOn = !counterOn;
  6349. }
  6350. if (inputString.equalsIgnoreCase("::fog")) {
  6351. this.fog = !fog;
  6352. }
  6353. if (inputString.equalsIgnoreCase("::forum")) {
  6354. launchURL("http://ownxile.com/index.php?action=forum");
  6355. }
  6356. if (inputString.equalsIgnoreCase("::donate")) {
  6357. launchURL("http://ownxile.com/index.php?page=donate");
  6358. }
  6359. if (inputString.equalsIgnoreCase("::vote")) {
  6360. launchURL("http://ownxile.com/index.php?page=vote");
  6361. }
  6362. if (inputString.equalsIgnoreCase("::guides")) {
  6363. launchURL("http://ownxile.com/index.php?board=11.0");
  6364. }
  6365. if (inputString.equalsIgnoreCase("::wiki")) {
  6366. launchURL("http://ownxile.com/wiki");
  6367. }
  6368. if (inputString.equals("::fpson"))
  6369. fpsOn = true;
  6370. if (inputString.equals("::fpsoff"))
  6371. fpsOn = false;
  6372. if (inputString.equals("::dataon"))
  6373. clientData = true;
  6374. if (inputString.equals("::dataoff"))
  6375. clientData = false;
  6376. if (inputString.startsWith("/"))
  6377. inputString = "::" + inputString;
  6378. if (inputString.startsWith("::")) {
  6379. stream.createFrame(103);
  6380. stream.writeWordBigEndian(inputString.length() - 1);
  6381. stream.writeString(inputString.substring(2));
  6382. } else {
  6383. String s = inputString.toLowerCase();
  6384. int j2 = 0;
  6385. if (s.startsWith("yellow:")) {
  6386. j2 = 0;
  6387. inputString = inputString.substring(7);
  6388. } else if (s.startsWith("red:")) {
  6389. j2 = 1;
  6390. inputString = inputString.substring(4);
  6391. } else if (s.startsWith("green:")) {
  6392. j2 = 2;
  6393. inputString = inputString.substring(6);
  6394. } else if (s.startsWith("cyan:")) {
  6395. j2 = 3;
  6396. inputString = inputString.substring(5);
  6397. } else if (s.startsWith("purple:")) {
  6398. j2 = 4;
  6399. inputString = inputString.substring(7);
  6400. } else if (s.startsWith("white:")) {
  6401. j2 = 5;
  6402. inputString = inputString.substring(6);
  6403. } else if (s.startsWith("flash1:")) {
  6404. j2 = 6;
  6405. inputString = inputString.substring(7);
  6406. } else if (s.startsWith("flash2:")) {
  6407. j2 = 7;
  6408. inputString = inputString.substring(7);
  6409. } else if (s.startsWith("flash3:")) {
  6410. j2 = 8;
  6411. inputString = inputString.substring(7);
  6412. } else if (s.startsWith("glow1:")) {
  6413. j2 = 9;
  6414. inputString = inputString.substring(6);
  6415. } else if (s.startsWith("glow2:")) {
  6416. j2 = 10;
  6417. inputString = inputString.substring(6);
  6418. } else if (s.startsWith("glow3:")) {
  6419. j2 = 11;
  6420. inputString = inputString.substring(6);
  6421. }
  6422. s = inputString.toLowerCase();
  6423. int i3 = 0;
  6424. if (s.startsWith("wave:")) {
  6425. i3 = 1;
  6426. inputString = inputString.substring(5);
  6427. } else if (s.startsWith("wave2:")) {
  6428. i3 = 2;
  6429. inputString = inputString.substring(6);
  6430. } else if (s.startsWith("shake:")) {
  6431. i3 = 3;
  6432. inputString = inputString.substring(6);
  6433. } else if (s.startsWith("scroll:")) {
  6434. i3 = 4;
  6435. inputString = inputString.substring(7);
  6436. } else if (s.startsWith("slide:")) {
  6437. i3 = 5;
  6438. inputString = inputString.substring(6);
  6439. }
  6440. stream.createFrame(4);
  6441. stream.writeWordBigEndian(0);
  6442. int j3 = stream.currentOffset;
  6443. stream.method425(i3);
  6444. stream.method425(j2);
  6445. aStream_834.currentOffset = 0;
  6446. TextInput.method526(inputString, aStream_834);
  6447. stream.method441(0, aStream_834.buffer,
  6448. aStream_834.currentOffset);
  6449. stream.writeBytes(stream.currentOffset - j3);
  6450. inputString = TextInput.processText(inputString);
  6451. // inputString = Censor.doCensor(inputString);
  6452. myPlayer.textSpoken = inputString;
  6453. myPlayer.anInt1513 = j2;
  6454. myPlayer.anInt1531 = i3;
  6455. myPlayer.textCycle = 150;
  6456. if (myPrivilege == 2)
  6457. pushMessage(myPlayer.textSpoken, 2, "@cr2@"
  6458. + myPlayer.name);
  6459. else if (myPrivilege == 3)
  6460. pushMessage(myPlayer.textSpoken, 2, "@cr3@"
  6461. + myPlayer.name);
  6462. else if (myPrivilege == 1)
  6463. pushMessage(myPlayer.textSpoken, 2, "@cr1@"
  6464. + myPlayer.name);
  6465. else
  6466. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  6467. if (publicChatMode == 2) {
  6468. publicChatMode = 3;
  6469. stream.createFrame(95);
  6470. stream.writeWordBigEndian(publicChatMode);
  6471. stream.writeWordBigEndian(privateChatMode);
  6472. stream.writeWordBigEndian(tradeMode);
  6473. }
  6474. }
  6475. inputString = "";
  6476. inputTaken = true;
  6477. }
  6478. }
  6479. } while (true);
  6480. }
  6481.  
  6482. private void buildPublicChat(int j) {
  6483. int l = 0;
  6484. for (int i1 = 0; i1 < 500; i1++) {
  6485. if (chatMessages[i1] == null)
  6486. continue;
  6487. if (chatTypeView != 1)
  6488. continue;
  6489. int j1 = chatTypes[i1];
  6490. String s = chatNames[i1];
  6491. int k1 = (70 - l * 14 + 42) + chatScrollPos + 4 + 5;
  6492. if (k1 < -23)
  6493. break;
  6494. if (s != null && s.startsWith("@cr1@"))
  6495. s = s.substring(5);
  6496. if (s != null && s.startsWith("@cr2@"))
  6497. s = s.substring(5);
  6498. if (s != null && s.startsWith("@cr3@"))
  6499. s = s.substring(5);
  6500. if ((j1 == 1 || j1 == 2)
  6501. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6502. && isFriendOrSelf(s))) {
  6503. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6504. if (myPrivilege >= 1) {
  6505. menuActionName[menuActionRow] = "Report abuse @whi@"
  6506. + s;
  6507. menuActionID[menuActionRow] = 606;
  6508. menuActionRow++;
  6509. }
  6510. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6511. menuActionID[menuActionRow] = 42;
  6512. menuActionRow++;
  6513. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6514. menuActionID[menuActionRow] = 337;
  6515. menuActionRow++;
  6516. }
  6517. l++;
  6518. }
  6519. }
  6520. }
  6521.  
  6522. private void buildFriendChat(int j) {
  6523. int l = 0;
  6524. for (int i1 = 0; i1 < 500; i1++) {
  6525. if (chatMessages[i1] == null)
  6526. continue;
  6527. if (chatTypeView != 2)
  6528. continue;
  6529. int j1 = chatTypes[i1];
  6530. String s = chatNames[i1];
  6531. int k1 = (70 - l * 14 + 42) + chatScrollPos + 4 + 5;
  6532. if (k1 < -23)
  6533. break;
  6534. if (s != null && s.startsWith("@cr1@"))
  6535. s = s.substring(5);
  6536. if (s != null && s.startsWith("@cr2@"))
  6537. s = s.substring(5);
  6538. if (s != null && s.startsWith("@cr3@"))
  6539. s = s.substring(5);
  6540. if ((j1 == 5 || j1 == 6)
  6541. && (splitPrivateChat == 0 || chatTypeView == 2)
  6542. && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1
  6543. && isFriendOrSelf(s)))
  6544. l++;
  6545. if ((j1 == 3 || j1 == 7)
  6546. && (splitPrivateChat == 0 || chatTypeView == 2)
  6547. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6548. && isFriendOrSelf(s))) {
  6549. if (j > k1 - 14 && j <= k1) {
  6550. if (myPrivilege >= 1) {
  6551. menuActionName[menuActionRow] = "Report abuse @whi@"
  6552. + s;
  6553. menuActionID[menuActionRow] = 606;
  6554. menuActionRow++;
  6555. }
  6556. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6557. menuActionID[menuActionRow] = 42;
  6558. menuActionRow++;
  6559. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6560. menuActionID[menuActionRow] = 337;
  6561. menuActionRow++;
  6562. }
  6563. l++;
  6564. }
  6565. }
  6566. }
  6567.  
  6568. private void buildDuelorTrade(int j) {
  6569. int l = 0;
  6570. for (int i1 = 0; i1 < 500; i1++) {
  6571. if (chatMessages[i1] == null)
  6572. continue;
  6573. if (chatTypeView != 3 && chatTypeView != 4)
  6574. continue;
  6575. int j1 = chatTypes[i1];
  6576. String s = chatNames[i1];
  6577. int k1 = (70 - l * 14 + 42) + chatScrollPos + 4 + 5;
  6578. if (k1 < -23)
  6579. break;
  6580. if (s != null && s.startsWith("@cr1@"))
  6581. s = s.substring(5);
  6582. if (s != null && s.startsWith("@cr2@"))
  6583. s = s.substring(5);
  6584. if (s != null && s.startsWith("@cr3@"))
  6585. s = s.substring(5);
  6586. if (chatTypeView == 3 && j1 == 4
  6587. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6588. if (j > k1 - 14 && j <= k1) {
  6589. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6590. menuActionID[menuActionRow] = 484;
  6591. menuActionRow++;
  6592. }
  6593. l++;
  6594. }
  6595. if (chatTypeView == 4 && j1 == 8
  6596. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6597. if (j > k1 - 14 && j <= k1) {
  6598. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6599. + s;
  6600. menuActionID[menuActionRow] = 6;
  6601. menuActionRow++;
  6602. }
  6603. l++;
  6604. }
  6605. if (j1 == 12) {
  6606. if (j > k1 - 14 && j <= k1) {
  6607. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6608. menuActionID[menuActionRow] = 915;
  6609. menuActionRow++;
  6610. }
  6611. l++;
  6612. }
  6613. }
  6614. }
  6615.  
  6616. private void buildChatAreaMenu(int j) {
  6617. int l = 0;
  6618. for (int i1 = 0; i1 < 500; i1++) {
  6619. if (chatMessages[i1] == null)
  6620. continue;
  6621. int j1 = chatTypes[i1];
  6622. int k1 = (70 - l * 14 + 42) + chatScrollPos + 4 + 5;
  6623. if (k1 < -23)
  6624. break;
  6625. String s = chatNames[i1];
  6626. if (chatTypeView == 1) {
  6627. buildPublicChat(j);
  6628. break;
  6629. }
  6630. if (chatTypeView == 2) {
  6631. buildFriendChat(j);
  6632. break;
  6633. }
  6634. if (chatTypeView == 3 || chatTypeView == 4) {
  6635. buildDuelorTrade(j);
  6636. break;
  6637. }
  6638. if (chatTypeView == 5) {
  6639. break;
  6640. }
  6641. if (s != null && s.startsWith("@cr1@")) {
  6642. s = s.substring(5);
  6643. }
  6644. if (s != null && s.startsWith("@cr2@")) {
  6645. s = s.substring(5);
  6646. }
  6647. if (s != null && s.startsWith("@cr3@")) {
  6648. s = s.substring(5);
  6649. }
  6650. if (j1 == 0)
  6651. l++;
  6652. if ((j1 == 1 || j1 == 2)
  6653. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6654. && isFriendOrSelf(s))) {
  6655. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6656. if (myPrivilege >= 1) {
  6657. menuActionName[menuActionRow] = "Report abuse @whi@"
  6658. + s;
  6659. menuActionID[menuActionRow] = 606;
  6660. menuActionRow++;
  6661. }
  6662. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6663. menuActionID[menuActionRow] = 42;
  6664. menuActionRow++;
  6665. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6666. menuActionID[menuActionRow] = 337;
  6667. menuActionRow++;
  6668. }
  6669. l++;
  6670. }
  6671. if ((j1 == 3 || j1 == 7)
  6672. && splitPrivateChat == 0
  6673. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6674. && isFriendOrSelf(s))) {
  6675. if (j > k1 - 14 && j <= k1) {
  6676. if (myPrivilege >= 1) {
  6677. menuActionName[menuActionRow] = "Report abuse @whi@"
  6678. + s;
  6679. menuActionID[menuActionRow] = 606;
  6680. menuActionRow++;
  6681. }
  6682. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6683. menuActionID[menuActionRow] = 42;
  6684. menuActionRow++;
  6685. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6686. menuActionID[menuActionRow] = 337;
  6687. menuActionRow++;
  6688. }
  6689. l++;
  6690. }
  6691. if (j1 == 4
  6692. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6693. if (j > k1 - 14 && j <= k1) {
  6694. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6695. menuActionID[menuActionRow] = 484;
  6696. menuActionRow++;
  6697. }
  6698. l++;
  6699. }
  6700. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0
  6701. && privateChatMode < 2)
  6702. l++;
  6703. if (j1 == 8
  6704. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6705. if (j > k1 - 14 && j <= k1) {
  6706. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6707. + s;
  6708. menuActionID[menuActionRow] = 6;
  6709. menuActionRow++;
  6710. }
  6711. l++;
  6712. }
  6713. }
  6714. }
  6715.  
  6716. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6717. int j = class9.contentType;
  6718. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6719. if (j == 1 && anInt900 == 0) {
  6720. class9.message = "Loading friend list";
  6721. class9.atActionType = 0;
  6722. return;
  6723. }
  6724. if (j == 1 && anInt900 == 1) {
  6725. class9.message = "Connecting to friendserver";
  6726. class9.atActionType = 0;
  6727. return;
  6728. }
  6729. if (j == 2 && anInt900 != 2) {
  6730. class9.message = "Please wait...";
  6731. class9.atActionType = 0;
  6732. return;
  6733. }
  6734. int k = friendsCount;
  6735. if (anInt900 != 2)
  6736. k = 0;
  6737. if (j > 700)
  6738. j -= 601;
  6739. else
  6740. j--;
  6741. if (j >= k) {
  6742. class9.message = "";
  6743. class9.atActionType = 0;
  6744. return;
  6745. } else {
  6746. class9.message = friendsList[j];
  6747. class9.atActionType = 1;
  6748. return;
  6749. }
  6750. }
  6751. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6752. int l = friendsCount;
  6753. if (anInt900 != 2)
  6754. l = 0;
  6755. if (j > 800)
  6756. j -= 701;
  6757. else
  6758. j -= 101;
  6759. if (j >= l) {
  6760. class9.message = "";
  6761. class9.atActionType = 0;
  6762. return;
  6763. }
  6764. if (friendsNodeIDs[j] == 0)
  6765. class9.message = "@red@Offline";
  6766. else if (friendsNodeIDs[j] == nodeID)
  6767. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
  6768. else
  6769. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  6770. class9.atActionType = 1;
  6771. return;
  6772. }
  6773. if (j == 203) {
  6774. int i1 = friendsCount;
  6775. if (anInt900 != 2)
  6776. i1 = 0;
  6777. class9.scrollMax = i1 * 15 + 20;
  6778. if (class9.scrollMax <= class9.height)
  6779. class9.scrollMax = class9.height + 1;
  6780. return;
  6781. }
  6782. if (j >= 401 && j <= 500) {
  6783. if ((j -= 401) == 0 && anInt900 == 0) {
  6784. class9.message = "Loading ignore list";
  6785. class9.atActionType = 0;
  6786. return;
  6787. }
  6788. if (j == 1 && anInt900 == 0) {
  6789. class9.message = "Please wait...";
  6790. class9.atActionType = 0;
  6791. return;
  6792. }
  6793. int j1 = ignoreCount;
  6794. if (anInt900 == 0)
  6795. j1 = 0;
  6796. if (j >= j1) {
  6797. class9.message = "";
  6798. class9.atActionType = 0;
  6799. return;
  6800. } else {
  6801. class9.message = TextClass.fixName(TextClass
  6802. .nameForLong(ignoreListAsLongs[j]));
  6803. class9.atActionType = 1;
  6804. return;
  6805. }
  6806. }
  6807. if (j == 503) {
  6808. class9.scrollMax = ignoreCount * 15 + 20;
  6809. if (class9.scrollMax <= class9.height)
  6810. class9.scrollMax = class9.height + 1;
  6811. return;
  6812. }
  6813. if (j == 327) {
  6814. class9.modelRotation1 = 150;
  6815. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6816. if (aBoolean1031) {
  6817. for (int k1 = 0; k1 < 7; k1++) {
  6818. int l1 = anIntArray1065[k1];
  6819. if (l1 >= 0 && !IDK.cache[l1].method537())
  6820. return;
  6821. }
  6822.  
  6823. aBoolean1031 = false;
  6824. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6825. int i2 = 0;
  6826. for (int j2 = 0; j2 < 7; j2++) {
  6827. int k2 = anIntArray1065[j2];
  6828. if (k2 >= 0)
  6829. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  6830. .method538();
  6831. }
  6832.  
  6833. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6834. for (int l2 = 0; l2 < 5; l2++)
  6835. if (anIntArray990[l2] != 0) {
  6836. model.method476(anIntArrayArray1003[l2][0],
  6837. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6838. if (l2 == 1)
  6839. model.method476(anIntArray1204[0],
  6840. anIntArray1204[anIntArray990[l2]]);
  6841. }
  6842.  
  6843. model.method469();
  6844. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6845. model.method479(64, 850, -30, -50, -30, true);
  6846. class9.anInt233 = 5;
  6847. class9.mediaID = 0;
  6848. RSInterface.method208(aBoolean994, model);
  6849. }
  6850. return;
  6851. }
  6852. if (j == 328) {
  6853. RSInterface rsInterface = class9;
  6854. int verticleTilt = 150;
  6855. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6856. rsInterface.modelRotation1 = verticleTilt;
  6857. rsInterface.modelRotation2 = animationSpeed;
  6858. if (aBoolean1031) {
  6859. Model characterDisplay = myPlayer.method452();
  6860. for (int l2 = 0; l2 < 5; l2++)
  6861. if (anIntArray990[l2] != 0) {
  6862. characterDisplay.method476(anIntArrayArray1003[l2][0],
  6863. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6864. if (l2 == 1)
  6865. characterDisplay.method476(anIntArray1204[0],
  6866. anIntArray1204[anIntArray990[l2]]);
  6867. }
  6868. int staticFrame = myPlayer.anInt1511;
  6869. characterDisplay.method469();
  6870. characterDisplay
  6871. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  6872. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6873. rsInterface.anInt233 = 5;
  6874. rsInterface.mediaID = 0;
  6875. RSInterface.method208(aBoolean994, characterDisplay);
  6876. }
  6877. return;
  6878. }
  6879. if (j == 324) {
  6880. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6881. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6882. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6883. }
  6884. if (aBoolean1047) {
  6885. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6886. return;
  6887. } else {
  6888. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6889. return;
  6890. }
  6891. }
  6892. if (j == 325) {
  6893. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6894. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6895. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6896. }
  6897. if (aBoolean1047) {
  6898. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6899. return;
  6900. } else {
  6901. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6902. return;
  6903. }
  6904. }
  6905. if (j == 600) {
  6906. class9.message = reportAbuseInput;
  6907. if (loopCycle % 20 < 10) {
  6908. class9.message += "|";
  6909. return;
  6910. } else {
  6911. class9.message += " ";
  6912. return;
  6913. }
  6914. }
  6915. if (j == 613)
  6916. if (myPrivilege >= 1) {
  6917. if (canMute) {
  6918. class9.textColor = 0xff0000;
  6919. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  6920. } else {
  6921. class9.textColor = 0xffffff;
  6922. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  6923. }
  6924. } else {
  6925. class9.message = "";
  6926. }
  6927. if (j == 650 || j == 655)
  6928. if (anInt1193 != 0) {
  6929. String s;
  6930. if (daysSinceLastLogin == 0)
  6931. s = "earlier today";
  6932. else if (daysSinceLastLogin == 1)
  6933. s = "yesterday";
  6934. else
  6935. s = daysSinceLastLogin + " days ago";
  6936. class9.message = "You last logged in " + s + " from: "
  6937. + Signlink.dns;
  6938. } else {
  6939. class9.message = "";
  6940. }
  6941. if (j == 651) {
  6942. if (unreadMessages == 0) {
  6943. class9.message = "0 unread messages";
  6944. class9.textColor = 0xffff00;
  6945. }
  6946. if (unreadMessages == 1) {
  6947. class9.message = "1 unread message";
  6948. class9.textColor = 65280;
  6949. }
  6950. if (unreadMessages > 1) {
  6951. class9.message = unreadMessages + " unread messages";
  6952. class9.textColor = 65280;
  6953. }
  6954. }
  6955. if (j == 652)
  6956. if (daysSinceRecovChange == 201) {
  6957. if (membersInt == 1)
  6958. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6959. else
  6960. class9.message = "";
  6961. } else if (daysSinceRecovChange == 200) {
  6962. class9.message = "You have not yet set any password recovery questions.";
  6963. } else {
  6964. String s1;
  6965. if (daysSinceRecovChange == 0)
  6966. s1 = "Earlier today";
  6967. else if (daysSinceRecovChange == 1)
  6968. s1 = "Yesterday";
  6969. else
  6970. s1 = daysSinceRecovChange + " days ago";
  6971. class9.message = s1 + " you changed your recovery questions";
  6972. }
  6973. if (j == 653)
  6974. if (daysSinceRecovChange == 201) {
  6975. if (membersInt == 1)
  6976. class9.message = "@whi@recommend you use a members world instead. You may use";
  6977. else
  6978. class9.message = "";
  6979. } else if (daysSinceRecovChange == 200)
  6980. class9.message = "We strongly recommend you do so now to secure your account.";
  6981. else
  6982. class9.message = "If you do not remember making this change then cancel it immediately";
  6983. if (j == 654) {
  6984. if (daysSinceRecovChange == 201)
  6985. if (membersInt == 1) {
  6986. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6987. return;
  6988. } else {
  6989. class9.message = "";
  6990. return;
  6991. }
  6992. if (daysSinceRecovChange == 200) {
  6993. class9.message = "Do this from the 'account management' area on our front webpage";
  6994. return;
  6995. }
  6996. class9.message = "Do this from the 'account management' area on our front webpage";
  6997. }
  6998. }
  6999.  
  7000. private void drawSplitPrivateChat() {
  7001. if (splitPrivateChat == 0)
  7002. return;
  7003. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  7004. int i = 0;
  7005. if (anInt1104 != 0)
  7006. i = 1;
  7007. for (int j = 0; j < 100; j++)
  7008. if (chatMessages[j] != null) {
  7009. int k = chatTypes[j];
  7010. String s = chatNames[j];
  7011. byte byte1 = 0;
  7012. if (s != null && s.startsWith("@cr1@")) {
  7013. s = s.substring(5);
  7014. byte1 = 1;
  7015. }
  7016. if (s != null && s.startsWith("@cr2@")) {
  7017. s = s.substring(5);
  7018. byte1 = 2;
  7019. }
  7020. if (s != null && s.startsWith("@cr3@")) {
  7021. s = s.substring(5);
  7022. byte1 = 3;
  7023. }
  7024. if ((k == 3 || k == 7)
  7025. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  7026. && isFriendOrSelf(s))) {
  7027. int l = 329 - i * 13;
  7028. if (clientSize != 0) {
  7029. l = clientHeight - 170 - i * 13;
  7030. }
  7031. int k1 = 4;
  7032. textDrawingArea.method385(0, "From", l, k1);
  7033. textDrawingArea.method385(65535, "From", l - 1, k1);
  7034. k1 += textDrawingArea.getTextWidth("From ");
  7035. if (byte1 == 1) {
  7036. modIcons[0].drawBackground(k1, l - 12);
  7037. k1 += 12;
  7038. }
  7039. if (byte1 == 2) {
  7040. modIcons[1].drawBackground(k1, l - 12);
  7041. k1 += 12;
  7042. }
  7043. if (byte1 == 3) {
  7044. modIcons[2].drawBackground(k1, l - 12);
  7045. k1 += 12;
  7046. }
  7047. textDrawingArea.method385(0, s + ": " + chatMessages[j], l,
  7048. k1);
  7049. textDrawingArea.method385(65535,
  7050. s + ": " + chatMessages[j], l - 1, k1);
  7051. if (++i >= 5)
  7052. return;
  7053. }
  7054. if (k == 5 && privateChatMode < 2) {
  7055. int i1 = 329 - i * 13;
  7056. if (clientSize != 0) {
  7057. i1 = clientHeight - 170 - i * 13;
  7058. }
  7059. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  7060. textDrawingArea
  7061. .method385(65535, chatMessages[j], i1 - 1, 4);
  7062. if (++i >= 5)
  7063. return;
  7064. }
  7065. if (k == 6 && privateChatMode < 2) {
  7066. int j1 = 329 - i * 13;
  7067. if (clientSize != 0) {
  7068. j1 = clientHeight - 170 - i * 13;
  7069. }
  7070. textDrawingArea.method385(0, "To " + s + ": "
  7071. + chatMessages[j], j1, 4);
  7072. textDrawingArea.method385(65535, "To " + s + ": "
  7073. + chatMessages[j], j1 - 1, 4);
  7074. if (++i >= 5)
  7075. return;
  7076. }
  7077. }
  7078.  
  7079. }
  7080.  
  7081. public void pushMessage(String s, int i, String s1) {
  7082. if (i == 0 && dialogID != -1) {
  7083. aString844 = s;
  7084. super.clickMode3 = 0;
  7085. }
  7086. if (backDialogID == -1)
  7087. inputTaken = true;
  7088. for (int j = 499; j > 0; j--) {
  7089. chatTypes[j] = chatTypes[j - 1];
  7090. chatNames[j] = chatNames[j - 1];
  7091. chatMessages[j] = chatMessages[j - 1];
  7092. chatRights[j] = chatRights[j - 1];
  7093. }
  7094. chatTypes[0] = i;
  7095. chatNames[0] = s1;
  7096. chatMessages[0] = s;
  7097. chatRights[0] = rights;
  7098. }
  7099.  
  7100. public static void setTab(int id) {
  7101. tabID = id;
  7102. tabAreaAltered = true;
  7103. }
  7104.  
  7105. private void processTabClick() {
  7106. minimapHovers();
  7107. int[] tab = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, };
  7108. if (clientSize == 0) {
  7109. if (super.clickMode3 == 1) {
  7110. if (super.saveClickX >= 524 && super.saveClickX <= 561
  7111. && super.saveClickY >= 169 && super.saveClickY < 205
  7112. && tabInterfaceIDs[0] != -1) {
  7113. needDrawTabArea = true;
  7114. tabID = 0;
  7115. tabAreaAltered = true;
  7116. }
  7117. if (super.saveClickX >= 562 && super.saveClickX <= 594
  7118. && super.saveClickY >= 168 && super.saveClickY < 205
  7119. && tabInterfaceIDs[1] != -1) {
  7120. needDrawTabArea = true;
  7121. tabID = 1;
  7122. tabAreaAltered = true;
  7123. }
  7124. if (super.saveClickX >= 595 && super.saveClickX <= 626
  7125. && super.saveClickY >= 168 && super.saveClickY < 205
  7126. && tabInterfaceIDs[2] != -1) {
  7127. needDrawTabArea = true;
  7128. tabID = 2;
  7129. tabAreaAltered = true;
  7130. }
  7131. if (super.saveClickX >= 627 && super.saveClickX <= 660
  7132. && super.saveClickY >= 168 && super.saveClickY < 203
  7133. && tabInterfaceIDs[3] != -1) {
  7134. needDrawTabArea = true;
  7135. tabID = 3;
  7136. tabAreaAltered = true;
  7137. }
  7138. if (super.saveClickX >= 661 && super.saveClickX <= 693
  7139. && super.saveClickY >= 168 && super.saveClickY < 205
  7140. && tabInterfaceIDs[4] != -1) {
  7141. needDrawTabArea = true;
  7142. tabID = 4;
  7143. tabAreaAltered = true;
  7144. }
  7145. if (super.saveClickX >= 694 && super.saveClickX <= 725
  7146. && super.saveClickY >= 168 && super.saveClickY < 205
  7147. && tabInterfaceIDs[5] != -1) {
  7148. needDrawTabArea = true;
  7149. tabID = 5;
  7150. tabAreaAltered = true;
  7151. }
  7152. if (super.saveClickX >= 726 && super.saveClickX <= 765
  7153. && super.saveClickY >= 169 && super.saveClickY < 205
  7154. && tabInterfaceIDs[6] != -1) {
  7155. needDrawTabArea = true;
  7156. tabID = 6;
  7157. tabAreaAltered = true;
  7158. }
  7159. if (super.saveClickX >= 524 && super.saveClickX <= 561
  7160. && super.saveClickY >= 466 && super.saveClickY < 503
  7161. && tabInterfaceIDs[7] != -1) {
  7162. needDrawTabArea = true;
  7163. tabID = 7;
  7164. tabAreaAltered = true;
  7165. }
  7166. if (super.saveClickX >= 562 && super.saveClickX <= 594
  7167. && super.saveClickY >= 466 && super.saveClickY < 503
  7168. && tabInterfaceIDs[8] != -1) {
  7169. needDrawTabArea = true;
  7170. tabID = 8;
  7171. tabAreaAltered = true;
  7172. }
  7173. if (super.saveClickX >= 595 && super.saveClickX <= 627
  7174. && super.saveClickY >= 466 && super.saveClickY < 503
  7175. && tabInterfaceIDs[9] != -1) {
  7176. needDrawTabArea = true;
  7177. tabID = 9;
  7178. tabAreaAltered = true;
  7179. }
  7180. if (super.saveClickX >= 627 && super.saveClickX <= 664
  7181. && super.saveClickY >= 466 && super.saveClickY < 503
  7182. && tabInterfaceIDs[10] != -1) {
  7183. needDrawTabArea = true;
  7184. tabID = 10;
  7185. tabAreaAltered = true;
  7186. }
  7187. if (super.saveClickX >= 661 && super.saveClickX <= 694
  7188. && super.saveClickY >= 466 && super.saveClickY < 503
  7189. && tabInterfaceIDs[11] != -1) {
  7190. needDrawTabArea = true;
  7191. tabID = 11;
  7192. tabAreaAltered = true;
  7193. }
  7194. if (super.saveClickX >= 695 && super.saveClickX <= 725
  7195. && super.saveClickY >= 466 && super.saveClickY < 503
  7196. && tabInterfaceIDs[12] != -1) {
  7197. needDrawTabArea = true;
  7198. tabID = 12;
  7199. tabAreaAltered = true;
  7200. }
  7201. if (super.saveClickX >= 726 && super.saveClickX <= 765
  7202. && super.saveClickY >= 466 && super.saveClickY < 502
  7203. && tabInterfaceIDs[13] != -1) {
  7204. needDrawTabArea = true;
  7205. tabID = 13;
  7206. tabAreaAltered = true;
  7207. }
  7208. }
  7209. } else if (clientSize != 0) {
  7210. if (clientWidth < smallTabs) {
  7211. if (super.clickMode3 == 1) {
  7212. if (super.saveClickX >= clientWidth - 241
  7213. && super.saveClickX <= clientWidth - 204
  7214. && super.saveClickY >= clientHeight - 72
  7215. && super.saveClickY < clientHeight - 40
  7216. && tabInterfaceIDs[0] != -1) {
  7217. if (tabID == tab[0]) {
  7218. showTab = !showTab;
  7219. } else {
  7220. showTab = true;
  7221. }
  7222. tabID = tab[0];
  7223. needDrawTabArea = true;
  7224. tabAreaAltered = true;
  7225.  
  7226. }
  7227. if (super.saveClickX >= clientWidth - 202
  7228. && super.saveClickX <= clientWidth - 171
  7229. && super.saveClickY >= clientHeight - 72
  7230. && super.saveClickY < clientHeight - 40
  7231. && tabInterfaceIDs[1] != -1) {
  7232. if (tabID == tab[1]) {
  7233. showTab = !showTab;
  7234. } else {
  7235. showTab = true;
  7236. }
  7237. tabID = tab[1];
  7238. needDrawTabArea = true;
  7239. tabAreaAltered = true;
  7240.  
  7241. }
  7242. if (super.saveClickX >= clientWidth - 170
  7243. && super.saveClickX <= clientWidth - 139
  7244. && super.saveClickY >= clientHeight - 72
  7245. && super.saveClickY < clientHeight - 40
  7246. && tabInterfaceIDs[2] != -1) {
  7247. if (tabID == tab[2]) {
  7248. showTab = !showTab;
  7249. } else {
  7250. showTab = true;
  7251. }
  7252. tabID = tab[2];
  7253. needDrawTabArea = true;
  7254. tabAreaAltered = true;
  7255.  
  7256. }
  7257. if (super.saveClickX >= clientWidth - 138
  7258. && super.saveClickX <= clientWidth - 105
  7259. && super.saveClickY >= clientHeight - 72
  7260. && super.saveClickY < clientHeight - 40
  7261. && tabInterfaceIDs[3] != -1) {
  7262. if (tabID == tab[3]) {
  7263. showTab = !showTab;
  7264. } else {
  7265. showTab = true;
  7266. }
  7267. tabID = tab[3];
  7268. needDrawTabArea = true;
  7269. tabAreaAltered = true;
  7270.  
  7271. }
  7272. if (super.saveClickX >= clientWidth - 104
  7273. && super.saveClickX <= clientWidth - 72
  7274. && super.saveClickY >= clientHeight - 72
  7275. && super.saveClickY < clientHeight - 40
  7276. && tabInterfaceIDs[4] != -1) {
  7277. if (tabID == tab[4]) {
  7278. showTab = !showTab;
  7279. } else {
  7280. showTab = true;
  7281. }
  7282. tabID = tab[4];
  7283. needDrawTabArea = true;
  7284. tabAreaAltered = true;
  7285.  
  7286. }
  7287. if (super.saveClickX >= clientWidth - 71
  7288. && super.saveClickX <= clientWidth - 39
  7289. && super.saveClickY >= clientHeight - 72
  7290. && super.saveClickY < clientHeight - 40
  7291. && tabInterfaceIDs[5] != -1) {
  7292. if (tabID == tab[5]) {
  7293. showTab = !showTab;
  7294. } else {
  7295. showTab = true;
  7296. }
  7297. tabID = tab[5];
  7298. needDrawTabArea = true;
  7299. tabAreaAltered = true;
  7300.  
  7301. }
  7302. if (super.saveClickX >= clientWidth - 38
  7303. && super.saveClickX <= clientWidth - 0
  7304. && super.saveClickY >= clientHeight - 72
  7305. && super.saveClickY < clientHeight - 40
  7306. && tabInterfaceIDs[6] != -1) {
  7307. if (tabID == tab[6]) {
  7308. showTab = !showTab;
  7309. } else {
  7310. showTab = true;
  7311. }
  7312. tabID = tab[6];
  7313. needDrawTabArea = true;
  7314. tabAreaAltered = true;
  7315.  
  7316. }
  7317. if (super.saveClickX >= clientWidth - 241
  7318. && super.saveClickX <= clientWidth - 204
  7319. && super.saveClickY >= clientHeight - 37
  7320. && super.saveClickY < clientHeight - 0
  7321. && tabInterfaceIDs[7] != -1) {
  7322. if (tabID == tab[7]) {
  7323. showTab = !showTab;
  7324. } else {
  7325. showTab = true;
  7326. }
  7327. tabID = tab[7];
  7328. needDrawTabArea = true;
  7329. tabAreaAltered = true;
  7330.  
  7331. }
  7332. if (super.saveClickX >= clientWidth - 202
  7333. && super.saveClickX <= clientWidth - 171
  7334. && super.saveClickY >= clientHeight - 37
  7335. && super.saveClickY < clientHeight - 0
  7336. && tabInterfaceIDs[8] != -1) {
  7337. if (tabID == tab[8]) {
  7338. showTab = !showTab;
  7339. } else {
  7340. showTab = true;
  7341. }
  7342. tabID = tab[8];
  7343. needDrawTabArea = true;
  7344. tabAreaAltered = true;
  7345.  
  7346. }
  7347. if (super.saveClickX >= clientWidth - 170
  7348. && super.saveClickX <= clientWidth - 139
  7349. && super.saveClickY >= clientHeight - 37
  7350. && super.saveClickY < clientHeight - 0
  7351. && tabInterfaceIDs[9] != -1) {
  7352. if (tabID == tab[9]) {
  7353. showTab = !showTab;
  7354. } else {
  7355. showTab = true;
  7356. }
  7357. tabID = tab[9];
  7358. needDrawTabArea = true;
  7359. tabAreaAltered = true;
  7360.  
  7361. }
  7362. if (super.saveClickX >= clientWidth - 138
  7363. && super.saveClickX <= clientWidth - 105
  7364. && super.saveClickY >= clientHeight - 37
  7365. && super.saveClickY < clientHeight - 0
  7366. && tabInterfaceIDs[10] != -1) {
  7367. if (tabID == tab[10]) {
  7368. showTab = !showTab;
  7369. } else {
  7370. showTab = true;
  7371. }
  7372. tabID = tab[10];
  7373. needDrawTabArea = true;
  7374. tabAreaAltered = true;
  7375.  
  7376. }
  7377. if (super.saveClickX >= clientWidth - 104
  7378. && super.saveClickX <= clientWidth - 72
  7379. && super.saveClickY >= clientHeight - 37
  7380. && super.saveClickY < clientHeight - 0
  7381. && tabInterfaceIDs[11] != -1) {
  7382. if (tabID == tab[11]) {
  7383. showTab = !showTab;
  7384. } else {
  7385. showTab = true;
  7386. }
  7387. tabID = tab[11];
  7388. needDrawTabArea = true;
  7389. tabAreaAltered = true;
  7390.  
  7391. }
  7392. if (super.saveClickX >= clientWidth - 71
  7393. && super.saveClickX <= clientWidth - 39
  7394. && super.saveClickY >= clientHeight - 37
  7395. && super.saveClickY < clientHeight - 0
  7396. && tabInterfaceIDs[12] != -1) {
  7397. if (tabID == tab[12]) {
  7398. showTab = !showTab;
  7399. } else {
  7400. showTab = true;
  7401. }
  7402. tabID = tab[12];
  7403. needDrawTabArea = true;
  7404. tabAreaAltered = true;
  7405.  
  7406. }
  7407. if (super.saveClickX >= clientWidth - 38
  7408. && super.saveClickX <= clientWidth - 0
  7409. && super.saveClickY >= clientHeight - 37
  7410. && super.saveClickY < clientHeight - 0
  7411. && tabInterfaceIDs[13] != -1) {
  7412. if (tabID == tab[13]) {
  7413. showTab = !showTab;
  7414. } else {
  7415. showTab = true;
  7416. }
  7417. tabID = tab[13];
  7418. needDrawTabArea = true;
  7419. tabAreaAltered = true;
  7420.  
  7421. }
  7422. }
  7423. }
  7424. }
  7425. if (clientWidth >= smallTabs) {
  7426. if (super.clickMode3 == 1) {
  7427. if (super.saveClickX >= clientWidth - 462
  7428. && super.saveClickX <= clientWidth - 429
  7429. && super.saveClickY >= clientHeight - 37
  7430. && super.saveClickY < clientHeight - 0
  7431. && tabInterfaceIDs[0] != -1) {
  7432. if (tabID == tab[0]) {
  7433. showTab = !showTab;
  7434. } else {
  7435. showTab = true;
  7436. }
  7437. tabID = tab[0];
  7438. needDrawTabArea = true;
  7439. tabAreaAltered = true;
  7440.  
  7441. }
  7442. if (super.saveClickX >= clientWidth - 429
  7443. && super.saveClickX <= clientWidth - 396
  7444. && super.saveClickY >= clientHeight - 37
  7445. && super.saveClickY < clientHeight - 0
  7446. && tabInterfaceIDs[1] != -1) {
  7447. if (tabID == tab[1]) {
  7448. showTab = !showTab;
  7449. } else {
  7450. showTab = true;
  7451. }
  7452. tabID = tab[1];
  7453. needDrawTabArea = true;
  7454. tabAreaAltered = true;
  7455.  
  7456. }
  7457. if (super.saveClickX >= clientWidth - 396
  7458. && super.saveClickX <= clientWidth - 363
  7459. && super.saveClickY >= clientHeight - 37
  7460. && super.saveClickY < clientHeight - 0
  7461. && tabInterfaceIDs[2] != -1) {
  7462. if (tabID == tab[2]) {
  7463. showTab = !showTab;
  7464. } else {
  7465. showTab = true;
  7466. }
  7467. tabID = tab[2];
  7468. needDrawTabArea = true;
  7469. tabAreaAltered = true;
  7470.  
  7471. }
  7472. if (super.saveClickX >= clientWidth - 363
  7473. && super.saveClickX <= clientWidth - 330
  7474. && super.saveClickY >= clientHeight - 37
  7475. && super.saveClickY < clientHeight - 0
  7476. && tabInterfaceIDs[3] != -1) {
  7477. if (tabID == tab[3]) {
  7478. showTab = !showTab;
  7479. } else {
  7480. showTab = true;
  7481. }
  7482. tabID = tab[3];
  7483. needDrawTabArea = true;
  7484. tabAreaAltered = true;
  7485.  
  7486. }
  7487. if (super.saveClickX >= clientWidth - 330
  7488. && super.saveClickX <= clientWidth - 297
  7489. && super.saveClickY >= clientHeight - 37
  7490. && super.saveClickY < clientHeight - 0
  7491. && tabInterfaceIDs[4] != -1) {
  7492. if (tabID == tab[4]) {
  7493. showTab = !showTab;
  7494. } else {
  7495. showTab = true;
  7496. }
  7497. tabID = tab[4];
  7498. needDrawTabArea = true;
  7499. tabAreaAltered = true;
  7500.  
  7501. }
  7502. if (super.saveClickX >= clientWidth - 297
  7503. && super.saveClickX <= clientWidth - 264
  7504. && super.saveClickY >= clientHeight - 37
  7505. && super.saveClickY < clientHeight - 0
  7506. && tabInterfaceIDs[5] != -1) {
  7507. if (tabID == tab[5]) {
  7508. showTab = !showTab;
  7509. } else {
  7510. showTab = true;
  7511. }
  7512. tabID = tab[5];
  7513. needDrawTabArea = true;
  7514. tabAreaAltered = true;
  7515.  
  7516. }
  7517. if (super.saveClickX >= clientWidth - 264
  7518. && super.saveClickX <= clientWidth - 231
  7519. && super.saveClickY >= clientHeight - 37
  7520. && super.saveClickY < clientHeight - 0
  7521. && tabInterfaceIDs[6] != -1) {
  7522. if (tabID == tab[6]) {
  7523. showTab = !showTab;
  7524. } else {
  7525. showTab = true;
  7526. }
  7527. tabID = tab[6];
  7528. needDrawTabArea = true;
  7529. tabAreaAltered = true;
  7530.  
  7531. }
  7532. if (super.saveClickX >= clientWidth - 231
  7533. && super.saveClickX <= clientWidth - 198
  7534. && super.saveClickY >= clientHeight - 37
  7535. && super.saveClickY < clientHeight - 0
  7536. && tabInterfaceIDs[7] != -1) {
  7537. if (tabID == tab[7]) {
  7538. showTab = !showTab;
  7539. } else {
  7540. showTab = true;
  7541. }
  7542. tabID = tab[7];
  7543. needDrawTabArea = true;
  7544. tabAreaAltered = true;
  7545.  
  7546. }
  7547. if (super.saveClickX >= clientWidth - 198
  7548. && super.saveClickX <= clientWidth - 165
  7549. && super.saveClickY >= clientHeight - 37
  7550. && super.saveClickY < clientHeight - 0
  7551. && tabInterfaceIDs[8] != -1) {
  7552. if (tabID == tab[8]) {
  7553. showTab = !showTab;
  7554. } else {
  7555. showTab = true;
  7556. }
  7557. tabID = tab[8];
  7558. needDrawTabArea = true;
  7559. tabAreaAltered = true;
  7560.  
  7561. }
  7562. if (super.saveClickX >= clientWidth - 165
  7563. && super.saveClickX <= clientWidth - 132
  7564. && super.saveClickY >= clientHeight - 37
  7565. && super.saveClickY < clientHeight - 0
  7566. && tabInterfaceIDs[9] != -1) {
  7567. if (tabID == tab[9]) {
  7568. showTab = !showTab;
  7569. } else {
  7570. showTab = true;
  7571. }
  7572. tabID = tab[9];
  7573. needDrawTabArea = true;
  7574. tabAreaAltered = true;
  7575.  
  7576. }
  7577. if (super.saveClickX >= clientWidth - 132
  7578. && super.saveClickX <= clientWidth - 99
  7579. && super.saveClickY >= clientHeight - 37
  7580. && super.saveClickY < clientHeight - 0
  7581. && tabInterfaceIDs[10] != -1) {
  7582. if (tabID == tab[10]) {
  7583. showTab = !showTab;
  7584. } else {
  7585. showTab = true;
  7586. }
  7587. tabID = tab[10];
  7588. needDrawTabArea = true;
  7589. tabAreaAltered = true;
  7590.  
  7591. }
  7592. if (super.saveClickX >= clientWidth - 99
  7593. && super.saveClickX <= clientWidth - 66
  7594. && super.saveClickY >= clientHeight - 37
  7595. && super.saveClickY < clientHeight - 0
  7596. && tabInterfaceIDs[11] != -1) {
  7597. if (tabID == tab[11]) {
  7598. showTab = !showTab;
  7599. } else {
  7600. showTab = true;
  7601. }
  7602. tabID = tab[11];
  7603. needDrawTabArea = true;
  7604. tabAreaAltered = true;
  7605.  
  7606. }
  7607. if (super.saveClickX >= clientWidth - 66
  7608. && super.saveClickX <= clientWidth - 33
  7609. && super.saveClickY >= clientHeight - 37
  7610. && super.saveClickY < clientHeight - 0
  7611. && tabInterfaceIDs[12] != -1) {
  7612. if (tabID == tab[12]) {
  7613. showTab = !showTab;
  7614. } else {
  7615. showTab = true;
  7616. }
  7617. tabID = tab[12];
  7618. needDrawTabArea = true;
  7619. tabAreaAltered = true;
  7620.  
  7621. }
  7622. if (super.saveClickX >= clientWidth - 33
  7623. && super.saveClickX <= clientWidth - 0
  7624. && super.saveClickY >= clientHeight - 37
  7625. && super.saveClickY < clientHeight - 0
  7626. && tabInterfaceIDs[13] != -1) {
  7627. if (tabID == tab[13]) {
  7628. showTab = !showTab;
  7629. } else {
  7630. showTab = true;
  7631. }
  7632. tabID = tab[13];
  7633. needDrawTabArea = true;
  7634. tabAreaAltered = true;
  7635. }
  7636. }
  7637. }
  7638. }
  7639.  
  7640. private void resetImageProducers2() {
  7641. if (aRSImageProducer_1166 != null)
  7642. return;
  7643. nullLoader();
  7644. super.fullGameScreen = null;
  7645. aRSImageProducer_1107 = null;
  7646. aRSImageProducer_1108 = null;
  7647. aRSImageProducer_1109 = null;
  7648. aRSImageProducer_1110 = null;
  7649. aRSImageProducer_1111 = null;
  7650. aRSImageProducer_1112 = null;
  7651. aRSImageProducer_1113 = null;
  7652. aRSImageProducer_1114 = null;
  7653. aRSImageProducer_1115 = null;
  7654. aRSImageProducer_1166 = new RSImageProducer(516, 165,
  7655. getGameComponent());// chat back
  7656. aRSImageProducer_1164 = new RSImageProducer(249, 168,
  7657. getGameComponent());// mapback
  7658. DrawingArea.setAllPixelsToZero();
  7659. cacheSprite[24].drawSprite(0, 0);
  7660. aRSImageProducer_1163 = new RSImageProducer(250, 335,
  7661. getGameComponent());// inventory
  7662. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  7663. getGameComponent());// gamescreen
  7664. DrawingArea.setAllPixelsToZero();
  7665. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  7666. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  7667. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7668. welcomeScreenRaised = true;
  7669. }
  7670.  
  7671. private void method81(Sprite sprite, int j, int k) {
  7672. int l = k * k + j * j;
  7673. if (l > 4225 && l < 0x15f90) {
  7674. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  7675. int j1 = Model.modelIntArray1[i1];
  7676. int k1 = Model.modelIntArray2[i1];
  7677. j1 = (j1 * 256) / (minimapInt3 + 256);
  7678. k1 = (k1 * 256) / (minimapInt3 + 256);
  7679. int l1 = j * j1 + k * k1 >> 16;
  7680. int i2 = j * k1 - k * j1 >> 16;
  7681. double d = Math.atan2(l1, i2);
  7682. int j2 = (int) (Math.sin(d) * 63D);
  7683. int k2 = (int) (Math.cos(d) * 57D);
  7684. mapEdge.method353(
  7685. (clientSize == 0 ? 86 : 89) - k2 - 20,
  7686. d,
  7687. ((clientSize == 0 ? 131 : clientWidth + 131 - 238) + j2) - 10 - 5);
  7688. } else {
  7689. markMinimap(sprite, k, j);
  7690. }
  7691. }
  7692.  
  7693. private void rightClickChatButtons() {
  7694. int y = 0;
  7695. if (clientSize != 0) {
  7696. y = clientHeight - 503;
  7697. }
  7698. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= y + 482
  7699. && super.mouseY <= y + 503) {
  7700. menuActionName[1] = "View All";
  7701. menuActionID[1] = 999;
  7702. menuActionRow = 2;
  7703. } else if (super.mouseX >= 71 && super.mouseX <= 127
  7704. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7705. menuActionName[1] = "View Game";
  7706. menuActionID[1] = 998;
  7707. menuActionRow = 2;
  7708. } else if (super.mouseX >= 137 && super.mouseX <= 193
  7709. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7710. menuActionName[1] = "Hide public";
  7711. menuActionID[1] = 997;
  7712. menuActionName[2] = "Off public";
  7713. menuActionID[2] = 996;
  7714. menuActionName[3] = "Friends public";
  7715. menuActionID[3] = 995;
  7716. menuActionName[4] = "On public";
  7717. menuActionID[4] = 994;
  7718. menuActionName[5] = "View public";
  7719. menuActionID[5] = 993;
  7720. menuActionRow = 6;
  7721. } else if (super.mouseX >= 203 && super.mouseX <= 259
  7722. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7723. menuActionName[1] = "Off private";
  7724. menuActionID[1] = 992;
  7725. menuActionName[2] = "Friends private";
  7726. menuActionID[2] = 991;
  7727. menuActionName[3] = "On private";
  7728. menuActionID[3] = 990;
  7729. menuActionName[4] = "View private";
  7730. menuActionID[4] = 989;
  7731. menuActionRow = 5;
  7732. } else if (super.mouseX >= 269 && super.mouseX <= 325
  7733. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7734. menuActionName[1] = "Off clan chat";
  7735. menuActionID[1] = 1003;
  7736. menuActionName[2] = "Friends clan chat";
  7737. menuActionID[2] = 1002;
  7738. menuActionName[3] = "On clan chat";
  7739. menuActionID[3] = 1001;
  7740. menuActionName[4] = "View clan chat";
  7741. menuActionID[4] = 1000;
  7742. menuActionRow = 5;
  7743. } else if (super.mouseX >= 335 && super.mouseX <= 391
  7744. && super.mouseY >= y + 482 && super.mouseY <= y + 503) {
  7745. menuActionName[1] = "Off trade";
  7746. menuActionID[1] = 987;
  7747. menuActionName[2] = "Friends trade";
  7748. menuActionID[2] = 986;
  7749. menuActionName[3] = "On trade";
  7750. menuActionID[3] = 985;
  7751. menuActionName[4] = "View trade";
  7752. menuActionID[4] = 984;
  7753. menuActionRow = 5;
  7754. }
  7755. }
  7756.  
  7757. private String prayerBook;
  7758. private boolean prayClicked;
  7759.  
  7760. public void processRightClick() {
  7761. if (activeInterfaceType != 0) {
  7762. return;
  7763. }
  7764. menuActionName[0] = "Cancel";
  7765. menuActionID[0] = 1107;
  7766. menuActionRow = 1;
  7767. if (fullscreenInterfaceID != -1) {
  7768. anInt886 = 0;
  7769. anInt1315 = 0;
  7770. buildInterfaceMenu(8,
  7771. RSInterface.interfaceCache[fullscreenInterfaceID],
  7772. super.mouseX, 8, super.mouseY, 0);
  7773. if (anInt886 != anInt1026) {
  7774. anInt1026 = anInt886;
  7775. }
  7776. if (anInt1315 != anInt1129) {
  7777. anInt1129 = anInt1315;
  7778. }
  7779. return;
  7780. }
  7781. buildSplitPrivateChatMenu();
  7782. anInt886 = 0;
  7783. anInt1315 = 0;
  7784. if (clientSize == 0) {
  7785. if (super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516
  7786. && super.mouseY < 338)
  7787. if (openInterfaceID != -1)
  7788. buildInterfaceMenu(4,
  7789. RSInterface.interfaceCache[openInterfaceID],
  7790. super.mouseX, 4, super.mouseY, 0);
  7791. else
  7792. build3dScreenMenu();
  7793. } else if (clientSize != 0) {
  7794. if (canClick())
  7795. if (super.mouseX > (clientWidth / 2) - 356
  7796. && super.mouseY > (clientHeight / 2) - 230
  7797. && super.mouseX < ((clientWidth / 2) + 356)
  7798. && super.mouseY < (clientHeight / 2) + 230
  7799. && openInterfaceID != -1)
  7800. buildInterfaceMenu((clientWidth / 2) - 356,
  7801. RSInterface.interfaceCache[openInterfaceID],
  7802. super.mouseX, (clientHeight / 2) - 230,
  7803. super.mouseY, 0);
  7804. else
  7805. build3dScreenMenu();
  7806. }
  7807. if (anInt886 != anInt1026) {
  7808. anInt1026 = anInt886;
  7809. }
  7810. if (anInt1315 != anInt1129) {
  7811. anInt1129 = anInt1315;
  7812. }
  7813. anInt886 = 0;
  7814. anInt1315 = 0;
  7815. if (clientSize == 0) {
  7816. if (super.mouseX > clientWidth - 218
  7817. && super.mouseY > clientHeight - 298
  7818. && super.mouseX < clientWidth - 25
  7819. && super.mouseY < clientHeight - 35) {
  7820. if (invOverlayInterfaceID != -1)
  7821. buildInterfaceMenu(clientWidth - 218,
  7822. RSInterface.interfaceCache[invOverlayInterfaceID],
  7823. super.mouseX, clientHeight - 298, super.mouseY, 0);
  7824. else if (tabInterfaceIDs[tabID] != -1)
  7825. buildInterfaceMenu(clientWidth - 218,
  7826. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  7827. super.mouseX, clientHeight - 298, super.mouseY, 0);
  7828. }
  7829. } else if (clientSize != 0) {
  7830. int y = clientWidth > 1000 ? 37 : 74;
  7831. if (clientWidth > 1000) {
  7832. if (super.mouseX > clientWidth - 197
  7833. && super.mouseY > clientHeight - y - 267
  7834. && super.mouseX < clientWidth - 7
  7835. && super.mouseY < clientHeight - y - 7 && showTab) {
  7836. if (invOverlayInterfaceID != -1) {
  7837. buildInterfaceMenu(
  7838. clientWidth - 197,
  7839. RSInterface.interfaceCache[invOverlayInterfaceID],
  7840. super.mouseX, clientHeight - 304, super.mouseY,
  7841. 0);
  7842. } else if (tabInterfaceIDs[tabID] != -1) {
  7843. buildInterfaceMenu(
  7844. clientWidth - 197,
  7845. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  7846. super.mouseX, clientHeight - 304, super.mouseY,
  7847. 0);
  7848. }
  7849. }
  7850. }
  7851. if (clientWidth <= 1000) {
  7852. if (super.mouseX > clientWidth - 211
  7853. && super.mouseY > clientHeight - y - 267
  7854. && super.mouseX < clientWidth - 7
  7855. && super.mouseY < clientHeight - y - 7 && showTab) {
  7856. if (invOverlayInterfaceID != -1) {
  7857. buildInterfaceMenu(
  7858. clientWidth - 211,
  7859. RSInterface.interfaceCache[invOverlayInterfaceID],
  7860. super.mouseX, clientHeight - y - 267,
  7861. super.mouseY, 0);
  7862. } else if (tabInterfaceIDs[tabID] != -1) {
  7863. buildInterfaceMenu(
  7864. clientWidth - 211,
  7865. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  7866. super.mouseX, clientHeight - y - 267,
  7867. super.mouseY, 0);
  7868. }
  7869. }
  7870. }
  7871. }
  7872. if (anInt886 != anInt1048) {
  7873. needDrawTabArea = true;
  7874. tabAreaAltered = true;
  7875. anInt1048 = anInt886;
  7876. }
  7877. if (anInt1315 != anInt1044) {
  7878. needDrawTabArea = true;
  7879. tabAreaAltered = true;
  7880. anInt1044 = anInt1315;
  7881. }
  7882. anInt886 = 0;
  7883. anInt1315 = 0;
  7884. if (super.mouseX > 0
  7885. && super.mouseY > (clientSize == 0 ? 338 : clientHeight - 165)
  7886. && super.mouseX < 490
  7887. && super.mouseY < (clientSize == 0 ? 463 : clientHeight - 40)
  7888. && showChat) {
  7889. if (backDialogID != -1) {
  7890. buildInterfaceMenu(20,
  7891. RSInterface.interfaceCache[backDialogID], super.mouseX,
  7892. (clientSize == 0 ? 358 : clientHeight - 145),
  7893. super.mouseY, 0);
  7894. } else if (super.mouseY < (clientSize == 0 ? 463
  7895. : clientHeight - 40) && super.mouseX < 490) {
  7896. buildChatAreaMenu(super.mouseY
  7897. - (clientSize == 0 ? 338 : clientHeight - 165));
  7898. }
  7899. }
  7900. if (backDialogID != -1 && anInt886 != anInt1039) {
  7901. inputTaken = true;
  7902. anInt1039 = anInt886;
  7903. }
  7904. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7905. inputTaken = true;
  7906. anInt1500 = anInt1315;
  7907. }
  7908. if (super.mouseX > 0 && super.mouseY > clientHeight - 165
  7909. && super.mouseX < 519 && super.mouseY < clientHeight)
  7910. rightClickChatButtons();
  7911. if (super.mouseX > clientWidth - 249 && super.mouseY < 168)
  7912. rightClickChatButtons();
  7913. processMinimapActions();
  7914. boolean flag = false;
  7915. while (!flag) {
  7916. flag = true;
  7917. for (int j = 0; j < menuActionRow - 1; j++) {
  7918. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7919. String s = menuActionName[j];
  7920. menuActionName[j] = menuActionName[j + 1];
  7921. menuActionName[j + 1] = s;
  7922. int k = menuActionID[j];
  7923. menuActionID[j] = menuActionID[j + 1];
  7924. menuActionID[j + 1] = k;
  7925. k = menuActionCmd2[j];
  7926. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7927. menuActionCmd2[j + 1] = k;
  7928. k = menuActionCmd3[j];
  7929. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7930. menuActionCmd3[j + 1] = k;
  7931. k = menuActionCmd1[j];
  7932. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7933. menuActionCmd1[j + 1] = k;
  7934. flag = false;
  7935. }
  7936. }
  7937. }
  7938. }
  7939.  
  7940. private int method83(int i, int j, int k) {
  7941. int l = 256 - k;
  7942. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  7943. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7944. }
  7945.  
  7946. private void login(String s, String s1, boolean flag) {
  7947. Signlink.errorname = s;
  7948. try {
  7949. if (!flag) {
  7950. loginMessage1 = "";
  7951. loginMessage2 = "Connecting to server...";
  7952. drawLoginScreen(true);
  7953. }
  7954. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7955. long l = TextClass.longForName(s);
  7956. int i = (int) (l >> 16 & 31L);
  7957. stream.currentOffset = 0;
  7958. stream.writeWordBigEndian(14);
  7959. stream.writeWordBigEndian(i);
  7960. socketStream.queueBytes(2, stream.buffer);
  7961. for (int j = 0; j < 8; j++)
  7962. socketStream.read();
  7963.  
  7964. int k = socketStream.read();
  7965. int i1 = k;
  7966. if (k == 0) {
  7967. socketStream.flushInputStream(inStream.buffer, 8);
  7968. inStream.currentOffset = 0;
  7969. aLong1215 = inStream.readQWord();
  7970. int ai[] = new int[4];
  7971. ai[0] = (int) (Math.random() * 99999999D);
  7972. ai[1] = (int) (Math.random() * 99999999D);
  7973. ai[2] = (int) (aLong1215 >> 32);
  7974. ai[3] = (int) aLong1215;
  7975. stream.currentOffset = 0;
  7976. stream.writeWordBigEndian(10);
  7977. stream.writeDWord(ai[0]);
  7978. stream.writeDWord(ai[1]);
  7979. stream.writeDWord(ai[2]);
  7980. stream.writeDWord(ai[3]);
  7981. stream.writeDWord(Config.VERSION);
  7982. stream.writeString(s);
  7983. stream.writeString(s1);
  7984. stream.doKeys();
  7985. aStream_847.currentOffset = 0;
  7986. if (flag)
  7987. aStream_847.writeWordBigEndian(18);
  7988. else
  7989. aStream_847.writeWordBigEndian(16);
  7990. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  7991. + 1 + 2);
  7992. aStream_847.writeWordBigEndian(255);
  7993. aStream_847.writeWord(474);
  7994. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7995. for (int l1 = 0; l1 < 9; l1++)
  7996. aStream_847.writeDWord(expectedCRCs[l1]);
  7997.  
  7998. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7999. stream.encryption = new ISAACRandomGen(ai);
  8000. for (int j2 = 0; j2 < 4; j2++)
  8001. ai[j2] += 50;
  8002.  
  8003. encryption = new ISAACRandomGen(ai);
  8004. socketStream.queueBytes(aStream_847.currentOffset,
  8005. aStream_847.buffer);
  8006. k = socketStream.read();
  8007. }
  8008. if (k == 1) {
  8009. try {
  8010. Thread.sleep(2000L);
  8011. } catch (Exception _ex) {
  8012. }
  8013. login(s, s1, flag);
  8014. return;
  8015. }
  8016. if (k == 2) {
  8017. myPrivilege = socketStream.read();
  8018. flagged = socketStream.read() == 1;
  8019. aLong1220 = 0L;
  8020. anInt1022 = 0;
  8021. mouseDetection.coordsIndex = 0;
  8022. super.awtFocus = true;
  8023. aBoolean954 = true;
  8024. loggedIn = true;
  8025. stream.currentOffset = 0;
  8026. inStream.currentOffset = 0;
  8027. pktType = -1;
  8028. anInt841 = -1;
  8029. anInt842 = -1;
  8030. anInt843 = -1;
  8031. pktSize = 0;
  8032. anInt1009 = 0;
  8033. anInt1104 = 0;
  8034. anInt1011 = 0;
  8035. anInt855 = 0;
  8036. menuActionRow = 0;
  8037. menuOpen = false;
  8038. super.idleTime = 0;
  8039. for (int j1 = 0; j1 < 100; j1++)
  8040. chatMessages[j1] = null;
  8041.  
  8042. itemSelected = 0;
  8043. spellSelected = 0;
  8044. loadingStage = 0;
  8045. anInt1062 = 0;
  8046. setNorth();
  8047. anInt1021 = 0;
  8048. anInt985 = -1;
  8049. destX = 0;
  8050. destY = 0;
  8051. playerCount = 0;
  8052. npcCount = 0;
  8053. for (int i2 = 0; i2 < maxPlayers; i2++) {
  8054. playerArray[i2] = null;
  8055. aStreamArray895s[i2] = null;
  8056. }
  8057.  
  8058. for (int k2 = 0; k2 < 16384; k2++)
  8059. npcArray[k2] = null;
  8060.  
  8061. myPlayer = playerArray[myPlayerIndex] = new Player();
  8062. aClass19_1013.removeAll();
  8063. aClass19_1056.removeAll();
  8064. for (int l2 = 0; l2 < 4; l2++) {
  8065. for (int i3 = 0; i3 < 104; i3++) {
  8066. for (int k3 = 0; k3 < 104; k3++)
  8067. groundArray[l2][i3][k3] = null;
  8068.  
  8069. }
  8070.  
  8071. }
  8072.  
  8073. aClass19_1179 = new NodeList();
  8074. fullscreenInterfaceID = -1;
  8075. anInt900 = 0;
  8076. friendsCount = 0;
  8077. dialogID = -1;
  8078. backDialogID = -1;
  8079. openInterfaceID = -1;
  8080. invOverlayInterfaceID = -1;
  8081. anInt1018 = -1;
  8082. aBoolean1149 = false;
  8083. tabID = 3;
  8084. inputDialogState = 0;
  8085. menuOpen = false;
  8086. messagePromptRaised = false;
  8087. aString844 = null;
  8088. anInt1055 = 0;
  8089. anInt1054 = -1;
  8090. aBoolean1047 = true;
  8091. method45();
  8092. for (int j3 = 0; j3 < 5; j3++)
  8093. anIntArray990[j3] = 0;
  8094.  
  8095. for (int l3 = 0; l3 < 5; l3++) {
  8096. atPlayerActions[l3] = null;
  8097. atPlayerArray[l3] = false;
  8098. }
  8099.  
  8100. anInt1175 = 0;
  8101. anInt1134 = 0;
  8102. anInt986 = 0;
  8103. anInt1288 = 0;
  8104. anInt924 = 0;
  8105. anInt1188 = 0;
  8106. anInt1155 = 0;
  8107. anInt1226 = 0;
  8108. // int anInt941 = 0;
  8109. // int anInt1260 = 0;
  8110. resetImageProducers2();
  8111. return;
  8112. }
  8113. if (k == 3) {
  8114. loginMessage1 = "";
  8115. loginMessage2 = "Invalid username or password.";
  8116. return;
  8117. }
  8118. if (k == 4) {
  8119. loginMessage1 = "Your account has been disabled.";
  8120. loginMessage2 = "Please check your message-center for details.";
  8121. return;
  8122. }
  8123. if (k == 5) {
  8124. loginMessage1 = "Your account is already logged in.";
  8125. loginMessage2 = "Try again in 60 secs...";
  8126. return;
  8127. }
  8128. if (k == 6) {
  8129. loginMessage1 = "OwnXile has been updated!";
  8130. loginMessage2 = "Please reload this page.";
  8131. return;
  8132. }
  8133. if (k == 7) {
  8134. loginMessage1 = "This world is full.";
  8135. loginMessage2 = "Please use a different world.";
  8136. return;
  8137. }
  8138. if (k == 8) {
  8139. loginMessage1 = "Unable to connect.";
  8140. loginMessage2 = "Login server offline.";
  8141. return;
  8142. }
  8143. if (k == 9) {
  8144. loginMessage1 = "Login limit exceeded.";
  8145. loginMessage2 = "Too many connections from your address.";
  8146. return;
  8147. }
  8148. if (k == 10) {
  8149. loginMessage1 = "Unable to connect.";
  8150. loginMessage2 = "Bad session id.";
  8151. return;
  8152. }
  8153. if (k == 11) {
  8154. loginMessage2 = "Login server rejected session.";
  8155. loginMessage2 = "Please try again.";
  8156. return;
  8157. }
  8158. if (k == 12) {
  8159. loginMessage1 = "You need a members account to login to this world.";
  8160. loginMessage2 = "Please subscribe, or use a different world.";
  8161. return;
  8162. }
  8163. if (k == 13) {
  8164. loginMessage1 = "Could not complete login.";
  8165. loginMessage2 = "Please try using a different world.";
  8166. return;
  8167. }
  8168. if (k == 14) {
  8169. loginMessage1 = "The server is being updated.";
  8170. loginMessage2 = "Please wait 1 minute and try again.";
  8171. return;
  8172. }
  8173. if (k == 15) {
  8174. loggedIn = true;
  8175. stream.currentOffset = 0;
  8176. inStream.currentOffset = 0;
  8177. pktType = -1;
  8178. anInt841 = -1;
  8179. anInt842 = -1;
  8180. anInt843 = -1;
  8181. pktSize = 0;
  8182. anInt1009 = 0;
  8183. anInt1104 = 0;
  8184. menuActionRow = 0;
  8185. menuOpen = false;
  8186. aLong824 = System.currentTimeMillis();
  8187. return;
  8188. }
  8189. if (k == 16) {
  8190. loginMessage1 = "Login attempts exceeded.";
  8191. loginMessage2 = "Please wait 1 minute and try again.";
  8192. return;
  8193. }
  8194. if (k == 17) {
  8195. loginMessage1 = "You are standing in a members-only area.";
  8196. loginMessage2 = "To play on this world move to a free area first";
  8197. return;
  8198. }
  8199. if (k == 20) {
  8200. loginMessage1 = "Invalid loginserver requested";
  8201. loginMessage2 = "Please try using a different world.";
  8202. return;
  8203. }
  8204. if (k == 21) {
  8205. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  8206. loginMessage1 = "You have only just left another world";
  8207. loginMessage2 = "Your profile will be transferred in: "
  8208. + k1 + " seconds";
  8209. drawLoginScreen(true);
  8210. try {
  8211. Thread.sleep(1000L);
  8212. } catch (Exception _ex) {
  8213. }
  8214. }
  8215.  
  8216. login(s, s1, flag);
  8217. return;
  8218. }
  8219. if (k == -1) {
  8220. if (i1 == 0) {
  8221. if (loginFailures < 2) {
  8222. try {
  8223. Thread.sleep(2000L);
  8224. } catch (Exception _ex) {
  8225. }
  8226. loginFailures++;
  8227. login(s, s1, flag);
  8228. return;
  8229. } else {
  8230. loginMessage1 = "No response from loginserver";
  8231. loginMessage2 = "Please wait 1 minute and try again.";
  8232. return;
  8233. }
  8234. } else {
  8235. loginMessage1 = "No response from server";
  8236. loginMessage2 = "Please try using a different world.";
  8237. return;
  8238. }
  8239. } else {
  8240. System.out.println("response:" + k);
  8241. loginMessage1 = "Unexpected server response";
  8242. loginMessage2 = "Please try using a different world.";
  8243. return;
  8244. }
  8245. } catch (IOException _ex) {
  8246. loginMessage1 = "";
  8247. }
  8248. loginMessage2 = "Error connecting to server.";
  8249. }
  8250.  
  8251. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  8252. int l1, int i2, int j2, boolean flag, int k2) {
  8253. byte byte0 = 104;
  8254. byte byte1 = 104;
  8255. for (int l2 = 0; l2 < byte0; l2++) {
  8256. for (int i3 = 0; i3 < byte1; i3++) {
  8257. anIntArrayArray901[l2][i3] = 0;
  8258. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  8259. }
  8260. }
  8261. int j3 = j2;
  8262. int k3 = j1;
  8263. anIntArrayArray901[j2][j1] = 99;
  8264. anIntArrayArray825[j2][j1] = 0;
  8265. int l3 = 0;
  8266. int i4 = 0;
  8267. bigX[l3] = j2;
  8268. bigY[l3++] = j1;
  8269. boolean flag1 = false;
  8270. int j4 = bigX.length;
  8271. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  8272. while (i4 != l3) {
  8273. j3 = bigX[i4];
  8274. k3 = bigY[i4];
  8275. i4 = (i4 + 1) % j4;
  8276. if (j3 == k2 && k3 == i2) {
  8277. flag1 = true;
  8278. break;
  8279. }
  8280. if (i1 != 0) {
  8281. if ((i1 < 5 || i1 == 10)
  8282. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  8283. i1 - 1, i2)) {
  8284. flag1 = true;
  8285. break;
  8286. }
  8287. if (i1 < 10
  8288. && aClass11Array1230[plane].method220(k2, i2, k3,
  8289. i1 - 1, j, j3)) {
  8290. flag1 = true;
  8291. break;
  8292. }
  8293. }
  8294. if (k1 != 0
  8295. && k != 0
  8296. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  8297. k1, k3)) {
  8298. flag1 = true;
  8299. break;
  8300. }
  8301. int l4 = anIntArrayArray825[j3][k3] + 1;
  8302. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  8303. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  8304. bigX[l3] = j3 - 1;
  8305. bigY[l3] = k3;
  8306. l3 = (l3 + 1) % j4;
  8307. anIntArrayArray901[j3 - 1][k3] = 2;
  8308. anIntArrayArray825[j3 - 1][k3] = l4;
  8309. }
  8310. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  8311. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  8312. bigX[l3] = j3 + 1;
  8313. bigY[l3] = k3;
  8314. l3 = (l3 + 1) % j4;
  8315. anIntArrayArray901[j3 + 1][k3] = 8;
  8316. anIntArrayArray825[j3 + 1][k3] = l4;
  8317. }
  8318. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  8319. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8320. bigX[l3] = j3;
  8321. bigY[l3] = k3 - 1;
  8322. l3 = (l3 + 1) % j4;
  8323. anIntArrayArray901[j3][k3 - 1] = 1;
  8324. anIntArrayArray825[j3][k3 - 1] = l4;
  8325. }
  8326. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  8327. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8328. bigX[l3] = j3;
  8329. bigY[l3] = k3 + 1;
  8330. l3 = (l3 + 1) % j4;
  8331. anIntArrayArray901[j3][k3 + 1] = 4;
  8332. anIntArrayArray825[j3][k3 + 1] = l4;
  8333. }
  8334. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  8335. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  8336. && (ai[j3 - 1][k3] & 0x1280108) == 0
  8337. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8338. bigX[l3] = j3 - 1;
  8339. bigY[l3] = k3 - 1;
  8340. l3 = (l3 + 1) % j4;
  8341. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  8342. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  8343. }
  8344. if (j3 < byte0 - 1 && k3 > 0
  8345. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  8346. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  8347. && (ai[j3 + 1][k3] & 0x1280180) == 0
  8348. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8349. bigX[l3] = j3 + 1;
  8350. bigY[l3] = k3 - 1;
  8351. l3 = (l3 + 1) % j4;
  8352. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  8353. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  8354. }
  8355. if (j3 > 0 && k3 < byte1 - 1
  8356. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  8357. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  8358. && (ai[j3 - 1][k3] & 0x1280108) == 0
  8359. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8360. bigX[l3] = j3 - 1;
  8361. bigY[l3] = k3 + 1;
  8362. l3 = (l3 + 1) % j4;
  8363. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  8364. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  8365. }
  8366. if (j3 < byte0 - 1 && k3 < byte1 - 1
  8367. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  8368. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  8369. && (ai[j3 + 1][k3] & 0x1280180) == 0
  8370. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8371. bigX[l3] = j3 + 1;
  8372. bigY[l3] = k3 + 1;
  8373. l3 = (l3 + 1) % j4;
  8374. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  8375. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  8376. }
  8377. }
  8378. anInt1264 = 0;
  8379. if (!flag1) {
  8380. if (flag) {
  8381. int i5 = 100;
  8382. for (int k5 = 1; k5 < 2; k5++) {
  8383. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  8384. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++) {
  8385. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  8386. && anIntArrayArray825[i6][l6] < i5) {
  8387. i5 = anIntArrayArray825[i6][l6];
  8388. j3 = i6;
  8389. k3 = l6;
  8390. anInt1264 = 1;
  8391. flag1 = true;
  8392. }
  8393. }
  8394. }
  8395. if (flag1)
  8396. break;
  8397. }
  8398. }
  8399. if (!flag1)
  8400. return false;
  8401. }
  8402. i4 = 0;
  8403. bigX[i4] = j3;
  8404. bigY[i4++] = k3;
  8405. int l5;
  8406. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  8407. if (j5 != l5) {
  8408. l5 = j5;
  8409. bigX[i4] = j3;
  8410. bigY[i4++] = k3;
  8411. }
  8412. if ((j5 & 2) != 0)
  8413. j3++;
  8414. else if ((j5 & 8) != 0)
  8415. j3--;
  8416. if ((j5 & 1) != 0)
  8417. k3++;
  8418. else if ((j5 & 4) != 0)
  8419. k3--;
  8420. }
  8421. if (i4 > 0) {
  8422. int k4 = i4;
  8423. if (k4 > 25)
  8424. k4 = 25;
  8425. i4--;
  8426. int k6 = bigX[i4];
  8427. int i7 = bigY[i4];
  8428. anInt1288 += k4;
  8429. if (anInt1288 >= 92) {
  8430. stream.createFrame(36);
  8431. stream.writeDWord(0);
  8432. anInt1288 = 0;
  8433. }
  8434. if (i == 0) {
  8435. stream.createFrame(164);
  8436. stream.writeWordBigEndian(k4 + k4 + 3);
  8437. }
  8438. if (i == 1) {
  8439. stream.createFrame(248);
  8440. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8441. }
  8442. if (i == 2) {
  8443. stream.createFrame(98);
  8444. stream.writeWordBigEndian(k4 + k4 + 3);
  8445. }
  8446. stream.method433(k6 + baseX);
  8447. destX = bigX[0];
  8448. destY = bigY[0];
  8449. for (int j7 = 1; j7 < k4; j7++) {
  8450. i4--;
  8451. stream.writeWordBigEndian(bigX[i4] - k6);
  8452. stream.writeWordBigEndian(bigY[i4] - i7);
  8453. }
  8454. stream.method431(i7 + baseY);
  8455. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8456. return true;
  8457. }
  8458. return i != 1;
  8459. }
  8460.  
  8461. private void method86(Stream stream) {
  8462. for (int j = 0; j < anInt893; j++) {
  8463. int k = anIntArray894[j];
  8464. NPC npc = npcArray[k];
  8465. int l = stream.readUnsignedByte();
  8466. if ((l & 0x10) != 0) {
  8467. int i1 = stream.method434();
  8468. if (i1 == 65535)
  8469. i1 = -1;
  8470. int i2 = stream.readUnsignedByte();
  8471. if (i1 == npc.anim && i1 != -1) {
  8472. int l2 = Animation.anims[i1].anInt365;
  8473. if (l2 == 1) {
  8474. npc.anInt1527 = 0;
  8475. npc.anInt1528 = 0;
  8476. npc.anInt1529 = i2;
  8477. npc.anInt1530 = 0;
  8478. }
  8479. if (l2 == 2)
  8480. npc.anInt1530 = 0;
  8481. } else if (i1 == -1
  8482. || npc.anim == -1
  8483. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  8484. npc.anim = i1;
  8485. npc.anInt1527 = 0;
  8486. npc.anInt1528 = 0;
  8487. npc.anInt1529 = i2;
  8488. npc.anInt1530 = 0;
  8489. npc.anInt1542 = npc.smallXYIndex;
  8490. }
  8491. }
  8492. if ((l & 8) != 0) {
  8493. int j1 = stream.method426();
  8494. int j2 = stream.method427();
  8495. npc.updateHitData(j2, j1, loopCycle);
  8496. npc.loopCycleStatus = loopCycle + 300;
  8497. npc.currentHealth = stream.method426();
  8498. npc.maxHealth = stream.readUnsignedByte();
  8499. }
  8500. if ((l & 0x80) != 0) {
  8501. npc.anInt1520 = stream.readUnsignedWord();
  8502. int k1 = stream.readDWord();
  8503. npc.anInt1524 = k1 >> 16;
  8504. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8505. npc.anInt1521 = 0;
  8506. npc.anInt1522 = 0;
  8507. if (npc.anInt1523 > loopCycle)
  8508. npc.anInt1521 = -1;
  8509. if (npc.anInt1520 == 65535)
  8510. npc.anInt1520 = -1;
  8511. }
  8512. if ((l & 0x20) != 0) {
  8513. npc.interactingEntity = stream.readUnsignedWord();
  8514. if (npc.interactingEntity == 65535)
  8515. npc.interactingEntity = -1;
  8516. }
  8517. if ((l & 1) != 0) {
  8518. npc.textSpoken = stream.readString();
  8519. npc.textCycle = 100;
  8520. }
  8521. if ((l & 0x40) != 0) {
  8522. int l1 = stream.method427();
  8523. int k2 = stream.method428();
  8524. npc.updateHitData(k2, l1, loopCycle);
  8525. npc.loopCycleStatus = loopCycle + 300;
  8526. npc.currentHealth = stream.method428();
  8527. npc.maxHealth = stream.method427();
  8528. }
  8529. if ((l & 2) != 0) {
  8530. npc.desc = EntityDef.forID(stream.method436());
  8531. npc.anInt1540 = npc.desc.size;
  8532. npc.anInt1504 = npc.desc.anInt79;
  8533. npc.anInt1554 = npc.desc.walkAnim;
  8534. npc.anInt1555 = npc.desc.anInt58;
  8535. npc.anInt1556 = npc.desc.anInt83;
  8536. npc.anInt1557 = npc.desc.anInt55;
  8537. npc.anInt1511 = npc.desc.standAnim;
  8538. }
  8539. if ((l & 4) != 0) {
  8540. npc.anInt1538 = stream.method434();
  8541. npc.anInt1539 = stream.method434();
  8542. }
  8543. }
  8544. }
  8545.  
  8546. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  8547. if (menuActionRow >= 400)
  8548. return;
  8549. if (entityDef.childrenIDs != null)
  8550. entityDef = entityDef.method161();
  8551. if (entityDef == null)
  8552. return;
  8553. if (!entityDef.aBoolean84)
  8554. return;
  8555. String s = entityDef.name;
  8556. if (entityDef.combatLevel != 0)
  8557. s = s
  8558. + combatDiffColor(myPlayer.combatLevel,
  8559. entityDef.combatLevel) + " (level-"
  8560. + entityDef.combatLevel + ")";
  8561. if (itemSelected == 1) {
  8562. menuActionName[menuActionRow] = "Use " + selectedItemName
  8563. + " with @yel@" + s;
  8564. menuActionID[menuActionRow] = 582;
  8565. menuActionCmd1[menuActionRow] = i;
  8566. menuActionCmd2[menuActionRow] = k;
  8567. menuActionCmd3[menuActionRow] = j;
  8568. menuActionRow++;
  8569. return;
  8570. }
  8571. if (spellSelected == 1) {
  8572. if ((spellUsableOn & 2) == 2) {
  8573. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8574. menuActionID[menuActionRow] = 413;
  8575. menuActionCmd1[menuActionRow] = i;
  8576. menuActionCmd2[menuActionRow] = k;
  8577. menuActionCmd3[menuActionRow] = j;
  8578. menuActionRow++;
  8579. }
  8580. } else {
  8581. if (entityDef.actions != null) {
  8582. for (int l = 4; l >= 0; l--)
  8583. if (entityDef.actions[l] != null
  8584. && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  8585. menuActionName[menuActionRow] = entityDef.actions[l]
  8586. + " @yel@" + s;
  8587. if (l == 0)
  8588. menuActionID[menuActionRow] = 20;
  8589. if (l == 1)
  8590. menuActionID[menuActionRow] = 412;
  8591. if (l == 2)
  8592. menuActionID[menuActionRow] = 225;
  8593. if (l == 3)
  8594. menuActionID[menuActionRow] = 965;
  8595. if (l == 4)
  8596. menuActionID[menuActionRow] = 478;
  8597. menuActionCmd1[menuActionRow] = i;
  8598. menuActionCmd2[menuActionRow] = k;
  8599. menuActionCmd3[menuActionRow] = j;
  8600. menuActionRow++;
  8601. }
  8602.  
  8603. }
  8604. if (entityDef.actions != null) {
  8605. for (int i1 = 4; i1 >= 0; i1--)
  8606. if (entityDef.actions[i1] != null
  8607. && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  8608. char c = '\0';
  8609. if (entityDef.combatLevel > myPlayer.combatLevel)
  8610. c = '\u07D0';
  8611. menuActionName[menuActionRow] = entityDef.actions[i1]
  8612. + " @yel@" + s;
  8613. if (i1 == 0)
  8614. menuActionID[menuActionRow] = 20 + c;
  8615. if (i1 == 1)
  8616. menuActionID[menuActionRow] = 412 + c;
  8617. if (i1 == 2)
  8618. menuActionID[menuActionRow] = 225 + c;
  8619. if (i1 == 3)
  8620. menuActionID[menuActionRow] = 965 + c;
  8621. if (i1 == 4)
  8622. menuActionID[menuActionRow] = 478 + c;
  8623. menuActionCmd1[menuActionRow] = i;
  8624. menuActionCmd2[menuActionRow] = k;
  8625. menuActionCmd3[menuActionRow] = j;
  8626. menuActionRow++;
  8627. }
  8628.  
  8629. }
  8630. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8631. menuActionID[menuActionRow] = 1025;
  8632. menuActionCmd1[menuActionRow] = i;
  8633. menuActionCmd2[menuActionRow] = k;
  8634. menuActionCmd3[menuActionRow] = j;
  8635. menuActionRow++;
  8636. }
  8637. }
  8638.  
  8639. private void buildAtPlayerMenu(int i, int j, Player player, int k) {
  8640. if (player == myPlayer)
  8641. return;
  8642. if (menuActionRow >= 400)
  8643. return;
  8644. String s;
  8645. if (player.skill == 0) {
  8646. s = player.name
  8647. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8648. + " (level-" + player.combatLevel + ")";
  8649. } else if (player.skill == 60) {
  8650. s = player.name;
  8651. } else if (player.skill == 61) {
  8652. s = "@bla@" + player.name.toUpperCase();
  8653. } else if (player.skill == 62) {
  8654. s = "@red@" + player.name.toUpperCase();
  8655. } else {
  8656. if (8 > player.skill)
  8657. s = "@or2@"
  8658. + this.TITLES[player.skill]
  8659. + "@whi@ "
  8660. + player.name
  8661. + combatDiffColor(myPlayer.combatLevel,
  8662. player.combatLevel) + " (level-"
  8663. + player.combatLevel + ")";
  8664. else
  8665. s = "@whi@"
  8666. + player.name
  8667. + " @or2@"
  8668. + this.TITLES[player.skill]
  8669. + " "
  8670. + combatDiffColor(myPlayer.combatLevel,
  8671. player.combatLevel) + " (level-"
  8672. + player.combatLevel + ")";
  8673. }
  8674. if (itemSelected == 1) {
  8675. menuActionName[menuActionRow] = "Use " + selectedItemName
  8676. + " with @whi@" + s;
  8677. menuActionID[menuActionRow] = 491;
  8678. menuActionCmd1[menuActionRow] = j;
  8679. menuActionCmd2[menuActionRow] = i;
  8680. menuActionCmd3[menuActionRow] = k;
  8681. menuActionRow++;
  8682. } else if (spellSelected == 1) {
  8683. if ((spellUsableOn & 8) == 8) {
  8684. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8685. menuActionID[menuActionRow] = 365;
  8686. menuActionCmd1[menuActionRow] = j;
  8687. menuActionCmd2[menuActionRow] = i;
  8688. menuActionCmd3[menuActionRow] = k;
  8689. menuActionRow++;
  8690. }
  8691. } else {
  8692. for (int l = 4; l >= 0; l--)
  8693. if (atPlayerActions[l] != null) {
  8694. menuActionName[menuActionRow] = atPlayerActions[l]
  8695. + " @whi@" + s;
  8696. char c = '\0';
  8697. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  8698. if (player.combatLevel > myPlayer.combatLevel)
  8699. c = '\u07D0';
  8700. if (myPlayer.team != 0 && player.team != 0)
  8701. if (myPlayer.team == player.team)
  8702. c = '\u07D0';
  8703. else
  8704. c = '\0';
  8705. } else if (atPlayerArray[l])
  8706. c = '\u07D0';
  8707. if (l == 0)
  8708. menuActionID[menuActionRow] = 561 + c;
  8709. if (l == 1)
  8710. menuActionID[menuActionRow] = 779 + c;
  8711. if (l == 2)
  8712. menuActionID[menuActionRow] = 27 + c;
  8713. if (l == 3)
  8714. menuActionID[menuActionRow] = 577 + c;
  8715. if (l == 4)
  8716. menuActionID[menuActionRow] = 729 + c;
  8717. menuActionCmd1[menuActionRow] = j;
  8718. menuActionCmd2[menuActionRow] = i;
  8719. menuActionCmd3[menuActionRow] = k;
  8720. menuActionRow++;
  8721. }
  8722.  
  8723. }
  8724. for (int i1 = 0; i1 < menuActionRow; i1++) {
  8725. if (menuActionID[i1] == 519) {
  8726. menuActionName[i1] = "Walk here @whi@" + s;
  8727. return;
  8728. }
  8729. }
  8730. }
  8731.  
  8732. private void method89(Class30_Sub1 class30_sub1) {
  8733. int i = 0;
  8734. int j = -1;
  8735. int k = 0;
  8736. int l = 0;
  8737. if (class30_sub1.anInt1296 == 0)
  8738. i = worldController.method300(class30_sub1.anInt1295,
  8739. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8740. if (class30_sub1.anInt1296 == 1)
  8741. i = worldController.method301(class30_sub1.anInt1295,
  8742. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8743. if (class30_sub1.anInt1296 == 2)
  8744. i = worldController.method302(class30_sub1.anInt1295,
  8745. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8746. if (class30_sub1.anInt1296 == 3)
  8747. i = worldController.method303(class30_sub1.anInt1295,
  8748. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8749. if (i != 0) {
  8750. int i1 = worldController.method304(class30_sub1.anInt1295,
  8751. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8752. j = i >> 14 & 0x7fff;
  8753. k = i1 & 0x1f;
  8754. l = i1 >> 6;
  8755. }
  8756. class30_sub1.anInt1299 = j;
  8757. class30_sub1.anInt1301 = k;
  8758. class30_sub1.anInt1300 = l;
  8759. }
  8760.  
  8761. void startUp() {
  8762. if (Signlink.sunjava)
  8763. super.minDelay = 5;
  8764.  
  8765. CacheUtility.installCache(this);
  8766. drawLoadingText(20, "Starting up");
  8767. if (Signlink.cache_dat != null) {
  8768. for (int i = 0; i < 5; i++)
  8769. decompressors[i] = new Decompressor(Signlink.cache_dat,
  8770. Signlink.cache_idx[i], i + 1);
  8771. }
  8772. try {
  8773. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  8774. expectedCRCs[1], 25);
  8775. smallText = new TextDrawingArea(false, "p11_full",
  8776. titleStreamLoader);
  8777. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full",
  8778. titleStreamLoader);
  8779. chatTextDrawingArea = new TextDrawingArea(false, "b12_full",
  8780. titleStreamLoader);
  8781. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true,
  8782. "q8_full", titleStreamLoader);
  8783. drawLogo();
  8784. loadTitleScreen();
  8785. StreamLoader streamLoader = streamLoaderForName(2, "config",
  8786. "config", expectedCRCs[2], 30);
  8787. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  8788. "interface", expectedCRCs[3], 35);
  8789. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  8790. "media", expectedCRCs[4], 40);
  8791. this.mediaStreamLoader = streamLoader_2;
  8792. try {
  8793. SpriteLoader.loadSprites(streamLoader_2);
  8794. cacheSprite = SpriteLoader.sprites;
  8795. } catch (Exception e) {
  8796. System.out.println("Unable to load sprite cache.");
  8797. }
  8798. try {
  8799. SpriteLoader2.loadSprites(streamLoader_2);
  8800. cacheSprite2 = SpriteLoader2.sprites;
  8801. } catch (Exception e) {
  8802. System.out.println("Unable to load sprite cache.");
  8803. }
  8804. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  8805. "textures", expectedCRCs[6], 45);
  8806. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  8807. "wordenc", expectedCRCs[7], 50);
  8808. streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8],
  8809. 55);
  8810. byteGroundArray = new byte[4][104][104];
  8811. intGroundArray = new int[4][105][105];
  8812. worldController = new WorldController(intGroundArray);
  8813. for (int j = 0; j < 4; j++)
  8814. aClass11Array1230[j] = new Class11();
  8815.  
  8816. minimapImage = new Sprite(512, 512);
  8817. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  8818. "versionlist", expectedCRCs[5], 60);
  8819. drawLoadingText(60, "Connecting to update server");
  8820. onDemandFetcher = new OnDemandFetcher();
  8821. onDemandFetcher.start(streamLoader_6, this);
  8822. Class36.method528(onDemandFetcher.getAnimCount());
  8823. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8824. // preloadModels();
  8825. // repackCacheIndex(1);
  8826. drawLoadingText(80, "Unpacking media");
  8827. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8828. mapBack = new Background(streamLoader_2, "mapback", 0);
  8829. for (int j3 = 0; j3 <= 14; j3++)
  8830. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  8831. compass = new Sprite(streamLoader_2, "compass", 0);
  8832. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  8833. mapEdge.method345();
  8834. try {
  8835. for (int k3 = 0; k3 < 100; k3++)
  8836. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  8837. k3);
  8838. } catch (Exception _ex) {
  8839. }
  8840. try {
  8841. for (int l3 = 0; l3 < 100; l3++)
  8842. mapFunctions[l3] = new Sprite(streamLoader_2,
  8843. "mapfunction", l3);
  8844. } catch (Exception _ex) {
  8845. }
  8846. try {
  8847. for (int i4 = 0; i4 < 20; i4++)
  8848. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8849. } catch (Exception _ex) {
  8850. }
  8851. try {
  8852. for (int h1 = 0; h1 < 6; h1++)
  8853. headIconsHint[h1] = new Sprite(streamLoader_2,
  8854. "headicons_hint", h1);
  8855. } catch (Exception _ex) {
  8856. }
  8857. try {
  8858. for (int j4 = 0; j4 < 8; j4++)
  8859. headIcons[j4] = new Sprite(streamLoader_2,
  8860. "headicons_prayer", j4);
  8861. for (int j45 = 0; j45 < 3; j45++)
  8862. skullIcons[j45] = new Sprite(streamLoader_2,
  8863. "headicons_pk", j45);
  8864. } catch (Exception _ex) {
  8865. }
  8866. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8867. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8868. for (int k4 = 0; k4 < 8; k4++)
  8869. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8870. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8871. multiWay = new Sprite(streamLoader_2, "Overlay_multiway", 0);
  8872. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8873. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8874. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8875. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8876. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  8877. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8878. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8879. for (int l4 = 0; l4 < 3; l4++)
  8880. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  8881. for (int i = 0; i < 3; i++)
  8882. counter[i] = new Sprite("XP " + i);
  8883. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8884. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  8885. getGameComponent());
  8886. sprite.method346(0, 0);
  8887. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8888. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  8889. getGameComponent());
  8890. sprite.method346(0, 0);
  8891. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  8892. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  8893. getGameComponent());
  8894. sprite.method346(0, 0);
  8895. int i5 = (int) (Math.random() * 21D) - 10;
  8896. int j5 = (int) (Math.random() * 21D) - 10;
  8897. int k5 = (int) (Math.random() * 21D) - 10;
  8898. int l5 = (int) (Math.random() * 41D) - 20;
  8899. for (int i6 = 0; i6 < 100; i6++) {
  8900. if (mapFunctions[i6] != null)
  8901. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8902. if (mapScenes[i6] != null)
  8903. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8904. }
  8905. drawLoadingText(83, "Unpacking textures");
  8906. Texture.method368(streamLoader_3);
  8907. Texture.method372(0.80000000000000004D);
  8908. Texture.method367();
  8909. drawLoadingText(86, "Unpacking config");
  8910. Animation.unpackConfig(streamLoader);
  8911. ObjectDef.unpackConfig(streamLoader);
  8912. Flo.unpackConfig(streamLoader);
  8913. ItemDef.unpackConfig(streamLoader);
  8914. EntityDef.unpackConfig(streamLoader);
  8915. IDK.unpackConfig(streamLoader);
  8916. SpotAnim.unpackConfig(streamLoader);
  8917. Varp.unpackConfig(streamLoader);
  8918. VarBit.unpackConfig(streamLoader);
  8919. ItemDef.isMembers = isMembers;
  8920. drawLoadingText(95, "Unpacking interfaces");
  8921. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText,
  8922. aTextDrawingArea_1271, chatTextDrawingArea,
  8923. aTextDrawingArea_1273 };
  8924. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s,
  8925. streamLoader_2);
  8926. drawLoadingText(100, "Preparing game engine");
  8927. for (int j6 = 0; j6 < 33; j6++) {
  8928. int k6 = 999;
  8929. int i7 = 0;
  8930. for (int k7 = 0; k7 < 34; k7++) {
  8931. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  8932. if (k6 == 999)
  8933. k6 = k7;
  8934. continue;
  8935. }
  8936. if (k6 == 999)
  8937. continue;
  8938. i7 = k7;
  8939. break;
  8940. }
  8941. anIntArray968[j6] = k6;
  8942. anIntArray1057[j6] = i7 - k6;
  8943. }
  8944. for (int l6 = 1; l6 < 153; l6++) {
  8945. int j7 = 999;
  8946. int l7 = 0;
  8947. for (int j8 = 24; j8 < 177; j8++) {
  8948. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0
  8949. && (j8 > 34 || l6 > 34)) {
  8950. if (j7 == 999) {
  8951. j7 = j8;
  8952. }
  8953. continue;
  8954. }
  8955. if (j7 == 999) {
  8956. continue;
  8957. }
  8958. l7 = j8;
  8959. break;
  8960. }
  8961. anIntArray1052[l6 - 1] = j7 - 24;
  8962. anIntArray1229[l6 - 1] = l7 - j7;
  8963. }
  8964. Texture.method365(765, 503);
  8965. fullScreenTextureArray = Texture.anIntArray1472;
  8966. Texture.method365(516, 165);
  8967. anIntArray1180 = Texture.anIntArray1472;
  8968. Texture.method365(250, 335);
  8969. anIntArray1181 = Texture.anIntArray1472;
  8970. Texture.method365(512, 334);
  8971. anIntArray1182 = Texture.anIntArray1472;
  8972. int ai[] = new int[9];
  8973. for (int i8 = 0; i8 < 9; i8++) {
  8974. int k8 = 128 + i8 * 32 + 15;
  8975. int l8 = 600 + k8 * 3;
  8976. int i9 = Texture.anIntArray1470[k8];
  8977. ai[i8] = l8 * i9 >> 16;
  8978. }
  8979. WorldController.method310(500, 800, 512, 334, ai);
  8980. Censor.loadConfig(streamLoader_4);
  8981. mouseDetection = new MouseDetection(this);
  8982. startRunnable(mouseDetection, 10);
  8983. Animable_Sub5.clientInstance = this;
  8984. ObjectDef.clientInstance = this;
  8985. EntityDef.clientInstance = this;
  8986. return;
  8987. } catch (Exception exception) {
  8988. exception.printStackTrace();
  8989. Signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8990. }
  8991. loadingError = true;
  8992. }
  8993.  
  8994. private void method91(Stream stream, int i) {
  8995. while (stream.bitPosition + 10 < i * 8) {
  8996. int j = stream.readBits(11);
  8997. if (j == 2047)
  8998. break;
  8999. if (playerArray[j] == null) {
  9000. playerArray[j] = new Player();
  9001. if (aStreamArray895s[j] != null)
  9002. playerArray[j].updatePlayer(aStreamArray895s[j]);
  9003. }
  9004. playerIndices[playerCount++] = j;
  9005. Player player = playerArray[j];
  9006. player.anInt1537 = loopCycle;
  9007. int k = stream.readBits(1);
  9008. if (k == 1)
  9009. anIntArray894[anInt893++] = j;
  9010. int l = stream.readBits(1);
  9011. int i1 = stream.readBits(5);
  9012. if (i1 > 15)
  9013. i1 -= 32;
  9014. int j1 = stream.readBits(5);
  9015. if (j1 > 15)
  9016. j1 -= 32;
  9017. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  9018. l == 1);
  9019. }
  9020. stream.finishBitAccess();
  9021. }
  9022.  
  9023. public String indexLocation(int cacheIndex, int index) {
  9024. return Signlink.findcachedir() + "index" + cacheIndex + "/"
  9025. + (index != -1 ? index + ".gz" : "");
  9026. }
  9027.  
  9028. public void repackCacheIndex(int cacheIndex) {
  9029. System.out.println("Started repacking index " + cacheIndex + ".");
  9030. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  9031. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  9032. try {
  9033. for (int index = 0; index < indexLength; index++) {
  9034. int fileIndex = Integer
  9035. .parseInt(getFileNameWithoutExtension(file[index]
  9036. .toString()));
  9037. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  9038. if (data != null && data.length > 0) {
  9039. decompressors[cacheIndex].method234(data.length, data,
  9040. fileIndex);
  9041. System.out.println("Repacked " + fileIndex + ".");
  9042. } else {
  9043. System.out.println("Unable to locate index " + fileIndex
  9044. + ".");
  9045. }
  9046. }
  9047. } catch (Exception e) {
  9048. System.out.println("Error packing cache index " + cacheIndex + ".");
  9049. }
  9050. System.out.println("Finished repacking " + cacheIndex + ".");
  9051. }
  9052.  
  9053. public byte[] fileToByteArray(int cacheIndex, int index) {
  9054. try {
  9055. if (indexLocation(cacheIndex, index).length() <= 0
  9056. || indexLocation(cacheIndex, index) == null) {
  9057. return null;
  9058. }
  9059. File file = new File(indexLocation(cacheIndex, index));
  9060. byte[] fileData = new byte[(int) file.length()];
  9061. FileInputStream fis = new FileInputStream(file);
  9062. fis.read(fileData);
  9063. fis.close();
  9064. return fileData;
  9065. } catch (Exception e) {
  9066. return null;
  9067. }
  9068. }
  9069.  
  9070. public boolean inCircle(int circleX, int circleY, int clickX, int clickY,
  9071. int radius) {
  9072. return java.lang.Math.pow((circleX + radius - clickX), 2)
  9073. + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math
  9074. .pow(radius, 2);
  9075. }
  9076.  
  9077. private void processMainScreenClick() {
  9078. if (anInt1021 != 0)
  9079. return;
  9080. if (super.clickMode3 == 1) {
  9081. int i = (clientSize == 0 ? super.saveClickX - 25 - 545
  9082. : super.saveClickX - clientWidth + 183);
  9083. int j = (clientSize == 0 ? super.saveClickY - 9
  9084. : super.saveClickY - 10);
  9085. if (i >= 0 && j >= 0 && i < 146 && j < 151 && canClickMap()) {
  9086. if (inCircle(0, 0, i, j, 77)) {
  9087. i -= 73;
  9088. j -= 75;
  9089. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9090. int i1 = Texture.anIntArray1470[k];
  9091. int j1 = Texture.anIntArray1471[k];
  9092. i1 = i1 * (minimapInt3 + 256) >> 8;
  9093. j1 = j1 * (minimapInt3 + 256) >> 8;
  9094. int k1 = j * i1 + i * j1 >> 11;
  9095. int l1 = j * j1 - i * i1 >> 11;
  9096. int i2 = myPlayer.x + k1 >> 7;
  9097. int j2 = myPlayer.y - l1 >> 7;
  9098. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0,
  9099. 0, j2, myPlayer.smallX[0], true, i2);
  9100. if (flag1) {
  9101. stream.writeWordBigEndian(i);
  9102. stream.writeWordBigEndian(j);
  9103. stream.writeWord(minimapInt1);
  9104. stream.writeWordBigEndian(57);
  9105. stream.writeWordBigEndian(minimapInt2);
  9106. stream.writeWordBigEndian(minimapInt3);
  9107. stream.writeWordBigEndian(89);
  9108. stream.writeWord(myPlayer.x);
  9109. stream.writeWord(myPlayer.y);
  9110. stream.writeWordBigEndian(anInt1264);
  9111. stream.writeWordBigEndian(63);
  9112. }
  9113. }
  9114. anInt1117++;
  9115. if (anInt1117 > 1151) {
  9116. anInt1117 = 0;
  9117. stream.createFrame(246);
  9118. stream.writeWordBigEndian(0);
  9119. int l = stream.currentOffset;
  9120. if ((int) (Math.random() * 2D) == 0)
  9121. stream.writeWordBigEndian(101);
  9122. stream.writeWordBigEndian(197);
  9123. stream.writeWord((int) (Math.random() * 65536D));
  9124. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9125. stream.writeWordBigEndian(67);
  9126. stream.writeWord(14214);
  9127. if ((int) (Math.random() * 2D) == 0)
  9128. stream.writeWord(29487);
  9129. stream.writeWord((int) (Math.random() * 65536D));
  9130. if ((int) (Math.random() * 2D) == 0)
  9131. stream.writeWordBigEndian(220);
  9132. stream.writeWordBigEndian(180);
  9133. stream.writeBytes(stream.currentOffset - l);
  9134. }
  9135. }
  9136. }
  9137. }
  9138.  
  9139. private String interfaceIntToString(int j) {
  9140. if (j < 0x3b9ac9ff)
  9141. return String.valueOf(j);
  9142. else
  9143. return "*";
  9144. }
  9145.  
  9146. private void showErrorScreen() {
  9147. Graphics g = getGameComponent().getGraphics();
  9148. g.setColor(Color.black);
  9149. g.fillRect(0, 0, 765, 503);
  9150. method4(1);
  9151. if (loadingError) {
  9152. aBoolean831 = false;
  9153. g.setFont(new Font("Helvetica", 1, 16));
  9154. g.setColor(Color.yellow);
  9155. int k = 35;
  9156. g.drawString("Sorry, an error has occured whilst loading OwnXile",
  9157. 30, k);
  9158. k += 50;
  9159. g.setColor(Color.white);
  9160. g.drawString("To fix this try the following (in order):", 30, k);
  9161. k += 50;
  9162. g.setColor(Color.white);
  9163. g.setFont(new Font("Helvetica", 1, 12));
  9164. g.drawString(
  9165. "1: Try closing ALL open web-browser windows, and reloading",
  9166. 30, k);
  9167. k += 30;
  9168. g.drawString(
  9169. "2: Try clearing your web-browsers cache from tools->internet options",
  9170. 30, k);
  9171. k += 30;
  9172. g.drawString("3: Try using a different game-world", 30, k);
  9173. k += 30;
  9174. g.drawString("4: Try rebooting your computer", 30, k);
  9175. k += 30;
  9176. g.drawString(
  9177. "5: Try selecting a different version of Java from the play-game menu",
  9178. 30, k);
  9179. }
  9180. if (genericLoadingError) {
  9181. aBoolean831 = false;
  9182. g.setFont(new Font("Helvetica", 1, 20));
  9183. g.setColor(Color.white);
  9184. g.drawString("Error - unable to load game!", 50, 50);
  9185. g.drawString("To play OwnXile make sure you play from", 50, 100);
  9186. g.drawString("http://www.ownxile.com", 50, 150);
  9187. }
  9188. if (rsAlreadyLoaded) {
  9189. aBoolean831 = false;
  9190. g.setColor(Color.yellow);
  9191. int l = 35;
  9192. g.drawString(
  9193. "Error a copy of OwnXile already appears to be loaded", 30,
  9194. l);
  9195. l += 50;
  9196. g.setColor(Color.white);
  9197. g.drawString("To fix this try the following (in order):", 30, l);
  9198. l += 50;
  9199. g.setColor(Color.white);
  9200. g.setFont(new Font("Helvetica", 1, 12));
  9201. g.drawString(
  9202. "1: Try closing ALL open web-browser windows, and reloading",
  9203. 30, l);
  9204. l += 30;
  9205. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  9206. l += 30;
  9207. }
  9208. }
  9209.  
  9210. public URL getCodeBase() {
  9211. try {
  9212. return new URL(server + ":" + (80 + portOff));
  9213. } catch (Exception _ex) {
  9214. }
  9215. return null;
  9216. }
  9217.  
  9218. private void method95() {
  9219. for (int j = 0; j < npcCount; j++) {
  9220. int k = npcIndices[j];
  9221. NPC npc = npcArray[k];
  9222. if (npc != null)
  9223. method96(npc);
  9224. }
  9225. }
  9226.  
  9227. private void method96(Entity entity) {
  9228. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  9229. || entity.y >= 13184) {
  9230. entity.anim = -1;
  9231. entity.anInt1520 = -1;
  9232. entity.anInt1547 = 0;
  9233. entity.anInt1548 = 0;
  9234. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9235. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9236. entity.method446();
  9237. }
  9238. if (entity == myPlayer
  9239. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  9240. entity.anim = -1;
  9241. entity.anInt1520 = -1;
  9242. entity.anInt1547 = 0;
  9243. entity.anInt1548 = 0;
  9244. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9245. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9246. entity.method446();
  9247. }
  9248. if (entity.anInt1547 > loopCycle)
  9249. method97(entity);
  9250. else if (entity.anInt1548 >= loopCycle)
  9251. method98(entity);
  9252. else
  9253. method99(entity);
  9254. method100(entity);
  9255. method101(entity);
  9256. }
  9257.  
  9258. private void method97(Entity entity) {
  9259. int i = entity.anInt1547 - loopCycle;
  9260. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9261. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9262. entity.x += (j - entity.x) / i;
  9263. entity.y += (k - entity.y) / i;
  9264. entity.anInt1503 = 0;
  9265. if (entity.anInt1549 == 0)
  9266. entity.turnDirection = 1024;
  9267. if (entity.anInt1549 == 1)
  9268. entity.turnDirection = 1536;
  9269. if (entity.anInt1549 == 2)
  9270. entity.turnDirection = 0;
  9271. if (entity.anInt1549 == 3)
  9272. entity.turnDirection = 512;
  9273. }
  9274.  
  9275. private void method98(Entity entity) {
  9276. if (entity.anInt1548 == loopCycle
  9277. || entity.anim == -1
  9278. || entity.anInt1529 != 0
  9279. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  9280. .method258(entity.anInt1527)) {
  9281. int i = entity.anInt1548 - entity.anInt1547;
  9282. int j = loopCycle - entity.anInt1547;
  9283. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9284. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9285. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9286. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9287. entity.x = (k * (i - j) + i1 * j) / i;
  9288. entity.y = (l * (i - j) + j1 * j) / i;
  9289. }
  9290. entity.anInt1503 = 0;
  9291. if (entity.anInt1549 == 0)
  9292. entity.turnDirection = 1024;
  9293. if (entity.anInt1549 == 1)
  9294. entity.turnDirection = 1536;
  9295. if (entity.anInt1549 == 2)
  9296. entity.turnDirection = 0;
  9297. if (entity.anInt1549 == 3)
  9298. entity.turnDirection = 512;
  9299. entity.anInt1552 = entity.turnDirection;
  9300. }
  9301.  
  9302. private void method99(Entity entity) {
  9303. entity.anInt1517 = entity.anInt1511;
  9304. if (entity.smallXYIndex == 0) {
  9305. entity.anInt1503 = 0;
  9306. return;
  9307. }
  9308. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9309. Animation animation = Animation.anims[entity.anim];
  9310. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  9311. entity.anInt1503++;
  9312. return;
  9313. }
  9314. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  9315. entity.anInt1503++;
  9316. return;
  9317. }
  9318. }
  9319. int i = entity.x;
  9320. int j = entity.y;
  9321. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9322. * 64;
  9323. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9324. * 64;
  9325. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  9326. entity.x = k;
  9327. entity.y = l;
  9328. return;
  9329. }
  9330. if (i < k) {
  9331. if (j < l)
  9332. entity.turnDirection = 1280;
  9333. else if (j > l)
  9334. entity.turnDirection = 1792;
  9335. else
  9336. entity.turnDirection = 1536;
  9337. } else if (i > k) {
  9338. if (j < l)
  9339. entity.turnDirection = 768;
  9340. else if (j > l)
  9341. entity.turnDirection = 256;
  9342. else
  9343. entity.turnDirection = 512;
  9344. } else if (j < l)
  9345. entity.turnDirection = 1024;
  9346. else
  9347. entity.turnDirection = 0;
  9348. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9349. if (i1 > 1024)
  9350. i1 -= 2048;
  9351. int j1 = entity.anInt1555;
  9352. if (i1 >= -256 && i1 <= 256)
  9353. j1 = entity.anInt1554;
  9354. else if (i1 >= 256 && i1 < 768)
  9355. j1 = entity.anInt1557;
  9356. else if (i1 >= -768 && i1 <= -256)
  9357. j1 = entity.anInt1556;
  9358. if (j1 == -1)
  9359. j1 = entity.anInt1554;
  9360. entity.anInt1517 = j1;
  9361. int k1 = 4;
  9362. if (entity.anInt1552 != entity.turnDirection
  9363. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9364. k1 = 2;
  9365. if (entity.smallXYIndex > 2)
  9366. k1 = 6;
  9367. if (entity.smallXYIndex > 3)
  9368. k1 = 8;
  9369. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  9370. k1 = 8;
  9371. entity.anInt1503--;
  9372. }
  9373. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9374. k1 <<= 1;
  9375. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  9376. && entity.anInt1505 != -1)
  9377. entity.anInt1517 = entity.anInt1505;
  9378. if (i < k) {
  9379. entity.x += k1;
  9380. if (entity.x > k)
  9381. entity.x = k;
  9382. } else if (i > k) {
  9383. entity.x -= k1;
  9384. if (entity.x < k)
  9385. entity.x = k;
  9386. }
  9387. if (j < l) {
  9388. entity.y += k1;
  9389. if (entity.y > l)
  9390. entity.y = l;
  9391. } else if (j > l) {
  9392. entity.y -= k1;
  9393. if (entity.y < l)
  9394. entity.y = l;
  9395. }
  9396. if (entity.x == k && entity.y == l) {
  9397. entity.smallXYIndex--;
  9398. if (entity.anInt1542 > 0)
  9399. entity.anInt1542--;
  9400. }
  9401. }
  9402.  
  9403. private void method100(Entity entity) {
  9404. if (entity.anInt1504 == 0)
  9405. return;
  9406. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  9407. NPC npc = npcArray[entity.interactingEntity];
  9408. if (npc != null) {
  9409. int i1 = entity.x - npc.x;
  9410. int k1 = entity.y - npc.y;
  9411. if (i1 != 0 || k1 != 0)
  9412. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9413. }
  9414. }
  9415. if (entity.interactingEntity >= 32768) {
  9416. int j = entity.interactingEntity - 32768;
  9417. if (j == unknownInt10)
  9418. j = myPlayerIndex;
  9419. Player player = playerArray[j];
  9420. if (player != null) {
  9421. int l1 = entity.x - player.x;
  9422. int i2 = entity.y - player.y;
  9423. if (l1 != 0 || i2 != 0)
  9424. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9425. }
  9426. }
  9427. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  9428. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  9429. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9430. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9431. if (k != 0 || j1 != 0)
  9432. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9433. entity.anInt1538 = 0;
  9434. entity.anInt1539 = 0;
  9435. }
  9436. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9437. if (l != 0) {
  9438. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9439. entity.anInt1552 = entity.turnDirection;
  9440. else if (l > 1024)
  9441. entity.anInt1552 -= entity.anInt1504;
  9442. else
  9443. entity.anInt1552 += entity.anInt1504;
  9444. entity.anInt1552 &= 0x7ff;
  9445. if (entity.anInt1517 == entity.anInt1511
  9446. && entity.anInt1552 != entity.turnDirection) {
  9447. if (entity.anInt1512 != -1) {
  9448. entity.anInt1517 = entity.anInt1512;
  9449. return;
  9450. }
  9451. entity.anInt1517 = entity.anInt1554;
  9452. }
  9453. }
  9454. }
  9455.  
  9456. public void method101(Entity entity) {
  9457. entity.aBoolean1541 = false;
  9458. if (entity.anInt1517 != -1) {
  9459. Animation animation = Animation.anims[entity.anInt1517];
  9460. entity.anInt1519++;
  9461. if (entity.anInt1518 < animation.anInt352
  9462. && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  9463. entity.anInt1519 = 0;
  9464. entity.anInt1518++;
  9465. }
  9466. if (entity.anInt1518 >= animation.anInt352) {
  9467. entity.anInt1519 = 0;
  9468. entity.anInt1518 = 0;
  9469. }
  9470. }
  9471. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  9472. if (entity.anInt1521 < 0)
  9473. entity.anInt1521 = 0;
  9474. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9475. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  9476. && entity.anInt1522 > animation_1
  9477. .method258(entity.anInt1521); entity.anInt1521++)
  9478. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9479.  
  9480. if (entity.anInt1521 >= animation_1.anInt352
  9481. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9482. entity.anInt1520 = -1;
  9483. }
  9484. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  9485. Animation animation_2 = Animation.anims[entity.anim];
  9486. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  9487. && entity.anInt1547 <= loopCycle
  9488. && entity.anInt1548 < loopCycle) {
  9489. entity.anInt1529 = 1;
  9490. return;
  9491. }
  9492. }
  9493. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9494. Animation animation_3 = Animation.anims[entity.anim];
  9495. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  9496. && entity.anInt1528 > animation_3
  9497. .method258(entity.anInt1527); entity.anInt1527++)
  9498. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9499.  
  9500. if (entity.anInt1527 >= animation_3.anInt352) {
  9501. entity.anInt1527 -= animation_3.anInt356;
  9502. entity.anInt1530++;
  9503. if (entity.anInt1530 >= animation_3.anInt362)
  9504. entity.anim = -1;
  9505. if (entity.anInt1527 < 0
  9506. || entity.anInt1527 >= animation_3.anInt352)
  9507. entity.anim = -1;
  9508. }
  9509. entity.aBoolean1541 = animation_3.aBoolean358;
  9510. }
  9511. if (entity.anInt1529 > 0)
  9512. entity.anInt1529--;
  9513. }
  9514.  
  9515. private void drawGameScreen() {
  9516. if (fullscreenInterfaceID != -1
  9517. && (loadingStage == 2 || super.fullGameScreen != null)) {
  9518. if (loadingStage == 2) {
  9519. method119(anInt945, fullscreenInterfaceID);
  9520. if (openInterfaceID != -1) {
  9521. method119(anInt945, openInterfaceID);
  9522. }
  9523. anInt945 = 0;
  9524. resetAllImageProducers();
  9525. super.fullGameScreen.initDrawingArea();
  9526. Texture.anIntArray1472 = fullScreenTextureArray;
  9527. DrawingArea.setAllPixelsToZero();
  9528. welcomeScreenRaised = true;
  9529. if (openInterfaceID != -1) {
  9530. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  9531. if (rsInterface_1.width == 512
  9532. && rsInterface_1.height == 334
  9533. && rsInterface_1.type == 0) {
  9534. rsInterface_1.width = (clientSize == 0 ? 765
  9535. : clientWidth);
  9536. rsInterface_1.height = (clientSize == 0 ? 503
  9537. : clientHeight);
  9538. }
  9539. drawInterface(0, clientSize == 0 ? 0
  9540. : (clientWidth / 2) - 765 / 2, rsInterface_1,
  9541. clientSize == 0 ? 8 : (clientHeight / 2) - 503 / 2);
  9542. }
  9543. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9544. if (rsInterface.width == 512 && rsInterface.height == 334
  9545. && rsInterface.type == 0) {
  9546. rsInterface.width = (clientSize == 0 ? 765 : clientWidth);
  9547. rsInterface.height = (clientSize == 0 ? 503 : clientHeight);
  9548. }
  9549. drawInterface(0, clientSize == 0 ? 0
  9550. : (clientWidth / 2) - 765 / 2, rsInterface,
  9551. clientSize == 0 ? 8 : (clientHeight / 2) - 503 / 2);
  9552. }
  9553. drawCount++;
  9554. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9555. return;
  9556. } else {
  9557. if (drawCount != 0) {
  9558. resetImageProducers2();
  9559. }
  9560. }
  9561. if (welcomeScreenRaised) {
  9562. welcomeScreenRaised = false;
  9563. if (clientSize == 0) {
  9564. topFrame.drawGraphics(0, super.graphics, 0);
  9565. leftFrame.drawGraphics(4, super.graphics, 0);
  9566. // mapEdgeIP.drawGraphics(4, super.graphics, 516);
  9567. }
  9568. needDrawTabArea = true;
  9569. inputTaken = true;
  9570. tabAreaAltered = true;
  9571. if (loadingStage != 2) {
  9572. if (clientSize == 0) {
  9573. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  9574. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  9575. } else {
  9576. aRSImageProducer_1165.drawGraphics(0, super.graphics, 0);
  9577. }
  9578. }
  9579. }
  9580. if (!menuOpen) {
  9581. processRightClick();
  9582. drawTooltip();
  9583. } else {
  9584. drawMenu(4, 4);
  9585. }
  9586. if (menuOpen && menuScreenArea == 1) {
  9587. }
  9588. if (invOverlayInterfaceID != -1) {
  9589. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9590. if (flag1) {
  9591. }
  9592. }
  9593. if (atInventoryInterfaceType == 2) {
  9594. }
  9595. if (activeInterfaceType == 2) {
  9596. }
  9597. drawTabArea();
  9598. if (backDialogID == -1) {
  9599. aClass9_1059.scrollPosition = (short) (chatScrollMax
  9600. - chatScrollPos - 114);
  9601. if (clientSize == 0) {
  9602. if (super.mouseX > 478 && super.mouseX < 580
  9603. && super.mouseY > 342)
  9604. moveScroller(494, 110, super.mouseX - 0,
  9605. super.mouseY - 348, aClass9_1059, 0, false,
  9606. chatScrollMax);
  9607. } else if (super.mouseX >= 460 && super.mouseX <= 513
  9608. && super.mouseY >= clientHeight - 158
  9609. && super.mouseY <= clientHeight - 44) {
  9610. moveScroller(496 - 16, 114, super.mouseX - 16, super.mouseY,
  9611. aClass9_1059, clientHeight - 158, false, chatScrollMax);
  9612. }
  9613. int i = chatScrollMax - 114 - aClass9_1059.scrollPosition;
  9614. if (i < 0)
  9615. i = 0;
  9616. if (i > chatScrollMax - 114)
  9617. i = chatScrollMax - 114;
  9618. if (chatScrollPos != i) {
  9619. chatScrollPos = i;
  9620. inputTaken = true;
  9621. }
  9622. }
  9623. if (backDialogID != -1) {
  9624. boolean flag2 = method119(anInt945, backDialogID);
  9625. if (flag2)
  9626. inputTaken = true;
  9627. }
  9628. if (atInventoryInterfaceType == 3)
  9629. inputTaken = true;
  9630. if (activeInterfaceType == 3)
  9631. inputTaken = true;
  9632. if (aString844 != null)
  9633. inputTaken = true;
  9634. if (menuOpen && menuScreenArea == 2)
  9635. inputTaken = true;
  9636. if (inputTaken) {
  9637. drawChatArea();
  9638. }
  9639. if (loadingStage == 2)
  9640. method146();
  9641. if (loadingStage == 2) {
  9642. if (clientSize == 0) {
  9643. drawMinimap();
  9644. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  9645. }
  9646. }
  9647. if (anInt1054 != -1)
  9648. tabAreaAltered = true;
  9649. if (tabAreaAltered) {
  9650. if (anInt1054 != -1 && anInt1054 == tabID) {
  9651. anInt1054 = -1;
  9652. stream.createFrame(120);
  9653. stream.writeWordBigEndian(tabID);
  9654. }
  9655. tabAreaAltered = false;
  9656. aRSImageProducer_1125.initDrawingArea();
  9657. aRSImageProducer_1165.initDrawingArea();
  9658. }
  9659. anInt945 = 0;
  9660. }
  9661.  
  9662. private boolean buildFriendsListMenu(RSInterface class9) {
  9663. int i = class9.contentType;
  9664. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  9665. if (i >= 801)
  9666. i -= 701;
  9667. else if (i >= 701)
  9668. i -= 601;
  9669. else if (i >= 101)
  9670. i -= 101;
  9671. else
  9672. i--;
  9673. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9674. menuActionID[menuActionRow] = 792;
  9675. menuActionRow++;
  9676. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9677. menuActionID[menuActionRow] = 639;
  9678. menuActionRow++;
  9679. return true;
  9680. }
  9681. if (i >= 401 && i <= 500) {
  9682. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  9683. menuActionID[menuActionRow] = 322;
  9684. menuActionRow++;
  9685. return true;
  9686. } else {
  9687. return false;
  9688. }
  9689. }
  9690.  
  9691. private void method104() {
  9692. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  9693. .reverseGetFirst();
  9694. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  9695. .reverseGetNext())
  9696. if (class30_sub2_sub4_sub3.anInt1560 != plane
  9697. || class30_sub2_sub4_sub3.aBoolean1567)
  9698. class30_sub2_sub4_sub3.unlink();
  9699. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  9700. class30_sub2_sub4_sub3.method454(anInt945);
  9701. if (class30_sub2_sub4_sub3.aBoolean1567)
  9702. class30_sub2_sub4_sub3.unlink();
  9703. else
  9704. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  9705. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  9706. class30_sub2_sub4_sub3.anInt1562, 60,
  9707. class30_sub2_sub4_sub3.anInt1561,
  9708. class30_sub2_sub4_sub3, false);
  9709. }
  9710.  
  9711. }
  9712.  
  9713. public void drawBlackBox(int xPos, int yPos) {
  9714. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  9715. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  9716. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  9717. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  9718. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  9719. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  9720. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  9721. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  9722. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  9723. }
  9724.  
  9725. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9726. if (class9.parentID == 197 && clientSize != 0) {
  9727. k = clientWidth - 120;
  9728. l = 170;
  9729. }
  9730. if (class9.type != 0 || class9.children == null)
  9731. return;
  9732. if (class9.isMouseoverTriggered && anInt1026 != class9.id
  9733. && anInt1048 != class9.id && anInt1039 != class9.id)
  9734. return;
  9735. int i1 = DrawingArea.topX;
  9736. int j1 = DrawingArea.topY;
  9737. int k1 = DrawingArea.bottomX;
  9738. int l1 = DrawingArea.bottomY;
  9739.  
  9740. int alpha = class9.transparency;
  9741. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9742. int i2 = class9.children.length;
  9743. for (int j2 = 0; j2 < i2; j2++) {
  9744. int k2 = class9.childX[j2] + k;
  9745. int l2 = (class9.childY[j2] + l) - j;
  9746. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9747. k2 += class9_1.anInt263;
  9748. l2 += class9_1.anInt265;
  9749. if (class9_1.contentType > 0)
  9750. drawFriendsListOrWelcomeScreen(class9_1);
  9751. if ((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2
  9752. && i1 >= j2 && k < i2 + class9_1.width
  9753. && i1 < j2 + class9_1.height)
  9754. if (class9_1.hoverType >= 0)
  9755. anInt886 = class9_1.hoverType;
  9756. else
  9757. anInt886 = class9_1.id;
  9758. if (class9_1.type == 8 && k >= i2 && i1 >= j2
  9759. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  9760. anInt1315 = class9_1.id;
  9761. }
  9762. if (class9_1.type == 0) {
  9763. SortTabs();
  9764. if (class9_1.scrollPosition > class9_1.scrollMax
  9765. - class9_1.height)
  9766. class9_1.scrollPosition = class9_1.scrollMax
  9767. - class9_1.height;
  9768. if (class9_1.scrollPosition < 0)
  9769. class9_1.scrollPosition = 0;
  9770. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9771. if (class9_1.scrollMax > class9_1.height)
  9772. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2,
  9773. k2 + class9_1.width, class9_1.scrollMax);
  9774. } else if (class9_1.type != 1)
  9775. if (class9_1.type == 2) {
  9776. int i3 = 0;
  9777. for (int l3 = 0; l3 < class9_1.height; l3++) {
  9778. for (int l4 = 0; l4 < class9_1.width; l4++) {
  9779. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9780. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9781. if (i3 < 20) {
  9782. k5 += class9_1.spritesX[i3];
  9783. j6 += class9_1.spritesY[i3];
  9784. }
  9785. if (class9_1.inv[i3] > 0) {
  9786. int k6 = 0;
  9787. int j7 = 0;
  9788. int j9 = class9_1.inv[i3] - 1;
  9789. if (k5 > DrawingArea.topX - 32
  9790. && k5 < DrawingArea.bottomX
  9791. && j6 > DrawingArea.topY - 32
  9792. && j6 < DrawingArea.bottomY
  9793. || activeInterfaceType != 0
  9794. && anInt1085 == i3) {
  9795. int l9 = 0;
  9796. if (itemSelected == 1 && anInt1283 == i3
  9797. && anInt1284 == class9_1.id)
  9798. l9 = 0xffffff;
  9799. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  9800. .getSprite(j9,
  9801. class9_1.invStackSizes[i3],
  9802. l9);
  9803. if (class30_sub2_sub1_sub1_2 != null) {
  9804. if (activeInterfaceType != 0
  9805. && anInt1085 == i3
  9806. && anInt1084 == class9_1.id) {
  9807. k6 = super.mouseX - anInt1087;
  9808. j7 = super.mouseY - anInt1088;
  9809. if (k6 < 5 && k6 > -5)
  9810. k6 = 0;
  9811. if (j7 < 5 && j7 > -5)
  9812. j7 = 0;
  9813. if (anInt989 < 12) {
  9814. k6 = 0;
  9815. j7 = 0;
  9816. }
  9817. class30_sub2_sub1_sub1_2
  9818. .drawSprite1(k5 + k6, j6
  9819. + j7);
  9820. if (j6 + j7 < DrawingArea.topY
  9821. && class9.scrollPosition > 0) {
  9822. int i10 = (anInt945 * (DrawingArea.topY
  9823. - j6 - j7)) / 3;
  9824. if (i10 > anInt945 * 10)
  9825. i10 = anInt945 * 10;
  9826. if (i10 > class9.scrollPosition)
  9827. i10 = class9.scrollPosition;
  9828. class9.scrollPosition -= i10;
  9829. anInt1088 += i10;
  9830. }
  9831. if (j6 + j7 + 32 > DrawingArea.bottomY
  9832. && class9.scrollPosition < class9.scrollMax
  9833. - class9.height) {
  9834. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9835. if (j10 > anInt945 * 10)
  9836. j10 = anInt945 * 10;
  9837. if (j10 > class9.scrollMax
  9838. - class9.height
  9839. - class9.scrollPosition)
  9840. j10 = class9.scrollMax
  9841. - class9.height
  9842. - class9.scrollPosition;
  9843. class9.scrollPosition += j10;
  9844. anInt1088 -= j10;
  9845. }
  9846. } else if (atInventoryInterfaceType != 0
  9847. && atInventoryIndex == i3
  9848. && atInventoryInterface == class9_1.id)
  9849. class30_sub2_sub1_sub1_2
  9850. .drawSprite1(k5, j6);
  9851. else
  9852. class30_sub2_sub1_sub1_2
  9853. .drawSprite(k5, j6);
  9854. if (class30_sub2_sub1_sub1_2.anInt1444 == 33
  9855. || class9_1.invStackSizes[i3] != 1) {
  9856. int k10 = class9_1.invStackSizes[i3];
  9857. smallText.method385(0,
  9858. intToKOrMil(k10), j6 + 10
  9859. + j7, k5 + 1 + k6);
  9860. if (k10 >= 1)
  9861. smallText.method385(0xFFFF00,
  9862. intToKOrMil(k10), j6
  9863. + 9 + j7, k5
  9864. + k6);
  9865. if (k10 >= 100000)
  9866. smallText.method385(0xFFFFFF,
  9867. intToKOrMil(k10), j6
  9868. + 9 + j7, k5
  9869. + k6);
  9870. if (k10 >= 10000000)
  9871. smallText.method385(0x00FF80,
  9872. intToKOrMil(k10), j6
  9873. + 9 + j7, k5
  9874. + k6);
  9875. }
  9876. }
  9877. }
  9878. } else if (class9_1.sprites != null && i3 < 20) {
  9879. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9880. if (class30_sub2_sub1_sub1_1 != null)
  9881. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9882. }
  9883. i3++;
  9884. }
  9885. }
  9886. } else if (class9_1.type == 13) {
  9887. int i3 = 0;
  9888. for (int l3 = 0; l3 < class9_1.height; l3++) {
  9889. for (int l4 = 0; l4 < class9_1.width; l4++) {
  9890. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9891. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9892. if (i3 < 20) {
  9893. k5 += class9_1.spritesX[i3];
  9894. j6 += class9_1.spritesY[i3];
  9895. }
  9896. if (class9_1.inv[i3] > 0) {
  9897. int k6 = 0;
  9898. int j7 = 0;
  9899. int j9 = class9_1.inv[i3] - 1;
  9900. if (k5 > DrawingArea.topX - 32
  9901. && k5 < DrawingArea.bottomX
  9902. && j6 > DrawingArea.topY - 32
  9903. && j6 < DrawingArea.bottomY
  9904. || activeInterfaceType != 0
  9905. && anInt1085 == i3) {
  9906. int l9 = 0;
  9907. if (itemSelected == 1 && anInt1283 == i3
  9908. && anInt1284 == class9_1.id)
  9909. l9 = 0xffffff;
  9910. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  9911. .getSprite(j9,
  9912. class9_1.invStackSizes[i3],
  9913. l9);
  9914. if (class30_sub2_sub1_sub1_2 != null) {
  9915. if (activeInterfaceType != 0
  9916. && anInt1085 == i3
  9917. && anInt1084 == class9_1.id) {
  9918. k6 = super.mouseX - anInt1087;
  9919. j7 = super.mouseY - anInt1088;
  9920. if (k6 < 5 && k6 > -5)
  9921. k6 = 0;
  9922. if (j7 < 5 && j7 > -5)
  9923. j7 = 0;
  9924. if (anInt989 < 10) {
  9925. k6 = 0;
  9926. j7 = 0;
  9927. }
  9928. class30_sub2_sub1_sub1_2
  9929. .drawSprite1(k5 + k6, j6
  9930. + j7);
  9931.  
  9932. if (j6 + j7 < DrawingArea.topY
  9933. && class9.scrollPosition > 0) {
  9934. int i10 = (anInt945 * (DrawingArea.topY
  9935. - j6 - j7)) / 3;
  9936. if (i10 > anInt945 * 10)
  9937. i10 = anInt945 * 10;
  9938. if (i10 > class9.scrollPosition)
  9939. i10 = class9.scrollPosition;
  9940. class9.scrollPosition -= i10;
  9941. anInt1088 += i10;
  9942. }
  9943. if (j6 + j7 + 32 > DrawingArea.bottomY
  9944. && class9.scrollPosition < class9.scrollMax
  9945. - class9.height) {
  9946. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9947. if (j10 > anInt945 * 10)
  9948. j10 = anInt945 * 10;
  9949. if (j10 > class9.scrollMax
  9950. - class9.height
  9951. - class9.scrollPosition)
  9952. j10 = class9.scrollMax
  9953. - class9.height
  9954. - class9.scrollPosition;
  9955. class9.scrollPosition += j10;
  9956. anInt1088 -= j10;
  9957. }
  9958. } else if (atInventoryInterfaceType != 0
  9959. && atInventoryIndex == i3
  9960. && atInventoryInterface == class9_1.id)
  9961. class30_sub2_sub1_sub1_2
  9962. .drawSprite1(k5, j6);
  9963. else
  9964. class30_sub2_sub1_sub1_2
  9965. .drawSprite(k5, j6);
  9966. }
  9967. }
  9968. } else if (class9_1.sprites != null && i3 < 20) {
  9969. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9970. if (class30_sub2_sub1_sub1_1 != null)
  9971. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9972. }
  9973. i3++;
  9974. }
  9975. }
  9976. }else if (class9_1.type == 3) {
  9977. boolean flag = false;
  9978. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  9979. || anInt1026 == class9_1.id)
  9980. flag = true;
  9981. int j3;
  9982. if (interfaceIsSelected(class9_1)) {
  9983. j3 = class9_1.anInt219;
  9984. if (flag && class9_1.anInt239 != 0)
  9985. j3 = class9_1.anInt239;
  9986. } else {
  9987. j3 = class9_1.textColor;
  9988. if (flag && class9_1.anInt216 != 0)
  9989. j3 = class9_1.anInt216;
  9990. }
  9991. if (class9_1.aByte254 == 0) {
  9992. if (class9_1.aBoolean227)
  9993. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  9994. class9_1.width);
  9995. else
  9996. DrawingArea.fillPixels(k2, class9_1.width,
  9997. class9_1.height, j3, l2);
  9998. } else if (class9_1.aBoolean227)
  9999. DrawingArea.method335(j3, l2, class9_1.width,
  10000. class9_1.height,
  10001. 256 - (class9_1.aByte254 & 0xff), k2);
  10002. else
  10003. DrawingArea.method338(l2, class9_1.height,
  10004. 256 - (class9_1.aByte254 & 0xff), j3,
  10005. class9_1.width, k2);
  10006. } else if (class9_1.type == 4) {
  10007. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  10008. String s = class9_1.message;
  10009. boolean flag1 = false;
  10010. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  10011. || anInt1026 == class9_1.id)
  10012. flag1 = true;
  10013. int i4;
  10014. if (interfaceIsSelected(class9_1)) {
  10015. i4 = class9_1.anInt219;
  10016. if (flag1 && class9_1.anInt239 != 0)
  10017. i4 = class9_1.anInt239;
  10018. if (class9_1.aString228.length() > 0)
  10019. s = class9_1.aString228;
  10020. } else {
  10021. i4 = class9_1.textColor;
  10022. if (flag1 && class9_1.anInt216 != 0)
  10023. i4 = class9_1.anInt216;
  10024. }
  10025. if (class9_1.atActionType == 6 && aBoolean1149) {
  10026. s = "Please wait...";
  10027. i4 = class9_1.textColor;
  10028. }
  10029. if ((backDialogID != -1 || dialogID != -1 || class9_1.message
  10030. .contains("Click here to continue"))
  10031. && (class9.id == backDialogID || class9.id == dialogID)) {
  10032. if (i4 == 0xffff00)
  10033. i4 = 255;
  10034. if (i4 == 49152)
  10035. i4 = 0xffffff;
  10036. }
  10037. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  10038. if (s.indexOf("%") != -1) {
  10039. do {
  10040. int k7 = s.indexOf("%1");
  10041. if (k7 == -1)
  10042. break;
  10043. s = s.substring(0, k7)
  10044. + interfaceIntToString(extractInterfaceValues(
  10045. class9_1, 0))
  10046. + s.substring(k7 + 2);
  10047. } while (true);
  10048. do {
  10049. int l7 = s.indexOf("%2");
  10050. if (l7 == -1)
  10051. break;
  10052. s = s.substring(0, l7)
  10053. + interfaceIntToString(extractInterfaceValues(
  10054. class9_1, 1))
  10055. + s.substring(l7 + 2);
  10056. } while (true);
  10057. do {
  10058. int i8 = s.indexOf("%3");
  10059. if (i8 == -1)
  10060. break;
  10061. s = s.substring(0, i8)
  10062. + interfaceIntToString(extractInterfaceValues(
  10063. class9_1, 2))
  10064. + s.substring(i8 + 2);
  10065. } while (true);
  10066. do {
  10067. int j8 = s.indexOf("%4");
  10068. if (j8 == -1)
  10069. break;
  10070. s = s.substring(0, j8)
  10071. + interfaceIntToString(extractInterfaceValues(
  10072. class9_1, 3))
  10073. + s.substring(j8 + 2);
  10074. } while (true);
  10075. do {
  10076. int k8 = s.indexOf("%5");
  10077. if (k8 == -1)
  10078. break;
  10079. s = s.substring(0, k8)
  10080. + interfaceIntToString(extractInterfaceValues(
  10081. class9_1, 4))
  10082. + s.substring(k8 + 2);
  10083. } while (true);
  10084. }
  10085. int l8 = s.indexOf("\\n");
  10086. String s1;
  10087. if (l8 != -1) {
  10088. s1 = s.substring(0, l8);
  10089. s = s.substring(l8 + 2);
  10090. } else {
  10091. s1 = s;
  10092. s = "";
  10093. }
  10094. if (class9_1.centerText)
  10095. textDrawingArea.method382(i4, k2 + class9_1.width
  10096. / 2, s1, l6, class9_1.textShadow);
  10097. else
  10098. textDrawingArea.method389(class9_1.textShadow, k2,
  10099. i4, s1, l6);
  10100. }
  10101. } else if (class9_1.type == 5) {
  10102. Sprite sprite;
  10103. if (interfaceIsSelected(class9_1))
  10104. sprite = class9_1.sprite2;
  10105. else
  10106. sprite = class9_1.sprite1;
  10107. if (sprite != null) {
  10108. if (spellSelected == 1 && class9_1.id == spellID
  10109. && spellID != 0)
  10110. sprite.drawSprite(k2, l2, 0xffffff);
  10111. else if (sprite != null) {
  10112. if (class9_1.drawsTransparent) {
  10113. sprite.drawTransparentSprite(k2, l2, alpha);
  10114. } else {
  10115. sprite.drawSprite(k2, l2);
  10116. }
  10117. }
  10118. }
  10119. if (sprite != null)
  10120. if (class9_1.drawsTransparent) {
  10121. sprite.drawSprite1(k2, l2);
  10122. } else {
  10123. sprite.drawSprite(k2, l2);
  10124. }
  10125. } else if (class9_1.type == 6) {
  10126. int k3 = Texture.textureInt1;
  10127. int j4 = Texture.textureInt2;
  10128. Texture.textureInt1 = k2 + class9_1.width / 2;
  10129. Texture.textureInt2 = l2 + class9_1.height / 2;
  10130. int i5 = Texture.anIntArray1470[class9_1.modelRotation1]
  10131. * class9_1.modelZoom >> 16;
  10132. int l5 = Texture.anIntArray1471[class9_1.modelRotation1]
  10133. * class9_1.modelZoom >> 16;
  10134. boolean flag2 = interfaceIsSelected(class9_1);
  10135. int i7;
  10136. if (flag2)
  10137. i7 = class9_1.anInt258;
  10138. else
  10139. i7 = class9_1.anInt257;
  10140. Model model;
  10141. if (i7 == -1) {
  10142. model = class9_1.method209(-1, -1, flag2);
  10143. } else {
  10144. Animation animation = Animation.anims[i7];
  10145. model = class9_1.method209(
  10146. animation.anIntArray354[class9_1.anInt246],
  10147. animation.anIntArray353[class9_1.anInt246],
  10148. flag2);
  10149. }
  10150. if (model != null)
  10151. model.method482(class9_1.modelRotation2, 0,
  10152. class9_1.modelRotation1, 0, i5, l5);
  10153. Texture.textureInt1 = k3;
  10154. Texture.textureInt2 = j4;
  10155. } else if (class9_1.type == 7) {
  10156. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  10157. int k4 = 0;
  10158. for (int j5 = 0; j5 < class9_1.height; j5++) {
  10159. for (int i6 = 0; i6 < class9_1.width; i6++) {
  10160. if (class9_1.inv[k4] > 0) {
  10161. ItemDef itemDef = ItemDef
  10162. .forID(class9_1.inv[k4] - 1);
  10163. String s2 = itemDef.name;
  10164. if (itemDef.stackable
  10165. || class9_1.invStackSizes[k4] != 1)
  10166. s2 = s2
  10167. + " x"
  10168. + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  10169. int i9 = k2 + i6
  10170. * (115 + class9_1.invSpritePadX);
  10171. int k9 = l2 + j5
  10172. * (12 + class9_1.invSpritePadY);
  10173. if (class9_1.centerText)
  10174. textDrawingArea_1.method382(
  10175. class9_1.textColor, i9
  10176. + class9_1.width / 2, s2,
  10177. k9, class9_1.textShadow);
  10178. else
  10179. textDrawingArea_1.method389(
  10180. class9_1.textShadow, i9,
  10181. class9_1.textColor, s2, k9);
  10182. }
  10183. k4++;
  10184. }
  10185. }
  10186. } else if (class9_1.type == 8
  10187. && (anInt1500 == class9_1.id
  10188. || anInt1044 == class9_1.id || anInt1129 == class9_1.id)
  10189. && anInt1501 == 0 && !menuOpen) {
  10190. int boxWidth = 0;
  10191. int boxHeight = 0;
  10192. TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
  10193. for (String s1 = class9_1.message; s1.length() > 0;) {
  10194. if (s1.indexOf("%") != -1) {
  10195. do {
  10196. int k7 = s1.indexOf("%1");
  10197. if (k7 == -1)
  10198. break;
  10199. s1 = s1.substring(0, k7)
  10200. + interfaceIntToString(extractInterfaceValues(
  10201. class9_1, 0))
  10202. + s1.substring(k7 + 2);
  10203. } while (true);
  10204. do {
  10205. int l7 = s1.indexOf("%2");
  10206. if (l7 == -1)
  10207. break;
  10208. s1 = s1.substring(0, l7)
  10209. + interfaceIntToString(extractInterfaceValues(
  10210. class9_1, 1))
  10211. + s1.substring(l7 + 2);
  10212. } while (true);
  10213. do {
  10214. int i8 = s1.indexOf("%3");
  10215. if (i8 == -1)
  10216. break;
  10217. s1 = s1.substring(0, i8)
  10218. + interfaceIntToString(extractInterfaceValues(
  10219. class9_1, 2))
  10220. + s1.substring(i8 + 2);
  10221. } while (true);
  10222. do {
  10223. int j8 = s1.indexOf("%4");
  10224. if (j8 == -1)
  10225. break;
  10226. s1 = s1.substring(0, j8)
  10227. + interfaceIntToString(extractInterfaceValues(
  10228. class9_1, 3))
  10229. + s1.substring(j8 + 2);
  10230. } while (true);
  10231. do {
  10232. int k8 = s1.indexOf("%5");
  10233. if (k8 == -1)
  10234. break;
  10235. s1 = s1.substring(0, k8)
  10236. + interfaceIntToString(extractInterfaceValues(
  10237. class9_1, 4))
  10238. + s1.substring(k8 + 2);
  10239. } while (true);
  10240. }
  10241. int l7 = s1.indexOf("\\n");
  10242. String s4;
  10243. if (l7 != -1) {
  10244. s4 = s1.substring(0, l7);
  10245. s1 = s1.substring(l7 + 2);
  10246. } else {
  10247. s4 = s1;
  10248. s1 = "";
  10249. }
  10250. int j10 = textDrawingArea_2.getTextWidth(s4);
  10251. if (j10 > boxWidth) {
  10252. boxWidth = j10;
  10253. }
  10254. boxHeight += textDrawingArea_2.anInt1497 + 1;
  10255. }
  10256. boxWidth += 6;
  10257. boxHeight += 7;
  10258. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  10259. int yPos = l2 + class9_1.height + 5;
  10260. if (xPos < k2 + 5)
  10261. xPos = k2 + 5;
  10262. if (xPos + boxWidth > k + class9.width)
  10263. xPos = (k + class9.width) - boxWidth;
  10264. if (yPos + boxHeight > l + class9.height)
  10265. yPos = (l2 - boxHeight);
  10266. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0,
  10267. boxWidth);
  10268. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  10269. String s2 = class9_1.message;
  10270. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2
  10271. .length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {// anInt1497
  10272. if (s2.indexOf("%") != -1) {
  10273. do {
  10274. int k7 = s2.indexOf("%1");
  10275. if (k7 == -1)
  10276. break;
  10277. s2 = s2.substring(0, k7)
  10278. + interfaceIntToString(extractInterfaceValues(
  10279. class9_1, 0))
  10280. + s2.substring(k7 + 2);
  10281. } while (true);
  10282. do {
  10283. int l7 = s2.indexOf("%2");
  10284. if (l7 == -1)
  10285. break;
  10286. s2 = s2.substring(0, l7)
  10287. + interfaceIntToString(extractInterfaceValues(
  10288. class9_1, 1))
  10289. + s2.substring(l7 + 2);
  10290. } while (true);
  10291. do {
  10292. int i8 = s2.indexOf("%3");
  10293. if (i8 == -1)
  10294. break;
  10295. s2 = s2.substring(0, i8)
  10296. + interfaceIntToString(extractInterfaceValues(
  10297. class9_1, 2))
  10298. + s2.substring(i8 + 2);
  10299. } while (true);
  10300. do {
  10301. int j8 = s2.indexOf("%4");
  10302. if (j8 == -1)
  10303. break;
  10304. s2 = s2.substring(0, j8)
  10305. + interfaceIntToString(extractInterfaceValues(
  10306. class9_1, 3))
  10307. + s2.substring(j8 + 2);
  10308. } while (true);
  10309. do {
  10310. int k8 = s2.indexOf("%5");
  10311. if (k8 == -1)
  10312. break;
  10313. s2 = s2.substring(0, k8)
  10314. + interfaceIntToString(extractInterfaceValues(
  10315. class9_1, 4))
  10316. + s2.substring(k8 + 2);
  10317. } while (true);
  10318. }
  10319. int l11 = s2.indexOf("\\n");
  10320. String s5;
  10321. if (l11 != -1) {
  10322. s5 = s2.substring(0, l11);
  10323. s2 = s2.substring(l11 + 2);
  10324. } else {
  10325. s5 = s2;
  10326. s2 = "";
  10327. }
  10328. if (class9_1.centerText) {
  10329. textDrawingArea_2.method382(yPos, xPos
  10330. + class9_1.width / 2, s5, j11, false);
  10331. } else {
  10332. if (s5.contains("\\r")) {
  10333. String text = s5
  10334. .substring(0, s5.indexOf("\\r"));
  10335. String text2 = s5
  10336. .substring(s5.indexOf("\\r") + 2);
  10337. textDrawingArea_2.method389(false, xPos + 3, 0,
  10338. text, j11);
  10339. int rightX = boxWidth + xPos
  10340. - textDrawingArea_2.getTextWidth(text2)
  10341. - 2;
  10342. textDrawingArea_2.method389(false, rightX, 0,
  10343. text2, j11);
  10344. System.out.println("Box: " + boxWidth + "");
  10345. } else
  10346. textDrawingArea_2.method389(false, xPos + 3, 0,
  10347. s5, j11);
  10348. }
  10349. }
  10350. }
  10351. }
  10352. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10353. }
  10354.  
  10355. private void randomizeBackground(Background background) {
  10356. int j = 256;
  10357. for (int k = 0; k < anIntArray1190.length; k++)
  10358. anIntArray1190[k] = 0;
  10359.  
  10360. for (int l = 0; l < 5000; l++) {
  10361. int i1 = (int) (Math.random() * 128D * (double) j);
  10362. anIntArray1190[i1] = (int) (Math.random() * 256D);
  10363. }
  10364. for (int j1 = 0; j1 < 20; j1++) {
  10365. for (int k1 = 1; k1 < j - 1; k1++) {
  10366. for (int i2 = 1; i2 < 127; i2++) {
  10367. int k2 = i2 + (k1 << 7);
  10368. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  10369. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10370. }
  10371.  
  10372. }
  10373. int ai[] = anIntArray1190;
  10374. anIntArray1190 = anIntArray1191;
  10375. anIntArray1191 = ai;
  10376. }
  10377. if (background != null) {
  10378. int l1 = 0;
  10379. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  10380. for (int l2 = 0; l2 < background.anInt1452; l2++)
  10381. if (background.aByteArray1450[l1++] != 0) {
  10382. int i3 = l2 + 16 + background.anInt1454;
  10383. int j3 = j2 + 16 + background.anInt1455;
  10384. int k3 = i3 + (j3 << 7);
  10385. anIntArray1190[k3] = 0;
  10386. }
  10387. }
  10388. }
  10389. }
  10390.  
  10391. private void method107(int i, int j, Stream stream, Player player) {
  10392. if ((i & 0x400) != 0) {
  10393. player.anInt1543 = stream.method428();
  10394. player.anInt1545 = stream.method428();
  10395. player.anInt1544 = stream.method428();
  10396. player.anInt1546 = stream.method428();
  10397. player.anInt1547 = stream.method436() + loopCycle;
  10398. player.anInt1548 = stream.method435() + loopCycle;
  10399. player.anInt1549 = stream.method428();
  10400. player.method446();
  10401. }
  10402. if ((i & 0x100) != 0) {
  10403. player.anInt1520 = stream.method434();
  10404. int k = stream.readDWord(); try {
  10405. if (Class36.animationlist[Integer.parseInt(Integer.toHexString(SpotAnim.cache[player.anInt1520].aAnimation_407.anIntArray353[0]).substring(0, Integer.toHexString(SpotAnim.cache[player.anInt1520].aAnimation_407.anIntArray353[0])
  10406. .length() - 4), 16)].length == 0)
  10407. onDemandFetcher.method558(1,Integer.parseInt(Integer.toHexString(SpotAnim.cache[player.anInt1520].aAnimation_407.anIntArray353[0]).substring(0,Integer.toHexString(SpotAnim.cache[player.anInt1520].aAnimation_407.anIntArray353[0]).length() - 4),16));
  10408. } catch (Exception e) {
  10409. }
  10410. player.anInt1524 = k >> 16;
  10411. player.anInt1523 = loopCycle + (k & 0xffff);
  10412. player.anInt1521 = 0;
  10413. player.anInt1522 = 0;
  10414. if (player.anInt1523 > loopCycle)
  10415. player.anInt1521 = -1;
  10416. if (player.anInt1520 == 65535)
  10417. player.anInt1520 = -1;
  10418. }
  10419. if ((i & 8) != 0) {
  10420. int l = stream.method434();
  10421. if (l == 65535)
  10422. l = -1;
  10423. int i2 = stream.method427();
  10424. if (l == player.anim && l != -1) {
  10425. int i3 = Animation.anims[l].anInt365;
  10426. if (i3 == 1) {
  10427. player.anInt1527 = 0;
  10428. player.anInt1528 = 0;
  10429. player.anInt1529 = i2;
  10430. player.anInt1530 = 0;
  10431. }
  10432. if (i3 == 2)
  10433. player.anInt1530 = 0;
  10434. } else if (l == -1
  10435. || player.anim == -1
  10436. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  10437. player.anim = l;
  10438. player.anInt1527 = 0;
  10439. player.anInt1528 = 0;
  10440. player.anInt1529 = i2;
  10441. player.anInt1530 = 0;
  10442. player.anInt1542 = player.smallXYIndex;
  10443. }
  10444. }
  10445. if ((i & 4) != 0) {
  10446. player.textSpoken = stream.readString();
  10447. if (player.textSpoken.charAt(0) == '~') {
  10448. player.textSpoken = player.textSpoken.substring(1);
  10449. pushMessage(player.textSpoken, 2, player.name);
  10450. } else if (player == myPlayer)
  10451. pushMessage(player.textSpoken, 2, player.name);
  10452. player.anInt1513 = 0;
  10453. player.anInt1531 = 0;
  10454. player.textCycle = 150;
  10455. }
  10456. if ((i & 0x80) != 0) {
  10457. // right fucking here
  10458. int i1 = stream.method434();
  10459. int j2 = stream.readUnsignedByte();
  10460. int j3 = stream.method427();
  10461. int k3 = stream.currentOffset;
  10462. if (player.name != null && player.visible) {
  10463. long l3 = TextClass.longForName(player.name);
  10464. boolean flag = false;
  10465. if (j2 <= 1) {
  10466. for (int i4 = 0; i4 < ignoreCount; i4++) {
  10467. if (ignoreListAsLongs[i4] != l3)
  10468. continue;
  10469. flag = true;
  10470. break;
  10471. }
  10472.  
  10473. }
  10474. if (!flag && anInt1251 == 0)
  10475. try {
  10476. aStream_834.currentOffset = 0;
  10477. stream.method442(j3, 0, aStream_834.buffer);
  10478. aStream_834.currentOffset = 0;
  10479. String s = TextInput.method525(j3, aStream_834);
  10480. // s = Censor.doCensor(s);
  10481. player.textSpoken = s;
  10482. player.anInt1513 = i1 >> 8;
  10483. player.privelage = j2;
  10484. player.anInt1531 = i1 & 0xff;
  10485. player.textCycle = 150;
  10486. if (j2 == 2)
  10487. pushMessage(s, 1, "@cr2@" + player.name);
  10488. else if (j2 == 3)
  10489. pushMessage(s, 1, "@cr3@" + player.name);
  10490. else if (j2 == 1)
  10491. pushMessage(s, 1, "@cr1@" + player.name);
  10492. else
  10493. pushMessage(s, 2, player.name);
  10494. } catch (Exception exception) {
  10495. Signlink.reporterror("cde2");
  10496. }
  10497. }
  10498. stream.currentOffset = k3 + j3;
  10499. }
  10500. if ((i & 1) != 0) {
  10501. player.interactingEntity = stream.method434();
  10502. if (player.interactingEntity == 65535)
  10503. player.interactingEntity = -1;
  10504. }
  10505. if ((i & 0x10) != 0) {
  10506. int j1 = stream.method427();
  10507. byte abyte0[] = new byte[j1];
  10508. Stream stream_1 = new Stream(abyte0);
  10509. stream.readBytes(j1, 0, abyte0);
  10510. aStreamArray895s[j] = stream_1;
  10511. player.updatePlayer(stream_1);
  10512. }
  10513. if ((i & 2) != 0) {
  10514. player.anInt1538 = stream.method436();
  10515. player.anInt1539 = stream.method434();
  10516. }
  10517. if ((i & 0x20) != 0) {
  10518. int k1 = stream.readUnsignedByte();
  10519. int k2 = stream.method426();
  10520. player.updateHitData(k2, k1, loopCycle);
  10521. player.loopCycleStatus = loopCycle + 300;
  10522. player.currentHealth = stream.method427();
  10523. player.maxHealth = stream.readUnsignedByte();
  10524. }
  10525. if ((i & 0x200) != 0) {
  10526. int l1 = stream.readUnsignedByte();
  10527. int l2 = stream.method428();
  10528. player.updateHitData(l2, l1, loopCycle);
  10529. player.loopCycleStatus = loopCycle + 300;
  10530. player.currentHealth = stream.readUnsignedByte();
  10531. player.maxHealth = stream.method427();
  10532. }
  10533. }
  10534.  
  10535. private void method108() {
  10536. try {
  10537. int j = myPlayer.x + anInt1278;
  10538. int k = myPlayer.y + anInt1131;
  10539. if (anInt1014 - j < -500 || anInt1014 - j > 500
  10540. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  10541. anInt1014 = j;
  10542. anInt1015 = k;
  10543. }
  10544. if (anInt1014 != j)
  10545. anInt1014 += (j - anInt1014) / 16;
  10546. if (anInt1015 != k)
  10547. anInt1015 += (k - anInt1015) / 16;
  10548. if (super.keyArray[1] == 1)
  10549. anInt1186 += (-24 - anInt1186) / 2;
  10550. else if (super.keyArray[2] == 1)
  10551. anInt1186 += (24 - anInt1186) / 2;
  10552. else
  10553. anInt1186 /= 2;
  10554. if (super.keyArray[3] == 1)
  10555. anInt1187 += (12 - anInt1187) / 2;
  10556. else if (super.keyArray[4] == 1)
  10557. anInt1187 += (-12 - anInt1187) / 2;
  10558. else
  10559. anInt1187 /= 2;
  10560. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  10561. anInt1184 += anInt1187 / 2;
  10562. if (anInt1184 < 128)
  10563. anInt1184 = 128;
  10564. if (anInt1184 > 383)
  10565. anInt1184 = 383;
  10566. int l = anInt1014 >> 7;
  10567. int i1 = anInt1015 >> 7;
  10568. int j1 = method42(plane, anInt1015, anInt1014);
  10569. int k1 = 0;
  10570. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  10571. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  10572. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  10573. int l2 = plane;
  10574. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10575. l2++;
  10576. int i3 = j1 - intGroundArray[l2][l1][k2];
  10577. if (i3 > k1)
  10578. k1 = i3;
  10579. }
  10580.  
  10581. }
  10582.  
  10583. }
  10584. anInt1005++;
  10585. if (anInt1005 > 1512) {
  10586. anInt1005 = 0;
  10587. stream.createFrame(77);
  10588. stream.writeWordBigEndian(0);
  10589. int i2 = stream.currentOffset;
  10590. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10591. stream.writeWordBigEndian(101);
  10592. stream.writeWordBigEndian(233);
  10593. stream.writeWord(45092);
  10594. if ((int) (Math.random() * 2D) == 0)
  10595. stream.writeWord(35784);
  10596. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10597. stream.writeWordBigEndian(64);
  10598. stream.writeWordBigEndian(38);
  10599. stream.writeWord((int) (Math.random() * 65536D));
  10600. stream.writeWord((int) (Math.random() * 65536D));
  10601. stream.writeBytes(stream.currentOffset - i2);
  10602. }
  10603. int j2 = k1 * 192;
  10604. if (j2 > 0x17f00)
  10605. j2 = 0x17f00;
  10606. if (j2 < 32768)
  10607. j2 = 32768;
  10608. if (j2 > anInt984) {
  10609. anInt984 += (j2 - anInt984) / 24;
  10610. return;
  10611. }
  10612. if (j2 < anInt984) {
  10613. anInt984 += (j2 - anInt984) / 80;
  10614. }
  10615. } catch (Exception _ex) {
  10616. Signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  10617. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  10618. + anInt1070 + "," + baseX + "," + baseY);
  10619. throw new RuntimeException("eek");
  10620. }
  10621. }
  10622.  
  10623. public void processDrawing() {
  10624. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  10625. showErrorScreen();
  10626. return;
  10627. }
  10628. if (!loggedIn)
  10629. drawLoginScreen(false);
  10630. else
  10631. drawGameScreen();
  10632. anInt1213 = 0;
  10633. }
  10634.  
  10635. private boolean isFriendOrSelf(String s) {
  10636. if (s == null)
  10637. return false;
  10638. for (int i = 0; i < friendsCount; i++)
  10639. if (s.equalsIgnoreCase(friendsList[i]))
  10640. return true;
  10641. return s.equalsIgnoreCase(myPlayer.name);
  10642. }
  10643.  
  10644. private static String combatDiffColor(int i, int j) {
  10645. int k = i - j;
  10646. if (k < -9)
  10647. return "@red@";
  10648. if (k < -6)
  10649. return "@or3@";
  10650. if (k < -3)
  10651. return "@or2@";
  10652. if (k < 0)
  10653. return "@or1@";
  10654. if (k > 9)
  10655. return "@gre@";
  10656. if (k > 6)
  10657. return "@gr3@";
  10658. if (k > 3)
  10659. return "@gr2@";
  10660. if (k > 0)
  10661. return "@gr1@";
  10662. else
  10663. return "@yel@";
  10664. }
  10665.  
  10666. private void setWaveVolume(int i) {
  10667. Signlink.wavevol = i;
  10668. }
  10669.  
  10670. public static int returnGeneralInterfaceOffsetX() {
  10671. return (int) (clientWidth <= 1000 ? (clientWidth / 2) - 256
  10672. - (clientWidth * 0.1) : (clientWidth / 2) - 256);
  10673. }
  10674.  
  10675. private void draw3dScreen() {
  10676. if (counterOn && clientSize == 0)
  10677. drawCounterOnScreen();
  10678. if (showChat)
  10679. drawSplitPrivateChat();
  10680.  
  10681. if (crossType == 1) {
  10682. crosses[crossIndex / 100].drawSprite(crossX - 8
  10683. - (clientSize == 0 ? 4 : 0), crossY - 8
  10684. - (clientSize == 0 ? 4 : 0));
  10685. }
  10686. if (crossType == 2)
  10687. crosses[4 + crossIndex / 100].drawSprite(crossX - 8
  10688. - (clientSize == 0 ? 4 : 0), crossY - 8
  10689. - (clientSize == 0 ? 4 : 0));
  10690. if (anInt1055 == 1)
  10691. multiWay.drawSprite(
  10692. (clientSize == 0 ? 472
  10693. : (anInt1018 == 197 ? clientWidth - 258
  10694. : clientWidth - 255)),
  10695. (clientSize == 0 ? 296 : (anInt1018 == 197 ? 52 : 20)));
  10696. if (anInt1018 != -1) {
  10697. method119(anInt945, anInt1018);
  10698.  
  10699. if (anInt1018 == 11146 && clientSize != 0) {
  10700. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], -5);
  10701. } else if ((anInt1018 == 2804 || anInt1018 == 11479)
  10702. && clientSize != 0) {
  10703. drawInterface(0, clientWidth / 2 - 256,
  10704. RSInterface.interfaceCache[anInt1018], -5);
  10705. } else if (anInt1018 == 4535 && clientSize != 0) {
  10706. drawInterface(0, -418, RSInterface.interfaceCache[anInt1018],
  10707. -285);
  10708. } else if ((anInt1018 == 15892 || anInt1018 == 15917
  10709. || anInt1018 == 15931 || anInt1018 == 15962)
  10710. && clientSize != 0) {
  10711. drawInterface(0, (anInt1018 == 15892 ? -325 : -349),
  10712. RSInterface.interfaceCache[anInt1018], 25);
  10713. } else
  10714. drawInterface(0, clientSize == 0 ? 0 : (clientWidth / 2) - -80,
  10715. RSInterface.interfaceCache[anInt1018],
  10716. clientSize == 0 ? 0 : (clientHeight / 2) - 550);
  10717. }
  10718. drawParallelWidgets();
  10719. if (openInterfaceID != -1) {
  10720. method119(anInt945, openInterfaceID);
  10721. drawInterface(0, clientSize == 0 ? 0 : (clientWidth / 2) - 356,
  10722. RSInterface.interfaceCache[openInterfaceID],
  10723. clientSize == 0 ? 0 : (clientHeight / 2) - 230);
  10724. }
  10725. method70();
  10726. if (!menuOpen) {
  10727. processRightClick();
  10728. drawTooltip();
  10729. } else
  10730. drawMenu((clientSize == 0 ? 4 : 0), (clientSize == 0 ? 4 : 0));
  10731. /*
  10732. * drawSplitPrivateChat(); if(crossType == 1) { crosses[crossIndex /
  10733. * 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4); anInt1142++;
  10734. * if(anInt1142 > 67) { anInt1142 = 0; stream.createFrame(78); } }
  10735. * if(crossType == 2) crosses[4 + crossIndex / 100].drawSprite(crossX -
  10736. * 8 - 4, crossY - 8 - 4); if(anInt1018 != -1) { method119(anInt945,
  10737. * anInt1018); drawInterface(0, clientSize == 0 ? 0 : (clientWidth / 2)
  10738. * - -80, RSInterface.interfaceCache[anInt1018], clientSize == 0 ? 0 :
  10739. * (clientHeight / 2) - 550); //drawInterface(0, 0,
  10740. * RSInterface.interfaceCache[anInt1018], 0); } if(openInterfaceID !=
  10741. * -1) { method119(anInt945, openInterfaceID); drawInterface(0,
  10742. * clientSize == 0 ? 0 : (clientWidth / 2) - 256,
  10743. * RSInterface.interfaceCache[openInterfaceID], clientSize == 0 ? 0 :
  10744. * (clientHeight / 2) - 167); //drawInterface(0, 0,
  10745. * RSInterface.interfaceCache[openInterfaceID], 0); } method70();
  10746. * if(!menuOpen) {
  10747. *
  10748. * processRightClick();
  10749. *
  10750. * drawTooltip(); } else if(menuScreenArea == 0) drawMenu(4, 4);
  10751. * if(anInt1055 == 1) headIcons[1].drawSprite(472, 296);
  10752. */
  10753. if (fpsOn) {
  10754. char c = '\u01FB';
  10755. int k = 20;
  10756. int i1 = 0xffff00;
  10757. if (super.fps < 15)
  10758. i1 = 0xff0000;
  10759. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  10760. k += 15;
  10761. Runtime runtime = Runtime.getRuntime();
  10762. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10763. i1 = 0xffff00;
  10764. if (j1 > 0x2000000 && lowMem)
  10765. i1 = 0xff0000;
  10766. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10767. k += 15;
  10768. }
  10769. int x = baseX + (myPlayer.x - 6 >> 7);
  10770. int y = baseY + (myPlayer.y - 6 >> 7);
  10771. if (clientData) {
  10772. int calculateWidth = clientWidth - super.mouseX;
  10773. int calculateHeight = clientHeight - super.mouseY;
  10774. aTextDrawingArea_1271.method385(0xffff00, "Dimensions: "
  10775. + clientWidth + " x " + clientHeight, clientSize == 0 ? 225
  10776. : showChat ? clientHeight - 277 : clientHeight - 140, 5);
  10777. aTextDrawingArea_1271.method385(0xffff00, "Mouse Positions: "
  10778. + "clientWidth - " + calculateWidth + ", "
  10779. + "clientHeight - " + calculateHeight,
  10780. clientSize == 0 ? 240 : showChat ? clientHeight - 262
  10781. : clientHeight - 125, 5);
  10782. for (int num = 0; num < anIntArray1235.length; num++) {
  10783. int[] flo = anIntArray1235;
  10784. aTextDrawingArea_1271
  10785. .method385(0xffff00,
  10786. "Floor Map Array: " + Arrays.toString(flo),
  10787. clientSize == 0 ? 255
  10788. : showChat ? clientHeight - 247
  10789. : clientHeight - 110, 5);
  10790. }
  10791. for (int num = 0; num < anIntArray1236.length; num++) {
  10792. int[] obj = anIntArray1236;
  10793. aTextDrawingArea_1271.method385(0xffff00, "Object Map Array: "
  10794. + Arrays.toString(obj), clientSize == 0 ? 270
  10795. : showChat ? clientHeight - 232 : clientHeight - 95, 5);
  10796. }
  10797. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps,
  10798. clientSize == 0 ? 285 : showChat ? clientHeight - 217
  10799. : clientHeight - 80, 5);
  10800. Runtime runtime = Runtime.getRuntime();
  10801. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10802. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k",
  10803. clientSize == 0 ? 299 : showChat ? clientHeight - 202
  10804. : clientHeight - 65, 5);
  10805. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: "
  10806. + super.mouseX + " , Mouse Y: " + super.mouseY,
  10807. clientSize == 0 ? 314 : showChat ? clientHeight - 187
  10808. : clientHeight - 50, 5);
  10809. aTextDrawingArea_1271.method385(0xffff00,
  10810. "Coords: " + x + ", " + y,
  10811. clientSize == 0 ? 329 : showChat ? clientHeight - 172
  10812. : clientHeight - 35, 5);
  10813. }
  10814. if (anInt1104 != 0) {
  10815. int j = anInt1104 / 50;
  10816. int l = j / 60;
  10817. j %= 60;
  10818. if (j < 10)
  10819. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  10820. + l + ":0" + j, 329, 4);
  10821. else
  10822. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  10823. + l + ":" + j, 329, 4);
  10824. anInt849++;
  10825. if (anInt849 > 75) {
  10826. anInt849 = 0;
  10827. stream.createFrame(148);
  10828. }
  10829. }
  10830. }
  10831.  
  10832. private void addIgnore(long l) {
  10833. try {
  10834. if (l == 0L)
  10835. return;
  10836. if (ignoreCount >= 100) {
  10837. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10838. return;
  10839. }
  10840. String s = TextClass.fixName(TextClass.nameForLong(l));
  10841. for (int j = 0; j < ignoreCount; j++)
  10842. if (ignoreListAsLongs[j] == l) {
  10843. pushMessage(s + " is already on your ignore list", 0, "");
  10844. return;
  10845. }
  10846. for (int k = 0; k < friendsCount; k++)
  10847. if (friendsListAsLongs[k] == l) {
  10848. pushMessage("Please remove " + s
  10849. + " from your friend list first", 0, "");
  10850. return;
  10851. }
  10852.  
  10853. ignoreListAsLongs[ignoreCount++] = l;
  10854. needDrawTabArea = true;
  10855. stream.createFrame(133);
  10856. stream.writeQWord(l);
  10857. return;
  10858. } catch (RuntimeException runtimeexception) {
  10859. Signlink.reporterror("45688, " + l + ", " + 4 + ", "
  10860. + runtimeexception.toString());
  10861. }
  10862. throw new RuntimeException();
  10863. }
  10864.  
  10865. private void method114() {
  10866. for (int i = -1; i < playerCount; i++) {
  10867. int j;
  10868. if (i == -1)
  10869. j = myPlayerIndex;
  10870. else
  10871. j = playerIndices[i];
  10872. Player player = playerArray[j];
  10873. if (player != null)
  10874. method96(player);
  10875. }
  10876.  
  10877. }
  10878.  
  10879. private void method115() {
  10880. if (loadingStage == 2) {
  10881. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  10882. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  10883. .reverseGetNext()) {
  10884. if (class30_sub1.anInt1294 > 0)
  10885. class30_sub1.anInt1294--;
  10886. if (class30_sub1.anInt1294 == 0) {
  10887. if (class30_sub1.anInt1299 < 0
  10888. || ObjectManager.method178(class30_sub1.anInt1299,
  10889. class30_sub1.anInt1301)) {
  10890. method142(class30_sub1.anInt1298,
  10891. class30_sub1.anInt1295, class30_sub1.anInt1300,
  10892. class30_sub1.anInt1301, class30_sub1.anInt1297,
  10893. class30_sub1.anInt1296, class30_sub1.anInt1299);
  10894. class30_sub1.unlink();
  10895. }
  10896. } else {
  10897. if (class30_sub1.anInt1302 > 0)
  10898. class30_sub1.anInt1302--;
  10899. if (class30_sub1.anInt1302 == 0
  10900. && class30_sub1.anInt1297 >= 1
  10901. && class30_sub1.anInt1298 >= 1
  10902. && class30_sub1.anInt1297 <= 102
  10903. && class30_sub1.anInt1298 <= 102
  10904. && (class30_sub1.anInt1291 < 0 || ObjectManager
  10905. .method178(class30_sub1.anInt1291,
  10906. class30_sub1.anInt1293))) {
  10907. method142(class30_sub1.anInt1298,
  10908. class30_sub1.anInt1295, class30_sub1.anInt1292,
  10909. class30_sub1.anInt1293, class30_sub1.anInt1297,
  10910. class30_sub1.anInt1296, class30_sub1.anInt1291);
  10911. class30_sub1.anInt1302 = -1;
  10912. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10913. && class30_sub1.anInt1299 == -1)
  10914. class30_sub1.unlink();
  10915. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10916. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  10917. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10918. class30_sub1.unlink();
  10919. }
  10920. }
  10921. }
  10922.  
  10923. }
  10924. }
  10925.  
  10926. private void determineMenuSize() {
  10927. int boxLength = chatTextDrawingArea.getTextWidth("Choose option");
  10928. for (int row = 0; row < menuActionRow; row++) {
  10929. int actionLength = chatTextDrawingArea
  10930. .getTextWidth(menuActionName[row]);
  10931. if (actionLength > boxLength)
  10932. boxLength = actionLength;
  10933. }
  10934. boxLength += 8;
  10935. int offset = 15 * menuActionRow + 21;
  10936. if (super.saveClickX > 0 && super.saveClickY > 0
  10937. && super.saveClickX < 765 && super.saveClickY < 503) {
  10938. int xClick = super.saveClickX - boxLength / 2;
  10939. if (xClick + boxLength > 761) {
  10940. xClick = 761 - boxLength;
  10941. }
  10942. if (xClick < 0) {
  10943. xClick = 0;
  10944. }
  10945. int yClick = super.saveClickY - 0;
  10946. if (yClick + offset > 497) {
  10947. yClick = 497 - offset;
  10948. }
  10949. if (yClick < 0) {
  10950. yClick = 0;
  10951. }
  10952. menuOpen = true;
  10953. menuOffsetX = xClick;
  10954. menuOffsetY = yClick;
  10955. menuWidth = boxLength;
  10956. menuHeight = 15 * menuActionRow + 22;
  10957. }
  10958. if (clientSize != 0) {
  10959. if (super.saveClickX > 0 && super.saveClickY > 0
  10960. && super.saveClickX < clientWidth
  10961. && super.saveClickY < clientHeight) {
  10962. int i1 = super.saveClickX - 0 - boxLength / 2;
  10963. if (i1 + boxLength > clientWidth)
  10964. i1 = clientWidth - boxLength;
  10965. if (i1 < 0)
  10966. i1 = 0;
  10967. int l1 = super.saveClickY - 0;
  10968. if (l1 + offset > clientHeight)
  10969. l1 = clientHeight - offset;
  10970. if (l1 < 0)
  10971. l1 = 0;
  10972. menuOpen = true;
  10973. menuScreenArea = 0;
  10974. menuOffsetX = i1;
  10975. menuOffsetY = l1;
  10976. menuWidth = boxLength;
  10977. menuHeight = 15 * menuActionRow + 22;
  10978. }
  10979. }
  10980. }
  10981.  
  10982. public int centerX = clientWidth / 2;
  10983. public int centerY = clientHeight / 2;
  10984.  
  10985. public void refreshClientScreen() {
  10986. aRSImageProducer_1109 = new RSImageProducer(clientWidth, clientHeight,
  10987. getGameComponent());
  10988. DrawingArea.setAllPixelsToZero();
  10989. }
  10990.  
  10991. public void checkClientSize() {
  10992. clientWidth = getGameComponent().getWidth();
  10993. clientHeight = getGameComponent().getHeight();
  10994. centerX = clientWidth / 2;
  10995. centerY = clientHeight / 2;
  10996. }
  10997.  
  10998. private void method117(Stream stream) {
  10999. stream.initBitAccess();
  11000. int j = stream.readBits(1);
  11001. if (j == 0)
  11002. return;
  11003. int k = stream.readBits(2);
  11004. if (k == 0) {
  11005. anIntArray894[anInt893++] = myPlayerIndex;
  11006. return;
  11007. }
  11008. if (k == 1) {
  11009. int l = stream.readBits(3);
  11010. myPlayer.moveInDir(false, l);
  11011. int k1 = stream.readBits(1);
  11012. if (k1 == 1)
  11013. anIntArray894[anInt893++] = myPlayerIndex;
  11014. return;
  11015. }
  11016. if (k == 2) {
  11017. int i1 = stream.readBits(3);
  11018. myPlayer.moveInDir(true, i1);
  11019. int l1 = stream.readBits(3);
  11020. myPlayer.moveInDir(true, l1);
  11021. int j2 = stream.readBits(1);
  11022. if (j2 == 1)
  11023. anIntArray894[anInt893++] = myPlayerIndex;
  11024. return;
  11025. }
  11026. if (k == 3) {
  11027. plane = stream.readBits(2);
  11028. int j1 = stream.readBits(1);
  11029. int i2 = stream.readBits(1);
  11030. if (i2 == 1)
  11031. anIntArray894[anInt893++] = myPlayerIndex;
  11032. int k2 = stream.readBits(7);
  11033. int l2 = stream.readBits(7);
  11034. myPlayer.setPos(l2, k2, j1 == 1);
  11035. }
  11036. }
  11037.  
  11038. private void nullLoader() {
  11039. aBoolean831 = false;
  11040. while (drawingFlames) {
  11041. aBoolean831 = false;
  11042. try {
  11043. Thread.sleep(50L);
  11044. } catch (Exception _ex) {
  11045. }
  11046. }
  11047. aBackground_966 = null;
  11048. aBackground_967 = null;
  11049. aBackgroundArray1152s = null;
  11050. anIntArray850 = null;
  11051. anIntArray851 = null;
  11052. anIntArray852 = null;
  11053. anIntArray853 = null;
  11054. anIntArray1190 = null;
  11055. anIntArray1191 = null;
  11056. anIntArray828 = null;
  11057. anIntArray829 = null;
  11058. aClass30_Sub2_Sub1_Sub1_1201 = null;
  11059. aClass30_Sub2_Sub1_Sub1_1202 = null;
  11060. }
  11061.  
  11062. private boolean method119(int i, int j) {
  11063. boolean flag1 = false;
  11064. RSInterface class9 = RSInterface.interfaceCache[j];
  11065. for (int k = 0; k < class9.children.length; k++) {
  11066. if (class9.children[k] == -1)
  11067. break;
  11068. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  11069. if (class9_1.type == 1)
  11070. flag1 |= method119(i, class9_1.id);
  11071. if (class9_1.type == 6
  11072. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  11073. boolean flag2 = interfaceIsSelected(class9_1);
  11074. int l;
  11075. if (flag2)
  11076. l = class9_1.anInt258;
  11077. else
  11078. l = class9_1.anInt257;
  11079. if (l != -1) {
  11080. Animation animation = Animation.anims[l];
  11081. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  11082. .method258(class9_1.anInt246);) {
  11083. class9_1.anInt208 -= animation
  11084. .method258(class9_1.anInt246) + 1;
  11085. class9_1.anInt246++;
  11086. if (class9_1.anInt246 >= animation.anInt352) {
  11087. class9_1.anInt246 -= animation.anInt356;
  11088. if (class9_1.anInt246 < 0
  11089. || class9_1.anInt246 >= animation.anInt352)
  11090. class9_1.anInt246 = 0;
  11091. }
  11092. flag1 = true;
  11093. }
  11094.  
  11095. }
  11096. }
  11097. }
  11098.  
  11099. return flag1;
  11100. }
  11101.  
  11102. private int method120() {
  11103. int j = 3;
  11104. if (yCameraCurve < 310) {
  11105. int k = xCameraPos >> 7;
  11106. int l = yCameraPos >> 7;
  11107. int i1 = myPlayer.x >> 7;
  11108. int j1 = myPlayer.y >> 7;
  11109. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11110. j = plane;
  11111. int k1;
  11112. if (i1 > k)
  11113. k1 = i1 - k;
  11114. else
  11115. k1 = k - i1;
  11116. int l1;
  11117. if (j1 > l)
  11118. l1 = j1 - l;
  11119. else
  11120. l1 = l - j1;
  11121. if (k1 > l1) {
  11122. int i2 = (l1 * 0x10000) / k1;
  11123. int k2 = 32768;
  11124. while (k != i1) {
  11125. if (k < i1)
  11126. k++;
  11127. else if (k > i1)
  11128. k--;
  11129. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11130. j = plane;
  11131. k2 += i2;
  11132. if (k2 >= 0x10000) {
  11133. k2 -= 0x10000;
  11134. if (l < j1)
  11135. l++;
  11136. else if (l > j1)
  11137. l--;
  11138. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11139. j = plane;
  11140. }
  11141. }
  11142. } else {
  11143. int j2 = (k1 * 0x10000) / l1;
  11144. int l2 = 32768;
  11145. while (l != j1) {
  11146. if (l < j1)
  11147. l++;
  11148. else if (l > j1)
  11149. l--;
  11150. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11151. j = plane;
  11152. l2 += j2;
  11153. if (l2 >= 0x10000) {
  11154. l2 -= 0x10000;
  11155. if (k < i1)
  11156. k++;
  11157. else if (k > i1)
  11158. k--;
  11159. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11160. j = plane;
  11161. }
  11162. }
  11163. }
  11164. }
  11165. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  11166. j = plane;
  11167. return j;
  11168. }
  11169.  
  11170. private int method121() {
  11171. int j = method42(plane, yCameraPos, xCameraPos);
  11172. if (j - zCameraPos < 800
  11173. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  11174. return plane;
  11175. else
  11176. return 3;
  11177. }
  11178.  
  11179. private void delIgnore(long l) {
  11180. try {
  11181. if (l == 0L)
  11182. return;
  11183. for (int j = 0; j < ignoreCount; j++)
  11184. if (ignoreListAsLongs[j] == l) {
  11185. ignoreCount--;
  11186. needDrawTabArea = true;
  11187. System.arraycopy(ignoreListAsLongs, j + 1,
  11188. ignoreListAsLongs, j, ignoreCount - j);
  11189.  
  11190. stream.createFrame(74);
  11191. stream.writeQWord(l);
  11192. return;
  11193. }
  11194.  
  11195. return;
  11196. } catch (RuntimeException runtimeexception) {
  11197. Signlink.reporterror("47229, " + 3 + ", " + l + ", "
  11198. + runtimeexception.toString());
  11199. }
  11200. throw new RuntimeException();
  11201. }
  11202.  
  11203. private void chatJoin(long l) {
  11204. try {
  11205. if (l == 0L)
  11206. return;
  11207. stream.createFrame(60);
  11208. stream.writeQWord(l);
  11209. return;
  11210. } catch (RuntimeException runtimeexception) {
  11211. Signlink.reporterror("47229, " + 3 + ", " + l + ", "
  11212. + runtimeexception.toString());
  11213. }
  11214. throw new RuntimeException();
  11215.  
  11216. }
  11217.  
  11218. public String getParameter(String s) {
  11219. if (Signlink.mainapp != null)
  11220. return Signlink.mainapp.getParameter(s);
  11221. else
  11222. return super.getParameter(s);
  11223. }
  11224.  
  11225. private void adjustVolume(boolean flag, int i) {
  11226. Signlink.midiVolume = i;
  11227. if (flag)
  11228. Signlink.midi = "voladjust";
  11229. }
  11230.  
  11231. private int extractInterfaceValues(RSInterface class9, int j) {
  11232. if (class9.valueIndexArray == null
  11233. || j >= class9.valueIndexArray.length)
  11234. return -2;
  11235. try {
  11236. int ai[] = class9.valueIndexArray[j];
  11237. int k = 0;
  11238. int l = 0;
  11239. int i1 = 0;
  11240. do {
  11241. int j1 = ai[l++];
  11242. int k1 = 0;
  11243. byte byte0 = 0;
  11244. if (j1 == 0)
  11245. return k;
  11246. if (j1 == 1)
  11247. k1 = currentStats[ai[l++]];
  11248. if (j1 == 2)
  11249. k1 = maxStats[ai[l++]];
  11250. if (j1 == 3)
  11251. k1 = currentExp[ai[l++]];
  11252. if (j1 == 4) {
  11253. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  11254. int k2 = ai[l++];
  11255. if (k2 >= 0 && k2 < ItemDef.totalItems
  11256. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  11257. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  11258. if (class9_1.inv[j3] == k2 + 1)
  11259. k1 += class9_1.invStackSizes[j3];
  11260.  
  11261. }
  11262. }
  11263. if (j1 == 5)
  11264. k1 = variousSettings[ai[l++]];
  11265. if (j1 == 6)
  11266. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  11267. if (j1 == 7)
  11268. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11269. if (j1 == 8)
  11270. k1 = myPlayer.combatLevel;
  11271. if (j1 == 9) {
  11272. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  11273. if (Skills.skillEnabled[l1])
  11274. k1 += maxStats[l1];
  11275.  
  11276. }
  11277. if (j1 == 10) {
  11278. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11279. int l2 = ai[l++] + 1;
  11280. if (l2 >= 0 && l2 < ItemDef.totalItems && isMembers) {
  11281. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  11282. if (class9_2.inv[k3] != l2)
  11283. continue;
  11284. k1 = 0x3b9ac9ff;
  11285. break;
  11286. }
  11287.  
  11288. }
  11289. }
  11290. if (j1 == 11)
  11291. k1 = energy;
  11292. if (j1 == 12)
  11293. k1 = weight;
  11294. if (j1 == 13) {
  11295. int i2 = variousSettings[ai[l++]];
  11296. int i3 = ai[l++];
  11297. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11298. }
  11299. if (j1 == 14) {
  11300. int j2 = ai[l++];
  11301. VarBit varBit = VarBit.cache[j2];
  11302. int l3 = varBit.anInt648;
  11303. int i4 = varBit.anInt649;
  11304. int j4 = varBit.anInt650;
  11305. int k4 = anIntArray1232[j4 - i4];
  11306. k1 = variousSettings[l3] >> i4 & k4;
  11307. }
  11308. if (j1 == 15)
  11309. byte0 = 1;
  11310. if (j1 == 16)
  11311. byte0 = 2;
  11312. if (j1 == 17)
  11313. byte0 = 3;
  11314. if (j1 == 18)
  11315. k1 = (myPlayer.x >> 7) + baseX;
  11316. if (j1 == 19)
  11317. k1 = (myPlayer.y >> 7) + baseY;
  11318. if (j1 == 20)
  11319. k1 = ai[l++];
  11320. if (byte0 == 0) {
  11321. if (i1 == 0)
  11322. k += k1;
  11323. if (i1 == 1)
  11324. k -= k1;
  11325. if (i1 == 2 && k1 != 0)
  11326. k /= k1;
  11327. if (i1 == 3)
  11328. k *= k1;
  11329. i1 = 0;
  11330. } else {
  11331. i1 = byte0;
  11332. }
  11333. } while (true);
  11334. } catch (Exception _ex) {
  11335. return -1;
  11336. }
  11337. }
  11338.  
  11339. private void drawTooltip() {
  11340. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11341. return;
  11342. String s;
  11343. if (itemSelected == 1 && menuActionRow < 2)
  11344. s = "Use " + selectedItemName + " with...";
  11345. else if (spellSelected == 1 && menuActionRow < 2)
  11346. s = spellTooltip + "...";
  11347. else
  11348. s = menuActionName[menuActionRow - 1];
  11349. if (menuActionRow > 2)
  11350. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11351. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11352. }
  11353.  
  11354. private void markMinimap(Sprite sprite, int i, int j) {
  11355. int k = minimapInt1 + minimapInt2 & 0x7ff;
  11356. int l = sprite.myWidth + sprite.myHeight + i * i + j * j;
  11357. if (l > 4850 && clientSize != 0)
  11358. return;
  11359. int sine = Model.modelIntArray1[k];
  11360. int cosine = Model.modelIntArray2[k];
  11361. sine = (sine * 256) / (minimapInt3 + 256);
  11362. cosine = (cosine * 256) / (minimapInt3 + 256);
  11363. int k1 = j * sine + i * cosine >> 16;
  11364. int l1 = j * cosine - i * sine >> 16;
  11365. sprite.drawSprite(
  11366. (((clientSize == 0 ? 129 - 5 : clientWidth + 129 - 5 - 238) + k1) - sprite.anInt1444 / 2) + 4,
  11367. (clientSize == 0 ? 88 : 88 + 3) - l1 - sprite.anInt1445 / 2 - 4);
  11368. }
  11369.  
  11370. private void drawMinimap() {
  11371. if (clientSize == 0) {
  11372. aRSImageProducer_1164.initDrawingArea();
  11373. }
  11374. if (clientSize != 0) {
  11375. for (int i = 0; i < 76; i++) {
  11376. int amt = (int) (Math.sqrt(Math.pow(77, 2)
  11377. - Math.pow(75 - i, 2)));
  11378. anIntArray1229[i] = 2 * amt + 2;
  11379. anIntArray1229[150 - i] = 2 * amt + 2;
  11380. anIntArray1052[i] = -amt + 73;
  11381. anIntArray1052[150 - i] = -amt + 73;
  11382. }
  11383. }
  11384.  
  11385. if (anInt1021 == 2) {
  11386. byte abyte0[] = mapBack.aByteArray1450;
  11387. int ai[] = DrawingArea.pixels;
  11388. int k2 = abyte0.length;
  11389. for (int i5 = 0; i5 < k2; i5++)
  11390. if (abyte0[i5] == 0)
  11391. ai[i5] = 0;
  11392. compass.method352(33, minimapInt1, anIntArray1057, 256,
  11393. anIntArray968, 25, (clientSize == 0 ? 4 : 4 + 3),
  11394. (clientSize == 0 ? 34 - 5 : clientWidth + 34 - 5 - 238),
  11395. 33, 25);
  11396. aRSImageProducer_1165.initDrawingArea();
  11397. return;
  11398. }
  11399. int i = minimapInt1 + minimapInt2 & 0x7ff;
  11400. int j = 48 + myPlayer.x / 32;
  11401. int l2 = 464 - myPlayer.y / 32;
  11402.  
  11403. minimapImage
  11404. .method352(
  11405. 151,
  11406. i,
  11407. anIntArray1229,
  11408. 256 + minimapInt3,
  11409. anIntArray1052,
  11410. l2,
  11411. (clientSize == 0 ? 9 : 12),
  11412. (clientSize == 0 ? 59 - 5 : clientWidth + 59 - 5 - 238),
  11413. 146, j);
  11414. for (int j5 = 0; j5 < anInt1071; j5++) {
  11415. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11416. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11417. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  11418. }
  11419. for (int vb = 0; vb < customMapIcons.length; vb++) {
  11420. markMinimap(new Sprite(customMapIcons[vb]),
  11421. ((mapIconX[vb] - baseX) * 4 + 2) - myPlayer.x / 32,
  11422. ((mapIconY[vb] - baseY) * 4 + 2) - myPlayer.y / 32);
  11423. }
  11424. for (int k5 = 0; k5 < 104; k5++) {
  11425. for (int l5 = 0; l5 < 104; l5++) {
  11426. NodeList class19 = groundArray[plane][k5][l5];
  11427. if (class19 != null) {
  11428. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11429. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11430. markMinimap(mapDotItem, l, j3);
  11431. }
  11432. }
  11433. }
  11434. for (int i6 = 0; i6 < npcCount; i6++) {
  11435. NPC npc = npcArray[npcIndices[i6]];
  11436. if (npc != null && npc.isVisible()) {
  11437. EntityDef entityDef = npc.desc;
  11438. if (entityDef.childrenIDs != null)
  11439. entityDef = entityDef.method161();
  11440. if (entityDef != null && entityDef.aBoolean87
  11441. && entityDef.aBoolean84) {
  11442. int i1 = npc.x / 32 - myPlayer.x / 32;
  11443. int k3 = npc.y / 32 - myPlayer.y / 32;
  11444. markMinimap(mapDotNPC, i1, k3);
  11445. }
  11446. }
  11447. }
  11448. for (int j6 = 0; j6 < playerCount; j6++) {
  11449. Player player = playerArray[playerIndices[j6]];
  11450. if (player != null && player.isVisible()) {
  11451. int j1 = player.x / 32 - myPlayer.x / 32;
  11452. int l3 = player.y / 32 - myPlayer.y / 32;
  11453. boolean flag1 = false;
  11454. boolean flag3 = false;
  11455. for (int j3 = 0; j3 < clanList.length; j3++) {
  11456. if (clanList[j3] == null)
  11457. continue;
  11458. if (!clanList[j3].equalsIgnoreCase(player.name))
  11459. continue;
  11460. flag3 = true;
  11461. break;
  11462. }
  11463. long l6 = TextClass.longForName(player.name);
  11464. for (int k6 = 0; k6 < friendsCount; k6++) {
  11465. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  11466. continue;
  11467. flag1 = true;
  11468. break;
  11469. }
  11470. boolean flag2 = false;
  11471. if (myPlayer.team != 0 && player.team != 0
  11472. && myPlayer.team == player.team)
  11473. flag2 = true;
  11474. if (flag1)
  11475. markMinimap(mapDotFriend, j1, l3);
  11476. else if (flag3)
  11477. markMinimap(mapDotClan, j1, l3);
  11478. else if (flag2)
  11479. markMinimap(mapDotTeam, j1, l3);
  11480. else
  11481. markMinimap(mapDotPlayer, j1, l3);
  11482. }
  11483. }
  11484. if (anInt855 != 0 && loopCycle % 20 < 10) {
  11485. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  11486. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11487. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  11488. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x
  11489. / 32;
  11490. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y
  11491. / 32;
  11492. method81(mapMarker, i4, k1);
  11493. }
  11494. }
  11495. if (anInt855 == 2) {
  11496. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11497. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11498. method81(mapMarker, j4, l1);
  11499. }
  11500. if (anInt855 == 10 && anInt933 >= 0
  11501. && anInt933 < playerArray.length) {
  11502. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11503. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  11504. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x
  11505. / 32;
  11506. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y
  11507. / 32;
  11508. method81(mapMarker, k4, i2);
  11509. }
  11510. }
  11511. }
  11512. if (destX != 0) {
  11513. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11514. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11515. markMinimap(mapFlag, j2, l4);
  11516. }
  11517.  
  11518. if (clientSize != 0) {
  11519. cacheSprite[33].drawSprite(clientWidth - 238, 3);
  11520. compass.method352(33, minimapInt1, anIntArray1057, 256,
  11521. anIntArray968, 25, (clientSize == 0 ? 4 : 4 + 3),
  11522. (clientSize == 0 ? 34 - 5 : clientWidth + 34 - 5 - 238),
  11523. 33, 25);
  11524. }
  11525.  
  11526. DrawingArea.drawPixels(3, (clientSize == 0 ? 9 : 12) + 74,
  11527. (clientSize == 0 ? 130 - 5 : clientWidth + 130 - 5 - 238),
  11528. 0xffffff, 3);
  11529.  
  11530. if (clientSize == 0) {
  11531. cacheSprite[24].drawSprite(0, 0);
  11532. cacheSprite[26].method352(33, minimapInt1, anIntArray1057, 256,
  11533. anIntArray968, 25, 4, 29, 33, 25);
  11534. }
  11535. loadAllOrbs();
  11536. if (menuOpen && clientSize == 0)
  11537. drawMenu(516, 0);
  11538. else if (menuOpen && menuScreenArea == 3 && clientSize != 0)
  11539. drawMenu(516, 0);
  11540.  
  11541. aRSImageProducer_1165.initDrawingArea();
  11542. }
  11543.  
  11544. private void npcScreenPos(Entity entity, int i) {
  11545. calcEntityScreenPos(entity.x, i, entity.y);
  11546. }
  11547.  
  11548. private void calcEntityScreenPos(int i, int j, int l) {
  11549. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  11550. spriteDrawX = -1;
  11551. spriteDrawY = -1;
  11552. return;
  11553. }
  11554. int i1 = method42(plane, l, i) - j;
  11555. i -= xCameraPos;
  11556. i1 -= zCameraPos;
  11557. l -= yCameraPos;
  11558. int j1 = Model.modelIntArray1[yCameraCurve];
  11559. int k1 = Model.modelIntArray2[yCameraCurve];
  11560. int l1 = Model.modelIntArray1[xCameraCurve];
  11561. int i2 = Model.modelIntArray2[xCameraCurve];
  11562. int j2 = l * l1 + i * i2 >> 16;
  11563. l = l * i2 - i * l1 >> 16;
  11564. i = j2;
  11565. j2 = i1 * k1 - l * j1 >> 16;
  11566. l = i1 * j1 + l * k1 >> 16;
  11567. i1 = j2;
  11568. if (l >= 50) {
  11569. spriteDrawX = Texture.textureInt1 + (i << log_view_dist) / l;
  11570. spriteDrawY = Texture.textureInt2 + (i1 << log_view_dist) / l;
  11571. } else {
  11572. spriteDrawX = -1;
  11573. spriteDrawY = -1;
  11574. }
  11575. }
  11576.  
  11577. private void buildSplitPrivateChatMenu() {
  11578. if (splitPrivateChat == 0)
  11579. return;
  11580. int i = 0;
  11581. if (anInt1104 != 0)
  11582. i = 1;
  11583. for (int j = 0; j < 100; j++)
  11584. if (chatMessages[j] != null) {
  11585. int k = chatTypes[j];
  11586. String s = chatNames[j];
  11587. if (s != null && s.startsWith("@cr1@")) {
  11588. s = s.substring(5);
  11589. }
  11590. if (s != null && s.startsWith("@cr2@")) {
  11591. s = s.substring(5);
  11592. }
  11593. if (s != null && s.startsWith("@cr3@")) {
  11594. s = s.substring(5);
  11595. }
  11596. if ((k == 3 || k == 7)
  11597. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  11598. && isFriendOrSelf(s))) {
  11599. int l = 329 - i * 13;
  11600. if (super.mouseX > 4 && super.mouseY - 4 > l - 10
  11601. && super.mouseY - 4 <= l + 3) {
  11602. int i1 = aTextDrawingArea_1271.getTextWidth("From: "
  11603. + s + chatMessages[j]) + 25;
  11604. if (i1 > 450)
  11605. i1 = 450;
  11606. if (super.mouseX < 4 + i1) {
  11607. if (myPrivilege >= 1) {
  11608. menuActionName[menuActionRow] = "Report abuse @whi@"
  11609. + s;
  11610. menuActionID[menuActionRow] = 2606;
  11611. menuActionRow++;
  11612. }
  11613. menuActionName[menuActionRow] = "Add ignore @whi@"
  11614. + s;
  11615. menuActionID[menuActionRow] = 2042;
  11616. menuActionRow++;
  11617. menuActionName[menuActionRow] = "Add friend @whi@"
  11618. + s;
  11619. menuActionID[menuActionRow] = 2337;
  11620. menuActionRow++;
  11621. }
  11622. }
  11623. if (++i >= 5)
  11624. return;
  11625. }
  11626. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11627. return;
  11628. }
  11629.  
  11630. }
  11631.  
  11632. private void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  11633. int i2, int j2) {
  11634. Class30_Sub1 class30_sub1 = null;
  11635. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11636. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11637. .reverseGetNext()) {
  11638. if (class30_sub1_1.anInt1295 != l1
  11639. || class30_sub1_1.anInt1297 != i2
  11640. || class30_sub1_1.anInt1298 != j1
  11641. || class30_sub1_1.anInt1296 != i1)
  11642. continue;
  11643. class30_sub1 = class30_sub1_1;
  11644. break;
  11645. }
  11646.  
  11647. if (class30_sub1 == null) {
  11648. class30_sub1 = new Class30_Sub1();
  11649. class30_sub1.anInt1295 = l1;
  11650. class30_sub1.anInt1296 = i1;
  11651. class30_sub1.anInt1297 = i2;
  11652. class30_sub1.anInt1298 = j1;
  11653. method89(class30_sub1);
  11654. aClass19_1179.insertHead(class30_sub1);
  11655. }
  11656. class30_sub1.anInt1291 = k;
  11657. class30_sub1.anInt1293 = k1;
  11658. class30_sub1.anInt1292 = l;
  11659. class30_sub1.anInt1302 = j2;
  11660. class30_sub1.anInt1294 = j;
  11661. }
  11662.  
  11663. private boolean interfaceIsSelected(RSInterface class9) {
  11664. if (class9.anIntArray245 == null)
  11665. return false;
  11666. for (int i = 0; i < class9.anIntArray245.length; i++) {
  11667. int j = extractInterfaceValues(class9, i);
  11668. int k = class9.anIntArray212[i];
  11669. if (class9.anIntArray245[i] == 2) {
  11670. if (j >= k)
  11671. return false;
  11672. } else if (class9.anIntArray245[i] == 3) {
  11673. if (j <= k)
  11674. return false;
  11675. } else if (class9.anIntArray245[i] == 4) {
  11676. if (j == k)
  11677. return false;
  11678. } else if (j != k)
  11679. return false;
  11680. }
  11681.  
  11682. return true;
  11683. }
  11684.  
  11685. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  11686. if (aSocket832 != null) {
  11687. try {
  11688. aSocket832.close();
  11689. } catch (Exception _ex) {
  11690. }
  11691. aSocket832 = null;
  11692. }
  11693. aSocket832 = openSocket(43595);
  11694. aSocket832.setSoTimeout(10000);
  11695. java.io.InputStream inputstream = aSocket832.getInputStream();
  11696. OutputStream outputstream = aSocket832.getOutputStream();
  11697. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11698. return new DataInputStream(inputstream);
  11699. }
  11700.  
  11701. private void doFlamesDrawing() {
  11702. char c = '\u0100';
  11703. if (anInt1040 > 0) {
  11704. for (int i = 0; i < 256; i++)
  11705. if (anInt1040 > 768)
  11706. anIntArray850[i] = method83(anIntArray851[i],
  11707. anIntArray852[i], 1024 - anInt1040);
  11708. else if (anInt1040 > 256)
  11709. anIntArray850[i] = anIntArray852[i];
  11710. else
  11711. anIntArray850[i] = method83(anIntArray852[i],
  11712. anIntArray851[i], 256 - anInt1040);
  11713.  
  11714. } else if (anInt1041 > 0) {
  11715. for (int j = 0; j < 256; j++)
  11716. if (anInt1041 > 768)
  11717. anIntArray850[j] = method83(anIntArray851[j],
  11718. anIntArray853[j], 1024 - anInt1041);
  11719. else if (anInt1041 > 256)
  11720. anIntArray850[j] = anIntArray853[j];
  11721. else
  11722. anIntArray850[j] = method83(anIntArray853[j],
  11723. anIntArray851[j], 256 - anInt1041);
  11724.  
  11725. } else {
  11726. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11727.  
  11728. }
  11729. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  11730. aRSImageProducer_1110.anIntArray315, 0, 33920);
  11731.  
  11732. int i1 = 0;
  11733. int j1 = 1152;
  11734. for (int k1 = 1; k1 < c - 1; k1++) {
  11735. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11736. int j2 = 22 + l1;
  11737. if (j2 < 0)
  11738. j2 = 0;
  11739. i1 += j2;
  11740. for (int l2 = j2; l2 < 128; l2++) {
  11741. int j3 = anIntArray828[i1++];
  11742. if (j3 != 0) {
  11743. int l3 = j3;
  11744. int j4 = 256 - j3;
  11745. j3 = anIntArray850[j3];
  11746. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  11747. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  11748. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  11749. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11750. } else {
  11751. j1++;
  11752. }
  11753. }
  11754.  
  11755. j1 += j2;
  11756. }
  11757.  
  11758. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  11759. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  11760. aRSImageProducer_1111.anIntArray315, 0, 33920);
  11761.  
  11762. i1 = 0;
  11763. j1 = 1176;
  11764. for (int k2 = 1; k2 < c - 1; k2++) {
  11765. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11766. int k3 = 103 - i3;
  11767. j1 += i3;
  11768. for (int i4 = 0; i4 < k3; i4++) {
  11769. int k4 = anIntArray828[i1++];
  11770. if (k4 != 0) {
  11771. int i5 = k4;
  11772. int j5 = 256 - k4;
  11773. k4 = anIntArray850[k4];
  11774. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  11775. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  11776. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  11777. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11778. } else {
  11779. j1++;
  11780. }
  11781. }
  11782.  
  11783. i1 += 128 - k3;
  11784. j1 += 128 - k3 - i3;
  11785. }
  11786.  
  11787. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11788. }
  11789.  
  11790. private void method134(Stream stream) {
  11791. int j = stream.readBits(8);
  11792. if (j < playerCount) {
  11793. for (int k = j; k < playerCount; k++)
  11794. anIntArray840[anInt839++] = playerIndices[k];
  11795.  
  11796. }
  11797. if (j > playerCount) {
  11798. Signlink.reporterror(myUsername + " Too many players");
  11799. throw new RuntimeException("eek");
  11800. }
  11801. playerCount = 0;
  11802. for (int l = 0; l < j; l++) {
  11803. int i1 = playerIndices[l];
  11804. Player player = playerArray[i1];
  11805. int j1 = stream.readBits(1);
  11806. if (j1 == 0) {
  11807. playerIndices[playerCount++] = i1;
  11808. player.anInt1537 = loopCycle;
  11809. } else {
  11810. int k1 = stream.readBits(2);
  11811. if (k1 == 0) {
  11812. playerIndices[playerCount++] = i1;
  11813. player.anInt1537 = loopCycle;
  11814. anIntArray894[anInt893++] = i1;
  11815. } else if (k1 == 1) {
  11816. playerIndices[playerCount++] = i1;
  11817. player.anInt1537 = loopCycle;
  11818. int l1 = stream.readBits(3);
  11819. player.moveInDir(false, l1);
  11820. int j2 = stream.readBits(1);
  11821. if (j2 == 1)
  11822. anIntArray894[anInt893++] = i1;
  11823. } else if (k1 == 2) {
  11824. playerIndices[playerCount++] = i1;
  11825. player.anInt1537 = loopCycle;
  11826. int i2 = stream.readBits(3);
  11827. player.moveInDir(true, i2);
  11828. int k2 = stream.readBits(3);
  11829. player.moveInDir(true, k2);
  11830. int l2 = stream.readBits(1);
  11831. if (l2 == 1)
  11832. anIntArray894[anInt893++] = i1;
  11833. } else if (k1 == 3)
  11834. anIntArray840[anInt839++] = i1;
  11835. }
  11836. }
  11837. }
  11838.  
  11839. private void drawLoginScreen(boolean flag) {
  11840.  
  11841. if (runClicked)
  11842. runClicked = false;
  11843. resetImageProducers();
  11844. aRSImageProducer_1109.initDrawingArea();
  11845. aBackground_966.drawBackground(0, 0);
  11846. char c = '\u0168';
  11847. char c1 = '\310';
  11848. if (loginScreenState == 0) {
  11849. int i = c1 / 2 + 80;
  11850. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString,
  11851. i, true);
  11852. i = c1 / 2 - 20;
  11853. chatTextDrawingArea.method382(0xffff00, c / 2,
  11854. "Welcome to OwnXile", i, true);
  11855. i += 30;
  11856. int l = c / 2 - 80;
  11857. int k1 = c1 / 2 + 20;
  11858. aBackground_967.drawBackground(l - 73, k1 - 20);
  11859. chatTextDrawingArea
  11860. .method382(0xffffff, l, "New User", k1 + 5, true);
  11861. l = c / 2 + 80;
  11862. aBackground_967.drawBackground(l - 73, k1 - 20);
  11863. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5,
  11864. true);
  11865. }
  11866. if (loginScreenState == 2) {
  11867. int j = c1 / 2 - 40;
  11868. if (loginMessage1.length() > 0) {
  11869. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1,
  11870. j - 15, true);
  11871. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2,
  11872. j, true);
  11873. j += 30;
  11874. } else {
  11875. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2,
  11876. j - 7, true);
  11877. j += 30;
  11878. }
  11879. chatTextDrawingArea
  11880. .method389(true, c / 2 - 90, 0xffffff, "Username: "
  11881. + myUsername
  11882. + ((loginScreenCursorPos == 0)
  11883. & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11884. j += 15;
  11885. chatTextDrawingArea
  11886. .method389(true, c / 2 - 88, 0xffffff, "Password: "
  11887. + TextClass.passwordAsterisks(myPassword)
  11888. + ((loginScreenCursorPos == 1)
  11889. & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11890. j += 15;
  11891. if (!flag) {
  11892. int i1 = c / 2 - 80;
  11893. int l1 = c1 / 2 + 50;
  11894. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  11895. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5,
  11896. true);
  11897. i1 = c / 2 + 80;
  11898. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  11899. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5,
  11900. true);
  11901. }
  11902. }
  11903. if (loginScreenState == 3) {
  11904. chatTextDrawingArea.method382(0xffff00, c / 2,
  11905. "Create a free account", c1 / 2 - 60, true);
  11906. int k = c1 / 2 - 35;
  11907. chatTextDrawingArea.method382(0xffffff, c / 2,
  11908. "To create a new account you need to", k, true);
  11909. k += 15;
  11910. chatTextDrawingArea.method382(0xffffff, c / 2,
  11911. "go back to the OwnXile forums", k, true);
  11912. k += 15;
  11913. chatTextDrawingArea.method382(0xffffff, c / 2,
  11914. "and choose the register button", k, true);
  11915. k += 15;
  11916. chatTextDrawingArea.method382(0xffffff, c / 2,
  11917. "button at the top right of that page.", k, true);
  11918. k += 15;
  11919. int j1 = c / 2;
  11920. int i2 = c1 / 2 + 50;
  11921. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  11922. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  11923. }
  11924. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  11925. if (welcomeScreenRaised) {
  11926. welcomeScreenRaised = false;
  11927. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  11928. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  11929. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  11930. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  11931. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  11932. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  11933. }
  11934. }
  11935.  
  11936. private void drawFlames() {
  11937. drawingFlames = true;
  11938. try {
  11939. long l = System.currentTimeMillis();
  11940. int i = 0;
  11941. int j = 20;
  11942. while (aBoolean831) {
  11943. // calcFlamesPosition();
  11944. // calcFlamesPosition();
  11945. doFlamesDrawing();
  11946. if (++i > 10) {
  11947. long l1 = System.currentTimeMillis();
  11948. int k = (int) (l1 - l) / 10 - j;
  11949. j = 40 - k;
  11950. if (j < 5)
  11951. j = 5;
  11952. i = 0;
  11953. l = l1;
  11954. }
  11955. try {
  11956. Thread.sleep(j);
  11957. } catch (Exception _ex) {
  11958. }
  11959. }
  11960. } catch (Exception _ex) {
  11961. }
  11962. drawingFlames = false;
  11963. }
  11964.  
  11965. public void raiseWelcomeScreen() {
  11966. welcomeScreenRaised = true;
  11967. }
  11968.  
  11969. private void method137(Stream stream, int j) {
  11970. if (j == 84) {
  11971. int k = stream.readUnsignedByte();
  11972. int j3 = anInt1268 + (k >> 4 & 7);
  11973. int i6 = anInt1269 + (k & 7);
  11974. int l8 = stream.readUnsignedWord();
  11975. int k11 = stream.readUnsignedWord();
  11976. int l13 = stream.readUnsignedWord();
  11977. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  11978. NodeList class19_1 = groundArray[plane][j3][i6];
  11979. if (class19_1 != null) {
  11980. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  11981. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  11982. .reverseGetNext()) {
  11983. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  11984. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11985. continue;
  11986. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11987. break;
  11988. }
  11989.  
  11990. spawnGroundItem(j3, i6);
  11991. }
  11992. }
  11993. return;
  11994. }
  11995. if (j == 105) {
  11996. int l = stream.readUnsignedByte();
  11997. int k3 = anInt1268 + (l >> 4 & 7);
  11998. int j6 = anInt1269 + (l & 7);
  11999. int i9 = stream.readUnsignedWord();
  12000. int l11 = stream.readUnsignedByte();
  12001. int i14 = l11 >> 4 & 0xf;
  12002. int i16 = l11 & 7;
  12003. if (myPlayer.smallX[0] >= k3 - i14
  12004. && myPlayer.smallX[0] <= k3 + i14
  12005. && myPlayer.smallY[0] >= j6 - i14
  12006. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  12007. && anInt1062 < 50) {
  12008. anIntArray1207[anInt1062] = i9;
  12009. anIntArray1241[anInt1062] = i16;
  12010. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  12011. anInt1062++;
  12012. }
  12013. }
  12014. if (j == 215) {
  12015. int i1 = stream.method435();
  12016. int l3 = stream.method428();
  12017. int k6 = anInt1268 + (l3 >> 4 & 7);
  12018. int j9 = anInt1269 + (l3 & 7);
  12019. int i12 = stream.method435();
  12020. int j14 = stream.readUnsignedWord();
  12021. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  12022. && i12 != unknownInt10) {
  12023. Item class30_sub2_sub4_sub2_2 = new Item();
  12024. class30_sub2_sub4_sub2_2.ID = i1;
  12025. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  12026. if (groundArray[plane][k6][j9] == null)
  12027. groundArray[plane][k6][j9] = new NodeList();
  12028. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  12029. spawnGroundItem(k6, j9);
  12030. }
  12031. return;
  12032. }
  12033. if (j == 156) {
  12034. int j1 = stream.method426();
  12035. int i4 = anInt1268 + (j1 >> 4 & 7);
  12036. int l6 = anInt1269 + (j1 & 7);
  12037. int k9 = stream.readUnsignedWord();
  12038. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  12039. NodeList class19 = groundArray[plane][i4][l6];
  12040. if (class19 != null) {
  12041. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  12042. .reverseGetNext()) {
  12043. if (item.ID != (k9 & 0x7fff))
  12044. continue;
  12045. item.unlink();
  12046. break;
  12047. }
  12048.  
  12049. if (class19.reverseGetFirst() == null)
  12050. groundArray[plane][i4][l6] = null;
  12051. spawnGroundItem(i4, l6);
  12052. }
  12053. }
  12054. return;
  12055. }
  12056. if (j == 160) {
  12057. int k1 = stream.method428();
  12058. int j4 = anInt1268 + (k1 >> 4 & 7);
  12059. int i7 = anInt1269 + (k1 & 7);
  12060. int l9 = stream.method428();
  12061. int j12 = l9 >> 2;
  12062. int k14 = l9 & 3;
  12063. int j16 = anIntArray1177[j12];
  12064. int j17 = stream.method435();
  12065. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  12066. int j18 = intGroundArray[plane][j4][i7];
  12067. int i19 = intGroundArray[plane][j4 + 1][i7];
  12068. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  12069. int k20 = intGroundArray[plane][j4][i7 + 1];
  12070. if (j16 == 0) {
  12071. Object1 class10 = worldController.method296(plane, j4, i7);
  12072. if (class10 != null) {
  12073. int k21 = class10.uid >> 14 & 0x7fff;
  12074. if (j12 == 2) {
  12075. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  12076. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  12077. false);
  12078. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  12079. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  12080. j17, false);
  12081. } else {
  12082. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  12083. k21, k14, j12, i19, l19, j18, k20, j17,
  12084. false);
  12085. }
  12086. }
  12087. }
  12088. if (j16 == 1) {
  12089. Object2 class26 = worldController.method297(j4, i7, plane);
  12090. if (class26 != null)
  12091. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  12092. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  12093. j18, k20, j17, false);
  12094. }
  12095. if (j16 == 2) {
  12096. Object5 class28 = worldController.method298(j4, i7, plane);
  12097. if (j12 == 11)
  12098. j12 = 10;
  12099. if (class28 != null)
  12100. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  12101. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  12102. j18, k20, j17, false);
  12103. }
  12104. if (j16 == 3) {
  12105. Object3 class49 = worldController.method299(i7, j4, plane);
  12106. if (class49 != null)
  12107. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  12108. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  12109. j18, k20, j17, false);
  12110. }
  12111. }
  12112. return;
  12113. }
  12114. if (j == 147) {
  12115. int l1 = stream.method428();
  12116. int k4 = anInt1268 + (l1 >> 4 & 7);
  12117. int j7 = anInt1269 + (l1 & 7);
  12118. int i10 = stream.readUnsignedWord();
  12119. byte byte0 = stream.method430();
  12120. int l14 = stream.method434();
  12121. byte byte1 = stream.method429();
  12122. int k17 = stream.readUnsignedWord();
  12123. int k18 = stream.method428();
  12124. int j19 = k18 >> 2;
  12125. int i20 = k18 & 3;
  12126. int l20 = anIntArray1177[j19];
  12127. byte byte2 = stream.readSignedByte();
  12128. int l21 = stream.readUnsignedWord();
  12129. byte byte3 = stream.method429();
  12130. Player player;
  12131. if (i10 == unknownInt10)
  12132. player = myPlayer;
  12133. else
  12134. player = playerArray[i10];
  12135. if (player != null) {
  12136. ObjectDef class46 = ObjectDef.forID(l21);
  12137. int i22 = intGroundArray[plane][k4][j7];
  12138. int j22 = intGroundArray[plane][k4 + 1][j7];
  12139. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  12140. int l22 = intGroundArray[plane][k4][j7 + 1];
  12141. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  12142. -1);
  12143. if (model != null) {
  12144. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  12145. player.anInt1707 = l14 + loopCycle;
  12146. player.anInt1708 = k17 + loopCycle;
  12147. player.aModel_1714 = model;
  12148. int i23 = class46.anInt744;
  12149. int j23 = class46.anInt761;
  12150. if (i20 == 1 || i20 == 3) {
  12151. i23 = class46.anInt761;
  12152. j23 = class46.anInt744;
  12153. }
  12154. player.anInt1711 = k4 * 128 + i23 * 64;
  12155. player.anInt1713 = j7 * 128 + j23 * 64;
  12156. player.anInt1712 = method42(plane, player.anInt1713,
  12157. player.anInt1711);
  12158. if (byte2 > byte0) {
  12159. byte byte4 = byte2;
  12160. byte2 = byte0;
  12161. byte0 = byte4;
  12162. }
  12163. if (byte3 > byte1) {
  12164. byte byte5 = byte3;
  12165. byte3 = byte1;
  12166. byte1 = byte5;
  12167. }
  12168. player.anInt1719 = k4 + byte2;
  12169. player.anInt1721 = k4 + byte0;
  12170. player.anInt1720 = j7 + byte3;
  12171. player.anInt1722 = j7 + byte1;
  12172. }
  12173. }
  12174. }
  12175. if (j == 151) {
  12176. int i2 = stream.method426();
  12177. int l4 = anInt1268 + (i2 >> 4 & 7);
  12178. int k7 = anInt1269 + (i2 & 7);
  12179. int j10 = stream.method434();
  12180. int k12 = stream.method428();
  12181. int i15 = k12 >> 2;
  12182. int k16 = k12 & 3;
  12183. int l17 = anIntArray1177[i15];
  12184. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  12185. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  12186. return;
  12187. }
  12188. if (j == 4) {
  12189. int j2 = stream.readUnsignedByte();
  12190. int i5 = anInt1268 + (j2 >> 4 & 7);
  12191. int l7 = anInt1269 + (j2 & 7);
  12192. int k10 = stream.readUnsignedWord();
  12193. int l12 = stream.readUnsignedByte();
  12194. int j15 = stream.readUnsignedWord();
  12195. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  12196. i5 = i5 * 128 + 64;
  12197. l7 = l7 * 128 + 64;
  12198. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  12199. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  12200. i5);
  12201. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  12202. }
  12203. return;
  12204. }
  12205. if (j == 44) {
  12206. int k2 = stream.method436();
  12207. int j5 = stream.readUnsignedWord();
  12208. int i8 = stream.readUnsignedByte();
  12209. int l10 = anInt1268 + (i8 >> 4 & 7);
  12210. int i13 = anInt1269 + (i8 & 7);
  12211. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  12212. Item class30_sub2_sub4_sub2_1 = new Item();
  12213. class30_sub2_sub4_sub2_1.ID = k2;
  12214. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  12215. if (groundArray[plane][l10][i13] == null)
  12216. groundArray[plane][l10][i13] = new NodeList();
  12217. groundArray[plane][l10][i13]
  12218. .insertHead(class30_sub2_sub4_sub2_1);
  12219. spawnGroundItem(l10, i13);
  12220. }
  12221. return;
  12222. }
  12223. if (j == 101) {
  12224. int l2 = stream.method427();
  12225. int k5 = l2 >> 2;
  12226. int j8 = l2 & 3;
  12227. int i11 = anIntArray1177[k5];
  12228. int j13 = stream.readUnsignedByte();
  12229. int k15 = anInt1268 + (j13 >> 4 & 7);
  12230. int l16 = anInt1269 + (j13 & 7);
  12231. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  12232. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  12233. return;
  12234. }
  12235. if (j == 117) {
  12236. int i3 = stream.readUnsignedByte();
  12237. int l5 = anInt1268 + (i3 >> 4 & 7);
  12238. int k8 = anInt1269 + (i3 & 7);
  12239. int j11 = l5 + stream.readSignedByte();
  12240. int k13 = k8 + stream.readSignedByte();
  12241. int l15 = stream.readSignedWord();
  12242. int i17 = stream.readUnsignedWord();
  12243. int i18 = stream.readUnsignedByte() * 4;
  12244. int l18 = stream.readUnsignedByte() * 4;
  12245. int k19 = stream.readUnsignedWord();
  12246. int j20 = stream.readUnsignedWord();
  12247. int i21 = stream.readUnsignedByte();
  12248. int j21 = stream.readUnsignedByte();
  12249. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  12250. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  12251. l5 = l5 * 128 + 64;
  12252. k8 = k8 * 128 + 64;
  12253. j11 = j11 * 128 + 64;
  12254. k13 = k13 * 128 + 64;
  12255. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  12256. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  12257. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  12258. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  12259. method42(plane, k13, j11) - l18, j11);
  12260. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  12261. }
  12262. }
  12263. }
  12264.  
  12265. private void method139(Stream stream) {
  12266. stream.initBitAccess();
  12267. int k = stream.readBits(8);
  12268. if (k < npcCount) {
  12269. for (int l = k; l < npcCount; l++)
  12270. anIntArray840[anInt839++] = npcIndices[l];
  12271.  
  12272. }
  12273. if (k > npcCount) {
  12274. Signlink.reporterror(myUsername + " Too many npcs");
  12275. throw new RuntimeException("eek");
  12276. }
  12277. npcCount = 0;
  12278. for (int i1 = 0; i1 < k; i1++) {
  12279. int j1 = npcIndices[i1];
  12280. NPC npc = npcArray[j1];
  12281. int k1 = stream.readBits(1);
  12282. if (k1 == 0) {
  12283. npcIndices[npcCount++] = j1;
  12284. npc.anInt1537 = loopCycle;
  12285. } else {
  12286. int l1 = stream.readBits(2);
  12287. if (l1 == 0) {
  12288. npcIndices[npcCount++] = j1;
  12289. npc.anInt1537 = loopCycle;
  12290. anIntArray894[anInt893++] = j1;
  12291. } else if (l1 == 1) {
  12292. npcIndices[npcCount++] = j1;
  12293. npc.anInt1537 = loopCycle;
  12294. int i2 = stream.readBits(3);
  12295. npc.moveInDir(false, i2);
  12296. int k2 = stream.readBits(1);
  12297. if (k2 == 1)
  12298. anIntArray894[anInt893++] = j1;
  12299. } else if (l1 == 2) {
  12300. npcIndices[npcCount++] = j1;
  12301. npc.anInt1537 = loopCycle;
  12302. int j2 = stream.readBits(3);
  12303. npc.moveInDir(true, j2);
  12304. int l2 = stream.readBits(3);
  12305. npc.moveInDir(true, l2);
  12306. int i3 = stream.readBits(1);
  12307. if (i3 == 1)
  12308. anIntArray894[anInt893++] = j1;
  12309. } else if (l1 == 3)
  12310. anIntArray840[anInt839++] = j1;
  12311. }
  12312. }
  12313.  
  12314. }
  12315.  
  12316. private void processLoginScreenInput() {
  12317. if (loginScreenState == 0) {
  12318. int i = super.myWidth / 2 - 80;
  12319. int l = super.myHeight / 2 + 20;
  12320. l += 20;
  12321. if (super.clickMode3 == 1 && super.saveClickX >= i - 75
  12322. && super.saveClickX <= i + 75 && super.saveClickY >= l - 20
  12323. && super.saveClickY <= l + 20) {
  12324. loginScreenState = 3;
  12325. loginScreenCursorPos = 0;
  12326. }
  12327. i = super.myWidth / 2 + 80;
  12328. if (super.clickMode3 == 1 && super.saveClickX >= i - 75
  12329. && super.saveClickX <= i + 75 && super.saveClickY >= l - 20
  12330. && super.saveClickY <= l + 20) {
  12331. loginMessage1 = "";
  12332. loginMessage2 = "Enter your username & password.";
  12333. loginScreenState = 2;
  12334. loginScreenCursorPos = 0;
  12335. }
  12336. } else {
  12337. if (loginScreenState == 2) {
  12338. int j = super.myHeight / 2 - 40;
  12339. j += 30;
  12340. j += 25;
  12341. if (super.clickMode3 == 1 && super.saveClickY >= j - 15
  12342. && super.saveClickY < j)
  12343. loginScreenCursorPos = 0;
  12344. j += 15;
  12345. if (super.clickMode3 == 1 && super.saveClickY >= j - 15
  12346. && super.saveClickY < j)
  12347. loginScreenCursorPos = 1;
  12348. j += 15;
  12349. int i1 = super.myWidth / 2 - 80;
  12350. int k1 = super.myHeight / 2 + 50;
  12351. k1 += 20;
  12352. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75
  12353. && super.saveClickX <= i1 + 75
  12354. && super.saveClickY >= k1 - 20
  12355. && super.saveClickY <= k1 + 20) {
  12356. loginFailures = 0;
  12357. login(myUsername, myPassword, false);
  12358. if (loggedIn)
  12359. return;
  12360. }
  12361. i1 = super.myWidth / 2 + 80;
  12362. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75
  12363. && super.saveClickX <= i1 + 75
  12364. && super.saveClickY >= k1 - 20
  12365. && super.saveClickY <= k1 + 20) {
  12366. loginScreenState = 0;
  12367. }
  12368. do {
  12369. int l1 = readChar(-796);
  12370. if (l1 == -1)
  12371. break;
  12372. boolean flag1 = false;
  12373. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  12374. if (l1 != validUserPassChars.charAt(i2))
  12375. continue;
  12376. flag1 = true;
  12377. break;
  12378. }
  12379.  
  12380. if (loginScreenCursorPos == 0) {
  12381. if (l1 == 8 && myUsername.length() > 0)
  12382. myUsername = myUsername.substring(0,
  12383. myUsername.length() - 1);
  12384. if (l1 == 9 || l1 == 10 || l1 == 13)
  12385. loginScreenCursorPos = 1;
  12386. if (flag1)
  12387. myUsername += (char) l1;
  12388. if (myUsername.length() > 12)
  12389. myUsername = myUsername.substring(0, 12);
  12390. } else if (loginScreenCursorPos == 1) {
  12391. if (l1 == 8 && myPassword.length() > 0)
  12392. myPassword = myPassword.substring(0,
  12393. myPassword.length() - 1);
  12394. if (l1 == 9 || l1 == 10 || l1 == 13)
  12395. loginScreenCursorPos = 0;
  12396. if (flag1)
  12397. myPassword += (char) l1;
  12398. if (myPassword.length() > 20)
  12399. myPassword = myPassword.substring(0, 20);
  12400. }
  12401. } while (true);
  12402. return;
  12403. }
  12404. if (loginScreenState == 3) {
  12405. int k = super.myWidth / 2;
  12406. int j1 = super.myHeight / 2 + 50;
  12407. j1 += 20;
  12408. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  12409. && super.saveClickX <= k + 75
  12410. && super.saveClickY >= j1 - 20
  12411. && super.saveClickY <= j1 + 20)
  12412. loginScreenState = 0;
  12413. }
  12414. }
  12415. }
  12416.  
  12417. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  12418. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  12419. if (lowMem && j != plane)
  12420. return;
  12421. int i2 = 0;
  12422. if (j1 == 0)
  12423. i2 = worldController.method300(j, i1, i);
  12424. if (j1 == 1)
  12425. i2 = worldController.method301(j, i1, i);
  12426. if (j1 == 2)
  12427. i2 = worldController.method302(j, i1, i);
  12428. if (j1 == 3)
  12429. i2 = worldController.method303(j, i1, i);
  12430. if (i2 != 0) {
  12431. int i3 = worldController.method304(j, i1, i, i2);
  12432. int j2 = i2 >> 14 & 0x7fff;
  12433. int k2 = i3 & 0x1f;
  12434. int l2 = i3 >> 6;
  12435. if (j1 == 0) {
  12436. worldController.method291(i1, j, i, (byte) -119);
  12437. ObjectDef class46 = ObjectDef.forID(j2);
  12438. if (class46.aBoolean767)
  12439. aClass11Array1230[j].method215(l2, k2,
  12440. class46.aBoolean757, i1, i);
  12441. }
  12442. if (j1 == 1)
  12443. worldController.method292(i, j, i1);
  12444. if (j1 == 2) {
  12445. worldController.method293(j, i1, i);
  12446. ObjectDef class46_1 = ObjectDef.forID(j2);
  12447. if (i1 + class46_1.anInt744 > 103
  12448. || i + class46_1.anInt744 > 103
  12449. || i1 + class46_1.anInt761 > 103
  12450. || i + class46_1.anInt761 > 103)
  12451. return;
  12452. if (class46_1.aBoolean767)
  12453. aClass11Array1230[j].method216(l2, class46_1.anInt744,
  12454. i1, i, class46_1.anInt761,
  12455. class46_1.aBoolean757);
  12456. }
  12457. if (j1 == 3) {
  12458. worldController.method294(j, i, i1);
  12459. ObjectDef class46_2 = ObjectDef.forID(j2);
  12460. if (class46_2.aBoolean767 && class46_2.hasActions)
  12461. aClass11Array1230[j].method218(i, i1);
  12462. }
  12463. }
  12464. if (k1 >= 0) {
  12465. int j3 = j;
  12466. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  12467. j3++;
  12468. ObjectManager.method188(worldController, k, i, l, j3,
  12469. aClass11Array1230[j], intGroundArray, i1, k1, j);
  12470. }
  12471. }
  12472. }
  12473.  
  12474. private void updatePlayers(int i, Stream stream) {
  12475. anInt839 = 0;
  12476. anInt893 = 0;
  12477. method117(stream);
  12478. method134(stream);
  12479. method91(stream, i);
  12480. method49(stream);
  12481. for (int k = 0; k < anInt839; k++) {
  12482. int l = anIntArray840[k];
  12483. if (playerArray[l].anInt1537 != loopCycle)
  12484. playerArray[l] = null;
  12485. }
  12486.  
  12487. if (stream.currentOffset != i) {
  12488. Signlink.reporterror("Error packet size mismatch in getplayer pos:"
  12489. + stream.currentOffset + " psize:" + i);
  12490. throw new RuntimeException("eek");
  12491. }
  12492. for (int i1 = 0; i1 < playerCount; i1++)
  12493. if (playerArray[playerIndices[i1]] == null) {
  12494. Signlink.reporterror(myUsername
  12495. + " null entry in pl list - pos:" + i1 + " size:"
  12496. + playerCount);
  12497. throw new RuntimeException("eek");
  12498. }
  12499.  
  12500. }
  12501.  
  12502. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  12503. int l1 = 2048 - k & 0x7ff;
  12504. int i2 = 2048 - j1 & 0x7ff;
  12505. int j2 = 0;
  12506. int k2 = 0;
  12507. int l2 = j;
  12508. if (l1 != 0) {
  12509. int i3 = Model.modelIntArray1[l1];
  12510. int k3 = Model.modelIntArray2[l1];
  12511. int i4 = k2 * k3 - l2 * i3 >> 16;
  12512. l2 = k2 * i3 + l2 * k3 >> 16;
  12513. k2 = i4;
  12514. }
  12515. if (i2 != 0) {
  12516. /*
  12517. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  12518. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  12519. * l2 = fwdbwd; }
  12520. */
  12521. int j3 = Model.modelIntArray1[i2];
  12522. int l3 = Model.modelIntArray2[i2];
  12523. int j4 = l2 * j3 + j2 * l3 >> 16;
  12524. l2 = l2 * l3 - j2 * j3 >> 16;
  12525. j2 = j4;
  12526. }
  12527. xCameraPos = l - j2;
  12528. zCameraPos = i1 - k2;
  12529. yCameraPos = k1 - l2;
  12530. yCameraCurve = k;
  12531. xCameraCurve = j1;
  12532. }
  12533.  
  12534. public void updateStrings(String str, int i) {
  12535. switch (i) {
  12536. case 1675:
  12537. sendFrame126(str, 17508);
  12538. break;// Stab
  12539. case 1676:
  12540. sendFrame126(str, 17509);
  12541. break;// Slash
  12542. case 1677:
  12543. sendFrame126(str, 17510);
  12544. break;// Cursh
  12545. case 1678:
  12546. sendFrame126(str, 17511);
  12547. break;// Magic
  12548. case 1679:
  12549. sendFrame126(str, 17512);
  12550. break;// Range
  12551. case 1680:
  12552. sendFrame126(str, 17513);
  12553. break;// Stab
  12554. case 1681:
  12555. sendFrame126(str, 17514);
  12556. break;// Slash
  12557. case 1682:
  12558. sendFrame126(str, 17515);
  12559. break;// Crush
  12560. case 1683:
  12561. sendFrame126(str, 17516);
  12562. break;// Magic
  12563. case 1684:
  12564. sendFrame126(str, 17517);
  12565. break;// Range
  12566. case 1686:
  12567. sendFrame126(str, 17518);
  12568. break;// Strength
  12569. case 1687:
  12570. sendFrame126(str, 17519);
  12571. break;// Prayer
  12572. }
  12573. }
  12574.  
  12575. public void sendFrame126(String str, int i) {
  12576. RSInterface.interfaceCache[i].message = str;
  12577. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID]) {
  12578. needDrawTabArea = true;
  12579. }
  12580. }
  12581.  
  12582. public void sendPacket185(int button, int toggle, int type) {
  12583. switch (type) {
  12584. case 135:
  12585. RSInterface class9 = RSInterface.interfaceCache[button];
  12586. boolean flag8 = true;
  12587. if (class9.contentType > 0)
  12588. flag8 = promptUserForInput(class9);
  12589. if (flag8) {
  12590. stream.createFrame(185);
  12591. stream.writeWord(button);
  12592. }
  12593. break;
  12594. case 646:
  12595. stream.createFrame(185);
  12596. stream.writeWord(button);
  12597. RSInterface class9_2 = RSInterface.interfaceCache[button];
  12598. if (class9_2.valueIndexArray != null
  12599. && class9_2.valueIndexArray[0][0] == 5) {
  12600. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  12601. variousSettings[toggle] = class9_2.anIntArray212[0];
  12602. method33(toggle);
  12603. needDrawTabArea = true;
  12604. }
  12605. }
  12606. break;
  12607. case 169:
  12608. stream.createFrame(185);
  12609. stream.writeWord(button);
  12610. RSInterface class9_3 = RSInterface.interfaceCache[button];
  12611. if (class9_3.valueIndexArray != null
  12612. && class9_3.valueIndexArray[0][0] == 5) {
  12613. variousSettings[toggle] = 1 - variousSettings[toggle];
  12614. method33(toggle);
  12615. needDrawTabArea = true;
  12616. }
  12617. switch (button) {
  12618. case 74214:
  12619. System.out.println("toggle = " + toggle);
  12620. if (toggle == 0)
  12621. sendFrame36(173, toggle);
  12622. if (toggle == 1)
  12623. sendPacket185(153, 173, 646);
  12624. break;
  12625. }
  12626. break;
  12627. }
  12628. }
  12629.  
  12630. public void sendFrame36(int id, int state) {
  12631. anIntArray1045[id] = state;
  12632. if (variousSettings[id] != state) {
  12633. variousSettings[id] = state;
  12634. method33(id);
  12635. needDrawTabArea = true;
  12636. if (dialogID != -1)
  12637. inputTaken = true;
  12638. }
  12639. }
  12640.  
  12641. public void sendFrame219() {
  12642. if (invOverlayInterfaceID != -1) {
  12643. invOverlayInterfaceID = -1;
  12644. tabAreaAltered = true;
  12645. needDrawTabArea = true;
  12646. }
  12647. if (backDialogID != -1) {
  12648. backDialogID = -1;
  12649. inputTaken = true;
  12650. }
  12651. if (inputDialogState != 0) {
  12652. inputDialogState = 0;
  12653. inputTaken = true;
  12654. }
  12655. openInterfaceID = -1;
  12656. aBoolean1149 = false;
  12657. }
  12658.  
  12659. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  12660. if (backDialogID != -1) {
  12661. backDialogID = -1;
  12662. inputTaken = true;
  12663. }
  12664. if (inputDialogState != 0) {
  12665. inputDialogState = 0;
  12666. inputTaken = true;
  12667. }
  12668. openInterfaceID = interfaceID;
  12669. invOverlayInterfaceID = sideInterfaceID;
  12670. needDrawTabArea = true;
  12671. tabAreaAltered = true;
  12672. aBoolean1149 = false;
  12673. }
  12674.  
  12675. private boolean parsePacket() {
  12676. if (socketStream == null)
  12677. return false;
  12678. try {
  12679. int i = socketStream.available();
  12680. if (i == 0)
  12681. return false;
  12682. if (pktType == -1) {
  12683. socketStream.flushInputStream(inStream.buffer, 1);
  12684. pktType = inStream.buffer[0] & 0xff;
  12685. if (encryption != null)
  12686. pktType = pktType - encryption.getNextKey() & 0xff;
  12687. pktSize = SizeConstants.packetSizes[pktType];
  12688. i--;
  12689. }
  12690. if (pktSize == -1)
  12691. if (i > 0) {
  12692. socketStream.flushInputStream(inStream.buffer, 1);
  12693. pktSize = inStream.buffer[0] & 0xff;
  12694. i--;
  12695. } else {
  12696. return false;
  12697. }
  12698. if (pktSize == -2)
  12699. if (i > 1) {
  12700. socketStream.flushInputStream(inStream.buffer, 2);
  12701. inStream.currentOffset = 0;
  12702. pktSize = inStream.readUnsignedWord();
  12703. i -= 2;
  12704. } else {
  12705. return false;
  12706. }
  12707. if (i < pktSize)
  12708. return false;
  12709. inStream.currentOffset = 0;
  12710. socketStream.flushInputStream(inStream.buffer, pktSize);
  12711. anInt1009 = 0;
  12712. anInt843 = anInt842;
  12713. anInt842 = anInt841;
  12714. anInt841 = pktType;
  12715. switch (pktType) {
  12716. case 81:
  12717. updatePlayers(pktSize, inStream);
  12718. aBoolean1080 = false;
  12719. pktType = -1;
  12720. return true;
  12721.  
  12722. case 176:
  12723. daysSinceRecovChange = inStream.method427();
  12724. unreadMessages = inStream.method435();
  12725. membersInt = inStream.readUnsignedByte();
  12726. anInt1193 = inStream.method440();
  12727. daysSinceLastLogin = inStream.readUnsignedWord();
  12728. if (anInt1193 != 0 && openInterfaceID == -1) {
  12729. Signlink.dnslookup(TextClass.method586(anInt1193));
  12730. clearTopInterfaces();
  12731. char c = '\u028A';
  12732. if (daysSinceRecovChange != 201 || membersInt == 1)
  12733. c = '\u028F';
  12734. reportAbuseInput = "";
  12735. canMute = false;
  12736. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  12737. if (RSInterface.interfaceCache[k9] == null
  12738. || RSInterface.interfaceCache[k9].contentType != c)
  12739. continue;
  12740. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  12741.  
  12742. }
  12743. }
  12744. pktType = -1;
  12745. return true;
  12746.  
  12747. case 64:
  12748. anInt1268 = inStream.method427();
  12749. anInt1269 = inStream.method428();
  12750. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  12751. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  12752. if (groundArray[plane][j][l9] != null) {
  12753. groundArray[plane][j][l9] = null;
  12754. spawnGroundItem(j, l9);
  12755. }
  12756. }
  12757. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  12758. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  12759. .reverseGetNext())
  12760. if (class30_sub1.anInt1297 >= anInt1268
  12761. && class30_sub1.anInt1297 < anInt1268 + 8
  12762. && class30_sub1.anInt1298 >= anInt1269
  12763. && class30_sub1.anInt1298 < anInt1269 + 8
  12764. && class30_sub1.anInt1295 == plane)
  12765. class30_sub1.anInt1294 = 0;
  12766. pktType = -1;
  12767. return true;
  12768.  
  12769. case 185:
  12770. int k = inStream.method436();
  12771. RSInterface.interfaceCache[k].anInt233 = 3;
  12772. if (myPlayer.desc == null)
  12773. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  12774. + (myPlayer.anIntArray1700[4] << 20)
  12775. + (myPlayer.equipment[0] << 15)
  12776. + (myPlayer.equipment[8] << 10)
  12777. + (myPlayer.equipment[11] << 5)
  12778. + myPlayer.equipment[1];
  12779. else
  12780. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  12781. pktType = -1;
  12782. return true;
  12783.  
  12784. /* Clan chat packet */
  12785. case 217:
  12786. try {
  12787. name = inStream.readString();
  12788. message = inStream.readString();
  12789. clanname = inStream.readString();
  12790. rights = inStream.readUnsignedWord();
  12791. message = TextInput.processText(message);
  12792. // message = Censor.doCensor(message);
  12793. System.out.println(clanname);
  12794. pushMessage(message, 16, name);
  12795. } catch (Exception e) {
  12796. e.printStackTrace();
  12797. }
  12798. pktType = -1;
  12799. return true;
  12800.  
  12801. case 107:
  12802. aBoolean1160 = false;
  12803. for (int l = 0; l < 5; l++)
  12804. aBooleanArray876[l] = false;
  12805. pktType = -1;
  12806. return true;
  12807.  
  12808. case 72:
  12809. int i1 = inStream.method434();
  12810. RSInterface class9 = RSInterface.interfaceCache[i1];
  12811. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  12812. class9.inv[k15] = -1;
  12813. class9.inv[k15] = 0;
  12814. }
  12815. pktType = -1;
  12816. return true;
  12817.  
  12818. case 214:
  12819. ignoreCount = pktSize / 8;
  12820. for (int j1 = 0; j1 < ignoreCount; j1++)
  12821. ignoreListAsLongs[j1] = inStream.readQWord();
  12822. pktType = -1;
  12823. return true;
  12824.  
  12825. case 166:
  12826. aBoolean1160 = true;
  12827. anInt1098 = inStream.readUnsignedByte();
  12828. anInt1099 = inStream.readUnsignedByte();
  12829. anInt1100 = inStream.readUnsignedWord();
  12830. anInt1101 = inStream.readUnsignedByte();
  12831. anInt1102 = inStream.readUnsignedByte();
  12832. if (anInt1102 >= 100) {
  12833. xCameraPos = anInt1098 * 128 + 64;
  12834. yCameraPos = anInt1099 * 128 + 64;
  12835. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  12836. - anInt1100;
  12837. }
  12838. pktType = -1;
  12839. return true;
  12840.  
  12841. case 134:
  12842. needDrawTabArea = true;
  12843. int k1 = inStream.readUnsignedByte();
  12844. int i10 = inStream.method439();
  12845. int l15 = inStream.readUnsignedByte();
  12846. int xp = currentExp[k1];
  12847. currentExp[k1] = i10;
  12848. currentStats[k1] = l15;
  12849. if (currentExp[k1] - xp > 0 && counterOn) {
  12850. latest += 1;
  12851. xpCounter += currentExp[k1] - xp;
  12852. expAdded[getLatest()] += currentExp[k1] - xp;
  12853. }
  12854. maxStats[k1] = 1;
  12855. for (int k20 = 0; k20 < 98; k20++)
  12856. if (i10 >= anIntArray1019[k20])
  12857. maxStats[k1] = k20 + 2;
  12858. pktType = -1;
  12859. return true;
  12860.  
  12861. case 71:
  12862. int l1 = inStream.readUnsignedWord();
  12863. int j10 = inStream.method426();
  12864. if (l1 == 65535)
  12865. l1 = -1;
  12866. tabInterfaceIDs[j10] = l1;
  12867. needDrawTabArea = true;
  12868. tabAreaAltered = true;
  12869. pktType = -1;
  12870. return true;
  12871.  
  12872. case 74:
  12873. int i2 = inStream.method434();
  12874. if (i2 == 65535)
  12875. i2 = -1;
  12876. if (i2 != currentSong && musicEnabled && !lowMem
  12877. && prevSong == 0) {
  12878. nextSong = i2;
  12879. songChanging = true;
  12880. onDemandFetcher.method558(2, nextSong);
  12881. }
  12882. currentSong = i2;
  12883. pktType = -1;
  12884. return true;
  12885.  
  12886. case 121:
  12887. int j2 = inStream.method436();
  12888. int k10 = inStream.method435();
  12889. if (musicEnabled && !lowMem) {
  12890. nextSong = j2;
  12891. songChanging = false;
  12892. onDemandFetcher.method558(2, nextSong);
  12893. prevSong = k10;
  12894. }
  12895. pktType = -1;
  12896. return true;
  12897.  
  12898. case 109:
  12899. resetLogout();
  12900. pktType = -1;
  12901. return false;
  12902.  
  12903. case 70:
  12904. int k2 = inStream.readSignedWord();
  12905. int l10 = inStream.method437();
  12906. int i16 = inStream.method434();
  12907. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  12908. class9_5.anInt263 = k2;
  12909. class9_5.anInt265 = l10;
  12910. pktType = -1;
  12911. return true;
  12912.  
  12913. case 73:
  12914. case 241:
  12915. int l2 = anInt1069;
  12916. int i11 = anInt1070;
  12917. if (pktType == 73) {
  12918. l2 = inStream.method435();
  12919. i11 = inStream.readUnsignedWord();
  12920. aBoolean1159 = false;
  12921. }
  12922. if (pktType == 241) {
  12923. i11 = inStream.method435();
  12924. inStream.initBitAccess();
  12925. for (int j16 = 0; j16 < 4; j16++) {
  12926. for (int l20 = 0; l20 < 13; l20++) {
  12927. for (int j23 = 0; j23 < 13; j23++) {
  12928. int i26 = inStream.readBits(1);
  12929. if (i26 == 1)
  12930. anIntArrayArrayArray1129[j16][l20][j23] = inStream
  12931. .readBits(26);
  12932. else
  12933. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12934. }
  12935. }
  12936. }
  12937. inStream.finishBitAccess();
  12938. l2 = inStream.readUnsignedWord();
  12939. aBoolean1159 = true;
  12940. }
  12941. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12942. pktType = -1;
  12943. return true;
  12944. }
  12945. anInt1069 = l2;
  12946. anInt1070 = i11;
  12947. baseX = (anInt1069 - 6) * 8;
  12948. baseY = (anInt1070 - 6) * 8;
  12949. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49)
  12950. && anInt1070 / 8 == 48;
  12951. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12952. aBoolean1141 = true;
  12953. loadingStage = 1;
  12954. aLong824 = System.currentTimeMillis();
  12955. aRSImageProducer_1165.initDrawingArea();
  12956. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2);
  12957. DrawingArea.drawPixels(20, 3, 3, 0, 128);
  12958. aTextDrawingArea_1271.drawText(0, "Loading - please wait", 18,
  12959. 68);
  12960. aTextDrawingArea_1271.drawText(0xffffff,
  12961. "Loading - please wait", 17, 67);
  12962. aRSImageProducer_1165.drawGraphics(clientSize == 0 ? 4 : 0,
  12963. super.graphics, clientSize == 0 ? 4 : 0);
  12964.  
  12965. if (pktType == 73) {
  12966. int k16 = 0;
  12967. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12968. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12969. k16++;
  12970. }
  12971. aByteArrayArray1183 = new byte[k16][];
  12972. aByteArrayArray1247 = new byte[k16][];
  12973. anIntArray1234 = new int[k16];
  12974. anIntArray1235 = new int[k16];
  12975. anIntArray1236 = new int[k16];
  12976. k16 = 0;
  12977. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12978. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12979. anIntArray1234[k16] = (l23 << 8) + j26;
  12980. if (aBoolean1141
  12981. && (j26 == 49 || j26 == 149 || j26 == 147
  12982. || l23 == 50 || l23 == 49
  12983. && j26 == 47)) {
  12984. anIntArray1235[k16] = -1;
  12985. anIntArray1236[k16] = -1;
  12986. k16++;
  12987. } else {
  12988. int k28 = anIntArray1235[k16] = onDemandFetcher
  12989. .method562(0, j26, l23);
  12990. if (k28 != -1)
  12991. onDemandFetcher.method558(3, k28);
  12992. int j30 = anIntArray1236[k16] = onDemandFetcher
  12993. .method562(1, j26, l23);
  12994. if (j30 != -1)
  12995. onDemandFetcher.method558(3, j30);
  12996. k16++;
  12997. }
  12998. }
  12999. }
  13000. }
  13001. if (pktType == 241) {
  13002. int l16 = 0;
  13003. int ai[] = new int[676];
  13004. for (int i24 = 0; i24 < 4; i24++) {
  13005. for (int k26 = 0; k26 < 13; k26++) {
  13006. for (int l28 = 0; l28 < 13; l28++) {
  13007. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  13008. if (k30 != -1) {
  13009. int k31 = k30 >> 14 & 0x3ff;
  13010. int i32 = k30 >> 3 & 0x7ff;
  13011. int k32 = (k31 / 8 << 8) + i32 / 8;
  13012. for (int j33 = 0; j33 < l16; j33++) {
  13013. if (ai[j33] != k32)
  13014. continue;
  13015. k32 = -1;
  13016.  
  13017. }
  13018. if (k32 != -1)
  13019. ai[l16++] = k32;
  13020. }
  13021. }
  13022. }
  13023. }
  13024. aByteArrayArray1183 = new byte[l16][];
  13025. aByteArrayArray1247 = new byte[l16][];
  13026. anIntArray1234 = new int[l16];
  13027. anIntArray1235 = new int[l16];
  13028. anIntArray1236 = new int[l16];
  13029. for (int l26 = 0; l26 < l16; l26++) {
  13030. int i29 = anIntArray1234[l26] = ai[l26];
  13031. int l30 = i29 >> 8 & 0xff;
  13032. int l31 = i29 & 0xff;
  13033. int j32 = anIntArray1235[l26] = onDemandFetcher
  13034. .method562(0, l31, l30);
  13035. if (j32 != -1)
  13036. onDemandFetcher.method558(3, j32);
  13037. int i33 = anIntArray1236[l26] = onDemandFetcher
  13038. .method562(1, l31, l30);
  13039. if (i33 != -1)
  13040. onDemandFetcher.method558(3, i33);
  13041. }
  13042. }
  13043. int i17 = baseX - anInt1036;
  13044. int j21 = baseY - anInt1037;
  13045. anInt1036 = baseX;
  13046. anInt1037 = baseY;
  13047. for (int j24 = 0; j24 < 16384; j24++) {
  13048. NPC npc = npcArray[j24];
  13049. if (npc != null) {
  13050. for (int j29 = 0; j29 < 10; j29++) {
  13051. npc.smallX[j29] -= i17;
  13052. npc.smallY[j29] -= j21;
  13053. }
  13054. npc.x -= i17 * 128;
  13055. npc.y -= j21 * 128;
  13056. }
  13057. }
  13058. for (int i27 = 0; i27 < maxPlayers; i27++) {
  13059. Player player = playerArray[i27];
  13060. if (player != null) {
  13061. for (int i31 = 0; i31 < 10; i31++) {
  13062. player.smallX[i31] -= i17;
  13063. player.smallY[i31] -= j21;
  13064. }
  13065. player.x -= i17 * 128;
  13066. player.y -= j21 * 128;
  13067. }
  13068. }
  13069. aBoolean1080 = true;
  13070. byte byte1 = 0;
  13071. byte byte2 = 104;
  13072. byte byte3 = 1;
  13073. if (i17 < 0) {
  13074. byte1 = 103;
  13075. byte2 = -1;
  13076. byte3 = -1;
  13077. }
  13078. byte byte4 = 0;
  13079. byte byte5 = 104;
  13080. byte byte6 = 1;
  13081. if (j21 < 0) {
  13082. byte4 = 103;
  13083. byte5 = -1;
  13084. byte6 = -1;
  13085. }
  13086. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  13087. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  13088. int i34 = k33 + i17;
  13089. int j34 = l33 + j21;
  13090. for (int k34 = 0; k34 < 4; k34++)
  13091. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  13092. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  13093. else
  13094. groundArray[k34][k33][l33] = null;
  13095. }
  13096. }
  13097. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  13098. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  13099. .reverseGetNext()) {
  13100. class30_sub1_1.anInt1297 -= i17;
  13101. class30_sub1_1.anInt1298 -= j21;
  13102. if (class30_sub1_1.anInt1297 < 0
  13103. || class30_sub1_1.anInt1298 < 0
  13104. || class30_sub1_1.anInt1297 >= 104
  13105. || class30_sub1_1.anInt1298 >= 104)
  13106. class30_sub1_1.unlink();
  13107. }
  13108. if (destX != 0) {
  13109. destX -= i17;
  13110. destY -= j21;
  13111. }
  13112. aBoolean1160 = false;
  13113. pktType = -1;
  13114. return true;
  13115.  
  13116. case 208:
  13117. int i3 = inStream.method437();
  13118. if (i3 >= 0) {
  13119. method60(i3);
  13120. walkableInterfaceMode = true;
  13121. } else
  13122. walkableInterfaceMode = false;
  13123. anInt1018 = i3;
  13124. pktType = -1;
  13125. return true;
  13126.  
  13127. case 99:
  13128. anInt1021 = inStream.readUnsignedByte();
  13129. pktType = -1;
  13130. return true;
  13131.  
  13132. case 75:
  13133. int j3 = inStream.method436();
  13134. int j11 = inStream.method436();
  13135. RSInterface.interfaceCache[j11].anInt233 = 2;
  13136. RSInterface.interfaceCache[j11].mediaID = j3;
  13137. pktType = -1;
  13138. return true;
  13139.  
  13140. case 114:
  13141. anInt1104 = inStream.method434() * 30;
  13142. pktType = -1;
  13143. return true;
  13144.  
  13145. case 60:
  13146. anInt1269 = inStream.readUnsignedByte();
  13147. anInt1268 = inStream.method427();
  13148. while (inStream.currentOffset < pktSize) {
  13149. int k3 = inStream.readUnsignedByte();
  13150. method137(inStream, k3);
  13151. }
  13152. pktType = -1;
  13153. return true;
  13154.  
  13155. case 35:
  13156. int l3 = inStream.readUnsignedByte();
  13157. int k11 = inStream.readUnsignedByte();
  13158. int j17 = inStream.readUnsignedByte();
  13159. int k21 = inStream.readUnsignedByte();
  13160. aBooleanArray876[l3] = true;
  13161. anIntArray873[l3] = k11;
  13162. anIntArray1203[l3] = j17;
  13163. anIntArray928[l3] = k21;
  13164. anIntArray1030[l3] = 0;
  13165. pktType = -1;
  13166. return true;
  13167.  
  13168. case 174:
  13169. int i4 = inStream.readUnsignedWord();
  13170. int l11 = inStream.readUnsignedByte();
  13171. int k17 = inStream.readUnsignedWord();
  13172. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  13173. anIntArray1207[anInt1062] = i4;
  13174. anIntArray1241[anInt1062] = l11;
  13175. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  13176. anInt1062++;
  13177. }
  13178. pktType = -1;
  13179. return true;
  13180.  
  13181. case 104:
  13182. int j4 = inStream.method427();
  13183. int i12 = inStream.method426();
  13184. String s6 = inStream.readString();
  13185. if (j4 >= 1 && j4 <= 5) {
  13186. if (s6.equalsIgnoreCase("null"))
  13187. s6 = null;
  13188. atPlayerActions[j4 - 1] = s6;
  13189. atPlayerArray[j4 - 1] = i12 == 0;
  13190. }
  13191. pktType = -1;
  13192. return true;
  13193.  
  13194. case 78:
  13195. destX = 0;
  13196. pktType = -1;
  13197. return true;
  13198.  
  13199. case 253:
  13200. String s = inStream.readString();
  13201. if (s.endsWith(":tradereq:")) {
  13202. String s3 = s.substring(0, s.indexOf(":"));
  13203. long l17 = TextClass.longForName(s3);
  13204. boolean flag2 = false;
  13205. for (int j27 = 0; j27 < ignoreCount; j27++) {
  13206. if (ignoreListAsLongs[j27] != l17)
  13207. continue;
  13208. flag2 = true;
  13209.  
  13210. }
  13211. if (!flag2 && anInt1251 == 0)
  13212. pushMessage("wishes to trade with you.", 4, s3);
  13213. } else if (s.endsWith(":clan:")) {
  13214. String s4 = s.substring(0, s.indexOf(":"));
  13215. TextClass.longForName(s4);
  13216. pushMessage("Clan: ", 8, s4);
  13217. } else if (s.endsWith("#url#")) {
  13218. String link = s.substring(0, s.indexOf("#"));
  13219. pushMessage("Join us at: ", 9, link);
  13220. } else if (s.endsWith(":duelreq:")) {
  13221. String s4 = s.substring(0, s.indexOf(":"));
  13222. long l18 = TextClass.longForName(s4);
  13223. boolean flag3 = false;
  13224. for (int k27 = 0; k27 < ignoreCount; k27++) {
  13225. if (ignoreListAsLongs[k27] != l18)
  13226. continue;
  13227. flag3 = true;
  13228.  
  13229. }
  13230. if (!flag3 && anInt1251 == 0)
  13231. pushMessage("wishes to duel with you.", 8, s4);
  13232. } else if (s.endsWith(":chalreq:")) {
  13233. String s5 = s.substring(0, s.indexOf(":"));
  13234. long l19 = TextClass.longForName(s5);
  13235. boolean flag4 = false;
  13236. for (int l27 = 0; l27 < ignoreCount; l27++) {
  13237. if (ignoreListAsLongs[l27] != l19)
  13238. continue;
  13239. flag4 = true;
  13240.  
  13241. }
  13242. if (!flag4 && anInt1251 == 0) {
  13243. String s8 = s.substring(s.indexOf(":") + 1,
  13244. s.length() - 9);
  13245. pushMessage(s8, 8, s5);
  13246. }
  13247. } else if (s.endsWith(":resetautocast:")) {
  13248. autocast = false;
  13249. autoCastId = 0;
  13250. } else {
  13251. pushMessage(s, 0, "");
  13252. }
  13253. pktType = -1;
  13254. return true;
  13255.  
  13256. case 1:
  13257. for (int k4 = 0; k4 < playerArray.length; k4++)
  13258. if (playerArray[k4] != null)
  13259. playerArray[k4].anim = -1;
  13260. for (int j12 = 0; j12 < npcArray.length; j12++)
  13261. if (npcArray[j12] != null)
  13262. npcArray[j12].anim = -1;
  13263. pktType = -1;
  13264. return true;
  13265.  
  13266. case 50:
  13267. long l4 = inStream.readQWord();
  13268. int i18 = inStream.readUnsignedByte();
  13269. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  13270. for (int k24 = 0; k24 < friendsCount; k24++) {
  13271. if (l4 != friendsListAsLongs[k24])
  13272. continue;
  13273. if (friendsNodeIDs[k24] != i18) {
  13274. friendsNodeIDs[k24] = i18;
  13275. needDrawTabArea = true;
  13276. if (i18 >= 2) {
  13277. pushMessage(s7 + " has logged in.", 5, "");
  13278. }
  13279. if (i18 <= 1) {
  13280. pushMessage(s7 + " has logged out.", 5, "");
  13281. }
  13282. }
  13283. s7 = null;
  13284.  
  13285. }
  13286. if (s7 != null && friendsCount < 200) {
  13287. friendsListAsLongs[friendsCount] = l4;
  13288. friendsList[friendsCount] = s7;
  13289. friendsNodeIDs[friendsCount] = i18;
  13290. friendsCount++;
  13291. needDrawTabArea = true;
  13292. }
  13293. for (boolean flag6 = false; !flag6;) {
  13294. flag6 = true;
  13295. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  13296. if (friendsNodeIDs[k29] != nodeID
  13297. && friendsNodeIDs[k29 + 1] == nodeID
  13298. || friendsNodeIDs[k29] == 0
  13299. && friendsNodeIDs[k29 + 1] != 0) {
  13300. int j31 = friendsNodeIDs[k29];
  13301. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  13302. friendsNodeIDs[k29 + 1] = j31;
  13303. String s10 = friendsList[k29];
  13304. friendsList[k29] = friendsList[k29 + 1];
  13305. friendsList[k29 + 1] = s10;
  13306. long l32 = friendsListAsLongs[k29];
  13307. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  13308. friendsListAsLongs[k29 + 1] = l32;
  13309. needDrawTabArea = true;
  13310. flag6 = false;
  13311. }
  13312. }
  13313. pktType = -1;
  13314. return true;
  13315.  
  13316. case 110:
  13317. if (tabID == 12) {
  13318. needDrawTabArea = true;
  13319. }
  13320. energy = inStream.readUnsignedByte();
  13321. pktType = -1;
  13322. return true;
  13323.  
  13324. case 254:
  13325. anInt855 = inStream.readUnsignedByte();
  13326. if (anInt855 == 1)
  13327. anInt1222 = inStream.readUnsignedWord();
  13328. if (anInt855 >= 2 && anInt855 <= 6) {
  13329. if (anInt855 == 2) {
  13330. anInt937 = 64;
  13331. anInt938 = 64;
  13332. }
  13333. if (anInt855 == 3) {
  13334. anInt937 = 0;
  13335. anInt938 = 64;
  13336. }
  13337. if (anInt855 == 4) {
  13338. anInt937 = 128;
  13339. anInt938 = 64;
  13340. }
  13341. if (anInt855 == 5) {
  13342. anInt937 = 64;
  13343. anInt938 = 0;
  13344. }
  13345. if (anInt855 == 6) {
  13346. anInt937 = 64;
  13347. anInt938 = 128;
  13348. }
  13349. anInt855 = 2;
  13350. anInt934 = inStream.readUnsignedWord();
  13351. anInt935 = inStream.readUnsignedWord();
  13352. anInt936 = inStream.readUnsignedByte();
  13353. }
  13354. if (anInt855 == 10)
  13355. anInt933 = inStream.readUnsignedWord();
  13356. pktType = -1;
  13357. return true;
  13358.  
  13359. case 248:
  13360. int i5 = inStream.method435();
  13361. int k12 = inStream.readUnsignedWord();
  13362. if (backDialogID != -1) {
  13363. backDialogID = -1;
  13364. inputTaken = true;
  13365. }
  13366. if (inputDialogState != 0) {
  13367. inputDialogState = 0;
  13368. inputTaken = true;
  13369. }
  13370. openInterfaceID = i5;
  13371. invOverlayInterfaceID = k12;
  13372. needDrawTabArea = true;
  13373. tabAreaAltered = true;
  13374. aBoolean1149 = false;
  13375. pktType = -1;
  13376. return true;
  13377.  
  13378. case 79:
  13379. int j5 = inStream.method434();
  13380. int l12 = inStream.method435();
  13381. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  13382. if (class9_3 != null && class9_3.type == 0) {
  13383. if (l12 < 0)
  13384. l12 = 0;
  13385. if (l12 > class9_3.scrollMax - class9_3.height)
  13386. l12 = class9_3.scrollMax - class9_3.height;
  13387. class9_3.scrollPosition = l12;
  13388. }
  13389. pktType = -1;
  13390. return true;
  13391.  
  13392. case 68:
  13393. for (int k5 = 0; k5 < variousSettings.length; k5++)
  13394. if (variousSettings[k5] != anIntArray1045[k5]) {
  13395. variousSettings[k5] = anIntArray1045[k5];
  13396. method33(k5);
  13397. needDrawTabArea = true;
  13398. }
  13399. pktType = -1;
  13400. return true;
  13401.  
  13402. case 196:
  13403. long l5 = inStream.readQWord();
  13404. inStream.readDWord();
  13405. int l21 = inStream.readUnsignedByte();
  13406. boolean flag5 = false;
  13407. if (l21 <= 1) {
  13408. for (int l29 = 0; l29 < ignoreCount; l29++) {
  13409. if (ignoreListAsLongs[l29] != l5)
  13410. continue;
  13411. flag5 = true;
  13412.  
  13413. }
  13414. }
  13415. if (!flag5 && anInt1251 == 0)
  13416. try {
  13417. String s9 = TextInput.method525(pktSize - 13, inStream);
  13418. // if(l21 != 3)
  13419. // s9 = Censor.doCensor(s9);
  13420. if (l21 == 4)
  13421. pushMessage(
  13422. s9,
  13423. 7,
  13424. "@cr4@"
  13425. + TextClass.fixName(TextClass
  13426. .nameForLong(l5)));
  13427. else if (l21 == 3)
  13428. pushMessage(
  13429. s9,
  13430. 7,
  13431. "@cr3@"
  13432. + TextClass.fixName(TextClass
  13433. .nameForLong(l5)));
  13434. else if (l21 == 2)
  13435. pushMessage(
  13436. s9,
  13437. 7,
  13438. "@cr2@"
  13439. + TextClass.fixName(TextClass
  13440. .nameForLong(l5)));
  13441. else if (l21 == 1)
  13442. pushMessage(
  13443. s9,
  13444. 7,
  13445. "@cr1@"
  13446. + TextClass.fixName(TextClass
  13447. .nameForLong(l5)));
  13448. else
  13449. pushMessage(s9, 3, TextClass.fixName(TextClass
  13450. .nameForLong(l5)));
  13451. } catch (Exception exception1) {
  13452. Signlink.reporterror("cde1");
  13453. }
  13454. pktType = -1;
  13455. return true;
  13456.  
  13457. case 85:
  13458. anInt1269 = inStream.method427();
  13459. anInt1268 = inStream.method427();
  13460. pktType = -1;
  13461. return true;
  13462.  
  13463. case 24:
  13464. anInt1054 = inStream.method428();
  13465. if (anInt1054 == tabID) {
  13466. if (anInt1054 == 3)
  13467. tabID = 1;
  13468. else
  13469. tabID = 3;
  13470. needDrawTabArea = true;
  13471. }
  13472. pktType = -1;
  13473. return true;
  13474.  
  13475. case 246:
  13476. int i6 = inStream.method434();
  13477. int i13 = inStream.readUnsignedWord();
  13478. int k18 = inStream.readUnsignedWord();
  13479. if (k18 == 65535) {
  13480. RSInterface.interfaceCache[i6].anInt233 = 0;
  13481. pktType = -1;
  13482. return true;
  13483. } else {
  13484. ItemDef itemDef = ItemDef.forID(k18);
  13485. RSInterface.interfaceCache[i6].anInt233 = 4;
  13486. RSInterface.interfaceCache[i6].mediaID = k18;
  13487. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationX;
  13488. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationY;
  13489. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100)
  13490. / i13;
  13491. pktType = -1;
  13492. return true;
  13493. }
  13494.  
  13495. case 171:
  13496. boolean flag1 = inStream.readUnsignedByte() == 1;
  13497. int j13 = inStream.readUnsignedWord();
  13498. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  13499. pktType = -1;
  13500. return true;
  13501.  
  13502. case 142:
  13503. int j6 = inStream.method434();
  13504. method60(j6);
  13505. if (backDialogID != -1) {
  13506. backDialogID = -1;
  13507. inputTaken = true;
  13508. }
  13509. if (inputDialogState != 0) {
  13510. inputDialogState = 0;
  13511. inputTaken = true;
  13512. }
  13513. invOverlayInterfaceID = j6;
  13514. tabAreaAltered = true;
  13515. needDrawTabArea = true;
  13516. openInterfaceID = -1;
  13517. aBoolean1149 = false;
  13518. pktType = -1;
  13519. return true;
  13520.  
  13521. case 126:
  13522. try {
  13523. String text = inStream.readString();
  13524. int frame = inStream.method435();
  13525. if (text.startsWith("www.")) {
  13526. launchURL(text);
  13527. }
  13528. updateStrings(text, frame);
  13529. sendFrame126(text, frame);
  13530. if (frame >= 18144 && frame <= 18244) {
  13531. clanList[frame - 18144] = text;
  13532. }
  13533. } catch (Exception e) {
  13534. }
  13535. pktType = -1;
  13536. return true;
  13537.  
  13538. case 206:
  13539. publicChatMode = inStream.readUnsignedByte();
  13540. privateChatMode = inStream.readUnsignedByte();
  13541. tradeMode = inStream.readUnsignedByte();
  13542. inputTaken = true;
  13543. pktType = -1;
  13544. return true;
  13545.  
  13546. case 240:
  13547. if (tabID == 12) {
  13548. needDrawTabArea = true;
  13549. }
  13550. weight = inStream.readSignedWord();
  13551. pktType = -1;
  13552. return true;
  13553.  
  13554. case 8:
  13555. int k6 = inStream.method436();
  13556. int l13 = inStream.readUnsignedWord();
  13557. RSInterface.interfaceCache[k6].anInt233 = 1;
  13558. RSInterface.interfaceCache[k6].mediaID = l13;
  13559. pktType = -1;
  13560. return true;
  13561.  
  13562. case 122:
  13563. int l6 = inStream.method436();
  13564. int i14 = inStream.method436();
  13565. int i19 = i14 >> 10 & 0x1f;
  13566. int i22 = i14 >> 5 & 0x1f;
  13567. int l24 = i14 & 0x1f;
  13568. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  13569. + (i22 << 11) + (l24 << 3);
  13570. pktType = -1;
  13571. return true;
  13572.  
  13573. case 53:
  13574. needDrawTabArea = true;
  13575. int i7 = inStream.readUnsignedWord();
  13576. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  13577. int j19 = inStream.readUnsignedWord();
  13578. for (int j22 = 0; j22 < j19; j22++) {
  13579. int i25 = inStream.readUnsignedByte();
  13580. if (i25 == 255)
  13581. i25 = inStream.method440();
  13582. class9_1.inv[j22] = inStream.method436();
  13583. class9_1.invStackSizes[j22] = i25;
  13584. }
  13585. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  13586. class9_1.inv[j25] = 0;
  13587. class9_1.invStackSizes[j25] = 0;
  13588. }
  13589. pktType = -1;
  13590. return true;
  13591.  
  13592. case 230:
  13593. int j7 = inStream.method435();
  13594. int j14 = inStream.readUnsignedWord();
  13595. int k19 = inStream.readUnsignedWord();
  13596. int k22 = inStream.method436();
  13597. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  13598. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  13599. RSInterface.interfaceCache[j14].modelZoom = j7;
  13600. pktType = -1;
  13601. return true;
  13602.  
  13603. case 221:
  13604. anInt900 = inStream.readUnsignedByte();
  13605. needDrawTabArea = true;
  13606. pktType = -1;
  13607. return true;
  13608.  
  13609. case 177:
  13610. aBoolean1160 = true;
  13611. anInt995 = inStream.readUnsignedByte();
  13612. anInt996 = inStream.readUnsignedByte();
  13613. anInt997 = inStream.readUnsignedWord();
  13614. anInt998 = inStream.readUnsignedByte();
  13615. anInt999 = inStream.readUnsignedByte();
  13616. if (anInt999 >= 100) {
  13617. int k7 = anInt995 * 128 + 64;
  13618. int k14 = anInt996 * 128 + 64;
  13619. int i20 = method42(plane, k14, k7) - anInt997;
  13620. int l22 = k7 - xCameraPos;
  13621. int k25 = i20 - zCameraPos;
  13622. int j28 = k14 - yCameraPos;
  13623. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  13624. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  13625. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  13626. if (yCameraCurve < 128)
  13627. yCameraCurve = 128;
  13628. if (yCameraCurve > 383)
  13629. yCameraCurve = 383;
  13630. }
  13631. pktType = -1;
  13632. return true;
  13633.  
  13634. case 249:
  13635. anInt1046 = inStream.method426();
  13636. unknownInt10 = inStream.method436();
  13637. pktType = -1;
  13638. return true;
  13639.  
  13640. case 65:
  13641. updateNPCs(inStream, pktSize);
  13642. pktType = -1;
  13643. return true;
  13644.  
  13645. case 27:
  13646. messagePromptRaised = false;
  13647. inputDialogState = 1;
  13648. amountOrNameInput = "";
  13649. inputTaken = true;
  13650. pktType = -1;
  13651. return true;
  13652.  
  13653. case 187:
  13654. messagePromptRaised = false;
  13655. inputDialogState = 2;
  13656. amountOrNameInput = "";
  13657. inputTaken = true;
  13658. pktType = -1;
  13659. return true;
  13660.  
  13661. case 97:
  13662. int l7 = inStream.readUnsignedWord();
  13663. method60(l7);
  13664. if (invOverlayInterfaceID != -1) {
  13665. needDrawTabArea = true;
  13666. invOverlayInterfaceID = -1;
  13667. tabAreaAltered = true;
  13668. }
  13669. if (backDialogID != -1) {
  13670. backDialogID = -1;
  13671. inputTaken = true;
  13672. }
  13673. if (inputDialogState != 0) {
  13674. inputDialogState = 0;
  13675. inputTaken = true;
  13676. }
  13677. openInterfaceID = l7;
  13678. aBoolean1149 = false;
  13679. pktType = -1;
  13680. return true;
  13681.  
  13682. case 218:
  13683. int i8 = inStream.method438();
  13684. dialogID = i8;
  13685. inputTaken = true;
  13686. pktType = -1;
  13687. return true;
  13688.  
  13689. case 87:
  13690. int j8 = inStream.method434();
  13691. int l14 = inStream.method439();
  13692. anIntArray1045[j8] = l14;
  13693. if (variousSettings[j8] != l14) {
  13694. variousSettings[j8] = l14;
  13695. method33(j8);
  13696. needDrawTabArea = true;
  13697. if (dialogID != -1)
  13698. inputTaken = true;
  13699. }
  13700. pktType = -1;
  13701. return true;
  13702.  
  13703. case 36:
  13704. int k8 = inStream.method434();
  13705. byte byte0 = inStream.readSignedByte();
  13706. anIntArray1045[k8] = byte0;
  13707. if (variousSettings[k8] != byte0) {
  13708. variousSettings[k8] = byte0;
  13709. method33(k8);
  13710. needDrawTabArea = true;
  13711. if (dialogID != -1)
  13712. inputTaken = true;
  13713. }
  13714. pktType = -1;
  13715. return true;
  13716.  
  13717. case 61:
  13718. anInt1055 = inStream.readUnsignedByte();
  13719. pktType = -1;
  13720. return true;
  13721.  
  13722. case 200:
  13723. int l8 = inStream.readUnsignedWord();
  13724. int i15 = inStream.readSignedWord();
  13725. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  13726. class9_4.anInt257 = i15;
  13727. if (i15 > 587 && i15 < 599) {
  13728. class9_4.modelZoom = 2000;
  13729. }
  13730. if (i15 == -1) {
  13731. class9_4.anInt246 = 0;
  13732. class9_4.anInt208 = 0;
  13733. }
  13734. pktType = -1;
  13735. return true;
  13736. case 219:
  13737. if (invOverlayInterfaceID != -1) {
  13738. invOverlayInterfaceID = -1;
  13739. needDrawTabArea = true;
  13740. tabAreaAltered = true;
  13741. }
  13742. if (backDialogID != -1) {
  13743. backDialogID = -1;
  13744. inputTaken = true;
  13745. }
  13746. if (inputDialogState != 0) {
  13747. inputDialogState = 0;
  13748. inputTaken = true;
  13749. }
  13750. openInterfaceID = -1;
  13751. aBoolean1149 = false;
  13752. pktType = -1;
  13753. return true;
  13754.  
  13755. case 34:
  13756. needDrawTabArea = true;
  13757. int i9 = inStream.readUnsignedWord();
  13758. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  13759. while (inStream.currentOffset < pktSize) {
  13760. int j20 = inStream.method422();
  13761. int i23 = inStream.readUnsignedWord();
  13762. int l25 = inStream.readUnsignedByte();
  13763. if (l25 == 255)
  13764. l25 = inStream.readDWord();
  13765. if (j20 >= 0 && j20 < class9_2.inv.length) {
  13766. class9_2.inv[j20] = i23;
  13767. class9_2.invStackSizes[j20] = l25;
  13768. }
  13769. }
  13770. pktType = -1;
  13771. return true;
  13772.  
  13773. case 4:
  13774. case 44:
  13775. case 84:
  13776. case 101:
  13777. case 105:
  13778. case 117:
  13779. case 147:
  13780. case 151:
  13781. case 156:
  13782. case 160:
  13783. case 215:
  13784. method137(inStream, pktType);
  13785. pktType = -1;
  13786. return true;
  13787.  
  13788. case 106:
  13789. tabID = inStream.method427();
  13790. needDrawTabArea = true;
  13791. tabAreaAltered = true;
  13792. pktType = -1;
  13793. return true;
  13794.  
  13795. case 164:
  13796. int j9 = inStream.method434();
  13797. method60(j9);
  13798. if (invOverlayInterfaceID != -1) {
  13799. needDrawTabArea = true;
  13800. invOverlayInterfaceID = -1;
  13801. tabAreaAltered = true;
  13802. }
  13803. backDialogID = j9;
  13804. inputTaken = true;
  13805. openInterfaceID = -1;
  13806. aBoolean1149 = false;
  13807. pktType = -1;
  13808. return true;
  13809.  
  13810. }
  13811. Signlink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  13812. + anInt842 + "," + anInt843);
  13813. } catch (IOException _ex) {
  13814. dropClient();
  13815. } catch (Exception exception) {
  13816. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  13817. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  13818. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  13819. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  13820. s2 = s2 + inStream.buffer[j15] + ",";
  13821. Signlink.reporterror(s2);
  13822. }
  13823. pktType = -1;
  13824. return true;
  13825. }
  13826.  
  13827. public static int log_view_dist = 9;
  13828.  
  13829. private void method146() {
  13830. anInt1265++;
  13831. method47(true);
  13832. method26(true);
  13833. method47(false);
  13834. method26(false);
  13835. method55();
  13836. method104();
  13837. if (!aBoolean1160) {
  13838. int i = anInt1184;
  13839. if (anInt984 / 256 > i)
  13840. i = anInt984 / 256;
  13841. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  13842. i = anIntArray1203[4] + 128;
  13843. int k = minimapInt1 + anInt896 & 0x7ff;
  13844. setCameraPos(cameraPos2 + i * (clientSize == 0 ? cameraPos1 : 5),
  13845. i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50,
  13846. k, anInt1015);
  13847. }
  13848. int j;
  13849. if (!aBoolean1160)
  13850. j = method120();
  13851. else
  13852. j = method121();
  13853. int l = xCameraPos;
  13854. int i1 = zCameraPos;
  13855. int j1 = yCameraPos;
  13856. int k1 = yCameraCurve;
  13857. int l1 = xCameraCurve;
  13858. for (int i2 = 0; i2 < 5; i2++)
  13859. if (aBooleanArray876[i2]) {
  13860. int j2 = (int) ((Math.random()
  13861. * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  13862. .sin((double) anIntArray1030[i2]
  13863. * ((double) anIntArray928[i2] / 100D))
  13864. * (double) anIntArray1203[i2]);
  13865. if (i2 == 0)
  13866. xCameraPos += j2;
  13867. if (i2 == 1)
  13868. zCameraPos += j2;
  13869. if (i2 == 2)
  13870. yCameraPos += j2;
  13871. if (i2 == 3)
  13872. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  13873. if (i2 == 4) {
  13874. yCameraCurve += j2;
  13875. if (yCameraCurve < 128)
  13876. yCameraCurve = 128;
  13877. if (yCameraCurve > 383)
  13878. yCameraCurve = 383;
  13879. }
  13880. }
  13881. int k2 = Texture.anInt1481;
  13882. Model.aBoolean1684 = true;
  13883. Model.anInt1687 = 0;
  13884. Model.anInt1685 = super.mouseX - 4;
  13885. Model.anInt1686 = super.mouseY - 4;
  13886. DrawingArea.setAllPixelsToZero();
  13887. if (fog) {
  13888. DrawingArea.method336(1000, 0, 0, 0xC8C0A8, 10000);
  13889. }
  13890. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  13891. zCameraPos, j, yCameraCurve);
  13892. worldController.clearObj5Cache();
  13893. updateEntities();
  13894. drawHeadIcon();
  13895. method37(k2);
  13896. if (loggedIn) {
  13897. drawUnfixedGame();
  13898. draw3dScreen();
  13899. }
  13900. if (loggedIn) {
  13901. aRSImageProducer_1165.drawGraphics(clientSize == 0 ? 4 : 0,
  13902. super.graphics, clientSize == 0 ? 4 : 0);
  13903. }
  13904. xCameraPos = l;
  13905. zCameraPos = i1;
  13906. yCameraPos = j1;
  13907. yCameraCurve = k1;
  13908. xCameraCurve = l1;
  13909. }
  13910.  
  13911. public void clearTopInterfaces() {
  13912. stream.createFrame(130);
  13913. if (invOverlayInterfaceID != -1) {
  13914. invOverlayInterfaceID = -1;
  13915. needDrawTabArea = true;
  13916. aBoolean1149 = false;
  13917. tabAreaAltered = true;
  13918. }
  13919. if (backDialogID != -1) {
  13920. backDialogID = -1;
  13921. inputTaken = true;
  13922. aBoolean1149 = false;
  13923. }
  13924. openInterfaceID = -1;
  13925. fullscreenInterfaceID = -1;
  13926. }
  13927.  
  13928. Sprite[] counter;
  13929.  
  13930. public Client() {
  13931. counter = new Sprite[3];
  13932. fullscreenInterfaceID = -1;
  13933. chatRights = new int[500];
  13934. chatTypeView = 0;
  13935. clanChatMode = 0;
  13936. cButtonHPos = -1;
  13937. cButtonCPos = 0;
  13938. server = "localhost";
  13939. anIntArrayArray825 = new int[104][104];
  13940. friendsNodeIDs = new int[200];
  13941. groundArray = new NodeList[4][104][104];
  13942. aBoolean831 = false;
  13943. aStream_834 = new Stream(new byte[5000]);
  13944. npcArray = new NPC[16384];
  13945. npcIndices = new int[16384];
  13946. anIntArray840 = new int[1000];
  13947. aStream_847 = Stream.create();
  13948. aBoolean848 = true;
  13949. openInterfaceID = -1;
  13950. currentExp = new int[Skills.skillsCount];
  13951. aBoolean872 = false;
  13952. anIntArray873 = new int[5];
  13953. aBooleanArray876 = new boolean[5];
  13954. drawFlames = false;
  13955. reportAbuseInput = "";
  13956. unknownInt10 = -1;
  13957. menuOpen = false;
  13958. inputString = "";
  13959. maxPlayers = 2048;
  13960. myPlayerIndex = 2047;
  13961. playerArray = new Player[maxPlayers];
  13962. playerIndices = new int[maxPlayers];
  13963. anIntArray894 = new int[maxPlayers];
  13964. aStreamArray895s = new Stream[maxPlayers];
  13965. anInt897 = 1;
  13966. anIntArrayArray901 = new int[104][104];
  13967. aByteArray912 = new byte[16384];
  13968. currentStats = new int[Skills.skillsCount];
  13969. ignoreListAsLongs = new long[100];
  13970. loadingError = false;
  13971. anIntArray928 = new int[5];
  13972. anIntArrayArray929 = new int[104][104];
  13973. chatTypes = new int[500];
  13974. chatNames = new String[500];
  13975. chatMessages = new String[500];
  13976. sideIcons = new Sprite[15];
  13977. aBoolean954 = true;
  13978. friendsListAsLongs = new long[200];
  13979. currentSong = -1;
  13980. drawingFlames = false;
  13981. spriteDrawX = -1;
  13982. spriteDrawY = -1;
  13983. anIntArray968 = new int[33];
  13984. anIntArray969 = new int[256];
  13985. decompressors = new Decompressor[5];
  13986. variousSettings = new int[2000];
  13987. aBoolean972 = false;
  13988. anInt975 = 50;
  13989. anIntArray976 = new int[anInt975];
  13990. anIntArray977 = new int[anInt975];
  13991. anIntArray978 = new int[anInt975];
  13992. anIntArray979 = new int[anInt975];
  13993. anIntArray980 = new int[anInt975];
  13994. anIntArray981 = new int[anInt975];
  13995. anIntArray982 = new int[anInt975];
  13996. aStringArray983 = new String[anInt975];
  13997. anInt985 = -1;
  13998. hitMarks = new Sprite[20];
  13999. anIntArray990 = new int[5];
  14000. aBoolean994 = false;
  14001. amountOrNameInput = "";
  14002. aClass19_1013 = new NodeList();
  14003. aBoolean1017 = false;
  14004. anInt1018 = -1;
  14005. anIntArray1030 = new int[5];
  14006. aBoolean1031 = false;
  14007. mapFunctions = new Sprite[100];
  14008. dialogID = -1;
  14009. maxStats = new int[Skills.skillsCount];
  14010. anIntArray1045 = new int[2000];
  14011. aBoolean1047 = true;
  14012. anIntArray1052 = new int[152];
  14013. anIntArray1229 = new int[152];
  14014. anInt1054 = -1;
  14015. aClass19_1056 = new NodeList();
  14016. anIntArray1057 = new int[33];
  14017. aClass9_1059 = new RSInterface();
  14018. mapScenes = new Background[100];
  14019. barFillColor = 0x4d4233;
  14020. anIntArray1065 = new int[7];
  14021. anIntArray1072 = new int[1000];
  14022. anIntArray1073 = new int[1000];
  14023. aBoolean1080 = false;
  14024. friendsList = new String[200];
  14025. inStream = Stream.create();
  14026. expectedCRCs = new int[9];
  14027. menuActionCmd2 = new int[500];
  14028. menuActionCmd3 = new int[500];
  14029. menuActionID = new int[500];
  14030. menuActionCmd1 = new int[500];
  14031. headIcons = new Sprite[20];
  14032. skullIcons = new Sprite[20];
  14033. headIconsHint = new Sprite[20];
  14034. tabAreaAltered = false;
  14035. aString1121 = "";
  14036. atPlayerActions = new String[5];
  14037. atPlayerArray = new boolean[5];
  14038. anIntArrayArrayArray1129 = new int[4][13][13];
  14039. anInt1132 = 2;
  14040. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  14041. aBoolean1141 = false;
  14042. aBoolean1149 = false;
  14043. crosses = new Sprite[8];
  14044. musicEnabled = true;
  14045. needDrawTabArea = false;
  14046. loggedIn = false;
  14047. canMute = false;
  14048. aBoolean1159 = false;
  14049. aBoolean1160 = false;
  14050. anInt1171 = 1;
  14051. myUsername = "";
  14052. myPassword = "";
  14053. genericLoadingError = false;
  14054. reportAbuseInterfaceID = -1;
  14055. aClass19_1179 = new NodeList();
  14056. anInt1184 = 128;
  14057. invOverlayInterfaceID = -1;
  14058. stream = Stream.create();
  14059. menuActionName = new String[500];
  14060. anIntArray1203 = new int[5];
  14061. anIntArray1207 = new int[50];
  14062. anInt1210 = 2;
  14063. chatScrollMax = 78;
  14064. promptInput = "";
  14065. modIcons = new Background[3];
  14066. tabID = 3;
  14067. inputTaken = false;
  14068. songChanging = true;
  14069. aClass11Array1230 = new Class11[4];
  14070. anIntArray1240 = new int[100];
  14071. anIntArray1241 = new int[50];
  14072. aBoolean1242 = false;
  14073. anIntArray1250 = new int[50];
  14074. rsAlreadyLoaded = false;
  14075. welcomeScreenRaised = false;
  14076. messagePromptRaised = false;
  14077. loginMessage1 = "";
  14078. loginMessage2 = "";
  14079. backDialogID = -1;
  14080. anInt1279 = 2;
  14081. bigX = new int[4000];
  14082. bigY = new int[4000];
  14083. }
  14084.  
  14085. public static int getMaxWidth() {
  14086. return (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  14087. }
  14088.  
  14089. public static int getMaxHeight() {
  14090. return (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  14091. }
  14092.  
  14093. public boolean isWebclient() {
  14094. return gameFrame == null && isApplet == true;
  14095. }
  14096.  
  14097. public boolean autocast;
  14098. public int rights;
  14099. public String name;
  14100. public String message;
  14101. public String clanname;
  14102. private final int[] chatRights;
  14103. public int chatTypeView;
  14104. public int clanChatMode;
  14105. public int duelMode;
  14106. public int autoCastId = 0;
  14107. public static Sprite[] cacheSprite;
  14108. public static Sprite[] cacheSprite2;
  14109. /**/
  14110. private RSImageProducer leftFrame;
  14111. private RSImageProducer topFrame;
  14112. private int ignoreCount;
  14113. private long aLong824;
  14114. private int[][] anIntArrayArray825;
  14115. private int[] friendsNodeIDs;
  14116. private NodeList[][][] groundArray;
  14117. private int[] anIntArray828;
  14118. private int[] anIntArray829;
  14119. private volatile boolean aBoolean831;
  14120. private Socket aSocket832;
  14121. private int loginScreenState;
  14122. private Stream aStream_834;
  14123. private NPC[] npcArray;
  14124. private int npcCount;
  14125. private int[] npcIndices;
  14126. private int anInt839;
  14127. private int[] anIntArray840;
  14128. private int anInt841;
  14129. private int anInt842;
  14130. private int anInt843;
  14131. private String aString844;
  14132. private int privateChatMode;
  14133. private Stream aStream_847;
  14134. private boolean aBoolean848;
  14135. private static int anInt849;
  14136. private int[] anIntArray850;
  14137. private int[] anIntArray851;
  14138. private int[] anIntArray852;
  14139. private int[] anIntArray853;
  14140. private static int anInt854;
  14141. private int anInt855;
  14142. static int openInterfaceID;
  14143. private int xCameraPos;
  14144. private int zCameraPos;
  14145. private int yCameraPos;
  14146. private int yCameraCurve;
  14147. private int xCameraCurve;
  14148. private int myPrivilege;
  14149. private final int[] currentExp;
  14150. private Sprite mapFlag;
  14151. private Sprite mapMarker;
  14152. private boolean aBoolean872;
  14153. private final int[] anIntArray873;
  14154. private final boolean[] aBooleanArray876;
  14155. private int weight;
  14156. private MouseDetection mouseDetection;
  14157. private volatile boolean drawFlames;
  14158. private String reportAbuseInput;
  14159. private int unknownInt10;
  14160. private boolean menuOpen;
  14161. private int anInt886;
  14162. private String inputString;
  14163. private final int maxPlayers;
  14164. private final int myPlayerIndex;
  14165. private Player[] playerArray;
  14166. private int playerCount;
  14167. private int[] playerIndices;
  14168. private int anInt893;
  14169. private int[] anIntArray894;
  14170. private Stream[] aStreamArray895s;
  14171. private int anInt896;
  14172. private int anInt897;
  14173. private int friendsCount;
  14174. private int anInt900;
  14175. private int[][] anIntArrayArray901;
  14176. private byte[] aByteArray912;
  14177. private int anInt913;
  14178. private int crossX;
  14179. private int crossY;
  14180. private int crossIndex;
  14181. private int crossType;
  14182. private int plane;
  14183. private final int[] currentStats;
  14184. private static int anInt924;
  14185. private final long[] ignoreListAsLongs;
  14186. private boolean loadingError;
  14187. private final int[] anIntArray928;
  14188. private int[][] anIntArrayArray929;
  14189. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  14190. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  14191. private int anInt933;
  14192. private int anInt934;
  14193. private int anInt935;
  14194. private int anInt936;
  14195. private int anInt937;
  14196. private int anInt938;
  14197. private final int[] chatTypes;
  14198. private final String[] chatNames;
  14199. private final String[] chatMessages;
  14200. private int anInt945;
  14201. private WorldController worldController;
  14202. private Sprite[] sideIcons;
  14203. private int menuScreenArea;
  14204. private int menuOffsetX;
  14205. private int menuOffsetY;
  14206. private int menuWidth;
  14207. private int menuHeight;
  14208. private long aLong953;
  14209. private boolean aBoolean954;
  14210. private long[] friendsListAsLongs;
  14211. private String[] clanList = new String[100];
  14212. private int currentSong;
  14213. private static int nodeID = 10;
  14214. static int portOff;
  14215. static boolean clientData;
  14216. private static boolean isMembers = true;
  14217. private static boolean lowMem;
  14218. private volatile boolean drawingFlames;
  14219. private int spriteDrawX;
  14220. private int spriteDrawY;
  14221. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  14222. 0xff00ff, 0xffffff };
  14223. private Background aBackground_966;
  14224. private Background aBackground_967;
  14225. private final int[] anIntArray968;
  14226. private final int[] anIntArray969;
  14227. final Decompressor[] decompressors;
  14228. public int variousSettings[];
  14229. private boolean aBoolean972;
  14230. private final int anInt975;
  14231. private final int[] anIntArray976;
  14232. private final int[] anIntArray977;
  14233. private final int[] anIntArray978;
  14234. private final int[] anIntArray979;
  14235. private final int[] anIntArray980;
  14236. private final int[] anIntArray981;
  14237. private final int[] anIntArray982;
  14238. private final String[] aStringArray983;
  14239. private int anInt984;
  14240. private int anInt985;
  14241. private static int anInt986;
  14242. private Sprite[] hitMarks;
  14243. private int anInt988;
  14244. private int anInt989;
  14245. private final int[] anIntArray990;
  14246. private final boolean aBoolean994;
  14247. private int anInt995;
  14248. private int anInt996;
  14249. private int anInt997;
  14250. private int anInt998;
  14251. private int anInt999;
  14252. private ISAACRandomGen encryption;
  14253. private Sprite mapEdge;
  14254. private Sprite multiOverlay;
  14255. static final int[][] anIntArrayArray1003 = {
  14256. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  14257. 54193 },
  14258. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  14259. 56621, 4783, 1341, 16578, 35003, 25239 },
  14260. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  14261. 10153, 56621, 4783, 1341, 16578, 35003 },
  14262. { 4626, 11146, 6439, 12, 4758, 10270 },
  14263. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  14264. private String amountOrNameInput;
  14265. private static int anInt1005;
  14266. private int daysSinceLastLogin;
  14267. private int pktSize;
  14268. private int pktType;
  14269. private int anInt1009;
  14270. private int anInt1010;
  14271. private int anInt1011;
  14272. private NodeList aClass19_1013;
  14273. private int anInt1014;
  14274. private int anInt1015;
  14275. private int anInt1016;
  14276. private boolean aBoolean1017;
  14277. private int anInt1018;
  14278. private boolean walkableInterfaceMode;
  14279. private static final int[] anIntArray1019;
  14280. private int anInt1021;
  14281. private int anInt1022;
  14282. private int loadingStage;
  14283. private Sprite scrollBar1;
  14284. private Sprite scrollBar2;
  14285. private int anInt1026;
  14286. private final int[] anIntArray1030;
  14287. private boolean aBoolean1031;
  14288. private Sprite[] mapFunctions;
  14289. private int baseX;
  14290. private int baseY;
  14291. private int anInt1036;
  14292. private int anInt1037;
  14293. private int loginFailures;
  14294. private int anInt1039;
  14295. private int anInt1040;
  14296. private int anInt1041;
  14297. private int dialogID;
  14298. private final int[] maxStats;
  14299. private final int[] anIntArray1045;
  14300. private int anInt1046;
  14301. private boolean aBoolean1047;
  14302. private int anInt1048;
  14303. private String aString1049;
  14304. private static int anInt1051;
  14305. private final int[] anIntArray1052;
  14306. private StreamLoader titleStreamLoader;
  14307. private int anInt1054;
  14308. private int anInt1055;
  14309. private NodeList aClass19_1056;
  14310. private final int[] anIntArray1057;
  14311. public final RSInterface aClass9_1059;
  14312. private Background[] mapScenes;
  14313. private int anInt1062;
  14314. private final int barFillColor;
  14315. private int friendsListAction;
  14316. private final int[] anIntArray1065;
  14317. private int mouseInvInterfaceIndex;
  14318. private int lastActiveInvInterface;
  14319. public OnDemandFetcher onDemandFetcher;
  14320. private int anInt1069;
  14321. private int anInt1070;
  14322. private int anInt1071;
  14323. private int[] anIntArray1072;
  14324. private int[] anIntArray1073;
  14325. private Sprite mapDotItem;
  14326. private Sprite mapDotNPC;
  14327. private Sprite mapDotPlayer;
  14328. private Sprite mapDotFriend;
  14329. private Sprite mapDotTeam;
  14330. private Sprite mapDotClan;
  14331. private int anInt1079;
  14332. private boolean aBoolean1080;
  14333. private String[] friendsList;
  14334. private Stream inStream;
  14335. private int anInt1084;
  14336. private int anInt1085;
  14337. private int activeInterfaceType;
  14338. private int anInt1087;
  14339. private int anInt1088;
  14340. public static int chatScrollPos;
  14341. public static int spellID = 0;
  14342. public int cameraPos1 = 3;
  14343. public static int cameraPos2 = 600;
  14344. public static int clientWidth = 765, clientHeight = 503;
  14345. public static int clientSize = 0;
  14346. public int appletWidth = 765;
  14347. public int appletHeight = 503;
  14348. private static final int resizableWidth = 900;
  14349. private static final int resizableHeight = 600;
  14350. private int gameAreaWidth = 512;
  14351. private int gameAreaHeight = 334;
  14352. public boolean showTab = true;
  14353. public static boolean showChat = true;
  14354. private int smallTabs = 1000;
  14355. public static int totalRead = 0;
  14356. private final int[] expectedCRCs;
  14357. private int[] menuActionCmd2;
  14358. private int[] menuActionCmd3;
  14359. private int[] menuActionID;
  14360. private int[] menuActionCmd1;
  14361. private Sprite multiWay;
  14362. private Sprite[] headIcons;
  14363. private Sprite[] skullIcons;
  14364. private Sprite[] headIconsHint;
  14365. private static int anInt1097;
  14366. private int anInt1098;
  14367. private int anInt1099;
  14368. private int anInt1100;
  14369. private int anInt1101;
  14370. private int anInt1102;
  14371. private static boolean tabAreaAltered;
  14372. private int anInt1104;
  14373. private RSImageProducer aRSImageProducer_1107;
  14374. private RSImageProducer aRSImageProducer_1108;
  14375. private RSImageProducer aRSImageProducer_1109;
  14376. private RSImageProducer aRSImageProducer_1110;
  14377. private RSImageProducer aRSImageProducer_1111;
  14378. private RSImageProducer aRSImageProducer_1112;
  14379. private RSImageProducer aRSImageProducer_1113;
  14380. private RSImageProducer aRSImageProducer_1114;
  14381. private RSImageProducer aRSImageProducer_1115;
  14382. private static int anInt1117;
  14383. private int membersInt;
  14384. private String aString1121;
  14385. private Sprite compass;
  14386. private RSImageProducer aRSImageProducer_1123;
  14387. private RSImageProducer aRSImageProducer_1124;
  14388. private RSImageProducer aRSImageProducer_1125;
  14389. public static Player myPlayer;
  14390. private final String[] atPlayerActions;
  14391. private final boolean[] atPlayerArray;
  14392. private final int[][][] anIntArrayArrayArray1129;
  14393. public static final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1,
  14394. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
  14395. private int anInt1131;
  14396. private int anInt1132;
  14397. private int menuActionRow;
  14398. private static int anInt1134;
  14399. private int spellSelected;
  14400. private int anInt1137;
  14401. private int spellUsableOn;
  14402. private String spellTooltip;
  14403. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  14404. private boolean aBoolean1141;
  14405. private static int anInt1142;
  14406. private int energy;
  14407. private boolean aBoolean1149;
  14408. private Sprite[] crosses;
  14409. private boolean musicEnabled;
  14410. private Background[] aBackgroundArray1152s;
  14411. static boolean needDrawTabArea;
  14412. private int unreadMessages;
  14413. private static int anInt1155;
  14414. protected static boolean fpsOn;
  14415. public boolean loggedIn;
  14416. private boolean canMute;
  14417. private boolean aBoolean1159;
  14418. private boolean aBoolean1160;
  14419. static int loopCycle;
  14420. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  14421. private RSImageProducer aRSImageProducer_1163;
  14422. private RSImageProducer mapEdgeIP;
  14423. private RSImageProducer aRSImageProducer_1164;
  14424. private RSImageProducer aRSImageProducer_1165;
  14425. private RSImageProducer aRSImageProducer_1166;
  14426. private int daysSinceRecovChange;
  14427. private RSSocket socketStream;
  14428. private int anInt1169;
  14429. private int minimapInt3;
  14430. private int anInt1171;
  14431. private String myUsername;
  14432. private String myPassword;
  14433. private static int anInt1175;
  14434. private boolean genericLoadingError;
  14435. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  14436. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  14437. private int reportAbuseInterfaceID;
  14438. private NodeList aClass19_1179;
  14439. private int[] anIntArray1180;
  14440. private int[] anIntArray1181;
  14441. private int[] anIntArray1182;
  14442. private byte[][] aByteArrayArray1183;
  14443. private int anInt1184;
  14444. private int minimapInt1;
  14445. private int anInt1186;
  14446. private int anInt1187;
  14447. private static int anInt1188;
  14448. private int invOverlayInterfaceID;
  14449. private int[] anIntArray1190;
  14450. private int[] anIntArray1191;
  14451. private Stream stream;
  14452. private int anInt1193;
  14453. private int splitPrivateChat;
  14454. private Background mapBack;
  14455. private String[] menuActionName;
  14456. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  14457. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  14458. private final int[] anIntArray1203;
  14459. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  14460. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  14461. private static boolean flagged;
  14462. private final int[] anIntArray1207;
  14463. private int minimapInt2;
  14464. private int anInt1210;
  14465. static int chatScrollMax;
  14466. private String promptInput;
  14467. private int anInt1213;
  14468. private int[][][] intGroundArray;
  14469. private long aLong1215;
  14470. private int loginScreenCursorPos;
  14471. private final Background[] modIcons;
  14472. private long aLong1220;
  14473. static int tabID;
  14474. private int anInt1222;
  14475. public static boolean inputTaken;
  14476. private int inputDialogState;
  14477. private static int anInt1226;
  14478. private int nextSong;
  14479. private boolean songChanging;
  14480. private final int[] anIntArray1229;
  14481. private Class11[] aClass11Array1230;
  14482. public static int anIntArray1232[];
  14483. private int[] anIntArray1234;
  14484. private int[] anIntArray1235;
  14485. private int[] anIntArray1236;
  14486. private int anInt1237;
  14487. private int anInt1238;
  14488. public final int anInt1239 = 100;
  14489. private final int[] anIntArray1240;
  14490. private final int[] anIntArray1241;
  14491. private boolean aBoolean1242;
  14492. private int atInventoryLoopCycle;
  14493. private int atInventoryInterface;
  14494. private int atInventoryIndex;
  14495. private int atInventoryInterfaceType;
  14496. private byte[][] aByteArrayArray1247;
  14497. private int tradeMode;
  14498. private int anInt1249;
  14499. private final int[] anIntArray1250;
  14500. private int anInt1251;
  14501. private final boolean rsAlreadyLoaded;
  14502. private int anInt1253;
  14503. private int anInt1254;
  14504. private boolean welcomeScreenRaised;
  14505. private boolean messagePromptRaised;
  14506. private byte[][][] byteGroundArray;
  14507. private int prevSong;
  14508. private int destX;
  14509. private int destY;
  14510. private Sprite minimapImage;
  14511. private int anInt1264;
  14512. private int anInt1265;
  14513. private String loginMessage1;
  14514. private String loginMessage2;
  14515. private int anInt1268;
  14516. private int anInt1269;
  14517. private TextDrawingArea smallText;
  14518. private TextDrawingArea aTextDrawingArea_1271;
  14519. private TextDrawingArea chatTextDrawingArea;
  14520. private int anInt1275;
  14521. private int backDialogID;
  14522. private int anInt1278;
  14523. private int anInt1279;
  14524. private int[] bigX;
  14525. private int[] bigY;
  14526. private int itemSelected;
  14527. private int anInt1283;
  14528. private int anInt1284;
  14529. private int anInt1285;
  14530. private String selectedItemName;
  14531. private int publicChatMode;
  14532. private static int anInt1288;
  14533. public static int anInt1290;
  14534. public static String server = "localhost";
  14535. public int drawCount;
  14536. public int fullscreenInterfaceID;
  14537. public int anInt1044;// 377
  14538. public int anInt1129;// 377
  14539. public int anInt1315;// 377
  14540. public int anInt1500;// 377
  14541. public int anInt1501;// 377
  14542. public int[] fullScreenTextureArray;
  14543.  
  14544. public void resetAllImageProducers() {
  14545. if (super.fullGameScreen != null) {
  14546. return;
  14547. }
  14548. aRSImageProducer_1166 = null;
  14549. aRSImageProducer_1164 = null;
  14550. aRSImageProducer_1163 = null;
  14551. aRSImageProducer_1165 = null;
  14552. aRSImageProducer_1123 = null;
  14553. aRSImageProducer_1124 = null;
  14554. aRSImageProducer_1125 = null;
  14555. aRSImageProducer_1107 = null;
  14556. aRSImageProducer_1108 = null;
  14557. aRSImageProducer_1109 = null;
  14558. aRSImageProducer_1110 = null;
  14559. aRSImageProducer_1111 = null;
  14560. aRSImageProducer_1112 = null;
  14561. aRSImageProducer_1113 = null;
  14562. aRSImageProducer_1114 = null;
  14563. aRSImageProducer_1115 = null;
  14564. super.fullGameScreen = new RSImageProducer(clientWidth, clientHeight,
  14565. getGameComponent());
  14566. welcomeScreenRaised = true;
  14567. }
  14568.  
  14569. public static void launchURL(String url) {
  14570. String osName = System.getProperty("os.name");
  14571. try {
  14572. if (osName.startsWith("Mac OS")) {
  14573. Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");
  14574. Method openURL = fileMgr.getDeclaredMethod("openURL",
  14575. new Class[] { String.class });
  14576. openURL.invoke(null, new Object[] { url });
  14577. } else if (osName.startsWith("Windows")) {
  14578. Runtime.getRuntime().exec(
  14579. "rundll32 url.dll,FileProtocolHandler " + url);
  14580. } else { // assume Unix or Linux
  14581. String[] browsers = { "firefox", "opera", "konqueror",
  14582. "epiphany", "mozilla", "netscape", "safari" };
  14583. String browser = null;
  14584. for (int count = 0; count < browsers.length && browser == null; count++) {
  14585. if (Runtime.getRuntime()
  14586. .exec(new String[] { "which", browsers[count] })
  14587. .waitFor() == 0) {
  14588. browser = browsers[count];
  14589. }
  14590. }
  14591. if (browser == null) {
  14592. throw new Exception("Could not find web browser");
  14593. } else {
  14594. Runtime.getRuntime().exec(new String[] { browser, url });
  14595. }
  14596. }
  14597. } catch (Exception e) {
  14598. System.out.println("Failed to open URL.");
  14599. }
  14600. }
  14601.  
  14602. static {
  14603. anIntArray1019 = new int[99];
  14604. int i = 0;
  14605. for (int j = 0; j < 99; j++) {
  14606. int l = j + 1;
  14607. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  14608. i += i1;
  14609. anIntArray1019[j] = i / 4;
  14610. }
  14611. anIntArray1232 = new int[32];
  14612. i = 2;
  14613. for (int k = 0; k < 32; k++) {
  14614. anIntArray1232[k] = i - 1;
  14615. i += i;
  14616. }
  14617. }
  14618. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement