Advertisement
Guest User

Untitled

a guest
Apr 11th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 388.67 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.net.*;
  9. import java.lang.reflect.Method;
  10.  
  11. import sign.signlink;
  12.  
  13. import javax.swing.*;
  14.  
  15. import Notification.Notify;
  16.  
  17. public class client extends RSApplet {
  18.  
  19. /**
  20. *
  21. */
  22. private static final long serialVersionUID = 1L;
  23. /**
  24. *
  25. */
  26.  
  27. public Sprite[] chatImages = new Sprite[2];
  28. public static int spellID = 0;
  29. public int MapX, MapY;
  30.  
  31. private static String intToKOrMilLongName(int i) {
  32. String s = String.valueOf(i);
  33. for (int k = s.length() - 3; k > 0; k -= 3)
  34. s = s.substring(0, k) + "," + s.substring(k);
  35. if (s.length() > 8)
  36. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  37. + s + ")";
  38. else if (s.length() > 4)
  39. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  40. return " " + s;
  41. }
  42.  
  43. private static String intToKOrMil(int j) {
  44. if (j < 0x186a0)
  45. return String.valueOf(j);
  46. if (j < 0x989680)
  47. return j / 1000 + "K";
  48. else
  49. return j / 0xf4240 + "M";
  50. }
  51.  
  52. public void stopMidi() {
  53. signlink.midifade = 0;
  54. signlink.midi = "stop";
  55. }
  56.  
  57. private boolean menuHasAddFriend(int j) {
  58. if (j < 0)
  59. return false;
  60. int k = menuActionID[j];
  61. if (k >= 2000)
  62. k -= 2000;
  63. return k == 337;
  64. }
  65.  
  66. public void drawChannelButtons() {
  67. String text[] = { "On", "Friends", "Off", "Hide" };
  68. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  69. switch (cButtonCPos) {
  70. case 0:
  71. chatButtons[1].drawSprite(5, 142);
  72. break;
  73. case 1:
  74. chatButtons[1].drawSprite(71, 142);
  75. break;
  76. case 2:
  77. chatButtons[1].drawSprite(137, 142);
  78. break;
  79. case 3:
  80. chatButtons[1].drawSprite(203, 142);
  81. break;
  82. case 4:
  83. chatButtons[1].drawSprite(269, 142);
  84. break;
  85. case 5:
  86. chatButtons[1].drawSprite(335, 142);
  87. break;
  88. }
  89. if (cButtonHPos == cButtonCPos) {
  90. switch (cButtonHPos) {
  91. case 0:
  92. chatButtons[2].drawSprite(5, 142);
  93. break;
  94. case 1:
  95. chatButtons[2].drawSprite(71, 142);
  96. break;
  97. case 2:
  98. chatButtons[2].drawSprite(137, 142);
  99. break;
  100. case 3:
  101. chatButtons[2].drawSprite(203, 142);
  102. break;
  103. case 4:
  104. chatButtons[2].drawSprite(269, 142);
  105. break;
  106. case 5:
  107. chatButtons[2].drawSprite(335, 142);
  108. break;
  109. case 6:
  110. chatButtons[3].drawSprite(404, 142);
  111. break;
  112. }
  113. } else {
  114. switch (cButtonHPos) {
  115. case 0:
  116. chatButtons[0].drawSprite(5, 142);
  117. break;
  118. case 1:
  119. chatButtons[0].drawSprite(71, 142);
  120. break;
  121. case 2:
  122. chatButtons[0].drawSprite(137, 142);
  123. break;
  124. case 3:
  125. chatButtons[0].drawSprite(203, 142);
  126. break;
  127. case 4:
  128. chatButtons[0].drawSprite(269, 142);
  129. break;
  130. case 5:
  131. chatButtons[0].drawSprite(335, 142);
  132. break;
  133. case 6:
  134. chatButtons[3].drawSprite(404, 142);
  135. break;
  136. }
  137. }
  138. smallText.method389(true, 425, 0xffffff, " Screenshot", 157);
  139. smallText.method389(true, 26, 0xffffff, "All", 157);
  140. smallText.method389(true, 86, 0xffffff, "Game", 157);
  141. smallText.method389(true, 150, 0xffffff, "Public", 152);
  142. smallText.method389(true, 212, 0xffffff, "Private", 152);
  143. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  144. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  145. smallText.method382(textColor[publicChatMode], 164,text[publicChatMode], 163, true);
  146. smallText.method382(textColor[privateChatMode], 230,text[privateChatMode], 163, true);
  147. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode],163, true);
  148. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163,true);
  149. }
  150.  
  151. private void drawChatArea() {
  152. aRSImageProducer_1166.initDrawingArea();
  153. Texture.anIntArray1472 = anIntArray1180;
  154. chatArea.drawSprite(0, 0);
  155. drawChannelButtons();
  156. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  157. if (messagePromptRaised) {
  158. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  159. newBoldFont.drawCenteredString(promptInput + "*", 259, 80, 128, -1);
  160. } else if (inputDialogState == 1) {
  161. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  162. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  163. 128, -1);
  164. } else if (inputDialogState == 2) {
  165. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  166. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  167. 128, -1);
  168. } else if (aString844 != null) {
  169. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  170. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128,
  171. -1);
  172. } else if (backDialogID != -1) {
  173. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  174. } else if (dialogID != -1) {
  175. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  176. } else {
  177. int j77 = -3;
  178. int j = 0;
  179. DrawingArea.setDrawingArea(122, 8, 497, 7);
  180. for (int k = 0; k < 500; k++)
  181. if (chatMessages[k] != null) {
  182. int chatType = chatTypes[k];
  183. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  184. String s1 = chatNames[k];
  185. byte byte0 = 0;
  186. if (s1 != null && s1.startsWith("@cr1@")) {
  187. s1 = s1.substring(5);
  188. byte0 = 1;
  189. } else if (s1 != null && s1.startsWith("@cr2@")) {
  190. s1 = s1.substring(5);
  191. byte0 = 2;
  192. } else if (s1 != null && s1.startsWith("@cr3@")) {
  193. s1 = s1.substring(5);
  194. byte0 = 3;
  195. } else if (s1 != null && s1.startsWith("@cr4@")) {
  196. s1 = s1.substring(5);
  197. byte0 = 4;
  198. } else if (s1 != null && s1.startsWith("@cr5@")) {
  199. s1 = s1.substring(5);
  200. byte0 = 5;
  201. } else if (s1 != null && s1.startsWith("@cr6@")) {
  202. s1 = s1.substring(5);
  203. byte0 = 6;
  204. }
  205. if (chatType == 0) {
  206. if (chatTypeView == 5 || chatTypeView == 0) {
  207. if (yPos > 0 && yPos < 210)
  208. // textDrawingArea.method389(false, 11, 0,
  209. // chatMessages[k], yPos);//chat color enabled
  210. newRegularFont.drawBasicString(chatMessages[k],
  211. 11, yPos, 0, -1);
  212. j++;
  213. j77++;
  214. }
  215. }
  216. if ((chatType == 1 || chatType == 2)
  217. && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1
  218. && isFriendOrSelf(s1))) {
  219. if (chatTypeView == 1 || chatTypeView == 0) {
  220. if (yPos > 0 && yPos < 210) {
  221. int xPos = 11;
  222. if (byte0 == 1) {
  223. modIcons[0].drawSprite(xPos + 1, yPos - 11);
  224. xPos += 14;
  225. } else if (byte0 == 2) {
  226. modIcons[1].drawSprite(xPos, yPos - 13);
  227. xPos += 14;
  228. } else if (byte0 == 3) {
  229. modIcons[2].drawSprite(xPos + 1, yPos - 11);
  230. xPos += 14;
  231. } else if (byte0 == 4) {
  232. modIcons[3].drawSprite(xPos + 1, yPos - 10);
  233. xPos += 14;
  234. } else if (byte0 == 5) {
  235. modIcons[4].drawSprite(xPos + 1, yPos - 10);
  236. xPos += 14;
  237. } else if (byte0 == 6) {
  238. modIcons[5].drawSprite(xPos + 1, yPos - 10);
  239. xPos += 14;
  240. }
  241. // textDrawingArea.method385(0, s1 + ":", yPos,
  242. // xPos);
  243. // xPos += textDrawingArea.getTextWidth(s1) + 8;
  244. // textDrawingArea.method389(false, xPos, 255,
  245. // chatMessages[k], yPos);
  246.  
  247. newRegularFont.drawBasicString(s1 + ":", xPos,
  248. yPos, 0, -1);
  249. xPos += newRegularFont.getTextWidth(s1) + 8;
  250. newRegularFont.drawBasicString(chatMessages[k],
  251. xPos, yPos, 255, -1);
  252. }
  253. j++;
  254. j77++;
  255. }
  256. }
  257. if ((chatType == 3 || chatType == 7)
  258. && (splitPrivateChat == 0 || chatTypeView == 2)
  259. && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1
  260. && isFriendOrSelf(s1))) {
  261. if (chatTypeView == 2 || chatTypeView == 0) {
  262. if (yPos > 0 && yPos < 210) {
  263. int k1 = 11;
  264. // textDrawingArea.method385(0, "From", yPos,
  265. // k1);
  266. // k1 += textDrawingArea.getTextWidth("From ");
  267.  
  268. newRegularFont.drawBasicString("From", k1,
  269. yPos, 0, -1);
  270. if (byte0 == 3 || byte0 == 2 || byte0 == 1
  271. || byte0 == 0) {
  272. k1 += textDrawingArea.getTextWidth("From ");
  273. } else if (byte0 == 6 || byte0 == 5
  274. || byte0 == 4) {
  275. k1 += textDrawingArea.getTextWidth("From");
  276. }
  277. if (byte0 == 1) {
  278. modIcons[0].drawSprite(k1 - 1, yPos - 11);
  279. k1 += 12;
  280. } else if (byte0 == 2) {
  281. modIcons[1].drawSprite(k1 - 2, yPos - 13);
  282. k1 += 12;
  283. } else if (byte0 == 3) {
  284. modIcons[2].drawSprite(k1 - 1, yPos - 11);
  285. k1 += 12;
  286. } else if (byte0 == 4) {
  287. modIcons[3].drawSprite(k1, yPos - 10);
  288. k1 += 12;
  289. } else if (byte0 == 5) {
  290. modIcons[4].drawSprite(k1, yPos - 10);
  291. k1 += 12;
  292. } else if (byte0 == 6) {
  293. modIcons[5].drawSprite(k1, yPos - 10);
  294. k1 += 12;
  295. }
  296. // textDrawingArea.method385(0, s1 + ":", yPos,
  297. // k1);
  298. // k1 += textDrawingArea.getTextWidth(s1) + 8;
  299. // textDrawingArea.method385(0x800000,
  300. // chatMessages[k], yPos, k1);
  301.  
  302. newRegularFont.drawBasicString(s1 + ":", k1,
  303. yPos, 0, -1);
  304. k1 += newRegularFont.getTextWidth(s1) + 8;
  305. newRegularFont.drawBasicString(chatMessages[k],
  306. k1, yPos, 0x800000, -1);
  307. }
  308. j++;
  309. j77++;
  310. }
  311. }
  312. if (chatType == 4
  313. && (tradeMode == 0 || tradeMode == 1
  314. && isFriendOrSelf(s1))) {
  315. if (chatTypeView == 3 || chatTypeView == 0) {
  316. if (yPos > 0 && yPos < 210)
  317. // textDrawingArea.method385(0x800080, s1 + " "
  318. // + chatMessages[k], yPos, 11);
  319. newRegularFont.drawBasicString(s1 + " "
  320. + chatMessages[k], 11, yPos, 0x800080,
  321. -1);
  322. j++;
  323. j77++;
  324. }
  325. }
  326. if (chatType == 5 && splitPrivateChat == 0
  327. && privateChatMode < 2) {
  328. if (chatTypeView == 2 || chatTypeView == 0) {
  329. if (yPos > 0 && yPos < 210)
  330. // textDrawingArea.method385(0x800000,
  331. // chatMessages[k], yPos, 11);
  332. newRegularFont.drawBasicString(chatMessages[k],
  333. 11, yPos, 0x800000, -1);
  334. j++;
  335. j77++;
  336. }
  337. }
  338. if (chatType == 6
  339. && (splitPrivateChat == 0 || chatTypeView == 2)
  340. && privateChatMode < 2) {
  341. if (chatTypeView == 2 || chatTypeView == 0) {
  342. if (yPos > 0 && yPos < 210) {
  343. // textDrawingArea.method385(0, "To " + s1 +
  344. // ":", yPos, 11);
  345. // textDrawingArea.method385(0x800000,
  346. // chatMessages[k], yPos, 15 +
  347. // textDrawingArea.getTextWidth("To :" + s1));
  348.  
  349. newRegularFont.drawBasicString(
  350. "To " + s1 + ":", 11, yPos, 0, -1);
  351. newRegularFont.drawBasicString(
  352. chatMessages[k],
  353. 15 + newRegularFont.getTextWidth("To :"
  354. + s1), yPos, 0x800000, -1);
  355. }
  356. j++;
  357. j77++;
  358. }
  359. }
  360. if (chatType == 8
  361. && (tradeMode == 0 || tradeMode == 1
  362. && isFriendOrSelf(s1))) {
  363. if (chatTypeView == 3 || chatTypeView == 0) {
  364. if (yPos > 0 && yPos < 210)
  365. newRegularFont.drawBasicString(s1 + " "
  366. + chatMessages[k], 11, yPos, 0x7e3200,
  367. -1);
  368. j++;
  369. j77++;
  370. }
  371. if(chatType == 11 && (clanChatMode == 0)) {
  372. if (chatTypeView == 11) {
  373. if(yPos > 0 && yPos < 110)
  374. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  375. j++;
  376. j77++;
  377. }
  378. }
  379. }
  380. if(chatType == 16) {
  381. int j2 = 40+11;
  382. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  383. if(chatTypeView == 11 || chatTypeView == 0) {
  384. if(yPos > 0 && yPos < 110)
  385. switch(chatRights[k]) {
  386. case 1:
  387. j2 += clanNameWidth;
  388. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  389. j2 += 15;
  390. break;
  391. case 2:
  392. j2 += clanNameWidth;
  393. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  394. j2 += 15;
  395. break;
  396. case 3:
  397. j2 += clanNameWidth;
  398. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  399. j2 += 15;
  400. break;
  401. case 4:
  402. j2 += clanNameWidth;
  403. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  404. j2 += 15;
  405. break;
  406. default:
  407. j2 += clanNameWidth;
  408. break;
  409. }
  410. newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
  411. newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
  412. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
  413. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  414. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  415. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  416.  
  417. j++;
  418. j77++;
  419. }
  420. }
  421. }
  422. DrawingArea.defaultDrawingAreaSize();
  423. anInt1211 = j * 14 + 7 + 5;
  424. if (anInt1211 < 111)
  425. anInt1211 = 111;
  426. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  427. String s;
  428. if (myPlayer != null && myPlayer.name != null)
  429. s = myPlayer.name;
  430. else
  431. s = TextClass.fixName(myUsername);
  432. textDrawingArea.method385(0, s + ":", 133, 11);
  433. textDrawingArea.drawChatInput(255,12 + textDrawingArea.getTextWidth(s + ": "), inputString+ "*", 133, false);
  434. DrawingArea.method339(121, 0x807660, 506, 7);
  435. }
  436. if (menuOpen && menuScreenArea == 2) {
  437. drawMenu();
  438. }
  439. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  440. aRSImageProducer_1165.initDrawingArea();
  441. Texture.anIntArray1472 = anIntArray1182;
  442. }
  443.  
  444. public void init() {
  445. try {
  446. nodeID = 10;
  447. portOff = 0;
  448. setHighMem();
  449. isMembers = true;
  450. signlink.storeid = 32;
  451. signlink.startpriv(InetAddress.getLocalHost());
  452. initClientFrame(503, 765);
  453. instance = this;
  454. } catch (Exception exception) {
  455. return;
  456. }
  457. }
  458.  
  459. public void startRunnable(Runnable runnable, int i) {
  460. if (i > 10)
  461. i = 10;
  462. if (signlink.mainapp != null) {
  463. signlink.startthread(runnable, i);
  464. } else {
  465. super.startRunnable(runnable, i);
  466. }
  467. }
  468.  
  469. public Socket openSocket(int port) throws IOException {
  470. return new Socket(InetAddress.getByName(server), port);
  471. }
  472.  
  473. public void processMenuClick() {
  474. if (activeInterfaceType != 0)
  475. return;
  476. int j = super.clickMode3;
  477. if (spellSelected == 1 && super.saveClickX >= 516
  478. && super.saveClickY >= 160 && super.saveClickX <= 765
  479. && super.saveClickY <= 205)
  480. j = 0;
  481. if (menuOpen) {
  482. if (j != 1) {
  483. int k = super.mouseX;
  484. int j1 = super.mouseY;
  485. if (menuScreenArea == 0) {
  486. k -= 4;
  487. j1 -= 4;
  488. }
  489. if (menuScreenArea == 1) {
  490. k -= 519;
  491. j1 -= 168;
  492. }
  493. if (menuScreenArea == 2) {
  494. k -= 17;
  495. j1 -= 338;
  496. }
  497. if (menuScreenArea == 3) {
  498. k -= 519;
  499. j1 -= 0;
  500. }
  501. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  502. || j1 < menuOffsetY - 10
  503. || j1 > menuOffsetY + menuHeight + 10) {
  504. menuOpen = false;
  505. if (menuScreenArea == 1)
  506. needDrawTabArea = true;
  507. if (menuScreenArea == 2)
  508. inputTaken = true;
  509. }
  510. }
  511. if (j == 1) {
  512. int l = menuOffsetX;
  513. int k1 = menuOffsetY;
  514. int i2 = menuWidth;
  515. int k2 = super.saveClickX;
  516. int l2 = super.saveClickY;
  517. if (menuScreenArea == 0) {
  518. k2 -= 4;
  519. l2 -= 4;
  520. }
  521. if (menuScreenArea == 1) {
  522. k2 -= 519;
  523. l2 -= 168;
  524. }
  525. if (menuScreenArea == 2) {
  526. k2 -= 17;
  527. l2 -= 338;
  528. }
  529. if (menuScreenArea == 3) {
  530. k2 -= 519;
  531. l2 -= 0;
  532. }
  533. int i3 = -1;
  534. for (int j3 = 0; j3 < menuActionRow; j3++) {
  535. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  536. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  537. i3 = j3;
  538. }
  539. if (i3 != -1)
  540. doAction(i3);
  541. menuOpen = false;
  542. if (menuScreenArea == 1)
  543. needDrawTabArea = true;
  544. if (menuScreenArea == 2) {
  545. inputTaken = true;
  546. }
  547. }
  548. } else {
  549. if (j == 1 && menuActionRow > 0) {
  550. int i1 = menuActionID[menuActionRow - 1];
  551. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  552. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  553. || i1 == 847 || i1 == 447 || i1 == 1125) {
  554. int l1 = menuActionCmd2[menuActionRow - 1];
  555. int j2 = menuActionCmd3[menuActionRow - 1];
  556. RSInterface class9 = RSInterface.interfaceCache[j2];
  557. if (class9.aBoolean259 || class9.aBoolean235) {
  558. aBoolean1242 = false;
  559. anInt989 = 0;
  560. anInt1084 = j2;
  561. anInt1085 = l1;
  562. activeInterfaceType = 2;
  563. anInt1087 = super.saveClickX;
  564. anInt1088 = super.saveClickY;
  565. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  566. activeInterfaceType = 1;
  567. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  568. activeInterfaceType = 3;
  569. return;
  570. }
  571. }
  572. }
  573. if (j == 1
  574. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  575. && menuActionRow > 2)
  576. j = 2;
  577. if (j == 1 && menuActionRow > 0)
  578. doAction(menuActionRow - 1);
  579. if (j == 2 && menuActionRow > 0)
  580. determineMenuSize();
  581. }
  582. }
  583.  
  584. public static int totalRead = 0;
  585.  
  586. public static String getFileNameWithoutExtension(String fileName) {
  587. File tmpFile = new File(fileName);
  588. tmpFile.getName();
  589. int whereDot = tmpFile.getName().lastIndexOf('.');
  590. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  591. return tmpFile.getName().substring(0, whereDot);
  592. }
  593. return "";
  594. }
  595.  
  596. public void preloadModels() {
  597. File file = new File("./Raw/");
  598. File[] fileArray = file.listFiles();
  599. for (int y = 0; y < fileArray.length; y++) {
  600. String s = fileArray[y].getName();
  601. byte[] buffer = ReadFile("./Raw/" + s);
  602. Model.method460(buffer,
  603. Integer.parseInt(getFileNameWithoutExtension(s)));
  604. }
  605. }
  606.  
  607. public static final byte[] ReadFile(String s) {
  608. try {
  609. byte abyte0[];
  610. File file = new File(s);
  611. int i = (int) file.length();
  612. abyte0 = new byte[i];
  613. DataInputStream datainputstream = new DataInputStream(
  614. new BufferedInputStream(new FileInputStream(s)));
  615. datainputstream.readFully(abyte0, 0, i);
  616. datainputstream.close();
  617. totalRead++;
  618. return abyte0;
  619. } catch (Exception e) {
  620. System.out.println((new StringBuilder()).append("Read Error: ")
  621. .append(s).toString());
  622. return null;
  623. }
  624. }
  625.  
  626. public void addModels() {
  627. for (int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  628. byte[] abyte0 = getModel(ModelIndex);
  629. if (abyte0 != null && abyte0.length > 0) {
  630. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  631. }
  632. }
  633. }
  634.  
  635. public byte[] getModel(int Index) {
  636. try {
  637. File Model = new File(signlink.findcachedir() + "./pModels/"
  638. + Index + ".gz");
  639. byte[] aByte = new byte[(int) Model.length()];
  640. FileInputStream fis = new FileInputStream(Model);
  641. fis.read(aByte);
  642. System.out.println("" + Index + " aByte = [" + aByte + "]!");
  643. fis.close();
  644. return aByte;
  645. } catch (Exception e) {
  646. return null;
  647. }
  648. }
  649.  
  650. public void addMaps() {
  651. for (int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  652. byte[] abyte0 = getMaps(MapIndex);
  653. if (abyte0 != null && abyte0.length > 0) {
  654. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  655. System.out.println("Maps Added");
  656. }
  657. }
  658. }
  659.  
  660. public byte[] getMaps(int Index) {
  661. try {
  662. File Map = new File(signlink.findcachedir() + "./pMaps/" + Index
  663. + ".gz");
  664. byte[] aByte = new byte[(int) Map.length()];
  665. FileInputStream fis = new FileInputStream(Map);
  666. fis.read(aByte);
  667. pushMessage("aByte = [" + aByte + "]!", 0, "");
  668. fis.close();
  669. return aByte;
  670. } catch (Exception e) {
  671. return null;
  672. }
  673. }
  674.  
  675. public void saveMidi(boolean flag, byte abyte0[]) {
  676. signlink.midifade = flag ? 1 : 0;
  677. signlink.midisave(abyte0, abyte0.length);
  678. }
  679.  
  680. public int positions[] = new int[2000];
  681. public int landScapes[] = new int[2000];
  682. public int objects[] = new int[2000];
  683.  
  684. public final void method22() {
  685. try {
  686. anInt985 = -1;
  687. aClass19_1056.removeAll();
  688. aClass19_1013.removeAll();
  689. Texture.method366();
  690. unlinkMRUNodes();
  691. worldController.initToNull();
  692.  
  693. System.gc();
  694. for (int i = 0; i < 4; i++)
  695. aClass11Array1230[i].method210();
  696.  
  697. for (int l = 0; l < 4; l++) {
  698. for (int k1 = 0; k1 < 104; k1++) {
  699. for (int j2 = 0; j2 < 104; j2++)
  700. byteGroundArray[l][k1][j2] = 0;
  701.  
  702. }
  703.  
  704. }
  705.  
  706. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  707. intGroundArray);
  708.  
  709. int k2 = aByteArrayArray1183.length;
  710.  
  711. int k18 = 62;
  712. for (int A = 0; A < k2; A++)
  713. for (int B = 0; B < 2000; B++)
  714. if (anIntArray1234[A] == positions[B]) {
  715. anIntArray1235[A] = landScapes[B];
  716. anIntArray1236[A] = objects[B];
  717. }
  718.  
  719. stream.createFrame(0);
  720.  
  721. if (!aBoolean1159) {
  722. for (int i3 = 0; i3 < k2; i3++) {
  723. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  724. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  725.  
  726. byte abyte0[] = aByteArrayArray1183[i3];
  727. if (FileOperations
  728. .FileExists("./.ss_474/Null.map/mapsFloor/"
  729. + anIntArray1235[i3] + ".dat"))
  730. abyte0 = FileOperations
  731. .ReadFile("./.ss_474/Null.map/mapsFloor/"
  732. + anIntArray1235[i3] + ".dat");
  733.  
  734. if (abyte0 != null)
  735. // objectManager.method180(abyte0, k5, i4, (anInt1069 -
  736. // 6) * 8, (anInt1070 - 6) * 8, (byte)4,
  737. // aClass11Array1230);
  738. objectManager.method180(abyte0, k5, i4,
  739. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  740. aClass11Array1230);
  741. }
  742.  
  743. for (int j4 = 0; j4 < k2; j4++) {
  744. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  745. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  746. byte abyte2[] = aByteArrayArray1183[j4];
  747. if (abyte2 == null && anInt1070 < 800)
  748. // ObjectManager.method174(k7, 64, 0, 64, l5);
  749. objectManager.method174(k7, 64, 64, l5);
  750. }
  751.  
  752. anInt1097++;
  753. if (anInt1097 > 160) {
  754. anInt1097 = 0;
  755. stream.createFrame(238);
  756. stream.writeWordBigEndian(96);
  757.  
  758. }
  759. stream.createFrame(0);
  760.  
  761. for (int i6 = 0; i6 < k2; i6++) {
  762. byte abyte1[] = aByteArrayArray1247[i6];
  763. if (FileOperations
  764. .FileExists("./.ss_474/Null.map/spawnObject/"
  765. + anIntArray1236[i6] + ".dat"))
  766. abyte1 = FileOperations
  767. .ReadFile("./.ss_474/Null.map/spawnObject/"
  768. + anIntArray1236[i6] + ".dat");
  769. if (abyte1 != null) {
  770. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  771. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  772. // ObjectManager.method190(l8, aClass11Array1230, k9, 7,
  773. // aClass25_946, abyte1);
  774. objectManager.method190(l8, aClass11Array1230, k9,
  775. worldController, abyte1);
  776. }
  777. }
  778.  
  779. }
  780. if (aBoolean1159) {
  781. for (int j3 = 0; j3 < 4; j3++) {
  782. for (int k4 = 0; k4 < 13; k4++) {
  783. for (int j6 = 0; j6 < 13; j6++) {
  784. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  785. if (l7 != -1) {
  786. int i9 = l7 >> 24 & 3;
  787. int l9 = l7 >> 1 & 3;
  788. int j10 = l7 >> 14 & 0x3ff;
  789. int l10 = l7 >> 3 & 0x7ff;
  790. int j11 = (j10 / 8 << 8) + l10 / 8;
  791. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  792. if (anIntArray1234[l11] != j11
  793. || aByteArrayArray1183[l11] == null)
  794. continue;
  795. // ObjectManager.method179(i9, l9,
  796. // aClass11Array1230, 9, k4 * 8, (j10 & 7) *
  797. // 8, aByteArrayArray1183[l11], (l10 & 7) *
  798. // 8, j3, j6 * 8);
  799. objectManager.method179(i9, l9,
  800. aClass11Array1230, k4 * 8,
  801. (j10 & 7) * 8,
  802. aByteArrayArray1183[l11],
  803. (l10 & 7) * 8, j3, j6 * 8);
  804. break;
  805. }
  806.  
  807. }
  808. }
  809.  
  810. }
  811.  
  812. }
  813.  
  814. for (int l4 = 0; l4 < 13; l4++) {
  815. for (int k6 = 0; k6 < 13; k6++) {
  816. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  817. if (i8 == -1)
  818. // ObjectManager.method174(k6 * 8, 8, 0, 8, l4 * 8);
  819. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  820. }
  821.  
  822. }
  823.  
  824. stream.createFrame(0);
  825.  
  826. for (int l6 = 0; l6 < 4; l6++) {
  827. for (int j8 = 0; j8 < 13; j8++) {
  828. for (int j9 = 0; j9 < 13; j9++) {
  829. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  830. if (i10 != -1) {
  831. int k10 = i10 >> 24 & 3;
  832. int i11 = i10 >> 1 & 3;
  833. int k11 = i10 >> 14 & 0x3ff;
  834. int i12 = i10 >> 3 & 0x7ff;
  835. int j12 = (k11 / 8 << 8) + i12 / 8;
  836. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  837. if (anIntArray1234[k12] != j12
  838. || aByteArrayArray1247[k12] == null)
  839. continue;
  840. byte abyte0[] = aByteArrayArray1247[k12];
  841. if (FileOperations
  842. .FileExists("./Cache/FloorMaps/"
  843. + anIntArray1235[k12]
  844. + ".dat"))
  845. abyte0 = FileOperations
  846. .ReadFile(signlink
  847. .findcachedir()
  848. + "FloorMaps/"
  849. + anIntArray1235[k12]
  850. + ".dat");
  851. // ObjectManager.method183(aClass11Array1230,
  852. // aClass25_946, k10, j8 * 8, (i12 & 7) * 8,
  853. // true, l6, abyte0, (k11 & 7) * 8, i11, j9
  854. // * 8);
  855. objectManager.method183(aClass11Array1230,
  856. worldController, k10, j8 * 8,
  857. (i12 & 7) * 8, l6,
  858. aByteArrayArray1247[k12],
  859. (k11 & 7) * 8, i11, j9 * 8);
  860. break;
  861. }
  862.  
  863. }
  864. }
  865.  
  866. }
  867.  
  868. }
  869.  
  870. }
  871. stream.createFrame(0);
  872. objectManager.method171(aClass11Array1230, worldController);
  873. aRSImageProducer_1165.initDrawingArea();
  874. stream.createFrame(0);
  875.  
  876. int k3 = ObjectManager.anInt145;
  877. if (k3 > plane)
  878. k3 = plane;
  879.  
  880. if (k3 < plane - 1)
  881. k3 = plane - 1;
  882. if (lowMem)
  883.  
  884. worldController.method275(ObjectManager.anInt145);
  885. else
  886. worldController.method275(0);
  887. for (int i5 = 0; i5 < 104; i5++) {
  888. for (int i7 = 0; i7 < 104; i7++)
  889. spawnGroundItem(i5, i7);
  890.  
  891. }
  892.  
  893. anInt1051++;
  894. if (anInt1051 > 98) {
  895. anInt1051 = 0;
  896. stream.createFrame(150);
  897.  
  898. }
  899. method63();
  900. } catch (Exception e) {
  901. e.printStackTrace();
  902. }
  903. ObjectDef.mruNodes1.unlinkAll();
  904.  
  905. if (super.gameFrame != null) {
  906. stream.createFrame(210);
  907.  
  908. stream.writeDWord(0x3f008edd);
  909. }
  910. System.gc();
  911. Texture.method367();
  912. onDemandFetcher.method566();
  913.  
  914. int k = (anInt1069 - 6) / 8 - 1;
  915. int j1 = (anInt1069 + 6) / 8 + 1;
  916. int i2 = (anInt1070 - 6) / 8 - 1;
  917. int l2 = (anInt1070 + 6) / 8 + 1;
  918. if (aBoolean1141) {
  919. k = 49;
  920. j1 = 50;
  921. i2 = 49;
  922. l2 = 50;
  923. }
  924. for (int l3 = k; l3 <= j1; l3++) {
  925. for (int j5 = i2; j5 <= l2; j5++)
  926. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  927. int j7 = onDemandFetcher.method562(0, j5, l3);
  928. if (j7 != -1)
  929. onDemandFetcher.method560(j7, 3);
  930. int k8 = onDemandFetcher.method562(1, j5, l3);
  931. if (k8 != -1)
  932. onDemandFetcher.method560(k8, 3);
  933. }
  934.  
  935. }
  936.  
  937. }
  938.  
  939. public void unlinkMRUNodes() {
  940. ObjectDef.mruNodes1.unlinkAll();
  941. ObjectDef.mruNodes2.unlinkAll();
  942. EntityDef.mruNodes.unlinkAll();
  943. ItemDef.mruNodes2.unlinkAll();
  944. ItemDef.mruNodes1.unlinkAll();
  945. Player.mruNodes.unlinkAll();
  946. SpotAnim.aMRUNodes_415.unlinkAll();
  947. }
  948.  
  949. public void method24(int i) {
  950. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  951. int j = ai.length;
  952. for (int k = 0; k < j; k++)
  953. ai[k] = 0;
  954.  
  955. for (int l = 1; l < 103; l++) {
  956. int i1 = 24628 + (103 - l) * 512 * 4;
  957. for (int k1 = 1; k1 < 103; k1++) {
  958. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  959. worldController.method309(ai, i1, i, k1, l);
  960. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  961. worldController.method309(ai, i1, i + 1, k1, l);
  962. i1 += 4;
  963. }
  964.  
  965. }
  966.  
  967. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16)
  968. + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  969. + ((238 + (int) (Math.random() * 20D)) - 10);
  970. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  971. aClass30_Sub2_Sub1_Sub1_1263.method343();
  972. for (int i2 = 1; i2 < 103; i2++) {
  973. for (int j2 = 1; j2 < 103; j2++) {
  974. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  975. method50(i2, j1, j2, l1, i);
  976. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  977. method50(i2, j1, j2, l1, i + 1);
  978. }
  979.  
  980. }
  981.  
  982. aRSImageProducer_1165.initDrawingArea();
  983. anInt1071 = 0;
  984. for (int k2 = 0; k2 < 104; k2++) {
  985. for (int l2 = 0; l2 < 104; l2++) {
  986. int i3 = worldController.method303(plane, k2, l2);
  987. if (i3 != 0) {
  988. i3 = i3 >> 14 & 0x7fff;
  989. int j3 = ObjectDef.forID(i3).anInt746;
  990. if (j3 >= 0) {
  991. int k3 = k2;
  992. int l3 = l2;
  993. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36
  994. && j3 != 46 && j3 != 47 && j3 != 48) {
  995. byte byte0 = 104;
  996. byte byte1 = 104;
  997. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  998. for (int i4 = 0; i4 < 10; i4++) {
  999. int j4 = (int) (Math.random() * 4D);
  1000. if (j4 == 0 && k3 > 0 && k3 > k2 - 3
  1001. && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1002. k3--;
  1003. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3
  1004. && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1005. k3++;
  1006. if (j4 == 2 && l3 > 0 && l3 > l2 - 3
  1007. && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1008. l3--;
  1009. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3
  1010. && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1011. l3++;
  1012. }
  1013.  
  1014. }
  1015. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1016. anIntArray1072[anInt1071] = k3;
  1017. anIntArray1073[anInt1071] = l3;
  1018. anInt1071++;
  1019. }
  1020. }
  1021. }
  1022.  
  1023. }
  1024.  
  1025. }
  1026.  
  1027. public void spawnGroundItem(int i, int j) {
  1028. NodeList class19 = groundArray[plane][i][j];
  1029. if (class19 == null) {
  1030. worldController.method295(plane, i, j);
  1031. return;
  1032. }
  1033. int k = 0xfa0a1f01;
  1034. Object obj = null;
  1035. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1036. .reverseGetNext()) {
  1037. ItemDef itemDef = ItemDef.forID(item.ID);
  1038. int l = itemDef.value;
  1039. if (itemDef.stackable)
  1040. l *= item.anInt1559 + 1;
  1041. // notifyItemSpawn(item, i + baseX, j + baseY);
  1042.  
  1043. if (l > k) {
  1044. k = l;
  1045. obj = item;
  1046. }
  1047. }
  1048.  
  1049. class19.insertTail(((Node) (obj)));
  1050. Object obj1 = null;
  1051. Object obj2 = null;
  1052. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1053. .reverseGetNext()) {
  1054. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1055. && obj1 == null)
  1056. obj1 = class30_sub2_sub4_sub2_1;
  1057. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1058. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1059. && obj2 == null)
  1060. obj2 = class30_sub2_sub4_sub2_1;
  1061. }
  1062.  
  1063. int i1 = i + (j << 7) + 0x60000000;
  1064. worldController.method281(i, i1, ((Animable) (obj1)),
  1065. method42(plane, j * 128 + 64, i * 128 + 64),
  1066. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1067. }
  1068.  
  1069. public void method26(boolean flag) {
  1070. for (int j = 0; j < npcCount; j++) {
  1071. NPC npc = npcArray[npcIndices[j]];
  1072. int k = 0x20000000 + (npcIndices[j] << 14);
  1073. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1074. continue;
  1075. int l = npc.x >> 7;
  1076. int i1 = npc.y >> 7;
  1077. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1078. continue;
  1079. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1080. && (npc.y & 0x7f) == 64) {
  1081. if (anIntArrayArray929[l][i1] == anInt1265)
  1082. continue;
  1083. anIntArrayArray929[l][i1] = anInt1265;
  1084. }
  1085. if (!npc.desc.aBoolean84)
  1086. k += 0x80000000;
  1087. worldController
  1088. .method285(plane, npc.anInt1552,
  1089. method42(plane, npc.y, npc.x), k, npc.y,
  1090. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1091. npc.aBoolean1541);
  1092. }
  1093. }
  1094.  
  1095. private boolean replayWave() {
  1096. return signlink.wavereplay();
  1097. }
  1098.  
  1099. public void loadError() {
  1100. String s = "ondemand";// was a constant parameter
  1101. System.out.println(s);
  1102. try {
  1103. getAppletContext().showDocument(
  1104. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1105. } catch (Exception exception) {
  1106. exception.printStackTrace();
  1107. }
  1108. do
  1109. try {
  1110. Thread.sleep(1000L);
  1111. } catch (Exception _ex) {
  1112. }
  1113. while (true);
  1114. }
  1115.  
  1116. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1117. {
  1118. if(class9 == null){
  1119. return;
  1120. }
  1121. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1122. return;
  1123. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1124. return;
  1125. int k1 = class9.children.length;
  1126. for(int l1 = 0; l1 < k1; l1++)
  1127. {
  1128. int i2 = class9.childX[l1] + i;
  1129. int j2 = (class9.childY[l1] + l) - j1;
  1130. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1131. if (class9_1 == null) {
  1132. break;
  1133. }
  1134. i2 += class9_1.anInt263;
  1135. j2 += class9_1.anInt265;
  1136. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1137. if(class9_1.mOverInterToTrigger >= 0)
  1138. anInt886 = class9_1.mOverInterToTrigger;
  1139. else
  1140. anInt886 = class9_1.id;
  1141. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1142. anInt1315 = class9_1.id;
  1143. }
  1144. if (class9_1.type == 9 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1145. anInt1315 = class9_1.id;
  1146. }
  1147. if (class9_1.type == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1148. hoverId = class9_1.id;
  1149. }
  1150. if(class9_1.type == 0)
  1151. {
  1152. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1153. if(class9_1.scrollMax > class9_1.height)
  1154. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1155. } else
  1156. {
  1157. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1158. {
  1159. boolean flag = false;
  1160. if(class9_1.contentType != 0)
  1161. flag = buildFriendsListMenu(class9_1);
  1162. if(!flag)
  1163. {
  1164. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1165. menuActionName[menuActionRow] = class9_1.tooltip;
  1166. menuActionID[menuActionRow] = 315;
  1167. menuActionCmd3[menuActionRow] = class9_1.id;
  1168. menuActionRow++;
  1169. }
  1170. }
  1171. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1172. {
  1173. String s = class9_1.selectedActionName;
  1174. if(s.indexOf(" ") != -1)
  1175. s = s.substring(0, s.indexOf(" "));
  1176. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1177. menuActionID[menuActionRow] = 626;
  1178. menuActionCmd3[menuActionRow] = class9_1.id;
  1179. menuActionRow++;
  1180. }
  1181. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1182. {
  1183. menuActionName[menuActionRow] = "Close";
  1184. menuActionID[menuActionRow] = 200;
  1185. menuActionCmd3[menuActionRow] = class9_1.id;
  1186. menuActionRow++;
  1187. }
  1188. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1189. {
  1190. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1191. menuActionName[menuActionRow] = class9_1.tooltip;
  1192. menuActionID[menuActionRow] = 169;
  1193. menuActionCmd3[menuActionRow] = class9_1.id;
  1194. menuActionRow++;
  1195. if (class9_1.hoverText != null) {
  1196. //drawHoverBox(k, l, class9_1.hoverText);
  1197. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1198. }
  1199. }
  1200. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1201. {
  1202. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1203. menuActionName[menuActionRow] = class9_1.tooltip;
  1204. menuActionID[menuActionRow] = 646;
  1205. menuActionCmd3[menuActionRow] = class9_1.id;
  1206. menuActionRow++;
  1207. }
  1208. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1209. {
  1210. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1211. menuActionName[menuActionRow] = class9_1.tooltip;
  1212. menuActionID[menuActionRow] = 679;
  1213. menuActionCmd3[menuActionRow] = class9_1.id;
  1214. menuActionRow++;
  1215. }
  1216. if(class9_1.type == 2)
  1217. {
  1218. int k2 = 0;
  1219. for(int l2 = 0; l2 < class9_1.height; l2++)
  1220. {
  1221. for(int i3 = 0; i3 < class9_1.width; i3++)
  1222. {
  1223. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1224. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1225. if(k2 < 20)
  1226. {
  1227. j3 += class9_1.spritesX[k2];
  1228. k3 += class9_1.spritesY[k2];
  1229. }
  1230. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1231. {
  1232. mouseInvInterfaceIndex = k2;
  1233. lastActiveInvInterface = class9_1.id;
  1234. if(class9_1.inv[k2] > 0)
  1235. {
  1236. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1237. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1238. {
  1239. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1240. {
  1241. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1242. menuActionID[menuActionRow] = 870;
  1243. menuActionCmd1[menuActionRow] = itemDef.id;
  1244. menuActionCmd2[menuActionRow] = k2;
  1245. menuActionCmd3[menuActionRow] = class9_1.id;
  1246. menuActionRow++;
  1247. }
  1248. } else
  1249. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1250. {
  1251. if((spellUsableOn & 0x10) == 16)
  1252. {
  1253. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1254. menuActionID[menuActionRow] = 543;
  1255. menuActionCmd1[menuActionRow] = itemDef.id;
  1256. menuActionCmd2[menuActionRow] = k2;
  1257. menuActionCmd3[menuActionRow] = class9_1.id;
  1258. menuActionRow++;
  1259. }
  1260. } else
  1261. {
  1262. if(class9_1.isInventoryInterface)
  1263. {
  1264. for(int l3 = 4; l3 >= 3; l3--)
  1265. if(itemDef.itemActions != null && itemDef.itemActions[l3] != null)
  1266. {
  1267. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1268. if(l3 == 3)
  1269. menuActionID[menuActionRow] = 493;
  1270. if(l3 == 4)
  1271. menuActionID[menuActionRow] = 847;
  1272. menuActionCmd1[menuActionRow] = itemDef.id;
  1273. menuActionCmd2[menuActionRow] = k2;
  1274. menuActionCmd3[menuActionRow] = class9_1.id;
  1275. menuActionRow++;
  1276. } else
  1277. if(l3 == 4)
  1278. {
  1279. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1280. menuActionID[menuActionRow] = 847;
  1281. menuActionCmd1[menuActionRow] = itemDef.id;
  1282. menuActionCmd2[menuActionRow] = k2;
  1283. menuActionCmd3[menuActionRow] = class9_1.id;
  1284. menuActionRow++;
  1285. }
  1286.  
  1287. }
  1288. if(class9_1.usableItemInterface)
  1289. {
  1290. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1291. menuActionID[menuActionRow] = 447;
  1292. menuActionCmd1[menuActionRow] = itemDef.id;
  1293. //k2 = inventory spot
  1294. //System.out.println(k2);
  1295. menuActionCmd2[menuActionRow] = k2;
  1296. menuActionCmd3[menuActionRow] = class9_1.id;
  1297. menuActionRow++;
  1298. }
  1299. if(class9_1.isInventoryInterface && itemDef.itemActions != null)
  1300. {
  1301. for(int i4 = 2; i4 >= 0; i4--)
  1302. if(itemDef.itemActions[i4] != null)
  1303. {
  1304. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1305. if(i4 == 0)
  1306. menuActionID[menuActionRow] = 74;
  1307. if(i4 == 1)
  1308. menuActionID[menuActionRow] = 454;
  1309. if(i4 == 2)
  1310. menuActionID[menuActionRow] = 539;
  1311. menuActionCmd1[menuActionRow] = itemDef.id;
  1312. menuActionCmd2[menuActionRow] = k2;
  1313. menuActionCmd3[menuActionRow] = class9_1.id;
  1314. menuActionRow++;
  1315. }
  1316.  
  1317. }
  1318. if(class9_1.actions != null)
  1319. {
  1320. for(int j4 = 4; j4 >= 0; j4--)
  1321. if(class9_1.actions[j4] != null)
  1322. {
  1323. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1324. if(j4 == 0)
  1325. menuActionID[menuActionRow] = 632;
  1326. if(j4 == 1)
  1327. menuActionID[menuActionRow] = 78;
  1328. if(j4 == 2)
  1329. menuActionID[menuActionRow] = 867;
  1330. if(j4 == 3)
  1331. menuActionID[menuActionRow] = 431;
  1332. if(j4 == 4)
  1333. menuActionID[menuActionRow] = 53;
  1334. menuActionCmd1[menuActionRow] = itemDef.id;
  1335. menuActionCmd2[menuActionRow] = k2;
  1336. menuActionCmd3[menuActionRow] = class9_1.id;
  1337. menuActionRow++;
  1338. }
  1339.  
  1340. }
  1341. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1342. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1343. menuActionID[menuActionRow] = 1125;
  1344. menuActionCmd1[menuActionRow] = itemDef.id;
  1345. menuActionCmd2[menuActionRow] = k2;
  1346. menuActionCmd3[menuActionRow] = class9_1.id;
  1347. menuActionRow++;
  1348. }
  1349. }
  1350. }
  1351. k2++;
  1352. }
  1353.  
  1354. }
  1355.  
  1356. }
  1357. }
  1358. }
  1359. }
  1360.  
  1361. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1362. scrollBar1.drawSprite(i1, l);
  1363. scrollBar2.drawSprite(i1, (l + j) - 16);
  1364. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1365. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1366. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1367. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1368. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1369. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1370. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1371. int k1 = ((j - 32) * j) / j1;
  1372. if (k1 < 8)
  1373. k1 = 8;
  1374. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1375. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1376. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1377. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1378. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1379. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1380. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1381. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1382. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1383. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1384. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1385. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1386. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1387. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1388. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1389. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1390. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1391. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1392. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1393. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1394. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1395. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1396. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1397. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1398. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1399. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1400. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1401. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1402. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1403. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1404. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1405. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1406. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1407. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1408. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1409. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1410. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1411. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1412. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1413. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1414. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1415. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1416. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1417. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1418. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1419. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1420. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1421. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1422. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1423. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1424. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1425. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1426. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1427. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1428. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1429. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1430. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1431. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1432. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1433. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1434. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1435. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1436. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1437. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1438. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1439. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1440. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1441. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1442. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1443. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1444. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1445. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1446. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1447. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1448. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1449. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1450. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1451. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1452. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1453. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1454. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1455. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1456. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1457. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1458. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1459. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1460. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1461. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1462. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1463. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1464. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1465. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1466. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1467. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1468. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1469. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1470. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1471. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1472. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1473. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1474. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1475. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1476. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1477. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1478. }
  1479.  
  1480. public void updateNPCs(Stream stream, int i) {
  1481. anInt839 = 0;
  1482. anInt893 = 0;
  1483. method139(stream);
  1484. method46(i, stream);
  1485. method86(stream);
  1486. for (int k = 0; k < anInt839; k++) {
  1487. int l = anIntArray840[k];
  1488. if (npcArray[l].anInt1537 != loopCycle) {
  1489. npcArray[l].desc = null;
  1490. npcArray[l] = null;
  1491. }
  1492. }
  1493.  
  1494. if (stream.currentOffset != i) {
  1495. signlink.reporterror(myUsername
  1496. + " size mismatch in getnpcpos - pos:"
  1497. + stream.currentOffset + " psize:" + i);
  1498. throw new RuntimeException("eek");
  1499. }
  1500. for (int i1 = 0; i1 < npcCount; i1++)
  1501. if (npcArray[npcIndices[i1]] == null) {
  1502. signlink.reporterror(myUsername
  1503. + " null entry in npc list - pos:" + i1 + " size:"
  1504. + npcCount);
  1505. throw new RuntimeException("eek");
  1506. }
  1507.  
  1508. }
  1509.  
  1510. private int cButtonHPos;
  1511. private int cButtonHCPos;
  1512. private int cButtonCPos;
  1513.  
  1514. public void processChatModeClick() {
  1515. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482
  1516. && super.mouseY <= 503) {
  1517. cButtonHPos = 0;
  1518. aBoolean1233 = true;
  1519. inputTaken = true;
  1520. } else if (super.mouseX >= 71 && super.mouseX <= 127
  1521. && super.mouseY >= 482 && super.mouseY <= 503) {
  1522. cButtonHPos = 1;
  1523. aBoolean1233 = true;
  1524. inputTaken = true;
  1525. } else if (super.mouseX >= 137 && super.mouseX <= 193
  1526. && super.mouseY >= 482 && super.mouseY <= 503) {
  1527. cButtonHPos = 2;
  1528. aBoolean1233 = true;
  1529. inputTaken = true;
  1530. } else if (super.mouseX >= 203 && super.mouseX <= 259
  1531. && super.mouseY >= 482 && super.mouseY <= 503) {
  1532. cButtonHPos = 3;
  1533. aBoolean1233 = true;
  1534. inputTaken = true;
  1535. } else if (super.mouseX >= 269 && super.mouseX <= 325
  1536. && super.mouseY >= 482 && super.mouseY <= 503) {
  1537. cButtonHPos = 4;
  1538. aBoolean1233 = true;
  1539. inputTaken = true;
  1540. } else if (super.mouseX >= 335 && super.mouseX <= 391
  1541. && super.mouseY >= 482 && super.mouseY <= 503) {
  1542. cButtonHPos = 5;
  1543. aBoolean1233 = true;
  1544. inputTaken = true;
  1545. } else if (super.mouseX >= 404 && super.mouseX <= 515
  1546. && super.mouseY >= 482 && super.mouseY <= 503) {
  1547. cButtonHPos = 6;
  1548. aBoolean1233 = true;
  1549. inputTaken = true;
  1550. } else {
  1551. cButtonHPos = -1;
  1552. aBoolean1233 = true;
  1553. inputTaken = true;
  1554. }
  1555. if (super.clickMode3 == 1) {
  1556. if (super.saveClickX >= 5 && super.saveClickX <= 61
  1557. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1558. cButtonCPos = 0;
  1559. chatTypeView = 0;
  1560. aBoolean1233 = true;
  1561. inputTaken = true;
  1562. } else if (super.saveClickX >= 71 && super.saveClickX <= 127
  1563. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1564. cButtonCPos = 1;
  1565. chatTypeView = 5;
  1566. aBoolean1233 = true;
  1567. inputTaken = true;
  1568. } else if (super.saveClickX >= 137 && super.saveClickX <= 193
  1569. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1570. cButtonCPos = 2;
  1571. chatTypeView = 1;
  1572. aBoolean1233 = true;
  1573. inputTaken = true;
  1574. } else if (super.saveClickX >= 203 && super.saveClickX <= 259
  1575. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1576. cButtonCPos = 3;
  1577. chatTypeView = 2;
  1578. aBoolean1233 = true;
  1579. inputTaken = true;
  1580. } else if (super.saveClickX >= 269 && super.saveClickX <= 325
  1581. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1582. cButtonCPos = 4;
  1583. chatTypeView = 11;
  1584. aBoolean1233 = true;
  1585. inputTaken = true;
  1586. } else if (super.saveClickX >= 335 && super.saveClickX <= 391
  1587. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1588. cButtonCPos = 5;
  1589. chatTypeView = 3;
  1590. aBoolean1233 = true;
  1591. inputTaken = true;
  1592. } else if (super.saveClickX >= 404 && super.saveClickX <= 515
  1593. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1594. Jframe.takeScreenshot();
  1595. }
  1596. }
  1597. }
  1598.  
  1599. public void method33(int i) {
  1600. int j = Varp.cache[i].anInt709;
  1601. if (j == 0)
  1602. return;
  1603. int k = variousSettings[i];
  1604. if (j == 1) {
  1605. if (k == 1)
  1606. Texture.method372(0.90000000000000002D);
  1607. if (k == 2)
  1608. Texture.method372(0.80000000000000004D);
  1609. if (k == 3)
  1610. Texture.method372(0.69999999999999996D);
  1611. if (k == 4)
  1612. Texture.method372(0.59999999999999998D);
  1613. ItemDef.mruNodes1.unlinkAll();
  1614. welcomeScreenRaised = true;
  1615. }
  1616. if (j == 3) {
  1617. boolean flag1 = musicEnabled;
  1618. if (k == 0) {
  1619. adjustVolume(musicEnabled, 0);
  1620. musicEnabled = true;
  1621. }
  1622. if (k == 1) {
  1623. adjustVolume(musicEnabled, -400);
  1624. musicEnabled = true;
  1625. }
  1626. if (k == 2) {
  1627. adjustVolume(musicEnabled, -800);
  1628. musicEnabled = true;
  1629. }
  1630. if (k == 3) {
  1631. adjustVolume(musicEnabled, -1200);
  1632. musicEnabled = true;
  1633. }
  1634. if (k == 4)
  1635. musicEnabled = false;
  1636. if (musicEnabled != flag1 && !lowMem) {
  1637. if (musicEnabled) {
  1638. nextSong = currentSong;
  1639. songChanging = true;
  1640. onDemandFetcher.method558(2, nextSong);
  1641. } else {
  1642. stopMidi();
  1643. }
  1644. prevSong = 0;
  1645. }
  1646. }
  1647. if (j == 4) {
  1648. if (k == 0) {
  1649. aBoolean848 = true;
  1650. setWaveVolume(0);
  1651. }
  1652. if (k == 1) {
  1653. aBoolean848 = true;
  1654. setWaveVolume(-400);
  1655. }
  1656. if (k == 2) {
  1657. aBoolean848 = true;
  1658. setWaveVolume(-800);
  1659. }
  1660. if (k == 3) {
  1661. aBoolean848 = true;
  1662. setWaveVolume(-1200);
  1663. }
  1664. if (k == 4)
  1665. aBoolean848 = false;
  1666. }
  1667. if (j == 5)
  1668. anInt1253 = k;
  1669. if (j == 6)
  1670. anInt1249 = k;
  1671. if (j == 8) {
  1672. splitPrivateChat = k;
  1673. inputTaken = true;
  1674. }
  1675. if (j == 9)
  1676. anInt913 = k;
  1677. }
  1678.  
  1679. public void updateEntities() {
  1680. try {
  1681. int anInt974 = 0;
  1682. for (int j = -1; j < playerCount + npcCount; j++) {
  1683. Object obj;
  1684. if (j == -1)
  1685. obj = myPlayer;
  1686. else if (j < playerCount)
  1687. obj = playerArray[playerIndices[j]];
  1688. else
  1689. obj = npcArray[npcIndices[j - playerCount]];
  1690. if (obj == null || !((Entity) (obj)).isVisible())
  1691. continue;
  1692. if (obj instanceof NPC) {
  1693. EntityDef entityDef = ((NPC) obj).desc;
  1694. if (entityDef.childrenIDs != null)
  1695. entityDef = entityDef.method161();
  1696. if (entityDef == null)
  1697. continue;
  1698. }
  1699. if (j < playerCount) {
  1700. int l = 30;
  1701. Player player = (Player) obj;
  1702. if (player.headIcon >= 0) {
  1703. npcScreenPos(((Entity) (obj)),
  1704. ((Entity) (obj)).height + 15);
  1705. if (spriteDrawX > -1) {
  1706. if (player.skullIcon < 2) {
  1707. skullIcons[player.skullIcon].drawSprite(
  1708. spriteDrawX - 12, spriteDrawY - l);
  1709. l += 25;
  1710. }
  1711. if (player.headIcon < 7) {
  1712. headIcons[player.headIcon].drawSprite(
  1713. spriteDrawX - 12, spriteDrawY - l);
  1714. l += 18;
  1715. }
  1716. }
  1717. }
  1718. if (j >= 0 && anInt855 == 10
  1719. && anInt933 == playerIndices[j]) {
  1720. npcScreenPos(((Entity) (obj)),
  1721. ((Entity) (obj)).height + 15);
  1722. if (spriteDrawX > -1)
  1723. headIconsHint[player.hintIcon].drawSprite(
  1724. spriteDrawX - 12, spriteDrawY - l);
  1725. }
  1726. } else {
  1727. EntityDef entityDef_1 = ((NPC) obj).desc;
  1728. if (entityDef_1.anInt75 >= 0
  1729. && entityDef_1.anInt75 < headIcons.length) {
  1730. npcScreenPos(((Entity) (obj)),
  1731. ((Entity) (obj)).height + 15);
  1732. if (spriteDrawX > -1)
  1733. headIcons[entityDef_1.anInt75].drawSprite(
  1734. spriteDrawX - 12, spriteDrawY - 30);
  1735. }
  1736. if (anInt855 == 1
  1737. && anInt1222 == npcIndices[j - playerCount]
  1738. && loopCycle % 20 < 10) {
  1739. npcScreenPos(((Entity) (obj)),
  1740. ((Entity) (obj)).height + 15);
  1741. if (spriteDrawX > -1)
  1742. headIconsHint[0].drawSprite(spriteDrawX - 12,
  1743. spriteDrawY - 28);
  1744. }
  1745. }
  1746. if (((Entity) (obj)).textSpoken != null
  1747. && (j >= playerCount || publicChatMode == 0
  1748. || publicChatMode == 3 || publicChatMode == 1
  1749. && isFriendOrSelf(((Player) obj).name))) {
  1750. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1751. if (spriteDrawX > -1 && anInt974 < anInt975) {
  1752. anIntArray979[anInt974] = chatTextDrawingArea
  1753. .method384(((Entity) (obj)).textSpoken) / 2;
  1754. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1755. anIntArray976[anInt974] = spriteDrawX;
  1756. anIntArray977[anInt974] = spriteDrawY;
  1757. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1758. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1759. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1760. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1761. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  1762. && ((Entity) (obj)).anInt1531 <= 3) {
  1763. anIntArray978[anInt974] += 10;
  1764. anIntArray977[anInt974] += 5;
  1765. }
  1766. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1767. anIntArray979[anInt974] = 60;
  1768. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1769. anIntArray978[anInt974] += 5;
  1770. }
  1771. }
  1772. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  1773. try {
  1774. npcScreenPos(((Entity) (obj)),
  1775. ((Entity) (obj)).height + 15);
  1776. if (spriteDrawX > -1) {
  1777. int i1 = (((Entity) (obj)).currentHealth * 30)
  1778. / ((Entity) (obj)).maxHealth;
  1779. if (i1 > 30)
  1780. i1 = 30;
  1781. DrawingArea.drawPixels(5, spriteDrawY - 3,
  1782. spriteDrawX - 15, 65280, i1);
  1783. DrawingArea.drawPixels(5, spriteDrawY - 3,
  1784. (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1785. }
  1786. } catch (Exception e) {
  1787. }
  1788. }
  1789. for (int j1 = 0; j1 < 4; j1++)
  1790. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  1791. npcScreenPos(((Entity) (obj)),
  1792. ((Entity) (obj)).height / 2);
  1793. if (spriteDrawX > -1) {
  1794. if (j1 == 1)
  1795. spriteDrawY -= 20;
  1796. if (j1 == 2) {
  1797. spriteDrawX -= 15;
  1798. spriteDrawY -= 10;
  1799. }
  1800. if (j1 == 3) {
  1801. spriteDrawX += 15;
  1802. spriteDrawY -= 10;
  1803. }
  1804. hitMarks[((Entity) (obj)).hitMarkTypes[j1]]
  1805. .drawSprite(spriteDrawX - 12,
  1806. spriteDrawY - 12);
  1807. smallText.drawText(0, String
  1808. .valueOf(((Entity) (obj)).hitArray[j1]),
  1809. spriteDrawY + 4, spriteDrawX);
  1810. smallText.drawText(0xffffff, String
  1811. .valueOf(((Entity) (obj)).hitArray[j1]),
  1812. spriteDrawY + 3, spriteDrawX - 1);
  1813. }
  1814. }
  1815. }
  1816. for (int k = 0; k < anInt974; k++) {
  1817. int k1 = anIntArray976[k];
  1818. int l1 = anIntArray977[k];
  1819. int j2 = anIntArray979[k];
  1820. int k2 = anIntArray978[k];
  1821. boolean flag = true;
  1822. while (flag) {
  1823. flag = false;
  1824. for (int l2 = 0; l2 < k; l2++)
  1825. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2]
  1826. && l1 - k2 < anIntArray977[l2] + 2
  1827. && k1 - j2 < anIntArray976[l2]
  1828. + anIntArray979[l2]
  1829. && k1 + j2 > anIntArray976[l2]
  1830. - anIntArray979[l2]
  1831. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  1832. l1 = anIntArray977[l2] - anIntArray978[l2];
  1833. flag = true;
  1834. }
  1835.  
  1836. }
  1837. spriteDrawX = anIntArray976[k];
  1838. spriteDrawY = anIntArray977[k] = l1;
  1839. String s = aStringArray983[k];
  1840. if (anInt1249 == 0) {
  1841. int i3 = 0xffff00;
  1842. if (anIntArray980[k] < 6)
  1843. i3 = anIntArray965[anIntArray980[k]];
  1844. if (anIntArray980[k] == 6)
  1845. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1846. if (anIntArray980[k] == 7)
  1847. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1848. if (anIntArray980[k] == 8)
  1849. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1850. if (anIntArray980[k] == 9) {
  1851. int j3 = 150 - anIntArray982[k];
  1852. if (j3 < 50)
  1853. i3 = 0xff0000 + 1280 * j3;
  1854. else if (j3 < 100)
  1855. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1856. else if (j3 < 150)
  1857. i3 = 65280 + 5 * (j3 - 100);
  1858. }
  1859. if (anIntArray980[k] == 10) {
  1860. int k3 = 150 - anIntArray982[k];
  1861. if (k3 < 50)
  1862. i3 = 0xff0000 + 5 * k3;
  1863. else if (k3 < 100)
  1864. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1865. else if (k3 < 150)
  1866. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1867. }
  1868. if (anIntArray980[k] == 11) {
  1869. int l3 = 150 - anIntArray982[k];
  1870. if (l3 < 50)
  1871. i3 = 0xffffff - 0x50005 * l3;
  1872. else if (l3 < 100)
  1873. i3 = 65280 + 0x50005 * (l3 - 50);
  1874. else if (l3 < 150)
  1875. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1876. }
  1877. if (anIntArray981[k] == 0) {
  1878. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  1879. spriteDrawX);
  1880. chatTextDrawingArea.drawText(i3, s, spriteDrawY,
  1881. spriteDrawX);
  1882. }
  1883. if (anIntArray981[k] == 1) {
  1884. chatTextDrawingArea.method386(0, s, spriteDrawX,
  1885. anInt1265, spriteDrawY + 1);
  1886. chatTextDrawingArea.method386(i3, s, spriteDrawX,
  1887. anInt1265, spriteDrawY);
  1888. }
  1889. if (anIntArray981[k] == 2) {
  1890. chatTextDrawingArea.method387(spriteDrawX, s,
  1891. anInt1265, spriteDrawY + 1, 0);
  1892. chatTextDrawingArea.method387(spriteDrawX, s,
  1893. anInt1265, spriteDrawY, i3);
  1894. }
  1895. if (anIntArray981[k] == 3) {
  1896. chatTextDrawingArea.method388(150 - anIntArray982[k],
  1897. s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1898. chatTextDrawingArea.method388(150 - anIntArray982[k],
  1899. s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1900. }
  1901. if (anIntArray981[k] == 4) {
  1902. int i4 = chatTextDrawingArea.method384(s);
  1903. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1904. DrawingArea.setDrawingArea(334, spriteDrawX - 50,
  1905. spriteDrawX + 50, 0);
  1906. chatTextDrawingArea.method385(0, s, spriteDrawY + 1,
  1907. (spriteDrawX + 50) - k4);
  1908. chatTextDrawingArea.method385(i3, s, spriteDrawY,
  1909. (spriteDrawX + 50) - k4);
  1910. DrawingArea.defaultDrawingAreaSize();
  1911. }
  1912. if (anIntArray981[k] == 5) {
  1913. int j4 = 150 - anIntArray982[k];
  1914. int l4 = 0;
  1915. if (j4 < 25)
  1916. l4 = j4 - 25;
  1917. else if (j4 > 125)
  1918. l4 = j4 - 125;
  1919. DrawingArea
  1920. .setDrawingArea(spriteDrawY + 5, 0, 512,
  1921. spriteDrawY
  1922. - chatTextDrawingArea.anInt1497
  1923. - 1);
  1924. chatTextDrawingArea.drawText(0, s,
  1925. spriteDrawY + 1 + l4, spriteDrawX);
  1926. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4,
  1927. spriteDrawX);
  1928. DrawingArea.defaultDrawingAreaSize();
  1929. }
  1930. } else {
  1931. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  1932. spriteDrawX);
  1933. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY,
  1934. spriteDrawX);
  1935. }
  1936. }
  1937. } catch (Exception e) {
  1938. }
  1939. }
  1940.  
  1941. public void delFriend(long l) {
  1942. try {
  1943. if (l == 0L)
  1944. return;
  1945. for (int i = 0; i < friendsCount; i++) {
  1946. if (friendsListAsLongs[i] != l)
  1947. continue;
  1948. friendsCount--;
  1949. needDrawTabArea = true;
  1950. for (int j = i; j < friendsCount; j++) {
  1951. friendsList[j] = friendsList[j + 1];
  1952. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1953. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1954. }
  1955.  
  1956. stream.createFrame(215);
  1957. stream.writeQWord(l);
  1958. break;
  1959. }
  1960. } catch (RuntimeException runtimeexception) {
  1961. signlink.reporterror("18622, " + false + ", " + l + ", "
  1962. + runtimeexception.toString());
  1963. throw new RuntimeException();
  1964. }
  1965. }
  1966.  
  1967. public void drawSideIcons() {
  1968. /* Top sideIcons */
  1969. if (tabInterfaceIDs[0] != -1)// attack
  1970. sideIcons[0].drawSprite(10, 4);
  1971. if (tabInterfaceIDs[1] != -1)// stat
  1972. sideIcons[1].drawSprite(43, 4);
  1973. if (tabInterfaceIDs[2] != -1)// quest
  1974. sideIcons[2].drawSprite(76, 3);
  1975. if (tabInterfaceIDs[3] != -1)// inventory
  1976. sideIcons[3].drawSprite(111, 5);
  1977. if (tabInterfaceIDs[4] != -1)// equipment
  1978. sideIcons[4].drawSprite(140, 1);
  1979. if (tabInterfaceIDs[5] != -1)// prayer
  1980. sideIcons[5].drawSprite(174, 1);
  1981. if (tabInterfaceIDs[6] != -1)// magic
  1982. sideIcons[6].drawSprite(208, 4);
  1983. /* Bottom sideIcons */
  1984. if (tabInterfaceIDs[7] != -1)// clan
  1985. sideIcons[7].drawSprite(11, 303);
  1986. if (tabInterfaceIDs[8] != -1)// friends
  1987. sideIcons[8].drawSprite(46, 306);
  1988. if (tabInterfaceIDs[9] != -1)// ignore
  1989. sideIcons[9].drawSprite(79, 306);
  1990. if (tabInterfaceIDs[10] != -1)// options
  1991. sideIcons[10].drawSprite(113, 300);
  1992. if (tabInterfaceIDs[11] != -1)// options
  1993. sideIcons[11].drawSprite(145, 304);
  1994. if (tabInterfaceIDs[12] != -1)// emotes
  1995. sideIcons[12].drawSprite(181, 302);
  1996. if (tabInterfaceIDs[13] != -1)// music
  1997. sideIcons[13].drawSprite(213, 303);
  1998. }
  1999.  
  2000. public void drawRedStones() {
  2001. if (tabInterfaceIDs[tabID] != -1) {
  2002. switch (tabID) {
  2003. case 0:
  2004. redStones[0].drawSprite(3, 0);
  2005. break;
  2006. case 1:
  2007. redStones[4].drawSprite(41, 0);
  2008. break;
  2009. case 2:
  2010. redStones[4].drawSprite(74, 0);
  2011. break;
  2012. case 3:
  2013. redStones[4].drawSprite(107, 0);
  2014. break;
  2015. case 4:
  2016. redStones[4].drawSprite(140, 0);
  2017. break;
  2018. case 5:
  2019. redStones[4].drawSprite(173, 0);
  2020. break;
  2021. case 6:
  2022. redStones[1].drawSprite(206, 0);
  2023. break;
  2024. case 7:
  2025. redStones[2].drawSprite(3, 298);
  2026. break;
  2027. case 8:
  2028. redStones[4].drawSprite(41, 298);
  2029. break;
  2030. case 9:
  2031. redStones[4].drawSprite(74, 298);
  2032. break;
  2033. case 10:
  2034. redStones[4].drawSprite(107, 298);
  2035. break;
  2036. case 11:
  2037. redStones[4].drawSprite(140, 298);
  2038. break;
  2039. case 12:
  2040. redStones[4].drawSprite(173, 298);
  2041. break;
  2042. case 13:
  2043. redStones[3].drawSprite(206, 298);
  2044. break;
  2045. }
  2046. }
  2047. }
  2048.  
  2049. private void drawTabArea() {
  2050. aRSImageProducer_1163.initDrawingArea();
  2051. Texture.anIntArray1472 = anIntArray1181;
  2052. tabArea.drawSprite(0, 0);
  2053. if (invOverlayInterfaceID == -1) {
  2054. drawRedStones();
  2055. drawSideIcons();
  2056. }
  2057. if (invOverlayInterfaceID != -1)
  2058. drawInterface(0, 28,
  2059. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2060. else if (tabInterfaceIDs[tabID] != -1)
  2061. drawInterface(0, 28,
  2062. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2063. if (menuOpen && menuScreenArea == 1)
  2064. drawMenu();
  2065. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2066. aRSImageProducer_1165.initDrawingArea();
  2067. Texture.anIntArray1472 = anIntArray1182;
  2068. }
  2069.  
  2070. public void method37(int j) {
  2071. if (!lowMem) {
  2072. if (Texture.anIntArray1480[17] >= j) {
  2073. Background background = Texture.aBackgroundArray1474s[17];
  2074. int k = background.anInt1452 * background.anInt1453 - 1;
  2075. int j1 = background.anInt1452 * anInt945 * 2;
  2076. byte abyte0[] = background.aByteArray1450;
  2077. byte abyte3[] = aByteArray912;
  2078. for (int i2 = 0; i2 <= k; i2++)
  2079. abyte3[i2] = abyte0[i2 - j1 & k];
  2080.  
  2081. background.aByteArray1450 = abyte3;
  2082. aByteArray912 = abyte0;
  2083. Texture.method370(17);
  2084. anInt854++;
  2085. if (anInt854 > 1235) {
  2086. anInt854 = 0;
  2087. stream.createFrame(226);
  2088. stream.writeWordBigEndian(0);
  2089. int l2 = stream.currentOffset;
  2090. stream.writeWord(58722);
  2091. stream.writeWordBigEndian(240);
  2092. stream.writeWord((int) (Math.random() * 65536D));
  2093. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2094. if ((int) (Math.random() * 2D) == 0)
  2095. stream.writeWord(51825);
  2096. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2097. stream.writeWord((int) (Math.random() * 65536D));
  2098. stream.writeWord(7130);
  2099. stream.writeWord((int) (Math.random() * 65536D));
  2100. stream.writeWord(61657);
  2101. stream.writeBytes(stream.currentOffset - l2);
  2102. }
  2103. }
  2104. if (Texture.anIntArray1480[24] >= j) {
  2105. Background background_1 = Texture.aBackgroundArray1474s[24];
  2106. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2107. int k1 = background_1.anInt1452 * anInt945 * 2;
  2108. byte abyte1[] = background_1.aByteArray1450;
  2109. byte abyte4[] = aByteArray912;
  2110. for (int j2 = 0; j2 <= l; j2++)
  2111. abyte4[j2] = abyte1[j2 - k1 & l];
  2112.  
  2113. background_1.aByteArray1450 = abyte4;
  2114. aByteArray912 = abyte1;
  2115. Texture.method370(24);
  2116. }
  2117. if (Texture.anIntArray1480[34] >= j) {
  2118. Background background_2 = Texture.aBackgroundArray1474s[34];
  2119. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2120. int l1 = background_2.anInt1452 * anInt945 * 2;
  2121. byte abyte2[] = background_2.aByteArray1450;
  2122. byte abyte5[] = aByteArray912;
  2123. for (int k2 = 0; k2 <= i1; k2++)
  2124. abyte5[k2] = abyte2[k2 - l1 & i1];
  2125.  
  2126. background_2.aByteArray1450 = abyte5;
  2127. aByteArray912 = abyte2;
  2128. Texture.method370(34);
  2129. }
  2130. if (Texture.anIntArray1480[40] >= j) {
  2131. Background background_2 = Texture.aBackgroundArray1474s[40];
  2132. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2133. int l1 = background_2.anInt1452 * anInt945 * 2;
  2134. byte abyte2[] = background_2.aByteArray1450;
  2135. byte abyte5[] = aByteArray912;
  2136. for (int k2 = 0; k2 <= i1; k2++)
  2137. abyte5[k2] = abyte2[k2 - l1 & i1];
  2138. background_2.aByteArray1450 = abyte5;
  2139. aByteArray912 = abyte2;
  2140. Texture.method370(40);
  2141. }
  2142. }
  2143. }
  2144.  
  2145. public void method38() {
  2146. for (int i = -1; i < playerCount; i++) {
  2147. int j;
  2148. if (i == -1)
  2149. j = myPlayerIndex;
  2150. else
  2151. j = playerIndices[i];
  2152. Player player = playerArray[j];
  2153. if (player != null && player.textCycle > 0) {
  2154. player.textCycle--;
  2155. if (player.textCycle == 0)
  2156. player.textSpoken = null;
  2157. }
  2158. }
  2159. for (int k = 0; k < npcCount; k++) {
  2160. int l = npcIndices[k];
  2161. NPC npc = npcArray[l];
  2162. if (npc != null && npc.textCycle > 0) {
  2163. npc.textCycle--;
  2164. if (npc.textCycle == 0)
  2165. npc.textSpoken = null;
  2166. }
  2167. }
  2168. }
  2169.  
  2170. public void calcCameraPos() {
  2171. int i = anInt1098 * 128 + 64;
  2172. int j = anInt1099 * 128 + 64;
  2173. int k = method42(plane, j, i) - anInt1100;
  2174. if (xCameraPos < i) {
  2175. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2176. if (xCameraPos > i)
  2177. xCameraPos = i;
  2178. }
  2179. if (xCameraPos > i) {
  2180. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2181. if (xCameraPos < i)
  2182. xCameraPos = i;
  2183. }
  2184. if (zCameraPos < k) {
  2185. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2186. if (zCameraPos > k)
  2187. zCameraPos = k;
  2188. }
  2189. if (zCameraPos > k) {
  2190. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2191. if (zCameraPos < k)
  2192. zCameraPos = k;
  2193. }
  2194. if (yCameraPos < j) {
  2195. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2196. if (yCameraPos > j)
  2197. yCameraPos = j;
  2198. }
  2199. if (yCameraPos > j) {
  2200. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2201. if (yCameraPos < j)
  2202. yCameraPos = j;
  2203. }
  2204. i = anInt995 * 128 + 64;
  2205. j = anInt996 * 128 + 64;
  2206. k = method42(plane, j, i) - anInt997;
  2207. int l = i - xCameraPos;
  2208. int i1 = k - zCameraPos;
  2209. int j1 = j - yCameraPos;
  2210. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2211. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2212. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2213. if (l1 < 128)
  2214. l1 = 128;
  2215. if (l1 > 383)
  2216. l1 = 383;
  2217. if (yCameraCurve < l1) {
  2218. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2219. if (yCameraCurve > l1)
  2220. yCameraCurve = l1;
  2221. }
  2222. if (yCameraCurve > l1) {
  2223. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2224. if (yCameraCurve < l1)
  2225. yCameraCurve = l1;
  2226. }
  2227. int j2 = i2 - xCameraCurve;
  2228. if (j2 > 1024)
  2229. j2 -= 2048;
  2230. if (j2 < -1024)
  2231. j2 += 2048;
  2232. if (j2 > 0) {
  2233. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2234. xCameraCurve &= 0x7ff;
  2235. }
  2236. if (j2 < 0) {
  2237. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2238. xCameraCurve &= 0x7ff;
  2239. }
  2240. int k2 = i2 - xCameraCurve;
  2241. if (k2 > 1024)
  2242. k2 -= 2048;
  2243. if (k2 < -1024)
  2244. k2 += 2048;
  2245. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2246. xCameraCurve = i2;
  2247. }
  2248.  
  2249. public void drawMenu() {
  2250. int i = menuOffsetX;
  2251. int j = menuOffsetY;
  2252. int k = menuWidth;
  2253. int l = menuHeight + 1;
  2254. int i1 = 0x5d5447;
  2255. // DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2256. // DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2257. DrawingArea.drawPixels(l, j, i, i1, k);
  2258. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2259. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2260. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2261. int j1 = super.mouseX;
  2262. int k1 = super.mouseY;
  2263. if (menuScreenArea == 0) {
  2264. j1 -= 4;
  2265. k1 -= 4;
  2266. }
  2267. if (menuScreenArea == 1) {
  2268. j1 -= 519;
  2269. k1 -= 168;
  2270. }
  2271. if (menuScreenArea == 2) {
  2272. j1 -= 17;
  2273. k1 -= 338;
  2274. }
  2275. if (menuScreenArea == 3) {
  2276. j1 -= 519;
  2277. k1 -= 0;
  2278. }
  2279. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2280. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2281. int j2 = 0xffffff;
  2282. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2283. j2 = 0xffff00;
  2284. newBoldFont.drawBasicString(menuActionName[l1], i + 3, i2, j2, 0);
  2285. }
  2286. }
  2287.  
  2288. public void addFriend(long l) {
  2289. try {
  2290. if (l == 0L)
  2291. return;
  2292. if (friendsCount >= 100 && anInt1046 != 1) {
  2293. pushMessage(
  2294. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2295. 0, "");
  2296. return;
  2297. }
  2298. if (friendsCount >= 200) {
  2299. pushMessage(
  2300. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2301. 0, "");
  2302. return;
  2303. }
  2304. String s = TextClass.fixName(TextClass.nameForLong(l));
  2305. for (int i = 0; i < friendsCount; i++)
  2306. if (friendsListAsLongs[i] == l) {
  2307. pushMessage(s + " is already on your friend list", 0, "");
  2308. return;
  2309. }
  2310. for (int j = 0; j < ignoreCount; j++)
  2311. if (ignoreListAsLongs[j] == l) {
  2312. pushMessage("Please remove " + s
  2313. + " from your ignore list first", 0, "");
  2314. return;
  2315. }
  2316.  
  2317. if (s.equals(myPlayer.name)) {
  2318. return;
  2319. } else {
  2320. friendsList[friendsCount] = s;
  2321. friendsListAsLongs[friendsCount] = l;
  2322. friendsNodeIDs[friendsCount] = 0;
  2323. friendsCount++;
  2324. needDrawTabArea = true;
  2325. stream.createFrame(188);
  2326. stream.writeQWord(l);
  2327. return;
  2328. }
  2329. } catch (RuntimeException runtimeexception) {
  2330. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  2331. + runtimeexception.toString());
  2332. }
  2333. throw new RuntimeException();
  2334. }
  2335.  
  2336. private int method42(int i, int j, int k) {
  2337. int l = k >> 7;
  2338. int i1 = j >> 7;
  2339. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2340. return 0;
  2341. int j1 = i;
  2342. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2343. j1++;
  2344. int k1 = k & 0x7f;
  2345. int l1 = j & 0x7f;
  2346. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  2347. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2348. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  2349. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2350. return i2 * (128 - l1) + j2 * l1 >> 7;
  2351. }
  2352.  
  2353. public void resetLogout() {
  2354. try {
  2355. if (socketStream != null)
  2356. socketStream.close();
  2357. } catch (Exception _ex) {
  2358. }
  2359. socketStream = null;
  2360. loggedIn = false;
  2361. loginScreenState = 0;
  2362. // myUsername = "";
  2363. // myPassword = "";
  2364. unlinkMRUNodes();
  2365. worldController.initToNull();
  2366. for (int i = 0; i < 4; i++)
  2367. aClass11Array1230[i].method210();
  2368. System.gc();
  2369. stopMidi();
  2370. currentSong = -1;
  2371. nextSong = -1;
  2372. prevSong = 0;
  2373. }
  2374.  
  2375. public void method45() {
  2376. aBoolean1031 = true;
  2377. for (int j = 0; j < 7; j++) {
  2378. anIntArray1065[j] = -1;
  2379. for (int k = 0; k < IDK.length; k++) {
  2380. if (IDK.cache[k].aBoolean662
  2381. || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2382. continue;
  2383. anIntArray1065[j] = k;
  2384. break;
  2385. }
  2386. }
  2387. }
  2388.  
  2389. public void method46(int i, Stream stream) {
  2390. while (stream.bitPosition + 21 < i * 8) {
  2391. int k = stream.readBits(14);
  2392. if (k == 16383)
  2393. break;
  2394. if (npcArray[k] == null)
  2395. npcArray[k] = new NPC();
  2396. NPC npc = npcArray[k];
  2397. npcIndices[npcCount++] = k;
  2398. npc.anInt1537 = loopCycle;
  2399. int l = stream.readBits(5);
  2400. if (l > 15)
  2401. l -= 32;
  2402. int i1 = stream.readBits(5);
  2403. if (i1 > 15)
  2404. i1 -= 32;
  2405. int j1 = stream.readBits(1);
  2406. npc.desc = EntityDef.forID(stream.readBits(14));
  2407. int k1 = stream.readBits(1);
  2408. if (k1 == 1)
  2409. anIntArray894[anInt893++] = k;
  2410. npc.anInt1540 = npc.desc.aByte68;
  2411. npc.anInt1504 = npc.desc.anInt79;
  2412. npc.anInt1554 = npc.desc.walkAnim;
  2413. npc.anInt1555 = npc.desc.anInt58;
  2414. npc.anInt1556 = npc.desc.anInt83;
  2415. npc.anInt1557 = npc.desc.anInt55;
  2416. npc.anInt1511 = npc.desc.standAnim;
  2417. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2418. }
  2419. stream.finishBitAccess();
  2420. }
  2421.  
  2422. public void processGameLoop() {
  2423. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2424. return;
  2425. loopCycle++;
  2426. if (!loggedIn)
  2427. processLoginScreenInput();
  2428. else
  2429. mainGameProcessor();
  2430. processOnDemandQueue();
  2431. }
  2432.  
  2433. public void method47(boolean flag) {
  2434. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2435. destX = 0;
  2436. int j = playerCount;
  2437. if (flag)
  2438. j = 1;
  2439. for (int l = 0; l < j; l++) {
  2440. Player player;
  2441. int i1;
  2442. if (flag) {
  2443. player = myPlayer;
  2444. i1 = myPlayerIndex << 14;
  2445. } else {
  2446. player = playerArray[playerIndices[l]];
  2447. i1 = playerIndices[l] << 14;
  2448. }
  2449. if (player == null || !player.isVisible())
  2450. continue;
  2451. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  2452. && !flag && player.anInt1517 == player.anInt1511;
  2453. int j1 = player.x >> 7;
  2454. int k1 = player.y >> 7;
  2455. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2456. continue;
  2457. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  2458. && loopCycle < player.anInt1708) {
  2459. player.aBoolean1699 = false;
  2460. player.anInt1709 = method42(plane, player.y, player.x);
  2461. worldController.method286(plane, player.y, player,
  2462. player.anInt1552, player.anInt1722, player.x,
  2463. player.anInt1709, player.anInt1719, player.anInt1721,
  2464. i1, player.anInt1720);
  2465. continue;
  2466. }
  2467. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2468. if (anIntArrayArray929[j1][k1] == anInt1265)
  2469. continue;
  2470. anIntArrayArray929[j1][k1] = anInt1265;
  2471. }
  2472. player.anInt1709 = method42(plane, player.y, player.x);
  2473. worldController.method285(plane, player.anInt1552,
  2474. player.anInt1709, i1, player.y, 60, player.x, player,
  2475. player.aBoolean1541);
  2476. }
  2477. }
  2478.  
  2479. private boolean promptUserForInput(RSInterface class9) {
  2480. int j = class9.contentType;
  2481. if (anInt900 == 2) {
  2482. if (j == 201) {
  2483. inputTaken = true;
  2484. inputDialogState = 0;
  2485. messagePromptRaised = true;
  2486. promptInput = "";
  2487. friendsListAction = 1;
  2488. aString1121 = "Enter name of friend to add to list";
  2489. }
  2490. if (j == 202) {
  2491. inputTaken = true;
  2492. inputDialogState = 0;
  2493. messagePromptRaised = true;
  2494. promptInput = "";
  2495. friendsListAction = 2;
  2496. aString1121 = "Enter name of friend to delete from list";
  2497. }
  2498. }
  2499. if (j == 205) {
  2500. anInt1011 = 250;
  2501. return true;
  2502. }
  2503. if (j == 501) {
  2504. inputTaken = true;
  2505. inputDialogState = 0;
  2506. messagePromptRaised = true;
  2507. promptInput = "";
  2508. friendsListAction = 4;
  2509. aString1121 = "Enter name of player to add to list";
  2510. }
  2511. if (j == 502) {
  2512. inputTaken = true;
  2513. inputDialogState = 0;
  2514. messagePromptRaised = true;
  2515. promptInput = "";
  2516. friendsListAction = 5;
  2517. aString1121 = "Enter name of player to delete from list";
  2518. }
  2519. if (j == 550) {
  2520. inputTaken = true;
  2521. inputDialogState = 0;
  2522. messagePromptRaised = true;
  2523. promptInput = "";
  2524. friendsListAction = 6;
  2525. aString1121 = "Enter the name of the chat you wish to join";
  2526. }
  2527. if (j >= 300 && j <= 313) {
  2528. int k = (j - 300) / 2;
  2529. int j1 = j & 1;
  2530. int i2 = anIntArray1065[k];
  2531. if (i2 != -1) {
  2532. do {
  2533. if (j1 == 0 && --i2 < 0)
  2534. i2 = IDK.length - 1;
  2535. if (j1 == 1 && ++i2 >= IDK.length)
  2536. i2 = 0;
  2537. } while (IDK.cache[i2].aBoolean662
  2538. || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2539. anIntArray1065[k] = i2;
  2540. aBoolean1031 = true;
  2541. }
  2542. }
  2543. if (j >= 314 && j <= 323) {
  2544. int l = (j - 314) / 2;
  2545. int k1 = j & 1;
  2546. int j2 = anIntArray990[l];
  2547. if (k1 == 0 && --j2 < 0)
  2548. j2 = anIntArrayArray1003[l].length - 1;
  2549. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2550. j2 = 0;
  2551. anIntArray990[l] = j2;
  2552. aBoolean1031 = true;
  2553. }
  2554. if (j == 324 && !aBoolean1047) {
  2555. aBoolean1047 = true;
  2556. method45();
  2557. }
  2558. if (j == 325 && aBoolean1047) {
  2559. aBoolean1047 = false;
  2560. method45();
  2561. }
  2562. if (j == 326) {
  2563. stream.createFrame(101);
  2564. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2565. for (int i1 = 0; i1 < 7; i1++)
  2566. stream.writeWordBigEndian(anIntArray1065[i1]);
  2567.  
  2568. for (int l1 = 0; l1 < 5; l1++)
  2569. stream.writeWordBigEndian(anIntArray990[l1]);
  2570.  
  2571. return true;
  2572. }
  2573. if (j == 613)
  2574. canMute = !canMute;
  2575. if (j >= 601 && j <= 612) {
  2576. clearTopInterfaces();
  2577. if (reportAbuseInput.length() > 0) {
  2578. stream.createFrame(218);
  2579. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2580. stream.writeWordBigEndian(j - 601);
  2581. stream.writeWordBigEndian(canMute ? 1 : 0);
  2582. }
  2583. }
  2584. return false;
  2585. }
  2586.  
  2587. public void method49(Stream stream) {
  2588. for (int j = 0; j < anInt893; j++) {
  2589. int k = anIntArray894[j];
  2590. Player player = playerArray[k];
  2591. int l = stream.readUnsignedByte();
  2592. if ((l & 0x40) != 0)
  2593. l += stream.readUnsignedByte() << 8;
  2594. method107(l, k, stream, player);
  2595. }
  2596. }
  2597.  
  2598. public void method50(int i, int k, int l, int i1, int j1) {
  2599. int k1 = worldController.method300(j1, l, i);
  2600. if (k1 != 0) {
  2601. int l1 = worldController.method304(j1, l, i, k1);
  2602. int k2 = l1 >> 6 & 3;
  2603. int i3 = l1 & 0x1f;
  2604. int k3 = k;
  2605. if (k1 > 0)
  2606. k3 = i1;
  2607. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2608. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2609. int i5 = k1 >> 14 & 0x7fff;
  2610. ObjectDef class46_2 = ObjectDef.forID(i5);
  2611. if (class46_2.anInt758 != -1) {
  2612. Background background_2 = mapScenes[class46_2.anInt758];
  2613. if (background_2 != null) {
  2614. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2615. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2616. background_2.drawBackground(48 + l * 4 + i6, 48
  2617. + (104 - i - class46_2.anInt761) * 4 + j6);
  2618. }
  2619. } else {
  2620. if (i3 == 0 || i3 == 2)
  2621. if (k2 == 0) {
  2622. ai[k4] = k3;
  2623. ai[k4 + 512] = k3;
  2624. ai[k4 + 1024] = k3;
  2625. ai[k4 + 1536] = k3;
  2626. } else if (k2 == 1) {
  2627. ai[k4] = k3;
  2628. ai[k4 + 1] = k3;
  2629. ai[k4 + 2] = k3;
  2630. ai[k4 + 3] = k3;
  2631. } else if (k2 == 2) {
  2632. ai[k4 + 3] = k3;
  2633. ai[k4 + 3 + 512] = k3;
  2634. ai[k4 + 3 + 1024] = k3;
  2635. ai[k4 + 3 + 1536] = k3;
  2636. } else if (k2 == 3) {
  2637. ai[k4 + 1536] = k3;
  2638. ai[k4 + 1536 + 1] = k3;
  2639. ai[k4 + 1536 + 2] = k3;
  2640. ai[k4 + 1536 + 3] = k3;
  2641. }
  2642. if (i3 == 3)
  2643. if (k2 == 0)
  2644. ai[k4] = k3;
  2645. else if (k2 == 1)
  2646. ai[k4 + 3] = k3;
  2647. else if (k2 == 2)
  2648. ai[k4 + 3 + 1536] = k3;
  2649. else if (k2 == 3)
  2650. ai[k4 + 1536] = k3;
  2651. if (i3 == 2)
  2652. if (k2 == 3) {
  2653. ai[k4] = k3;
  2654. ai[k4 + 512] = k3;
  2655. ai[k4 + 1024] = k3;
  2656. ai[k4 + 1536] = k3;
  2657. } else if (k2 == 0) {
  2658. ai[k4] = k3;
  2659. ai[k4 + 1] = k3;
  2660. ai[k4 + 2] = k3;
  2661. ai[k4 + 3] = k3;
  2662. } else if (k2 == 1) {
  2663. ai[k4 + 3] = k3;
  2664. ai[k4 + 3 + 512] = k3;
  2665. ai[k4 + 3 + 1024] = k3;
  2666. ai[k4 + 3 + 1536] = k3;
  2667. } else if (k2 == 2) {
  2668. ai[k4 + 1536] = k3;
  2669. ai[k4 + 1536 + 1] = k3;
  2670. ai[k4 + 1536 + 2] = k3;
  2671. ai[k4 + 1536 + 3] = k3;
  2672. }
  2673. }
  2674. }
  2675. k1 = worldController.method302(j1, l, i);
  2676. if (k1 != 0) {
  2677. int i2 = worldController.method304(j1, l, i, k1);
  2678. int l2 = i2 >> 6 & 3;
  2679. int j3 = i2 & 0x1f;
  2680. int l3 = k1 >> 14 & 0x7fff;
  2681. ObjectDef class46_1 = ObjectDef.forID(l3);
  2682. if (class46_1.anInt758 != -1) {
  2683. Background background_1 = mapScenes[class46_1.anInt758];
  2684. if (background_1 != null) {
  2685. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2686. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2687. background_1.drawBackground(48 + l * 4 + j5, 48
  2688. + (104 - i - class46_1.anInt761) * 4 + k5);
  2689. }
  2690. } else if (j3 == 9) {
  2691. int l4 = 0xeeeeee;
  2692. if (k1 > 0)
  2693. l4 = 0xee0000;
  2694. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2695. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2696. if (l2 == 0 || l2 == 2) {
  2697. ai1[l5 + 1536] = l4;
  2698. ai1[l5 + 1024 + 1] = l4;
  2699. ai1[l5 + 512 + 2] = l4;
  2700. ai1[l5 + 3] = l4;
  2701. } else {
  2702. ai1[l5] = l4;
  2703. ai1[l5 + 512 + 1] = l4;
  2704. ai1[l5 + 1024 + 2] = l4;
  2705. ai1[l5 + 1536 + 3] = l4;
  2706. }
  2707. }
  2708. }
  2709. k1 = worldController.method303(j1, l, i);
  2710. if (k1 != 0) {
  2711. int j2 = k1 >> 14 & 0x7fff;
  2712. ObjectDef class46 = ObjectDef.forID(j2);
  2713. if (class46.anInt758 != -1) {
  2714. Background background = mapScenes[class46.anInt758];
  2715. if (background != null) {
  2716. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2717. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2718. background.drawBackground(48 + l * 4 + i4, 48
  2719. + (104 - i - class46.anInt761) * 4 + j4);
  2720. }
  2721. }
  2722. }
  2723. }
  2724.  
  2725. public void loadTitleScreen() {
  2726. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2727. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2728. aBackgroundArray1152s = new Background[12];
  2729. int j = 0;
  2730. try {
  2731. j = Integer.parseInt(getParameter("fl_icon"));
  2732. } catch (Exception _ex) {
  2733. }
  2734. if (j == 0) {
  2735. for (int k = 0; k < 12; k++)
  2736. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  2737. "runes", k);
  2738.  
  2739. } else {
  2740. for (int l = 0; l < 12; l++)
  2741. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  2742. "runes", 12 + (l & 3));
  2743.  
  2744. }
  2745. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2746. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2747. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0,
  2748. aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2749.  
  2750. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0,
  2751. aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2752.  
  2753. anIntArray851 = new int[256];
  2754. for (int k1 = 0; k1 < 64; k1++)
  2755. anIntArray851[k1] = k1 * 0x40000;
  2756.  
  2757. for (int l1 = 0; l1 < 64; l1++)
  2758. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2759.  
  2760. for (int i2 = 0; i2 < 64; i2++)
  2761. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2762.  
  2763. for (int j2 = 0; j2 < 64; j2++)
  2764. anIntArray851[j2 + 192] = 0xffffff;
  2765.  
  2766. anIntArray852 = new int[256];
  2767. for (int k2 = 0; k2 < 64; k2++)
  2768. anIntArray852[k2] = k2 * 1024;
  2769.  
  2770. for (int l2 = 0; l2 < 64; l2++)
  2771. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2772.  
  2773. for (int i3 = 0; i3 < 64; i3++)
  2774. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2775.  
  2776. for (int j3 = 0; j3 < 64; j3++)
  2777. anIntArray852[j3 + 192] = 0xffffff;
  2778.  
  2779. anIntArray853 = new int[256];
  2780. for (int k3 = 0; k3 < 64; k3++)
  2781. anIntArray853[k3] = k3 * 4;
  2782.  
  2783. for (int l3 = 0; l3 < 64; l3++)
  2784. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2785.  
  2786. for (int i4 = 0; i4 < 64; i4++)
  2787. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2788.  
  2789. for (int j4 = 0; j4 < 64; j4++)
  2790. anIntArray853[j4 + 192] = 0xffffff;
  2791.  
  2792. anIntArray850 = new int[256];
  2793. anIntArray1190 = new int[32768];
  2794. anIntArray1191 = new int[32768];
  2795. randomizeBackground(null);
  2796. anIntArray828 = new int[32768];
  2797. anIntArray829 = new int[32768];
  2798. drawLoadingText(10, "Connecting to fileserver");
  2799. if (!aBoolean831) {
  2800. drawFlames = true;
  2801. aBoolean831 = true;
  2802. startRunnable(this, 2);
  2803. }
  2804. }
  2805.  
  2806. private static void setHighMem() {
  2807. WorldController.lowMem = false;
  2808. Texture.lowMem = false;
  2809. lowMem = false;
  2810. ObjectManager.lowMem = false;
  2811. ObjectDef.lowMem = false;
  2812. }
  2813.  
  2814. public static void main(String args[]) {
  2815. try {
  2816. nodeID = 10;
  2817. portOff = 0;
  2818. setHighMem();
  2819. isMembers = true;
  2820. signlink.storeid = 32;
  2821. signlink.startpriv(InetAddress.getLocalHost());
  2822. instance = new Jframe(args);
  2823. } catch (Exception exception) {
  2824. }
  2825. }
  2826.  
  2827. public static client instance;
  2828.  
  2829. public void loadingStages() {
  2830. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2831. aRSImageProducer_1165.initDrawingArea();
  2832. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151,
  2833. 257);
  2834. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.",
  2835. 150, 256);
  2836. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2837. loadingStage = 1;
  2838. aLong824 = System.currentTimeMillis();
  2839. }
  2840. if (loadingStage == 1) {
  2841. int j = method54();
  2842. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2843. signlink.reporterror(myUsername + " glcfb " + aLong1215 + ","
  2844. + j + "," + lowMem + "," + decompressors[0] + ","
  2845. + onDemandFetcher.getNodeCount() + "," + plane + ","
  2846. + anInt1069 + "," + anInt1070);
  2847. aLong824 = System.currentTimeMillis();
  2848. }
  2849. }
  2850. if (loadingStage == 2 && plane != anInt985) {
  2851. anInt985 = plane;
  2852. method24(plane);
  2853. }
  2854. }
  2855.  
  2856. private int method54() {
  2857. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  2858. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1) {
  2859. System.out.println("MapID:" + anIntArray1235[i]);
  2860. if (anIntArray1235[i] == 1510)// just a test
  2861. anIntArray1235[i] = -1;
  2862. return -1;// null map files
  2863. }
  2864. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1) {
  2865. System.out.println("LandscapeID:" + anIntArray1236[i]);
  2866. if (anIntArray1236[i] == 1511)// just a test
  2867. anIntArray1236[i] = -1;
  2868. return -2;
  2869. }
  2870. }
  2871. boolean flag = true;
  2872. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  2873. byte abyte0[] = aByteArrayArray1247[j];
  2874. if (abyte0 != null) {
  2875. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2876. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2877. if (aBoolean1159) {
  2878. k = 10;
  2879. l = 10;
  2880. }
  2881. flag &= ObjectManager.method189(k, abyte0, l);
  2882. }
  2883. }
  2884. if (!flag)
  2885. return -3;// couldn't parse all landscapes
  2886. if (aBoolean1080) {
  2887. return -4;
  2888. } else {
  2889. loadingStage = 2;
  2890. ObjectManager.anInt131 = plane;
  2891. method22();
  2892. stream.createFrame(121);
  2893. return 0;
  2894. }
  2895. }
  2896.  
  2897. public void method55() {
  2898. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  2899. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  2900. .reverseGetNext())
  2901. if (class30_sub2_sub4_sub4.anInt1597 != plane
  2902. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2903. class30_sub2_sub4_sub4.unlink();
  2904. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  2905. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  2906. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2907. if (npc != null && npc.x >= 0 && npc.x < 13312
  2908. && npc.y >= 0 && npc.y < 13312)
  2909. class30_sub2_sub4_sub4.method455(
  2910. loopCycle,
  2911. npc.y,
  2912. method42(class30_sub2_sub4_sub4.anInt1597,
  2913. npc.y, npc.x)
  2914. - class30_sub2_sub4_sub4.anInt1583,
  2915. npc.x);
  2916. }
  2917. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  2918. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2919. Player player;
  2920. if (j == unknownInt10)
  2921. player = myPlayer;
  2922. else
  2923. player = playerArray[j];
  2924. if (player != null && player.x >= 0 && player.x < 13312
  2925. && player.y >= 0 && player.y < 13312)
  2926. class30_sub2_sub4_sub4.method455(
  2927. loopCycle,
  2928. player.y,
  2929. method42(class30_sub2_sub4_sub4.anInt1597,
  2930. player.y, player.x)
  2931. - class30_sub2_sub4_sub4.anInt1583,
  2932. player.x);
  2933. }
  2934. class30_sub2_sub4_sub4.method456(anInt945);
  2935. worldController.method285(plane,
  2936. class30_sub2_sub4_sub4.anInt1595,
  2937. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  2938. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  2939. (int) class30_sub2_sub4_sub4.aDouble1585,
  2940. class30_sub2_sub4_sub4, false);
  2941. }
  2942.  
  2943. }
  2944.  
  2945. public AppletContext getAppletContext() {
  2946. if (signlink.mainapp != null)
  2947. return signlink.mainapp.getAppletContext();
  2948. else
  2949. return super.getAppletContext();
  2950. }
  2951.  
  2952. public static String capitalize(String s) {
  2953. for (int i = 0; i < s.length(); i++) {
  2954. if (i == 0) {
  2955. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)),
  2956. s.substring(1));
  2957. }
  2958. if (!Character.isLetterOrDigit(s.charAt(i))) {
  2959. if (i + 1 < s.length()) {
  2960. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  2961. Character.toUpperCase(s.charAt(i + 1)),
  2962. s.substring(i + 2));
  2963. }
  2964. }
  2965. }
  2966. return s;
  2967. }
  2968.  
  2969. private void drawLogo() {
  2970. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2971. Sprite sprite = new Sprite(abyte0, this);
  2972. aRSImageProducer_1110.initDrawingArea();
  2973. sprite.method346(0, 0);
  2974. aRSImageProducer_1111.initDrawingArea();
  2975. sprite.method346(-637, 0);
  2976. aRSImageProducer_1107.initDrawingArea();
  2977. sprite.method346(-128, 0);
  2978. aRSImageProducer_1108.initDrawingArea();
  2979. sprite.method346(-202, -371);
  2980. aRSImageProducer_1109.initDrawingArea();
  2981. sprite.method346(-202, -171);
  2982. aRSImageProducer_1112.initDrawingArea();
  2983. sprite.method346(0, -265);
  2984. aRSImageProducer_1113.initDrawingArea();
  2985. sprite.method346(-562, -265);
  2986. aRSImageProducer_1114.initDrawingArea();
  2987. sprite.method346(-128, -171);
  2988. aRSImageProducer_1115.initDrawingArea();
  2989. sprite.method346(-562, -171);
  2990. int ai[] = new int[sprite.myWidth];
  2991. for (int j = 0; j < sprite.myHeight; j++) {
  2992. for (int k = 0; k < sprite.myWidth; k++)
  2993. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1)
  2994. + sprite.myWidth * j];
  2995.  
  2996. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j,
  2997. sprite.myWidth);
  2998. }
  2999. aRSImageProducer_1110.initDrawingArea();
  3000. sprite.method346(382, 0);
  3001. aRSImageProducer_1111.initDrawingArea();
  3002. sprite.method346(-255, 0);
  3003. aRSImageProducer_1107.initDrawingArea();
  3004. sprite.method346(254, 0);
  3005. aRSImageProducer_1108.initDrawingArea();
  3006. sprite.method346(180, -371);
  3007. aRSImageProducer_1109.initDrawingArea();
  3008. sprite.method346(180, -171);
  3009. aRSImageProducer_1112.initDrawingArea();
  3010. sprite.method346(382, -265);
  3011. aRSImageProducer_1113.initDrawingArea();
  3012. sprite.method346(-180, -265);
  3013. aRSImageProducer_1114.initDrawingArea();
  3014. sprite.method346(254, -171);
  3015. aRSImageProducer_1115.initDrawingArea();
  3016. sprite.method346(-180, -171);
  3017. sprite = new Sprite(titleStreamLoader, "logo", 0);
  3018. aRSImageProducer_1107.initDrawingArea();
  3019. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3020. sprite = null;
  3021. Object obj = null;
  3022. Object obj1 = null;
  3023. System.gc();
  3024. }
  3025.  
  3026. /*
  3027. * public void drawLogo() { byte abyte0[] =
  3028. * titleStreamLoader.getDataForName("title.dat"); Sprite sprite = new
  3029. * Sprite(abyte0, this); aRSImageProducer_1110.initDrawingArea();
  3030. * sprite.method346(0, 0); aRSImageProducer_1111.initDrawingArea();
  3031. * sprite.method346(-637, 0); aRSImageProducer_1107.initDrawingArea();
  3032. * sprite.method346(-128, 0); aRSImageProducer_1108.initDrawingArea();
  3033. * sprite.method346(-202, -371); aRSImageProducer_1109.initDrawingArea();
  3034. * sprite.method346(-202, -171); aRSImageProducer_1112.initDrawingArea();
  3035. * sprite.method346(0, -265); aRSImageProducer_1113.initDrawingArea();
  3036. * sprite.method346(-562, -265); aRSImageProducer_1114.initDrawingArea();
  3037. * sprite.method346(-128, -171); aRSImageProducer_1115.initDrawingArea();
  3038. * sprite.method346(-562, -171); int ai[] = new int[sprite.myWidth]; for(int
  3039. * j = 0; j < sprite.myHeight; j++) { for(int k = 0; k < sprite.myWidth;
  3040. * k++) ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth *
  3041. * j];
  3042. *
  3043. * System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j,
  3044. * sprite.myWidth); } aRSImageProducer_1110.initDrawingArea();
  3045. * sprite.method346(382, 0); aRSImageProducer_1111.initDrawingArea();
  3046. * sprite.method346(-255, 0); aRSImageProducer_1107.initDrawingArea();
  3047. * sprite.method346(254, 0); aRSImageProducer_1108.initDrawingArea();
  3048. * sprite.method346(180, -371); aRSImageProducer_1109.initDrawingArea();
  3049. * sprite.method346(180, -171); aRSImageProducer_1112.initDrawingArea();
  3050. * sprite.method346(382, -265); aRSImageProducer_1113.initDrawingArea();
  3051. * sprite.method346(-180, -265); aRSImageProducer_1114.initDrawingArea();
  3052. * sprite.method346(254, -171); aRSImageProducer_1115.initDrawingArea();
  3053. * sprite.method346(-180, -171); sprite = new Sprite(titleStreamLoader,
  3054. * "logo", 0); aRSImageProducer_1107.initDrawingArea();
  3055. * sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18); sprite = null;
  3056. * Object obj = null; Object obj1 = null; System.gc(); }
  3057. */
  3058.  
  3059. private void processOnDemandQueue() {
  3060. do {
  3061. OnDemandData onDemandData;
  3062. do {
  3063. onDemandData = onDemandFetcher.getNextNode();
  3064. if (onDemandData == null)
  3065. return;
  3066. if (onDemandData.dataType == 0) {
  3067. Model.method460(onDemandData.buffer, onDemandData.ID);
  3068. needDrawTabArea = true;
  3069. if (backDialogID != -1)
  3070. inputTaken = true;
  3071. }
  3072. if (onDemandData.dataType == 1 && onDemandData.buffer != null)
  3073. Class36.method529(onDemandData.buffer, onDemandData.ID);
  3074. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong
  3075. && onDemandData.buffer != null)
  3076. saveMidi(songChanging, onDemandData.buffer);
  3077. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3078. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3079. if (anIntArray1235[i] == onDemandData.ID) {
  3080. System.out.println("Floor Map Loaded: "
  3081. + anIntArray1235[i]);
  3082. // aByteArrayArray1183[i] =
  3083. // FileOperations.readFile("maps/floors/" +
  3084. // anIntArray1235[i]);
  3085. if (aByteArrayArray1183[i] == null)
  3086. aByteArrayArray1183[i] = onDemandData.buffer;
  3087. if (onDemandData.buffer == null)
  3088. anIntArray1235[i] = -1;
  3089. break;
  3090. }
  3091. if (anIntArray1236[i] != onDemandData.ID)
  3092. continue;
  3093. System.out.println("Object Map Loaded: "
  3094. + anIntArray1236[i]);
  3095. // aByteArrayArray1247[i] =
  3096. // FileOperations.readFile("maps/objects/" +
  3097. // anIntArray1236[i]);
  3098. if (aByteArrayArray1247[i] == null)
  3099. aByteArrayArray1247[i] = onDemandData.buffer;
  3100. if (onDemandData.buffer == null)
  3101. anIntArray1236[i] = -1;
  3102. break;
  3103. }
  3104.  
  3105. }
  3106. } while (onDemandData.dataType != 93
  3107. || !onDemandFetcher.method564(onDemandData.ID));
  3108. ObjectManager.method173(new Stream(onDemandData.buffer),
  3109. onDemandFetcher);
  3110. } while (true);
  3111. }
  3112.  
  3113. public void calcFlamesPosition() {
  3114. char c = '\u0100';
  3115. for (int j = 10; j < 117; j++) {
  3116. int k = (int) (Math.random() * 100D);
  3117. if (k < 50)
  3118. anIntArray828[j + (c - 2 << 7)] = 255;
  3119. }
  3120. for (int l = 0; l < 100; l++) {
  3121. int i1 = (int) (Math.random() * 124D) + 2;
  3122. int k1 = (int) (Math.random() * 128D) + 128;
  3123. int k2 = i1 + (k1 << 7);
  3124. anIntArray828[k2] = 192;
  3125. }
  3126.  
  3127. for (int j1 = 1; j1 < c - 1; j1++) {
  3128. for (int l1 = 1; l1 < 127; l1++) {
  3129. int l2 = l1 + (j1 << 7);
  3130. anIntArray829[l2] = (anIntArray828[l2 - 1]
  3131. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3132. }
  3133.  
  3134. }
  3135.  
  3136. anInt1275 += 128;
  3137. if (anInt1275 > anIntArray1190.length) {
  3138. anInt1275 -= anIntArray1190.length;
  3139. int i2 = (int) (Math.random() * 12D);
  3140. randomizeBackground(aBackgroundArray1152s[i2]);
  3141. }
  3142. for (int j2 = 1; j2 < c - 1; j2++) {
  3143. for (int i3 = 1; i3 < 127; i3++) {
  3144. int k3 = i3 + (j2 << 7);
  3145. int i4 = anIntArray829[k3 + 128]
  3146. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  3147. - 1] / 5;
  3148. if (i4 < 0)
  3149. i4 = 0;
  3150. anIntArray828[k3] = i4;
  3151. }
  3152.  
  3153. }
  3154.  
  3155. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3156.  
  3157. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D
  3158. + Math.sin((double) loopCycle / 15D) * 14D + Math
  3159. .sin((double) loopCycle / 16D) * 12D);
  3160. if (anInt1040 > 0)
  3161. anInt1040 -= 4;
  3162. if (anInt1041 > 0)
  3163. anInt1041 -= 4;
  3164. if (anInt1040 == 0 && anInt1041 == 0) {
  3165. int l3 = (int) (Math.random() * 2000D);
  3166. if (l3 == 0)
  3167. anInt1040 = 1024;
  3168. if (l3 == 1)
  3169. anInt1041 = 1024;
  3170. }
  3171. }
  3172.  
  3173. private boolean saveWave(byte abyte0[], int i) {
  3174. return abyte0 == null || signlink.wavesave(abyte0, i);
  3175. }
  3176.  
  3177. public void method60(int i) {
  3178. RSInterface class9 = RSInterface.interfaceCache[i];
  3179. for (int j = 0; j < class9.children.length; j++) {
  3180. if (class9.children[j] == -1)
  3181. break;
  3182. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3183. if (class9_1.type == 1)
  3184. method60(class9_1.id);
  3185. class9_1.anInt246 = 0;
  3186. class9_1.anInt208 = 0;
  3187. }
  3188. }
  3189.  
  3190. public void drawHeadIcon() {
  3191. if (anInt855 != 2)
  3192. return;
  3193. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2,
  3194. (anInt935 - baseY << 7) + anInt938);
  3195. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  3196. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3197. }
  3198.  
  3199. private void mainGameProcessor() {
  3200. if (anInt1104 > 1)
  3201. anInt1104--;
  3202. if (anInt1011 > 0)
  3203. anInt1011--;
  3204. for (int j = 0; j < 5; j++)
  3205. if (!parsePacket())
  3206. break;
  3207.  
  3208. if (!loggedIn)
  3209. return;
  3210. synchronized (mouseDetection.syncObject) {
  3211. if (flagged) {
  3212. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3213. stream.createFrame(45);
  3214. stream.writeWordBigEndian(0);
  3215. int j2 = stream.currentOffset;
  3216. int j3 = 0;
  3217. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3218. if (j2 - stream.currentOffset >= 240)
  3219. break;
  3220. j3++;
  3221. int l4 = mouseDetection.coordsY[j4];
  3222. if (l4 < 0)
  3223. l4 = 0;
  3224. else if (l4 > 502)
  3225. l4 = 502;
  3226. int k5 = mouseDetection.coordsX[j4];
  3227. if (k5 < 0)
  3228. k5 = 0;
  3229. else if (k5 > 764)
  3230. k5 = 764;
  3231. int i6 = l4 * 765 + k5;
  3232. if (mouseDetection.coordsY[j4] == -1
  3233. && mouseDetection.coordsX[j4] == -1) {
  3234. k5 = -1;
  3235. l4 = -1;
  3236. i6 = 0x7ffff;
  3237. }
  3238. if (k5 == anInt1237 && l4 == anInt1238) {
  3239. if (anInt1022 < 2047)
  3240. anInt1022++;
  3241. } else {
  3242. int j6 = k5 - anInt1237;
  3243. anInt1237 = k5;
  3244. int k6 = l4 - anInt1238;
  3245. anInt1238 = l4;
  3246. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31
  3247. && k6 >= -32 && k6 <= 31) {
  3248. j6 += 32;
  3249. k6 += 32;
  3250. stream.writeWord((anInt1022 << 12) + (j6 << 6)
  3251. + k6);
  3252. anInt1022 = 0;
  3253. } else if (anInt1022 < 8) {
  3254. stream.writeDWordBigEndian(0x800000
  3255. + (anInt1022 << 19) + i6);
  3256. anInt1022 = 0;
  3257. } else {
  3258. stream.writeDWord(0xc0000000
  3259. + (anInt1022 << 19) + i6);
  3260. anInt1022 = 0;
  3261. }
  3262. }
  3263. }
  3264.  
  3265. stream.writeBytes(stream.currentOffset - j2);
  3266. if (j3 >= mouseDetection.coordsIndex) {
  3267. mouseDetection.coordsIndex = 0;
  3268. } else {
  3269. mouseDetection.coordsIndex -= j3;
  3270. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3271. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5
  3272. + j3];
  3273. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5
  3274. + j3];
  3275. }
  3276.  
  3277. }
  3278. }
  3279. } else {
  3280. mouseDetection.coordsIndex = 0;
  3281. }
  3282. }
  3283. if (super.clickMode3 != 0) {
  3284. long l = (super.aLong29 - aLong1220) / 50L;
  3285. if (l > 4095L)
  3286. l = 4095L;
  3287. aLong1220 = super.aLong29;
  3288. int k2 = super.saveClickY;
  3289. if (k2 < 0)
  3290. k2 = 0;
  3291. else if (k2 > 502)
  3292. k2 = 502;
  3293. int k3 = super.saveClickX;
  3294. if (k3 < 0)
  3295. k3 = 0;
  3296. else if (k3 > 764)
  3297. k3 = 764;
  3298. int k4 = k2 * 765 + k3;
  3299. int j5 = 0;
  3300. if (super.clickMode3 == 2)
  3301. j5 = 1;
  3302. int l5 = (int) l;
  3303. stream.createFrame(241);
  3304. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3305. }
  3306. if (anInt1016 > 0)
  3307. anInt1016--;
  3308. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  3309. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3310. aBoolean1017 = true;
  3311. if (aBoolean1017 && anInt1016 <= 0) {
  3312. anInt1016 = 20;
  3313. aBoolean1017 = false;
  3314. stream.createFrame(86);
  3315. stream.writeWord(anInt1184);
  3316. stream.method432(viewRotation);
  3317. }
  3318. if (super.awtFocus && !aBoolean954) {
  3319. aBoolean954 = true;
  3320. stream.createFrame(3);
  3321. stream.writeWordBigEndian(1);
  3322. }
  3323. if (!super.awtFocus && aBoolean954) {
  3324. aBoolean954 = false;
  3325. stream.createFrame(3);
  3326. stream.writeWordBigEndian(0);
  3327. }
  3328. loadingStages();
  3329. method115();
  3330. method90();
  3331. anInt1009++;
  3332. if (anInt1009 > 750)
  3333. dropClient();
  3334. method114();
  3335. method95();
  3336. method38();
  3337. anInt945++;
  3338. if (crossType != 0) {
  3339. crossIndex += 20;
  3340. if (crossIndex >= 400)
  3341. crossType = 0;
  3342. }
  3343. if (atInventoryInterfaceType != 0) {
  3344. atInventoryLoopCycle++;
  3345. if (atInventoryLoopCycle >= 15) {
  3346. if (atInventoryInterfaceType == 2)
  3347. needDrawTabArea = true;
  3348. if (atInventoryInterfaceType == 3)
  3349. inputTaken = true;
  3350. atInventoryInterfaceType = 0;
  3351. }
  3352. }
  3353. if (activeInterfaceType != 0) {
  3354. anInt989++;
  3355. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  3356. || super.mouseY > anInt1088 + 5
  3357. || super.mouseY < anInt1088 - 5)
  3358. aBoolean1242 = true;
  3359. if (super.clickMode2 == 0) {
  3360. if (activeInterfaceType == 2)
  3361. needDrawTabArea = true;
  3362. if (activeInterfaceType == 3)
  3363. inputTaken = true;
  3364. activeInterfaceType = 0;
  3365. if (aBoolean1242 && anInt989 >= 5) {
  3366. lastActiveInvInterface = -1;
  3367. processRightClick();
  3368. if (lastActiveInvInterface == anInt1084
  3369. && mouseInvInterfaceIndex != anInt1085) {
  3370. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3371. int j1 = 0;
  3372. if (anInt913 == 1 && class9.contentType == 206)
  3373. j1 = 1;
  3374. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3375. j1 = 0;
  3376. if (class9.aBoolean235) {
  3377. int l2 = anInt1085;
  3378. int l3 = mouseInvInterfaceIndex;
  3379. class9.inv[l3] = class9.inv[l2];
  3380. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3381. class9.inv[l2] = -1;
  3382. class9.invStackSizes[l2] = 0;
  3383. } else if (j1 == 1) {
  3384. int i3 = anInt1085;
  3385. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3386. if (i3 > i4) {
  3387. class9.swapInventoryItems(i3, i3 - 1);
  3388. i3--;
  3389. } else if (i3 < i4) {
  3390. class9.swapInventoryItems(i3, i3 + 1);
  3391. i3++;
  3392. }
  3393.  
  3394. } else {
  3395. class9.swapInventoryItems(anInt1085,
  3396. mouseInvInterfaceIndex);
  3397. }
  3398. stream.createFrame(214);
  3399. stream.method433(anInt1084);
  3400. stream.method424(j1);
  3401. stream.method433(anInt1085);
  3402. stream.method431(mouseInvInterfaceIndex);
  3403. }
  3404. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  3405. && menuActionRow > 2)
  3406. determineMenuSize();
  3407. else if (menuActionRow > 0)
  3408. doAction(menuActionRow - 1);
  3409. atInventoryLoopCycle = 10;
  3410. super.clickMode3 = 0;
  3411. }
  3412. }
  3413. if (WorldController.anInt470 != -1) {
  3414. int k = WorldController.anInt470;
  3415. int k1 = WorldController.anInt471;
  3416. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  3417. myPlayer.smallX[0], true, k);
  3418. WorldController.anInt470 = -1;
  3419. if (flag) {
  3420. crossX = super.saveClickX;
  3421. crossY = super.saveClickY;
  3422. crossType = 1;
  3423. crossIndex = 0;
  3424. }
  3425. }
  3426. if (super.clickMode3 == 1 && aString844 != null) {
  3427. aString844 = null;
  3428. inputTaken = true;
  3429. super.clickMode3 = 0;
  3430. }
  3431. processMenuClick();
  3432. processMainScreenClick();
  3433. processTabClick();
  3434. processChatModeClick();
  3435. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3436. anInt1213++;
  3437. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3438. if (anInt1501 < 50 && !menuOpen) {
  3439. anInt1501++;
  3440. if (anInt1501 == 50) {
  3441. if (anInt1500 != 0) {
  3442. inputTaken = true;
  3443. }
  3444. if (anInt1044 != 0) {
  3445. needDrawTabArea = true;
  3446. }
  3447. }
  3448. }
  3449. } else if (anInt1501 > 0) {
  3450. anInt1501--;
  3451. }
  3452. if (loadingStage == 2)
  3453. method108();
  3454. if (loadingStage == 2 && aBoolean1160)
  3455. calcCameraPos();
  3456. for (int i1 = 0; i1 < 5; i1++)
  3457. anIntArray1030[i1]++;
  3458.  
  3459. method73();
  3460. super.idleTime++;
  3461. if (super.idleTime > 4500)
  3462. // if(super.idleTime > 3000)
  3463. {
  3464. anInt1011 = 250;
  3465. super.idleTime -= 500;
  3466. stream.createFrame(202);
  3467. }
  3468. /*
  3469. * anInt988++; if(anInt988 > 500) { anInt988 = 0; int l1 =
  3470. * (int)(Math.random() * 8D); if((l1 & 1) == 1) anInt1278 += anInt1279;
  3471. * if((l1 & 2) == 2) anInt1131 += anInt1132; if((l1 & 4) == 4) anInt896
  3472. * += anInt897; } if(anInt1278 < -50) anInt1279 = 2; if(anInt1278 > 50)
  3473. * anInt1279 = -2; if(anInt1131 < -55) anInt1132 = 2; if(anInt1131 > 55)
  3474. * anInt1132 = -2; if(anInt896 < -40) anInt897 = 1; if(anInt896 > 40)
  3475. * anInt897 = -1; anInt1254++; if(anInt1254 > 500) { anInt1254 = 0; int
  3476. * i2 = (int)(Math.random() * 8D); if((i2 & 1) == 1) minimapInt2 +=
  3477. * anInt1210; if((i2 & 2) == 2) minimapInt3 += anInt1171; }
  3478. * if(minimapInt2 < -60) anInt1210 = 2; if(minimapInt2 > 60) anInt1210 =
  3479. * -2; if(minimapInt3 < -20) anInt1171 = 1; if(minimapInt3 > 10)
  3480. * anInt1171 = -1;
  3481. */
  3482. anInt1010++;
  3483. if (anInt1010 > 50)
  3484. stream.createFrame(0);
  3485. try {
  3486. if (socketStream != null && stream.currentOffset > 0) {
  3487. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3488. stream.currentOffset = 0;
  3489. anInt1010 = 0;
  3490. }
  3491. } catch (IOException _ex) {
  3492. dropClient();
  3493. } catch (Exception exception) {
  3494. resetLogout();
  3495. }
  3496. }
  3497.  
  3498. public void method63() {
  3499. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  3500. .reverseGetFirst();
  3501. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  3502. .reverseGetNext())
  3503. if (class30_sub1.anInt1294 == -1) {
  3504. class30_sub1.anInt1302 = 0;
  3505. method89(class30_sub1);
  3506. } else {
  3507. class30_sub1.unlink();
  3508. }
  3509.  
  3510. }
  3511.  
  3512. private void resetImageProducers() {
  3513. if (aRSImageProducer_1107 != null)
  3514. return;
  3515. super.fullGameScreen = null;
  3516. aRSImageProducer_1166 = null;
  3517. aRSImageProducer_1164 = null;
  3518. aRSImageProducer_1163 = null;
  3519. aRSImageProducer_1165 = null;
  3520. aRSImageProducer_1123 = null;
  3521. aRSImageProducer_1124 = null;
  3522. aRSImageProducer_1125 = null;
  3523. aRSImageProducer_1110 = new RSImageProducer(128, 265,
  3524. getGameComponent());
  3525. DrawingArea.setAllPixelsToZero();
  3526. aRSImageProducer_1111 = new RSImageProducer(128, 265,
  3527. getGameComponent());
  3528. DrawingArea.setAllPixelsToZero();
  3529. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  3530. getGameComponent());
  3531. DrawingArea.setAllPixelsToZero();
  3532. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  3533. getGameComponent());
  3534. DrawingArea.setAllPixelsToZero();
  3535. aRSImageProducer_1109 = new RSImageProducer(360, 200,
  3536. getGameComponent());
  3537. DrawingArea.setAllPixelsToZero();
  3538. aRSImageProducer_1112 = new RSImageProducer(202, 238,
  3539. getGameComponent());
  3540. DrawingArea.setAllPixelsToZero();
  3541. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  3542. getGameComponent());
  3543. DrawingArea.setAllPixelsToZero();
  3544. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3545. DrawingArea.setAllPixelsToZero();
  3546. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3547. DrawingArea.setAllPixelsToZero();
  3548. if (titleStreamLoader != null) {
  3549. drawLogo();
  3550. loadTitleScreen();
  3551. }
  3552. welcomeScreenRaised = true;
  3553. }
  3554.  
  3555. void drawLoadingText(int i, String s) {
  3556. anInt1079 = i;
  3557. aString1049 = s;
  3558. resetImageProducers();
  3559. if (titleStreamLoader == null) {
  3560. super.drawLoadingText(i, s);
  3561. return;
  3562. }
  3563. aRSImageProducer_1109.initDrawingArea();
  3564. char c = '\u0168';
  3565. char c1 = '\310';
  3566. byte byte1 = 20;
  3567. chatTextDrawingArea.drawText(0xffffff,
  3568. "RuneScape is loading - please wait...",
  3569. c1 / 2 - 26 - byte1, c / 2);
  3570. int j = c1 / 2 - 18 - byte1;
  3571. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3572. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3573. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3574. DrawingArea
  3575. .drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3576. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3577. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3578. if (welcomeScreenRaised) {
  3579. welcomeScreenRaised = false;
  3580. if (!aBoolean831) {
  3581. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3582. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3583. }
  3584. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3585. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3586. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3587. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3588. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3589. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3590. }
  3591. }
  3592.  
  3593. public void method65(int i, int j, int k, int l, RSInterface class9,
  3594. int i1, boolean flag, int j1) {
  3595. int anInt992;
  3596. if (aBoolean972)
  3597. anInt992 = 32;
  3598. else
  3599. anInt992 = 0;
  3600. aBoolean972 = false;
  3601. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3602. class9.scrollPosition -= anInt1213 * 4;
  3603. if (flag) {
  3604. needDrawTabArea = true;
  3605. }
  3606. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3607. class9.scrollPosition += anInt1213 * 4;
  3608. if (flag) {
  3609. needDrawTabArea = true;
  3610. }
  3611. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  3612. && l < (i1 + j) - 16 && anInt1213 > 0) {
  3613. int l1 = ((j - 32) * j) / j1;
  3614. if (l1 < 8)
  3615. l1 = 8;
  3616. int i2 = l - i1 - 16 - l1 / 2;
  3617. int j2 = j - 32 - l1;
  3618. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3619. if (flag)
  3620. needDrawTabArea = true;
  3621. aBoolean972 = true;
  3622. }
  3623. }
  3624.  
  3625. private boolean method66(int i, int j, int k) {
  3626. int i1 = i >> 14 & 0x7fff;
  3627. int j1 = worldController.method304(plane, k, j, i);
  3628. if (j1 == -1)
  3629. return false;
  3630. int k1 = j1 & 0x1f;
  3631. int l1 = j1 >> 6 & 3;
  3632. if (k1 == 10 || k1 == 11 || k1 == 22) {
  3633. ObjectDef class46 = ObjectDef.forID(i1);
  3634. int i2;
  3635. int j2;
  3636. if (l1 == 0 || l1 == 2) {
  3637. i2 = class46.anInt744;
  3638. j2 = class46.anInt761;
  3639. } else {
  3640. i2 = class46.anInt761;
  3641. j2 = class46.anInt744;
  3642. }
  3643. int k2 = class46.anInt768;
  3644. if (l1 != 0)
  3645. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3646. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j,
  3647. myPlayer.smallX[0], false, k);
  3648. } else {
  3649. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j,
  3650. myPlayer.smallX[0], false, k);
  3651. }
  3652. crossX = super.saveClickX;
  3653. crossY = super.saveClickY;
  3654. crossType = 2;
  3655. crossIndex = 0;
  3656. return true;
  3657. }
  3658.  
  3659. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  3660. int k) {
  3661. byte abyte0[] = null;
  3662. int l = 5;
  3663. try {
  3664. if (decompressors[0] != null)
  3665. abyte0 = decompressors[0].decompress(i);
  3666. } catch (Exception _ex) {
  3667. }
  3668. if (abyte0 != null) {
  3669. // aCRC32_930.reset();
  3670. // aCRC32_930.update(abyte0);
  3671. // int i1 = (int)aCRC32_930.getValue();
  3672. // if(i1 != j)
  3673. }
  3674. if (abyte0 != null) {
  3675. StreamLoader streamLoader = new StreamLoader(abyte0, s);
  3676. return streamLoader;
  3677. }
  3678. int j1 = 0;
  3679. while (abyte0 == null) {
  3680. String s2 = "Unknown error";
  3681. drawLoadingText(k, "Requesting " + s);
  3682. Object obj = null;
  3683. try {
  3684. int k1 = 0;
  3685. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3686. byte abyte1[] = new byte[6];
  3687. datainputstream.readFully(abyte1, 0, 6);
  3688. Stream stream = new Stream(abyte1);
  3689. stream.currentOffset = 3;
  3690. int i2 = stream.read3Bytes() + 6;
  3691. int j2 = 6;
  3692. abyte0 = new byte[i2];
  3693. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3694.  
  3695. while (j2 < i2) {
  3696. int l2 = i2 - j2;
  3697. if (l2 > 1000)
  3698. l2 = 1000;
  3699. int j3 = datainputstream.read(abyte0, j2, l2);
  3700. if (j3 < 0) {
  3701. s2 = "Length error: " + j2 + "/" + i2;
  3702. throw new IOException("EOF");
  3703. }
  3704. j2 += j3;
  3705. int k3 = (j2 * 100) / i2;
  3706. if (k3 != k1)
  3707. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3708. k1 = k3;
  3709. }
  3710. datainputstream.close();
  3711. try {
  3712. if (decompressors[0] != null)
  3713. decompressors[0].method234(abyte0.length, abyte0, i);
  3714. } catch (Exception _ex) {
  3715. decompressors[0] = null;
  3716. }
  3717. /*
  3718. * if(abyte0 != null) { aCRC32_930.reset();
  3719. * aCRC32_930.update(abyte0); int i3 =
  3720. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  3721. * j1++; s2 = "Checksum error: " + i3; } }
  3722. */
  3723. } catch (IOException ioexception) {
  3724. if (s2.equals("Unknown error"))
  3725. s2 = "Connection error";
  3726. abyte0 = null;
  3727. } catch (NullPointerException _ex) {
  3728. s2 = "Null error";
  3729. abyte0 = null;
  3730. if (!signlink.reporterror)
  3731. return null;
  3732. } catch (ArrayIndexOutOfBoundsException _ex) {
  3733. s2 = "Bounds error";
  3734. abyte0 = null;
  3735. if (!signlink.reporterror)
  3736. return null;
  3737. } catch (Exception _ex) {
  3738. s2 = "Unexpected error";
  3739. abyte0 = null;
  3740. if (!signlink.reporterror)
  3741. return null;
  3742. }
  3743. if (abyte0 == null) {
  3744. for (int l1 = l; l1 > 0; l1--) {
  3745. if (j1 >= 3) {
  3746. drawLoadingText(k, "Game updated - please reload page");
  3747. l1 = 10;
  3748. } else {
  3749. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3750. }
  3751. try {
  3752. Thread.sleep(1000L);
  3753. } catch (Exception _ex) {
  3754. }
  3755. }
  3756.  
  3757. l *= 2;
  3758. if (l > 60)
  3759. l = 60;
  3760. aBoolean872 = !aBoolean872;
  3761. }
  3762.  
  3763. }
  3764.  
  3765. StreamLoader streamLoader_1 = new StreamLoader(abyte0, s);
  3766. return streamLoader_1;
  3767. }
  3768.  
  3769. public void dropClient() {
  3770. if (anInt1011 > 0) {
  3771. resetLogout();
  3772. return;
  3773. }
  3774. aRSImageProducer_1165.initDrawingArea();
  3775. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2);
  3776. DrawingArea.drawPixels(37, 3, 3, 0, 227);
  3777. aTextDrawingArea_1271.drawText(0, "Connection Lost", 19, 120);
  3778. aTextDrawingArea_1271.drawText(0xffffff, "Connection Lost", 18, 119);
  3779. aTextDrawingArea_1271
  3780. .drawText(0, "Please Wait - Reconnecting", 34, 117);
  3781. aTextDrawingArea_1271.drawText(0xffffff, "Please Wait - Reconnecting",
  3782. 34, 116);
  3783. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3784. anInt1021 = 0;
  3785. destX = 0;
  3786. RSSocket rsSocket = socketStream;
  3787. loggedIn = false;
  3788. loginFailures = 0;
  3789. login(myUsername, myPassword, true);
  3790. if (!loggedIn)
  3791. resetLogout();
  3792. try {
  3793. rsSocket.close();
  3794. } catch (Exception _ex) {
  3795. }
  3796. }
  3797.  
  3798. private void doAction(int i) {
  3799. if (i < 0)
  3800. return;
  3801. if (inputDialogState != 0) {
  3802. inputDialogState = 0;
  3803. inputTaken = true;
  3804. }
  3805. int j = menuActionCmd2[i];
  3806. int k = menuActionCmd3[i];
  3807. int l = menuActionID[i];
  3808. int i1 = menuActionCmd1[i];
  3809. if (l >= 2000)
  3810. l -= 2000;
  3811. if (l == 582) {
  3812. NPC npc = npcArray[i1];
  3813. if (npc != null) {
  3814. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  3815. myPlayer.smallX[0], false, npc.smallX[0]);
  3816. crossX = super.saveClickX;
  3817. crossY = super.saveClickY;
  3818. crossType = 2;
  3819. crossIndex = 0;
  3820. stream.createFrame(57);
  3821. stream.method432(anInt1285);
  3822. stream.method432(i1);
  3823. stream.method431(anInt1283);
  3824. stream.method432(anInt1284);
  3825. }
  3826. }
  3827. if (l == 234) {
  3828. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  3829. myPlayer.smallX[0], false, j);
  3830. if (!flag1)
  3831. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  3832. myPlayer.smallX[0], false, j);
  3833. crossX = super.saveClickX;
  3834. crossY = super.saveClickY;
  3835. crossType = 2;
  3836. crossIndex = 0;
  3837. stream.createFrame(236);
  3838. stream.method431(k + baseY);
  3839. stream.writeWord(i1);
  3840. stream.method431(j + baseX);
  3841. }
  3842. if (l == 62 && method66(i1, k, j)) {
  3843. stream.createFrame(192);
  3844. stream.writeWord(anInt1284);
  3845. stream.method431(i1 >> 14 & 0x7fff);
  3846. stream.method433(k + baseY);
  3847. stream.method431(anInt1283);
  3848. stream.method433(j + baseX);
  3849. stream.writeWord(anInt1285);
  3850. }
  3851.  
  3852. if (l == 511) {
  3853. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  3854. myPlayer.smallX[0], false, j);
  3855. if (!flag2)
  3856. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  3857. myPlayer.smallX[0], false, j);
  3858. crossX = super.saveClickX;
  3859. crossY = super.saveClickY;
  3860. crossType = 2;
  3861. crossIndex = 0;
  3862. stream.createFrame(25);
  3863. stream.method431(anInt1284);
  3864. stream.method432(anInt1285);
  3865. stream.writeWord(i1);
  3866. stream.method432(k + baseY);
  3867. stream.method433(anInt1283);
  3868. stream.writeWord(j + baseX);
  3869. }
  3870. if (l == 74) {
  3871. stream.createFrame(122);
  3872. stream.method433(k);
  3873. stream.method432(j);
  3874. stream.method431(i1);
  3875. atInventoryLoopCycle = 0;
  3876. atInventoryInterface = k;
  3877. atInventoryIndex = j;
  3878. atInventoryInterfaceType = 2;
  3879. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3880. atInventoryInterfaceType = 1;
  3881. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3882. atInventoryInterfaceType = 3;
  3883. }
  3884. if (l == 315) {
  3885. RSInterface class9 = RSInterface.interfaceCache[k];
  3886. boolean flag8 = true;
  3887. if (class9.contentType > 0)
  3888. flag8 = promptUserForInput(class9);
  3889. if (flag8) {
  3890.  
  3891. switch (k) {
  3892. case 19144:
  3893. sendFrame248(15106, 3213);
  3894. method60(15106);
  3895. inputTaken = true;
  3896. break;
  3897. default:
  3898. stream.createFrame(185);
  3899. stream.writeWord(k);
  3900. break;
  3901.  
  3902. }
  3903. }
  3904. }
  3905. if (l == 561) {
  3906. Player player = playerArray[i1];
  3907. if (player != null) {
  3908. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  3909. player.smallY[0], myPlayer.smallX[0], false,
  3910. player.smallX[0]);
  3911. crossX = super.saveClickX;
  3912. crossY = super.saveClickY;
  3913. crossType = 2;
  3914. crossIndex = 0;
  3915. anInt1188 += i1;
  3916. if (anInt1188 >= 90) {
  3917. stream.createFrame(136);
  3918. anInt1188 = 0;
  3919. }
  3920. stream.createFrame(128);
  3921. stream.writeWord(i1);
  3922. }
  3923. }
  3924. if (l == 20) {
  3925. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3926. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  3927. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  3928. class30_sub2_sub4_sub1_sub1_1.smallY[0],
  3929. myPlayer.smallX[0], false,
  3930. class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  3931. crossX = super.saveClickX;
  3932. crossY = super.saveClickY;
  3933. crossType = 2;
  3934. crossIndex = 0;
  3935. stream.createFrame(155);
  3936. stream.method431(i1);
  3937. }
  3938. }
  3939. if (l == 779) {
  3940. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3941. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  3942. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  3943. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  3944. myPlayer.smallX[0], false,
  3945. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  3946. crossX = super.saveClickX;
  3947. crossY = super.saveClickY;
  3948. crossType = 2;
  3949. crossIndex = 0;
  3950. stream.createFrame(153);
  3951. stream.method431(i1);
  3952. }
  3953. }
  3954. if (l == 516)
  3955. if (!menuOpen)
  3956. worldController.method312(super.saveClickY - 4,
  3957. super.saveClickX - 4);
  3958. else
  3959. worldController.method312(k - 4, j - 4);
  3960. if (l == 1062) {
  3961. anInt924 += baseX;
  3962. if (anInt924 >= 113) {
  3963. stream.createFrame(183);
  3964. stream.writeDWordBigEndian(0xe63271);
  3965. anInt924 = 0;
  3966. }
  3967. method66(i1, k, j);
  3968. stream.createFrame(228);
  3969. stream.method432(i1 >> 14 & 0x7fff);
  3970. stream.method432(k + baseY);
  3971. stream.writeWord(j + baseX);
  3972. }
  3973. if (l == 679 && !aBoolean1149) {
  3974. stream.createFrame(40);
  3975. stream.writeWord(k);
  3976. aBoolean1149 = true;
  3977. }
  3978. if (l == 431) {
  3979. stream.createFrame(129);
  3980. stream.method432(j);
  3981. stream.writeWord(k);
  3982. stream.method432(i1);
  3983. atInventoryLoopCycle = 0;
  3984. atInventoryInterface = k;
  3985. atInventoryIndex = j;
  3986. atInventoryInterfaceType = 2;
  3987. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3988. atInventoryInterfaceType = 1;
  3989. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3990. atInventoryInterfaceType = 3;
  3991. }
  3992. if (l == 337 || l == 42 || l == 792 || l == 322) {
  3993. String s = menuActionName[i];
  3994. int k1 = s.indexOf("@whi@");
  3995. if (k1 != -1) {
  3996. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3997. if (l == 337)
  3998. addFriend(l3);
  3999. if (l == 42)
  4000. addIgnore(l3);
  4001. if (l == 792)
  4002. delFriend(l3);
  4003. if (l == 322)
  4004. delIgnore(l3);
  4005. }
  4006. }
  4007. if (l == 53) {
  4008. stream.createFrame(135);
  4009. stream.method431(j);
  4010. stream.method432(k);
  4011. stream.method431(i1);
  4012. atInventoryLoopCycle = 0;
  4013. atInventoryInterface = k;
  4014. atInventoryIndex = j;
  4015. atInventoryInterfaceType = 2;
  4016. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4017. atInventoryInterfaceType = 1;
  4018. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4019. atInventoryInterfaceType = 3;
  4020. }
  4021. if (l == 539) {
  4022. stream.createFrame(16);
  4023. stream.method432(i1);
  4024. stream.method433(j);
  4025. stream.method433(k);
  4026. atInventoryLoopCycle = 0;
  4027. atInventoryInterface = k;
  4028. atInventoryIndex = j;
  4029. atInventoryInterfaceType = 2;
  4030. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4031. atInventoryInterfaceType = 1;
  4032. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4033. atInventoryInterfaceType = 3;
  4034. }
  4035. if (l == 484 || l == 6) {
  4036. String s1 = menuActionName[i];
  4037. int l1 = s1.indexOf("@whi@");
  4038. if (l1 != -1) {
  4039. s1 = s1.substring(l1 + 5).trim();
  4040. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass
  4041. .longForName(s1)));
  4042. boolean flag9 = false;
  4043. for (int j3 = 0; j3 < playerCount; j3++) {
  4044. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4045. if (class30_sub2_sub4_sub1_sub2_7 == null
  4046. || class30_sub2_sub4_sub1_sub2_7.name == null
  4047. || !class30_sub2_sub4_sub1_sub2_7.name
  4048. .equalsIgnoreCase(s7))
  4049. continue;
  4050. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4051. class30_sub2_sub4_sub1_sub2_7.smallY[0],
  4052. myPlayer.smallX[0], false,
  4053. class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  4054. if (l == 484) {
  4055. stream.createFrame(39);
  4056. stream.method431(playerIndices[j3]);
  4057. }
  4058. if (l == 6) {
  4059. anInt1188 += i1;
  4060. if (anInt1188 >= 90) {
  4061. stream.createFrame(136);
  4062. anInt1188 = 0;
  4063. }
  4064. stream.createFrame(128);
  4065. stream.writeWord(playerIndices[j3]);
  4066. }
  4067. flag9 = true;
  4068. break;
  4069. }
  4070.  
  4071. if (!flag9)
  4072. pushMessage("Unable to find " + s7, 0, "");
  4073. }
  4074. }
  4075. if (l == 870) {
  4076. stream.createFrame(53);
  4077. stream.writeWord(j);
  4078. stream.method432(anInt1283);
  4079. stream.method433(i1);
  4080. stream.writeWord(anInt1284);
  4081. stream.method431(anInt1285);
  4082. stream.writeWord(k);
  4083. atInventoryLoopCycle = 0;
  4084. atInventoryInterface = k;
  4085. atInventoryIndex = j;
  4086. atInventoryInterfaceType = 2;
  4087. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4088. atInventoryInterfaceType = 1;
  4089. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4090. atInventoryInterfaceType = 3;
  4091. }
  4092. if (l == 847) {
  4093. stream.createFrame(87);
  4094. stream.method432(i1);
  4095. stream.writeWord(k);
  4096. stream.method432(j);
  4097. atInventoryLoopCycle = 0;
  4098. atInventoryInterface = k;
  4099. atInventoryIndex = j;
  4100. atInventoryInterfaceType = 2;
  4101. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4102. atInventoryInterfaceType = 1;
  4103. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4104. atInventoryInterfaceType = 3;
  4105. }
  4106. if (l == 626) {
  4107. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4108. spellSelected = 1;
  4109. spellID = class9_1.id;
  4110. anInt1137 = k;
  4111. spellUsableOn = class9_1.spellUsableOn;
  4112. itemSelected = 0;
  4113. needDrawTabArea = true;
  4114. spellID = class9_1.id;
  4115. String s4 = class9_1.selectedActionName;
  4116. if (s4.indexOf(" ") != -1)
  4117. s4 = s4.substring(0, s4.indexOf(" "));
  4118. String s8 = class9_1.selectedActionName;
  4119. if (s8.indexOf(" ") != -1)
  4120. s8 = s8.substring(s8.indexOf(" ") + 1);
  4121. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4122. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4123. // 0xffffff);
  4124. // class9_1.sprite1.drawSprite(200,200);
  4125. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4126. if (spellUsableOn == 16) {
  4127. needDrawTabArea = true;
  4128. tabID = 3;
  4129. tabAreaAltered = true;
  4130. }
  4131. return;
  4132. }
  4133. if (l == 78) {
  4134. stream.createFrame(117);
  4135. stream.method433(k);
  4136. stream.method433(i1);
  4137. stream.method431(j);
  4138. atInventoryLoopCycle = 0;
  4139. atInventoryInterface = k;
  4140. atInventoryIndex = j;
  4141. atInventoryInterfaceType = 2;
  4142. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4143. atInventoryInterfaceType = 1;
  4144. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4145. atInventoryInterfaceType = 3;
  4146. }
  4147. if (l == 27) {
  4148. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4149. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4150. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4151. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  4152. myPlayer.smallX[0], false,
  4153. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4154. crossX = super.saveClickX;
  4155. crossY = super.saveClickY;
  4156. crossType = 2;
  4157. crossIndex = 0;
  4158. anInt986 += i1;
  4159. if (anInt986 >= 54) {
  4160. stream.createFrame(189);
  4161. stream.writeWordBigEndian(234);
  4162. anInt986 = 0;
  4163. }
  4164. stream.createFrame(73);
  4165. stream.method431(i1);
  4166. }
  4167. }
  4168. if (l == 213) {
  4169. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4170. myPlayer.smallX[0], false, j);
  4171. if (!flag3)
  4172. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4173. myPlayer.smallX[0], false, j);
  4174. crossX = super.saveClickX;
  4175. crossY = super.saveClickY;
  4176. crossType = 2;
  4177. crossIndex = 0;
  4178. stream.createFrame(79);
  4179. stream.method431(k + baseY);
  4180. stream.writeWord(i1);
  4181. stream.method432(j + baseX);
  4182. }
  4183. if (l == 632) {
  4184. stream.createFrame(145);
  4185. stream.method432(k);
  4186. stream.method432(j);
  4187. stream.method432(i1);
  4188. atInventoryLoopCycle = 0;
  4189. atInventoryInterface = k;
  4190. atInventoryIndex = j;
  4191. atInventoryInterfaceType = 2;
  4192. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4193. atInventoryInterfaceType = 1;
  4194. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4195. atInventoryInterfaceType = 3;
  4196. }
  4197. if (l == 1004) {
  4198. if (tabInterfaceIDs[10] != -1) {
  4199. needDrawTabArea = true;
  4200. tabID = 10;
  4201. tabAreaAltered = true;
  4202. }
  4203. }
  4204. if (l == 1003) {
  4205. clanChatMode = 2;
  4206. inputTaken = true;
  4207. }
  4208. if (l == 1002) {
  4209. clanChatMode = 1;
  4210. inputTaken = true;
  4211. }
  4212. if (l == 1001) {
  4213. clanChatMode = 0;
  4214. inputTaken = true;
  4215. }
  4216. if (l == 1000) {
  4217. cButtonCPos = 4;
  4218. chatTypeView = 11;
  4219. inputTaken = true;
  4220. }
  4221. if (l == 999) {
  4222. cButtonCPos = 0;
  4223. chatTypeView = 0;
  4224. inputTaken = true;
  4225. }
  4226. if (l == 998) {
  4227. cButtonCPos = 1;
  4228. chatTypeView = 5;
  4229. inputTaken = true;
  4230. }
  4231. if (l == 997) {
  4232. publicChatMode = 3;
  4233. inputTaken = true;
  4234. }
  4235. if (l == 996) {
  4236. publicChatMode = 2;
  4237. inputTaken = true;
  4238. }
  4239. if (l == 995) {
  4240. publicChatMode = 1;
  4241. inputTaken = true;
  4242. }
  4243. if (l == 994) {
  4244. publicChatMode = 0;
  4245. inputTaken = true;
  4246. }
  4247. if (l == 993) {
  4248. cButtonCPos = 2;
  4249. chatTypeView = 1;
  4250. inputTaken = true;
  4251. }
  4252. if (l == 992) {
  4253. privateChatMode = 2;
  4254. inputTaken = true;
  4255. }
  4256. if (l == 991) {
  4257. privateChatMode = 1;
  4258. inputTaken = true;
  4259. }
  4260. if (l == 990) {
  4261. privateChatMode = 0;
  4262. inputTaken = true;
  4263. }
  4264. if (l == 989) {
  4265. cButtonCPos = 3;
  4266. chatTypeView = 2;
  4267. inputTaken = true;
  4268. }
  4269. if (l == 987) {
  4270. tradeMode = 2;
  4271. inputTaken = true;
  4272. }
  4273. if (l == 986) {
  4274. tradeMode = 1;
  4275. inputTaken = true;
  4276. }
  4277. if (l == 985) {
  4278. tradeMode = 0;
  4279. inputTaken = true;
  4280. }
  4281. if (l == 984) {
  4282. cButtonCPos = 5;
  4283. chatTypeView = 3;
  4284. inputTaken = true;
  4285. }
  4286. if (l == 983) {
  4287. duelMode = 2;
  4288. inputTaken = true;
  4289. }
  4290. if (l == 982) {
  4291. duelMode = 1;
  4292. inputTaken = true;
  4293. }
  4294. if (l == 981) {
  4295. duelMode = 0;
  4296. inputTaken = true;
  4297. }
  4298. if (l == 980) {
  4299. cButtonCPos = 6;
  4300. chatTypeView = 4;
  4301. inputTaken = true;
  4302. }
  4303. if (l == 493) {
  4304. stream.createFrame(75);
  4305. stream.method433(k);
  4306. stream.method431(j);
  4307. stream.method432(i1);
  4308. atInventoryLoopCycle = 0;
  4309. atInventoryInterface = k;
  4310. atInventoryIndex = j;
  4311. atInventoryInterfaceType = 2;
  4312. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4313. atInventoryInterfaceType = 1;
  4314. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4315. atInventoryInterfaceType = 3;
  4316. }
  4317. if (l == 652) {
  4318. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4319. myPlayer.smallX[0], false, j);
  4320. if (!flag4)
  4321. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4322. myPlayer.smallX[0], false, j);
  4323. crossX = super.saveClickX;
  4324. crossY = super.saveClickY;
  4325. crossType = 2;
  4326. crossIndex = 0;
  4327. stream.createFrame(156);
  4328. stream.method432(j + baseX);
  4329. stream.method431(k + baseY);
  4330. stream.method433(i1);
  4331. }
  4332. if (l == 94) {
  4333. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4334. myPlayer.smallX[0], false, j);
  4335. if (!flag5)
  4336. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4337. myPlayer.smallX[0], false, j);
  4338. crossX = super.saveClickX;
  4339. crossY = super.saveClickY;
  4340. crossType = 2;
  4341. crossIndex = 0;
  4342. stream.createFrame(181);
  4343. stream.method431(k + baseY);
  4344. stream.writeWord(i1);
  4345. stream.method431(j + baseX);
  4346. stream.method432(anInt1137);
  4347. }
  4348. if (l == 646) {
  4349. stream.createFrame(185);
  4350. stream.writeWord(k);
  4351. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4352. if (class9_2.valueIndexArray != null
  4353. && class9_2.valueIndexArray[0][0] == 5) {
  4354. int i2 = class9_2.valueIndexArray[0][1];
  4355. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  4356. variousSettings[i2] = class9_2.anIntArray212[0];
  4357. method33(i2);
  4358. needDrawTabArea = true;
  4359. }
  4360. }
  4361. }
  4362. if (l == 225) {
  4363. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4364. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4365. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4366. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  4367. myPlayer.smallX[0], false,
  4368. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4369. crossX = super.saveClickX;
  4370. crossY = super.saveClickY;
  4371. crossType = 2;
  4372. crossIndex = 0;
  4373. anInt1226 += i1;
  4374. if (anInt1226 >= 85) {
  4375. stream.createFrame(230);
  4376. stream.writeWordBigEndian(239);
  4377. anInt1226 = 0;
  4378. }
  4379. stream.createFrame(17);
  4380. stream.method433(i1);
  4381. }
  4382. }
  4383. if (l == 965) {
  4384. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4385. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4386. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4387. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  4388. myPlayer.smallX[0], false,
  4389. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4390. crossX = super.saveClickX;
  4391. crossY = super.saveClickY;
  4392. crossType = 2;
  4393. crossIndex = 0;
  4394. anInt1134++;
  4395. if (anInt1134 >= 96) {
  4396. stream.createFrame(152);
  4397. stream.writeWordBigEndian(88);
  4398. anInt1134 = 0;
  4399. }
  4400. stream.createFrame(21);
  4401. stream.writeWord(i1);
  4402. }
  4403. }
  4404. if (l == 413) {
  4405. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4406. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4407. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4408. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  4409. myPlayer.smallX[0], false,
  4410. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4411. crossX = super.saveClickX;
  4412. crossY = super.saveClickY;
  4413. crossType = 2;
  4414. crossIndex = 0;
  4415. stream.createFrame(131);
  4416. stream.method433(i1);
  4417. stream.method432(anInt1137);
  4418. }
  4419. }
  4420. if (l == 200)
  4421. clearTopInterfaces();
  4422. if (l == 1025) {
  4423. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4424. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4425. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4426. if (entityDef.childrenIDs != null)
  4427. entityDef = entityDef.method161();
  4428. if (entityDef != null) {
  4429. String s9;
  4430. if (entityDef.description != null)
  4431. s9 = new String(entityDef.description);
  4432. else
  4433. s9 = "It's a " + entityDef.name + ".";
  4434. pushMessage(s9, 0, "");
  4435. }
  4436. }
  4437. }
  4438. if (l == 900) {
  4439. method66(i1, k, j);
  4440. stream.createFrame(252);
  4441. stream.method433(i1 >> 14 & 0x7fff);
  4442. stream.method431(k + baseY);
  4443. stream.method432(j + baseX);
  4444. }
  4445. if (l == 412) {
  4446. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4447. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4448. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4449. class30_sub2_sub4_sub1_sub1_6.smallY[0],
  4450. myPlayer.smallX[0], false,
  4451. class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  4452. crossX = super.saveClickX;
  4453. crossY = super.saveClickY;
  4454. crossType = 2;
  4455. crossIndex = 0;
  4456. stream.createFrame(72);
  4457. stream.method432(i1);
  4458. }
  4459. }
  4460. if (l == 365) {
  4461. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4462. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4463. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4464. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  4465. myPlayer.smallX[0], false,
  4466. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4467. crossX = super.saveClickX;
  4468. crossY = super.saveClickY;
  4469. crossType = 2;
  4470. crossIndex = 0;
  4471. stream.createFrame(249);
  4472. stream.method432(i1);
  4473. stream.method431(anInt1137);
  4474. }
  4475. }
  4476. if (l == 729) {
  4477. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4478. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4479. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4480. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  4481. myPlayer.smallX[0], false,
  4482. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4483. crossX = super.saveClickX;
  4484. crossY = super.saveClickY;
  4485. crossType = 2;
  4486. crossIndex = 0;
  4487. stream.createFrame(39);
  4488. stream.method431(i1);
  4489. }
  4490. }
  4491. if (l == 577) {
  4492. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4493. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4494. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4495. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  4496. myPlayer.smallX[0], false,
  4497. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4498. crossX = super.saveClickX;
  4499. crossY = super.saveClickY;
  4500. crossType = 2;
  4501. crossIndex = 0;
  4502. stream.createFrame(139);
  4503. stream.method431(i1);
  4504. }
  4505. }
  4506. if (l == 956 && method66(i1, k, j)) {
  4507. stream.createFrame(35);
  4508. stream.method431(j + baseX);
  4509. stream.method432(anInt1137);
  4510. stream.method432(k + baseY);
  4511. stream.method431(i1 >> 14 & 0x7fff);
  4512. }
  4513. if (l == 567) {
  4514. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4515. myPlayer.smallX[0], false, j);
  4516. if (!flag6)
  4517. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4518. myPlayer.smallX[0], false, j);
  4519. crossX = super.saveClickX;
  4520. crossY = super.saveClickY;
  4521. crossType = 2;
  4522. crossIndex = 0;
  4523. stream.createFrame(23);
  4524. stream.method431(k + baseY);
  4525. stream.method431(i1);
  4526. stream.method431(j + baseX);
  4527. }
  4528. if (l == 867) {
  4529. if ((i1 & 3) == 0)
  4530. anInt1175++;
  4531. if (anInt1175 >= 59) {
  4532. stream.createFrame(200);
  4533. stream.createFrame(201);
  4534. stream.writeWord(25501);
  4535. anInt1175 = 0;
  4536. }
  4537. stream.createFrame(43);
  4538. stream.method431(k);
  4539. stream.method432(i1);
  4540. stream.method432(j);
  4541. atInventoryLoopCycle = 0;
  4542. atInventoryInterface = k;
  4543. atInventoryIndex = j;
  4544. atInventoryInterfaceType = 2;
  4545. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4546. atInventoryInterfaceType = 1;
  4547. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4548. atInventoryInterfaceType = 3;
  4549. }
  4550. if (l == 543) {
  4551. stream.createFrame(237);
  4552. stream.writeWord(j);
  4553. stream.method432(i1);
  4554. stream.writeWord(k);
  4555. stream.method432(anInt1137);
  4556. atInventoryLoopCycle = 0;
  4557. atInventoryInterface = k;
  4558. atInventoryIndex = j;
  4559. atInventoryInterfaceType = 2;
  4560. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4561. atInventoryInterfaceType = 1;
  4562. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4563. atInventoryInterfaceType = 3;
  4564. }
  4565. if (l == 606) {
  4566. String s2 = menuActionName[i];
  4567. int j2 = s2.indexOf("@whi@");
  4568. if (j2 != -1)
  4569. if (openInterfaceID == -1) {
  4570. clearTopInterfaces();
  4571. reportAbuseInput = s2.substring(j2 + 5).trim();
  4572. canMute = false;
  4573. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  4574. if (RSInterface.interfaceCache[i3] == null
  4575. || RSInterface.interfaceCache[i3].contentType != 600)
  4576. continue;
  4577. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4578. break;
  4579. }
  4580.  
  4581. } else {
  4582. pushMessage(
  4583. "Please close the interface you have open before using 'report abuse'",
  4584. 0, "");
  4585. }
  4586. }
  4587. if (l == 491) {
  4588. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4589. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  4590. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4591. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  4592. myPlayer.smallX[0], false,
  4593. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  4594. crossX = super.saveClickX;
  4595. crossY = super.saveClickY;
  4596. crossType = 2;
  4597. crossIndex = 0;
  4598. stream.createFrame(14);
  4599. stream.method432(anInt1284);
  4600. stream.writeWord(i1);
  4601. stream.writeWord(anInt1285);
  4602. stream.method431(anInt1283);
  4603. }
  4604. }
  4605. if (l == 639) {
  4606. String s3 = menuActionName[i];
  4607. int k2 = s3.indexOf("@whi@");
  4608. if (k2 != -1) {
  4609. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4610. int k3 = -1;
  4611. for (int i4 = 0; i4 < friendsCount; i4++) {
  4612. if (friendsListAsLongs[i4] != l4)
  4613. continue;
  4614. k3 = i4;
  4615. break;
  4616. }
  4617.  
  4618. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  4619. inputTaken = true;
  4620. inputDialogState = 0;
  4621. messagePromptRaised = true;
  4622. promptInput = "";
  4623. friendsListAction = 3;
  4624. aLong953 = friendsListAsLongs[k3];
  4625. aString1121 = "Enter message to send to " + friendsList[k3];
  4626. }
  4627. }
  4628. }
  4629. if (l == 1052) {
  4630. stream.createFrame(185);
  4631. stream.writeWord(154);
  4632. }
  4633.  
  4634. if (l == 1004) {
  4635. if (tabInterfaceIDs[14] != -1) {
  4636. needDrawTabArea = true;
  4637. tabID = 14;
  4638. tabAreaAltered = true;
  4639. }
  4640. }
  4641.  
  4642. if (l == 454) {
  4643. stream.createFrame(41);
  4644. stream.writeWord(i1);
  4645. stream.method432(j);
  4646. stream.method432(k);
  4647. atInventoryLoopCycle = 0;
  4648. atInventoryInterface = k;
  4649. atInventoryIndex = j;
  4650. atInventoryInterfaceType = 2;
  4651. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4652. atInventoryInterfaceType = 1;
  4653. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4654. atInventoryInterfaceType = 3;
  4655. }
  4656. if (l == 478) {
  4657. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4658. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  4659. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4660. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  4661. myPlayer.smallX[0], false,
  4662. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  4663. crossX = super.saveClickX;
  4664. crossY = super.saveClickY;
  4665. crossType = 2;
  4666. crossIndex = 0;
  4667. if ((i1 & 3) == 0)
  4668. anInt1155++;
  4669. if (anInt1155 >= 53) {
  4670. stream.createFrame(85);
  4671. stream.writeWordBigEndian(66);
  4672. anInt1155 = 0;
  4673. }
  4674. stream.createFrame(18);
  4675. stream.method431(i1);
  4676. }
  4677. }
  4678. if (l == 113) {
  4679. method66(i1, k, j);
  4680. stream.createFrame(70);
  4681. stream.method431(j + baseX);
  4682. stream.writeWord(k + baseY);
  4683. stream.method433(i1 >> 14 & 0x7fff);
  4684. }
  4685. if (l == 872) {
  4686. method66(i1, k, j);
  4687. stream.createFrame(234);
  4688. stream.method433(j + baseX);
  4689. stream.method432(i1 >> 14 & 0x7fff);
  4690. stream.method433(k + baseY);
  4691. }
  4692. if (l == 502) {
  4693. method66(i1, k, j);
  4694. stream.createFrame(132);
  4695. stream.method433(j + baseX);
  4696. stream.writeWord(i1 >> 14 & 0x7fff);
  4697. stream.method432(k + baseY);
  4698. }
  4699. if (l == 1125) {
  4700. ItemDef itemDef = ItemDef.forID(i1);
  4701. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4702. String s5;
  4703. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4704. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4705. else if (itemDef.description != null)
  4706. s5 = new String(itemDef.description);
  4707. else
  4708. s5 = "It's a " + itemDef.name + ".";
  4709. pushMessage(s5, 0, "");
  4710. }
  4711. if (l == 169) {
  4712. stream.createFrame(185);
  4713. stream.writeWord(k);
  4714. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4715. if (class9_3.valueIndexArray != null
  4716. && class9_3.valueIndexArray[0][0] == 5) {
  4717. int l2 = class9_3.valueIndexArray[0][1];
  4718. variousSettings[l2] = 1 - variousSettings[l2];
  4719. method33(l2);
  4720. needDrawTabArea = true;
  4721. }
  4722. }
  4723. if (l == 447) {
  4724. itemSelected = 1;
  4725. anInt1283 = j;
  4726. anInt1284 = k;
  4727. anInt1285 = i1;
  4728. selectedItemName = ItemDef.forID(i1).name;
  4729. spellSelected = 0;
  4730. needDrawTabArea = true;
  4731. return;
  4732. }
  4733. if (l == 1226) {
  4734. int j1 = i1 >> 14 & 0x7fff;
  4735. ObjectDef class46 = ObjectDef.forID(j1);
  4736. String s10;
  4737. if (class46.description != null)
  4738. s10 = new String(class46.description);
  4739. else
  4740. s10 = "It's a " + class46.name + ".";
  4741. pushMessage(s10, 0, "");
  4742. }
  4743. if (l == 244) {
  4744. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4745. myPlayer.smallX[0], false, j);
  4746. if (!flag7)
  4747. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4748. myPlayer.smallX[0], false, j);
  4749. crossX = super.saveClickX;
  4750. crossY = super.saveClickY;
  4751. crossType = 2;
  4752. crossIndex = 0;
  4753. stream.createFrame(253);
  4754. stream.method431(j + baseX);
  4755. stream.method433(k + baseY);
  4756. stream.method432(i1);
  4757. }
  4758. if (l == 1448) {
  4759. ItemDef itemDef_1 = ItemDef.forID(i1);
  4760. String s6;
  4761. if (itemDef_1.description != null)
  4762. s6 = new String(itemDef_1.description);
  4763. else
  4764. s6 = "It's a " + itemDef_1.name + ".";
  4765. pushMessage(s6, 0, "");
  4766. }
  4767. itemSelected = 0;
  4768. spellSelected = 0;
  4769. needDrawTabArea = true;
  4770.  
  4771. }
  4772.  
  4773. public void method70() {
  4774. anInt1251 = 0;
  4775. int j = (myPlayer.x >> 7) + baseX;
  4776. int k = (myPlayer.y >> 7) + baseY;
  4777. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4778. anInt1251 = 1;
  4779. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4780. anInt1251 = 1;
  4781. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4782. anInt1251 = 0;
  4783. }
  4784.  
  4785. public void run() {
  4786. if (drawFlames) {
  4787. drawFlames();
  4788. } else {
  4789. super.run();
  4790. }
  4791. }
  4792.  
  4793. private void build3dScreenMenu() {
  4794. if (itemSelected == 0 && spellSelected == 0) {
  4795. menuActionName[menuActionRow] = "Walk here";
  4796. menuActionID[menuActionRow] = 516;
  4797. menuActionCmd2[menuActionRow] = super.mouseX;
  4798. menuActionCmd3[menuActionRow] = super.mouseY;
  4799. menuActionRow++;
  4800. }
  4801. int j = -1;
  4802. for (int k = 0; k < Model.anInt1687; k++) {
  4803. int l = Model.anIntArray1688[k];
  4804. int i1 = l & 0x7f;
  4805. int j1 = l >> 7 & 0x7f;
  4806. int k1 = l >> 29 & 3;
  4807. int l1 = l >> 14 & 0x7fff;
  4808. if (l == j)
  4809. continue;
  4810. j = l;
  4811. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  4812. ObjectDef class46 = ObjectDef.forID(l1);
  4813. if (class46.childrenIDs != null)
  4814. class46 = class46.method580();
  4815. if (class46 == null)
  4816. continue;
  4817. if (itemSelected == 1) {
  4818. menuActionName[menuActionRow] = "Use " + selectedItemName
  4819. + " with @cya@" + class46.name;
  4820. menuActionID[menuActionRow] = 62;
  4821. menuActionCmd1[menuActionRow] = l;
  4822. menuActionCmd2[menuActionRow] = i1;
  4823. menuActionCmd3[menuActionRow] = j1;
  4824. menuActionRow++;
  4825. } else if (spellSelected == 1) {
  4826. if ((spellUsableOn & 4) == 4) {
  4827. menuActionName[menuActionRow] = spellTooltip + " @cya@"
  4828. + class46.name;
  4829. menuActionID[menuActionRow] = 956;
  4830. menuActionCmd1[menuActionRow] = l;
  4831. menuActionCmd2[menuActionRow] = i1;
  4832. menuActionCmd3[menuActionRow] = j1;
  4833. menuActionRow++;
  4834. }
  4835. } else {
  4836. if (class46.actions != null) {
  4837. for (int i2 = 4; i2 >= 0; i2--)
  4838. if (class46.actions[i2] != null) {
  4839. menuActionName[menuActionRow] = class46.actions[i2]
  4840. + " @cya@" + class46.name;
  4841. if (i2 == 0)
  4842. menuActionID[menuActionRow] = 502;
  4843. if (i2 == 1)
  4844. menuActionID[menuActionRow] = 900;
  4845. if (i2 == 2)
  4846. menuActionID[menuActionRow] = 113;
  4847. if (i2 == 3)
  4848. menuActionID[menuActionRow] = 872;
  4849. if (i2 == 4)
  4850. menuActionID[menuActionRow] = 1062;
  4851. menuActionCmd1[menuActionRow] = l;
  4852. menuActionCmd2[menuActionRow] = i1;
  4853. menuActionCmd3[menuActionRow] = j1;
  4854. menuActionRow++;
  4855. }
  4856.  
  4857. }
  4858. menuActionName[menuActionRow] = "Examine @cya@"
  4859. + class46.name + " @gre@(@whi@" + l1
  4860. + "@gre@) (@whi@" + (i1 + baseX) + ","
  4861. + (j1 + baseY) + "@gre@)";
  4862. // menuActionName[menuActionRow] = "Examine @cya@" +
  4863. // class46.name;
  4864. menuActionID[menuActionRow] = 1226;
  4865. menuActionCmd1[menuActionRow] = class46.type << 14;
  4866. menuActionCmd2[menuActionRow] = i1;
  4867. menuActionCmd3[menuActionRow] = j1;
  4868. menuActionRow++;
  4869. }
  4870. }
  4871. if (k1 == 1) {
  4872. NPC npc = npcArray[l1];
  4873. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64
  4874. && (npc.y & 0x7f) == 64) {
  4875. for (int j2 = 0; j2 < npcCount; j2++) {
  4876. NPC npc2 = npcArray[npcIndices[j2]];
  4877. if (npc2 != null && npc2 != npc
  4878. && npc2.desc.aByte68 == 1 && npc2.x == npc.x
  4879. && npc2.y == npc.y)
  4880. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4881. }
  4882.  
  4883. for (int l2 = 0; l2 < playerCount; l2++) {
  4884. Player player = playerArray[playerIndices[l2]];
  4885. if (player != null && player.x == npc.x
  4886. && player.y == npc.y)
  4887. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4888. }
  4889.  
  4890. }
  4891. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4892. }
  4893. if (k1 == 0) {
  4894. Player player = playerArray[l1];
  4895. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  4896. for (int k2 = 0; k2 < npcCount; k2++) {
  4897. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4898. if (class30_sub2_sub4_sub1_sub1_2 != null
  4899. && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1
  4900. && class30_sub2_sub4_sub1_sub1_2.x == player.x
  4901. && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  4902. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc,
  4903. npcIndices[k2], j1, i1);
  4904. }
  4905.  
  4906. for (int i3 = 0; i3 < playerCount; i3++) {
  4907. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4908. if (class30_sub2_sub4_sub1_sub2_2 != null
  4909. && class30_sub2_sub4_sub1_sub2_2 != player
  4910. && class30_sub2_sub4_sub1_sub2_2.x == player.x
  4911. && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  4912. buildAtPlayerMenu(i1, playerIndices[i3],
  4913. class30_sub2_sub4_sub1_sub2_2, j1);
  4914. }
  4915.  
  4916. }
  4917. buildAtPlayerMenu(i1, l1, player, j1);
  4918. }
  4919. if (k1 == 3) {
  4920. NodeList class19 = groundArray[plane][i1][j1];
  4921. if (class19 != null) {
  4922. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19
  4923. .getNext()) {
  4924. ItemDef itemDef = ItemDef.forID(item.ID);
  4925. if (itemSelected == 1) {
  4926. menuActionName[menuActionRow] = "Use "
  4927. + selectedItemName + " with @lre@"
  4928. + itemDef.name;
  4929. menuActionID[menuActionRow] = 511;
  4930. menuActionCmd1[menuActionRow] = item.ID;
  4931. menuActionCmd2[menuActionRow] = i1;
  4932. menuActionCmd3[menuActionRow] = j1;
  4933. menuActionRow++;
  4934. } else if (spellSelected == 1) {
  4935. if ((spellUsableOn & 1) == 1) {
  4936. menuActionName[menuActionRow] = spellTooltip
  4937. + " @lre@" + itemDef.name;
  4938. menuActionID[menuActionRow] = 94;
  4939. menuActionCmd1[menuActionRow] = item.ID;
  4940. menuActionCmd2[menuActionRow] = i1;
  4941. menuActionCmd3[menuActionRow] = j1;
  4942. menuActionRow++;
  4943. }
  4944. } else {
  4945. for (int j3 = 4; j3 >= 0; j3--)
  4946. if (itemDef.groundActions != null
  4947. && itemDef.groundActions[j3] != null) {
  4948. menuActionName[menuActionRow] = itemDef.groundActions[j3]
  4949. + " @lre@" + itemDef.name;
  4950. if (j3 == 0)
  4951. menuActionID[menuActionRow] = 652;
  4952. if (j3 == 1)
  4953. menuActionID[menuActionRow] = 567;
  4954. if (j3 == 2)
  4955. menuActionID[menuActionRow] = 234;
  4956. if (j3 == 3)
  4957. menuActionID[menuActionRow] = 244;
  4958. if (j3 == 4)
  4959. menuActionID[menuActionRow] = 213;
  4960. menuActionCmd1[menuActionRow] = item.ID;
  4961. menuActionCmd2[menuActionRow] = i1;
  4962. menuActionCmd3[menuActionRow] = j1;
  4963. menuActionRow++;
  4964. } else if (j3 == 2) {
  4965. menuActionName[menuActionRow] = "Take @lre@"
  4966. + itemDef.name;
  4967. menuActionID[menuActionRow] = 234;
  4968. menuActionCmd1[menuActionRow] = item.ID;
  4969. menuActionCmd2[menuActionRow] = i1;
  4970. menuActionCmd3[menuActionRow] = j1;
  4971. menuActionRow++;
  4972. }
  4973.  
  4974. // menuActionName[menuActionRow] = "Examine @lre@" +
  4975. // itemDef.name + " @gre@(@whi@" + item.ID +
  4976. // "@gre@)";
  4977. menuActionName[menuActionRow] = "Examine @lre@"
  4978. + itemDef.name;
  4979. menuActionID[menuActionRow] = 1448;
  4980. menuActionCmd1[menuActionRow] = item.ID;
  4981. menuActionCmd2[menuActionRow] = i1;
  4982. menuActionCmd3[menuActionRow] = j1;
  4983. menuActionRow++;
  4984. }
  4985. }
  4986. }
  4987. }
  4988. }
  4989. }
  4990.  
  4991. public void cleanUpForQuit() {
  4992. signlink.reporterror = false;
  4993. try {
  4994. if (socketStream != null)
  4995. socketStream.close();
  4996. } catch (Exception _ex) {
  4997. }
  4998. socketStream = null;
  4999. stopMidi();
  5000. if (mouseDetection != null)
  5001. mouseDetection.running = false;
  5002. mapIcon = null;
  5003. mouseDetection = null;
  5004. onDemandFetcher.disable();
  5005. onDemandFetcher = null;
  5006. aStream_834 = null;
  5007. stream = null;
  5008. aStream_847 = null;
  5009. inStream = null;
  5010. anIntArray1234 = null;
  5011. aByteArrayArray1183 = null;
  5012. aByteArrayArray1247 = null;
  5013. anIntArray1235 = null;
  5014. anIntArray1236 = null;
  5015. intGroundArray = null;
  5016. byteGroundArray = null;
  5017. worldController = null;
  5018. aClass11Array1230 = null;
  5019. anIntArrayArray901 = null;
  5020. anIntArrayArray825 = null;
  5021. bigX = null;
  5022. bigY = null;
  5023. aByteArray912 = null;
  5024. aRSImageProducer_1163 = null;
  5025. mapEdgeIP = null;
  5026. leftFrame = null;
  5027. topFrame = null;
  5028. rightFrame = null;
  5029. aRSImageProducer_1164 = null;
  5030. aRSImageProducer_1165 = null;
  5031. aRSImageProducer_1166 = null;
  5032. aRSImageProducer_1123 = null;
  5033. aRSImageProducer_1124 = null;
  5034. aRSImageProducer_1125 = null;
  5035. /* Null pointers for custom sprites */
  5036. multiOverlay = null;
  5037. chatArea = null;
  5038. chatButtons = null;
  5039. tabArea = null;
  5040. /**/
  5041. sideIcons = null;
  5042. redStones = null;
  5043. compass = null;
  5044. hitMarks = null;
  5045. headIcons = null;
  5046. skullIcons = null;
  5047. headIconsHint = null;
  5048. crosses = null;
  5049. mapDotItem = null;
  5050. mapDotNPC = null;
  5051. mapDotPlayer = null;
  5052. mapDotFriend = null;
  5053. mapDotTeam = null;
  5054. mapScenes = null;
  5055. mapFunctions = null;
  5056. anIntArrayArray929 = null;
  5057. playerArray = null;
  5058. playerIndices = null;
  5059. anIntArray894 = null;
  5060. aStreamArray895s = null;
  5061. anIntArray840 = null;
  5062. npcArray = null;
  5063. npcIndices = null;
  5064. groundArray = null;
  5065. aClass19_1179 = null;
  5066. aClass19_1013 = null;
  5067. aClass19_1056 = null;
  5068. menuActionCmd2 = null;
  5069. menuActionCmd3 = null;
  5070. menuActionID = null;
  5071. menuActionCmd1 = null;
  5072. menuActionName = null;
  5073. variousSettings = null;
  5074. anIntArray1072 = null;
  5075. anIntArray1073 = null;
  5076. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5077. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5078. friendsList = null;
  5079. friendsListAsLongs = null;
  5080. friendsNodeIDs = null;
  5081. aRSImageProducer_1110 = null;
  5082. aRSImageProducer_1111 = null;
  5083. aRSImageProducer_1107 = null;
  5084. aRSImageProducer_1108 = null;
  5085. aRSImageProducer_1109 = null;
  5086. aRSImageProducer_1112 = null;
  5087. aRSImageProducer_1113 = null;
  5088. aRSImageProducer_1114 = null;
  5089. aRSImageProducer_1115 = null;
  5090. nullLoader();
  5091. ObjectDef.nullLoader();
  5092. EntityDef.nullLoader();
  5093. ItemDef.nullLoader();
  5094. Flo.cache = null;
  5095. IDK.cache = null;
  5096. RSInterface.interfaceCache = null;
  5097. DummyClass.cache = null;
  5098. Animation.anims = null;
  5099. SpotAnim.cache = null;
  5100. SpotAnim.aMRUNodes_415 = null;
  5101. Varp.cache = null;
  5102. super.fullGameScreen = null;
  5103. Player.mruNodes = null;
  5104. Texture.nullLoader();
  5105. WorldController.nullLoader();
  5106. Model.nullLoader();
  5107. Class36.nullLoader();
  5108. System.gc();
  5109. }
  5110.  
  5111. public void printDebug() {
  5112. System.out.println("============");
  5113. System.out.println("flame-cycle:" + anInt1208);
  5114. if (onDemandFetcher != null)
  5115. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5116. System.out.println("loop-cycle:" + loopCycle);
  5117. System.out.println("draw-cycle:" + anInt1061);
  5118. System.out.println("ptype:" + pktType);
  5119. System.out.println("psize:" + pktSize);
  5120. if (socketStream != null)
  5121. socketStream.printDebug();
  5122. super.shouldDebug = true;
  5123. }
  5124.  
  5125. Component getGameComponent() {
  5126. if (signlink.mainapp != null)
  5127. return signlink.mainapp;
  5128. if (super.gameFrame != null)
  5129. return super.gameFrame;
  5130. else
  5131. return this;
  5132. }
  5133.  
  5134. public void pmTabToReply() {
  5135. String name = null;
  5136. for (int k = 0; k < 100; k++) {
  5137. if (chatMessages[k] == null) {
  5138. continue;
  5139. }
  5140. int l = chatTypes[k];
  5141. if (l == 3 || l == 7) {
  5142. name = chatNames[k];
  5143. break;
  5144. }
  5145. }
  5146.  
  5147. if (name == null) {
  5148. pushMessage(
  5149. "You haven't received any messages to which you can reply.",
  5150. 0, "");
  5151. return;
  5152. }
  5153.  
  5154. if (name.startsWith("@cr")) {
  5155. name = name.substring(5);
  5156. }
  5157.  
  5158. long nameAsLong = TextClass.longForName(name.trim());
  5159. int k3 = -1;
  5160. for (int i4 = 0; i4 < friendsCount; i4++) {
  5161. if (friendsListAsLongs[i4] != nameAsLong)
  5162. continue;
  5163. k3 = i4;
  5164. break;
  5165. }
  5166.  
  5167. if (k3 != -1) {
  5168. if (friendsNodeIDs[k3] > 0) {
  5169. inputTaken = true;
  5170. inputDialogState = 0;
  5171. messagePromptRaised = true;
  5172. promptInput = "";
  5173. friendsListAction = 3;
  5174. aLong953 = friendsListAsLongs[k3];
  5175. aString1121 = "Enter message to send to " + friendsList[k3];
  5176. } else {
  5177. pushMessage("That player is currently offline.", 0, "");
  5178. }
  5179. }
  5180. }
  5181.  
  5182. private void method73() {
  5183. do {
  5184. int j = readChar(-796);
  5185. if(inputString.equals("::zoomin")) {
  5186. System.out.println("zoomin");
  5187. inputString = "";
  5188. clientZoom += 50;
  5189. }
  5190. if(inputString.equals("::zoomout")) {
  5191. System.out.println("zoomin");
  5192. clientZoom -= 50;
  5193. inputString = "";
  5194. }
  5195. if(j == -1)
  5196. break;
  5197. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5198. if(j == 8 && reportAbuseInput.length() > 0)
  5199. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5200. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5201. reportAbuseInput += (char)j;
  5202. } else if(messagePromptRaised) {
  5203. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5204. promptInput += (char)j;
  5205. inputTaken = true;
  5206. }
  5207. if(j == 8 && promptInput.length() > 0) {
  5208. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5209. inputTaken = true;
  5210. }
  5211. if(j == 13 || j == 10) {
  5212. messagePromptRaised = false;
  5213. inputTaken = true;
  5214. if(friendsListAction == 1) {
  5215. long l = TextClass.longForName(promptInput);
  5216. addFriend(l);
  5217. }
  5218. if(friendsListAction == 2 && friendsCount > 0) {
  5219. long l1 = TextClass.longForName(promptInput);
  5220. delFriend(l1);
  5221. }
  5222. if(friendsListAction == 3 && promptInput.length() > 0) {
  5223. stream.createFrame(126);
  5224. stream.writeWordBigEndian(0);
  5225. int k = stream.currentOffset;
  5226. stream.writeQWord(aLong953);
  5227. TextInput.method526(promptInput, stream);
  5228. stream.writeBytes(stream.currentOffset - k);
  5229. promptInput = TextInput.processText(promptInput);
  5230. //promptInput = Censor.doCensor(promptInput);
  5231. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5232. if(privateChatMode == 2) {
  5233. privateChatMode = 1;
  5234. stream.createFrame(95);
  5235. stream.writeWordBigEndian(publicChatMode);
  5236. stream.writeWordBigEndian(privateChatMode);
  5237. stream.writeWordBigEndian(tradeMode);
  5238. }
  5239. }
  5240. if(friendsListAction == 4 && ignoreCount < 100) {
  5241. long l2 = TextClass.longForName(promptInput);
  5242. addIgnore(l2);
  5243. }
  5244. if(friendsListAction == 5 && ignoreCount > 0) {
  5245. long l3 = TextClass.longForName(promptInput);
  5246. delIgnore(l3);
  5247. }
  5248. if(friendsListAction == 6) {
  5249. long l3 = TextClass.longForName(promptInput);
  5250. chatJoin(l3);
  5251. }
  5252. }
  5253. } else if(inputDialogState == 1) {
  5254. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5255. amountOrNameInput += (char)j;
  5256. inputTaken = true;
  5257. }
  5258. if(j == 8 && amountOrNameInput.length() > 0) {
  5259. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5260. inputTaken = true;
  5261. }
  5262. if(j == 13 || j == 10) {
  5263. if(amountOrNameInput.length() > 0) {
  5264. int i1 = 0;
  5265. try {
  5266. i1 = Integer.parseInt(amountOrNameInput);
  5267. }
  5268. catch(Exception _ex) { }
  5269. stream.createFrame(208);
  5270. stream.writeDWord(i1);
  5271. }
  5272. inputDialogState = 0;
  5273. inputTaken = true;
  5274. }
  5275. } else if(inputDialogState == 2) {
  5276. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5277. amountOrNameInput += (char)j;
  5278. inputTaken = true;
  5279. }
  5280. if(j == 8 && amountOrNameInput.length() > 0) {
  5281. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5282. inputTaken = true;
  5283. }
  5284. if(j == 13 || j == 10) {
  5285. if(amountOrNameInput.length() > 0) {
  5286. stream.createFrame(60);
  5287. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5288. }
  5289. inputDialogState = 0;
  5290. inputTaken = true;
  5291. }
  5292. } else if(backDialogID == -1) {
  5293. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5294. inputString += (char)j;
  5295. inputTaken = true;
  5296. }
  5297. if(j == 8 && inputString.length() > 0) {
  5298. inputString = inputString.substring(0, inputString.length() - 1);
  5299. inputTaken = true;
  5300. }
  5301. if (j == 9)
  5302. pmTabToReply();
  5303. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5304. if (myPrivilege == 3) {
  5305. if (inputString.startsWith("//setspecto")) {
  5306. int amt = Integer.parseInt(inputString
  5307. .substring(12));
  5308. anIntArray1045[300] = amt;
  5309. if (variousSettings[300] != amt) {
  5310. variousSettings[300] = amt;
  5311. method33(300);
  5312. needDrawTabArea = true;
  5313. if (dialogID != -1)
  5314. inputTaken = true;
  5315. }
  5316. }
  5317. if (inputString.equals("clientdrop"))
  5318. dropClient();
  5319. if (inputString.startsWith("full")) {
  5320. try {
  5321. String[] args = inputString.split(" ");
  5322. int id1 = Integer.parseInt(args[1]);
  5323. int id2 = Integer.parseInt(args[2]);
  5324. fullscreenInterfaceID = id1;
  5325. openInterfaceID = id2;
  5326. pushMessage("Opened Interface", 0, "");
  5327. } catch (Exception e) {
  5328. pushMessage("Interface Failed to load", 0, "");
  5329. }
  5330. }
  5331. if (inputString.equals("::lag"))
  5332. printDebug();
  5333. if (inputString.equals("::prefetchmusic")) {
  5334. for (int j1 = 0; j1 < onDemandFetcher
  5335. .getVersionCount(2); j1++)
  5336. onDemandFetcher.method563((byte) 1, 2, j1);
  5337.  
  5338. }
  5339. System.out.println(inputString);
  5340. if (inputString.equals("::maps"))
  5341. addMaps();
  5342. if (inputString.equals("zoomin"))
  5343. System.out.println("test");
  5344. if (inputString.equals("::zoomout"))
  5345. clientZoom -= 50;
  5346. if (inputString.equals("::models"))
  5347. addModels();
  5348. if (inputString.equals("::fpson"))
  5349. fpsOn = true;
  5350. if (inputString.equals("::fpsoff"))
  5351. fpsOn = false;
  5352. if (inputString.equals("::dataon"))
  5353. clientData = true;
  5354. if (inputString.equals("::dataoff"))
  5355. clientData = false;
  5356. if (inputString.equals("::noclip")) {
  5357. for (int k1 = 0; k1 < 4; k1++) {
  5358. for (int i2 = 1; i2 < 103; i2++) {
  5359. for (int k2 = 1; k2 < 103; k2++)
  5360. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5361.  
  5362. }
  5363. }
  5364. }
  5365. }
  5366.  
  5367. if (inputString.equals("add model")) {
  5368. try {
  5369. int ModelIndex = Integer.parseInt(JOptionPane
  5370. .showInputDialog(this, "Enter model ID",
  5371. "Model", 3));
  5372. byte[] abyte0 = getModel(ModelIndex);
  5373. if (abyte0 != null && abyte0.length > 0) {
  5374. decompressors[1].method234(abyte0.length,
  5375. abyte0, ModelIndex);
  5376. pushMessage("Model: [" + ModelIndex
  5377. + "] added successfully!", 0, "");
  5378. } else {
  5379. pushMessage("Unable to find the model. "
  5380. + ModelIndex, 0, "");
  5381. }
  5382. } catch (Exception e) {
  5383. pushMessage("Syntax - ::add model <path>", 0, "");
  5384. }
  5385. }
  5386. if(inputString.startsWith("/"))
  5387. inputString = "::" + inputString;
  5388. if (inputString.startsWith("::")) {
  5389. stream.createFrame(103);
  5390. stream.writeWordBigEndian(inputString.length() - 1);
  5391. stream.writeString(inputString.substring(2));
  5392. } else {
  5393. String s = inputString.toLowerCase();
  5394. int j2 = 0;
  5395. if (s.startsWith("yellow:")) {
  5396. j2 = 0;
  5397. inputString = inputString.substring(7);
  5398. } else if (s.startsWith("red:")) {
  5399. j2 = 1;
  5400. inputString = inputString.substring(4);
  5401. } else if (s.startsWith("green:")) {
  5402. j2 = 2;
  5403. inputString = inputString.substring(6);
  5404. } else if (s.startsWith("cyan:")) {
  5405. j2 = 3;
  5406. inputString = inputString.substring(5);
  5407. } else if (s.startsWith("purple:")) {
  5408. j2 = 4;
  5409. inputString = inputString.substring(7);
  5410. } else if (s.startsWith("white:")) {
  5411. j2 = 5;
  5412. inputString = inputString.substring(6);
  5413. } else if (s.startsWith("flash1:")) {
  5414. j2 = 6;
  5415. inputString = inputString.substring(7);
  5416. } else if (s.startsWith("flash2:")) {
  5417. j2 = 7;
  5418. inputString = inputString.substring(7);
  5419. } else if (s.startsWith("flash3:")) {
  5420. j2 = 8;
  5421. inputString = inputString.substring(7);
  5422. } else if (s.startsWith("glow1:")) {
  5423. j2 = 9;
  5424. inputString = inputString.substring(6);
  5425. } else if (s.startsWith("glow2:")) {
  5426. j2 = 10;
  5427. inputString = inputString.substring(6);
  5428. } else if (s.startsWith("glow3:")) {
  5429. j2 = 11;
  5430. inputString = inputString.substring(6);
  5431. }
  5432. s = inputString.toLowerCase();
  5433. int i3 = 0;
  5434. if (s.startsWith("wave:")) {
  5435. i3 = 1;
  5436. inputString = inputString.substring(5);
  5437. } else if (s.startsWith("wave2:")) {
  5438. i3 = 2;
  5439. inputString = inputString.substring(6);
  5440. } else if (s.startsWith("shake:")) {
  5441. i3 = 3;
  5442. inputString = inputString.substring(6);
  5443. } else if (s.startsWith("scroll:")) {
  5444. i3 = 4;
  5445. inputString = inputString.substring(7);
  5446. } else if (s.startsWith("slide:")) {
  5447. i3 = 5;
  5448. inputString = inputString.substring(6);
  5449. }
  5450. stream.createFrame(4);
  5451. stream.writeWordBigEndian(0);
  5452. int j3 = stream.currentOffset;
  5453. stream.method425(i3);
  5454. stream.method425(j2);
  5455. aStream_834.currentOffset = 0;
  5456. TextInput.method526(inputString, aStream_834);
  5457. stream.method441(0, aStream_834.buffer,
  5458. aStream_834.currentOffset);
  5459. stream.writeBytes(stream.currentOffset - j3);
  5460. inputString = TextInput.processText(inputString);
  5461. // inputString = Censor.doCensor(inputString);
  5462. myPlayer.textSpoken = inputString;
  5463. myPlayer.anInt1513 = j2;
  5464. myPlayer.anInt1531 = i3;
  5465. myPlayer.textCycle = 150;
  5466. switch (myPrivilege) {
  5467. case 1:
  5468. pushMessage(myPlayer.textSpoken, 2, "@cr1@"
  5469. + myPlayer.name);
  5470. break;
  5471. case 2:
  5472. pushMessage(myPlayer.textSpoken, 2, "@cr2@"
  5473. + myPlayer.name);
  5474. break;
  5475. case 3:
  5476. pushMessage(myPlayer.textSpoken, 2, "@cr3@"
  5477. + myPlayer.name);
  5478. break;
  5479. case 4:
  5480. pushMessage(myPlayer.textSpoken, 2, "@cr4@"
  5481. + myPlayer.name);
  5482. break;
  5483. case 5:
  5484. pushMessage(myPlayer.textSpoken, 2, "@cr5@"
  5485. + myPlayer.name);
  5486. break;
  5487. case 6:
  5488. pushMessage(myPlayer.textSpoken, 2, "@cr6@"
  5489. + myPlayer.name);
  5490. break;
  5491. default:
  5492. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5493. }
  5494. if (publicChatMode == 2) {
  5495. publicChatMode = 3;
  5496. aBoolean1233 = true;
  5497. stream.createFrame(95);
  5498. stream.writeWordBigEndian(publicChatMode);
  5499. stream.writeWordBigEndian(privateChatMode);
  5500. stream.writeWordBigEndian(tradeMode);
  5501. }
  5502. }
  5503. inputString = "";
  5504. inputTaken = true;
  5505. }
  5506. }
  5507. } while (true);
  5508. }
  5509.  
  5510. private void buildPublicChat(int j) {
  5511. int l = 0;
  5512. for (int i1 = 0; i1 < 500; i1++) {
  5513. if (chatMessages[i1] == null)
  5514. continue;
  5515. if (chatTypeView != 1)
  5516. continue;
  5517. int j1 = chatTypes[i1];
  5518. String s = chatNames[i1];
  5519. String ct = chatMessages[i1];
  5520. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5521. if (k1 < -23)
  5522. break;
  5523. if (s != null && s.startsWith("@cr1@"))
  5524. s = s.substring(5);
  5525. if (s != null && s.startsWith("@cr2@"))
  5526. s = s.substring(5);
  5527. if (s != null && s.startsWith("@cr3@"))
  5528. s = s.substring(5);
  5529. if (s != null && s.startsWith("@cr4@"))
  5530. s = s.substring(5);
  5531. if (s != null && s.startsWith("@cr5@"))
  5532. s = s.substring(5);
  5533. if (s != null && s.startsWith("@cr6@"))
  5534. s = s.substring(5);
  5535. if ((j1 == 1 || j1 == 2)
  5536. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  5537. && isFriendOrSelf(s))) {
  5538. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5539. if (myPrivilege >= 1) {
  5540. menuActionName[menuActionRow] = "Report abuse @whi@"
  5541. + s;
  5542. menuActionID[menuActionRow] = 606;
  5543. menuActionRow++;
  5544. }
  5545. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5546. menuActionID[menuActionRow] = 42;
  5547. menuActionRow++;
  5548. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5549. menuActionID[menuActionRow] = 337;
  5550. menuActionRow++;
  5551. }
  5552. l++;
  5553. }
  5554. }
  5555. }
  5556.  
  5557. private void buildFriendChat(int j) {
  5558. int l = 0;
  5559. for (int i1 = 0; i1 < 500; i1++) {
  5560. if (chatMessages[i1] == null)
  5561. continue;
  5562. if (chatTypeView != 2)
  5563. continue;
  5564. int j1 = chatTypes[i1];
  5565. String s = chatNames[i1];
  5566. String ct = chatMessages[i1];
  5567. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5568. if (k1 < -23)
  5569. break;
  5570. if (s != null && s.startsWith("@cr1@"))
  5571. s = s.substring(5);
  5572. if (s != null && s.startsWith("@cr2@"))
  5573. s = s.substring(5);
  5574. if (s != null && s.startsWith("@cr3@"))
  5575. s = s.substring(5);
  5576. if (s != null && s.startsWith("@cr4@"))
  5577. s = s.substring(5);
  5578. if (s != null && s.startsWith("@cr5@"))
  5579. s = s.substring(5);
  5580. if (s != null && s.startsWith("@cr6@"))
  5581. s = s.substring(5);
  5582. if ((j1 == 5 || j1 == 6)
  5583. && (splitPrivateChat == 0 || chatTypeView == 2)
  5584. && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1
  5585. && isFriendOrSelf(s)))
  5586. l++;
  5587. if ((j1 == 3 || j1 == 7)
  5588. && (splitPrivateChat == 0 || chatTypeView == 2)
  5589. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  5590. && isFriendOrSelf(s))) {
  5591. if (j > k1 - 14 && j <= k1) {
  5592. if (myPrivilege >= 1) {
  5593. menuActionName[menuActionRow] = "Report abuse @whi@"
  5594. + s;
  5595. menuActionID[menuActionRow] = 606;
  5596. menuActionRow++;
  5597. }
  5598. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5599. menuActionID[menuActionRow] = 42;
  5600. menuActionRow++;
  5601. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5602. menuActionID[menuActionRow] = 337;
  5603. menuActionRow++;
  5604. }
  5605. l++;
  5606. }
  5607. }
  5608. }
  5609.  
  5610. private void buildDuelorTrade(int j) {
  5611. int l = 0;
  5612. for (int i1 = 0; i1 < 500; i1++) {
  5613. if (chatMessages[i1] == null)
  5614. continue;
  5615. if (chatTypeView != 3 && chatTypeView != 4)
  5616. continue;
  5617. int j1 = chatTypes[i1];
  5618. String s = chatNames[i1];
  5619. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5620. if (k1 < -23)
  5621. break;
  5622. if (s != null && s.startsWith("@cr1@"))
  5623. s = s.substring(5);
  5624. if (s != null && s.startsWith("@cr2@"))
  5625. s = s.substring(5);
  5626. if (s != null && s.startsWith("@cr3@"))
  5627. s = s.substring(5);
  5628. if (s != null && s.startsWith("@cr4@"))
  5629. s = s.substring(5);
  5630. if (s != null && s.startsWith("@cr5@"))
  5631. s = s.substring(5);
  5632. if (s != null && s.startsWith("@cr6@"))
  5633. s = s.substring(5);
  5634. if (chatTypeView == 3 && j1 == 4
  5635. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5636. if (j > k1 - 14 && j <= k1) {
  5637. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5638. menuActionID[menuActionRow] = 484;
  5639. menuActionRow++;
  5640. }
  5641. l++;
  5642. }
  5643. if (chatTypeView == 4 && j1 == 8
  5644. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5645. if (j > k1 - 14 && j <= k1) {
  5646. menuActionName[menuActionRow] = "Accept challenge @whi@"
  5647. + s;
  5648. menuActionID[menuActionRow] = 6;
  5649. menuActionRow++;
  5650. }
  5651. l++;
  5652. }
  5653. if (j1 == 12) {
  5654. if (j > k1 - 14 && j <= k1) {
  5655. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5656. menuActionID[menuActionRow] = 915;
  5657. menuActionRow++;
  5658. }
  5659. l++;
  5660. }
  5661. }
  5662. }
  5663.  
  5664. private void buildChatAreaMenu(int j) {
  5665. int l = 0;
  5666. int test = 0;
  5667. for (int i1 = 0; i1 < 500; i1++) {
  5668. if (chatMessages[i1] == null)
  5669. continue;
  5670. int j1 = chatTypes[i1];
  5671. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5672. if (k1 < -23)
  5673. break;
  5674. String s = chatNames[i1];
  5675. String ct = chatMessages[i1];
  5676. boolean flag = false;
  5677. if (chatTypeView == 1) {
  5678. buildPublicChat(j);
  5679. break;
  5680. }
  5681. if (chatTypeView == 2) {
  5682. buildFriendChat(j);
  5683. break;
  5684. }
  5685. if (chatTypeView == 3 || chatTypeView == 4) {
  5686. buildDuelorTrade(j);
  5687. break;
  5688. }
  5689. if (chatTypeView == 5) {
  5690. break;
  5691. }
  5692. if (s != null && s.startsWith("@cr1@")) {
  5693. s = s.substring(5);
  5694. byte byte0 = 1;
  5695. }
  5696. if (s != null && s.startsWith("@cr2@")) {
  5697. s = s.substring(5);
  5698. byte byte0 = 2;
  5699. }
  5700. if (s != null && s.startsWith("@cr3@")) {
  5701. s = s.substring(5);
  5702. byte byte0 = 3;
  5703. }
  5704. if (s != null && s.startsWith("@cr4@")) {
  5705. s = s.substring(5);
  5706. byte byte0 = 4;
  5707. }
  5708. if (s != null && s.startsWith("@cr5@")) {
  5709. s = s.substring(5);
  5710. byte byte0 = 5;
  5711. }
  5712. if (s != null && s.startsWith("@cr6@")) {
  5713. s = s.substring(5);
  5714. byte byte0 = 6;
  5715. }
  5716. if (j1 == 0)
  5717. l++;
  5718. if ((j1 == 1 || j1 == 2)
  5719. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  5720. && isFriendOrSelf(s))) {
  5721. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5722. if (myPrivilege >= 1) {
  5723. menuActionName[menuActionRow] = "Report abuse @whi@"
  5724. + s;
  5725. menuActionID[menuActionRow] = 606;
  5726. menuActionRow++;
  5727. }
  5728. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5729. menuActionID[menuActionRow] = 42;
  5730. menuActionRow++;
  5731. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5732. menuActionID[menuActionRow] = 337;
  5733. menuActionRow++;
  5734. }
  5735. l++;
  5736. }
  5737. if ((j1 == 3 || j1 == 7)
  5738. && splitPrivateChat == 0
  5739. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  5740. && isFriendOrSelf(s))) {
  5741. if (j > k1 - 14 && j <= k1) {
  5742. if (myPrivilege >= 1) {
  5743. menuActionName[menuActionRow] = "Report abuse @whi@"
  5744. + s;
  5745. menuActionID[menuActionRow] = 606;
  5746. menuActionRow++;
  5747. }
  5748. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5749. menuActionID[menuActionRow] = 42;
  5750. menuActionRow++;
  5751. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5752. menuActionID[menuActionRow] = 337;
  5753. menuActionRow++;
  5754. }
  5755. l++;
  5756. }
  5757. if (j1 == 4
  5758. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5759. if (j > k1 - 14 && j <= k1) {
  5760. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5761. menuActionID[menuActionRow] = 484;
  5762. menuActionRow++;
  5763. }
  5764. l++;
  5765. }
  5766. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0
  5767. && privateChatMode < 2)
  5768. l++;
  5769. if (j1 == 8
  5770. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5771. if (j > k1 - 14 && j <= k1) {
  5772. menuActionName[menuActionRow] = "Accept challenge @whi@"
  5773. + s;
  5774. menuActionID[menuActionRow] = 6;
  5775. menuActionRow++;
  5776. }
  5777. l++;
  5778. }
  5779. }
  5780. }
  5781.  
  5782. public void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  5783. int j = class9.contentType;
  5784. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  5785. if (j == 1 && anInt900 == 0) {
  5786. class9.message = "Loading friend list";
  5787. class9.atActionType = 0;
  5788. return;
  5789. }
  5790. if (j == 1 && anInt900 == 1) {
  5791. class9.message = "Connecting to friendserver";
  5792. class9.atActionType = 0;
  5793. return;
  5794. }
  5795. if (j == 2 && anInt900 != 2) {
  5796. class9.message = "Please wait...";
  5797. class9.atActionType = 0;
  5798. return;
  5799. }
  5800. int k = friendsCount;
  5801. if (anInt900 != 2)
  5802. k = 0;
  5803. if (j > 700)
  5804. j -= 601;
  5805. else
  5806. j--;
  5807. if (j >= k) {
  5808. class9.message = "";
  5809. class9.atActionType = 0;
  5810. return;
  5811. } else {
  5812. class9.message = friendsList[j];
  5813. class9.atActionType = 1;
  5814. return;
  5815. }
  5816. }
  5817. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  5818. int l = friendsCount;
  5819. if (anInt900 != 2)
  5820. l = 0;
  5821. if (j > 800)
  5822. j -= 701;
  5823. else
  5824. j -= 101;
  5825. if (j >= l) {
  5826. class9.message = "";
  5827. class9.atActionType = 0;
  5828. return;
  5829. }
  5830. if (friendsNodeIDs[j] == 0)
  5831. class9.message = "@red@Offline";
  5832. else if (friendsNodeIDs[j] == nodeID)
  5833. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
  5834. else
  5835. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  5836. class9.atActionType = 1;
  5837. return;
  5838. }
  5839. if (j == 203) {
  5840. int i1 = friendsCount;
  5841. if (anInt900 != 2)
  5842. i1 = 0;
  5843. class9.scrollMax = i1 * 15 + 20;
  5844. if (class9.scrollMax <= class9.height)
  5845. class9.scrollMax = class9.height + 1;
  5846. return;
  5847. }
  5848. if (j >= 401 && j <= 500) {
  5849. if ((j -= 401) == 0 && anInt900 == 0) {
  5850. class9.message = "Loading ignore list";
  5851. class9.atActionType = 0;
  5852. return;
  5853. }
  5854. if (j == 1 && anInt900 == 0) {
  5855. class9.message = "Please wait...";
  5856. class9.atActionType = 0;
  5857. return;
  5858. }
  5859. int j1 = ignoreCount;
  5860. if (anInt900 == 0)
  5861. j1 = 0;
  5862. if (j >= j1) {
  5863. class9.message = "";
  5864. class9.atActionType = 0;
  5865. return;
  5866. } else {
  5867. class9.message = TextClass.fixName(TextClass
  5868. .nameForLong(ignoreListAsLongs[j]));
  5869. class9.atActionType = 1;
  5870. return;
  5871. }
  5872. }
  5873. if (j == 503) {
  5874. class9.scrollMax = ignoreCount * 15 + 20;
  5875. if (class9.scrollMax <= class9.height)
  5876. class9.scrollMax = class9.height + 1;
  5877. return;
  5878. }
  5879. if (j == 327) {
  5880. class9.modelRotation1 = 150;
  5881. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  5882. if (aBoolean1031) {
  5883. for (int k1 = 0; k1 < 7; k1++) {
  5884. int l1 = anIntArray1065[k1];
  5885. if (l1 >= 0 && !IDK.cache[l1].method537())
  5886. return;
  5887. }
  5888.  
  5889. aBoolean1031 = false;
  5890. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5891. int i2 = 0;
  5892. for (int j2 = 0; j2 < 7; j2++) {
  5893. int k2 = anIntArray1065[j2];
  5894. if (k2 >= 0)
  5895. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  5896. .method538();
  5897. }
  5898.  
  5899. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5900. for (int l2 = 0; l2 < 5; l2++)
  5901. if (anIntArray990[l2] != 0) {
  5902. model.method476(anIntArrayArray1003[l2][0],
  5903. anIntArrayArray1003[l2][anIntArray990[l2]]);
  5904. if (l2 == 1)
  5905. model.method476(anIntArray1204[0],
  5906. anIntArray1204[anIntArray990[l2]]);
  5907. // if(l2 == 1)
  5908. // model.method476(Legs2[0], Legs2[anIntArray990[l2]]);
  5909. }
  5910.  
  5911. model.method469();
  5912. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5913. model.method479(64, 1300, 0, -570, 0, true);
  5914. class9.anInt233 = 5;
  5915. class9.mediaID = 0;
  5916. RSInterface.method208(aBoolean994, model);
  5917. }
  5918. return;
  5919. }
  5920. if (j == 328) {
  5921. RSInterface rsInterface = class9;
  5922. int verticleTilt = 150;
  5923. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  5924. rsInterface.modelRotation1 = verticleTilt;
  5925. rsInterface.modelRotation2 = animationSpeed;
  5926. if (aBoolean1031) {
  5927. Model characterDisplay = myPlayer.method452();
  5928. for (int l2 = 0; l2 < 5; l2++)
  5929. if (anIntArray990[l2] != 0) {
  5930. characterDisplay.method476(anIntArrayArray1003[l2][0],
  5931. anIntArrayArray1003[l2][anIntArray990[l2]]);
  5932. if (l2 == 1)
  5933. characterDisplay.method476(anIntArray1204[0],
  5934. anIntArray1204[anIntArray990[l2]]);
  5935. }
  5936. int staticFrame = myPlayer.anInt1511;
  5937. characterDisplay.method469();
  5938. characterDisplay
  5939. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  5940. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  5941. rsInterface.anInt233 = 5;
  5942. rsInterface.mediaID = 0;
  5943. RSInterface.method208(aBoolean994, characterDisplay);
  5944. }
  5945. return;
  5946. }
  5947. if (j == 324) {
  5948. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  5949. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5950. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5951. }
  5952. if (aBoolean1047) {
  5953. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5954. return;
  5955. } else {
  5956. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5957. return;
  5958. }
  5959. }
  5960. if (j == 325) {
  5961. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  5962. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5963. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5964. }
  5965. if (aBoolean1047) {
  5966. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5967. return;
  5968. } else {
  5969. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5970. return;
  5971. }
  5972. }
  5973. if (j == 600) {
  5974. class9.message = reportAbuseInput;
  5975. if (loopCycle % 20 < 10) {
  5976. class9.message += "|";
  5977. return;
  5978. } else {
  5979. class9.message += " ";
  5980. return;
  5981. }
  5982. }
  5983. if (j == 613)
  5984. if (myPrivilege >= 1) {
  5985. if (canMute) {
  5986. class9.textColor = 0xff0000;
  5987. // class9.message =
  5988. // "Moderator option: Mute player for 48 hours: <ON>";
  5989. } else {
  5990. class9.textColor = 0xffffff;
  5991. // class9.message =
  5992. // "Moderator option: Mute player for 48 hours: <OFF>";
  5993. }
  5994. } else {
  5995. class9.message = "";
  5996. }
  5997. if (j == 650 || j == 655)
  5998. if (anInt1193 != 0) {
  5999. String s;
  6000. if (daysSinceLastLogin == 0)
  6001. s = "earlier today";
  6002. else if (daysSinceLastLogin == 1)
  6003. s = "yesterday";
  6004. else
  6005. s = daysSinceLastLogin + " days ago";
  6006. class9.message = "You last logged in " + s + " from: "
  6007. + signlink.dns;
  6008. } else {
  6009. class9.message = "";
  6010. }
  6011. if (j == 651) {
  6012. if (unreadMessages == 0) {
  6013. class9.message = "0 unread messages";
  6014. class9.textColor = 0xffff00;
  6015. }
  6016. if (unreadMessages == 1) {
  6017. class9.message = "1 unread message";
  6018. class9.textColor = 65280;
  6019. }
  6020. if (unreadMessages > 1) {
  6021. class9.message = unreadMessages + " unread messages";
  6022. class9.textColor = 65280;
  6023. }
  6024. }
  6025. if (j == 652)
  6026. if (daysSinceRecovChange == 201) {
  6027. if (membersInt == 1)
  6028. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6029. else
  6030. class9.message = "";
  6031. } else if (daysSinceRecovChange == 200) {
  6032. class9.message = "You have not yet set any password recovery questions.";
  6033. } else {
  6034. String s1;
  6035. if (daysSinceRecovChange == 0)
  6036. s1 = "Earlier today";
  6037. else if (daysSinceRecovChange == 1)
  6038. s1 = "Yesterday";
  6039. else
  6040. s1 = daysSinceRecovChange + " days ago";
  6041. class9.message = s1 + " you changed your recovery questions";
  6042. }
  6043. if (j == 653)
  6044. if (daysSinceRecovChange == 201) {
  6045. if (membersInt == 1)
  6046. class9.message = "@whi@recommend you use a members world instead. You may use";
  6047. else
  6048. class9.message = "";
  6049. } else if (daysSinceRecovChange == 200)
  6050. class9.message = "We strongly recommend you do so now to secure your account.";
  6051. else
  6052. class9.message = "If you do not remember making this change then cancel it immediately";
  6053. if (j == 654) {
  6054. if (daysSinceRecovChange == 201)
  6055. if (membersInt == 1) {
  6056. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6057. return;
  6058. } else {
  6059. class9.message = "";
  6060. return;
  6061. }
  6062. if (daysSinceRecovChange == 200) {
  6063. class9.message = "Do this from the 'account management' area on our front webpage";
  6064. return;
  6065. }
  6066. class9.message = "Do this from the 'account management' area on our front webpage";
  6067. }
  6068. }
  6069.  
  6070. private void drawSplitPrivateChat() {
  6071. if (splitPrivateChat == 0)
  6072. return;
  6073. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6074. int i = 0;
  6075. if (anInt1104 != 0)
  6076. i = 1;
  6077. for (int j = 0; j < 100; j++)
  6078. if (chatMessages[j] != null) {
  6079. int k = chatTypes[j];
  6080. String s = chatNames[j];
  6081. byte byte1 = 0;
  6082. if (s != null && s.startsWith("@cr1@")) {
  6083. s = s.substring(5);
  6084. byte1 = 1;
  6085. }
  6086. if (s != null && s.startsWith("@cr2@")) {
  6087. s = s.substring(5);
  6088. byte1 = 2;
  6089. }
  6090. if (s != null && s.startsWith("@cr3@")) {
  6091. s = s.substring(5);
  6092. byte1 = 3;
  6093. }
  6094. if (s != null && s.startsWith("@cr4@")) {
  6095. s = s.substring(5);
  6096. byte1 = 4;
  6097. }
  6098. if (s != null && s.startsWith("@cr5@")) {
  6099. s = s.substring(5);
  6100. byte1 = 5;
  6101. }
  6102. if (s != null && s.startsWith("@cr6@")) {
  6103. s = s.substring(5);
  6104. byte1 = 6;
  6105. }
  6106.  
  6107. if ((k == 3 || k == 7)
  6108. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  6109. && isFriendOrSelf(s))) {
  6110. int l = 329 - i * 13;
  6111. int k1 = 4;
  6112. textDrawingArea.method385(0, "From", l, k1);
  6113. textDrawingArea.method385(65535, "From", l - 1, k1);
  6114. if (byte1 == 3 || byte1 == 2 || byte1 == 1 || byte1 == 0) {
  6115. k1 += textDrawingArea.getTextWidth("From ");
  6116. } else if (byte1 == 6 || byte1 == 5 || byte1 == 4) {
  6117. k1 += textDrawingArea.getTextWidth("From");
  6118. }
  6119. if (byte1 == 1) {
  6120. modIcons[0].drawSprite(k1 - 2, l - 12);
  6121. k1 += 12;
  6122. }
  6123. if (byte1 == 2) {
  6124. modIcons[1].drawSprite(k1 - 2, l - 13);
  6125. k1 += 12;
  6126. }
  6127. if (byte1 == 3) {
  6128. modIcons[2].drawSprite(k1 - 2, l - 12);
  6129. k1 += 12;
  6130. }
  6131. if (byte1 == 4) {
  6132. modIcons[3].drawSprite(k1, l - 11);
  6133. k1 += 12;
  6134. }
  6135. if (byte1 == 5) {
  6136. modIcons[4].drawSprite(k1, l - 11);
  6137. k1 += 12;
  6138. }
  6139. if (byte1 == 6) {
  6140. modIcons[5].drawSprite(k1, l - 11);
  6141. k1 += 12;
  6142. }
  6143. textDrawingArea.method385(0, s + ": " + chatMessages[j], l,
  6144. k1);
  6145. //here
  6146. textDrawingArea.method385(65535,
  6147. s + ": " + chatMessages[j], l - 1, k1);
  6148. if (++i >= 5)
  6149. return;
  6150. }
  6151. if (k == 5 && privateChatMode < 2) {
  6152. int i1 = 329 - i * 13;
  6153. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6154. textDrawingArea
  6155. .method385(65535, chatMessages[j], i1 - 1, 4);
  6156. if (++i >= 5)
  6157. return;
  6158. }
  6159. if (k == 6 && privateChatMode < 2) {
  6160. int j1 = 329 - i * 13;
  6161. textDrawingArea.method385(0, "To " + s + ": "
  6162. + chatMessages[j], j1, 4);
  6163. textDrawingArea.method385(65535, "To " + s + ": "
  6164. + chatMessages[j], j1 - 1, 4);
  6165. if (++i >= 5)
  6166. return;
  6167. }
  6168. }
  6169.  
  6170. }
  6171.  
  6172. public void pushMessage(String s, int i, String s1) {
  6173. if(i == 0 && dialogID != -1) {
  6174. aString844 = s;
  6175. super.clickMode3 = 0;
  6176. }
  6177. if(backDialogID == -1)
  6178. inputTaken = true;
  6179. for(int j = 499; j > 0; j--) {
  6180. chatTypes[j] = chatTypes[j - 1];
  6181. chatNames[j] = chatNames[j - 1];
  6182. chatMessages[j] = chatMessages[j - 1];
  6183. chatRights[j] = chatRights[j - 1];
  6184. }
  6185. chatTypes[0] = i;
  6186. chatNames[0] = s1;
  6187. chatMessages[0] = s;
  6188. chatRights[0] = rights;
  6189. }
  6190.  
  6191. public void setNorth() {
  6192. cameraOffsetX = 0;
  6193. cameraOffsetY = 0;
  6194. viewRotationOffset = 0;
  6195. viewRotation = 0;
  6196. minimapRotation = 0;
  6197. minimapZoom = 0;
  6198. }
  6199.  
  6200. public void processTabClick() {
  6201. if (super.clickMode3 == 1) {
  6202. if (super.saveClickX >= 524 && super.saveClickX <= 561
  6203. && super.saveClickY >= 169 && super.saveClickY < 205
  6204. && tabInterfaceIDs[0] != -1) {
  6205. needDrawTabArea = true;
  6206. tabID = 0;
  6207. tabAreaAltered = true;
  6208. }
  6209. if (super.saveClickX >= 562 && super.saveClickX <= 594
  6210. && super.saveClickY >= 168 && super.saveClickY < 205
  6211. && tabInterfaceIDs[1] != -1) {
  6212. needDrawTabArea = true;
  6213. tabID = 1;
  6214. tabAreaAltered = true;
  6215. }
  6216. if (super.saveClickX >= 595 && super.saveClickX <= 626
  6217. && super.saveClickY >= 168 && super.saveClickY < 205
  6218. && tabInterfaceIDs[2] != -1) {
  6219. needDrawTabArea = true;
  6220. tabID = 2;
  6221. tabAreaAltered = true;
  6222. }
  6223. if (super.saveClickX >= 627 && super.saveClickX <= 660
  6224. && super.saveClickY >= 168 && super.saveClickY < 203
  6225. && tabInterfaceIDs[3] != -1) {
  6226. needDrawTabArea = true;
  6227. tabID = 3;
  6228. tabAreaAltered = true;
  6229. }
  6230. if (super.saveClickX >= 661 && super.saveClickX <= 693
  6231. && super.saveClickY >= 168 && super.saveClickY < 205
  6232. && tabInterfaceIDs[4] != -1) {
  6233. needDrawTabArea = true;
  6234. tabID = 4;
  6235. tabAreaAltered = true;
  6236. }
  6237. if (super.saveClickX >= 694 && super.saveClickX <= 725
  6238. && super.saveClickY >= 168 && super.saveClickY < 205
  6239. && tabInterfaceIDs[5] != -1) {
  6240. needDrawTabArea = true;
  6241. tabID = 5;
  6242. tabAreaAltered = true;
  6243. }
  6244. if (super.saveClickX >= 726 && super.saveClickX <= 765
  6245. && super.saveClickY >= 169 && super.saveClickY < 205
  6246. && tabInterfaceIDs[6] != -1) {
  6247. needDrawTabArea = true;
  6248. tabID = 6;
  6249. tabAreaAltered = true;
  6250. }
  6251. if (super.saveClickX >= 524 && super.saveClickX <= 561
  6252. && super.saveClickY >= 466 && super.saveClickY < 503
  6253. && tabInterfaceIDs[7] != -1) {
  6254. needDrawTabArea = true;
  6255. tabID = 7;
  6256. tabAreaAltered = true;
  6257. }
  6258. if (super.saveClickX >= 562 && super.saveClickX <= 594
  6259. && super.saveClickY >= 466 && super.saveClickY < 503
  6260. && tabInterfaceIDs[8] != -1) {
  6261. needDrawTabArea = true;
  6262. tabID = 8;
  6263. tabAreaAltered = true;
  6264. }
  6265. if (super.saveClickX >= 595 && super.saveClickX <= 627
  6266. && super.saveClickY >= 466 && super.saveClickY < 503
  6267. && tabInterfaceIDs[9] != -1) {
  6268. needDrawTabArea = true;
  6269. tabID = 9;
  6270. tabAreaAltered = true;
  6271. }
  6272. if (super.saveClickX >= 627 && super.saveClickX <= 664
  6273. && super.saveClickY >= 466 && super.saveClickY < 503
  6274. && tabInterfaceIDs[10] != -1) {
  6275. needDrawTabArea = true;
  6276. tabID = 10;
  6277. tabAreaAltered = true;
  6278. }
  6279. if (super.saveClickX >= 661 && super.saveClickX <= 694
  6280. && super.saveClickY >= 466 && super.saveClickY < 503
  6281. && tabInterfaceIDs[11] != -1) {
  6282. needDrawTabArea = true;
  6283. tabID = 11;
  6284. tabAreaAltered = true;
  6285. }
  6286. if (super.saveClickX >= 695 && super.saveClickX <= 725
  6287. && super.saveClickY >= 466 && super.saveClickY < 503
  6288. && tabInterfaceIDs[12] != -1) {
  6289. needDrawTabArea = true;
  6290. tabID = 12;
  6291. tabAreaAltered = true;
  6292. }
  6293. if (super.saveClickX >= 726 && super.saveClickX <= 765
  6294. && super.saveClickY >= 466 && super.saveClickY < 502
  6295. && tabInterfaceIDs[13] != -1) {
  6296. needDrawTabArea = true;
  6297. tabID = 13;
  6298. tabAreaAltered = true;
  6299. }
  6300. }
  6301. }
  6302.  
  6303. private void resetImageProducers2() {
  6304. if (aRSImageProducer_1166 != null)
  6305. return;
  6306. nullLoader();
  6307. super.fullGameScreen = null;
  6308. aRSImageProducer_1107 = null;
  6309. aRSImageProducer_1108 = null;
  6310. aRSImageProducer_1109 = null;
  6311. aRSImageProducer_1110 = null;
  6312. aRSImageProducer_1111 = null;
  6313. aRSImageProducer_1112 = null;
  6314. aRSImageProducer_1113 = null;
  6315. aRSImageProducer_1114 = null;
  6316. aRSImageProducer_1115 = null;
  6317. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  6318. getGameComponent());
  6319. aRSImageProducer_1164 = new RSImageProducer(246, 164,
  6320. getGameComponent());
  6321. DrawingArea.setAllPixelsToZero();
  6322. mapBack[0].drawBackground(0, 0);
  6323. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  6324. getGameComponent());
  6325. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  6326. getGameComponent());
  6327. DrawingArea.setAllPixelsToZero();
  6328. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6329. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6330. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6331. welcomeScreenRaised = true;
  6332. }
  6333.  
  6334. public String getDocumentBaseHost() {
  6335. if (signlink.mainapp != null) {
  6336. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6337. }
  6338. if (super.gameFrame != null) {
  6339. return ""; // runescape.com <- removed for Jframe to work
  6340. } else {
  6341. return ""; // super.getDocumentBase().getHost().toLowerCase() <-
  6342. // removed for Jframe to work
  6343. }
  6344. }
  6345.  
  6346. public void method81(Sprite sprite, int j, int k) {
  6347. int l = k * k + j * j;
  6348. if (l > 4225 && l < 0x15f90) {
  6349. int i1 = viewRotation + minimapRotation & 0x7ff;
  6350. int j1 = Model.modelIntArray1[i1];
  6351. int k1 = Model.modelIntArray2[i1];
  6352. j1 = (j1 * 256) / (minimapZoom + 256);
  6353. k1 = (k1 * 256) / (minimapZoom + 256);
  6354. int l1 = j * j1 + k * k1 >> 16;
  6355. int i2 = j * k1 - k * j1 >> 16;
  6356. double d = Math.atan2(l1, i2);
  6357. int j2 = (int) (Math.sin(d) * 63D);
  6358. int k2 = (int) (Math.cos(d) * 57D);
  6359. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6360. } else {
  6361. markMinimap(sprite, k, j);
  6362. }
  6363. }
  6364.  
  6365. public void rightClickChatButtons() {
  6366. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482
  6367. && super.mouseY <= 503) {
  6368. menuActionName[1] = "View All";
  6369. menuActionID[1] = 999;
  6370. menuActionRow = 2;
  6371. } else if (super.mouseX >= 71 && super.mouseX <= 127
  6372. && super.mouseY >= 482 && super.mouseY <= 503) {
  6373. menuActionName[1] = "View Game";
  6374. menuActionID[1] = 998;
  6375. menuActionRow = 2;
  6376. } else if (super.mouseX >= 137 && super.mouseX <= 193
  6377. && super.mouseY >= 482 && super.mouseY <= 503) {
  6378. menuActionName[1] = "Hide public";
  6379. menuActionID[1] = 997;
  6380. menuActionName[2] = "Off public";
  6381. menuActionID[2] = 996;
  6382. menuActionName[3] = "Friends public";
  6383. menuActionID[3] = 995;
  6384. menuActionName[4] = "On public";
  6385. menuActionID[4] = 994;
  6386. menuActionName[5] = "View public";
  6387. menuActionID[5] = 993;
  6388. menuActionRow = 6;
  6389. } else if (super.mouseX >= 203 && super.mouseX <= 259
  6390. && super.mouseY >= 482 && super.mouseY <= 503) {
  6391. menuActionName[1] = "Off private";
  6392. menuActionID[1] = 992;
  6393. menuActionName[2] = "Friends private";
  6394. menuActionID[2] = 991;
  6395. menuActionName[3] = "On private";
  6396. menuActionID[3] = 990;
  6397. menuActionName[4] = "View private";
  6398. menuActionID[4] = 989;
  6399. menuActionRow = 5;
  6400. } else if (super.mouseX >= 269 && super.mouseX <= 325
  6401. && super.mouseY >= 482 && super.mouseY <= 503) {
  6402. menuActionName[1] = "Off clan chat";
  6403. menuActionID[1] = 1003;
  6404. menuActionName[2] = "Friends clan chat";
  6405. menuActionID[2] = 1002;
  6406. menuActionName[3] = "On clan chat";
  6407. menuActionID[3] = 1001;
  6408. menuActionName[4] = "View clan chat";
  6409. menuActionID[4] = 1000;
  6410. menuActionRow = 5;
  6411. } else if (super.mouseX >= 335 && super.mouseX <= 391
  6412. && super.mouseY >= 482 && super.mouseY <= 503) {
  6413. menuActionName[1] = "Off trade";
  6414. menuActionID[1] = 987;
  6415. menuActionName[2] = "Friends trade";
  6416. menuActionID[2] = 986;
  6417. menuActionName[3] = "On trade";
  6418. menuActionID[3] = 985;
  6419. menuActionName[4] = "View trade";
  6420. menuActionID[4] = 984;
  6421. menuActionRow = 5;
  6422. }
  6423. }
  6424.  
  6425. public void processRightClick() {
  6426. if (activeInterfaceType != 0) {
  6427. return;
  6428. }
  6429. menuActionName[0] = "Cancel";
  6430. menuActionID[0] = 1107;
  6431. menuActionRow = 1;
  6432. if (fullscreenInterfaceID != -1) {
  6433. anInt886 = 0;
  6434. anInt1315 = 0;
  6435. buildInterfaceMenu(8,
  6436. RSInterface.interfaceCache[fullscreenInterfaceID],
  6437. super.mouseX, 8, super.mouseY, 0);
  6438. if (anInt886 != anInt1026) {
  6439. anInt1026 = anInt886;
  6440. }
  6441. if (anInt1315 != anInt1129) {
  6442. anInt1129 = anInt1315;
  6443. }
  6444. return;
  6445. }
  6446. buildSplitPrivateChatMenu();
  6447. anInt886 = 0;
  6448. anInt1315 = 0;
  6449. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516
  6450. && super.mouseY < 338) {
  6451. if (openInterfaceID != -1) {
  6452. buildInterfaceMenu(4,
  6453. RSInterface.interfaceCache[openInterfaceID],
  6454. super.mouseX, 4, super.mouseY, 0);
  6455. } else {
  6456. build3dScreenMenu();
  6457. }
  6458. }
  6459. if (anInt886 != anInt1026) {
  6460. anInt1026 = anInt886;
  6461. }
  6462. if (anInt1315 != anInt1129) {
  6463. anInt1129 = anInt1315;
  6464. }
  6465. anInt886 = 0;
  6466. anInt1315 = 0;
  6467. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740
  6468. && super.mouseY < 468) {
  6469. if (invOverlayInterfaceID != -1) {
  6470. buildInterfaceMenu(548,
  6471. RSInterface.interfaceCache[invOverlayInterfaceID],
  6472. super.mouseX, 207, super.mouseY, 0);
  6473. } else if (tabInterfaceIDs[tabID] != -1) {
  6474. buildInterfaceMenu(548,
  6475. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  6476. super.mouseX, 207, super.mouseY, 0);
  6477. }
  6478. }
  6479. if (anInt886 != anInt1048) {
  6480. needDrawTabArea = true;
  6481. tabAreaAltered = true;
  6482. anInt1048 = anInt886;
  6483. }
  6484. if (anInt1315 != anInt1044) {
  6485. needDrawTabArea = true;
  6486. tabAreaAltered = true;
  6487. anInt1044 = anInt1315;
  6488. }
  6489. anInt886 = 0;
  6490. anInt1315 = 0;
  6491. if (super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490
  6492. && super.mouseY < 463) {
  6493. if (backDialogID != -1) {
  6494. buildInterfaceMenu(20,
  6495. RSInterface.interfaceCache[backDialogID], super.mouseX,
  6496. 358, super.mouseY, 0);
  6497. } else if (super.mouseY < 463 && super.mouseX < 490) {
  6498. buildChatAreaMenu(super.mouseY - 338);
  6499. }
  6500. }
  6501. if (backDialogID != -1 && anInt886 != anInt1039) {
  6502. inputTaken = true;
  6503. anInt1039 = anInt886;
  6504. }
  6505. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6506. inputTaken = true;
  6507. anInt1500 = anInt1315;
  6508. }
  6509. /* Enable custom right click areas */
  6510. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516
  6511. && super.mouseY < 503)
  6512. rightClickChatButtons();
  6513. /**/
  6514. boolean flag = false;
  6515. while (!flag) {
  6516. flag = true;
  6517. for (int j = 0; j < menuActionRow - 1; j++) {
  6518. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6519. String s = menuActionName[j];
  6520. menuActionName[j] = menuActionName[j + 1];
  6521. menuActionName[j + 1] = s;
  6522. int k = menuActionID[j];
  6523. menuActionID[j] = menuActionID[j + 1];
  6524. menuActionID[j + 1] = k;
  6525. k = menuActionCmd2[j];
  6526. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6527. menuActionCmd2[j + 1] = k;
  6528. k = menuActionCmd3[j];
  6529. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6530. menuActionCmd3[j + 1] = k;
  6531. k = menuActionCmd1[j];
  6532. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6533. menuActionCmd1[j + 1] = k;
  6534. flag = false;
  6535. }
  6536. }
  6537. }
  6538. }
  6539.  
  6540. private int method83(int i, int j, int k) {
  6541. int l = 256 - k;
  6542. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  6543. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6544. }
  6545.  
  6546. public void login(String s, String s1, boolean flag) {
  6547. signlink.errorname = s;
  6548. try {
  6549. if (!flag) {
  6550. loginMessage1 = "";
  6551. loginMessage2 = "Connecting to server...";
  6552. drawLoginScreen(true);
  6553. }
  6554. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6555. long l = TextClass.longForName(s);
  6556. int i = (int) (l >> 16 & 31L);
  6557. stream.currentOffset = 0;
  6558. stream.writeWordBigEndian(14);
  6559. stream.writeWordBigEndian(i);
  6560. socketStream.queueBytes(2, stream.buffer);
  6561. for (int j = 0; j < 8; j++)
  6562. socketStream.read();
  6563.  
  6564. int k = socketStream.read();
  6565. int i1 = k;
  6566. if (k == 0) {
  6567. socketStream.flushInputStream(inStream.buffer, 8);
  6568. inStream.currentOffset = 0;
  6569. aLong1215 = inStream.readQWord();
  6570. int ai[] = new int[4];
  6571. ai[0] = (int) (Math.random() * 99999999D);
  6572. ai[1] = (int) (Math.random() * 99999999D);
  6573. ai[2] = (int) (aLong1215 >> 32);
  6574. ai[3] = (int) aLong1215;
  6575. stream.currentOffset = 0;
  6576. stream.writeWordBigEndian(10);
  6577. stream.writeDWord(ai[0]);
  6578. stream.writeDWord(ai[1]);
  6579. stream.writeDWord(ai[2]);
  6580. stream.writeDWord(ai[3]);
  6581. stream.writeDWord(signlink.uid);
  6582. stream.writeString(s);
  6583. stream.writeString(s1);
  6584. stream.doKeys();
  6585. aStream_847.currentOffset = 0;
  6586. if (flag)
  6587. aStream_847.writeWordBigEndian(18);
  6588. else
  6589. aStream_847.writeWordBigEndian(16);
  6590. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  6591. + 1 + 2);
  6592. aStream_847.writeWordBigEndian(255);
  6593. aStream_847.writeWord(317);
  6594. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6595. for (int l1 = 0; l1 < 9; l1++)
  6596. aStream_847.writeDWord(expectedCRCs[l1]);
  6597.  
  6598. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6599. stream.encryption = new ISAACRandomGen(ai);
  6600. for (int j2 = 0; j2 < 4; j2++)
  6601. ai[j2] += 50;
  6602.  
  6603. encryption = new ISAACRandomGen(ai);
  6604. socketStream.queueBytes(aStream_847.currentOffset,
  6605. aStream_847.buffer);
  6606. k = socketStream.read();
  6607. }
  6608. if (k == 1) {
  6609. try {
  6610. Thread.sleep(2000L);
  6611. } catch (Exception _ex) {
  6612. }
  6613. login(s, s1, flag);
  6614. Notify notifyManager = new Notify();
  6615. notifyManager.showNotify( new ImageIcon( Notify.icon ), ""+ System.lineSeparator() + "Welcome to Project-Text! "+ System.lineSeparator() + "Logged in as: " +myUsername );
  6616. return;
  6617. }
  6618. if (k == 2) {
  6619. Notify notifyManager = new Notify();
  6620. notifyManager.showNotify( new ImageIcon( Notify.icon ), ""+ System.lineSeparator() + "Welcome to Project-Text! "+ System.lineSeparator() + "Logged in as: " +myUsername );
  6621. myPrivilege = socketStream.read();
  6622. flagged = socketStream.read() == 1;
  6623. aLong1220 = 0L;
  6624. anInt1022 = 0;
  6625. mouseDetection.coordsIndex = 0;
  6626. super.awtFocus = true;
  6627. aBoolean954 = true;
  6628. loggedIn = true;
  6629. stream.currentOffset = 0;
  6630. inStream.currentOffset = 0;
  6631. pktType = -1;
  6632. anInt841 = -1;
  6633. anInt842 = -1;
  6634. anInt843 = -1;
  6635. pktSize = 0;
  6636. anInt1009 = 0;
  6637. anInt1104 = 0;
  6638. anInt1011 = 0;
  6639. anInt855 = 0;
  6640. menuActionRow = 0;
  6641. menuOpen = false;
  6642. super.idleTime = 0;
  6643. for (int j1 = 0; j1 < 500; j1++)
  6644. chatMessages[j1] = null;
  6645.  
  6646. itemSelected = 0;
  6647. spellSelected = 0;
  6648. loadingStage = 0;
  6649. anInt1062 = 0;
  6650. setNorth();
  6651. anInt1021 = 0;
  6652. anInt985 = -1;
  6653. destX = 0;
  6654. destY = 0;
  6655. playerCount = 0;
  6656. npcCount = 0;
  6657. for (int i2 = 0; i2 < maxPlayers; i2++) {
  6658. playerArray[i2] = null;
  6659. aStreamArray895s[i2] = null;
  6660. }
  6661.  
  6662. for (int k2 = 0; k2 < 16384; k2++)
  6663. npcArray[k2] = null;
  6664.  
  6665. myPlayer = playerArray[myPlayerIndex] = new Player();
  6666. aClass19_1013.removeAll();
  6667. aClass19_1056.removeAll();
  6668. for (int l2 = 0; l2 < 4; l2++) {
  6669. for (int i3 = 0; i3 < 104; i3++) {
  6670. for (int k3 = 0; k3 < 104; k3++)
  6671. groundArray[l2][i3][k3] = null;
  6672.  
  6673. }
  6674.  
  6675. }
  6676.  
  6677. aClass19_1179 = new NodeList();
  6678. fullscreenInterfaceID = -1;
  6679. anInt900 = 0;
  6680. friendsCount = 0;
  6681. dialogID = -1;
  6682. backDialogID = -1;
  6683. openInterfaceID = -1;
  6684. invOverlayInterfaceID = -1;
  6685. anInt1018 = -1;
  6686. aBoolean1149 = false;
  6687. tabID = 3;
  6688. inputDialogState = 0;
  6689. menuOpen = false;
  6690. messagePromptRaised = false;
  6691. aString844 = null;
  6692. anInt1055 = 0;
  6693. anInt1054 = -1;
  6694. aBoolean1047 = true;
  6695. method45();
  6696. for (int j3 = 0; j3 < 5; j3++)
  6697. anIntArray990[j3] = 0;
  6698.  
  6699. for (int l3 = 0; l3 < 5; l3++) {
  6700. atPlayerActions[l3] = null;
  6701. atPlayerArray[l3] = false;
  6702. }
  6703.  
  6704. anInt1175 = 0;
  6705. anInt1134 = 0;
  6706. anInt986 = 0;
  6707. anInt1288 = 0;
  6708. anInt924 = 0;
  6709. anInt1188 = 0;
  6710. anInt1155 = 0;
  6711. anInt1226 = 0;
  6712. int anInt941 = 0;
  6713. int anInt1260 = 0;
  6714. resetImageProducers2();
  6715. return;
  6716. }
  6717. if (k == 3) {
  6718. loginMessage1 = "";
  6719. loginMessage2 = "Invalid username or password.";
  6720. return;
  6721. }
  6722. if (k == 4) {
  6723. loginMessage1 = "Your account has been disabled.";
  6724. loginMessage2 = "Please check your message-center for details.";
  6725. return;
  6726. }
  6727. if (k == 5) {
  6728. loginMessage1 = "Your account is already logged in.";
  6729. loginMessage2 = "Try again in 60 secs...";
  6730. return;
  6731. }
  6732. if (k == 6) {
  6733. loginMessage1 = "RuneScape has been updated!";
  6734. loginMessage2 = "Please reload this page.";
  6735. return;
  6736. }
  6737. if (k == 7) {
  6738. loginMessage1 = "This world is full.";
  6739. loginMessage2 = "Please use a different world.";
  6740. return;
  6741. }
  6742. if (k == 8) {
  6743. loginMessage1 = "Unable to connect.";
  6744. loginMessage2 = "Login server offline.";
  6745. return;
  6746. }
  6747. if (k == 9) {
  6748. loginMessage1 = "Login limit exceeded.";
  6749. loginMessage2 = "Too many connections from your address.";
  6750. return;
  6751. }
  6752. if (k == 10) {
  6753. loginMessage1 = "Unable to connect.";
  6754. loginMessage2 = "Bad session id.";
  6755. return;
  6756. }
  6757. if (k == 11) {
  6758. loginMessage2 = "Login server rejected session.";
  6759. loginMessage2 = "Please try again.";
  6760. return;
  6761. }
  6762. if (k == 12) {
  6763. loginMessage1 = "You need a members account to login to this world.";
  6764. loginMessage2 = "Please subscribe, or use a different world.";
  6765. return;
  6766. }
  6767. if (k == 13) {
  6768. loginMessage1 = "Could not complete login.";
  6769. loginMessage2 = "Please try using a different world.";
  6770. return;
  6771. }
  6772. if (k == 14) {
  6773. loginMessage1 = "The server is being updated.";
  6774. loginMessage2 = "Please wait 1 minute and try again.";
  6775. return;
  6776. }
  6777. if (k == 15) {
  6778. loggedIn = true;
  6779. stream.currentOffset = 0;
  6780. inStream.currentOffset = 0;
  6781. pktType = -1;
  6782. anInt841 = -1;
  6783. anInt842 = -1;
  6784. anInt843 = -1;
  6785. pktSize = 0;
  6786. anInt1009 = 0;
  6787. anInt1104 = 0;
  6788. menuActionRow = 0;
  6789. menuOpen = false;
  6790. aLong824 = System.currentTimeMillis();
  6791. return;
  6792. }
  6793. if (k == 16) {
  6794. loginMessage1 = "Login attempts exceeded.";
  6795. loginMessage2 = "Please wait 1 minute and try again.";
  6796. return;
  6797. }
  6798. if (k == 17) {
  6799. loginMessage1 = "You are standing in a members-only area.";
  6800. loginMessage2 = "To play on this world move to a free area first";
  6801. return;
  6802. }
  6803. if (k == 20) {
  6804. loginMessage1 = "Invalid loginserver requested";
  6805. loginMessage2 = "Please try using a different world.";
  6806. return;
  6807. }
  6808. if (k == 21) {
  6809. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  6810. loginMessage1 = "You have only just left another world";
  6811. loginMessage2 = "Your profile will be transferred in: "
  6812. + k1 + " seconds";
  6813. drawLoginScreen(true);
  6814. try {
  6815. Thread.sleep(1000L);
  6816. } catch (Exception _ex) {
  6817. }
  6818. }
  6819.  
  6820. login(s, s1, flag);
  6821. return;
  6822. }
  6823. if (k == -1) {
  6824. if (i1 == 0) {
  6825. if (loginFailures < 2) {
  6826. try {
  6827. Thread.sleep(2000L);
  6828. } catch (Exception _ex) {
  6829. }
  6830. loginFailures++;
  6831. login(s, s1, flag);
  6832. return;
  6833. } else {
  6834. loginMessage1 = "No response from loginserver";
  6835. loginMessage2 = "Please wait 1 minute and try again.";
  6836. return;
  6837. }
  6838. } else {
  6839. loginMessage1 = "No response from server";
  6840. loginMessage2 = "Please try using a different world.";
  6841. return;
  6842. }
  6843. } else {
  6844. System.out.println("response:" + k);
  6845. loginMessage1 = "Unexpected server response";
  6846. loginMessage2 = "Please try using a different world.";
  6847. return;
  6848. }
  6849. } catch (IOException _ex) {
  6850. loginMessage1 = "";
  6851. }
  6852. loginMessage2 = "Error connecting to server.";
  6853. }
  6854.  
  6855. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  6856. int l1, int i2, int j2, boolean flag, int k2) {
  6857. byte byte0 = 104;
  6858. byte byte1 = 104;
  6859. for (int l2 = 0; l2 < byte0; l2++) {
  6860. for (int i3 = 0; i3 < byte1; i3++) {
  6861. anIntArrayArray901[l2][i3] = 0;
  6862. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6863. }
  6864. }
  6865. int j3 = j2;
  6866. int k3 = j1;
  6867. anIntArrayArray901[j2][j1] = 99;
  6868. anIntArrayArray825[j2][j1] = 0;
  6869. int l3 = 0;
  6870. int i4 = 0;
  6871. bigX[l3] = j2;
  6872. bigY[l3++] = j1;
  6873. boolean flag1 = false;
  6874. int j4 = bigX.length;
  6875. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6876. while (i4 != l3) {
  6877. j3 = bigX[i4];
  6878. k3 = bigY[i4];
  6879. i4 = (i4 + 1) % j4;
  6880. if (j3 == k2 && k3 == i2) {
  6881. flag1 = true;
  6882. break;
  6883. }
  6884. if (i1 != 0) {
  6885. if ((i1 < 5 || i1 == 10)
  6886. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  6887. i1 - 1, i2)) {
  6888. flag1 = true;
  6889. break;
  6890. }
  6891. if (i1 < 10
  6892. && aClass11Array1230[plane].method220(k2, i2, k3,
  6893. i1 - 1, j, j3)) {
  6894. flag1 = true;
  6895. break;
  6896. }
  6897. }
  6898. if (k1 != 0
  6899. && k != 0
  6900. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  6901. k1, k3)) {
  6902. flag1 = true;
  6903. break;
  6904. }
  6905. int l4 = anIntArrayArray825[j3][k3] + 1;
  6906. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  6907. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  6908. bigX[l3] = j3 - 1;
  6909. bigY[l3] = k3;
  6910. l3 = (l3 + 1) % j4;
  6911. anIntArrayArray901[j3 - 1][k3] = 2;
  6912. anIntArrayArray825[j3 - 1][k3] = l4;
  6913. }
  6914. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  6915. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  6916. bigX[l3] = j3 + 1;
  6917. bigY[l3] = k3;
  6918. l3 = (l3 + 1) % j4;
  6919. anIntArrayArray901[j3 + 1][k3] = 8;
  6920. anIntArrayArray825[j3 + 1][k3] = l4;
  6921. }
  6922. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  6923. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  6924. bigX[l3] = j3;
  6925. bigY[l3] = k3 - 1;
  6926. l3 = (l3 + 1) % j4;
  6927. anIntArrayArray901[j3][k3 - 1] = 1;
  6928. anIntArrayArray825[j3][k3 - 1] = l4;
  6929. }
  6930. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  6931. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  6932. bigX[l3] = j3;
  6933. bigY[l3] = k3 + 1;
  6934. l3 = (l3 + 1) % j4;
  6935. anIntArrayArray901[j3][k3 + 1] = 4;
  6936. anIntArrayArray825[j3][k3 + 1] = l4;
  6937. }
  6938. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  6939. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  6940. && (ai[j3 - 1][k3] & 0x1280108) == 0
  6941. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  6942. bigX[l3] = j3 - 1;
  6943. bigY[l3] = k3 - 1;
  6944. l3 = (l3 + 1) % j4;
  6945. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6946. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6947. }
  6948. if (j3 < byte0 - 1 && k3 > 0
  6949. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  6950. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  6951. && (ai[j3 + 1][k3] & 0x1280180) == 0
  6952. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  6953. bigX[l3] = j3 + 1;
  6954. bigY[l3] = k3 - 1;
  6955. l3 = (l3 + 1) % j4;
  6956. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6957. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6958. }
  6959. if (j3 > 0 && k3 < byte1 - 1
  6960. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  6961. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  6962. && (ai[j3 - 1][k3] & 0x1280108) == 0
  6963. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  6964. bigX[l3] = j3 - 1;
  6965. bigY[l3] = k3 + 1;
  6966. l3 = (l3 + 1) % j4;
  6967. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6968. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6969. }
  6970. if (j3 < byte0 - 1 && k3 < byte1 - 1
  6971. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  6972. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  6973. && (ai[j3 + 1][k3] & 0x1280180) == 0
  6974. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  6975. bigX[l3] = j3 + 1;
  6976. bigY[l3] = k3 + 1;
  6977. l3 = (l3 + 1) % j4;
  6978. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6979. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6980. }
  6981. }
  6982. anInt1264 = 0;
  6983. if (!flag1) {
  6984. if (flag) {
  6985. int i5 = 100;
  6986. for (int k5 = 1; k5 < 2; k5++) {
  6987. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  6988. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6989. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  6990. && anIntArrayArray825[i6][l6] < i5) {
  6991. i5 = anIntArrayArray825[i6][l6];
  6992. j3 = i6;
  6993. k3 = l6;
  6994. anInt1264 = 1;
  6995. flag1 = true;
  6996. }
  6997.  
  6998. }
  6999.  
  7000. if (flag1)
  7001. break;
  7002. }
  7003.  
  7004. }
  7005. if (!flag1)
  7006. return false;
  7007. }
  7008. i4 = 0;
  7009. bigX[i4] = j3;
  7010. bigY[i4++] = k3;
  7011. int l5;
  7012. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  7013. if (j5 != l5) {
  7014. l5 = j5;
  7015. bigX[i4] = j3;
  7016. bigY[i4++] = k3;
  7017. }
  7018. if ((j5 & 2) != 0)
  7019. j3++;
  7020. else if ((j5 & 8) != 0)
  7021. j3--;
  7022. if ((j5 & 1) != 0)
  7023. k3++;
  7024. else if ((j5 & 4) != 0)
  7025. k3--;
  7026. }
  7027. // if(cancelWalk) { return i4 > 0; }
  7028.  
  7029. if (i4 > 0) {
  7030. int k4 = i4;
  7031. if (k4 > 25)
  7032. k4 = 25;
  7033. i4--;
  7034. int k6 = bigX[i4];
  7035. int i7 = bigY[i4];
  7036. anInt1288 += k4;
  7037. if (anInt1288 >= 92) {
  7038. stream.createFrame(36);
  7039. stream.writeDWord(0);
  7040. anInt1288 = 0;
  7041. }
  7042. if (i == 0) {
  7043. stream.createFrame(164);
  7044. stream.writeWordBigEndian(k4 + k4 + 3);
  7045. }
  7046. if (i == 1) {
  7047. stream.createFrame(248);
  7048. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7049. }
  7050. if (i == 2) {
  7051. stream.createFrame(98);
  7052. stream.writeWordBigEndian(k4 + k4 + 3);
  7053. }
  7054. stream.method433(k6 + baseX);
  7055. destX = bigX[0];
  7056. destY = bigY[0];
  7057. for (int j7 = 1; j7 < k4; j7++) {
  7058. i4--;
  7059. stream.writeWordBigEndian(bigX[i4] - k6);
  7060. stream.writeWordBigEndian(bigY[i4] - i7);
  7061. }
  7062.  
  7063. stream.method431(i7 + baseY);
  7064. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7065. return true;
  7066. }
  7067. return i != 1;
  7068. }
  7069.  
  7070. public void method86(Stream stream) {
  7071. for (int j = 0; j < anInt893; j++) {
  7072. int k = anIntArray894[j];
  7073. NPC npc = npcArray[k];
  7074. int l = stream.readUnsignedByte();
  7075. if ((l & 0x10) != 0) {
  7076. int i1 = stream.method434();
  7077. if (i1 == 65535)
  7078. i1 = -1;
  7079. int i2 = stream.readUnsignedByte();
  7080. if (i1 == npc.anim && i1 != -1) {
  7081. int l2 = Animation.anims[i1].anInt365;
  7082. if (l2 == 1) {
  7083. npc.anInt1527 = 0;
  7084. npc.anInt1528 = 0;
  7085. npc.anInt1529 = i2;
  7086. npc.anInt1530 = 0;
  7087. }
  7088. if (l2 == 2)
  7089. npc.anInt1530 = 0;
  7090. } else if (i1 == -1
  7091. || npc.anim == -1
  7092. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  7093. npc.anim = i1;
  7094. npc.anInt1527 = 0;
  7095. npc.anInt1528 = 0;
  7096. npc.anInt1529 = i2;
  7097. npc.anInt1530 = 0;
  7098. npc.anInt1542 = npc.smallXYIndex;
  7099. }
  7100. }
  7101. if ((l & 8) != 0) {
  7102. int j1 = stream.method426();
  7103. int j2 = stream.method427();
  7104. npc.updateHitData(j2, j1, loopCycle);
  7105. npc.loopCycleStatus = loopCycle + 300;
  7106. npc.currentHealth = stream.method426();
  7107. npc.maxHealth = stream.readUnsignedByte();
  7108. }
  7109. if ((l & 0x80) != 0) {
  7110. npc.anInt1520 = stream.readUnsignedWord();
  7111. int k1 = stream.readDWord();
  7112. npc.anInt1524 = k1 >> 16;
  7113. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7114. npc.anInt1521 = 0;
  7115. npc.anInt1522 = 0;
  7116. if (npc.anInt1523 > loopCycle)
  7117. npc.anInt1521 = -1;
  7118. if (npc.anInt1520 == 65535)
  7119. npc.anInt1520 = -1;
  7120. }
  7121. if ((l & 0x20) != 0) {
  7122. npc.interactingEntity = stream.readUnsignedWord();
  7123. if (npc.interactingEntity == 65535)
  7124. npc.interactingEntity = -1;
  7125. }
  7126. if ((l & 1) != 0) {
  7127. npc.textSpoken = stream.readString();
  7128. npc.textCycle = 100;
  7129. // entityMessage(npc);
  7130.  
  7131. }
  7132. if ((l & 0x40) != 0) {
  7133. int l1 = stream.method427();
  7134. int k2 = stream.method428();
  7135. npc.updateHitData(k2, l1, loopCycle);
  7136. npc.loopCycleStatus = loopCycle + 300;
  7137. npc.currentHealth = stream.method428();
  7138. npc.maxHealth = stream.method427();
  7139. }
  7140. if ((l & 2) != 0) {
  7141. npc.desc = EntityDef.forID(stream.method436());
  7142. npc.anInt1540 = npc.desc.aByte68;
  7143. npc.anInt1504 = npc.desc.anInt79;
  7144. npc.anInt1554 = npc.desc.walkAnim;
  7145. npc.anInt1555 = npc.desc.anInt58;
  7146. npc.anInt1556 = npc.desc.anInt83;
  7147. npc.anInt1557 = npc.desc.anInt55;
  7148. npc.anInt1511 = npc.desc.standAnim;
  7149. }
  7150. if ((l & 4) != 0) {
  7151. npc.anInt1538 = stream.method434();
  7152. npc.anInt1539 = stream.method434();
  7153. }
  7154. }
  7155. }
  7156.  
  7157. public void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  7158. if (menuActionRow >= 400)
  7159. return;
  7160. if (entityDef.childrenIDs != null)
  7161. entityDef = entityDef.method161();
  7162. if (entityDef == null)
  7163. return;
  7164. if (!entityDef.aBoolean84)
  7165. return;
  7166. String s = entityDef.name;
  7167. if (entityDef.combatLevel != 0)
  7168. s = s
  7169. + combatDiffColor(myPlayer.combatLevel,
  7170. entityDef.combatLevel) + " (level-"
  7171. + entityDef.combatLevel + ")";
  7172. if (itemSelected == 1) {
  7173. menuActionName[menuActionRow] = "Use " + selectedItemName
  7174. + " with @yel@" + s;
  7175. menuActionID[menuActionRow] = 582;
  7176. menuActionCmd1[menuActionRow] = i;
  7177. menuActionCmd2[menuActionRow] = k;
  7178. menuActionCmd3[menuActionRow] = j;
  7179. menuActionRow++;
  7180. return;
  7181. }
  7182. if (spellSelected == 1) {
  7183. if ((spellUsableOn & 2) == 2) {
  7184. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7185. menuActionID[menuActionRow] = 413;
  7186. menuActionCmd1[menuActionRow] = i;
  7187. menuActionCmd2[menuActionRow] = k;
  7188. menuActionCmd3[menuActionRow] = j;
  7189. menuActionRow++;
  7190. }
  7191. } else {
  7192. if (entityDef.actions != null) {
  7193. for (int l = 4; l >= 0; l--)
  7194. if (entityDef.actions[l] != null
  7195. && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  7196. menuActionName[menuActionRow] = entityDef.actions[l]
  7197. + " @yel@" + s;
  7198. if (l == 0)
  7199. menuActionID[menuActionRow] = 20;
  7200. if (l == 1)
  7201. menuActionID[menuActionRow] = 412;
  7202. if (l == 2)
  7203. menuActionID[menuActionRow] = 225;
  7204. if (l == 3)
  7205. menuActionID[menuActionRow] = 965;
  7206. if (l == 4)
  7207. menuActionID[menuActionRow] = 478;
  7208. menuActionCmd1[menuActionRow] = i;
  7209. menuActionCmd2[menuActionRow] = k;
  7210. menuActionCmd3[menuActionRow] = j;
  7211. menuActionRow++;
  7212. }
  7213.  
  7214. }
  7215. if (entityDef.actions != null) {
  7216. for (int i1 = 4; i1 >= 0; i1--)
  7217. if (entityDef.actions[i1] != null
  7218. && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  7219. char c = '\0';
  7220. if (entityDef.combatLevel > myPlayer.combatLevel)
  7221. c = '\u07D0';
  7222. menuActionName[menuActionRow] = entityDef.actions[i1]
  7223. + " @yel@" + s;
  7224. if (i1 == 0)
  7225. menuActionID[menuActionRow] = 20 + c;
  7226. if (i1 == 1)
  7227. menuActionID[menuActionRow] = 412 + c;
  7228. if (i1 == 2)
  7229. menuActionID[menuActionRow] = 225 + c;
  7230. if (i1 == 3)
  7231. menuActionID[menuActionRow] = 965 + c;
  7232. if (i1 == 4)
  7233. menuActionID[menuActionRow] = 478 + c;
  7234. menuActionCmd1[menuActionRow] = i;
  7235. menuActionCmd2[menuActionRow] = k;
  7236. menuActionCmd3[menuActionRow] = j;
  7237. menuActionRow++;
  7238. }
  7239.  
  7240. }
  7241. // menuActionName[menuActionRow] = "Examine @yel@" + s +
  7242. // " @gre@(@whi@" + entityDef.type + "@gre@)";
  7243. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7244. menuActionID[menuActionRow] = 1025;
  7245. menuActionCmd1[menuActionRow] = i;
  7246. menuActionCmd2[menuActionRow] = k;
  7247. menuActionCmd3[menuActionRow] = j;
  7248. menuActionRow++;
  7249. }
  7250. }
  7251.  
  7252. public void buildAtPlayerMenu(int i, int j, Player player, int k) {
  7253. if (player == myPlayer)
  7254. return;
  7255. if (menuActionRow >= 400)
  7256. return;
  7257. String s;
  7258. if (player.skill == 0)
  7259. s = player.name
  7260. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  7261. + " (level-" + player.combatLevel + ")";
  7262. else
  7263. s = player.name + " (skill-" + player.skill + ")";
  7264. if (itemSelected == 1) {
  7265. menuActionName[menuActionRow] = "Use " + selectedItemName
  7266. + " with @whi@" + s;
  7267. menuActionID[menuActionRow] = 491;
  7268. menuActionCmd1[menuActionRow] = j;
  7269. menuActionCmd2[menuActionRow] = i;
  7270. menuActionCmd3[menuActionRow] = k;
  7271. menuActionRow++;
  7272. } else if (spellSelected == 1) {
  7273. if ((spellUsableOn & 8) == 8) {
  7274. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7275. menuActionID[menuActionRow] = 365;
  7276. menuActionCmd1[menuActionRow] = j;
  7277. menuActionCmd2[menuActionRow] = i;
  7278. menuActionCmd3[menuActionRow] = k;
  7279. menuActionRow++;
  7280. }
  7281. } else {
  7282. for (int l = 4; l >= 0; l--)
  7283. if (atPlayerActions[l] != null) {
  7284. menuActionName[menuActionRow] = atPlayerActions[l]
  7285. + " @whi@" + s;
  7286. char c = '\0';
  7287. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  7288. if (player.combatLevel > myPlayer.combatLevel)
  7289. c = '\u07D0';
  7290. if (myPlayer.team != 0 && player.team != 0)
  7291. if (myPlayer.team == player.team)
  7292. c = '\u07D0';
  7293. else
  7294. c = '\0';
  7295. } else if (atPlayerArray[l])
  7296. c = '\u07D0';
  7297. if (l == 0)
  7298. menuActionID[menuActionRow] = 561 + c;
  7299. if (l == 1)
  7300. menuActionID[menuActionRow] = 779 + c;
  7301. if (l == 2)
  7302. menuActionID[menuActionRow] = 27 + c;
  7303. if (l == 3)
  7304. menuActionID[menuActionRow] = 577 + c;
  7305. if (l == 4)
  7306. menuActionID[menuActionRow] = 729 + c;
  7307. menuActionCmd1[menuActionRow] = j;
  7308. menuActionCmd2[menuActionRow] = i;
  7309. menuActionCmd3[menuActionRow] = k;
  7310. menuActionRow++;
  7311. }
  7312.  
  7313. }
  7314. for (int i1 = 0; i1 < menuActionRow; i1++)
  7315. if (menuActionID[i1] == 516) {
  7316. menuActionName[i1] = "Walk here @whi@" + s;
  7317. return;
  7318. }
  7319.  
  7320. }
  7321.  
  7322. public void method89(Class30_Sub1 class30_sub1) {
  7323. int i = 0;
  7324. int j = -1;
  7325. int k = 0;
  7326. int l = 0;
  7327. if (class30_sub1.anInt1296 == 0)
  7328. i = worldController.method300(class30_sub1.anInt1295,
  7329. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7330. if (class30_sub1.anInt1296 == 1)
  7331. i = worldController.method301(class30_sub1.anInt1295,
  7332. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7333. if (class30_sub1.anInt1296 == 2)
  7334. i = worldController.method302(class30_sub1.anInt1295,
  7335. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7336. if (class30_sub1.anInt1296 == 3)
  7337. i = worldController.method303(class30_sub1.anInt1295,
  7338. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7339. if (i != 0) {
  7340. int i1 = worldController.method304(class30_sub1.anInt1295,
  7341. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7342. j = i >> 14 & 0x7fff;
  7343. k = i1 & 0x1f;
  7344. l = i1 >> 6;
  7345. }
  7346. class30_sub1.anInt1299 = j;
  7347. class30_sub1.anInt1301 = k;
  7348. class30_sub1.anInt1300 = l;
  7349. }
  7350.  
  7351. public void method90() {
  7352. for (int i = 0; i < anInt1062; i++)
  7353. if (anIntArray1250[i] <= 0) {
  7354. boolean flag1 = false;
  7355. try {
  7356. if (anIntArray1207[i] == anInt874
  7357. && anIntArray1241[i] == anInt1289) {
  7358. if (!replayWave())
  7359. flag1 = true;
  7360. } else {
  7361. Stream stream = Sounds.method241(anIntArray1241[i],
  7362. anIntArray1207[i]);
  7363. if (System.currentTimeMillis()
  7364. + (long) (stream.currentOffset / 22) > aLong1172
  7365. + (long) (anInt1257 / 22)) {
  7366. anInt1257 = stream.currentOffset;
  7367. aLong1172 = System.currentTimeMillis();
  7368. if (saveWave(stream.buffer, stream.currentOffset)) {
  7369. anInt874 = anIntArray1207[i];
  7370. anInt1289 = anIntArray1241[i];
  7371. } else {
  7372. flag1 = true;
  7373. }
  7374. }
  7375. }
  7376. } catch (Exception exception) {
  7377. }
  7378. if (!flag1 || anIntArray1250[i] == -5) {
  7379. anInt1062--;
  7380. for (int j = i; j < anInt1062; j++) {
  7381. anIntArray1207[j] = anIntArray1207[j + 1];
  7382. anIntArray1241[j] = anIntArray1241[j + 1];
  7383. anIntArray1250[j] = anIntArray1250[j + 1];
  7384. }
  7385.  
  7386. i--;
  7387. } else {
  7388. anIntArray1250[i] = -5;
  7389. }
  7390. } else {
  7391. anIntArray1250[i]--;
  7392. }
  7393.  
  7394. if (prevSong > 0) {
  7395. prevSong -= 20;
  7396. if (prevSong < 0)
  7397. prevSong = 0;
  7398. if (prevSong == 0 && musicEnabled && !lowMem) {
  7399. nextSong = currentSong;
  7400. songChanging = true;
  7401. onDemandFetcher.method558(2, nextSong);
  7402. }
  7403. }
  7404. }
  7405.  
  7406. void startUp() {
  7407. drawLoadingText(20, "Starting up");
  7408. new CacheDownloader(this).downloadCache();
  7409. if (signlink.sunjava)
  7410. super.minDelay = 5;
  7411. if (aBoolean993) {
  7412. // rsAlreadyLoaded = true;
  7413. // return;
  7414. }
  7415. aBoolean993 = true;
  7416. boolean flag = true;
  7417. String s = getDocumentBaseHost();
  7418. if (signlink.cache_dat != null) {
  7419. for (int i = 0; i < 5; i++)
  7420. decompressors[i] = new Decompressor(signlink.cache_dat,
  7421. signlink.cache_idx[i], i + 1);
  7422. }
  7423. try {
  7424. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  7425. expectedCRCs[1], 25);
  7426. smallText = new TextDrawingArea(false, "p11_full",
  7427. titleStreamLoader);
  7428. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full",
  7429. titleStreamLoader);
  7430. chatTextDrawingArea = new TextDrawingArea(false, "b12_full",
  7431. titleStreamLoader);
  7432. aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full",
  7433. titleStreamLoader);
  7434. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  7435. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  7436. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  7437. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  7438. drawLogo();
  7439. loadTitleScreen();
  7440. StreamLoader streamLoader = streamLoaderForName(2, "config",
  7441. "config", expectedCRCs[2], 30);
  7442. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  7443. "interface", expectedCRCs[3], 35);
  7444. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  7445. "media", expectedCRCs[4], 40);
  7446. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  7447. "textures", expectedCRCs[6], 45);
  7448. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  7449. "wordenc", expectedCRCs[7], 50);
  7450. StreamLoader streamLoader_5 = streamLoaderForName(8,
  7451. "sound effects", "sounds", expectedCRCs[8], 55);
  7452. byteGroundArray = new byte[4][104][104];
  7453. intGroundArray = new int[4][105][105];
  7454. worldController = new WorldController(intGroundArray);
  7455. for (int j = 0; j < 4; j++)
  7456. aClass11Array1230[j] = new Class11();
  7457.  
  7458. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7459. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  7460. "versionlist", expectedCRCs[5], 60);
  7461. drawLoadingText(60, "Connecting to update server");
  7462. onDemandFetcher = new OnDemandFetcher();
  7463. onDemandFetcher.start(streamLoader_6, this);
  7464. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  7465. // preloadModels();
  7466. // models();
  7467. drawLoadingText(80, "Unpacking media");
  7468. /* Custom sprite unpacking */
  7469. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7470. // mapIcon = new Sprite(streamLoader_2, "mapfunction", 70);
  7471. chatArea = new Sprite("Gameframe/chatarea");
  7472. tabArea = new Sprite("Gameframe/tabarea");
  7473. /**/
  7474. for (int m1 = 0; m1 <= 1; m1++)
  7475. mapBack[m1] = new Background(streamLoader_2, "mapback", m1);
  7476. for (int c1 = 0; c1 <= 3; c1++)
  7477. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7478. for (int j3 = 0; j3 <= 14; j3++)
  7479. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7480. for (int r1 = 0; r1 < 5; r1++)
  7481. redStones[r1] = new Sprite("Gameframe/redstones " + r1);
  7482. Sprite[] clanIcons = new Sprite[9];
  7483. for (int index = 0; index < clanIcons.length; index++) {
  7484. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);
  7485. }
  7486. RSFont.unpackImages(modIcons, clanIcons);
  7487. compass = new Sprite(streamLoader_2, "compass", 0);
  7488. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7489. mapEdge.method345();
  7490. try {
  7491. for (int k3 = 0; k3 < 100; k3++)
  7492. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  7493. k3);
  7494. } catch (Exception _ex) {
  7495. }
  7496. try {
  7497. for (int l3 = 0; l3 < 100; l3++)
  7498. mapFunctions[l3] = new Sprite(streamLoader_2,
  7499. "mapfunction", l3);
  7500. } catch (Exception _ex) {
  7501. }
  7502. try {
  7503. for (int i4 = 0; i4 < 20; i4++)
  7504. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7505. } catch (Exception _ex) {
  7506. }
  7507. try {
  7508. for (int h1 = 0; h1 < 6; h1++)
  7509. headIconsHint[h1] = new Sprite(streamLoader_2,
  7510. "headicons_hint", h1);
  7511. } catch (Exception _ex) {
  7512. }
  7513. try {
  7514. for (int j4 = 0; j4 < 8; j4++)
  7515. headIcons[j4] = new Sprite(streamLoader_2,
  7516. "headicons_prayer", j4);
  7517. for (int j45 = 0; j45 < 3; j45++)
  7518. skullIcons[j45] = new Sprite(streamLoader_2,
  7519. "headicons_pk", j45);
  7520. } catch (Exception _ex) {
  7521. }
  7522. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7523. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7524. for (int k4 = 0; k4 < 8; k4++)
  7525. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7526.  
  7527. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7528. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7529. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7530. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7531. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7532. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7533. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7534.  
  7535. for (int l4 = 0; l4 < 6; l4++)
  7536. modIcons[l4] = new Sprite(streamLoader_2, "mod_icons", l4);
  7537.  
  7538. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7539. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7540. getGameComponent());
  7541. sprite.method346(0, 0);
  7542. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7543. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7544. getGameComponent());
  7545. sprite.method346(0, 0);
  7546. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7547. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7548. getGameComponent());
  7549. sprite.method346(0, 0);
  7550. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7551. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7552. getGameComponent());
  7553. sprite.method346(0, 0);
  7554. int i5 = (int) (Math.random() * 21D) - 10;
  7555. int j5 = (int) (Math.random() * 21D) - 10;
  7556. int k5 = (int) (Math.random() * 21D) - 10;
  7557. int l5 = (int) (Math.random() * 41D) - 20;
  7558. for (int i6 = 0; i6 < 100; i6++) {
  7559. if (mapFunctions[i6] != null)
  7560. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7561. if (mapScenes[i6] != null)
  7562. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7563. }
  7564.  
  7565. drawLoadingText(83, "Unpacking textures");
  7566. Texture.method368(streamLoader_3);
  7567. Texture.method372(0.80000000000000004D);
  7568. Texture.method367();
  7569. drawLoadingText(86, "Unpacking config");
  7570. Animation.unpackConfig(streamLoader);
  7571. ObjectDef.unpackConfig(streamLoader);
  7572. Flo.unpackConfig(streamLoader);
  7573. ItemDef.unpackConfig(streamLoader);
  7574. EntityDef.unpackConfig(streamLoader);
  7575. IDK.unpackConfig(streamLoader);
  7576. SpotAnim.unpackConfig(streamLoader);
  7577. Varp.unpackConfig(streamLoader);
  7578. VarBit.unpackConfig(streamLoader);
  7579. ItemDef.isMembers = isMembers;
  7580. if (!lowMem) {
  7581. drawLoadingText(90, "Unpacking sounds");
  7582. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7583. Stream stream = new Stream(abyte0);
  7584. Sounds.unpack(stream);
  7585. }
  7586. drawLoadingText(95, "Unpacking interfaces");
  7587. TextDrawingArea allFonts[] = { smallText, aTextDrawingArea_1271,
  7588. chatTextDrawingArea, aTextDrawingArea_1273 };
  7589. RSInterface.unpack(streamLoader_1, allFonts, streamLoader_2);
  7590. drawLoadingText(100, "Preparing game engine");
  7591. for (int j6 = 0; j6 < 33; j6++) {
  7592. int k6 = 999;
  7593. int i7 = 0;
  7594. for (int k7 = 0; k7 < 34; k7++) {
  7595. if (mapBack[0].aByteArray1450[k7 + j6
  7596. * mapBack[0].anInt1452] == 0) {
  7597. if (k6 == 999)
  7598. k6 = k7;
  7599. continue;
  7600. }
  7601. if (k6 == 999)
  7602. continue;
  7603. i7 = k7;
  7604. break;
  7605. }
  7606.  
  7607. anIntArray968[j6] = k6;
  7608. anIntArray1057[j6] = i7 - k6;
  7609. }
  7610.  
  7611. for (int l6 = 5; l6 < 156; l6++) {
  7612. int j7 = 999;
  7613. int l7 = 0;
  7614. for (int j8 = 25; j8 < 172; j8++) {
  7615. if (mapBack[0].aByteArray1450[j8 + l6
  7616. * mapBack[0].anInt1452] == 0
  7617. && (j8 > 34 || l6 > 34)) {
  7618. if (j7 == 999)
  7619. j7 = j8;
  7620. continue;
  7621. }
  7622. if (j7 == 999)
  7623. continue;
  7624. l7 = j8;
  7625. break;
  7626. }
  7627.  
  7628. anIntArray1052[l6 - 5] = j7 - 25;
  7629. anIntArray1229[l6 - 5] = l7 - j7;
  7630. }
  7631.  
  7632. Texture.method365(765, 503);
  7633. fullScreenTextureArray = Texture.anIntArray1472;
  7634. Texture.method365(519, 165);
  7635. anIntArray1180 = Texture.anIntArray1472;
  7636. Texture.method365(246, 335);
  7637. anIntArray1181 = Texture.anIntArray1472;
  7638. Texture.method365(512, 334);
  7639. anIntArray1182 = Texture.anIntArray1472;
  7640. int ai[] = new int[9];
  7641. for (int i8 = 0; i8 < 9; i8++) {
  7642. int k8 = 128 + i8 * 32 + 15;
  7643. int l8 = 600 + k8 * 3;
  7644. int i9 = Texture.anIntArray1470[k8];
  7645. ai[i8] = l8 * i9 >> 16;
  7646. }
  7647.  
  7648. WorldController.method310(500, 800, 512, 334, ai);
  7649. Censor.loadConfig(streamLoader_4);
  7650. mouseDetection = new MouseDetection(this);
  7651. startRunnable(mouseDetection, 10);
  7652. Animable_Sub5.clientInstance = this;
  7653. ObjectDef.clientInstance = this;
  7654. EntityDef.clientInstance = this;
  7655. return;
  7656. } catch (Exception exception) {
  7657. exception.printStackTrace();
  7658. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7659. }
  7660. loadingError = true;
  7661. }
  7662.  
  7663.  
  7664. public void method91(Stream stream, int i) {
  7665. while (stream.bitPosition + 10 < i * 8) {
  7666. int j = stream.readBits(11);
  7667. if (j == 2047)
  7668. break;
  7669. if (playerArray[j] == null) {
  7670. playerArray[j] = new Player();
  7671. if (aStreamArray895s[j] != null)
  7672. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7673. }
  7674. playerIndices[playerCount++] = j;
  7675. Player player = playerArray[j];
  7676. player.anInt1537 = loopCycle;
  7677. int k = stream.readBits(1);
  7678. if (k == 1)
  7679. anIntArray894[anInt893++] = j;
  7680. int l = stream.readBits(1);
  7681. int i1 = stream.readBits(5);
  7682. if (i1 > 15)
  7683. i1 -= 32;
  7684. int j1 = stream.readBits(5);
  7685. if (j1 > 15)
  7686. j1 -= 32;
  7687. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  7688. l == 1);
  7689. }
  7690. stream.finishBitAccess();
  7691. }
  7692.  
  7693. public void processMainScreenClick() {
  7694. if (anInt1021 != 0)
  7695. return;
  7696. if (super.clickMode3 == 1) {
  7697. int i = super.saveClickX - 25 - 545;
  7698. int j = super.saveClickY - 5 - 4;
  7699. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  7700. i -= 73;
  7701. j -= 75;
  7702. int k = viewRotation + minimapRotation & 0x7ff;
  7703. int i1 = Texture.anIntArray1470[k];
  7704. int j1 = Texture.anIntArray1471[k];
  7705. i1 = i1 * (minimapZoom + 256) >> 8;
  7706. j1 = j1 * (minimapZoom + 256) >> 8;
  7707. int k1 = j * i1 + i * j1 >> 11;
  7708. int l1 = j * j1 - i * i1 >> 11;
  7709. int i2 = myPlayer.x + k1 >> 7;
  7710. int j2 = myPlayer.y - l1 >> 7;
  7711. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  7712. j2, myPlayer.smallX[0], true, i2);
  7713. if (flag1) {
  7714. stream.writeWordBigEndian(i);
  7715. stream.writeWordBigEndian(j);
  7716. stream.writeWord(viewRotation);
  7717. stream.writeWordBigEndian(57);
  7718. stream.writeWordBigEndian(minimapRotation);
  7719. stream.writeWordBigEndian(minimapZoom);
  7720. stream.writeWordBigEndian(89);
  7721. stream.writeWord(myPlayer.x);
  7722. stream.writeWord(myPlayer.y);
  7723. stream.writeWordBigEndian(anInt1264);
  7724. stream.writeWordBigEndian(63);
  7725. }
  7726. }
  7727. anInt1117++;
  7728. if (anInt1117 > 1151) {
  7729. anInt1117 = 0;
  7730. stream.createFrame(246);
  7731. stream.writeWordBigEndian(0);
  7732. int l = stream.currentOffset;
  7733. if ((int) (Math.random() * 2D) == 0)
  7734. stream.writeWordBigEndian(101);
  7735. stream.writeWordBigEndian(197);
  7736. stream.writeWord((int) (Math.random() * 65536D));
  7737. stream.writeWordBigEndian((int) (Math.random() * 256D));
  7738. stream.writeWordBigEndian(67);
  7739. stream.writeWord(14214);
  7740. if ((int) (Math.random() * 2D) == 0)
  7741. stream.writeWord(29487);
  7742. stream.writeWord((int) (Math.random() * 65536D));
  7743. if ((int) (Math.random() * 2D) == 0)
  7744. stream.writeWordBigEndian(220);
  7745. stream.writeWordBigEndian(180);
  7746. stream.writeBytes(stream.currentOffset - l);
  7747. }
  7748. }
  7749. }
  7750.  
  7751. private String interfaceIntToString(int j) {
  7752. if (j < 0x3b9ac9ff)
  7753. return String.valueOf(j);
  7754. else
  7755. return "*";
  7756. }
  7757.  
  7758. public void showErrorScreen() {
  7759. Graphics g = getGameComponent().getGraphics();
  7760. g.setColor(Color.black);
  7761. g.fillRect(0, 0, 765, 503);
  7762. method4(1);
  7763. if (loadingError) {
  7764. aBoolean831 = false;
  7765. g.setFont(new Font("Helvetica", 1, 16));
  7766. g.setColor(Color.yellow);
  7767. int k = 35;
  7768. g.drawString(
  7769. "Sorry, an error has occured whilst loading RuneScape",
  7770. 30, k);
  7771. k += 50;
  7772. g.setColor(Color.white);
  7773. g.drawString("To fix this try the following (in order):", 30, k);
  7774. k += 50;
  7775. g.setColor(Color.white);
  7776. g.setFont(new Font("Helvetica", 1, 12));
  7777. g.drawString(
  7778. "1: Try closing ALL open web-browser windows, and reloading",
  7779. 30, k);
  7780. k += 30;
  7781. g.drawString(
  7782. "2: Try clearing your web-browsers cache from tools->internet options",
  7783. 30, k);
  7784. k += 30;
  7785. g.drawString("3: Try using a different game-world", 30, k);
  7786. k += 30;
  7787. g.drawString("4: Try rebooting your computer", 30, k);
  7788. k += 30;
  7789. g.drawString(
  7790. "5: Try selecting a different version of Java from the play-game menu",
  7791. 30, k);
  7792. }
  7793. if (genericLoadingError) {
  7794. aBoolean831 = false;
  7795. g.setFont(new Font("Helvetica", 1, 20));
  7796. g.setColor(Color.white);
  7797. g.drawString("Error - unable to load game!", 50, 50);
  7798. g.drawString("To play RuneScape make sure you play from", 50,
  7799. 100);
  7800. g.drawString("http://www.RuneScape.com", 50, 150);
  7801. }
  7802. if (rsAlreadyLoaded) {
  7803. aBoolean831 = false;
  7804. g.setColor(Color.yellow);
  7805. int l = 35;
  7806. g.drawString(
  7807. "Error a copy of RuneScape already appears to be loaded",
  7808. 30, l);
  7809. l += 50;
  7810. g.setColor(Color.white);
  7811. g.drawString("To fix this try the following (in order):", 30, l);
  7812. l += 50;
  7813. g.setColor(Color.white);
  7814. g.setFont(new Font("Helvetica", 1, 12));
  7815. g.drawString(
  7816. "1: Try closing ALL open web-browser windows, and reloading",
  7817. 30, l);
  7818. l += 30;
  7819. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7820. l += 30;
  7821. }
  7822. }
  7823.  
  7824. public URL getCodeBase() {
  7825. try {
  7826. return new URL(server + ":" + (80 + portOff));
  7827. } catch (Exception _ex) {
  7828. }
  7829. return null;
  7830. }
  7831.  
  7832. public void method95() {
  7833. for (int j = 0; j < npcCount; j++) {
  7834. int k = npcIndices[j];
  7835. NPC npc = npcArray[k];
  7836. if (npc != null)
  7837. method96(npc);
  7838. }
  7839. }
  7840.  
  7841. public void method96(Entity entity) {
  7842. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  7843. || entity.y >= 13184) {
  7844. entity.anim = -1;
  7845. entity.anInt1520 = -1;
  7846. entity.anInt1547 = 0;
  7847. entity.anInt1548 = 0;
  7848. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7849. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7850. entity.method446();
  7851. }
  7852. if (entity == myPlayer
  7853. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  7854. entity.anim = -1;
  7855. entity.anInt1520 = -1;
  7856. entity.anInt1547 = 0;
  7857. entity.anInt1548 = 0;
  7858. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7859. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7860. entity.method446();
  7861. }
  7862. if (entity.anInt1547 > loopCycle)
  7863. method97(entity);
  7864. else if (entity.anInt1548 >= loopCycle)
  7865. method98(entity);
  7866. else
  7867. method99(entity);
  7868. method100(entity);
  7869. method101(entity);
  7870. }
  7871.  
  7872. public void method97(Entity entity) {
  7873. int i = entity.anInt1547 - loopCycle;
  7874. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7875. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7876. entity.x += (j - entity.x) / i;
  7877. entity.y += (k - entity.y) / i;
  7878. entity.anInt1503 = 0;
  7879. if (entity.anInt1549 == 0)
  7880. entity.turnDirection = 1024;
  7881. if (entity.anInt1549 == 1)
  7882. entity.turnDirection = 1536;
  7883. if (entity.anInt1549 == 2)
  7884. entity.turnDirection = 0;
  7885. if (entity.anInt1549 == 3)
  7886. entity.turnDirection = 512;
  7887. }
  7888.  
  7889. public void method98(Entity entity) {
  7890. if (entity.anInt1548 == loopCycle
  7891. || entity.anim == -1
  7892. || entity.anInt1529 != 0
  7893. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  7894. .method258(entity.anInt1527)) {
  7895. int i = entity.anInt1548 - entity.anInt1547;
  7896. int j = loopCycle - entity.anInt1547;
  7897. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7898. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7899. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7900. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7901. entity.x = (k * (i - j) + i1 * j) / i;
  7902. entity.y = (l * (i - j) + j1 * j) / i;
  7903. }
  7904. entity.anInt1503 = 0;
  7905. if (entity.anInt1549 == 0)
  7906. entity.turnDirection = 1024;
  7907. if (entity.anInt1549 == 1)
  7908. entity.turnDirection = 1536;
  7909. if (entity.anInt1549 == 2)
  7910. entity.turnDirection = 0;
  7911. if (entity.anInt1549 == 3)
  7912. entity.turnDirection = 512;
  7913. entity.anInt1552 = entity.turnDirection;
  7914. }
  7915.  
  7916. public void method99(Entity entity) {
  7917. entity.anInt1517 = entity.anInt1511;
  7918. if (entity.smallXYIndex == 0) {
  7919. entity.anInt1503 = 0;
  7920. return;
  7921. }
  7922. if (entity.anim != -1 && entity.anInt1529 == 0) {
  7923. Animation animation = Animation.anims[entity.anim];
  7924. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  7925. entity.anInt1503++;
  7926. return;
  7927. }
  7928. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  7929. entity.anInt1503++;
  7930. return;
  7931. }
  7932. }
  7933. int i = entity.x;
  7934. int j = entity.y;
  7935. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  7936. * 64;
  7937. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  7938. * 64;
  7939. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  7940. entity.x = k;
  7941. entity.y = l;
  7942. return;
  7943. }
  7944. if (i < k) {
  7945. if (j < l)
  7946. entity.turnDirection = 1280;
  7947. else if (j > l)
  7948. entity.turnDirection = 1792;
  7949. else
  7950. entity.turnDirection = 1536;
  7951. } else if (i > k) {
  7952. if (j < l)
  7953. entity.turnDirection = 768;
  7954. else if (j > l)
  7955. entity.turnDirection = 256;
  7956. else
  7957. entity.turnDirection = 512;
  7958. } else if (j < l)
  7959. entity.turnDirection = 1024;
  7960. else
  7961. entity.turnDirection = 0;
  7962. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7963. if (i1 > 1024)
  7964. i1 -= 2048;
  7965. int j1 = entity.anInt1555;
  7966. if (i1 >= -256 && i1 <= 256)
  7967. j1 = entity.anInt1554;
  7968. else if (i1 >= 256 && i1 < 768)
  7969. j1 = entity.anInt1557;
  7970. else if (i1 >= -768 && i1 <= -256)
  7971. j1 = entity.anInt1556;
  7972. if (j1 == -1)
  7973. j1 = entity.anInt1554;
  7974. entity.anInt1517 = j1;
  7975. int k1 = 4;
  7976. if (entity.anInt1552 != entity.turnDirection
  7977. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7978. k1 = 2;
  7979. if (entity.smallXYIndex > 2)
  7980. k1 = 6;
  7981. if (entity.smallXYIndex > 3)
  7982. k1 = 8;
  7983. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  7984. k1 = 8;
  7985. entity.anInt1503--;
  7986. }
  7987. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7988. k1 <<= 1;
  7989. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  7990. && entity.anInt1505 != -1)
  7991. entity.anInt1517 = entity.anInt1505;
  7992. if (i < k) {
  7993. entity.x += k1;
  7994. if (entity.x > k)
  7995. entity.x = k;
  7996. } else if (i > k) {
  7997. entity.x -= k1;
  7998. if (entity.x < k)
  7999. entity.x = k;
  8000. }
  8001. if (j < l) {
  8002. entity.y += k1;
  8003. if (entity.y > l)
  8004. entity.y = l;
  8005. } else if (j > l) {
  8006. entity.y -= k1;
  8007. if (entity.y < l)
  8008. entity.y = l;
  8009. }
  8010. if (entity.x == k && entity.y == l) {
  8011. entity.smallXYIndex--;
  8012. if (entity.anInt1542 > 0)
  8013. entity.anInt1542--;
  8014. }
  8015. }
  8016.  
  8017. public void method100(Entity entity) {
  8018. if (entity.anInt1504 == 0)
  8019. return;
  8020. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  8021. NPC npc = npcArray[entity.interactingEntity];
  8022. if (npc != null) {
  8023. int i1 = entity.x - npc.x;
  8024. int k1 = entity.y - npc.y;
  8025. if (i1 != 0 || k1 != 0)
  8026. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8027. }
  8028. }
  8029. if (entity.interactingEntity >= 32768) {
  8030. int j = entity.interactingEntity - 32768;
  8031. if (j == unknownInt10)
  8032. j = myPlayerIndex;
  8033. Player player = playerArray[j];
  8034. if (player != null) {
  8035. int l1 = entity.x - player.x;
  8036. int i2 = entity.y - player.y;
  8037. if (l1 != 0 || i2 != 0)
  8038. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8039. }
  8040. }
  8041. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  8042. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  8043. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8044. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8045. if (k != 0 || j1 != 0)
  8046. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8047. entity.anInt1538 = 0;
  8048. entity.anInt1539 = 0;
  8049. }
  8050. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8051. if (l != 0) {
  8052. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8053. entity.anInt1552 = entity.turnDirection;
  8054. else if (l > 1024)
  8055. entity.anInt1552 -= entity.anInt1504;
  8056. else
  8057. entity.anInt1552 += entity.anInt1504;
  8058. entity.anInt1552 &= 0x7ff;
  8059. if (entity.anInt1517 == entity.anInt1511
  8060. && entity.anInt1552 != entity.turnDirection) {
  8061. if (entity.anInt1512 != -1) {
  8062. entity.anInt1517 = entity.anInt1512;
  8063. return;
  8064. }
  8065. entity.anInt1517 = entity.anInt1554;
  8066. }
  8067. }
  8068. }
  8069.  
  8070. public void method101(Entity entity) {
  8071. entity.aBoolean1541 = false;
  8072. if (entity.anInt1517 != -1) {
  8073. Animation animation = Animation.anims[entity.anInt1517];
  8074. entity.anInt1519++;
  8075. if (entity.anInt1518 < animation.anInt352
  8076. && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  8077. entity.anInt1519 = 0;
  8078. entity.anInt1518++;
  8079. }
  8080. if (entity.anInt1518 >= animation.anInt352) {
  8081. entity.anInt1519 = 0;
  8082. entity.anInt1518 = 0;
  8083. }
  8084. }
  8085. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  8086. if (entity.anInt1521 < 0)
  8087. entity.anInt1521 = 0;
  8088. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8089. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  8090. && entity.anInt1522 > animation_1
  8091. .method258(entity.anInt1521); entity.anInt1521++)
  8092. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8093.  
  8094. if (entity.anInt1521 >= animation_1.anInt352
  8095. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8096. entity.anInt1520 = -1;
  8097. }
  8098. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  8099. Animation animation_2 = Animation.anims[entity.anim];
  8100. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  8101. && entity.anInt1547 <= loopCycle
  8102. && entity.anInt1548 < loopCycle) {
  8103. entity.anInt1529 = 1;
  8104. return;
  8105. }
  8106. }
  8107. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8108. Animation animation_3 = Animation.anims[entity.anim];
  8109. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  8110. && entity.anInt1528 > animation_3
  8111. .method258(entity.anInt1527); entity.anInt1527++)
  8112. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8113.  
  8114. if (entity.anInt1527 >= animation_3.anInt352) {
  8115. entity.anInt1527 -= animation_3.anInt356;
  8116. entity.anInt1530++;
  8117. if (entity.anInt1530 >= animation_3.anInt362)
  8118. entity.anim = -1;
  8119. if (entity.anInt1527 < 0
  8120. || entity.anInt1527 >= animation_3.anInt352)
  8121. entity.anim = -1;
  8122. }
  8123. entity.aBoolean1541 = animation_3.aBoolean358;
  8124. }
  8125. if (entity.anInt1529 > 0)
  8126. entity.anInt1529--;
  8127. }
  8128.  
  8129. private void drawGameScreen() {
  8130. if (fullscreenInterfaceID != -1
  8131. && (loadingStage == 2 || super.fullGameScreen != null)) {
  8132. if (loadingStage == 2) {
  8133. method119(anInt945, fullscreenInterfaceID);
  8134. if (openInterfaceID != -1) {
  8135. method119(anInt945, openInterfaceID);
  8136. }
  8137. anInt945 = 0;
  8138. resetAllImageProducers();
  8139. super.fullGameScreen.initDrawingArea();
  8140. Texture.anIntArray1472 = fullScreenTextureArray;
  8141. DrawingArea.setAllPixelsToZero();
  8142. welcomeScreenRaised = true;
  8143. if (openInterfaceID != -1) {
  8144. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8145. if (rsInterface_1.width == 512
  8146. && rsInterface_1.height == 334
  8147. && rsInterface_1.type == 0) {
  8148. rsInterface_1.width = 765;
  8149. rsInterface_1.height = 503;
  8150. }
  8151. drawInterface(0, 0, rsInterface_1, 8);
  8152. }
  8153. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8154. if (rsInterface.width == 512 && rsInterface.height == 334
  8155. && rsInterface.type == 0) {
  8156. rsInterface.width = 765;
  8157. rsInterface.height = 503;
  8158. }
  8159. drawInterface(0, 0, rsInterface, 8);
  8160.  
  8161. if (!menuOpen) {
  8162. processRightClick();
  8163. drawTooltip();
  8164. } else {
  8165. drawMenu();
  8166. }
  8167. }
  8168. drawCount++;
  8169. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8170. return;
  8171. } else {
  8172. if (drawCount != 0) {
  8173. resetImageProducers2();
  8174. }
  8175. }
  8176. if (welcomeScreenRaised) {
  8177. welcomeScreenRaised = false;
  8178. topFrame.drawGraphics(0, super.graphics, 0);
  8179. leftFrame.drawGraphics(4, super.graphics, 0);
  8180. rightFrame.drawGraphics(4, super.graphics, 516);
  8181. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8182. needDrawTabArea = true;
  8183. inputTaken = true;
  8184. tabAreaAltered = true;
  8185. aBoolean1233 = true;
  8186. if (loadingStage != 2) {
  8187. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8188. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8189. }
  8190. }
  8191. if (menuOpen && menuScreenArea == 1)
  8192. needDrawTabArea = true;
  8193. if (invOverlayInterfaceID != -1) {
  8194. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8195. if (flag1)
  8196. needDrawTabArea = true;
  8197. }
  8198. if (atInventoryInterfaceType == 2)
  8199. needDrawTabArea = true;
  8200. if (activeInterfaceType == 2)
  8201. needDrawTabArea = true;
  8202. if (needDrawTabArea) {
  8203. drawTabArea();
  8204. needDrawTabArea = false;
  8205. }
  8206. if (backDialogID == -1) {
  8207. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8208. if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8209. method65(494, 110, super.mouseX - 0, super.mouseY - 348,
  8210. aClass9_1059, 0, false, anInt1211);
  8211. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8212. if (i < 0)
  8213. i = 0;
  8214. if (i > anInt1211 - 110)
  8215. i = anInt1211 - 110;
  8216. if (anInt1089 != i) {
  8217. anInt1089 = i;
  8218. inputTaken = true;
  8219. }
  8220. }
  8221. if (backDialogID != -1) {
  8222. boolean flag2 = method119(anInt945, backDialogID);
  8223. if (flag2)
  8224. inputTaken = true;
  8225. }
  8226. if (atInventoryInterfaceType == 3)
  8227. inputTaken = true;
  8228. if (activeInterfaceType == 3)
  8229. inputTaken = true;
  8230. if (aString844 != null)
  8231. inputTaken = true;
  8232. if (menuOpen && menuScreenArea == 2)
  8233. inputTaken = true;
  8234. if (inputTaken) {
  8235. drawChatArea();
  8236. inputTaken = false;
  8237. }
  8238. if (loadingStage == 2)
  8239. method146();
  8240. if (loadingStage == 2) {
  8241. drawMinimap();
  8242. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8243. }
  8244. if (anInt1054 != -1)
  8245. tabAreaAltered = true;
  8246. if (tabAreaAltered) {
  8247. if (anInt1054 != -1 && anInt1054 == tabID) {
  8248. anInt1054 = -1;
  8249. stream.createFrame(120);
  8250. stream.writeWordBigEndian(tabID);
  8251. }
  8252. tabAreaAltered = false;
  8253. aRSImageProducer_1125.initDrawingArea();
  8254. aRSImageProducer_1165.initDrawingArea();
  8255. }
  8256. anInt945 = 0;
  8257. }
  8258.  
  8259. private boolean buildFriendsListMenu(RSInterface class9) {
  8260. int i = class9.contentType;
  8261. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  8262. if (i >= 801)
  8263. i -= 701;
  8264. else if (i >= 701)
  8265. i -= 601;
  8266. else if (i >= 101)
  8267. i -= 101;
  8268. else
  8269. i--;
  8270. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8271. menuActionID[menuActionRow] = 792;
  8272. menuActionRow++;
  8273. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8274. menuActionID[menuActionRow] = 639;
  8275. menuActionRow++;
  8276. return true;
  8277. }
  8278. if (i >= 401 && i <= 500) {
  8279. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8280. menuActionID[menuActionRow] = 322;
  8281. menuActionRow++;
  8282. return true;
  8283. } else {
  8284. return false;
  8285. }
  8286. }
  8287.  
  8288. public void method104() {
  8289. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8290. .reverseGetFirst();
  8291. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8292. .reverseGetNext())
  8293. if (class30_sub2_sub4_sub3.anInt1560 != plane
  8294. || class30_sub2_sub4_sub3.aBoolean1567)
  8295. class30_sub2_sub4_sub3.unlink();
  8296. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  8297. class30_sub2_sub4_sub3.method454(anInt945);
  8298. if (class30_sub2_sub4_sub3.aBoolean1567)
  8299. class30_sub2_sub4_sub3.unlink();
  8300. else
  8301. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  8302. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  8303. class30_sub2_sub4_sub3.anInt1562, 60,
  8304. class30_sub2_sub4_sub3.anInt1561,
  8305. class30_sub2_sub4_sub3, false);
  8306. }
  8307.  
  8308. }
  8309.  
  8310. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8311. if (class9.type != 0 || class9.children == null)
  8312. return;
  8313. if (class9.isMouseoverTriggered && anInt1026 != class9.id
  8314. && anInt1048 != class9.id && anInt1039 != class9.id)
  8315. return;
  8316. int i1 = DrawingArea.topX;
  8317. int j1 = DrawingArea.topY;
  8318. int k1 = DrawingArea.bottomX;
  8319. int l1 = DrawingArea.bottomY;
  8320. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8321. int i2 = class9.children.length;
  8322. for (int j2 = 0; j2 < i2; j2++) {
  8323. int k2 = class9.childX[j2] + k;
  8324. int l2 = (class9.childY[j2] + l) - j;
  8325. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8326. k2 += class9_1.anInt263;
  8327. l2 += class9_1.anInt265;
  8328. if (class9_1.contentType > 0)
  8329. drawFriendsListOrWelcomeScreen(class9_1);
  8330. // here
  8331. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  8332. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  8333. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  8334. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  8335. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  8336. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  8337. 12436, 12446, 12456, 6004, 18471,
  8338. /* Ancients */
  8339. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  8340. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  8341. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  8342. for (int m5 = 0; m5 < IDs.length; m5++) {
  8343. if (class9_1.id == IDs[m5] + 1) {
  8344. if (m5 > 61)
  8345. drawBlackBox(k2 + 1, l2);
  8346. else
  8347. drawBlackBox(k2, l2 + 1);
  8348. }
  8349. }
  8350. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  8351. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  8352. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  8353. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  8354. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  8355. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  8356. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  8357. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  8358. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  8359. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  8360. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  8361. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  8362. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  8363. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  8364. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  8365. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  8366. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  8367. for (int r = 0; r < runeChildren.length; r++)
  8368. if (class9_1.id == runeChildren[r])
  8369. class9_1.modelZoom = 775;
  8370. if (class9_1.type == 0) {
  8371. if (class9_1.scrollPosition > class9_1.scrollMax
  8372. - class9_1.height)
  8373. class9_1.scrollPosition = class9_1.scrollMax
  8374. - class9_1.height;
  8375. if (class9_1.scrollPosition < 0)
  8376. class9_1.scrollPosition = 0;
  8377. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8378. if (class9_1.scrollMax > class9_1.height) {
  8379. // clan chat
  8380. if (class9_1.id == 18143) {
  8381. int clanMates = 0;
  8382. for (int i = 18155; i < 18244; i++) {
  8383. RSInterface line = RSInterface.interfaceCache[i];
  8384. if (line.message.length() > 0) {
  8385. clanMates++;
  8386. }
  8387. }
  8388. class9_1.scrollMax = (clanMates * 14) + class9_1.height
  8389. + 1;
  8390. }
  8391. if (class9_1.id == 24322 || class9_1.id == 24423) {
  8392. int members = 0;
  8393. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  8394. RSInterface line = RSInterface.interfaceCache[i];
  8395. if (line != null && line.message != null) {
  8396. if (line.message.length() > 0) {
  8397. members++;
  8398. }
  8399. }
  8400. }
  8401. class9_1.scrollMax = (members * 14) + 1;
  8402. }
  8403. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2,
  8404. k2 + class9_1.width, class9_1.scrollMax);
  8405. }
  8406. } else if (class9_1.type != 1)
  8407. if (class9_1.type == 2) {
  8408. int i3 = 0;
  8409. for (int l3 = 0; l3 < class9_1.height; l3++) {
  8410. for (int l4 = 0; l4 < class9_1.width; l4++) {
  8411. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8412. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8413. if (i3 < 20) {
  8414. k5 += class9_1.spritesX[i3];
  8415. j6 += class9_1.spritesY[i3];
  8416. }
  8417. if (class9_1.inv[i3] > 0) {
  8418. int k6 = 0;
  8419. int j7 = 0;
  8420. int j9 = class9_1.inv[i3] - 1;
  8421. if (k5 > DrawingArea.topX - 32
  8422. && k5 < DrawingArea.bottomX
  8423. && j6 > DrawingArea.topY - 32
  8424. && j6 < DrawingArea.bottomY
  8425. || activeInterfaceType != 0
  8426. && anInt1085 == i3) {
  8427. int l9 = 0;
  8428. if (itemSelected == 1 && anInt1283 == i3
  8429. && anInt1284 == class9_1.id)
  8430. l9 = 0xffffff;
  8431. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  8432. .getSprite(j9,
  8433. class9_1.invStackSizes[i3],
  8434. l9);
  8435. if (class30_sub2_sub1_sub1_2 != null) {
  8436. if (activeInterfaceType != 0
  8437. && anInt1085 == i3
  8438. && anInt1084 == class9_1.id) {
  8439. k6 = super.mouseX - anInt1087;
  8440. j7 = super.mouseY - anInt1088;
  8441. if (k6 < 5 && k6 > -5)
  8442. k6 = 0;
  8443. if (j7 < 5 && j7 > -5)
  8444. j7 = 0;
  8445. if (anInt989 < 10) {
  8446. k6 = 0;
  8447. j7 = 0;
  8448. }
  8449. class30_sub2_sub1_sub1_2
  8450. .drawSprite1(k5 + k6, j6
  8451. + j7);
  8452. if (j6 + j7 < DrawingArea.topY
  8453. && class9.scrollPosition > 0) {
  8454. int i10 = (anInt945 * (DrawingArea.topY
  8455. - j6 - j7)) / 3;
  8456. if (i10 > anInt945 * 10)
  8457. i10 = anInt945 * 10;
  8458. if (i10 > class9.scrollPosition)
  8459. i10 = class9.scrollPosition;
  8460. class9.scrollPosition -= i10;
  8461. anInt1088 += i10;
  8462. }
  8463. if (j6 + j7 + 32 > DrawingArea.bottomY
  8464. && class9.scrollPosition < class9.scrollMax
  8465. - class9.height) {
  8466. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8467. if (j10 > anInt945 * 10)
  8468. j10 = anInt945 * 10;
  8469. if (j10 > class9.scrollMax
  8470. - class9.height
  8471. - class9.scrollPosition)
  8472. j10 = class9.scrollMax
  8473. - class9.height
  8474. - class9.scrollPosition;
  8475. class9.scrollPosition += j10;
  8476. anInt1088 -= j10;
  8477. }
  8478. } else if (atInventoryInterfaceType != 0
  8479. && atInventoryIndex == i3
  8480. && atInventoryInterface == class9_1.id)
  8481. class30_sub2_sub1_sub1_2
  8482. .drawSprite1(k5, j6);
  8483. else
  8484. class30_sub2_sub1_sub1_2
  8485. .drawSprite(k5, j6);
  8486. if (class30_sub2_sub1_sub1_2.maxWidth == 33
  8487. || class9_1.invStackSizes[i3] != 1) {
  8488. int k10 = class9_1.invStackSizes[i3];
  8489. if (k10 >= 1)
  8490. smallText.method385(0xFFFF00,
  8491. intToKOrMil(k10), j6
  8492. + 9 + j7, k5
  8493. + k6);
  8494. if (k10 >= 100000)
  8495. smallText.method385(0xFFFFFF,
  8496. intToKOrMil(k10), j6
  8497. + 9 + j7, k5
  8498. + k6);
  8499. if (k10 >= 10000000)
  8500. smallText.method385(0x0FF80,
  8501. intToKOrMil(k10), j6
  8502. + 9 + j7, k5
  8503. + k6);
  8504.  
  8505. /*
  8506. * smallText.method385(0,
  8507. * intToKOrMil(k10), j6 + 10 + j7,
  8508. * k5 + 1 + k6);
  8509. * smallText.method385(0xffff00,
  8510. * intToKOrMil(k10), j6 + 9 + j7, k5
  8511. * + k6);
  8512. */
  8513. }
  8514. }
  8515. }
  8516. } else if (class9_1.sprites != null && i3 < 20) {
  8517. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8518. if (class30_sub2_sub1_sub1_1 != null)
  8519. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8520. }
  8521. i3++;
  8522. }
  8523. }
  8524. } else if (class9_1.type == 3) {
  8525. boolean flag = false;
  8526. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  8527. || anInt1026 == class9_1.id)
  8528. flag = true;
  8529. int j3;
  8530. if (interfaceIsSelected(class9_1)) {
  8531. j3 = class9_1.anInt219;
  8532. if (flag && class9_1.anInt239 != 0)
  8533. j3 = class9_1.anInt239;
  8534. } else {
  8535. j3 = class9_1.textColor;
  8536. if (flag && class9_1.anInt216 != 0)
  8537. j3 = class9_1.anInt216;
  8538. }
  8539. if (class9_1.aByte254 == 0) {
  8540. if (class9_1.aBoolean227)
  8541. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  8542. class9_1.width);
  8543. else
  8544. DrawingArea.fillPixels(k2, class9_1.width,
  8545. class9_1.height, j3, l2);
  8546. } else if (class9_1.aBoolean227)
  8547. DrawingArea.method335(j3, l2, class9_1.width,
  8548. class9_1.height,
  8549. 256 - (class9_1.aByte254 & 0xff), k2);
  8550. else
  8551. DrawingArea.method338(l2, class9_1.height,
  8552. 256 - (class9_1.aByte254 & 0xff), j3,
  8553. class9_1.width, k2);
  8554. } else if (class9_1.type == 4) {
  8555. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8556. String s = class9_1.message;
  8557. boolean flag1 = false;
  8558. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  8559. || anInt1026 == class9_1.id)
  8560. flag1 = true;
  8561. int i4;
  8562. if (interfaceIsSelected(class9_1)) {
  8563. i4 = class9_1.anInt219;
  8564. if (flag1 && class9_1.anInt239 != 0)
  8565. i4 = class9_1.anInt239;
  8566. if (class9_1.aString228.length() > 0)
  8567. s = class9_1.aString228;
  8568. } else {
  8569. i4 = class9_1.textColor;
  8570. if (flag1 && class9_1.anInt216 != 0)
  8571. i4 = class9_1.anInt216;
  8572. }
  8573. if (class9_1.atActionType == 6 && aBoolean1149) {
  8574. s = "Please wait...";
  8575. i4 = class9_1.textColor;
  8576. }
  8577. if (DrawingArea.width == 519) {
  8578. if (i4 == 0xffff00)
  8579. i4 = 255;
  8580. if (i4 == 49152)
  8581. i4 = 0xffffff;
  8582. }
  8583. if ((class9_1.parentID == 1151)
  8584. || (class9_1.parentID == 12855)) {
  8585. switch (i4) {
  8586. case 16773120:
  8587. i4 = 0xFE981F;
  8588. break;
  8589. case 7040819:
  8590. i4 = 0xAF6A1A;
  8591. break;
  8592. }
  8593. }
  8594. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  8595. if (s.indexOf("%") != -1) {
  8596. do {
  8597. int k7 = s.indexOf("%1");
  8598. if (k7 == -1)
  8599. break;
  8600. if (class9_1.id < 4000 || class9_1.id > 5000
  8601. && class9_1.id != 13921
  8602. && class9_1.id != 13922
  8603. && class9_1.id != 12171
  8604. && class9_1.id != 12172)
  8605. s = s.substring(0, k7)
  8606. + methodR(extractInterfaceValues(
  8607. class9_1, 0))
  8608. + s.substring(k7 + 2);
  8609. else
  8610. s = s.substring(0, k7)
  8611. + interfaceIntToString(extractInterfaceValues(
  8612. class9_1, 0))
  8613. + s.substring(k7 + 2);
  8614. } while (true);
  8615. do {
  8616. int l7 = s.indexOf("%2");
  8617. if (l7 == -1)
  8618. break;
  8619. s = s.substring(0, l7)
  8620. + interfaceIntToString(extractInterfaceValues(
  8621. class9_1, 1))
  8622. + s.substring(l7 + 2);
  8623. } while (true);
  8624. do {
  8625. int i8 = s.indexOf("%3");
  8626. if (i8 == -1)
  8627. break;
  8628. s = s.substring(0, i8)
  8629. + interfaceIntToString(extractInterfaceValues(
  8630. class9_1, 2))
  8631. + s.substring(i8 + 2);
  8632. } while (true);
  8633. do {
  8634. int j8 = s.indexOf("%4");
  8635. if (j8 == -1)
  8636. break;
  8637. s = s.substring(0, j8)
  8638. + interfaceIntToString(extractInterfaceValues(
  8639. class9_1, 3))
  8640. + s.substring(j8 + 2);
  8641. } while (true);
  8642. do {
  8643. int k8 = s.indexOf("%5");
  8644. if (k8 == -1)
  8645. break;
  8646. s = s.substring(0, k8)
  8647. + interfaceIntToString(extractInterfaceValues(
  8648. class9_1, 4))
  8649. + s.substring(k8 + 2);
  8650. } while (true);
  8651. }
  8652. int l8 = s.indexOf("\\n");
  8653. String s1;
  8654. if (l8 != -1) {
  8655. s1 = s.substring(0, l8);
  8656. s = s.substring(l8 + 2);
  8657. } else {
  8658. s1 = s;
  8659. s = "";
  8660. }
  8661. RSFont font = null;
  8662. if (textDrawingArea == smallText) {
  8663. font = newSmallFont;
  8664. } else if (textDrawingArea == aTextDrawingArea_1271) {
  8665. font = newRegularFont;
  8666. } else if (textDrawingArea == chatTextDrawingArea) {
  8667. font = newBoldFont;
  8668. } else if (textDrawingArea == aTextDrawingArea_1273) {
  8669. font = newFancyFont;
  8670. }
  8671. if (class9_1.centerText) {
  8672. font.drawCenteredString(s1,
  8673. k2 + class9_1.width / 2, l6, i4,
  8674. class9_1.textShadow ? 0 : -1);
  8675. } else {
  8676. font.drawBasicString(s1, k2, l6, i4,
  8677. class9_1.textShadow ? 0 : -1);
  8678. }
  8679. }
  8680. } else if (class9_1.type == 5) {
  8681. Sprite image;
  8682. Sprite hover;
  8683. if (interfaceIsSelected(class9_1)) {
  8684. image = class9_1.sprite2;
  8685. hover = class9_1.enabledHover;
  8686. } else {
  8687. image = class9_1.sprite1;
  8688. hover = class9_1.disabledHover;
  8689. }
  8690. if (image != null) {
  8691. if (spellSelected == 1 && class9_1.id == spellID
  8692. && spellID != 0) {
  8693. image.drawSprite(k2, l2, 0xffffff);
  8694. } else {
  8695. image.drawSprite(k2, l2);
  8696. }
  8697. if (hover != null) {
  8698. if (hoverId == class9_1.id) {
  8699. hover.drawSprite(k2, l2);
  8700. }
  8701. }
  8702. }
  8703. } else if (class9_1.type == 6) {
  8704. int k3 = Texture.textureInt1;
  8705. int j4 = Texture.textureInt2;
  8706. Texture.textureInt1 = k2 + class9_1.width / 2;
  8707. Texture.textureInt2 = l2 + class9_1.height / 2;
  8708. int i5 = Texture.anIntArray1470[class9_1.modelRotation1]
  8709. * class9_1.modelZoom >> 16;
  8710. int l5 = Texture.anIntArray1471[class9_1.modelRotation1]
  8711. * class9_1.modelZoom >> 16;
  8712. boolean flag2 = interfaceIsSelected(class9_1);
  8713. int i7;
  8714. if (flag2)
  8715. i7 = class9_1.anInt258;
  8716. else
  8717. i7 = class9_1.anInt257;
  8718. Model model;
  8719. if (i7 == -1) {
  8720. model = class9_1.method209(-1, -1, flag2);
  8721. } else {
  8722. Animation animation = Animation.anims[i7];
  8723. model = class9_1.method209(
  8724. animation.anIntArray354[class9_1.anInt246],
  8725. animation.anIntArray353[class9_1.anInt246],
  8726. flag2);
  8727. }
  8728. if (model != null)
  8729. model.method482(class9_1.modelRotation2, 0,
  8730. class9_1.modelRotation1, 0, i5, l5);
  8731. Texture.textureInt1 = k3;
  8732. Texture.textureInt2 = j4;
  8733. } else if (class9_1.type == 7) {
  8734. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8735. int k4 = 0;
  8736. for (int j5 = 0; j5 < class9_1.height; j5++) {
  8737. for (int i6 = 0; i6 < class9_1.width; i6++) {
  8738. if (class9_1.inv[k4] > 0) {
  8739. ItemDef itemDef = ItemDef
  8740. .forID(class9_1.inv[k4] - 1);
  8741. String s2 = itemDef.name;
  8742. if (itemDef.stackable
  8743. || class9_1.invStackSizes[k4] != 1)
  8744. s2 = s2
  8745. + " x"
  8746. + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8747. int i9 = k2 + i6
  8748. * (115 + class9_1.invSpritePadX);
  8749. int k9 = l2 + j5
  8750. * (12 + class9_1.invSpritePadY);
  8751. if (class9_1.centerText)
  8752. textDrawingArea_1.method382(
  8753. class9_1.textColor, i9
  8754. + class9_1.width / 2, s2,
  8755. k9, class9_1.textShadow);
  8756. else
  8757. textDrawingArea_1.method389(
  8758. class9_1.textShadow, i9,
  8759. class9_1.textColor, s2, k9);
  8760. }
  8761. k4++;
  8762. }
  8763. }
  8764. }
  8765. if (class9_1.type == 8
  8766. && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id)
  8767. && anInt1501 == 100) {
  8768.  
  8769. int boxWidth = 0;
  8770. int boxHeight = 0;
  8771. TextDrawingArea textDrawingArea_2 = class9_1.textDrawingAreas;
  8772. for (String s1 = class9_1.message; s1.length() > 0;) {
  8773. int l7 = s1.indexOf("\\n");
  8774. String s4;
  8775. if (l7 != -1) {
  8776. s4 = s1.substring(0, l7);
  8777. s1 = s1.substring(l7 + 2);
  8778. } else {
  8779. s4 = s1;
  8780. s1 = "";
  8781. }
  8782. int j10 = textDrawingArea_2.getTextWidth(s4);
  8783. if (j10 > boxWidth) {
  8784. boxWidth = j10;
  8785. }
  8786. boxHeight += textDrawingArea_2.anInt1497 + 1;
  8787. }
  8788. boxWidth += 6;
  8789. boxHeight += 7;
  8790. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  8791. int yPos = l2 + class9_1.height + 5;
  8792. if (xPos < k2 + 5) {
  8793. xPos = k2 + 5;
  8794. }
  8795. if (xPos + boxWidth > k + class9.width) {
  8796. xPos = (k + class9.width) - boxWidth;
  8797. }
  8798. if (yPos + boxHeight > l + class9.height) {
  8799. yPos = (l + class9.height) - boxHeight;
  8800. }
  8801. /*
  8802. * if(class9_1.inventoryhover){ if(xPos + boxWidth+k > 249){
  8803. * xPos = 251 - boxWidth-k; } if(yPos+boxHeight+l >261 ){ yPos =
  8804. * 245 - boxHeight - l; } }
  8805. */
  8806. switch (class9_1.id) {
  8807. case 9217:
  8808. case 9220:
  8809. case 9223:
  8810. case 9226:
  8811. case 9229:
  8812. case 9232:
  8813. case 9235:
  8814. case 9238:
  8815. xPos -= 80;
  8816. break;
  8817. case 9239:
  8818. yPos -= 100;
  8819. break;
  8820. }
  8821. DrawingArea
  8822. .method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  8823. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  8824. String s2 = class9_1.message;
  8825. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2
  8826. .length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {// anInt1497
  8827. int l11 = s2.indexOf("\\n");
  8828. String s5;
  8829. if (l11 != -1) {
  8830. s5 = s2.substring(0, l11);
  8831. s2 = s2.substring(l11 + 2);
  8832. } else {
  8833. s5 = s2;
  8834. s2 = "";
  8835. }
  8836. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  8837. }
  8838. // }
  8839. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8840. }
  8841. if (class9_1.type == 12) {
  8842. Sprite sprite;
  8843. if (interfaceIsSelected(class9_1))
  8844. sprite = class9_1.sprite2;
  8845. else
  8846. sprite = class9_1.sprite1;
  8847. if (sprite != null)
  8848. sprite.drawAdvancedSprite(k2, l2);
  8849. } else if (class9_1.type == 9) {
  8850. drawHoverBox(k2, l2, class9_1.message);
  8851. }
  8852. }
  8853. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8854. }
  8855.  
  8856. public final String methodR(int j) {
  8857. if (j >= 0 && j < 10000)
  8858. return String.valueOf(j);
  8859. if (j >= 10000 && j < 10000000)
  8860. return j / 1000 + "K";
  8861. if (j >= 10000000 && j < 999999999)
  8862. return j / 1000000 + "M";
  8863. if (j >= 999999999)
  8864. return "*";
  8865. else
  8866. return "?";
  8867. }
  8868.  
  8869. public void drawHoverBox(int xPos, int yPos, String text) {
  8870. String[] results = text.split("\n");
  8871. int height = (results.length * 16) + 3;
  8872. int width;
  8873. width = aTextDrawingArea_1271.getTextWidth(results[0]) + 6;
  8874. for (int i = 1; i < results.length; i++)
  8875. if (width <= aTextDrawingArea_1271.getTextWidth(results[i]) + 6)
  8876. width = aTextDrawingArea_1271.getTextWidth(results[i]) + 6;
  8877. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  8878. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  8879. yPos += 14;
  8880. for (int i = 0; i < results.length; i++) {
  8881. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i],
  8882. yPos);
  8883. yPos += 16;
  8884. }
  8885. }
  8886.  
  8887. public void drawBlackBox(int xPos, int yPos) {
  8888. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8889. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8890. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8891. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8892. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8893. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8894. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8895. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8896. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8897. }
  8898.  
  8899. public void randomizeBackground(Background background) {
  8900. int j = 256;
  8901. for (int k = 0; k < anIntArray1190.length; k++)
  8902. anIntArray1190[k] = 0;
  8903.  
  8904. for (int l = 0; l < 5000; l++) {
  8905. int i1 = (int) (Math.random() * 128D * (double) j);
  8906. anIntArray1190[i1] = (int) (Math.random() * 256D);
  8907. }
  8908. for (int j1 = 0; j1 < 20; j1++) {
  8909. for (int k1 = 1; k1 < j - 1; k1++) {
  8910. for (int i2 = 1; i2 < 127; i2++) {
  8911. int k2 = i2 + (k1 << 7);
  8912. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  8913. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8914. }
  8915.  
  8916. }
  8917. int ai[] = anIntArray1190;
  8918. anIntArray1190 = anIntArray1191;
  8919. anIntArray1191 = ai;
  8920. }
  8921. if (background != null) {
  8922. int l1 = 0;
  8923. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  8924. for (int l2 = 0; l2 < background.anInt1452; l2++)
  8925. if (background.aByteArray1450[l1++] != 0) {
  8926. int i3 = l2 + 16 + background.anInt1454;
  8927. int j3 = j2 + 16 + background.anInt1455;
  8928. int k3 = i3 + (j3 << 7);
  8929. anIntArray1190[k3] = 0;
  8930. }
  8931. }
  8932. }
  8933. }
  8934.  
  8935. private void method107(int i, int j, Stream stream, Player player) {
  8936. if ((i & 0x400) != 0) {
  8937. player.anInt1543 = stream.method428();
  8938. player.anInt1545 = stream.method428();
  8939. player.anInt1544 = stream.method428();
  8940. player.anInt1546 = stream.method428();
  8941. player.anInt1547 = stream.method436() + loopCycle;
  8942. player.anInt1548 = stream.method435() + loopCycle;
  8943. player.anInt1549 = stream.method428();
  8944. player.method446();
  8945. }
  8946. if ((i & 0x100) != 0) {
  8947. player.anInt1520 = stream.method434();
  8948. int k = stream.readDWord();
  8949. player.anInt1524 = k >> 16;
  8950. player.anInt1523 = loopCycle + (k & 0xffff);
  8951. player.anInt1521 = 0;
  8952. player.anInt1522 = 0;
  8953. if (player.anInt1523 > loopCycle)
  8954. player.anInt1521 = -1;
  8955. if (player.anInt1520 == 65535)
  8956. player.anInt1520 = -1;
  8957. }
  8958. if ((i & 8) != 0) {
  8959. int l = stream.method434();
  8960. if (l == 65535)
  8961. l = -1;
  8962. int i2 = stream.method427();
  8963. if (l == player.anim && l != -1) {
  8964. int i3 = Animation.anims[l].anInt365;
  8965. if (i3 == 1) {
  8966. player.anInt1527 = 0;
  8967. player.anInt1528 = 0;
  8968. player.anInt1529 = i2;
  8969. player.anInt1530 = 0;
  8970. }
  8971. if (i3 == 2)
  8972. player.anInt1530 = 0;
  8973. } else if (l == -1
  8974. || player.anim == -1
  8975. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  8976. player.anim = l;
  8977. player.anInt1527 = 0;
  8978. player.anInt1528 = 0;
  8979. player.anInt1529 = i2;
  8980. player.anInt1530 = 0;
  8981. player.anInt1542 = player.smallXYIndex;
  8982. }
  8983. }
  8984. if ((i & 4) != 0) {
  8985. player.textSpoken = stream.readString();
  8986. if (player.textSpoken.charAt(0) == '~') {
  8987. player.textSpoken = player.textSpoken.substring(1);
  8988. pushMessage(player.textSpoken, 2, player.name);
  8989. } else if (player == myPlayer)
  8990. pushMessage(player.textSpoken, 2, player.name);
  8991. player.anInt1513 = 0;
  8992. player.anInt1531 = 0;
  8993. player.textCycle = 150;
  8994. }
  8995. if ((i & 0x80) != 0) {
  8996. int i1 = stream.method434();
  8997. int j2 = stream.readUnsignedByte();
  8998. int j3 = stream.method427();
  8999. int k3 = stream.currentOffset;
  9000. if (player.name != null && player.visible) {
  9001. long l3 = TextClass.longForName(player.name);
  9002. boolean flag = false;
  9003. if (j2 <= 1) {
  9004. for (int i4 = 0; i4 < ignoreCount; i4++) {
  9005. if (ignoreListAsLongs[i4] != l3)
  9006. continue;
  9007. flag = true;
  9008. break;
  9009. }
  9010.  
  9011. }
  9012. if (!flag && anInt1251 == 0)
  9013. try {
  9014. aStream_834.currentOffset = 0;
  9015. stream.method442(j3, 0, aStream_834.buffer);
  9016. aStream_834.currentOffset = 0;
  9017. String s = TextInput.method525(j3, aStream_834);
  9018. player.textSpoken = s;
  9019. player.anInt1513 = i1 >> 8;
  9020. player.privelage = j2;
  9021. player.anInt1531 = i1 & 0xff;
  9022. player.textCycle = 150;
  9023. switch (j2) {
  9024. case 1:
  9025. pushMessage(s, 1, "@cr1@" + player.name);
  9026. break;
  9027. case 2:
  9028. pushMessage(s, 1, "@cr2@" + player.name);
  9029. break;
  9030. case 3:
  9031. pushMessage(s, 1, "@cr3@" + player.name);
  9032. break;
  9033. case 4:
  9034. pushMessage(s, 1, "@cr4@" + player.name);
  9035. break;
  9036. case 5:
  9037. pushMessage(s, 1, "@cr5@" + player.name);
  9038. break;
  9039. case 6:
  9040. pushMessage(s, 1, "@cr6@" + player.name);
  9041. break;
  9042. default:
  9043. pushMessage(s, 2, player.name);
  9044. }
  9045. } catch (Exception exception) {
  9046. signlink.reporterror("cde2");
  9047. }
  9048. }
  9049. stream.currentOffset = k3 + j3;
  9050. }
  9051. if ((i & 1) != 0) {
  9052. player.interactingEntity = stream.method434();
  9053. if (player.interactingEntity == 65535)
  9054. player.interactingEntity = -1;
  9055. }
  9056. if ((i & 0x10) != 0) {
  9057. int j1 = stream.method427();
  9058. byte abyte0[] = new byte[j1];
  9059. Stream stream_1 = new Stream(abyte0);
  9060. stream.readBytes(j1, 0, abyte0);
  9061. aStreamArray895s[j] = stream_1;
  9062. player.updatePlayer(stream_1);
  9063. }
  9064. if ((i & 2) != 0) {
  9065. player.anInt1538 = stream.method436();
  9066. player.anInt1539 = stream.method434();
  9067. }
  9068. if ((i & 0x20) != 0) {
  9069. int k1 = stream.readUnsignedByte();
  9070. int k2 = stream.method426();
  9071. player.updateHitData(k2, k1, loopCycle);
  9072. player.loopCycleStatus = loopCycle + 300;
  9073. player.currentHealth = stream.method427();
  9074. player.maxHealth = stream.readUnsignedByte();
  9075. }
  9076. if ((i & 0x200) != 0) {
  9077. int l1 = stream.readUnsignedByte();
  9078. int l2 = stream.method428();
  9079. player.updateHitData(l2, l1, loopCycle);
  9080. player.loopCycleStatus = loopCycle + 300;
  9081. player.currentHealth = stream.readUnsignedByte();
  9082. player.maxHealth = stream.method427();
  9083. }
  9084. }
  9085.  
  9086. public void method108() {
  9087. try {
  9088. int j = myPlayer.x + cameraOffsetX;
  9089. int k = myPlayer.y + cameraOffsetY;
  9090. if (anInt1014 - j < -500 || anInt1014 - j > 500
  9091. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  9092. anInt1014 = j;
  9093. anInt1015 = k;
  9094. }
  9095. if (anInt1014 != j)
  9096. anInt1014 += (j - anInt1014) / 16;
  9097. if (anInt1015 != k)
  9098. anInt1015 += (k - anInt1015) / 16;
  9099. if (super.keyArray[1] == 1)
  9100. anInt1186 += (-24 - anInt1186) / 2;
  9101. else if (super.keyArray[2] == 1)
  9102. anInt1186 += (24 - anInt1186) / 2;
  9103. else
  9104. anInt1186 /= 2;
  9105. if (super.keyArray[3] == 1)
  9106. anInt1187 += (12 - anInt1187) / 2;
  9107. else if (super.keyArray[4] == 1)
  9108. anInt1187 += (-12 - anInt1187) / 2;
  9109. else
  9110. anInt1187 /= 2;
  9111. viewRotation = viewRotation + anInt1186 / 2 & 0x7ff;
  9112. anInt1184 += anInt1187 / 2;
  9113. if (anInt1184 < 128)
  9114. anInt1184 = 128;
  9115. if (anInt1184 > 383)
  9116. anInt1184 = 383;
  9117. int l = anInt1014 >> 7;
  9118. int i1 = anInt1015 >> 7;
  9119. int j1 = method42(plane, anInt1015, anInt1014);
  9120. int k1 = 0;
  9121. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  9122. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  9123. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  9124. int l2 = plane;
  9125. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9126. l2++;
  9127. int i3 = j1 - intGroundArray[l2][l1][k2];
  9128. if (i3 > k1)
  9129. k1 = i3;
  9130. }
  9131.  
  9132. }
  9133.  
  9134. }
  9135. anInt1005++;
  9136. if (anInt1005 > 1512) {
  9137. anInt1005 = 0;
  9138. stream.createFrame(77);
  9139. stream.writeWordBigEndian(0);
  9140. int i2 = stream.currentOffset;
  9141. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9142. stream.writeWordBigEndian(101);
  9143. stream.writeWordBigEndian(233);
  9144. stream.writeWord(45092);
  9145. if ((int) (Math.random() * 2D) == 0)
  9146. stream.writeWord(35784);
  9147. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9148. stream.writeWordBigEndian(64);
  9149. stream.writeWordBigEndian(38);
  9150. stream.writeWord((int) (Math.random() * 65536D));
  9151. stream.writeWord((int) (Math.random() * 65536D));
  9152. stream.writeBytes(stream.currentOffset - i2);
  9153. }
  9154. int j2 = k1 * 192;
  9155. if (j2 > 0x17f00)
  9156. j2 = 0x17f00;
  9157. if (j2 < 32768)
  9158. j2 = 32768;
  9159. if (j2 > anInt984) {
  9160. anInt984 += (j2 - anInt984) / 24;
  9161. return;
  9162. }
  9163. if (j2 < anInt984) {
  9164. anInt984 += (j2 - anInt984) / 80;
  9165. }
  9166. } catch (Exception _ex) {
  9167. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  9168. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  9169. + anInt1070 + "," + baseX + "," + baseY);
  9170. throw new RuntimeException("eek");
  9171. }
  9172. }
  9173.  
  9174. public void processDrawing() {
  9175. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  9176. showErrorScreen();
  9177. return;
  9178. }
  9179. anInt1061++;
  9180. if (!loggedIn)
  9181. drawLoginScreen(false);
  9182. else
  9183. drawGameScreen();
  9184. anInt1213 = 0;
  9185. }
  9186.  
  9187. private boolean isFriendOrSelf(String s) {
  9188. if (s == null)
  9189. return false;
  9190. for (int i = 0; i < friendsCount; i++)
  9191. if (s.equalsIgnoreCase(friendsList[i]))
  9192. return true;
  9193. return s.equalsIgnoreCase(myPlayer.name);
  9194. }
  9195.  
  9196. private static String combatDiffColor(int i, int j) {
  9197. int k = i - j;
  9198. if (k < -9)
  9199. return "@red@";
  9200. if (k < -6)
  9201. return "@or3@";
  9202. if (k < -3)
  9203. return "@or2@";
  9204. if (k < 0)
  9205. return "@or1@";
  9206. if (k > 9)
  9207. return "@gre@";
  9208. if (k > 6)
  9209. return "@gr3@";
  9210. if (k > 3)
  9211. return "@gr2@";
  9212. if (k > 0)
  9213. return "@gr1@";
  9214. else
  9215. return "@yel@";
  9216. }
  9217.  
  9218. public void setWaveVolume(int i) {
  9219. signlink.wavevol = i;
  9220. }
  9221.  
  9222. private void draw3dScreen() {
  9223. drawSplitPrivateChat();
  9224. if (crossType == 1) {
  9225. crosses[crossIndex / 100]
  9226. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9227. anInt1142++;
  9228. if (anInt1142 > 67) {
  9229. anInt1142 = 0;
  9230. stream.createFrame(78);
  9231. }
  9232. }
  9233. if (crossType == 2)
  9234. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  9235. crossY - 8 - 4);
  9236. if (anInt1018 != -1) {
  9237. method119(anInt945, anInt1018);
  9238. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9239. }
  9240. if (openInterfaceID != -1) {
  9241. method119(anInt945, openInterfaceID);
  9242. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9243. }
  9244. method70();
  9245. if (!menuOpen) {
  9246. processRightClick();
  9247. drawTooltip();
  9248. } else if (menuScreenArea == 0)
  9249. drawMenu();
  9250. if (anInt1055 == 1)
  9251. multiOverlay.drawSprite(472, 296);
  9252. if (fpsOn) {
  9253. char c = '\u01FB';
  9254. int k = 20;
  9255. int i1 = 0xffff00;
  9256. if (super.fps < 15)
  9257. i1 = 0xff0000;
  9258. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9259. k += 15;
  9260. Runtime runtime = Runtime.getRuntime();
  9261. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9262. i1 = 0xffff00;
  9263. if (j1 > 0x2000000 && lowMem)
  9264. i1 = 0xff0000;
  9265. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9266. k += 15;
  9267. }
  9268. int i1 = 0xffff00;
  9269. int x = baseX + (myPlayer.x - 6 >> 7);
  9270. int y = baseY + (myPlayer.y - 6 >> 7);
  9271. if (clientData) {
  9272. char c = '\u01FB';
  9273. int k = 20;
  9274. if (super.fps < 15)
  9275. i1 = 0xff0000;
  9276. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285,
  9277. 5);
  9278. Runtime runtime = Runtime.getRuntime();
  9279. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9280. i1 = 0xffff00;
  9281. if (j1 > 0x2000000 && lowMem)
  9282. i1 = 0xff0000;
  9283. k += 15;
  9284. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299,
  9285. 5);
  9286. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: "
  9287. + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9288. aTextDrawingArea_1271.method385(0xffff00,
  9289. "Coords: " + x + ", " + y, 329, 5);
  9290. }
  9291. if (anInt1104 != 0) {
  9292. int j = anInt1104 / 50;
  9293. int l = j / 60;
  9294. j %= 60;
  9295. if (j < 10)
  9296. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  9297. + l + ":0" + j, 329, 4);
  9298. else
  9299. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  9300. + l + ":" + j, 329, 4);
  9301. anInt849++;
  9302. if (anInt849 > 75) {
  9303. anInt849 = 0;
  9304. stream.createFrame(148);
  9305. }
  9306. }
  9307. }
  9308.  
  9309. public void addIgnore(long l) {
  9310. try {
  9311. if (l == 0L)
  9312. return;
  9313. if (ignoreCount >= 100) {
  9314. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9315. return;
  9316. }
  9317. String s = TextClass.fixName(TextClass.nameForLong(l));
  9318. for (int j = 0; j < ignoreCount; j++)
  9319. if (ignoreListAsLongs[j] == l) {
  9320. pushMessage(s + " is already on your ignore list", 0, "");
  9321. return;
  9322. }
  9323. for (int k = 0; k < friendsCount; k++)
  9324. if (friendsListAsLongs[k] == l) {
  9325. pushMessage("Please remove " + s
  9326. + " from your friend list first", 0, "");
  9327. return;
  9328. }
  9329.  
  9330. ignoreListAsLongs[ignoreCount++] = l;
  9331. needDrawTabArea = true;
  9332. stream.createFrame(133);
  9333. stream.writeQWord(l);
  9334. return;
  9335. } catch (RuntimeException runtimeexception) {
  9336. signlink.reporterror("45688, " + l + ", " + 4 + ", "
  9337. + runtimeexception.toString());
  9338. }
  9339. throw new RuntimeException();
  9340. }
  9341.  
  9342. public void method114() {
  9343. for (int i = -1; i < playerCount; i++) {
  9344. int j;
  9345. if (i == -1)
  9346. j = myPlayerIndex;
  9347. else
  9348. j = playerIndices[i];
  9349. Player player = playerArray[j];
  9350. if (player != null)
  9351. method96(player);
  9352. }
  9353.  
  9354. }
  9355.  
  9356. public void method115() {
  9357. if (loadingStage == 2) {
  9358. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  9359. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  9360. .reverseGetNext()) {
  9361. if (class30_sub1.anInt1294 > 0)
  9362. class30_sub1.anInt1294--;
  9363. if (class30_sub1.anInt1294 == 0) {
  9364. if (class30_sub1.anInt1299 < 0
  9365. || ObjectManager.method178(class30_sub1.anInt1299,
  9366. class30_sub1.anInt1301)) {
  9367. method142(class30_sub1.anInt1298,
  9368. class30_sub1.anInt1295, class30_sub1.anInt1300,
  9369. class30_sub1.anInt1301, class30_sub1.anInt1297,
  9370. class30_sub1.anInt1296, class30_sub1.anInt1299);
  9371. class30_sub1.unlink();
  9372. }
  9373. } else {
  9374. if (class30_sub1.anInt1302 > 0)
  9375. class30_sub1.anInt1302--;
  9376. if (class30_sub1.anInt1302 == 0
  9377. && class30_sub1.anInt1297 >= 1
  9378. && class30_sub1.anInt1298 >= 1
  9379. && class30_sub1.anInt1297 <= 102
  9380. && class30_sub1.anInt1298 <= 102
  9381. && (class30_sub1.anInt1291 < 0 || ObjectManager
  9382. .method178(class30_sub1.anInt1291,
  9383. class30_sub1.anInt1293))) {
  9384. method142(class30_sub1.anInt1298,
  9385. class30_sub1.anInt1295, class30_sub1.anInt1292,
  9386. class30_sub1.anInt1293, class30_sub1.anInt1297,
  9387. class30_sub1.anInt1296, class30_sub1.anInt1291);
  9388. class30_sub1.anInt1302 = -1;
  9389. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  9390. && class30_sub1.anInt1299 == -1)
  9391. class30_sub1.unlink();
  9392. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  9393. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  9394. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9395. class30_sub1.unlink();
  9396. }
  9397. }
  9398. }
  9399.  
  9400. }
  9401. }
  9402.  
  9403. public void determineMenuSize() {
  9404. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9405. for (int j = 0; j < menuActionRow; j++) {
  9406. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9407. if (k > i)
  9408. i = k;
  9409. }
  9410.  
  9411. i += 8;
  9412. int l = 15 * menuActionRow + 21;
  9413. if (super.saveClickX > 4 && super.saveClickY > 4
  9414. && super.saveClickX < 516 && super.saveClickY < 338) {
  9415. int i1 = super.saveClickX - 4 - i / 2;
  9416. if (i1 + i > 512)
  9417. i1 = 512 - i;
  9418. if (i1 < 0)
  9419. i1 = 0;
  9420. int l1 = super.saveClickY - 4;
  9421. if (l1 + l > 334)
  9422. l1 = 334 - l;
  9423. if (l1 < 0)
  9424. l1 = 0;
  9425. menuOpen = true;
  9426. menuScreenArea = 0;
  9427. menuOffsetX = i1;
  9428. menuOffsetY = l1;
  9429. menuWidth = i;
  9430. menuHeight = 15 * menuActionRow + 22;
  9431. }
  9432. if (super.saveClickX > 519 && super.saveClickY > 168
  9433. && super.saveClickX < 765 && super.saveClickY < 503) {
  9434. int j1 = super.saveClickX - 519 - i / 2;
  9435. if (j1 < 0)
  9436. j1 = 0;
  9437. else if (j1 + i > 245)
  9438. j1 = 245 - i;
  9439. int i2 = super.saveClickY - 168;
  9440. if (i2 < 0)
  9441. i2 = 0;
  9442. else if (i2 + l > 333)
  9443. i2 = 333 - l;
  9444. menuOpen = true;
  9445. menuScreenArea = 1;
  9446. menuOffsetX = j1;
  9447. menuOffsetY = i2;
  9448. menuWidth = i;
  9449. menuHeight = 15 * menuActionRow + 22;
  9450. }
  9451. if (super.saveClickX > 0 && super.saveClickY > 338
  9452. && super.saveClickX < 516 && super.saveClickY < 503) {
  9453. int k1 = super.saveClickX - 0 - i / 2;
  9454. if (k1 < 0)
  9455. k1 = 0;
  9456. else if (k1 + i > 516)
  9457. k1 = 516 - i;
  9458. int j2 = super.saveClickY - 338;
  9459. if (j2 < 0)
  9460. j2 = 0;
  9461. else if (j2 + l > 165)
  9462. j2 = 165 - l;
  9463. menuOpen = true;
  9464. menuScreenArea = 2;
  9465. menuOffsetX = k1;
  9466. menuOffsetY = j2;
  9467. menuWidth = i;
  9468. menuHeight = 15 * menuActionRow + 22;
  9469. }
  9470. }
  9471.  
  9472. public void method117(Stream stream) {
  9473. stream.initBitAccess();
  9474. int j = stream.readBits(1);
  9475. if (j == 0)
  9476. return;
  9477. int k = stream.readBits(2);
  9478. if (k == 0) {
  9479. anIntArray894[anInt893++] = myPlayerIndex;
  9480. return;
  9481. }
  9482. if (k == 1) {
  9483. int l = stream.readBits(3);
  9484. myPlayer.moveInDir(false, l);
  9485. int k1 = stream.readBits(1);
  9486. if (k1 == 1)
  9487. anIntArray894[anInt893++] = myPlayerIndex;
  9488. return;
  9489. }
  9490. if (k == 2) {
  9491. int i1 = stream.readBits(3);
  9492. myPlayer.moveInDir(true, i1);
  9493. int l1 = stream.readBits(3);
  9494. myPlayer.moveInDir(true, l1);
  9495. int j2 = stream.readBits(1);
  9496. if (j2 == 1)
  9497. anIntArray894[anInt893++] = myPlayerIndex;
  9498. return;
  9499. }
  9500. if (k == 3) {
  9501. plane = stream.readBits(2);
  9502. int j1 = stream.readBits(1);
  9503. int i2 = stream.readBits(1);
  9504. if (i2 == 1)
  9505. anIntArray894[anInt893++] = myPlayerIndex;
  9506. int k2 = stream.readBits(7);
  9507. int l2 = stream.readBits(7);
  9508. myPlayer.setPos(l2, k2, j1 == 1);
  9509. }
  9510. }
  9511.  
  9512. public void nullLoader() {
  9513. aBoolean831 = false;
  9514. while (drawingFlames) {
  9515. aBoolean831 = false;
  9516. try {
  9517. Thread.sleep(50L);
  9518. } catch (Exception _ex) {
  9519. }
  9520. }
  9521. aBackground_966 = null;
  9522. aBackground_967 = null;
  9523. aBackgroundArray1152s = null;
  9524. anIntArray850 = null;
  9525. anIntArray851 = null;
  9526. anIntArray852 = null;
  9527. anIntArray853 = null;
  9528. anIntArray1190 = null;
  9529. anIntArray1191 = null;
  9530. anIntArray828 = null;
  9531. anIntArray829 = null;
  9532. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9533. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9534. }
  9535.  
  9536. private boolean method119(int i, int j) {
  9537. boolean flag1 = false;
  9538. RSInterface class9 = RSInterface.interfaceCache[j];
  9539. for (int k = 0; k < class9.children.length; k++) {
  9540. if (class9.children[k] == -1)
  9541. break;
  9542. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9543. if (class9_1.type == 1)
  9544. flag1 |= method119(i, class9_1.id);
  9545. if (class9_1.type == 6
  9546. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  9547. boolean flag2 = interfaceIsSelected(class9_1);
  9548. int l;
  9549. if (flag2)
  9550. l = class9_1.anInt258;
  9551. else
  9552. l = class9_1.anInt257;
  9553. if (l != -1) {
  9554. Animation animation = Animation.anims[l];
  9555. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  9556. .method258(class9_1.anInt246);) {
  9557. class9_1.anInt208 -= animation
  9558. .method258(class9_1.anInt246) + 1;
  9559. class9_1.anInt246++;
  9560. if (class9_1.anInt246 >= animation.anInt352) {
  9561. class9_1.anInt246 -= animation.anInt356;
  9562. if (class9_1.anInt246 < 0
  9563. || class9_1.anInt246 >= animation.anInt352)
  9564. class9_1.anInt246 = 0;
  9565. }
  9566. flag1 = true;
  9567. }
  9568.  
  9569. }
  9570. }
  9571. }
  9572.  
  9573. return flag1;
  9574. }
  9575.  
  9576. private int method120() {
  9577. int j = 3;
  9578. if (yCameraCurve < 310) {
  9579. int k = xCameraPos >> 7;
  9580. int l = yCameraPos >> 7;
  9581. int i1 = myPlayer.x >> 7;
  9582. int j1 = myPlayer.y >> 7;
  9583. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9584. j = plane;
  9585. int k1;
  9586. if (i1 > k)
  9587. k1 = i1 - k;
  9588. else
  9589. k1 = k - i1;
  9590. int l1;
  9591. if (j1 > l)
  9592. l1 = j1 - l;
  9593. else
  9594. l1 = l - j1;
  9595. if (k1 > l1) {
  9596. int i2 = (l1 * 0x10000) / k1;
  9597. int k2 = 32768;
  9598. while (k != i1) {
  9599. if (k < i1)
  9600. k++;
  9601. else if (k > i1)
  9602. k--;
  9603. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9604. j = plane;
  9605. k2 += i2;
  9606. if (k2 >= 0x10000) {
  9607. k2 -= 0x10000;
  9608. if (l < j1)
  9609. l++;
  9610. else if (l > j1)
  9611. l--;
  9612. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9613. j = plane;
  9614. }
  9615. }
  9616. } else {
  9617. int j2 = (k1 * 0x10000) / l1;
  9618. int l2 = 32768;
  9619. while (l != j1) {
  9620. if (l < j1)
  9621. l++;
  9622. else if (l > j1)
  9623. l--;
  9624. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9625. j = plane;
  9626. l2 += j2;
  9627. if (l2 >= 0x10000) {
  9628. l2 -= 0x10000;
  9629. if (k < i1)
  9630. k++;
  9631. else if (k > i1)
  9632. k--;
  9633. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9634. j = plane;
  9635. }
  9636. }
  9637. }
  9638. }
  9639. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9640. j = plane;
  9641. return j;
  9642. }
  9643.  
  9644. private int method121() {
  9645. int j = method42(plane, yCameraPos, xCameraPos);
  9646. if (j - zCameraPos < 800
  9647. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9648. return plane;
  9649. else
  9650. return 3;
  9651. }
  9652.  
  9653. public void delIgnore(long l) {
  9654. try {
  9655. if (l == 0L)
  9656. return;
  9657. for (int j = 0; j < ignoreCount; j++)
  9658. if (ignoreListAsLongs[j] == l) {
  9659. ignoreCount--;
  9660. needDrawTabArea = true;
  9661. System.arraycopy(ignoreListAsLongs, j + 1,
  9662. ignoreListAsLongs, j, ignoreCount - j);
  9663.  
  9664. stream.createFrame(74);
  9665. stream.writeQWord(l);
  9666. return;
  9667. }
  9668.  
  9669. return;
  9670. } catch (RuntimeException runtimeexception) {
  9671. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  9672. + runtimeexception.toString());
  9673. }
  9674. throw new RuntimeException();
  9675. }
  9676.  
  9677. private void chatJoin(long l) {
  9678. try {
  9679. if (l == 0L)
  9680. return;
  9681. stream.createFrame(60);
  9682. stream.writeQWord(l);
  9683. return;
  9684. } catch (RuntimeException runtimeexception) {
  9685. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  9686. + runtimeexception.toString());
  9687. }
  9688. throw new RuntimeException();
  9689.  
  9690. }
  9691.  
  9692. public String getParameter(String s) {
  9693. if (signlink.mainapp != null)
  9694. return signlink.mainapp.getParameter(s);
  9695. else
  9696. return super.getParameter(s);
  9697. }
  9698.  
  9699. public void adjustVolume(boolean flag, int i) {
  9700. signlink.midivol = i;
  9701. if (flag)
  9702. signlink.midi = "voladjust";
  9703. }
  9704.  
  9705. private int extractInterfaceValues(RSInterface class9, int j) {
  9706. if (class9.valueIndexArray == null
  9707. || j >= class9.valueIndexArray.length)
  9708. return -2;
  9709. try {
  9710. int ai[] = class9.valueIndexArray[j];
  9711. int k = 0;
  9712. int l = 0;
  9713. int i1 = 0;
  9714. do {
  9715. int j1 = ai[l++];
  9716. int k1 = 0;
  9717. byte byte0 = 0;
  9718. if (j1 == 0)
  9719. return k;
  9720. if (j1 == 1)
  9721. k1 = currentStats[ai[l++]];
  9722. if (j1 == 2)
  9723. k1 = maxStats[ai[l++]];
  9724. if (j1 == 3)
  9725. k1 = currentExp[ai[l++]];
  9726. if (j1 == 4) {
  9727. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9728. int k2 = ai[l++];
  9729. if (k2 >= 0 && k2 < ItemDef.totalItems
  9730. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  9731. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  9732. if (class9_1.inv[j3] == k2 + 1)
  9733. k1 += class9_1.invStackSizes[j3];
  9734.  
  9735. }
  9736. }
  9737. if (j1 == 5)
  9738. k1 = variousSettings[ai[l++]];
  9739. if (j1 == 6)
  9740. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9741. if (j1 == 7)
  9742. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9743. if (j1 == 8)
  9744. k1 = myPlayer.combatLevel;
  9745. if (j1 == 9) {
  9746. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  9747. if (Skills.skillEnabled[l1])
  9748. k1 += maxStats[l1];
  9749.  
  9750. }
  9751. if (j1 == 10) {
  9752. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9753. int l2 = ai[l++] + 1;
  9754. if (l2 >= 0 && l2 < ItemDef.totalItems
  9755. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  9756. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  9757. if (class9_2.inv[k3] != l2)
  9758. continue;
  9759. k1 = 0x3b9ac9ff;
  9760. break;
  9761. }
  9762.  
  9763. }
  9764. }
  9765. if (j1 == 11)
  9766. k1 = energy;
  9767. if (j1 == 12)
  9768. k1 = weight;
  9769. if (j1 == 13) {
  9770. int i2 = variousSettings[ai[l++]];
  9771. int i3 = ai[l++];
  9772. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9773. }
  9774. if (j1 == 14) {
  9775. int j2 = ai[l++];
  9776. VarBit varBit = VarBit.cache[j2];
  9777. int l3 = varBit.anInt648;
  9778. int i4 = varBit.anInt649;
  9779. int j4 = varBit.anInt650;
  9780. int k4 = anIntArray1232[j4 - i4];
  9781. k1 = variousSettings[l3] >> i4 & k4;
  9782. }
  9783. if (j1 == 15)
  9784. byte0 = 1;
  9785. if (j1 == 16)
  9786. byte0 = 2;
  9787. if (j1 == 17)
  9788. byte0 = 3;
  9789. if (j1 == 18)
  9790. k1 = (myPlayer.x >> 7) + baseX;
  9791. if (j1 == 19)
  9792. k1 = (myPlayer.y >> 7) + baseY;
  9793. if (j1 == 20)
  9794. k1 = ai[l++];
  9795. if (byte0 == 0) {
  9796. if (i1 == 0)
  9797. k += k1;
  9798. if (i1 == 1)
  9799. k -= k1;
  9800. if (i1 == 2 && k1 != 0)
  9801. k /= k1;
  9802. if (i1 == 3)
  9803. k *= k1;
  9804. i1 = 0;
  9805. } else {
  9806. i1 = byte0;
  9807. }
  9808. } while (true);
  9809. } catch (Exception _ex) {
  9810. return -1;
  9811. }
  9812. }
  9813.  
  9814. public void drawTooltip() {
  9815. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9816. return;
  9817. String s;
  9818. if (itemSelected == 1 && menuActionRow < 2)
  9819. s = "Use " + selectedItemName + " with...";
  9820. else if (spellSelected == 1 && menuActionRow < 2)
  9821. s = spellTooltip + "...";
  9822. else
  9823. s = menuActionName[menuActionRow - 1];
  9824. if (menuActionRow > 2)
  9825. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9826. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9827. }
  9828.  
  9829. public void drawMinimap() {
  9830. aRSImageProducer_1164.initDrawingArea();
  9831. if (anInt1021 == 2) {
  9832. mapBack[1].drawBackground(0, 0);
  9833. compass.method352(33, viewRotation, anIntArray1057, 256,
  9834. anIntArray968, 25, 0, 0, 33, 25);
  9835. aRSImageProducer_1165.initDrawingArea();
  9836. return;
  9837. }
  9838. int i = viewRotation + minimapRotation & 0x7ff;
  9839. int j = 48 + myPlayer.x / 32;
  9840. int l2 = 464 - myPlayer.y / 32;
  9841. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  9842. 256 + minimapZoom, anIntArray1052, l2, 5, 25, 146, j);
  9843. compass.method352(33, viewRotation, anIntArray1057, 256, anIntArray968,
  9844. 25, 0, 0, 33, 25);
  9845. for (int j5 = 0; j5 < anInt1071; j5++) {
  9846. try {
  9847. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9848. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9849. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9850. } catch (Exception exception) {
  9851. }
  9852. }
  9853. for (int k5 = 0; k5 < 104; k5++) {
  9854. for (int l5 = 0; l5 < 104; l5++) {
  9855. NodeList class19 = groundArray[plane][k5][l5];
  9856. if (class19 != null) {
  9857. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9858. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9859. markMinimap(mapDotItem, l, j3);
  9860. }
  9861. }
  9862. }
  9863. for (int i6 = 0; i6 < npcCount; i6++) {
  9864. NPC npc = npcArray[npcIndices[i6]];
  9865. if (npc != null && npc.isVisible()) {
  9866. EntityDef entityDef = npc.desc;
  9867. if (entityDef.childrenIDs != null)
  9868. entityDef = entityDef.method161();
  9869. if (entityDef != null && entityDef.aBoolean87
  9870. && entityDef.aBoolean84) {
  9871. int i1 = npc.x / 32 - myPlayer.x / 32;
  9872. int k3 = npc.y / 32 - myPlayer.y / 32;
  9873. markMinimap(mapDotNPC, i1, k3);
  9874. }
  9875. }
  9876. }
  9877. for (int j6 = 0; j6 < playerCount; j6++) {
  9878. Player player = playerArray[playerIndices[j6]];
  9879. if (player != null && player.isVisible()) {
  9880. int j1 = player.x / 32 - myPlayer.x / 32;
  9881. int l3 = player.y / 32 - myPlayer.y / 32;
  9882. boolean flag1 = false;
  9883. long l6 = TextClass.longForName(player.name);
  9884. for (int k6 = 0; k6 < friendsCount; k6++) {
  9885. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9886. continue;
  9887. flag1 = true;
  9888. break;
  9889. }
  9890. if (myPlayer.team != 0 && player.team != 0
  9891. && myPlayer.team == player.team) {
  9892. }
  9893. if (flag1)
  9894. markMinimap(mapDotFriend, j1, l3);
  9895. else
  9896. markMinimap(mapDotPlayer, j1, l3);
  9897. }
  9898. }
  9899. if (anInt855 != 0 && loopCycle % 20 < 10) {
  9900. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9901. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9902. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  9903. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x
  9904. / 32;
  9905. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y
  9906. / 32;
  9907. method81(mapMarker, i4, k1);
  9908. }
  9909. }
  9910. if (anInt855 == 2) {
  9911. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9912. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9913. method81(mapMarker, j4, l1);
  9914. }
  9915. if (anInt855 == 10 && anInt933 >= 0
  9916. && anInt933 < playerArray.length) {
  9917. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9918. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  9919. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x
  9920. / 32;
  9921. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y
  9922. / 32;
  9923. method81(mapMarker, k4, i2);
  9924. }
  9925. }
  9926. }
  9927. if (destX != 0) {
  9928. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9929. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9930. markMinimap(mapFlag, j2, l4);
  9931. }
  9932. DrawingArea.drawPixels(3, 78, 97, 0xffffff, 3);
  9933. mapBack[0].drawBackground(0, 0);
  9934. aRSImageProducer_1165.initDrawingArea();
  9935. }
  9936.  
  9937. public void npcScreenPos(Entity entity, int i) {
  9938. calcEntityScreenPos(entity.x, i, entity.y);
  9939. }
  9940.  
  9941. public void calcEntityScreenPos(int i, int j, int l) {
  9942. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  9943. spriteDrawX = -1;
  9944. spriteDrawY = -1;
  9945. return;
  9946. }
  9947. int i1 = method42(plane, l, i) - j;
  9948. i -= xCameraPos;
  9949. i1 -= zCameraPos;
  9950. l -= yCameraPos;
  9951. int j1 = Model.modelIntArray1[yCameraCurve];
  9952. int k1 = Model.modelIntArray2[yCameraCurve];
  9953. int l1 = Model.modelIntArray1[xCameraCurve];
  9954. int i2 = Model.modelIntArray2[xCameraCurve];
  9955. int j2 = l * l1 + i * i2 >> 16;
  9956. l = l * i2 - i * l1 >> 16;
  9957. i = j2;
  9958. j2 = i1 * k1 - l * j1 >> 16;
  9959. l = i1 * j1 + l * k1 >> 16;
  9960. i1 = j2;
  9961. if (l >= 50) {
  9962. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9963. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9964. } else {
  9965. spriteDrawX = -1;
  9966. spriteDrawY = -1;
  9967. }
  9968. }
  9969.  
  9970. private void buildSplitPrivateChatMenu() {
  9971. if (splitPrivateChat == 0)
  9972. return;
  9973. int i = 0;
  9974. if (anInt1104 != 0)
  9975. i = 1;
  9976. for (int j = 0; j < 100; j++)
  9977. if (chatMessages[j] != null) {
  9978. int k = chatTypes[j];
  9979. String s = chatNames[j];
  9980. boolean flag1 = false;
  9981. if (s != null && s.startsWith("@cr1@")) {
  9982. s = s.substring(5);
  9983. byte byte0 = 1;
  9984. }
  9985. if (s != null && s.startsWith("@cr2@")) {
  9986. s = s.substring(5);
  9987. byte byte0 = 2;
  9988. }
  9989. if (s != null && s.startsWith("@cr3@")) {
  9990. s = s.substring(5);
  9991. byte byte0 = 3;
  9992. }
  9993. if (s != null && s.startsWith("@cr4@")) {
  9994. s = s.substring(5);
  9995. byte byte0 = 4;
  9996. }
  9997. if (s != null && s.startsWith("@cr5@")) {
  9998. s = s.substring(5);
  9999. byte byte0 = 5;
  10000. }
  10001. if (s != null && s.startsWith("@cr6@")) {
  10002. s = s.substring(5);
  10003. byte byte0 = 6;
  10004. }
  10005. if ((k == 3 || k == 7)
  10006. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  10007. && isFriendOrSelf(s))) {
  10008. int l = 329 - i * 13;
  10009. if (super.mouseX > 4 && super.mouseY - 4 > l - 10
  10010. && super.mouseY - 4 <= l + 3) {
  10011. int i1 = aTextDrawingArea_1271.getTextWidth("From: "
  10012. + s + chatMessages[j]) + 25;
  10013. //here
  10014. Notify notifyManager = new Notify();
  10015. notifyManager.showNotify( new ImageIcon( Notify.icon ), "You recieved a Private Message from: "+ s + System.lineSeparator() + chatMessages[j]);
  10016. if (i1 > 450)
  10017. i1 = 450;
  10018. if (super.mouseX < 4 + i1) {
  10019. if (myPrivilege >= 1) {
  10020. menuActionName[menuActionRow] = "Report abuse @whi@"
  10021. + s;
  10022. menuActionID[menuActionRow] = 2606;
  10023. menuActionRow++;
  10024. }
  10025. menuActionName[menuActionRow] = "Add ignore @whi@"
  10026. + s;
  10027. menuActionID[menuActionRow] = 2042;
  10028. menuActionRow++;
  10029. menuActionName[menuActionRow] = "Add friend @whi@"
  10030. + s;
  10031. menuActionID[menuActionRow] = 2337;
  10032. menuActionRow++;
  10033. }
  10034. }
  10035. if (++i >= 5)
  10036. return;
  10037. }
  10038. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10039. return;
  10040. }
  10041.  
  10042. }
  10043.  
  10044. public void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  10045. int i2, int j2) {
  10046. Class30_Sub1 class30_sub1 = null;
  10047. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  10048. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  10049. .reverseGetNext()) {
  10050. if (class30_sub1_1.anInt1295 != l1
  10051. || class30_sub1_1.anInt1297 != i2
  10052. || class30_sub1_1.anInt1298 != j1
  10053. || class30_sub1_1.anInt1296 != i1)
  10054. continue;
  10055. class30_sub1 = class30_sub1_1;
  10056. break;
  10057. }
  10058.  
  10059. if (class30_sub1 == null) {
  10060. class30_sub1 = new Class30_Sub1();
  10061. class30_sub1.anInt1295 = l1;
  10062. class30_sub1.anInt1296 = i1;
  10063. class30_sub1.anInt1297 = i2;
  10064. class30_sub1.anInt1298 = j1;
  10065. method89(class30_sub1);
  10066. aClass19_1179.insertHead(class30_sub1);
  10067. }
  10068. class30_sub1.anInt1291 = k;
  10069. class30_sub1.anInt1293 = k1;
  10070. class30_sub1.anInt1292 = l;
  10071. class30_sub1.anInt1302 = j2;
  10072. class30_sub1.anInt1294 = j;
  10073. }
  10074.  
  10075. private boolean interfaceIsSelected(RSInterface class9) {
  10076. if (class9.anIntArray245 == null)
  10077. return false;
  10078. for (int i = 0; i < class9.anIntArray245.length; i++) {
  10079. int j = extractInterfaceValues(class9, i);
  10080. int k = class9.anIntArray212[i];
  10081. if (class9.anIntArray245[i] == 2) {
  10082. if (j >= k)
  10083. return false;
  10084. } else if (class9.anIntArray245[i] == 3) {
  10085. if (j <= k)
  10086. return false;
  10087. } else if (class9.anIntArray245[i] == 4) {
  10088. if (j == k)
  10089. return false;
  10090. } else if (j != k)
  10091. return false;
  10092. }
  10093.  
  10094. return true;
  10095. }
  10096.  
  10097. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  10098. // if(!aBoolean872)
  10099. // if(signlink.mainapp != null)
  10100. // return signlink.openurl(s);
  10101. // else
  10102. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10103. if (aSocket832 != null) {
  10104. try {
  10105. aSocket832.close();
  10106. } catch (Exception _ex) {
  10107. }
  10108. aSocket832 = null;
  10109. }
  10110. aSocket832 = openSocket(43595);
  10111. aSocket832.setSoTimeout(10000);
  10112. java.io.InputStream inputstream = aSocket832.getInputStream();
  10113. OutputStream outputstream = aSocket832.getOutputStream();
  10114. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10115. return new DataInputStream(inputstream);
  10116. }
  10117.  
  10118. public void doFlamesDrawing() {
  10119. char c = '\u0100';
  10120. if (anInt1040 > 0) {
  10121. for (int i = 0; i < 256; i++)
  10122. if (anInt1040 > 768)
  10123. anIntArray850[i] = method83(anIntArray851[i],
  10124. anIntArray852[i], 1024 - anInt1040);
  10125. else if (anInt1040 > 256)
  10126. anIntArray850[i] = anIntArray852[i];
  10127. else
  10128. anIntArray850[i] = method83(anIntArray852[i],
  10129. anIntArray851[i], 256 - anInt1040);
  10130.  
  10131. } else if (anInt1041 > 0) {
  10132. for (int j = 0; j < 256; j++)
  10133. if (anInt1041 > 768)
  10134. anIntArray850[j] = method83(anIntArray851[j],
  10135. anIntArray853[j], 1024 - anInt1041);
  10136. else if (anInt1041 > 256)
  10137. anIntArray850[j] = anIntArray853[j];
  10138. else
  10139. anIntArray850[j] = method83(anIntArray853[j],
  10140. anIntArray851[j], 256 - anInt1041);
  10141.  
  10142. } else {
  10143. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  10144.  
  10145. }
  10146. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  10147. aRSImageProducer_1110.anIntArray315, 0, 33920);
  10148.  
  10149. int i1 = 0;
  10150. int j1 = 1152;
  10151. for (int k1 = 1; k1 < c - 1; k1++) {
  10152. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  10153. int j2 = 22 + l1;
  10154. if (j2 < 0)
  10155. j2 = 0;
  10156. i1 += j2;
  10157. for (int l2 = j2; l2 < 128; l2++) {
  10158. int j3 = anIntArray828[i1++];
  10159. if (j3 != 0) {
  10160. int l3 = j3;
  10161. int j4 = 256 - j3;
  10162. j3 = anIntArray850[j3];
  10163. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  10164. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  10165. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  10166. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  10167. } else {
  10168. j1++;
  10169. }
  10170. }
  10171.  
  10172. j1 += j2;
  10173. }
  10174.  
  10175. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  10176. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  10177. aRSImageProducer_1111.anIntArray315, 0, 33920);
  10178.  
  10179. i1 = 0;
  10180. j1 = 1176;
  10181. for (int k2 = 1; k2 < c - 1; k2++) {
  10182. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10183. int k3 = 103 - i3;
  10184. j1 += i3;
  10185. for (int i4 = 0; i4 < k3; i4++) {
  10186. int k4 = anIntArray828[i1++];
  10187. if (k4 != 0) {
  10188. int i5 = k4;
  10189. int j5 = 256 - k4;
  10190. k4 = anIntArray850[k4];
  10191. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10192. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  10193. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  10194. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10195. } else {
  10196. j1++;
  10197. }
  10198. }
  10199.  
  10200. i1 += 128 - k3;
  10201. j1 += 128 - k3 - i3;
  10202. }
  10203.  
  10204. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10205. }
  10206.  
  10207. public void method134(Stream stream) {
  10208. int j = stream.readBits(8);
  10209. if (j < playerCount) {
  10210. for (int k = j; k < playerCount; k++)
  10211. anIntArray840[anInt839++] = playerIndices[k];
  10212.  
  10213. }
  10214. if (j > playerCount) {
  10215. signlink.reporterror(myUsername + " Too many players");
  10216. throw new RuntimeException("eek");
  10217. }
  10218. playerCount = 0;
  10219. for (int l = 0; l < j; l++) {
  10220. int i1 = playerIndices[l];
  10221. Player player = playerArray[i1];
  10222. int j1 = stream.readBits(1);
  10223. if (j1 == 0) {
  10224. playerIndices[playerCount++] = i1;
  10225. player.anInt1537 = loopCycle;
  10226. } else {
  10227. int k1 = stream.readBits(2);
  10228. if (k1 == 0) {
  10229. playerIndices[playerCount++] = i1;
  10230. player.anInt1537 = loopCycle;
  10231. anIntArray894[anInt893++] = i1;
  10232. } else if (k1 == 1) {
  10233. playerIndices[playerCount++] = i1;
  10234. player.anInt1537 = loopCycle;
  10235. int l1 = stream.readBits(3);
  10236. player.moveInDir(false, l1);
  10237. int j2 = stream.readBits(1);
  10238. if (j2 == 1)
  10239. anIntArray894[anInt893++] = i1;
  10240. } else if (k1 == 2) {
  10241. playerIndices[playerCount++] = i1;
  10242. player.anInt1537 = loopCycle;
  10243. int i2 = stream.readBits(3);
  10244. player.moveInDir(true, i2);
  10245. int k2 = stream.readBits(3);
  10246. player.moveInDir(true, k2);
  10247. int l2 = stream.readBits(1);
  10248. if (l2 == 1)
  10249. anIntArray894[anInt893++] = i1;
  10250. } else if (k1 == 3)
  10251. anIntArray840[anInt839++] = i1;
  10252. }
  10253. }
  10254. }
  10255.  
  10256. public void drawLoginScreen(boolean flag) {
  10257. resetImageProducers();
  10258. aRSImageProducer_1109.initDrawingArea();
  10259. aBackground_966.drawBackground(0, 0);
  10260. char c = '\u0168';
  10261. char c1 = '\310';
  10262. if (loginScreenState == 0) {
  10263. int i = c1 / 2 + 80;
  10264. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString,
  10265. i, true);
  10266. i = c1 / 2 - 20;
  10267. chatTextDrawingArea.method382(0xffff00, c / 2,
  10268. "Welcome to RuneScape", i, true);
  10269. i += 30;
  10270. int l = c / 2 - 80;
  10271. int k1 = c1 / 2 + 20;
  10272. aBackground_967.drawBackground(l - 73, k1 - 20);
  10273. chatTextDrawingArea
  10274. .method382(0xffffff, l, "New User", k1 + 5, true);
  10275. l = c / 2 + 80;
  10276. aBackground_967.drawBackground(l - 73, k1 - 20);
  10277. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5,
  10278. true);
  10279. }
  10280. if (loginScreenState == 2) {
  10281. int j = c1 / 2 - 40;
  10282. if (loginMessage1.length() > 0) {
  10283. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1,
  10284. j - 15, true);
  10285. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2,
  10286. j, true);
  10287. j += 30;
  10288. } else {
  10289. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2,
  10290. j - 7, true);
  10291. j += 30;
  10292. }
  10293. chatTextDrawingArea
  10294. .method389(true, c / 2 - 90, 0xffffff, "Username: "
  10295. + capitalize(myUsername)
  10296. + ((loginScreenCursorPos == 0)
  10297. & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10298. // chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff,
  10299. // "Username: " + myUsername + ((loginScreenCursorPos == 0) &
  10300. // (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10301. j += 15;
  10302. chatTextDrawingArea
  10303. .method389(true, c / 2 - 88, 0xffffff, "Password: "
  10304. + TextClass.passwordAsterisks(myPassword)
  10305. + ((loginScreenCursorPos == 1)
  10306. & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10307. j += 15;
  10308. if (!flag) {
  10309. int i1 = c / 2 - 80;
  10310. int l1 = c1 / 2 + 50;
  10311. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10312. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5,
  10313. true);
  10314. i1 = c / 2 + 80;
  10315. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10316. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5,
  10317. true);
  10318. }
  10319. }
  10320. if (loginScreenState == 3) {
  10321. chatTextDrawingArea.method382(0xffff00, c / 2,
  10322. "Create a free account", c1 / 2 - 60, true);
  10323. int k = c1 / 2 - 35;
  10324. chatTextDrawingArea.method382(0xffffff, c / 2,
  10325. "To create a new account you need to", k, true);
  10326. k += 15;
  10327. chatTextDrawingArea.method382(0xffffff, c / 2,
  10328. "go back to the main RuneScape webpage", k, true);
  10329. k += 15;
  10330. chatTextDrawingArea.method382(0xffffff, c / 2,
  10331. "and choose the red 'create account'", k, true);
  10332. k += 15;
  10333. chatTextDrawingArea.method382(0xffffff, c / 2,
  10334. "button at the top right of that page.", k, true);
  10335. k += 15;
  10336. int j1 = c / 2;
  10337. int i2 = c1 / 2 + 50;
  10338. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10339. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10340. }
  10341. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10342. if (welcomeScreenRaised) {
  10343. welcomeScreenRaised = false;
  10344. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10345. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10346. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10347. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10348. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10349. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10350. }
  10351. }
  10352.  
  10353. public void drawFlames() {
  10354. drawingFlames = true;
  10355. try {
  10356. long l = System.currentTimeMillis();
  10357. int i = 0;
  10358. int j = 20;
  10359. while (aBoolean831) {
  10360. anInt1208++;
  10361. calcFlamesPosition();
  10362. calcFlamesPosition();
  10363. doFlamesDrawing();
  10364. if (++i > 10) {
  10365. long l1 = System.currentTimeMillis();
  10366. int k = (int) (l1 - l) / 10 - j;
  10367. j = 40 - k;
  10368. if (j < 5)
  10369. j = 5;
  10370. i = 0;
  10371. l = l1;
  10372. }
  10373. try {
  10374. Thread.sleep(j);
  10375. } catch (Exception _ex) {
  10376. }
  10377. }
  10378. } catch (Exception _ex) {
  10379. }
  10380. drawingFlames = false;
  10381. }
  10382.  
  10383. public void raiseWelcomeScreen() {
  10384. welcomeScreenRaised = true;
  10385. }
  10386.  
  10387. public void method137(Stream stream, int j) {
  10388. if (j == 84) {
  10389. int k = stream.readUnsignedByte();
  10390. int j3 = anInt1268 + (k >> 4 & 7);
  10391. int i6 = anInt1269 + (k & 7);
  10392. int l8 = stream.readUnsignedWord();
  10393. int k11 = stream.readUnsignedWord();
  10394. int l13 = stream.readUnsignedWord();
  10395. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  10396. NodeList class19_1 = groundArray[plane][j3][i6];
  10397. if (class19_1 != null) {
  10398. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  10399. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  10400. .reverseGetNext()) {
  10401. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  10402. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10403. continue;
  10404. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10405. break;
  10406. }
  10407.  
  10408. spawnGroundItem(j3, i6);
  10409. }
  10410. }
  10411. return;
  10412. }
  10413. if (j == 105) {
  10414. int l = stream.readUnsignedByte();
  10415. int k3 = anInt1268 + (l >> 4 & 7);
  10416. int j6 = anInt1269 + (l & 7);
  10417. int i9 = stream.readUnsignedWord();
  10418. int l11 = stream.readUnsignedByte();
  10419. int i14 = l11 >> 4 & 0xf;
  10420. int i16 = l11 & 7;
  10421. if (myPlayer.smallX[0] >= k3 - i14
  10422. && myPlayer.smallX[0] <= k3 + i14
  10423. && myPlayer.smallY[0] >= j6 - i14
  10424. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  10425. && anInt1062 < 50) {
  10426. anIntArray1207[anInt1062] = i9;
  10427. anIntArray1241[anInt1062] = i16;
  10428. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10429. anInt1062++;
  10430. }
  10431. }
  10432. if (j == 215) {
  10433. int i1 = stream.method435();
  10434. int l3 = stream.method428();
  10435. int k6 = anInt1268 + (l3 >> 4 & 7);
  10436. int j9 = anInt1269 + (l3 & 7);
  10437. int i12 = stream.method435();
  10438. int j14 = stream.readUnsignedWord();
  10439. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  10440. && i12 != unknownInt10) {
  10441. Item class30_sub2_sub4_sub2_2 = new Item();
  10442. class30_sub2_sub4_sub2_2.ID = i1;
  10443. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10444. if (groundArray[plane][k6][j9] == null)
  10445. groundArray[plane][k6][j9] = new NodeList();
  10446. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10447. spawnGroundItem(k6, j9);
  10448. }
  10449. return;
  10450. }
  10451. if (j == 156) {
  10452. int j1 = stream.method426();
  10453. int i4 = anInt1268 + (j1 >> 4 & 7);
  10454. int l6 = anInt1269 + (j1 & 7);
  10455. int k9 = stream.readUnsignedWord();
  10456. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  10457. NodeList class19 = groundArray[plane][i4][l6];
  10458. if (class19 != null) {
  10459. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  10460. .reverseGetNext()) {
  10461. if (item.ID != (k9 & 0x7fff))
  10462. continue;
  10463. item.unlink();
  10464. break;
  10465. }
  10466.  
  10467. if (class19.reverseGetFirst() == null)
  10468. groundArray[plane][i4][l6] = null;
  10469. spawnGroundItem(i4, l6);
  10470. }
  10471. }
  10472. return;
  10473. }
  10474. if (j == 160) {
  10475. int k1 = stream.method428();
  10476. int j4 = anInt1268 + (k1 >> 4 & 7);
  10477. int i7 = anInt1269 + (k1 & 7);
  10478. int l9 = stream.method428();
  10479. int j12 = l9 >> 2;
  10480. int k14 = l9 & 3;
  10481. int j16 = anIntArray1177[j12];
  10482. int j17 = stream.method435();
  10483. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  10484. int j18 = intGroundArray[plane][j4][i7];
  10485. int i19 = intGroundArray[plane][j4 + 1][i7];
  10486. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10487. int k20 = intGroundArray[plane][j4][i7 + 1];
  10488. if (j16 == 0) {
  10489. Object1 class10 = worldController.method296(plane, j4, i7);
  10490. if (class10 != null) {
  10491. int k21 = class10.uid >> 14 & 0x7fff;
  10492. if (j12 == 2) {
  10493. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  10494. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  10495. false);
  10496. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  10497. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  10498. j17, false);
  10499. } else {
  10500. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  10501. k21, k14, j12, i19, l19, j18, k20, j17,
  10502. false);
  10503. }
  10504. }
  10505. }
  10506. if (j16 == 1) {
  10507. Object2 class26 = worldController.method297(j4, i7, plane);
  10508. if (class26 != null)
  10509. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  10510. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  10511. j18, k20, j17, false);
  10512. }
  10513. if (j16 == 2) {
  10514. Object5 class28 = worldController.method298(j4, i7, plane);
  10515. if (j12 == 11)
  10516. j12 = 10;
  10517. if (class28 != null)
  10518. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  10519. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  10520. j18, k20, j17, false);
  10521. }
  10522. if (j16 == 3) {
  10523. Object3 class49 = worldController.method299(i7, j4, plane);
  10524. if (class49 != null)
  10525. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  10526. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  10527. j18, k20, j17, false);
  10528. }
  10529. }
  10530. return;
  10531. }
  10532. if (j == 147) {
  10533. int l1 = stream.method428();
  10534. int k4 = anInt1268 + (l1 >> 4 & 7);
  10535. int j7 = anInt1269 + (l1 & 7);
  10536. int i10 = stream.readUnsignedWord();
  10537. byte byte0 = stream.method430();
  10538. int l14 = stream.method434();
  10539. byte byte1 = stream.method429();
  10540. int k17 = stream.readUnsignedWord();
  10541. int k18 = stream.method428();
  10542. int j19 = k18 >> 2;
  10543. int i20 = k18 & 3;
  10544. int l20 = anIntArray1177[j19];
  10545. byte byte2 = stream.readSignedByte();
  10546. int l21 = stream.readUnsignedWord();
  10547. byte byte3 = stream.method429();
  10548. Player player;
  10549. if (i10 == unknownInt10)
  10550. player = myPlayer;
  10551. else
  10552. player = playerArray[i10];
  10553. if (player != null) {
  10554. ObjectDef class46 = ObjectDef.forID(l21);
  10555. int i22 = intGroundArray[plane][k4][j7];
  10556. int j22 = intGroundArray[plane][k4 + 1][j7];
  10557. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10558. int l22 = intGroundArray[plane][k4][j7 + 1];
  10559. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  10560. -1);
  10561. if (model != null) {
  10562. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10563. player.anInt1707 = l14 + loopCycle;
  10564. player.anInt1708 = k17 + loopCycle;
  10565. player.aModel_1714 = model;
  10566. int i23 = class46.anInt744;
  10567. int j23 = class46.anInt761;
  10568. if (i20 == 1 || i20 == 3) {
  10569. i23 = class46.anInt761;
  10570. j23 = class46.anInt744;
  10571. }
  10572. player.anInt1711 = k4 * 128 + i23 * 64;
  10573. player.anInt1713 = j7 * 128 + j23 * 64;
  10574. player.anInt1712 = method42(plane, player.anInt1713,
  10575. player.anInt1711);
  10576. if (byte2 > byte0) {
  10577. byte byte4 = byte2;
  10578. byte2 = byte0;
  10579. byte0 = byte4;
  10580. }
  10581. if (byte3 > byte1) {
  10582. byte byte5 = byte3;
  10583. byte3 = byte1;
  10584. byte1 = byte5;
  10585. }
  10586. player.anInt1719 = k4 + byte2;
  10587. player.anInt1721 = k4 + byte0;
  10588. player.anInt1720 = j7 + byte3;
  10589. player.anInt1722 = j7 + byte1;
  10590. }
  10591. }
  10592. }
  10593. if (j == 151) {
  10594. int i2 = stream.method426();
  10595. int l4 = anInt1268 + (i2 >> 4 & 7);
  10596. int k7 = anInt1269 + (i2 & 7);
  10597. int j10 = stream.method434();
  10598. int k12 = stream.method428();
  10599. int i15 = k12 >> 2;
  10600. int k16 = k12 & 3;
  10601. int l17 = anIntArray1177[i15];
  10602. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10603. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10604. return;
  10605. }
  10606. if (j == 4) {
  10607. int j2 = stream.readUnsignedByte();
  10608. int i5 = anInt1268 + (j2 >> 4 & 7);
  10609. int l7 = anInt1269 + (j2 & 7);
  10610. int k10 = stream.readUnsignedWord();
  10611. int l12 = stream.readUnsignedByte();
  10612. int j15 = stream.readUnsignedWord();
  10613. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  10614. i5 = i5 * 128 + 64;
  10615. l7 = l7 * 128 + 64;
  10616. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  10617. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  10618. i5);
  10619. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10620. }
  10621. return;
  10622. }
  10623. if (j == 44) {
  10624. int k2 = stream.method436();
  10625. int j5 = stream.readUnsignedWord();
  10626. int i8 = stream.readUnsignedByte();
  10627. int l10 = anInt1268 + (i8 >> 4 & 7);
  10628. int i13 = anInt1269 + (i8 & 7);
  10629. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  10630. Item class30_sub2_sub4_sub2_1 = new Item();
  10631. class30_sub2_sub4_sub2_1.ID = k2;
  10632. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10633. if (groundArray[plane][l10][i13] == null)
  10634. groundArray[plane][l10][i13] = new NodeList();
  10635. groundArray[plane][l10][i13]
  10636. .insertHead(class30_sub2_sub4_sub2_1);
  10637. spawnGroundItem(l10, i13);
  10638. }
  10639. return;
  10640. }
  10641. if (j == 101) {
  10642. int l2 = stream.method427();
  10643. int k5 = l2 >> 2;
  10644. int j8 = l2 & 3;
  10645. int i11 = anIntArray1177[k5];
  10646. int j13 = stream.readUnsignedByte();
  10647. int k15 = anInt1268 + (j13 >> 4 & 7);
  10648. int l16 = anInt1269 + (j13 & 7);
  10649. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10650. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10651. return;
  10652. }
  10653. if (j == 117) {
  10654. int i3 = stream.readUnsignedByte();
  10655. int l5 = anInt1268 + (i3 >> 4 & 7);
  10656. int k8 = anInt1269 + (i3 & 7);
  10657. int j11 = l5 + stream.readSignedByte();
  10658. int k13 = k8 + stream.readSignedByte();
  10659. int l15 = stream.readSignedWord();
  10660. int i17 = stream.readUnsignedWord();
  10661. int i18 = stream.readUnsignedByte() * 4;
  10662. int l18 = stream.readUnsignedByte() * 4;
  10663. int k19 = stream.readUnsignedWord();
  10664. int j20 = stream.readUnsignedWord();
  10665. int i21 = stream.readUnsignedByte();
  10666. int j21 = stream.readUnsignedByte();
  10667. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  10668. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  10669. l5 = l5 * 128 + 64;
  10670. k8 = k8 * 128 + 64;
  10671. j11 = j11 * 128 + 64;
  10672. k13 = k13 * 128 + 64;
  10673. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  10674. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  10675. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  10676. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  10677. method42(plane, k13, j11) - l18, j11);
  10678. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10679. }
  10680. }
  10681. }
  10682.  
  10683. private static void setLowMem() {
  10684. WorldController.lowMem = true;
  10685. Texture.lowMem = true;
  10686. lowMem = true;
  10687. ObjectManager.lowMem = true;
  10688. ObjectDef.lowMem = true;
  10689. }
  10690.  
  10691. public void method139(Stream stream) {
  10692. stream.initBitAccess();
  10693. int k = stream.readBits(8);
  10694. if (k < npcCount) {
  10695. for (int l = k; l < npcCount; l++)
  10696. anIntArray840[anInt839++] = npcIndices[l];
  10697.  
  10698. }
  10699. if (k > npcCount) {
  10700. signlink.reporterror(myUsername + " Too many npcs");
  10701. throw new RuntimeException("eek");
  10702. }
  10703. npcCount = 0;
  10704. for (int i1 = 0; i1 < k; i1++) {
  10705. int j1 = npcIndices[i1];
  10706. NPC npc = npcArray[j1];
  10707. int k1 = stream.readBits(1);
  10708. if (k1 == 0) {
  10709. npcIndices[npcCount++] = j1;
  10710. npc.anInt1537 = loopCycle;
  10711. } else {
  10712. int l1 = stream.readBits(2);
  10713. if (l1 == 0) {
  10714. npcIndices[npcCount++] = j1;
  10715. npc.anInt1537 = loopCycle;
  10716. anIntArray894[anInt893++] = j1;
  10717. } else if (l1 == 1) {
  10718. npcIndices[npcCount++] = j1;
  10719. npc.anInt1537 = loopCycle;
  10720. int i2 = stream.readBits(3);
  10721. npc.moveInDir(false, i2);
  10722. int k2 = stream.readBits(1);
  10723. if (k2 == 1)
  10724. anIntArray894[anInt893++] = j1;
  10725. } else if (l1 == 2) {
  10726. npcIndices[npcCount++] = j1;
  10727. npc.anInt1537 = loopCycle;
  10728. int j2 = stream.readBits(3);
  10729. npc.moveInDir(true, j2);
  10730. int l2 = stream.readBits(3);
  10731. npc.moveInDir(true, l2);
  10732. int i3 = stream.readBits(1);
  10733. if (i3 == 1)
  10734. anIntArray894[anInt893++] = j1;
  10735. } else if (l1 == 3)
  10736. anIntArray840[anInt839++] = j1;
  10737. }
  10738. }
  10739.  
  10740. }
  10741.  
  10742. public void processLoginScreenInput() {
  10743. if (loginScreenState == 0) {
  10744. int i = super.myWidth / 2 - 80;
  10745. int l = super.myHeight / 2 + 20;
  10746. l += 20;
  10747. if (super.clickMode3 == 1 && super.saveClickX >= i - 75
  10748. && super.saveClickX <= i + 75 && super.saveClickY >= l - 20
  10749. && super.saveClickY <= l + 20) {
  10750. loginScreenState = 3;
  10751. loginScreenCursorPos = 0;
  10752. }
  10753. i = super.myWidth / 2 + 80;
  10754. if (super.clickMode3 == 1 && super.saveClickX >= i - 75
  10755. && super.saveClickX <= i + 75 && super.saveClickY >= l - 20
  10756. && super.saveClickY <= l + 20) {
  10757. loginMessage1 = "";
  10758. loginMessage2 = "Enter your username & password.";
  10759. loginScreenState = 2;
  10760. loginScreenCursorPos = 0;
  10761. }
  10762. } else {
  10763. if (loginScreenState == 2) {
  10764. int j = super.myHeight / 2 - 40;
  10765. j += 30;
  10766. j += 25;
  10767. if (super.clickMode3 == 1 && super.saveClickY >= j - 15
  10768. && super.saveClickY < j)
  10769. loginScreenCursorPos = 0;
  10770. j += 15;
  10771. if (super.clickMode3 == 1 && super.saveClickY >= j - 15
  10772. && super.saveClickY < j)
  10773. loginScreenCursorPos = 1;
  10774. j += 15;
  10775. int i1 = super.myWidth / 2 - 80;
  10776. int k1 = super.myHeight / 2 + 50;
  10777. k1 += 20;
  10778. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75
  10779. && super.saveClickX <= i1 + 75
  10780. && super.saveClickY >= k1 - 20
  10781. && super.saveClickY <= k1 + 20) {
  10782. loginFailures = 0;
  10783. login(myUsername, myPassword, false);
  10784. if (loggedIn)
  10785. return;
  10786. }
  10787. i1 = super.myWidth / 2 + 80;
  10788. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75
  10789. && super.saveClickX <= i1 + 75
  10790. && super.saveClickY >= k1 - 20
  10791. && super.saveClickY <= k1 + 20) {
  10792. loginScreenState = 0;
  10793. // myUsername = "";
  10794. // myPassword = "";
  10795. }
  10796. do {
  10797. int l1 = readChar(-796);
  10798. if (l1 == -1)
  10799. break;
  10800. boolean flag1 = false;
  10801. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  10802. if (l1 != validUserPassChars.charAt(i2))
  10803. continue;
  10804. flag1 = true;
  10805. break;
  10806. }
  10807.  
  10808. if (loginScreenCursorPos == 0) {
  10809. if (l1 == 8 && myUsername.length() > 0)
  10810. myUsername = myUsername.substring(0,
  10811. myUsername.length() - 1);
  10812. if (l1 == 9 || l1 == 10 || l1 == 13)
  10813. loginScreenCursorPos = 1;
  10814. if (flag1)
  10815. myUsername += (char) l1;
  10816. if (myUsername.length() > 12)
  10817. myUsername = myUsername.substring(0, 12);
  10818. } else if (loginScreenCursorPos == 1) {
  10819. if (l1 == 8 && myPassword.length() > 0)
  10820. myPassword = myPassword.substring(0,
  10821. myPassword.length() - 1);
  10822. if (l1 == 9 || l1 == 10 || l1 == 13)
  10823. loginScreenCursorPos = 0;
  10824. if (flag1)
  10825. myPassword += (char) l1;
  10826. if (myPassword.length() > 20)
  10827. myPassword = myPassword.substring(0, 20);
  10828. }
  10829. } while (true);
  10830. return;
  10831. }
  10832. if (loginScreenState == 3) {
  10833. int k = super.myWidth / 2;
  10834. int j1 = super.myHeight / 2 + 50;
  10835. j1 += 20;
  10836. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  10837. && super.saveClickX <= k + 75
  10838. && super.saveClickY >= j1 - 20
  10839. && super.saveClickY <= j1 + 20)
  10840. loginScreenState = 0;
  10841. }
  10842. }
  10843. }
  10844.  
  10845. public static void markMinimap(Sprite sprite, int i, int j) {
  10846. int k = viewRotation + minimapRotation & 0x7ff;
  10847. int l = i * i + j * j;
  10848. if (l > 6400)
  10849. return;
  10850. int i1 = Model.modelIntArray1[k];
  10851. int j1 = Model.modelIntArray2[k];
  10852. i1 = (i1 * 256) / (minimapZoom + 256);
  10853. j1 = (j1 * 256) / (minimapZoom + 256);
  10854. int k1 = j * i1 + i * j1 >> 16;
  10855. int l1 = j * j1 - i * i1 >> 16;
  10856. if (l > 2500) {
  10857. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4, 83 - l1
  10858. - sprite.maxHeight / 2 - 4);
  10859. } else {
  10860. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4, 83 - l1
  10861. - sprite.maxHeight / 2 - 4);
  10862. }
  10863. }
  10864.  
  10865. public void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  10866. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  10867. if (lowMem && j != plane)
  10868. return;
  10869. int i2 = 0;
  10870. if (j1 == 0)
  10871. i2 = worldController.method300(j, i1, i);
  10872. if (j1 == 1)
  10873. i2 = worldController.method301(j, i1, i);
  10874. if (j1 == 2)
  10875. i2 = worldController.method302(j, i1, i);
  10876. if (j1 == 3)
  10877. i2 = worldController.method303(j, i1, i);
  10878. if (i2 != 0) {
  10879. int i3 = worldController.method304(j, i1, i, i2);
  10880. int j2 = i2 >> 14 & 0x7fff;
  10881. int k2 = i3 & 0x1f;
  10882. int l2 = i3 >> 6;
  10883. if (j1 == 0) {
  10884. worldController.method291(i1, j, i, (byte) -119);
  10885. ObjectDef class46 = ObjectDef.forID(j2);
  10886. if (class46.aBoolean767)
  10887. aClass11Array1230[j].method215(l2, k2,
  10888. class46.aBoolean757, i1, i);
  10889. }
  10890. if (j1 == 1)
  10891. worldController.method292(i, j, i1);
  10892. if (j1 == 2) {
  10893. worldController.method293(j, i1, i);
  10894. ObjectDef class46_1 = ObjectDef.forID(j2);
  10895. if (i1 + class46_1.anInt744 > 103
  10896. || i + class46_1.anInt744 > 103
  10897. || i1 + class46_1.anInt761 > 103
  10898. || i + class46_1.anInt761 > 103)
  10899. return;
  10900. if (class46_1.aBoolean767)
  10901. aClass11Array1230[j].method216(l2, class46_1.anInt744,
  10902. i1, i, class46_1.anInt761,
  10903. class46_1.aBoolean757);
  10904. }
  10905. if (j1 == 3) {
  10906. worldController.method294(j, i, i1);
  10907. ObjectDef class46_2 = ObjectDef.forID(j2);
  10908. if (class46_2.aBoolean767 && class46_2.hasActions)
  10909. aClass11Array1230[j].method218(i, i1);
  10910. }
  10911. }
  10912. if (k1 >= 0) {
  10913. int j3 = j;
  10914. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10915. j3++;
  10916. ObjectManager.method188(worldController, k, i, l, j3,
  10917. aClass11Array1230[j], intGroundArray, i1, k1, j);
  10918. }
  10919. }
  10920. }
  10921.  
  10922. public void updatePlayers(int i, Stream stream) {
  10923. anInt839 = 0;
  10924. anInt893 = 0;
  10925. method117(stream);
  10926. method134(stream);
  10927. method91(stream, i);
  10928. method49(stream);
  10929. for (int k = 0; k < anInt839; k++) {
  10930. int l = anIntArray840[k];
  10931. if (playerArray[l].anInt1537 != loopCycle)
  10932. playerArray[l] = null;
  10933. }
  10934.  
  10935. if (stream.currentOffset != i) {
  10936. signlink.reporterror("Error packet size mismatch in getplayer pos:"
  10937. + stream.currentOffset + " psize:" + i);
  10938. throw new RuntimeException("eek");
  10939. }
  10940. for (int i1 = 0; i1 < playerCount; i1++)
  10941. if (playerArray[playerIndices[i1]] == null) {
  10942. signlink.reporterror(myUsername
  10943. + " null entry in pl list - pos:" + i1 + " size:"
  10944. + playerCount);
  10945. throw new RuntimeException("eek");
  10946. }
  10947.  
  10948. }
  10949.  
  10950. public void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  10951. int l1 = 2048 - k & 0x7ff;
  10952. int i2 = 2048 - j1 & 0x7ff;
  10953. int j2 = 0;
  10954. int k2 = 0;
  10955. int l2 = j;
  10956. if (l1 != 0) {
  10957. int i3 = Model.modelIntArray1[l1];
  10958. int k3 = Model.modelIntArray2[l1];
  10959. int i4 = k2 * k3 - l2 * i3 >> 16;
  10960. l2 = k2 * i3 + l2 * k3 >> 16;
  10961. k2 = i4;
  10962. }
  10963. if (i2 != 0) {
  10964. /*
  10965. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  10966. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  10967. * l2 = fwdbwd; }
  10968. */
  10969. int j3 = Model.modelIntArray1[i2];
  10970. int l3 = Model.modelIntArray2[i2];
  10971. int j4 = l2 * j3 + j2 * l3 >> 16;
  10972. l2 = l2 * l3 - j2 * j3 >> 16;
  10973. j2 = j4;
  10974. }
  10975. xCameraPos = l - j2;
  10976. zCameraPos = i1 - k2;
  10977. yCameraPos = k1 - l2;
  10978. yCameraCurve = k;
  10979. xCameraCurve = j1;
  10980. }
  10981.  
  10982. public void updateStrings(String str, int i) {
  10983. switch (i) {
  10984. case 1675:
  10985. sendFrame126(str, 17508);
  10986. break;// Stab
  10987. case 1676:
  10988. sendFrame126(str, 17509);
  10989. break;// Slash
  10990. case 1678:
  10991. sendFrame126(str, 17511);
  10992. break;// Magic
  10993. case 1679:
  10994. sendFrame126(str, 17512);
  10995. break;// Range
  10996. case 1680:
  10997. sendFrame126(str, 17513);
  10998. break;// Stab
  10999. case 1681:
  11000. sendFrame126(str, 17514);
  11001. break;// Slash
  11002. case 1682:
  11003. sendFrame126(str, 17515);
  11004. break;// Crush
  11005. case 1683:
  11006. sendFrame126(str, 17516);
  11007. break;// Magic
  11008. case 1684:
  11009. sendFrame126(str, 17517);
  11010. break;// Range
  11011. case 1686:
  11012. sendFrame126(str, 17518);
  11013. break;// Strength
  11014. case 1687:
  11015. sendFrame126(str, 17519);
  11016. break;// Prayer
  11017. }
  11018. }
  11019.  
  11020. public void sendFrame126(String str, int i) {
  11021. RSInterface.interfaceCache[i].message = str;
  11022. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  11023. needDrawTabArea = true;
  11024. }
  11025.  
  11026. public void sendPacket185(int button, int toggle, int type) {
  11027. switch (type) {
  11028. case 135:
  11029. RSInterface class9 = RSInterface.interfaceCache[button];
  11030. boolean flag8 = true;
  11031. if (class9.contentType > 0)
  11032. flag8 = promptUserForInput(class9);
  11033. if (flag8) {
  11034. stream.createFrame(185);
  11035. stream.writeWord(button);
  11036. }
  11037. break;
  11038. case 646:
  11039. stream.createFrame(185);
  11040. stream.writeWord(button);
  11041. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11042. if (class9_2.valueIndexArray != null
  11043. && class9_2.valueIndexArray[0][0] == 5) {
  11044. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11045. variousSettings[toggle] = class9_2.anIntArray212[0];
  11046. method33(toggle);
  11047. needDrawTabArea = true;
  11048. }
  11049. }
  11050. break;
  11051. case 169:
  11052. stream.createFrame(185);
  11053. stream.writeWord(button);
  11054. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11055. if (class9_3.valueIndexArray != null
  11056. && class9_3.valueIndexArray[0][0] == 5) {
  11057. variousSettings[toggle] = 1 - variousSettings[toggle];
  11058. method33(toggle);
  11059. needDrawTabArea = true;
  11060. }
  11061. switch (button) {
  11062. case 19136:
  11063. System.out.println("toggle = " + toggle);
  11064. if (toggle == 0)
  11065. sendFrame36(173, toggle);
  11066. if (toggle == 1)
  11067. sendPacket185(153, 173, 646);
  11068. break;
  11069. }
  11070. break;
  11071. }
  11072. }
  11073.  
  11074. public void sendFrame36(int id, int state) {
  11075. anIntArray1045[id] = state;
  11076. if (variousSettings[id] != state) {
  11077. variousSettings[id] = state;
  11078. method33(id);
  11079. needDrawTabArea = true;
  11080. if (dialogID != -1)
  11081. inputTaken = true;
  11082. }
  11083. }
  11084.  
  11085. public void sendFrame219() {
  11086. if (invOverlayInterfaceID != -1) {
  11087. invOverlayInterfaceID = -1;
  11088. needDrawTabArea = true;
  11089. tabAreaAltered = true;
  11090. }
  11091. if (backDialogID != -1) {
  11092. backDialogID = -1;
  11093. inputTaken = true;
  11094. }
  11095. if (inputDialogState != 0) {
  11096. inputDialogState = 0;
  11097. inputTaken = true;
  11098. }
  11099. openInterfaceID = -1;
  11100. aBoolean1149 = false;
  11101. }
  11102.  
  11103. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  11104. if (backDialogID != -1) {
  11105. backDialogID = -1;
  11106. inputTaken = true;
  11107. }
  11108. if (inputDialogState != 0) {
  11109. inputDialogState = 0;
  11110. inputTaken = true;
  11111. }
  11112. openInterfaceID = interfaceID;
  11113. invOverlayInterfaceID = sideInterfaceID;
  11114. needDrawTabArea = true;
  11115. tabAreaAltered = true;
  11116. aBoolean1149 = false;
  11117. }
  11118.  
  11119. private boolean parsePacket() {
  11120. if (socketStream == null)
  11121. return false;
  11122. try {
  11123. int i = socketStream.available();
  11124. if (i == 0)
  11125. return false;
  11126. if (pktType == -1) {
  11127. socketStream.flushInputStream(inStream.buffer, 1);
  11128. pktType = inStream.buffer[0] & 0xff;
  11129. if (encryption != null)
  11130. pktType = pktType - encryption.getNextKey() & 0xff;
  11131. pktSize = SizeConstants.packetSizes[pktType];
  11132. i--;
  11133. }
  11134. if (pktSize == -1)
  11135. if (i > 0) {
  11136. socketStream.flushInputStream(inStream.buffer, 1);
  11137. pktSize = inStream.buffer[0] & 0xff;
  11138. i--;
  11139. } else {
  11140. return false;
  11141. }
  11142. if (pktSize == -2)
  11143. if (i > 1) {
  11144. socketStream.flushInputStream(inStream.buffer, 2);
  11145. inStream.currentOffset = 0;
  11146. pktSize = inStream.readUnsignedWord();
  11147. i -= 2;
  11148. } else {
  11149. return false;
  11150. }
  11151. if (i < pktSize)
  11152. return false;
  11153. inStream.currentOffset = 0;
  11154. socketStream.flushInputStream(inStream.buffer, pktSize);
  11155. anInt1009 = 0;
  11156. anInt843 = anInt842;
  11157. anInt842 = anInt841;
  11158. anInt841 = pktType;
  11159. switch (pktType) {
  11160. case 81:
  11161. updatePlayers(pktSize, inStream);
  11162. aBoolean1080 = false;
  11163. pktType = -1;
  11164. return true;
  11165.  
  11166. case 176:
  11167. daysSinceRecovChange = inStream.method427();
  11168. unreadMessages = inStream.method435();
  11169. membersInt = inStream.readUnsignedByte();
  11170. anInt1193 = inStream.method440();
  11171. daysSinceLastLogin = inStream.readUnsignedWord();
  11172. if (anInt1193 != 0 && openInterfaceID == -1) {
  11173. signlink.dnslookup(TextClass.method586(anInt1193));
  11174. clearTopInterfaces();
  11175. char c = '\u028A';
  11176. if (daysSinceRecovChange != 201 || membersInt == 1)
  11177. c = '\u028F';
  11178. reportAbuseInput = "";
  11179. canMute = false;
  11180. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11181. if (RSInterface.interfaceCache[k9] == null
  11182. || RSInterface.interfaceCache[k9].contentType != c)
  11183. continue;
  11184. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11185.  
  11186. }
  11187. }
  11188. pktType = -1;
  11189. return true;
  11190.  
  11191. case 64:
  11192. anInt1268 = inStream.method427();
  11193. anInt1269 = inStream.method428();
  11194. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  11195. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11196. if (groundArray[plane][j][l9] != null) {
  11197. groundArray[plane][j][l9] = null;
  11198. spawnGroundItem(j, l9);
  11199. }
  11200. }
  11201. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  11202. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  11203. .reverseGetNext())
  11204. if (class30_sub1.anInt1297 >= anInt1268
  11205. && class30_sub1.anInt1297 < anInt1268 + 8
  11206. && class30_sub1.anInt1298 >= anInt1269
  11207. && class30_sub1.anInt1298 < anInt1269 + 8
  11208. && class30_sub1.anInt1295 == plane)
  11209. class30_sub1.anInt1294 = 0;
  11210. pktType = -1;
  11211. return true;
  11212.  
  11213. case 185:
  11214. int k = inStream.method436();
  11215. RSInterface.interfaceCache[k].anInt233 = 3;
  11216. if (myPlayer.desc == null)
  11217. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  11218. + (myPlayer.anIntArray1700[4] << 20)
  11219. + (myPlayer.equipment[0] << 15)
  11220. + (myPlayer.equipment[8] << 10)
  11221. + (myPlayer.equipment[11] << 5)
  11222. + myPlayer.equipment[1];
  11223. else
  11224. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  11225. pktType = -1;
  11226. return true;
  11227.  
  11228. /* Clan message packet */
  11229. case 217:
  11230. try {
  11231. name = inStream.readString();
  11232. message = inStream.readString();
  11233. clanname = inStream.readString();
  11234. rights = inStream.readUnsignedWord();
  11235. pushMessage(message, 16, name);
  11236. } catch(Exception e) {
  11237. e.printStackTrace();
  11238. }
  11239. pktType = -1;
  11240. return true;
  11241.  
  11242. case 107:
  11243. aBoolean1160 = false;
  11244. for (int l = 0; l < 5; l++)
  11245. aBooleanArray876[l] = false;
  11246. pktType = -1;
  11247. return true;
  11248.  
  11249. case 72:
  11250. int i1 = inStream.method434();
  11251. RSInterface class9 = RSInterface.interfaceCache[i1];
  11252. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  11253. class9.inv[k15] = -1;
  11254. class9.inv[k15] = 0;
  11255. }
  11256. pktType = -1;
  11257. return true;
  11258.  
  11259. case 214:
  11260. ignoreCount = pktSize / 8;
  11261. for (int j1 = 0; j1 < ignoreCount; j1++)
  11262. ignoreListAsLongs[j1] = inStream.readQWord();
  11263. pktType = -1;
  11264. return true;
  11265.  
  11266. case 166:
  11267. aBoolean1160 = true;
  11268. anInt1098 = inStream.readUnsignedByte();
  11269. anInt1099 = inStream.readUnsignedByte();
  11270. anInt1100 = inStream.readUnsignedWord();
  11271. anInt1101 = inStream.readUnsignedByte();
  11272. anInt1102 = inStream.readUnsignedByte();
  11273. if (anInt1102 >= 100) {
  11274. xCameraPos = anInt1098 * 128 + 64;
  11275. yCameraPos = anInt1099 * 128 + 64;
  11276. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  11277. - anInt1100;
  11278. }
  11279. pktType = -1;
  11280. return true;
  11281.  
  11282. case 134:
  11283. needDrawTabArea = true;
  11284. int k1 = inStream.readUnsignedByte();
  11285. int i10 = inStream.method439();
  11286. int l15 = inStream.readUnsignedByte();
  11287. currentExp[k1] = i10;
  11288. currentStats[k1] = l15;
  11289. maxStats[k1] = 1;
  11290. for (int k20 = 0; k20 < 98; k20++)
  11291. if (i10 >= anIntArray1019[k20])
  11292. maxStats[k1] = k20 + 2;
  11293. pktType = -1;
  11294. return true;
  11295.  
  11296. case 71:
  11297. int l1 = inStream.readUnsignedWord();
  11298. int j10 = inStream.method426();
  11299. if (l1 == 65535)
  11300. l1 = -1;
  11301. tabInterfaceIDs[j10] = l1;
  11302. needDrawTabArea = true;
  11303. tabAreaAltered = true;
  11304. pktType = -1;
  11305. return true;
  11306.  
  11307. case 74:
  11308. int i2 = inStream.method434();
  11309. if (i2 == 65535)
  11310. i2 = -1;
  11311. if (i2 != currentSong && musicEnabled && !lowMem
  11312. && prevSong == 0) {
  11313. nextSong = i2;
  11314. songChanging = true;
  11315. onDemandFetcher.method558(2, nextSong);
  11316. }
  11317. currentSong = i2;
  11318. pktType = -1;
  11319. return true;
  11320.  
  11321. case 121:
  11322. int j2 = inStream.method436();
  11323. int k10 = inStream.method435();
  11324. if (musicEnabled && !lowMem) {
  11325. nextSong = j2;
  11326. songChanging = false;
  11327. onDemandFetcher.method558(2, nextSong);
  11328. prevSong = k10;
  11329. }
  11330. pktType = -1;
  11331. return true;
  11332.  
  11333. case 109:
  11334. resetLogout();
  11335. pktType = -1;
  11336. return false;
  11337.  
  11338. case 70:
  11339. int k2 = inStream.readSignedWord();
  11340. int l10 = inStream.method437();
  11341. int i16 = inStream.method434();
  11342. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11343. class9_5.anInt263 = k2;
  11344. class9_5.anInt265 = l10;
  11345. pktType = -1;
  11346. return true;
  11347.  
  11348. case 73:
  11349. case 241:
  11350. int l2 = anInt1069;
  11351. int i11 = anInt1070;
  11352. if (pktType == 73) {
  11353. l2 = inStream.method435();
  11354. i11 = inStream.readUnsignedWord();
  11355. aBoolean1159 = false;
  11356. }
  11357. if (pktType == 241) {
  11358. i11 = inStream.method435();
  11359. inStream.initBitAccess();
  11360. for (int j16 = 0; j16 < 4; j16++) {
  11361. for (int l20 = 0; l20 < 13; l20++) {
  11362. for (int j23 = 0; j23 < 13; j23++) {
  11363. int i26 = inStream.readBits(1);
  11364. if (i26 == 1)
  11365. anIntArrayArrayArray1129[j16][l20][j23] = inStream
  11366. .readBits(26);
  11367. else
  11368. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11369. }
  11370. }
  11371. }
  11372. inStream.finishBitAccess();
  11373. l2 = inStream.readUnsignedWord();
  11374. aBoolean1159 = true;
  11375. }
  11376. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11377. pktType = -1;
  11378. return true;
  11379. }
  11380. anInt1069 = l2;
  11381. anInt1070 = i11;
  11382. baseX = (anInt1069 - 6) * 8;
  11383. baseY = (anInt1070 - 6) * 8;
  11384. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49)
  11385. && anInt1070 / 8 == 48;
  11386. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11387. aBoolean1141 = true;
  11388. loadingStage = 1;
  11389. aLong824 = System.currentTimeMillis();
  11390. aRSImageProducer_1165.initDrawingArea();
  11391. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2);
  11392. DrawingArea.drawPixels(20, 3, 3, 0, 128);
  11393. aTextDrawingArea_1271.drawText(0, "Loading - Please Wait", 18,
  11394. 68);
  11395. aTextDrawingArea_1271.drawText(0xffffff,
  11396. "Loading - Please Wait", 17, 67);
  11397. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11398. if (pktType == 73) {
  11399. int k16 = 0;
  11400. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11401. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11402. k16++;
  11403. }
  11404. aByteArrayArray1183 = new byte[k16][];
  11405. aByteArrayArray1247 = new byte[k16][];
  11406. anIntArray1234 = new int[k16];
  11407. anIntArray1235 = new int[k16];
  11408. anIntArray1236 = new int[k16];
  11409. k16 = 0;
  11410. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11411. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11412. anIntArray1234[k16] = (l23 << 8) + j26;
  11413. if (aBoolean1141
  11414. && (j26 == 49 || j26 == 149 || j26 == 147
  11415. || l23 == 50 || l23 == 49
  11416. && j26 == 47)) {
  11417. anIntArray1235[k16] = -1;
  11418. anIntArray1236[k16] = -1;
  11419. k16++;
  11420. } else {
  11421. int k28 = anIntArray1235[k16] = onDemandFetcher
  11422. .method562(0, j26, l23);
  11423. if (k28 != -1)
  11424. onDemandFetcher.method558(3, k28);
  11425. int j30 = anIntArray1236[k16] = onDemandFetcher
  11426. .method562(1, j26, l23);
  11427. if (j30 != -1)
  11428. onDemandFetcher.method558(3, j30);
  11429. k16++;
  11430. }
  11431. }
  11432. }
  11433. }
  11434. if (pktType == 241) {
  11435. int l16 = 0;
  11436. int ai[] = new int[676];
  11437. for (int i24 = 0; i24 < 4; i24++) {
  11438. for (int k26 = 0; k26 < 13; k26++) {
  11439. for (int l28 = 0; l28 < 13; l28++) {
  11440. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11441. if (k30 != -1) {
  11442. int k31 = k30 >> 14 & 0x3ff;
  11443. int i32 = k30 >> 3 & 0x7ff;
  11444. int k32 = (k31 / 8 << 8) + i32 / 8;
  11445. for (int j33 = 0; j33 < l16; j33++) {
  11446. if (ai[j33] != k32)
  11447. continue;
  11448. k32 = -1;
  11449.  
  11450. }
  11451. if (k32 != -1)
  11452. ai[l16++] = k32;
  11453. }
  11454. }
  11455. }
  11456. }
  11457. aByteArrayArray1183 = new byte[l16][];
  11458. aByteArrayArray1247 = new byte[l16][];
  11459. anIntArray1234 = new int[l16];
  11460. anIntArray1235 = new int[l16];
  11461. anIntArray1236 = new int[l16];
  11462. for (int l26 = 0; l26 < l16; l26++) {
  11463. int i29 = anIntArray1234[l26] = ai[l26];
  11464. int l30 = i29 >> 8 & 0xff;
  11465. int l31 = i29 & 0xff;
  11466. int j32 = anIntArray1235[l26] = onDemandFetcher
  11467. .method562(0, l31, l30);
  11468. if (j32 != -1)
  11469. onDemandFetcher.method558(3, j32);
  11470. int i33 = anIntArray1236[l26] = onDemandFetcher
  11471. .method562(1, l31, l30);
  11472. if (i33 != -1)
  11473. onDemandFetcher.method558(3, i33);
  11474. }
  11475. }
  11476. int i17 = baseX - anInt1036;
  11477. int j21 = baseY - anInt1037;
  11478. anInt1036 = baseX;
  11479. anInt1037 = baseY;
  11480. for (int j24 = 0; j24 < 16384; j24++) {
  11481. NPC npc = npcArray[j24];
  11482. if (npc != null) {
  11483. for (int j29 = 0; j29 < 10; j29++) {
  11484. npc.smallX[j29] -= i17;
  11485. npc.smallY[j29] -= j21;
  11486. }
  11487. npc.x -= i17 * 128;
  11488. npc.y -= j21 * 128;
  11489. }
  11490. }
  11491. for (int i27 = 0; i27 < maxPlayers; i27++) {
  11492. Player player = playerArray[i27];
  11493. if (player != null) {
  11494. for (int i31 = 0; i31 < 10; i31++) {
  11495. player.smallX[i31] -= i17;
  11496. player.smallY[i31] -= j21;
  11497. }
  11498. player.x -= i17 * 128;
  11499. player.y -= j21 * 128;
  11500. }
  11501. }
  11502. aBoolean1080 = true;
  11503. byte byte1 = 0;
  11504. byte byte2 = 104;
  11505. byte byte3 = 1;
  11506. if (i17 < 0) {
  11507. byte1 = 103;
  11508. byte2 = -1;
  11509. byte3 = -1;
  11510. }
  11511. byte byte4 = 0;
  11512. byte byte5 = 104;
  11513. byte byte6 = 1;
  11514. if (j21 < 0) {
  11515. byte4 = 103;
  11516. byte5 = -1;
  11517. byte6 = -1;
  11518. }
  11519. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  11520. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  11521. int i34 = k33 + i17;
  11522. int j34 = l33 + j21;
  11523. for (int k34 = 0; k34 < 4; k34++)
  11524. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11525. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11526. else
  11527. groundArray[k34][k33][l33] = null;
  11528. }
  11529. }
  11530. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11531. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11532. .reverseGetNext()) {
  11533. class30_sub1_1.anInt1297 -= i17;
  11534. class30_sub1_1.anInt1298 -= j21;
  11535. if (class30_sub1_1.anInt1297 < 0
  11536. || class30_sub1_1.anInt1298 < 0
  11537. || class30_sub1_1.anInt1297 >= 104
  11538. || class30_sub1_1.anInt1298 >= 104)
  11539. class30_sub1_1.unlink();
  11540. }
  11541. if (destX != 0) {
  11542. destX -= i17;
  11543. destY -= j21;
  11544. }
  11545. aBoolean1160 = false;
  11546. pktType = -1;
  11547. return true;
  11548.  
  11549. case 208:
  11550. int i3 = inStream.method437();
  11551. if (i3 >= 0)
  11552. method60(i3);
  11553. anInt1018 = i3;
  11554. pktType = -1;
  11555. return true;
  11556.  
  11557. case 99:
  11558. /*
  11559. * Black map, mape state 2, causes blackness
  11560. */
  11561. anInt1021 = inStream.readUnsignedByte();
  11562. pktType = -1;
  11563. return true;
  11564.  
  11565. case 75:
  11566. int j3 = inStream.method436();
  11567. int j11 = inStream.method436();
  11568. RSInterface.interfaceCache[j11].anInt233 = 2;
  11569. RSInterface.interfaceCache[j11].mediaID = j3;
  11570. pktType = -1;
  11571. return true;
  11572.  
  11573. case 114:
  11574. anInt1104 = inStream.method434() * 30;
  11575. pktType = -1;
  11576. return true;
  11577.  
  11578. case 60:
  11579. anInt1269 = inStream.readUnsignedByte();
  11580. anInt1268 = inStream.method427();
  11581. while (inStream.currentOffset < pktSize) {
  11582. int k3 = inStream.readUnsignedByte();
  11583. method137(inStream, k3);
  11584. }
  11585. pktType = -1;
  11586. return true;
  11587.  
  11588. case 35:
  11589. int l3 = inStream.readUnsignedByte();
  11590. int k11 = inStream.readUnsignedByte();
  11591. int j17 = inStream.readUnsignedByte();
  11592. int k21 = inStream.readUnsignedByte();
  11593. aBooleanArray876[l3] = true;
  11594. anIntArray873[l3] = k11;
  11595. anIntArray1203[l3] = j17;
  11596. anIntArray928[l3] = k21;
  11597. anIntArray1030[l3] = 0;
  11598. pktType = -1;
  11599. return true;
  11600.  
  11601. case 174:
  11602. int i4 = inStream.readUnsignedWord();
  11603. int l11 = inStream.readUnsignedByte();
  11604. int k17 = inStream.readUnsignedWord();
  11605. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  11606. anIntArray1207[anInt1062] = i4;
  11607. anIntArray1241[anInt1062] = l11;
  11608. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11609. anInt1062++;
  11610. }
  11611. pktType = -1;
  11612. return true;
  11613.  
  11614. case 104:
  11615. int j4 = inStream.method427();
  11616. int i12 = inStream.method426();
  11617. String s6 = inStream.readString();
  11618. if (j4 >= 1 && j4 <= 5) {
  11619. if (s6.equalsIgnoreCase("null"))
  11620. s6 = null;
  11621. atPlayerActions[j4 - 1] = s6;
  11622. atPlayerArray[j4 - 1] = i12 == 0;
  11623. }
  11624. pktType = -1;
  11625. return true;
  11626.  
  11627. case 78:
  11628. destX = 0;
  11629. pktType = -1;
  11630. return true;
  11631.  
  11632. case 253:
  11633. String s = inStream.readString();
  11634. if(s.endsWith(":tradereq:")) {
  11635. String s3 = s.substring(0, s.indexOf(":"));
  11636. long l17 = TextClass.longForName(s3);
  11637. boolean flag2 = false;
  11638. for(int j27 = 0; j27 < ignoreCount; j27++) {
  11639. if(ignoreListAsLongs[j27] != l17)
  11640. continue;
  11641. flag2 = true;
  11642. }
  11643. if(!flag2 && anInt1251 == 0)
  11644. pushMessage("wishes to trade with you.", 4, s3);
  11645. } else if (s.endsWith(":clan:")) {
  11646. String s4 = s.substring(0, s.indexOf(":"));
  11647. TextClass.longForName(s4);
  11648. pushMessage("Clan: ", 8, s4);
  11649. } else if(s.endsWith("#url#")) {
  11650. String link = s.substring(0, s.indexOf("#"));
  11651. pushMessage("Join us at: ", 9, link);
  11652. } else if(s.endsWith(":duelreq:")) {
  11653. String s4 = s.substring(0, s.indexOf(":"));
  11654. long l18 = TextClass.longForName(s4);
  11655. boolean flag3 = false;
  11656. for(int k27 = 0; k27 < ignoreCount; k27++) {
  11657. if(ignoreListAsLongs[k27] != l18)
  11658. continue;
  11659. flag3 = true;
  11660.  
  11661. }
  11662. if(!flag3 && anInt1251 == 0)
  11663. pushMessage("wishes to duel with you.", 8, s4);
  11664. } else if(s.endsWith(":chalreq:")) {
  11665. String s5 = s.substring(0, s.indexOf(":"));
  11666. long l19 = TextClass.longForName(s5);
  11667. boolean flag4 = false;
  11668. for(int l27 = 0; l27 < ignoreCount; l27++) {
  11669. if(ignoreListAsLongs[l27] != l19)
  11670. continue;
  11671. flag4 = true;
  11672.  
  11673. }
  11674. if(!flag4 && anInt1251 == 0) {
  11675. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11676. pushMessage(s8, 8, s5);
  11677. }
  11678. } else {
  11679. pushMessage(s, 0, "");
  11680. }
  11681. pktType = -1;
  11682. return true;
  11683.  
  11684. case 1:
  11685. for (int k4 = 0; k4 < playerArray.length; k4++)
  11686. if (playerArray[k4] != null)
  11687. playerArray[k4].anim = -1;
  11688. for (int j12 = 0; j12 < npcArray.length; j12++)
  11689. if (npcArray[j12] != null)
  11690. npcArray[j12].anim = -1;
  11691. pktType = -1;
  11692. return true;
  11693.  
  11694. case 50:
  11695. long l4 = inStream.readQWord();
  11696. int i18 = inStream.readUnsignedByte();
  11697. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11698. for (int k24 = 0; k24 < friendsCount; k24++) {
  11699. if (l4 != friendsListAsLongs[k24])
  11700. continue;
  11701. if (friendsNodeIDs[k24] != i18) {
  11702. friendsNodeIDs[k24] = i18;
  11703. needDrawTabArea = true;
  11704. if (i18 >= 2) {
  11705. pushMessage(s7 + " has logged in.", 5, "");
  11706. }
  11707. if (i18 <= 1) {
  11708. pushMessage(s7 + " has logged out.", 5, "");
  11709. }
  11710. }
  11711. s7 = null;
  11712.  
  11713. }
  11714. if (s7 != null && friendsCount < 200) {
  11715. friendsListAsLongs[friendsCount] = l4;
  11716. friendsList[friendsCount] = s7;
  11717. friendsNodeIDs[friendsCount] = i18;
  11718. friendsCount++;
  11719. needDrawTabArea = true;
  11720. }
  11721. for (boolean flag6 = false; !flag6;) {
  11722. flag6 = true;
  11723. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  11724. if (friendsNodeIDs[k29] != nodeID
  11725. && friendsNodeIDs[k29 + 1] == nodeID
  11726. || friendsNodeIDs[k29] == 0
  11727. && friendsNodeIDs[k29 + 1] != 0) {
  11728. int j31 = friendsNodeIDs[k29];
  11729. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11730. friendsNodeIDs[k29 + 1] = j31;
  11731. String s10 = friendsList[k29];
  11732. friendsList[k29] = friendsList[k29 + 1];
  11733. friendsList[k29 + 1] = s10;
  11734. long l32 = friendsListAsLongs[k29];
  11735. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11736. friendsListAsLongs[k29 + 1] = l32;
  11737. needDrawTabArea = true;
  11738. flag6 = false;
  11739. }
  11740. }
  11741. pktType = -1;
  11742. return true;
  11743.  
  11744. case 110:
  11745. if (tabID == 12)
  11746. needDrawTabArea = true;
  11747. energy = inStream.readUnsignedByte();
  11748. pktType = -1;
  11749. return true;
  11750.  
  11751. case 254:
  11752. anInt855 = inStream.readUnsignedByte();
  11753. if (anInt855 == 1)
  11754. anInt1222 = inStream.readUnsignedWord();
  11755. if (anInt855 >= 2 && anInt855 <= 6) {
  11756. if (anInt855 == 2) {
  11757. anInt937 = 64;
  11758. anInt938 = 64;
  11759. }
  11760. if (anInt855 == 3) {
  11761. anInt937 = 0;
  11762. anInt938 = 64;
  11763. }
  11764. if (anInt855 == 4) {
  11765. anInt937 = 128;
  11766. anInt938 = 64;
  11767. }
  11768. if (anInt855 == 5) {
  11769. anInt937 = 64;
  11770. anInt938 = 0;
  11771. }
  11772. if (anInt855 == 6) {
  11773. anInt937 = 64;
  11774. anInt938 = 128;
  11775. }
  11776. anInt855 = 2;
  11777. anInt934 = inStream.readUnsignedWord();
  11778. anInt935 = inStream.readUnsignedWord();
  11779. anInt936 = inStream.readUnsignedByte();
  11780. }
  11781. if (anInt855 == 10)
  11782. anInt933 = inStream.readUnsignedWord();
  11783. pktType = -1;
  11784. return true;
  11785.  
  11786. case 248:
  11787. int i5 = inStream.method435();
  11788. int k12 = inStream.readUnsignedWord();
  11789. if (backDialogID != -1) {
  11790. backDialogID = -1;
  11791. inputTaken = true;
  11792. }
  11793. if (inputDialogState != 0) {
  11794. inputDialogState = 0;
  11795. inputTaken = true;
  11796. }
  11797. openInterfaceID = i5;
  11798. invOverlayInterfaceID = k12;
  11799. needDrawTabArea = true;
  11800. tabAreaAltered = true;
  11801. aBoolean1149 = false;
  11802. pktType = -1;
  11803. return true;
  11804.  
  11805. case 79:
  11806. int j5 = inStream.method434();
  11807. int l12 = inStream.method435();
  11808. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11809. if (class9_3 != null && class9_3.type == 0) {
  11810. if (l12 < 0)
  11811. l12 = 0;
  11812. if (l12 > class9_3.scrollMax - class9_3.height)
  11813. l12 = class9_3.scrollMax - class9_3.height;
  11814. class9_3.scrollPosition = l12;
  11815. }
  11816. pktType = -1;
  11817. return true;
  11818.  
  11819. case 68:
  11820. for (int k5 = 0; k5 < variousSettings.length; k5++)
  11821. if (variousSettings[k5] != anIntArray1045[k5]) {
  11822. variousSettings[k5] = anIntArray1045[k5];
  11823. method33(k5);
  11824. needDrawTabArea = true;
  11825. }
  11826. pktType = -1;
  11827. return true;
  11828.  
  11829. case 196:
  11830. long l5 = inStream.readQWord();
  11831. int j18 = inStream.readDWord();
  11832. int l21 = inStream.readUnsignedByte();
  11833. boolean flag5 = false;
  11834. if (l21 <= 1) {
  11835. for (int l29 = 0; l29 < ignoreCount; l29++) {
  11836. if (ignoreListAsLongs[l29] != l5)
  11837. continue;
  11838. flag5 = true;
  11839.  
  11840. }
  11841. }
  11842. if (!flag5 && anInt1251 == 0)
  11843. try {
  11844. String s9 = TextInput.method525(pktSize - 13, inStream);
  11845. switch (l21) {
  11846. case 1:
  11847. pushMessage(
  11848. s9,
  11849. 7,
  11850. "@cr1@"
  11851. + TextClass.fixName(TextClass
  11852. .nameForLong(l5)));
  11853. break;
  11854. case 2:
  11855. pushMessage(
  11856. s9,
  11857. 7,
  11858. "@cr2@"
  11859. + TextClass.fixName(TextClass
  11860. .nameForLong(l5)));
  11861. break;
  11862. case 3:
  11863. pushMessage(
  11864. s9,
  11865. 7,
  11866. "@cr3@"
  11867. + TextClass.fixName(TextClass
  11868. .nameForLong(l5)));
  11869. break;
  11870. case 4:
  11871. pushMessage(
  11872. s9,
  11873. 7,
  11874. "@cr4@"
  11875. + TextClass.fixName(TextClass
  11876. .nameForLong(l5)));
  11877. break;
  11878. case 5:
  11879. pushMessage(
  11880. s9,
  11881. 7,
  11882. "@cr5@"
  11883. + TextClass.fixName(TextClass
  11884. .nameForLong(l5)));
  11885. break;
  11886. case 6:
  11887. pushMessage(
  11888. s9,
  11889. 7,
  11890. "@cr6@"
  11891. + TextClass.fixName(TextClass
  11892. .nameForLong(l5)));
  11893. break;
  11894. default:
  11895. pushMessage(s9, 3, TextClass.fixName(TextClass
  11896. .nameForLong(l5)));
  11897. }
  11898. } catch (Exception exception1) {
  11899. signlink.reporterror("cde1");
  11900. }
  11901. pktType = -1;
  11902. return true;
  11903.  
  11904. case 85:
  11905. anInt1269 = inStream.method427();
  11906. anInt1268 = inStream.method427();
  11907. pktType = -1;
  11908. return true;
  11909.  
  11910. case 24:
  11911. anInt1054 = inStream.method428();
  11912. if (anInt1054 == tabID) {
  11913. if (anInt1054 == 3)
  11914. tabID = 1;
  11915. else
  11916. tabID = 3;
  11917. needDrawTabArea = true;
  11918. }
  11919. pktType = -1;
  11920. return true;
  11921.  
  11922. case 246:
  11923. int i6 = inStream.method434();
  11924. int i13 = inStream.readUnsignedWord();
  11925. int k18 = inStream.readUnsignedWord();
  11926. if (k18 == 65535) {
  11927. RSInterface.interfaceCache[i6].anInt233 = 0;
  11928. pktType = -1;
  11929. return true;
  11930. } else {
  11931. ItemDef itemDef = ItemDef.forID(k18);
  11932. RSInterface.interfaceCache[i6].anInt233 = 4;
  11933. RSInterface.interfaceCache[i6].mediaID = k18;
  11934. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  11935. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  11936. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100)
  11937. / i13;
  11938. pktType = -1;
  11939. return true;
  11940. }
  11941.  
  11942. case 171:
  11943. boolean flag1 = inStream.readUnsignedByte() == 1;
  11944. int j13 = inStream.readUnsignedWord();
  11945. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11946. pktType = -1;
  11947. return true;
  11948.  
  11949. case 142:
  11950. int j6 = inStream.method434();
  11951. method60(j6);
  11952. if (backDialogID != -1) {
  11953. backDialogID = -1;
  11954. inputTaken = true;
  11955. }
  11956. if (inputDialogState != 0) {
  11957. inputDialogState = 0;
  11958. inputTaken = true;
  11959. }
  11960. invOverlayInterfaceID = j6;
  11961. needDrawTabArea = true;
  11962. tabAreaAltered = true;
  11963. openInterfaceID = -1;
  11964. aBoolean1149 = false;
  11965. pktType = -1;
  11966. return true;
  11967.  
  11968. case 126:
  11969. try {
  11970. String text = inStream.readString();
  11971. int frame = inStream.method435();
  11972. if (text.startsWith("www.")) {
  11973. launchURL(text);
  11974. pktType = -1;
  11975. return true;
  11976. }
  11977. RSInterface.interfaceCache[frame].message = text;
  11978. if(RSInterface.interfaceCache[frame].parentID == tabInterfaceIDs[tabID] ||frame >= 7562 && frame <= 7586)
  11979. needDrawTabArea = true;
  11980. pktType = -1;
  11981. } catch (Exception e) {
  11982. }
  11983. pktType = -1;
  11984. return true;
  11985.  
  11986. case 206:
  11987. publicChatMode = inStream.readUnsignedByte();
  11988. privateChatMode = inStream.readUnsignedByte();
  11989. tradeMode = inStream.readUnsignedByte();
  11990. aBoolean1233 = true;
  11991. inputTaken = true;
  11992. pktType = -1;
  11993. return true;
  11994.  
  11995. case 240:
  11996. if (tabID == 12)
  11997. needDrawTabArea = true;
  11998. weight = inStream.readSignedWord();
  11999. pktType = -1;
  12000. return true;
  12001.  
  12002. case 8:
  12003. int k6 = inStream.method436();
  12004. int l13 = inStream.readUnsignedWord();
  12005. RSInterface.interfaceCache[k6].anInt233 = 1;
  12006. RSInterface.interfaceCache[k6].mediaID = l13;
  12007. pktType = -1;
  12008. return true;
  12009.  
  12010. case 122:
  12011. int l6 = inStream.method436();
  12012. int i14 = inStream.method436();
  12013. int i19 = i14 >> 10 & 0x1f;
  12014. int i22 = i14 >> 5 & 0x1f;
  12015. int l24 = i14 & 0x1f;
  12016. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  12017. + (i22 << 11) + (l24 << 3);
  12018. pktType = -1;
  12019. return true;
  12020.  
  12021. case 53:
  12022. needDrawTabArea = true;
  12023. int i7 = inStream.readUnsignedWord();
  12024. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12025. int j19 = inStream.readUnsignedWord();
  12026. for (int j22 = 0; j22 < j19; j22++) {
  12027. int i25 = inStream.readUnsignedByte();
  12028. if (i25 == 255)
  12029. i25 = inStream.method440();
  12030. class9_1.inv[j22] = inStream.method436();
  12031. class9_1.invStackSizes[j22] = i25;
  12032. }
  12033. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12034. class9_1.inv[j25] = 0;
  12035. class9_1.invStackSizes[j25] = 0;
  12036. }
  12037. pktType = -1;
  12038. return true;
  12039.  
  12040. case 230:
  12041. int j7 = inStream.method435();
  12042. int j14 = inStream.readUnsignedWord();
  12043. int k19 = inStream.readUnsignedWord();
  12044. int k22 = inStream.method436();
  12045. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12046. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12047. RSInterface.interfaceCache[j14].modelZoom = j7;
  12048. pktType = -1;
  12049. return true;
  12050.  
  12051. case 221:
  12052. anInt900 = inStream.readUnsignedByte();
  12053. needDrawTabArea = true;
  12054. pktType = -1;
  12055. return true;
  12056.  
  12057. case 177:
  12058. aBoolean1160 = true;
  12059. anInt995 = inStream.readUnsignedByte();
  12060. anInt996 = inStream.readUnsignedByte();
  12061. anInt997 = inStream.readUnsignedWord();
  12062. anInt998 = inStream.readUnsignedByte();
  12063. anInt999 = inStream.readUnsignedByte();
  12064. if (anInt999 >= 100) {
  12065. int k7 = anInt995 * 128 + 64;
  12066. int k14 = anInt996 * 128 + 64;
  12067. int i20 = method42(plane, k14, k7) - anInt997;
  12068. int l22 = k7 - xCameraPos;
  12069. int k25 = i20 - zCameraPos;
  12070. int j28 = k14 - yCameraPos;
  12071. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  12072. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12073. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12074. if (yCameraCurve < 128)
  12075. yCameraCurve = 128;
  12076. if (yCameraCurve > 383)
  12077. yCameraCurve = 383;
  12078. }
  12079. pktType = -1;
  12080. return true;
  12081.  
  12082. case 249:
  12083. anInt1046 = inStream.method426();
  12084. unknownInt10 = inStream.method436();
  12085. pktType = -1;
  12086. return true;
  12087.  
  12088. case 65:
  12089. updateNPCs(inStream, pktSize);
  12090. pktType = -1;
  12091. return true;
  12092.  
  12093. case 27:
  12094. messagePromptRaised = false;
  12095. inputDialogState = 1;
  12096. amountOrNameInput = "";
  12097. inputTaken = true;
  12098. pktType = -1;
  12099. return true;
  12100.  
  12101. case 187:
  12102. messagePromptRaised = false;
  12103. inputDialogState = 2;
  12104. amountOrNameInput = "";
  12105. inputTaken = true;
  12106. pktType = -1;
  12107. return true;
  12108.  
  12109. case 97:
  12110. int l7 = inStream.readUnsignedWord();
  12111. method60(l7);
  12112. if (invOverlayInterfaceID != -1) {
  12113. invOverlayInterfaceID = -1;
  12114. needDrawTabArea = true;
  12115. tabAreaAltered = true;
  12116. }
  12117. if (backDialogID != -1) {
  12118. backDialogID = -1;
  12119. inputTaken = true;
  12120. }
  12121. if (inputDialogState != 0) {
  12122. inputDialogState = 0;
  12123. inputTaken = true;
  12124. }
  12125. // 17511 = Question Type
  12126. // 15819 = Christmas Type
  12127. // 15812 = Security Type
  12128. // 15801 = Item Scam Type
  12129. // 15791 = Password Safety ?
  12130. // 15774 = Good/Bad Password
  12131. // 15767 = Drama Type ????
  12132. if (l7 == 15244) {
  12133. openInterfaceID = 15767;
  12134. fullscreenInterfaceID = 15244;
  12135. } else {
  12136. openInterfaceID = l7;
  12137. }
  12138. aBoolean1149 = false;
  12139. pktType = -1;
  12140. return true;
  12141.  
  12142. case 218:
  12143. int i8 = inStream.method438();
  12144. dialogID = i8;
  12145. inputTaken = true;
  12146. pktType = -1;
  12147. return true;
  12148.  
  12149. case 87:
  12150. int j8 = inStream.method434();
  12151. int l14 = inStream.method439();
  12152. anIntArray1045[j8] = l14;
  12153. if (variousSettings[j8] != l14) {
  12154. variousSettings[j8] = l14;
  12155. method33(j8);
  12156. needDrawTabArea = true;
  12157. if (dialogID != -1)
  12158. inputTaken = true;
  12159. }
  12160. pktType = -1;
  12161. return true;
  12162.  
  12163. case 36:
  12164. int k8 = inStream.method434();
  12165. byte byte0 = inStream.readSignedByte();
  12166. anIntArray1045[k8] = byte0;
  12167. if (variousSettings[k8] != byte0) {
  12168. variousSettings[k8] = byte0;
  12169. method33(k8);
  12170. needDrawTabArea = true;
  12171. if (dialogID != -1)
  12172. inputTaken = true;
  12173. }
  12174. pktType = -1;
  12175. return true;
  12176.  
  12177. case 61:
  12178. anInt1055 = inStream.readUnsignedByte();
  12179. pktType = -1;
  12180. return true;
  12181.  
  12182. case 200:
  12183. int l8 = inStream.readUnsignedWord();
  12184. int i15 = inStream.readSignedWord();
  12185. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12186. class9_4.anInt257 = i15;
  12187. if (i15 == 591 || i15 == 588) {
  12188. class9_4.modelZoom = 900; // anInt269
  12189. }
  12190. if (i15 == -1) {
  12191. class9_4.anInt246 = 0;
  12192. class9_4.anInt208 = 0;
  12193. }
  12194. pktType = -1;
  12195. return true;
  12196.  
  12197. case 219:
  12198. if (invOverlayInterfaceID != -1) {
  12199. invOverlayInterfaceID = -1;
  12200. needDrawTabArea = true;
  12201. tabAreaAltered = true;
  12202. }
  12203. if (backDialogID != -1) {
  12204. backDialogID = -1;
  12205. inputTaken = true;
  12206. }
  12207. if (inputDialogState != 0) {
  12208. inputDialogState = 0;
  12209. inputTaken = true;
  12210. }
  12211. openInterfaceID = -1;
  12212. aBoolean1149 = false;
  12213. pktType = -1;
  12214. return true;
  12215.  
  12216. case 34:
  12217. needDrawTabArea = true;
  12218. int i9 = inStream.readUnsignedWord();
  12219. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12220. while (inStream.currentOffset < pktSize) {
  12221. int j20 = inStream.method422();
  12222. int i23 = inStream.readUnsignedWord();
  12223. int l25 = inStream.readUnsignedByte();
  12224. if (l25 == 255)
  12225. l25 = inStream.readDWord();
  12226. if (j20 >= 0 && j20 < class9_2.inv.length) {
  12227. class9_2.inv[j20] = i23;
  12228. class9_2.invStackSizes[j20] = l25;
  12229. }
  12230. }
  12231. pktType = -1;
  12232. return true;
  12233.  
  12234. case 4:
  12235. case 44:
  12236. case 84:
  12237. case 101:
  12238. case 105:
  12239. case 117:
  12240. case 147:
  12241. case 151:
  12242. case 156:
  12243. case 160:
  12244. case 215:
  12245. method137(inStream, pktType);
  12246. pktType = -1;
  12247. return true;
  12248.  
  12249. case 106:
  12250. tabID = inStream.method427();
  12251. needDrawTabArea = true;
  12252. tabAreaAltered = true;
  12253. pktType = -1;
  12254. return true;
  12255.  
  12256. case 164:
  12257. int j9 = inStream.method434();
  12258. method60(j9);
  12259. if (invOverlayInterfaceID != -1) {
  12260. invOverlayInterfaceID = -1;
  12261. needDrawTabArea = true;
  12262. tabAreaAltered = true;
  12263. }
  12264. backDialogID = j9;
  12265. inputTaken = true;
  12266. openInterfaceID = -1;
  12267. aBoolean1149 = false;
  12268. pktType = -1;
  12269. return true;
  12270.  
  12271. }
  12272. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  12273. + anInt842 + "," + anInt843);
  12274. resetLogout();
  12275. } catch (IOException _ex) {
  12276. dropClient();
  12277. } catch (Exception exception) {
  12278. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  12279. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  12280. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12281. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12282. s2 = s2 + inStream.buffer[j15] + ",";
  12283. signlink.reporterror(s2);
  12284. resetLogout();
  12285. }
  12286. return true;
  12287. }
  12288. public static int clientZoom = 600;
  12289.  
  12290. public void method146() {
  12291. anInt1265++;
  12292. method47(true);
  12293. method26(true);
  12294. method47(false);
  12295. method26(false);
  12296. method55();
  12297. method104();
  12298. if (!aBoolean1160) {
  12299. int i = anInt1184;
  12300. if (anInt984 / 256 > i)
  12301. i = anInt984 / 256;
  12302. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12303. i = anIntArray1203[4] + 128;
  12304. int k = viewRotation + viewRotationOffset & 0x7ff;
  12305. setCameraPos(clientZoom + i * 3, i, anInt1014,
  12306. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12307. }
  12308. int j;
  12309. if (!aBoolean1160)
  12310. j = method120();
  12311. else
  12312. j = method121();
  12313. int l = xCameraPos;
  12314. int i1 = zCameraPos;
  12315. int j1 = yCameraPos;
  12316. int k1 = yCameraCurve;
  12317. int l1 = xCameraCurve;
  12318. for (int i2 = 0; i2 < 5; i2++)
  12319. if (aBooleanArray876[i2]) {
  12320. int j2 = (int) ((Math.random()
  12321. * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  12322. .sin((double) anIntArray1030[i2]
  12323. * ((double) anIntArray928[i2] / 100D))
  12324. * (double) anIntArray1203[i2]);
  12325. if (i2 == 0)
  12326. xCameraPos += j2;
  12327. if (i2 == 1)
  12328. zCameraPos += j2;
  12329. if (i2 == 2)
  12330. yCameraPos += j2;
  12331. if (i2 == 3)
  12332. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12333. if (i2 == 4) {
  12334. yCameraCurve += j2;
  12335. if (yCameraCurve < 128)
  12336. yCameraCurve = 128;
  12337. if (yCameraCurve > 383)
  12338. yCameraCurve = 383;
  12339. }
  12340. }
  12341. int k2 = Texture.anInt1481;
  12342. Model.aBoolean1684 = true;
  12343. Model.anInt1687 = 0;
  12344. Model.anInt1685 = super.mouseX - 4;
  12345. Model.anInt1686 = super.mouseY - 4;
  12346. DrawingArea.setAllPixelsToZero();
  12347. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  12348. zCameraPos, j, yCameraCurve);
  12349. worldController.clearObj5Cache();
  12350. updateEntities();
  12351. drawHeadIcon();
  12352. method37(k2);
  12353. draw3dScreen();
  12354. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12355. xCameraPos = l;
  12356. zCameraPos = i1;
  12357. yCameraPos = j1;
  12358. yCameraCurve = k1;
  12359. xCameraCurve = l1;
  12360. }
  12361.  
  12362. public void clearTopInterfaces() {
  12363. stream.createFrame(130);
  12364. if (invOverlayInterfaceID != -1) {
  12365. invOverlayInterfaceID = -1;
  12366. needDrawTabArea = true;
  12367. aBoolean1149 = false;
  12368. tabAreaAltered = true;
  12369. }
  12370. if (backDialogID != -1) {
  12371. backDialogID = -1;
  12372. inputTaken = true;
  12373. aBoolean1149 = false;
  12374. }
  12375. openInterfaceID = -1;
  12376. fullscreenInterfaceID = -1;
  12377. }
  12378.  
  12379. public client() {
  12380. chatRights = new int[500];
  12381. fullscreenInterfaceID = -1;
  12382. chatTypeView = 0;
  12383. clanChatMode = 0;
  12384. cButtonHPos = -1;
  12385. cButtonHCPos = -1;
  12386. cButtonCPos = 0;
  12387. server = "0.0.0.0";
  12388. //server = "24.29.236.119";
  12389. anIntArrayArray825 = new int[104][104];
  12390. friendsNodeIDs = new int[200];
  12391. groundArray = new NodeList[4][104][104];
  12392. aBoolean831 = false;
  12393. aStream_834 = new Stream(new byte[5000]);
  12394. npcArray = new NPC[16384];
  12395. npcIndices = new int[16384];
  12396. anIntArray840 = new int[1000];
  12397. aStream_847 = Stream.create();
  12398. aBoolean848 = true;
  12399. openInterfaceID = -1;
  12400. currentExp = new int[Skills.skillsCount];
  12401. aBoolean872 = false;
  12402. anIntArray873 = new int[5];
  12403. anInt874 = -1;
  12404. aBooleanArray876 = new boolean[5];
  12405. drawFlames = false;
  12406. reportAbuseInput = "";
  12407. unknownInt10 = -1;
  12408. menuOpen = false;
  12409. inputString = "";
  12410. maxPlayers = 2048;
  12411. myPlayerIndex = 2047;
  12412. playerArray = new Player[maxPlayers];
  12413. playerIndices = new int[maxPlayers];
  12414. anIntArray894 = new int[maxPlayers];
  12415. aStreamArray895s = new Stream[maxPlayers];
  12416. anInt897 = 1;
  12417. anIntArrayArray901 = new int[104][104];
  12418. anInt902 = 0x766654;
  12419. aByteArray912 = new byte[16384];
  12420. currentStats = new int[Skills.skillsCount];
  12421. ignoreListAsLongs = new long[100];
  12422. loadingError = false;
  12423. anInt927 = 0x332d25;
  12424. anIntArray928 = new int[5];
  12425. anIntArrayArray929 = new int[104][104];
  12426. chatTypes = new int[500];
  12427. chatNames = new String[500];
  12428. chatMessages = new String[500];
  12429. chatButtons = new Sprite[4];
  12430. sideIcons = new Sprite[15];
  12431. redStones = new Sprite[5];
  12432. mapBack = new Background[2];
  12433. aBoolean954 = true;
  12434. friendsListAsLongs = new long[200];
  12435. currentSong = -1;
  12436. drawingFlames = false;
  12437. spriteDrawX = -1;
  12438. spriteDrawY = -1;
  12439. anIntArray968 = new int[33];
  12440. anIntArray969 = new int[256];
  12441. decompressors = new Decompressor[5];
  12442. variousSettings = new int[2000];
  12443. aBoolean972 = false;
  12444. anInt975 = 50;
  12445. anIntArray976 = new int[anInt975];
  12446. anIntArray977 = new int[anInt975];
  12447. anIntArray978 = new int[anInt975];
  12448. anIntArray979 = new int[anInt975];
  12449. anIntArray980 = new int[anInt975];
  12450. anIntArray981 = new int[anInt975];
  12451. anIntArray982 = new int[anInt975];
  12452. aStringArray983 = new String[anInt975];
  12453. anInt985 = -1;
  12454. hitMarks = new Sprite[20];
  12455. anIntArray990 = new int[5];
  12456. aBoolean994 = false;
  12457. anInt1002 = 0x23201b;
  12458. amountOrNameInput = "";
  12459. aClass19_1013 = new NodeList();
  12460. aBoolean1017 = false;
  12461. anInt1018 = -1;
  12462. anIntArray1030 = new int[5];
  12463. aBoolean1031 = false;
  12464. mapFunctions = new Sprite[100];
  12465. dialogID = -1;
  12466. maxStats = new int[Skills.skillsCount];
  12467. anIntArray1045 = new int[2000];
  12468. aBoolean1047 = true;
  12469. anIntArray1052 = new int[151];
  12470. anInt1054 = -1;
  12471. aClass19_1056 = new NodeList();
  12472. anIntArray1057 = new int[33];
  12473. aClass9_1059 = new RSInterface();
  12474. mapScenes = new Background[100];
  12475. barFillColor = 0x4d4233;
  12476. anIntArray1065 = new int[7];
  12477. anIntArray1072 = new int[1000];
  12478. anIntArray1073 = new int[1000];
  12479. aBoolean1080 = false;
  12480. friendsList = new String[200];
  12481. inStream = Stream.create();
  12482. expectedCRCs = new int[9];
  12483. menuActionCmd2 = new int[500];
  12484. menuActionCmd3 = new int[500];
  12485. menuActionID = new int[500];
  12486. menuActionCmd1 = new int[500];
  12487. headIcons = new Sprite[20];
  12488. skullIcons = new Sprite[20];
  12489. headIconsHint = new Sprite[20];
  12490. tabAreaAltered = false;
  12491. aString1121 = "";
  12492. atPlayerActions = new String[5];
  12493. atPlayerArray = new boolean[5];
  12494. anIntArrayArrayArray1129 = new int[4][13][13];
  12495. anInt1132 = 2;
  12496. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12497. aBoolean1141 = false;
  12498. aBoolean1149 = false;
  12499. crosses = new Sprite[8];
  12500. musicEnabled = true;
  12501. needDrawTabArea = false;
  12502. loggedIn = false;
  12503. canMute = false;
  12504. aBoolean1159 = false;
  12505. aBoolean1160 = false;
  12506. anInt1171 = 1;
  12507. myUsername = "";
  12508. myPassword = "";
  12509. genericLoadingError = false;
  12510. reportAbuseInterfaceID = -1;
  12511. aClass19_1179 = new NodeList();
  12512. anInt1184 = 128;
  12513. invOverlayInterfaceID = -1;
  12514. stream = Stream.create();
  12515. menuActionName = new String[500];
  12516. anIntArray1203 = new int[5];
  12517. anIntArray1207 = new int[50];
  12518. anInt1210 = 2;
  12519. anInt1211 = 78;
  12520. promptInput = "";
  12521. modIcons = new Sprite[6];
  12522. tabID = 3;
  12523. inputTaken = false;
  12524. songChanging = true;
  12525. anIntArray1229 = new int[151];
  12526. aClass11Array1230 = new Class11[4];
  12527. aBoolean1233 = false;
  12528. anIntArray1240 = new int[100];
  12529. anIntArray1241 = new int[50];
  12530. aBoolean1242 = false;
  12531. anIntArray1250 = new int[50];
  12532. rsAlreadyLoaded = false;
  12533. welcomeScreenRaised = false;
  12534. messagePromptRaised = false;
  12535. loginMessage1 = "";
  12536. loginMessage2 = "";
  12537. backDialogID = -1;
  12538. anInt1279 = 2;
  12539. bigX = new int[4000];
  12540. bigY = new int[4000];
  12541. anInt1289 = -1;
  12542. }
  12543.  
  12544. private String clanUsername;
  12545. private String clanMessage;
  12546. private final int[] chatRights;
  12547. private int hoverId;
  12548.  
  12549. public int rights;
  12550. public String name;
  12551. public String message;
  12552. public String clanname;
  12553. public int chatTypeView;
  12554. public int clanChatMode;
  12555. public int duelMode;
  12556.  
  12557. /* Declare custom sprites */
  12558. private static Sprite mapIcon;
  12559. private Sprite chatArea;
  12560. private Sprite[] chatButtons;
  12561. private final Background[] mapBack;
  12562. private Sprite tabArea;
  12563. /**/
  12564.  
  12565. private RSImageProducer leftFrame;
  12566. private RSImageProducer topFrame;
  12567. private RSImageProducer rightFrame;
  12568. private int ignoreCount;
  12569. private long aLong824;
  12570. private int[][] anIntArrayArray825;
  12571. private int[] friendsNodeIDs;
  12572. private NodeList[][][] groundArray;
  12573. private int[] anIntArray828;
  12574. private int[] anIntArray829;
  12575. private volatile boolean aBoolean831;
  12576. private Socket aSocket832;
  12577. private int loginScreenState;
  12578. private Stream aStream_834;
  12579. private NPC[] npcArray;
  12580. private int npcCount;
  12581. private int[] npcIndices;
  12582. private int anInt839;
  12583. private int[] anIntArray840;
  12584. private int anInt841;
  12585. private int anInt842;
  12586. private int anInt843;
  12587. private String aString844;
  12588. private int privateChatMode;
  12589. private Stream aStream_847;
  12590. private boolean aBoolean848;
  12591. private static int anInt849;
  12592. private int[] anIntArray850;
  12593. private int[] anIntArray851;
  12594. private int[] anIntArray852;
  12595. private int[] anIntArray853;
  12596. private static int anInt854;
  12597. private int anInt855;
  12598. public static int openInterfaceID;
  12599. private int xCameraPos;
  12600. private int zCameraPos;
  12601. private int yCameraPos;
  12602. private int yCameraCurve;
  12603. private int xCameraCurve;
  12604. private int myPrivilege;
  12605. private final int[] currentExp;
  12606. private Sprite[] redStones;
  12607. private Sprite mapFlag;
  12608. private Sprite mapMarker;
  12609. private boolean aBoolean872;
  12610. private final int[] anIntArray873;
  12611. private int anInt874;
  12612. private final boolean[] aBooleanArray876;
  12613. private int weight;
  12614. private MouseDetection mouseDetection;
  12615. private volatile boolean drawFlames;
  12616. private String reportAbuseInput;
  12617. private int unknownInt10;
  12618. private boolean menuOpen;
  12619. private int anInt886;
  12620. private String inputString;
  12621. private final int maxPlayers;
  12622. private final int myPlayerIndex;
  12623. private Player[] playerArray;
  12624. private int playerCount;
  12625. private int[] playerIndices;
  12626. private int anInt893;
  12627. private int[] anIntArray894;
  12628. private Stream[] aStreamArray895s;
  12629. private int viewRotationOffset;
  12630. private int anInt897;
  12631. private int friendsCount;
  12632. private int anInt900;
  12633. private int[][] anIntArrayArray901;
  12634. private final int anInt902;
  12635. private byte[] aByteArray912;
  12636. private int anInt913;
  12637. private int crossX;
  12638. private int crossY;
  12639. private int crossIndex;
  12640. private int crossType;
  12641. private int plane;
  12642. private final int[] currentStats;
  12643. private static int anInt924;
  12644. private final long[] ignoreListAsLongs;
  12645. private boolean loadingError;
  12646. private final int anInt927;
  12647. private final int[] anIntArray928;
  12648. private int[][] anIntArrayArray929;
  12649. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12650. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12651. private int anInt933;
  12652. private int anInt934;
  12653. private int anInt935;
  12654. private int anInt936;
  12655. private int anInt937;
  12656. private int anInt938;
  12657. private static int anInt940;
  12658. private final int[] chatTypes;
  12659. private final String[] chatNames;
  12660. private final String[] chatMessages;
  12661. private int anInt945;
  12662. private WorldController worldController;
  12663. private Sprite[] sideIcons;
  12664. private int menuScreenArea;
  12665. private int menuOffsetX;
  12666. private int menuOffsetY;
  12667. private int menuWidth;
  12668. private int menuHeight;
  12669. private long aLong953;
  12670. private boolean aBoolean954;
  12671. private String[] clanList = new String[100];
  12672. private long[] friendsListAsLongs;
  12673. private int currentSong;
  12674. private static int nodeID = 10;
  12675. static int portOff;
  12676. static boolean clientData;
  12677. private static boolean isMembers = true;
  12678. private static boolean lowMem;
  12679. private volatile boolean drawingFlames;
  12680. private int spriteDrawX;
  12681. private int spriteDrawY;
  12682. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  12683. 0xff00ff, 0xffffff };
  12684. private Background aBackground_966;
  12685. private Background aBackground_967;
  12686. private final int[] anIntArray968;
  12687. private final int[] anIntArray969;
  12688. final Decompressor[] decompressors;
  12689. public int variousSettings[];
  12690. private boolean aBoolean972;
  12691. private final int anInt975;
  12692. private final int[] anIntArray976;
  12693. private final int[] anIntArray977;
  12694. private final int[] anIntArray978;
  12695. private final int[] anIntArray979;
  12696. private final int[] anIntArray980;
  12697. private final int[] anIntArray981;
  12698. private final int[] anIntArray982;
  12699. private final String[] aStringArray983;
  12700. private int anInt984;
  12701. private int anInt985;
  12702. private static int anInt986;
  12703. private Sprite[] hitMarks;
  12704. private int anInt988;
  12705. private int anInt989;
  12706. private final int[] anIntArray990;
  12707. private static boolean aBoolean993;
  12708. private final boolean aBoolean994;
  12709. private int anInt995;
  12710. private int anInt996;
  12711. private int anInt997;
  12712. private int anInt998;
  12713. private int anInt999;
  12714. private ISAACRandomGen encryption;
  12715. private Sprite mapEdge;
  12716. private final int anInt1002;
  12717. static final int[][] anIntArrayArray1003 = {
  12718. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  12719. 54193 },
  12720. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12721. 56621, 4783, 1341, 16578, 35003, 25239 },
  12722. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12723. 10153, 56621, 4783, 1341, 16578, 35003 },
  12724. { 4626, 11146, 6439, 12, 4758, 10270 },
  12725. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  12726.  
  12727. private Sprite multiOverlay;
  12728. private String amountOrNameInput;
  12729. private static int anInt1005;
  12730. private int daysSinceLastLogin;
  12731. private int pktSize;
  12732. private int pktType;
  12733. private int anInt1009;
  12734. private int anInt1010;
  12735. private int anInt1011;
  12736. private NodeList aClass19_1013;
  12737. private int anInt1014;
  12738. private int anInt1015;
  12739. private int anInt1016;
  12740. private boolean aBoolean1017;
  12741. public static int anInt1018;
  12742. private static final int[] anIntArray1019;
  12743. private int anInt1021;
  12744. private int anInt1022;
  12745. private int loadingStage;
  12746. private Sprite scrollBar1;
  12747. private Sprite scrollBar2;
  12748. private int anInt1026;
  12749. private Background backBase1;
  12750. private Background backBase2;
  12751. private Background backHmid1;
  12752. private final int[] anIntArray1030;
  12753. private boolean aBoolean1031;
  12754. private static Sprite[] mapFunctions;
  12755. private static int baseX;
  12756. private static int baseY;
  12757. private int anInt1036;
  12758. private int anInt1037;
  12759. private int loginFailures;
  12760. private int anInt1039;
  12761. private int anInt1040;
  12762. private int anInt1041;
  12763. private int dialogID;
  12764. private final int[] maxStats;
  12765. private final int[] anIntArray1045;
  12766. private int anInt1046;
  12767. private boolean aBoolean1047;
  12768. public TextDrawingArea smallText;
  12769. public TextDrawingArea aTextDrawingArea_1271;
  12770. public TextDrawingArea chatTextDrawingArea;
  12771. public TextDrawingArea aTextDrawingArea_1273;
  12772. public RSFont newSmallFont;
  12773. public RSFont newRegularFont;
  12774. public RSFont newBoldFont;
  12775. public RSFont newFancyFont;
  12776. private int anInt1048;
  12777. private String aString1049;
  12778. private static int anInt1051;
  12779. private final int[] anIntArray1052;
  12780. private StreamLoader titleStreamLoader;
  12781. private int anInt1054;
  12782. private int anInt1055;
  12783. private NodeList aClass19_1056;
  12784. private final int[] anIntArray1057;
  12785. public final RSInterface aClass9_1059;
  12786. private Background[] mapScenes;
  12787. private static int anInt1061;
  12788. private int anInt1062;
  12789. private final int barFillColor;
  12790. private int friendsListAction;
  12791. private final int[] anIntArray1065;
  12792. private int mouseInvInterfaceIndex;
  12793. private int lastActiveInvInterface;
  12794. public OnDemandFetcher onDemandFetcher;
  12795. private int anInt1069;
  12796. private int anInt1070;
  12797. private int anInt1071;
  12798. private int[] anIntArray1072;
  12799. private int[] anIntArray1073;
  12800. private Sprite mapDotItem;
  12801. private Sprite mapDotNPC;
  12802. private Sprite mapDotPlayer;
  12803. private Sprite mapDotFriend;
  12804. private Sprite mapDotTeam;
  12805. private Sprite mapDotClan;
  12806. private int anInt1079;
  12807. private boolean aBoolean1080;
  12808. private String[] friendsList;
  12809. private Stream inStream;
  12810. private int anInt1084;
  12811. private int anInt1085;
  12812. private int activeInterfaceType;
  12813. private int anInt1087;
  12814. private int anInt1088;
  12815. public static int anInt1089;
  12816. private final int[] expectedCRCs;
  12817. private int[] menuActionCmd2;
  12818. private int[] menuActionCmd3;
  12819. private int[] menuActionID;
  12820. private int[] menuActionCmd1;
  12821. private Sprite[] headIcons;
  12822. private Sprite[] skullIcons;
  12823. private Sprite[] headIconsHint;
  12824. private static int anInt1097;
  12825. private int anInt1098;
  12826. private int anInt1099;
  12827. private int anInt1100;
  12828. private int anInt1101;
  12829. private int anInt1102;
  12830. public static boolean tabAreaAltered;
  12831. private int anInt1104;
  12832. private RSImageProducer aRSImageProducer_1107;
  12833. private RSImageProducer aRSImageProducer_1108;
  12834. private RSImageProducer aRSImageProducer_1109;
  12835. private RSImageProducer aRSImageProducer_1110;
  12836. private RSImageProducer aRSImageProducer_1111;
  12837. private RSImageProducer aRSImageProducer_1112;
  12838. private RSImageProducer aRSImageProducer_1113;
  12839. private RSImageProducer aRSImageProducer_1114;
  12840. private RSImageProducer aRSImageProducer_1115;
  12841. private static int anInt1117;
  12842. private int membersInt;
  12843. private String aString1121;
  12844. private Sprite compass;
  12845. private RSImageProducer aRSImageProducer_1123;
  12846. private RSImageProducer aRSImageProducer_1124;
  12847. private RSImageProducer aRSImageProducer_1125;
  12848. public static Player myPlayer;
  12849. private final String[] atPlayerActions;
  12850. private final boolean[] atPlayerArray;
  12851. private final int[][][] anIntArrayArrayArray1129;
  12852. public static final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1,
  12853. -1, -1, -1, -1, -1, -1, -1, -1 };
  12854. private int cameraOffsetY;
  12855. private int anInt1132;
  12856. private int menuActionRow;
  12857. private static int anInt1134;
  12858. private int spellSelected;
  12859. private int anInt1137;
  12860. private int spellUsableOn;
  12861. private String spellTooltip;
  12862. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12863. private boolean aBoolean1141;
  12864. private static int anInt1142;
  12865. private int energy;
  12866. private boolean aBoolean1149;
  12867. private Sprite[] crosses;
  12868. private boolean musicEnabled;
  12869. private Background[] aBackgroundArray1152s;
  12870. public static boolean needDrawTabArea;
  12871. private int unreadMessages;
  12872. private static int anInt1155;
  12873. private static boolean fpsOn;
  12874. public boolean loggedIn;
  12875. private boolean canMute;
  12876. private boolean aBoolean1159;
  12877. private boolean aBoolean1160;
  12878. static int loopCycle;
  12879. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12880. private RSImageProducer aRSImageProducer_1163;
  12881. private RSImageProducer mapEdgeIP;
  12882. private RSImageProducer aRSImageProducer_1164;
  12883. private RSImageProducer aRSImageProducer_1165;
  12884. private RSImageProducer aRSImageProducer_1166;
  12885. private int daysSinceRecovChange;
  12886. private RSSocket socketStream;
  12887. private int anInt1169;
  12888. private static int minimapZoom;
  12889. private int anInt1171;
  12890. private long aLong1172;
  12891. private String myUsername;
  12892. private String myPassword;
  12893. private static int anInt1175;
  12894. private boolean genericLoadingError;
  12895. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  12896. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  12897. private int reportAbuseInterfaceID;
  12898. private NodeList aClass19_1179;
  12899. private int[] anIntArray1180;
  12900. private int[] anIntArray1181;
  12901. private int[] anIntArray1182;
  12902. private byte[][] aByteArrayArray1183;
  12903. private int anInt1184;
  12904. private static int viewRotation;
  12905. private int anInt1186;
  12906. private int anInt1187;
  12907. private static int anInt1188;
  12908. private int invOverlayInterfaceID;
  12909. private int[] anIntArray1190;
  12910. private int[] anIntArray1191;
  12911. private Stream stream;
  12912. private int anInt1193;
  12913. private int splitPrivateChat;
  12914.  
  12915. private String[] menuActionName;
  12916. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12917. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12918. private final int[] anIntArray1203;
  12919. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  12920. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  12921. private static boolean flagged;
  12922. private final int[] anIntArray1207;
  12923. private int anInt1208;
  12924. private static int minimapRotation;
  12925. private int anInt1210;
  12926. public static int anInt1211;
  12927. private String promptInput;
  12928. private int anInt1213;
  12929. private int[][][] intGroundArray;
  12930. private long aLong1215;
  12931. private int loginScreenCursorPos;
  12932. private final Sprite[] modIcons;
  12933. private long aLong1220;
  12934. public static int tabID;
  12935. private int anInt1222;
  12936. public static boolean inputTaken;
  12937. private int inputDialogState;
  12938. private static int anInt1226;
  12939. private int nextSong;
  12940. private boolean songChanging;
  12941. private final int[] anIntArray1229;
  12942. private Class11[] aClass11Array1230;
  12943. public static int anIntArray1232[];
  12944. private boolean aBoolean1233;
  12945. private int[] anIntArray1234;
  12946. private int[] anIntArray1235;
  12947. private int[] anIntArray1236;
  12948. private int anInt1237;
  12949. private int anInt1238;
  12950. public final int anInt1239 = 100;
  12951. private final int[] anIntArray1240;
  12952. private final int[] anIntArray1241;
  12953. private boolean aBoolean1242;
  12954. private int atInventoryLoopCycle;
  12955. private int atInventoryInterface;
  12956. private int atInventoryIndex;
  12957. private int atInventoryInterfaceType;
  12958. private byte[][] aByteArrayArray1247;
  12959. private int tradeMode;
  12960. private int anInt1249;
  12961. private final int[] anIntArray1250;
  12962. private int anInt1251;
  12963. private final boolean rsAlreadyLoaded;
  12964. private int anInt1253;
  12965. private int anInt1254;
  12966. private boolean welcomeScreenRaised;
  12967. private boolean messagePromptRaised;
  12968. private int anInt1257;
  12969. private byte[][][] byteGroundArray;
  12970. private int prevSong;
  12971. private int destX;
  12972. private int destY;
  12973. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12974. private int anInt1264;
  12975. private int anInt1265;
  12976. private String loginMessage1;
  12977. private String loginMessage2;
  12978. private int anInt1268;
  12979. private int anInt1269;
  12980. private int anInt1275;
  12981. private int backDialogID;
  12982. private int cameraOffsetX;
  12983. private int anInt1279;
  12984. private int[] bigX;
  12985. private int[] bigY;
  12986. private int itemSelected;
  12987. private int anInt1283;
  12988. private int anInt1284;
  12989. private int anInt1285;
  12990. private String selectedItemName;
  12991. private int publicChatMode;
  12992. private static int anInt1288;
  12993. private int anInt1289;
  12994. public static int anInt1290;
  12995. public static String server = "localhost";
  12996. public int drawCount;
  12997. public int fullscreenInterfaceID;
  12998. public int anInt1044;// 377
  12999. public int anInt1129;// 377
  13000. public int anInt1315;// 377
  13001. public int anInt1500;// 377
  13002. public int anInt1501;// 377
  13003. public int[] fullScreenTextureArray;
  13004.  
  13005. public void resetAllImageProducers() {
  13006. if (super.fullGameScreen != null) {
  13007. return;
  13008. }
  13009. aRSImageProducer_1166 = null;
  13010. aRSImageProducer_1164 = null;
  13011. aRSImageProducer_1163 = null;
  13012. aRSImageProducer_1165 = null;
  13013. aRSImageProducer_1123 = null;
  13014. aRSImageProducer_1124 = null;
  13015. aRSImageProducer_1125 = null;
  13016. aRSImageProducer_1107 = null;
  13017. aRSImageProducer_1108 = null;
  13018. aRSImageProducer_1109 = null;
  13019. aRSImageProducer_1110 = null;
  13020. aRSImageProducer_1111 = null;
  13021. aRSImageProducer_1112 = null;
  13022. aRSImageProducer_1113 = null;
  13023. aRSImageProducer_1114 = null;
  13024. aRSImageProducer_1115 = null;
  13025. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  13026. welcomeScreenRaised = true;
  13027. }
  13028.  
  13029. public void launchURL(String url) {
  13030. String osName = System.getProperty("os.name");
  13031. try {
  13032. if (osName.startsWith("Mac OS")) {
  13033. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  13034. Method openURL = fileMgr.getDeclaredMethod("openURL",
  13035. new Class[] { String.class });
  13036. openURL.invoke(null, new Object[] { url });
  13037. } else if (osName.startsWith("Windows"))
  13038. Runtime.getRuntime().exec(
  13039. "rundll32 url.dll,FileProtocolHandler " + url);
  13040. else { // assume Unix or Linux
  13041. String[] browsers = { "firefox", "opera", "konqueror",
  13042. "epiphany", "mozilla", "netscape", "safari" };
  13043. String browser = null;
  13044. for (int count = 0; count < browsers.length && browser == null; count++)
  13045. if (Runtime.getRuntime()
  13046. .exec(new String[] { "which", browsers[count] })
  13047. .waitFor() == 0)
  13048. browser = browsers[count];
  13049. if (browser == null) {
  13050. throw new Exception("Could not find web browser");
  13051. } else
  13052. Runtime.getRuntime().exec(new String[] { browser, url });
  13053. }
  13054. } catch (Exception e) {
  13055. pushMessage("Failed to open URL.", 0, "");
  13056. }
  13057. }
  13058.  
  13059. static {
  13060. anIntArray1019 = new int[99];
  13061. int i = 0;
  13062. for (int j = 0; j < 99; j++) {
  13063. int l = j + 1;
  13064. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  13065. i += i1;
  13066. anIntArray1019[j] = i / 4;
  13067. }
  13068. anIntArray1232 = new int[32];
  13069. i = 2;
  13070. for (int k = 0; k < 32; k++) {
  13071. anIntArray1232[k] = i - 1;
  13072. i += i;
  13073. }
  13074. }
  13075. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement