Advertisement
Guest User

Untitled

a guest
Feb 20th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 409.82 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4. import java.applet.AppletContext;
  5. import java.awt.*;
  6. import java.awt.event.KeyEvent;
  7. import java.io.*;
  8. import java.lang.reflect.Method;
  9. import java.net.*;
  10. import java.text.NumberFormat;
  11.  
  12. import javax.swing.JFrame;
  13. import javax.swing.JOptionPane;
  14.  
  15. import sign.signlink;
  16.  
  17. public class client extends RSApplet {
  18.  
  19. private static final long serialVersionUID = 1972391094425694511L;
  20.  
  21. /**
  22. * Store time of when last skill experienced was received.
  23. */
  24. public static long timeXpReceived;
  25.  
  26. /**
  27. * Current skill experience being shown.
  28. */
  29. public static int currentXP;
  30. public static boolean experienceOrb = true;
  31. public static int currentXPTotal;
  32.  
  33. public static boolean forceResetXp;
  34. public static int xpAddedPos;
  35.  
  36. public static int expAdded;
  37.  
  38. public static long xpFloatingTime;
  39.  
  40. public int xpGained;
  41.  
  42. public static int xpCounter;
  43.  
  44. public static boolean counterOn;
  45.  
  46. public static void setTab(int id) {
  47. needDrawTabArea = true;
  48. tabID = id;
  49. tabAreaAltered = true;
  50. }
  51.  
  52. int vengTimer = -1;
  53. int freezeTimer = -1;
  54.  
  55. public void updateStrings(String str, int i) {
  56. switch (i) {
  57. case 1675:
  58. sendFrame126(str, 17508);
  59. break; // Stab
  60. case 1676:
  61. sendFrame126(str, 17509);
  62. break; // Slash
  63. case 1677:
  64. sendFrame126(str, 17510);
  65. break; // Cursh
  66. case 1678:
  67. sendFrame126(str, 17511);
  68. break; // Magic
  69. case 1679:
  70. sendFrame126(str, 17512);
  71. break; // Range
  72. case 1680:
  73. sendFrame126(str, 17513);
  74. break; // Stab
  75. case 1681:
  76. sendFrame126(str, 17514);
  77. break; // Slash
  78. case 1682:
  79. sendFrame126(str, 17515);
  80. break; // Crush
  81. case 1683:
  82. sendFrame126(str, 17516);
  83. break; // Magic
  84. case 1684:
  85. sendFrame126(str, 17517);
  86. break; // Range
  87. case 1686:
  88. sendFrame126(str, 17518);
  89. break; // Strength
  90. case 1687:
  91. sendFrame126(str, 17519);
  92. break; // Prayer
  93. }
  94. }
  95.  
  96. public void sendFrame126(String str, int i) {
  97. RSInterface.interfaceCache[i].message = str;
  98. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  99. needDrawTabArea = true;
  100. }
  101.  
  102. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  103. if (backDialogID != -1) {
  104. backDialogID = -1;
  105. inputTaken = true;
  106. }
  107. if (inputDialogState != 0) {
  108. inputDialogState = 0;
  109. inputTaken = true;
  110. }
  111. openInterfaceID = interfaceID;
  112. invOverlayInterfaceID = sideInterfaceID;
  113. needDrawTabArea = true;
  114. tabAreaAltered = true;
  115. aBoolean1149 = false;
  116. }
  117.  
  118. public void addObject(int objectId, int x, int y, int face, int type,
  119. int height) {
  120. int mX = MapX - 6;
  121. int mY = MapY - 6;
  122. int x2 = x - (mX * 8);
  123. int y2 = y - (mY * 8);
  124. int i15 = 40 >> 2;
  125. int l17 = anIntArray1177[i15];
  126. if (y2 > 0 && y2 < 103 && x2 > 0 && x2 < 103) {
  127. method130(-1, objectId, face, l17, y2, type, height, x2, 0);
  128. }
  129. }
  130.  
  131. public void loadNewObjects() {
  132. addObject(4874, 3094, 3500, 1, 10, 0);
  133. addObject(4875, 3095, 3500, 1, 10, 0);
  134. addObject(4876, 3096, 3500, 1, 10, 0);
  135. addObject(4877, 3097, 3500, 1, 10, 0);
  136. addObject(4878, 3098, 3500, 1, 10, 0);
  137. addObject(409, 3217, 3221, 1, 10, 0);
  138. addObject(26258, 3217, 3224, 1, 10, 0);
  139. addObject(2980, 3217, 3226, 1, 10, 0);
  140. addObject(3192, 3221, 3211, -1, 10, 0);
  141. for (int i = 0; i < 8; i++) {
  142. addObject(6084, 3212 - i, 3218, 2, 10, 0);
  143. }
  144. for (int i = 0; i < 4; i++) {
  145. addObject(-1, 3208, 3220 + i, -1, 9, 0);
  146. }
  147. for (int i = 0; i < 4; i++) {
  148. addObject(-1, 3210, 3220 + i, -1, 9, 0);
  149. }
  150. }
  151.  
  152. public static int clientZoom = 600;
  153.  
  154. public static int spellID = 0;
  155.  
  156. private static String intToKOrMilLongName(int i) {
  157. String s = String.valueOf(i);
  158. for (int k = s.length() - 3; k > 0; k -= 3)
  159. s = s.substring(0, k) + "," + s.substring(k);
  160. if (s.length() > 8)
  161. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  162. + s + ")";
  163. else if (s.length() > 4)
  164. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  165. return " " + s;
  166. }
  167.  
  168. private void stopMidi() {
  169. signlink.midifade = 0;
  170. signlink.midi = "stop";
  171. }
  172.  
  173. private boolean menuHasAddFriend(int j) {
  174. if (j < 0)
  175. return false;
  176. int k = menuActionID[j];
  177. if (k >= 2000)
  178. k -= 2000;
  179. return k == 337;
  180. }
  181.  
  182. public void drawChannelButtons() {
  183. String text[] = { "On", "Friends", "Off", "Hide" };
  184. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 }; /*
  185. * Draws main
  186. * buttons
  187. * sprite
  188. */
  189. chatButtons.drawSprite(5, 143); /* Button hovering */
  190. if (cButtonHPos == 7) {
  191. reportH.drawSprite(404, 143);
  192. }
  193. if (cButtonCPos == 0)
  194. chatButtonC.drawSprite(5, 143);
  195. else if (cButtonCPos == 1)
  196. chatButtonC.drawSprite(62, 143);
  197. else if (cButtonCPos == 2)
  198. chatButtonC.drawSprite(119, 143);
  199. else if (cButtonCPos == 3)
  200. chatButtonC.drawSprite(176, 143);
  201. else if (cButtonCPos == 4)
  202. chatButtonC.drawSprite(233, 143);
  203. else if (cButtonCPos == 5)
  204. chatButtonC.drawSprite(290, 143);
  205. else if (cButtonCPos == 6)
  206. chatButtonC.drawSprite(347, 143);
  207. if (cButtonHPos == cButtonCPos) {
  208. if (cButtonHPos == 0)
  209. chatButtonHC.drawSprite(5, 143);
  210. else if (cButtonHPos == 1)
  211. chatButtonHC.drawSprite(62, 143);
  212. else if (cButtonHPos == 2)
  213. chatButtonHC.drawSprite(119, 143);
  214. else if (cButtonHPos == 3)
  215. chatButtonHC.drawSprite(176, 143);
  216. else if (cButtonHPos == 4)
  217. chatButtonHC.drawSprite(233, 143);
  218. else if (cButtonHPos == 5)
  219. chatButtonHC.drawSprite(290, 143);
  220. else if (cButtonHPos == 6)
  221. chatButtonHC.drawSprite(347, 143);
  222. } else {
  223. if (cButtonHPos == 0)
  224. chatButtonH.drawSprite(5, 143);
  225. else if (cButtonHPos == 1)
  226. chatButtonH.drawSprite(62, 143);
  227. else if (cButtonHPos == 2)
  228. chatButtonH.drawSprite(119, 143);
  229. else if (cButtonHPos == 3)
  230. chatButtonH.drawSprite(176, 143);
  231. else if (cButtonHPos == 4)
  232. chatButtonH.drawSprite(233, 143);
  233. else if (cButtonHPos == 5)
  234. chatButtonH.drawSprite(290, 143);
  235. else if (cButtonHPos == 6)
  236. chatButtonH.drawSprite(347, 143);
  237. } /* Button text */
  238. smallText.method389(true, 427, 0xffffff, "Report Abuse", 158);
  239. smallText.method389(true, 26, 0xffffff, "All", 158);
  240. smallText.method389(true, 77, 0xffffff, "Game", 158);
  241. smallText.method389(true, 131, 0xffffff, "Public", 153);
  242. smallText.method389(true, 185, 0xffffff, "Private", 153);
  243. smallText.method389(true, 249, 0xffffff, "Clan", 153);
  244. smallText.method389(true, 304, 0xffffff, "Trade", 153);
  245. smallText.method389(true, 363, 0xffffff, "Duel", 153); /* Chat modes */
  246. smallText.method382(textColor[publicChatMode], 146,
  247. text[publicChatMode], 164, true);
  248. smallText.method382(textColor[privateChatMode], 203,
  249. text[privateChatMode], 164, true);
  250. smallText.method382(textColor[clanChatMode], 260, text[clanChatMode],
  251. 164, true);
  252. smallText.method382(textColor[tradeMode], 317, text[tradeMode], 164,
  253. true);
  254. smallText
  255. .method382(textColor[duelMode], 374, text[duelMode], 164, true);
  256. }
  257.  
  258. private void drawChatArea() {
  259. aRSImageProducer_1166.initDrawingArea();
  260. Texture.anIntArray1472 = anIntArray1180;
  261. chatArea.drawSprite(0, 0);
  262. drawChannelButtons();
  263. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  264. if (messagePromptRaised) {
  265. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  266. newBoldFont.drawCenteredString(promptInput + "*", 259, 80, 128, -1);
  267. } else if (inputDialogState == 1) {
  268. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  269. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  270. 128, -1);
  271. } else if (inputDialogState == 2) {
  272. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  273. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  274. 128, -1);
  275. } else if (aString844 != null) {
  276. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  277. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128,
  278. -1);
  279. } else if (backDialogID != -1) {
  280. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  281. } else if (dialogID != -1) {
  282. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  283. } else {
  284. int j77 = -3;
  285. int j = 0;
  286. DrawingArea.setDrawingArea(122, 8, 497, 7);
  287. for (int k = 0; k < 500; k++)
  288. if (chatMessages[k] != null) {
  289. int chatType = chatTypes[k];
  290. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  291. String s1 = chatNames[k];
  292. byte byte0 = 0;
  293. if (s1 != null && s1.startsWith("@cr1@")) {
  294. s1 = s1.substring(5);
  295. byte0 = 1;
  296. } else if (s1 != null && s1.startsWith("@cr2@")) {
  297. s1 = s1.substring(5);
  298. byte0 = 2;
  299. } else if (s1 != null && s1.startsWith("@cr3@")) {
  300. s1 = s1.substring(5);
  301. byte0 = 3;
  302. } else if (s1 != null && s1.startsWith("@cr4@")) {
  303. s1 = s1.substring(5);
  304. byte0 = 4;
  305. } else if (s1 != null && s1.startsWith("@cr5@")) {
  306. s1 = s1.substring(5);
  307. byte0 = 5;
  308. } else if (s1 != null && s1.startsWith("@cr6@")) {
  309. s1 = s1.substring(5);
  310. byte0 = 6;
  311. } else if (s1 != null && s1.startsWith("@cr7@")) {
  312. s1 = s1.substring(5);
  313. byte0 = 7;
  314. } else if (s1 != null && s1.startsWith("@cr8@")) {
  315. s1 = s1.substring(5);
  316. byte0 = 8;
  317. } else if (s1 != null && s1.startsWith("@cr9@")) {
  318. s1 = s1.substring(5);
  319. byte0 = 9;
  320. } else if (s1 != null && s1.startsWith("@cr10@")) {
  321. s1 = s1.substring(6);
  322. byte0 = 10;
  323. }
  324. if (chatType == 0) {
  325. if (chatTypeView == 5 || chatTypeView == 0) {
  326. if (yPos > 0 && yPos < 210) {
  327. newRegularFont.drawBasicString(chatMessages[k],
  328. 11, yPos, 0, -1);
  329. }
  330. j++;
  331. j77++;
  332. }
  333. }
  334. if ((chatType == 1 || chatType == 2)
  335. && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1
  336. && isFriendOrSelf(s1))) {
  337. if (chatTypeView == 1 || chatTypeView == 0) {
  338. if (yPos > 0 && yPos < 210) {
  339. int xPos = 11;
  340. if (byte0 == 1) {
  341. modIcons[0].drawSprite(xPos + 1, yPos - 12);
  342. xPos += 14;
  343. } else if (byte0 == 2) {
  344. modIcons[1].drawSprite(xPos + 1, yPos - 12);
  345. xPos += 14;
  346. } else if (byte0 == 3) {
  347. modIcons[2].drawSprite(xPos + 1, yPos - 12);
  348. xPos += 14;
  349. } else if (byte0 == 4) {
  350. modIcons[3].drawSprite(xPos + 1, yPos - 12);
  351. xPos += 14;
  352. } else if (byte0 == 5) {
  353. modIcons[4].drawSprite(xPos + 1, yPos - 12);
  354. xPos += 14;
  355. } else if (byte0 == 6) {
  356. modIcons[5].drawSprite(xPos + 1, yPos - 12);
  357. xPos += 14;
  358. } else if (byte0 == 7) {
  359. modIcons[6].drawSprite(xPos + 1, yPos - 12);
  360. xPos += 14;
  361. } else if (byte0 == 8) {
  362. modIcons[7].drawSprite(xPos + 1, yPos - 12);
  363. xPos += 14;
  364. } else if (byte0 == 9) {
  365. modIcons[8].drawSprite(xPos + 1, yPos - 12);
  366. xPos += 14;
  367. } else if (byte0 == 10) {
  368. modIcons[10]
  369. .drawSprite(xPos + 1, yPos - 12);
  370. xPos += 14;
  371. }
  372. newRegularFont.drawBasicString(s1 + ":", xPos,
  373. yPos, 0, -1); // ok typej
  374. xPos += newRegularFont.getTextWidth(s1) + 8;
  375. newRegularFont.drawBasicString(chatMessages[k],
  376. xPos, yPos, 255, -1);
  377. }
  378. j++;
  379. j77++;
  380. }
  381. }
  382. if ((chatType == 3 || chatType == 7)
  383. && (splitPrivateChat == 0 || chatTypeView == 2)
  384. && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1
  385. && isFriendOrSelf(s1))) {
  386. if (chatTypeView == 2 || chatTypeView == 0) {
  387. if (yPos > 0 && yPos < 210) {
  388. int k1 = 11;
  389. newRegularFont.drawBasicString("From", k1,
  390. yPos, 0, -1);
  391. if (byte0 == 3 || byte0 == 2 || byte0 == 1
  392. || byte0 == 0) {
  393. k1 += textDrawingArea.getTextWidth("From ");
  394. } else if (byte0 == 6 || byte0 == 5
  395. || byte0 == 4) {
  396. k1 += textDrawingArea.getTextWidth("From");
  397. }
  398. if (byte0 == 1) {
  399. modIcons[0].drawSprite(k1, yPos - 12);
  400. k1 += 12;
  401. } else if (byte0 == 2) {
  402. modIcons[1].drawSprite(k1, yPos - 12);
  403. k1 += 12;
  404. } else if (byte0 == 3) {
  405. modIcons[2].drawSprite(k1, yPos - 12);
  406. k1 += 12;
  407. } else if (byte0 == 4) {
  408. modIcons[3].drawSprite(k1, yPos - 12);
  409. k1 += 12;
  410. } else if (byte0 == 5) {
  411. modIcons[4].drawSprite(k1, yPos - 12);
  412. k1 += 12;
  413. } else if (byte0 == 6) {
  414. modIcons[5].drawSprite(k1, yPos - 12);
  415. k1 += 12;
  416. } else if (byte0 == 7) {
  417. modIcons[6].drawSprite(k1, yPos - 12);
  418. k1 += 12;
  419. } else if (byte0 == 8) {
  420. modIcons[7].drawSprite(k1, yPos - 12);
  421. k1 += 12;
  422. } else if (byte0 == 9) {
  423. modIcons[8].drawSprite(k1, yPos - 12);
  424. k1 += 12;
  425. } else if (byte0 == 10) {
  426. modIcons[10].drawSprite(k1, yPos - 12);
  427. k1 += 12;
  428. }
  429. newRegularFont.drawBasicString(s1 + ":", k1,
  430. yPos, 0, -1);
  431. k1 += newRegularFont.getTextWidth(s1) + 8;
  432. newRegularFont.drawBasicString(chatMessages[k],
  433. k1, yPos, 0x800000, -1);
  434. }
  435. j++;
  436. j77++;
  437. }
  438. }
  439. if (chatType == 4
  440. && (tradeMode == 0 || tradeMode == 1
  441. && isFriendOrSelf(s1))) {
  442. if (chatTypeView == 3 || chatTypeView == 0) {
  443. if (yPos > 0 && yPos < 210)
  444. newRegularFont.drawBasicString(s1 + " "
  445. + chatMessages[k], 11, yPos, 0x800080,
  446. -1);
  447. j++;
  448. j77++;
  449. }
  450. }
  451. if (chatType == 5 && splitPrivateChat == 0
  452. && privateChatMode < 2) {
  453. if (chatTypeView == 2 || chatTypeView == 0) {
  454. if (yPos > 0 && yPos < 210)
  455. newRegularFont.drawBasicString(chatMessages[k],
  456. 11, yPos, 0x800000, -1);
  457. j++;
  458. j77++;
  459. }
  460. }
  461. if (chatType == 6
  462. && (splitPrivateChat == 0 || chatTypeView == 2)
  463. && privateChatMode < 2) {
  464. if (chatTypeView == 2 || chatTypeView == 0) {
  465. if (yPos > 0 && yPos < 210) {
  466. newRegularFont.drawBasicString(
  467. "To " + s1 + ":", 11, yPos, 0, -1);
  468. newRegularFont.drawBasicString(
  469. chatMessages[k],
  470. 15 + newRegularFont.getTextWidth("To :"
  471. + s1), yPos, 0x800000, -1);
  472. }
  473. j++;
  474. j77++;
  475. }
  476. }
  477. if (chatType == 8
  478. && (tradeMode == 0 || tradeMode == 1
  479. && isFriendOrSelf(s1))) {
  480. if (chatTypeView == 3 || chatTypeView == 0) {
  481. if (yPos > 0 && yPos < 210)
  482. newRegularFont.drawBasicString(s1 + " "
  483. + chatMessages[k], 11, yPos, 0x7e3200,
  484. -1);
  485. j++;
  486. j77++;
  487. }
  488. if (chatType == 11 && (clanChatMode == 0)) {
  489. if (chatTypeView == 11) {
  490. if (yPos > 0 && yPos < 110)
  491. newRegularFont.drawBasicString(s1 + " "
  492. + chatMessages[k], 19, yPos,
  493. 0x7e3200, -1);
  494. j++;
  495. j77++;
  496. }
  497. }
  498. if (chatType == 12) {
  499. if (chatTypeView == 11 || chatTypeView == 0) {
  500. if (yPos > 3 && yPos < 130) {
  501. String title = "<col=0000FF>"
  502. + clanTitles[k] + "</col>";
  503. String username = (chatRights[k] > 0 ? "<img="
  504. + (chatRights[k] - 1) + ">"
  505. : "")
  506. + TextClass.fixName(chatNames[k]);
  507. String message = "<col=800000>"
  508. + chatMessages[k] + "</col>";
  509. newRegularFont.drawBasicString("[" + title
  510. + "] " + username + ": " + message,
  511. 11, yPos, 0, -1);
  512. }
  513. j++;
  514. j77++;
  515. }
  516. }
  517. }
  518. if (chatType == 16) {
  519. int j2 = 40 + 11;
  520. int clanNameWidth = textDrawingArea
  521. .getTextWidth(clanname);
  522. if (chatTypeView == 11 || chatTypeView == 0) {
  523. if (yPos > 0 && yPos < 110)
  524. switch (chatRights[k]) {
  525. case 1:
  526. j2 += clanNameWidth;
  527. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  528. j2 += 15;
  529. break;
  530. case 2:
  531. j2 += clanNameWidth;
  532. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  533. j2 += 15;
  534. break;
  535. case 3:
  536. j2 += clanNameWidth;
  537. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  538. j2 += 15;
  539. break;
  540. case 4:
  541. j2 += clanNameWidth;
  542. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  543. j2 += 15;
  544. break;
  545. default:
  546. j2 += clanNameWidth;
  547. break;
  548. }
  549. newRegularFont
  550. .drawBasicString("[", 19, yPos, 0, -1);
  551. newRegularFont.drawBasicString("]",
  552. clanNameWidth + 16 + 11, yPos, 0, -1);
  553. newRegularFont.drawBasicString(""
  554. + capitalize(clanname) + "", 25, yPos, 255,
  555. -1);
  556. newRegularFont.drawBasicString(
  557. capitalize(chatNames[k]) + ":", j2 - 17,
  558. yPos);
  559. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  560. newRegularFont.drawBasicString(
  561. capitalize(chatMessages[k]), j2 - 16, yPos,
  562. 0x800000, -1);
  563.  
  564. j++;
  565. j77++;
  566. }
  567. }
  568. }
  569. DrawingArea.defaultDrawingAreaSize();
  570. anInt1211 = j * 14 + 7 + 5;
  571. if (anInt1211 < 111)
  572. anInt1211 = 111;
  573. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  574. String fixedString;
  575.  
  576. if (myPlayer != null && myPlayer.name != null)
  577. fixedString = "<col=" + titleColor(myPlayer.titleColor, 0)
  578. + ">" + myPlayer.title + "</col> " + myPlayer.name;
  579. else
  580. fixedString = TextClass.fixName(capitalize(myUsername));
  581.  
  582. String s;
  583. if (myPlayer != null && myPlayer.name != null)
  584. s = "" + myPlayer.title + " " + myPlayer.name;
  585. else
  586. s = TextClass.fixName(capitalize(myUsername));
  587.  
  588. int xPos = 0;
  589. // int yPos = 0;
  590. if (myPrivilege == 0) { // Player
  591. newRegularFont.drawBasicString(fixedString + "", 11, 133, 0, -1);
  592. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 12, 123);
  593. textDrawingArea.method385(0, ": ", 133,
  594. (26) + textDrawingArea.getTextWidth(s));
  595. newRegularFont.drawBasicString(inputString
  596. + ((loopCycle % 40 < 20) ? "|" : ""),
  597. 24 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  598. -1);
  599. DrawingArea.method339(121, 0x807660, 506, 7);
  600. } else if (myPrivilege == 1) { // Moderator
  601. modIcons[0].drawSprite(10 + xPos, 122);
  602. xPos += 14;
  603. newRegularFont
  604. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  605. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  606. 123);
  607. textDrawingArea.method385(0, ": ", 133,
  608. (38 + textDrawingArea.getTextWidth(s)));
  609. newRegularFont.drawBasicString(inputString
  610. + ((loopCycle % 40 < 20) ? "|" : ""),
  611. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  612. -1);
  613. DrawingArea.method339(121, 0x807660, 506, 7);
  614. } else if (myPrivilege == 2) { // Administrator
  615. modIcons[1].drawSprite(10 + xPos, 122);
  616. xPos += 14;
  617. newRegularFont
  618. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  619. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  620. 123);
  621. textDrawingArea.method385(0, ": ", 133,
  622. (38 + textDrawingArea.getTextWidth(s)));
  623. newRegularFont.drawBasicString(inputString
  624. + ((loopCycle % 40 < 20) ? "|" : ""),
  625. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  626. -1);
  627. DrawingArea.method339(121, 0x807660, 506, 7);
  628. } else if (myPrivilege == 3) { // Developer // seck
  629. modIcons[2].drawSprite(10 + xPos, 121);
  630. xPos += 14;
  631. newRegularFont
  632. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  633. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  634. 123);
  635. textDrawingArea.method385(0, ": ", 10,
  636. (38 + textDrawingArea.getTextWidth(s)));
  637. newRegularFont.drawBasicString(inputString
  638. + ((loopCycle % 40 < 20) ? "|" : ""),
  639. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  640. -1);
  641. DrawingArea.method339(121, 0x807660, 506, 7);
  642. } else if (myPrivilege == 4) { // Donator
  643. modIcons[3].drawSprite(10 + xPos, 122);
  644. xPos += 14; // kk test
  645. newRegularFont
  646. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  647. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  648. 123);
  649. textDrawingArea.method385(0, ": ", 133,
  650. (38 + textDrawingArea.getTextWidth(s)));
  651. newRegularFont.drawBasicString(inputString
  652. + ((loopCycle % 40 < 20) ? "|" : ""),
  653. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  654. -1);
  655. DrawingArea.method339(121, 0x807660, 506, 7);
  656. } else if (myPrivilege == 5) { // Super Donator
  657. modIcons[4].drawSprite(10 + xPos, 122);
  658. xPos += 14;
  659. newRegularFont
  660. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  661. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  662. 123);
  663. textDrawingArea.method385(0, ": ", 133,
  664. (38 + textDrawingArea.getTextWidth(s)));
  665. newRegularFont.drawBasicString(inputString
  666. + ((loopCycle % 40 < 20) ? "|" : ""),
  667. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  668. -1);
  669. DrawingArea.method339(121, 0x807660, 506, 7);
  670. } else if (myPrivilege == 6) { // Extreme Donator
  671. modIcons[5].drawSprite(10 + xPos, 122);
  672. xPos += 14;
  673. newRegularFont
  674. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  675. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  676. 123);
  677. textDrawingArea.method385(0, ": ", 133,
  678. (38 + textDrawingArea.getTextWidth(s)));
  679. newRegularFont.drawBasicString(inputString
  680. + ((loopCycle % 40 < 20) ? "|" : ""),
  681. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  682. -1);
  683. DrawingArea.method339(121, 0x807660, 506, 7);
  684. } else if (myPrivilege == 7) { // Help Squad
  685. modIcons[6].drawSprite(10 + xPos, 122);
  686. xPos += 14;
  687. newRegularFont
  688. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  689. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  690. 123);
  691. textDrawingArea.method385(0, ": ", 133,
  692. (38 + textDrawingArea.getTextWidth(s)));
  693. newRegularFont.drawBasicString(inputString
  694. + ((loopCycle % 40 < 20) ? "|" : ""),
  695. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  696. -1);
  697. DrawingArea.method339(121, 0x807660, 506, 7);
  698. } else if (myPrivilege == 8) { // Respected Member
  699. modIcons[7].drawSprite(9 + xPos, 122);
  700. xPos += 14;
  701. newRegularFont
  702. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  703. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  704. 123);
  705. textDrawingArea.method385(0, ": ", 133,
  706. (38 + textDrawingArea.getTextWidth(s)));
  707. newRegularFont.drawBasicString(inputString
  708. + ((loopCycle % 40 < 20) ? "|" : ""),
  709. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  710. -1);
  711. DrawingArea.method339(121, 0x807660, 506, 7);
  712. } else if (myPrivilege == 9) { // Veteran
  713. modIcons[8].drawSprite(10 + xPos, 122);
  714. xPos += 14;
  715. newRegularFont
  716. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  717. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  718. 123);
  719. textDrawingArea.method385(0, ": ", 133,
  720. (38 + textDrawingArea.getTextWidth(s)));
  721. newRegularFont.drawBasicString(inputString
  722. + ((loopCycle % 40 < 20) ? "|" : ""),
  723. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  724. -1);
  725. DrawingArea.method339(121, 0x807660, 506, 7);
  726. } else if (myPrivilege == 10) { // Veteran
  727. modIcons[10].drawSprite(10 + xPos, 122);
  728. xPos += 14;
  729. newRegularFont
  730. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  731. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  732. 123);
  733. textDrawingArea.method385(0, ": ", 133,
  734. (38 + textDrawingArea.getTextWidth(s)));
  735. newRegularFont.drawBasicString(inputString
  736. + ((loopCycle % 40 < 20) ? "|" : ""),
  737. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  738. -1);
  739. DrawingArea.method339(121, 0x807660, 506, 7);
  740. }
  741. }
  742. if (menuOpen && menuScreenArea == 2) {
  743. drawMenu();
  744. }
  745. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  746. aRSImageProducer_1165.initDrawingArea();
  747. Texture.anIntArray1472 = anIntArray1182;
  748.  
  749. }
  750.  
  751. private String clanUsername;
  752. private String clanMessage;
  753. private String clanTitle;
  754. private final String[] clanTitles;
  755. private int channelRights;
  756.  
  757. public void init() {
  758. nodeID = 10;
  759. portOff = 0;
  760. setHighMem();
  761. isMembers = true;
  762. instance = this;
  763. initClientFrame(503, 765);
  764. }
  765.  
  766. public void startRunnable(Runnable runnable, int i) {
  767. if (i > 10)
  768. i = 10;
  769. if (signlink.mainapp != null) {
  770. signlink.startthread(runnable, i);
  771. } else {
  772. super.startRunnable(runnable, i);
  773. }
  774. }
  775.  
  776. public Socket openSocket(int port) throws IOException {
  777. return new Socket(InetAddress.getByName(server), port);
  778. }
  779.  
  780. private void processMenuClick() {
  781. if (activeInterfaceType != 0)
  782. return;
  783. int j = super.clickMode3;
  784. if (spellSelected == 1 && super.saveClickX >= 516
  785. && super.saveClickY >= 160 && super.saveClickX <= 765
  786. && super.saveClickY <= 205)
  787. j = 0;
  788. if (menuOpen) {
  789. if (j != 1) {
  790. int k = super.mouseX;
  791. int j1 = super.mouseY;
  792. if (menuScreenArea == 0) {
  793. k -= 4;
  794. j1 -= 4;
  795. }
  796. if (menuScreenArea == 1) {
  797. k -= 519;
  798. j1 -= 168;
  799. }
  800. if (menuScreenArea == 2) {
  801. k -= 17;
  802. j1 -= 338;
  803. }
  804. if (menuScreenArea == 3) {
  805. k -= 519;
  806. j1 -= 0;
  807. }
  808. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  809. || j1 < menuOffsetY - 10
  810. || j1 > menuOffsetY + anInt952 + 10) {
  811. menuOpen = false;
  812. if (menuScreenArea == 1)
  813. needDrawTabArea = true;
  814. if (menuScreenArea == 2)
  815. inputTaken = true;
  816. }
  817. }
  818. if (j == 1) {
  819. int l = menuOffsetX;
  820. int k1 = menuOffsetY;
  821. int i2 = menuWidth;
  822. int k2 = super.saveClickX;
  823. int l2 = super.saveClickY;
  824. if (menuScreenArea == 0) {
  825. k2 -= 4;
  826. l2 -= 4;
  827. }
  828. if (menuScreenArea == 1) {
  829. k2 -= 519;
  830. l2 -= 168;
  831. }
  832. if (menuScreenArea == 2) {
  833. k2 -= 17;
  834. l2 -= 338;
  835. }
  836. if (menuScreenArea == 3) {
  837. k2 -= 519;
  838. l2 -= 0;
  839. }
  840. int i3 = -1;
  841. for (int j3 = 0; j3 < menuActionRow; j3++) {
  842. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  843. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  844. i3 = j3;
  845. }
  846.  
  847. if (i3 != -1)
  848. doAction(i3);
  849. menuOpen = false;
  850. if (menuScreenArea == 1)
  851. needDrawTabArea = true;
  852. if (menuScreenArea == 2) {
  853. inputTaken = true;
  854. }
  855. }
  856. } else {
  857. if (j == 1 && menuActionRow > 0) {
  858. int i1 = menuActionID[menuActionRow - 1];
  859. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  860. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  861. || i1 == 847 || i1 == 447 || i1 == 1125) {
  862. int l1 = menuActionCmd2[menuActionRow - 1];
  863. int j2 = menuActionCmd3[menuActionRow - 1];
  864. RSInterface class9 = RSInterface.interfaceCache[j2];
  865. if (class9.aBoolean259 || class9.aBoolean235) {
  866. aBoolean1242 = false;
  867. anInt989 = 0;
  868. anInt1084 = j2;
  869. anInt1085 = l1;
  870. activeInterfaceType = 2;
  871. anInt1087 = super.saveClickX;
  872. anInt1088 = super.saveClickY;
  873. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  874. activeInterfaceType = 1;
  875. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  876. activeInterfaceType = 3;
  877. return;
  878. }
  879. }
  880. }
  881. if (j == 1
  882. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  883. && menuActionRow > 2)
  884. j = 2;
  885. if (j == 1 && menuActionRow > 0)
  886. doAction(menuActionRow - 1);
  887. if (j == 2 && menuActionRow > 0)
  888. determineMenuSize();
  889. }
  890. }
  891.  
  892. public static int totalRead = 0;
  893.  
  894. public static String getFileNameWithoutExtension(String fileName) {
  895. File tmpFile = new File(fileName);
  896. tmpFile.getName();
  897. int whereDot = tmpFile.getName().lastIndexOf('.');
  898. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  899. return tmpFile.getName().substring(0, whereDot);
  900. }
  901. return "";
  902. }
  903.  
  904. public void preloadModels() {
  905. File file = new File("./Raw/");
  906. File[] fileArray = file.listFiles();
  907. for (int y = 0; y < fileArray.length; y++) {
  908. String s = fileArray[y].getName();
  909. byte[] buffer = ReadFile("./Raw/" + s);
  910. Model.method460(buffer,
  911. Integer.parseInt(getFileNameWithoutExtension(s)));
  912. }
  913. }
  914.  
  915. public static final byte[] ReadFile(String s) {
  916. try {
  917. byte abyte0[];
  918. File file = new File(s);
  919. int i = (int) file.length();
  920. abyte0 = new byte[i];
  921. DataInputStream datainputstream = new DataInputStream(
  922. new BufferedInputStream(new FileInputStream(s)));
  923. datainputstream.readFully(abyte0, 0, i);
  924. datainputstream.close();
  925. totalRead++;
  926. return abyte0;
  927. } catch (Exception e) {
  928. System.out.println((new StringBuilder()).append("Read Error: ")
  929. .append(s).toString());
  930. return null;
  931. }
  932. }
  933.  
  934. public void models() {
  935. for (int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  936. byte[] abyte0 = getModel(ModelIndex);
  937. if (abyte0 != null && abyte0.length > 0) {
  938. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  939. pushMessage("Model added successfully!", 0, "");
  940. }
  941. }
  942. }
  943.  
  944. private void saveMidi(boolean flag, byte abyte0[]) {
  945. signlink.midifade = flag ? 1 : 0;
  946. signlink.midisave(abyte0, abyte0.length);
  947. }
  948.  
  949. private void method22() {
  950. try {
  951. anInt985 = -1;
  952. aClass19_1056.removeAll();
  953. aClass19_1013.removeAll();
  954. Texture.method366();
  955. unlinkMRUNodes();
  956. loadNewObjects();
  957. worldController.initToNull();
  958. System.gc();
  959. for (int i = 0; i < 4; i++)
  960. aClass11Array1230[i].method210();
  961.  
  962. for (int l = 0; l < 4; l++) {
  963. for (int k1 = 0; k1 < 104; k1++) {
  964. for (int j2 = 0; j2 < 104; j2++)
  965. byteGroundArray[l][k1][j2] = 0;
  966.  
  967. }
  968.  
  969. }
  970.  
  971. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  972. intGroundArray);
  973. int k2 = aByteArrayArray1183.length;
  974. stream.createFrame(0);
  975. if (!aBoolean1159) {
  976. for (int i3 = 0; i3 < k2; i3++) {
  977. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  978. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  979. byte abyte0[] = aByteArrayArray1183[i3];
  980. if (abyte0 != null)
  981. objectManager.method180(abyte0, k5, i4,
  982. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  983. aClass11Array1230);
  984. }
  985.  
  986. for (int j4 = 0; j4 < k2; j4++) {
  987. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  988. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  989. byte abyte2[] = aByteArrayArray1183[j4];
  990. if (abyte2 == null && anInt1070 < 800)
  991. objectManager.method174(k7, 64, 64, l5);
  992. }
  993.  
  994. anInt1097++;
  995. if (anInt1097 > 160) {
  996. anInt1097 = 0;
  997. stream.createFrame(238);
  998. stream.writeWordBigEndian(96);
  999. }
  1000. stream.createFrame(0);
  1001. for (int i6 = 0; i6 < k2; i6++) {
  1002. byte abyte1[] = aByteArrayArray1247[i6];
  1003. if (abyte1 != null) {
  1004. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1005. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1006. objectManager.method190(l8, aClass11Array1230, k9,
  1007. worldController, abyte1);
  1008. }
  1009. }
  1010.  
  1011. }
  1012. if (aBoolean1159) {
  1013. for (int j3 = 0; j3 < 4; j3++) {
  1014. for (int k4 = 0; k4 < 13; k4++) {
  1015. for (int j6 = 0; j6 < 13; j6++) {
  1016. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1017. if (l7 != -1) {
  1018. int i9 = l7 >> 24 & 3;
  1019. int l9 = l7 >> 1 & 3;
  1020. int j10 = l7 >> 14 & 0x3ff;
  1021. int l10 = l7 >> 3 & 0x7ff;
  1022. int j11 = (j10 / 8 << 8) + l10 / 8;
  1023. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1024. if (anIntArray1234[l11] != j11
  1025. || aByteArrayArray1183[l11] == null)
  1026. continue;
  1027. objectManager.method179(i9, l9,
  1028. aClass11Array1230, k4 * 8,
  1029. (j10 & 7) * 8,
  1030. aByteArrayArray1183[l11],
  1031. (l10 & 7) * 8, j3, j6 * 8);
  1032. break;
  1033. }
  1034.  
  1035. }
  1036. }
  1037.  
  1038. }
  1039.  
  1040. }
  1041.  
  1042. for (int l4 = 0; l4 < 13; l4++) {
  1043. for (int k6 = 0; k6 < 13; k6++) {
  1044. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1045. if (i8 == -1)
  1046. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1047. }
  1048.  
  1049. }
  1050.  
  1051. stream.createFrame(0);
  1052. for (int l6 = 0; l6 < 4; l6++) {
  1053. for (int j8 = 0; j8 < 13; j8++) {
  1054. for (int j9 = 0; j9 < 13; j9++) {
  1055. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1056. if (i10 != -1) {
  1057. int k10 = i10 >> 24 & 3;
  1058. int i11 = i10 >> 1 & 3;
  1059. int k11 = i10 >> 14 & 0x3ff;
  1060. int i12 = i10 >> 3 & 0x7ff;
  1061. int j12 = (k11 / 8 << 8) + i12 / 8;
  1062. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1063. if (anIntArray1234[k12] != j12
  1064. || aByteArrayArray1247[k12] == null)
  1065. continue;
  1066. objectManager.method183(aClass11Array1230,
  1067. worldController, k10, j8 * 8,
  1068. (i12 & 7) * 8, l6,
  1069. aByteArrayArray1247[k12],
  1070. (k11 & 7) * 8, i11, j9 * 8);
  1071. break;
  1072. }
  1073.  
  1074. }
  1075. }
  1076.  
  1077. }
  1078.  
  1079. }
  1080.  
  1081. }
  1082. stream.createFrame(0);
  1083. objectManager.method171(aClass11Array1230, worldController);
  1084. aRSImageProducer_1165.initDrawingArea();
  1085. stream.createFrame(0);
  1086. int k3 = ObjectManager.anInt145;
  1087. if (k3 > plane)
  1088. k3 = plane;
  1089. if (k3 < plane - 1)
  1090. k3 = plane - 1;
  1091. if (lowMem)
  1092. worldController.method275(ObjectManager.anInt145);
  1093. else
  1094. worldController.method275(0);
  1095. for (int i5 = 0; i5 < 104; i5++) {
  1096. for (int i7 = 0; i7 < 104; i7++)
  1097. spawnGroundItem(i5, i7);
  1098.  
  1099. }
  1100.  
  1101. anInt1051++;
  1102. if (anInt1051 > 98) {
  1103. anInt1051 = 0;
  1104. stream.createFrame(150);
  1105. }
  1106. method63();
  1107. } catch (Exception exception) {
  1108. }
  1109. ObjectDef.mruNodes1.unlinkAll();
  1110. if (super.gameFrame != null) {
  1111. stream.createFrame(210);
  1112. stream.writeDWord(0x3f008edd);
  1113. }
  1114. if (lowMem && signlink.cache_dat != null) {
  1115. int j = onDemandFetcher.getVersionCount(0);
  1116. for (int i1 = 0; i1 < j; i1++) {
  1117. int l1 = onDemandFetcher.getModelIndex(i1);
  1118. if ((l1 & 0x79) == 0)
  1119. Model.method461(i1);
  1120. }
  1121.  
  1122. }
  1123. System.gc();
  1124. Texture.method367();
  1125. onDemandFetcher.method566();
  1126. int k = (anInt1069 - 6) / 8 - 1;
  1127. int j1 = (anInt1069 + 6) / 8 + 1;
  1128. int i2 = (anInt1070 - 6) / 8 - 1;
  1129. int l2 = (anInt1070 + 6) / 8 + 1;
  1130. if (aBoolean1141) {
  1131. k = 49;
  1132. j1 = 50;
  1133. i2 = 49;
  1134. l2 = 50;
  1135. }
  1136. for (int l3 = k; l3 <= j1; l3++) {
  1137. for (int j5 = i2; j5 <= l2; j5++)
  1138. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1139. int j7 = onDemandFetcher.method562(0, j5, l3);
  1140. if (j7 != -1)
  1141. onDemandFetcher.method560(j7, 3);
  1142. int k8 = onDemandFetcher.method562(1, j5, l3);
  1143. if (k8 != -1)
  1144. onDemandFetcher.method560(k8, 3);
  1145. }
  1146.  
  1147. }
  1148.  
  1149. }
  1150.  
  1151. private void unlinkMRUNodes() {
  1152. ObjectDef.mruNodes1.unlinkAll();
  1153. ObjectDef.mruNodes2.unlinkAll();
  1154. EntityDef.mruNodes.unlinkAll();
  1155. ItemDef.mruNodes2.unlinkAll();
  1156. ItemDef.mruNodes1.unlinkAll();
  1157. Player.mruNodes.unlinkAll();
  1158. SpotAnim.aMRUNodes_415.unlinkAll();
  1159. }
  1160.  
  1161. private void method24(int i) {
  1162. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1163. int j = ai.length;
  1164. for (int k = 0; k < j; k++)
  1165. ai[k] = 0;
  1166.  
  1167. for (int l = 1; l < 103; l++) {
  1168. int i1 = 24628 + (103 - l) * 512 * 4;
  1169. for (int k1 = 1; k1 < 103; k1++) {
  1170. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1171. worldController.method309(ai, i1, i, k1, l);
  1172. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1173. worldController.method309(ai, i1, i + 1, k1, l);
  1174. i1 += 4;
  1175. }
  1176.  
  1177. }
  1178.  
  1179. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16)
  1180. + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  1181. + ((238 + (int) (Math.random() * 20D)) - 10);
  1182. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  1183. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1184. for (int i2 = 1; i2 < 103; i2++) {
  1185. for (int j2 = 1; j2 < 103; j2++) {
  1186. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1187. method50(i2, j1, j2, l1, i);
  1188. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1189. method50(i2, j1, j2, l1, i + 1);
  1190. }
  1191.  
  1192. }
  1193.  
  1194. aRSImageProducer_1165.initDrawingArea();
  1195. anInt1071 = 0;
  1196. for (int k2 = 0; k2 < 104; k2++) {
  1197. for (int l2 = 0; l2 < 104; l2++) {
  1198. int i3 = worldController.method303(plane, k2, l2);
  1199. if (i3 != 0) {
  1200. i3 = i3 >> 14 & 0x7fff;
  1201. int j3 = ObjectDef.forID(i3).anInt746;
  1202. if (j3 >= 0) {
  1203. int k3 = k2;
  1204. int l3 = l2;
  1205. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36
  1206. && j3 != 46 && j3 != 47 && j3 != 48) {
  1207. byte byte0 = 104;
  1208. byte byte1 = 104;
  1209. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1210. for (int i4 = 0; i4 < 10; i4++) {
  1211. int j4 = (int) (Math.random() * 4D);
  1212. if (j4 == 0 && k3 > 0 && k3 > k2 - 3
  1213. && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1214. k3--;
  1215. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3
  1216. && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1217. k3++;
  1218. if (j4 == 2 && l3 > 0 && l3 > l2 - 3
  1219. && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1220. l3--;
  1221. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3
  1222. && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1223. l3++;
  1224. }
  1225.  
  1226. }
  1227. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1228. anIntArray1072[anInt1071] = k3;
  1229. anIntArray1073[anInt1071] = l3;
  1230. anInt1071++;
  1231. }
  1232. }
  1233. }
  1234.  
  1235. }
  1236.  
  1237. }
  1238.  
  1239. private void spawnGroundItem(int i, int j) {
  1240. NodeList class19 = groundArray[plane][i][j];
  1241. if (class19 == null) {
  1242. worldController.method295(plane, i, j);
  1243. return;
  1244. }
  1245. int k = 0xfa0a1f01;
  1246. Object obj = null;
  1247. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1248. .reverseGetNext()) {
  1249. ItemDef itemDef = ItemDef.forID(item.ID);
  1250. int l = itemDef.value;
  1251. if (itemDef.stackable)
  1252. l *= item.anInt1559 + 1;
  1253. // notifyItemSpawn(item, i + baseX, j + baseY);
  1254. if (l > k) {
  1255. k = l;
  1256. obj = item;
  1257. }
  1258. }
  1259.  
  1260. class19.insertTail(((Node) (obj)));
  1261. Object obj1 = null;
  1262. Object obj2 = null;
  1263. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1264. .reverseGetNext()) {
  1265. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1266. && obj1 == null)
  1267. obj1 = class30_sub2_sub4_sub2_1;
  1268. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1269. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1270. && obj2 == null)
  1271. obj2 = class30_sub2_sub4_sub2_1;
  1272. }
  1273.  
  1274. int i1 = i + (j << 7) + 0x60000000;
  1275. worldController.method281(i, i1, ((Animable) (obj1)),
  1276. method42(plane, j * 128 + 64, i * 128 + 64),
  1277. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1278. }
  1279.  
  1280. private void method26(boolean flag) {
  1281. for (int j = 0; j < npcCount; j++) {
  1282. NPC npc = npcArray[npcIndices[j]];
  1283. int k = 0x20000000 + (npcIndices[j] << 14);
  1284. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1285. continue;
  1286. int l = npc.x >> 7;
  1287. int i1 = npc.y >> 7;
  1288. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1289. continue;
  1290. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1291. && (npc.y & 0x7f) == 64) {
  1292. if (anIntArrayArray929[l][i1] == anInt1265)
  1293. continue;
  1294. anIntArrayArray929[l][i1] = anInt1265;
  1295. }
  1296. if (!npc.desc.aBoolean84)
  1297. k += 0x80000000;
  1298. worldController
  1299. .method285(plane, npc.anInt1552,
  1300. method42(plane, npc.y, npc.x), k, npc.y,
  1301. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1302. npc.aBoolean1541);
  1303. }
  1304. }
  1305.  
  1306. private boolean replayWave() {
  1307. return signlink.wavereplay();
  1308. }
  1309.  
  1310. private void loadError() {
  1311. String s = "ondemand"; // was a constant parameter
  1312. System.out.println(s);
  1313. try {
  1314. getAppletContext().showDocument(
  1315. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1316. } catch (Exception exception) {
  1317. exception.printStackTrace();
  1318. }
  1319. do
  1320. try {
  1321. Thread.sleep(1000L);
  1322. } catch (Exception _ex) {
  1323. }
  1324. while (true);
  1325. }
  1326.  
  1327. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
  1328. int i1, int j1) {
  1329. if (class9.type != 0 || class9.children == null
  1330. || class9.isMouseoverTriggered)
  1331. return;
  1332. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1333. return;
  1334. int k1 = class9.children.length;
  1335. for (int l1 = 0; l1 < k1; l1++) {
  1336. int i2 = class9.childX[l1] + i;
  1337. int j2 = (class9.childY[l1] + l) - j1;
  1338. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1339. i2 += class9_1.anInt263;
  1340. j2 += class9_1.anInt265;
  1341. if ((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0)
  1342. && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1343. && i1 < j2 + class9_1.height)
  1344. if (class9_1.mOverInterToTrigger >= 0)
  1345. anInt886 = class9_1.mOverInterToTrigger;
  1346. else
  1347. anInt886 = class9_1.id;
  1348. if (class9_1.type == 0) {
  1349. buildInterfaceMenu(i2, class9_1, k, j2, i1,
  1350. class9_1.scrollPosition);
  1351. if (class9_1.scrollMax > class9_1.height)
  1352. method65(i2 + class9_1.width, class9_1.height, k, i1,
  1353. class9_1, j2, true, class9_1.scrollMax);
  1354. } else {
  1355. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
  1356. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1357. boolean flag = false;
  1358. if (class9_1.contentType != 0)
  1359. flag = buildFriendsListMenu(class9_1);
  1360. if (!flag) {
  1361. // System.out.println("1"+class9_1.tooltip + ", " +
  1362. // class9_1.interfaceID);
  1363. menuActionName[menuActionRow] = class9_1.tooltip;
  1364. menuActionID[menuActionRow] = 315;
  1365. menuActionCmd3[menuActionRow] = class9_1.id;
  1366. menuActionRow++;
  1367. }
  1368. }
  1369. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
  1370. && i1 >= j2 && k < i2 + class9_1.width
  1371. && i1 < j2 + class9_1.height) {
  1372. String s = class9_1.selectedActionName;
  1373. if (s.indexOf(" ") != -1)
  1374. s = s.substring(0, s.indexOf(" "));
  1375. menuActionName[menuActionRow] = s + " @gre@"
  1376. + class9_1.spellName;
  1377. menuActionID[menuActionRow] = 626;
  1378. menuActionCmd3[menuActionRow] = class9_1.id;
  1379. menuActionRow++;
  1380. }
  1381. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
  1382. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1383. menuActionName[menuActionRow] = "Close";
  1384. menuActionID[menuActionRow] = 200;
  1385. menuActionCmd3[menuActionRow] = class9_1.id;
  1386. menuActionRow++;
  1387. }
  1388. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
  1389. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1390. // System.out.println("2"+class9_1.tooltip + ", " +
  1391. // class9_1.interfaceID);
  1392. menuActionName[menuActionRow] = class9_1.tooltip + ", "
  1393. + class9_1.id;
  1394. menuActionID[menuActionRow] = 169;
  1395. menuActionCmd3[menuActionRow] = class9_1.id;
  1396. menuActionRow++;
  1397. }
  1398. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
  1399. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1400. // System.out.println("3"+class9_1.tooltip + ", " +
  1401. // class9_1.interfaceID);
  1402. menuActionName[menuActionRow] = class9_1.tooltip + ", "
  1403. + class9_1.id;
  1404. menuActionID[menuActionRow] = 646;
  1405. menuActionCmd3[menuActionRow] = class9_1.id;
  1406. menuActionRow++;
  1407. }
  1408. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
  1409. && i1 >= j2 && k < i2 + class9_1.width
  1410. && i1 < j2 + class9_1.height) {
  1411. // System.out.println("4"+class9_1.tooltip + ", " +
  1412. // class9_1.interfaceID);
  1413. menuActionName[menuActionRow] = class9_1.tooltip + ", "
  1414. + class9_1.id;
  1415. menuActionID[menuActionRow] = 679;
  1416. menuActionCmd3[menuActionRow] = class9_1.id;
  1417. menuActionRow++;
  1418. }
  1419. if (k >= i2 && i1 >= j2
  1420. && k < i2 + (class9_1.type == 4 ? 100 : class9_1.width)
  1421. && i1 < j2 + class9_1.height) {
  1422. if (class9_1.actions != null) {
  1423. if ((class9_1.type == 4 && class9_1.message.length() > 0)
  1424. || class9_1.type == 5) {
  1425. for (int action = class9_1.actions.length - 1; action >= 0; action--) {
  1426. if (class9_1.actions[action] != null) {
  1427. menuActionName[menuActionRow] = class9_1.actions[action]
  1428. + (class9_1.type == 4 ? " "
  1429. + class9_1.message : "");
  1430. menuActionID[menuActionRow] = 647;
  1431. menuActionCmd2[menuActionRow] = action;
  1432. menuActionCmd3[menuActionRow] = class9_1.id;
  1433. menuActionRow++;
  1434. }
  1435. }
  1436. }
  1437. }
  1438. }
  1439. if (class9_1.type == 2) {
  1440. int k2 = 0;
  1441. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1442. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1443. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1444. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1445. if (k2 < 20) {
  1446. j3 += class9_1.spritesX[k2];
  1447. k3 += class9_1.spritesY[k2];
  1448. }
  1449. if (k >= j3 && i1 >= k3 && k < j3 + 32
  1450. && i1 < k3 + 32) {
  1451. mouseInvInterfaceIndex = k2;
  1452. lastActiveInvInterface = class9_1.id;
  1453. if (class9_1.inv[k2] > 0) {
  1454. ItemDef itemDef = ItemDef
  1455. .forID(class9_1.inv[k2] - 1);
  1456. if (itemSelected == 1
  1457. && class9_1.isInventoryInterface) {
  1458. if (class9_1.id != anInt1284
  1459. || k2 != anInt1283) {
  1460. menuActionName[menuActionRow] = "Use "
  1461. + selectedItemName
  1462. + " with @lre@"
  1463. + itemDef.name;
  1464. menuActionID[menuActionRow] = 870;
  1465. menuActionCmd1[menuActionRow] = itemDef.id;
  1466. menuActionCmd2[menuActionRow] = k2;
  1467. menuActionCmd3[menuActionRow] = class9_1.id;
  1468. menuActionRow++;
  1469. }
  1470. } else if (spellSelected == 1
  1471. && class9_1.isInventoryInterface) {
  1472. if ((spellUsableOn & 0x10) == 16) {
  1473. menuActionName[menuActionRow] = spellTooltip
  1474. + " @lre@" + itemDef.name;
  1475. menuActionID[menuActionRow] = 543;
  1476. menuActionCmd1[menuActionRow] = itemDef.id;
  1477. menuActionCmd2[menuActionRow] = k2;
  1478. menuActionCmd3[menuActionRow] = class9_1.id;
  1479. menuActionRow++;
  1480. }
  1481. } else {
  1482. if (class9_1.isInventoryInterface) {
  1483. for (int l3 = 4; l3 >= 3; l3--)
  1484. if (itemDef.itemActions != null
  1485. && itemDef.itemActions[l3] != null) {
  1486. menuActionName[menuActionRow] = itemDef.itemActions[l3]
  1487. + " @lre@"
  1488. + itemDef.name;
  1489. if (l3 == 3)
  1490. menuActionID[menuActionRow] = 493;
  1491. if (l3 == 4)
  1492. menuActionID[menuActionRow] = 847;
  1493. menuActionCmd1[menuActionRow] = itemDef.id;
  1494. menuActionCmd2[menuActionRow] = k2;
  1495. menuActionCmd3[menuActionRow] = class9_1.id;
  1496. menuActionRow++;
  1497. } else if (l3 == 4) {
  1498. menuActionName[menuActionRow] = "Drop @lre@"
  1499. + itemDef.name;
  1500. menuActionID[menuActionRow] = 847;
  1501. menuActionCmd1[menuActionRow] = itemDef.id;
  1502. menuActionCmd2[menuActionRow] = k2;
  1503. menuActionCmd3[menuActionRow] = class9_1.id;
  1504. menuActionRow++;
  1505. }
  1506.  
  1507. }
  1508. if (class9_1.usableItemInterface) {
  1509. menuActionName[menuActionRow] = "Use @lre@"
  1510. + itemDef.name;
  1511. menuActionID[menuActionRow] = 447;
  1512. menuActionCmd1[menuActionRow] = itemDef.id;
  1513. menuActionCmd2[menuActionRow] = k2;
  1514. menuActionCmd3[menuActionRow] = class9_1.id;
  1515. menuActionRow++;
  1516. }
  1517. if (class9_1.isInventoryInterface
  1518. && itemDef.itemActions != null) {
  1519. for (int i4 = 2; i4 >= 0; i4--)
  1520. if (itemDef.itemActions[i4] != null) {
  1521. menuActionName[menuActionRow] = itemDef.itemActions[i4]
  1522. + " @lre@"
  1523. + itemDef.name;
  1524. if (i4 == 0)
  1525. menuActionID[menuActionRow] = 74;
  1526. if (i4 == 1)
  1527. menuActionID[menuActionRow] = 454;
  1528. if (i4 == 2)
  1529. menuActionID[menuActionRow] = 539;
  1530. menuActionCmd1[menuActionRow] = itemDef.id;
  1531. menuActionCmd2[menuActionRow] = k2;
  1532. menuActionCmd3[menuActionRow] = class9_1.id;
  1533. menuActionRow++;
  1534. }
  1535.  
  1536. }
  1537. if (class9_1.actions != null) {
  1538. for (int j4 = 4; j4 >= 0; j4--)
  1539. if (class9_1.actions[j4] != null) {
  1540. menuActionName[menuActionRow] = class9_1.actions[j4]
  1541. + " @lre@"
  1542. + itemDef.name;
  1543. if (j4 == 0)
  1544. menuActionID[menuActionRow] = 632;
  1545. if (j4 == 1)
  1546. menuActionID[menuActionRow] = 78;
  1547. if (j4 == 2)
  1548. menuActionID[menuActionRow] = 867;
  1549. if (j4 == 3)
  1550. menuActionID[menuActionRow] = 431;
  1551. if (j4 == 4)
  1552. menuActionID[menuActionRow] = 53;
  1553. menuActionCmd1[menuActionRow] = itemDef.id;
  1554. menuActionCmd2[menuActionRow] = k2;
  1555. menuActionCmd3[menuActionRow] = class9_1.id;
  1556. menuActionRow++;
  1557. }
  1558.  
  1559. }
  1560. // menuActionName[menuActionRow] =
  1561. // "Examine @lre@" + itemDef.name +
  1562. // " @gre@(@whi@" + (class9_1.inv[k2] -
  1563. // 1) + "@gre@)";
  1564. menuActionName[menuActionRow] = "Examine @lre@"
  1565. + itemDef.name;
  1566. menuActionID[menuActionRow] = 1125;
  1567. menuActionCmd1[menuActionRow] = itemDef.id;
  1568. menuActionCmd2[menuActionRow] = k2;
  1569. menuActionCmd3[menuActionRow] = class9_1.id;
  1570. menuActionRow++;
  1571. }
  1572. }
  1573. }
  1574. k2++;
  1575. }
  1576.  
  1577. }
  1578.  
  1579. }
  1580. }
  1581. }
  1582.  
  1583. }
  1584.  
  1585. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1586. scrollBar1.method361(i1, l);
  1587. scrollBar2.method361(i1, (l + j) - 16);
  1588. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1589. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1590. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1591. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1592. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1593. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1594. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1595. int k1 = ((j - 32) * j) / j1;
  1596. if (k1 < 8)
  1597. k1 = 8;
  1598. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1599. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1600. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1601. DrawingArea.method341(l + 16 + l1, 0x8d8269, k1, i1 + 1);
  1602. DrawingArea.method341(l + 16 + l1, 0x6a614d, k1, i1 + 2);
  1603. DrawingArea.method341(l + 16 + l1, 0x706651, k1, i1 + 3);
  1604. DrawingArea.method341(l + 16 + l1, 0x706651, k1, i1 + 4);
  1605. DrawingArea.method341(l + 16 + l1, 0x6a614d, k1, i1 + 5);
  1606. DrawingArea.method341(l + 16 + l1, 0x6a614d, k1, i1 + 6);
  1607. DrawingArea.method341(l + 16 + l1, 0x685e4b, k1, i1 + 7);
  1608. DrawingArea.method341(l + 16 + l1, 0x685e4b, k1, i1 + 8);
  1609. DrawingArea.method341(l + 16 + l1, 0x665d4a, k1, i1 + 9);
  1610. DrawingArea.method341(l + 16 + l1, 0x665d4a, k1, i1 + 10);
  1611. DrawingArea.method341(l + 16 + l1, 0x58503f, k1, i1 + 11);
  1612. DrawingArea.method341(l + 16 + l1, 0x58503f, k1, i1 + 12);
  1613. DrawingArea.method341(l + 16 + l1, 0x544c3c, k1, i1 + 13);
  1614. DrawingArea.method341(l + 16 + l1, 0x4b4535, k1, i1 + 14);
  1615. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1616. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1617. DrawingArea.method339(l + 17 + l1, 0x6a614d, 14, i1);
  1618. DrawingArea.method339(l + 17 + l1, 0x706651, 13, i1);
  1619. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1620. DrawingArea.method339(l + 17 + l1, 0x6a614d, 10, i1);
  1621. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1622. DrawingArea.method339(l + 17 + l1, 0x7d715b, 5, i1);
  1623. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1624. DrawingArea.method339(l + 17 + l1, 0x8d8269, 3, i1);
  1625. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1626. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1627. DrawingArea.method339(l + 18 + l1, 0x625946, 15, i1);
  1628. DrawingArea.method339(l + 18 + l1, 0x665d4a, 14, i1);
  1629. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1630. DrawingArea.method339(l + 18 + l1, 0x6a614d, 10, i1);
  1631. DrawingArea.method339(l + 18 + l1, 0x706651, 7, i1);
  1632. DrawingArea.method339(l + 18 + l1, 0x726954, 5, i1);
  1633. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1634. DrawingArea.method339(l + 18 + l1, 0x7d715b, 3, i1);
  1635. DrawingArea.method339(l + 18 + l1, 0x8d8269, 2, i1);
  1636. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1637. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1638. DrawingArea.method339(l + 19 + l1, 0x544c3c, 15, i1);
  1639. DrawingArea.method339(l + 19 + l1, 0x625946, 14, i1);
  1640. DrawingArea.method339(l + 19 + l1, 0x665d4a, 11, i1);
  1641. DrawingArea.method339(l + 19 + l1, 0x685e4b, 9, i1);
  1642. DrawingArea.method339(l + 19 + l1, 0x6a614d, 7, i1);
  1643. DrawingArea.method339(l + 19 + l1, 0x706651, 5, i1);
  1644. DrawingArea.method339(l + 19 + l1, 0x726954, 4, i1);
  1645. DrawingArea.method339(l + 19 + l1, 0x6a614d, 3, i1);
  1646. DrawingArea.method339(l + 19 + l1, 0x8d8269, 2, i1);
  1647. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1648. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1649. DrawingArea.method339(l + 20 + l1, 0x4b4535, 15, i1);
  1650. DrawingArea.method339(l + 20 + l1, 0x4f4839, 14, i1);
  1651. DrawingArea.method339(l + 20 + l1, 0x58503f, 13, i1);
  1652. DrawingArea.method339(l + 20 + l1, 0x665d4a, 10, i1);
  1653. DrawingArea.method339(l + 20 + l1, 0x685e4b, 8, i1);
  1654. DrawingArea.method339(l + 20 + l1, 0x6a614d, 6, i1);
  1655. DrawingArea.method339(l + 20 + l1, 0x706651, 4, i1);
  1656. DrawingArea.method339(l + 20 + l1, 0x6a614d, 3, i1);
  1657. DrawingArea.method339(l + 20 + l1, 0x8d8269, 2, i1);
  1658. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1659. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1660. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1661. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1662. DrawingArea.method339(l + 14 + l1 + k1, 0x413a2e, 14, i1);
  1663. DrawingArea.method339(l + 14 + l1 + k1, 0x453d31, 10, i1);
  1664. DrawingArea.method339(l + 14 + l1 + k1, 0x4f4839, 9, i1);
  1665. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1666. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4535, 4, i1);
  1667. DrawingArea.method339(l + 14 + l1 + k1, 0x625946, 3, i1);
  1668. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1669. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1670. DrawingArea.method339(l + 13 + l1 + k1, 0x453d31, 15, i1);
  1671. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4535, 11, i1);
  1672. DrawingArea.method339(l + 13 + l1 + k1, 0x544c3c, 9, i1);
  1673. DrawingArea.method339(l + 13 + l1 + k1, 0x4f4839, 7, i1);
  1674. DrawingArea.method339(l + 13 + l1 + k1, 0x625946, 6, i1);
  1675. DrawingArea.method339(l + 13 + l1 + k1, 0x58503f, 4, i1);
  1676. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1677. DrawingArea.method339(l + 13 + l1 + k1, 0x706651, 2, i1);
  1678. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1679. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1680. DrawingArea.method339(l + 12 + l1 + k1, 0x453d31, 15, i1);
  1681. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4535, 14, i1);
  1682. DrawingArea.method339(l + 12 + l1 + k1, 0x4f4839, 12, i1);
  1683. DrawingArea.method339(l + 12 + l1 + k1, 0x625946, 11, i1);
  1684. DrawingArea.method339(l + 12 + l1 + k1, 0x58503f, 10, i1);
  1685. DrawingArea.method339(l + 12 + l1 + k1, 0x665d4a, 7, i1);
  1686. DrawingArea.method339(l + 12 + l1 + k1, 0x685e4b, 4, i1);
  1687. DrawingArea.method339(l + 12 + l1 + k1, 0x726954, 3, i1);
  1688. DrawingArea.method339(l + 12 + l1 + k1, 0x7d715b, 2, i1);
  1689. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1690. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1691. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4535, 15, i1);
  1692. DrawingArea.method339(l + 11 + l1 + k1, 0x544c3c, 14, i1);
  1693. DrawingArea.method339(l + 11 + l1 + k1, 0x625946, 13, i1);
  1694. DrawingArea.method339(l + 11 + l1 + k1, 0x58503f, 11, i1);
  1695. DrawingArea.method339(l + 11 + l1 + k1, 0x665d4a, 9, i1);
  1696. DrawingArea.method339(l + 11 + l1 + k1, 0x685e4b, 7, i1);
  1697. DrawingArea.method339(l + 11 + l1 + k1, 0x6a614d, 5, i1);
  1698. DrawingArea.method339(l + 11 + l1 + k1, 0x706651, 4, i1);
  1699. DrawingArea.method339(l + 11 + l1 + k1, 0x6a614d, 3, i1);
  1700. DrawingArea.method339(l + 11 + l1 + k1, 0x7d715b, 2, i1);
  1701. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1702. }
  1703.  
  1704. private void updateNPCs(Stream stream, int i) {
  1705. anInt839 = 0;
  1706. anInt893 = 0;
  1707. method139(stream);
  1708. method46(i, stream);
  1709. method86(stream);
  1710. for (int k = 0; k < anInt839; k++) {
  1711. int l = anIntArray840[k];
  1712. if (npcArray[l].anInt1537 != loopCycle) {
  1713. npcArray[l].desc = null;
  1714. npcArray[l] = null;
  1715. }
  1716. }
  1717.  
  1718. if (stream.currentOffset != i) {
  1719. signlink.reporterror(myUsername
  1720. + " size mismatch in getnpcpos - pos:"
  1721. + stream.currentOffset + " psize:" + i);
  1722. throw new RuntimeException("eek");
  1723. }
  1724. for (int i1 = 0; i1 < npcCount; i1++)
  1725. if (npcArray[npcIndices[i1]] == null) {
  1726. signlink.reporterror(myUsername
  1727. + " null entry in npc list - pos:" + i1 + " size:"
  1728. + npcCount);
  1729. throw new RuntimeException("eek");
  1730. }
  1731.  
  1732. }
  1733.  
  1734. private int cButtonHPos;
  1735. private int cButtonHCPos;
  1736. private int cButtonCPos;
  1737.  
  1738. private void processChatModeClick() {
  1739. if (super.mouseX >= 6 && super.mouseX <= 62 && super.mouseY >= 482
  1740. && super.mouseY <= 505) {
  1741. cButtonHPos = 0;
  1742. aBoolean1233 = true;
  1743. inputTaken = true;
  1744. } else if (super.mouseX >= 63 && super.mouseX <= 118
  1745. && super.mouseY >= 482 && super.mouseY <= 505) {
  1746. cButtonHPos = 1;
  1747. aBoolean1233 = true;
  1748. inputTaken = true;
  1749. } else if (super.mouseX >= 119 && super.mouseX <= 175
  1750. && super.mouseY >= 482 && super.mouseY <= 505) {
  1751. cButtonHPos = 2;
  1752. aBoolean1233 = true;
  1753. inputTaken = true;
  1754. } else if (super.mouseX >= 177 && super.mouseX <= 232
  1755. && super.mouseY >= 482 && super.mouseY <= 505) {
  1756. cButtonHPos = 3;
  1757. aBoolean1233 = true;
  1758. inputTaken = true;
  1759. } else if (super.mouseX >= 233 && super.mouseX <= 289
  1760. && super.mouseY >= 482 && super.mouseY <= 505) {
  1761. cButtonHPos = 4;
  1762. aBoolean1233 = true;
  1763. inputTaken = true;
  1764. } else if (super.mouseX >= 290 && super.mouseX <= 346
  1765. && super.mouseY >= 482 && super.mouseY <= 505) {
  1766. cButtonHPos = 5;
  1767. aBoolean1233 = true;
  1768. inputTaken = true;
  1769. } else if (super.mouseX >= 347 && super.mouseX <= 403
  1770. && super.mouseY >= 482 && super.mouseY <= 505) {
  1771. cButtonHPos = 6;
  1772. aBoolean1233 = true;
  1773. inputTaken = true;
  1774. } else if (super.mouseX >= 404 && super.mouseX <= 515
  1775. && super.mouseY >= 482 && super.mouseY <= 505) {
  1776. cButtonHPos = 7;
  1777. aBoolean1233 = true;
  1778. inputTaken = true;
  1779. } else {
  1780. cButtonHPos = -1;
  1781. aBoolean1233 = true;
  1782. inputTaken = true;
  1783. }
  1784.  
  1785. if (super.clickMode3 == 1) {
  1786. if (super.saveClickX >= 6 && super.saveClickX <= 62
  1787. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1788. cButtonCPos = 0;
  1789. chatTypeView = 0;
  1790. aBoolean1233 = true;
  1791. inputTaken = true;
  1792. }
  1793. if (super.saveClickX >= 63 && super.saveClickX <= 118
  1794. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1795. cButtonCPos = 1;
  1796. chatTypeView = 5;
  1797. aBoolean1233 = true;
  1798. inputTaken = true;
  1799. }
  1800. if (super.saveClickX >= 119 && super.saveClickX <= 175
  1801. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1802. cButtonCPos = 2;
  1803. chatTypeView = 1;
  1804. aBoolean1233 = true;
  1805. inputTaken = true;
  1806. }
  1807. if (super.saveClickX >= 177 && super.saveClickX <= 232
  1808. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1809. cButtonCPos = 3;
  1810. chatTypeView = 2;
  1811. aBoolean1233 = true;
  1812. inputTaken = true;
  1813. }
  1814. if (super.saveClickX >= 233 && super.saveClickX <= 289
  1815. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1816. cButtonCPos = 4;
  1817. chatTypeView = 11;
  1818. aBoolean1233 = true;
  1819. inputTaken = true;
  1820. }
  1821. if (super.saveClickX >= 290 && super.saveClickX <= 346
  1822. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1823. cButtonCPos = 5;
  1824. chatTypeView = 3;
  1825. aBoolean1233 = true;
  1826. inputTaken = true;
  1827. }
  1828. if (super.saveClickX >= 347 && super.saveClickX <= 403
  1829. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1830. cButtonCPos = 6;
  1831. chatTypeView = 4;
  1832. aBoolean1233 = true;
  1833. inputTaken = true;
  1834. }
  1835. if (super.saveClickX >= 404 && super.saveClickX <= 515
  1836. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1837. if (openInterfaceID == -1) {
  1838. clearTopInterfaces();
  1839. reportAbuseInput = "";
  1840. canMute = false;
  1841. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1842. if (RSInterface.interfaceCache[i] == null
  1843. || RSInterface.interfaceCache[i].contentType != 600)
  1844. continue;
  1845. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1846. break;
  1847. }
  1848.  
  1849. } else {
  1850. pushMessage(
  1851. "Please close the interface you have open before using 'report abuse'",
  1852. 0, "");
  1853. }
  1854. }
  1855. }
  1856. }
  1857.  
  1858. private void method33(int i) {
  1859. int j = Varp.cache[i].anInt709;
  1860. if (j == 0)
  1861. return;
  1862. int k = variousSettings[i];
  1863. if (j == 1) {
  1864. if (k == 1)
  1865. Texture.method372(0.90000000000000002D);
  1866. if (k == 2)
  1867. Texture.method372(0.80000000000000004D);
  1868. if (k == 3)
  1869. Texture.method372(0.69999999999999996D);
  1870. if (k == 4)
  1871. Texture.method372(0.59999999999999998D);
  1872. ItemDef.mruNodes1.unlinkAll();
  1873. welcomeScreenRaised = true;
  1874. }
  1875. if (j == 3) {
  1876. boolean flag1 = musicEnabled;
  1877. if (k == 0) {
  1878. adjustVolume(musicEnabled, 0);
  1879. musicEnabled = true;
  1880. }
  1881. if (k == 1) {
  1882. adjustVolume(musicEnabled, -400);
  1883. musicEnabled = true;
  1884. }
  1885. if (k == 2) {
  1886. adjustVolume(musicEnabled, -800);
  1887. musicEnabled = true;
  1888. }
  1889. if (k == 3) {
  1890. adjustVolume(musicEnabled, -1200);
  1891. musicEnabled = true;
  1892. }
  1893. if (k == 4)
  1894. musicEnabled = false;
  1895. if (musicEnabled != flag1 && !lowMem) {
  1896. if (musicEnabled) {
  1897. nextSong = currentSong;
  1898. songChanging = true;
  1899. onDemandFetcher.method558(2, nextSong);
  1900. } else {
  1901. stopMidi();
  1902. }
  1903. prevSong = 0;
  1904. }
  1905. }
  1906. if (j == 4) {
  1907. if (k == 0) {
  1908. aBoolean848 = true;
  1909. setWaveVolume(0);
  1910. }
  1911. if (k == 1) {
  1912. aBoolean848 = true;
  1913. setWaveVolume(-400);
  1914. }
  1915. if (k == 2) {
  1916. aBoolean848 = true;
  1917. setWaveVolume(-800);
  1918. }
  1919. if (k == 3) {
  1920. aBoolean848 = true;
  1921. setWaveVolume(-1200);
  1922. }
  1923. if (k == 4)
  1924. aBoolean848 = false;
  1925. }
  1926. if (j == 5)
  1927. anInt1253 = k;
  1928. if (j == 6)
  1929. anInt1249 = k;
  1930. if (j == 8) {
  1931. splitPrivateChat = k;
  1932. inputTaken = true;
  1933. }
  1934. if (j == 9)
  1935. anInt913 = k;
  1936. }
  1937.  
  1938. private void updateEntities() {
  1939. try {
  1940. int anInt974 = 0;
  1941. for (int j = -1; j < playerCount + npcCount; j++) {
  1942. Object obj;
  1943. if (j == -1)
  1944. obj = myPlayer;
  1945. else if (j < playerCount)
  1946. obj = playerArray[playerIndices[j]];
  1947. else
  1948. obj = npcArray[npcIndices[j - playerCount]];
  1949. if (obj == null || !((Entity) (obj)).isVisible())
  1950. continue;
  1951. if (obj instanceof NPC) {
  1952. EntityDef entityDef = ((NPC) obj).desc;
  1953. if (entityDef.childrenIDs != null)
  1954. entityDef = entityDef.method161();
  1955. if (entityDef == null)
  1956. continue;
  1957. }
  1958. if (j < playerCount) {
  1959. int l = 30;
  1960. Player player = (Player) obj;
  1961. if (player.headIcon >= 0) {
  1962. npcScreenPos(((Entity) (obj)),
  1963. ((Entity) (obj)).height + 15);
  1964. if (spriteDrawX > -1) {
  1965. if (player.skullIcon < 2) {
  1966. skullIcons[player.skullIcon].drawSprite(
  1967. spriteDrawX - 12, spriteDrawY - l);
  1968. l += 25;
  1969. }
  1970. if (player.headIcon < 7) {
  1971. headIcons[player.headIcon].drawSprite(
  1972. spriteDrawX - 12, spriteDrawY - l);
  1973. l += 18;
  1974. }
  1975. }
  1976. }
  1977. if (j >= 0 && anInt855 == 10
  1978. && anInt933 == playerIndices[j]) {
  1979. npcScreenPos(((Entity) (obj)),
  1980. ((Entity) (obj)).height + 15);
  1981. if (spriteDrawX > -1)
  1982. headIconsHint[player.hintIcon].drawSprite(
  1983. spriteDrawX - 12, spriteDrawY - l);
  1984. }
  1985. } else {
  1986. EntityDef entityDef_1 = ((NPC) obj).desc;
  1987. if (entityDef_1.anInt75 >= 0
  1988. && entityDef_1.anInt75 < headIcons.length) {
  1989. npcScreenPos(((Entity) (obj)),
  1990. ((Entity) (obj)).height + 15);
  1991. if (spriteDrawX > -1)
  1992. headIcons[entityDef_1.anInt75].drawSprite(
  1993. spriteDrawX - 12, spriteDrawY - 30);
  1994. }
  1995. if (anInt855 == 1
  1996. && anInt1222 == npcIndices[j - playerCount]
  1997. && loopCycle % 20 < 10) {
  1998. npcScreenPos(((Entity) (obj)),
  1999. ((Entity) (obj)).height + 15);
  2000. if (spriteDrawX > -1)
  2001. headIconsHint[0].drawSprite(spriteDrawX - 12,
  2002. spriteDrawY - 28);
  2003. }
  2004. }
  2005. if (((Entity) (obj)).textSpoken != null
  2006. && (j >= playerCount || publicChatMode == 0
  2007. || publicChatMode == 3 || publicChatMode == 1
  2008. && isFriendOrSelf(((Player) obj).name))) {
  2009. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2010. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2011. anIntArray979[anInt974] = chatTextDrawingArea
  2012. .method384(((Entity) (obj)).textSpoken) / 2;
  2013. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2014. anIntArray976[anInt974] = spriteDrawX;
  2015. anIntArray977[anInt974] = spriteDrawY;
  2016. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2017. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2018. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2019. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2020. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  2021. && ((Entity) (obj)).anInt1531 <= 3) {
  2022. anIntArray978[anInt974] += 10;
  2023. anIntArray977[anInt974] += 5;
  2024. }
  2025. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2026. anIntArray979[anInt974] = 60;
  2027. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2028. anIntArray978[anInt974] += 5;
  2029. }
  2030. }
  2031. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2032. try {
  2033. npcScreenPos(((Entity) (obj)),
  2034. ((Entity) (obj)).height + 15);
  2035. if (spriteDrawX > -1) {
  2036. int i1 = (((Entity) (obj)).currentHealth * 30)
  2037. / ((Entity) (obj)).maxHealth;
  2038. if (i1 > 30) {
  2039. i1 = 30;
  2040. }
  2041. int HpPercent = (((Entity) (obj)).currentHealth * 56)
  2042. / ((Entity) (obj)).maxHealth;
  2043. if (HpPercent > 56) {
  2044. HpPercent = 56;
  2045. }
  2046. HPBarEmpty.drawSprite(spriteDrawX - 28,
  2047. spriteDrawY - 5);
  2048. HPBarFull = new Sprite(Sprite.location
  2049. + "orbs/HP 0.png", HpPercent, 7);
  2050. HPBarFull.drawSprite(spriteDrawX - 28,
  2051. spriteDrawY - 5);
  2052. // DrawingArea.drawPixels(5, spriteDrawY - 3,
  2053. // spriteDrawX - 15, 65280, i1);
  2054. // DrawingArea.drawPixels(5, spriteDrawY - 3,
  2055. // (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2056. }
  2057. } catch (Exception e) {
  2058. }
  2059. }
  2060. for (int j1 = 0; j1 < 4; j1++)
  2061. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2062. npcScreenPos(((Entity) (obj)),
  2063. ((Entity) (obj)).height / 2);
  2064. if (spriteDrawX > -1) {
  2065. if (j1 == 1)
  2066. spriteDrawY -= 20;
  2067. if (j1 == 2) {
  2068. spriteDrawX -= 15;
  2069. spriteDrawY -= 10;
  2070. }
  2071. if (j1 == 3) {
  2072. spriteDrawX += 15;
  2073. spriteDrawY -= 10;
  2074. }
  2075. hitMarks[((Entity) (obj)).hitMarkTypes[j1]]
  2076. .drawSprite(spriteDrawX - 12,
  2077. spriteDrawY - 12);
  2078. smallText.drawText(0, String
  2079. .valueOf(((Entity) (obj)).hitArray[j1]),
  2080. spriteDrawY + 4, spriteDrawX);
  2081. smallText.drawText(0xffffff, String
  2082. .valueOf(((Entity) (obj)).hitArray[j1]),
  2083. spriteDrawY + 3, spriteDrawX - 1);
  2084. }
  2085. }
  2086.  
  2087. }
  2088. for (int k = 0; k < anInt974; k++) {
  2089. int k1 = anIntArray976[k];
  2090. int l1 = anIntArray977[k];
  2091. int j2 = anIntArray979[k];
  2092. int k2 = anIntArray978[k];
  2093. boolean flag = true;
  2094. while (flag) {
  2095. flag = false;
  2096. for (int l2 = 0; l2 < k; l2++)
  2097. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2]
  2098. && l1 - k2 < anIntArray977[l2] + 2
  2099. && k1 - j2 < anIntArray976[l2]
  2100. + anIntArray979[l2]
  2101. && k1 + j2 > anIntArray976[l2]
  2102. - anIntArray979[l2]
  2103. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  2104. l1 = anIntArray977[l2] - anIntArray978[l2];
  2105. flag = true;
  2106. }
  2107.  
  2108. }
  2109. spriteDrawX = anIntArray976[k];
  2110. spriteDrawY = anIntArray977[k] = l1;
  2111. String s = aStringArray983[k];
  2112. if (anInt1249 == 0) {
  2113. int i3 = 0xffff00;
  2114. if (anIntArray980[k] < 6)
  2115. i3 = anIntArray965[anIntArray980[k]];
  2116. if (anIntArray980[k] == 6)
  2117. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2118. if (anIntArray980[k] == 7)
  2119. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2120. if (anIntArray980[k] == 8)
  2121. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2122. if (anIntArray980[k] == 9) {
  2123. int j3 = 150 - anIntArray982[k];
  2124. if (j3 < 50)
  2125. i3 = 0xff0000 + 1280 * j3;
  2126. else if (j3 < 100)
  2127. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2128. else if (j3 < 150)
  2129. i3 = 65280 + 5 * (j3 - 100);
  2130. }
  2131. if (anIntArray980[k] == 10) {
  2132. int k3 = 150 - anIntArray982[k];
  2133. if (k3 < 50)
  2134. i3 = 0xff0000 + 5 * k3;
  2135. else if (k3 < 100)
  2136. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2137. else if (k3 < 150)
  2138. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2139. }
  2140. if (anIntArray980[k] == 11) {
  2141. int l3 = 150 - anIntArray982[k];
  2142. if (l3 < 50)
  2143. i3 = 0xffffff - 0x50005 * l3;
  2144. else if (l3 < 100)
  2145. i3 = 65280 + 0x50005 * (l3 - 50);
  2146. else if (l3 < 150)
  2147. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2148. }
  2149. if (anIntArray981[k] == 0) {
  2150. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2151. spriteDrawX);
  2152. chatTextDrawingArea.drawText(i3, s, spriteDrawY,
  2153. spriteDrawX);
  2154. }
  2155. if (anIntArray981[k] == 1) {
  2156. chatTextDrawingArea.method386(0, s, spriteDrawX,
  2157. anInt1265, spriteDrawY + 1);
  2158. chatTextDrawingArea.method386(i3, s, spriteDrawX,
  2159. anInt1265, spriteDrawY);
  2160. }
  2161. if (anIntArray981[k] == 2) {
  2162. chatTextDrawingArea.method387(spriteDrawX, s,
  2163. anInt1265, spriteDrawY + 1, 0);
  2164. chatTextDrawingArea.method387(spriteDrawX, s,
  2165. anInt1265, spriteDrawY, i3);
  2166. }
  2167. if (anIntArray981[k] == 3) {
  2168. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2169. s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2170. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2171. s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2172. }
  2173. if (anIntArray981[k] == 4) {
  2174. int i4 = chatTextDrawingArea.method384(s);
  2175. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2176. DrawingArea.setDrawingArea(334, spriteDrawX - 50,
  2177. spriteDrawX + 50, 0);
  2178. chatTextDrawingArea.method385(0, s, spriteDrawY + 1,
  2179. (spriteDrawX + 50) - k4);
  2180. chatTextDrawingArea.method385(i3, s, spriteDrawY,
  2181. (spriteDrawX + 50) - k4);
  2182. DrawingArea.defaultDrawingAreaSize();
  2183. }
  2184. if (anIntArray981[k] == 5) {
  2185. int j4 = 150 - anIntArray982[k];
  2186. int l4 = 0;
  2187. if (j4 < 25)
  2188. l4 = j4 - 25;
  2189. else if (j4 > 125)
  2190. l4 = j4 - 125;
  2191. DrawingArea
  2192. .setDrawingArea(spriteDrawY + 5, 0, 512,
  2193. spriteDrawY
  2194. - chatTextDrawingArea.anInt1497
  2195. - 1);
  2196. chatTextDrawingArea.drawText(0, s,
  2197. spriteDrawY + 1 + l4, spriteDrawX);
  2198. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4,
  2199. spriteDrawX);
  2200. DrawingArea.defaultDrawingAreaSize();
  2201. }
  2202. } else {
  2203. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2204. spriteDrawX);
  2205. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY,
  2206. spriteDrawX);
  2207. }
  2208. }
  2209. } catch (Exception e) {
  2210. }
  2211.  
  2212. }
  2213.  
  2214. private void delFriend(long l) {
  2215. try {
  2216. if (l == 0L)
  2217. return;
  2218. for (int i = 0; i < friendsCount; i++) {
  2219. if (friendsListAsLongs[i] != l)
  2220. continue;
  2221. friendsCount--;
  2222. needDrawTabArea = true;
  2223. for (int j = i; j < friendsCount; j++) {
  2224. friendsList[j] = friendsList[j + 1];
  2225. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2226. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2227. }
  2228.  
  2229. stream.createFrame(215);
  2230. stream.writeQWord(l);
  2231. break;
  2232. }
  2233. } catch (RuntimeException runtimeexception) {
  2234. signlink.reporterror("18622, " + false + ", " + l + ", "
  2235. + runtimeexception.toString());
  2236. throw new RuntimeException();
  2237. }
  2238. }
  2239.  
  2240. public void drawSideIcons() { /* Top sideIcons */
  2241. if (tabInterfaceIDs[0] != -1 && anInt1054 == 0)
  2242. if (loopCycle % 20 >= 10)
  2243. ;
  2244. sideIcons[0].drawSprite(10, 4);
  2245. if (tabInterfaceIDs[1] != -1 && anInt1054 == 1)
  2246. if (loopCycle % 20 >= 10)
  2247. ;
  2248. sideIcons[1].drawSprite(43, 4);
  2249. if (tabInterfaceIDs[2] != -1 && anInt1054 == 2)
  2250. if (loopCycle % 20 >= 10)
  2251. ;
  2252. sideIcons[2].drawSprite(76, 3);
  2253. if (tabInterfaceIDs[3] != -1 && anInt1054 == 3)
  2254. if (loopCycle % 20 >= 10)
  2255. ;
  2256. sideIcons[3].drawSprite(111, 5);
  2257. if (tabInterfaceIDs[4] != -1 && anInt1054 == 4)
  2258. if (loopCycle % 20 >= 10)
  2259. ;
  2260. sideIcons[4].drawSprite(140, 1);
  2261. if (tabInterfaceIDs[5] != -1 && anInt1054 == 5)
  2262. if (loopCycle % 20 >= 10)
  2263. ;
  2264. sideIcons[5].drawSprite(174, 1);
  2265. if (tabInterfaceIDs[6] != -1 && anInt1054 == 6)
  2266. if (loopCycle % 20 >= 10)
  2267. ;
  2268. sideIcons[6].drawSprite(209, 5); /* Bottom sideIcons */
  2269. if (tabInterfaceIDs[7] != -1 && anInt1054 == 7)
  2270. if (loopCycle % 20 >= 10)
  2271. ;
  2272. sideIcons[7].drawSprite(43, 302);
  2273. if (tabInterfaceIDs[8] != -1 && anInt1054 == 8)
  2274. if (loopCycle % 20 >= 10)
  2275. ;
  2276. sideIcons[8].drawSprite(76, 302);
  2277. if (tabInterfaceIDs[9] != -1 && anInt1054 == 9)
  2278. if (loopCycle % 20 >= 10)
  2279. ;
  2280. sideIcons[13].drawSprite(112, 304);
  2281. if (tabInterfaceIDs[10] != -1 && anInt1054 == 10)
  2282. if (loopCycle % 20 >= 10)
  2283. ;
  2284. sideIcons[10].drawSprite(143, 303);
  2285. if (tabInterfaceIDs[11] != -1 && anInt1054 == 11)
  2286. if (loopCycle % 20 >= 10)
  2287. ;
  2288. sideIcons[11].drawSprite(173, 300);
  2289. if (tabInterfaceIDs[12] != -1 && anInt1054 == 12)
  2290. if (loopCycle % 20 >= 10)
  2291. ;
  2292. sideIcons[12].drawSprite(206, 300);
  2293. sIcon.drawAdvancedSprite(-3, 285);
  2294. }
  2295.  
  2296. public void drawRedStones() {
  2297. if (tabInterfaceIDs[tabID] != -1) {
  2298. if (tabID == 0)
  2299. redStones[0].drawSprite(3, 0);
  2300. if (tabID == 1)
  2301. redStones[4].drawSprite(41, 0);
  2302. if (tabID == 2)
  2303. redStones[4].drawSprite(74, 0);
  2304. if (tabID == 3)
  2305. redStones[4].drawSprite(107, 0);
  2306. if (tabID == 4)
  2307. redStones[4].drawSprite(140, 0);
  2308. if (tabID == 5)
  2309. redStones[4].drawSprite(173, 0);
  2310. if (tabID == 6)
  2311. redStones[1].drawSprite(206, 0);
  2312. if (tabID == 7)
  2313. redStones[4].drawSprite(107, 298);
  2314. if (tabID == 8)
  2315. redStones[4].drawSprite(41, 298);
  2316. if (tabID == 9)
  2317. redStones[4].drawSprite(74, 298);
  2318. if (tabID == 11)
  2319. redStones[4].drawSprite(140, 298);
  2320. if (tabID == 12)
  2321. redStones[4].drawSprite(173, 298);
  2322. if (tabID == 13)
  2323. redStones[3].drawSprite(206, 298);
  2324. if (tabID == 14)
  2325. redStones[2].drawSprite(3, 298);
  2326. }
  2327. }
  2328.  
  2329. private void drawTabArea() {
  2330. aRSImageProducer_1163.initDrawingArea();
  2331. Texture.anIntArray1472 = anIntArray1181; /* Draws new tab area sprite */
  2332. tabArea.drawSprite(0, 0);
  2333. if (invOverlayInterfaceID == -1) {
  2334. drawRedStones();
  2335. drawSideIcons();
  2336. }
  2337. if (invOverlayInterfaceID != -1)
  2338. drawInterface(0, 28,
  2339. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2340. else if (tabInterfaceIDs[tabID] != -1)
  2341. drawInterface(0, 28,
  2342. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2343. if (menuOpen && menuScreenArea == 1)
  2344. drawMenu();
  2345. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2346. aRSImageProducer_1165.initDrawingArea();
  2347. Texture.anIntArray1472 = anIntArray1182;
  2348. }
  2349.  
  2350. private void method37(int j) {
  2351. if (!lowMem) {
  2352. if (Texture.anIntArray1480[17] >= j) {
  2353. Background background = Texture.aBackgroundArray1474s[17];
  2354. int k = background.anInt1452 * background.anInt1453 - 1;
  2355. int j1 = background.anInt1452 * anInt945 * 2;
  2356. byte abyte0[] = background.aByteArray1450;
  2357. byte abyte3[] = aByteArray912;
  2358. for (int i2 = 0; i2 <= k; i2++)
  2359. abyte3[i2] = abyte0[i2 - j1 & k];
  2360.  
  2361. background.aByteArray1450 = abyte3;
  2362. aByteArray912 = abyte0;
  2363. Texture.method370(17);
  2364. anInt854++;
  2365. if (anInt854 > 1235) {
  2366. anInt854 = 0;
  2367. stream.createFrame(226);
  2368. stream.writeWordBigEndian(0);
  2369. int l2 = stream.currentOffset;
  2370. stream.writeWord(58722);
  2371. stream.writeWordBigEndian(240);
  2372. stream.writeWord((int) (Math.random() * 65536D));
  2373. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2374. if ((int) (Math.random() * 2D) == 0)
  2375. stream.writeWord(51825);
  2376. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2377. stream.writeWord((int) (Math.random() * 65536D));
  2378. stream.writeWord(7130);
  2379. stream.writeWord((int) (Math.random() * 65536D));
  2380. stream.writeWord(61657);
  2381. stream.writeBytes(stream.currentOffset - l2);
  2382. }
  2383. }
  2384. if (Texture.anIntArray1480[24] >= j) {
  2385. Background background_1 = Texture.aBackgroundArray1474s[24];
  2386. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2387. int k1 = background_1.anInt1452 * anInt945 * 2;
  2388. byte abyte1[] = background_1.aByteArray1450;
  2389. byte abyte4[] = aByteArray912;
  2390. for (int j2 = 0; j2 <= l; j2++)
  2391. abyte4[j2] = abyte1[j2 - k1 & l];
  2392.  
  2393. background_1.aByteArray1450 = abyte4;
  2394. aByteArray912 = abyte1;
  2395. Texture.method370(24);
  2396. }
  2397. if (Texture.anIntArray1480[34] >= j) {
  2398. Background background_2 = Texture.aBackgroundArray1474s[34];
  2399. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2400. int l1 = background_2.anInt1452 * anInt945 * 2;
  2401. byte abyte2[] = background_2.aByteArray1450;
  2402. byte abyte5[] = aByteArray912;
  2403. for (int k2 = 0; k2 <= i1; k2++)
  2404. abyte5[k2] = abyte2[k2 - l1 & i1];
  2405.  
  2406. background_2.aByteArray1450 = abyte5;
  2407. aByteArray912 = abyte2;
  2408. Texture.method370(34);
  2409. }
  2410. }
  2411. }
  2412.  
  2413. private void method38() {
  2414. for (int i = -1; i < playerCount; i++) {
  2415. int j;
  2416. if (i == -1)
  2417. j = myPlayerIndex;
  2418. else
  2419. j = playerIndices[i];
  2420. Player player = playerArray[j];
  2421. if (player != null && player.textCycle > 0) {
  2422. player.textCycle--;
  2423. if (player.textCycle == 0)
  2424. player.textSpoken = null;
  2425. }
  2426. }
  2427.  
  2428. for (int k = 0; k < npcCount; k++) {
  2429. int l = npcIndices[k];
  2430. NPC npc = npcArray[l];
  2431. if (npc != null && npc.textCycle > 0) {
  2432. npc.textCycle--;
  2433. if (npc.textCycle == 0)
  2434. npc.textSpoken = null;
  2435. }
  2436. }
  2437.  
  2438. }
  2439.  
  2440. private void calcCameraPos() {
  2441. int i = anInt1098 * 128 + 64;
  2442. int j = anInt1099 * 128 + 64;
  2443. int k = method42(plane, j, i) - anInt1100;
  2444. if (xCameraPos < i) {
  2445. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2446. if (xCameraPos > i)
  2447. xCameraPos = i;
  2448. }
  2449. if (xCameraPos > i) {
  2450. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2451. if (xCameraPos < i)
  2452. xCameraPos = i;
  2453. }
  2454. if (zCameraPos < k) {
  2455. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2456. if (zCameraPos > k)
  2457. zCameraPos = k;
  2458. }
  2459. if (zCameraPos > k) {
  2460. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2461. if (zCameraPos < k)
  2462. zCameraPos = k;
  2463. }
  2464. if (yCameraPos < j) {
  2465. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2466. if (yCameraPos > j)
  2467. yCameraPos = j;
  2468. }
  2469. if (yCameraPos > j) {
  2470. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2471. if (yCameraPos < j)
  2472. yCameraPos = j;
  2473. }
  2474. i = anInt995 * 128 + 64;
  2475. j = anInt996 * 128 + 64;
  2476. k = method42(plane, j, i) - anInt997;
  2477. int l = i - xCameraPos;
  2478. int i1 = k - zCameraPos;
  2479. int j1 = j - yCameraPos;
  2480. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2481. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2482. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2483. if (l1 < 128)
  2484. l1 = 128;
  2485. if (l1 > 383)
  2486. l1 = 383;
  2487. if (yCameraCurve < l1) {
  2488. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2489. if (yCameraCurve > l1)
  2490. yCameraCurve = l1;
  2491. }
  2492. if (yCameraCurve > l1) {
  2493. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2494. if (yCameraCurve < l1)
  2495. yCameraCurve = l1;
  2496. }
  2497. int j2 = i2 - xCameraCurve;
  2498. if (j2 > 1024)
  2499. j2 -= 2048;
  2500. if (j2 < -1024)
  2501. j2 += 2048;
  2502. if (j2 > 0) {
  2503. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2504. xCameraCurve &= 0x7ff;
  2505. }
  2506. if (j2 < 0) {
  2507. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2508. xCameraCurve &= 0x7ff;
  2509. }
  2510. int k2 = i2 - xCameraCurve;
  2511. if (k2 > 1024)
  2512. k2 -= 2048;
  2513. if (k2 < -1024)
  2514. k2 += 2048;
  2515. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2516. xCameraCurve = i2;
  2517. }
  2518.  
  2519. private void drawMenu() {
  2520. int i = menuOffsetX;
  2521. int j = menuOffsetY;
  2522. int k = menuWidth;
  2523. int l = anInt952;
  2524. int i1 = 0x5d5447;
  2525. DrawingArea.drawPixels(l, j, i, i1, k);
  2526. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2527. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2528. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2529. int j1 = super.mouseX;
  2530. int k1 = super.mouseY;
  2531. if (menuScreenArea == 0) {
  2532. j1 -= 4;
  2533. k1 -= 4;
  2534. }
  2535. if (menuScreenArea == 1) {
  2536. j1 -= 519;
  2537. k1 -= 168;
  2538. }
  2539. if (menuScreenArea == 2) {
  2540. j1 -= 17;
  2541. k1 -= 338;
  2542. }
  2543. if (menuScreenArea == 3) {
  2544. j1 -= 519;
  2545. k1 -= 0;
  2546. }
  2547. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2548. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2549. int j2 = 0xffffff;
  2550. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2551. j2 = 0xffff00;
  2552. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1],
  2553. i2);
  2554. }
  2555.  
  2556. }
  2557.  
  2558. private void addFriend(long l) {
  2559. try {
  2560. if (l == 0L)
  2561. return;
  2562. if (friendsCount >= 100 && anInt1046 != 1) {
  2563. pushMessage(
  2564. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2565. 0, "");
  2566. return;
  2567. }
  2568. if (friendsCount >= 200) {
  2569. pushMessage(
  2570. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2571. 0, "");
  2572. return;
  2573. }
  2574. String s = TextClass.fixName(TextClass.nameForLong(l));
  2575. for (int i = 0; i < friendsCount; i++)
  2576. if (friendsListAsLongs[i] == l) {
  2577. pushMessage(s + " is already on your friend list", 0, "");
  2578. return;
  2579. }
  2580. for (int j = 0; j < ignoreCount; j++)
  2581. if (ignoreListAsLongs[j] == l) {
  2582. pushMessage("Please remove " + s
  2583. + " from your ignore list first", 0, "");
  2584. return;
  2585. }
  2586.  
  2587. if (s.equals(myPlayer.name)) {
  2588. return;
  2589. } else {
  2590. friendsList[friendsCount] = s;
  2591. friendsListAsLongs[friendsCount] = l;
  2592. friendsNodeIDs[friendsCount] = 0;
  2593. friendsCount++;
  2594. needDrawTabArea = true;
  2595. stream.createFrame(188);
  2596. stream.writeQWord(l);
  2597. return;
  2598. }
  2599. } catch (RuntimeException runtimeexception) {
  2600. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  2601. + runtimeexception.toString());
  2602. }
  2603. throw new RuntimeException();
  2604. }
  2605.  
  2606. private int method42(int i, int j, int k) {
  2607. int l = k >> 7;
  2608. int i1 = j >> 7;
  2609. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2610. return 0;
  2611. int j1 = i;
  2612. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2613. j1++;
  2614. int k1 = k & 0x7f;
  2615. int l1 = j & 0x7f;
  2616. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  2617. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2618. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  2619. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2620. return i2 * (128 - l1) + j2 * l1 >> 7;
  2621. }
  2622.  
  2623. private static String intToKOrMil(int j) {
  2624. if (j == 0)
  2625. return "@inf@";
  2626. if (j < 0x186a0)
  2627. return String.valueOf(j);
  2628. if (j < 0x989680)
  2629. return j / 1000 + "K";
  2630. else
  2631. return j / 0xf4240 + "M";
  2632. }
  2633.  
  2634. private void resetLogout() {
  2635. try {
  2636. if (socketStream != null)
  2637. socketStream.close();
  2638. } catch (Exception _ex) {
  2639. }
  2640. socketStream = null;
  2641. loggedIn = false;
  2642. loginScreenState = 0;
  2643. // myUsername = "";
  2644. // myPassword = "";
  2645. unlinkMRUNodes();
  2646. worldController.initToNull();
  2647. for (int i = 0; i < 4; i++)
  2648. aClass11Array1230[i].method210();
  2649.  
  2650. System.gc();
  2651. stopMidi();
  2652. currentSong = -1;
  2653. nextSong = -1;
  2654. prevSong = 0;
  2655. }
  2656.  
  2657. private void method45() {
  2658. aBoolean1031 = true;
  2659. for (int j = 0; j < 7; j++) {
  2660. anIntArray1065[j] = -1;
  2661. for (int k = 0; k < IDK.length; k++) {
  2662. if (IDK.cache[k].aBoolean662
  2663. || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2664. continue;
  2665. anIntArray1065[j] = k;
  2666. break;
  2667. }
  2668.  
  2669. }
  2670.  
  2671. }
  2672.  
  2673. private void method46(int i, Stream stream) {
  2674. while (stream.bitPosition + 21 < i * 8) {
  2675. int k = stream.readBits(14);
  2676. if (k == 16383)
  2677. break;
  2678. if (npcArray[k] == null)
  2679. npcArray[k] = new NPC();
  2680. NPC npc = npcArray[k];
  2681. npcIndices[npcCount++] = k;
  2682. npc.anInt1537 = loopCycle;
  2683. int l = stream.readBits(5);
  2684. if (l > 15)
  2685. l -= 32;
  2686. int i1 = stream.readBits(5);
  2687. if (i1 > 15)
  2688. i1 -= 32;
  2689. int j1 = stream.readBits(1);
  2690. npc.desc = EntityDef.forID(stream.readBits(14));
  2691. int k1 = stream.readBits(1);
  2692. if (k1 == 1)
  2693. anIntArray894[anInt893++] = k;
  2694. npc.anInt1540 = npc.desc.aByte68;
  2695. npc.anInt1504 = npc.desc.anInt79;
  2696. npc.anInt1554 = npc.desc.walkAnim;
  2697. npc.anInt1555 = npc.desc.anInt58;
  2698. npc.anInt1556 = npc.desc.anInt83;
  2699. npc.anInt1557 = npc.desc.anInt55;
  2700. npc.anInt1511 = npc.desc.standAnim;
  2701. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2702. }
  2703. stream.finishBitAccess();
  2704. }
  2705.  
  2706. public void processGameLoop() {
  2707. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2708. return;
  2709. loopCycle++;
  2710. if (!loggedIn)
  2711. processLoginScreenInput();
  2712. else
  2713. mainGameProcessor();
  2714. processOnDemandQueue();
  2715. }
  2716.  
  2717. private void method47(boolean flag) {
  2718. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2719. destX = 0;
  2720. int j = playerCount;
  2721. if (flag)
  2722. j = 1;
  2723. for (int l = 0; l < j; l++) {
  2724. Player player;
  2725. int i1;
  2726. if (flag) {
  2727. player = myPlayer;
  2728. i1 = myPlayerIndex << 14;
  2729. } else {
  2730. player = playerArray[playerIndices[l]];
  2731. i1 = playerIndices[l] << 14;
  2732. }
  2733. if (player == null || !player.isVisible())
  2734. continue;
  2735. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  2736. && !flag && player.anInt1517 == player.anInt1511;
  2737. int j1 = player.x >> 7;
  2738. int k1 = player.y >> 7;
  2739. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2740. continue;
  2741. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  2742. && loopCycle < player.anInt1708) {
  2743. player.aBoolean1699 = false;
  2744. player.anInt1709 = method42(plane, player.y, player.x);
  2745. worldController.method286(plane, player.y, player,
  2746. player.anInt1552, player.anInt1722, player.x,
  2747. player.anInt1709, player.anInt1719, player.anInt1721,
  2748. i1, player.anInt1720);
  2749. continue;
  2750. }
  2751. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2752. if (anIntArrayArray929[j1][k1] == anInt1265)
  2753. continue;
  2754. anIntArrayArray929[j1][k1] = anInt1265;
  2755. }
  2756. player.anInt1709 = method42(plane, player.y, player.x);
  2757. worldController.method285(plane, player.anInt1552,
  2758. player.anInt1709, i1, player.y, 60, player.x, player,
  2759. player.aBoolean1541);
  2760. }
  2761.  
  2762. }
  2763.  
  2764. private boolean promptUserForInput(RSInterface class9) {
  2765. int j = class9.contentType;
  2766. if (anInt900 == 2) {
  2767. if (j == 201) {
  2768. inputTaken = true;
  2769. inputDialogState = 0;
  2770. messagePromptRaised = true;
  2771. promptInput = "";
  2772. friendsListAction = 1;
  2773. aString1121 = "Enter name of friend to add to list";
  2774. }
  2775. if (j == 202) {
  2776. inputTaken = true;
  2777. inputDialogState = 0;
  2778. messagePromptRaised = true;
  2779. promptInput = "";
  2780. friendsListAction = 2;
  2781. aString1121 = "Enter name of friend to delete from list";
  2782. }
  2783. }
  2784. if (j == 205) {
  2785. anInt1011 = 250;
  2786. return true;
  2787. }
  2788. if (j == 501) {
  2789. inputTaken = true;
  2790. inputDialogState = 0;
  2791. messagePromptRaised = true;
  2792. promptInput = "";
  2793. friendsListAction = 4;
  2794. aString1121 = "Enter name of player to add to list";
  2795. }
  2796. if (j == 502) {
  2797. inputTaken = true;
  2798. inputDialogState = 0;
  2799. messagePromptRaised = true;
  2800. promptInput = "";
  2801. friendsListAction = 5;
  2802. aString1121 = "Enter name of player to delete from list";
  2803. }
  2804. if (j >= 300 && j <= 313) {
  2805. int k = (j - 300) / 2;
  2806. int j1 = j & 1;
  2807. int i2 = anIntArray1065[k];
  2808. if (i2 != -1) {
  2809. do {
  2810. if (j1 == 0 && --i2 < 0)
  2811. i2 = IDK.length - 1;
  2812. if (j1 == 1 && ++i2 >= IDK.length)
  2813. i2 = 0;
  2814. } while (IDK.cache[i2].aBoolean662
  2815. || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2816. anIntArray1065[k] = i2;
  2817. aBoolean1031 = true;
  2818. }
  2819. }
  2820. if (j >= 314 && j <= 323) {
  2821. int l = (j - 314) / 2;
  2822. int k1 = j & 1;
  2823. int j2 = anIntArray990[l];
  2824. if (k1 == 0 && --j2 < 0)
  2825. j2 = anIntArrayArray1003[l].length - 1;
  2826. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2827. j2 = 0;
  2828. anIntArray990[l] = j2;
  2829. aBoolean1031 = true;
  2830. }
  2831. if (j == 324 && !aBoolean1047) {
  2832. aBoolean1047 = true;
  2833. method45();
  2834. }
  2835. if (j == 325 && aBoolean1047) {
  2836. aBoolean1047 = false;
  2837. method45();
  2838. }
  2839. if (j == 326) {
  2840. stream.createFrame(101);
  2841. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2842. for (int i1 = 0; i1 < 7; i1++)
  2843. stream.writeWordBigEndian(anIntArray1065[i1]);
  2844.  
  2845. for (int l1 = 0; l1 < 5; l1++)
  2846. stream.writeWordBigEndian(anIntArray990[l1]);
  2847.  
  2848. return true;
  2849. }
  2850. if (j == 613)
  2851. canMute = !canMute;
  2852. if (j >= 601 && j <= 612) {
  2853. clearTopInterfaces();
  2854. if (reportAbuseInput.length() > 0) {
  2855. stream.createFrame(218);
  2856. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2857. stream.writeWordBigEndian(j - 601);
  2858. stream.writeWordBigEndian(canMute ? 1 : 0);
  2859. }
  2860. }
  2861. return false;
  2862. }
  2863.  
  2864. private void method49(Stream stream) {
  2865. for (int j = 0; j < anInt893; j++) {
  2866. int k = anIntArray894[j];
  2867. Player player = playerArray[k];
  2868. int l = stream.readUnsignedByte();
  2869. if ((l & 0x40) != 0)
  2870. l += stream.readUnsignedByte() << 8;
  2871. method107(l, k, stream, player);
  2872. }
  2873.  
  2874. }
  2875.  
  2876. private void method50(int i, int k, int l, int i1, int j1) {
  2877. int k1 = worldController.method300(j1, l, i);
  2878. if (k1 != 0) {
  2879. int l1 = worldController.method304(j1, l, i, k1);
  2880. int k2 = l1 >> 6 & 3;
  2881. int i3 = l1 & 0x1f;
  2882. int k3 = k;
  2883. if (k1 > 0)
  2884. k3 = i1;
  2885. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2886. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2887. int i5 = k1 >> 14 & 0x7fff;
  2888. ObjectDef class46_2 = ObjectDef.forID(i5);
  2889. if (class46_2.anInt758 != -1) {
  2890. Background background_2 = mapScenes[class46_2.anInt758];
  2891. if (background_2 != null) {
  2892. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2893. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2894. background_2.method361(48 + l * 4 + i6, 48
  2895. + (104 - i - class46_2.anInt761) * 4 + j6);
  2896. }
  2897. } else {
  2898. if (i3 == 0 || i3 == 2)
  2899. if (k2 == 0) {
  2900. ai[k4] = k3;
  2901. ai[k4 + 512] = k3;
  2902. ai[k4 + 1024] = k3;
  2903. ai[k4 + 1536] = k3;
  2904. } else if (k2 == 1) {
  2905. ai[k4] = k3;
  2906. ai[k4 + 1] = k3;
  2907. ai[k4 + 2] = k3;
  2908. ai[k4 + 3] = k3;
  2909. } else if (k2 == 2) {
  2910. ai[k4 + 3] = k3;
  2911. ai[k4 + 3 + 512] = k3;
  2912. ai[k4 + 3 + 1024] = k3;
  2913. ai[k4 + 3 + 1536] = k3;
  2914. } else if (k2 == 3) {
  2915. ai[k4 + 1536] = k3;
  2916. ai[k4 + 1536 + 1] = k3;
  2917. ai[k4 + 1536 + 2] = k3;
  2918. ai[k4 + 1536 + 3] = k3;
  2919. }
  2920. if (i3 == 3)
  2921. if (k2 == 0)
  2922. ai[k4] = k3;
  2923. else if (k2 == 1)
  2924. ai[k4 + 3] = k3;
  2925. else if (k2 == 2)
  2926. ai[k4 + 3 + 1536] = k3;
  2927. else if (k2 == 3)
  2928. ai[k4 + 1536] = k3;
  2929. if (i3 == 2)
  2930. if (k2 == 3) {
  2931. ai[k4] = k3;
  2932. ai[k4 + 512] = k3;
  2933. ai[k4 + 1024] = k3;
  2934. ai[k4 + 1536] = k3;
  2935. } else if (k2 == 0) {
  2936. ai[k4] = k3;
  2937. ai[k4 + 1] = k3;
  2938. ai[k4 + 2] = k3;
  2939. ai[k4 + 3] = k3;
  2940. } else if (k2 == 1) {
  2941. ai[k4 + 3] = k3;
  2942. ai[k4 + 3 + 512] = k3;
  2943. ai[k4 + 3 + 1024] = k3;
  2944. ai[k4 + 3 + 1536] = k3;
  2945. } else if (k2 == 2) {
  2946. ai[k4 + 1536] = k3;
  2947. ai[k4 + 1536 + 1] = k3;
  2948. ai[k4 + 1536 + 2] = k3;
  2949. ai[k4 + 1536 + 3] = k3;
  2950. }
  2951. }
  2952. }
  2953. k1 = worldController.method302(j1, l, i);
  2954. if (k1 != 0) {
  2955. int i2 = worldController.method304(j1, l, i, k1);
  2956. int l2 = i2 >> 6 & 3;
  2957. int j3 = i2 & 0x1f;
  2958. int l3 = k1 >> 14 & 0x7fff;
  2959. ObjectDef class46_1 = ObjectDef.forID(l3);
  2960. if (class46_1.anInt758 != -1) {
  2961. Background background_1 = mapScenes[class46_1.anInt758];
  2962. if (background_1 != null) {
  2963. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2964. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2965. background_1.method361(48 + l * 4 + j5, 48
  2966. + (104 - i - class46_1.anInt761) * 4 + k5);
  2967. }
  2968. } else if (j3 == 9) {
  2969. int l4 = 0xeeeeee;
  2970. if (k1 > 0)
  2971. l4 = 0xee0000;
  2972. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2973. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2974. if (l2 == 0 || l2 == 2) {
  2975. ai1[l5 + 1536] = l4;
  2976. ai1[l5 + 1024 + 1] = l4;
  2977. ai1[l5 + 512 + 2] = l4;
  2978. ai1[l5 + 3] = l4;
  2979. } else {
  2980. ai1[l5] = l4;
  2981. ai1[l5 + 512 + 1] = l4;
  2982. ai1[l5 + 1024 + 2] = l4;
  2983. ai1[l5 + 1536 + 3] = l4;
  2984. }
  2985. }
  2986. }
  2987. k1 = worldController.method303(j1, l, i);
  2988. if (k1 != 0) {
  2989. int j2 = k1 >> 14 & 0x7fff;
  2990. ObjectDef class46 = ObjectDef.forID(j2);
  2991. if (class46.anInt758 != -1) {
  2992. Background background = mapScenes[class46.anInt758];
  2993. if (background != null) {
  2994. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2995. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2996. background.method361(48 + l * 4 + i4, 48
  2997. + (104 - i - class46.anInt761) * 4 + j4);
  2998. }
  2999. }
  3000. }
  3001. }
  3002.  
  3003. private void loadTitleScreen() {
  3004. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  3005. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  3006. aBackgroundArray1152s = new Background[12];
  3007. int j = 0;
  3008. try {
  3009. j = Integer.parseInt(getParameter("fl_icon"));
  3010. } catch (Exception _ex) {
  3011. }
  3012. if (j == 0) {
  3013. for (int k = 0; k < 12; k++)
  3014. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3015. "runes", k);
  3016.  
  3017. } else {
  3018. for (int l = 0; l < 12; l++)
  3019. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3020. "runes", 12 + (l & 3));
  3021.  
  3022. }
  3023. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3024. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3025. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0,
  3026. aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3027.  
  3028. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0,
  3029. aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3030.  
  3031. anIntArray851 = new int[256];
  3032. for (int k1 = 0; k1 < 64; k1++)
  3033. anIntArray851[k1] = k1 * 0x40000;
  3034.  
  3035. for (int l1 = 0; l1 < 64; l1++)
  3036. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3037.  
  3038. for (int i2 = 0; i2 < 64; i2++)
  3039. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3040.  
  3041. for (int j2 = 0; j2 < 64; j2++)
  3042. anIntArray851[j2 + 192] = 0xffffff;
  3043.  
  3044. anIntArray852 = new int[256];
  3045. for (int k2 = 0; k2 < 64; k2++)
  3046. anIntArray852[k2] = k2 * 1024;
  3047.  
  3048. for (int l2 = 0; l2 < 64; l2++)
  3049. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3050.  
  3051. for (int i3 = 0; i3 < 64; i3++)
  3052. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3053.  
  3054. for (int j3 = 0; j3 < 64; j3++)
  3055. anIntArray852[j3 + 192] = 0xffffff;
  3056.  
  3057. anIntArray853 = new int[256];
  3058. for (int k3 = 0; k3 < 64; k3++)
  3059. anIntArray853[k3] = k3 * 4;
  3060.  
  3061. for (int l3 = 0; l3 < 64; l3++)
  3062. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3063.  
  3064. for (int i4 = 0; i4 < 64; i4++)
  3065. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3066.  
  3067. for (int j4 = 0; j4 < 64; j4++)
  3068. anIntArray853[j4 + 192] = 0xffffff;
  3069.  
  3070. anIntArray850 = new int[256];
  3071. anIntArray1190 = new int[32768];
  3072. anIntArray1191 = new int[32768];
  3073. randomizeBackground(null);
  3074. anIntArray828 = new int[32768];
  3075. anIntArray829 = new int[32768];
  3076. drawLoadingText(10, "Connecting to fileserver");
  3077. if (!aBoolean831) {
  3078. drawFlames = true;
  3079. aBoolean831 = true;
  3080. startRunnable(this, 2);
  3081. }
  3082. }
  3083.  
  3084. private static void setHighMem() {
  3085. WorldController.lowMem = false;
  3086. Texture.lowMem = false;
  3087. lowMem = false;
  3088. ObjectManager.lowMem = false;
  3089. ObjectDef.lowMem = false;
  3090. }
  3091.  
  3092. public static void main(String args[]) {
  3093. try {
  3094. nodeID = 10;
  3095. portOff = 0;
  3096. setHighMem();
  3097. isMembers = true;
  3098. signlink.storeid = 32;
  3099. signlink.startpriv(InetAddress.getLocalHost());
  3100. instance = new client();
  3101. new Jframe(args);
  3102. } catch (Exception e) {
  3103. e.printStackTrace();
  3104. }
  3105. }
  3106.  
  3107. public static client instance;
  3108.  
  3109. private void loadingStages() {
  3110. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3111. aRSImageProducer_1165.initDrawingArea();
  3112. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151,
  3113. 257);
  3114. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.",
  3115. 150, 256);
  3116. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3117. loadingStage = 1;
  3118. aLong824 = System.currentTimeMillis();
  3119. }
  3120. if (loadingStage == 1) {
  3121. int j = method54();
  3122. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3123. signlink.reporterror(myUsername + " glcfb " + aLong1215 + ","
  3124. + j + "," + lowMem + "," + decompressors[0] + ","
  3125. + onDemandFetcher.getNodeCount() + "," + plane + ","
  3126. + anInt1069 + "," + anInt1070);
  3127. aLong824 = System.currentTimeMillis();
  3128. }
  3129. }
  3130. if (loadingStage == 2 && plane != anInt985) {
  3131. anInt985 = plane;
  3132. method24(plane);
  3133. }
  3134. }
  3135.  
  3136. private int method54() {
  3137. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3138. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3139. return -1;
  3140. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3141. return -2;
  3142. }
  3143.  
  3144. boolean flag = true;
  3145. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3146. byte abyte0[] = aByteArrayArray1247[j];
  3147. if (abyte0 != null) {
  3148. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3149. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3150. if (aBoolean1159) {
  3151. k = 10;
  3152. l = 10;
  3153. }
  3154. flag &= ObjectManager.method189(k, abyte0, l);
  3155. }
  3156. }
  3157.  
  3158. if (!flag)
  3159. return -3;
  3160. if (aBoolean1080) {
  3161. return -4;
  3162. } else {
  3163. loadingStage = 2;
  3164. ObjectManager.anInt131 = plane;
  3165. method22();
  3166. stream.createFrame(121);
  3167. return 0;
  3168. }
  3169. }
  3170.  
  3171. private void method55() {
  3172. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3173. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3174. .reverseGetNext())
  3175. if (class30_sub2_sub4_sub4.anInt1597 != plane
  3176. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3177. class30_sub2_sub4_sub4.unlink();
  3178. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3179. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3180. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3181. if (npc != null && npc.x >= 0 && npc.x < 13312
  3182. && npc.y >= 0 && npc.y < 13312)
  3183. class30_sub2_sub4_sub4.method455(
  3184. loopCycle,
  3185. npc.y,
  3186. method42(class30_sub2_sub4_sub4.anInt1597,
  3187. npc.y, npc.x)
  3188. - class30_sub2_sub4_sub4.anInt1583,
  3189. npc.x);
  3190. }
  3191. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3192. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3193. Player player;
  3194. if (j == unknownInt10)
  3195. player = myPlayer;
  3196. else
  3197. player = playerArray[j];
  3198. if (player != null && player.x >= 0 && player.x < 13312
  3199. && player.y >= 0 && player.y < 13312)
  3200. class30_sub2_sub4_sub4.method455(
  3201. loopCycle,
  3202. player.y,
  3203. method42(class30_sub2_sub4_sub4.anInt1597,
  3204. player.y, player.x)
  3205. - class30_sub2_sub4_sub4.anInt1583,
  3206. player.x);
  3207. }
  3208. class30_sub2_sub4_sub4.method456(anInt945);
  3209. worldController.method285(plane,
  3210. class30_sub2_sub4_sub4.anInt1595,
  3211. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  3212. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  3213. (int) class30_sub2_sub4_sub4.aDouble1585,
  3214. class30_sub2_sub4_sub4, false);
  3215. }
  3216.  
  3217. }
  3218.  
  3219. public AppletContext getAppletContext() {
  3220. if (signlink.mainapp != null)
  3221. return signlink.mainapp.getAppletContext();
  3222. else
  3223. return super.getAppletContext();
  3224. }
  3225.  
  3226. public static String capitalize(String s) {
  3227. for (int i = 0; i < s.length(); i++) {
  3228. if (i == 0) {
  3229. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)),
  3230. s.substring(1));
  3231. }
  3232. if (!Character.isLetterOrDigit(s.charAt(i))) {
  3233. if (i + 1 < s.length()) {
  3234. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  3235. Character.toUpperCase(s.charAt(i + 1)),
  3236. s.substring(i + 2));
  3237. }
  3238. }
  3239. }
  3240. return s;
  3241. }
  3242.  
  3243. private void drawLogo() {
  3244. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3245. Sprite sprite = new Sprite(abyte0, this);
  3246. aRSImageProducer_1110.initDrawingArea();
  3247. sprite.method346(0, 0);
  3248. aRSImageProducer_1111.initDrawingArea();
  3249. sprite.method346(-637, 0);
  3250. aRSImageProducer_1107.initDrawingArea();
  3251. sprite.method346(-128, 0);
  3252. aRSImageProducer_1108.initDrawingArea();
  3253. sprite.method346(-202, -371);
  3254. aRSImageProducer_1109.initDrawingArea();
  3255. sprite.method346(-202, -171);
  3256. aRSImageProducer_1112.initDrawingArea();
  3257. sprite.method346(0, -265);
  3258. aRSImageProducer_1113.initDrawingArea();
  3259. sprite.method346(-562, -265);
  3260. aRSImageProducer_1114.initDrawingArea();
  3261. sprite.method346(-128, -171);
  3262. aRSImageProducer_1115.initDrawingArea();
  3263. sprite.method346(-562, -171);
  3264.  
  3265. int backgroundPixels[] = new int[sprite.myWidth];
  3266. for (int j = 0; j < sprite.myHeight; j++) {
  3267. for (int k = 0; k < sprite.myWidth; k++)
  3268. backgroundPixels[k] = sprite.myPixels[(sprite.myWidth - k - 1)
  3269. + sprite.myWidth * j];
  3270.  
  3271. System.arraycopy(backgroundPixels, 0, sprite.myPixels,
  3272. sprite.myWidth * j, sprite.myWidth);
  3273.  
  3274. }
  3275. sprite = null;
  3276. Object obj = null;
  3277. Object obj1 = null;
  3278. System.gc();
  3279. }
  3280.  
  3281. private void processOnDemandQueue() {
  3282. do {
  3283. OnDemandData onDemandData;
  3284. do {
  3285. onDemandData = onDemandFetcher.getNextNode();
  3286. if (onDemandData == null)
  3287. return;
  3288. if (onDemandData.dataType == 0) {
  3289. Model.method460(onDemandData.buffer, onDemandData.ID);
  3290. if (backDialogID != -1)
  3291. inputTaken = true;
  3292. }
  3293. if (onDemandData.dataType == 1 || onDemandData.dataType == 4
  3294. && onDemandData.buffer != null) {
  3295. Class36.method529(onDemandData.ID, onDemandData.buffer);
  3296. }
  3297. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong
  3298. && onDemandData.buffer != null)
  3299. saveMidi(songChanging, onDemandData.buffer);
  3300. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3301. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3302. if (anIntArray1235[i] == onDemandData.ID) {
  3303. aByteArrayArray1183[i] = onDemandData.buffer;
  3304. if (onDemandData.buffer == null)
  3305. anIntArray1235[i] = -1;
  3306. break;
  3307. }
  3308. if (anIntArray1236[i] != onDemandData.ID)
  3309. continue;
  3310. aByteArrayArray1247[i] = onDemandData.buffer;
  3311. if (onDemandData.buffer == null)
  3312. anIntArray1236[i] = -1;
  3313. break;
  3314. }
  3315.  
  3316. }
  3317. } while (onDemandData.dataType != 93
  3318. || !onDemandFetcher.method564(onDemandData.ID));
  3319. ObjectManager.method173(new Stream(onDemandData.buffer),
  3320. onDemandFetcher);
  3321. } while (true);
  3322. }
  3323.  
  3324. private void calcFlamesPosition() {
  3325.  
  3326. char c = '\u0100';
  3327. for (int j = 10; j < 117; j++) {
  3328. int k = (int) (Math.random() * 100D);
  3329. if (k < 50)
  3330. anIntArray828[j + (c - 2 << 7)] = 255;
  3331. }
  3332. for (int l = 0; l < 100; l++) {
  3333. int i1 = (int) (Math.random() * 124D) + 2;
  3334. int k1 = (int) (Math.random() * 128D) + 128;
  3335. int k2 = i1 + (k1 << 7);
  3336. anIntArray828[k2] = 192;
  3337. }
  3338.  
  3339. for (int j1 = 1; j1 < c - 1; j1++) {
  3340. for (int l1 = 1; l1 < 127; l1++) {
  3341. int l2 = l1 + (j1 << 7);
  3342. anIntArray829[l2] = (anIntArray828[l2 - 1]
  3343. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3344. }
  3345.  
  3346. }
  3347.  
  3348. anInt1275 += 128;
  3349. if (anInt1275 > anIntArray1190.length) {
  3350. anInt1275 -= anIntArray1190.length;
  3351. int i2 = (int) (Math.random() * 12D);
  3352. randomizeBackground(aBackgroundArray1152s[i2]);
  3353. }
  3354. for (int j2 = 1; j2 < c - 1; j2++) {
  3355. for (int i3 = 1; i3 < 127; i3++) {
  3356. int k3 = i3 + (j2 << 7);
  3357. int i4 = anIntArray829[k3 + 128]
  3358. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  3359. - 1] / 5;
  3360. if (i4 < 0)
  3361. i4 = 0;
  3362. anIntArray828[k3] = i4;
  3363. }
  3364.  
  3365. }
  3366.  
  3367. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3368.  
  3369. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D
  3370. + Math.sin((double) loopCycle / 15D) * 14D + Math
  3371. .sin((double) loopCycle / 16D) * 12D);
  3372. if (anInt1040 > 0)
  3373. anInt1040 -= 4;
  3374. if (anInt1041 > 0)
  3375. anInt1041 -= 4;
  3376. if (anInt1040 == 0 && anInt1041 == 0) {
  3377. int l3 = (int) (Math.random() * 2000D);
  3378. if (l3 == 0)
  3379. anInt1040 = 1024;
  3380. if (l3 == 1)
  3381. anInt1041 = 1024;
  3382. }
  3383. }
  3384.  
  3385. private boolean saveWave(byte abyte0[], int i) {
  3386. return abyte0 == null || signlink.wavesave(abyte0, i);
  3387. }
  3388.  
  3389. private void method60(int i) {
  3390. RSInterface class9 = RSInterface.interfaceCache[i];
  3391. for (int j = 0; j < class9.children.length; j++) {
  3392. if (class9.children[j] == -1)
  3393. break;
  3394. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3395. if (class9_1.type == 1)
  3396. method60(class9_1.id);
  3397. class9_1.anInt246 = 0;
  3398. class9_1.anInt208 = 0;
  3399. }
  3400. }
  3401.  
  3402. private void drawHeadIcon() {
  3403. if (anInt855 != 2)
  3404. return;
  3405. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2,
  3406. (anInt935 - baseY << 7) + anInt938);
  3407. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  3408. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3409. }
  3410.  
  3411. private static int freezeY = -1;
  3412.  
  3413. private void mainGameProcessor() {
  3414. if (anInt1104 > 1)
  3415. anInt1104--;
  3416. if (anInt1011 > 0)
  3417. anInt1011--;
  3418. for (int j = 0; j < 5; j++)
  3419. if (!parsePacket())
  3420. break;
  3421.  
  3422. if (!loggedIn)
  3423. return;
  3424. if (freezeTimer != -1) {
  3425. freezeTimer -= 1;
  3426. if (freezeTimer == -1) {
  3427. freezeY = -1;
  3428. }
  3429. }
  3430. synchronized (mouseDetection.syncObject) {
  3431. if (flagged) {
  3432. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3433. stream.createFrame(45);
  3434. stream.writeWordBigEndian(0);
  3435. int j2 = stream.currentOffset;
  3436. int j3 = 0;
  3437. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3438. if (j2 - stream.currentOffset >= 240)
  3439. break;
  3440. j3++;
  3441. int l4 = mouseDetection.coordsY[j4];
  3442. if (l4 < 0)
  3443. l4 = 0;
  3444. else if (l4 > 502)
  3445. l4 = 502;
  3446. int k5 = mouseDetection.coordsX[j4];
  3447. if (k5 < 0)
  3448. k5 = 0;
  3449. else if (k5 > 764)
  3450. k5 = 764;
  3451. int i6 = l4 * 765 + k5;
  3452. if (mouseDetection.coordsY[j4] == -1
  3453. && mouseDetection.coordsX[j4] == -1) {
  3454. k5 = -1;
  3455. l4 = -1;
  3456. i6 = 0x7ffff;
  3457. }
  3458. if (k5 == anInt1237 && l4 == anInt1238) {
  3459. if (anInt1022 < 2047)
  3460. anInt1022++;
  3461. } else {
  3462. int j6 = k5 - anInt1237;
  3463. anInt1237 = k5;
  3464. int k6 = l4 - anInt1238;
  3465. anInt1238 = l4;
  3466. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31
  3467. && k6 >= -32 && k6 <= 31) {
  3468. j6 += 32;
  3469. k6 += 32;
  3470. stream.writeWord((anInt1022 << 12) + (j6 << 6)
  3471. + k6);
  3472. anInt1022 = 0;
  3473. } else if (anInt1022 < 8) {
  3474. stream.writeDWordBigEndian(0x800000
  3475. + (anInt1022 << 19) + i6);
  3476. anInt1022 = 0;
  3477. } else {
  3478. stream.writeDWord(0xc0000000
  3479. + (anInt1022 << 19) + i6);
  3480. anInt1022 = 0;
  3481. }
  3482. }
  3483. }
  3484.  
  3485. stream.writeBytes(stream.currentOffset - j2);
  3486. if (j3 >= mouseDetection.coordsIndex) {
  3487. mouseDetection.coordsIndex = 0;
  3488. } else {
  3489. mouseDetection.coordsIndex -= j3;
  3490. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3491. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5
  3492. + j3];
  3493. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5
  3494. + j3];
  3495. }
  3496.  
  3497. }
  3498. }
  3499. } else {
  3500. mouseDetection.coordsIndex = 0;
  3501. }
  3502. }
  3503. if (super.clickMode3 != 0) {
  3504. long l = (super.aLong29 - aLong1220) / 50L;
  3505. if (l > 4095L)
  3506. l = 4095L;
  3507. aLong1220 = super.aLong29;
  3508. int k2 = super.saveClickY;
  3509. if (k2 < 0)
  3510. k2 = 0;
  3511. else if (k2 > 502)
  3512. k2 = 502;
  3513. int k3 = super.saveClickX;
  3514. if (k3 < 0)
  3515. k3 = 0;
  3516. else if (k3 > 764)
  3517. k3 = 764;
  3518. int k4 = k2 * 765 + k3;
  3519. int j5 = 0;
  3520. if (super.clickMode3 == 2)
  3521. j5 = 1;
  3522. int l5 = (int) l;
  3523. stream.createFrame(241);
  3524. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3525. }
  3526. if (anInt1016 > 0)
  3527. anInt1016--;
  3528. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  3529. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3530. aBoolean1017 = true;
  3531. if (aBoolean1017 && anInt1016 <= 0) {
  3532. anInt1016 = 20;
  3533. aBoolean1017 = false;
  3534. stream.createFrame(86);
  3535. stream.writeWord(anInt1184);
  3536. stream.method432(minimapInt1);
  3537. }
  3538. if (super.awtFocus && !aBoolean954) {
  3539. aBoolean954 = true;
  3540. stream.createFrame(3);
  3541. stream.writeWordBigEndian(1);
  3542. }
  3543. if (!super.awtFocus && aBoolean954) {
  3544. aBoolean954 = false;
  3545. stream.createFrame(3);
  3546. stream.writeWordBigEndian(0);
  3547. }
  3548. loadingStages();
  3549. method115();
  3550. method90();
  3551. anInt1009++;
  3552. if (anInt1009 > 750)
  3553. dropClient();
  3554. method114();
  3555. method95();
  3556. method38();
  3557. anInt945++;
  3558. if (crossType != 0) {
  3559. crossIndex += 20;
  3560. if (crossIndex >= 400)
  3561. crossType = 0;
  3562. }
  3563. if (atInventoryInterfaceType != 0) {
  3564. atInventoryLoopCycle++;
  3565. if (atInventoryLoopCycle >= 15) {
  3566. if (atInventoryInterfaceType == 2)
  3567. needDrawTabArea = true;
  3568. if (atInventoryInterfaceType == 3)
  3569. inputTaken = true;
  3570. atInventoryInterfaceType = 0;
  3571. }
  3572. }
  3573. if (activeInterfaceType != 0) {
  3574. anInt989++;
  3575. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  3576. || super.mouseY > anInt1088 + 5
  3577. || super.mouseY < anInt1088 - 5)
  3578. aBoolean1242 = true;
  3579. if (super.clickMode2 == 0) {
  3580. if (activeInterfaceType == 2)
  3581. needDrawTabArea = true;
  3582. if (activeInterfaceType == 3)
  3583. inputTaken = true;
  3584. activeInterfaceType = 0;
  3585. if (aBoolean1242 && anInt989 >= 10) {
  3586. lastActiveInvInterface = -1;
  3587. processRightClick();
  3588. if (lastActiveInvInterface == anInt1084
  3589. && mouseInvInterfaceIndex != anInt1085) {
  3590. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3591. int j1 = 0;
  3592. if (anInt913 == 1 && class9.contentType == 206)
  3593. j1 = 1;
  3594. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3595. j1 = 0;
  3596. if (class9.aBoolean235) {
  3597. int l2 = anInt1085;
  3598. int l3 = mouseInvInterfaceIndex;
  3599. class9.inv[l3] = class9.inv[l2];
  3600. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3601. class9.inv[l2] = -1;
  3602. class9.invStackSizes[l2] = 0;
  3603. } else if (j1 == 1) {
  3604. int i3 = anInt1085;
  3605. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3606. if (i3 > i4) {
  3607. class9.swapInventoryItems(i3, i3 - 1);
  3608. i3--;
  3609. } else if (i3 < i4) {
  3610. class9.swapInventoryItems(i3, i3 + 1);
  3611. i3++;
  3612. }
  3613.  
  3614. } else {
  3615. class9.swapInventoryItems(anInt1085,
  3616. mouseInvInterfaceIndex);
  3617. }
  3618. stream.createFrame(214);
  3619. stream.method433(anInt1084);
  3620. stream.method424(j1);
  3621. stream.method433(anInt1085);
  3622. stream.method431(mouseInvInterfaceIndex);
  3623. }
  3624. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  3625. && menuActionRow > 2)
  3626. determineMenuSize();
  3627. else if (menuActionRow > 0)
  3628. doAction(menuActionRow - 1);
  3629. atInventoryLoopCycle = 10;
  3630. super.clickMode3 = 0;
  3631. }
  3632. }
  3633. if (WorldController.anInt470 != -1) {
  3634. int k = WorldController.anInt470;
  3635. int k1 = WorldController.anInt471;
  3636. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  3637. myPlayer.smallX[0], true, k);
  3638. WorldController.anInt470 = -1;
  3639. if (flag) {
  3640. crossX = super.saveClickX;
  3641. crossY = super.saveClickY;
  3642. crossType = 1;
  3643. crossIndex = 0;
  3644. }
  3645. }
  3646. if (super.clickMode3 == 1 && aString844 != null) {
  3647. aString844 = null;
  3648. inputTaken = true;
  3649. super.clickMode3 = 0;
  3650. }
  3651. processMenuClick();
  3652. processMainScreenClick();
  3653. processTabClick();
  3654. processMapAreaClick();
  3655. processChatModeClick();
  3656. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3657. anInt1213++;
  3658. if (loadingStage == 2)
  3659. method108();
  3660. if (loadingStage == 2 && aBoolean1160)
  3661. calcCameraPos();
  3662. for (int i1 = 0; i1 < 5; i1++)
  3663. anIntArray1030[i1]++;
  3664.  
  3665. method73();
  3666. super.idleTime++;
  3667. if (super.idleTime > 4500) {
  3668. anInt1011 = 250;
  3669. super.idleTime -= 500;
  3670. stream.createFrame(202);
  3671. }
  3672. anInt988++;
  3673. if (anInt988 > 500) {
  3674. anInt988 = 0;
  3675. int l1 = (int) (Math.random() * 8D);
  3676. if ((l1 & 1) == 1)
  3677. anInt1278 += anInt1279;
  3678. if ((l1 & 2) == 2)
  3679. anInt1131 += anInt1132;
  3680. if ((l1 & 4) == 4)
  3681. anInt896 += anInt897;
  3682. }
  3683. if (anInt1278 < -50)
  3684. anInt1279 = 2;
  3685. if (anInt1278 > 50)
  3686. anInt1279 = -2;
  3687. if (anInt1131 < -55)
  3688. anInt1132 = 2;
  3689. if (anInt1131 > 55)
  3690. anInt1132 = -2;
  3691. if (anInt896 < -40)
  3692. anInt897 = 1;
  3693. if (anInt896 > 40)
  3694. anInt897 = -1;
  3695. anInt1254++;
  3696. if (anInt1254 > 500) {
  3697. anInt1254 = 0;
  3698. int i2 = (int) (Math.random() * 8D);
  3699. if ((i2 & 1) == 1)
  3700. minimapInt2 += anInt1210;
  3701. if ((i2 & 2) == 2)
  3702. minimapInt3 += anInt1171;
  3703. }
  3704. if (minimapInt2 < -60)
  3705. anInt1210 = 2;
  3706. if (minimapInt2 > 60)
  3707. anInt1210 = -2;
  3708. if (minimapInt3 < -20)
  3709. anInt1171 = 1;
  3710. if (minimapInt3 > 10)
  3711. anInt1171 = -1;
  3712. anInt1010++;
  3713. if (anInt1010 > 50)
  3714. stream.createFrame(0);
  3715. try {
  3716. if (socketStream != null && stream.currentOffset > 0) {
  3717. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3718. stream.currentOffset = 0;
  3719. anInt1010 = 0;
  3720. }
  3721. } catch (IOException _ex) {
  3722. dropClient();
  3723. } catch (Exception exception) {
  3724. resetLogout();
  3725. }
  3726. }
  3727.  
  3728. private void method63() {
  3729. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  3730. .reverseGetFirst();
  3731. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  3732. .reverseGetNext())
  3733. if (class30_sub1.anInt1294 == -1) {
  3734. class30_sub1.anInt1302 = 0;
  3735. method89(class30_sub1);
  3736. } else {
  3737. class30_sub1.unlink();
  3738. }
  3739.  
  3740. }
  3741.  
  3742. private void resetImageProducers() {
  3743. if (aRSImageProducer_1107 != null)
  3744. return;
  3745. super.fullGameScreen = null;
  3746. aRSImageProducer_1166 = null;
  3747. aRSImageProducer_1164 = null;
  3748. aRSImageProducer_1163 = null;
  3749. aRSImageProducer_1165 = null;
  3750. aRSImageProducer_1123 = null;
  3751. aRSImageProducer_1124 = null;
  3752. aRSImageProducer_1125 = null;
  3753. aRSImageProducer_1110 = new RSImageProducer(128, 265,
  3754. getGameComponent());
  3755. DrawingArea.setAllPixelsToZero();
  3756. aRSImageProducer_1111 = new RSImageProducer(128, 265,
  3757. getGameComponent());
  3758. DrawingArea.setAllPixelsToZero();
  3759. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  3760. getGameComponent());
  3761. DrawingArea.setAllPixelsToZero();
  3762. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  3763. getGameComponent());
  3764. DrawingArea.setAllPixelsToZero();
  3765. aRSImageProducer_1109 = new RSImageProducer(765, 503,
  3766. getGameComponent());
  3767. DrawingArea.setAllPixelsToZero();
  3768. aRSImageProducer_1112 = new RSImageProducer(202, 238,
  3769. getGameComponent());
  3770. DrawingArea.setAllPixelsToZero();
  3771. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  3772. getGameComponent());
  3773. DrawingArea.setAllPixelsToZero();
  3774. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3775. DrawingArea.setAllPixelsToZero();
  3776. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3777. DrawingArea.setAllPixelsToZero();
  3778. if (titleStreamLoader != null) {
  3779. drawLogo();
  3780. loadTitleScreen();
  3781. }
  3782. welcomeScreenRaised = true;
  3783. }
  3784.  
  3785. void drawLoadingText(int i, String s) {
  3786. anInt1079 = i;
  3787. aString1049 = s;
  3788. resetImageProducers();
  3789. if (titleStreamLoader == null) {
  3790. super.drawLoadingText(i, s);
  3791. return;
  3792. }
  3793. aRSImageProducer_1109.initDrawingArea();
  3794. char c = '\u0168';
  3795. char c1 = '\310';
  3796. byte byte1 = 20;
  3797. chatTextDrawingArea.drawText(0xffffff,
  3798. "Allious PK is loading - please wait...", c1 / 2 - 26
  3799. - byte1, c / 2);
  3800. int j = c1 / 2 - 18 - byte1;
  3801. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3802. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3803. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3804. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3805. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3806. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3807. if (welcomeScreenRaised) {
  3808. welcomeScreenRaised = false;
  3809. if (!aBoolean831) {
  3810. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3811. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3812. }
  3813. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3814. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3815. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3816. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3817. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3818. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3819. }
  3820. }
  3821.  
  3822. private void method65(int i, int j, int k, int l, RSInterface class9,
  3823. int i1, boolean flag, int j1) {
  3824. int anInt992;
  3825. if (aBoolean972)
  3826. anInt992 = 32;
  3827. else
  3828. anInt992 = 0;
  3829. aBoolean972 = false;
  3830. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3831. class9.scrollPosition -= anInt1213 * 4;
  3832. if (flag) {
  3833. needDrawTabArea = true;
  3834. }
  3835. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3836. class9.scrollPosition += anInt1213 * 4;
  3837. if (flag) {
  3838. needDrawTabArea = true;
  3839. }
  3840. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  3841. && l < (i1 + j) - 16 && anInt1213 > 0) {
  3842. int l1 = ((j - 32) * j) / j1;
  3843. if (l1 < 8)
  3844. l1 = 8;
  3845. int i2 = l - i1 - 16 - l1 / 2;
  3846. int j2 = j - 32 - l1;
  3847. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3848. if (flag)
  3849. needDrawTabArea = true;
  3850. aBoolean972 = true;
  3851. }
  3852. }
  3853.  
  3854. private boolean method66(int i, int j, int k) {
  3855. int i1 = i >> 14 & 0x7fff;
  3856. int j1 = worldController.method304(plane, k, j, i);
  3857. if (j1 == -1)
  3858. return false;
  3859. int k1 = j1 & 0x1f;
  3860. int l1 = j1 >> 6 & 3;
  3861. if (k1 == 10 || k1 == 11 || k1 == 22) {
  3862. ObjectDef class46 = ObjectDef.forID(i1);
  3863. int i2;
  3864. int j2;
  3865. if (l1 == 0 || l1 == 2) {
  3866. i2 = class46.anInt744;
  3867. j2 = class46.anInt761;
  3868. } else {
  3869. i2 = class46.anInt761;
  3870. j2 = class46.anInt744;
  3871. }
  3872. int k2 = class46.anInt768;
  3873. if (l1 != 0)
  3874. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3875. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j,
  3876. myPlayer.smallX[0], false, k);
  3877. } else {
  3878. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j,
  3879. myPlayer.smallX[0], false, k);
  3880. }
  3881. crossX = super.saveClickX;
  3882. crossY = super.saveClickY;
  3883. crossType = 2;
  3884. crossIndex = 0;
  3885. return true;
  3886. }
  3887.  
  3888. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  3889. int k) {
  3890. byte abyte0[] = null;
  3891. int l = 5;
  3892. try {
  3893. if (decompressors[0] != null)
  3894. abyte0 = decompressors[0].decompress(i);
  3895. } catch (Exception _ex) {
  3896. }
  3897. if (abyte0 != null) {
  3898. // aCRC32_930.reset();
  3899. // aCRC32_930.update(abyte0);
  3900. // int i1 = (int)aCRC32_930.getValue();
  3901. // if(i1 != j)
  3902. }
  3903. if (abyte0 != null) {
  3904. StreamLoader streamLoader = new StreamLoader(abyte0);
  3905. return streamLoader;
  3906. }
  3907. int j1 = 0;
  3908. while (abyte0 == null) {
  3909. String s2 = "Unknown error";
  3910. drawLoadingText(k, "Requesting " + s);
  3911. Object obj = null;
  3912. try {
  3913. int k1 = 0;
  3914. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3915. byte abyte1[] = new byte[6];
  3916. datainputstream.readFully(abyte1, 0, 6);
  3917. Stream stream = new Stream(abyte1);
  3918. stream.currentOffset = 3;
  3919. int i2 = stream.read3Bytes() + 6;
  3920. int j2 = 6;
  3921. abyte0 = new byte[i2];
  3922. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3923.  
  3924. while (j2 < i2) {
  3925. int l2 = i2 - j2;
  3926. if (l2 > 1000)
  3927. l2 = 1000;
  3928. int j3 = datainputstream.read(abyte0, j2, l2);
  3929. if (j3 < 0) {
  3930. s2 = "Length error: " + j2 + "/" + i2;
  3931. throw new IOException("EOF");
  3932. }
  3933. j2 += j3;
  3934. int k3 = (j2 * 100) / i2;
  3935. if (k3 != k1)
  3936. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3937. k1 = k3;
  3938. }
  3939. datainputstream.close();
  3940. try {
  3941. if (decompressors[0] != null)
  3942. decompressors[0].method234(abyte0.length, abyte0, i);
  3943. } catch (Exception _ex) {
  3944. decompressors[0] = null;
  3945. }
  3946. /*
  3947. * if(abyte0 != null) { aCRC32_930.reset();
  3948. * aCRC32_930.update(abyte0); int i3 =
  3949. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  3950. * j1++; s2 = "Checksum error: " + i3; } }
  3951. */
  3952. } catch (IOException ioexception) {
  3953. if (s2.equals("Unknown error"))
  3954. s2 = "Connection error";
  3955. abyte0 = null;
  3956. } catch (NullPointerException _ex) {
  3957. s2 = "Null error";
  3958. abyte0 = null;
  3959. if (!signlink.reporterror)
  3960. return null;
  3961. } catch (ArrayIndexOutOfBoundsException _ex) {
  3962. s2 = "Bounds error";
  3963. abyte0 = null;
  3964. if (!signlink.reporterror)
  3965. return null;
  3966. } catch (Exception _ex) {
  3967. s2 = "Unexpected error";
  3968. abyte0 = null;
  3969. if (!signlink.reporterror)
  3970. return null;
  3971. }
  3972. if (abyte0 == null) {
  3973. for (int l1 = l; l1 > 0; l1--) {
  3974. if (j1 >= 3) {
  3975. drawLoadingText(k, "Game updated - please reload page");
  3976. l1 = 10;
  3977. } else {
  3978. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3979. }
  3980. try {
  3981. Thread.sleep(1000L);
  3982. } catch (Exception _ex) {
  3983. }
  3984. }
  3985.  
  3986. l *= 2;
  3987. if (l > 60)
  3988. l = 60;
  3989. aBoolean872 = !aBoolean872;
  3990. }
  3991.  
  3992. }
  3993.  
  3994. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3995. return streamLoader_1;
  3996. }
  3997.  
  3998. public void sendStringAsLong(String string) {
  3999. stream.createFrame(60);
  4000. stream.writeQWord(TextClass.longForName(string));
  4001. }
  4002.  
  4003. public void sendString(int identifier, String text) {
  4004. text = identifier + "," + text;
  4005. stream.createFrame(127);
  4006. stream.writeWordBigEndian(text.length() + 1);
  4007. stream.writeString(text);
  4008. }
  4009.  
  4010. private void dropClient() {
  4011. if (anInt1011 > 0) {
  4012. resetLogout();
  4013. return;
  4014. }
  4015. aRSImageProducer_1165.initDrawingArea();
  4016. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  4017. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  4018. aTextDrawingArea_1271.drawText(0,
  4019. "Please wait - attempting to reestablish", 159, 257);
  4020. aTextDrawingArea_1271.drawText(0xffffff,
  4021. "Please wait - attempting to reestablish", 158, 256);
  4022. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4023. anInt1021 = 0;
  4024. destX = 0;
  4025. RSSocket rsSocket = socketStream;
  4026. loggedIn = false;
  4027. loginFailures = 0;
  4028. login(myUsername, myPassword, true);
  4029. if (!loggedIn)
  4030. resetLogout();
  4031. try {
  4032. rsSocket.close();
  4033. } catch (Exception _ex) {
  4034. }
  4035. }
  4036.  
  4037. private void doAction(int i) {
  4038. if (i < 0)
  4039. return;
  4040. if (inputDialogState != 0) {
  4041. inputDialogState = 0;
  4042. inputTaken = true;
  4043. }
  4044. int j = menuActionCmd2[i];
  4045. int k = menuActionCmd3[i];
  4046. int identity = menuActionID[i];
  4047. int i1 = menuActionCmd1[i];
  4048. if (identity >= 2000)
  4049. identity -= 2000;
  4050.  
  4051. if (identity == 474) {
  4052. counterOn = !counterOn;
  4053. currentXP = 0;
  4054.  
  4055. stream.createFrame(185);
  4056. if (counterOn) {
  4057. stream.writeWord(5002);
  4058. } else {
  4059. stream.writeWord(5003);
  4060. }
  4061. } else if (identity == 475) {
  4062. xpCounter = 0;
  4063. }
  4064. if (identity == 696) {
  4065. minimapInt1 = 0;
  4066. anInt1184 = 120;
  4067. }
  4068. if (identity == 582) {
  4069. NPC npc = npcArray[i1];
  4070. if (npc != null) {
  4071. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  4072. myPlayer.smallX[0], false, npc.smallX[0]);
  4073. crossX = super.saveClickX;
  4074. crossY = super.saveClickY;
  4075. crossType = 2;
  4076. crossIndex = 0;
  4077. stream.createFrame(57);
  4078. stream.method432(anInt1285);
  4079. stream.method432(i1);
  4080. stream.method431(anInt1283);
  4081. stream.method432(anInt1284);
  4082. }
  4083. }
  4084. if (identity == 234) {
  4085. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4086. myPlayer.smallX[0], false, j);
  4087. if (!flag1)
  4088. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4089. myPlayer.smallX[0], false, j);
  4090. crossX = super.saveClickX;
  4091. crossY = super.saveClickY;
  4092. crossType = 2;
  4093. crossIndex = 0;
  4094. stream.createFrame(236);
  4095. stream.method431(k + baseY);
  4096. stream.writeWord(i1);
  4097. stream.method431(j + baseX);
  4098. }
  4099. if (identity == 62 && method66(i1, k, j)) {
  4100. stream.createFrame(192);
  4101. stream.writeWord(anInt1284);
  4102. stream.method431(i1 >> 14 & 0x7fff);
  4103. stream.method433(k + baseY);
  4104. stream.method431(anInt1283);
  4105. stream.method433(j + baseX);
  4106. stream.writeWord(anInt1285);
  4107. }
  4108. if (identity == 511) {
  4109. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4110. myPlayer.smallX[0], false, j);
  4111. if (!flag2)
  4112. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4113. myPlayer.smallX[0], false, j);
  4114. crossX = super.saveClickX;
  4115. crossY = super.saveClickY;
  4116. crossType = 2;
  4117. crossIndex = 0;
  4118. stream.createFrame(25);
  4119. stream.method431(anInt1284);
  4120. stream.method432(anInt1285);
  4121. stream.writeWord(i1);
  4122. stream.method432(k + baseY);
  4123. stream.method433(anInt1283);
  4124. stream.writeWord(j + baseX);
  4125. }
  4126. if (identity == 74) {
  4127. stream.createFrame(122);
  4128. stream.method433(k);
  4129. stream.method432(j);
  4130. stream.method431(i1);
  4131. atInventoryLoopCycle = 0;
  4132. atInventoryInterface = k;
  4133. atInventoryIndex = j;
  4134. atInventoryInterfaceType = 2;
  4135. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4136. atInventoryInterfaceType = 1;
  4137. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4138. atInventoryInterfaceType = 3;
  4139. }
  4140. if (identity == 315) {
  4141. RSInterface class9 = RSInterface.interfaceCache[k];
  4142. boolean flag8 = true;
  4143. if (class9.contentType > 0)
  4144. flag8 = promptUserForInput(class9);
  4145. if (flag8) {
  4146. switch (k) {
  4147. case 27653:
  4148. sendFrame248(15106, 3213);
  4149. method60(15106);
  4150. inputTaken = true;
  4151. break;
  4152. default:
  4153. stream.createFrame(185);
  4154. stream.writeWord(k);
  4155. break;
  4156.  
  4157. }
  4158. }
  4159. }
  4160. if (identity == 561) {
  4161. Player player = playerArray[i1];
  4162. if (player != null) {
  4163. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4164. player.smallY[0], myPlayer.smallX[0], false,
  4165. player.smallX[0]);
  4166. crossX = super.saveClickX;
  4167. crossY = super.saveClickY;
  4168. crossType = 2;
  4169. crossIndex = 0;
  4170. anInt1188 += i1;
  4171. if (anInt1188 >= 90) {
  4172. stream.createFrame(136);
  4173. anInt1188 = 0;
  4174. }
  4175. stream.createFrame(128);
  4176. stream.writeWord(i1);
  4177. }
  4178. }
  4179. if (identity == 20) {
  4180. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4181. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4182. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4183. class30_sub2_sub4_sub1_sub1_1.smallY[0],
  4184. myPlayer.smallX[0], false,
  4185. class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  4186. crossX = super.saveClickX;
  4187. crossY = super.saveClickY;
  4188. crossType = 2;
  4189. crossIndex = 0;
  4190. stream.createFrame(155);
  4191. stream.method431(i1);
  4192. }
  4193. }
  4194. if (identity == 779) {
  4195. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4196. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4197. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4198. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  4199. myPlayer.smallX[0], false,
  4200. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  4201. crossX = super.saveClickX;
  4202. crossY = super.saveClickY;
  4203. crossType = 2;
  4204. crossIndex = 0;
  4205. stream.createFrame(153);
  4206. stream.method431(i1);
  4207. }
  4208. }
  4209. if (identity == 516)
  4210. if (!menuOpen)
  4211. worldController.method312(super.saveClickY - 4,
  4212. super.saveClickX - 4);
  4213. else
  4214. worldController.method312(k - 4, j - 4);
  4215. if (identity == 1062) {
  4216. anInt924 += baseX;
  4217. if (anInt924 >= 113) {
  4218. stream.createFrame(183);
  4219. stream.writeDWordBigEndian(0xe63271);
  4220. anInt924 = 0;
  4221. }
  4222. method66(i1, k, j);
  4223. stream.createFrame(228);
  4224. stream.method432(i1 >> 14 & 0x7fff);
  4225. stream.method432(k + baseY);
  4226. stream.writeWord(j + baseX);
  4227. }
  4228. if (identity == 679 && !aBoolean1149) {
  4229. stream.createFrame(40);
  4230. stream.writeWord(k);
  4231. aBoolean1149 = true;
  4232. }
  4233. if (identity == 431) {
  4234. stream.createFrame(129);
  4235. stream.method432(j);
  4236. stream.writeWord(k);
  4237. stream.method432(i1);
  4238. atInventoryLoopCycle = 0;
  4239. atInventoryInterface = k;
  4240. atInventoryIndex = j;
  4241. atInventoryInterfaceType = 2;
  4242. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4243. atInventoryInterfaceType = 1;
  4244. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4245. atInventoryInterfaceType = 3;
  4246. }
  4247. if (identity == 337 || identity == 42 || identity == 792
  4248. || identity == 322) {
  4249. String s = menuActionName[i];
  4250. int k1 = s.indexOf("@whi@");
  4251. if (k1 != -1) {
  4252. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4253. if (identity == 337)
  4254. addFriend(l3);
  4255. if (identity == 42)
  4256. addIgnore(l3);
  4257. if (identity == 792)
  4258. delFriend(l3);
  4259. if (identity == 322)
  4260. delIgnore(l3);
  4261. }
  4262. }
  4263. if (identity == 53) {
  4264. stream.createFrame(135);
  4265. stream.method431(j);
  4266. stream.method432(k);
  4267. stream.method431(i1);
  4268. atInventoryLoopCycle = 0;
  4269. atInventoryInterface = k;
  4270. atInventoryIndex = j;
  4271. atInventoryInterfaceType = 2;
  4272. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4273. atInventoryInterfaceType = 1;
  4274. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4275. atInventoryInterfaceType = 3;
  4276. }
  4277. if (identity == 539) {
  4278. stream.createFrame(16);
  4279. stream.method432(i1);
  4280. stream.method433(j);
  4281. stream.method433(k);
  4282. atInventoryLoopCycle = 0;
  4283. atInventoryInterface = k;
  4284. atInventoryIndex = j;
  4285. atInventoryInterfaceType = 2;
  4286. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4287. atInventoryInterfaceType = 1;
  4288. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4289. atInventoryInterfaceType = 3;
  4290. }
  4291. if (identity == 484 || identity == 6) {
  4292. String s1 = menuActionName[i];
  4293. int l1 = s1.indexOf("@whi@");
  4294. if (l1 != -1) {
  4295. s1 = s1.substring(l1 + 5).trim();
  4296. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass
  4297. .longForName(s1)));
  4298. boolean flag9 = false;
  4299. for (int j3 = 0; j3 < playerCount; j3++) {
  4300. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4301. if (class30_sub2_sub4_sub1_sub2_7 == null
  4302. || class30_sub2_sub4_sub1_sub2_7.name == null
  4303. || !class30_sub2_sub4_sub1_sub2_7.name
  4304. .equalsIgnoreCase(s7))
  4305. continue;
  4306. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4307. class30_sub2_sub4_sub1_sub2_7.smallY[0],
  4308. myPlayer.smallX[0], false,
  4309. class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  4310. if (identity == 484) {
  4311. stream.createFrame(139);
  4312. stream.method431(playerIndices[j3]);
  4313. }
  4314. if (identity == 6) {
  4315. anInt1188 += i1;
  4316. if (anInt1188 >= 90) {
  4317. stream.createFrame(136);
  4318. anInt1188 = 0;
  4319. }
  4320. stream.createFrame(128);
  4321. stream.writeWord(playerIndices[j3]);
  4322. }
  4323. flag9 = true;
  4324. break;
  4325. }
  4326.  
  4327. if (!flag9)
  4328. pushMessage("Unable to find " + s7, 0, "");
  4329. }
  4330. }
  4331. if (identity == 870) {
  4332. stream.createFrame(53);
  4333. stream.writeWord(j);
  4334. stream.method432(anInt1283);
  4335. stream.method433(i1);
  4336. stream.writeWord(anInt1284);
  4337. stream.method431(anInt1285);
  4338. stream.writeWord(k);
  4339. atInventoryLoopCycle = 0;
  4340. atInventoryInterface = k;
  4341. atInventoryIndex = j;
  4342. atInventoryInterfaceType = 2;
  4343. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4344. atInventoryInterfaceType = 1;
  4345. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4346. atInventoryInterfaceType = 3;
  4347. }
  4348. if (identity == 847) {
  4349. stream.createFrame(87);
  4350. stream.method432(i1);
  4351. stream.writeWord(k);
  4352. stream.method432(j);
  4353. atInventoryLoopCycle = 0;
  4354. atInventoryInterface = k;
  4355. atInventoryIndex = j;
  4356. atInventoryInterfaceType = 2;
  4357. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4358. atInventoryInterfaceType = 1;
  4359. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4360. atInventoryInterfaceType = 3;
  4361. }
  4362. if (identity == 626) {
  4363. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4364. spellSelected = 1;
  4365. spellID = class9_1.id;
  4366. anInt1137 = k;
  4367. spellUsableOn = class9_1.spellUsableOn;
  4368. itemSelected = 0;
  4369. needDrawTabArea = true;
  4370. spellID = class9_1.id;
  4371. String s4 = class9_1.selectedActionName;
  4372. if (s4.indexOf(" ") != -1)
  4373. s4 = s4.substring(0, s4.indexOf(" "));
  4374. String s8 = class9_1.selectedActionName;
  4375. if (s8.indexOf(" ") != -1)
  4376. s8 = s8.substring(s8.indexOf(" ") + 1);
  4377. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4378. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4379. // 0xffffff);
  4380. // class9_1.sprite1.drawSprite(200,200);
  4381. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4382. if (spellUsableOn == 16) {
  4383. needDrawTabArea = true;
  4384. tabID = 3;
  4385. tabAreaAltered = true;
  4386. }
  4387. return;
  4388. }
  4389. if (identity == 78) {
  4390. stream.createFrame(117);
  4391. stream.method433(k);
  4392. stream.method433(i1);
  4393. stream.method431(j);
  4394. atInventoryLoopCycle = 0;
  4395. atInventoryInterface = k;
  4396. atInventoryIndex = j;
  4397. atInventoryInterfaceType = 2;
  4398. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4399. atInventoryInterfaceType = 1;
  4400. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4401. atInventoryInterfaceType = 3;
  4402. }
  4403. if (identity == 27) {
  4404. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4405. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4406. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4407. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  4408. myPlayer.smallX[0], false,
  4409. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4410. crossX = super.saveClickX;
  4411. crossY = super.saveClickY;
  4412. crossType = 2;
  4413. crossIndex = 0;
  4414. anInt986 += i1;
  4415. if (anInt986 >= 54) {
  4416. stream.createFrame(189);
  4417. stream.writeWordBigEndian(234);
  4418. anInt986 = 0;
  4419. }
  4420. stream.createFrame(73);
  4421. stream.method431(i1);
  4422. }
  4423. }
  4424. if (identity == 213) {
  4425. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4426. myPlayer.smallX[0], false, j);
  4427. if (!flag3)
  4428. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4429. myPlayer.smallX[0], false, j);
  4430. crossX = super.saveClickX;
  4431. crossY = super.saveClickY;
  4432. crossType = 2;
  4433. crossIndex = 0;
  4434. stream.createFrame(79);
  4435. stream.method431(k + baseY);
  4436. stream.writeWord(i1);
  4437. stream.method432(j + baseX);
  4438. }
  4439. if (identity == 632) {
  4440. stream.createFrame(145);
  4441. stream.method432(k);
  4442. stream.method432(j);
  4443. stream.method432(i1);
  4444. atInventoryLoopCycle = 0;
  4445. atInventoryInterface = k;
  4446. atInventoryIndex = j;
  4447. atInventoryInterfaceType = 2;
  4448. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4449. atInventoryInterfaceType = 1;
  4450. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4451. atInventoryInterfaceType = 3;
  4452. }
  4453. if (identity == 1004) {
  4454. if (tabInterfaceIDs[10] != -1) {
  4455. needDrawTabArea = true;
  4456. tabID = 10;
  4457. tabAreaAltered = true;
  4458. }
  4459. }
  4460. if (identity == 1003) {
  4461. clanChatMode = 2;
  4462. aBoolean1233 = true;
  4463. inputTaken = true;
  4464. }
  4465. if (identity == 1002) {
  4466. clanChatMode = 1;
  4467. aBoolean1233 = true;
  4468. inputTaken = true;
  4469. }
  4470. if (identity == 1001) {
  4471. clanChatMode = 0;
  4472. aBoolean1233 = true;
  4473. inputTaken = true;
  4474. }
  4475. if (identity == 1000) {
  4476. cButtonCPos = 4;
  4477. chatTypeView = 11;
  4478. aBoolean1233 = true;
  4479. inputTaken = true;
  4480. }
  4481. if (identity == 999) {
  4482. cButtonCPos = 0;
  4483. chatTypeView = 0;
  4484. aBoolean1233 = true;
  4485. inputTaken = true;
  4486. }
  4487. if (identity == 998) {
  4488. cButtonCPos = 1;
  4489. chatTypeView = 5;
  4490. aBoolean1233 = true;
  4491. inputTaken = true;
  4492. }
  4493. if (identity == 997) {
  4494. publicChatMode = 3;
  4495. aBoolean1233 = true;
  4496. inputTaken = true;
  4497. }
  4498. if (identity == 996) {
  4499. publicChatMode = 2;
  4500. aBoolean1233 = true;
  4501. inputTaken = true;
  4502. }
  4503. if (identity == 995) {
  4504. publicChatMode = 1;
  4505. aBoolean1233 = true;
  4506. inputTaken = true;
  4507. }
  4508. if (identity == 994) {
  4509. publicChatMode = 0;
  4510. aBoolean1233 = true;
  4511. inputTaken = true;
  4512. }
  4513. if (identity == 993) {
  4514. cButtonCPos = 2;
  4515. chatTypeView = 1;
  4516. aBoolean1233 = true;
  4517. inputTaken = true;
  4518. }
  4519. if (identity == 992) {
  4520. privateChatMode = 2;
  4521. aBoolean1233 = true;
  4522. inputTaken = true;
  4523. }
  4524. if (identity == 991) {
  4525. privateChatMode = 1;
  4526. aBoolean1233 = true;
  4527. inputTaken = true;
  4528. }
  4529. if (identity == 990) {
  4530. privateChatMode = 0;
  4531. aBoolean1233 = true;
  4532. inputTaken = true;
  4533. }
  4534. if (identity == 989) {
  4535. cButtonCPos = 3;
  4536. chatTypeView = 2;
  4537. aBoolean1233 = true;
  4538. inputTaken = true;
  4539. }
  4540. if (identity == 987) {
  4541. tradeMode = 2;
  4542. aBoolean1233 = true;
  4543. inputTaken = true;
  4544. }
  4545. if (identity == 986) {
  4546. tradeMode = 1;
  4547. aBoolean1233 = true;
  4548. inputTaken = true;
  4549. }
  4550. if (identity == 985) {
  4551. tradeMode = 0;
  4552. aBoolean1233 = true;
  4553. inputTaken = true;
  4554. }
  4555. if (identity == 984) {
  4556. cButtonCPos = 5;
  4557. chatTypeView = 3;
  4558. aBoolean1233 = true;
  4559. inputTaken = true;
  4560. }
  4561. if (identity == 983) {
  4562. duelMode = 2;
  4563. aBoolean1233 = true;
  4564. inputTaken = true;
  4565. }
  4566. if (identity == 982) {
  4567. duelMode = 1;
  4568. aBoolean1233 = true;
  4569. inputTaken = true;
  4570. }
  4571. if (identity == 981) {
  4572. duelMode = 0;
  4573. aBoolean1233 = true;
  4574. inputTaken = true;
  4575. }
  4576. if (identity == 980) {
  4577. cButtonCPos = 6;
  4578. chatTypeView = 4;
  4579. aBoolean1233 = true;
  4580. inputTaken = true;
  4581. }
  4582. if (identity == 647) {
  4583. stream.createFrame(213);
  4584. stream.writeWord(k);
  4585. stream.writeWord(j);
  4586. switch (k) {
  4587. case 18304:
  4588. if (j == 0) {
  4589. inputTaken = true;
  4590. inputDialogState = 0;
  4591. messagePromptRaised = true;
  4592. promptInput = "";
  4593. friendsListAction = 8;
  4594. aString1121 = "Enter your clan chat title";
  4595. }
  4596. break;
  4597. }
  4598. }
  4599. if (identity == 493) {
  4600. stream.createFrame(75);
  4601. stream.method433(k);
  4602. stream.method431(j);
  4603. stream.method432(i1);
  4604. atInventoryLoopCycle = 0;
  4605. atInventoryInterface = k;
  4606. atInventoryIndex = j;
  4607. atInventoryInterfaceType = 2;
  4608. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4609. atInventoryInterfaceType = 1;
  4610. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4611. atInventoryInterfaceType = 3;
  4612. }
  4613. if (identity == 652) {
  4614. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4615. myPlayer.smallX[0], false, j);
  4616. if (!flag4)
  4617. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4618. myPlayer.smallX[0], false, j);
  4619. crossX = super.saveClickX;
  4620. crossY = super.saveClickY;
  4621. crossType = 2;
  4622. crossIndex = 0;
  4623. stream.createFrame(156);
  4624. stream.method432(j + baseX);
  4625. stream.method431(k + baseY);
  4626. stream.method433(i1);
  4627. }
  4628. if (identity == 94) {
  4629. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4630. myPlayer.smallX[0], false, j);
  4631. if (!flag5)
  4632. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4633. myPlayer.smallX[0], false, j);
  4634. crossX = super.saveClickX;
  4635. crossY = super.saveClickY;
  4636. crossType = 2;
  4637. crossIndex = 0;
  4638. stream.createFrame(181);
  4639. stream.method431(k + baseY);
  4640. stream.writeWord(i1);
  4641. stream.method431(j + baseX);
  4642. stream.method432(anInt1137);
  4643. }
  4644. if (identity == 646) {
  4645. stream.createFrame(185);
  4646. stream.writeWord(k);
  4647. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4648. if (class9_2.valueIndexArray != null
  4649. && class9_2.valueIndexArray[0][0] == 5) {
  4650. int i2 = class9_2.valueIndexArray[0][1];
  4651. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  4652. variousSettings[i2] = class9_2.anIntArray212[0];
  4653. method33(i2);
  4654. needDrawTabArea = true;
  4655. }
  4656. }
  4657. switch (k) {
  4658. // clan chat
  4659. case 18129:
  4660. if (RSInterface.interfaceCache[18135].message.toLowerCase()
  4661. .contains("join")) {
  4662. inputTaken = true;
  4663. inputDialogState = 0;
  4664. messagePromptRaised = true;
  4665. promptInput = "";
  4666. friendsListAction = 6;
  4667. aString1121 = "Enter the name of the chat you wish to join";
  4668. } else {
  4669. sendString(0, "");
  4670. }
  4671. break;
  4672. case 18132:
  4673. openInterfaceID = 18300;
  4674. break;
  4675. case 18526:
  4676. inputTaken = true;
  4677. inputDialogState = 0;
  4678. messagePromptRaised = true;
  4679. promptInput = "";
  4680. friendsListAction = 9;
  4681. aString1121 = "Enter a name to add";
  4682. break;
  4683. case 18527:
  4684. inputTaken = true;
  4685. inputDialogState = 0;
  4686. messagePromptRaised = true;
  4687. promptInput = "";
  4688. friendsListAction = 10;
  4689. aString1121 = "Enter a name to add";
  4690. break;
  4691. }
  4692. }
  4693. if (identity == 225) {
  4694. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4695. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4696. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4697. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  4698. myPlayer.smallX[0], false,
  4699. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4700. crossX = super.saveClickX;
  4701. crossY = super.saveClickY;
  4702. crossType = 2;
  4703. crossIndex = 0;
  4704. anInt1226 += i1;
  4705. if (anInt1226 >= 85) {
  4706. stream.createFrame(230);
  4707. stream.writeWordBigEndian(239);
  4708. anInt1226 = 0;
  4709. }
  4710. stream.createFrame(17);
  4711. stream.method433(i1);
  4712. }
  4713. }
  4714. if (identity == 965) {
  4715. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4716. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4717. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4718. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  4719. myPlayer.smallX[0], false,
  4720. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4721. crossX = super.saveClickX;
  4722. crossY = super.saveClickY;
  4723. crossType = 2;
  4724. crossIndex = 0;
  4725. anInt1134++;
  4726. if (anInt1134 >= 96) {
  4727. stream.createFrame(152);
  4728. stream.writeWordBigEndian(88);
  4729. anInt1134 = 0;
  4730. }
  4731. stream.createFrame(21);
  4732. stream.writeWord(i1);
  4733. }
  4734. }
  4735. if (identity == 413) {
  4736. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4737. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4738. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4739. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  4740. myPlayer.smallX[0], false,
  4741. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4742. crossX = super.saveClickX;
  4743. crossY = super.saveClickY;
  4744. crossType = 2;
  4745. crossIndex = 0;
  4746. stream.createFrame(131);
  4747. stream.method433(i1);
  4748. stream.method432(anInt1137);
  4749. }
  4750. }
  4751. if (identity == 200)
  4752. clearTopInterfaces();
  4753. if (identity == 1025) {
  4754. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4755. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4756. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4757. if (entityDef.childrenIDs != null)
  4758. entityDef = entityDef.method161();
  4759. if (entityDef != null) {
  4760. String s9;
  4761. if (entityDef.description != null)
  4762. s9 = new String(entityDef.description);
  4763. else
  4764. s9 = "It's a " + entityDef.name + ".";
  4765. pushMessage(s9, 0, "");
  4766. }
  4767. }
  4768. }
  4769. if (identity == 900) {
  4770. method66(i1, k, j);
  4771. stream.createFrame(252);
  4772. stream.method433(i1 >> 14 & 0x7fff);
  4773. stream.method431(k + baseY);
  4774. stream.method432(j + baseX);
  4775. }
  4776. if (identity == 412) {
  4777. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4778. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4779. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4780. class30_sub2_sub4_sub1_sub1_6.smallY[0],
  4781. myPlayer.smallX[0], false,
  4782. class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  4783. crossX = super.saveClickX;
  4784. crossY = super.saveClickY;
  4785. crossType = 2;
  4786. crossIndex = 0;
  4787. stream.createFrame(72);
  4788. stream.method432(i1);
  4789. }
  4790. }
  4791. if (identity == 365) {
  4792. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4793. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4794. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4795. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  4796. myPlayer.smallX[0], false,
  4797. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4798. crossX = super.saveClickX;
  4799. crossY = super.saveClickY;
  4800. crossType = 2;
  4801. crossIndex = 0;
  4802. stream.createFrame(249);
  4803. stream.method432(i1);
  4804. stream.method431(anInt1137);
  4805. }
  4806. }
  4807. if (identity == 729) {
  4808. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4809. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4810. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4811. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  4812. myPlayer.smallX[0], false,
  4813. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4814. crossX = super.saveClickX;
  4815. crossY = super.saveClickY;
  4816. crossType = 2;
  4817. crossIndex = 0;
  4818. stream.createFrame(39);
  4819. stream.method431(i1);
  4820. }
  4821. }
  4822. if (identity == 577) {
  4823. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4824. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4825. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4826. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  4827. myPlayer.smallX[0], false,
  4828. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4829. crossX = super.saveClickX;
  4830. crossY = super.saveClickY;
  4831. crossType = 2;
  4832. crossIndex = 0;
  4833. stream.createFrame(139);
  4834. stream.method431(i1);
  4835. }
  4836. }
  4837. if (identity == 956 && method66(i1, k, j)) {
  4838. stream.createFrame(35);
  4839. stream.method431(j + baseX);
  4840. stream.method432(anInt1137);
  4841. stream.method432(k + baseY);
  4842. stream.method431(i1 >> 14 & 0x7fff);
  4843. }
  4844. if (identity == 567) {
  4845. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4846. myPlayer.smallX[0], false, j);
  4847. if (!flag6)
  4848. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4849. myPlayer.smallX[0], false, j);
  4850. crossX = super.saveClickX;
  4851. crossY = super.saveClickY;
  4852. crossType = 2;
  4853. crossIndex = 0;
  4854. stream.createFrame(23);
  4855. stream.method431(k + baseY);
  4856. stream.method431(i1);
  4857. stream.method431(j + baseX);
  4858. }
  4859. if (identity == 867) {
  4860. if ((i1 & 3) == 0)
  4861. anInt1175++;
  4862. if (anInt1175 >= 59) {
  4863. stream.createFrame(200);
  4864. stream.writeWord(25501);
  4865. anInt1175 = 0;
  4866. }
  4867. stream.createFrame(43);
  4868. stream.method431(k);
  4869. stream.method432(i1);
  4870. stream.method432(j);
  4871. atInventoryLoopCycle = 0;
  4872. atInventoryInterface = k;
  4873. atInventoryIndex = j;
  4874. atInventoryInterfaceType = 2;
  4875. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4876. atInventoryInterfaceType = 1;
  4877. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4878. atInventoryInterfaceType = 3;
  4879. }
  4880. if (identity == 543) {
  4881. stream.createFrame(237);
  4882. stream.writeWord(j);
  4883. stream.method432(i1);
  4884. stream.writeWord(k);
  4885. stream.method432(anInt1137);
  4886. atInventoryLoopCycle = 0;
  4887. atInventoryInterface = k;
  4888. atInventoryIndex = j;
  4889. atInventoryInterfaceType = 2;
  4890. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4891. atInventoryInterfaceType = 1;
  4892. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4893. atInventoryInterfaceType = 3;
  4894. }
  4895. if (identity == 606) {
  4896. String s2 = menuActionName[i];
  4897. int j2 = s2.indexOf("@whi@");
  4898. if (j2 != -1)
  4899. if (openInterfaceID == -1) {
  4900. clearTopInterfaces();
  4901. reportAbuseInput = s2.substring(j2 + 5).trim();
  4902. canMute = false;
  4903. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  4904. if (RSInterface.interfaceCache[i3] == null
  4905. || RSInterface.interfaceCache[i3].contentType != 600)
  4906. continue;
  4907. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4908. break;
  4909. }
  4910.  
  4911. } else {
  4912. pushMessage(
  4913. "Please close the interface you have open before using 'report abuse'",
  4914. 0, "");
  4915. }
  4916. }
  4917. if (identity == 491) {
  4918. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4919. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  4920. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4921. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  4922. myPlayer.smallX[0], false,
  4923. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  4924. crossX = super.saveClickX;
  4925. crossY = super.saveClickY;
  4926. crossType = 2;
  4927. crossIndex = 0;
  4928. stream.createFrame(14);
  4929. stream.method432(anInt1284);
  4930. stream.writeWord(i1);
  4931. stream.writeWord(anInt1285);
  4932. stream.method431(anInt1283);
  4933. }
  4934. }
  4935. if (identity == 639) {
  4936. String s3 = menuActionName[i];
  4937. int k2 = s3.indexOf("@whi@");
  4938. if (k2 != -1) {
  4939. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4940. int k3 = -1;
  4941. for (int i4 = 0; i4 < friendsCount; i4++) {
  4942. if (friendsListAsLongs[i4] != l4)
  4943. continue;
  4944. k3 = i4;
  4945. break;
  4946. }
  4947.  
  4948. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  4949. inputTaken = true;
  4950. inputDialogState = 0;
  4951. messagePromptRaised = true;
  4952. promptInput = "";
  4953. friendsListAction = 3;
  4954. aLong953 = friendsListAsLongs[k3];
  4955. aString1121 = "Enter message to send to " + friendsList[k3];
  4956. }
  4957. }
  4958. }
  4959. if (identity == 454) {
  4960. stream.createFrame(41);
  4961. stream.writeWord(i1);
  4962. stream.method432(j);
  4963. stream.method432(k);
  4964. atInventoryLoopCycle = 0;
  4965. atInventoryInterface = k;
  4966. atInventoryIndex = j;
  4967. atInventoryInterfaceType = 2;
  4968. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4969. atInventoryInterfaceType = 1;
  4970. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4971. atInventoryInterfaceType = 3;
  4972. }
  4973. if (identity == 478) {
  4974. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4975. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  4976. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4977. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  4978. myPlayer.smallX[0], false,
  4979. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  4980. crossX = super.saveClickX;
  4981. crossY = super.saveClickY;
  4982. crossType = 2;
  4983. crossIndex = 0;
  4984. if ((i1 & 3) == 0)
  4985. anInt1155++;
  4986. if (anInt1155 >= 53) {
  4987. stream.createFrame(85);
  4988. stream.writeWordBigEndian(66);
  4989. anInt1155 = 0;
  4990. }
  4991. stream.createFrame(18);
  4992. stream.method431(i1);
  4993. }
  4994. }
  4995. if (identity == 113) {
  4996. method66(i1, k, j);
  4997. stream.createFrame(70);
  4998. stream.method431(j + baseX);
  4999. stream.writeWord(k + baseY);
  5000. stream.method433(i1 >> 14 & 0x7fff);
  5001. }
  5002. if (identity == 872) {
  5003. method66(i1, k, j);
  5004. stream.createFrame(234);
  5005. stream.method433(j + baseX);
  5006. stream.method432(i1 >> 14 & 0x7fff);
  5007. stream.method433(k + baseY);
  5008. }
  5009. if (identity == 502) {
  5010. method66(i1, k, j);
  5011. stream.createFrame(132);
  5012. stream.method433(j + baseX);
  5013. stream.writeWord(i1 >> 14 & 0x7fff);
  5014. stream.method432(k + baseY);
  5015. }
  5016. if (identity == 1125) {
  5017. ItemDef itemDef = ItemDef.forID(i1);
  5018. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5019. String s5;
  5020. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5021. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5022. else if (itemDef.description != null)
  5023. s5 = new String(itemDef.description);
  5024. else
  5025. s5 = "It's a " + itemDef.name + ".";
  5026. pushMessage(s5, 0, "");
  5027. }
  5028. if (identity == 169) {
  5029. stream.createFrame(185);
  5030. stream.writeWord(k);
  5031. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5032. if (class9_3.valueIndexArray != null
  5033. && class9_3.valueIndexArray[0][0] == 5) {
  5034. int l2 = class9_3.valueIndexArray[0][1];
  5035. variousSettings[l2] = 1 - variousSettings[l2];
  5036. method33(l2);
  5037. needDrawTabArea = true;
  5038. }
  5039. }
  5040. if (identity == 447) {
  5041. itemSelected = 1;
  5042. anInt1283 = j;
  5043. anInt1284 = k;
  5044. anInt1285 = i1;
  5045. selectedItemName = ItemDef.forID(i1).name;
  5046. spellSelected = 0;
  5047. needDrawTabArea = true;
  5048. return;
  5049. }
  5050. if (identity == 1226) {
  5051. int j1 = i1 >> 14 & 0x7fff;
  5052. ObjectDef class46 = ObjectDef.forID(j1);
  5053. String s10;
  5054. if (class46.description != null)
  5055. s10 = new String(class46.description);
  5056. else
  5057. s10 = "It's a " + class46.name + ".";
  5058. pushMessage(s10, 0, "");
  5059. }
  5060. if (identity == 244) {
  5061. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5062. myPlayer.smallX[0], false, j);
  5063. if (!flag7)
  5064. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5065. myPlayer.smallX[0], false, j);
  5066. crossX = super.saveClickX;
  5067. crossY = super.saveClickY;
  5068. crossType = 2;
  5069. crossIndex = 0;
  5070. stream.createFrame(253);
  5071. stream.method431(j + baseX);
  5072. stream.method433(k + baseY);
  5073. stream.method432(i1);
  5074. }
  5075. if (identity == 1448) {
  5076. ItemDef itemDef_1 = ItemDef.forID(i1);
  5077. String s6;
  5078. if (itemDef_1.description != null)
  5079. s6 = new String(itemDef_1.description);
  5080. else
  5081. s6 = "It's a " + itemDef_1.name + ".";
  5082. pushMessage(s6, 0, "");
  5083. }
  5084. itemSelected = 0;
  5085. spellSelected = 0;
  5086. needDrawTabArea = true;
  5087.  
  5088. }
  5089.  
  5090. private void method70() {
  5091. anInt1251 = 0;
  5092. int j = (myPlayer.x >> 7) + baseX;
  5093. int k = (myPlayer.y >> 7) + baseY;
  5094. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5095. anInt1251 = 1;
  5096. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5097. anInt1251 = 1;
  5098. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5099. anInt1251 = 0;
  5100. }
  5101.  
  5102. public void run() {
  5103. if (drawFlames) {
  5104. drawFlames();
  5105. } else {
  5106. super.run();
  5107. }
  5108. }
  5109.  
  5110. public void sendFrame36(int id, int state) {
  5111. anIntArray1045[id] = state;
  5112. if (variousSettings[id] != state) {
  5113. variousSettings[id] = state;
  5114. method33(id);
  5115. needDrawTabArea = true;
  5116. if (dialogID != -1)
  5117. inputTaken = true;
  5118. }
  5119. }
  5120.  
  5121. public void sendPacket185(int button, int toggle, int type) {
  5122. switch (type) {
  5123. case 135:
  5124. RSInterface class9 = RSInterface.interfaceCache[button];
  5125. boolean flag8 = true;
  5126. if (class9.contentType > 0)
  5127. flag8 = promptUserForInput(class9);
  5128. if (flag8) {
  5129. stream.createFrame(185);
  5130. stream.writeWord(button);
  5131. }
  5132. break;
  5133. case 646:
  5134. stream.createFrame(185);
  5135. stream.writeWord(button);
  5136. RSInterface class9_2 = RSInterface.interfaceCache[button];
  5137. if (class9_2.valueIndexArray != null
  5138. && class9_2.valueIndexArray[0][0] == 5) {
  5139. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  5140. variousSettings[toggle] = class9_2.anIntArray212[0];
  5141. method33(toggle);
  5142. needDrawTabArea = true;
  5143. }
  5144. }
  5145. break;
  5146. case 169:
  5147. stream.createFrame(185);
  5148. stream.writeWord(button);
  5149. RSInterface class9_3 = RSInterface.interfaceCache[button];
  5150. if (class9_3.valueIndexArray != null
  5151. && class9_3.valueIndexArray[0][0] == 5) {
  5152. variousSettings[toggle] = 1 - variousSettings[toggle];
  5153. method33(toggle);
  5154. needDrawTabArea = true;
  5155. }
  5156. switch (button) {
  5157. case 19136:
  5158. System.out.println("toggle = " + toggle);
  5159. if (toggle == 0)
  5160. sendFrame36(173, toggle);
  5161. if (toggle == 1)
  5162. sendPacket185(153, 173, 646);
  5163. break;
  5164. }
  5165. break;
  5166. }
  5167. }
  5168.  
  5169. private void build3dScreenMenu() {
  5170. if (itemSelected == 0 && spellSelected == 0) {
  5171. menuActionName[menuActionRow] = "Walk here";
  5172. menuActionID[menuActionRow] = 516;
  5173. menuActionCmd2[menuActionRow] = super.mouseX;
  5174. menuActionCmd3[menuActionRow] = super.mouseY;
  5175. menuActionRow++;
  5176. }
  5177. int j = -1;
  5178. for (int k = 0; k < Model.anInt1687; k++) {
  5179. int l = Model.anIntArray1688[k];
  5180. int i1 = l & 0x7f;
  5181. int j1 = l >> 7 & 0x7f;
  5182. int k1 = l >> 29 & 3;
  5183. int l1 = l >> 14 & 0x7fff;
  5184. if (l == j)
  5185. continue;
  5186. j = l;
  5187. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5188. ObjectDef class46 = ObjectDef.forID(l1);
  5189. if (class46.childrenIDs != null)
  5190. class46 = class46.method580();
  5191. if (class46 == null)
  5192. continue;
  5193. if (itemSelected == 1) {
  5194. menuActionName[menuActionRow] = "Use " + selectedItemName
  5195. + " with @cya@" + class46.name;
  5196. menuActionID[menuActionRow] = 62;
  5197. menuActionCmd1[menuActionRow] = l;
  5198. menuActionCmd2[menuActionRow] = i1;
  5199. menuActionCmd3[menuActionRow] = j1;
  5200. menuActionRow++;
  5201. } else if (spellSelected == 1) {
  5202. if ((spellUsableOn & 4) == 4) {
  5203. menuActionName[menuActionRow] = spellTooltip + " @cya@"
  5204. + class46.name;
  5205. menuActionID[menuActionRow] = 956;
  5206. menuActionCmd1[menuActionRow] = l;
  5207. menuActionCmd2[menuActionRow] = i1;
  5208. menuActionCmd3[menuActionRow] = j1;
  5209. menuActionRow++;
  5210. }
  5211. } else {
  5212. if (class46.actions != null) {
  5213. for (int i2 = 4; i2 >= 0; i2--)
  5214. if (class46.actions[i2] != null) {
  5215. menuActionName[menuActionRow] = class46.actions[i2]
  5216. + " @cya@" + class46.name;
  5217. if (i2 == 0)
  5218. menuActionID[menuActionRow] = 502;
  5219. if (i2 == 1)
  5220. menuActionID[menuActionRow] = 900;
  5221. if (i2 == 2)
  5222. menuActionID[menuActionRow] = 113;
  5223. if (i2 == 3)
  5224. menuActionID[menuActionRow] = 872;
  5225. if (i2 == 4)
  5226. menuActionID[menuActionRow] = 1062;
  5227. menuActionCmd1[menuActionRow] = l;
  5228. menuActionCmd2[menuActionRow] = i1;
  5229. menuActionCmd3[menuActionRow] = j1;
  5230. menuActionRow++;
  5231. }
  5232.  
  5233. }
  5234. // menuActionName[menuActionRow] = "Examine @cya@" +
  5235. // class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" +
  5236. // (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  5237. menuActionName[menuActionRow] = "Examine @cya@"
  5238. + class46.name + " @gre@(@whi@" + l1
  5239. + "@gre@) (@whi@" + (i1 + baseX) + ","
  5240. + (j1 + baseY) + "@gre@)";
  5241. menuActionID[menuActionRow] = 1226;
  5242. menuActionCmd1[menuActionRow] = class46.type << 14;
  5243. menuActionCmd2[menuActionRow] = i1;
  5244. menuActionCmd3[menuActionRow] = j1;
  5245. menuActionRow++;
  5246. }
  5247. }
  5248. if (k1 == 1) {
  5249. NPC npc = npcArray[l1];
  5250. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64
  5251. && (npc.y & 0x7f) == 64) {
  5252. for (int j2 = 0; j2 < npcCount; j2++) {
  5253. NPC npc2 = npcArray[npcIndices[j2]];
  5254. if (npc2 != null && npc2 != npc
  5255. && npc2.desc.aByte68 == 1 && npc2.x == npc.x
  5256. && npc2.y == npc.y)
  5257. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5258. }
  5259.  
  5260. for (int l2 = 0; l2 < playerCount; l2++) {
  5261. Player player = playerArray[playerIndices[l2]];
  5262. if (player != null && player.x == npc.x
  5263. && player.y == npc.y)
  5264. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5265. }
  5266.  
  5267. }
  5268. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5269. }
  5270. if (k1 == 0) {
  5271. Player player = playerArray[l1];
  5272. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  5273. for (int k2 = 0; k2 < npcCount; k2++) {
  5274. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5275. if (class30_sub2_sub4_sub1_sub1_2 != null
  5276. && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1
  5277. && class30_sub2_sub4_sub1_sub1_2.x == player.x
  5278. && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  5279. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc,
  5280. npcIndices[k2], j1, i1);
  5281. }
  5282.  
  5283. for (int i3 = 0; i3 < playerCount; i3++) {
  5284. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5285. if (class30_sub2_sub4_sub1_sub2_2 != null
  5286. && class30_sub2_sub4_sub1_sub2_2 != player
  5287. && class30_sub2_sub4_sub1_sub2_2.x == player.x
  5288. && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  5289. buildAtPlayerMenu(i1, playerIndices[i3],
  5290. class30_sub2_sub4_sub1_sub2_2, j1);
  5291. }
  5292.  
  5293. }
  5294. buildAtPlayerMenu(i1, l1, player, j1);
  5295. }
  5296. if (k1 == 3) {
  5297. NodeList class19 = groundArray[plane][i1][j1];
  5298. if (class19 != null) {
  5299. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19
  5300. .getNext()) {
  5301. ItemDef itemDef = ItemDef.forID(item.ID);
  5302. if (itemSelected == 1) {
  5303. menuActionName[menuActionRow] = "Use "
  5304. + selectedItemName + " with @lre@"
  5305. + itemDef.name;
  5306. menuActionID[menuActionRow] = 511;
  5307. menuActionCmd1[menuActionRow] = item.ID;
  5308. menuActionCmd2[menuActionRow] = i1;
  5309. menuActionCmd3[menuActionRow] = j1;
  5310. menuActionRow++;
  5311. } else if (spellSelected == 1) {
  5312. if ((spellUsableOn & 1) == 1) {
  5313. menuActionName[menuActionRow] = spellTooltip
  5314. + " @lre@" + itemDef.name;
  5315. menuActionID[menuActionRow] = 94;
  5316. menuActionCmd1[menuActionRow] = item.ID;
  5317. menuActionCmd2[menuActionRow] = i1;
  5318. menuActionCmd3[menuActionRow] = j1;
  5319. menuActionRow++;
  5320. }
  5321. } else {
  5322. for (int j3 = 4; j3 >= 0; j3--)
  5323. if (itemDef.groundActions != null
  5324. && itemDef.groundActions[j3] != null) {
  5325. menuActionName[menuActionRow] = itemDef.groundActions[j3]
  5326. + " @lre@" + itemDef.name;
  5327. if (j3 == 0)
  5328. menuActionID[menuActionRow] = 652;
  5329. if (j3 == 1)
  5330. menuActionID[menuActionRow] = 567;
  5331. if (j3 == 2)
  5332. menuActionID[menuActionRow] = 234;
  5333. if (j3 == 3)
  5334. menuActionID[menuActionRow] = 244;
  5335. if (j3 == 4)
  5336. menuActionID[menuActionRow] = 213;
  5337. menuActionCmd1[menuActionRow] = item.ID;
  5338. menuActionCmd2[menuActionRow] = i1;
  5339. menuActionCmd3[menuActionRow] = j1;
  5340. menuActionRow++;
  5341. } else if (j3 == 2) {
  5342. menuActionName[menuActionRow] = "Take @lre@"
  5343. + itemDef.name;
  5344. menuActionID[menuActionRow] = 234;
  5345. menuActionCmd1[menuActionRow] = item.ID;
  5346. menuActionCmd2[menuActionRow] = i1;
  5347. menuActionCmd3[menuActionRow] = j1;
  5348. menuActionRow++;
  5349. }
  5350.  
  5351. // menuActionName[menuActionRow] = "Examine @lre@" +
  5352. // itemDef.name + " @gre@(@whi@" + item.ID +
  5353. // "@gre@)";
  5354. menuActionName[menuActionRow] = "Examine @lre@"
  5355. + itemDef.name;
  5356. menuActionID[menuActionRow] = 1448;
  5357. menuActionCmd1[menuActionRow] = item.ID;
  5358. menuActionCmd2[menuActionRow] = i1;
  5359. menuActionCmd3[menuActionRow] = j1;
  5360. menuActionRow++;
  5361. }
  5362. }
  5363.  
  5364. }
  5365. }
  5366. }
  5367. }
  5368.  
  5369. public void cleanUpForQuit() {
  5370. signlink.reporterror = false;
  5371. try {
  5372. if (socketStream != null)
  5373. socketStream.close();
  5374. } catch (Exception _ex) {
  5375. }
  5376. socketStream = null;
  5377. stopMidi();
  5378. if (mouseDetection != null)
  5379. mouseDetection.running = false;
  5380. mouseDetection = null;
  5381. onDemandFetcher.disable();
  5382. onDemandFetcher = null;
  5383. aStream_834 = null;
  5384. stream = null;
  5385. aStream_847 = null;
  5386. inStream = null;
  5387. anIntArray1234 = null;
  5388. aByteArrayArray1183 = null;
  5389. aByteArrayArray1247 = null;
  5390. anIntArray1235 = null;
  5391. anIntArray1236 = null;
  5392. intGroundArray = null;
  5393. byteGroundArray = null;
  5394. worldController = null;
  5395. aClass11Array1230 = null;
  5396. anIntArrayArray901 = null;
  5397. anIntArrayArray825 = null;
  5398. bigX = null;
  5399. bigY = null;
  5400. aByteArray912 = null;
  5401. aRSImageProducer_1163 = null;
  5402. aRSImageProducer_1164 = null;
  5403. aRSImageProducer_1165 = null;
  5404. aRSImageProducer_1166 = null;
  5405. aRSImageProducer_1123 = null;
  5406. aRSImageProducer_1124 = null;
  5407. aRSImageProducer_1125 = null; /* Null pointers for custom sprites */
  5408. background = null;
  5409. // loginBox = null;
  5410. chatArea = null;
  5411. chatButtons = null;
  5412. ORBS = null;
  5413. HPBarFull = null;
  5414. HPBarEmpty = null;
  5415. chatButtonH = null;
  5416. chatButtonHC = null;
  5417. chatButtonC = null;
  5418. reportH = null;
  5419. tabArea = null;
  5420. mapArea = null;
  5421. logIconH = null;
  5422. logIconC = null;
  5423. emptyOrb = null;
  5424. hitPointsFill = null;
  5425. hitPointsIcon = null;
  5426. prayerFill = null;
  5427. prayerIcon = null;
  5428. frame = null; /**/
  5429. sideIcons = null;
  5430. redStones = null;
  5431. compass = null;
  5432. hitMarks = null;
  5433. headIcons = null;
  5434. skullIcons = null;
  5435. headIconsHint = null;
  5436. crosses = null;
  5437. mapDotItem = null;
  5438. mapDotNPC = null;
  5439. mapDotPlayer = null;
  5440. mapDotFriend = null;
  5441. mapDotTeam = null;
  5442. mapScenes = null;
  5443. mapFunctions = null;
  5444. anIntArrayArray929 = null;
  5445. playerArray = null;
  5446. playerIndices = null;
  5447. anIntArray894 = null;
  5448. aStreamArray895s = null;
  5449. anIntArray840 = null;
  5450. npcArray = null;
  5451. npcIndices = null;
  5452. groundArray = null;
  5453. aClass19_1179 = null;
  5454. aClass19_1013 = null;
  5455. aClass19_1056 = null;
  5456. menuActionCmd2 = null;
  5457. menuActionCmd3 = null;
  5458. menuActionID = null;
  5459. menuActionCmd1 = null;
  5460. menuActionName = null;
  5461. variousSettings = null;
  5462. anIntArray1072 = null;
  5463. anIntArray1073 = null;
  5464. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5465. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5466. friendsList = null;
  5467. friendsListAsLongs = null;
  5468. friendsNodeIDs = null;
  5469. aRSImageProducer_1110 = null;
  5470. aRSImageProducer_1111 = null;
  5471. aRSImageProducer_1107 = null;
  5472. aRSImageProducer_1108 = null;
  5473. aRSImageProducer_1109 = null;
  5474. aRSImageProducer_1112 = null;
  5475. aRSImageProducer_1113 = null;
  5476. aRSImageProducer_1114 = null;
  5477. aRSImageProducer_1115 = null;
  5478. multiOverlay = null;
  5479. nullLoader();
  5480. ObjectDef.nullLoader();
  5481. EntityDef.nullLoader();
  5482. ItemDef.nullLoader();
  5483. Floor.cache = null;
  5484. IDK.cache = null;
  5485. RSInterface.interfaceCache = null;
  5486. DummyClass.cache = null;
  5487. Animation.anims = null;
  5488. SpotAnim.cache = null;
  5489. SpotAnim.aMRUNodes_415 = null;
  5490. Varp.cache = null;
  5491. super.fullGameScreen = null;
  5492. Player.mruNodes = null;
  5493. Texture.nullLoader();
  5494. WorldController.nullLoader();
  5495. Model.nullLoader();
  5496. Class36.nullLoader();
  5497. System.gc();
  5498. }
  5499.  
  5500. private void printDebug() {
  5501. System.out.println("============");
  5502. System.out.println("flame-cycle:" + anInt1208);
  5503. if (onDemandFetcher != null)
  5504. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5505. System.out.println("loop-cycle:" + loopCycle);
  5506. System.out.println("draw-cycle:" + anInt1061);
  5507. System.out.println("ptype:" + pktType);
  5508. System.out.println("psize:" + pktSize);
  5509. if (socketStream != null)
  5510. socketStream.printDebug();
  5511. super.shouldDebug = true;
  5512. }
  5513.  
  5514. Component getGameComponent() {
  5515. if (signlink.mainapp != null)
  5516. return signlink.mainapp;
  5517. if (super.gameFrame != null)
  5518. return super.gameFrame;
  5519. else
  5520. return this;
  5521. }
  5522.  
  5523. public byte[] getModel(int Index) {
  5524. try {
  5525. File Model = new File("./Models/" + Index + ".gz");
  5526. byte[] aByte = new byte[(int) Model.length()];
  5527. FileInputStream fis = new FileInputStream(Model);
  5528. fis.read(aByte);
  5529. pushMessage("aByte = [" + aByte + "]!", 0, "");
  5530. fis.close();
  5531. return aByte;
  5532. } catch (Exception e) {
  5533. return null;
  5534. }
  5535. }
  5536.  
  5537. private void method73() {
  5538. do {
  5539. int j = readChar(-796);
  5540. if (j == -1)
  5541. break;
  5542. if (openInterfaceID != -1
  5543. && openInterfaceID == reportAbuseInterfaceID) {
  5544. if (j == 8 && reportAbuseInput.length() > 0)
  5545. reportAbuseInput = reportAbuseInput.substring(0,
  5546. reportAbuseInput.length() - 1);
  5547. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48
  5548. && j <= 57 || j == 32)
  5549. && reportAbuseInput.length() < 12)
  5550. reportAbuseInput += (char) j;
  5551. } else if (messagePromptRaised) {
  5552. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  5553. promptInput += (char) j;
  5554. inputTaken = true;
  5555. }
  5556. if (j == 8 && promptInput.length() > 0) {
  5557. promptInput = promptInput.substring(0,
  5558. promptInput.length() - 1);
  5559. inputTaken = true;
  5560. }
  5561. if (j == 13 || j == 10) {
  5562. messagePromptRaised = false;
  5563. inputTaken = true;
  5564. if (friendsListAction == 1) {
  5565. long l = TextClass.longForName(promptInput);
  5566. addFriend(l);
  5567. }
  5568. if (friendsListAction == 2 && friendsCount > 0) {
  5569. long l1 = TextClass.longForName(promptInput);
  5570. delFriend(l1);
  5571. }
  5572. if (friendsListAction == 3 && promptInput.length() > 0) {
  5573. stream.createFrame(126);
  5574. stream.writeWordBigEndian(0);
  5575. int k = stream.currentOffset;
  5576. stream.writeQWord(aLong953);
  5577. TextInput.method526(promptInput, stream);
  5578. stream.writeBytes(stream.currentOffset - k);
  5579. promptInput = TextInput.processText(promptInput);
  5580. // promptInput = Censor.doCensor(promptInput);
  5581. pushMessage(promptInput, 6, TextClass.fixName(TextClass
  5582. .nameForLong(aLong953)));
  5583. if (privateChatMode == 2) {
  5584. privateChatMode = 1;
  5585. stream.createFrame(95);
  5586. stream.writeWordBigEndian(publicChatMode);
  5587. stream.writeWordBigEndian(privateChatMode);
  5588. stream.writeWordBigEndian(tradeMode);
  5589. }
  5590. }
  5591. if (friendsListAction == 4 && ignoreCount < 100) {
  5592. long l2 = TextClass.longForName(promptInput);
  5593. addIgnore(l2);
  5594. }
  5595. if (friendsListAction == 5 && ignoreCount > 0) {
  5596. long l3 = TextClass.longForName(promptInput);
  5597. delIgnore(l3);
  5598. }
  5599. // clan chat
  5600. if (friendsListAction == 6) {
  5601. sendStringAsLong(promptInput);
  5602. } else if (friendsListAction == 8) {
  5603. sendString(1, promptInput);
  5604. } else if (friendsListAction == 9) {
  5605. sendString(2, promptInput);
  5606. } else if (friendsListAction == 10) {
  5607. sendString(3, promptInput);
  5608. }
  5609. }
  5610. } else if (inputDialogState == 1) {
  5611. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5612. amountOrNameInput += (char) j;
  5613. inputTaken = true;
  5614. }
  5615. if ((!amountOrNameInput.toLowerCase().contains("k")
  5616. && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput
  5617. .toLowerCase().contains("b"))
  5618. && (j == 107 || j == 109)
  5619. || j == 98) {
  5620. amountOrNameInput += (char) j;
  5621. inputTaken = true;
  5622. }
  5623. if (j == 8 && amountOrNameInput.length() > 0) {
  5624. amountOrNameInput = amountOrNameInput.substring(0,
  5625. amountOrNameInput.length() - 1);
  5626. inputTaken = true;
  5627. }
  5628. if (j == 13 || j == 10) {
  5629. if (amountOrNameInput.length() > 0) {
  5630. if (amountOrNameInput.length() > 0) {
  5631. if (amountOrNameInput.toLowerCase().contains("k")) {
  5632. amountOrNameInput = amountOrNameInput
  5633. .replaceAll("k", "000");
  5634. } else if (amountOrNameInput.toLowerCase()
  5635. .contains("m")) {
  5636. amountOrNameInput = amountOrNameInput
  5637. .replaceAll("m", "000000");
  5638. } else if (amountOrNameInput.toLowerCase()
  5639. .contains("b")) {
  5640. amountOrNameInput = amountOrNameInput
  5641. .replaceAll("b", "000000000");
  5642. }
  5643. int amount = 0;
  5644. amount = Integer.parseInt(amountOrNameInput);
  5645. stream.createFrame(208);
  5646. stream.writeDWord(amount);
  5647. }
  5648. inputDialogState = 0;
  5649. inputTaken = true;
  5650. }
  5651. }
  5652. } else if (inputDialogState == 2) {
  5653. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5654. amountOrNameInput += (char) j;
  5655. inputTaken = true;
  5656. }
  5657. if (j == 8 && amountOrNameInput.length() > 0) {
  5658. amountOrNameInput = amountOrNameInput.substring(0,
  5659. amountOrNameInput.length() - 1);
  5660. inputTaken = true;
  5661. }
  5662. if (j == 13 || j == 10) {
  5663. if (amountOrNameInput.length() > 0) {
  5664. stream.createFrame(60);
  5665. stream.writeQWord(TextClass
  5666. .longForName(amountOrNameInput));
  5667. }
  5668. inputDialogState = 0;
  5669. inputTaken = true;
  5670. }
  5671. } else if (backDialogID == -1) {
  5672. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  5673. inputString += (char) j;
  5674. inputTaken = true;
  5675. }
  5676. if (j == 8 && inputString.length() > 0) {
  5677. inputString = inputString.substring(0,
  5678. inputString.length() - 1);
  5679. inputTaken = true;
  5680. }
  5681. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5682. if (inputString.startsWith("/"))
  5683. inputString = "::" + inputString;
  5684. System.out.println(inputString);
  5685.  
  5686. if (inputString.equals("::clientdrop")) {
  5687. dropClient();
  5688. System.exit(0);
  5689. }
  5690. if (inputString.equals("::fpson"))
  5691. fpsOn = true;
  5692. if (inputString.equals("::fpsoff"))
  5693. fpsOn = false;
  5694. if (inputString.equals("::dataon"))
  5695. clientData = true;
  5696. if (inputString.equals("::dataoff"))
  5697. clientData = false;
  5698. if (myPrivilege == 3) {
  5699. if (inputString.startsWith("//setspecto")) {
  5700. int amt = Integer.parseInt(inputString.substring(12));
  5701. anIntArray1045[300] = amt;
  5702. if (variousSettings[300] != amt) {
  5703. variousSettings[300] = amt;
  5704. method33(300);
  5705. needDrawTabArea = true;
  5706. if (dialogID != -1)
  5707. inputTaken = true;
  5708. }
  5709. }
  5710. if (inputString.equals("::lag"))
  5711. printDebug();
  5712. if (inputString.equals("::prefetchmusic")) {
  5713. for (int j1 = 0; j1 < onDemandFetcher
  5714. .getVersionCount(2); j1++)
  5715. onDemandFetcher.method563((byte) 1, 2, j1);
  5716.  
  5717. }
  5718. if (inputString.equals("::fpson"))
  5719. fpsOn = true;
  5720. if (inputString.equals("::fpsoff"))
  5721. fpsOn = false;
  5722. if (inputString.equals("::noclip")) {
  5723. for (int k1 = 0; k1 < 4; k1++) {
  5724. for (int i2 = 1; i2 < 103; i2++) {
  5725. for (int k2 = 1; k2 < 103; k2++)
  5726. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5727.  
  5728. }
  5729. }
  5730. }
  5731. }
  5732. if (inputString.startsWith("::")) {
  5733. stream.createFrame(103);
  5734. stream.writeWordBigEndian(inputString.length() - 1);
  5735. stream.writeString(inputString.substring(2));
  5736. } else {
  5737. String s = inputString.toLowerCase();
  5738. int j2 = 0;
  5739. if (s.startsWith("yellow:")) {
  5740. j2 = 0;
  5741. inputString = inputString.substring(7);
  5742. } else if (s.startsWith("red:")) {
  5743. j2 = 1;
  5744. inputString = inputString.substring(4);
  5745. } else if (s.startsWith("green:")) {
  5746. j2 = 2;
  5747. inputString = inputString.substring(6);
  5748. } else if (s.startsWith("cyan:")) {
  5749. j2 = 3;
  5750. inputString = inputString.substring(5);
  5751. } else if (s.startsWith("purple:")) {
  5752. j2 = 4;
  5753. inputString = inputString.substring(7);
  5754. } else if (s.startsWith("white:")) {
  5755. j2 = 5;
  5756. inputString = inputString.substring(6);
  5757. } else if (s.startsWith("flash1:")) {
  5758. j2 = 6;
  5759. inputString = inputString.substring(7);
  5760. } else if (s.startsWith("flash2:")) {
  5761. j2 = 7;
  5762. inputString = inputString.substring(7);
  5763. } else if (s.startsWith("flash3:")) {
  5764. j2 = 8;
  5765. inputString = inputString.substring(7);
  5766. } else if (s.startsWith("glow1:")) {
  5767. j2 = 9;
  5768. inputString = inputString.substring(6);
  5769. } else if (s.startsWith("glow2:")) {
  5770. j2 = 10;
  5771. inputString = inputString.substring(6);
  5772. } else if (s.startsWith("glow3:")) {
  5773. j2 = 11;
  5774. inputString = inputString.substring(6);
  5775. }
  5776. s = inputString.toLowerCase();
  5777. int i3 = 0;
  5778. if (s.startsWith("wave:")) {
  5779. i3 = 1;
  5780. inputString = inputString.substring(5);
  5781. } else if (s.startsWith("wave2:")) {
  5782. i3 = 2;
  5783. inputString = inputString.substring(6);
  5784. } else if (s.startsWith("shake:")) {
  5785. i3 = 3;
  5786. inputString = inputString.substring(6);
  5787. } else if (s.startsWith("scroll:")) {
  5788. i3 = 4;
  5789. inputString = inputString.substring(7);
  5790. } else if (s.startsWith("slide:")) {
  5791. i3 = 5;
  5792. inputString = inputString.substring(6);
  5793. }
  5794. stream.createFrame(4);
  5795. stream.writeWordBigEndian(0);
  5796. int j3 = stream.currentOffset;
  5797. stream.method425(i3);
  5798. stream.method425(j2);
  5799. aStream_834.currentOffset = 0;
  5800. TextInput.method526(inputString, aStream_834);
  5801. stream.method441(0, aStream_834.buffer,
  5802. aStream_834.currentOffset);
  5803. stream.writeBytes(stream.currentOffset - j3);
  5804. inputString = TextInput.processText(inputString);
  5805. // inputString = Censor.doCensor(inputString);
  5806. myPlayer.textSpoken = inputString;
  5807. myPlayer.anInt1513 = j2;
  5808. myPlayer.anInt1531 = i3;
  5809. myPlayer.textCycle = 150;
  5810. String cr = "";
  5811. if (myPrivilege == 10)
  5812. cr = "@cr10@";
  5813. if (myPrivilege == 9)
  5814. cr = "@cr9@";
  5815. if (myPrivilege == 8)
  5816. cr = "@cr8@";
  5817. if (myPrivilege == 7)
  5818. cr = "@cr7@";
  5819. if (myPrivilege == 6)
  5820. cr = "@cr6@";
  5821. if (myPrivilege == 5)
  5822. cr = "@cr5@";
  5823. if (myPrivilege == 4)
  5824. cr = "@cr4@";
  5825. if (myPrivilege == 3)
  5826. cr = "@cr3@";
  5827. if (myPrivilege == 2)
  5828. cr = "@cr2@";
  5829. if (myPrivilege == 1)
  5830. cr = "@cr1@";
  5831. pushMessage(myPlayer.textSpoken, 2, cr + "<col="
  5832. + titleColor(myPlayer.titleColor, 0) + ">"
  5833. + myPlayer.title + "</col> " + myPlayer.name);
  5834. // myself
  5835. if (publicChatMode == 2) {
  5836. publicChatMode = 3;
  5837. stream.createFrame(95);
  5838. stream.writeWordBigEndian(publicChatMode);
  5839. stream.writeWordBigEndian(privateChatMode);
  5840. stream.writeWordBigEndian(tradeMode);
  5841. }
  5842. }
  5843. inputString = "";
  5844. inputTaken = true;
  5845. }
  5846. }
  5847. } while (true);
  5848. }
  5849.  
  5850. private void buildPublicChat(int j) {
  5851. int l = 0;
  5852. for (int i1 = 0; i1 < 500; i1++) {
  5853. if (chatMessages[i1] == null)
  5854. continue;
  5855. if (chatTypeView != 1)
  5856. continue;
  5857. int j1 = chatTypes[i1];
  5858. String s = chatNames[i1];
  5859. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5860. if (k1 < -23)
  5861. break;
  5862. if (s != null && s.startsWith("@cr"))
  5863. s = s.substring(5);
  5864. if (s != null && s.startsWith("<col=")) {
  5865. s = s.substring(s.indexOf("</col>") + 6);
  5866. }
  5867. if (s != null && s.startsWith("@cr1@"))
  5868. s = s.substring(5);
  5869. if (s != null && s.startsWith("@cr2@"))
  5870. s = s.substring(5);
  5871. if (s != null && s.startsWith("@cr3@"))
  5872. s = s.substring(5);
  5873. if (s != null && s.startsWith("@cr4@"))
  5874. s = s.substring(5);
  5875. if (s != null && s.startsWith("@cr5@"))
  5876. s = s.substring(5);
  5877. if (s != null && s.startsWith("@cr6@"))
  5878. s = s.substring(5);
  5879. if (s != null && s.startsWith("@cr7@"))
  5880. s = s.substring(5);
  5881. if (s != null && s.startsWith("@cr8@"))
  5882. s = s.substring(5);
  5883. if (s != null && s.startsWith("@cr9@"))
  5884. s = s.substring(5);
  5885. if (s != null && s.startsWith("@cr10@"))
  5886. s = s.substring(6);
  5887. if ((j1 == 1 || j1 == 2)
  5888. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  5889. && isFriendOrSelf(s))) {
  5890. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5891. if (myPrivilege >= 1) {
  5892. menuActionName[menuActionRow] = "Report abuse @whi@"
  5893. + s;
  5894. menuActionID[menuActionRow] = 606;
  5895. menuActionRow++;
  5896. }
  5897. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5898. menuActionID[menuActionRow] = 42;
  5899. menuActionRow++;
  5900. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5901. menuActionID[menuActionRow] = 337;
  5902. menuActionRow++;
  5903. }
  5904. l++;
  5905. }
  5906. }
  5907. }
  5908.  
  5909. private void buildFriendChat(int j) {
  5910. int l = 0;
  5911. for (int i1 = 0; i1 < 500; i1++) {
  5912. if (chatMessages[i1] == null)
  5913. continue;
  5914. if (chatTypeView != 2)
  5915. continue;
  5916. int j1 = chatTypes[i1];
  5917. String s = chatNames[i1];
  5918. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5919. if (k1 < -23)
  5920. break;
  5921. if (s != null && s.startsWith("@cr1@"))
  5922. s = s.substring(5);
  5923. if (s != null && s.startsWith("@cr2@"))
  5924. s = s.substring(5);
  5925. if (s != null && s.startsWith("@cr3@"))
  5926. s = s.substring(5);
  5927. if (s != null && s.startsWith("@cr4@"))
  5928. s = s.substring(5);
  5929. if (s != null && s.startsWith("@cr5@"))
  5930. s = s.substring(5);
  5931. if (s != null && s.startsWith("@cr6@"))
  5932. s = s.substring(5);
  5933. if (s != null && s.startsWith("@cr7@"))
  5934. s = s.substring(5);
  5935. if (s != null && s.startsWith("@cr8@"))
  5936. s = s.substring(5);
  5937. if (s != null && s.startsWith("@cr9@"))
  5938. s = s.substring(5);
  5939. if (s != null && s.startsWith("@cr10@"))
  5940. s = s.substring(5);
  5941. if ((j1 == 5 || j1 == 6)
  5942. && (splitPrivateChat == 0 || chatTypeView == 2)
  5943. && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1
  5944. && isFriendOrSelf(s)))
  5945. l++;
  5946. if ((j1 == 3 || j1 == 7)
  5947. && (splitPrivateChat == 0 || chatTypeView == 2)
  5948. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  5949. && isFriendOrSelf(s))) {
  5950. if (j > k1 - 14 && j <= k1) {
  5951. if (myPrivilege >= 1) {
  5952. menuActionName[menuActionRow] = "Report abuse @whi@"
  5953. + s;
  5954. menuActionID[menuActionRow] = 606;
  5955. menuActionRow++;
  5956. }
  5957. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5958. menuActionID[menuActionRow] = 42;
  5959. menuActionRow++;
  5960. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5961. menuActionID[menuActionRow] = 337;
  5962. menuActionRow++;
  5963. }
  5964. l++;
  5965. }
  5966. }
  5967. }
  5968.  
  5969. private void buildDuelorTrade(int j) {
  5970. int l = 0;
  5971. for (int i1 = 0; i1 < 500; i1++) {
  5972. if (chatMessages[i1] == null)
  5973. continue;
  5974. if (chatTypeView != 3 && chatTypeView != 4)
  5975. continue;
  5976. int j1 = chatTypes[i1];
  5977. String s = chatNames[i1];
  5978. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5979. if (k1 < -23)
  5980. break;
  5981. if (s != null && s.startsWith("@cr1@"))
  5982. s = s.substring(5);
  5983. if (s != null && s.startsWith("@cr2@"))
  5984. s = s.substring(5);
  5985. if (s != null && s.startsWith("@cr3@"))
  5986. s = s.substring(5);
  5987. if (s != null && s.startsWith("@cr4@"))
  5988. s = s.substring(5);
  5989. if (s != null && s.startsWith("@cr5@"))
  5990. s = s.substring(5);
  5991. if (s != null && s.startsWith("@cr6@"))
  5992. s = s.substring(5);
  5993. if (s != null && s.startsWith("@cr7@"))
  5994. s = s.substring(5);
  5995. if (s != null && s.startsWith("@cr8@"))
  5996. s = s.substring(5);
  5997. if (s != null && s.startsWith("@cr9@"))
  5998. s = s.substring(5);
  5999. if (s != null && s.startsWith("@cr10@"))
  6000. s = s.substring(6);
  6001. if (chatTypeView == 3 && j1 == 4
  6002. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6003. if (j > k1 - 14 && j <= k1) {
  6004. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6005. menuActionID[menuActionRow] = 484;
  6006. menuActionRow++;
  6007. }
  6008. l++;
  6009. }
  6010. if (chatTypeView == 4 && j1 == 8
  6011. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6012. if (j > k1 - 14 && j <= k1) {
  6013. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6014. + s;
  6015. menuActionID[menuActionRow] = 6;
  6016. menuActionRow++;
  6017. }
  6018. l++;
  6019. }
  6020. if (j1 == 12) {
  6021. if (j > k1 - 14 && j <= k1) {
  6022. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6023. menuActionID[menuActionRow] = 915;
  6024. menuActionRow++;
  6025. }
  6026. l++;
  6027. }
  6028. }
  6029. }
  6030.  
  6031. private void buildChatAreaMenu(int j) {
  6032. int l = 0;
  6033. int test = 0;
  6034. for (int i1 = 0; i1 < 500; i1++) {
  6035. if (chatMessages[i1] == null)
  6036. continue;
  6037. int j1 = chatTypes[i1];
  6038. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6039. if (k1 < -23)
  6040. break;
  6041. String s = chatNames[i1];
  6042. String ct = chatMessages[i1];
  6043. boolean flag = false;
  6044. if (chatTypeView == 1) {
  6045. buildPublicChat(j);
  6046. break;
  6047. }
  6048. if (chatTypeView == 2) {
  6049. buildFriendChat(j);
  6050. break;
  6051. }
  6052. if (chatTypeView == 3 || chatTypeView == 4) {
  6053. buildDuelorTrade(j);
  6054. break;
  6055. }
  6056. if (chatTypeView == 5) {
  6057. break;
  6058. }
  6059. if (s != null && s.startsWith("@cr1@")) {
  6060. s = s.substring(5);
  6061. }
  6062. if (s != null && s.startsWith("@cr2@")) {
  6063. s = s.substring(5);
  6064. }
  6065. if (s != null && s.startsWith("@cr3@")) {
  6066. s = s.substring(5);
  6067. }
  6068. if (s != null && s.startsWith("@cr4@")) {
  6069. s = s.substring(5);
  6070. }
  6071. if (s != null && s.startsWith("@cr5@")) {
  6072. s = s.substring(5);
  6073. }
  6074. if (s != null && s.startsWith("@cr6@")) {
  6075. s = s.substring(5);
  6076. }
  6077. if (s != null && s.startsWith("@cr7@")) {
  6078. s = s.substring(5);
  6079. }
  6080. if (s != null && s.startsWith("@cr8@")) {
  6081. s = s.substring(5);
  6082. }
  6083. if (s != null && s.startsWith("@cr9@")) {
  6084. s = s.substring(5);
  6085. }
  6086. if (s != null && s.startsWith("@cr10@")) {
  6087. s = s.substring(6);
  6088. }
  6089. if (s != null && s.startsWith("<col=")) {
  6090. s = s.substring(s.indexOf("</col>") + 6);
  6091. }
  6092. if (j1 == 0)
  6093. l++;
  6094. if ((j1 == 1 || j1 == 2)
  6095. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6096. && isFriendOrSelf(s))) {
  6097. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6098. if (myPrivilege >= 1) {
  6099. menuActionName[menuActionRow] = "Report abuse @whi@"
  6100. + s;
  6101. menuActionID[menuActionRow] = 606;
  6102. menuActionRow++;
  6103. }
  6104. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6105. menuActionID[menuActionRow] = 42;
  6106. menuActionRow++;
  6107. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6108. menuActionID[menuActionRow] = 337;
  6109. menuActionRow++;
  6110. }
  6111. l++;
  6112. }
  6113. if ((j1 == 3 || j1 == 7)
  6114. && splitPrivateChat == 0
  6115. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6116. && isFriendOrSelf(s))) {
  6117. if (j > k1 - 14 && j <= k1) {
  6118. if (myPrivilege >= 1) {
  6119. menuActionName[menuActionRow] = "Report abuse @whi@"
  6120. + s;
  6121. menuActionID[menuActionRow] = 606;
  6122. menuActionRow++;
  6123. }
  6124. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6125. menuActionID[menuActionRow] = 42;
  6126. menuActionRow++;
  6127. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6128. menuActionID[menuActionRow] = 337;
  6129. menuActionRow++;
  6130. }
  6131. l++;
  6132. }
  6133. if (j1 == 4
  6134. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6135. if (j > k1 - 14 && j <= k1) {
  6136. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6137. menuActionID[menuActionRow] = 484;
  6138. menuActionRow++;
  6139. }
  6140. l++;
  6141. }
  6142. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0
  6143. && privateChatMode < 2)
  6144. l++;
  6145. if (j1 == 8
  6146. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6147. if (j > k1 - 14 && j <= k1) {
  6148. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6149. + s;
  6150. menuActionID[menuActionRow] = 6;
  6151. menuActionRow++;
  6152. }
  6153. l++;
  6154. }
  6155. }
  6156. }
  6157.  
  6158. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6159. int j = class9.contentType;
  6160. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6161. if (j == 1 && anInt900 == 0) {
  6162. class9.message = "Loading friend list";
  6163. class9.atActionType = 0;
  6164. return;
  6165. }
  6166. if (j == 1 && anInt900 == 1) {
  6167. class9.message = "Connecting to friendserver";
  6168. class9.atActionType = 0;
  6169. return;
  6170. }
  6171. if (j == 2 && anInt900 != 2) {
  6172. class9.message = "Please wait...";
  6173. class9.atActionType = 0;
  6174. return;
  6175. }
  6176. int k = friendsCount;
  6177. if (anInt900 != 2)
  6178. k = 0;
  6179. if (j > 700)
  6180. j -= 601;
  6181. else
  6182. j--;
  6183. if (j >= k) {
  6184. class9.message = "";
  6185. class9.atActionType = 0;
  6186. return;
  6187. } else {
  6188. class9.message = friendsList[j];
  6189. class9.atActionType = 1;
  6190. return;
  6191. }
  6192. }
  6193. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6194. int l = friendsCount;
  6195. if (anInt900 != 2)
  6196. l = 0;
  6197. if (j > 800)
  6198. j -= 701;
  6199. else
  6200. j -= 101;
  6201. if (j >= l) {
  6202. class9.message = "";
  6203. class9.atActionType = 0;
  6204. return;
  6205. }
  6206. if (friendsNodeIDs[j] == 0)
  6207. class9.message = "@red@Offline";
  6208. else if (friendsNodeIDs[j] == nodeID)
  6209. class9.message = "@gre@Online" /* + (friendsNodeIDs[j] - 9) */
  6210. ;
  6211. else
  6212. class9.message = "@red@Offline" /* + (friendsNodeIDs[j] - 9) */
  6213. ;
  6214. class9.atActionType = 1;
  6215. return;
  6216. }
  6217. if (j == 203) {
  6218. int i1 = friendsCount;
  6219. if (anInt900 != 2)
  6220. i1 = 0;
  6221. class9.scrollMax = i1 * 15 + 20;
  6222. if (class9.scrollMax <= class9.height)
  6223. class9.scrollMax = class9.height + 1;
  6224. return;
  6225. }
  6226. if (j >= 401 && j <= 500) {
  6227. if ((j -= 401) == 0 && anInt900 == 0) {
  6228. class9.message = "Loading ignore list";
  6229. class9.atActionType = 0;
  6230. return;
  6231. }
  6232. if (j == 1 && anInt900 == 0) {
  6233. class9.message = "Please wait...";
  6234. class9.atActionType = 0;
  6235. return;
  6236. }
  6237. int j1 = ignoreCount;
  6238. if (anInt900 == 0)
  6239. j1 = 0;
  6240. if (j >= j1) {
  6241. class9.message = "";
  6242. class9.atActionType = 0;
  6243. return;
  6244. } else {
  6245. class9.message = TextClass.fixName(TextClass
  6246. .nameForLong(ignoreListAsLongs[j]));
  6247. class9.atActionType = 1;
  6248. return;
  6249. }
  6250. }
  6251. if (j == 503) {
  6252. class9.scrollMax = ignoreCount * 15 + 20;
  6253. if (class9.scrollMax <= class9.height)
  6254. class9.scrollMax = class9.height + 1;
  6255. return;
  6256. }
  6257. if (j == 327) {
  6258. class9.modelRotation1 = 150;
  6259. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6260. if (aBoolean1031) {
  6261. for (int k1 = 0; k1 < 7; k1++) {
  6262. int l1 = anIntArray1065[k1];
  6263. if (l1 >= 0 && !IDK.cache[l1].method537())
  6264. return;
  6265. }
  6266.  
  6267. aBoolean1031 = false;
  6268. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6269. int i2 = 0;
  6270. for (int j2 = 0; j2 < 7; j2++) {
  6271. int k2 = anIntArray1065[j2];
  6272. if (k2 >= 0)
  6273. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  6274. .method538();
  6275. }
  6276.  
  6277. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6278. for (int l2 = 0; l2 < 5; l2++)
  6279. if (anIntArray990[l2] != 0) {
  6280. model.method476(anIntArrayArray1003[l2][0],
  6281. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6282. if (l2 == 1)
  6283. model.method476(anIntArray1204[0],
  6284. anIntArray1204[anIntArray990[l2]]);
  6285. // if(l2 == 1)
  6286. // model.method476(Legs2[0], Legs2[anIntArray990[l2]]);
  6287. }
  6288.  
  6289. model.method469();
  6290. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6291. model.method479(64, 1300, 0, -570, 0, true);
  6292. class9.anInt233 = 5;
  6293. class9.mediaID = 0;
  6294. RSInterface.method208(aBoolean994, model);
  6295. }
  6296. return;
  6297. }
  6298. if (j == 328) {
  6299. RSInterface rsInterface = class9;
  6300. int verticleTilt = 150;
  6301. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6302. rsInterface.modelRotation1 = verticleTilt;
  6303. rsInterface.modelRotation2 = animationSpeed;
  6304. if (aBoolean1031) {
  6305. Model characterDisplay = myPlayer.method452();
  6306. for (int l2 = 0; l2 < 5; l2++)
  6307. if (anIntArray990[l2] != 0) {
  6308. characterDisplay.method476(anIntArrayArray1003[l2][0],
  6309. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6310. if (l2 == 1)
  6311. characterDisplay.method476(anIntArray1204[0],
  6312. anIntArray1204[anIntArray990[l2]]);
  6313. }
  6314. int staticFrame = myPlayer.anInt1511;
  6315. characterDisplay.method469();
  6316. characterDisplay
  6317. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  6318. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6319. rsInterface.anInt233 = 5;
  6320. rsInterface.mediaID = 0;
  6321. RSInterface.method208(aBoolean994, characterDisplay);
  6322. }
  6323. return;
  6324. }
  6325. if (j == 324) {
  6326. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6327. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6328. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6329. }
  6330. if (aBoolean1047) {
  6331. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6332. return;
  6333. } else {
  6334. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6335. return;
  6336. }
  6337. }
  6338. if (j == 325) {
  6339. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6340. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6341. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6342. }
  6343. if (aBoolean1047) {
  6344. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6345. return;
  6346. } else {
  6347. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6348. return;
  6349. }
  6350. }
  6351. if (j == 600) {
  6352. class9.message = reportAbuseInput;
  6353. if (loopCycle % 20 < 10) {
  6354. class9.message += "|";
  6355. return;
  6356. } else {
  6357. class9.message += " ";
  6358. return;
  6359. }
  6360. }
  6361. if (j == 613)
  6362. if (myPrivilege >= 1) {
  6363. if (canMute) {
  6364. class9.textColor = 0xff0000;
  6365. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  6366. } else {
  6367. class9.textColor = 0xffffff;
  6368. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  6369. }
  6370. } else {
  6371. class9.message = "";
  6372. }
  6373. if (j == 650 || j == 655)
  6374. if (anInt1193 != 0) {
  6375. String s;
  6376. if (daysSinceLastLogin == 0)
  6377. s = "earlier today";
  6378. else if (daysSinceLastLogin == 1)
  6379. s = "yesterday";
  6380. else
  6381. s = daysSinceLastLogin + " days ago";
  6382. class9.message = "You last logged in " + s + " from: "
  6383. + signlink.dns;
  6384. } else {
  6385. class9.message = "";
  6386. }
  6387. if (j == 651) {
  6388. if (unreadMessages == 0) {
  6389. class9.message = "0 unread messages";
  6390. class9.textColor = 0xffff00;
  6391. }
  6392. if (unreadMessages == 1) {
  6393. class9.message = "1 unread message";
  6394. class9.textColor = 65280;
  6395. }
  6396. if (unreadMessages > 1) {
  6397. class9.message = unreadMessages + " unread messages";
  6398. class9.textColor = 65280;
  6399. }
  6400. }
  6401. if (j == 652)
  6402. if (daysSinceRecovChange == 201) {
  6403. if (membersInt == 1)
  6404. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6405. else
  6406. class9.message = "";
  6407. } else if (daysSinceRecovChange == 200) {
  6408. class9.message = "You have not yet set any password recovery questions.";
  6409. } else {
  6410. String s1;
  6411. if (daysSinceRecovChange == 0)
  6412. s1 = "Earlier today";
  6413. else if (daysSinceRecovChange == 1)
  6414. s1 = "Yesterday";
  6415. else
  6416. s1 = daysSinceRecovChange + " days ago";
  6417. class9.message = s1 + " you changed your recovery questions";
  6418. }
  6419. if (j == 653)
  6420. if (daysSinceRecovChange == 201) {
  6421. if (membersInt == 1)
  6422. class9.message = "@whi@recommend you use a members world instead. You may use";
  6423. else
  6424. class9.message = "";
  6425. } else if (daysSinceRecovChange == 200)
  6426. class9.message = "We strongly recommend you do so now to secure your account.";
  6427. else
  6428. class9.message = "If you do not remember making this change then cancel it immediately";
  6429. if (j == 654) {
  6430. if (daysSinceRecovChange == 201)
  6431. if (membersInt == 1) {
  6432. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6433. return;
  6434. } else {
  6435. class9.message = "";
  6436. return;
  6437. }
  6438. if (daysSinceRecovChange == 200) {
  6439. class9.message = "Do this from the 'account management' area on our front webpage";
  6440. return;
  6441. }
  6442. class9.message = "Do this from the 'account management' area on our front webpage";
  6443. }
  6444. }
  6445.  
  6446. private void drawSplitPrivateChat() {
  6447. if (splitPrivateChat == 0)
  6448. return;
  6449. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6450. int i = 0;
  6451. if (anInt1104 != 0)
  6452. i = 1;
  6453. for (int j = 0; j < 100; j++)
  6454. if (chatMessages[j] != null) {
  6455. int k = chatTypes[j];
  6456. String s = chatNames[j];
  6457. byte byte1 = 0;
  6458. if (s != null && s.startsWith("@cr1@")) {
  6459. s = s.substring(5);
  6460. byte1 = 1;
  6461. }
  6462. if (s != null && s.startsWith("@cr2@")) {
  6463. s = s.substring(5);
  6464. byte1 = 2;
  6465. }
  6466. if (s != null && s.startsWith("@cr3@")) {
  6467. s = s.substring(5);
  6468. byte1 = 3;
  6469. }
  6470. if (s != null && s.startsWith("@cr4@")) {
  6471. s = s.substring(5);
  6472. byte1 = 4;
  6473. }
  6474. if (s != null && s.startsWith("@cr5@")) {
  6475. s = s.substring(5);
  6476. byte1 = 5;
  6477. }
  6478. if (s != null && s.startsWith("@cr6@")) {
  6479. s = s.substring(5);
  6480. byte1 = 6;
  6481. }
  6482. if (s != null && s.startsWith("@cr7@")) {
  6483. s = s.substring(5);
  6484. byte1 = 7;
  6485. }
  6486. if (s != null && s.startsWith("@cr8@")) {
  6487. s = s.substring(5);
  6488. byte1 = 8;
  6489. }
  6490. if (s != null && s.startsWith("@cr9@")) {
  6491. s = s.substring(5);
  6492. byte1 = 9;
  6493. }
  6494. if (s != null && s.startsWith("@cr10@")) {
  6495. s = s.substring(5);
  6496. byte1 = 10;
  6497. }
  6498. if ((k == 3 || k == 7)
  6499. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  6500. && isFriendOrSelf(s))) {
  6501. int l = 329 - i * 13;
  6502. int k1 = 4;
  6503. textDrawingArea.method385(0, "From", l, k1);
  6504. textDrawingArea.method385(65535, "From", l - 1, k1);
  6505. k1 += textDrawingArea.getTextWidth("From ");
  6506. if (byte1 == 1) {
  6507. modIcons[1].drawSprite(k1, l - 12);
  6508. k1 += 12;
  6509. }
  6510. if (byte1 == 2) {
  6511. modIcons[2].drawSprite(k1, l - 12);
  6512. k1 += 12;
  6513. }
  6514. if (byte1 == 3) {
  6515. modIcons[3].drawSprite(k1, l - 12);
  6516. k1 += 12;
  6517. }
  6518. if (byte1 == 4) {
  6519. modIcons[4].drawSprite(k1, l - 12);
  6520. k1 += 12;
  6521. }
  6522. if (byte1 == 5) {
  6523. modIcons[5].drawSprite(k1, l - 12);
  6524. k1 += 12;
  6525. }
  6526. if (byte1 == 6) {
  6527. modIcons[6].drawSprite(k1, l - 12);
  6528. k1 += 12;
  6529. }
  6530. if (byte1 == 7) {
  6531. modIcons[7].drawSprite(k1, l - 12);
  6532. k1 += 12;
  6533. }
  6534. if (byte1 == 8) {
  6535. modIcons[8].drawSprite(k1, l - 12);
  6536. k1 += 12;
  6537. }
  6538. if (byte1 == 9) {
  6539. modIcons[9].drawSprite(k1, l - 12);
  6540. k1 += 12;
  6541. }
  6542. if (byte1 == 10) {
  6543. modIcons[10].drawSprite(k1, l - 12);
  6544. k1 += 12;
  6545. }
  6546. textDrawingArea.method385(0, s + ": " + chatMessages[j], l,
  6547. k1);
  6548. textDrawingArea.method385(65535,
  6549. s + ": " + chatMessages[j], l - 1, k1);
  6550. if (++i >= 5)
  6551. return;
  6552. }
  6553. if (k == 5 && privateChatMode < 2) {
  6554. int i1 = 329 - i * 13;
  6555. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6556. textDrawingArea
  6557. .method385(65535, chatMessages[j], i1 - 1, 4);
  6558. if (++i >= 5)
  6559. return;
  6560. }
  6561. if (k == 6 && privateChatMode < 2) {
  6562. int j1 = 329 - i * 13;
  6563. textDrawingArea.method385(0, "To " + s + ": "
  6564. + chatMessages[j], j1, 4);
  6565. textDrawingArea.method385(65535, "To " + s + ": "
  6566. + chatMessages[j], j1 - 1, 4);
  6567. if (++i >= 5)
  6568. return;
  6569. }
  6570. }
  6571.  
  6572. }
  6573.  
  6574. public void pushMessage(String s, int i, String s1) {
  6575. if (i == 0 && dialogID != -1) {
  6576. aString844 = s;
  6577. super.clickMode3 = 0;
  6578. }
  6579. if (backDialogID == -1)
  6580. inputTaken = true;
  6581. for (int j = 499; j > 0; j--) {
  6582. chatTypes[j] = chatTypes[j - 1];
  6583. chatNames[j] = chatNames[j - 1];
  6584. chatMessages[j] = chatMessages[j - 1];
  6585. chatRights[j] = chatRights[j - 1];
  6586. clanTitles[j] = clanTitles[j - 1];
  6587. }
  6588. chatTypes[0] = i;
  6589. chatNames[0] = s1;
  6590. chatMessages[0] = s;
  6591. chatRights[0] = channelRights;
  6592. clanTitles[0] = clanTitle;
  6593. }
  6594.  
  6595. public int logIconHPos = 0;
  6596.  
  6597. public void processMapAreaClick() {
  6598. if (super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1
  6599. && super.mouseY <= 23) {
  6600. logIconHPos = 1;
  6601. } else {
  6602. logIconHPos = 0;
  6603. }
  6604. }
  6605.  
  6606. private void processTabClick() {
  6607. if (super.clickMode3 == 1) {
  6608. if (super.saveClickX >= 524 && super.saveClickX <= 561
  6609. && super.saveClickY >= 169 && super.saveClickY < 205
  6610. && tabInterfaceIDs[0] != -1) {
  6611. needDrawTabArea = true;
  6612. tabID = 0;
  6613. tabAreaAltered = true;
  6614. }
  6615. if (super.saveClickX >= 562 && super.saveClickX <= 594
  6616. && super.saveClickY >= 168 && super.saveClickY < 205
  6617. && tabInterfaceIDs[1] != -1) {
  6618. needDrawTabArea = true;
  6619. tabID = 1;
  6620. tabAreaAltered = true;
  6621. }
  6622. if (super.saveClickX >= 595 && super.saveClickX <= 626
  6623. && super.saveClickY >= 168 && super.saveClickY < 205
  6624. && tabInterfaceIDs[2] != -1) {
  6625. needDrawTabArea = true;
  6626. tabID = 2;
  6627. tabAreaAltered = true;
  6628. }
  6629. if (super.saveClickX >= 627 && super.saveClickX <= 660
  6630. && super.saveClickY >= 168 && super.saveClickY < 203
  6631. && tabInterfaceIDs[3] != -1) {
  6632. needDrawTabArea = true;
  6633. tabID = 3;
  6634. tabAreaAltered = true;
  6635. }
  6636. if (super.saveClickX >= 661 && super.saveClickX <= 693
  6637. && super.saveClickY >= 168 && super.saveClickY < 205
  6638. && tabInterfaceIDs[4] != -1) {
  6639. needDrawTabArea = true;
  6640. tabID = 4;
  6641. tabAreaAltered = true;
  6642. }
  6643. if (super.saveClickX >= 694 && super.saveClickX <= 725
  6644. && super.saveClickY >= 168 && super.saveClickY < 205
  6645. && tabInterfaceIDs[5] != -1) {
  6646. needDrawTabArea = true;
  6647. tabID = 5;
  6648. tabAreaAltered = true;
  6649. }
  6650. if (super.saveClickX >= 726 && super.saveClickX <= 765
  6651. && super.saveClickY >= 169 && super.saveClickY < 205
  6652. && tabInterfaceIDs[6] != -1) {
  6653. needDrawTabArea = true;
  6654. tabID = 6;
  6655. tabAreaAltered = true;
  6656. }
  6657. if (super.saveClickX >= 627 && super.saveClickX <= 664
  6658. && super.saveClickY >= 466 && super.saveClickY < 503
  6659. && tabInterfaceIDs[7] != -1) {
  6660. needDrawTabArea = true;
  6661. tabID = 7;
  6662. tabAreaAltered = true;
  6663. }
  6664. if (super.saveClickX >= 562 && super.saveClickX <= 594
  6665. && super.saveClickY >= 466 && super.saveClickY < 503
  6666. && tabInterfaceIDs[8] != -1) {
  6667. needDrawTabArea = true;
  6668. tabID = 8;
  6669. tabAreaAltered = true;
  6670. }
  6671. if (super.saveClickX >= 595 && super.saveClickX <= 627
  6672. && super.saveClickY >= 466 && super.saveClickY < 503
  6673. && tabInterfaceIDs[9] != -1) {
  6674. needDrawTabArea = true;
  6675. tabID = 9;
  6676. tabAreaAltered = true;
  6677. }
  6678. if (super.saveClickX >= 742 && super.saveClickX <= 764
  6679. && super.saveClickY >= 1 && super.saveClickY < 24
  6680. && tabInterfaceIDs[10] != -1) {
  6681. needDrawTabArea = true;
  6682. tabID = 10;
  6683. tabAreaAltered = true;
  6684. }
  6685. if (super.saveClickX >= 661 && super.saveClickX <= 694
  6686. && super.saveClickY >= 466 && super.saveClickY < 503
  6687. && tabInterfaceIDs[11] != -1) {
  6688. needDrawTabArea = true;
  6689. tabID = 11;
  6690. tabAreaAltered = true;
  6691. }
  6692. if (super.saveClickX >= 695 && super.saveClickX <= 725
  6693. && super.saveClickY >= 466 && super.saveClickY < 503
  6694. && tabInterfaceIDs[12] != -1) {
  6695. needDrawTabArea = true;
  6696. tabID = 12;
  6697. tabAreaAltered = true;
  6698. }
  6699. if (super.saveClickX >= 726 && super.saveClickX <= 765
  6700. && super.saveClickY >= 466 && super.saveClickY < 502
  6701. && tabInterfaceIDs[13] != -1) {
  6702. needDrawTabArea = true;
  6703. tabID = 13;
  6704. tabAreaAltered = true;
  6705. }
  6706. if (super.saveClickX >= 520 && super.saveClickX <= 561
  6707. && super.saveClickY >= 466 && super.saveClickY < 502
  6708. && tabInterfaceIDs[14] != -1) {
  6709. needDrawTabArea = true;
  6710. tabID = 14;
  6711. tabAreaAltered = true;
  6712. }
  6713. }
  6714. }
  6715.  
  6716. private void resetImageProducers2() {
  6717. if (aRSImageProducer_1166 != null)
  6718. return;
  6719. nullLoader();
  6720. super.fullGameScreen = null;
  6721. aRSImageProducer_1107 = null;
  6722. aRSImageProducer_1108 = null;
  6723. aRSImageProducer_1109 = null;
  6724. aRSImageProducer_1110 = null;
  6725. aRSImageProducer_1111 = null;
  6726. aRSImageProducer_1112 = null;
  6727. aRSImageProducer_1113 = null;
  6728. aRSImageProducer_1114 = null;
  6729. aRSImageProducer_1115 = null; /* Original chat area image producer */
  6730. // aRSImageProducer_1166 = new RSImageProducer(479, 96,
  6731. // getGameComponent());
  6732. /* New chat area image producer */
  6733. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  6734. getGameComponent());
  6735. aRSImageProducer_1164 = new RSImageProducer(246, 168,
  6736. getGameComponent());
  6737. DrawingArea.setAllPixelsToZero();
  6738. mapArea.drawSprite(0, 0);
  6739. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  6740. getGameComponent());
  6741. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  6742. getGameComponent());
  6743. DrawingArea.setAllPixelsToZero();
  6744. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6745. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6746. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6747. welcomeScreenRaised = true;
  6748. }
  6749.  
  6750. private String getDocumentBaseHost() {
  6751. if (signlink.mainapp != null)
  6752. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6753. if (super.gameFrame != null)
  6754. return "";
  6755. else
  6756. return "";
  6757. }
  6758.  
  6759. private void method81(Sprite sprite, int j, int k) {
  6760. int l = k * k + j * j;
  6761. if (l > 4225 && l < 0x15f90) {
  6762. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6763. int j1 = Model.modelIntArray1[i1];
  6764. int k1 = Model.modelIntArray2[i1];
  6765. j1 = (j1 * 256) / (minimapInt3 + 256);
  6766. k1 = (k1 * 256) / (minimapInt3 + 256);
  6767. int l1 = j * j1 + k * k1 >> 16;
  6768. int i2 = j * k1 - k * j1 >> 16;
  6769. double d = Math.atan2(l1, i2);
  6770. int j2 = (int) (Math.sin(d) * 63D);
  6771. int k2 = (int) (Math.cos(d) * 57D);
  6772. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6773. } else {
  6774. markMinimap(sprite, k, j);
  6775. }
  6776. }
  6777.  
  6778. private void rightClickMapArea() {
  6779. int x = super.mouseX;
  6780. int y = super.mouseY;
  6781. if (x >= 542 && x <= 578 && y >= 5 && y <= 39) {
  6782. menuActionName[1] = "Face North";
  6783. menuActionID[1] = 696;
  6784. menuActionRow = 2;
  6785. }
  6786. if (super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1
  6787. && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
  6788. menuActionName[1] = "Logout";
  6789. menuActionID[1] = 1004;
  6790. menuActionRow = 2;
  6791. }
  6792. }
  6793.  
  6794. private void rightClickChatButtons() {
  6795. if (super.mouseX >= 6 && super.mouseX <= 62 && super.mouseY >= 482
  6796. && super.mouseY <= 503) {
  6797. menuActionName[1] = "View All";
  6798. menuActionID[1] = 999;
  6799. menuActionRow = 2;
  6800. } else if (super.mouseX >= 63 && super.mouseX <= 118
  6801. && super.mouseY >= 482 && super.mouseY <= 503) {
  6802. menuActionName[1] = "View Game";
  6803. menuActionID[1] = 998;
  6804. menuActionRow = 2;
  6805. } else if (super.mouseX >= 119 && super.mouseX <= 175
  6806. && super.mouseY >= 482 && super.mouseY <= 503) {
  6807. menuActionName[1] = "Hide public";
  6808. menuActionID[1] = 997;
  6809. menuActionName[2] = "Off public";
  6810. menuActionID[2] = 996;
  6811. menuActionName[3] = "Friends public";
  6812. menuActionID[3] = 995;
  6813. menuActionName[4] = "On public";
  6814. menuActionID[4] = 994;
  6815. menuActionName[5] = "View public";
  6816. menuActionID[5] = 993;
  6817. menuActionRow = 6;
  6818. } else if (super.mouseX >= 177 && super.mouseX <= 232
  6819. && super.mouseY >= 482 && super.mouseY <= 503) {
  6820. menuActionName[1] = "Off private";
  6821. menuActionID[1] = 992;
  6822. menuActionName[2] = "Friends private";
  6823. menuActionID[2] = 991;
  6824. menuActionName[3] = "On private";
  6825. menuActionID[3] = 990;
  6826. menuActionName[4] = "View private";
  6827. menuActionID[4] = 989;
  6828. menuActionRow = 5;
  6829. } else if (super.mouseX >= 233 && super.mouseX <= 289
  6830. && super.mouseY >= 482 && super.mouseY <= 503) {
  6831. menuActionName[1] = "Off clan chat";
  6832. menuActionID[1] = 1003;
  6833. menuActionName[2] = "Friends clan chat";
  6834. menuActionID[2] = 1002;
  6835. menuActionName[3] = "On clan chat";
  6836. menuActionID[3] = 1001;
  6837. menuActionName[4] = "View clan chat";
  6838. menuActionID[4] = 1000;
  6839. menuActionRow = 5;
  6840. } else if (super.mouseX >= 290 && super.mouseX <= 346
  6841. && super.mouseY >= 482 && super.mouseY <= 503) {
  6842. menuActionName[1] = "Off trade";
  6843. menuActionID[1] = 987;
  6844. menuActionName[2] = "Friends trade";
  6845. menuActionID[2] = 986;
  6846. menuActionName[3] = "On trade";
  6847. menuActionID[3] = 985;
  6848. menuActionName[4] = "View trade";
  6849. menuActionID[4] = 984;
  6850. menuActionRow = 5;
  6851. } else if (super.mouseX >= 347 && super.mouseX <= 403
  6852. && super.mouseY >= 482 && super.mouseY <= 503) {
  6853. menuActionName[1] = "Off duel";
  6854. menuActionID[1] = 983;
  6855. menuActionName[2] = "Friends duel";
  6856. menuActionID[2] = 982;
  6857. menuActionName[3] = "On duel";
  6858. menuActionID[3] = 981;
  6859. menuActionName[4] = "View duel";
  6860. menuActionID[4] = 980;
  6861. menuActionRow = 5;
  6862. }
  6863. }
  6864.  
  6865. private void processRightClick() {
  6866. if (activeInterfaceType != 0)
  6867. return;
  6868. menuActionName[0] = "Cancel";
  6869. menuActionID[0] = 1107;
  6870. menuActionRow = 1;
  6871. buildSplitPrivateChatMenu();
  6872.  
  6873. anInt886 = 0;
  6874. if (super.mouseX >= 515 && super.mouseX <= 765 && super.mouseY >= 0
  6875. && super.mouseY <= 167) {
  6876. if (tabInterfaceIDs[tabID] != -1) {
  6877. buildInterfaceMenu(0,
  6878. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  6879. super.mouseX, 0, super.mouseY, 0);
  6880. }
  6881. }
  6882. if (super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516
  6883. && super.mouseY < 338)
  6884. if (openInterfaceID != -1)
  6885. buildInterfaceMenu(4,
  6886. RSInterface.interfaceCache[openInterfaceID],
  6887. super.mouseX, 4, super.mouseY, 0);
  6888. else
  6889. build3dScreenMenu();
  6890. if (anInt886 != anInt1026)
  6891. anInt1026 = anInt886;
  6892. anInt886 = 0;
  6893. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740
  6894. && super.mouseY < 468)
  6895. if (invOverlayInterfaceID != -1)
  6896. buildInterfaceMenu(548,
  6897. RSInterface.interfaceCache[invOverlayInterfaceID],
  6898. super.mouseX, 207, super.mouseY, 0);
  6899. else if (tabInterfaceIDs[tabID] != -1)
  6900. buildInterfaceMenu(548,
  6901. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  6902. super.mouseX, 207, super.mouseY, 0);
  6903. if (anInt886 != anInt1048) {
  6904. needDrawTabArea = true;
  6905. anInt1048 = anInt886;
  6906. }
  6907. anInt886 = 0; /* Chat area clicking */
  6908. if (super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490
  6909. && super.mouseY < 463)
  6910. if (backDialogID != -1)
  6911. buildInterfaceMenu(20,
  6912. RSInterface.interfaceCache[backDialogID], super.mouseX,
  6913. 358, super.mouseY, 0);
  6914. else if (super.mouseY < 463 && super.mouseX < 490)
  6915. buildChatAreaMenu(super.mouseY - 338);
  6916. if (backDialogID != -1 && anInt886 != anInt1039) {
  6917. inputTaken = true;
  6918. anInt1039 = anInt886;
  6919. } /* Enable custom right click areas */
  6920.  
  6921. int x = instance.mouseX;
  6922. int y = instance.mouseY;
  6923. if (inCircle(516, 22, x, y, 16)) {
  6924. instance.menuActionName[1] = counterOn ? "Off" : "On";
  6925. instance.menuActionID[1] = 474;
  6926. instance.menuActionName[0] = "Reset";
  6927. instance.menuActionID[0] = 475;
  6928. instance.menuActionRow = 2;
  6929. }
  6930.  
  6931. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516
  6932. && super.mouseY < 503)
  6933. rightClickChatButtons();
  6934. if (super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765
  6935. && super.mouseY < 168)
  6936. rightClickMapArea(); /**/
  6937. boolean flag = false;
  6938. while (!flag) {
  6939. flag = true;
  6940. for (int j = 0; j < menuActionRow - 1; j++)
  6941. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6942. String s = menuActionName[j];
  6943. menuActionName[j] = menuActionName[j + 1];
  6944. menuActionName[j + 1] = s;
  6945. int k = menuActionID[j];
  6946. menuActionID[j] = menuActionID[j + 1];
  6947. menuActionID[j + 1] = k;
  6948. k = menuActionCmd2[j];
  6949. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6950. menuActionCmd2[j + 1] = k;
  6951. k = menuActionCmd3[j];
  6952. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6953. menuActionCmd3[j + 1] = k;
  6954. k = menuActionCmd1[j];
  6955. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6956. menuActionCmd1[j + 1] = k;
  6957. flag = false;
  6958. }
  6959.  
  6960. }
  6961. }
  6962.  
  6963. private int method83(int i, int j, int k) {
  6964. int l = 256 - k;
  6965. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  6966. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6967. }
  6968.  
  6969. private void login(String s, String s1, boolean flag) {
  6970. signlink.errorname = s;
  6971. try {
  6972. if (!flag) {
  6973. loginMessage1 = "";
  6974. loginMessage2 = "Connecting to the server...";
  6975. drawLoginScreen(true);
  6976. }
  6977.  
  6978. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6979. long l = TextClass.longForName(s);
  6980. int i = (int) (l >> 16 & 31L);
  6981. stream.currentOffset = 0;
  6982. stream.writeWordBigEndian(14);
  6983. stream.writeWordBigEndian(i);
  6984. socketStream.queueBytes(2, stream.buffer);
  6985. for (int j = 0; j < 8; j++)
  6986. socketStream.read();
  6987.  
  6988. int k = socketStream.read();
  6989. int i1 = k;
  6990. if (k == 0) {
  6991. socketStream.flushInputStream(inStream.buffer, 8);
  6992. inStream.currentOffset = 0;
  6993. aLong1215 = inStream.readQWord();
  6994. int ai[] = new int[4];
  6995. ai[0] = (int) (Math.random() * 99999999D);
  6996. ai[1] = (int) (Math.random() * 99999999D);
  6997. ai[2] = (int) (aLong1215 >> 32);
  6998. ai[3] = (int) aLong1215;
  6999. stream.currentOffset = 0;
  7000. stream.writeWordBigEndian(10);
  7001. stream.writeDWord(ai[0]);
  7002. stream.writeDWord(ai[1]);
  7003. stream.writeDWord(ai[2]);
  7004. stream.writeDWord(ai[3]);
  7005. stream.writeDWord(signlink.uid);
  7006. stream.writeString(s);
  7007. stream.writeString(s1);
  7008. stream.doKeys();
  7009. aStream_847.currentOffset = 0;
  7010. if (flag)
  7011. aStream_847.writeWordBigEndian(18);
  7012. else
  7013. aStream_847.writeWordBigEndian(16);
  7014. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  7015. + 1 + 2);
  7016. aStream_847.writeWordBigEndian(255);
  7017. aStream_847.writeWord(signlink.clientVersion);
  7018. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7019. for (int l1 = 0; l1 < 9; l1++)
  7020. aStream_847.writeDWord(expectedCRCs[l1]);
  7021.  
  7022. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7023. stream.encryption = new ISAACRandomGen(ai);
  7024. for (int j2 = 0; j2 < 4; j2++)
  7025. ai[j2] += 50;
  7026.  
  7027. encryption = new ISAACRandomGen(ai);
  7028. socketStream.queueBytes(aStream_847.currentOffset,
  7029. aStream_847.buffer);
  7030. k = socketStream.read();
  7031. }
  7032. if (k == 1) {
  7033. try {
  7034. Thread.sleep(2000L);
  7035. } catch (Exception _ex) {
  7036. }
  7037. login(s, s1, flag);
  7038. return;
  7039. }
  7040. if (k == 2) {
  7041. myPrivilege = socketStream.read();
  7042. flagged = socketStream.read() == 1;
  7043. aLong1220 = 0L;
  7044. anInt1022 = 0;
  7045. mouseDetection.coordsIndex = 0;
  7046. super.awtFocus = true;
  7047. aBoolean954 = true;
  7048. loggedIn = true;
  7049. stream.currentOffset = 0;
  7050. inStream.currentOffset = 0;
  7051. pktType = -1;
  7052. anInt841 = -1;
  7053. anInt842 = -1;
  7054. anInt843 = -1;
  7055. pktSize = 0;
  7056. anInt1009 = 0;
  7057. anInt1104 = 0;
  7058. anInt1011 = 0;
  7059. anInt855 = 0;
  7060. menuActionRow = 0;
  7061. menuOpen = false;
  7062. super.idleTime = 0;
  7063. for (int j1 = 0; j1 < 100; j1++)
  7064. chatMessages[j1] = null;
  7065.  
  7066. itemSelected = 0;
  7067. spellSelected = 0;
  7068. loadingStage = 0;
  7069. anInt1062 = 0;
  7070. anInt1278 = (int) (Math.random() * 100D) - 50;
  7071. anInt1131 = (int) (Math.random() * 110D) - 55;
  7072. anInt896 = (int) (Math.random() * 80D) - 40;
  7073. minimapInt2 = (int) (Math.random() * 120D) - 60;
  7074. minimapInt3 = (int) (Math.random() * 30D) - 20;
  7075. minimapInt1 = (int) (Math.random() * 20D) - 10 & 0x7ff;
  7076. anInt1021 = 0;
  7077. anInt985 = -1;
  7078. destX = 0;
  7079. destY = 0;
  7080. playerCount = 0;
  7081. npcCount = 0;
  7082. for (int i2 = 0; i2 < maxPlayers; i2++) {
  7083. playerArray[i2] = null;
  7084. aStreamArray895s[i2] = null;
  7085. }
  7086.  
  7087. for (int k2 = 0; k2 < 16384; k2++)
  7088. npcArray[k2] = null;
  7089.  
  7090. myPlayer = playerArray[myPlayerIndex] = new Player();
  7091. aClass19_1013.removeAll();
  7092. aClass19_1056.removeAll();
  7093. for (int l2 = 0; l2 < 4; l2++) {
  7094. for (int i3 = 0; i3 < 104; i3++) {
  7095. for (int k3 = 0; k3 < 104; k3++)
  7096. groundArray[l2][i3][k3] = null;
  7097.  
  7098. }
  7099.  
  7100. }
  7101.  
  7102. aClass19_1179 = new NodeList();
  7103. anInt900 = 0;
  7104. friendsCount = 0;
  7105. dialogID = -1;
  7106. backDialogID = -1;
  7107. openInterfaceID = -1;
  7108. invOverlayInterfaceID = -1;
  7109. anInt1018 = -1;
  7110. aBoolean1149 = false;
  7111. tabID = 3;
  7112. inputDialogState = 0;
  7113. menuOpen = false;
  7114. messagePromptRaised = false;
  7115. aString844 = null;
  7116. anInt1055 = 0;
  7117. anInt1054 = -1;
  7118. aBoolean1047 = true;
  7119. method45();
  7120. for (int j3 = 0; j3 < 5; j3++)
  7121. anIntArray990[j3] = 0;
  7122.  
  7123. for (int l3 = 0; l3 < 5; l3++) {
  7124. atPlayerActions[l3] = null;
  7125. atPlayerArray[l3] = false;
  7126. }
  7127.  
  7128. anInt1175 = 0;
  7129. anInt1134 = 0;
  7130. anInt986 = 0;
  7131. anInt1288 = 0;
  7132. anInt924 = 0;
  7133. anInt1188 = 0;
  7134. anInt1155 = 0;
  7135. anInt1226 = 0;
  7136. int anInt941 = 0;
  7137. int anInt1260 = 0;
  7138. resetImageProducers2();
  7139. return;
  7140. }
  7141. if (k == 3) {
  7142. loginMessage1 = "";
  7143. loginMessage2 = "Invalid username or password.";
  7144. return;
  7145. }
  7146. if (k == 4) {
  7147. loginMessage1 = "Your account has been disabled.";
  7148. loginMessage2 = "Please check your message-center for details.";
  7149. return;
  7150. }
  7151. if (k == 5) {
  7152. loginMessage1 = "Your account is already logged in.";
  7153. loginMessage2 = "Try again in 60 secs...";
  7154. return;
  7155. }
  7156. if (k == 6) {
  7157. loginMessage1 = "RuneScape has been updated!";
  7158. loginMessage2 = "Please reload this page.";
  7159. return;
  7160. }
  7161. if (k == 7) {
  7162. loginMessage1 = "This world is full.";
  7163. loginMessage2 = "Please use a different world.";
  7164. return;
  7165. }
  7166. if (k == 8) {
  7167. loginMessage1 = "Unable to connect.";
  7168. loginMessage2 = "Login server offline.";
  7169. return;
  7170. }
  7171. if (k == 9) {
  7172. loginMessage1 = "Login limit exceeded.";
  7173. loginMessage2 = "Too many connections from your address.";
  7174. return;
  7175. }
  7176. if (k == 10) {
  7177. loginMessage1 = "Unable to connect.";
  7178. loginMessage2 = "Bad session id.";
  7179. return;
  7180. }
  7181. if (k == 11) {
  7182. loginMessage2 = "Login server rejected session.";
  7183. loginMessage2 = "Please try again.";
  7184. return;
  7185. }
  7186. if (k == 12) {
  7187. loginMessage1 = "You need a members account to login to this world.";
  7188. loginMessage2 = "Please subscribe, or use a different world.";
  7189. return;
  7190. }
  7191. if (k == 13) {
  7192. loginMessage1 = "Could not complete login.";
  7193. loginMessage2 = "Please try using a different world.";
  7194. return;
  7195. }
  7196. if (k == 14) {
  7197. loginMessage1 = "The server is being updated.";
  7198. loginMessage2 = "Please wait 1 minute and try again.";
  7199. return;
  7200. }
  7201. if (k == 15) {
  7202. loggedIn = true;
  7203. stream.currentOffset = 0;
  7204. inStream.currentOffset = 0;
  7205. pktType = -1;
  7206. anInt841 = -1;
  7207. anInt842 = -1;
  7208. anInt843 = -1;
  7209. pktSize = 0;
  7210. anInt1009 = 0;
  7211. anInt1104 = 0;
  7212. menuActionRow = 0;
  7213. menuOpen = false;
  7214. aLong824 = System.currentTimeMillis();
  7215. return;
  7216. }
  7217. if (k == 16) {
  7218. loginMessage1 = "Login attempts exceeded.";
  7219. loginMessage2 = "Please wait 1 minute and try again.";
  7220. return;
  7221. }
  7222. if (k == 17) {
  7223. loginMessage1 = "You are standing in a members-only area.";
  7224. loginMessage2 = "To play on this world move to a free area first";
  7225. return;
  7226. }
  7227. if (k == 20) {
  7228. loginMessage1 = "Invalid loginserver requested";
  7229. loginMessage2 = "Please try using a different world.";
  7230. return;
  7231. }
  7232. if (k == 21) {
  7233. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  7234. loginMessage1 = "You have only just left another world";
  7235. loginMessage2 = "Your profile will be transferred in: "
  7236. + k1 + " seconds";
  7237. drawLoginScreen(true);
  7238. try {
  7239. Thread.sleep(1000L);
  7240. } catch (Exception _ex) {
  7241. }
  7242. }
  7243.  
  7244. login(s, s1, flag);
  7245. return;
  7246. }
  7247. if (k == -1) {
  7248. if (i1 == 0) {
  7249. if (loginFailures < 2) {
  7250. try {
  7251. Thread.sleep(2000L);
  7252. } catch (Exception _ex) {
  7253. }
  7254. loginFailures++;
  7255. login(s, s1, flag);
  7256. return;
  7257. } else {
  7258. loginMessage1 = "No response from loginserver";
  7259. loginMessage2 = "Please wait 1 minute and try again.";
  7260. return;
  7261. }
  7262. } else {
  7263. loginMessage1 = "No response from server";
  7264. loginMessage2 = "Please try using a different world.";
  7265. return;
  7266. }
  7267. } else {
  7268. System.out.println("response:" + k);
  7269. loginMessage1 = "Unexpected server response";
  7270. loginMessage2 = "Please try using a different world.";
  7271. return;
  7272. }
  7273. } catch (IOException _ex) {
  7274. loginMessage1 = "";
  7275. }
  7276. loginMessage2 = "Error connecting to server.";
  7277. }
  7278.  
  7279. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  7280. int l1, int i2, int j2, boolean flag, int k2) {
  7281. byte byte0 = 104;
  7282. byte byte1 = 104;
  7283. for (int l2 = 0; l2 < byte0; l2++) {
  7284. for (int i3 = 0; i3 < byte1; i3++) {
  7285. anIntArrayArray901[l2][i3] = 0;
  7286. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7287. }
  7288.  
  7289. }
  7290.  
  7291. int j3 = j2;
  7292. int k3 = j1;
  7293. anIntArrayArray901[j2][j1] = 99;
  7294. anIntArrayArray825[j2][j1] = 0;
  7295. int l3 = 0;
  7296. int i4 = 0;
  7297. bigX[l3] = j2;
  7298. bigY[l3++] = j1;
  7299. boolean flag1 = false;
  7300. int j4 = bigX.length;
  7301. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7302. while (i4 != l3) {
  7303. j3 = bigX[i4];
  7304. k3 = bigY[i4];
  7305. i4 = (i4 + 1) % j4;
  7306. if (j3 == k2 && k3 == i2) {
  7307. flag1 = true;
  7308. break;
  7309. }
  7310. if (i1 != 0) {
  7311. if ((i1 < 5 || i1 == 10)
  7312. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  7313. i1 - 1, i2)) {
  7314. flag1 = true;
  7315. break;
  7316. }
  7317. if (i1 < 10
  7318. && aClass11Array1230[plane].method220(k2, i2, k3,
  7319. i1 - 1, j, j3)) {
  7320. flag1 = true;
  7321. break;
  7322. }
  7323. }
  7324. if (k1 != 0
  7325. && k != 0
  7326. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  7327. k1, k3)) {
  7328. flag1 = true;
  7329. break;
  7330. }
  7331. int l4 = anIntArrayArray825[j3][k3] + 1;
  7332. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  7333. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  7334. bigX[l3] = j3 - 1;
  7335. bigY[l3] = k3;
  7336. l3 = (l3 + 1) % j4;
  7337. anIntArrayArray901[j3 - 1][k3] = 2;
  7338. anIntArrayArray825[j3 - 1][k3] = l4;
  7339. }
  7340. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  7341. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  7342. bigX[l3] = j3 + 1;
  7343. bigY[l3] = k3;
  7344. l3 = (l3 + 1) % j4;
  7345. anIntArrayArray901[j3 + 1][k3] = 8;
  7346. anIntArrayArray825[j3 + 1][k3] = l4;
  7347. }
  7348. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  7349. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7350. bigX[l3] = j3;
  7351. bigY[l3] = k3 - 1;
  7352. l3 = (l3 + 1) % j4;
  7353. anIntArrayArray901[j3][k3 - 1] = 1;
  7354. anIntArrayArray825[j3][k3 - 1] = l4;
  7355. }
  7356. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  7357. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7358. bigX[l3] = j3;
  7359. bigY[l3] = k3 + 1;
  7360. l3 = (l3 + 1) % j4;
  7361. anIntArrayArray901[j3][k3 + 1] = 4;
  7362. anIntArrayArray825[j3][k3 + 1] = l4;
  7363. }
  7364. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  7365. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  7366. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7367. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7368. bigX[l3] = j3 - 1;
  7369. bigY[l3] = k3 - 1;
  7370. l3 = (l3 + 1) % j4;
  7371. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7372. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7373. }
  7374. if (j3 < byte0 - 1 && k3 > 0
  7375. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  7376. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  7377. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7378. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7379. bigX[l3] = j3 + 1;
  7380. bigY[l3] = k3 - 1;
  7381. l3 = (l3 + 1) % j4;
  7382. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7383. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7384. }
  7385. if (j3 > 0 && k3 < byte1 - 1
  7386. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  7387. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  7388. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7389. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7390. bigX[l3] = j3 - 1;
  7391. bigY[l3] = k3 + 1;
  7392. l3 = (l3 + 1) % j4;
  7393. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7394. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7395. }
  7396. if (j3 < byte0 - 1 && k3 < byte1 - 1
  7397. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  7398. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  7399. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7400. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7401. bigX[l3] = j3 + 1;
  7402. bigY[l3] = k3 + 1;
  7403. l3 = (l3 + 1) % j4;
  7404. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7405. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7406. }
  7407. }
  7408. anInt1264 = 0;
  7409. if (!flag1) {
  7410. if (flag) {
  7411. int i5 = 100;
  7412. for (int k5 = 1; k5 < 2; k5++) {
  7413. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  7414. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7415. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  7416. && anIntArrayArray825[i6][l6] < i5) {
  7417. i5 = anIntArrayArray825[i6][l6];
  7418. j3 = i6;
  7419. k3 = l6;
  7420. anInt1264 = 1;
  7421. flag1 = true;
  7422. }
  7423.  
  7424. }
  7425.  
  7426. if (flag1)
  7427. break;
  7428. }
  7429.  
  7430. }
  7431. if (!flag1)
  7432. return false;
  7433. }
  7434. i4 = 0;
  7435. bigX[i4] = j3;
  7436. bigY[i4++] = k3;
  7437. int l5;
  7438. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  7439. if (j5 != l5) {
  7440. l5 = j5;
  7441. bigX[i4] = j3;
  7442. bigY[i4++] = k3;
  7443. }
  7444. if ((j5 & 2) != 0)
  7445. j3++;
  7446. else if ((j5 & 8) != 0)
  7447. j3--;
  7448. if ((j5 & 1) != 0)
  7449. k3++;
  7450. else if ((j5 & 4) != 0)
  7451. k3--;
  7452. }
  7453. // if(cancelWalk) { return i4 > 0; }
  7454. if (i4 > 0) {
  7455. int k4 = i4;
  7456. if (k4 > 25)
  7457. k4 = 25;
  7458. i4--;
  7459. int k6 = bigX[i4];
  7460. int i7 = bigY[i4];
  7461. anInt1288 += k4;
  7462. if (anInt1288 >= 92) {
  7463. stream.createFrame(36);
  7464. stream.writeDWord(0);
  7465. anInt1288 = 0;
  7466. }
  7467. if (i == 0) {
  7468. stream.createFrame(164);
  7469. stream.writeWordBigEndian(k4 + k4 + 3);
  7470. }
  7471. if (i == 1) {
  7472. stream.createFrame(248);
  7473. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7474. }
  7475. if (i == 2) {
  7476. stream.createFrame(98);
  7477. stream.writeWordBigEndian(k4 + k4 + 3);
  7478. }
  7479. stream.method433(k6 + baseX);
  7480. destX = bigX[0];
  7481. destY = bigY[0];
  7482. for (int j7 = 1; j7 < k4; j7++) {
  7483. i4--;
  7484. stream.writeWordBigEndian(bigX[i4] - k6);
  7485. stream.writeWordBigEndian(bigY[i4] - i7);
  7486. }
  7487.  
  7488. stream.method431(i7 + baseY);
  7489. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7490. return true;
  7491. }
  7492. return i != 1;
  7493. }
  7494.  
  7495. private void method86(Stream stream) {
  7496. for (int j = 0; j < anInt893; j++) {
  7497. int k = anIntArray894[j];
  7498. NPC npc = npcArray[k];
  7499. int l = stream.readUnsignedByte();
  7500. if ((l & 0x10) != 0) {
  7501. int i1 = stream.method434();
  7502. if (i1 == 65535)
  7503. i1 = -1;
  7504. int i2 = stream.readUnsignedByte();
  7505. if (i1 == npc.anim && i1 != -1) {
  7506. int l2 = Animation.anims[i1].anInt365;
  7507. if (l2 == 1) {
  7508. npc.anInt1527 = 0;
  7509. npc.anInt1528 = 0;
  7510. npc.anInt1529 = i2;
  7511. npc.anInt1530 = 0;
  7512. }
  7513. if (l2 == 2)
  7514. npc.anInt1530 = 0;
  7515. } else if (i1 == -1
  7516. || npc.anim == -1
  7517. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  7518. npc.anim = i1;
  7519. npc.anInt1527 = 0;
  7520. npc.anInt1528 = 0;
  7521. npc.anInt1529 = i2;
  7522. npc.anInt1530 = 0;
  7523. npc.anInt1542 = npc.smallXYIndex;
  7524. }
  7525. }
  7526. if ((l & 8) != 0) {
  7527. int j1 = stream.method426();
  7528. int j2 = stream.method427();
  7529. npc.updateHitData(j2, j1, loopCycle);
  7530. npc.loopCycleStatus = loopCycle + 300;
  7531. npc.currentHealth = stream.method426();
  7532. npc.maxHealth = stream.readUnsignedByte();
  7533. }
  7534. if ((l & 0x80) != 0) {
  7535. npc.anInt1520 = stream.readUnsignedWord();
  7536. int k1 = stream.readDWord();
  7537. npc.anInt1524 = k1 >> 16;
  7538. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7539. npc.anInt1521 = 0;
  7540. npc.anInt1522 = 0;
  7541. if (npc.anInt1523 > loopCycle)
  7542. npc.anInt1521 = -1;
  7543. if (npc.anInt1520 == 65535)
  7544. npc.anInt1520 = -1;
  7545. }
  7546. if ((l & 0x20) != 0) {
  7547. npc.interactingEntity = stream.readUnsignedWord();
  7548. if (npc.interactingEntity == 65535)
  7549. npc.interactingEntity = -1;
  7550. }
  7551. if ((l & 1) != 0) {
  7552. npc.textSpoken = stream.readString();
  7553. npc.textCycle = 100;
  7554. // entityMessage(npc);
  7555. }
  7556. if ((l & 0x40) != 0) {
  7557. int l1 = stream.method427();
  7558. int k2 = stream.method428();
  7559. npc.updateHitData(k2, l1, loopCycle);
  7560. npc.loopCycleStatus = loopCycle + 300;
  7561. npc.currentHealth = stream.method428();
  7562. npc.maxHealth = stream.method427();
  7563. }
  7564. if ((l & 2) != 0) {
  7565. npc.desc = EntityDef.forID(stream.method436());
  7566. npc.anInt1540 = npc.desc.aByte68;
  7567. npc.anInt1504 = npc.desc.anInt79;
  7568. npc.anInt1554 = npc.desc.walkAnim;
  7569. npc.anInt1555 = npc.desc.anInt58;
  7570. npc.anInt1556 = npc.desc.anInt83;
  7571. npc.anInt1557 = npc.desc.anInt55;
  7572. npc.anInt1511 = npc.desc.standAnim;
  7573. }
  7574. if ((l & 4) != 0) {
  7575. npc.anInt1538 = stream.method434();
  7576. npc.anInt1539 = stream.method434();
  7577. }
  7578. }
  7579. }
  7580.  
  7581. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  7582. if (menuActionRow >= 400)
  7583. return;
  7584. if (entityDef.childrenIDs != null)
  7585. entityDef = entityDef.method161();
  7586. if (entityDef == null)
  7587. return;
  7588. if (!entityDef.aBoolean84)
  7589. return;
  7590. String s = entityDef.name;
  7591. if (entityDef.combatLevel != 0)
  7592. s = s
  7593. + combatDiffColor(myPlayer.combatLevel,
  7594. entityDef.combatLevel) + " (level-"
  7595. + entityDef.combatLevel + ")";
  7596. if (itemSelected == 1) {
  7597. menuActionName[menuActionRow] = "Use " + selectedItemName
  7598. + " with @yel@" + s;
  7599. menuActionID[menuActionRow] = 582;
  7600. menuActionCmd1[menuActionRow] = i;
  7601. menuActionCmd2[menuActionRow] = k;
  7602. menuActionCmd3[menuActionRow] = j;
  7603. menuActionRow++;
  7604. return;
  7605. }
  7606. if (spellSelected == 1) {
  7607. if ((spellUsableOn & 2) == 2) {
  7608. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7609. menuActionID[menuActionRow] = 413;
  7610. menuActionCmd1[menuActionRow] = i;
  7611. menuActionCmd2[menuActionRow] = k;
  7612. menuActionCmd3[menuActionRow] = j;
  7613. menuActionRow++;
  7614. }
  7615. } else {
  7616. if (entityDef.actions != null) {
  7617. for (int l = 4; l >= 0; l--)
  7618. if (entityDef.actions[l] != null
  7619. && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  7620. menuActionName[menuActionRow] = entityDef.actions[l]
  7621. + " @yel@" + s;
  7622. if (l == 0)
  7623. menuActionID[menuActionRow] = 20;
  7624. if (l == 1)
  7625. menuActionID[menuActionRow] = 412;
  7626. if (l == 2)
  7627. menuActionID[menuActionRow] = 225;
  7628. if (l == 3)
  7629. menuActionID[menuActionRow] = 965;
  7630. if (l == 4)
  7631. menuActionID[menuActionRow] = 478;
  7632. menuActionCmd1[menuActionRow] = i;
  7633. menuActionCmd2[menuActionRow] = k;
  7634. menuActionCmd3[menuActionRow] = j;
  7635. menuActionRow++;
  7636. }
  7637.  
  7638. }
  7639. if (entityDef.actions != null) {
  7640. for (int i1 = 4; i1 >= 0; i1--)
  7641. if (entityDef.actions[i1] != null
  7642. && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  7643. char c = '\0';
  7644. if (entityDef.combatLevel > myPlayer.combatLevel)
  7645. c = '\u07D0';
  7646. menuActionName[menuActionRow] = entityDef.actions[i1]
  7647. + " @yel@" + s;
  7648. if (i1 == 0)
  7649. menuActionID[menuActionRow] = 20 + c;
  7650. if (i1 == 1)
  7651. menuActionID[menuActionRow] = 412 + c;
  7652. if (i1 == 2)
  7653. menuActionID[menuActionRow] = 225 + c;
  7654. if (i1 == 3)
  7655. menuActionID[menuActionRow] = 965 + c;
  7656. if (i1 == 4)
  7657. menuActionID[menuActionRow] = 478 + c;
  7658. menuActionCmd1[menuActionRow] = i;
  7659. menuActionCmd2[menuActionRow] = k;
  7660. menuActionCmd3[menuActionRow] = j;
  7661. menuActionRow++;
  7662. }
  7663.  
  7664. }
  7665. // menuActionName[menuActionRow] = "Examine @yel@" + s +
  7666. // " @gre@(@whi@" + entityDef.type + "@gre@)";
  7667. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7668. menuActionID[menuActionRow] = 1025;
  7669. menuActionCmd1[menuActionRow] = i;
  7670. menuActionCmd2[menuActionRow] = k;
  7671. menuActionCmd3[menuActionRow] = j;
  7672. menuActionRow++;
  7673. }
  7674. }
  7675.  
  7676. private void buildAtPlayerMenu(int i, int j, Player player, int k) {
  7677. if (player == myPlayer)
  7678. return;
  7679. if (menuActionRow >= 400)
  7680. return;
  7681. String s;
  7682. if (player.skill == 0)
  7683. s = player.name
  7684. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  7685. + " (level-" + player.combatLevel + ")";
  7686. else
  7687. s = player.name + " (skill-" + player.skill + ")";
  7688. if (itemSelected == 1) {
  7689. menuActionName[menuActionRow] = "Use " + selectedItemName
  7690. + " with @whi@" + s;
  7691. menuActionID[menuActionRow] = 491;
  7692. menuActionCmd1[menuActionRow] = j;
  7693. menuActionCmd2[menuActionRow] = i;
  7694. menuActionCmd3[menuActionRow] = k;
  7695. menuActionRow++;
  7696. } else if (spellSelected == 1) {
  7697. if ((spellUsableOn & 8) == 8) {
  7698. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7699. menuActionID[menuActionRow] = 365;
  7700. menuActionCmd1[menuActionRow] = j;
  7701. menuActionCmd2[menuActionRow] = i;
  7702. menuActionCmd3[menuActionRow] = k;
  7703. menuActionRow++;
  7704. }
  7705. } else {
  7706. for (int l = 4; l >= 0; l--)
  7707. if (atPlayerActions[l] != null) {
  7708. menuActionName[menuActionRow] = atPlayerActions[l]
  7709. + " @whi@" + s;
  7710. char c = '\0';
  7711. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  7712. if (player.combatLevel > myPlayer.combatLevel)
  7713. c = '\u07D0';
  7714. if (myPlayer.team != 0 && player.team != 0)
  7715. if (myPlayer.team == player.team)
  7716. c = '\u07D0';
  7717. else
  7718. c = '\0';
  7719. } else if (atPlayerArray[l])
  7720. c = '\u07D0';
  7721. if (l == 0)
  7722. menuActionID[menuActionRow] = 561 + c;
  7723. if (l == 1)
  7724. menuActionID[menuActionRow] = 779 + c;
  7725. if (l == 2)
  7726. menuActionID[menuActionRow] = 27 + c;
  7727. if (l == 3)
  7728. menuActionID[menuActionRow] = 577 + c;
  7729. if (l == 4)
  7730. menuActionID[menuActionRow] = 729 + c;
  7731. menuActionCmd1[menuActionRow] = j;
  7732. menuActionCmd2[menuActionRow] = i;
  7733. menuActionCmd3[menuActionRow] = k;
  7734. menuActionRow++;
  7735. }
  7736.  
  7737. }
  7738. for (int i1 = 0; i1 < menuActionRow; i1++)
  7739. if (menuActionID[i1] == 516) {
  7740. menuActionName[i1] = "Walk here @whi@" + s;
  7741. return;
  7742. }
  7743.  
  7744. }
  7745.  
  7746. private void method89(Class30_Sub1 class30_sub1) {
  7747. int i = 0;
  7748. int j = -1;
  7749. int k = 0;
  7750. int l = 0;
  7751. if (class30_sub1.anInt1296 == 0)
  7752. i = worldController.method300(class30_sub1.anInt1295,
  7753. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7754. if (class30_sub1.anInt1296 == 1)
  7755. i = worldController.method301(class30_sub1.anInt1295,
  7756. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7757. if (class30_sub1.anInt1296 == 2)
  7758. i = worldController.method302(class30_sub1.anInt1295,
  7759. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7760. if (class30_sub1.anInt1296 == 3)
  7761. i = worldController.method303(class30_sub1.anInt1295,
  7762. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7763. if (i != 0) {
  7764. int i1 = worldController.method304(class30_sub1.anInt1295,
  7765. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7766. j = i >> 14 & 0x7fff;
  7767. k = i1 & 0x1f;
  7768. l = i1 >> 6;
  7769. }
  7770. class30_sub1.anInt1299 = j;
  7771. class30_sub1.anInt1301 = k;
  7772. class30_sub1.anInt1300 = l;
  7773. }
  7774.  
  7775. private void method90() {
  7776. for (int i = 0; i < anInt1062; i++)
  7777. if (anIntArray1250[i] <= 0) {
  7778. boolean flag1 = false;
  7779. try {
  7780. if (anIntArray1207[i] == anInt874
  7781. && anIntArray1241[i] == anInt1289) {
  7782. if (!replayWave())
  7783. flag1 = true;
  7784. } else {
  7785. Stream stream = Sounds.method241(anIntArray1241[i],
  7786. anIntArray1207[i]);
  7787. if (System.currentTimeMillis()
  7788. + (long) (stream.currentOffset / 22) > aLong1172
  7789. + (long) (anInt1257 / 22)) {
  7790. anInt1257 = stream.currentOffset;
  7791. aLong1172 = System.currentTimeMillis();
  7792. if (saveWave(stream.buffer, stream.currentOffset)) {
  7793. anInt874 = anIntArray1207[i];
  7794. anInt1289 = anIntArray1241[i];
  7795. } else {
  7796. flag1 = true;
  7797. }
  7798. }
  7799. }
  7800. } catch (Exception exception) {
  7801. }
  7802. if (!flag1 || anIntArray1250[i] == -5) {
  7803. anInt1062--;
  7804. for (int j = i; j < anInt1062; j++) {
  7805. anIntArray1207[j] = anIntArray1207[j + 1];
  7806. anIntArray1241[j] = anIntArray1241[j + 1];
  7807. anIntArray1250[j] = anIntArray1250[j + 1];
  7808. }
  7809.  
  7810. i--;
  7811. } else {
  7812. anIntArray1250[i] = -5;
  7813. }
  7814. } else {
  7815. anIntArray1250[i]--;
  7816. }
  7817.  
  7818. if (prevSong > 0) {
  7819. prevSong -= 20;
  7820. if (prevSong < 0)
  7821. prevSong = 0;
  7822. if (prevSong == 0 && musicEnabled && !lowMem) {
  7823. nextSong = currentSong;
  7824. songChanging = true;
  7825. onDemandFetcher.method558(2, nextSong);
  7826. }
  7827. }
  7828. }
  7829.  
  7830. public String indexLocation(int cacheIndex, int index) {
  7831. return signlink.findcachedir() + "index" + cacheIndex + "/"
  7832. + (index != -1 ? index + ".gz" : "");
  7833. }
  7834.  
  7835. public void repackCacheIndex(int cacheIndex) {
  7836. System.out.println("Started repacking index " + cacheIndex + ".");
  7837. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  7838. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  7839. try {
  7840. for (int index = 0; index < indexLength; index++) {
  7841. int fileIndex = Integer
  7842. .parseInt(getFileNameWithoutExtension(file[index]
  7843. .toString()));
  7844. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  7845. if (data != null && data.length > 0) {
  7846. decompressors[cacheIndex].method234(data.length, data,
  7847. fileIndex);
  7848. System.out.println("Repacked " + fileIndex + ".");
  7849. } else {
  7850. System.out.println("Unable to locate index " + fileIndex
  7851. + ".");
  7852. }
  7853. }
  7854. } catch (Exception e) {
  7855. System.out.println("Error packing cache index " + cacheIndex + ".");
  7856. }
  7857. System.out.println("Finished repacking " + cacheIndex + ".");
  7858. }
  7859.  
  7860. public byte[] fileToByteArray(int cacheIndex, int index) {
  7861. try {
  7862. if (indexLocation(cacheIndex, index).length() <= 0
  7863. || indexLocation(cacheIndex, index) == null) {
  7864. return null;
  7865. }
  7866. File file = new File(indexLocation(cacheIndex, index));
  7867. byte[] fileData = new byte[(int) file.length()];
  7868. FileInputStream fis = new FileInputStream(file);
  7869. fis.read(fileData);
  7870. fis.close();
  7871. return fileData;
  7872. } catch (Exception e) {
  7873. return null;
  7874. }
  7875. }
  7876.  
  7877. void startUp() {
  7878. //drawLoadingText(20, "Starting up");
  7879. new CacheDownloader(this).downloadCache();
  7880. if (signlink.sunjava)
  7881. super.minDelay = 5;
  7882. if (aBoolean993) {
  7883. // rsAlreadyLoaded = true;
  7884. // return;
  7885. }
  7886. aBoolean993 = true;
  7887. boolean flag = true;
  7888. String s = getDocumentBaseHost();
  7889. if (signlink.cache_dat != null) {
  7890. for (int i = 0; i < 6; i++)
  7891. decompressors[i] = new Decompressor(signlink.cache_dat,
  7892. signlink.cache_idx[i], i + 1);
  7893. }
  7894. try {
  7895. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  7896. expectedCRCs[1], 25);
  7897. smallText = new TextDrawingArea(false, "p11_full",
  7898. titleStreamLoader);
  7899. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full",
  7900. titleStreamLoader);
  7901. chatTextDrawingArea = new TextDrawingArea(false, "b12_full",
  7902. titleStreamLoader);
  7903. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true,
  7904. "q8_full", titleStreamLoader);
  7905. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  7906. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  7907. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  7908. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  7909. drawLogo();
  7910. loadTitleScreen();
  7911. StreamLoader streamLoader = streamLoaderForName(2, "config",
  7912. "config", expectedCRCs[2], 30);
  7913. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  7914. "interface", expectedCRCs[3], 35);
  7915. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  7916. "media", expectedCRCs[4], 40);
  7917. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  7918. "textures", expectedCRCs[6], 45);
  7919. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  7920. "wordenc", expectedCRCs[7], 50);
  7921. StreamLoader streamLoader_5 = streamLoaderForName(8,
  7922. "sound effects", "sounds", expectedCRCs[8], 55);
  7923. byteGroundArray = new byte[4][104][104];
  7924. intGroundArray = new int[4][105][105];
  7925. worldController = new WorldController(intGroundArray);
  7926. for (int j = 0; j < 4; j++)
  7927. aClass11Array1230[j] = new Class11();
  7928.  
  7929. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7930. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  7931. "versionlist", expectedCRCs[5], 60);
  7932. drawLoadingText(60, "Connecting to update server");
  7933. onDemandFetcher = new OnDemandFetcher();
  7934. onDemandFetcher.start(streamLoader_6, this);
  7935. Class36.animationlist = new Class36[4500][0];
  7936. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  7937. drawLoadingText(80, "Unpacking media"); /* Custom sprite unpacking */
  7938. freezeBar = new Sprite("/timer/1");
  7939. Sprite[] clanIcons = new Sprite[9];
  7940. for (int index = 0; index < clanIcons.length; index++) {
  7941. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);
  7942. }
  7943. sIcon = new Sprite("s");
  7944. logo = new Sprite("login/logo");
  7945. loginBox = new Sprite("login/loginbox");
  7946. loginbar = new Sprite("login/loginbar");
  7947. loginbarHover = new Sprite("login/loginbarHover");
  7948. loginbar2 = new Sprite("login/loginbar_2");
  7949. loginbar2Hover = new Sprite("login/loginbar_2Hover");
  7950. background = new Sprite("login/background");
  7951. loginButton = new Sprite("login/loginbutton");
  7952. registerButton = new Sprite("login/registerbutton");
  7953. loginButtonHover = new Sprite("login/loginbuttonH");
  7954. registerButtonHover = new Sprite("login/registerbuttonH");
  7955. forumButton = new Sprite("login/forum");
  7956. forumButtonHover = new Sprite("login/forum_h");
  7957. voteButton = new Sprite("login/vote");
  7958. voteButtonHover = new Sprite("login/vote_h");
  7959. storeButton = new Sprite("login/store");
  7960. storeButtonHover = new Sprite("login/store_h");
  7961. itemlistButton = new Sprite("login/itemlist");
  7962. itemlistButtonHover = new Sprite("login/itemlist_h");
  7963. chatArea = new Sprite("chatarea");
  7964. infinity = new Sprite("infinity");
  7965. for (int i = 0; i <= 34; i++) {
  7966. ORBS[i] = new Sprite("orbs/ORBS " + i + "");
  7967. }
  7968. HPBarFull = new Sprite("orbs/HP 0");
  7969. HPBarEmpty = new Sprite("orbs/HP 1");
  7970. chatButtons = new Sprite("chatbuttons");
  7971. chatButtonH = new Sprite("chathover");
  7972. chatButtonC = new Sprite("chatclicked");
  7973. chatButtonHC = new Sprite("chatclickedh");
  7974. reportH = new Sprite("reporthover");
  7975. tabArea = new Sprite("orbs/tabarea474");
  7976. mapArea = new Sprite("orbs/Mapback474");
  7977. logIconH = new Sprite("orbs/logiconh");
  7978. logIconC = new Sprite("orbs/logiconc");
  7979. hitPointsFill = new Sprite("orbs/hitpointsfill");
  7980. hitPointsIcon = new Sprite("orbs/hitpointsicon");
  7981. prayerFill = new Sprite("orbs/prayerfill");
  7982. prayerIcon = new Sprite("orbs/prayericon");
  7983. emptyOrb = new Sprite("orbs/emptyorb");
  7984. runFill = new Sprite("orbs/runFill"); /**/
  7985. RSFont.unpackImages(modIcons, clanIcons);
  7986. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7987. mapBack = new Background(streamLoader_2, "mapback", 0);
  7988. for (int j3 = 0; j3 < 14; j3++)
  7989. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7990. for (int r1 = 0; r1 < 5; r1++)
  7991. redStones[r1] = new Sprite(streamLoader_2, "redstones", r1);
  7992.  
  7993. compass = new Sprite(streamLoader_2, "compass", 0);
  7994. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7995. mapEdge.method345();
  7996. try {
  7997. for (int k3 = 0; k3 < 100; k3++)
  7998. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  7999. k3);
  8000. } catch (Exception _ex) {
  8001. }
  8002. try {
  8003. for (int l3 = 0; l3 < 100; l3++)
  8004. mapFunctions[l3] = new Sprite(streamLoader_2,
  8005. "mapfunction", l3);
  8006. } catch (Exception _ex) {
  8007. }
  8008. try {
  8009. for (int i4 = 0; i4 < 20; i4++)
  8010. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8011. } catch (Exception _ex) {
  8012. }
  8013. try {
  8014. for (int h1 = 0; h1 < 6; h1++)
  8015. headIconsHint[h1] = new Sprite(streamLoader_2,
  8016. "headicons_hint", h1);
  8017. } catch (Exception _ex) {
  8018. }
  8019. try {
  8020. for (int j4 = 0; j4 < 8; j4++)
  8021. headIcons[j4] = new Sprite(streamLoader_2,
  8022. "headicons_prayer", j4);
  8023. for (int j45 = 0; j45 < 3; j45++)
  8024. skullIcons[j45] = new Sprite(streamLoader_2,
  8025. "headicons_pk", j45);
  8026. } catch (Exception _ex) {
  8027. }
  8028. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8029. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8030. for (int k4 = 0; k4 < 8; k4++)
  8031. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8032.  
  8033. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8034. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8035. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8036. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8037. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8038. scrollBar1 = new Background(streamLoader_2, "scrollbar", 0);
  8039. scrollBar2 = new Background(streamLoader_2, "scrollbar", 1);
  8040.  
  8041. for (int l4 = 0; l4 < 11; l4++)
  8042. modIcons[l4] = new Sprite(streamLoader_2, "mod_icons", l4);
  8043.  
  8044. Sprite sprite = new Sprite("frame");
  8045. frame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  8046. getGameComponent());
  8047. sprite.method346(0, 0);
  8048.  
  8049. int i5 = (int) (Math.random() * 21D) - 10;
  8050. int j5 = (int) (Math.random() * 21D) - 10;
  8051. int k5 = (int) (Math.random() * 21D) - 10;
  8052. int l5 = (int) (Math.random() * 41D) - 20;
  8053. for (int i6 = 0; i6 < 100; i6++) {
  8054. if (mapFunctions[i6] != null)
  8055. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8056. if (mapScenes[i6] != null)
  8057. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8058. }
  8059.  
  8060. drawLoadingText(83, "Unpacking textures");
  8061. Texture.method368(streamLoader_3);
  8062. Texture.method372(0.80000000000000004D);
  8063. Texture.method367();
  8064. drawLoadingText(86, "Unpacking config");
  8065. Animation.unpackConfig(streamLoader);
  8066. ObjectDef.unpackConfig(streamLoader);
  8067. Floor.unpackConfig(streamLoader);
  8068. OverLayFlo317.unpackConfig(streamLoader);
  8069. ItemDef.unpackConfig(streamLoader);
  8070. EntityDef.unpackConfig(streamLoader);
  8071. IDK.unpackConfig(streamLoader);
  8072. SpotAnim.unpackConfig(streamLoader);
  8073. Varp.unpackConfig(streamLoader);
  8074. VarBit.unpackConfig(streamLoader);
  8075. ItemDef.isMembers = isMembers;
  8076. drawLoadingText(95, "Unpacking interfaces");
  8077. TextDrawingArea allFonts[] = { smallText, aTextDrawingArea_1271,
  8078. chatTextDrawingArea, aTextDrawingArea_1273 };
  8079. RSInterface.fonts = allFonts;
  8080. RSInterface.unpack(streamLoader_1, allFonts, streamLoader_2);
  8081. drawLoadingText(100, "Preparing game engine");
  8082. for (int j6 = 0; j6 < 33; j6++) {
  8083. int k6 = 999;
  8084. int i7 = 0;
  8085. for (int k7 = 0; k7 < 34; k7++) {
  8086. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  8087. if (k6 == 999)
  8088. k6 = k7;
  8089. continue;
  8090. }
  8091. if (k6 == 999)
  8092. continue;
  8093. i7 = k7;
  8094. break;
  8095. }
  8096.  
  8097. anIntArray968[j6] = k6;
  8098. anIntArray1057[j6] = i7 - k6;
  8099. }
  8100.  
  8101. for (int l6 = 5; l6 < 156; l6++) {
  8102. int j7 = 999;
  8103. int l7 = 0;
  8104. for (int j8 = 25; j8 < 172; j8++) {
  8105. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0
  8106. && (j8 > 34 || l6 > 34)) {
  8107. if (j7 == 999)
  8108. j7 = j8;
  8109. continue;
  8110. }
  8111. if (j7 == 999)
  8112. continue;
  8113. l7 = j8;
  8114. break;
  8115. }
  8116.  
  8117. anIntArray1052[l6 - 5] = j7 - 25;
  8118. anIntArray1229[l6 - 5] = l7 - j7;
  8119. }
  8120.  
  8121. Texture.method365(519, 165);
  8122. anIntArray1180 = Texture.anIntArray1472;
  8123. Texture.method365(246, 335);
  8124. anIntArray1181 = Texture.anIntArray1472;
  8125. Texture.method365(512, 334);
  8126. anIntArray1182 = Texture.anIntArray1472;
  8127. int ai[] = new int[9];
  8128. for (int i8 = 0; i8 < 9; i8++) {
  8129. int k8 = 128 + i8 * 32 + 15;
  8130. int l8 = 600 + k8 * 3;
  8131. int i9 = Texture.anIntArray1470[k8];
  8132. ai[i8] = l8 * i9 >> 16;
  8133. }
  8134.  
  8135. WorldController.method310(500, 800, 512, 334, ai);
  8136. Censor.loadConfig(streamLoader_4);
  8137. mouseDetection = new MouseDetection(this);
  8138. startRunnable(mouseDetection, 10);
  8139. Animable_Sub5.clientInstance = this;
  8140. ObjectDef.clientInstance = this;
  8141. EntityDef.clientInstance = this;
  8142. return;
  8143. } catch (Exception exception) {
  8144. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8145. }
  8146. loadingError = true;
  8147. }
  8148.  
  8149. private void method91(Stream stream, int i) {
  8150. while (stream.bitPosition + 10 < i * 8) {
  8151. int j = stream.readBits(11);
  8152. if (j == 2047)
  8153. break;
  8154. if (playerArray[j] == null) {
  8155. playerArray[j] = new Player();
  8156. if (aStreamArray895s[j] != null)
  8157. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8158. }
  8159. playerIndices[playerCount++] = j;
  8160. Player player = playerArray[j];
  8161. player.anInt1537 = loopCycle;
  8162. int k = stream.readBits(1);
  8163. if (k == 1)
  8164. anIntArray894[anInt893++] = j;
  8165. int l = stream.readBits(1);
  8166. int i1 = stream.readBits(5);
  8167. if (i1 > 15)
  8168. i1 -= 32;
  8169. int j1 = stream.readBits(5);
  8170. if (j1 > 15)
  8171. j1 -= 32;
  8172. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  8173. l == 1);
  8174. }
  8175. stream.finishBitAccess();
  8176. }
  8177.  
  8178. /**
  8179. *
  8180. * @param circleX
  8181. * X coordinate of the circle, the most X of the circle.
  8182. * @param circleY
  8183. * Y coordinate of the circle, the most Y of the circle.
  8184. * @param clickX
  8185. * Current position of the player click/mouse.
  8186. * @param clickY
  8187. * Current position of the player click/mouse.
  8188. * @param radius
  8189. * How big the circle is.
  8190. * @return True, if the player click/mouse is in the circle.
  8191. */
  8192. public static boolean inCircle(int circleX, int circleY, int clickX,
  8193. int clickY, int radius) {
  8194. return java.lang.Math.pow((circleX + radius - clickX), 2)
  8195. + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math
  8196. .pow(radius, 2);
  8197. }
  8198.  
  8199. private void processMainScreenClick() {
  8200. if (anInt1021 != 0)
  8201. return;
  8202. if (super.clickMode3 == 1) {
  8203. int i = super.saveClickX - 565;
  8204. int j = super.saveClickY - 5 - 4;
  8205. int mouseX = i;
  8206. int mouseY = j;
  8207. if ((inCircle(0, 0, mouseX, mouseY, 73)
  8208. && !(mouseX >= 21 && mouseX <= 48 && mouseY >= 132 && mouseY <= 141) && !(mouseX >= 21
  8209. && mouseX <= 43 && mouseY >= 124 && mouseY <= 131))
  8210. || mouseX >= 61
  8211. && mouseX <= 80
  8212. && mouseY >= 135
  8213. && mouseY <= 149) {
  8214. i -= 73;
  8215. j -= 75;
  8216. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8217. int i1 = Texture.anIntArray1470[k];
  8218. int j1 = Texture.anIntArray1471[k];
  8219. i1 = i1 * (minimapInt3 + 256) >> 8;
  8220. j1 = j1 * (minimapInt3 + 256) >> 8;
  8221. int k1 = j * i1 + i * j1 >> 11;
  8222. int l1 = j * j1 - i * i1 >> 11;
  8223. int i2 = myPlayer.x + k1 >> 7;
  8224. int j2 = myPlayer.y - l1 >> 7;
  8225. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  8226. j2, myPlayer.smallX[0], true, i2);
  8227. if (flag1) {
  8228. stream.writeWordBigEndian(i);
  8229. stream.writeWordBigEndian(j);
  8230. stream.writeWord(minimapInt1);
  8231. stream.writeWordBigEndian(57);
  8232. stream.writeWordBigEndian(minimapInt2);
  8233. stream.writeWordBigEndian(minimapInt3);
  8234. stream.writeWordBigEndian(89);
  8235. stream.writeWord(myPlayer.x);
  8236. stream.writeWord(myPlayer.y);
  8237. stream.writeWordBigEndian(anInt1264);
  8238. stream.writeWordBigEndian(63);
  8239. }
  8240. }
  8241. anInt1117++;
  8242. if (anInt1117 > 1151) {
  8243. anInt1117 = 0;
  8244. stream.createFrame(246);
  8245. stream.writeWordBigEndian(0);
  8246. int l = stream.currentOffset;
  8247. if ((int) (Math.random() * 2D) == 0)
  8248. stream.writeWordBigEndian(101);
  8249. stream.writeWordBigEndian(197);
  8250. stream.writeWord((int) (Math.random() * 65536D));
  8251. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8252. stream.writeWordBigEndian(67);
  8253. stream.writeWord(14214);
  8254. if ((int) (Math.random() * 2D) == 0)
  8255. stream.writeWord(29487);
  8256. stream.writeWord((int) (Math.random() * 65536D));
  8257. if ((int) (Math.random() * 2D) == 0)
  8258. stream.writeWordBigEndian(220);
  8259. stream.writeWordBigEndian(180);
  8260. stream.writeBytes(stream.currentOffset - l);
  8261. }
  8262. }
  8263. }
  8264.  
  8265. private String interfaceIntToString(int j) {
  8266. if (j < 0x3b9ac9ff)
  8267. return String.valueOf(j);
  8268. else
  8269. return "*";
  8270. }
  8271.  
  8272. private void showErrorScreen() {
  8273. Graphics g = getGameComponent().getGraphics();
  8274. g.setColor(Color.black);
  8275. g.fillRect(0, 0, 765, 503);
  8276. method4(1);
  8277. if (loadingError) {
  8278. aBoolean831 = false;
  8279. g.setFont(new Font("Helvetica", 1, 16));
  8280. g.setColor(Color.yellow);
  8281. int k = 35;
  8282. g.drawString(
  8283. "Sorry, an error has occured whilst loading RuneScape", 30,
  8284. k);
  8285. k += 50;
  8286. g.setColor(Color.white);
  8287. g.drawString("To fix this try the following (in order):", 30, k);
  8288. k += 50;
  8289. g.setColor(Color.white);
  8290. g.setFont(new Font("Helvetica", 1, 12));
  8291. g.drawString(
  8292. "1: Try closing ALL open web-browser windows, and reloading",
  8293. 30, k);
  8294. k += 30;
  8295. g.drawString(
  8296. "2: Try clearing your web-browsers cache from tools->internet options",
  8297. 30, k);
  8298. k += 30;
  8299. g.drawString("3: Try using a different game-world", 30, k);
  8300. k += 30;
  8301. g.drawString("4: Try rebooting your computer", 30, k);
  8302. k += 30;
  8303. g.drawString(
  8304. "5: Try selecting a different version of Java from the play-game menu",
  8305. 30, k);
  8306. }
  8307. if (genericLoadingError) {
  8308. aBoolean831 = false;
  8309. g.setFont(new Font("Helvetica", 1, 20));
  8310. g.setColor(Color.white);
  8311. g.drawString("Error - unable to load game!", 50, 50);
  8312. g.drawString("To play RuneScape make sure you play from", 50, 100);
  8313. g.drawString("http://www.runescape.com", 50, 150);
  8314. }
  8315. if (rsAlreadyLoaded) {
  8316. aBoolean831 = false;
  8317. g.setColor(Color.yellow);
  8318. int l = 35;
  8319. g.drawString(
  8320. "Error a copy of RuneScape already appears to be loaded",
  8321. 30, l);
  8322. l += 50;
  8323. g.setColor(Color.white);
  8324. g.drawString("To fix this try the following (in order):", 30, l);
  8325. l += 50;
  8326. g.setColor(Color.white);
  8327. g.setFont(new Font("Helvetica", 1, 12));
  8328. g.drawString(
  8329. "1: Try closing ALL open web-browser windows, and reloading",
  8330. 30, l);
  8331. l += 30;
  8332. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8333. l += 30;
  8334. }
  8335. }
  8336.  
  8337. public URL getCodeBase() {
  8338. try {
  8339. return new URL(server + ":" + (80 + portOff));
  8340. } catch (Exception _ex) {
  8341. }
  8342. return null;
  8343. }
  8344.  
  8345. private void method95() {
  8346. for (int j = 0; j < npcCount; j++) {
  8347. int k = npcIndices[j];
  8348. NPC npc = npcArray[k];
  8349. if (npc != null)
  8350. method96(npc);
  8351. }
  8352. }
  8353.  
  8354. private void method96(Entity entity) {
  8355. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  8356. || entity.y >= 13184) {
  8357. entity.anim = -1;
  8358. entity.anInt1520 = -1;
  8359. entity.anInt1547 = 0;
  8360. entity.anInt1548 = 0;
  8361. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8362. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8363. entity.method446();
  8364. }
  8365. if (entity == myPlayer
  8366. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  8367. entity.anim = -1;
  8368. entity.anInt1520 = -1;
  8369. entity.anInt1547 = 0;
  8370. entity.anInt1548 = 0;
  8371. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8372. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8373. entity.method446();
  8374. }
  8375. if (entity.anInt1547 > loopCycle)
  8376. method97(entity);
  8377. else if (entity.anInt1548 >= loopCycle)
  8378. method98(entity);
  8379. else
  8380. method99(entity);
  8381. method100(entity);
  8382. method101(entity);
  8383. }
  8384.  
  8385. private void method97(Entity entity) {
  8386. int i = entity.anInt1547 - loopCycle;
  8387. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8388. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8389. entity.x += (j - entity.x) / i;
  8390. entity.y += (k - entity.y) / i;
  8391. entity.anInt1503 = 0;
  8392. if (entity.anInt1549 == 0)
  8393. entity.turnDirection = 1024;
  8394. if (entity.anInt1549 == 1)
  8395. entity.turnDirection = 1536;
  8396. if (entity.anInt1549 == 2)
  8397. entity.turnDirection = 0;
  8398. if (entity.anInt1549 == 3)
  8399. entity.turnDirection = 512;
  8400. }
  8401.  
  8402. private void method98(Entity entity) {
  8403. if (entity.anInt1548 == loopCycle
  8404. || entity.anim == -1
  8405. || entity.anInt1529 != 0
  8406. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  8407. .method258(entity.anInt1527)) {
  8408. int i = entity.anInt1548 - entity.anInt1547;
  8409. int j = loopCycle - entity.anInt1547;
  8410. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8411. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8412. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8413. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8414. entity.x = (k * (i - j) + i1 * j) / i;
  8415. entity.y = (l * (i - j) + j1 * j) / i;
  8416. }
  8417. entity.anInt1503 = 0;
  8418. if (entity.anInt1549 == 0)
  8419. entity.turnDirection = 1024;
  8420. if (entity.anInt1549 == 1)
  8421. entity.turnDirection = 1536;
  8422. if (entity.anInt1549 == 2)
  8423. entity.turnDirection = 0;
  8424. if (entity.anInt1549 == 3)
  8425. entity.turnDirection = 512;
  8426. entity.anInt1552 = entity.turnDirection;
  8427. }
  8428.  
  8429. private void method99(Entity entity) {
  8430. entity.anInt1517 = entity.anInt1511;
  8431. if (entity.smallXYIndex == 0) {
  8432. entity.anInt1503 = 0;
  8433. return;
  8434. }
  8435. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8436. Animation animation = Animation.anims[entity.anim];
  8437. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  8438. entity.anInt1503++;
  8439. return;
  8440. }
  8441. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  8442. entity.anInt1503++;
  8443. return;
  8444. }
  8445. }
  8446. int i = entity.x;
  8447. int j = entity.y;
  8448. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8449. * 64;
  8450. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8451. * 64;
  8452. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  8453. entity.x = k;
  8454. entity.y = l;
  8455. return;
  8456. }
  8457. if (i < k) {
  8458. if (j < l)
  8459. entity.turnDirection = 1280;
  8460. else if (j > l)
  8461. entity.turnDirection = 1792;
  8462. else
  8463. entity.turnDirection = 1536;
  8464. } else if (i > k) {
  8465. if (j < l)
  8466. entity.turnDirection = 768;
  8467. else if (j > l)
  8468. entity.turnDirection = 256;
  8469. else
  8470. entity.turnDirection = 512;
  8471. } else if (j < l)
  8472. entity.turnDirection = 1024;
  8473. else
  8474. entity.turnDirection = 0;
  8475. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8476. if (i1 > 1024)
  8477. i1 -= 2048;
  8478. int j1 = entity.anInt1555;
  8479. if (i1 >= -256 && i1 <= 256)
  8480. j1 = entity.anInt1554;
  8481. else if (i1 >= 256 && i1 < 768)
  8482. j1 = entity.anInt1557;
  8483. else if (i1 >= -768 && i1 <= -256)
  8484. j1 = entity.anInt1556;
  8485. if (j1 == -1)
  8486. j1 = entity.anInt1554;
  8487. entity.anInt1517 = j1;
  8488. int k1 = 4;
  8489. if (entity.anInt1552 != entity.turnDirection
  8490. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8491. k1 = 2;
  8492. if (entity.smallXYIndex > 2)
  8493. k1 = 6;
  8494. if (entity.smallXYIndex > 3)
  8495. k1 = 8;
  8496. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  8497. k1 = 8;
  8498. entity.anInt1503--;
  8499. }
  8500. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8501. k1 <<= 1;
  8502. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  8503. && entity.anInt1505 != -1)
  8504. entity.anInt1517 = entity.anInt1505;
  8505. if (i < k) {
  8506. entity.x += k1;
  8507. if (entity.x > k)
  8508. entity.x = k;
  8509. } else if (i > k) {
  8510. entity.x -= k1;
  8511. if (entity.x < k)
  8512. entity.x = k;
  8513. }
  8514. if (j < l) {
  8515. entity.y += k1;
  8516. if (entity.y > l)
  8517. entity.y = l;
  8518. } else if (j > l) {
  8519. entity.y -= k1;
  8520. if (entity.y < l)
  8521. entity.y = l;
  8522. }
  8523. if (entity.x == k && entity.y == l) {
  8524. entity.smallXYIndex--;
  8525. if (entity.anInt1542 > 0)
  8526. entity.anInt1542--;
  8527. }
  8528. }
  8529.  
  8530. private void method100(Entity entity) {
  8531. if (entity.anInt1504 == 0)
  8532. return;
  8533. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  8534. NPC npc = npcArray[entity.interactingEntity];
  8535. if (npc != null) {
  8536. int i1 = entity.x - npc.x;
  8537. int k1 = entity.y - npc.y;
  8538. if (i1 != 0 || k1 != 0)
  8539. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8540. }
  8541. }
  8542. if (entity.interactingEntity >= 32768) {
  8543. int j = entity.interactingEntity - 32768;
  8544. if (j == unknownInt10)
  8545. j = myPlayerIndex;
  8546. Player player = playerArray[j];
  8547. if (player != null) {
  8548. int l1 = entity.x - player.x;
  8549. int i2 = entity.y - player.y;
  8550. if (l1 != 0 || i2 != 0)
  8551. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8552. }
  8553. }
  8554. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  8555. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  8556. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8557. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8558. if (k != 0 || j1 != 0)
  8559. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8560. entity.anInt1538 = 0;
  8561. entity.anInt1539 = 0;
  8562. }
  8563. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8564. if (l != 0) {
  8565. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8566. entity.anInt1552 = entity.turnDirection;
  8567. else if (l > 1024)
  8568. entity.anInt1552 -= entity.anInt1504;
  8569. else
  8570. entity.anInt1552 += entity.anInt1504;
  8571. entity.anInt1552 &= 0x7ff;
  8572. if (entity.anInt1517 == entity.anInt1511
  8573. && entity.anInt1552 != entity.turnDirection) {
  8574. if (entity.anInt1512 != -1) {
  8575. entity.anInt1517 = entity.anInt1512;
  8576. return;
  8577. }
  8578. entity.anInt1517 = entity.anInt1554;
  8579. }
  8580. }
  8581. }
  8582.  
  8583. public void method101(Entity entity) {
  8584. try {
  8585. entity.aBoolean1541 = false;
  8586. if (entity.anInt1517 > Animation.anims.length)
  8587. entity.anInt1517 = -1;
  8588. if (entity.anInt1517 != -1) {
  8589. Animation animation = Animation.anims[entity.anInt1517];
  8590. entity.anInt1519++;
  8591. if (animation == null)
  8592. return;
  8593. if (entity.anInt1518 < animation.anInt352
  8594. && entity.anInt1519 > animation
  8595. .method258(entity.anInt1518)) {
  8596. entity.anInt1519 = entity.anInt1517 == 7043 ? 1 : 0;
  8597. entity.anInt1518++;
  8598. }
  8599. if (entity.anInt1518 >= animation.anInt352) {
  8600. entity.anInt1519 = entity.anInt1517 == 7043 ? 1 : 0;
  8601. entity.anInt1518 = 0;
  8602. }
  8603. }
  8604. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  8605. if (entity.anInt1521 < 0)
  8606. entity.anInt1521 = 0;
  8607. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8608. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  8609. && entity.anInt1522 > animation_1
  8610. .method258(entity.anInt1521); entity.anInt1521++)
  8611. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8612.  
  8613. if (entity.anInt1521 >= animation_1.anInt352
  8614. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8615. entity.anInt1520 = -1;
  8616. }
  8617. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  8618. Animation animation_2 = Animation.anims[entity.anim];
  8619. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  8620. && entity.anInt1547 <= loopCycle
  8621. && entity.anInt1548 < loopCycle) {
  8622. entity.anInt1529 = 1;
  8623. return;
  8624. }
  8625. }
  8626. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8627. Animation animation_3 = Animation.anims[entity.anim];
  8628. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  8629. && entity.anInt1528 > animation_3
  8630. .method258(entity.anInt1527); entity.anInt1527++)
  8631. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8632.  
  8633. if (entity.anInt1527 >= animation_3.anInt352) {
  8634. entity.anInt1527 -= animation_3.anInt356;
  8635. entity.anInt1530++;
  8636. if (entity.anInt1530 >= animation_3.anInt362)
  8637. entity.anim = -1;
  8638. if (entity.anInt1527 < 0
  8639. || entity.anInt1527 >= animation_3.anInt352)
  8640. entity.anim = -1;
  8641. }
  8642. entity.aBoolean1541 = animation_3.aBoolean358;
  8643. }
  8644. if (entity.anInt1529 > 0)
  8645. entity.anInt1529--;
  8646. } catch (Exception e) {
  8647.  
  8648. }
  8649. }
  8650.  
  8651. private void drawGameScreen() {
  8652. if (welcomeScreenRaised) {
  8653. welcomeScreenRaised = false;
  8654. frame.drawGraphics(0, super.graphics, 0);
  8655. needDrawTabArea = true;
  8656. inputTaken = true;
  8657. tabAreaAltered = true;
  8658. aBoolean1233 = true;
  8659. if (loadingStage != 2) {
  8660. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8661. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8662. }
  8663. }
  8664. if (loadingStage == 2)
  8665. method146();
  8666. if (menuOpen && menuScreenArea == 1)
  8667. needDrawTabArea = true;
  8668. if (invOverlayInterfaceID != -1) {
  8669. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8670. if (flag1)
  8671. needDrawTabArea = true;
  8672. }
  8673. if (atInventoryInterfaceType == 2)
  8674. needDrawTabArea = true;
  8675. if (activeInterfaceType == 2)
  8676. needDrawTabArea = true;
  8677. if (needDrawTabArea) {
  8678. drawTabArea();
  8679. needDrawTabArea = false;
  8680. }
  8681. if (backDialogID == -1) {
  8682. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8683. if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8684. method65(494, 110, super.mouseX - 0, super.mouseY - 348,
  8685. aClass9_1059, 0, false, anInt1211);
  8686. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8687. if (i < 0)
  8688. i = 0;
  8689. if (i > anInt1211 - 110)
  8690. i = anInt1211 - 110;
  8691. if (anInt1089 != i) {
  8692. anInt1089 = i;
  8693. inputTaken = true;
  8694. }
  8695. }
  8696. if (backDialogID != -1) {
  8697. boolean flag2 = method119(anInt945, backDialogID);
  8698. if (flag2)
  8699. inputTaken = true;
  8700. }
  8701. if (atInventoryInterfaceType == 3)
  8702. inputTaken = true;
  8703. if (activeInterfaceType == 3)
  8704. inputTaken = true;
  8705. if (aString844 != null)
  8706. inputTaken = true;
  8707. if (menuOpen && menuScreenArea == 2)
  8708. inputTaken = true;
  8709. if (inputTaken) {
  8710. drawChatArea();
  8711. inputTaken = false;
  8712. }
  8713. if (loadingStage == 2) {
  8714. drawMinimap();
  8715. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8716. }
  8717. if (anInt1054 != -1)
  8718. tabAreaAltered = true;
  8719. if (tabAreaAltered) {
  8720. if (anInt1054 != -1 && anInt1054 == tabID) {
  8721. anInt1054 = -1;
  8722. stream.createFrame(120);
  8723. stream.writeWordBigEndian(tabID);
  8724. }
  8725. tabAreaAltered = false;
  8726. aRSImageProducer_1125.initDrawingArea();
  8727. aRSImageProducer_1165.initDrawingArea();
  8728. }
  8729. anInt945 = 0;
  8730. }
  8731.  
  8732. private boolean buildFriendsListMenu(RSInterface class9) {
  8733. int i = class9.contentType;
  8734. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  8735. if (i >= 801)
  8736. i -= 701;
  8737. else if (i >= 701)
  8738. i -= 601;
  8739. else if (i >= 101)
  8740. i -= 101;
  8741. else
  8742. i--;
  8743. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8744. menuActionID[menuActionRow] = 792;
  8745. menuActionRow++;
  8746. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8747. menuActionID[menuActionRow] = 639;
  8748. menuActionRow++;
  8749. return true;
  8750. }
  8751. if (i >= 401 && i <= 500) {
  8752. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8753. menuActionID[menuActionRow] = 322;
  8754. menuActionRow++;
  8755. return true;
  8756. } else {
  8757. return false;
  8758. }
  8759. }
  8760.  
  8761. private void method104() {
  8762. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8763. .reverseGetFirst();
  8764. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8765. .reverseGetNext())
  8766. if (class30_sub2_sub4_sub3.anInt1560 != plane
  8767. || class30_sub2_sub4_sub3.aBoolean1567)
  8768. class30_sub2_sub4_sub3.unlink();
  8769. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  8770. class30_sub2_sub4_sub3.method454(anInt945);
  8771. if (class30_sub2_sub4_sub3.aBoolean1567)
  8772. class30_sub2_sub4_sub3.unlink();
  8773. else
  8774. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  8775. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  8776. class30_sub2_sub4_sub3.anInt1562, 60,
  8777. class30_sub2_sub4_sub3.anInt1561,
  8778. class30_sub2_sub4_sub3, false);
  8779. }
  8780.  
  8781. }
  8782.  
  8783. public void drawBlackBox(int xPos, int yPos) {
  8784. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8785. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8786. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8787. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8788. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8789. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8790. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8791. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8792. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8793. }
  8794.  
  8795. public void drawOnBankInterface() {
  8796. // try {
  8797. if (openInterfaceID == 5292
  8798. && RSInterface.interfaceCache[27000].message.equals("1")) { // Sent
  8799. // on
  8800. // bank
  8801. // opening
  8802. // etc,
  8803. // refresh
  8804. // tabs
  8805. int tabs = Integer
  8806. .parseInt(RSInterface.interfaceCache[27001].message); // #
  8807. // of
  8808. // tabs
  8809. // used
  8810. int tab = Integer
  8811. .parseInt(RSInterface.interfaceCache[27002].message); // current
  8812. // tab
  8813. // selected
  8814. // System.out.println("Doing tabs up");
  8815. for (int i = 0; i <= tabs; i++) {
  8816. RSInterface.interfaceCache[22025 + i].sprite1 = new Sprite(
  8817. "Interfaces/Bank/TAB 3");
  8818. RSInterface.interfaceCache[22025 + i].tooltip = "Click here to select tab "
  8819. + (int) (i + 1);
  8820. }
  8821. for (int i = tabs + 1; i <= 8; i++) {
  8822. RSInterface.interfaceCache[22024 + i].sprite1 = new Sprite("");
  8823. RSInterface.interfaceCache[22024 + i].tooltip = "";
  8824. }
  8825. if (tabs != 8) {
  8826. RSInterface.interfaceCache[22025 + tabs].sprite1 = new Sprite(
  8827. "Interfaces/Bank/TAB 4");
  8828. RSInterface.interfaceCache[22025 + tabs].tooltip = "Drag an item here to create a new tab";
  8829. }
  8830. // System.out.println(tab);
  8831. if (tab == -1) // searching
  8832. RSInterface.interfaceCache[22024].sprite1 = new Sprite(
  8833. "Interfaces/Bank/TAB 1");
  8834. else if (tab > 0) {
  8835. RSInterface.interfaceCache[22024 + tab].sprite1 = new Sprite(
  8836. "Interfaces/Bank/TAB 2");
  8837. RSInterface.interfaceCache[22024].sprite1 = new Sprite(
  8838. "Interfaces/Bank/TAB 1");
  8839. } else
  8840. RSInterface.interfaceCache[22024].sprite1 = new Sprite(
  8841. "Bank/TAB 0");
  8842. // TODO: Highlight first item in new tab... (NOT MAIN) ADD BELOW TO
  8843. // RSINTERFACE
  8844. // RSInterface.interfaceCache[22043].sprite1 = new Sprite("");
  8845. RSInterface.interfaceCache[27000].message = "0";
  8846. }
  8847. /*
  8848. * } catch (Exception e) { //do w.e }
  8849. */
  8850. }
  8851.  
  8852. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8853. if (class9.type != 0 || class9.children == null)
  8854. return;
  8855. if (class9.isMouseoverTriggered && anInt1026 != class9.id
  8856. && anInt1048 != class9.id && anInt1039 != class9.id)
  8857. return;
  8858. int i1 = DrawingArea.topX;
  8859. int j1 = DrawingArea.topY;
  8860. int k1 = DrawingArea.bottomX;
  8861. int l1 = DrawingArea.bottomY;
  8862. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8863. int i2 = class9.children.length;
  8864. for (int j2 = 0; j2 < i2; j2++) {
  8865. int k2 = class9.childX[j2] + k;
  8866. int l2 = (class9.childY[j2] + l) - j;
  8867. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8868. k2 += class9_1.anInt263;
  8869. l2 += class9_1.anInt265;
  8870. if (class9_1.contentType > 0)
  8871. drawFriendsListOrWelcomeScreen(class9_1);
  8872. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  8873. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  8874. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  8875. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  8876. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  8877. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  8878. 12436, 12446, 12456, 6004, 18471, /* Ancients */
  8879. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  8880. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  8881. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  8882. for (int m5 = 0; m5 < IDs.length; m5++) {
  8883. if (class9_1.id == IDs[m5] + 1) {
  8884. if (m5 > 61)
  8885. drawBlackBox(k2 + 1, l2);
  8886. else
  8887. drawBlackBox(k2, l2 + 1);
  8888. }
  8889. }
  8890. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  8891. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  8892. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  8893. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  8894. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  8895. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  8896. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  8897. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  8898. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  8899. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  8900. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  8901. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  8902. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  8903. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  8904. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  8905. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  8906. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  8907. for (int r = 0; r < runeChildren.length; r++)
  8908. if (class9_1.id == runeChildren[r])
  8909. class9_1.anInt269 = 775;
  8910. if (class9_1.type == 0) {
  8911. if (class9_1.scrollPosition > class9_1.scrollMax
  8912. - class9_1.height)
  8913. class9_1.scrollPosition = class9_1.scrollMax
  8914. - class9_1.height;
  8915. if (class9_1.scrollPosition < 0)
  8916. class9_1.scrollPosition = 0;
  8917. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8918. if (class9_1.scrollMax > class9_1.height) {
  8919. // clan chat
  8920. if (class9_1.id == 18143) {
  8921. int clanMates = 0;
  8922. for (int i = 18155; i < 18244; i++) {
  8923. RSInterface line = RSInterface.interfaceCache[i];
  8924. if (line.message.length() > 0) {
  8925. clanMates++;
  8926. }
  8927. }
  8928. class9_1.scrollMax = (clanMates * 14) + class9_1.height
  8929. + 1;
  8930. }
  8931. if (class9_1.id == 18322 || class9_1.id == 18423) {
  8932. int members = 0;
  8933. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  8934. RSInterface line = RSInterface.interfaceCache[i];
  8935. if (line != null && line.message != null) {
  8936. if (line.message.length() > 0) {
  8937. members++;
  8938. }
  8939. }
  8940. }
  8941. class9_1.scrollMax = (members * 14) + 1;
  8942. }
  8943. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2,
  8944. k2 + class9_1.width, class9_1.scrollMax);
  8945. }
  8946. } else if (class9_1.type != 1)
  8947. if (class9_1.type == 2) {
  8948. int i3 = 0;
  8949. for (int l3 = 0; l3 < class9_1.height; l3++) {
  8950. for (int l4 = 0; l4 < class9_1.width; l4++) {
  8951. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8952. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8953. if (i3 < 20) {
  8954. k5 += class9_1.spritesX[i3];
  8955. j6 += class9_1.spritesY[i3];
  8956. }
  8957. if (class9_1.inv[i3] > 0) {
  8958. int k6 = 0;
  8959. int j7 = 0;
  8960. int j9 = class9_1.inv[i3] - 1;
  8961. if (k5 > DrawingArea.topX - 32
  8962. && k5 < DrawingArea.bottomX
  8963. && j6 > DrawingArea.topY - 32
  8964. && j6 < DrawingArea.bottomY
  8965. || activeInterfaceType != 0
  8966. && anInt1085 == i3) {
  8967. int l9 = 0;
  8968. if (itemSelected == 1 && anInt1283 == i3
  8969. && anInt1284 == class9_1.id)
  8970. l9 = 0xffffff;
  8971. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  8972. .getSprite(j9,
  8973. class9_1.invStackSizes[i3],
  8974. l9);
  8975. if (class30_sub2_sub1_sub1_2 != null) {
  8976. if (activeInterfaceType != 0
  8977. && anInt1085 == i3
  8978. && anInt1084 == class9_1.id) {
  8979. k6 = super.mouseX - anInt1087;
  8980. j7 = super.mouseY - anInt1088;
  8981. if (k6 < 5 && k6 > -5)
  8982. k6 = 0;
  8983. if (j7 < 5 && j7 > -5)
  8984. j7 = 0;
  8985. if (anInt989 < 10) {
  8986. k6 = 0;
  8987. j7 = 0;
  8988. }
  8989. class30_sub2_sub1_sub1_2
  8990. .drawSprite1(k5 + k6, j6
  8991. + j7);
  8992. if (j6 + j7 < DrawingArea.topY
  8993. && class9.scrollPosition > 0) {
  8994. int i10 = (anInt945 * (DrawingArea.topY
  8995. - j6 - j7)) / 3;
  8996. if (i10 > anInt945 * 10)
  8997. i10 = anInt945 * 10;
  8998. if (i10 > class9.scrollPosition)
  8999. i10 = class9.scrollPosition;
  9000. class9.scrollPosition -= i10;
  9001. anInt1088 += i10;
  9002. }
  9003. if (j6 + j7 + 32 > DrawingArea.bottomY
  9004. && class9.scrollPosition < class9.scrollMax
  9005. - class9.height) {
  9006. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9007. if (j10 > anInt945 * 10)
  9008. j10 = anInt945 * 10;
  9009. if (j10 > class9.scrollMax
  9010. - class9.height
  9011. - class9.scrollPosition)
  9012. j10 = class9.scrollMax
  9013. - class9.height
  9014. - class9.scrollPosition;
  9015. class9.scrollPosition += j10;
  9016. anInt1088 -= j10;
  9017. }
  9018. } else if (atInventoryInterfaceType != 0
  9019. && atInventoryIndex == i3
  9020. && atInventoryInterface == class9_1.id)
  9021. class30_sub2_sub1_sub1_2
  9022. .drawSprite1(k5, j6);
  9023. else
  9024. class30_sub2_sub1_sub1_2
  9025. .drawSprite(k5, j6);
  9026. if (class30_sub2_sub1_sub1_2.anInt1444 == 33
  9027. || class9_1.invStackSizes[i3] != 1) {
  9028. int k10 = class9_1.invStackSizes[i3];
  9029. if (intToKOrMil(k10) == "@inf@") {
  9030. infinity.drawSprite(k5 + k6, j6
  9031. + j7);
  9032. } else {
  9033. if (k10 > 99999
  9034. && k10 < 10000000) {
  9035. smallText.method385(
  9036. 0xFFFFFF,
  9037. intToKOrMil(k10),
  9038. j6 + 9 + j7, k5
  9039. + k6);
  9040. } else if (k10 > 9999999) {
  9041. smallText.method385(
  9042. 0x00ff80,
  9043. intToKOrMil(k10),
  9044. j6 + 9 + j7, k5
  9045. + k6);
  9046. } else {
  9047. smallText.method385(
  9048. 0xFFFF00,
  9049. intToKOrMil(k10),
  9050. j6 + 9 + j7, k5
  9051. + k6);
  9052. }
  9053. }
  9054. }
  9055. }
  9056. }
  9057. } else if (class9_1.sprites != null && i3 < 20) {
  9058. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9059. if (class30_sub2_sub1_sub1_1 != null)
  9060. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9061. }
  9062. i3++;
  9063. }
  9064.  
  9065. }
  9066.  
  9067. } else if (class9_1.type == 3) {
  9068. boolean flag = false;
  9069. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  9070. || anInt1026 == class9_1.id)
  9071. flag = true;
  9072. int j3;
  9073. if (interfaceIsSelected(class9_1)) {
  9074. j3 = class9_1.anInt219;
  9075. if (flag && class9_1.anInt239 != 0)
  9076. j3 = class9_1.anInt239;
  9077. } else {
  9078. j3 = class9_1.textColor;
  9079. if (flag && class9_1.anInt216 != 0)
  9080. j3 = class9_1.anInt216;
  9081. }
  9082. if (class9_1.aByte254 == 0) {
  9083. if (class9_1.aBoolean227)
  9084. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  9085. class9_1.width);
  9086. else
  9087. DrawingArea.fillPixels(k2, class9_1.width,
  9088. class9_1.height, j3, l2);
  9089. } else if (class9_1.aBoolean227)
  9090. DrawingArea.method335(j3, l2, class9_1.width,
  9091. class9_1.height,
  9092. 256 - (class9_1.aByte254 & 0xff), k2);
  9093. else
  9094. DrawingArea.method338(l2, class9_1.height,
  9095. 256 - (class9_1.aByte254 & 0xff), j3,
  9096. class9_1.width, k2);
  9097. } else if (class9_1.type == 4) {
  9098. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9099. String s = class9_1.message;
  9100. boolean flag1 = false;
  9101. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  9102. || anInt1026 == class9_1.id)
  9103. flag1 = true;
  9104. int i4;
  9105. if (interfaceIsSelected(class9_1)) {
  9106. i4 = class9_1.anInt219;
  9107. if (flag1 && class9_1.anInt239 != 0)
  9108. i4 = class9_1.anInt239;
  9109. if (class9_1.aString228.length() > 0)
  9110. s = class9_1.aString228;
  9111. } else {
  9112. i4 = class9_1.textColor;
  9113. if (flag1 && class9_1.anInt216 != 0)
  9114. i4 = class9_1.anInt216;
  9115. }
  9116. if (class9_1.atActionType == 6 && aBoolean1149) {
  9117. s = "Please wait...";
  9118. i4 = class9_1.textColor;
  9119. }
  9120. if (DrawingArea.width == 519) {
  9121. if (i4 == 0xffff00)
  9122. i4 = 255;
  9123. if (i4 == 49152)
  9124. i4 = 0xffffff;
  9125. }
  9126. if ((class9_1.parentID == 1151)
  9127. || (class9_1.parentID == 12855)) {
  9128. switch (i4) {
  9129. case 16773120:
  9130. i4 = 0xFE981F;
  9131. break;
  9132. case 7040819:
  9133. i4 = 0xAF6A1A;
  9134. break;
  9135. }
  9136. }
  9137. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  9138. if (s.indexOf("%") != -1) {
  9139. do {
  9140. int k7 = s.indexOf("%1");
  9141. if (k7 == -1)
  9142. break;
  9143. s = s.substring(0, k7)
  9144. + interfaceIntToString(extractInterfaceValues(
  9145. class9_1, 0))
  9146. + s.substring(k7 + 2);
  9147. } while (true);
  9148. do {
  9149. int l7 = s.indexOf("%2");
  9150. if (l7 == -1)
  9151. break;
  9152. s = s.substring(0, l7)
  9153. + interfaceIntToString(extractInterfaceValues(
  9154. class9_1, 1))
  9155. + s.substring(l7 + 2);
  9156. } while (true);
  9157. do {
  9158. int i8 = s.indexOf("%3");
  9159. if (i8 == -1)
  9160. break;
  9161. s = s.substring(0, i8)
  9162. + interfaceIntToString(extractInterfaceValues(
  9163. class9_1, 2))
  9164. + s.substring(i8 + 2);
  9165. } while (true);
  9166. do {
  9167. int j8 = s.indexOf("%4");
  9168. if (j8 == -1)
  9169. break;
  9170. s = s.substring(0, j8)
  9171. + interfaceIntToString(extractInterfaceValues(
  9172. class9_1, 3))
  9173. + s.substring(j8 + 2);
  9174. } while (true);
  9175. do {
  9176. int k8 = s.indexOf("%5");
  9177. if (k8 == -1)
  9178. break;
  9179. s = s.substring(0, k8)
  9180. + interfaceIntToString(extractInterfaceValues(
  9181. class9_1, 4))
  9182. + s.substring(k8 + 2);
  9183. } while (true);
  9184. }
  9185. int l8 = s.indexOf("\\n");
  9186. String s1;
  9187. if (l8 != -1) {
  9188. s1 = s.substring(0, l8);
  9189. s = s.substring(l8 + 2);
  9190. } else {
  9191. s1 = s;
  9192. s = "";
  9193. }
  9194. if (class9_1.centerText) {
  9195. newSmallFont.drawCenteredString(s1, k2
  9196. + class9_1.width / 2, l6, i4,
  9197. class9_1.textShadow ? 0 : -1);
  9198. } else {
  9199. newSmallFont.drawBasicString(s1, k2, l6, i4,
  9200. class9_1.textShadow ? 0 : -1);
  9201. }
  9202. }
  9203. } else if (class9_1.type == 5) {
  9204. // whats this?
  9205. Sprite sprite;
  9206. if (interfaceIsSelected(class9_1))
  9207. sprite = class9_1.sprite2;
  9208. else
  9209. sprite = class9_1.sprite1;
  9210. if (spellSelected == 1 && class9_1.id == spellID
  9211. && spellID != 0 && sprite != null) {
  9212. sprite.drawSprite(k2, l2, 0xffffff);
  9213. } else {
  9214. if (sprite != null)
  9215. sprite.drawSprite(k2, l2);
  9216. }
  9217. if (sprite != null)
  9218. sprite.drawSprite(k2, l2);
  9219. } else if (class9_1.type == 6) {
  9220. int k3 = Texture.textureInt1;
  9221. int j4 = Texture.textureInt2;
  9222. Texture.textureInt1 = k2 + class9_1.width / 2;
  9223. Texture.textureInt2 = l2 + class9_1.height / 2;
  9224. int i5 = Texture.anIntArray1470[class9_1.modelRotation1]
  9225. * class9_1.anInt269 >> 16;
  9226. int l5 = Texture.anIntArray1471[class9_1.modelRotation1]
  9227. * class9_1.anInt269 >> 16;
  9228. boolean flag2 = interfaceIsSelected(class9_1);
  9229. int i7;
  9230. if (flag2)
  9231. i7 = class9_1.anInt258;
  9232. else
  9233. i7 = class9_1.anInt257;
  9234. Model model;
  9235. if (i7 == -1) {
  9236. model = class9_1.method209(-1, -1, flag2);
  9237. } else {
  9238. Animation animation = Animation.anims[i7];
  9239. model = class9_1.method209(
  9240. animation.anIntArray354[class9_1.anInt246],
  9241. animation.anIntArray353[class9_1.anInt246],
  9242. flag2);
  9243. }
  9244. if (model != null)
  9245. model.method482(class9_1.modelRotation2, 0,
  9246. class9_1.modelRotation1, 0, i5, l5);
  9247. Texture.textureInt1 = k3;
  9248. Texture.textureInt2 = j4;
  9249. } else if (class9_1.type == 7) {
  9250. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9251. int k4 = 0;
  9252. for (int j5 = 0; j5 < class9_1.height; j5++) {
  9253. for (int i6 = 0; i6 < class9_1.width; i6++) {
  9254. if (class9_1.inv[k4] > 0) {
  9255. ItemDef itemDef = ItemDef
  9256. .forID(class9_1.inv[k4] - 1);
  9257. String s2 = itemDef.name;
  9258. if (itemDef.stackable
  9259. || class9_1.invStackSizes[k4] != 1)
  9260. s2 = s2
  9261. + " x"
  9262. + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9263. int i9 = k2 + i6
  9264. * (115 + class9_1.invSpritePadX);
  9265. int k9 = l2 + j5
  9266. * (12 + class9_1.invSpritePadY);
  9267. if (class9_1.centerText)
  9268. textDrawingArea_1.method382(
  9269. class9_1.textColor, i9
  9270. + class9_1.width / 2, s2,
  9271. k9, class9_1.textShadow);
  9272. else
  9273. textDrawingArea_1.method389(
  9274. class9_1.textShadow, i9,
  9275. class9_1.textColor, s2, k9);
  9276. }
  9277. k4++;
  9278. }
  9279.  
  9280. }
  9281.  
  9282. }
  9283. if (class9_1.type == 12) {
  9284. Sprite sprite;
  9285. if (interfaceIsSelected(class9_1))
  9286. sprite = class9_1.sprite2;
  9287. else
  9288. sprite = class9_1.sprite1;
  9289. if (sprite != null)
  9290. sprite.drawAdvancedSprite(k2, l2);
  9291. } else if (class9_1.type == 9) {
  9292. drawHoverBox(k2, l2, class9_1.message);
  9293. }
  9294. }
  9295.  
  9296. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9297. }
  9298.  
  9299. public void drawHoverBox(int xPos, int yPos, String text) {
  9300. String[] results = text.split("\n");
  9301. int height = (results.length * 16) + 3;
  9302. int width;
  9303. width = smallText.getTextWidth(results[0]) + 6;
  9304. for (int i = 1; i < results.length; i++)
  9305. if (width <= smallText.getTextWidth(results[i]) + 6)
  9306. width = smallText.getTextWidth(results[i]) + 6;
  9307. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  9308. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  9309. yPos += 14;
  9310. for (int i = 0; i < results.length; i++) {
  9311. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  9312. yPos += 16;
  9313. }
  9314. }
  9315.  
  9316. private boolean interfaceContainsItem(int interfaceId) {
  9317. RSInterface rsi = RSInterface.interfaceCache[interfaceId];
  9318. if (rsi == null)
  9319. return false;
  9320. if (rsi.inv == null) {
  9321. return false;
  9322. }
  9323. int count = 0;
  9324. for (int i = 0; i < rsi.inv.length; i++) {
  9325. if (rsi.inv[i] > 0) {
  9326. count++;
  9327. }
  9328. }
  9329. return count > 0;
  9330. }
  9331.  
  9332. private void randomizeBackground(Background background) {
  9333. int j = 256;
  9334. for (int k = 0; k < anIntArray1190.length; k++)
  9335. anIntArray1190[k] = 0;
  9336.  
  9337. for (int l = 0; l < 5000; l++) {
  9338. int i1 = (int) (Math.random() * 128D * (double) j);
  9339. anIntArray1190[i1] = (int) (Math.random() * 256D);
  9340. }
  9341.  
  9342. for (int j1 = 0; j1 < 20; j1++) {
  9343. for (int k1 = 1; k1 < j - 1; k1++) {
  9344. for (int i2 = 1; i2 < 127; i2++) {
  9345. int k2 = i2 + (k1 << 7);
  9346. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  9347. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9348. }
  9349.  
  9350. }
  9351.  
  9352. int ai[] = anIntArray1190;
  9353. anIntArray1190 = anIntArray1191;
  9354. anIntArray1191 = ai;
  9355. }
  9356.  
  9357. if (background != null) {
  9358. int l1 = 0;
  9359. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  9360. for (int l2 = 0; l2 < background.anInt1452; l2++)
  9361. if (background.aByteArray1450[l1++] != 0) {
  9362. int i3 = l2 + 16 + background.anInt1454;
  9363. int j3 = j2 + 16 + background.anInt1455;
  9364. int k3 = i3 + (j3 << 7);
  9365. anIntArray1190[k3] = 0;
  9366. }
  9367.  
  9368. }
  9369.  
  9370. }
  9371. }
  9372.  
  9373. private void method107(int i, int j, Stream stream, Player player) {
  9374. if ((i & 0x400) != 0) {
  9375. player.anInt1543 = stream.method428();
  9376. player.anInt1545 = stream.method428();
  9377. player.anInt1544 = stream.method428();
  9378. player.anInt1546 = stream.method428();
  9379. player.anInt1547 = stream.method436() + loopCycle;
  9380. player.anInt1548 = stream.method435() + loopCycle;
  9381. player.anInt1549 = stream.method428();
  9382. player.method446();
  9383. }
  9384. if ((i & 0x100) != 0) {
  9385. player.anInt1520 = stream.method434();
  9386. int k = stream.readDWord();
  9387. player.anInt1524 = k >> 16;
  9388. player.anInt1523 = loopCycle + (k & 0xffff);
  9389. player.anInt1521 = 0;
  9390. player.anInt1522 = 0;
  9391. if (player.anInt1523 > loopCycle)
  9392. player.anInt1521 = -1;
  9393. if (player.anInt1520 == 65535)
  9394. player.anInt1520 = -1;
  9395. }
  9396. if ((i & 8) != 0) {
  9397. int l = stream.method434();
  9398. if (l == 65535)
  9399. l = -1;
  9400. int i2 = stream.method427();
  9401. if (l == player.anim && l != -1) {
  9402. int i3 = Animation.anims[l].anInt365;
  9403. if (i3 == 1) {
  9404. player.anInt1527 = 0;
  9405. player.anInt1528 = 0;
  9406. player.anInt1529 = i2;
  9407. player.anInt1530 = 0;
  9408. }
  9409. if (i3 == 2)
  9410. player.anInt1530 = 0;
  9411. } else if (l == -1
  9412. || player.anim == -1
  9413. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  9414. player.anim = l;
  9415. player.anInt1527 = 0;
  9416. player.anInt1528 = 0;
  9417. player.anInt1529 = i2;
  9418. player.anInt1530 = 0;
  9419. player.anInt1542 = player.smallXYIndex;
  9420. }
  9421. }
  9422. if ((i & 4) != 0) {
  9423. player.textSpoken = stream.readString();
  9424. if (player.textSpoken.charAt(0) == '~') {
  9425. player.textSpoken = player.textSpoken.substring(1);
  9426. pushMessage(player.textSpoken, 2, player.name);
  9427. } else if (player == myPlayer)
  9428. pushMessage(player.textSpoken, 2, player.name);
  9429. player.anInt1513 = 0;
  9430. player.anInt1531 = 0;
  9431. player.textCycle = 150;
  9432. }
  9433. if ((i & 0x80) != 0) {
  9434. int i1 = stream.method434();
  9435. int j2 = stream.readUnsignedByte();
  9436. int j3 = stream.method427();
  9437. int k3 = stream.currentOffset;
  9438. if (player.name != null && player.visible) {
  9439. long l3 = TextClass.longForName(player.name);
  9440. boolean flag = false;
  9441. if (j2 <= 1) {
  9442. for (int i4 = 0; i4 < ignoreCount; i4++) {
  9443. if (ignoreListAsLongs[i4] != l3)
  9444. continue;
  9445. flag = true;
  9446. break;
  9447. }
  9448.  
  9449. }
  9450. if (!flag && anInt1251 == 0)
  9451. try {
  9452. aStream_834.currentOffset = 0;
  9453. stream.method442(j3, 0, aStream_834.buffer);
  9454. aStream_834.currentOffset = 0;
  9455. String s = TextInput.method525(j3, aStream_834);
  9456. // s = Censor.doCensor(s);
  9457. player.textSpoken = s;
  9458. player.anInt1513 = i1 >> 8;
  9459. player.privelage = j2;
  9460.  
  9461. // System.out.println("Other authority: " + j2 + ", " +
  9462. // player.name);
  9463. player.anInt1531 = i1 & 0xff;
  9464. player.textCycle = 150;
  9465. String cr = "";
  9466. if (j2 == 10)
  9467. cr = "@cr10@";
  9468. if (j2 == 9)
  9469. cr = "@cr9@";
  9470. if (j2 == 8)
  9471. cr = "@cr8@";
  9472. if (j2 == 7)
  9473. cr = "@cr7@";
  9474. if (j2 == 6)
  9475. cr = "@cr6@";
  9476. if (j2 == 5)
  9477. cr = "@cr5@";
  9478. if (j2 == 4)
  9479. cr = "@cr4@";
  9480. if (j2 == 3)
  9481. cr = "@cr3@";
  9482. if (j2 == 2)
  9483. cr = "@cr2@";
  9484. if (j2 == 1)
  9485. cr = "@cr1@";
  9486.  
  9487. // others
  9488. pushMessage(s, 1,
  9489. cr + "<col=" + titleColor(player.titleColor, 0)
  9490. + ">" + player.title + "</col> "
  9491. + player.name);
  9492. } catch (Exception exception) {
  9493. signlink.reporterror("cde2");
  9494. }
  9495. }
  9496. stream.currentOffset = k3 + j3;
  9497. }
  9498. if ((i & 1) != 0) {
  9499. player.interactingEntity = stream.method434();
  9500. if (player.interactingEntity == 65535)
  9501. player.interactingEntity = -1;
  9502. }
  9503. if ((i & 0x10) != 0) {
  9504. int j1 = stream.method427();
  9505. byte abyte0[] = new byte[j1];
  9506. Stream stream_1 = new Stream(abyte0);
  9507. stream.readBytes(j1, 0, abyte0);
  9508. aStreamArray895s[j] = stream_1;
  9509. player.updatePlayer(stream_1);
  9510. }
  9511. if ((i & 2) != 0) {
  9512. player.anInt1538 = stream.method436();
  9513. player.anInt1539 = stream.method434();
  9514. }
  9515. if ((i & 0x20) != 0) {
  9516. int k1 = stream.readUnsignedByte();
  9517. int k2 = stream.method426();
  9518. player.updateHitData(k2, k1, loopCycle);
  9519. player.loopCycleStatus = loopCycle + 300;
  9520. player.currentHealth = stream.method427();
  9521. player.maxHealth = stream.readUnsignedByte();
  9522. }
  9523. if ((i & 0x200) != 0) {
  9524. int l1 = stream.readUnsignedByte();
  9525. int l2 = stream.method428();
  9526. player.updateHitData(l2, l1, loopCycle);
  9527. player.loopCycleStatus = loopCycle + 300;
  9528. player.currentHealth = stream.readUnsignedByte();
  9529. player.maxHealth = stream.method427();
  9530. }
  9531. }
  9532.  
  9533. private void method108() {
  9534. try {
  9535. int j = myPlayer.x + anInt1278;
  9536. int k = myPlayer.y + anInt1131;
  9537. if (anInt1014 - j < -500 || anInt1014 - j > 500
  9538. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  9539. anInt1014 = j;
  9540. anInt1015 = k;
  9541. }
  9542. if (anInt1014 != j)
  9543. anInt1014 += (j - anInt1014) / 16;
  9544. if (anInt1015 != k)
  9545. anInt1015 += (k - anInt1015) / 16;
  9546. if (super.keyArray[1] == 1)
  9547. anInt1186 += (-24 - anInt1186) / 2;
  9548. else if (super.keyArray[2] == 1)
  9549. anInt1186 += (24 - anInt1186) / 2;
  9550. else
  9551. anInt1186 /= 2;
  9552. if (super.keyArray[3] == 1)
  9553. anInt1187 += (12 - anInt1187) / 2;
  9554. else if (super.keyArray[4] == 1)
  9555. anInt1187 += (-12 - anInt1187) / 2;
  9556. else
  9557. anInt1187 /= 2;
  9558. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  9559. anInt1184 += anInt1187 / 2;
  9560. if (anInt1184 < 128)
  9561. anInt1184 = 128;
  9562. if (anInt1184 > 383)
  9563. anInt1184 = 383;
  9564. int l = anInt1014 >> 7;
  9565. int i1 = anInt1015 >> 7;
  9566. int j1 = method42(plane, anInt1015, anInt1014);
  9567. int k1 = 0;
  9568. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  9569. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  9570. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  9571. int l2 = plane;
  9572. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9573. l2++;
  9574. int i3 = j1 - intGroundArray[l2][l1][k2];
  9575. if (i3 > k1)
  9576. k1 = i3;
  9577. }
  9578.  
  9579. }
  9580.  
  9581. }
  9582. anInt1005++;
  9583. if (anInt1005 > 1512) {
  9584. anInt1005 = 0;
  9585. stream.createFrame(77);
  9586. stream.writeWordBigEndian(0);
  9587. int i2 = stream.currentOffset;
  9588. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9589. stream.writeWordBigEndian(101);
  9590. stream.writeWordBigEndian(233);
  9591. stream.writeWord(45092);
  9592. if ((int) (Math.random() * 2D) == 0)
  9593. stream.writeWord(35784);
  9594. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9595. stream.writeWordBigEndian(64);
  9596. stream.writeWordBigEndian(38);
  9597. stream.writeWord((int) (Math.random() * 65536D));
  9598. stream.writeWord((int) (Math.random() * 65536D));
  9599. stream.writeBytes(stream.currentOffset - i2);
  9600. }
  9601. int j2 = k1 * 192;
  9602. if (j2 > 0x17f00)
  9603. j2 = 0x17f00;
  9604. if (j2 < 32768)
  9605. j2 = 32768;
  9606. if (j2 > anInt984) {
  9607. anInt984 += (j2 - anInt984) / 24;
  9608. return;
  9609. }
  9610. if (j2 < anInt984) {
  9611. anInt984 += (j2 - anInt984) / 80;
  9612. }
  9613. } catch (Exception _ex) {
  9614. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  9615. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  9616. + anInt1070 + "," + baseX + "," + baseY);
  9617. throw new RuntimeException("eek");
  9618. }
  9619. }
  9620.  
  9621. public void processDrawing() {
  9622. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  9623. showErrorScreen();
  9624. return;
  9625. }
  9626. anInt1061++;
  9627. if (!loggedIn)
  9628. drawLoginScreen(false);
  9629. else
  9630. drawGameScreen();
  9631. anInt1213 = 0;
  9632. }
  9633.  
  9634. private boolean isFriendOrSelf(String s) {
  9635. if (s == null)
  9636. return false;
  9637. for (int i = 0; i < friendsCount; i++)
  9638. if (s.equalsIgnoreCase(friendsList[i]))
  9639. return true;
  9640. return s.equalsIgnoreCase(myPlayer.name);
  9641. }
  9642.  
  9643. private static String combatDiffColor(int i, int j) {
  9644. int k = i - j;
  9645. if (k < -9)
  9646. return "@red@";
  9647. if (k < -6)
  9648. return "@or3@";
  9649. if (k < -3)
  9650. return "@or2@";
  9651. if (k < 0)
  9652. return "@or1@";
  9653. if (k > 9)
  9654. return "@gre@";
  9655. if (k > 6)
  9656. return "@gr3@";
  9657. if (k > 3)
  9658. return "@gr2@";
  9659. if (k > 0)
  9660. return "@gr1@";
  9661. else
  9662. return "@yel@";
  9663. }
  9664.  
  9665. private void setWaveVolume(int i) {
  9666. signlink.wavevol = i;
  9667. }
  9668.  
  9669. private String calculateInMinutes(int timer) {
  9670. int amountMinutes = (int) Math.floor((timer / 60));
  9671. int amountSeconds = (timer - (amountMinutes * 60));
  9672. String minutes = "" + amountMinutes;
  9673. String seconds = "" + amountSeconds;
  9674. if (amountSeconds < 10) {
  9675. seconds = "0" + seconds;
  9676. }
  9677. if (amountMinutes < 10) {
  9678. minutes = "0" + minutes;
  9679. }
  9680. return minutes + ":" + seconds;
  9681. }
  9682.  
  9683. public Sprite freezeBar;
  9684. private boolean prayerHover;
  9685.  
  9686. private void draw3dScreen() {
  9687.  
  9688. if (experienceOrb) {
  9689. if (counterOn) {
  9690. drawXpCounterBar();
  9691. }
  9692. }
  9693. drawSplitPrivateChat();
  9694. if (crossType == 1) {
  9695. crosses[crossIndex / 100]
  9696. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9697. anInt1142++;
  9698. if (anInt1142 > 67) {
  9699. anInt1142 = 0;
  9700. stream.createFrame(78);
  9701. }
  9702. }
  9703. if (crossType == 2)
  9704. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  9705. crossY - 8 - 4);
  9706. if (anInt1018 != -1) {
  9707. method119(anInt945, anInt1018);
  9708. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9709. }
  9710. if (openInterfaceID != -1) {
  9711. method119(anInt945, openInterfaceID);
  9712. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9713. }
  9714. method70();
  9715. if (!menuOpen) {
  9716. processRightClick();
  9717. drawTooltip();
  9718. } else if (menuScreenArea == 0)
  9719. drawMenu();
  9720. if (anInt1055 == 1)
  9721. multiOverlay.drawSprite(472, 296);
  9722. if (fpsOn) {
  9723. char c = '\u01FB';
  9724. int k = 20;
  9725. int i1 = 0xffff00;
  9726. if (super.fps < 15)
  9727. i1 = 0xff0000;
  9728. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9729. k += 15;
  9730. Runtime runtime = Runtime.getRuntime();
  9731. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9732. i1 = 0xffff00;
  9733. if (j1 > 0x2000000 && lowMem)
  9734. i1 = 0xff0000;
  9735. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9736. k += 15;
  9737. }
  9738. int i1 = 0xffff00;
  9739. int x = baseX + (myPlayer.x - 6 >> 7);
  9740. int y = baseY + (myPlayer.y - 6 >> 7);
  9741. if (clientData) {
  9742. char c = '\u01FB';
  9743. int k = 20;
  9744. if (super.fps < 15)
  9745. i1 = 0xff0000;
  9746. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285,
  9747. 5);
  9748. Runtime runtime = Runtime.getRuntime();
  9749. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9750. i1 = 0xffff00;
  9751. if (j1 > 0x2000000 && lowMem)
  9752. i1 = 0xff0000;
  9753. k += 15;
  9754. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299,
  9755. 5);
  9756. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: "
  9757. + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9758. aTextDrawingArea_1271.method385(0xffff00,
  9759. "Coords: " + x + ", " + y, 329, 5);
  9760. }
  9761. if (anInt1104 != 0) {
  9762. int j = anInt1104 / 50;
  9763. int l = j / 60;
  9764. j %= 60;
  9765. if (j < 10)
  9766. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  9767. + l + ":0" + j, 329, 4);
  9768. else
  9769. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  9770. + l + ":" + j, 329, 4);
  9771. anInt849++;
  9772. if (anInt849 > 75) {
  9773. anInt849 = 0;
  9774. stream.createFrame(148);
  9775. }
  9776. }
  9777. }
  9778.  
  9779. private void addIgnore(long l) {
  9780. try {
  9781. if (l == 0L)
  9782. return;
  9783. if (ignoreCount >= 100) {
  9784. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9785. return;
  9786. }
  9787. String s = TextClass.fixName(TextClass.nameForLong(l));
  9788. for (int j = 0; j < ignoreCount; j++)
  9789. if (ignoreListAsLongs[j] == l) {
  9790. pushMessage(s + " is already on your ignore list", 0, "");
  9791. return;
  9792. }
  9793. for (int k = 0; k < friendsCount; k++)
  9794. if (friendsListAsLongs[k] == l) {
  9795. pushMessage("Please remove " + s
  9796. + " from your friend list first", 0, "");
  9797. return;
  9798. }
  9799.  
  9800. ignoreListAsLongs[ignoreCount++] = l;
  9801. needDrawTabArea = true;
  9802. stream.createFrame(133);
  9803. stream.writeQWord(l);
  9804. return;
  9805. } catch (RuntimeException runtimeexception) {
  9806. signlink.reporterror("45688, " + l + ", " + 4 + ", "
  9807. + runtimeexception.toString());
  9808. }
  9809. throw new RuntimeException();
  9810. }
  9811.  
  9812. private void method114() {
  9813. for (int i = -1; i < playerCount; i++) {
  9814. int j;
  9815. if (i == -1)
  9816. j = myPlayerIndex;
  9817. else
  9818. j = playerIndices[i];
  9819. Player player = playerArray[j];
  9820. if (player != null)
  9821. method96(player);
  9822. }
  9823.  
  9824. }
  9825.  
  9826. private void method115() {
  9827. if (loadingStage == 2) {
  9828. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  9829. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  9830. .reverseGetNext()) {
  9831. if (class30_sub1.anInt1294 > 0)
  9832. class30_sub1.anInt1294--;
  9833. if (class30_sub1.anInt1294 == 0) {
  9834. if (class30_sub1.anInt1299 < 0
  9835. || ObjectManager.method178(class30_sub1.anInt1299,
  9836. class30_sub1.anInt1301)) {
  9837. method142(class30_sub1.anInt1298,
  9838. class30_sub1.anInt1295, class30_sub1.anInt1300,
  9839. class30_sub1.anInt1301, class30_sub1.anInt1297,
  9840. class30_sub1.anInt1296, class30_sub1.anInt1299);
  9841. class30_sub1.unlink();
  9842. }
  9843. } else {
  9844. if (class30_sub1.anInt1302 > 0)
  9845. class30_sub1.anInt1302--;
  9846. if (class30_sub1.anInt1302 == 0
  9847. && class30_sub1.anInt1297 >= 1
  9848. && class30_sub1.anInt1298 >= 1
  9849. && class30_sub1.anInt1297 <= 102
  9850. && class30_sub1.anInt1298 <= 102
  9851. && (class30_sub1.anInt1291 < 0 || ObjectManager
  9852. .method178(class30_sub1.anInt1291,
  9853. class30_sub1.anInt1293))) {
  9854. method142(class30_sub1.anInt1298,
  9855. class30_sub1.anInt1295, class30_sub1.anInt1292,
  9856. class30_sub1.anInt1293, class30_sub1.anInt1297,
  9857. class30_sub1.anInt1296, class30_sub1.anInt1291);
  9858. class30_sub1.anInt1302 = -1;
  9859. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  9860. && class30_sub1.anInt1299 == -1)
  9861. class30_sub1.unlink();
  9862. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  9863. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  9864. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9865. class30_sub1.unlink();
  9866. }
  9867. }
  9868. }
  9869.  
  9870. }
  9871. }
  9872.  
  9873. private void determineMenuSize() {
  9874. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9875. for (int j = 0; j < menuActionRow; j++) {
  9876. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9877. if (k > i)
  9878. i = k;
  9879. }
  9880.  
  9881. i += 8;
  9882. int l = 15 * menuActionRow + 21;
  9883. if (super.saveClickX > 4 && super.saveClickY > 4
  9884. && super.saveClickX < 516 && super.saveClickY < 338) {
  9885. int i1 = super.saveClickX - 4 - i / 2;
  9886. if (i1 + i > 512)
  9887. i1 = 512 - i;
  9888. if (i1 < 0)
  9889. i1 = 0;
  9890. int l1 = super.saveClickY - 4;
  9891. if (l1 + l > 334)
  9892. l1 = 334 - l;
  9893. if (l1 < 0)
  9894. l1 = 0;
  9895. menuOpen = true;
  9896. menuScreenArea = 0;
  9897. menuOffsetX = i1;
  9898. menuOffsetY = l1;
  9899. menuWidth = i;
  9900. anInt952 = 15 * menuActionRow + 22;
  9901. }
  9902. System.out.println(super.saveClickX);
  9903. System.out.println(super.saveClickY);
  9904. if (super.saveClickX > 519 && super.saveClickY > 168
  9905. && super.saveClickX < 765 && super.saveClickY < 503) {
  9906. int j1 = super.saveClickX - 519 - i / 2;
  9907. if (j1 < 0)
  9908. j1 = 0;
  9909. else if (j1 + i > 245)
  9910. j1 = 245 - i;
  9911. int i2 = super.saveClickY - 168;
  9912. if (i2 < 0)
  9913. i2 = 0;
  9914. else if (i2 + l > 333)
  9915. i2 = 333 - l;
  9916. menuOpen = true;
  9917. menuScreenArea = 1;
  9918. menuOffsetX = j1;
  9919. menuOffsetY = i2;
  9920. menuWidth = i;
  9921. anInt952 = 15 * menuActionRow + 22;
  9922. }
  9923. if (super.saveClickX > 0 && super.saveClickY > 338
  9924. && super.saveClickX < 516 && super.saveClickY < 503) {
  9925. int k1 = super.saveClickX - 0 - i / 2;
  9926. if (k1 < 0)
  9927. k1 = 0;
  9928. else if (k1 + i > 516)
  9929. k1 = 516 - i;
  9930. int j2 = super.saveClickY - 338;
  9931. if (j2 < 0)
  9932. j2 = 0;
  9933. else if (j2 + l > 165)
  9934. j2 = 165 - l;
  9935. menuOpen = true;
  9936. menuScreenArea = 2;
  9937. menuOffsetX = k1;
  9938. menuOffsetY = j2;
  9939. menuWidth = i;
  9940. anInt952 = 15 * menuActionRow + 22;
  9941. }
  9942. if (super.saveClickX >= 515 && super.saveClickX <= 765
  9943. && super.saveClickY >= 0 && super.saveClickY <= 169) {
  9944. System.out.println("Here2");
  9945. int k1 = super.saveClickX - 515 - i / 2;
  9946. if (k1 < 0)
  9947. k1 = 0;
  9948. else if (k1 + i > 249)
  9949. k1 = 249 - i;
  9950. int j2 = super.saveClickY;
  9951. if (j2 < 0)
  9952. j2 = 0;
  9953. else if (j2 + l > 168)
  9954. j2 = 168 - l;
  9955. menuOpen = true;
  9956. menuScreenArea = 3;
  9957. menuOffsetX = k1;
  9958. menuOffsetY = j2;
  9959. menuWidth = i;
  9960. anInt952 = 15 * menuActionRow + 22;
  9961. }
  9962. }
  9963.  
  9964. private void method117(Stream stream) {
  9965. stream.initBitAccess();
  9966. int j = stream.readBits(1);
  9967. if (j == 0)
  9968. return;
  9969. int k = stream.readBits(2);
  9970. if (k == 0) {
  9971. anIntArray894[anInt893++] = myPlayerIndex;
  9972. return;
  9973. }
  9974. if (k == 1) {
  9975. int l = stream.readBits(3);
  9976. myPlayer.moveInDir(false, l);
  9977. int k1 = stream.readBits(1);
  9978. if (k1 == 1)
  9979. anIntArray894[anInt893++] = myPlayerIndex;
  9980. return;
  9981. }
  9982. if (k == 2) {
  9983. int i1 = stream.readBits(3);
  9984. myPlayer.moveInDir(true, i1);
  9985. int l1 = stream.readBits(3);
  9986. myPlayer.moveInDir(true, l1);
  9987. int j2 = stream.readBits(1);
  9988. if (j2 == 1)
  9989. anIntArray894[anInt893++] = myPlayerIndex;
  9990. return;
  9991. }
  9992. if (k == 3) {
  9993. plane = stream.readBits(2);
  9994. int j1 = stream.readBits(1);
  9995. int i2 = stream.readBits(1);
  9996. if (i2 == 1)
  9997. anIntArray894[anInt893++] = myPlayerIndex;
  9998. int k2 = stream.readBits(7);
  9999. int l2 = stream.readBits(7);
  10000. myPlayer.setPos(l2, k2, j1 == 1);
  10001. }
  10002. }
  10003.  
  10004. private void nullLoader() {
  10005. aBoolean831 = false;
  10006. while (drawingFlames) {
  10007. aBoolean831 = false;
  10008. try {
  10009. Thread.sleep(50L);
  10010. } catch (Exception _ex) {
  10011. }
  10012. }
  10013. // aBackground_966 = null;
  10014. // aBackground_967 = null;
  10015. aBackgroundArray1152s = null;
  10016. anIntArray850 = null;
  10017. anIntArray851 = null;
  10018. anIntArray852 = null;
  10019. anIntArray853 = null;
  10020. anIntArray1190 = null;
  10021. anIntArray1191 = null;
  10022. anIntArray828 = null;
  10023. anIntArray829 = null;
  10024. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10025. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10026. }
  10027.  
  10028. private boolean method119(int i, int j) {
  10029. boolean flag1 = false;
  10030. RSInterface class9 = RSInterface.interfaceCache[j];
  10031. for (int k = 0; k < class9.children.length; k++) {
  10032. if (class9.children[k] == -1)
  10033. break;
  10034. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10035. if (class9_1.type == 1)
  10036. flag1 |= method119(i, class9_1.id);
  10037. if (class9_1.type == 6
  10038. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  10039. boolean flag2 = interfaceIsSelected(class9_1);
  10040. int l;
  10041. if (flag2)
  10042. l = class9_1.anInt258;
  10043. else
  10044. l = class9_1.anInt257;
  10045. if (l != -1) {
  10046. Animation animation = Animation.anims[l];
  10047. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  10048. .method258(class9_1.anInt246);) {
  10049. class9_1.anInt208 -= animation
  10050. .method258(class9_1.anInt246) + 1;
  10051. class9_1.anInt246++;
  10052. if (class9_1.anInt246 >= animation.anInt352) {
  10053. class9_1.anInt246 -= animation.anInt356;
  10054. if (class9_1.anInt246 < 0
  10055. || class9_1.anInt246 >= animation.anInt352)
  10056. class9_1.anInt246 = 0;
  10057. }
  10058. flag1 = true;
  10059. }
  10060.  
  10061. }
  10062. }
  10063. }
  10064.  
  10065. return flag1;
  10066. }
  10067.  
  10068. private int method120() {
  10069. int j = 3;
  10070. if (yCameraCurve < 310) {
  10071. int k = xCameraPos >> 7;
  10072. int l = yCameraPos >> 7;
  10073. int i1 = myPlayer.x >> 7;
  10074. int j1 = myPlayer.y >> 7;
  10075. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10076. j = plane;
  10077. int k1;
  10078. if (i1 > k)
  10079. k1 = i1 - k;
  10080. else
  10081. k1 = k - i1;
  10082. int l1;
  10083. if (j1 > l)
  10084. l1 = j1 - l;
  10085. else
  10086. l1 = l - j1;
  10087. if (k1 > l1) {
  10088. int i2 = (l1 * 0x10000) / k1;
  10089. int k2 = 32768;
  10090. while (k != i1) {
  10091. if (k < i1)
  10092. k++;
  10093. else if (k > i1)
  10094. k--;
  10095. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10096. j = plane;
  10097. k2 += i2;
  10098. if (k2 >= 0x10000) {
  10099. k2 -= 0x10000;
  10100. if (l < j1)
  10101. l++;
  10102. else if (l > j1)
  10103. l--;
  10104. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10105. j = plane;
  10106. }
  10107. }
  10108. } else {
  10109. int j2 = (k1 * 0x10000) / l1;
  10110. int l2 = 32768;
  10111. while (l != j1) {
  10112. if (l < j1)
  10113. l++;
  10114. else if (l > j1)
  10115. l--;
  10116. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10117. j = plane;
  10118. l2 += j2;
  10119. if (l2 >= 0x10000) {
  10120. l2 -= 0x10000;
  10121. if (k < i1)
  10122. k++;
  10123. else if (k > i1)
  10124. k--;
  10125. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10126. j = plane;
  10127. }
  10128. }
  10129. }
  10130. }
  10131. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10132. j = plane;
  10133. return j;
  10134. }
  10135.  
  10136. private int method121() {
  10137. int j = method42(plane, yCameraPos, xCameraPos);
  10138. if (j - zCameraPos < 800
  10139. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10140. return plane;
  10141. else
  10142. return 3;
  10143. }
  10144.  
  10145. private void delIgnore(long l) {
  10146. try {
  10147. if (l == 0L)
  10148. return;
  10149. for (int j = 0; j < ignoreCount; j++)
  10150. if (ignoreListAsLongs[j] == l) {
  10151. ignoreCount--;
  10152. needDrawTabArea = true;
  10153. System.arraycopy(ignoreListAsLongs, j + 1,
  10154. ignoreListAsLongs, j, ignoreCount - j);
  10155.  
  10156. stream.createFrame(74);
  10157. stream.writeQWord(l);
  10158. return;
  10159. }
  10160.  
  10161. return;
  10162. } catch (RuntimeException runtimeexception) {
  10163. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  10164. + runtimeexception.toString());
  10165. }
  10166. throw new RuntimeException();
  10167. }
  10168.  
  10169. public String getParameter(String s) {
  10170. if (signlink.mainapp != null)
  10171. return signlink.mainapp.getParameter(s);
  10172. else
  10173. return super.getParameter(s);
  10174. }
  10175.  
  10176. private void adjustVolume(boolean flag, int i) {
  10177. signlink.midivol = i;
  10178. if (flag)
  10179. signlink.midi = "voladjust";
  10180. }
  10181.  
  10182. private int extractInterfaceValues(RSInterface class9, int j) {
  10183. if (class9.valueIndexArray == null
  10184. || j >= class9.valueIndexArray.length)
  10185. return -2;
  10186. try {
  10187. int ai[] = class9.valueIndexArray[j];
  10188. int k = 0;
  10189. int l = 0;
  10190. int i1 = 0;
  10191. do {
  10192. int j1 = ai[l++];
  10193. int k1 = 0;
  10194. byte byte0 = 0;
  10195. if (j1 == 0)
  10196. return k;
  10197. if (j1 == 1)
  10198. k1 = currentStats[ai[l++]];
  10199. if (j1 == 2)
  10200. k1 = maxStats[ai[l++]];
  10201. if (j1 == 3)
  10202. k1 = currentExp[ai[l++]];
  10203. if (j1 == 4) {
  10204. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10205. int k2 = ai[l++];
  10206. if (k2 >= 0 && k2 < ItemDef.totalItems
  10207. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  10208. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  10209. if (class9_1.inv[j3] == k2 + 1)
  10210. k1 += class9_1.invStackSizes[j3];
  10211.  
  10212. }
  10213. }
  10214. if (j1 == 5)
  10215. k1 = variousSettings[ai[l++]];
  10216. if (j1 == 6)
  10217. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10218. if (j1 == 7)
  10219. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10220. if (j1 == 8)
  10221. k1 = myPlayer.combatLevel;
  10222. if (j1 == 9) {
  10223. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  10224. if (Skills.skillEnabled[l1])
  10225. k1 += maxStats[l1];
  10226.  
  10227. }
  10228. if (j1 == 10) {
  10229. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10230. int l2 = ai[l++] + 1;
  10231. if (l2 >= 0 && l2 < ItemDef.totalItems
  10232. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  10233. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  10234. if (class9_2.inv[k3] != l2)
  10235. continue;
  10236. k1 = 0x3b9ac9ff;
  10237. break;
  10238. }
  10239.  
  10240. }
  10241. }
  10242. if (j1 == 11)
  10243. k1 = energy;
  10244. if (j1 == 12)
  10245. k1 = weight;
  10246. if (j1 == 13) {
  10247. int i2 = variousSettings[ai[l++]];
  10248. int i3 = ai[l++];
  10249. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10250. }
  10251. if (j1 == 14) {
  10252. int j2 = ai[l++];
  10253. VarBit varBit = VarBit.cache[j2];
  10254. int l3 = varBit.anInt648;
  10255. int i4 = varBit.anInt649;
  10256. int j4 = varBit.anInt650;
  10257. int k4 = anIntArray1232[j4 - i4];
  10258. k1 = variousSettings[l3] >> i4 & k4;
  10259. }
  10260. if (j1 == 15)
  10261. byte0 = 1;
  10262. if (j1 == 16)
  10263. byte0 = 2;
  10264. if (j1 == 17)
  10265. byte0 = 3;
  10266. if (j1 == 18)
  10267. k1 = (myPlayer.x >> 7) + baseX;
  10268. if (j1 == 19)
  10269. k1 = (myPlayer.y >> 7) + baseY;
  10270. if (j1 == 20)
  10271. k1 = ai[l++];
  10272. if (byte0 == 0) {
  10273. if (i1 == 0)
  10274. k += k1;
  10275. if (i1 == 1)
  10276. k -= k1;
  10277. if (i1 == 2 && k1 != 0)
  10278. k /= k1;
  10279. if (i1 == 3)
  10280. k *= k1;
  10281. i1 = 0;
  10282. } else {
  10283. i1 = byte0;
  10284. }
  10285. } while (true);
  10286. } catch (Exception _ex) {
  10287. return -1;
  10288. }
  10289. }
  10290.  
  10291. private void drawTooltip() {
  10292. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10293. return;
  10294. String s;
  10295. if (itemSelected == 1 && menuActionRow < 2)
  10296. s = "Use " + selectedItemName;
  10297. else if (spellSelected == 1 && menuActionRow < 2)
  10298. s = spellTooltip + "...";
  10299. else
  10300. s = menuActionName[menuActionRow - 1];
  10301. if (menuActionRow > 2)
  10302. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10303. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10304. }
  10305.  
  10306. public void drawHPOrb() {
  10307. int currentHP = 0;
  10308. try {
  10309. currentHP = Integer
  10310. .parseInt(RSInterface.interfaceCache[4016].message);
  10311. } catch (Exception e) {
  10312. }
  10313. int maxHP = Integer.parseInt(RSInterface.interfaceCache[4017].message);
  10314. int health = (int) (((double) currentHP / (double) maxHP) * 100D);
  10315. ORBS[0] = new Sprite(Sprite.location + "orbs/ORBS " + "29.png", 27,
  10316. getOrbFill((int) (health)));
  10317. ORBS[19].drawSprite(-4, 41);
  10318. ORBS[22].drawSprite(24, 46);
  10319. ORBS[0].drawSprite(24, 46);
  10320. if (health <= 20) {
  10321. if (loopCycle % 20 < 10) {
  10322. ORBS[27].drawSprite(29, 52);
  10323. }
  10324. } else {
  10325. ORBS[27].drawSprite(29, 52);
  10326. }
  10327. smallText.method382(getOrbTextColor(health), 10, "" + currentHP, 68,
  10328. true);
  10329. }
  10330.  
  10331. public final String titleColor(final int i, int type) {
  10332. String titleChatbox = "", titleRightclick = "";
  10333. switch (i) {
  10334.  
  10335. case 0:
  10336. // orange
  10337. titleChatbox = "A67711";
  10338. titleRightclick = "or0";
  10339. break;
  10340.  
  10341. case 1:
  10342. // purple
  10343. titleChatbox = "FF00CD";
  10344. titleRightclick = "pur";
  10345. break;
  10346.  
  10347. case 2:
  10348. // red
  10349. titleChatbox = "ff0000";
  10350. titleRightclick = "red";
  10351. break;
  10352.  
  10353. case 3:
  10354. // green
  10355. titleChatbox = "148200";
  10356. titleRightclick = "gr0";
  10357. break;
  10358.  
  10359. case 4:
  10360. // black
  10361. titleChatbox = "0";
  10362. titleRightclick = "bla";
  10363. break;
  10364.  
  10365. case 5:
  10366. // yellow
  10367. titleChatbox = "ffff00";
  10368. titleRightclick = "yel";
  10369. break;
  10370.  
  10371. case 6:
  10372. // cyan
  10373. titleChatbox = "65535";
  10374. titleRightclick = "cya";
  10375. break;
  10376.  
  10377. case 7:
  10378. // white
  10379. titleChatbox = "ffffff";
  10380. titleRightclick = "whi";
  10381. break;
  10382. }
  10383. if (type == 0)
  10384. return titleChatbox;
  10385. else
  10386. return titleRightclick;
  10387. }
  10388.  
  10389. public final static int MISSING_POINTS_498_PLUS = 0;
  10390. public final static int BASE_OSRS = 19;
  10391. public final static int BASE_OSRS_HOVER = 21;
  10392.  
  10393. public void drawPrayerOrb() {
  10394. int currentPrayerLevel = Integer
  10395. .parseInt(RSInterface.interfaceCache[4012].message);
  10396. int maximumPrayerLevel = Integer
  10397. .parseInt(RSInterface.interfaceCache[4013].message);
  10398. int prayerPercentage = (int) (((double) currentPrayerLevel / (double) maximumPrayerLevel) * 100D);
  10399.  
  10400. ORBS[MISSING_POINTS_498_PLUS] = new Sprite(Sprite.location
  10401. + "orbs/ORBS " + "29.png", 27,
  10402. getOrbFill((int) (prayerPercentage)));
  10403.  
  10404. ORBS[BASE_OSRS].drawSprite(-3, 84);
  10405. ORBS[24].drawSprite(25, 89);
  10406. ORBS[0].drawSprite(25, 89);
  10407. if (currentPrayerLevel < (maximumPrayerLevel / 5)) {
  10408. if (loopCycle % 20 < 10) {
  10409. ORBS[6].drawSprite(28, 92);
  10410. }
  10411. } else {
  10412. ORBS[6].drawSprite(28, 92);
  10413. }
  10414. smallText.method382(getOrbTextColor(prayerPercentage), 12, ""
  10415. + currentPrayerLevel, 111, true);
  10416. }
  10417.  
  10418. public void drawRunOrb() {
  10419. String readCurrentRunEnergy = "100%";
  10420. readCurrentRunEnergy = readCurrentRunEnergy.replaceAll("%", "");
  10421. int currentRunEnergy = Integer.parseInt(readCurrentRunEnergy);
  10422. int maxRunEnergy = 100;
  10423. int run = (int) (((double) currentRunEnergy / (double) maxRunEnergy) * 100D);
  10424.  
  10425. ORBS[0] = new Sprite(Sprite.location + "orbs/ORBS " + "29.png", 27,
  10426. getOrbFill((int) (run)));
  10427. int x = 13;
  10428. int y = 13;
  10429. ORBS[19].drawSprite(11 + x, 107 + y);
  10430. ORBS[26].drawSprite(39 + x, 112 + y);
  10431. ORBS[0].drawSprite(39 + x, 112 + y);
  10432. ORBS[9].drawSprite(46 + x, 115 + y);
  10433. String currentEnergy = RSInterface.interfaceCache[149].message;
  10434. currentEnergy = currentEnergy.replaceAll("%", "");
  10435. smallText.method382(getOrbTextColor(run), 26 + x, currentEnergy,
  10436. 134 + y, true);
  10437. }
  10438.  
  10439. public int getOrbTextColor(int statusInt) {
  10440. if (statusInt >= 75 && statusInt <= 100) {
  10441. return 0x00FF00;
  10442. } else if (statusInt >= 50 && statusInt <= 74) {
  10443. return 0xFFFF00;
  10444. } else if (statusInt >= 25 && statusInt <= 49) {
  10445. return 0xFF981F;
  10446. } else {
  10447. return 0xFF0000;
  10448. }
  10449. }
  10450.  
  10451. public int getOrbFill(int statusInt) {
  10452. if (statusInt <= 100 && statusInt >= 97) {
  10453. return 0;
  10454. } else if (statusInt <= 96 && statusInt >= 93) {
  10455. return 1;
  10456. } else if (statusInt <= 92 && statusInt >= 89) {
  10457. return 2;
  10458. } else if (statusInt <= 88 && statusInt >= 85) {
  10459. return 3;
  10460. } else if (statusInt <= 84 && statusInt >= 81) {
  10461. return 4;
  10462. } else if (statusInt <= 80 && statusInt >= 77) {
  10463. return 5;
  10464. } else if (statusInt <= 76 && statusInt >= 73) {
  10465. return 6;
  10466. } else if (statusInt <= 72 && statusInt >= 69) {
  10467. return 7;
  10468. } else if (statusInt <= 68 && statusInt >= 65) {
  10469. return 8;
  10470. } else if (statusInt <= 64 && statusInt >= 61) {
  10471. return 9;
  10472. } else if (statusInt <= 60 && statusInt >= 57) {
  10473. return 10;
  10474. } else if (statusInt <= 56 && statusInt >= 53) {
  10475. return 11;
  10476. } else if (statusInt <= 52 && statusInt >= 49) {
  10477. return 12;
  10478. } else if (statusInt <= 48 && statusInt >= 45) {
  10479. return 13;
  10480. } else if (statusInt <= 44 && statusInt >= 41) {
  10481. return 14;
  10482. } else if (statusInt <= 40 && statusInt >= 37) {
  10483. return 15;
  10484. } else if (statusInt <= 36 && statusInt >= 33) {
  10485. return 16;
  10486. } else if (statusInt <= 32 && statusInt >= 29) {
  10487. return 17;
  10488. } else if (statusInt <= 28 && statusInt >= 25) {
  10489. return 18;
  10490. } else if (statusInt <= 24 && statusInt >= 21) {
  10491. return 19;
  10492. } else if (statusInt <= 20 && statusInt >= 17) {
  10493. return 20;
  10494. } else if (statusInt <= 16 && statusInt >= 13) {
  10495. return 21;
  10496. } else if (statusInt <= 12 && statusInt >= 9) {
  10497. return 22;
  10498. } else if (statusInt <= 8 && statusInt >= 7) {
  10499. return 23;
  10500. } else if (statusInt <= 6 && statusInt >= 5) {
  10501. return 24;
  10502. } else if (statusInt <= 4 && statusInt >= 3) {
  10503. return 25;
  10504. } else if (statusInt <= 2 && statusInt >= 1) {
  10505. return 26;
  10506. } else if (statusInt <= 0) {
  10507. return 27;
  10508. }
  10509. return 0;
  10510. }
  10511.  
  10512. private void drawMinimap() {
  10513. aRSImageProducer_1164.initDrawingArea();
  10514. if (anInt1021 == 2) {
  10515. compass.method352(33, minimapInt1, anIntArray1057, 256,
  10516. anIntArray968, 25, 8, 8, 33, 25);
  10517. aRSImageProducer_1165.initDrawingArea();
  10518. return;
  10519. }
  10520. int i = minimapInt1 + minimapInt2 & 0x7ff;
  10521. int j = 48 + myPlayer.x / 32;
  10522. int l2 = 464 - myPlayer.y / 32;
  10523. for (int x = 0; x < anIntArray1229.length; x++) {
  10524. anIntArray1229[x] = 170;
  10525. anIntArray1052[x] = -23;
  10526. }
  10527.  
  10528. // Map position
  10529. aClass30_Sub2_Sub1_Sub1_1263.method352(152, i, anIntArray1229,
  10530. 256 + minimapInt3, anIntArray1052, l2, 9, 50, 146, j);
  10531. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968,
  10532. 25, 4, 26, 33, 25);
  10533. for (int j5 = 0; j5 < anInt1071; j5++) {
  10534. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10535. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10536. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10537. }
  10538.  
  10539. for (int k5 = 0; k5 < 104; k5++) {
  10540. for (int l5 = 0; l5 < 104; l5++) {
  10541. NodeList class19 = groundArray[plane][k5][l5];
  10542. if (class19 != null) {
  10543. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10544. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10545. markMinimap(mapDotItem, l, j3);
  10546. }
  10547. }
  10548. }
  10549.  
  10550. for (int i6 = 0; i6 < npcCount; i6++) {
  10551. NPC npc = npcArray[npcIndices[i6]];
  10552. if (npc != null && npc.isVisible()) {
  10553. EntityDef entityDef = npc.desc;
  10554. if (entityDef.childrenIDs != null)
  10555. entityDef = entityDef.method161();
  10556. if (entityDef != null && entityDef.aBoolean87
  10557. && entityDef.aBoolean84) {
  10558. int i1 = npc.x / 32 - myPlayer.x / 32;
  10559. int k3 = npc.y / 32 - myPlayer.y / 32;
  10560. markMinimap(mapDotNPC, i1, k3);
  10561. }
  10562. }
  10563. }
  10564.  
  10565. for (int j6 = 0; j6 < playerCount; j6++) {
  10566. Player player = playerArray[playerIndices[j6]];
  10567. if (player != null && player.isVisible()) {
  10568. int j1 = player.x / 32 - myPlayer.x / 32;
  10569. int l3 = player.y / 32 - myPlayer.y / 32;
  10570. boolean flag1 = false;
  10571. long l6 = TextClass.longForName(player.name);
  10572. for (int k6 = 0; k6 < friendsCount; k6++) {
  10573. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10574. continue;
  10575. flag1 = true;
  10576. break;
  10577. }
  10578. boolean flag2 = false;
  10579. if (myPlayer.team != 0 && player.team != 0
  10580. && myPlayer.team == player.team)
  10581. flag2 = true;
  10582. if (flag1)
  10583. markMinimap(mapDotFriend, j1, l3);
  10584. else
  10585. markMinimap(mapDotPlayer, j1, l3);
  10586. }
  10587. }
  10588.  
  10589. if (anInt855 != 0 && loopCycle % 20 < 10) {
  10590. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10591. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10592. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  10593. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x
  10594. / 32;
  10595. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y
  10596. / 32;
  10597. method81(mapMarker, i4, k1);
  10598. }
  10599. }
  10600. if (anInt855 == 2) {
  10601. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10602. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10603. method81(mapMarker, j4, l1);
  10604. }
  10605. if (anInt855 == 10 && anInt933 >= 0
  10606. && anInt933 < playerArray.length) {
  10607. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10608. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  10609. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x
  10610. / 32;
  10611. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y
  10612. / 32;
  10613. method81(mapMarker, k4, i2);
  10614. }
  10615. }
  10616. }
  10617. if (destX != 0) {
  10618. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10619. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10620. markMinimap(mapFlag, j2, l4);
  10621. }
  10622. DrawingArea.drawPixels(3, 78 + 5, 97 + 20, 0xffffff, 3);
  10623. mapArea.drawSprite(0, 0);
  10624.  
  10625. drawLogoutButton();
  10626. drawHPOrb();
  10627. drawXpOrb();
  10628. drawPrayerOrb();
  10629. drawRunOrb();
  10630.  
  10631. if (menuOpen && menuScreenArea == 3) {
  10632. drawMenu();
  10633. }
  10634. aRSImageProducer_1165.initDrawingArea();
  10635. }
  10636.  
  10637. void drawXpOrb() {
  10638. int x;
  10639. int y;
  10640. int x1 = mouseX;
  10641. int y1 = mouseY;
  10642. x = 1;
  10643. y = 26;
  10644. ORBS[((inCircle(516, 22, x1, y1, 14) ? 31 : 30))].drawSprite(x, y);
  10645. }
  10646.  
  10647. public void drawLogoutButton() {
  10648. if (tabInterfaceIDs[9] != -1 && anInt1054 == 9)
  10649. if (loopCycle % 20 >= 10)
  10650. ;
  10651. logIconH.drawSprite(223, 1);
  10652. if (logIconHPos == 1) {
  10653. logIconH.drawSprite(223, 1);
  10654. if (tabID == 10)
  10655. logIconC.drawSprite(223, 1);
  10656. }
  10657. }
  10658.  
  10659. private void npcScreenPos(Entity entity, int i) {
  10660. calcEntityScreenPos(entity.x, i, entity.y);
  10661. }
  10662.  
  10663. private void calcEntityScreenPos(int i, int j, int l) {
  10664. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  10665. spriteDrawX = -1;
  10666. spriteDrawY = -1;
  10667. return;
  10668. }
  10669. int i1 = method42(plane, l, i) - j;
  10670. i -= xCameraPos;
  10671. i1 -= zCameraPos;
  10672. l -= yCameraPos;
  10673. int j1 = Model.modelIntArray1[yCameraCurve];
  10674. int k1 = Model.modelIntArray2[yCameraCurve];
  10675. int l1 = Model.modelIntArray1[xCameraCurve];
  10676. int i2 = Model.modelIntArray2[xCameraCurve];
  10677. int j2 = l * l1 + i * i2 >> 16;
  10678. l = l * i2 - i * l1 >> 16;
  10679. i = j2;
  10680. j2 = i1 * k1 - l * j1 >> 16;
  10681. l = i1 * j1 + l * k1 >> 16;
  10682. i1 = j2;
  10683. if (l >= 50) {
  10684. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  10685. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  10686. } else {
  10687. spriteDrawX = -1;
  10688. spriteDrawY = -1;
  10689. }
  10690. }
  10691.  
  10692. private void buildSplitPrivateChatMenu() {
  10693. if (splitPrivateChat == 0)
  10694. return;
  10695. int i = 0;
  10696. if (anInt1104 != 0)
  10697. i = 1;
  10698. for (int j = 0; j < 100; j++)
  10699. if (chatMessages[j] != null) {
  10700. int k = chatTypes[j];
  10701. String s = chatNames[j];
  10702. boolean flag1 = false;
  10703. if (s != null && s.startsWith("@cr1@")) {
  10704. s = s.substring(5);
  10705. }
  10706. if (s != null && s.startsWith("@cr2@")) {
  10707. s = s.substring(5);
  10708. }
  10709. if (s != null && s.startsWith("@cr3@")) {
  10710. s = s.substring(5);
  10711. }
  10712. if (s != null && s.startsWith("@cr4@")) {
  10713. s = s.substring(5);
  10714. }
  10715. if (s != null && s.startsWith("@cr5@")) {
  10716. s = s.substring(5);
  10717. }
  10718. if (s != null && s.startsWith("@cr6@")) {
  10719. s = s.substring(5);
  10720. }
  10721. if (s != null && s.startsWith("@cr7@")) {
  10722. s = s.substring(5);
  10723. }
  10724. if (s != null && s.startsWith("@cr8@")) {
  10725. s = s.substring(5);
  10726. }
  10727. if (s != null && s.startsWith("@cr9@")) {
  10728. s = s.substring(5);
  10729. }
  10730. if (s != null && s.startsWith("@cr10@")) {
  10731. s = s.substring(6);
  10732. }
  10733. if ((k == 3 || k == 7)
  10734. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  10735. && isFriendOrSelf(s))) {
  10736. int l = 329 - i * 13;
  10737. if (super.mouseX > 4 && super.mouseY - 4 > l - 10
  10738. && super.mouseY - 4 <= l + 3) {
  10739. int i1 = aTextDrawingArea_1271.getTextWidth("From: "
  10740. + s + chatMessages[j]) + 25;
  10741. if (i1 > 450)
  10742. i1 = 450;
  10743. if (super.mouseX < 4 + i1) {
  10744. if (myPrivilege >= 1) {
  10745. menuActionName[menuActionRow] = "Report abuse @whi@"
  10746. + s;
  10747. menuActionID[menuActionRow] = 2606;
  10748. menuActionRow++;
  10749. }
  10750. menuActionName[menuActionRow] = "Add ignore @whi@"
  10751. + s;
  10752. menuActionID[menuActionRow] = 2042;
  10753. menuActionRow++;
  10754. menuActionName[menuActionRow] = "Add friend @whi@"
  10755. + s;
  10756. menuActionID[menuActionRow] = 2337;
  10757. menuActionRow++;
  10758. }
  10759. }
  10760. if (++i >= 5)
  10761. return;
  10762. }
  10763. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10764. return;
  10765. }
  10766.  
  10767. }
  10768.  
  10769. public void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  10770. int i2, int j2) {
  10771. Class30_Sub1 class30_sub1 = null;
  10772. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  10773. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  10774. .reverseGetNext()) {
  10775. if (class30_sub1_1.anInt1295 != l1
  10776. || class30_sub1_1.anInt1297 != i2
  10777. || class30_sub1_1.anInt1298 != j1
  10778. || class30_sub1_1.anInt1296 != i1)
  10779. continue;
  10780. class30_sub1 = class30_sub1_1;
  10781. break;
  10782. }
  10783.  
  10784. if (class30_sub1 == null) {
  10785. class30_sub1 = new Class30_Sub1();
  10786. class30_sub1.anInt1295 = l1;
  10787. class30_sub1.anInt1296 = i1;
  10788. class30_sub1.anInt1297 = i2;
  10789. class30_sub1.anInt1298 = j1;
  10790. method89(class30_sub1);
  10791. aClass19_1179.insertHead(class30_sub1);
  10792. }
  10793. class30_sub1.anInt1291 = k;
  10794. class30_sub1.anInt1293 = k1;
  10795. class30_sub1.anInt1292 = l;
  10796. class30_sub1.anInt1302 = j2;
  10797. class30_sub1.anInt1294 = j;
  10798. }
  10799.  
  10800. private boolean interfaceIsSelected(RSInterface class9) {
  10801. if (class9.anIntArray245 == null)
  10802. return false;
  10803. for (int i = 0; i < class9.anIntArray245.length; i++) {
  10804. int j = extractInterfaceValues(class9, i);
  10805. int k = class9.anIntArray212[i];
  10806. if (class9.anIntArray245[i] == 2) {
  10807. if (j >= k)
  10808. return false;
  10809. } else if (class9.anIntArray245[i] == 3) {
  10810. if (j <= k)
  10811. return false;
  10812. } else if (class9.anIntArray245[i] == 4) {
  10813. if (j == k)
  10814. return false;
  10815. } else if (j != k)
  10816. return false;
  10817. }
  10818.  
  10819. return true;
  10820. }
  10821.  
  10822. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  10823. // if(!aBoolean872)
  10824. // if(signlink.mainapp != null)
  10825. // return signlink.openurl(s);
  10826. // else
  10827. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10828. if (aSocket832 != null) {
  10829. try {
  10830. aSocket832.close();
  10831. } catch (Exception _ex) {
  10832. }
  10833. aSocket832 = null;
  10834. }
  10835. aSocket832 = openSocket(43595);
  10836. aSocket832.setSoTimeout(10000);
  10837. java.io.InputStream inputstream = aSocket832.getInputStream();
  10838. OutputStream outputstream = aSocket832.getOutputStream();
  10839. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10840. return new DataInputStream(inputstream);
  10841. }
  10842.  
  10843. private void doFlamesDrawing() {
  10844. char c = '\u0100';
  10845. if (anInt1040 > 0) {
  10846. for (int i = 0; i < 256; i++)
  10847. if (anInt1040 > 768)
  10848. anIntArray850[i] = method83(anIntArray851[i],
  10849. anIntArray852[i], 1024 - anInt1040);
  10850. else if (anInt1040 > 256)
  10851. anIntArray850[i] = anIntArray852[i];
  10852. else
  10853. anIntArray850[i] = method83(anIntArray852[i],
  10854. anIntArray851[i], 256 - anInt1040);
  10855.  
  10856. } else if (anInt1041 > 0) {
  10857. for (int j = 0; j < 256; j++)
  10858. if (anInt1041 > 768)
  10859. anIntArray850[j] = method83(anIntArray851[j],
  10860. anIntArray853[j], 1024 - anInt1041);
  10861. else if (anInt1041 > 256)
  10862. anIntArray850[j] = anIntArray853[j];
  10863. else
  10864. anIntArray850[j] = method83(anIntArray853[j],
  10865. anIntArray851[j], 256 - anInt1041);
  10866.  
  10867. } else {
  10868. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  10869.  
  10870. }
  10871. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  10872. aRSImageProducer_1110.anIntArray315, 0, 33920);
  10873.  
  10874. int i1 = 0;
  10875. int j1 = 1152;
  10876. for (int k1 = 1; k1 < c - 1; k1++) {
  10877. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  10878. int j2 = 22 + l1;
  10879. if (j2 < 0)
  10880. j2 = 0;
  10881. i1 += j2;
  10882. for (int l2 = j2; l2 < 128; l2++) {
  10883. int j3 = anIntArray828[i1++];
  10884. if (j3 != 0) {
  10885. int l3 = j3;
  10886. int j4 = 256 - j3;
  10887. j3 = anIntArray850[j3];
  10888. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  10889. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  10890. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  10891. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  10892. } else {
  10893. j1++;
  10894. }
  10895. }
  10896.  
  10897. j1 += j2;
  10898. }
  10899.  
  10900. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  10901. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  10902. aRSImageProducer_1111.anIntArray315, 0, 33920);
  10903.  
  10904. i1 = 0;
  10905. j1 = 1176;
  10906. for (int k2 = 1; k2 < c - 1; k2++) {
  10907. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10908. int k3 = 103 - i3;
  10909. j1 += i3;
  10910. for (int i4 = 0; i4 < k3; i4++) {
  10911. int k4 = anIntArray828[i1++];
  10912. if (k4 != 0) {
  10913. int i5 = k4;
  10914. int j5 = 256 - k4;
  10915. k4 = anIntArray850[k4];
  10916. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10917. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  10918. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  10919. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10920. } else {
  10921. j1++;
  10922. }
  10923. }
  10924.  
  10925. i1 += 128 - k3;
  10926. j1 += 128 - k3 - i3;
  10927. }
  10928.  
  10929. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10930. }
  10931.  
  10932. private void method134(Stream stream) {
  10933. int j = stream.readBits(8);
  10934. if (j < playerCount) {
  10935. for (int k = j; k < playerCount; k++)
  10936. anIntArray840[anInt839++] = playerIndices[k];
  10937.  
  10938. }
  10939. if (j > playerCount) {
  10940. signlink.reporterror(myUsername + " Too many players");
  10941. throw new RuntimeException("eek");
  10942. }
  10943. playerCount = 0;
  10944. for (int l = 0; l < j; l++) {
  10945. int i1 = playerIndices[l];
  10946. Player player = playerArray[i1];
  10947. int j1 = stream.readBits(1);
  10948. if (j1 == 0) {
  10949. playerIndices[playerCount++] = i1;
  10950. player.anInt1537 = loopCycle;
  10951. } else {
  10952. int k1 = stream.readBits(2);
  10953. if (k1 == 0) {
  10954. playerIndices[playerCount++] = i1;
  10955. player.anInt1537 = loopCycle;
  10956. anIntArray894[anInt893++] = i1;
  10957. } else if (k1 == 1) {
  10958. playerIndices[playerCount++] = i1;
  10959. player.anInt1537 = loopCycle;
  10960. int l1 = stream.readBits(3);
  10961. player.moveInDir(false, l1);
  10962. int j2 = stream.readBits(1);
  10963. if (j2 == 1)
  10964. anIntArray894[anInt893++] = i1;
  10965. } else if (k1 == 2) {
  10966. playerIndices[playerCount++] = i1;
  10967. player.anInt1537 = loopCycle;
  10968. int i2 = stream.readBits(3);
  10969. player.moveInDir(true, i2);
  10970. int k2 = stream.readBits(3);
  10971. player.moveInDir(true, k2);
  10972. int l2 = stream.readBits(1);
  10973. if (l2 == 1)
  10974. anIntArray894[anInt893++] = i1;
  10975. } else if (k1 == 3)
  10976. anIntArray840[anInt839++] = i1;
  10977. }
  10978. }
  10979. }
  10980.  
  10981. private void drawLoginScreen(boolean flag) {
  10982. try {
  10983. resetImageProducers();
  10984. background.drawSprite(0, 0);
  10985. aRSImageProducer_1109.initDrawingArea();
  10986. loginBox.drawAdvancedSprite(-128, -135);
  10987. loginbar.drawAdvancedSprite(35, 245);
  10988. loginbar2.drawAdvancedSprite(35, 275);
  10989. loginButton.drawAdvancedSprite(239, 320);
  10990. registerButton.drawAdvancedSprite(304, 317);
  10991. forumButton.drawAdvancedSprite(57, -8);
  10992. voteButton.drawAdvancedSprite(203, -8);
  10993. storeButton.drawAdvancedSprite(334, -8);
  10994. itemlistButton.drawAdvancedSprite(464, -8);
  10995. logo.drawAdvancedSprite(-197, -112);
  10996. if (super.mouseX >= 265 && super.mouseX <= 477
  10997. && super.mouseY >= 282 && super.mouseY <= 303) {
  10998. loginbarHover.drawAdvancedSprite(35, 245);
  10999. }
  11000. if (super.mouseX >= 265 && super.mouseX <= 477
  11001. && super.mouseY >= 313 && super.mouseY <= 333) {
  11002. loginbar2Hover.drawAdvancedSprite(35, 275);
  11003. }
  11004. if (super.mouseX >= 304 && super.mouseX <= 368
  11005. && super.mouseY >= 342 && super.mouseY <= 360) {
  11006. loginButtonHover.drawAdvancedSprite(236, 317);
  11007. }
  11008. if (super.mouseX >= 373 && super.mouseX <= 436
  11009. && super.mouseY >= 342 && super.mouseY <= 360) {
  11010. registerButtonHover.drawAdvancedSprite(304, 317);
  11011. }
  11012. if (super.mouseX >= 195 && super.mouseX <= 325
  11013. && super.mouseY >= 39 && super.mouseY <= 85) {
  11014. forumButtonHover.drawAdvancedSprite(57, -8);
  11015. }
  11016. if (super.mouseX >= 357 && super.mouseX <= 447
  11017. && super.mouseY >= 39 && super.mouseY <= 85) {
  11018. voteButtonHover.drawAdvancedSprite(203, -8);
  11019. }
  11020. if (super.mouseX >= 480 && super.mouseX <= 579
  11021. && super.mouseY >= 39 && super.mouseY <= 85) {
  11022. storeButtonHover.drawAdvancedSprite(334, -8);
  11023. }
  11024. if (super.mouseX >= 602 && super.mouseX <= 727
  11025. && super.mouseY >= 39 && super.mouseY <= 85) {
  11026. itemlistButtonHover.drawAdvancedSprite(464, -8);
  11027. }
  11028. char c = '\u0168';
  11029. if (loginScreenState == 0) {
  11030. int i = 100;
  11031. aTextDrawingArea_1271.method382(0x75a9a9, c / 190,
  11032. onDemandFetcher.statusString, i, true);
  11033. int l = 275;
  11034. int k1 = 300;
  11035. // where shit goes
  11036. this.smallText.method389(false, 289, 16777215,
  11037. "Enter your username and password.", 420);
  11038. this.smallText.method382(16777215, 370, this.loginMessage1,
  11039. 264, true);
  11040. this.smallText.method382(16777215, 370, this.loginMessage2,
  11041. 274, true);
  11042. this.aTextDrawingArea_1271
  11043. .method389(
  11044. false,
  11045. 289,
  11046. 16777215,
  11047. new StringBuilder()
  11048. .append("")
  11049. .append(capitalize(myUsername))
  11050. .append(((this.loginScreenCursorPos == 0 ? 1
  11051. : 0) & (loopCycle % 40 < 20 ? 1
  11052. : 0)) != 0 ? "|" : "")
  11053. .toString(), 299);
  11054. this.aTextDrawingArea_1271
  11055. .method389(
  11056. true,
  11057. 289,
  11058. 16777215,
  11059. new StringBuilder()
  11060. .append("")
  11061. .append(TextClass
  11062. .passwordAsterisks(myPassword))
  11063. .append(((this.loginScreenCursorPos == 1 ? 1
  11064. : 0) & (loopCycle % 40 < 20 ? 1
  11065. : 0)) != 0 ? "|" : "")
  11066. .toString(), 329);
  11067. if ((this.mouseX >= 293) && (this.mouseX <= 474)
  11068. && (this.mouseY >= 302) && (this.mouseY <= 327)) {
  11069. // this.loginHover.drawSprite(296, 301);
  11070. // int j = 277;
  11071. }
  11072. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  11073. if (welcomeScreenRaised) {
  11074. }
  11075. }
  11076. } catch (Exception e) {
  11077.  
  11078. }
  11079. }
  11080.  
  11081. private void drawFlames() {
  11082. }
  11083.  
  11084. public void raiseWelcomeScreen() {
  11085. welcomeScreenRaised = true;
  11086. }
  11087.  
  11088. private void method137(Stream stream, int j) {
  11089. if (j == 84) {
  11090. int k = stream.readUnsignedByte();
  11091. int j3 = anInt1268 + (k >> 4 & 7);
  11092. int i6 = anInt1269 + (k & 7);
  11093. int l8 = stream.readUnsignedWord();
  11094. int k11 = stream.readUnsignedWord();
  11095. int l13 = stream.readUnsignedWord();
  11096. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  11097. NodeList class19_1 = groundArray[plane][j3][i6];
  11098. if (class19_1 != null) {
  11099. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  11100. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  11101. .reverseGetNext()) {
  11102. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  11103. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11104. continue;
  11105. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11106. break;
  11107. }
  11108.  
  11109. spawnGroundItem(j3, i6);
  11110. }
  11111. }
  11112. return;
  11113. }
  11114. if (j == 105) {
  11115. int l = stream.readUnsignedByte();
  11116. int k3 = anInt1268 + (l >> 4 & 7);
  11117. int j6 = anInt1269 + (l & 7);
  11118. int i9 = stream.readUnsignedWord();
  11119. int l11 = stream.readUnsignedByte();
  11120. int i14 = l11 >> 4 & 0xf;
  11121. int i16 = l11 & 7;
  11122. if (myPlayer.smallX[0] >= k3 - i14
  11123. && myPlayer.smallX[0] <= k3 + i14
  11124. && myPlayer.smallY[0] >= j6 - i14
  11125. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  11126. && anInt1062 < 50) {
  11127. anIntArray1207[anInt1062] = i9;
  11128. anIntArray1241[anInt1062] = i16;
  11129. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11130. anInt1062++;
  11131. }
  11132. }
  11133. if (j == 215) {
  11134. int i1 = stream.method435();
  11135. int l3 = stream.method428();
  11136. int k6 = anInt1268 + (l3 >> 4 & 7);
  11137. int j9 = anInt1269 + (l3 & 7);
  11138. int i12 = stream.method435();
  11139. int j14 = stream.readUnsignedWord();
  11140. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  11141. && i12 != unknownInt10) {
  11142. Item class30_sub2_sub4_sub2_2 = new Item();
  11143. class30_sub2_sub4_sub2_2.ID = i1;
  11144. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11145. if (groundArray[plane][k6][j9] == null)
  11146. groundArray[plane][k6][j9] = new NodeList();
  11147. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11148. spawnGroundItem(k6, j9);
  11149. }
  11150. return;
  11151. }
  11152. if (j == 156) {
  11153. int j1 = stream.method426();
  11154. int i4 = anInt1268 + (j1 >> 4 & 7);
  11155. int l6 = anInt1269 + (j1 & 7);
  11156. int k9 = stream.readUnsignedWord();
  11157. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  11158. NodeList class19 = groundArray[plane][i4][l6];
  11159. if (class19 != null) {
  11160. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  11161. .reverseGetNext()) {
  11162. if (item.ID != (k9 & 0x7fff))
  11163. continue;
  11164. item.unlink();
  11165. break;
  11166. }
  11167.  
  11168. if (class19.reverseGetFirst() == null)
  11169. groundArray[plane][i4][l6] = null;
  11170. spawnGroundItem(i4, l6);
  11171. }
  11172. }
  11173. return;
  11174. }
  11175. if (j == 160) {
  11176. int k1 = stream.method428();
  11177. int j4 = anInt1268 + (k1 >> 4 & 7);
  11178. int i7 = anInt1269 + (k1 & 7);
  11179. int l9 = stream.method428();
  11180. int j12 = l9 >> 2;
  11181. int k14 = l9 & 3;
  11182. int j16 = anIntArray1177[j12];
  11183. int j17 = stream.method435();
  11184. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  11185. int j18 = intGroundArray[plane][j4][i7];
  11186. int i19 = intGroundArray[plane][j4 + 1][i7];
  11187. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11188. int k20 = intGroundArray[plane][j4][i7 + 1];
  11189. if (j16 == 0) {
  11190. Object1 class10 = worldController.method296(plane, j4, i7);
  11191. if (class10 != null) {
  11192. int k21 = class10.uid >> 14 & 0x7fff;
  11193. if (j12 == 2) {
  11194. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11195. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  11196. false);
  11197. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  11198. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  11199. j17, false);
  11200. } else {
  11201. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11202. k21, k14, j12, i19, l19, j18, k20, j17,
  11203. false);
  11204. }
  11205. }
  11206. }
  11207. if (j16 == 1) {
  11208. Object2 class26 = worldController.method297(j4, i7, plane);
  11209. if (class26 != null)
  11210. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  11211. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  11212. j18, k20, j17, false);
  11213. }
  11214. if (j16 == 2) {
  11215. Object5 class28 = worldController.method298(j4, i7, plane);
  11216. if (j12 == 11)
  11217. j12 = 10;
  11218. if (class28 != null)
  11219. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  11220. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  11221. j18, k20, j17, false);
  11222. }
  11223. if (j16 == 3) {
  11224. Object3 class49 = worldController.method299(i7, j4, plane);
  11225. if (class49 != null)
  11226. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  11227. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  11228. j18, k20, j17, false);
  11229. }
  11230. }
  11231. return;
  11232. }
  11233. if (j == 147) {
  11234. int l1 = stream.method428();
  11235. int k4 = anInt1268 + (l1 >> 4 & 7);
  11236. int j7 = anInt1269 + (l1 & 7);
  11237. int i10 = stream.readUnsignedWord();
  11238. byte byte0 = stream.method430();
  11239. int l14 = stream.method434();
  11240. byte byte1 = stream.method429();
  11241. int k17 = stream.readUnsignedWord();
  11242. int k18 = stream.method428();
  11243. int j19 = k18 >> 2;
  11244. int i20 = k18 & 3;
  11245. int l20 = anIntArray1177[j19];
  11246. byte byte2 = stream.readSignedByte();
  11247. int l21 = stream.readUnsignedWord();
  11248. byte byte3 = stream.method429();
  11249. Player player;
  11250. if (i10 == unknownInt10)
  11251. player = myPlayer;
  11252. else
  11253. player = playerArray[i10];
  11254. if (player != null) {
  11255. ObjectDef class46 = ObjectDef.forID(l21);
  11256. int i22 = intGroundArray[plane][k4][j7];
  11257. int j22 = intGroundArray[plane][k4 + 1][j7];
  11258. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11259. int l22 = intGroundArray[plane][k4][j7 + 1];
  11260. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  11261. -1);
  11262. if (model != null) {
  11263. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11264. player.anInt1707 = l14 + loopCycle;
  11265. player.anInt1708 = k17 + loopCycle;
  11266. player.aModel_1714 = model;
  11267. int i23 = class46.anInt744;
  11268. int j23 = class46.anInt761;
  11269. if (i20 == 1 || i20 == 3) {
  11270. i23 = class46.anInt761;
  11271. j23 = class46.anInt744;
  11272. }
  11273. player.anInt1711 = k4 * 128 + i23 * 64;
  11274. player.anInt1713 = j7 * 128 + j23 * 64;
  11275. player.anInt1712 = method42(plane, player.anInt1713,
  11276. player.anInt1711);
  11277. if (byte2 > byte0) {
  11278. byte byte4 = byte2;
  11279. byte2 = byte0;
  11280. byte0 = byte4;
  11281. }
  11282. if (byte3 > byte1) {
  11283. byte byte5 = byte3;
  11284. byte3 = byte1;
  11285. byte1 = byte5;
  11286. }
  11287. player.anInt1719 = k4 + byte2;
  11288. player.anInt1721 = k4 + byte0;
  11289. player.anInt1720 = j7 + byte3;
  11290. player.anInt1722 = j7 + byte1;
  11291. }
  11292. }
  11293. }
  11294. if (j == 151) {
  11295. int i2 = stream.method426();
  11296. int l4 = anInt1268 + (i2 >> 4 & 7);
  11297. int k7 = anInt1269 + (i2 & 7);
  11298. int j10 = stream.method434();
  11299. int k12 = stream.method428();
  11300. int i15 = k12 >> 2;
  11301. int k16 = k12 & 3;
  11302. int l17 = anIntArray1177[i15];
  11303. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11304. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11305. return;
  11306. }
  11307. if (j == 4) {
  11308. int j2 = stream.readUnsignedByte();
  11309. int i5 = anInt1268 + (j2 >> 4 & 7);
  11310. int l7 = anInt1269 + (j2 & 7);
  11311. int k10 = stream.readUnsignedWord();
  11312. int l12 = stream.readUnsignedByte();
  11313. int j15 = stream.readUnsignedWord();
  11314. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  11315. i5 = i5 * 128 + 64;
  11316. l7 = l7 * 128 + 64;
  11317. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  11318. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  11319. i5);
  11320. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11321. }
  11322. return;
  11323. }
  11324. if (j == 44) {
  11325. int k2 = stream.method436();
  11326. int j5 = stream.readUnsignedWord();
  11327. int i8 = stream.readUnsignedByte();
  11328. int l10 = anInt1268 + (i8 >> 4 & 7);
  11329. int i13 = anInt1269 + (i8 & 7);
  11330. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  11331. Item class30_sub2_sub4_sub2_1 = new Item();
  11332. class30_sub2_sub4_sub2_1.ID = k2;
  11333. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11334. if (groundArray[plane][l10][i13] == null)
  11335. groundArray[plane][l10][i13] = new NodeList();
  11336. groundArray[plane][l10][i13]
  11337. .insertHead(class30_sub2_sub4_sub2_1);
  11338. spawnGroundItem(l10, i13);
  11339. }
  11340. return;
  11341. }
  11342. if (j == 101) {
  11343. int l2 = stream.method427();
  11344. int k5 = l2 >> 2;
  11345. int j8 = l2 & 3;
  11346. int i11 = anIntArray1177[k5];
  11347. int j13 = stream.readUnsignedByte();
  11348. int k15 = anInt1268 + (j13 >> 4 & 7);
  11349. int l16 = anInt1269 + (j13 & 7);
  11350. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11351. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11352. return;
  11353. }
  11354. if (j == 117) {
  11355. int i3 = stream.readUnsignedByte();
  11356. int l5 = anInt1268 + (i3 >> 4 & 7);
  11357. int k8 = anInt1269 + (i3 & 7);
  11358. int j11 = l5 + stream.readSignedByte();
  11359. int k13 = k8 + stream.readSignedByte();
  11360. int l15 = stream.readSignedWord();
  11361. int i17 = stream.readUnsignedWord();
  11362. int i18 = stream.readUnsignedByte() * 4;
  11363. int l18 = stream.readUnsignedByte() * 4;
  11364. int k19 = stream.readUnsignedWord();
  11365. int j20 = stream.readUnsignedWord();
  11366. int i21 = stream.readUnsignedByte();
  11367. int j21 = stream.readUnsignedByte();
  11368. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  11369. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  11370. l5 = l5 * 128 + 64;
  11371. k8 = k8 * 128 + 64;
  11372. j11 = j11 * 128 + 64;
  11373. k13 = k13 * 128 + 64;
  11374. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  11375. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  11376. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  11377. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  11378. method42(plane, k13, j11) - l18, j11);
  11379. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11380. }
  11381. }
  11382. }
  11383.  
  11384. private static void setLowMem() {
  11385. WorldController.lowMem = true;
  11386. Texture.lowMem = true;
  11387. lowMem = true;
  11388. ObjectManager.lowMem = true;
  11389. ObjectDef.lowMem = true;
  11390. }
  11391.  
  11392. private void method139(Stream stream) {
  11393. stream.initBitAccess();
  11394. int k = stream.readBits(8);
  11395. if (k < npcCount) {
  11396. for (int l = k; l < npcCount; l++)
  11397. anIntArray840[anInt839++] = npcIndices[l];
  11398.  
  11399. }
  11400. if (k > npcCount) {
  11401. signlink.reporterror(myUsername + " Too many npcs");
  11402. throw new RuntimeException("eek");
  11403. }
  11404. npcCount = 0;
  11405. for (int i1 = 0; i1 < k; i1++) {
  11406. int j1 = npcIndices[i1];
  11407. NPC npc = npcArray[j1];
  11408. int k1 = stream.readBits(1);
  11409. if (k1 == 0) {
  11410. npcIndices[npcCount++] = j1;
  11411. npc.anInt1537 = loopCycle;
  11412. } else {
  11413. int l1 = stream.readBits(2);
  11414. if (l1 == 0) {
  11415. npcIndices[npcCount++] = j1;
  11416. npc.anInt1537 = loopCycle;
  11417. anIntArray894[anInt893++] = j1;
  11418. } else if (l1 == 1) {
  11419. npcIndices[npcCount++] = j1;
  11420. npc.anInt1537 = loopCycle;
  11421. int i2 = stream.readBits(3);
  11422. npc.moveInDir(false, i2);
  11423. int k2 = stream.readBits(1);
  11424. if (k2 == 1)
  11425. anIntArray894[anInt893++] = j1;
  11426. } else if (l1 == 2) {
  11427. npcIndices[npcCount++] = j1;
  11428. npc.anInt1537 = loopCycle;
  11429. int j2 = stream.readBits(3);
  11430. npc.moveInDir(true, j2);
  11431. int l2 = stream.readBits(3);
  11432. npc.moveInDir(true, l2);
  11433. int i3 = stream.readBits(1);
  11434. if (i3 == 1)
  11435. anIntArray894[anInt893++] = j1;
  11436. } else if (l1 == 3)
  11437. anIntArray840[anInt839++] = j1;
  11438. }
  11439. }
  11440.  
  11441. }
  11442.  
  11443. private void processLoginScreenInput() {
  11444. if (this.loginScreenState == 0) {
  11445. int l = super.myHeight / 2 + 20;
  11446. l += 20;
  11447. int i = this.myHeight / 2 - 40;
  11448. i += 30;
  11449. i += 25;
  11450.  
  11451. resetImageProducers();
  11452.  
  11453. if (super.clickMode3 == 1 && (super.mouseX >= 373 && super.mouseX <= 436 && super.mouseY >= 342 && super.mouseY <= 360)) {
  11454. this.loginScreenCursorPos = 0;
  11455. this.loginMessage1 = "Enter your desired username and password.";
  11456. this.loginMessage2 = "The Forums will now open in your browser.";
  11457. //launchURL("http://foxtrot-pk.com/forum/"); //Register Link
  11458. }
  11459. //if (super.clickMode3 == 1 && (super.mouseX >= 356) && (super.mouseX <= 386) && (super.mouseY >= 348) && (super.mouseY <= 379)) {
  11460. //launchURL("https://www.youtube.com/channel/UCaDS6TG3gh2FEphFU8pfXEw");
  11461. //}
  11462. if (super.clickMode3 == 1 && super.mouseX >= 195 && super.mouseX <= 325 && super.mouseY >= 39 && super.mouseY <= 85) {
  11463. //launchURL("http://foxtrot-pk.com/forum/"); //Forums link
  11464. }
  11465. if (super.clickMode3 == 1 && super.mouseX >= 357 && super.mouseX <= 447 && super.mouseY >= 39 && super.mouseY <= 85) {
  11466. //launchURL("http://foxtrot-pk.com/forum/vote/"); //Vote Link
  11467. }
  11468. if (super.clickMode3 == 1 && super.mouseX >= 480 && super.mouseX <= 579 && super.mouseY >= 39 && super.mouseY <= 85) {
  11469. //launchURL("http://foxtrot-pk.com/forum/store/"); //Store Link
  11470. }
  11471. if (super.clickMode3 == 1 && super.mouseX >= 602 && super.mouseX <= 727 && super.mouseY >= 39 && super.mouseY <= 85) {
  11472. //launchURL("http://foxtrot-pk.com/forum/itemlist/"); //Item List link
  11473. }
  11474. if (super.clickMode3 == 1 && super.mouseX >= 265 && super.mouseX <= 479 && super.mouseY >= 280 && super.mouseY <= 304) {
  11475. loginScreenCursorPos = 0;
  11476. }
  11477. if (super.clickMode3 == 1 && super.mouseX >= 265 && super.mouseX <= 479 && super.mouseY >= 310 && super.mouseY <= 334) {
  11478. loginScreenCursorPos = 1;
  11479. }
  11480.  
  11481. if (super.clickMode3 == 1 && super.mouseX >= 304 && super.mouseX <= 368 && super.mouseY >= 342 && super.mouseY <= 360) {
  11482. loginFailures = 0;
  11483.  
  11484. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  11485. login(myUsername, myPassword, false);
  11486. } else {
  11487. this.loginScreenCursorPos = 0;
  11488. this.loginMessage1 = "Username & Password";
  11489. this.loginMessage2 = "Must be more than 1 character";
  11490. }
  11491. if (this.loggedIn)
  11492. return;
  11493. }
  11494.  
  11495. do {
  11496. int l1 = readChar(-796);
  11497.  
  11498. if (l1 == -1)
  11499. break;
  11500.  
  11501. boolean flag1 = false;
  11502.  
  11503. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  11504. if (l1 != validUserPassChars.charAt(i2))
  11505. continue;
  11506. flag1 = true;
  11507. break;
  11508. }
  11509.  
  11510. if (loginScreenCursorPos == 0) {
  11511. if (l1 == 8 && myUsername.length() > 0)
  11512. myUsername = myUsername.substring(0, myUsername.length() - 1);
  11513. if (l1 == 9 || l1 == 10 || l1 == 13)
  11514. loginScreenCursorPos = 1;
  11515. if (flag1)
  11516. myUsername += (char) l1;
  11517. if (myUsername.length() > 12)
  11518. myUsername = myUsername.substring(0, 12);
  11519. } else if (loginScreenCursorPos == 1) {
  11520. if (l1 == 8 && myPassword.length() > 0)
  11521. myPassword = myPassword.substring(0, myPassword.length() - 1);
  11522. if (l1 == 9 || l1 == 10 || l1 == 13) {
  11523. if (l1 == 10) {
  11524. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  11525. login(myUsername, myPassword, false);
  11526. } else {
  11527. this.loginScreenCursorPos = 0;
  11528. this.loginMessage1 = "Username & Password";
  11529. this.loginMessage2 = "Must be more than 1 character";
  11530. }
  11531. return;
  11532. }
  11533. loginScreenCursorPos = 0;
  11534. }
  11535. if (flag1)
  11536. myPassword += (char) l1;
  11537. if (myPassword.length() > 20)
  11538. myPassword = myPassword.substring(0, 20);
  11539. }
  11540. } while (true);
  11541. return;
  11542. }
  11543.  
  11544. if (loginScreenState == 3) {
  11545. int k = super.myWidth / 2;
  11546. int j1 = super.myHeight / 2 + 50;
  11547. j1 += 20;
  11548. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  11549. && super.saveClickX <= k + 75
  11550. && super.saveClickY >= j1 - 20
  11551. && super.saveClickY <= j1 + 20)
  11552. loginScreenState = 0;
  11553. }
  11554. }
  11555.  
  11556. private void markMinimap(Sprite sprite, int i, int j) {
  11557. if (sprite == null) {
  11558. return;
  11559. }
  11560. int k = minimapInt1 + minimapInt2 & 0x7ff;
  11561. int l = i * i + j * j;
  11562. if (l > 6400)
  11563. return;
  11564. int i1 = Model.modelIntArray1[k];
  11565. int j1 = Model.modelIntArray2[k];
  11566. i1 = (i1 * 256) / (minimapInt3 + 256);
  11567. j1 = (j1 * 256) / (minimapInt3 + 256);
  11568. int k1 = j * i1 + i * j1 >> 16;
  11569. int l1 = j * j1 - i * i1 >> 16;
  11570. sprite.drawSprite(((121 + k1) - sprite.anInt1444 / 2) - 2, 89 - l1
  11571. - sprite.anInt1445 / 2 - 4);
  11572. }
  11573.  
  11574. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  11575. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  11576. if (lowMem && j != plane)
  11577. return;
  11578. int i2 = 0;
  11579. if (j1 == 0)
  11580. i2 = worldController.method300(j, i1, i);
  11581. if (j1 == 1)
  11582. i2 = worldController.method301(j, i1, i);
  11583. if (j1 == 2)
  11584. i2 = worldController.method302(j, i1, i);
  11585. if (j1 == 3)
  11586. i2 = worldController.method303(j, i1, i);
  11587. if (i2 != 0) {
  11588. int i3 = worldController.method304(j, i1, i, i2);
  11589. int j2 = i2 >> 14 & 0x7fff;
  11590. int k2 = i3 & 0x1f;
  11591. int l2 = i3 >> 6;
  11592. if (j1 == 0) {
  11593. worldController.method291(i1, j, i, (byte) -119);
  11594. ObjectDef class46 = ObjectDef.forID(j2);
  11595. if (class46.aBoolean767)
  11596. aClass11Array1230[j].method215(l2, k2,
  11597. class46.aBoolean757, i1, i);
  11598. }
  11599. if (j1 == 1)
  11600. worldController.method292(i, j, i1);
  11601. if (j1 == 2) {
  11602. worldController.method293(j, i1, i);
  11603. ObjectDef class46_1 = ObjectDef.forID(j2);
  11604. if (i1 + class46_1.anInt744 > 103
  11605. || i + class46_1.anInt744 > 103
  11606. || i1 + class46_1.anInt761 > 103
  11607. || i + class46_1.anInt761 > 103)
  11608. return;
  11609. if (class46_1.aBoolean767)
  11610. aClass11Array1230[j].method216(l2, class46_1.anInt744,
  11611. i1, i, class46_1.anInt761,
  11612. class46_1.aBoolean757);
  11613. }
  11614. if (j1 == 3) {
  11615. worldController.method294(j, i, i1);
  11616. ObjectDef class46_2 = ObjectDef.forID(j2);
  11617. if (class46_2.aBoolean767 && class46_2.hasActions)
  11618. aClass11Array1230[j].method218(i, i1);
  11619. }
  11620. }
  11621. if (k1 >= 0) {
  11622. int j3 = j;
  11623. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11624. j3++;
  11625. ObjectManager.method188(worldController, k, i, l, j3,
  11626. aClass11Array1230[j], intGroundArray, i1, k1, j);
  11627. }
  11628. }
  11629. }
  11630.  
  11631. private void updatePlayers(int i, Stream stream) {
  11632. anInt839 = 0;
  11633. anInt893 = 0;
  11634. method117(stream);
  11635. method134(stream);
  11636. method91(stream, i);
  11637. method49(stream);
  11638. for (int k = 0; k < anInt839; k++) {
  11639. int l = anIntArray840[k];
  11640. if (playerArray[l].anInt1537 != loopCycle)
  11641. playerArray[l] = null;
  11642. }
  11643.  
  11644. if (stream.currentOffset != i) {
  11645. signlink.reporterror("Error packet size mismatch in getplayer pos:"
  11646. + stream.currentOffset + " psize:" + i);
  11647. throw new RuntimeException("eek");
  11648. }
  11649. for (int i1 = 0; i1 < playerCount; i1++)
  11650. if (playerArray[playerIndices[i1]] == null) {
  11651. signlink.reporterror(myUsername
  11652. + " null entry in pl list - pos:" + i1 + " size:"
  11653. + playerCount);
  11654. throw new RuntimeException("eek");
  11655. }
  11656.  
  11657. }
  11658.  
  11659. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  11660. int l1 = 2048 - k & 0x7ff;
  11661. int i2 = 2048 - j1 & 0x7ff;
  11662. int j2 = 0;
  11663. int k2 = 0;
  11664. int l2 = j;
  11665. if (l1 != 0) {
  11666. int i3 = Model.modelIntArray1[l1];
  11667. int k3 = Model.modelIntArray2[l1];
  11668. int i4 = k2 * k3 - l2 * i3 >> 16;
  11669. l2 = k2 * i3 + l2 * k3 >> 16;
  11670. k2 = i4;
  11671. }
  11672. if (i2 != 0) {
  11673. /*
  11674. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  11675. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  11676. * l2 = fwdbwd; }
  11677. */
  11678. int j3 = Model.modelIntArray1[i2];
  11679. int l3 = Model.modelIntArray2[i2];
  11680. int j4 = l2 * j3 + j2 * l3 >> 16;
  11681. l2 = l2 * l3 - j2 * j3 >> 16;
  11682. j2 = j4;
  11683. }
  11684. xCameraPos = l - j2;
  11685. zCameraPos = i1 - k2;
  11686. yCameraPos = k1 - l2;
  11687. yCameraCurve = k;
  11688. xCameraCurve = j1;
  11689. }
  11690.  
  11691. private boolean parsePacket() {
  11692. if (socketStream == null)
  11693. return false;
  11694. try {
  11695. int i = socketStream.available();
  11696. if (i == 0)
  11697. return false;
  11698. if (pktType == -1) {
  11699. socketStream.flushInputStream(inStream.buffer, 1);
  11700. pktType = inStream.buffer[0] & 0xff;
  11701. if (encryption != null)
  11702. pktType = pktType - encryption.getNextKey() & 0xff;
  11703. pktSize = SizeConstants.packetSizes[pktType];
  11704. i--;
  11705. }
  11706. if (pktSize == -1)
  11707. if (i > 0) {
  11708. socketStream.flushInputStream(inStream.buffer, 1);
  11709. pktSize = inStream.buffer[0] & 0xff;
  11710. i--;
  11711. } else {
  11712. return false;
  11713. }
  11714. if (pktSize == -2)
  11715. if (i > 1) {
  11716. socketStream.flushInputStream(inStream.buffer, 2);
  11717. inStream.currentOffset = 0;
  11718. pktSize = inStream.readUnsignedWord();
  11719. i -= 2;
  11720. } else {
  11721. return false;
  11722. }
  11723. if (i < pktSize)
  11724. return false;
  11725. inStream.currentOffset = 0;
  11726. socketStream.flushInputStream(inStream.buffer, pktSize);
  11727. anInt1009 = 0;
  11728. anInt843 = anInt842;
  11729. anInt842 = anInt841;
  11730. anInt841 = pktType;
  11731. if (pktType == 81) {
  11732. updatePlayers(pktSize, inStream);
  11733. aBoolean1080 = false;
  11734. pktType = -1;
  11735. return true;
  11736. }
  11737. if (pktType == 217) {
  11738. try {
  11739. clanUsername = inStream.readString();
  11740. clanMessage = TextInput.processText(inStream.readString());
  11741. clanTitle = inStream.readString();
  11742. channelRights = inStream.readUnsignedWord();
  11743. pushMessage(clanMessage, 12, clanUsername);
  11744. } catch (Exception e) {
  11745. e.printStackTrace();
  11746. }
  11747. pktType = -1;
  11748. return true;
  11749. }
  11750. if (pktType == 176) {
  11751. daysSinceRecovChange = inStream.method427();
  11752. unreadMessages = inStream.method435();
  11753. membersInt = inStream.readUnsignedByte();
  11754. anInt1193 = inStream.method440();
  11755. daysSinceLastLogin = inStream.readUnsignedWord();
  11756. if (anInt1193 != 0 && openInterfaceID == -1) {
  11757. signlink.dnslookup(TextClass.method586(anInt1193));
  11758. clearTopInterfaces();
  11759. char c = '\u028A';
  11760. if (daysSinceRecovChange != 201 || membersInt == 1)
  11761. c = '\u028F';
  11762. reportAbuseInput = "";
  11763. canMute = false;
  11764. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11765. if (RSInterface.interfaceCache[k9] == null
  11766. || RSInterface.interfaceCache[k9].contentType != c)
  11767. continue;
  11768. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11769. break;
  11770. }
  11771.  
  11772. }
  11773. pktType = -1;
  11774. return true;
  11775. }
  11776. if (pktType == 64) {
  11777. anInt1268 = inStream.method427();
  11778. anInt1269 = inStream.method428();
  11779. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  11780. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11781. if (groundArray[plane][j][l9] != null) {
  11782. groundArray[plane][j][l9] = null;
  11783. spawnGroundItem(j, l9);
  11784. }
  11785.  
  11786. }
  11787.  
  11788. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  11789. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  11790. .reverseGetNext())
  11791. if (class30_sub1.anInt1297 >= anInt1268
  11792. && class30_sub1.anInt1297 < anInt1268 + 8
  11793. && class30_sub1.anInt1298 >= anInt1269
  11794. && class30_sub1.anInt1298 < anInt1269 + 8
  11795. && class30_sub1.anInt1295 == plane)
  11796. class30_sub1.anInt1294 = 0;
  11797.  
  11798. pktType = -1;
  11799. return true;
  11800. }
  11801. if (pktType == 185) {
  11802. int k = inStream.method436();
  11803. RSInterface.interfaceCache[k].anInt233 = 3;
  11804. if (myPlayer.desc == null)
  11805. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  11806. + (myPlayer.anIntArray1700[4] << 20)
  11807. + (myPlayer.equipment[0] << 15)
  11808. + (myPlayer.equipment[8] << 10)
  11809. + (myPlayer.equipment[11] << 5)
  11810. + myPlayer.equipment[1];
  11811. else
  11812. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  11813. pktType = -1;
  11814. return true;
  11815. }
  11816. if (pktType == 107) {
  11817. aBoolean1160 = false;
  11818. for (int l = 0; l < 5; l++)
  11819. aBooleanArray876[l] = false;
  11820.  
  11821. pktType = -1;
  11822. return true;
  11823. }
  11824. if (pktType == 72) {
  11825. int i1 = inStream.method434();
  11826. RSInterface class9 = RSInterface.interfaceCache[i1];
  11827. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  11828. class9.inv[k15] = -1;
  11829. class9.inv[k15] = 0;
  11830. }
  11831.  
  11832. pktType = -1;
  11833. return true;
  11834. }
  11835. if (pktType == 214) {
  11836. ignoreCount = pktSize / 8;
  11837. for (int j1 = 0; j1 < ignoreCount; j1++)
  11838. ignoreListAsLongs[j1] = inStream.readQWord();
  11839.  
  11840. pktType = -1;
  11841. return true;
  11842. }
  11843. if (pktType == 166) {
  11844. aBoolean1160 = true;
  11845. anInt1098 = inStream.readUnsignedByte();
  11846. anInt1099 = inStream.readUnsignedByte();
  11847. anInt1100 = inStream.readUnsignedWord();
  11848. anInt1101 = inStream.readUnsignedByte();
  11849. anInt1102 = inStream.readUnsignedByte();
  11850. if (anInt1102 >= 100) {
  11851. xCameraPos = anInt1098 * 128 + 64;
  11852. yCameraPos = anInt1099 * 128 + 64;
  11853. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  11854. - anInt1100;
  11855. }
  11856. pktType = -1;
  11857. return true;
  11858. }
  11859. if (pktType == 134) {
  11860. needDrawTabArea = true;
  11861. int k1 = inStream.readUnsignedByte();
  11862. int i10 = inStream.method439();
  11863. int l15 = inStream.readUnsignedByte();
  11864. int xp = currentExp[k1];
  11865. currentExp[k1] = i10;
  11866. currentStats[k1] = l15;
  11867. maxStats[k1] = 1;//
  11868. xpCounter += currentExp[k1] - xp;
  11869. expAdded = currentExp[k1] - xp;
  11870. if (System.currentTimeMillis() - timeXpReceived > 150) {
  11871. currentXP = 0;
  11872. forceResetXp = true;
  11873. }
  11874. timeXpReceived = System.currentTimeMillis();
  11875. currentXP += expAdded;
  11876. for (int k20 = 0; k20 < 98; k20++)
  11877. if (i10 >= anIntArray1019[k20])
  11878. maxStats[k1] = k20 + 2;
  11879. pktType = -1;
  11880. return true;
  11881. }
  11882. if (pktType == 71) {
  11883. int l1 = inStream.readUnsignedWord();
  11884. int j10 = inStream.method426();
  11885. if (l1 == 65535)
  11886. l1 = -1;
  11887.  
  11888. tabInterfaceIDs[j10] = l1;// l1
  11889.  
  11890. needDrawTabArea = true;
  11891. tabAreaAltered = true;
  11892. pktType = -1;
  11893. return true;
  11894. }
  11895. if (pktType == 74) {
  11896. int i2 = inStream.method434();
  11897. if (i2 == 65535)
  11898. i2 = -1;
  11899. if (i2 != currentSong && musicEnabled && !lowMem
  11900. && prevSong == 0) {
  11901. nextSong = i2;
  11902. songChanging = true;
  11903. onDemandFetcher.method558(2, nextSong);
  11904. }
  11905. currentSong = i2;
  11906. pktType = -1;
  11907. return true;
  11908. }
  11909. if (pktType == 121) {
  11910. int j2 = inStream.method436();
  11911. int k10 = inStream.method435();
  11912. if (musicEnabled && !lowMem) {
  11913. nextSong = j2;
  11914. songChanging = false;
  11915. onDemandFetcher.method558(2, nextSong);
  11916. prevSong = k10;
  11917. }
  11918. pktType = -1;
  11919. return true;
  11920. }
  11921. if (pktType == 109) {
  11922. resetLogout();
  11923. pktType = -1;
  11924. return false;
  11925. }
  11926. if (pktType == 70) {
  11927. int k2 = inStream.readSignedWord();
  11928. int l10 = inStream.method437();
  11929. int i16 = inStream.method434();
  11930. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11931. class9_5.anInt263 = k2;
  11932. class9_5.anInt265 = l10;
  11933. pktType = -1;
  11934. return true;
  11935. }
  11936. if (pktType == 73 || pktType == 241) {
  11937.  
  11938. // mapReset();
  11939. int l2 = anInt1069;
  11940. int i11 = anInt1070;
  11941. if (pktType == 73) {
  11942. l2 = mapX = MapX = inStream.method435();
  11943. i11 = mapY = MapY = inStream.readUnsignedWord();
  11944. aBoolean1159 = false;
  11945. }
  11946. if (pktType == 241) {
  11947. i11 = inStream.method435();
  11948. inStream.initBitAccess();
  11949. for (int j16 = 0; j16 < 4; j16++) {
  11950. for (int l20 = 0; l20 < 13; l20++) {
  11951. for (int j23 = 0; j23 < 13; j23++) {
  11952. int i26 = inStream.readBits(1);
  11953. if (i26 == 1)
  11954. anIntArrayArrayArray1129[j16][l20][j23] = inStream
  11955. .readBits(26);
  11956. else
  11957. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11958. }
  11959.  
  11960. }
  11961.  
  11962. }
  11963.  
  11964. inStream.finishBitAccess();
  11965. l2 = inStream.readUnsignedWord();
  11966. aBoolean1159 = true;
  11967. }
  11968. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11969. pktType = -1;
  11970. return true;
  11971. }
  11972. anInt1069 = l2;
  11973. anInt1070 = i11;
  11974. baseX = (anInt1069 - 6) * 8;
  11975. baseY = (anInt1070 - 6) * 8;
  11976. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49)
  11977. && anInt1070 / 8 == 48;
  11978. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11979. aBoolean1141 = true;
  11980. loadingStage = 1;
  11981. aLong824 = System.currentTimeMillis();
  11982. aRSImageProducer_1165.initDrawingArea();
  11983. aTextDrawingArea_1271.drawText(0, "Loading - please wait.",
  11984. 151, 257);
  11985. aTextDrawingArea_1271.drawText(0xffffff,
  11986. "Loading - please wait.", 150, 256);
  11987. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11988. if (pktType == 73) {
  11989. int k16 = 0;
  11990. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11991. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11992. k16++;
  11993.  
  11994. }
  11995.  
  11996. aByteArrayArray1183 = new byte[k16][];
  11997. aByteArrayArray1247 = new byte[k16][];
  11998. anIntArray1234 = new int[k16];
  11999. anIntArray1235 = new int[k16];
  12000. anIntArray1236 = new int[k16];
  12001. k16 = 0;
  12002. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12003. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12004. anIntArray1234[k16] = (l23 << 8) + j26;
  12005. if (aBoolean1141
  12006. && (j26 == 49 || j26 == 149 || j26 == 147
  12007. || l23 == 50 || l23 == 49
  12008. && j26 == 47)) {
  12009. anIntArray1235[k16] = -1;
  12010. anIntArray1236[k16] = -1;
  12011. k16++;
  12012. } else {
  12013. int k28 = anIntArray1235[k16] = onDemandFetcher
  12014. .method562(0, j26, l23);
  12015. if (k28 != -1)
  12016. onDemandFetcher.method558(3, k28);
  12017. int j30 = anIntArray1236[k16] = onDemandFetcher
  12018. .method562(1, j26, l23);
  12019. if (j30 != -1)
  12020. onDemandFetcher.method558(3, j30);
  12021. k16++;
  12022. }
  12023. }
  12024.  
  12025. }
  12026.  
  12027. }
  12028. if (pktType == 241) {
  12029. int l16 = 0;
  12030. int ai[] = new int[676];
  12031. for (int i24 = 0; i24 < 4; i24++) {
  12032. for (int k26 = 0; k26 < 13; k26++) {
  12033. for (int l28 = 0; l28 < 13; l28++) {
  12034. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12035. if (k30 != -1) {
  12036. int k31 = k30 >> 14 & 0x3ff;
  12037. int i32 = k30 >> 3 & 0x7ff;
  12038. int k32 = (k31 / 8 << 8) + i32 / 8;
  12039. for (int j33 = 0; j33 < l16; j33++) {
  12040. if (ai[j33] != k32)
  12041. continue;
  12042. k32 = -1;
  12043. break;
  12044. }
  12045.  
  12046. if (k32 != -1)
  12047. ai[l16++] = k32;
  12048. }
  12049. }
  12050.  
  12051. }
  12052.  
  12053. }
  12054.  
  12055. aByteArrayArray1183 = new byte[l16][];
  12056. aByteArrayArray1247 = new byte[l16][];
  12057. anIntArray1234 = new int[l16];
  12058. anIntArray1235 = new int[l16];
  12059. anIntArray1236 = new int[l16];
  12060. for (int l26 = 0; l26 < l16; l26++) {
  12061. int i29 = anIntArray1234[l26] = ai[l26];
  12062. int l30 = i29 >> 8 & 0xff;
  12063. int l31 = i29 & 0xff;
  12064. int j32 = anIntArray1235[l26] = onDemandFetcher
  12065. .method562(0, l31, l30);
  12066. if (j32 != -1)
  12067. onDemandFetcher.method558(3, j32);
  12068. int i33 = anIntArray1236[l26] = onDemandFetcher
  12069. .method562(1, l31, l30);
  12070. if (i33 != -1)
  12071. onDemandFetcher.method558(3, i33);
  12072. }
  12073.  
  12074. }
  12075. int i17 = baseX - anInt1036;
  12076. int j21 = baseY - anInt1037;
  12077. anInt1036 = baseX;
  12078. anInt1037 = baseY;
  12079. for (int j24 = 0; j24 < 16384; j24++) {
  12080. NPC npc = npcArray[j24];
  12081. if (npc != null) {
  12082. for (int j29 = 0; j29 < 10; j29++) {
  12083. npc.smallX[j29] -= i17;
  12084. npc.smallY[j29] -= j21;
  12085. }
  12086.  
  12087. npc.x -= i17 * 128;
  12088. npc.y -= j21 * 128;
  12089. }
  12090. }
  12091.  
  12092. for (int i27 = 0; i27 < maxPlayers; i27++) {
  12093. Player player = playerArray[i27];
  12094. if (player != null) {
  12095. for (int i31 = 0; i31 < 10; i31++) {
  12096. player.smallX[i31] -= i17;
  12097. player.smallY[i31] -= j21;
  12098. }
  12099.  
  12100. player.x -= i17 * 128;
  12101. player.y -= j21 * 128;
  12102. }
  12103. }
  12104.  
  12105. aBoolean1080 = true;
  12106. byte byte1 = 0;
  12107. byte byte2 = 104;
  12108. byte byte3 = 1;
  12109. if (i17 < 0) {
  12110. byte1 = 103;
  12111. byte2 = -1;
  12112. byte3 = -1;
  12113. }
  12114. byte byte4 = 0;
  12115. byte byte5 = 104;
  12116. byte byte6 = 1;
  12117. if (j21 < 0) {
  12118. byte4 = 103;
  12119. byte5 = -1;
  12120. byte6 = -1;
  12121. }
  12122. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  12123. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  12124. int i34 = k33 + i17;
  12125. int j34 = l33 + j21;
  12126. for (int k34 = 0; k34 < 4; k34++)
  12127. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12128. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12129. else
  12130. groundArray[k34][k33][l33] = null;
  12131.  
  12132. }
  12133.  
  12134. }
  12135.  
  12136. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12137. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12138. .reverseGetNext()) {
  12139. class30_sub1_1.anInt1297 -= i17;
  12140. class30_sub1_1.anInt1298 -= j21;
  12141. if (class30_sub1_1.anInt1297 < 0
  12142. || class30_sub1_1.anInt1298 < 0
  12143. || class30_sub1_1.anInt1297 >= 104
  12144. || class30_sub1_1.anInt1298 >= 104)
  12145. class30_sub1_1.unlink();
  12146. }
  12147.  
  12148. if (destX != 0) {
  12149. destX -= i17;
  12150. destY -= j21;
  12151. }
  12152. aBoolean1160 = false;
  12153. pktType = -1;
  12154. return true;
  12155. }
  12156. if (pktType == 208) {
  12157. int i3 = inStream.method437();
  12158. if (i3 >= 0)
  12159. method60(i3);
  12160. anInt1018 = i3;
  12161. pktType = -1;
  12162. return true;
  12163. }
  12164. if (pktType == 99) {
  12165. anInt1021 = inStream.readUnsignedByte();
  12166. pktType = -1;
  12167. return true;
  12168. }
  12169. if (pktType == 75) {
  12170. int j3 = inStream.method436();
  12171. int j11 = inStream.method436();
  12172. RSInterface.interfaceCache[j11].anInt233 = 2;
  12173. RSInterface.interfaceCache[j11].mediaID = j3;
  12174. pktType = -1;
  12175. return true;
  12176. }
  12177. if (pktType == 114) {
  12178. anInt1104 = inStream.method434() * 30;
  12179. pktType = -1;
  12180. return true;
  12181. }
  12182. if (pktType == 60) {
  12183. anInt1269 = inStream.readUnsignedByte();
  12184. anInt1268 = inStream.method427();
  12185. while (inStream.currentOffset < pktSize) {
  12186. int k3 = inStream.readUnsignedByte();
  12187. method137(inStream, k3);
  12188. }
  12189. pktType = -1;
  12190. return true;
  12191. }
  12192. if (pktType == 35) {
  12193. int l3 = inStream.readUnsignedByte();
  12194. int k11 = inStream.readUnsignedByte();
  12195. int j17 = inStream.readUnsignedByte();
  12196. int k21 = inStream.readUnsignedByte();
  12197. aBooleanArray876[l3] = true;
  12198. anIntArray873[l3] = k11;
  12199. anIntArray1203[l3] = j17;
  12200. anIntArray928[l3] = k21;
  12201. anIntArray1030[l3] = 0;
  12202. pktType = -1;
  12203. return true;
  12204. }
  12205. if (pktType == 174) {
  12206. int i4 = inStream.readUnsignedWord();
  12207. int l11 = inStream.readUnsignedByte();
  12208. int k17 = inStream.readUnsignedWord();
  12209. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  12210. anIntArray1207[anInt1062] = i4;
  12211. anIntArray1241[anInt1062] = l11;
  12212. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  12213. anInt1062++;
  12214. }
  12215. pktType = -1;
  12216. return true;
  12217. }
  12218. if (pktType == 104) {
  12219. int j4 = inStream.method427();
  12220. int i12 = inStream.method426();
  12221. String s6 = inStream.readString();
  12222. if (j4 >= 1 && j4 <= 5) {
  12223. if (s6.equalsIgnoreCase("null"))
  12224. s6 = null;
  12225. atPlayerActions[j4 - 1] = s6;
  12226. atPlayerArray[j4 - 1] = i12 == 0;
  12227. }
  12228. pktType = -1;
  12229. return true;
  12230. }
  12231. if (pktType == 78) {
  12232. destX = 0;
  12233. pktType = -1;
  12234. return true;
  12235. }
  12236. if (pktType == 253) {
  12237. String s = inStream.readString();
  12238. if (s.endsWith(":tradereq:")) {
  12239. String s3 = s.substring(0, s.indexOf(":"));
  12240. long l17 = TextClass.longForName(s3);
  12241. boolean flag2 = false;
  12242. for (int j27 = 0; j27 < ignoreCount; j27++) {
  12243. if (ignoreListAsLongs[j27] != l17)
  12244. continue;
  12245. flag2 = true;
  12246. break;
  12247. }
  12248.  
  12249. if (!flag2 && anInt1251 == 0)
  12250. pushMessage("wishes to trade with you.", 4, s3);
  12251. } else if (s.endsWith(":duelreq:")) {
  12252. String s4 = s.substring(0, s.indexOf(":"));
  12253. long l18 = TextClass.longForName(s4);
  12254. boolean flag3 = false;
  12255. for (int k27 = 0; k27 < ignoreCount; k27++) {
  12256. if (ignoreListAsLongs[k27] != l18)
  12257. continue;
  12258. flag3 = true;
  12259. break;
  12260. }
  12261.  
  12262. if (!flag3 && anInt1251 == 0)
  12263. pushMessage("wishes to duel with you.", 8, s4);
  12264. } else if (s.endsWith(":chalreq:")) {
  12265. String s5 = s.substring(0, s.indexOf(":"));
  12266. long l19 = TextClass.longForName(s5);
  12267. boolean flag4 = false;
  12268. for (int l27 = 0; l27 < ignoreCount; l27++) {
  12269. if (ignoreListAsLongs[l27] != l19)
  12270. continue;
  12271. flag4 = true;
  12272. break;
  12273. }
  12274.  
  12275. if (!flag4 && anInt1251 == 0) {
  12276. String s8 = s.substring(s.indexOf(":") + 1,
  12277. s.length() - 9);
  12278. pushMessage(s8, 8, s5);
  12279. }
  12280. } else {
  12281. pushMessage(s, 0, "");
  12282. }
  12283. pktType = -1;
  12284. // serverMessage(s);
  12285. return true;
  12286. }
  12287. if (pktType == 1) {
  12288. for (int k4 = 0; k4 < playerArray.length; k4++)
  12289. if (playerArray[k4] != null)
  12290. playerArray[k4].anim = -1;
  12291.  
  12292. for (int j12 = 0; j12 < npcArray.length; j12++)
  12293. if (npcArray[j12] != null)
  12294. npcArray[j12].anim = -1;
  12295.  
  12296. pktType = -1;
  12297. return true;
  12298. }
  12299. if (pktType == 50) {
  12300. long l4 = inStream.readQWord();
  12301. int i18 = inStream.readUnsignedByte();
  12302. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12303. for (int k24 = 0; k24 < friendsCount; k24++) {
  12304. if (l4 != friendsListAsLongs[k24])
  12305. continue;
  12306. if (friendsNodeIDs[k24] != i18) {
  12307. friendsNodeIDs[k24] = i18;
  12308. needDrawTabArea = true;
  12309. if (i18 >= 2) {
  12310. pushMessage(s7 + " has logged in.", 5, "");
  12311. }
  12312. if (i18 <= 1) {
  12313. pushMessage(s7 + " has logged out.", 5, "");
  12314. }
  12315. }
  12316. s7 = null;
  12317. break;
  12318. }
  12319.  
  12320. if (s7 != null && friendsCount < 200) {
  12321. friendsListAsLongs[friendsCount] = l4;
  12322. friendsList[friendsCount] = s7;
  12323. friendsNodeIDs[friendsCount] = i18;
  12324. friendsCount++;
  12325. needDrawTabArea = true;
  12326. }
  12327. for (boolean flag6 = false; !flag6;) {
  12328. flag6 = true;
  12329. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  12330. if (friendsNodeIDs[k29] != nodeID
  12331. && friendsNodeIDs[k29 + 1] == nodeID
  12332. || friendsNodeIDs[k29] == 0
  12333. && friendsNodeIDs[k29 + 1] != 0) {
  12334. int j31 = friendsNodeIDs[k29];
  12335. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12336. friendsNodeIDs[k29 + 1] = j31;
  12337. String s10 = friendsList[k29];
  12338. friendsList[k29] = friendsList[k29 + 1];
  12339. friendsList[k29 + 1] = s10;
  12340. long l32 = friendsListAsLongs[k29];
  12341. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12342. friendsListAsLongs[k29 + 1] = l32;
  12343. needDrawTabArea = true;
  12344. flag6 = false;
  12345. }
  12346.  
  12347. }
  12348.  
  12349. pktType = -1;
  12350. return true;
  12351. }
  12352. if (pktType == 110) {
  12353. if (tabID == 12)
  12354. needDrawTabArea = true;
  12355. energy = inStream.readUnsignedByte();
  12356. pktType = -1;
  12357. return true;
  12358. }
  12359. if (pktType == 254) {
  12360. anInt855 = inStream.readUnsignedByte();
  12361. if (anInt855 == 1)
  12362. anInt1222 = inStream.readUnsignedWord();
  12363. if (anInt855 >= 2 && anInt855 <= 6) {
  12364. if (anInt855 == 2) {
  12365. anInt937 = 64;
  12366. anInt938 = 64;
  12367. }
  12368. if (anInt855 == 3) {
  12369. anInt937 = 0;
  12370. anInt938 = 64;
  12371. }
  12372. if (anInt855 == 4) {
  12373. anInt937 = 128;
  12374. anInt938 = 64;
  12375. }
  12376. if (anInt855 == 5) {
  12377. anInt937 = 64;
  12378. anInt938 = 0;
  12379. }
  12380. if (anInt855 == 6) {
  12381. anInt937 = 64;
  12382. anInt938 = 128;
  12383. }
  12384. anInt855 = 2;
  12385. anInt934 = inStream.readUnsignedWord();
  12386. anInt935 = inStream.readUnsignedWord();
  12387. anInt936 = inStream.readUnsignedByte();
  12388. }
  12389. if (anInt855 == 10)
  12390. anInt933 = inStream.readUnsignedWord();
  12391. pktType = -1;
  12392. return true;
  12393. }
  12394. if (pktType == 248) {
  12395. int i5 = inStream.method435();
  12396. int k12 = inStream.readUnsignedWord();
  12397. if (backDialogID != -1) {
  12398. backDialogID = -1;
  12399. inputTaken = true;
  12400. }
  12401. if (inputDialogState != 0) {
  12402. inputDialogState = 0;
  12403. inputTaken = true;
  12404. }
  12405. openInterfaceID = i5;
  12406. invOverlayInterfaceID = k12;
  12407. needDrawTabArea = true;
  12408. tabAreaAltered = true;
  12409. aBoolean1149 = false;
  12410. pktType = -1;
  12411. return true;
  12412. }
  12413. if (pktType == 79) {
  12414. int j5 = inStream.method434();
  12415. int l12 = inStream.method435();
  12416. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12417. if (class9_3 != null && class9_3.type == 0) {
  12418. if (l12 < 0)
  12419. l12 = 0;
  12420. if (l12 > class9_3.scrollMax - class9_3.height)
  12421. l12 = class9_3.scrollMax - class9_3.height;
  12422. class9_3.scrollPosition = l12;
  12423. }
  12424. pktType = -1;
  12425. return true;
  12426. }
  12427. if (pktType == 68) {
  12428. for (int k5 = 0; k5 < variousSettings.length; k5++)
  12429. if (variousSettings[k5] != anIntArray1045[k5]) {
  12430. variousSettings[k5] = anIntArray1045[k5];
  12431. method33(k5);
  12432. needDrawTabArea = true;
  12433. }
  12434.  
  12435. pktType = -1;
  12436. return true;
  12437. }
  12438. if (pktType == 196) {
  12439. long l5 = inStream.readQWord();
  12440. int j18 = inStream.readDWord();
  12441. int l21 = inStream.readUnsignedByte();
  12442. boolean flag5 = false;
  12443. if (l21 <= 1) {
  12444. for (int l29 = 0; l29 < ignoreCount; l29++) {
  12445. if (ignoreListAsLongs[l29] != l5)
  12446. continue;
  12447. flag5 = true;
  12448.  
  12449. }
  12450. }
  12451. if (!flag5 && anInt1251 == 0)
  12452. try {
  12453. String s9 = TextInput.method525(pktSize - 13, inStream);
  12454. switch (l21) {
  12455. case 1:
  12456. pushMessage(
  12457. s9,
  12458. 7,
  12459. "@cr1@"
  12460. + TextClass.fixName(TextClass
  12461. .nameForLong(l5)));
  12462. break;
  12463. case 2:
  12464. pushMessage(
  12465. s9,
  12466. 7,
  12467. "@cr2@"
  12468. + TextClass.fixName(TextClass
  12469. .nameForLong(l5)));
  12470. break;
  12471. case 3:
  12472. pushMessage(
  12473. s9,
  12474. 7,
  12475. "@cr3@"
  12476. + TextClass.fixName(TextClass
  12477. .nameForLong(l5)));
  12478. break;
  12479. case 4:
  12480. pushMessage(
  12481. s9,
  12482. 7,
  12483. "@cr4@"
  12484. + TextClass.fixName(TextClass
  12485. .nameForLong(l5)));
  12486. break;
  12487. case 5:
  12488. pushMessage(
  12489. s9,
  12490. 7,
  12491. "@cr5@"
  12492. + TextClass.fixName(TextClass
  12493. .nameForLong(l5)));
  12494. break;
  12495. case 6:
  12496. pushMessage(
  12497. s9,
  12498. 7,
  12499. "@cr6@"
  12500. + TextClass.fixName(TextClass
  12501. .nameForLong(l5)));
  12502. break;
  12503. case 7:
  12504. pushMessage(
  12505. s9,
  12506. 7,
  12507. "@cr7@"
  12508. + TextClass.fixName(TextClass
  12509. .nameForLong(l5)));
  12510. break;
  12511. case 8:
  12512. pushMessage(
  12513. s9,
  12514. 7,
  12515. "@cr8@"
  12516. + TextClass.fixName(TextClass
  12517. .nameForLong(l5)));
  12518. break;
  12519. case 9:
  12520. pushMessage(
  12521. s9,
  12522. 7,
  12523. "@cr9@"
  12524. + TextClass.fixName(TextClass
  12525. .nameForLong(l5)));
  12526. break;
  12527. case 10:
  12528. pushMessage(
  12529. s9,
  12530. 7,
  12531. "@cr10@"
  12532. + TextClass.fixName(TextClass
  12533. .nameForLong(l5)));
  12534. break;
  12535. default:
  12536. pushMessage(s9, 3, TextClass.fixName(TextClass
  12537. .nameForLong(l5)));
  12538. }
  12539. } catch (Exception exception1) {
  12540. signlink.reporterror("cde1");
  12541. }
  12542. pktType = -1;
  12543. return true;
  12544. }
  12545. if (pktType == 85) {
  12546. anInt1269 = inStream.method427();
  12547. anInt1268 = inStream.method427();
  12548. pktType = -1;
  12549. return true;
  12550. }
  12551. if (pktType == 24) {
  12552. anInt1054 = inStream.method428();
  12553. if (anInt1054 == tabID) {
  12554. if (anInt1054 == 3)
  12555. tabID = 1;
  12556. else
  12557. tabID = 3;
  12558. needDrawTabArea = true;
  12559. }
  12560. pktType = -1;
  12561. return true;
  12562. }
  12563. if (pktType == 246) {
  12564. int i6 = inStream.method434();
  12565. int i13 = inStream.readUnsignedWord();
  12566. int k18 = inStream.readUnsignedWord();
  12567. if (k18 == 65535) {
  12568. RSInterface.interfaceCache[i6].anInt233 = 0;
  12569. pktType = -1;
  12570. return true;
  12571. } else {
  12572. ItemDef itemDef = ItemDef.forID(k18);
  12573. RSInterface.interfaceCache[i6].anInt233 = 4;
  12574. RSInterface.interfaceCache[i6].mediaID = k18;
  12575. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  12576. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  12577. RSInterface.interfaceCache[i6].anInt269 = (itemDef.modelZoom * 100)
  12578. / i13;
  12579. pktType = -1;
  12580. return true;
  12581. }
  12582. }
  12583. if (pktType == 171) {
  12584. boolean flag1 = inStream.readUnsignedByte() == 1;
  12585. int j13 = inStream.readUnsignedWord();
  12586. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  12587. pktType = -1;
  12588. return true;
  12589. }
  12590. if (pktType == 142) {
  12591. int j6 = inStream.method434();
  12592. method60(j6);
  12593. if (backDialogID != -1) {
  12594. backDialogID = -1;
  12595. inputTaken = true;
  12596. }
  12597. if (inputDialogState != 0) {
  12598. inputDialogState = 0;
  12599. inputTaken = true;
  12600. }
  12601. invOverlayInterfaceID = j6;
  12602. needDrawTabArea = true;
  12603. tabAreaAltered = true;
  12604. openInterfaceID = -1;
  12605. aBoolean1149 = false;
  12606. pktType = -1;
  12607. return true;
  12608. }
  12609. if (pktType == 126) {
  12610. String text = inStream.readString();
  12611. int frame = inStream.method435();
  12612. if (text.startsWith("www.") || text.startsWith("http")) {
  12613. launchURL(text);
  12614. pktType = -1;
  12615. return true;
  12616. }
  12617. if (text.startsWith("freezetimer:")) {
  12618. String[] args = text.split(":");
  12619. freezeTimer = (int) (Integer.parseInt(args[1]) * 0.6);
  12620. pktType = -1;
  12621. return true;
  12622. }
  12623. updateStrings(text, frame);
  12624. sendFrame126(text, frame);
  12625. if (frame >= 18144 && frame <= 18244) {
  12626. clanList[frame - 18144] = text;
  12627. }
  12628. pktType = -1;
  12629. return true;
  12630. }
  12631. if (pktType == 206) {
  12632. publicChatMode = inStream.readUnsignedByte();
  12633. privateChatMode = inStream.readUnsignedByte();
  12634. tradeMode = inStream.readUnsignedByte();
  12635. aBoolean1233 = true;
  12636. inputTaken = true;
  12637. pktType = -1;
  12638. return true;
  12639. }
  12640. if (pktType == 240) {
  12641. if (tabID == 12)
  12642. needDrawTabArea = true;
  12643. weight = inStream.readSignedWord();
  12644. pktType = -1;
  12645. return true;
  12646. }
  12647. if (pktType == 8) {
  12648. int k6 = inStream.method436();
  12649. int l13 = inStream.readUnsignedWord();
  12650. RSInterface.interfaceCache[k6].anInt233 = 1;
  12651. RSInterface.interfaceCache[k6].mediaID = l13;
  12652. pktType = -1;
  12653. return true;
  12654. }
  12655. if (pktType == 122) {
  12656. int l6 = inStream.method436();
  12657. int i14 = inStream.method436();
  12658. int i19 = i14 >> 10 & 0x1f;
  12659. int i22 = i14 >> 5 & 0x1f;
  12660. int l24 = i14 & 0x1f;
  12661. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  12662. + (i22 << 11) + (l24 << 3);
  12663. pktType = -1;
  12664. return true;
  12665. }
  12666. if (pktType == 53) {
  12667. needDrawTabArea = true;
  12668. int i7 = inStream.readUnsignedWord();
  12669. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12670. int j19 = inStream.readUnsignedWord();
  12671. for (int j22 = 0; j22 < j19; j22++) {
  12672. int i25 = inStream.readUnsignedByte();
  12673. if (i25 == 255)
  12674. i25 = inStream.method440();
  12675. class9_1.inv[j22] = inStream.method436();
  12676. class9_1.invStackSizes[j22] = i25;
  12677. }
  12678.  
  12679. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12680. class9_1.inv[j25] = 0;
  12681. class9_1.invStackSizes[j25] = 0;
  12682. }
  12683.  
  12684. pktType = -1;
  12685. return true;
  12686. }
  12687. if (pktType == 230) {
  12688. int j7 = inStream.method435();
  12689. int j14 = inStream.readUnsignedWord();
  12690. int k19 = inStream.readUnsignedWord();
  12691. int k22 = inStream.method436();
  12692. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12693. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12694. RSInterface.interfaceCache[j14].anInt269 = j7;
  12695. pktType = -1;
  12696. return true;
  12697. }
  12698. if (pktType == 221) {
  12699. anInt900 = inStream.readUnsignedByte();
  12700. needDrawTabArea = true;
  12701. pktType = -1;
  12702. return true;
  12703. }
  12704. if (pktType == 177) {
  12705. aBoolean1160 = true;
  12706. anInt995 = inStream.readUnsignedByte();
  12707. anInt996 = inStream.readUnsignedByte();
  12708. anInt997 = inStream.readUnsignedWord();
  12709. anInt998 = inStream.readUnsignedByte();
  12710. anInt999 = inStream.readUnsignedByte();
  12711. if (anInt999 >= 100) {
  12712. int k7 = anInt995 * 128 + 64;
  12713. int k14 = anInt996 * 128 + 64;
  12714. int i20 = method42(plane, k14, k7) - anInt997;
  12715. int l22 = k7 - xCameraPos;
  12716. int k25 = i20 - zCameraPos;
  12717. int j28 = k14 - yCameraPos;
  12718. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  12719. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12720. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12721. if (yCameraCurve < 128)
  12722. yCameraCurve = 128;
  12723. if (yCameraCurve > 383)
  12724. yCameraCurve = 383;
  12725. }
  12726. pktType = -1;
  12727. return true;
  12728. }
  12729. if (pktType == 249) {
  12730. anInt1046 = inStream.method426();
  12731. unknownInt10 = inStream.method436();
  12732. pktType = -1;
  12733. return true;
  12734. }
  12735. if (pktType == 65) {
  12736. updateNPCs(inStream, pktSize);
  12737. pktType = -1;
  12738. return true;
  12739. }
  12740. if (pktType == 27) {
  12741. messagePromptRaised = false;
  12742. inputDialogState = 1;
  12743. amountOrNameInput = "";
  12744. inputTaken = true;
  12745. pktType = -1;
  12746. return true;
  12747. }
  12748. if (pktType == 187) {
  12749. messagePromptRaised = false;
  12750. inputDialogState = 2;
  12751. amountOrNameInput = "";
  12752. inputTaken = true;
  12753. pktType = -1;
  12754. return true;
  12755. }
  12756. if (pktType == 97) {
  12757. int l7 = inStream.readUnsignedWord();
  12758. method60(l7);
  12759. if (invOverlayInterfaceID != -1) {
  12760. invOverlayInterfaceID = -1;
  12761. needDrawTabArea = true;
  12762. tabAreaAltered = true;
  12763. }
  12764. if (backDialogID != -1) {
  12765. backDialogID = -1;
  12766. inputTaken = true;
  12767. }
  12768. if (inputDialogState != 0) {
  12769. inputDialogState = 0;
  12770. inputTaken = true;
  12771. }
  12772. openInterfaceID = l7;
  12773. aBoolean1149 = false;
  12774. pktType = -1;
  12775. return true;
  12776. }
  12777. if (pktType == 218) {
  12778. int i8 = inStream.method438();
  12779. dialogID = i8;
  12780. inputTaken = true;
  12781. pktType = -1;
  12782. return true;
  12783. }
  12784. if (pktType == 87) {
  12785. int j8 = inStream.method434();
  12786. int l14 = inStream.method439();
  12787. System.out.println("Test1: " + j8 + ", test2:" + l14);
  12788. anIntArray1045[j8] = l14;
  12789. if (variousSettings[j8] != l14) {
  12790. variousSettings[j8] = l14;
  12791. method33(j8);
  12792. needDrawTabArea = true;
  12793. if (dialogID != -1)
  12794. inputTaken = true;
  12795. }
  12796. pktType = -1;
  12797. return true;
  12798. }
  12799. if (pktType == 36) {
  12800. int k8 = inStream.method434();
  12801. byte byte0 = inStream.readSignedByte();
  12802. anIntArray1045[k8] = byte0;
  12803. if (variousSettings[k8] != byte0) {
  12804. variousSettings[k8] = byte0;
  12805. method33(k8);
  12806. needDrawTabArea = true;
  12807. if (dialogID != -1)
  12808. inputTaken = true;
  12809. }
  12810. pktType = -1;
  12811. return true;
  12812. }
  12813. if (pktType == 61) {
  12814. anInt1055 = inStream.readUnsignedByte();
  12815. pktType = -1;
  12816. return true;
  12817. }
  12818. if (pktType == 200) {
  12819. int l8 = inStream.readUnsignedWord();
  12820. int i15 = inStream.readSignedWord();
  12821. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12822. class9_4.anInt257 = i15;
  12823. if (i15 == -1) {
  12824. class9_4.anInt246 = 0;
  12825. class9_4.anInt208 = 0;
  12826. }
  12827. pktType = -1;
  12828. return true;
  12829. }
  12830. if (pktType == 219) {
  12831. if (invOverlayInterfaceID != -1) {
  12832. invOverlayInterfaceID = -1;
  12833. needDrawTabArea = true;
  12834. tabAreaAltered = true;
  12835. }
  12836. if (backDialogID != -1) {
  12837. backDialogID = -1;
  12838. inputTaken = true;
  12839. }
  12840. if (inputDialogState != 0) {
  12841. inputDialogState = 0;
  12842. inputTaken = true;
  12843. }
  12844. openInterfaceID = -1;
  12845. aBoolean1149 = false;
  12846. pktType = -1;
  12847. return true;
  12848. }
  12849. if (pktType == 34) {
  12850. needDrawTabArea = true;
  12851. int i9 = inStream.readUnsignedWord();
  12852. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12853. while (inStream.currentOffset < pktSize) {
  12854. int j20 = inStream.method422();
  12855. int i23 = inStream.readUnsignedWord();
  12856. int l25 = inStream.readUnsignedByte();
  12857. if (l25 == 255)
  12858. l25 = inStream.readDWord();
  12859. if (j20 >= 0 && j20 < class9_2.inv.length) {
  12860. class9_2.inv[j20] = i23;
  12861. class9_2.invStackSizes[j20] = l25;
  12862. }
  12863. }
  12864. pktType = -1;
  12865. return true;
  12866. }
  12867. if (pktType == 105 || pktType == 84 || pktType == 147
  12868. || pktType == 215 || pktType == 4 || pktType == 117
  12869. || pktType == 156 || pktType == 44 || pktType == 160
  12870. || pktType == 101 || pktType == 151) {
  12871. method137(inStream, pktType);
  12872. pktType = -1;
  12873. return true;
  12874. }
  12875. if (pktType == 106) {
  12876. tabID = inStream.method427();
  12877. needDrawTabArea = true;
  12878. tabAreaAltered = true;
  12879. pktType = -1;
  12880. return true;
  12881. }
  12882. if (pktType == 164) {
  12883. int j9 = inStream.method434();
  12884. method60(j9);
  12885. if (invOverlayInterfaceID != -1) {
  12886. invOverlayInterfaceID = -1;
  12887. needDrawTabArea = true;
  12888. tabAreaAltered = true;
  12889. }
  12890. backDialogID = j9;
  12891. inputTaken = true;
  12892. openInterfaceID = -1;
  12893. aBoolean1149 = false;
  12894. pktType = -1;
  12895. return true;
  12896. }
  12897. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  12898. + anInt842 + "," + anInt843);
  12899. resetLogout();
  12900. } catch (IOException _ex) {
  12901. dropClient();
  12902. } catch (Exception exception) {
  12903. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  12904. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  12905. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12906. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12907. s2 = s2 + inStream.buffer[j15] + ",";
  12908.  
  12909. signlink.reporterror(s2);
  12910. resetLogout();
  12911. }
  12912. return true;
  12913. }
  12914.  
  12915. private void method146() {
  12916. anInt1265++;
  12917. method47(true);
  12918. method26(true);
  12919. method47(false);
  12920. method26(false);
  12921. method55();
  12922. method104();
  12923. if (!aBoolean1160) {
  12924. int i = anInt1184;
  12925. if (anInt984 / 256 > i)
  12926. i = anInt984 / 256;
  12927. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12928. i = anIntArray1203[4] + 128;
  12929. int k = minimapInt1 + anInt896 & 0x7ff;
  12930. setCameraPos(clientZoom + i * 3, i, anInt1014,
  12931. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12932. }
  12933. int j;
  12934. if (!aBoolean1160)
  12935. j = method120();
  12936. else
  12937. j = method121();
  12938. int l = xCameraPos;
  12939. int i1 = zCameraPos;
  12940. int j1 = yCameraPos;
  12941. int k1 = yCameraCurve;
  12942. int l1 = xCameraCurve;
  12943. for (int i2 = 0; i2 < 5; i2++)
  12944. if (aBooleanArray876[i2]) {
  12945. int j2 = (int) ((Math.random()
  12946. * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  12947. .sin((double) anIntArray1030[i2]
  12948. * ((double) anIntArray928[i2] / 100D))
  12949. * (double) anIntArray1203[i2]);
  12950. if (i2 == 0)
  12951. xCameraPos += j2;
  12952. if (i2 == 1)
  12953. zCameraPos += j2;
  12954. if (i2 == 2)
  12955. yCameraPos += j2;
  12956. if (i2 == 3)
  12957. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12958. if (i2 == 4) {
  12959. yCameraCurve += j2;
  12960. if (yCameraCurve < 128)
  12961. yCameraCurve = 128;
  12962. if (yCameraCurve > 383)
  12963. yCameraCurve = 383;
  12964. }
  12965. }
  12966.  
  12967. int k2 = Texture.anInt1481;
  12968. Model.aBoolean1684 = true;
  12969. Model.anInt1687 = 0;
  12970. Model.anInt1685 = super.mouseX - 4;
  12971. Model.anInt1686 = super.mouseY - 4;
  12972. DrawingArea.setAllPixelsToZero();
  12973. // xxx disables graphics if(graphicsEnabled){
  12974. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12975. worldController.clearObj5Cache();
  12976. updateEntities();
  12977. drawHeadIcon();
  12978. method37(k2);
  12979. draw3dScreen();
  12980. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12981. xCameraPos = l;
  12982. zCameraPos = i1;
  12983. yCameraPos = j1;
  12984. yCameraCurve = k1;
  12985. xCameraCurve = l1;
  12986. // }
  12987. }
  12988.  
  12989. private void clearTopInterfaces() {
  12990. stream.createFrame(130);
  12991. if (invOverlayInterfaceID != -1) {
  12992. invOverlayInterfaceID = -1;
  12993. needDrawTabArea = true;
  12994. aBoolean1149 = false;
  12995. tabAreaAltered = true;
  12996. }
  12997. if (backDialogID != -1) {
  12998. backDialogID = -1;
  12999. inputTaken = true;
  13000. aBoolean1149 = false;
  13001. }
  13002. openInterfaceID = -1;
  13003. }
  13004.  
  13005. public client() {
  13006. chatTypeView = 0;
  13007. chatRights = new int[500];
  13008. xpAddedPos = expAdded = 0;
  13009. xpCounter = 0;
  13010. chatTypeView = 0;
  13011. clanTitles = new String[500];
  13012. clanChatMode = 0;
  13013. cButtonHPos = -1;
  13014. cButtonHCPos = -1;
  13015. cButtonCPos = 0;
  13016. server = "127.0.0.1";
  13017. anIntArrayArray825 = new int[104][104];
  13018. friendsNodeIDs = new int[200];
  13019. groundArray = new NodeList[4][104][104];
  13020. aBoolean831 = false;
  13021. aStream_834 = new Stream(new byte[5000]);
  13022. npcArray = new NPC[16384];
  13023. npcIndices = new int[16384];
  13024. anIntArray840 = new int[1000];
  13025. aStream_847 = Stream.create();
  13026. aBoolean848 = true;
  13027. openInterfaceID = -1;
  13028. currentExp = new int[Skills.skillsCount];
  13029. aBoolean872 = false;
  13030. anIntArray873 = new int[5];
  13031. anInt874 = -1;
  13032. aBooleanArray876 = new boolean[5];
  13033. drawFlames = false;
  13034. reportAbuseInput = "";
  13035. unknownInt10 = -1;
  13036. menuOpen = false;
  13037. inputString = "";
  13038. maxPlayers = 2048;
  13039. myPlayerIndex = 2047;
  13040. playerArray = new Player[maxPlayers];
  13041. playerIndices = new int[maxPlayers];
  13042. anIntArray894 = new int[maxPlayers];
  13043. aStreamArray895s = new Stream[maxPlayers];
  13044. anInt897 = 1;
  13045. anIntArrayArray901 = new int[104][104];
  13046. anInt902 = 0x766654;
  13047. aByteArray912 = new byte[16384];
  13048. currentStats = new int[Skills.skillsCount];
  13049. ignoreListAsLongs = new long[100];
  13050. loadingError = false;
  13051. anInt927 = 0x332d25;
  13052. anIntArray928 = new int[5];
  13053. anIntArrayArray929 = new int[104][104];
  13054. chatTypes = new int[500];
  13055. chatNames = new String[500];
  13056. chatMessages = new String[500];
  13057. sideIcons = new Sprite[14];
  13058. redStones = new Sprite[14];
  13059. aBoolean954 = true;
  13060. friendsListAsLongs = new long[200];
  13061. currentSong = -1;
  13062. drawingFlames = false;
  13063. spriteDrawX = -1;
  13064. spriteDrawY = -1;
  13065. anIntArray968 = new int[33];
  13066. anIntArray969 = new int[256];
  13067. decompressors = new Decompressor[6];
  13068. variousSettings = new int[2000];
  13069. aBoolean972 = false;
  13070. anInt975 = 50;
  13071. anIntArray976 = new int[anInt975];
  13072. anIntArray977 = new int[anInt975];
  13073. anIntArray978 = new int[anInt975];
  13074. anIntArray979 = new int[anInt975];
  13075. anIntArray980 = new int[anInt975];
  13076. anIntArray981 = new int[anInt975];
  13077. anIntArray982 = new int[anInt975];
  13078. aStringArray983 = new String[anInt975];
  13079. anInt985 = -1;
  13080. hitMarks = new Sprite[20];
  13081. anIntArray990 = new int[5];
  13082. aBoolean994 = false;
  13083. anInt1002 = 0x23201b;
  13084. amountOrNameInput = "";
  13085. aClass19_1013 = new NodeList();
  13086. aBoolean1017 = false;
  13087. anInt1018 = -1;
  13088. anIntArray1030 = new int[5];
  13089. aBoolean1031 = false;
  13090. mapFunctions = new Sprite[100];
  13091. dialogID = -1;
  13092. maxStats = new int[Skills.skillsCount];
  13093. anIntArray1045 = new int[2000];
  13094. aBoolean1047 = true;
  13095. anIntArray1052 = new int[151];
  13096. anInt1054 = -1;
  13097. aClass19_1056 = new NodeList();
  13098. anIntArray1057 = new int[33];
  13099. aClass9_1059 = new RSInterface();
  13100. mapScenes = new Background[100];
  13101. barFillColor = 0x4d4233;
  13102. anIntArray1065 = new int[7];
  13103. anIntArray1072 = new int[1000];
  13104. anIntArray1073 = new int[1000];
  13105. aBoolean1080 = false;
  13106. friendsList = new String[200];
  13107. inStream = Stream.create();
  13108. expectedCRCs = new int[9];
  13109. menuActionCmd2 = new int[500];
  13110. menuActionCmd3 = new int[500];
  13111. menuActionID = new int[500];
  13112. menuActionCmd1 = new int[500];
  13113. headIcons = new Sprite[20];
  13114. skullIcons = new Sprite[20];
  13115. headIconsHint = new Sprite[20];
  13116. tabAreaAltered = false;
  13117. aString1121 = "";
  13118. atPlayerActions = new String[5];
  13119. atPlayerArray = new boolean[5];
  13120. anIntArrayArrayArray1129 = new int[4][13][13];
  13121. anInt1132 = 2;
  13122. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13123. aBoolean1141 = false;
  13124. aBoolean1149 = false;
  13125. crosses = new Sprite[8];
  13126. musicEnabled = true;
  13127. needDrawTabArea = false;
  13128. loggedIn = false;
  13129. canMute = false;
  13130. aBoolean1159 = false;
  13131. aBoolean1160 = false;
  13132. anInt1171 = 1;
  13133. myUsername = "";
  13134. myPassword = "";
  13135. genericLoadingError = false;
  13136. reportAbuseInterfaceID = -1;
  13137. aClass19_1179 = new NodeList();
  13138. anInt1184 = 128;
  13139. invOverlayInterfaceID = -1;
  13140. stream = Stream.create();
  13141. menuActionName = new String[500];
  13142. anIntArray1203 = new int[5];
  13143. anIntArray1207 = new int[50];
  13144. anInt1210 = 2;
  13145. anInt1211 = 78;
  13146. promptInput = "";
  13147. modIcons = new Sprite[11];
  13148. tabID = 3;
  13149. inputTaken = false;
  13150. songChanging = true;
  13151. anIntArray1229 = new int[151];
  13152. aClass11Array1230 = new Class11[4];
  13153. aBoolean1233 = false;
  13154. anIntArray1240 = new int[100];
  13155. anIntArray1241 = new int[50];
  13156. aBoolean1242 = false;
  13157. anIntArray1250 = new int[50];
  13158. rsAlreadyLoaded = false;
  13159. welcomeScreenRaised = false;
  13160. messagePromptRaised = false;
  13161. loginMessage1 = "";
  13162. loginMessage2 = "";
  13163. backDialogID = -1;
  13164. anInt1279 = 2;
  13165. bigX = new int[4000];
  13166. bigY = new int[4000];
  13167. anInt1289 = -1;
  13168. }
  13169.  
  13170. void mouseWheelDragged(int i, int j) {
  13171. if (!mouseWheelDown)
  13172. return;
  13173. this.anInt1186 += i * 3;
  13174. this.anInt1187 += (j << 1);
  13175. }
  13176.  
  13177. public int chatTypeView;
  13178. public int clanChatMode;
  13179. public String clanname;
  13180. private final int[] chatRights;
  13181. public int duelMode; /* Declare custom sprites */
  13182. /**
  13183. * Login spites
  13184. */
  13185. private Sprite background;
  13186. private Sprite loginBox;
  13187. private Sprite loginbar;
  13188. private Sprite loginbarHover;
  13189. private Sprite loginbar2;
  13190. private Sprite loginbar2Hover;
  13191. private Sprite loginButton;
  13192. private Sprite registerButton;
  13193. private Sprite loginButtonHover;
  13194. private Sprite registerButtonHover;
  13195. private Sprite forumButton;
  13196. private Sprite forumButtonHover;
  13197. private Sprite voteButton;
  13198. private Sprite voteButtonHover;
  13199. private Sprite storeButton;
  13200. private Sprite storeButtonHover;
  13201. private Sprite itemlistButton;
  13202. private Sprite itemlistButtonHover;
  13203. private Sprite logo;
  13204.  
  13205. private Sprite sIcon;
  13206.  
  13207. private Sprite[] ORBS = new Sprite[35];
  13208. private Sprite HPBarFull, HPBarEmpty;
  13209. private Sprite infinity;
  13210. private Sprite chatArea;
  13211. private Sprite chatButtons;
  13212. private Sprite chatButtonH;
  13213. private Sprite chatButtonHC;
  13214. private Sprite chatButtonC;
  13215. private Sprite reportH;
  13216. private Sprite tabArea;
  13217. private Sprite mapArea;
  13218. private Sprite logIconH;
  13219. private Sprite logIconC;
  13220. private Sprite emptyOrb;
  13221. private Sprite drainOrb;
  13222. private Sprite hitPointsFill;
  13223. private Sprite hitPointsIcon;
  13224. private Sprite prayerFill;
  13225. private Sprite prayerIcon;
  13226. private Sprite runFill; /**/
  13227. private RSImageProducer frame;
  13228. private int ignoreCount;
  13229. private long aLong824;
  13230. private int[][] anIntArrayArray825;
  13231. private int[] friendsNodeIDs;
  13232. private NodeList[][][] groundArray;
  13233. private int[] anIntArray828;
  13234. private int[] anIntArray829;
  13235. private volatile boolean aBoolean831;
  13236. private Socket aSocket832;
  13237. private int loginScreenState;
  13238. private Stream aStream_834;
  13239. private NPC[] npcArray;
  13240. private int npcCount;
  13241. private int[] npcIndices;
  13242. private int anInt839;
  13243. private int[] anIntArray840;
  13244. private int anInt841;
  13245. private int anInt842;
  13246. private int anInt843;
  13247. private String aString844;
  13248. private int privateChatMode;
  13249. private Stream aStream_847;
  13250. private boolean aBoolean848;
  13251. private static int anInt849;
  13252. private int[] anIntArray850;
  13253. private int[] anIntArray851;
  13254. private int[] anIntArray852;
  13255. private int[] anIntArray853;
  13256. private static int anInt854;
  13257. private int anInt855;
  13258. public static int openInterfaceID;
  13259. private int xCameraPos;
  13260. private int zCameraPos;
  13261. private int yCameraPos;
  13262. private int yCameraCurve;
  13263. private int xCameraCurve;
  13264. private int myPrivilege;
  13265. private final int[] currentExp;
  13266. private Sprite[] redStones;
  13267. private Sprite mapFlag;
  13268. private Sprite mapMarker;
  13269. private boolean aBoolean872;
  13270. private final int[] anIntArray873;
  13271. private int anInt874;
  13272. private final boolean[] aBooleanArray876;
  13273. private int weight;
  13274. private MouseDetection mouseDetection;
  13275. private volatile boolean drawFlames;
  13276. private String reportAbuseInput;
  13277. private int unknownInt10;
  13278. private boolean menuOpen;
  13279. private int anInt886;
  13280. private String inputString;
  13281. private final int maxPlayers;
  13282. private final int myPlayerIndex;
  13283. private Player[] playerArray;
  13284. private int playerCount;
  13285. private int[] playerIndices;
  13286. private int anInt893;
  13287. private int[] anIntArray894;
  13288. private Stream[] aStreamArray895s;
  13289. private int anInt896;
  13290. private int anInt897;
  13291. private int friendsCount;
  13292. private int anInt900;
  13293. private int[][] anIntArrayArray901;
  13294. private final int anInt902;
  13295. private byte[] aByteArray912;
  13296. private int anInt913;
  13297. private int crossX;
  13298. private int crossY;
  13299. private int crossIndex;
  13300. private int crossType;
  13301. private int plane;
  13302. private final int[] currentStats;
  13303. private static int anInt924;
  13304. private final long[] ignoreListAsLongs;
  13305. private boolean loadingError;
  13306. private final int anInt927;
  13307. private final int[] anIntArray928;
  13308. private int[][] anIntArrayArray929;
  13309. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  13310. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  13311. private int anInt933;
  13312. private int anInt934;
  13313. private int anInt935;
  13314. private int anInt936;
  13315. private int anInt937;
  13316. private int anInt938;
  13317. private static int anInt940;
  13318. private final int[] chatTypes;
  13319. private final String[] chatNames;
  13320. private final String[] chatMessages;
  13321. private int anInt945;
  13322. private WorldController worldController;
  13323. private Sprite[] sideIcons;
  13324. private int menuScreenArea;
  13325. private int menuOffsetX;
  13326. private int menuOffsetY;
  13327. private int menuWidth;
  13328. private int anInt952;
  13329. private long aLong953;
  13330. private boolean aBoolean954;
  13331. private long[] friendsListAsLongs;
  13332. private int currentSong;
  13333. private static int nodeID = 10;
  13334. static int portOff;
  13335. static boolean clientData;
  13336. private static boolean isMembers = true;
  13337. private static boolean lowMem;
  13338. private volatile boolean drawingFlames;
  13339. private int spriteDrawX;
  13340. private int spriteDrawY;
  13341. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  13342. 0xff00ff, 0xffffff };
  13343. private Background aBackground_966;
  13344. private Background aBackground_967;
  13345. private final int[] anIntArray968;
  13346. private final int[] anIntArray969;
  13347. final Decompressor[] decompressors;
  13348. public int variousSettings[];
  13349. private boolean aBoolean972;
  13350. private final int anInt975;
  13351. private final int[] anIntArray976;
  13352. private final int[] anIntArray977;
  13353. private final int[] anIntArray978;
  13354. private final int[] anIntArray979;
  13355. private final int[] anIntArray980;
  13356. private final int[] anIntArray981;
  13357. private final int[] anIntArray982;
  13358. private final String[] aStringArray983;
  13359. private int anInt984;
  13360. private int anInt985;
  13361. private static int anInt986;
  13362. private Sprite[] hitMarks;
  13363. private int anInt988;
  13364. private int anInt989;
  13365. private final int[] anIntArray990;
  13366. private static boolean aBoolean993;
  13367. private final boolean aBoolean994;
  13368. private int anInt995;
  13369. private int anInt996;
  13370. private int anInt997;
  13371. private int anInt998;
  13372. private int anInt999;
  13373. private ISAACRandomGen encryption;
  13374. private Sprite mapEdge;
  13375. private Sprite multiOverlay;
  13376. private final int anInt1002;
  13377. static final int[][] anIntArrayArray1003 = {
  13378. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  13379. 54193 },
  13380. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13381. 56621, 4783, 1341, 16578, 35003, 25239 },
  13382. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13383. 10153, 56621, 4783, 1341, 16578, 35003 },
  13384. { 4626, 11146, 6439, 12, 4758, 10270 },
  13385. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  13386. private String amountOrNameInput;
  13387. private static int anInt1005;
  13388. private int daysSinceLastLogin;
  13389. private int pktSize;
  13390. private int pktType;
  13391. private int anInt1009;
  13392. private int anInt1010;
  13393. private int anInt1011;
  13394. private NodeList aClass19_1013;
  13395. private int anInt1014;
  13396. private int anInt1015;
  13397. private int anInt1016;
  13398. private boolean aBoolean1017;
  13399. private int anInt1018;
  13400. private static final int[] anIntArray1019;
  13401. private int anInt1021;
  13402. private int anInt1022;
  13403. private int loadingStage;
  13404. private Background scrollBar1;
  13405. private Background scrollBar2;
  13406. private int anInt1026;
  13407. private Background backBase1;
  13408. private Background backBase2;
  13409. private Background backHmid1;
  13410. private final int[] anIntArray1030;
  13411. private boolean aBoolean1031;
  13412. private Sprite[] mapFunctions;
  13413. private int baseX;
  13414. private int baseY;
  13415. private int anInt1036;
  13416. private int anInt1037;
  13417. private int loginFailures;
  13418. private int anInt1039;
  13419. private int anInt1040;
  13420. private int anInt1041;
  13421. private int dialogID;
  13422. private final int[] maxStats;
  13423. private final int[] anIntArray1045;
  13424. private int anInt1046;
  13425. private boolean aBoolean1047;
  13426. private int anInt1048;
  13427. private String aString1049;
  13428. private static int anInt1051;
  13429. private final int[] anIntArray1052;
  13430. private StreamLoader titleStreamLoader;
  13431. private int anInt1054;
  13432. private int anInt1055;
  13433. private NodeList aClass19_1056;
  13434. private final int[] anIntArray1057;
  13435. public final RSInterface aClass9_1059;
  13436. private Background[] mapScenes;
  13437. private static int anInt1061;
  13438. private int anInt1062;
  13439. private final int barFillColor;
  13440. private int friendsListAction;
  13441. private final int[] anIntArray1065;
  13442. private int mouseInvInterfaceIndex;
  13443. private int lastActiveInvInterface;
  13444. public static OnDemandFetcher onDemandFetcher;
  13445. private int anInt1069;
  13446. private int anInt1070;
  13447. private int anInt1071;
  13448. private int[] anIntArray1072;
  13449. private int[] anIntArray1073;
  13450. private Sprite mapDotItem;
  13451. private Sprite mapDotNPC;
  13452. private Sprite mapDotPlayer;
  13453. private Sprite mapDotFriend;
  13454. private Sprite mapDotTeam;
  13455. private int anInt1079;
  13456. private boolean aBoolean1080;
  13457. private String[] friendsList;
  13458. private Stream inStream;
  13459. private int anInt1084;
  13460. private int anInt1085;
  13461. private int activeInterfaceType;
  13462. private int anInt1087;
  13463. private int anInt1088;
  13464. public static int anInt1089;
  13465. private final int[] expectedCRCs;
  13466. private int[] menuActionCmd2;
  13467. private int[] menuActionCmd3;
  13468. private int[] menuActionID;
  13469. private int[] menuActionCmd1;
  13470. private Sprite[] headIcons;
  13471. private Sprite[] skullIcons;
  13472. private Sprite[] headIconsHint;
  13473. private static int anInt1097;
  13474. private int anInt1098;
  13475. private int anInt1099;
  13476. private int anInt1100;
  13477. private int anInt1101;
  13478. private int anInt1102;
  13479. public static boolean tabAreaAltered;
  13480. private int anInt1104;
  13481. private RSImageProducer aRSImageProducer_1107;
  13482. private RSImageProducer aRSImageProducer_1108;
  13483. private RSImageProducer aRSImageProducer_1109;
  13484. private RSImageProducer aRSImageProducer_1110;
  13485. private RSImageProducer aRSImageProducer_1111;
  13486. private RSImageProducer aRSImageProducer_1112;
  13487. private RSImageProducer aRSImageProducer_1113;
  13488. private RSImageProducer aRSImageProducer_1114;
  13489. private RSImageProducer aRSImageProducer_1115;
  13490. private static int anInt1117;
  13491. private int membersInt;
  13492. private String aString1121;
  13493. private Sprite compass;
  13494. private RSImageProducer aRSImageProducer_1123;
  13495. private RSImageProducer aRSImageProducer_1124;
  13496. private RSImageProducer aRSImageProducer_1125;
  13497. public static Player myPlayer;
  13498. private final String[] atPlayerActions;
  13499. private final boolean[] atPlayerArray;
  13500. private final int[][][] anIntArrayArrayArray1129;
  13501. public final static int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1,
  13502. -1, -1, -1, -1, -1, -1, -1, -1 };
  13503. private int anInt1131;
  13504. private int anInt1132;
  13505. private int menuActionRow;
  13506. private static int anInt1134;
  13507. private int spellSelected;
  13508. private int anInt1137;
  13509. private int spellUsableOn;
  13510. private String spellTooltip;
  13511. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  13512. private boolean aBoolean1141;
  13513. private static int anInt1142;
  13514. private int energy;
  13515. private boolean aBoolean1149;
  13516. private Sprite[] crosses;
  13517. private boolean musicEnabled;
  13518. private Background[] aBackgroundArray1152s;
  13519. public static boolean needDrawTabArea;
  13520. private int unreadMessages;
  13521. private static int anInt1155;
  13522. private static boolean fpsOn;
  13523. public boolean loggedIn;
  13524. private boolean canMute;
  13525. private boolean aBoolean1159;
  13526. private boolean aBoolean1160;
  13527. static int loopCycle;
  13528. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  13529. private RSImageProducer aRSImageProducer_1163;
  13530. private RSImageProducer aRSImageProducer_1164;
  13531. private RSImageProducer aRSImageProducer_1165;
  13532. private RSImageProducer aRSImageProducer_1166;
  13533. private int daysSinceRecovChange;
  13534. private RSSocket socketStream;
  13535. private int anInt1169;
  13536. private int minimapInt3;
  13537. private int anInt1171;
  13538. private long aLong1172;
  13539. private String myUsername;
  13540. private String myPassword;
  13541. private static int anInt1175;
  13542. private boolean genericLoadingError;
  13543. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  13544. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  13545. private int reportAbuseInterfaceID;
  13546. private NodeList aClass19_1179;
  13547. private int[] anIntArray1180;
  13548. private int[] anIntArray1181;
  13549. private int[] anIntArray1182;
  13550. private byte[][] aByteArrayArray1183;
  13551. private int anInt1184;
  13552. private int minimapInt1;
  13553. private int anInt1186;
  13554. private int anInt1187;
  13555. private static int anInt1188;
  13556. private int invOverlayInterfaceID;
  13557. private int[] anIntArray1190;
  13558. private int[] anIntArray1191;
  13559. private Stream stream;
  13560. private int anInt1193;
  13561. private int splitPrivateChat;
  13562. private Background mapBack;
  13563. private String[] menuActionName;
  13564. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  13565. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  13566. private final int[] anIntArray1203;
  13567. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  13568. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  13569. private static boolean flagged;
  13570. private final int[] anIntArray1207;
  13571. private int anInt1208;
  13572. private int minimapInt2;
  13573. private int anInt1210;
  13574. public static int anInt1211;
  13575. private String promptInput;
  13576. private int anInt1213;
  13577. private int[][][] intGroundArray;
  13578. private long aLong1215;
  13579. private int loginScreenCursorPos;
  13580. private final Sprite[] modIcons;
  13581. private long aLong1220;
  13582. public static int tabID;
  13583. private int anInt1222;
  13584. public static boolean inputTaken;
  13585. private int inputDialogState;
  13586. private static int anInt1226;
  13587. private int nextSong;
  13588. private boolean songChanging;
  13589. private final int[] anIntArray1229;
  13590. private Class11[] aClass11Array1230;
  13591. public static int anIntArray1232[];
  13592. private boolean aBoolean1233;
  13593. private int[] anIntArray1234;
  13594. private int[] anIntArray1235;
  13595. private int[] anIntArray1236;
  13596. private int anInt1237;
  13597. private int anInt1238;
  13598. public final int anInt1239 = 100;
  13599. private final int[] anIntArray1240;
  13600. private final int[] anIntArray1241;
  13601. private boolean aBoolean1242;
  13602. private int atInventoryLoopCycle;
  13603. private int atInventoryInterface;
  13604. private int atInventoryIndex;
  13605. private int atInventoryInterfaceType;
  13606. private byte[][] aByteArrayArray1247;
  13607. private int tradeMode;
  13608. private int anInt1249;
  13609. private final int[] anIntArray1250;
  13610. private int anInt1251;
  13611. private final boolean rsAlreadyLoaded;
  13612. private int anInt1253;
  13613. private int anInt1254;
  13614. private boolean welcomeScreenRaised;
  13615. private boolean messagePromptRaised;
  13616. private int anInt1257;
  13617. private byte[][][] byteGroundArray;
  13618. private int prevSong;
  13619. private int destX;
  13620. private int destY;
  13621. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  13622. private int anInt1264;
  13623. private int anInt1265;
  13624. private String loginMessage1;
  13625. private String loginMessage2;
  13626. private int anInt1268;
  13627. private int anInt1269;
  13628. private TextDrawingArea smallText;
  13629. private TextDrawingArea aTextDrawingArea_1271;
  13630. private TextDrawingArea chatTextDrawingArea;
  13631. public RSFont newSmallFont;
  13632. public RSFont newRegularFont;
  13633. public RSFont newBoldFont;
  13634. public RSFont newFancyFont;
  13635. private int anInt1275;
  13636. private int backDialogID;
  13637. private int anInt1278;
  13638. private int anInt1279;
  13639. private int[] bigX;
  13640. private int[] bigY;
  13641. private int itemSelected;
  13642. private int anInt1283;
  13643. private int anInt1284;
  13644. private int anInt1285;
  13645. private String selectedItemName;
  13646. private int publicChatMode;
  13647. private static int anInt1288;
  13648. private int anInt1289;
  13649. public static int anInt1290;
  13650. public static String server = "104.148.75.11";
  13651. public static int MapX;
  13652. public static int MapY;
  13653. public static int mapX;
  13654. public static int mapY;
  13655. private String[] clanList = new String[100];
  13656.  
  13657. public void launchURL(String url) {
  13658. String osName = System.getProperty("os.name");
  13659. try {
  13660. if (osName.startsWith("Mac OS")) {
  13661. @SuppressWarnings("rawtypes")
  13662. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  13663. @SuppressWarnings("unchecked")
  13664. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] { String.class });
  13665. openURL.invoke(null, new Object[] { url });
  13666. } else if (osName.startsWith("Windows")) {
  13667. Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
  13668. if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
  13669. try {
  13670. desktop.browse(new URL(url).toURI());
  13671. } catch (Exception e) {
  13672. e.printStackTrace();
  13673. }
  13674. }
  13675. } else { // assume Unix or Linux
  13676. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  13677. String browser = null;
  13678. for (int count = 0; count < browsers.length && browser == null; count++)
  13679. if (Runtime.getRuntime()
  13680. .exec(new String[] { "which", browsers[count] })
  13681. .waitFor() == 0)
  13682. browser = browsers[count];
  13683. if (browser == null) {
  13684. throw new Exception("Could not find web browser");
  13685. } else
  13686. Runtime.getRuntime().exec(new String[] { browser, url });
  13687. }
  13688. } catch (Exception e) {
  13689. pushMessage("Failed to open URL.", 0, "");
  13690. }
  13691. }
  13692.  
  13693. static {
  13694. anIntArray1019 = new int[99];
  13695. int i = 0;
  13696. for (int j = 0; j < 99; j++) {
  13697. int l = j + 1;
  13698. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  13699. i += i1;
  13700. anIntArray1019[j] = i / 4;
  13701. }
  13702.  
  13703. anIntArray1232 = new int[32];
  13704. i = 2;
  13705. for (int k = 0; k < 32; k++) {
  13706. anIntArray1232[k] = i - 1;
  13707. i += i;
  13708. }
  13709.  
  13710. }
  13711.  
  13712. private void drawXpCounterBar() {
  13713. int xModified1 = 0;
  13714. int xModified2 = -11;
  13715. int x = 500;
  13716. int y = 46;
  13717. int i = aTextDrawingArea_1271.getTextWidth(Integer
  13718. .toString(currentXPTotal))
  13719. - aTextDrawingArea_1271.getTextWidth(Integer
  13720. .toString(currentXPTotal)) / 2;
  13721. y = 65;
  13722. x = 483 + xModified1;
  13723. y = -6;
  13724. if (expAdded <= 0) {
  13725. expAdded = 0;
  13726. }
  13727. if (currentXP < 0) {
  13728. currentXP = 0;
  13729. }
  13730. if (currentXP > 0 && System.currentTimeMillis() - timeXpReceived > 150) {
  13731. if (forceResetXp) {
  13732. xpAddedPos = 73;
  13733. expAdded = 0;
  13734. xpFloatingTime = 0;
  13735. forceResetXp = false;
  13736. }
  13737. newSmallFont.drawBasicString("+"
  13738. + NumberFormat.getIntegerInstance().format(currentXP), x
  13739. + 4 + xModified2, y + 48 + xpAddedPos, 0xffffff, -1);
  13740. if (xpAddedPos > 0) {
  13741. xpAddedPos -= 1;
  13742. }
  13743. if (xpAddedPos == 0) {
  13744. if (xpFloatingTime == 0) {
  13745. xpFloatingTime = System.currentTimeMillis();
  13746. }
  13747. if (System.currentTimeMillis() - xpFloatingTime > 600) {
  13748. xpAddedPos = 0;
  13749. expAdded = 0;
  13750. currentXP = 0;
  13751. xpFloatingTime = 0;
  13752.  
  13753. }
  13754. }
  13755. }
  13756. ORBS[32].drawTransparentSprite(x - 93 + xModified1, y + 8, 150);
  13757. ORBS[33].draw24BitSprite(x - 91 + xModified1, y + 11);
  13758. if (xpCounter < 0) {
  13759. xpCounter = 0;
  13760. }
  13761. int positionX = x - 1 - i;
  13762. int positionY = y + 21;
  13763. positionX = x + 22 - i;
  13764. positionY = y + 26;
  13765. if (xpCounter <= Integer.MAX_VALUE
  13766. && System.currentTimeMillis() - timeXpReceived > 150) {
  13767. smallText.method382(0xFFFFFD, positionX + xModified1, NumberFormat
  13768. .getIntegerInstance().format(xpCounter), positionY, true);
  13769. currentXPTotal = xpCounter;
  13770. } else if (xpCounter >= Integer.MAX_VALUE) {
  13771. smallText.method382(0xFF0000, positionX + xModified1, "Lots!",
  13772. positionY, true);
  13773. } else if (xpCounter <= Integer.MAX_VALUE) {
  13774. smallText.method382(0xFFFFFD, positionX + xModified1, NumberFormat
  13775. .getIntegerInstance().format(currentXPTotal), positionY,
  13776. true);
  13777. }
  13778. }
  13779. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement