Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 413.44 KB | None | 0 0
  1. import java.applet.AppletContext;
  2. import java.awt.*;
  3. import java.io.*;
  4. import java.net.*;
  5. import java.text.DecimalFormat;
  6. import java.text.NumberFormat;
  7. import java.lang.reflect.Method;
  8.  
  9. import sign.signlink;
  10.  
  11. import javax.swing.*;
  12.  
  13. public class client extends RSApplet {
  14.  
  15. private static final long serialVersionUID = 1L;
  16.  
  17. private boolean revision474;
  18. private boolean revision498;
  19. private boolean revision508;
  20. private boolean OSOrbs;
  21.  
  22. private static String intToKOrMilLongName(int i) {
  23. String s = String.valueOf(i);
  24. for (int k = s.length() - 3; k > 0; k -= 3)
  25. s = s.substring(0, k) + "," + s.substring(k);
  26. if (s.length() > 8)
  27. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  28. + s + ")";
  29. else if (s.length() > 4)
  30. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  31. return " " + s;
  32. }
  33.  
  34. private static String intToKOrMil(int j) {
  35. if (j < 0x186a0)
  36. return String.valueOf(j);
  37. if (j < 0x989680)
  38. return j / 1000 + "K";
  39. else
  40. return j / 0xf4240 + "M";
  41. }
  42.  
  43. public final String titleColor(final int i, int type) {
  44. String titleChatbox = "", titleRightclick = "";
  45. switch (i) {
  46.  
  47. case 0: // orange
  48. titleChatbox = "A67711";
  49. titleRightclick = "or0";
  50. break;
  51.  
  52. case 1: // purple
  53. titleChatbox = "FF00CD";
  54. titleRightclick = "pur";
  55. break;
  56.  
  57. case 2: // red
  58. titleChatbox = "ff0000";
  59. titleRightclick = "red";
  60. break;
  61.  
  62. case 3: // green
  63. titleChatbox = "148200";
  64. titleRightclick = "gr0";
  65. break;
  66.  
  67. case 4: // black
  68. titleChatbox = "0";
  69. titleRightclick = "bla";
  70. break;
  71.  
  72. case 5: // yellow
  73. titleChatbox = "ffff00";
  74. titleRightclick = "yel";
  75. break;
  76.  
  77. case 6: // cyan
  78. titleChatbox = "65535";
  79. titleRightclick = "cya";
  80. break;
  81.  
  82. case 7: // white
  83. titleChatbox = "ffffff";
  84. titleRightclick = "whi";
  85. break;
  86. }
  87. if (type == 0)
  88. return titleChatbox;
  89. else
  90. return titleRightclick;
  91. }
  92.  
  93. public void stopMidi() {
  94. signlink.midifade = 0;
  95. signlink.midi = "stop";
  96. }
  97.  
  98. public Sprite[] chatImages = new Sprite[2];
  99. public static int spellID = 0;
  100. public int MapX, MapY;
  101.  
  102.  
  103. public static void setTab(int id) {
  104. needDrawTabArea = true;
  105. tabID = id;
  106. tabAreaAltered = true;
  107. }
  108.  
  109. private boolean menuHasAddFriend(int j) {
  110. if (j < 0)
  111. return false;
  112. int k = menuActionID[j];
  113. if (k >= 2000)
  114. k -= 2000;
  115. return k == 337;
  116. }
  117.  
  118. public void drawChannelButtons() {
  119. String text[] = { "On", "Friends", "Off", "Hide" };
  120. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  121. switch (cButtonCPos) {
  122. case 0:
  123. chatButtons[1].drawSprite(5, 142);
  124. break;
  125. case 1:
  126. chatButtons[1].drawSprite(71, 142);
  127. break;
  128. case 2:
  129. chatButtons[1].drawSprite(137, 142);
  130. break;
  131. case 3:
  132. chatButtons[1].drawSprite(203, 142);
  133. break;
  134. case 4:
  135. chatButtons[1].drawSprite(269, 142);
  136. break;
  137. case 5:
  138. chatButtons[1].drawSprite(335, 142);
  139. break;
  140. }
  141. if (cButtonHPos == cButtonCPos) {
  142. switch (cButtonHPos) {
  143. case 0:
  144. chatButtons[2].drawSprite(5, 142);
  145. break;
  146. case 1:
  147. chatButtons[2].drawSprite(71, 142);
  148. break;
  149. case 2:
  150. chatButtons[2].drawSprite(137, 142);
  151. break;
  152. case 3:
  153. chatButtons[2].drawSprite(203, 142);
  154. break;
  155. case 4:
  156. chatButtons[2].drawSprite(269, 142);
  157. break;
  158. case 5:
  159. chatButtons[2].drawSprite(335, 142);
  160. break;
  161. case 6:
  162. chatButtons[3].drawSprite(404, 142);
  163. break;
  164. }
  165. } else {
  166. switch (cButtonHPos) {
  167. case 0:
  168. chatButtons[0].drawSprite(5, 142);
  169. break;
  170. case 1:
  171. chatButtons[0].drawSprite(71, 142);
  172. break;
  173. case 2:
  174. chatButtons[0].drawSprite(137, 142);
  175. break;
  176. case 3:
  177. chatButtons[0].drawSprite(203, 142);
  178. break;
  179. case 4:
  180. chatButtons[0].drawSprite(269, 142);
  181. break;
  182. case 5:
  183. chatButtons[0].drawSprite(335, 142);
  184. break;
  185. case 6:
  186. chatButtons[3].drawSprite(404, 142);
  187. break;
  188. }
  189. }
  190. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  191. smallText.method389(true, 26, 0xffffff, "All", 157);
  192. smallText.method389(true, 86, 0xffffff, "Game", 157);
  193. smallText.method389(true, 150, 0xffffff, "Public", 152);
  194. smallText.method389(true, 212, 0xffffff, "Private", 152);
  195. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  196. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  197. smallText.method382(textColor[publicChatMode], 164,
  198. text[publicChatMode], 163, true);
  199. smallText.method382(textColor[privateChatMode], 230,
  200. text[privateChatMode], 163, true);
  201. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode],
  202. 163, true);
  203. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163,
  204. true);
  205. }
  206.  
  207. private void drawChatArea() {
  208. aRSImageProducer_1166.initDrawingArea();
  209. Texture.anIntArray1472 = anIntArray1180;
  210. chatArea.drawSprite(0, 0);
  211. drawChannelButtons();
  212. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  213. if (messagePromptRaised) {
  214. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  215. newBoldFont.drawCenteredString(promptInput + "*", 259, 80, 128, -1);
  216. } else if (inputDialogState == 1) {
  217. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  218. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  219. 128, -1);
  220. } else if (inputDialogState == 2) {
  221. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  222. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  223. 128, -1);
  224. } else if (aString844 != null) {
  225. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  226. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128,
  227. -1);
  228. } else if (backDialogID != -1) {
  229. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  230. } else if (dialogID != -1) {
  231. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  232. } else {
  233. int j77 = -3;
  234. int j = 0;
  235. DrawingArea.setDrawingArea(122, 8, 497, 7);
  236. for (int k = 0; k < 500; k++)
  237. if (chatMessages[k] != null) {
  238. int chatType = chatTypes[k];
  239. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  240. String s1 = chatNames[k];
  241. byte byte0 = 0;
  242. if (s1 != null && s1.startsWith("@cr1@")) {
  243. s1 = s1.substring(5);
  244. byte0 = 1;
  245. } else if (s1 != null && s1.startsWith("@cr2@")) {
  246. s1 = s1.substring(5);
  247. byte0 = 2;
  248. } else if (s1 != null && s1.startsWith("@cr3@")) {
  249. s1 = s1.substring(5);
  250. byte0 = 3;
  251. } else if (s1 != null && s1.startsWith("@cr4@")) {
  252. s1 = s1.substring(5);
  253. byte0 = 4;
  254. } else if (s1 != null && s1.startsWith("@cr5@")) {
  255. s1 = s1.substring(5);
  256. byte0 = 5;
  257. } else if (s1 != null && s1.startsWith("@cr6@")) {
  258. s1 = s1.substring(5);
  259. byte0 = 6;
  260. }
  261. if (chatType == 0) {
  262. if (chatTypeView == 5 || chatTypeView == 0) {
  263. if (yPos > 0 && yPos < 210)
  264. // textDrawingArea.method389(false, 11, 0,
  265. // chatMessages[k], yPos);//chat color enabled
  266. newRegularFont.drawBasicString(chatMessages[k],
  267. 11, yPos, 0, -1);
  268. j++;
  269. j77++;
  270. }
  271. }
  272. if ((chatType == 1 || chatType == 2)
  273. && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1
  274. && isFriendOrSelf(s1))) {
  275. if (chatTypeView == 1 || chatTypeView == 0) {
  276. if (yPos > 0 && yPos < 210) {
  277. int xPos = 11;
  278. if (byte0 == 1) {
  279. modIcons[0].drawSprite(xPos + 1, yPos - 11);
  280. xPos += 14;
  281. } else if (byte0 == 2) {
  282. modIcons[2].drawSprite(xPos, yPos - 13);
  283. xPos += 14;
  284. } else if (byte0 == 3) {
  285. modIcons[1].drawSprite(xPos + 1, yPos - 11);
  286. xPos += 14;
  287. } else if (byte0 == 4) {
  288. modIcons[3].drawSprite(xPos + 1, yPos - 10);
  289. xPos += 14;
  290. } else if (byte0 == 5) {
  291. modIcons[4].drawSprite(xPos + 1, yPos - 10);
  292. xPos += 14;
  293. } else if (byte0 == 6) {
  294. modIcons[5].drawSprite(xPos + 1, yPos - 10);
  295. xPos += 14;
  296. }
  297. newRegularFont.drawBasicString(s1 + ":", xPos,
  298. yPos, 0, -1);
  299. xPos += newRegularFont.getTextWidth(s1) + 8;
  300. newRegularFont.drawBasicString(chatMessages[k],
  301. xPos, yPos, 255, -1);
  302. }
  303. j++;
  304. j77++;
  305. }
  306. }
  307. if ((chatType == 3 || chatType == 7)
  308. && (splitPrivateChat == 0 || chatTypeView == 2)
  309. && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1
  310. && isFriendOrSelf(s1))) {
  311. if (chatTypeView == 2 || chatTypeView == 0) {
  312. if (yPos > 0 && yPos < 210) {
  313. int k1 = 11;
  314. newRegularFont.drawBasicString("From", k1,
  315. yPos, 0, -1);
  316. if (byte0 == 3 || byte0 == 2 || byte0 == 1
  317. || byte0 == 0) {
  318. k1 += textDrawingArea.getTextWidth("From ");
  319. } else if (byte0 == 6 || byte0 == 5
  320. || byte0 == 4) {
  321. k1 += textDrawingArea.getTextWidth("From");
  322. }
  323. if (byte0 == 1) {
  324. modIcons[0].drawSprite(k1 - 1, yPos - 11);
  325. k1 += 12;
  326. } else if (byte0 == 2) {
  327. modIcons[2].drawSprite(k1 - 2, yPos - 13);
  328. k1 += 12;
  329. } else if (byte0 == 3) {
  330. modIcons[1].drawSprite(k1 - 1, yPos - 11);
  331. k1 += 12;
  332. } else if (byte0 == 4) {
  333. modIcons[3].drawSprite(k1, yPos - 10);
  334. k1 += 12;
  335. } else if (byte0 == 5) {
  336. modIcons[4].drawSprite(k1, yPos - 10);
  337. k1 += 12;
  338. } else if (byte0 == 6) {
  339. modIcons[5].drawSprite(k1, yPos - 10);
  340. k1 += 12;
  341. }
  342. newRegularFont.drawBasicString(s1 + ":", k1,
  343. yPos, 0, -1);
  344. k1 += newRegularFont.getTextWidth(s1) + 8;
  345. newRegularFont.drawBasicString(chatMessages[k],
  346. k1, yPos, 0x800000, -1);
  347. }
  348. j++;
  349. j77++;
  350. }
  351. }
  352. if (chatType == 4
  353. && (tradeMode == 0 || tradeMode == 1
  354. && isFriendOrSelf(s1))) {
  355. if (chatTypeView == 3 || chatTypeView == 0) {
  356. if (yPos > 0 && yPos < 210)
  357. newRegularFont.drawBasicString(s1 + " "
  358. + chatMessages[k], 11, yPos, 0x800080,
  359. -1);
  360. j++;
  361. j77++;
  362. }
  363. }
  364. if (chatType == 5 && splitPrivateChat == 0
  365. && privateChatMode < 2) {
  366. if (chatTypeView == 2 || chatTypeView == 0) {
  367. if (yPos > 0 && yPos < 210)
  368. newRegularFont.drawBasicString(chatMessages[k],
  369. 11, yPos, 0x800000, -1);
  370. j++;
  371. j77++;
  372. }
  373. }
  374. if (chatType == 6
  375. && (splitPrivateChat == 0 || chatTypeView == 2)
  376. && privateChatMode < 2) {
  377. if (chatTypeView == 2 || chatTypeView == 0) {
  378. if (yPos > 0 && yPos < 210) {
  379. newRegularFont.drawBasicString(
  380. "To " + s1 + ":", 11, yPos, 0, -1);
  381. newRegularFont.drawBasicString(
  382. chatMessages[k],
  383. 15 + newRegularFont.getTextWidth("To :"
  384. + s1), yPos, 0x800000, -1);
  385. }
  386. j++;
  387. j77++;
  388. }
  389. }
  390. if (chatType == 8
  391. && (tradeMode == 0 || tradeMode == 1
  392. && isFriendOrSelf(s1))) {
  393. if (chatTypeView == 3 || chatTypeView == 0) {
  394. if (yPos > 0 && yPos < 210)
  395. newRegularFont.drawBasicString(s1 + " "
  396. + chatMessages[k], 11, yPos, 0x7e3200,
  397. -1);
  398. j++;
  399. j77++;
  400. }
  401. if (chatType == 11 && (clanChatMode == 0)) {
  402. if (chatTypeView == 11) {
  403. if (yPos > 0 && yPos < 110)
  404. newRegularFont.drawBasicString(s1 + " "
  405. + chatMessages[k], 19, yPos,
  406. 0x7e3200, -1);
  407. j++;
  408. j77++;
  409. }
  410. }
  411. if (chatType == 12) {
  412. if (chatTypeView == 11 || chatTypeView == 0) {
  413. if (yPos > 3 && yPos < 130) {
  414. String title = "<col=0000FF>"
  415. + clanTitles[k] + "</col>";
  416. String username = (chatRights[k] > 0 ? "<img="
  417. + (chatRights[k] - 1) + ">"
  418. : "")
  419. + TextClass.fixName(chatNames[k]);
  420. String message = "<col=800000>"
  421. + chatMessages[k] + "</col>";
  422. newRegularFont.drawBasicString("[" + title
  423. + "] " + username + ": " + message,
  424. 11, yPos, 0, -1);
  425. }
  426. j++;
  427. j77++;
  428. }
  429. }
  430. }
  431. if (chatType == 16) {
  432. int j2 = 40 + 11;
  433. int clanNameWidth = textDrawingArea
  434. .getTextWidth(clanname);
  435. if (chatTypeView == 11 || chatTypeView == 0) {
  436. if (yPos > 0 && yPos < 110)
  437. switch (chatRights[k]) {
  438. case 1:
  439. j2 += clanNameWidth;
  440. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  441. j2 += 15;
  442. break;
  443. case 2:
  444. j2 += clanNameWidth;
  445. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  446. j2 += 15;
  447. break;
  448. case 3:
  449. j2 += clanNameWidth;
  450. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  451. j2 += 15;
  452. break;
  453. case 4:
  454. j2 += clanNameWidth;
  455. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  456. j2 += 15;
  457. break;
  458. default:
  459. j2 += clanNameWidth;
  460. break;
  461. }
  462. newRegularFont
  463. .drawBasicString("[", 19, yPos, 0, -1);
  464. newRegularFont.drawBasicString("]",
  465. clanNameWidth + 16 + 11, yPos, 0, -1);
  466. newRegularFont.drawBasicString(""
  467. + capitalize(clanname) + "", 25, yPos, 255,
  468. -1);
  469. newRegularFont.drawBasicString(
  470. capitalize(chatNames[k]) + ":", j2 - 17,
  471. yPos);
  472. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  473. newRegularFont.drawBasicString(
  474. capitalize(chatMessages[k]), j2 - 16, yPos,
  475. 0x800000, -1);
  476.  
  477. j++;
  478. j77++;
  479. }
  480. }
  481. }
  482. DrawingArea.defaultDrawingAreaSize();
  483. anInt1211 = j * 14 + 7 + 5;
  484. if (anInt1211 < 111)
  485. anInt1211 = 111;
  486. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  487. String fixedString;
  488.  
  489. if (myPlayer != null && myPlayer.name != null)
  490. fixedString = "<col=" + titleColor(myPlayer.titleColor, 0)
  491. + ">" + myPlayer.title + "</col>" + myPlayer.name;
  492. else
  493. fixedString = TextClass.fixName(capitalize(myUsername));
  494.  
  495. String s;
  496. if (myPlayer != null && myPlayer.name != null)
  497. s = /*
  498. * "<col="+titleColor(myPlayer.titleColor, 0)+">" +
  499. * myPlayer.title + "</col>" + myPlayer.name;
  500. */"" + myPlayer.title + "" + myPlayer.name;
  501. else
  502. s = TextClass.fixName(capitalize(myUsername));
  503. int xPos = 0;
  504. int yPos = 0;
  505. if (myPrivilege == 0) { // Player
  506. newRegularFont
  507. .drawBasicString(fixedString + "", 11, 133, 0, -1);
  508. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 12,
  509. 123);
  510. textDrawingArea.method385(0, ": ", 133,
  511. (26) + textDrawingArea.getTextWidth(s));
  512. newRegularFont.drawBasicString(inputString
  513. + ((loopCycle % 40 < 20) ? "|" : ""),
  514. 24 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  515. -1);
  516. DrawingArea.method339(121, 0x807660, 506, 7);
  517. } else if (myPrivilege == 1) { // Moderator
  518. modIcons[0].drawSprite(10 + xPos, 122 + yPos);
  519. xPos += 14;
  520. newRegularFont
  521. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  522. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  523. 123);
  524. textDrawingArea.method385(0, ": ", 133,
  525. (38 + textDrawingArea.getTextWidth(s)));
  526. newRegularFont.drawBasicString(inputString
  527. + ((loopCycle % 40 < 20) ? "|" : ""),
  528. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  529. -1);
  530. DrawingArea.method339(121, 0x807660, 506, 7);
  531. } else if (myPrivilege == 2) { // Administrator
  532. modIcons[1].drawSprite(10 + xPos, 122 + yPos);
  533. xPos += 14;
  534. newRegularFont
  535. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  536. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  537. 123);
  538. textDrawingArea.method385(0, ": ", 133,
  539. (38 + textDrawingArea.getTextWidth(s)));
  540. newRegularFont.drawBasicString(inputString
  541. + ((loopCycle % 40 < 20) ? "|" : ""),
  542. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  543. -1);
  544. DrawingArea.method339(121, 0x807660, 506, 7);
  545. } else if (myPrivilege == 3) { // Developer
  546. modIcons[2].drawSprite(10 + xPos, 121 + yPos);
  547. xPos += 14;
  548. newRegularFont
  549. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  550. modIcons[9].drawSprite(24, 123);// was 124
  551. textDrawingArea.method385(0, ": ", 10,
  552. (38 + textDrawingArea.getTextWidth(s)));
  553. newRegularFont.drawBasicString(inputString
  554. + ((loopCycle % 40 < 20) ? "|" : ""),
  555. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  556. -1);
  557. DrawingArea.method339(121, 0x807660, 506, 7);
  558. } else if (myPrivilege == 4) { // Donator
  559. modIcons[3].drawSprite(10 + xPos, 122 + yPos);
  560. xPos += 14;
  561. newRegularFont
  562. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  563. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  564. 123);
  565. textDrawingArea.method385(0, ": ", 133,
  566. (38 + textDrawingArea.getTextWidth(s)));
  567. newRegularFont.drawBasicString(inputString
  568. + ((loopCycle % 40 < 20) ? "|" : ""),
  569. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  570. -1);
  571. DrawingArea.method339(121, 0x807660, 506, 7);
  572. } else if (myPrivilege == 5) { // Super Donator
  573. modIcons[4].drawSprite(10 + xPos, 122 + yPos);
  574. xPos += 14;
  575. newRegularFont
  576. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  577. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  578. 123);
  579. textDrawingArea.method385(0, ": ", 133,
  580. (38 + textDrawingArea.getTextWidth(s)));
  581. newRegularFont.drawBasicString(inputString
  582. + ((loopCycle % 40 < 20) ? "|" : ""),
  583. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  584. -1);
  585. DrawingArea.method339(121, 0x807660, 506, 7);
  586. } else if (myPrivilege == 6) { // Extreme Donator
  587. modIcons[5].drawSprite(10 + xPos, 122 + yPos);
  588. xPos += 14;
  589. newRegularFont
  590. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  591. modIcons[9].drawSprite(textDrawingArea.getTextWidth(s) + 24,
  592. 123);
  593. textDrawingArea.method385(0, ": ", 133,
  594. (38 + textDrawingArea.getTextWidth(s)));
  595. newRegularFont.drawBasicString(inputString
  596. + ((loopCycle % 40 < 20) ? "|" : ""),
  597. 36 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  598. -1);
  599. DrawingArea.method339(121, 0x807660, 506, 7);
  600. } else if (myPrivilege == 7) { // Help Squad
  601. modIcons[6].drawSprite(10 + xPos, 122 + yPos);
  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 == 8) { // Respected Member
  615. modIcons[7].drawSprite(9 + xPos, 122 + yPos);
  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 == 9) { // Veteran
  629. modIcons[8].drawSprite(10 + xPos, 122 + yPos);
  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, ": ", 133,
  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. }
  643. }
  644. if (menuOpen && menuScreenArea == 2) {
  645. drawMenu();
  646. }
  647. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  648. aRSImageProducer_1165.initDrawingArea();
  649. Texture.anIntArray1472 = anIntArray1182;
  650. }
  651.  
  652. private String clanUsername;
  653. private String clanMessage;
  654. private String clanTitle;
  655. private final String[] clanTitles;
  656. private int channelRights;
  657.  
  658. @Override
  659. public void init() {
  660. try {
  661. nodeID = 10;
  662. portOff = 0;
  663. setHighMem();
  664. isMembers = true;
  665. signlink.storeid = 32;
  666. signlink.startpriv(InetAddress.getLocalHost());
  667. initClientFrame(503, 765);
  668. instance = this;
  669. } catch (Exception exception) {
  670. return;
  671. }
  672. }
  673.  
  674. @Override
  675. public void startRunnable(Runnable runnable, int i) {
  676. if (i > 10)
  677. i = 10;
  678. if (signlink.mainapp != null) {
  679. signlink.startthread(runnable, i);
  680. } else {
  681. super.startRunnable(runnable, i);
  682. }
  683. }
  684.  
  685. public Socket openSocket(int port) throws IOException {
  686. return new Socket(InetAddress.getByName(server), port);
  687. }
  688.  
  689. public boolean processMenuClick() {
  690. if (activeInterfaceType != 0)
  691. return false;
  692. int j = super.clickMode3;
  693. if (spellSelected == 1 && super.saveClickX >= 516
  694. && super.saveClickY >= 160 && super.saveClickX <= 765
  695. && super.saveClickY <= 205)
  696. j = 0;
  697. if (menuOpen) {
  698. if (j != 1) {
  699. int k = super.mouseX;
  700. int j1 = super.mouseY;
  701. if (menuScreenArea == 0) {
  702. k -= 4;
  703. j1 -= 4;
  704. }
  705. if (menuScreenArea == 1) {
  706. k -= 519;
  707. j1 -= 168;
  708. }
  709. if (menuScreenArea == 2) {
  710. k -= 17;
  711. j1 -= 338;
  712. }
  713. if (menuScreenArea == 3) {
  714. k -= 519;
  715. j1 -= 0;
  716. }
  717. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  718. || j1 < menuOffsetY - 10
  719. || j1 > menuOffsetY + menuHeight + 10) {
  720. menuOpen = false;
  721. if (menuScreenArea == 1)
  722. needDrawTabArea = true;
  723. if (menuScreenArea == 2)
  724. inputTaken = true;
  725. }
  726. }
  727. if (j == 1) {
  728. int l = menuOffsetX;
  729. int k1 = menuOffsetY;
  730. int i2 = menuWidth;
  731. int k2 = super.saveClickX;
  732. int l2 = super.saveClickY;
  733. if (menuScreenArea == 0) {
  734. k2 -= 4;
  735. l2 -= 4;
  736. }
  737. if (menuScreenArea == 1) {
  738. k2 -= 519;
  739. l2 -= 168;
  740. }
  741. if (menuScreenArea == 2) {
  742. k2 -= 17;
  743. l2 -= 338;
  744. }
  745. if (menuScreenArea == 3) {
  746. k2 -= 519;
  747. l2 -= 0;
  748. }
  749. int i3 = -1;
  750. for (int j3 = 0; j3 < menuActionRow; j3++) {
  751. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  752. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  753. i3 = j3;
  754. }
  755. if (i3 != -1)
  756. doAction(i3);
  757. menuOpen = false;
  758. if (menuScreenArea == 1)
  759. needDrawTabArea = true;
  760. if (menuScreenArea == 2) {
  761. inputTaken = true;
  762. }
  763. }
  764. return true;
  765. } else {
  766. if (j == 1 && menuActionRow > 0) {
  767. int i1 = menuActionID[menuActionRow - 1];
  768. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  769. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  770. || i1 == 847 || i1 == 447 || i1 == 1125) {
  771. int l1 = menuActionCmd2[menuActionRow - 1];
  772. int j2 = menuActionCmd3[menuActionRow - 1];
  773. RSInterface class9 = RSInterface.interfaceCache[j2];
  774. if (class9.aBoolean259 || class9.aBoolean235) {
  775. aBoolean1242 = false;
  776. anInt989 = 0;
  777. anInt1084 = j2;
  778. anInt1085 = l1;
  779. activeInterfaceType = 2;
  780. anInt1087 = super.saveClickX;
  781. anInt1088 = super.saveClickY;
  782. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  783. activeInterfaceType = 1;
  784. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  785. activeInterfaceType = 3;
  786. return true;
  787. }
  788. }
  789. }
  790. if (j == 1
  791. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  792. && menuActionRow > 2)
  793. j = 2;
  794. if (j == 1 && menuActionRow > 0)
  795. doAction(menuActionRow - 1);
  796. if (j == 2 && menuActionRow > 0)
  797. determineMenuSize();
  798. return false;
  799. }
  800. }
  801.  
  802. public static int totalRead = 0;
  803.  
  804. public static String getFileNameWithoutExtension(String fileName) {
  805. File tmpFile = new File(fileName);
  806. tmpFile.getName();
  807. int whereDot = tmpFile.getName().lastIndexOf('.');
  808. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  809. return tmpFile.getName().substring(0, whereDot);
  810. }
  811. return "";
  812. }
  813.  
  814. public String indexLocation(int cacheIndex, int index) {
  815. return signlink.findcachedir() + "index" + cacheIndex + "/"
  816. + (index != -1 ? index + ".gz" : "");
  817. }
  818.  
  819. public void repackCacheIndex(int cacheIndex) {
  820. System.out.println("Started repacking index " + cacheIndex + ".");
  821. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  822. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  823. try {
  824. for (int index = 0; index < indexLength; index++) {
  825. int fileIndex = Integer
  826. .parseInt(getFileNameWithoutExtension(file[index]
  827. .toString()));
  828. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  829. if (data != null && data.length > 0) {
  830. decompressors[cacheIndex].method234(data.length, data,
  831. fileIndex);
  832. System.out.println("Repacked " + fileIndex + ".");
  833. } else {
  834. System.out.println("Unable to locate index " + fileIndex
  835. + ".");
  836. }
  837. }
  838. } catch (Exception e) {
  839. System.out.println("Error packing cache index " + cacheIndex + ".");
  840. }
  841. System.out.println("Finished repacking " + cacheIndex + ".");
  842. }
  843.  
  844. public byte[] fileToByteArray(int cacheIndex, int index) {
  845. try {
  846. if (indexLocation(cacheIndex, index).length() <= 0
  847. || indexLocation(cacheIndex, index) == null) {
  848. return null;
  849. }
  850. File file = new File(indexLocation(cacheIndex, index));
  851. byte[] fileData = new byte[(int) file.length()];
  852. FileInputStream fis = new FileInputStream(file);
  853. fis.read(fileData);
  854. fis.close();
  855. return fileData;
  856. } catch (Exception e) {
  857. return null;
  858. }
  859. }
  860.  
  861. public void preloadModels() {
  862. File file = new File("./Raw/");
  863. File[] fileArray = file.listFiles();
  864. for (int y = 0; y < fileArray.length; y++) {
  865. String s = fileArray[y].getName();
  866. byte[] buffer = ReadFile("./Raw/" + s);
  867. Model.method460(buffer,
  868. Integer.parseInt(getFileNameWithoutExtension(s)));
  869. }
  870. }
  871.  
  872. public static final byte[] ReadFile(String s) {
  873. try {
  874. byte abyte0[];
  875. File file = new File(s);
  876. int i = (int) file.length();
  877. abyte0 = new byte[i];
  878. DataInputStream datainputstream = new DataInputStream(
  879. new BufferedInputStream(new FileInputStream(s)));
  880. datainputstream.readFully(abyte0, 0, i);
  881. datainputstream.close();
  882. totalRead++;
  883. return abyte0;
  884. } catch (Exception e) {
  885. System.out.println((new StringBuilder()).append("Read Error: ")
  886. .append(s).toString());
  887. return null;
  888. }
  889. }
  890.  
  891. public void addModels() {
  892. for (int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  893. byte[] abyte0 = getModel(ModelIndex);
  894. if (abyte0 != null && abyte0.length > 0) {
  895. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  896. }
  897. }
  898. }
  899.  
  900. public byte[] getModel(int Index) {
  901. try {
  902. File Model = new File(signlink.findcachedir() + "./pModels/"
  903. + Index + ".gz");
  904. byte[] aByte = new byte[(int) Model.length()];
  905. FileInputStream fis = new FileInputStream(Model);
  906. fis.read(aByte);
  907. System.out.println("" + Index + " aByte = [" + aByte + "]!");
  908. fis.close();
  909. return aByte;
  910. } catch (Exception e) {
  911. return null;
  912. }
  913. }
  914.  
  915. public void addMaps() {
  916. for (int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  917. byte[] abyte0 = getMaps(MapIndex);
  918. if (abyte0 != null && abyte0.length > 0) {
  919. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  920. System.out.println("Maps Added");
  921. }
  922. }
  923. }
  924.  
  925. public byte[] getMaps(int Index) {
  926. try {
  927. File Map = new File(signlink.findcachedir() + "./pMaps/" + Index
  928. + ".gz");
  929. byte[] aByte = new byte[(int) Map.length()];
  930. FileInputStream fis = new FileInputStream(Map);
  931. fis.read(aByte);
  932. pushMessage("aByte = [" + aByte + "]!", 0, "");
  933. fis.close();
  934. return aByte;
  935. } catch (Exception e) {
  936. return null;
  937. }
  938. }
  939.  
  940. public void saveMidi(boolean flag, byte abyte0[]) {
  941. signlink.midifade = flag ? 1 : 0;
  942. signlink.midisave(abyte0, abyte0.length);
  943. }
  944.  
  945. public int positions[] = new int[2000];
  946. public int landScapes[] = new int[2000];
  947. public int objects[] = new int[2000];
  948.  
  949. public final void method22() {
  950. try {
  951. anInt985 = -1;
  952. aClass19_1056.removeAll();
  953. aClass19_1013.removeAll();
  954. Texture.method366();
  955. unlinkMRUNodes();
  956. worldController.initToNull();
  957.  
  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.  
  974. int k2 = aByteArrayArray1183.length;
  975.  
  976. int k18 = 62;
  977. for (int A = 0; A < k2; A++)
  978. for (int B = 0; B < 2000; B++)
  979. if (anIntArray1234[A] == positions[B]) {
  980. anIntArray1235[A] = landScapes[B];
  981. anIntArray1236[A] = objects[B];
  982. }
  983.  
  984. stream.createFrame(0);
  985.  
  986. if (!aBoolean1159) {
  987. for (int i3 = 0; i3 < k2; i3++) {
  988. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  989. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  990.  
  991. byte abyte0[] = aByteArrayArray1183[i3];
  992. if (FileOperations
  993. .FileExists("./.ss_474/Null.map/mapsFloor/"
  994. + anIntArray1235[i3] + ".dat"))
  995. abyte0 = FileOperations
  996. .ReadFile("./.ss_474/Null.map/mapsFloor/"
  997. + anIntArray1235[i3] + ".dat");
  998.  
  999. if (abyte0 != null)
  1000. // objectManager.method180(abyte0, k5, i4, (anInt1069 -
  1001. // 6) * 8, (anInt1070 - 6) * 8, (byte)4,
  1002. // aClass11Array1230);
  1003. objectManager.method180(abyte0, k5, i4,
  1004. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  1005. aClass11Array1230);
  1006. }
  1007.  
  1008. for (int j4 = 0; j4 < k2; j4++) {
  1009. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1010. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1011. byte abyte2[] = aByteArrayArray1183[j4];
  1012. if (abyte2 == null && anInt1070 < 800)
  1013. // ObjectManager.method174(k7, 64, 0, 64, l5);
  1014. objectManager.method174(k7, 64, 64, l5);
  1015. }
  1016.  
  1017. anInt1097++;
  1018. if (anInt1097 > 160) {
  1019. anInt1097 = 0;
  1020. stream.createFrame(238);
  1021. stream.writeWordBigEndian(96);
  1022.  
  1023. }
  1024. stream.createFrame(0);
  1025.  
  1026. for (int i6 = 0; i6 < k2; i6++) {
  1027. byte abyte1[] = aByteArrayArray1247[i6];
  1028. if (FileOperations
  1029. .FileExists("./.ss_474/Null.map/spawnObject/"
  1030. + anIntArray1236[i6] + ".dat"))
  1031. abyte1 = FileOperations
  1032. .ReadFile("./.ss_474/Null.map/spawnObject/"
  1033. + anIntArray1236[i6] + ".dat");
  1034. if (abyte1 != null) {
  1035. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1036. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1037. // ObjectManager.method190(l8, aClass11Array1230, k9, 7,
  1038. // aClass25_946, abyte1);
  1039. objectManager.method190(l8, aClass11Array1230, k9,
  1040. worldController, abyte1);
  1041. }
  1042. }
  1043.  
  1044. }
  1045. if (aBoolean1159) {
  1046. for (int j3 = 0; j3 < 4; j3++) {
  1047. for (int k4 = 0; k4 < 13; k4++) {
  1048. for (int j6 = 0; j6 < 13; j6++) {
  1049. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1050. if (l7 != -1) {
  1051. int i9 = l7 >> 24 & 3;
  1052. int l9 = l7 >> 1 & 3;
  1053. int j10 = l7 >> 14 & 0x3ff;
  1054. int l10 = l7 >> 3 & 0x7ff;
  1055. int j11 = (j10 / 8 << 8) + l10 / 8;
  1056. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1057. if (anIntArray1234[l11] != j11
  1058. || aByteArrayArray1183[l11] == null)
  1059. continue;
  1060. // ObjectManager.method179(i9, l9,
  1061. // aClass11Array1230, 9, k4 * 8, (j10 & 7) *
  1062. // 8, aByteArrayArray1183[l11], (l10 & 7) *
  1063. // 8, j3, j6 * 8);
  1064. objectManager.method179(i9, l9,
  1065. aClass11Array1230, k4 * 8,
  1066. (j10 & 7) * 8,
  1067. aByteArrayArray1183[l11],
  1068. (l10 & 7) * 8, j3, j6 * 8);
  1069. break;
  1070. }
  1071.  
  1072. }
  1073. }
  1074.  
  1075. }
  1076.  
  1077. }
  1078.  
  1079. for (int l4 = 0; l4 < 13; l4++) {
  1080. for (int k6 = 0; k6 < 13; k6++) {
  1081. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1082. if (i8 == -1)
  1083. // ObjectManager.method174(k6 * 8, 8, 0, 8, l4 * 8);
  1084. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1085. }
  1086.  
  1087. }
  1088.  
  1089. stream.createFrame(0);
  1090.  
  1091. for (int l6 = 0; l6 < 4; l6++) {
  1092. for (int j8 = 0; j8 < 13; j8++) {
  1093. for (int j9 = 0; j9 < 13; j9++) {
  1094. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1095. if (i10 != -1) {
  1096. int k10 = i10 >> 24 & 3;
  1097. int i11 = i10 >> 1 & 3;
  1098. int k11 = i10 >> 14 & 0x3ff;
  1099. int i12 = i10 >> 3 & 0x7ff;
  1100. int j12 = (k11 / 8 << 8) + i12 / 8;
  1101. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1102. if (anIntArray1234[k12] != j12
  1103. || aByteArrayArray1247[k12] == null)
  1104. continue;
  1105. if (FileOperations
  1106. .FileExists("./Cache/FloorMaps/"
  1107. + anIntArray1235[k12]
  1108. + ".dat"))
  1109. FileOperations.ReadFile(signlink
  1110. .findcachedir()
  1111. + "FloorMaps/"
  1112. + anIntArray1235[k12] + ".dat");
  1113. // ObjectManager.method183(aClass11Array1230,
  1114. // aClass25_946, k10, j8 * 8, (i12 & 7) * 8,
  1115. // true, l6, abyte0, (k11 & 7) * 8, i11, j9
  1116. // * 8);
  1117. objectManager.method183(aClass11Array1230,
  1118. worldController, k10, j8 * 8,
  1119. (i12 & 7) * 8, l6,
  1120. aByteArrayArray1247[k12],
  1121. (k11 & 7) * 8, i11, j9 * 8);
  1122. break;
  1123. }
  1124.  
  1125. }
  1126. }
  1127.  
  1128. }
  1129.  
  1130. }
  1131.  
  1132. }
  1133. stream.createFrame(0);
  1134. objectManager.method171(aClass11Array1230, worldController);
  1135. aRSImageProducer_1165.initDrawingArea();
  1136. stream.createFrame(0);
  1137.  
  1138. int k3 = ObjectManager.anInt145;
  1139. if (k3 > plane)
  1140. k3 = plane;
  1141.  
  1142. if (k3 < plane - 1)
  1143. k3 = plane - 1;
  1144. if (lowMem)
  1145.  
  1146. worldController.method275(ObjectManager.anInt145);
  1147. else
  1148. worldController.method275(0);
  1149. for (int i5 = 0; i5 < 104; i5++) {
  1150. for (int i7 = 0; i7 < 104; i7++)
  1151. spawnGroundItem(i5, i7);
  1152.  
  1153. }
  1154.  
  1155. anInt1051++;
  1156. if (anInt1051 > 98) {
  1157. anInt1051 = 0;
  1158. stream.createFrame(150);
  1159.  
  1160. }
  1161. method63();
  1162. } catch (Exception e) {
  1163. e.printStackTrace();
  1164. }
  1165. ObjectDef.mruNodes1.unlinkAll();
  1166.  
  1167. if (super.gameFrame != null) {
  1168. stream.createFrame(210);
  1169.  
  1170. stream.writeDWord(0x3f008edd);
  1171. }
  1172. System.gc();
  1173. Texture.method367();
  1174. onDemandFetcher.method566();
  1175.  
  1176. int k = (anInt1069 - 6) / 8 - 1;
  1177. int j1 = (anInt1069 + 6) / 8 + 1;
  1178. int i2 = (anInt1070 - 6) / 8 - 1;
  1179. int l2 = (anInt1070 + 6) / 8 + 1;
  1180. if (aBoolean1141) {
  1181. k = 49;
  1182. j1 = 50;
  1183. i2 = 49;
  1184. l2 = 50;
  1185. }
  1186. for (int l3 = k; l3 <= j1; l3++) {
  1187. for (int j5 = i2; j5 <= l2; j5++)
  1188. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1189. int j7 = onDemandFetcher.method562(0, j5, l3);
  1190. if (j7 != -1)
  1191. onDemandFetcher.method560(j7, 3);
  1192. int k8 = onDemandFetcher.method562(1, j5, l3);
  1193. if (k8 != -1)
  1194. onDemandFetcher.method560(k8, 3);
  1195. }
  1196.  
  1197. }
  1198.  
  1199. }
  1200.  
  1201. public void unlinkMRUNodes() {
  1202. ObjectDef.mruNodes1.unlinkAll();
  1203. ObjectDef.mruNodes2.unlinkAll();
  1204. EntityDef.mruNodes.unlinkAll();
  1205. ItemDef.mruNodes2.unlinkAll();
  1206. ItemDef.mruNodes1.unlinkAll();
  1207. Player.mruNodes.unlinkAll();
  1208. SpotAnim.aMRUNodes_415.unlinkAll();
  1209. }
  1210.  
  1211. public void method24(int i) {
  1212. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1213. int j = ai.length;
  1214. for (int k = 0; k < j; k++)
  1215. ai[k] = 0;
  1216.  
  1217. for (int l = 1; l < 103; l++) {
  1218. int i1 = 24628 + (103 - l) * 512 * 4;
  1219. for (int k1 = 1; k1 < 103; k1++) {
  1220. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1221. worldController.method309(ai, i1, i, k1, l);
  1222. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1223. worldController.method309(ai, i1, i + 1, k1, l);
  1224. i1 += 4;
  1225. }
  1226.  
  1227. }
  1228.  
  1229. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16)
  1230. + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  1231. + ((238 + (int) (Math.random() * 20D)) - 10);
  1232. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  1233. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1234. for (int i2 = 1; i2 < 103; i2++) {
  1235. for (int j2 = 1; j2 < 103; j2++) {
  1236. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1237. method50(i2, j1, j2, l1, i);
  1238. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1239. method50(i2, j1, j2, l1, i + 1);
  1240. }
  1241.  
  1242. }
  1243.  
  1244. aRSImageProducer_1165.initDrawingArea();
  1245. anInt1071 = 0;
  1246. for (int k2 = 0; k2 < 104; k2++) {
  1247. for (int l2 = 0; l2 < 104; l2++) {
  1248. int i3 = worldController.method303(plane, k2, l2);
  1249. if (i3 != 0) {
  1250. i3 = i3 >> 14 & 0x7fff;
  1251. int j3 = ObjectDef.forID(i3).anInt746;
  1252. if (j3 >= 0) {
  1253. int k3 = k2;
  1254. int l3 = l2;
  1255. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36
  1256. && j3 != 46 && j3 != 47 && j3 != 48) {
  1257. byte byte0 = 104;
  1258. byte byte1 = 104;
  1259. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1260. for (int i4 = 0; i4 < 10; i4++) {
  1261. int j4 = (int) (Math.random() * 4D);
  1262. if (j4 == 0 && k3 > 0 && k3 > k2 - 3
  1263. && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1264. k3--;
  1265. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3
  1266. && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1267. k3++;
  1268. if (j4 == 2 && l3 > 0 && l3 > l2 - 3
  1269. && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1270. l3--;
  1271. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3
  1272. && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1273. l3++;
  1274. }
  1275.  
  1276. }
  1277. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1278. anIntArray1072[anInt1071] = k3;
  1279. anIntArray1073[anInt1071] = l3;
  1280. anInt1071++;
  1281. }
  1282. }
  1283. }
  1284.  
  1285. }
  1286.  
  1287. }
  1288.  
  1289. public void spawnGroundItem(int i, int j) {
  1290. NodeList class19 = groundArray[plane][i][j];
  1291. if (class19 == null) {
  1292. worldController.method295(plane, i, j);
  1293. return;
  1294. }
  1295. int k = 0xfa0a1f01;
  1296. Object obj = null;
  1297. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1298. .reverseGetNext()) {
  1299. ItemDef itemDef = ItemDef.forID(item.ID);
  1300. int l = itemDef.value;
  1301. if (itemDef.stackable)
  1302. l *= item.anInt1559 + 1;
  1303. // notifyItemSpawn(item, i + baseX, j + baseY);
  1304.  
  1305. if (l > k) {
  1306. k = l;
  1307. obj = item;
  1308. }
  1309. }
  1310.  
  1311. class19.insertTail(((Node) (obj)));
  1312. Object obj1 = null;
  1313. Object obj2 = null;
  1314. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1315. .reverseGetNext()) {
  1316. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1317. && obj1 == null)
  1318. obj1 = class30_sub2_sub4_sub2_1;
  1319. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1320. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1321. && obj2 == null)
  1322. obj2 = class30_sub2_sub4_sub2_1;
  1323. }
  1324.  
  1325. int i1 = i + (j << 7) + 0x60000000;
  1326. worldController.method281(i, i1, ((Animable) (obj1)),
  1327. method42(plane, j * 128 + 64, i * 128 + 64),
  1328. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1329. }
  1330.  
  1331. public void method26(boolean flag) {
  1332. for (int j = 0; j < npcCount; j++) {
  1333. NPC npc = npcArray[npcIndices[j]];
  1334. int k = 0x20000000 + (npcIndices[j] << 14);
  1335. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1336. continue;
  1337. int l = npc.x >> 7;
  1338. int i1 = npc.y >> 7;
  1339. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1340. continue;
  1341. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1342. && (npc.y & 0x7f) == 64) {
  1343. if (anIntArrayArray929[l][i1] == anInt1265)
  1344. continue;
  1345. anIntArrayArray929[l][i1] = anInt1265;
  1346. }
  1347. if (!npc.desc.aBoolean84)
  1348. k += 0x80000000;
  1349. worldController
  1350. .method285(plane, npc.anInt1552,
  1351. method42(plane, npc.y, npc.x), k, npc.y,
  1352. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1353. npc.aBoolean1541);
  1354. }
  1355. }
  1356.  
  1357. private boolean replayWave() {
  1358. return signlink.wavereplay();
  1359. }
  1360.  
  1361. public void loadError() {
  1362. String s = "ondemand";// was a constant parameter
  1363. System.out.println(s);
  1364. try {
  1365. getAppletContext().showDocument(
  1366. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1367. } catch (Exception exception) {
  1368. exception.printStackTrace();
  1369. }
  1370. do
  1371. try {
  1372. Thread.sleep(1000L);
  1373. } catch (Exception _ex) {
  1374. }
  1375. while (true);
  1376. }
  1377.  
  1378. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
  1379. int i1, int j1) {
  1380. if (class9 == null) {
  1381. return;
  1382. }
  1383. if (class9.type != 0 || class9.children == null
  1384. || class9.isMouseoverTriggered)
  1385. return;
  1386. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1387. return;
  1388. int k1 = class9.children.length;
  1389. for (int l1 = 0; l1 < k1; l1++) {
  1390. int i2 = class9.childX[l1] + i;
  1391. int j2 = (class9.childY[l1] + l) - j1;
  1392. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1393. if (class9_1 == null) {
  1394. break;
  1395. }
  1396. i2 += class9_1.anInt263;
  1397. j2 += class9_1.anInt265;
  1398. if ((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0)
  1399. && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1400. && i1 < j2 + class9_1.height)
  1401. if (class9_1.mOverInterToTrigger >= 0)
  1402. anInt886 = class9_1.mOverInterToTrigger;
  1403. else
  1404. anInt886 = class9_1.id;
  1405. if (class9_1.type == 8 && k >= i2 && i1 >= j2
  1406. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1407. anInt1315 = class9_1.id;
  1408. }
  1409. if (class9_1.type == 9 && k >= i2 && i1 >= j2
  1410. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1411. anInt1315 = class9_1.id;
  1412. }
  1413. if (class9_1.type == 5 && k >= i2 && i1 >= j2
  1414. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1415. hoverId = class9_1.id;
  1416. }
  1417. if (class9_1.type == 0) {
  1418. buildInterfaceMenu(i2, class9_1, k, j2, i1,
  1419. class9_1.scrollPosition);
  1420. if (class9_1.scrollMax > class9_1.height)
  1421. method65(i2 + class9_1.width, class9_1.height, k, i1,
  1422. class9_1, j2, true, class9_1.scrollMax);
  1423. } else {
  1424. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
  1425. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1426. boolean flag = false;
  1427. if (class9_1.contentType != 0)
  1428. flag = buildFriendsListMenu(class9_1);
  1429. if (!flag) {
  1430. // System.out.println("1"+class9_1.tooltip + ", " +
  1431. // class9_1.interfaceID);
  1432. menuActionName[menuActionRow] = class9_1.tooltip;
  1433. menuActionID[menuActionRow] = 315;
  1434. menuActionCmd3[menuActionRow] = class9_1.id;
  1435. menuActionRow++;
  1436. }
  1437. }
  1438. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
  1439. && i1 >= j2 && k < i2 + class9_1.width
  1440. && i1 < j2 + class9_1.height) {
  1441. String s = class9_1.selectedActionName;
  1442. if (s.indexOf(" ") != -1)
  1443. s = s.substring(0, s.indexOf(" "));
  1444. menuActionName[menuActionRow] = s + " @gre@"
  1445. + class9_1.spellName;
  1446. menuActionID[menuActionRow] = 626;
  1447. menuActionCmd3[menuActionRow] = class9_1.id;
  1448. menuActionRow++;
  1449. }
  1450. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
  1451. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1452. menuActionName[menuActionRow] = "Close";
  1453. menuActionID[menuActionRow] = 200;
  1454. menuActionCmd3[menuActionRow] = class9_1.id;
  1455. menuActionRow++;
  1456. }
  1457. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
  1458. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1459. // System.out.println("2"+class9_1.tooltip + ", " +
  1460. // class9_1.interfaceID);
  1461. menuActionName[menuActionRow] = class9_1.tooltip;
  1462. menuActionID[menuActionRow] = 169;
  1463. menuActionCmd3[menuActionRow] = class9_1.id;
  1464. menuActionRow++;
  1465. if (class9_1.hoverText != null) {
  1466. // drawHoverBox(k, l, class9_1.hoverText);
  1467. // System.out.println("DRAWING INTERFACE: " +
  1468. // class9_1.hoverText);
  1469. }
  1470. }
  1471. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
  1472. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1473. // System.out.println("3"+class9_1.tooltip + ", " +
  1474. // class9_1.interfaceID);
  1475. menuActionName[menuActionRow] = class9_1.tooltip;
  1476. menuActionID[menuActionRow] = 646;
  1477. menuActionCmd3[menuActionRow] = class9_1.id;
  1478. menuActionRow++;
  1479. }
  1480. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
  1481. && i1 >= j2 && k < i2 + class9_1.width
  1482. && i1 < j2 + class9_1.height) {
  1483. menuActionName[menuActionRow] = class9_1.tooltip;
  1484. menuActionID[menuActionRow] = 679;
  1485. menuActionCmd3[menuActionRow] = class9_1.id;
  1486. menuActionRow++;
  1487. }
  1488. if (k >= i2 && i1 >= j2
  1489. && k < i2 + (class9_1.type == 4 ? 100 : class9_1.width)
  1490. && i1 < j2 + class9_1.height) {
  1491. if (class9_1.actions != null) {
  1492. if ((class9_1.type == 4 && class9_1.message.length() > 0)
  1493. || class9_1.type == 5) {
  1494. for (int action = class9_1.actions.length - 1; action >= 0; action--) {
  1495. if (class9_1.actions[action] != null) {
  1496. menuActionName[menuActionRow] = class9_1.actions[action]
  1497. + (class9_1.type == 4 ? " "
  1498. + class9_1.message : "");
  1499. menuActionID[menuActionRow] = 647;
  1500. menuActionCmd2[menuActionRow] = action;
  1501. menuActionCmd3[menuActionRow] = class9_1.id;
  1502. menuActionRow++;
  1503. }
  1504. }
  1505. }
  1506. }
  1507. }
  1508. if (class9_1.type == 2) {
  1509. int k2 = 0;
  1510. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1511. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1512. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1513. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1514. if (k2 < 20) {
  1515. j3 += class9_1.spritesX[k2];
  1516. k3 += class9_1.spritesY[k2];
  1517. }
  1518. if (k >= j3 && i1 >= k3 && k < j3 + 32
  1519. && i1 < k3 + 32) {
  1520. mouseInvInterfaceIndex = k2;
  1521. lastActiveInvInterface = class9_1.id;
  1522. if (class9_1.inv[k2] > 0) {
  1523. ItemDef itemDef = ItemDef
  1524. .forID(class9_1.inv[k2] - 1);
  1525. if (itemSelected == 1
  1526. && class9_1.isInventoryInterface) {
  1527. if (class9_1.id != anInt1284
  1528. || k2 != anInt1283) {
  1529. menuActionName[menuActionRow] = "Use "
  1530. + selectedItemName
  1531. + " with @lre@"
  1532. + itemDef.name;
  1533. menuActionID[menuActionRow] = 870;
  1534. menuActionCmd1[menuActionRow] = itemDef.id;
  1535. menuActionCmd2[menuActionRow] = k2;
  1536. menuActionCmd3[menuActionRow] = class9_1.id;
  1537. menuActionRow++;
  1538. }
  1539. } else if (spellSelected == 1
  1540. && class9_1.isInventoryInterface) {
  1541. if ((spellUsableOn & 0x10) == 16) {
  1542. menuActionName[menuActionRow] = spellTooltip
  1543. + " @lre@" + itemDef.name;
  1544. menuActionID[menuActionRow] = 543;
  1545. menuActionCmd1[menuActionRow] = itemDef.id;
  1546. menuActionCmd2[menuActionRow] = k2;
  1547. menuActionCmd3[menuActionRow] = class9_1.id;
  1548. menuActionRow++;
  1549. }
  1550. } else {
  1551. if (class9_1.isInventoryInterface) {
  1552. for (int l3 = 4; l3 >= 3; l3--)
  1553. if (itemDef.itemActions != null
  1554. && itemDef.itemActions[l3] != null) {
  1555. menuActionName[menuActionRow] = itemDef.itemActions[l3]
  1556. + " @lre@"
  1557. + itemDef.name;
  1558. if (l3 == 3)
  1559. menuActionID[menuActionRow] = 493;
  1560. if (l3 == 4)
  1561. menuActionID[menuActionRow] = 847;
  1562. menuActionCmd1[menuActionRow] = itemDef.id;
  1563. menuActionCmd2[menuActionRow] = k2;
  1564. menuActionCmd3[menuActionRow] = class9_1.id;
  1565. menuActionRow++;
  1566. } else if (l3 == 4) {
  1567. menuActionName[menuActionRow] = "Drop @lre@"
  1568. + itemDef.name;
  1569. menuActionID[menuActionRow] = 847;
  1570. menuActionCmd1[menuActionRow] = itemDef.id;
  1571. menuActionCmd2[menuActionRow] = k2;
  1572. menuActionCmd3[menuActionRow] = class9_1.id;
  1573. menuActionRow++;
  1574. }
  1575.  
  1576. }
  1577. if (class9_1.usableItemInterface) {
  1578. menuActionName[menuActionRow] = "Use @lre@"
  1579. + itemDef.name;
  1580. menuActionID[menuActionRow] = 447;
  1581. menuActionCmd1[menuActionRow] = itemDef.id;
  1582. // k2 = inventory spot
  1583. // System.out.println(k2);
  1584. menuActionCmd2[menuActionRow] = k2;
  1585. menuActionCmd3[menuActionRow] = class9_1.id;
  1586. menuActionRow++;
  1587. }
  1588. if (class9_1.isInventoryInterface
  1589. && itemDef.itemActions != null) {
  1590. for (int i4 = 2; i4 >= 0; i4--)
  1591. if (itemDef.itemActions[i4] != null) {
  1592. menuActionName[menuActionRow] = itemDef.itemActions[i4]
  1593. + " @lre@"
  1594. + itemDef.name;
  1595. if (i4 == 0)
  1596. menuActionID[menuActionRow] = 74;
  1597. if (i4 == 1)
  1598. menuActionID[menuActionRow] = 454;
  1599. if (i4 == 2)
  1600. menuActionID[menuActionRow] = 539;
  1601. menuActionCmd1[menuActionRow] = itemDef.id;
  1602. menuActionCmd2[menuActionRow] = k2;
  1603. menuActionCmd3[menuActionRow] = class9_1.id;
  1604. menuActionRow++;
  1605. }
  1606.  
  1607. }
  1608. if (class9_1.actions != null) {
  1609. for (int j4 = 4; j4 >= 0; j4--)
  1610. if (class9_1.actions[j4] != null) {
  1611. menuActionName[menuActionRow] = class9_1.actions[j4]
  1612. + " @lre@"
  1613. + itemDef.name;
  1614. if (j4 == 0)
  1615. menuActionID[menuActionRow] = 632;
  1616. if (j4 == 1)
  1617. menuActionID[menuActionRow] = 78;
  1618. if (j4 == 2)
  1619. menuActionID[menuActionRow] = 867;
  1620. if (j4 == 3)
  1621. menuActionID[menuActionRow] = 431;
  1622. if (j4 == 4)
  1623. menuActionID[menuActionRow] = 53;
  1624. menuActionCmd1[menuActionRow] = itemDef.id;
  1625. menuActionCmd2[menuActionRow] = k2;
  1626. menuActionCmd3[menuActionRow] = class9_1.id;
  1627. menuActionRow++;
  1628. }
  1629.  
  1630. }
  1631. menuActionName[menuActionRow] = "Examine @lre@"
  1632. + itemDef.name;
  1633. menuActionID[menuActionRow] = 1125;
  1634. menuActionCmd1[menuActionRow] = itemDef.id;
  1635. menuActionCmd2[menuActionRow] = k2;
  1636. menuActionCmd3[menuActionRow] = class9_1.id;
  1637. menuActionRow++;
  1638. }
  1639. }
  1640. }
  1641. k2++;
  1642. }
  1643.  
  1644. }
  1645.  
  1646. }
  1647. }
  1648. }
  1649. }
  1650.  
  1651. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1652. scrollBar1.drawSprite(i1, l);
  1653. scrollBar2.drawSprite(i1, (l + j) - 16);
  1654. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1655. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1656. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1657. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1658. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1659. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1660. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1661. int k1 = ((j - 32) * j) / j1;
  1662. if (k1 < 8)
  1663. k1 = 8;
  1664. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1665. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1666. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1667. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1668. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1669. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1670. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1671. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1672. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1673. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1674. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1675. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1676. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1677. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1678. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1679. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1680. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1681. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1682. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1683. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1684. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1685. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1686. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1687. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1688. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1689. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1690. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1691. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1692. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1693. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1694. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1695. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1696. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1697. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1698. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1699. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1700. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1701. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1702. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1703. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1704. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1705. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1706. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1707. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1708. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1709. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1710. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1711. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1712. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1713. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1714. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1715. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1716. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1717. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1718. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1719. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1720. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1721. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1722. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1723. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1724. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1725. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1726. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1727. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1728. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1729. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1730. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1731. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1732. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1733. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1734. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1735. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1736. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1737. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1738. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1739. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1740. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1741. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1742. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1743. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1744. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1745. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1746. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1747. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1748. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1749. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1750. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1751. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1752. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1753. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1754. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1755. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1756. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1757. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1758. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1759. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1760. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1761. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1762. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1763. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1764. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1765. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1766. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1767. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1768. }
  1769.  
  1770. public void updateNPCs(Stream stream, int i) {
  1771. anInt839 = 0;
  1772. anInt893 = 0;
  1773. method139(stream);
  1774. method46(i, stream);
  1775. method86(stream);
  1776. for (int k = 0; k < anInt839; k++) {
  1777. int l = anIntArray840[k];
  1778. if (npcArray[l].anInt1537 != loopCycle) {
  1779. npcArray[l].desc = null;
  1780. npcArray[l] = null;
  1781. }
  1782. }
  1783.  
  1784. if (stream.currentOffset != i) {
  1785. signlink.reporterror(myUsername
  1786. + " size mismatch in getnpcpos - pos:"
  1787. + stream.currentOffset + " psize:" + i);
  1788. throw new RuntimeException("eek");
  1789. }
  1790. for (int i1 = 0; i1 < npcCount; i1++)
  1791. if (npcArray[npcIndices[i1]] == null) {
  1792. signlink.reporterror(myUsername
  1793. + " null entry in npc list - pos:" + i1 + " size:"
  1794. + npcCount);
  1795. throw new RuntimeException("eek");
  1796. }
  1797.  
  1798. }
  1799.  
  1800. private int cButtonHPos;
  1801. private int cButtonCPos;
  1802.  
  1803. public void processChatModeClick() {
  1804. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482
  1805. && super.mouseY <= 503) {
  1806. cButtonHPos = 0;
  1807. inputTaken = true;
  1808. } else if (super.mouseX >= 71 && super.mouseX <= 127
  1809. && super.mouseY >= 482 && super.mouseY <= 503) {
  1810. cButtonHPos = 1;
  1811. inputTaken = true;
  1812. } else if (super.mouseX >= 137 && super.mouseX <= 193
  1813. && super.mouseY >= 482 && super.mouseY <= 503) {
  1814. cButtonHPos = 2;
  1815. inputTaken = true;
  1816. } else if (super.mouseX >= 203 && super.mouseX <= 259
  1817. && super.mouseY >= 482 && super.mouseY <= 503) {
  1818. cButtonHPos = 3;
  1819. inputTaken = true;
  1820. } else if (super.mouseX >= 269 && super.mouseX <= 325
  1821. && super.mouseY >= 482 && super.mouseY <= 503) {
  1822. cButtonHPos = 4;
  1823. inputTaken = true;
  1824. } else if (super.mouseX >= 335 && super.mouseX <= 391
  1825. && super.mouseY >= 482 && super.mouseY <= 503) {
  1826. cButtonHPos = 5;
  1827. inputTaken = true;
  1828. } else if (super.mouseX >= 404 && super.mouseX <= 515
  1829. && super.mouseY >= 482 && super.mouseY <= 503) {
  1830. cButtonHPos = 6;
  1831. inputTaken = true;
  1832. } else {
  1833. cButtonHPos = -1;
  1834. inputTaken = true;
  1835. }
  1836. if (super.clickMode3 == 1) {
  1837. if (super.saveClickX >= 5 && super.saveClickX <= 61
  1838. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1839. cButtonCPos = 0;
  1840. chatTypeView = 0;
  1841. inputTaken = true;
  1842. } else if (super.saveClickX >= 71 && super.saveClickX <= 127
  1843. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1844. cButtonCPos = 1;
  1845. chatTypeView = 5;
  1846. inputTaken = true;
  1847. } else if (super.saveClickX >= 137 && super.saveClickX <= 193
  1848. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1849. cButtonCPos = 2;
  1850. chatTypeView = 1;
  1851. inputTaken = true;
  1852. } else if (super.saveClickX >= 203 && super.saveClickX <= 259
  1853. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1854. cButtonCPos = 3;
  1855. chatTypeView = 2;
  1856. inputTaken = true;
  1857. } else if (super.saveClickX >= 269 && super.saveClickX <= 325
  1858. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1859. cButtonCPos = 4;
  1860. chatTypeView = 11;
  1861. inputTaken = true;
  1862. } else if (super.saveClickX >= 335 && super.saveClickX <= 391
  1863. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1864. cButtonCPos = 5;
  1865. chatTypeView = 3;
  1866. inputTaken = true;
  1867. }
  1868. }
  1869. }
  1870.  
  1871. public void method33(int i) {
  1872. int j = Varp.cache[i].anInt709;
  1873. if (j == 0)
  1874. return;
  1875. int k = variousSettings[i];
  1876. if (j == 1) {
  1877. if (k == 1)
  1878. Texture.method372(0.90000000000000002D);
  1879. if (k == 2)
  1880. Texture.method372(0.80000000000000004D);
  1881. if (k == 3)
  1882. Texture.method372(0.69999999999999996D);
  1883. if (k == 4)
  1884. Texture.method372(0.59999999999999998D);
  1885. ItemDef.mruNodes1.unlinkAll();
  1886. welcomeScreenRaised = true;
  1887. }
  1888. if (j == 3) {
  1889. boolean flag1 = musicEnabled;
  1890. if (k == 0) {
  1891. adjustVolume(musicEnabled, 0);
  1892. musicEnabled = true;
  1893. }
  1894. if (k == 1) {
  1895. adjustVolume(musicEnabled, -400);
  1896. musicEnabled = true;
  1897. }
  1898. if (k == 2) {
  1899. adjustVolume(musicEnabled, -800);
  1900. musicEnabled = true;
  1901. }
  1902. if (k == 3) {
  1903. adjustVolume(musicEnabled, -1200);
  1904. musicEnabled = true;
  1905. }
  1906. if (k == 4)
  1907. musicEnabled = false;
  1908. if (musicEnabled != flag1 && !lowMem) {
  1909. if (musicEnabled) {
  1910. nextSong = currentSong;
  1911. songChanging = true;
  1912. onDemandFetcher.method558(2, nextSong);
  1913. } else {
  1914. stopMidi();
  1915. }
  1916. prevSong = 0;
  1917. }
  1918. }
  1919. if (j == 4) {
  1920. if (k == 0) {
  1921. aBoolean848 = true;
  1922. setWaveVolume(0);
  1923. }
  1924. if (k == 1) {
  1925. aBoolean848 = true;
  1926. setWaveVolume(-400);
  1927. }
  1928. if (k == 2) {
  1929. aBoolean848 = true;
  1930. setWaveVolume(-800);
  1931. }
  1932. if (k == 3) {
  1933. aBoolean848 = true;
  1934. setWaveVolume(-1200);
  1935. }
  1936. if (k == 4)
  1937. aBoolean848 = false;
  1938. }
  1939. if (j == 5)
  1940. anInt1253 = k;
  1941. if (j == 6)
  1942. anInt1249 = k;
  1943. if (j == 8) {
  1944. splitPrivateChat = k;
  1945. inputTaken = true;
  1946. }
  1947. if (j == 9)
  1948. anInt913 = k;
  1949. }
  1950.  
  1951. public void updateEntities() {
  1952. try {
  1953. int anInt974 = 0;
  1954. for (int j = -1; j < playerCount + npcCount; j++) {
  1955. Object obj;
  1956. if (j == -1)
  1957. obj = myPlayer;
  1958. else if (j < playerCount)
  1959. obj = playerArray[playerIndices[j]];
  1960. else
  1961. obj = npcArray[npcIndices[j - playerCount]];
  1962. if (obj == null || !((Entity) (obj)).isVisible())
  1963. continue;
  1964. if (obj instanceof NPC) {
  1965. EntityDef entityDef = ((NPC) obj).desc;
  1966. if (entityDef.childrenIDs != null)
  1967. entityDef = entityDef.method161();
  1968. if (entityDef == null)
  1969. continue;
  1970. }
  1971. if (j < playerCount) {
  1972. int l = 30;
  1973. Player player = (Player) obj;
  1974. if (player.headIcon >= 0) {
  1975. npcScreenPos(((Entity) (obj)),
  1976. ((Entity) (obj)).height + 15);
  1977. if (spriteDrawX > -1) {
  1978. if (player.skullIcon < 2) {
  1979. skullIcons[player.skullIcon].drawSprite(
  1980. spriteDrawX - 12, spriteDrawY - l);
  1981. l += 25;
  1982. }
  1983. if (player.headIcon < 7) {
  1984. headIcons[player.headIcon].drawSprite(
  1985. spriteDrawX - 12, spriteDrawY - l);
  1986. l += 18;
  1987. }
  1988. }
  1989. }
  1990. if (j >= 0 && anInt855 == 10
  1991. && anInt933 == playerIndices[j]) {
  1992. npcScreenPos(((Entity) (obj)),
  1993. ((Entity) (obj)).height + 15);
  1994. if (spriteDrawX > -1)
  1995. headIconsHint[player.hintIcon].drawSprite(
  1996. spriteDrawX - 12, spriteDrawY - l);
  1997. }
  1998. } else {
  1999. EntityDef entityDef_1 = ((NPC) obj).desc;
  2000. if (entityDef_1.anInt75 >= 0
  2001. && entityDef_1.anInt75 < headIcons.length) {
  2002. npcScreenPos(((Entity) (obj)),
  2003. ((Entity) (obj)).height + 15);
  2004. if (spriteDrawX > -1)
  2005. headIcons[entityDef_1.anInt75].drawSprite(
  2006. spriteDrawX - 12, spriteDrawY - 30);
  2007. }
  2008. if (anInt855 == 1
  2009. && anInt1222 == npcIndices[j - playerCount]
  2010. && loopCycle % 20 < 10) {
  2011. npcScreenPos(((Entity) (obj)),
  2012. ((Entity) (obj)).height + 15);
  2013. if (spriteDrawX > -1)
  2014. headIconsHint[0].drawSprite(spriteDrawX - 12,
  2015. spriteDrawY - 28);
  2016. }
  2017. }
  2018. if (((Entity) (obj)).textSpoken != null
  2019. && (j >= playerCount || publicChatMode == 0
  2020. || publicChatMode == 3 || publicChatMode == 1
  2021. && isFriendOrSelf(((Player) obj).name))) {
  2022. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2023. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2024. anIntArray979[anInt974] = chatTextDrawingArea
  2025. .method384(((Entity) (obj)).textSpoken) / 2;
  2026. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2027. anIntArray976[anInt974] = spriteDrawX;
  2028. anIntArray977[anInt974] = spriteDrawY;
  2029. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2030. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2031. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2032. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2033. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  2034. && ((Entity) (obj)).anInt1531 <= 3) {
  2035. anIntArray978[anInt974] += 10;
  2036. anIntArray977[anInt974] += 5;
  2037. }
  2038. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2039. anIntArray979[anInt974] = 60;
  2040. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2041. anIntArray978[anInt974] += 5;
  2042. }
  2043. }
  2044. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2045. try {
  2046. npcScreenPos(((Entity) (obj)),
  2047. ((Entity) (obj)).height + 15);
  2048. if (spriteDrawX > -1) {
  2049. int i1 = (((Entity) (obj)).currentHealth * 30)
  2050. / ((Entity) (obj)).maxHealth;
  2051. if (i1 > 30)
  2052. i1 = 30;
  2053. DrawingArea.drawPixels(5, spriteDrawY - 3,
  2054. spriteDrawX - 15, 65280, i1);
  2055. DrawingArea.drawPixels(5, spriteDrawY - 3,
  2056. (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2057. }
  2058. } catch (Exception e) {
  2059. }
  2060. }
  2061. for (int j1 = 0; j1 < 4; j1++)
  2062. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2063. npcScreenPos(((Entity) (obj)),
  2064. ((Entity) (obj)).height / 2);
  2065. if (spriteDrawX > -1) {
  2066. if (j1 == 1)
  2067. spriteDrawY -= 20;
  2068. if (j1 == 2) {
  2069. spriteDrawX -= 15;
  2070. spriteDrawY -= 10;
  2071. }
  2072. if (j1 == 3) {
  2073. spriteDrawX += 15;
  2074. spriteDrawY -= 10;
  2075. }
  2076. hitMarks[((Entity) (obj)).hitMarkTypes[j1]]
  2077. .drawSprite(spriteDrawX - 12,
  2078. spriteDrawY - 12);
  2079. smallText.drawText(0, String
  2080. .valueOf(((Entity) (obj)).hitArray[j1]),
  2081. spriteDrawY + 4, spriteDrawX);
  2082. smallText.drawText(0xffffff, String
  2083. .valueOf(((Entity) (obj)).hitArray[j1]),
  2084. spriteDrawY + 3, spriteDrawX - 1);
  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. public void delFriend(long l) {
  2214. try {
  2215. if (l == 0L)
  2216. return;
  2217. for (int i = 0; i < friendsCount; i++) {
  2218. if (friendsListAsLongs[i] != l)
  2219. continue;
  2220. friendsCount--;
  2221. needDrawTabArea = true;
  2222. for (int j = i; j < friendsCount; j++) {
  2223. friendsList[j] = friendsList[j + 1];
  2224. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2225. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2226. }
  2227.  
  2228. stream.createFrame(215);
  2229. stream.writeQWord(l);
  2230. break;
  2231. }
  2232. } catch (RuntimeException runtimeexception) {
  2233. signlink.reporterror("18622, " + false + ", " + l + ", "
  2234. + runtimeexception.toString());
  2235. throw new RuntimeException();
  2236. }
  2237. }
  2238.  
  2239. public void drawSideIcons() {
  2240. /* Top sideIcons */
  2241. if (tabInterfaceIDs[0] != -1)// attack
  2242. sideIcons[0].drawSprite(10, 4);
  2243. if (tabInterfaceIDs[1] != -1)// stat
  2244. sideIcons[1].drawSprite(43, 4);
  2245. if (tabInterfaceIDs[2] != -1)// quest
  2246. sideIcons[2].drawSprite(76, 3);
  2247. if (tabInterfaceIDs[3] != -1)// inventory
  2248. sideIcons[3].drawSprite(111, 5);
  2249. if (tabInterfaceIDs[4] != -1)// equipment
  2250. sideIcons[4].drawSprite(140, 1);
  2251. if (tabInterfaceIDs[5] != -1)// prayer
  2252. sideIcons[5].drawSprite(174, 1);
  2253. if (tabInterfaceIDs[6] != -1)// magic
  2254. sideIcons[6].drawSprite(208, 4);
  2255. /* Bottom sideIcons */
  2256. if (tabInterfaceIDs[7] != -1)// clan
  2257. sideIcons[7].drawSprite(11, 303);
  2258. if (tabInterfaceIDs[8] != -1)// friends
  2259. sideIcons[8].drawSprite(46, 306);
  2260. if (tabInterfaceIDs[9] != -1)// ignore
  2261. sideIcons[9].drawSprite(79, 306);
  2262. if (tabInterfaceIDs[10] != -1)// options
  2263. sideIcons[10].drawSprite(113, 300);
  2264. if (tabInterfaceIDs[11] != -1)// options
  2265. sideIcons[11].drawSprite(145, 304);
  2266. if (tabInterfaceIDs[12] != -1)// emotes
  2267. sideIcons[12].drawSprite(181, 302);
  2268. if (tabInterfaceIDs[13] != -1)// music
  2269. sideIcons[13].drawSprite(213, 303);
  2270. }
  2271.  
  2272. public void drawRedStones() {
  2273. if (tabInterfaceIDs[tabID] != -1) {
  2274. switch (tabID) {
  2275. case 0:
  2276. redStones[0].drawSprite(3, 0);
  2277. break;
  2278. case 1:
  2279. redStones[4].drawSprite(41, 0);
  2280. break;
  2281. case 2:
  2282. redStones[4].drawSprite(74, 0);
  2283. break;
  2284. case 3:
  2285. redStones[4].drawSprite(107, 0);
  2286. break;
  2287. case 4:
  2288. redStones[4].drawSprite(140, 0);
  2289. break;
  2290. case 5:
  2291. redStones[4].drawSprite(173, 0);
  2292. break;
  2293. case 6:
  2294. redStones[1].drawSprite(206, 0);
  2295. break;
  2296. case 7:
  2297. redStones[2].drawSprite(3, 298);
  2298. break;
  2299. case 8:
  2300. redStones[4].drawSprite(41, 298);
  2301. break;
  2302. case 9:
  2303. redStones[4].drawSprite(74, 298);
  2304. break;
  2305. case 10:
  2306. redStones[4].drawSprite(107, 298);
  2307. break;
  2308. case 11:
  2309. redStones[4].drawSprite(140, 298);
  2310. break;
  2311. case 12:
  2312. redStones[4].drawSprite(173, 298);
  2313. break;
  2314. case 13:
  2315. redStones[3].drawSprite(206, 298);
  2316. break;
  2317. }
  2318. }
  2319. }
  2320.  
  2321. private void drawTabArea() {
  2322. if (revision508 == true) {
  2323. aRSImageProducer_1163.initDrawingArea();
  2324. Texture.anIntArray1472 = anIntArray1181;
  2325. tabArea508.drawSprite(0, 0);
  2326. if (invOverlayInterfaceID == -1) {
  2327. drawRedStones();
  2328. drawSideIcons();
  2329. }
  2330. if (invOverlayInterfaceID != -1)
  2331. drawInterface(0, 30,
  2332. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2333. else if (tabInterfaceIDs[tabID] != -1)
  2334. drawInterface(0, 30,
  2335. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2336. if (menuOpen && menuScreenArea == 1)
  2337. drawMenu();
  2338. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2339. aRSImageProducer_1165.initDrawingArea();
  2340. Texture.anIntArray1472 = anIntArray1182;
  2341. }
  2342. if (revision474 == true) {
  2343. aRSImageProducer_1163.initDrawingArea();
  2344. Texture.anIntArray1472 = anIntArray1181;
  2345. tabArea474.drawSprite(0, 0);
  2346. if (invOverlayInterfaceID == -1) {
  2347. drawRedStones();
  2348. drawSideIcons();
  2349. }
  2350. if (invOverlayInterfaceID != -1)
  2351. drawInterface(0, 30,
  2352. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2353. else if (tabInterfaceIDs[tabID] != -1)
  2354. drawInterface(0, 30,
  2355. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2356. if (menuOpen && menuScreenArea == 1)
  2357. drawMenu();
  2358. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2359. aRSImageProducer_1165.initDrawingArea();
  2360. Texture.anIntArray1472 = anIntArray1182;
  2361. }
  2362. if (revision498 == true) {
  2363. aRSImageProducer_1163.initDrawingArea();
  2364. Texture.anIntArray1472 = anIntArray1181;
  2365. tabArea.drawSprite(0, 0);
  2366. if (invOverlayInterfaceID == -1) {
  2367. drawRedStones();
  2368. drawSideIcons();
  2369. }
  2370. if (invOverlayInterfaceID != -1)
  2371. drawInterface(0, 28,
  2372. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2373. else if (tabInterfaceIDs[tabID] != -1)
  2374. drawInterface(0, 28,
  2375. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2376. if (menuOpen && menuScreenArea == 1)
  2377. drawMenu();
  2378. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2379. aRSImageProducer_1165.initDrawingArea();
  2380. Texture.anIntArray1472 = anIntArray1182;
  2381. }
  2382. }
  2383.  
  2384. public void method37(int j) {
  2385. if (!lowMem) {
  2386. if (Texture.anIntArray1480[17] >= j) {
  2387. Background background = Texture.aBackgroundArray1474s[17];
  2388. int k = background.anInt1452 * background.anInt1453 - 1;
  2389. int j1 = background.anInt1452 * anInt945 * 2;
  2390. byte abyte0[] = background.aByteArray1450;
  2391. byte abyte3[] = aByteArray912;
  2392. for (int i2 = 0; i2 <= k; i2++)
  2393. abyte3[i2] = abyte0[i2 - j1 & k];
  2394.  
  2395. background.aByteArray1450 = abyte3;
  2396. aByteArray912 = abyte0;
  2397. Texture.method370(17);
  2398. anInt854++;
  2399. if (anInt854 > 1235) {
  2400. anInt854 = 0;
  2401. stream.createFrame(226);
  2402. stream.writeWordBigEndian(0);
  2403. int l2 = stream.currentOffset;
  2404. stream.writeWord(58722);
  2405. stream.writeWordBigEndian(240);
  2406. stream.writeWord((int) (Math.random() * 65536D));
  2407. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2408. if ((int) (Math.random() * 2D) == 0)
  2409. stream.writeWord(51825);
  2410. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2411. stream.writeWord((int) (Math.random() * 65536D));
  2412. stream.writeWord(7130);
  2413. stream.writeWord((int) (Math.random() * 65536D));
  2414. stream.writeWord(61657);
  2415. stream.writeBytes(stream.currentOffset - l2);
  2416. }
  2417. }
  2418. if (Texture.anIntArray1480[24] >= j) {
  2419. Background background_1 = Texture.aBackgroundArray1474s[24];
  2420. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2421. int k1 = background_1.anInt1452 * anInt945 * 2;
  2422. byte abyte1[] = background_1.aByteArray1450;
  2423. byte abyte4[] = aByteArray912;
  2424. for (int j2 = 0; j2 <= l; j2++)
  2425. abyte4[j2] = abyte1[j2 - k1 & l];
  2426.  
  2427. background_1.aByteArray1450 = abyte4;
  2428. aByteArray912 = abyte1;
  2429. Texture.method370(24);
  2430. }
  2431. if (Texture.anIntArray1480[34] >= j) {
  2432. Background background_2 = Texture.aBackgroundArray1474s[34];
  2433. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2434. int l1 = background_2.anInt1452 * anInt945 * 2;
  2435. byte abyte2[] = background_2.aByteArray1450;
  2436. byte abyte5[] = aByteArray912;
  2437. for (int k2 = 0; k2 <= i1; k2++)
  2438. abyte5[k2] = abyte2[k2 - l1 & i1];
  2439.  
  2440. background_2.aByteArray1450 = abyte5;
  2441. aByteArray912 = abyte2;
  2442. Texture.method370(34);
  2443. }
  2444. if (Texture.anIntArray1480[40] >= j) {
  2445. Background background_2 = Texture.aBackgroundArray1474s[40];
  2446. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2447. int l1 = background_2.anInt1452 * anInt945 * 2;
  2448. byte abyte2[] = background_2.aByteArray1450;
  2449. byte abyte5[] = aByteArray912;
  2450. for (int k2 = 0; k2 <= i1; k2++)
  2451. abyte5[k2] = abyte2[k2 - l1 & i1];
  2452. background_2.aByteArray1450 = abyte5;
  2453. aByteArray912 = abyte2;
  2454. Texture.method370(40);
  2455. }
  2456. }
  2457. }
  2458.  
  2459. public void method38() {
  2460. for (int i = -1; i < playerCount; i++) {
  2461. int j;
  2462. if (i == -1)
  2463. j = myPlayerIndex;
  2464. else
  2465. j = playerIndices[i];
  2466. Player player = playerArray[j];
  2467. if (player != null && player.textCycle > 0) {
  2468. player.textCycle--;
  2469. if (player.textCycle == 0)
  2470. player.textSpoken = null;
  2471. }
  2472. }
  2473. for (int k = 0; k < npcCount; k++) {
  2474. int l = npcIndices[k];
  2475. NPC npc = npcArray[l];
  2476. if (npc != null && npc.textCycle > 0) {
  2477. npc.textCycle--;
  2478. if (npc.textCycle == 0)
  2479. npc.textSpoken = null;
  2480. }
  2481. }
  2482. }
  2483.  
  2484. public void calcCameraPos() {
  2485. int i = anInt1098 * 128 + 64;
  2486. int j = anInt1099 * 128 + 64;
  2487. int k = method42(plane, j, i) - anInt1100;
  2488. if (xCameraPos < i) {
  2489. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2490. if (xCameraPos > i)
  2491. xCameraPos = i;
  2492. }
  2493. if (xCameraPos > i) {
  2494. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2495. if (xCameraPos < i)
  2496. xCameraPos = i;
  2497. }
  2498. if (zCameraPos < k) {
  2499. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2500. if (zCameraPos > k)
  2501. zCameraPos = k;
  2502. }
  2503. if (zCameraPos > k) {
  2504. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2505. if (zCameraPos < k)
  2506. zCameraPos = k;
  2507. }
  2508. if (yCameraPos < j) {
  2509. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2510. if (yCameraPos > j)
  2511. yCameraPos = j;
  2512. }
  2513. if (yCameraPos > j) {
  2514. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2515. if (yCameraPos < j)
  2516. yCameraPos = j;
  2517. }
  2518. i = anInt995 * 128 + 64;
  2519. j = anInt996 * 128 + 64;
  2520. k = method42(plane, j, i) - anInt997;
  2521. int l = i - xCameraPos;
  2522. int i1 = k - zCameraPos;
  2523. int j1 = j - yCameraPos;
  2524. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2525. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2526. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2527. if (l1 < 128)
  2528. l1 = 128;
  2529. if (l1 > 383)
  2530. l1 = 383;
  2531. if (yCameraCurve < l1) {
  2532. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2533. if (yCameraCurve > l1)
  2534. yCameraCurve = l1;
  2535. }
  2536. if (yCameraCurve > l1) {
  2537. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2538. if (yCameraCurve < l1)
  2539. yCameraCurve = l1;
  2540. }
  2541. int j2 = i2 - xCameraCurve;
  2542. if (j2 > 1024)
  2543. j2 -= 2048;
  2544. if (j2 < -1024)
  2545. j2 += 2048;
  2546. if (j2 > 0) {
  2547. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2548. xCameraCurve &= 0x7ff;
  2549. }
  2550. if (j2 < 0) {
  2551. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2552. xCameraCurve &= 0x7ff;
  2553. }
  2554. int k2 = i2 - xCameraCurve;
  2555. if (k2 > 1024)
  2556. k2 -= 2048;
  2557. if (k2 < -1024)
  2558. k2 += 2048;
  2559. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2560. xCameraCurve = i2;
  2561. }
  2562.  
  2563. public void drawMenu() {
  2564. int i = menuOffsetX;
  2565. int j = menuOffsetY;
  2566. int k = menuWidth;
  2567. int l = menuHeight + 1;
  2568. int i1 = 0x5d5447;
  2569. // DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2570. // DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2571. DrawingArea.drawPixels(l, j, i, i1, k);
  2572. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2573. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2574. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2575. int j1 = super.mouseX;
  2576. int k1 = super.mouseY;
  2577. if (menuScreenArea == 0) {
  2578. j1 -= 4;
  2579. k1 -= 4;
  2580. }
  2581. if (menuScreenArea == 1) {
  2582. j1 -= 519;
  2583. k1 -= 168;
  2584. }
  2585. if (menuScreenArea == 2) {
  2586. j1 -= 17;
  2587. k1 -= 338;
  2588. }
  2589. if (menuScreenArea == 3) {
  2590. j1 -= 519;
  2591. k1 -= 0;
  2592. }
  2593. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2594. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2595. int j2 = 0xffffff;
  2596. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2597. j2 = 0xffff00;
  2598. newBoldFont.drawBasicString(menuActionName[l1], i + 3, i2, j2, 0);
  2599. }
  2600. }
  2601.  
  2602. public void addFriend(long l) {
  2603. try {
  2604. if (l == 0L)
  2605. return;
  2606. if (friendsCount >= 100 && anInt1046 != 1) {
  2607. pushMessage(
  2608. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2609. 0, "");
  2610. return;
  2611. }
  2612. if (friendsCount >= 200) {
  2613. pushMessage(
  2614. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2615. 0, "");
  2616. return;
  2617. }
  2618. String s = TextClass.fixName(TextClass.nameForLong(l));
  2619. for (int i = 0; i < friendsCount; i++)
  2620. if (friendsListAsLongs[i] == l) {
  2621. pushMessage(s + " is already on your friend list", 0, "");
  2622. return;
  2623. }
  2624. for (int j = 0; j < ignoreCount; j++)
  2625. if (ignoreListAsLongs[j] == l) {
  2626. pushMessage("Please remove " + s
  2627. + " from your ignore list first", 0, "");
  2628. return;
  2629. }
  2630.  
  2631. if (s.equals(myPlayer.name)) {
  2632. return;
  2633. } else {
  2634. friendsList[friendsCount] = s;
  2635. friendsListAsLongs[friendsCount] = l;
  2636. friendsNodeIDs[friendsCount] = 0;
  2637. friendsCount++;
  2638. needDrawTabArea = true;
  2639. stream.createFrame(188);
  2640. stream.writeQWord(l);
  2641. return;
  2642. }
  2643. } catch (RuntimeException runtimeexception) {
  2644. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  2645. + runtimeexception.toString());
  2646. }
  2647. throw new RuntimeException();
  2648. }
  2649.  
  2650. private int method42(int i, int j, int k) {
  2651. int l = k >> 7;
  2652. int i1 = j >> 7;
  2653. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2654. return 0;
  2655. int j1 = i;
  2656. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2657. j1++;
  2658. int k1 = k & 0x7f;
  2659. int l1 = j & 0x7f;
  2660. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  2661. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2662. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  2663. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2664. return i2 * (128 - l1) + j2 * l1 >> 7;
  2665. }
  2666.  
  2667. public void resetLogout() {
  2668. try {
  2669. if (socketStream != null)
  2670. socketStream.close();
  2671. } catch (Exception _ex) {
  2672. }
  2673. socketStream = null;
  2674. loggedIn = false;
  2675. loginScreenState = 0;
  2676. // myUsername = "";
  2677. // myPassword = "";
  2678. unlinkMRUNodes();
  2679. worldController.initToNull();
  2680. for (int i = 0; i < 4; i++)
  2681. aClass11Array1230[i].method210();
  2682. System.gc();
  2683. stopMidi();
  2684. currentSong = -1;
  2685. nextSong = -1;
  2686. prevSong = 0;
  2687. }
  2688.  
  2689. public void method45() {
  2690. aBoolean1031 = true;
  2691. for (int j = 0; j < 7; j++) {
  2692. anIntArray1065[j] = -1;
  2693. for (int k = 0; k < IDK.length; k++) {
  2694. if (IDK.cache[k].aBoolean662
  2695. || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2696. continue;
  2697. anIntArray1065[j] = k;
  2698. break;
  2699. }
  2700. }
  2701. }
  2702.  
  2703. private void method46(int i, Stream stream) {
  2704. while (stream.bitPosition + 21 < i * 8) {
  2705. int k = stream.readBits(14);
  2706. if (k == 16383)
  2707. break;
  2708. if (npcArray[k] == null)
  2709. npcArray[k] = new NPC();
  2710. NPC npc = npcArray[k];
  2711. npcIndices[npcCount++] = k;
  2712. npc.anInt1537 = loopCycle;
  2713. int l = stream.readBits(5);
  2714. if (l > 15)
  2715. l -= 32;
  2716. int i1 = stream.readBits(5);
  2717. if (i1 > 15)
  2718. i1 -= 32;
  2719. int j1 = stream.readBits(1);
  2720. npc.desc = EntityDef.forID(stream.readBits(14));
  2721. int k1 = stream.readBits(1);
  2722. if (k1 == 1)
  2723. anIntArray894[anInt893++] = k;
  2724. npc.anInt1540 = npc.desc.aByte68;
  2725. npc.anInt1504 = npc.desc.anInt79;
  2726. npc.anInt1554 = npc.desc.walkAnim;
  2727. npc.anInt1555 = npc.desc.anInt58;
  2728. npc.anInt1556 = npc.desc.anInt83;
  2729. npc.anInt1557 = npc.desc.anInt55;
  2730. npc.anInt1511 = npc.desc.standAnim;
  2731. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2732. }
  2733. stream.finishBitAccess();
  2734. }
  2735.  
  2736. @Override
  2737. public void processGameLoop() {
  2738. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2739. return;
  2740. loopCycle++;
  2741. if (!loggedIn)
  2742. processLoginScreenInput();
  2743. else
  2744. mainGameProcessor();
  2745. processOnDemandQueue();
  2746. }
  2747.  
  2748. public void method47(boolean flag) {
  2749. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2750. destX = 0;
  2751. int j = playerCount;
  2752. if (flag)
  2753. j = 1;
  2754. for (int l = 0; l < j; l++) {
  2755. Player player;
  2756. int i1;
  2757. if (flag) {
  2758. player = myPlayer;
  2759. i1 = myPlayerIndex << 14;
  2760. } else {
  2761. player = playerArray[playerIndices[l]];
  2762. i1 = playerIndices[l] << 14;
  2763. }
  2764. if (player == null || !player.isVisible())
  2765. continue;
  2766. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  2767. && !flag && player.anInt1517 == player.anInt1511;
  2768. int j1 = player.x >> 7;
  2769. int k1 = player.y >> 7;
  2770. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2771. continue;
  2772. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  2773. && loopCycle < player.anInt1708) {
  2774. player.aBoolean1699 = false;
  2775. player.anInt1709 = method42(plane, player.y, player.x);
  2776. worldController.method286(plane, player.y, player,
  2777. player.anInt1552, player.anInt1722, player.x,
  2778. player.anInt1709, player.anInt1719, player.anInt1721,
  2779. i1, player.anInt1720);
  2780. continue;
  2781. }
  2782. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2783. if (anIntArrayArray929[j1][k1] == anInt1265)
  2784. continue;
  2785. anIntArrayArray929[j1][k1] = anInt1265;
  2786. }
  2787. player.anInt1709 = method42(plane, player.y, player.x);
  2788. worldController.method285(plane, player.anInt1552,
  2789. player.anInt1709, i1, player.y, 60, player.x, player,
  2790. player.aBoolean1541);
  2791. }
  2792. }
  2793.  
  2794. private boolean promptUserForInput(RSInterface class9) {
  2795. int j = class9.contentType;
  2796. if (anInt900 == 2) {
  2797. if (j == 201) {
  2798. inputTaken = true;
  2799. inputDialogState = 0;
  2800. messagePromptRaised = true;
  2801. promptInput = "";
  2802. friendsListAction = 1;
  2803. aString1121 = "Enter name of friend to add to list";
  2804. }
  2805. if (j == 202) {
  2806. inputTaken = true;
  2807. inputDialogState = 0;
  2808. messagePromptRaised = true;
  2809. promptInput = "";
  2810. friendsListAction = 2;
  2811. aString1121 = "Enter name of friend to delete from list";
  2812. }
  2813. }
  2814. if (j == 205) {
  2815. anInt1011 = 250;
  2816. return true;
  2817. }
  2818. if (j == 501) {
  2819. inputTaken = true;
  2820. inputDialogState = 0;
  2821. messagePromptRaised = true;
  2822. promptInput = "";
  2823. friendsListAction = 4;
  2824. aString1121 = "Enter name of player to add to list";
  2825. }
  2826. if (j == 502) {
  2827. inputTaken = true;
  2828. inputDialogState = 0;
  2829. messagePromptRaised = true;
  2830. promptInput = "";
  2831. friendsListAction = 5;
  2832. aString1121 = "Enter name of player to delete from list";
  2833. }
  2834. if (j == 550) {
  2835. inputTaken = true;
  2836. inputDialogState = 0;
  2837. messagePromptRaised = true;
  2838. promptInput = "";
  2839. friendsListAction = 6;
  2840. aString1121 = "Enter the name of the chat you wish to join";
  2841. }
  2842. if (j >= 300 && j <= 313) {
  2843. int k = (j - 300) / 2;
  2844. int j1 = j & 1;
  2845. int i2 = anIntArray1065[k];
  2846. if (i2 != -1) {
  2847. do {
  2848. if (j1 == 0 && --i2 < 0)
  2849. i2 = IDK.length - 1;
  2850. if (j1 == 1 && ++i2 >= IDK.length)
  2851. i2 = 0;
  2852. } while (IDK.cache[i2].aBoolean662
  2853. || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2854. anIntArray1065[k] = i2;
  2855. aBoolean1031 = true;
  2856. }
  2857. }
  2858. if (j >= 314 && j <= 323) {
  2859. int l = (j - 314) / 2;
  2860. int k1 = j & 1;
  2861. int j2 = anIntArray990[l];
  2862. if (k1 == 0 && --j2 < 0)
  2863. j2 = anIntArrayArray1003[l].length - 1;
  2864. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2865. j2 = 0;
  2866. anIntArray990[l] = j2;
  2867. aBoolean1031 = true;
  2868. }
  2869. if (j == 324 && !aBoolean1047) {
  2870. aBoolean1047 = true;
  2871. method45();
  2872. }
  2873. if (j == 325 && aBoolean1047) {
  2874. aBoolean1047 = false;
  2875. method45();
  2876. }
  2877. if (j == 326) {
  2878. stream.createFrame(101);
  2879. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2880. for (int i1 = 0; i1 < 7; i1++)
  2881. stream.writeWordBigEndian(anIntArray1065[i1]);
  2882.  
  2883. for (int l1 = 0; l1 < 5; l1++)
  2884. stream.writeWordBigEndian(anIntArray990[l1]);
  2885.  
  2886. return true;
  2887. }
  2888. if (j == 613)
  2889. canMute = !canMute;
  2890. if (j >= 601 && j <= 612) {
  2891. clearTopInterfaces();
  2892. if (reportAbuseInput.length() > 0) {
  2893. stream.createFrame(218);
  2894. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2895. stream.writeWordBigEndian(j - 601);
  2896. stream.writeWordBigEndian(canMute ? 1 : 0);
  2897. }
  2898. }
  2899. return false;
  2900. }
  2901.  
  2902. public void method49(Stream stream) {
  2903. for (int j = 0; j < anInt893; j++) {
  2904. int k = anIntArray894[j];
  2905. Player player = playerArray[k];
  2906. int l = stream.readUnsignedByte();
  2907. if ((l & 0x40) != 0)
  2908. l += stream.readUnsignedByte() << 8;
  2909. method107(l, k, stream, player);
  2910. }
  2911. }
  2912.  
  2913. public void method50(int i, int k, int l, int i1, int j1) {
  2914. int k1 = worldController.method300(j1, l, i);
  2915. if (k1 != 0) {
  2916. int l1 = worldController.method304(j1, l, i, k1);
  2917. int k2 = l1 >> 6 & 3;
  2918. int i3 = l1 & 0x1f;
  2919. int k3 = k;
  2920. if (k1 > 0)
  2921. k3 = i1;
  2922. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2923. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2924. int i5 = k1 >> 14 & 0x7fff;
  2925. ObjectDef class46_2 = ObjectDef.forID(i5);
  2926. if (class46_2.anInt758 != -1) {
  2927. Background background_2 = mapScenes[class46_2.anInt758];
  2928. if (background_2 != null) {
  2929. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2930. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2931. background_2.drawBackground(48 + l * 4 + i6, 48
  2932. + (104 - i - class46_2.anInt761) * 4 + j6);
  2933. }
  2934. } else {
  2935. if (i3 == 0 || i3 == 2)
  2936. if (k2 == 0) {
  2937. ai[k4] = k3;
  2938. ai[k4 + 512] = k3;
  2939. ai[k4 + 1024] = k3;
  2940. ai[k4 + 1536] = k3;
  2941. } else if (k2 == 1) {
  2942. ai[k4] = k3;
  2943. ai[k4 + 1] = k3;
  2944. ai[k4 + 2] = k3;
  2945. ai[k4 + 3] = k3;
  2946. } else if (k2 == 2) {
  2947. ai[k4 + 3] = k3;
  2948. ai[k4 + 3 + 512] = k3;
  2949. ai[k4 + 3 + 1024] = k3;
  2950. ai[k4 + 3 + 1536] = k3;
  2951. } else if (k2 == 3) {
  2952. ai[k4 + 1536] = k3;
  2953. ai[k4 + 1536 + 1] = k3;
  2954. ai[k4 + 1536 + 2] = k3;
  2955. ai[k4 + 1536 + 3] = k3;
  2956. }
  2957. if (i3 == 3)
  2958. if (k2 == 0)
  2959. ai[k4] = k3;
  2960. else if (k2 == 1)
  2961. ai[k4 + 3] = k3;
  2962. else if (k2 == 2)
  2963. ai[k4 + 3 + 1536] = k3;
  2964. else if (k2 == 3)
  2965. ai[k4 + 1536] = k3;
  2966. if (i3 == 2)
  2967. if (k2 == 3) {
  2968. ai[k4] = k3;
  2969. ai[k4 + 512] = k3;
  2970. ai[k4 + 1024] = k3;
  2971. ai[k4 + 1536] = k3;
  2972. } else if (k2 == 0) {
  2973. ai[k4] = k3;
  2974. ai[k4 + 1] = k3;
  2975. ai[k4 + 2] = k3;
  2976. ai[k4 + 3] = k3;
  2977. } else if (k2 == 1) {
  2978. ai[k4 + 3] = k3;
  2979. ai[k4 + 3 + 512] = k3;
  2980. ai[k4 + 3 + 1024] = k3;
  2981. ai[k4 + 3 + 1536] = k3;
  2982. } else if (k2 == 2) {
  2983. ai[k4 + 1536] = k3;
  2984. ai[k4 + 1536 + 1] = k3;
  2985. ai[k4 + 1536 + 2] = k3;
  2986. ai[k4 + 1536 + 3] = k3;
  2987. }
  2988. }
  2989. }
  2990. k1 = worldController.method302(j1, l, i);
  2991. if (k1 != 0) {
  2992. int i2 = worldController.method304(j1, l, i, k1);
  2993. int l2 = i2 >> 6 & 3;
  2994. int j3 = i2 & 0x1f;
  2995. int l3 = k1 >> 14 & 0x7fff;
  2996. ObjectDef class46_1 = ObjectDef.forID(l3);
  2997. if (class46_1.anInt758 != -1) {
  2998. Background background_1 = mapScenes[class46_1.anInt758];
  2999. if (background_1 != null) {
  3000. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3001. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3002. background_1.drawBackground(48 + l * 4 + j5, 48
  3003. + (104 - i - class46_1.anInt761) * 4 + k5);
  3004. }
  3005. } else if (j3 == 9) {
  3006. int l4 = 0xeeeeee;
  3007. if (k1 > 0)
  3008. l4 = 0xee0000;
  3009. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3010. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3011. if (l2 == 0 || l2 == 2) {
  3012. ai1[l5 + 1536] = l4;
  3013. ai1[l5 + 1024 + 1] = l4;
  3014. ai1[l5 + 512 + 2] = l4;
  3015. ai1[l5 + 3] = l4;
  3016. } else {
  3017. ai1[l5] = l4;
  3018. ai1[l5 + 512 + 1] = l4;
  3019. ai1[l5 + 1024 + 2] = l4;
  3020. ai1[l5 + 1536 + 3] = l4;
  3021. }
  3022. }
  3023. }
  3024. k1 = worldController.method303(j1, l, i);
  3025. if (k1 != 0) {
  3026. int j2 = k1 >> 14 & 0x7fff;
  3027. ObjectDef class46 = ObjectDef.forID(j2);
  3028. if (class46.anInt758 != -1) {
  3029. Background background = mapScenes[class46.anInt758];
  3030. if (background != null) {
  3031. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3032. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3033. background.drawBackground(48 + l * 4 + i4, 48
  3034. + (104 - i - class46.anInt761) * 4 + j4);
  3035. }
  3036. }
  3037. }
  3038. }
  3039.  
  3040. public void loadTitleScreen() {
  3041. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  3042. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  3043. aBackgroundArray1152s = new Background[12];
  3044. int j = 0;
  3045. try {
  3046. j = Integer.parseInt(getParameter("fl_icon"));
  3047. } catch (Exception _ex) {
  3048. }
  3049. if (j == 0) {
  3050. for (int k = 0; k < 12; k++)
  3051. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3052. "runes", k);
  3053.  
  3054. } else {
  3055. for (int l = 0; l < 12; l++)
  3056. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3057. "runes", 12 + (l & 3));
  3058.  
  3059. }
  3060. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3061. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3062. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0,
  3063. aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3064.  
  3065. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0,
  3066. aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3067.  
  3068. anIntArray851 = new int[256];
  3069. for (int k1 = 0; k1 < 64; k1++)
  3070. anIntArray851[k1] = k1 * 0x40000;
  3071.  
  3072. for (int l1 = 0; l1 < 64; l1++)
  3073. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3074.  
  3075. for (int i2 = 0; i2 < 64; i2++)
  3076. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3077.  
  3078. for (int j2 = 0; j2 < 64; j2++)
  3079. anIntArray851[j2 + 192] = 0xffffff;
  3080.  
  3081. anIntArray852 = new int[256];
  3082. for (int k2 = 0; k2 < 64; k2++)
  3083. anIntArray852[k2] = k2 * 1024;
  3084.  
  3085. for (int l2 = 0; l2 < 64; l2++)
  3086. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3087.  
  3088. for (int i3 = 0; i3 < 64; i3++)
  3089. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3090.  
  3091. for (int j3 = 0; j3 < 64; j3++)
  3092. anIntArray852[j3 + 192] = 0xffffff;
  3093.  
  3094. anIntArray853 = new int[256];
  3095. for (int k3 = 0; k3 < 64; k3++)
  3096. anIntArray853[k3] = k3 * 4;
  3097.  
  3098. for (int l3 = 0; l3 < 64; l3++)
  3099. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3100.  
  3101. for (int i4 = 0; i4 < 64; i4++)
  3102. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3103.  
  3104. for (int j4 = 0; j4 < 64; j4++)
  3105. anIntArray853[j4 + 192] = 0xffffff;
  3106.  
  3107. anIntArray850 = new int[256];
  3108. anIntArray1190 = new int[32768];
  3109. anIntArray1191 = new int[32768];
  3110. randomizeBackground(null);
  3111. anIntArray828 = new int[32768];
  3112. anIntArray829 = new int[32768];
  3113. drawLoadingText(10, "Connecting to fileserver");
  3114. if (!aBoolean831) {
  3115. drawFlames = true;
  3116. aBoolean831 = true;
  3117. startRunnable(this, 2);
  3118. }
  3119. }
  3120.  
  3121. private static void setHighMem() {
  3122. WorldController.lowMem = false;
  3123. Texture.lowMem = false;
  3124. lowMem = false;
  3125. ObjectManager.lowMem = false;
  3126. ObjectDef.lowMem = false;
  3127. }
  3128.  
  3129. public static void main(String args[]) {
  3130. try {
  3131. nodeID = 10;
  3132. portOff = 0;
  3133. setHighMem();
  3134. isMembers = true;
  3135. signlink.storeid = 32;
  3136. signlink.startpriv(InetAddress.getLocalHost());
  3137. instance = new Jframe(args);
  3138. } catch (Exception exception) {
  3139. }
  3140. }
  3141.  
  3142. public static client instance;
  3143.  
  3144. public void loadingStages() {
  3145. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3146. aRSImageProducer_1165.initDrawingArea();
  3147. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151,
  3148. 257);
  3149. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.",
  3150. 150, 256);
  3151. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3152. loadingStage = 1;
  3153. aLong824 = System.currentTimeMillis();
  3154. }
  3155. if (loadingStage == 1) {
  3156. int j = method54();
  3157. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3158. signlink.reporterror(myUsername + " glcfb " + aLong1215 + ","
  3159. + j + "," + lowMem + "," + decompressors[0] + ","
  3160. + onDemandFetcher.getNodeCount() + "," + plane + ","
  3161. + anInt1069 + "," + anInt1070);
  3162. aLong824 = System.currentTimeMillis();
  3163. }
  3164. }
  3165. if (loadingStage == 2 && plane != anInt985) {
  3166. anInt985 = plane;
  3167. method24(plane);
  3168. }
  3169. }
  3170.  
  3171. private int method54() {
  3172. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3173. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1) {
  3174. System.out.println("MapID:" + anIntArray1235[i]);
  3175. if (anIntArray1235[i] == 1510)// just a test
  3176. anIntArray1235[i] = -1;
  3177. return -1;// null map files
  3178. }
  3179. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1) {
  3180. System.out.println("LandscapeID:" + anIntArray1236[i]);
  3181. if (anIntArray1236[i] == 1511)// just a test
  3182. anIntArray1236[i] = -1;
  3183. return -2;
  3184. }
  3185. }
  3186. boolean flag = true;
  3187. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3188. byte abyte0[] = aByteArrayArray1247[j];
  3189. if (abyte0 != null) {
  3190. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3191. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3192. if (aBoolean1159) {
  3193. k = 10;
  3194. l = 10;
  3195. }
  3196. flag &= ObjectManager.method189(k, abyte0, l);
  3197. }
  3198. }
  3199. if (!flag)
  3200. return -3;// couldn't parse all landscapes
  3201. if (aBoolean1080) {
  3202. return -4;
  3203. } else {
  3204. loadingStage = 2;
  3205. ObjectManager.anInt131 = plane;
  3206. method22();
  3207. stream.createFrame(121);
  3208. return 0;
  3209. }
  3210. }
  3211.  
  3212. public void method55() {
  3213. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3214. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3215. .reverseGetNext())
  3216. if (class30_sub2_sub4_sub4.anInt1597 != plane
  3217. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3218. class30_sub2_sub4_sub4.unlink();
  3219. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3220. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3221. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3222. if (npc != null && npc.x >= 0 && npc.x < 13312
  3223. && npc.y >= 0 && npc.y < 13312)
  3224. class30_sub2_sub4_sub4.method455(
  3225. loopCycle,
  3226. npc.y,
  3227. method42(class30_sub2_sub4_sub4.anInt1597,
  3228. npc.y, npc.x)
  3229. - class30_sub2_sub4_sub4.anInt1583,
  3230. npc.x);
  3231. }
  3232. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3233. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3234. Player player;
  3235. if (j == unknownInt10)
  3236. player = myPlayer;
  3237. else
  3238. player = playerArray[j];
  3239. if (player != null && player.x >= 0 && player.x < 13312
  3240. && player.y >= 0 && player.y < 13312)
  3241. class30_sub2_sub4_sub4.method455(
  3242. loopCycle,
  3243. player.y,
  3244. method42(class30_sub2_sub4_sub4.anInt1597,
  3245. player.y, player.x)
  3246. - class30_sub2_sub4_sub4.anInt1583,
  3247. player.x);
  3248. }
  3249. class30_sub2_sub4_sub4.method456(anInt945);
  3250. worldController.method285(plane,
  3251. class30_sub2_sub4_sub4.anInt1595,
  3252. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  3253. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  3254. (int) class30_sub2_sub4_sub4.aDouble1585,
  3255. class30_sub2_sub4_sub4, false);
  3256. }
  3257.  
  3258. }
  3259.  
  3260. @Override
  3261. public AppletContext getAppletContext() {
  3262. if (signlink.mainapp != null)
  3263. return signlink.mainapp.getAppletContext();
  3264. else
  3265. return super.getAppletContext();
  3266. }
  3267.  
  3268. public static String capitalize(String s) {
  3269. for (int i = 0; i < s.length(); i++) {
  3270. if (i == 0) {
  3271. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)),
  3272. s.substring(1));
  3273. }
  3274. if (!Character.isLetterOrDigit(s.charAt(i))) {
  3275. if (i + 1 < s.length()) {
  3276. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  3277. Character.toUpperCase(s.charAt(i + 1)),
  3278. s.substring(i + 2));
  3279. }
  3280. }
  3281. }
  3282. return s;
  3283. }
  3284.  
  3285. private void drawLogo() {
  3286. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3287. Sprite sprite = new Sprite(abyte0, this);
  3288. aRSImageProducer_1110.initDrawingArea();
  3289. sprite.method346(0, 0);
  3290. aRSImageProducer_1111.initDrawingArea();
  3291. sprite.method346(-637, 0);
  3292. aRSImageProducer_1107.initDrawingArea();
  3293. sprite.method346(-128, 0);
  3294. aRSImageProducer_1108.initDrawingArea();
  3295. sprite.method346(-202, -371);
  3296. aRSImageProducer_1109.initDrawingArea();
  3297. sprite.method346(-202, -171);
  3298. aRSImageProducer_1112.initDrawingArea();
  3299. sprite.method346(0, -265);
  3300. aRSImageProducer_1113.initDrawingArea();
  3301. sprite.method346(-562, -265);
  3302. aRSImageProducer_1114.initDrawingArea();
  3303. sprite.method346(-128, -171);
  3304. aRSImageProducer_1115.initDrawingArea();
  3305. sprite.method346(-562, -171);
  3306. int ai[] = new int[sprite.myWidth];
  3307. for (int j = 0; j < sprite.myHeight; j++) {
  3308. for (int k = 0; k < sprite.myWidth; k++)
  3309. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1)
  3310. + sprite.myWidth * j];
  3311.  
  3312. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j,
  3313. sprite.myWidth);
  3314. }
  3315. aRSImageProducer_1110.initDrawingArea();
  3316. sprite.method346(382, 0);
  3317. aRSImageProducer_1111.initDrawingArea();
  3318. sprite.method346(-255, 0);
  3319. aRSImageProducer_1107.initDrawingArea();
  3320. sprite.method346(254, 0);
  3321. aRSImageProducer_1108.initDrawingArea();
  3322. sprite.method346(180, -371);
  3323. aRSImageProducer_1109.initDrawingArea();
  3324. sprite.method346(180, -171);
  3325. aRSImageProducer_1112.initDrawingArea();
  3326. sprite.method346(382, -265);
  3327. aRSImageProducer_1113.initDrawingArea();
  3328. sprite.method346(-180, -265);
  3329. aRSImageProducer_1114.initDrawingArea();
  3330. sprite.method346(254, -171);
  3331. aRSImageProducer_1115.initDrawingArea();
  3332. sprite.method346(-180, -171);
  3333. sprite = new Sprite(titleStreamLoader, "logo", 0);
  3334. aRSImageProducer_1107.initDrawingArea();
  3335. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3336. sprite = null;
  3337. System.gc();
  3338. }
  3339.  
  3340. private void processOnDemandQueue() {
  3341. do {
  3342. OnDemandData onDemandData;
  3343. do {
  3344. onDemandData = onDemandFetcher.getNextNode();
  3345. if (onDemandData == null)
  3346. return;
  3347. if (onDemandData.dataType == 0) {
  3348. Model.method460(onDemandData.buffer, onDemandData.ID);
  3349. needDrawTabArea = true;
  3350. if (backDialogID != -1)
  3351. inputTaken = true;
  3352. }
  3353. if (onDemandData.dataType == 1 && onDemandData.buffer != null)
  3354. Class36.method529(onDemandData.buffer, onDemandData.ID);
  3355. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong
  3356. && onDemandData.buffer != null)
  3357. saveMidi(songChanging, onDemandData.buffer);
  3358. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3359. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3360. if (anIntArray1235[i] == onDemandData.ID) {
  3361. System.out.println("Floor Map Loaded: "
  3362. + anIntArray1235[i]);
  3363. // aByteArrayArray1183[i] =
  3364. // FileOperations.readFile("maps/floors/" +
  3365. // anIntArray1235[i]);
  3366. if (aByteArrayArray1183[i] == null)
  3367. aByteArrayArray1183[i] = onDemandData.buffer;
  3368. if (onDemandData.buffer == null)
  3369. anIntArray1235[i] = -1;
  3370. break;
  3371. }
  3372. if (anIntArray1236[i] != onDemandData.ID)
  3373. continue;
  3374. System.out.println("Object Map Loaded: "
  3375. + anIntArray1236[i]);
  3376. // aByteArrayArray1247[i] =
  3377. // FileOperations.readFile("maps/objects/" +
  3378. // anIntArray1236[i]);
  3379. if (aByteArrayArray1247[i] == null)
  3380. aByteArrayArray1247[i] = onDemandData.buffer;
  3381. if (onDemandData.buffer == null)
  3382. anIntArray1236[i] = -1;
  3383. break;
  3384. }
  3385.  
  3386. }
  3387. } while (onDemandData.dataType != 93
  3388. || !onDemandFetcher.method564(onDemandData.ID));
  3389. ObjectManager.method173(new Stream(onDemandData.buffer),
  3390. onDemandFetcher);
  3391. } while (true);
  3392. }
  3393.  
  3394. public void calcFlamesPosition() {
  3395. char c = '\u0100';
  3396. for (int j = 10; j < 117; j++) {
  3397. int k = (int) (Math.random() * 100D);
  3398. if (k < 50)
  3399. anIntArray828[j + (c - 2 << 7)] = 255;
  3400. }
  3401. for (int l = 0; l < 100; l++) {
  3402. int i1 = (int) (Math.random() * 124D) + 2;
  3403. int k1 = (int) (Math.random() * 128D) + 128;
  3404. int k2 = i1 + (k1 << 7);
  3405. anIntArray828[k2] = 192;
  3406. }
  3407.  
  3408. for (int j1 = 1; j1 < c - 1; j1++) {
  3409. for (int l1 = 1; l1 < 127; l1++) {
  3410. int l2 = l1 + (j1 << 7);
  3411. anIntArray829[l2] = (anIntArray828[l2 - 1]
  3412. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3413. }
  3414.  
  3415. }
  3416.  
  3417. anInt1275 += 128;
  3418. if (anInt1275 > anIntArray1190.length) {
  3419. anInt1275 -= anIntArray1190.length;
  3420. int i2 = (int) (Math.random() * 12D);
  3421. randomizeBackground(aBackgroundArray1152s[i2]);
  3422. }
  3423. for (int j2 = 1; j2 < c - 1; j2++) {
  3424. for (int i3 = 1; i3 < 127; i3++) {
  3425. int k3 = i3 + (j2 << 7);
  3426. int i4 = anIntArray829[k3 + 128]
  3427. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  3428. - 1] / 5;
  3429. if (i4 < 0)
  3430. i4 = 0;
  3431. anIntArray828[k3] = i4;
  3432. }
  3433.  
  3434. }
  3435.  
  3436. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3437.  
  3438. anIntArray969[c - 1] = (int) (Math.sin(loopCycle / 14D) * 16D
  3439. + Math.sin(loopCycle / 15D) * 14D + Math
  3440. .sin(loopCycle / 16D) * 12D);
  3441. if (anInt1040 > 0)
  3442. anInt1040 -= 4;
  3443. if (anInt1041 > 0)
  3444. anInt1041 -= 4;
  3445. if (anInt1040 == 0 && anInt1041 == 0) {
  3446. int l3 = (int) (Math.random() * 2000D);
  3447. if (l3 == 0)
  3448. anInt1040 = 1024;
  3449. if (l3 == 1)
  3450. anInt1041 = 1024;
  3451. }
  3452. }
  3453.  
  3454. private boolean saveWave(byte abyte0[], int i) {
  3455. return abyte0 == null || signlink.wavesave(abyte0, i);
  3456. }
  3457.  
  3458. public void method60(int i) {
  3459. RSInterface class9 = RSInterface.interfaceCache[i];
  3460. for (int j = 0; j < class9.children.length; j++) {
  3461. if (class9.children[j] == -1)
  3462. break;
  3463. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3464. if (class9_1.type == 1)
  3465. method60(class9_1.id);
  3466. class9_1.anInt246 = 0;
  3467. class9_1.anInt208 = 0;
  3468. }
  3469. }
  3470.  
  3471. public void drawHeadIcon() {
  3472. if (anInt855 != 2)
  3473. return;
  3474. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2,
  3475. (anInt935 - baseY << 7) + anInt938);
  3476. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  3477. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3478. }
  3479.  
  3480. private void mainGameProcessor() {
  3481. if (anInt1104 > 1)
  3482. anInt1104--;
  3483. if (anInt1011 > 0)
  3484. anInt1011--;
  3485. for (int j = 0; j < 5; j++)
  3486. if (!parsePacket())
  3487. break;
  3488.  
  3489. if (!loggedIn)
  3490. return;
  3491. synchronized (mouseDetection.syncObject) {
  3492. if (flagged) {
  3493. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3494. stream.createFrame(45);
  3495. stream.writeWordBigEndian(0);
  3496. int j2 = stream.currentOffset;
  3497. int j3 = 0;
  3498. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3499. if (j2 - stream.currentOffset >= 240)
  3500. break;
  3501. j3++;
  3502. int l4 = mouseDetection.coordsY[j4];
  3503. if (l4 < 0)
  3504. l4 = 0;
  3505. else if (l4 > 502)
  3506. l4 = 502;
  3507. int k5 = mouseDetection.coordsX[j4];
  3508. if (k5 < 0)
  3509. k5 = 0;
  3510. else if (k5 > 764)
  3511. k5 = 764;
  3512. int i6 = l4 * 765 + k5;
  3513. if (mouseDetection.coordsY[j4] == -1
  3514. && mouseDetection.coordsX[j4] == -1) {
  3515. k5 = -1;
  3516. l4 = -1;
  3517. i6 = 0x7ffff;
  3518. }
  3519. if (k5 == anInt1237 && l4 == anInt1238) {
  3520. if (anInt1022 < 2047)
  3521. anInt1022++;
  3522. } else {
  3523. int j6 = k5 - anInt1237;
  3524. anInt1237 = k5;
  3525. int k6 = l4 - anInt1238;
  3526. anInt1238 = l4;
  3527. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31
  3528. && k6 >= -32 && k6 <= 31) {
  3529. j6 += 32;
  3530. k6 += 32;
  3531. stream.writeWord((anInt1022 << 12) + (j6 << 6)
  3532. + k6);
  3533. anInt1022 = 0;
  3534. } else if (anInt1022 < 8) {
  3535. stream.writeDWordBigEndian(0x800000
  3536. + (anInt1022 << 19) + i6);
  3537. anInt1022 = 0;
  3538. } else {
  3539. stream.writeDWord(0xc0000000
  3540. + (anInt1022 << 19) + i6);
  3541. anInt1022 = 0;
  3542. }
  3543. }
  3544. }
  3545.  
  3546. stream.writeBytes(stream.currentOffset - j2);
  3547. if (j3 >= mouseDetection.coordsIndex) {
  3548. mouseDetection.coordsIndex = 0;
  3549. } else {
  3550. mouseDetection.coordsIndex -= j3;
  3551. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3552. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5
  3553. + j3];
  3554. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5
  3555. + j3];
  3556. }
  3557.  
  3558. }
  3559. }
  3560. } else {
  3561. mouseDetection.coordsIndex = 0;
  3562. }
  3563. }
  3564. if (super.clickMode3 != 0) {
  3565. long l = (super.aLong29 - aLong1220) / 50L;
  3566. if (l > 4095L)
  3567. l = 4095L;
  3568. aLong1220 = super.aLong29;
  3569. int k2 = super.saveClickY;
  3570. if (k2 < 0)
  3571. k2 = 0;
  3572. else if (k2 > 502)
  3573. k2 = 502;
  3574. int k3 = super.saveClickX;
  3575. if (k3 < 0)
  3576. k3 = 0;
  3577. else if (k3 > 764)
  3578. k3 = 764;
  3579. int k4 = k2 * 765 + k3;
  3580. int j5 = 0;
  3581. if (super.clickMode3 == 2)
  3582. j5 = 1;
  3583. int l5 = (int) l;
  3584. stream.createFrame(241);
  3585. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3586. }
  3587. if (anInt1016 > 0)
  3588. anInt1016--;
  3589. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  3590. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3591. aBoolean1017 = true;
  3592. if (aBoolean1017 && anInt1016 <= 0) {
  3593. anInt1016 = 20;
  3594. aBoolean1017 = false;
  3595. stream.createFrame(86);
  3596. stream.writeWord(anInt1184);
  3597. stream.method432(viewRotation);
  3598. }
  3599. if (super.awtFocus && !aBoolean954) {
  3600. aBoolean954 = true;
  3601. stream.createFrame(3);
  3602. stream.writeWordBigEndian(1);
  3603. }
  3604. if (!super.awtFocus && aBoolean954) {
  3605. aBoolean954 = false;
  3606. stream.createFrame(3);
  3607. stream.writeWordBigEndian(0);
  3608. }
  3609. loadingStages();
  3610. method115();
  3611. method90();
  3612. anInt1009++;
  3613. if (anInt1009 > 750)
  3614. dropClient();
  3615. method114();
  3616. method95();
  3617. method38();
  3618. anInt945++;
  3619. if (crossType != 0) {
  3620. crossIndex += 20;
  3621. if (crossIndex >= 400)
  3622. crossType = 0;
  3623. }
  3624. if (atInventoryInterfaceType != 0) {
  3625. atInventoryLoopCycle++;
  3626. if (atInventoryLoopCycle >= 15) {
  3627. if (atInventoryInterfaceType == 2)
  3628. needDrawTabArea = true;
  3629. if (atInventoryInterfaceType == 3)
  3630. inputTaken = true;
  3631. atInventoryInterfaceType = 0;
  3632. }
  3633. }
  3634. if (activeInterfaceType != 0) {
  3635. anInt989++;
  3636. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  3637. || super.mouseY > anInt1088 + 5
  3638. || super.mouseY < anInt1088 - 5)
  3639. aBoolean1242 = true;
  3640. if (super.clickMode2 == 0) {
  3641. if (activeInterfaceType == 2)
  3642. needDrawTabArea = true;
  3643. if (activeInterfaceType == 3)
  3644. inputTaken = true;
  3645. activeInterfaceType = 0;
  3646. if (aBoolean1242 && anInt989 >= 12) {
  3647. lastActiveInvInterface = -1;
  3648. processRightClick();
  3649. if (lastActiveInvInterface == anInt1084
  3650. && mouseInvInterfaceIndex != anInt1085) {
  3651. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3652. int j1 = 0;
  3653. if (anInt913 == 1 && class9.contentType == 206)
  3654. j1 = 1;
  3655. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3656. j1 = 0;
  3657. if (class9.aBoolean235) {
  3658. int l2 = anInt1085;
  3659. int l3 = mouseInvInterfaceIndex;
  3660. class9.inv[l3] = class9.inv[l2];
  3661. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3662. class9.inv[l2] = -1;
  3663. class9.invStackSizes[l2] = 0;
  3664. } else if (j1 == 1) {
  3665. int i3 = anInt1085;
  3666. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3667. if (i3 > i4) {
  3668. class9.swapInventoryItems(i3, i3 - 1);
  3669. i3--;
  3670. } else if (i3 < i4) {
  3671. class9.swapInventoryItems(i3, i3 + 1);
  3672. i3++;
  3673. }
  3674.  
  3675. } else {
  3676. class9.swapInventoryItems(anInt1085,
  3677. mouseInvInterfaceIndex);
  3678. }
  3679. stream.createFrame(214);
  3680. stream.method433(anInt1084);
  3681. stream.method424(j1);
  3682. stream.method433(anInt1085);
  3683. stream.method431(mouseInvInterfaceIndex);
  3684. }
  3685. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  3686. && menuActionRow > 2)
  3687. determineMenuSize();
  3688. else if (menuActionRow > 0)
  3689. doAction(menuActionRow - 1);
  3690. atInventoryLoopCycle = 10;
  3691. super.clickMode3 = 0;
  3692. }
  3693. }
  3694. if (WorldController.anInt470 != -1) {
  3695. int k = WorldController.anInt470;
  3696. int k1 = WorldController.anInt471;
  3697. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  3698. myPlayer.smallX[0], true, k);
  3699. WorldController.anInt470 = -1;
  3700. if (flag) {
  3701. crossX = super.saveClickX;
  3702. crossY = super.saveClickY;
  3703. crossType = 1;
  3704. crossIndex = 0;
  3705. }
  3706. }
  3707. if (super.clickMode3 == 1 && aString844 != null) {
  3708. aString844 = null;
  3709. inputTaken = true;
  3710. super.clickMode3 = 0;
  3711. }
  3712. if (!processMenuClick()) {
  3713. processMainScreenClick();
  3714. processTabClick();
  3715. processChatModeClick();
  3716. }
  3717. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3718. anInt1213++;
  3719. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3720. if (anInt1501 < 50 && !menuOpen) {
  3721. anInt1501++;
  3722. if (anInt1501 == 50) {
  3723. if (anInt1500 != 0) {
  3724. inputTaken = true;
  3725. }
  3726. if (anInt1044 != 0) {
  3727. needDrawTabArea = true;
  3728. }
  3729. }
  3730. }
  3731. } else if (anInt1501 > 0) {
  3732. anInt1501--;
  3733. }
  3734. if (loadingStage == 2)
  3735. method108();
  3736. if (loadingStage == 2 && aBoolean1160)
  3737. calcCameraPos();
  3738. for (int i1 = 0; i1 < 5; i1++)
  3739. anIntArray1030[i1]++;
  3740.  
  3741. method73();
  3742. super.idleTime++;
  3743. if (super.idleTime > 4500) {
  3744. anInt1011 = 250;
  3745. super.idleTime -= 500;
  3746. stream.createFrame(202);
  3747. }
  3748. anInt1010++;
  3749. if (anInt1010 > 50)
  3750. stream.createFrame(0);
  3751. try {
  3752. if (socketStream != null && stream.currentOffset > 0) {
  3753. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3754. stream.currentOffset = 0;
  3755. anInt1010 = 0;
  3756. }
  3757. } catch (IOException _ex) {
  3758. dropClient();
  3759. } catch (Exception exception) {
  3760. resetLogout();
  3761. }
  3762. }
  3763.  
  3764. public void method63() {
  3765. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  3766. .reverseGetFirst();
  3767. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  3768. .reverseGetNext())
  3769. if (class30_sub1.anInt1294 == -1) {
  3770. class30_sub1.anInt1302 = 0;
  3771. method89(class30_sub1);
  3772. } else {
  3773. class30_sub1.unlink();
  3774. }
  3775.  
  3776. }
  3777.  
  3778. private void resetImageProducers() {
  3779. if (aRSImageProducer_1107 != null)
  3780. return;
  3781. super.fullGameScreen = null;
  3782. aRSImageProducer_1166 = null;
  3783. aRSImageProducer_1164 = null;
  3784. aRSImageProducer_1163 = null;
  3785. aRSImageProducer_1165 = null;
  3786. aRSImageProducer_1125 = null;
  3787. aRSImageProducer_1110 = new RSImageProducer(128, 265,
  3788. getGameComponent());
  3789. DrawingArea.setAllPixelsToZero();
  3790. aRSImageProducer_1111 = new RSImageProducer(128, 265,
  3791. getGameComponent());
  3792. DrawingArea.setAllPixelsToZero();
  3793. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  3794. getGameComponent());
  3795. DrawingArea.setAllPixelsToZero();
  3796. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  3797. getGameComponent());
  3798. DrawingArea.setAllPixelsToZero();
  3799. aRSImageProducer_1109 = new RSImageProducer(360, 200,
  3800. getGameComponent());
  3801. DrawingArea.setAllPixelsToZero();
  3802. aRSImageProducer_1112 = new RSImageProducer(202, 238,
  3803. getGameComponent());
  3804. DrawingArea.setAllPixelsToZero();
  3805. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  3806. getGameComponent());
  3807. DrawingArea.setAllPixelsToZero();
  3808. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3809. DrawingArea.setAllPixelsToZero();
  3810. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3811. DrawingArea.setAllPixelsToZero();
  3812. if (titleStreamLoader != null) {
  3813. drawLogo();
  3814. loadTitleScreen();
  3815. }
  3816. welcomeScreenRaised = true;
  3817. }
  3818.  
  3819. public int rememberMe = 0;
  3820. public int loginButtonint;
  3821. public int rememberMehover;
  3822. public int textbox;
  3823. public int textbox1;
  3824.  
  3825. @Override
  3826. void drawLoadingText(int i, String s) {
  3827. anInt1079 = i;
  3828. aString1049 = s;
  3829. resetImageProducers();
  3830. if (titleStreamLoader == null) {
  3831. super.drawLoadingText(i, s);
  3832. return;
  3833. }
  3834. aRSImageProducer_1109.initDrawingArea();
  3835. char c = '\u0168';
  3836. char c1 = '\310';
  3837. byte byte1 = 20;
  3838. chatTextDrawingArea.drawText(0xffffff,
  3839. "RuneScape is loading - please wait...", c1 / 2 - 26 - byte1,
  3840. c / 2);
  3841. int j = c1 / 2 - 18 - byte1;
  3842. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0xa13900, j);
  3843. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3844. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0xbf2200, i * 3);
  3845. DrawingArea
  3846. .drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3847. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3848. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3849. if (welcomeScreenRaised) {
  3850. welcomeScreenRaised = false;
  3851. if (!aBoolean831) {
  3852. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3853. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3854. }
  3855. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3856. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3857. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3858. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3859. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3860. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3861. }
  3862. }
  3863.  
  3864. public void method65(int i, int j, int k, int l, RSInterface class9,
  3865. int i1, boolean flag, int j1) {
  3866. int anInt992;
  3867. if (aBoolean972)
  3868. anInt992 = 32;
  3869. else
  3870. anInt992 = 0;
  3871. aBoolean972 = false;
  3872. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3873. class9.scrollPosition -= anInt1213 * 4;
  3874. if (flag) {
  3875. needDrawTabArea = true;
  3876. }
  3877. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3878. class9.scrollPosition += anInt1213 * 4;
  3879. if (flag) {
  3880. needDrawTabArea = true;
  3881. }
  3882. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  3883. && l < (i1 + j) - 16 && anInt1213 > 0) {
  3884. int l1 = ((j - 32) * j) / j1;
  3885. if (l1 < 8)
  3886. l1 = 8;
  3887. int i2 = l - i1 - 16 - l1 / 2;
  3888. int j2 = j - 32 - l1;
  3889. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3890. if (flag)
  3891. needDrawTabArea = true;
  3892. aBoolean972 = true;
  3893. }
  3894. }
  3895.  
  3896. private boolean method66(int i, int j, int k) {
  3897. int i1 = i >> 14 & 0x7fff;
  3898. int j1 = worldController.method304(plane, k, j, i);
  3899. if (j1 == -1)
  3900. return false;
  3901. int k1 = j1 & 0x1f;
  3902. int l1 = j1 >> 6 & 3;
  3903. if (k1 == 10 || k1 == 11 || k1 == 22) {
  3904. ObjectDef class46 = ObjectDef.forID(i1);
  3905. int i2;
  3906. int j2;
  3907. if (l1 == 0 || l1 == 2) {
  3908. i2 = class46.anInt744;
  3909. j2 = class46.anInt761;
  3910. } else {
  3911. i2 = class46.anInt761;
  3912. j2 = class46.anInt744;
  3913. }
  3914. int k2 = class46.anInt768;
  3915. if (l1 != 0)
  3916. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3917. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j,
  3918. myPlayer.smallX[0], false, k);
  3919. } else {
  3920. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j,
  3921. myPlayer.smallX[0], false, k);
  3922. }
  3923. crossX = super.saveClickX;
  3924. crossY = super.saveClickY;
  3925. crossType = 2;
  3926. crossIndex = 0;
  3927. return true;
  3928. }
  3929.  
  3930. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  3931. int k) {
  3932. byte abyte0[] = null;
  3933. int l = 5;
  3934. try {
  3935. if (decompressors[0] != null)
  3936. abyte0 = decompressors[0].decompress(i);
  3937. } catch (Exception _ex) {
  3938. }
  3939. if (abyte0 != null) {
  3940. // aCRC32_930.reset();
  3941. // aCRC32_930.update(abyte0);
  3942. // int i1 = (int)aCRC32_930.getValue();
  3943. // if(i1 != j)
  3944. }
  3945. if (abyte0 != null) {
  3946. StreamLoader streamLoader = new StreamLoader(abyte0, s);
  3947. return streamLoader;
  3948. }
  3949. int j1 = 0;
  3950. while (abyte0 == null) {
  3951. String s2 = "Unknown error";
  3952. drawLoadingText(k, "Requesting " + s);
  3953. try {
  3954. int k1 = 0;
  3955. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3956. byte abyte1[] = new byte[6];
  3957. datainputstream.readFully(abyte1, 0, 6);
  3958. Stream stream = new Stream(abyte1);
  3959. stream.currentOffset = 3;
  3960. int i2 = stream.read3Bytes() + 6;
  3961. int j2 = 6;
  3962. abyte0 = new byte[i2];
  3963. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3964.  
  3965. while (j2 < i2) {
  3966. int l2 = i2 - j2;
  3967. if (l2 > 1000)
  3968. l2 = 1000;
  3969. int j3 = datainputstream.read(abyte0, j2, l2);
  3970. if (j3 < 0) {
  3971. s2 = "Length error: " + j2 + "/" + i2;
  3972. throw new IOException("EOF");
  3973. }
  3974. j2 += j3;
  3975. int k3 = (j2 * 100) / i2;
  3976. if (k3 != k1)
  3977. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3978. k1 = k3;
  3979. }
  3980. datainputstream.close();
  3981. try {
  3982. if (decompressors[0] != null)
  3983. decompressors[0].method234(abyte0.length, abyte0, i);
  3984. } catch (Exception _ex) {
  3985. decompressors[0] = null;
  3986. }
  3987. /*
  3988. * if(abyte0 != null) { aCRC32_930.reset();
  3989. * aCRC32_930.update(abyte0); int i3 =
  3990. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  3991. * j1++; s2 = "Checksum error: " + i3; } }
  3992. */
  3993. } catch (IOException ioexception) {
  3994. if (s2.equals("Unknown error"))
  3995. s2 = "Connection error";
  3996. abyte0 = null;
  3997. } catch (NullPointerException _ex) {
  3998. s2 = "Null error";
  3999. abyte0 = null;
  4000. if (!signlink.reporterror)
  4001. return null;
  4002. } catch (ArrayIndexOutOfBoundsException _ex) {
  4003. s2 = "Bounds error";
  4004. abyte0 = null;
  4005. if (!signlink.reporterror)
  4006. return null;
  4007. } catch (Exception _ex) {
  4008. s2 = "Unexpected error";
  4009. abyte0 = null;
  4010. if (!signlink.reporterror)
  4011. return null;
  4012. }
  4013. if (abyte0 == null) {
  4014. for (int l1 = l; l1 > 0; l1--) {
  4015. if (j1 >= 3) {
  4016. drawLoadingText(k, "Game updated - please reload page");
  4017. l1 = 10;
  4018. } else {
  4019. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4020. }
  4021. try {
  4022. Thread.sleep(1000L);
  4023. } catch (Exception _ex) {
  4024. }
  4025. }
  4026.  
  4027. l *= 2;
  4028. if (l > 60)
  4029. l = 60;
  4030. aBoolean872 = !aBoolean872;
  4031. }
  4032.  
  4033. }
  4034.  
  4035. StreamLoader streamLoader_1 = new StreamLoader(abyte0, s);
  4036. return streamLoader_1;
  4037. }
  4038.  
  4039. public void sendStringAsLong(String string) {
  4040. stream.createFrame(60);
  4041. stream.writeQWord(TextClass.longForName(string));
  4042. }
  4043.  
  4044. public void sendString(int identifier, String text) {
  4045. text = identifier + "," + text;
  4046. stream.createFrame(127);
  4047. stream.writeWordBigEndian(text.length() + 1);
  4048. stream.writeString(text);
  4049. }
  4050.  
  4051. public void dropClient() {
  4052. if (anInt1011 > 0) {
  4053. resetLogout();
  4054. return;
  4055. }
  4056. aRSImageProducer_1165.initDrawingArea();
  4057. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2);
  4058. DrawingArea.drawPixels(37, 3, 3, 0, 227);
  4059. aTextDrawingArea_1271.drawText(0, "Connection Lost", 19, 120);
  4060. aTextDrawingArea_1271.drawText(0xffffff, "Connection Lost", 18, 119);
  4061. aTextDrawingArea_1271
  4062. .drawText(0, "Please Wait - Reconnecting", 34, 117);
  4063. aTextDrawingArea_1271.drawText(0xffffff, "Please Wait - Reconnecting",
  4064. 34, 116);
  4065. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4066. anInt1021 = 0;
  4067. destX = 0;
  4068. RSSocket rsSocket = socketStream;
  4069. loggedIn = false;
  4070. loginFailures = 0;
  4071. login(myUsername, myPassword, true);
  4072. if (!loggedIn)
  4073. resetLogout();
  4074. try {
  4075. rsSocket.close();
  4076. } catch (Exception _ex) {
  4077. }
  4078. }
  4079.  
  4080. private void doAction(int i) {
  4081. if (i < 0)
  4082. return;
  4083. if (inputDialogState != 0) {
  4084. inputDialogState = 0;
  4085. inputTaken = true;
  4086. }
  4087. int j = menuActionCmd2[i];
  4088. int k = menuActionCmd3[i];
  4089. int l = menuActionID[i];
  4090. int i1 = menuActionCmd1[i];
  4091. if (l >= 2000)
  4092. l -= 2000;
  4093. if (l == 582) {
  4094. NPC npc = npcArray[i1];
  4095. if (npc != null) {
  4096. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  4097. myPlayer.smallX[0], false, npc.smallX[0]);
  4098. crossX = super.saveClickX;
  4099. crossY = super.saveClickY;
  4100. crossType = 2;
  4101. crossIndex = 0;
  4102. stream.createFrame(57);
  4103. stream.method432(anInt1285);
  4104. stream.method432(i1);
  4105. stream.method431(anInt1283);
  4106. stream.method432(anInt1284);
  4107. }
  4108. }
  4109. if (l == 234) {
  4110. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4111. myPlayer.smallX[0], false, j);
  4112. if (!flag1)
  4113. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4114. myPlayer.smallX[0], false, j);
  4115. crossX = super.saveClickX;
  4116. crossY = super.saveClickY;
  4117. crossType = 2;
  4118. crossIndex = 0;
  4119. stream.createFrame(236);
  4120. stream.method431(k + baseY);
  4121. stream.writeWord(i1);
  4122. stream.method431(j + baseX);
  4123. }
  4124. if (l == 62 && method66(i1, k, j)) {
  4125. stream.createFrame(192);
  4126. stream.writeWord(anInt1284);
  4127. stream.method431(i1 >> 14 & 0x7fff);
  4128. stream.method433(k + baseY);
  4129. stream.method431(anInt1283);
  4130. stream.method433(j + baseX);
  4131. stream.writeWord(anInt1285);
  4132. }
  4133.  
  4134. if (l == 511) {
  4135. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4136. myPlayer.smallX[0], false, j);
  4137. if (!flag2)
  4138. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4139. myPlayer.smallX[0], false, j);
  4140. crossX = super.saveClickX;
  4141. crossY = super.saveClickY;
  4142. crossType = 2;
  4143. crossIndex = 0;
  4144. stream.createFrame(25);
  4145. stream.method431(anInt1284);
  4146. stream.method432(anInt1285);
  4147. stream.writeWord(i1);
  4148. stream.method432(k + baseY);
  4149. stream.method433(anInt1283);
  4150. stream.writeWord(j + baseX);
  4151. }
  4152. if (l == 74) {
  4153. stream.createFrame(122);
  4154. stream.method433(k);
  4155. stream.method432(j);
  4156. stream.method431(i1);
  4157. atInventoryLoopCycle = 0;
  4158. atInventoryInterface = k;
  4159. atInventoryIndex = j;
  4160. atInventoryInterfaceType = 2;
  4161. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4162. atInventoryInterfaceType = 1;
  4163. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4164. atInventoryInterfaceType = 3;
  4165. }
  4166. if (l == 315) {
  4167. RSInterface class9 = RSInterface.interfaceCache[k];
  4168. boolean flag8 = true;
  4169. if (class9.contentType > 0)
  4170. flag8 = promptUserForInput(class9);
  4171. if (flag8) {
  4172.  
  4173. switch (k) {
  4174. case 19144:
  4175. sendFrame248(15106, 3213);
  4176. method60(15106);
  4177. inputTaken = true;
  4178. break;
  4179. default:
  4180. stream.createFrame(185);
  4181. stream.writeWord(k);
  4182. break;
  4183.  
  4184. }
  4185. }
  4186. }
  4187. if (l == 561) {
  4188. Player player = playerArray[i1];
  4189. if (player != null) {
  4190. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4191. player.smallY[0], myPlayer.smallX[0], false,
  4192. player.smallX[0]);
  4193. crossX = super.saveClickX;
  4194. crossY = super.saveClickY;
  4195. crossType = 2;
  4196. crossIndex = 0;
  4197. anInt1188 += i1;
  4198. if (anInt1188 >= 90) {
  4199. stream.createFrame(136);
  4200. anInt1188 = 0;
  4201. }
  4202. stream.createFrame(128);
  4203. stream.writeWord(i1);
  4204. }
  4205. }
  4206. if (l == 20) {
  4207. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4208. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4209. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4210. class30_sub2_sub4_sub1_sub1_1.smallY[0],
  4211. myPlayer.smallX[0], false,
  4212. class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  4213. crossX = super.saveClickX;
  4214. crossY = super.saveClickY;
  4215. crossType = 2;
  4216. crossIndex = 0;
  4217. stream.createFrame(155);
  4218. stream.method431(i1);
  4219. }
  4220. }
  4221. if (l == 779) {
  4222. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4223. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4224. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4225. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  4226. myPlayer.smallX[0], false,
  4227. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  4228. crossX = super.saveClickX;
  4229. crossY = super.saveClickY;
  4230. crossType = 2;
  4231. crossIndex = 0;
  4232. stream.createFrame(153);
  4233. stream.method431(i1);
  4234. }
  4235. }
  4236. if (l == 516)
  4237. if (!menuOpen)
  4238. worldController.method312(super.saveClickY - 4,
  4239. super.saveClickX - 4);
  4240. else
  4241. worldController.method312(k - 4, j - 4);
  4242. if (l == 1062) {
  4243. anInt924 += baseX;
  4244. if (anInt924 >= 113) {
  4245. stream.createFrame(183);
  4246. stream.writeDWordBigEndian(0xe63271);
  4247. anInt924 = 0;
  4248. }
  4249. method66(i1, k, j);
  4250. stream.createFrame(228);
  4251. stream.method432(i1 >> 14 & 0x7fff);
  4252. stream.method432(k + baseY);
  4253. stream.writeWord(j + baseX);
  4254. }
  4255. if (l == 679 && !aBoolean1149) {
  4256. stream.createFrame(40);
  4257. stream.writeWord(k);
  4258. aBoolean1149 = true;
  4259. }
  4260. if (l == 431) {
  4261. stream.createFrame(129);
  4262. stream.method432(j);
  4263. stream.writeWord(k);
  4264. stream.method432(i1);
  4265. atInventoryLoopCycle = 0;
  4266. atInventoryInterface = k;
  4267. atInventoryIndex = j;
  4268. atInventoryInterfaceType = 2;
  4269. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4270. atInventoryInterfaceType = 1;
  4271. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4272. atInventoryInterfaceType = 3;
  4273. }
  4274. if (l == 337 || l == 42 || l == 792 || l == 322) {
  4275. String s = menuActionName[i];
  4276. int k1 = s.indexOf("@whi@");
  4277. if (k1 != -1) {
  4278. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4279. if (l == 337)
  4280. addFriend(l3);
  4281. if (l == 42)
  4282. addIgnore(l3);
  4283. if (l == 792)
  4284. delFriend(l3);
  4285. if (l == 322)
  4286. delIgnore(l3);
  4287. }
  4288. }
  4289. if (l == 53) {
  4290. stream.createFrame(135);
  4291. stream.method431(j);
  4292. stream.method432(k);
  4293. stream.method431(i1);
  4294. atInventoryLoopCycle = 0;
  4295. atInventoryInterface = k;
  4296. atInventoryIndex = j;
  4297. atInventoryInterfaceType = 2;
  4298. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4299. atInventoryInterfaceType = 1;
  4300. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4301. atInventoryInterfaceType = 3;
  4302. }
  4303. if (l == 539) {
  4304. stream.createFrame(16);
  4305. stream.method432(i1);
  4306. stream.method433(j);
  4307. stream.method433(k);
  4308. atInventoryLoopCycle = 0;
  4309. atInventoryInterface = k;
  4310. atInventoryIndex = j;
  4311. atInventoryInterfaceType = 2;
  4312. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4313. atInventoryInterfaceType = 1;
  4314. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4315. atInventoryInterfaceType = 3;
  4316. }
  4317. if (l == 484 || l == 6) {
  4318. String s1 = menuActionName[i];
  4319. int l1 = s1.indexOf("@whi@");
  4320. if (l1 != -1) {
  4321. s1 = s1.substring(l1 + 5).trim();
  4322. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass
  4323. .longForName(s1)));
  4324. boolean flag9 = false;
  4325. for (int j3 = 0; j3 < playerCount; j3++) {
  4326. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4327. if (class30_sub2_sub4_sub1_sub2_7 == null
  4328. || class30_sub2_sub4_sub1_sub2_7.name == null
  4329. || !class30_sub2_sub4_sub1_sub2_7.name
  4330. .equalsIgnoreCase(s7))
  4331. continue;
  4332. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4333. class30_sub2_sub4_sub1_sub2_7.smallY[0],
  4334. myPlayer.smallX[0], false,
  4335. class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  4336. if (l == 484) {
  4337. stream.createFrame(39);
  4338. stream.method431(playerIndices[j3]);
  4339. }
  4340. if (l == 6) {
  4341. anInt1188 += i1;
  4342. if (anInt1188 >= 90) {
  4343. stream.createFrame(136);
  4344. anInt1188 = 0;
  4345. }
  4346. stream.createFrame(128);
  4347. stream.writeWord(playerIndices[j3]);
  4348. }
  4349. flag9 = true;
  4350. break;
  4351. }
  4352.  
  4353. if (!flag9)
  4354. pushMessage("Unable to find " + s7, 0, "");
  4355. }
  4356. }
  4357. if (l == 870) {
  4358. stream.createFrame(53);
  4359. stream.writeWord(j);
  4360. stream.method432(anInt1283);
  4361. stream.method433(i1);
  4362. stream.writeWord(anInt1284);
  4363. stream.method431(anInt1285);
  4364. stream.writeWord(k);
  4365. atInventoryLoopCycle = 0;
  4366. atInventoryInterface = k;
  4367. atInventoryIndex = j;
  4368. atInventoryInterfaceType = 2;
  4369. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4370. atInventoryInterfaceType = 1;
  4371. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4372. atInventoryInterfaceType = 3;
  4373. }
  4374. if (l == 847) {
  4375. stream.createFrame(87);
  4376. stream.method432(i1);
  4377. stream.writeWord(k);
  4378. stream.method432(j);
  4379. atInventoryLoopCycle = 0;
  4380. atInventoryInterface = k;
  4381. atInventoryIndex = j;
  4382. atInventoryInterfaceType = 2;
  4383. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4384. atInventoryInterfaceType = 1;
  4385. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4386. atInventoryInterfaceType = 3;
  4387. }
  4388. if (l == 626) {
  4389. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4390. spellSelected = 1;
  4391. spellID = class9_1.id;
  4392. anInt1137 = k;
  4393. spellUsableOn = class9_1.spellUsableOn;
  4394. itemSelected = 0;
  4395. needDrawTabArea = true;
  4396. spellID = class9_1.id;
  4397. String s4 = class9_1.selectedActionName;
  4398. if (s4.indexOf(" ") != -1)
  4399. s4 = s4.substring(0, s4.indexOf(" "));
  4400. String s8 = class9_1.selectedActionName;
  4401. if (s8.indexOf(" ") != -1)
  4402. s8 = s8.substring(s8.indexOf(" ") + 1);
  4403. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4404. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4405. // 0xffffff);
  4406. // class9_1.sprite1.drawSprite(200,200);
  4407. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4408. if (spellUsableOn == 16) {
  4409. needDrawTabArea = true;
  4410. tabID = 3;
  4411. tabAreaAltered = true;
  4412. }
  4413. return;
  4414. }
  4415. if (l == 78) {
  4416. stream.createFrame(117);
  4417. stream.method433(k);
  4418. stream.method433(i1);
  4419. stream.method431(j);
  4420. atInventoryLoopCycle = 0;
  4421. atInventoryInterface = k;
  4422. atInventoryIndex = j;
  4423. atInventoryInterfaceType = 2;
  4424. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4425. atInventoryInterfaceType = 1;
  4426. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4427. atInventoryInterfaceType = 3;
  4428. }
  4429. if (l == 27) {
  4430. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4431. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4432. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4433. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  4434. myPlayer.smallX[0], false,
  4435. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4436. crossX = super.saveClickX;
  4437. crossY = super.saveClickY;
  4438. crossType = 2;
  4439. crossIndex = 0;
  4440. anInt986 += i1;
  4441. if (anInt986 >= 54) {
  4442. stream.createFrame(189);
  4443. stream.writeWordBigEndian(234);
  4444. anInt986 = 0;
  4445. }
  4446. stream.createFrame(73);
  4447. stream.method431(i1);
  4448. }
  4449. }
  4450. if (l == 213) {
  4451. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4452. myPlayer.smallX[0], false, j);
  4453. if (!flag3)
  4454. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4455. myPlayer.smallX[0], false, j);
  4456. crossX = super.saveClickX;
  4457. crossY = super.saveClickY;
  4458. crossType = 2;
  4459. crossIndex = 0;
  4460. stream.createFrame(79);
  4461. stream.method431(k + baseY);
  4462. stream.writeWord(i1);
  4463. stream.method432(j + baseX);
  4464. }
  4465. if (l == 632) {
  4466. stream.createFrame(145);
  4467. stream.method432(k);
  4468. stream.method432(j);
  4469. stream.method432(i1);
  4470. atInventoryLoopCycle = 0;
  4471. atInventoryInterface = k;
  4472. atInventoryIndex = j;
  4473. atInventoryInterfaceType = 2;
  4474. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4475. atInventoryInterfaceType = 1;
  4476. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4477. atInventoryInterfaceType = 3;
  4478. }
  4479. if (l == 1050) {
  4480. if (!runClicked) {
  4481. runClicked = true;
  4482. stream.createFrame(185);
  4483. stream.writeWord(153);
  4484. } else {
  4485. runClicked = false;
  4486. stream.createFrame(185);
  4487. stream.writeWord(152);
  4488. }
  4489. }
  4490. if (l == 1004) {
  4491. if (tabInterfaceIDs[10] != -1) {
  4492. needDrawTabArea = true;
  4493. tabID = 10;
  4494. tabAreaAltered = true;
  4495. }
  4496. }
  4497. if (l == 1003) {
  4498. clanChatMode = 2;
  4499. inputTaken = true;
  4500. }
  4501. if (l == 1002) {
  4502. clanChatMode = 1;
  4503. inputTaken = true;
  4504. }
  4505. if (l == 1001) {
  4506. clanChatMode = 0;
  4507. inputTaken = true;
  4508. }
  4509. if (l == 1000) {
  4510. cButtonCPos = 4;
  4511. chatTypeView = 11;
  4512. inputTaken = true;
  4513. }
  4514. if (l == 999) {
  4515. cButtonCPos = 0;
  4516. chatTypeView = 0;
  4517. inputTaken = true;
  4518. }
  4519. if (l == 998) {
  4520. cButtonCPos = 1;
  4521. chatTypeView = 5;
  4522. inputTaken = true;
  4523. }
  4524. if (l == 997) {
  4525. publicChatMode = 3;
  4526. inputTaken = true;
  4527. }
  4528. if (l == 996) {
  4529. publicChatMode = 2;
  4530. inputTaken = true;
  4531. }
  4532. if (l == 995) {
  4533. publicChatMode = 1;
  4534. inputTaken = true;
  4535. }
  4536. if (l == 994) {
  4537. publicChatMode = 0;
  4538. inputTaken = true;
  4539. }
  4540. if (l == 993) {
  4541. cButtonCPos = 2;
  4542. chatTypeView = 1;
  4543. inputTaken = true;
  4544. }
  4545. if (l == 992) {
  4546. privateChatMode = 2;
  4547. inputTaken = true;
  4548. }
  4549. if (l == 991) {
  4550. privateChatMode = 1;
  4551. inputTaken = true;
  4552. }
  4553. if (l == 990) {
  4554. privateChatMode = 0;
  4555. inputTaken = true;
  4556. }
  4557. if (l == 989) {
  4558. cButtonCPos = 3;
  4559. chatTypeView = 2;
  4560. inputTaken = true;
  4561. }
  4562. if (l == 987) {
  4563. tradeMode = 2;
  4564. inputTaken = true;
  4565. }
  4566. if (l == 986) {
  4567. tradeMode = 1;
  4568. inputTaken = true;
  4569. }
  4570. if (l == 985) {
  4571. tradeMode = 0;
  4572. inputTaken = true;
  4573. }
  4574. if (l == 984) {
  4575. cButtonCPos = 5;
  4576. chatTypeView = 3;
  4577. inputTaken = true;
  4578. }
  4579. if (l == 983) {
  4580. duelMode = 2;
  4581. inputTaken = true;
  4582. }
  4583. if (l == 982) {
  4584. duelMode = 1;
  4585. inputTaken = true;
  4586. }
  4587. if (l == 981) {
  4588. duelMode = 0;
  4589. inputTaken = true;
  4590. }
  4591. if (l == 980) {
  4592. cButtonCPos = 6;
  4593. chatTypeView = 4;
  4594. inputTaken = true;
  4595. }
  4596. if (l == 493) {
  4597. stream.createFrame(75);
  4598. stream.method433(k);
  4599. stream.method431(j);
  4600. stream.method432(i1);
  4601. atInventoryLoopCycle = 0;
  4602. atInventoryInterface = k;
  4603. atInventoryIndex = j;
  4604. atInventoryInterfaceType = 2;
  4605. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4606. atInventoryInterfaceType = 1;
  4607. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4608. atInventoryInterfaceType = 3;
  4609. }
  4610. if (l == 652) {
  4611. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4612. myPlayer.smallX[0], false, j);
  4613. if (!flag4)
  4614. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4615. myPlayer.smallX[0], false, j);
  4616. crossX = super.saveClickX;
  4617. crossY = super.saveClickY;
  4618. crossType = 2;
  4619. crossIndex = 0;
  4620. stream.createFrame(156);
  4621. stream.method432(j + baseX);
  4622. stream.method431(k + baseY);
  4623. stream.method433(i1);
  4624. }
  4625. if (l == 94) {
  4626. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4627. myPlayer.smallX[0], false, j);
  4628. if (!flag5)
  4629. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4630. myPlayer.smallX[0], false, j);
  4631. crossX = super.saveClickX;
  4632. crossY = super.saveClickY;
  4633. crossType = 2;
  4634. crossIndex = 0;
  4635. stream.createFrame(181);
  4636. stream.method431(k + baseY);
  4637. stream.writeWord(i1);
  4638. stream.method431(j + baseX);
  4639. stream.method432(anInt1137);
  4640. }
  4641. // clan chat
  4642. if (l == 647) {
  4643. stream.createFrame(213);
  4644. stream.writeWord(k);
  4645. stream.writeWord(j);
  4646. switch (k) {
  4647. case 18304:
  4648. if (j == 0) {
  4649. inputTaken = true;
  4650. inputDialogState = 0;
  4651. messagePromptRaised = true;
  4652. promptInput = "";
  4653. friendsListAction = 8;
  4654. aString1121 = "Enter your clan chat title";
  4655. }
  4656. break;
  4657. }
  4658. }
  4659. if (l == 646) {
  4660. stream.createFrame(185);
  4661. stream.writeWord(k);
  4662. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4663. if (class9_2.valueIndexArray != null
  4664. && class9_2.valueIndexArray[0][0] == 5) {
  4665. int i2 = class9_2.valueIndexArray[0][1];
  4666. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  4667. variousSettings[i2] = class9_2.anIntArray212[0];
  4668. method33(i2);
  4669. needDrawTabArea = true;
  4670. }
  4671. }
  4672. switch (k) {
  4673. // clan chat
  4674. case 18129:
  4675. if (RSInterface.interfaceCache[18135].message.toLowerCase()
  4676. .contains("join")) {
  4677. inputTaken = true;
  4678. inputDialogState = 0;
  4679. messagePromptRaised = true;
  4680. promptInput = "";
  4681. friendsListAction = 6;
  4682. aString1121 = "Enter the name of the chat you wish to join";
  4683. } else {
  4684. sendString(0, "");
  4685. }
  4686. break;
  4687. case 18132:
  4688. openInterfaceID = 18300;
  4689. break;
  4690. case 18526:
  4691. inputTaken = true;
  4692. inputDialogState = 0;
  4693. messagePromptRaised = true;
  4694. promptInput = "";
  4695. friendsListAction = 9;
  4696. aString1121 = "Enter a name to add";
  4697. break;
  4698. case 18527:
  4699. inputTaken = true;
  4700. inputDialogState = 0;
  4701. messagePromptRaised = true;
  4702. promptInput = "";
  4703. friendsListAction = 10;
  4704. aString1121 = "Enter a name to add";
  4705. break;
  4706. }
  4707. }
  4708. if (l == 225) {
  4709. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4710. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4711. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4712. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  4713. myPlayer.smallX[0], false,
  4714. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4715. crossX = super.saveClickX;
  4716. crossY = super.saveClickY;
  4717. crossType = 2;
  4718. crossIndex = 0;
  4719. anInt1226 += i1;
  4720. if (anInt1226 >= 85) {
  4721. stream.createFrame(230);
  4722. stream.writeWordBigEndian(239);
  4723. anInt1226 = 0;
  4724. }
  4725. stream.createFrame(17);
  4726. stream.method433(i1);
  4727. }
  4728. }
  4729. if (l == 965) {
  4730. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4731. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4732. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4733. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  4734. myPlayer.smallX[0], false,
  4735. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4736. crossX = super.saveClickX;
  4737. crossY = super.saveClickY;
  4738. crossType = 2;
  4739. crossIndex = 0;
  4740. anInt1134++;
  4741. if (anInt1134 >= 96) {
  4742. stream.createFrame(152);
  4743. stream.writeWordBigEndian(88);
  4744. anInt1134 = 0;
  4745. }
  4746. stream.createFrame(21);
  4747. stream.writeWord(i1);
  4748. }
  4749. }
  4750. if (l == 413) {
  4751. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4752. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4753. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4754. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  4755. myPlayer.smallX[0], false,
  4756. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4757. crossX = super.saveClickX;
  4758. crossY = super.saveClickY;
  4759. crossType = 2;
  4760. crossIndex = 0;
  4761. stream.createFrame(131);
  4762. stream.method433(i1);
  4763. stream.method432(anInt1137);
  4764. }
  4765. }
  4766. if (l == 200)
  4767. clearTopInterfaces();
  4768. if (l == 1025) {
  4769. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4770. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4771. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4772. if (entityDef.childrenIDs != null)
  4773. entityDef = entityDef.method161();
  4774. if (entityDef != null) {
  4775. String s9;
  4776. if (entityDef.description != null)
  4777. s9 = new String(entityDef.description);
  4778. else
  4779. s9 = "It's a " + entityDef.name + ".";
  4780. pushMessage(s9, 0, "");
  4781. }
  4782. }
  4783. }
  4784. if (l == 900) {
  4785. method66(i1, k, j);
  4786. stream.createFrame(252);
  4787. stream.method433(i1 >> 14 & 0x7fff);
  4788. stream.method431(k + baseY);
  4789. stream.method432(j + baseX);
  4790. }
  4791. if (l == 412) {
  4792. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4793. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4794. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4795. class30_sub2_sub4_sub1_sub1_6.smallY[0],
  4796. myPlayer.smallX[0], false,
  4797. class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  4798. crossX = super.saveClickX;
  4799. crossY = super.saveClickY;
  4800. crossType = 2;
  4801. crossIndex = 0;
  4802. stream.createFrame(72);
  4803. stream.method432(i1);
  4804. }
  4805. }
  4806. if (l == 365) {
  4807. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4808. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4809. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4810. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  4811. myPlayer.smallX[0], false,
  4812. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4813. crossX = super.saveClickX;
  4814. crossY = super.saveClickY;
  4815. crossType = 2;
  4816. crossIndex = 0;
  4817. stream.createFrame(249);
  4818. stream.method432(i1);
  4819. stream.method431(anInt1137);
  4820. }
  4821. }
  4822. if (l == 729) {
  4823. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4824. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4825. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4826. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  4827. myPlayer.smallX[0], false,
  4828. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4829. crossX = super.saveClickX;
  4830. crossY = super.saveClickY;
  4831. crossType = 2;
  4832. crossIndex = 0;
  4833. stream.createFrame(39);
  4834. stream.method431(i1);
  4835. }
  4836. }
  4837. if (l == 577) {
  4838. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4839. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4840. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4841. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  4842. myPlayer.smallX[0], false,
  4843. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4844. crossX = super.saveClickX;
  4845. crossY = super.saveClickY;
  4846. crossType = 2;
  4847. crossIndex = 0;
  4848. stream.createFrame(139);
  4849. stream.method431(i1);
  4850. }
  4851. }
  4852. if (l == 956 && method66(i1, k, j)) {
  4853. stream.createFrame(35);
  4854. stream.method431(j + baseX);
  4855. stream.method432(anInt1137);
  4856. stream.method432(k + baseY);
  4857. stream.method431(i1 >> 14 & 0x7fff);
  4858. }
  4859. if (l == 567) {
  4860. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4861. myPlayer.smallX[0], false, j);
  4862. if (!flag6)
  4863. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4864. myPlayer.smallX[0], false, j);
  4865. crossX = super.saveClickX;
  4866. crossY = super.saveClickY;
  4867. crossType = 2;
  4868. crossIndex = 0;
  4869. stream.createFrame(23);
  4870. stream.method431(k + baseY);
  4871. stream.method431(i1);
  4872. stream.method431(j + baseX);
  4873. }
  4874. if (l == 867) {
  4875. if ((i1 & 3) == 0)
  4876. anInt1175++;
  4877. if (anInt1175 >= 59) {
  4878. stream.createFrame(200);
  4879. stream.createFrame(201);
  4880. stream.writeWord(25501);
  4881. anInt1175 = 0;
  4882. }
  4883. stream.createFrame(43);
  4884. stream.method431(k);
  4885. stream.method432(i1);
  4886. stream.method432(j);
  4887. atInventoryLoopCycle = 0;
  4888. atInventoryInterface = k;
  4889. atInventoryIndex = j;
  4890. atInventoryInterfaceType = 2;
  4891. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4892. atInventoryInterfaceType = 1;
  4893. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4894. atInventoryInterfaceType = 3;
  4895. }
  4896. if (l == 543) {
  4897. stream.createFrame(237);
  4898. stream.writeWord(j);
  4899. stream.method432(i1);
  4900. stream.writeWord(k);
  4901. stream.method432(anInt1137);
  4902. atInventoryLoopCycle = 0;
  4903. atInventoryInterface = k;
  4904. atInventoryIndex = j;
  4905. atInventoryInterfaceType = 2;
  4906. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4907. atInventoryInterfaceType = 1;
  4908. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4909. atInventoryInterfaceType = 3;
  4910. }
  4911. if (l == 606) {
  4912. String s2 = menuActionName[i];
  4913. int j2 = s2.indexOf("@whi@");
  4914. if (j2 != -1)
  4915. if (openInterfaceID == -1) {
  4916. clearTopInterfaces();
  4917. reportAbuseInput = s2.substring(j2 + 5).trim();
  4918. canMute = false;
  4919. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  4920. if (RSInterface.interfaceCache[i3] == null
  4921. || RSInterface.interfaceCache[i3].contentType != 600)
  4922. continue;
  4923. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4924. break;
  4925. }
  4926.  
  4927. } else {
  4928. pushMessage(
  4929. "Please close the interface you have open before using 'report abuse'",
  4930. 0, "");
  4931. }
  4932. }
  4933. if (l == 491) {
  4934. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4935. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  4936. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4937. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  4938. myPlayer.smallX[0], false,
  4939. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  4940. crossX = super.saveClickX;
  4941. crossY = super.saveClickY;
  4942. crossType = 2;
  4943. crossIndex = 0;
  4944. stream.createFrame(14);
  4945. stream.method432(anInt1284);
  4946. stream.writeWord(i1);
  4947. stream.writeWord(anInt1285);
  4948. stream.method431(anInt1283);
  4949. }
  4950. }
  4951. if (l == 639) {
  4952. String s3 = menuActionName[i];
  4953. int k2 = s3.indexOf("@whi@");
  4954. if (k2 != -1) {
  4955. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4956. int k3 = -1;
  4957. for (int i4 = 0; i4 < friendsCount; i4++) {
  4958. if (friendsListAsLongs[i4] != l4)
  4959. continue;
  4960. k3 = i4;
  4961. break;
  4962. }
  4963.  
  4964. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  4965. inputTaken = true;
  4966. inputDialogState = 0;
  4967. messagePromptRaised = true;
  4968. promptInput = "";
  4969. friendsListAction = 3;
  4970. aLong953 = friendsListAsLongs[k3];
  4971. aString1121 = "Enter message to send to " + friendsList[k3];
  4972. }
  4973. }
  4974. }
  4975. if (l == 1052) {
  4976. stream.createFrame(185);
  4977. stream.writeWord(154);
  4978. }
  4979.  
  4980. if (l == 1004) {
  4981. if (tabInterfaceIDs[14] != -1) {
  4982. needDrawTabArea = true;
  4983. tabID = 14;
  4984. tabAreaAltered = true;
  4985. }
  4986. }
  4987.  
  4988. if (l == 454) {
  4989. stream.createFrame(41);
  4990. stream.writeWord(i1);
  4991. stream.method432(j);
  4992. stream.method432(k);
  4993. atInventoryLoopCycle = 0;
  4994. atInventoryInterface = k;
  4995. atInventoryIndex = j;
  4996. atInventoryInterfaceType = 2;
  4997. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4998. atInventoryInterfaceType = 1;
  4999. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5000. atInventoryInterfaceType = 3;
  5001. }
  5002. if (l == 478) {
  5003. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5004. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  5005. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5006. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  5007. myPlayer.smallX[0], false,
  5008. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  5009. crossX = super.saveClickX;
  5010. crossY = super.saveClickY;
  5011. crossType = 2;
  5012. crossIndex = 0;
  5013. if ((i1 & 3) == 0)
  5014. anInt1155++;
  5015. if (anInt1155 >= 53) {
  5016. stream.createFrame(85);
  5017. stream.writeWordBigEndian(66);
  5018. anInt1155 = 0;
  5019. }
  5020. stream.createFrame(18);
  5021. stream.method431(i1);
  5022. }
  5023. }
  5024. if (l == 113) {
  5025. method66(i1, k, j);
  5026. stream.createFrame(70);
  5027. stream.method431(j + baseX);
  5028. stream.writeWord(k + baseY);
  5029. stream.method433(i1 >> 14 & 0x7fff);
  5030. }
  5031. if (l == 872) {
  5032. method66(i1, k, j);
  5033. stream.createFrame(234);
  5034. stream.method433(j + baseX);
  5035. stream.method432(i1 >> 14 & 0x7fff);
  5036. stream.method433(k + baseY);
  5037. }
  5038. if (l == 502) {
  5039. method66(i1, k, j);
  5040. stream.createFrame(132);
  5041. stream.method433(j + baseX);
  5042. stream.writeWord(i1 >> 14 & 0x7fff);
  5043. stream.method432(k + baseY);
  5044. }
  5045. if (l == 1125) {
  5046. ItemDef itemDef = ItemDef.forID(i1);
  5047. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5048. String s5;
  5049. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5050. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5051. else if (itemDef.description != null)
  5052. s5 = new String(itemDef.description);
  5053. else
  5054. s5 = "It's a " + itemDef.name + ".";
  5055. pushMessage(s5, 0, "");
  5056. }
  5057. if (l == 169) {
  5058. stream.createFrame(185);
  5059. stream.writeWord(k);
  5060. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5061. if (class9_3.valueIndexArray != null
  5062. && class9_3.valueIndexArray[0][0] == 5) {
  5063. int l2 = class9_3.valueIndexArray[0][1];
  5064. variousSettings[l2] = 1 - variousSettings[l2];
  5065. method33(l2);
  5066. needDrawTabArea = true;
  5067. }
  5068. }
  5069. if (l == 447) {
  5070. itemSelected = 1;
  5071. anInt1283 = j;
  5072. anInt1284 = k;
  5073. anInt1285 = i1;
  5074. selectedItemName = ItemDef.forID(i1).name;
  5075. spellSelected = 0;
  5076. needDrawTabArea = true;
  5077. return;
  5078. }
  5079. if (l == 1226) {
  5080. int j1 = i1 >> 14 & 0x7fff;
  5081. ObjectDef class46 = ObjectDef.forID(j1);
  5082. String s10;
  5083. if (class46.description != null)
  5084. s10 = new String(class46.description);
  5085. else
  5086. s10 = "It's a " + class46.name + ".";
  5087. pushMessage(s10, 0, "");
  5088. }
  5089. if (l == 244) {
  5090. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5091. myPlayer.smallX[0], false, j);
  5092. if (!flag7)
  5093. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5094. myPlayer.smallX[0], false, j);
  5095. crossX = super.saveClickX;
  5096. crossY = super.saveClickY;
  5097. crossType = 2;
  5098. crossIndex = 0;
  5099. stream.createFrame(253);
  5100. stream.method431(j + baseX);
  5101. stream.method433(k + baseY);
  5102. stream.method432(i1);
  5103. }
  5104. if (l == 1448) {
  5105. ItemDef itemDef_1 = ItemDef.forID(i1);
  5106. String s6;
  5107. if (itemDef_1.description != null)
  5108. s6 = new String(itemDef_1.description);
  5109. else
  5110. s6 = "It's a " + itemDef_1.name + ".";
  5111. pushMessage(s6, 0, "");
  5112. }
  5113. itemSelected = 0;
  5114. spellSelected = 0;
  5115. needDrawTabArea = true;
  5116.  
  5117. }
  5118.  
  5119. public void method70() {
  5120. anInt1251 = 0;
  5121. int j = (myPlayer.x >> 7) + baseX;
  5122. int k = (myPlayer.y >> 7) + baseY;
  5123. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5124. anInt1251 = 1;
  5125. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5126. anInt1251 = 1;
  5127. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5128. anInt1251 = 0;
  5129. }
  5130.  
  5131. @Override
  5132. public void run() {
  5133. if (drawFlames) {
  5134. drawFlames();
  5135. } else {
  5136. super.run();
  5137. }
  5138. }
  5139.  
  5140. private void build3dScreenMenu() {
  5141. if (itemSelected == 0 && spellSelected == 0) {
  5142. menuActionName[menuActionRow] = "Walk here";
  5143. menuActionID[menuActionRow] = 516;
  5144. menuActionCmd2[menuActionRow] = super.mouseX;
  5145. menuActionCmd3[menuActionRow] = super.mouseY;
  5146. menuActionRow++;
  5147. }
  5148. int j = -1;
  5149. for (int k = 0; k < Model.anInt1687; k++) {
  5150. int l = Model.anIntArray1688[k];
  5151. int i1 = l & 0x7f;
  5152. int j1 = l >> 7 & 0x7f;
  5153. int k1 = l >> 29 & 3;
  5154. int l1 = l >> 14 & 0x7fff;
  5155. if (l == j)
  5156. continue;
  5157. j = l;
  5158. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5159. ObjectDef class46 = ObjectDef.forID(l1);
  5160. if (class46.childrenIDs != null)
  5161. class46 = class46.method580();
  5162. if (class46 == null)
  5163. continue;
  5164. if (itemSelected == 1) {
  5165. menuActionName[menuActionRow] = "Use " + selectedItemName
  5166. + " with @cya@" + class46.name;
  5167. menuActionID[menuActionRow] = 62;
  5168. menuActionCmd1[menuActionRow] = l;
  5169. menuActionCmd2[menuActionRow] = i1;
  5170. menuActionCmd3[menuActionRow] = j1;
  5171. menuActionRow++;
  5172. } else if (spellSelected == 1) {
  5173. if ((spellUsableOn & 4) == 4) {
  5174. menuActionName[menuActionRow] = spellTooltip + " @cya@"
  5175. + class46.name;
  5176. menuActionID[menuActionRow] = 956;
  5177. menuActionCmd1[menuActionRow] = l;
  5178. menuActionCmd2[menuActionRow] = i1;
  5179. menuActionCmd3[menuActionRow] = j1;
  5180. menuActionRow++;
  5181. }
  5182. } else {
  5183. if (class46.actions != null) {
  5184. for (int i2 = 4; i2 >= 0; i2--)
  5185. if (class46.actions[i2] != null) {
  5186. menuActionName[menuActionRow] = class46.actions[i2]
  5187. + " @cya@" + class46.name;
  5188. if (i2 == 0)
  5189. menuActionID[menuActionRow] = 502;
  5190. if (i2 == 1)
  5191. menuActionID[menuActionRow] = 900;
  5192. if (i2 == 2)
  5193. menuActionID[menuActionRow] = 113;
  5194. if (i2 == 3)
  5195. menuActionID[menuActionRow] = 872;
  5196. if (i2 == 4)
  5197. menuActionID[menuActionRow] = 1062;
  5198. menuActionCmd1[menuActionRow] = l;
  5199. menuActionCmd2[menuActionRow] = i1;
  5200. menuActionCmd3[menuActionRow] = j1;
  5201. menuActionRow++;
  5202. }
  5203.  
  5204. }
  5205. menuActionName[menuActionRow] = "Examine @cya@" +
  5206. class46.name;
  5207. menuActionID[menuActionRow] = 1226;
  5208. menuActionCmd1[menuActionRow] = class46.type << 14;
  5209. menuActionCmd2[menuActionRow] = i1;
  5210. menuActionCmd3[menuActionRow] = j1;
  5211. menuActionRow++;
  5212. }
  5213. }
  5214. if (k1 == 1) {
  5215. NPC npc = npcArray[l1];
  5216. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64
  5217. && (npc.y & 0x7f) == 64) {
  5218. for (int j2 = 0; j2 < npcCount; j2++) {
  5219. NPC npc2 = npcArray[npcIndices[j2]];
  5220. if (npc2 != null && npc2 != npc
  5221. && npc2.desc.aByte68 == 1 && npc2.x == npc.x
  5222. && npc2.y == npc.y)
  5223. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5224. }
  5225.  
  5226. for (int l2 = 0; l2 < playerCount; l2++) {
  5227. Player player = playerArray[playerIndices[l2]];
  5228. if (player != null && player.x == npc.x
  5229. && player.y == npc.y)
  5230. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5231. }
  5232.  
  5233. }
  5234. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5235. }
  5236. if (k1 == 0) {
  5237. Player player = playerArray[l1];
  5238. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  5239. for (int k2 = 0; k2 < npcCount; k2++) {
  5240. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5241. if (class30_sub2_sub4_sub1_sub1_2 != null
  5242. && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1
  5243. && class30_sub2_sub4_sub1_sub1_2.x == player.x
  5244. && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  5245. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc,
  5246. npcIndices[k2], j1, i1);
  5247. }
  5248.  
  5249. for (int i3 = 0; i3 < playerCount; i3++) {
  5250. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5251. if (class30_sub2_sub4_sub1_sub2_2 != null
  5252. && class30_sub2_sub4_sub1_sub2_2 != player
  5253. && class30_sub2_sub4_sub1_sub2_2.x == player.x
  5254. && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  5255. buildAtPlayerMenu(i1, playerIndices[i3],
  5256. class30_sub2_sub4_sub1_sub2_2, j1);
  5257. }
  5258.  
  5259. }
  5260. buildAtPlayerMenu(i1, l1, player, j1);
  5261. }
  5262. if (k1 == 3) {
  5263. NodeList class19 = groundArray[plane][i1][j1];
  5264. if (class19 != null) {
  5265. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19
  5266. .getNext()) {
  5267. ItemDef itemDef = ItemDef.forID(item.ID);
  5268. if (itemSelected == 1) {
  5269. menuActionName[menuActionRow] = "Use "
  5270. + selectedItemName + " with @lre@"
  5271. + itemDef.name;
  5272. menuActionID[menuActionRow] = 511;
  5273. menuActionCmd1[menuActionRow] = item.ID;
  5274. menuActionCmd2[menuActionRow] = i1;
  5275. menuActionCmd3[menuActionRow] = j1;
  5276. menuActionRow++;
  5277. } else if (spellSelected == 1) {
  5278. if ((spellUsableOn & 1) == 1) {
  5279. menuActionName[menuActionRow] = spellTooltip
  5280. + " @lre@" + itemDef.name;
  5281. menuActionID[menuActionRow] = 94;
  5282. menuActionCmd1[menuActionRow] = item.ID;
  5283. menuActionCmd2[menuActionRow] = i1;
  5284. menuActionCmd3[menuActionRow] = j1;
  5285. menuActionRow++;
  5286. }
  5287. } else {
  5288. for (int j3 = 4; j3 >= 0; j3--)
  5289. if (itemDef.groundActions != null
  5290. && itemDef.groundActions[j3] != null) {
  5291. menuActionName[menuActionRow] = itemDef.groundActions[j3]
  5292. + " @lre@" + itemDef.name;
  5293. if (j3 == 0)
  5294. menuActionID[menuActionRow] = 652;
  5295. if (j3 == 1)
  5296. menuActionID[menuActionRow] = 567;
  5297. if (j3 == 2)
  5298. menuActionID[menuActionRow] = 234;
  5299. if (j3 == 3)
  5300. menuActionID[menuActionRow] = 244;
  5301. if (j3 == 4)
  5302. menuActionID[menuActionRow] = 213;
  5303. menuActionCmd1[menuActionRow] = item.ID;
  5304. menuActionCmd2[menuActionRow] = i1;
  5305. menuActionCmd3[menuActionRow] = j1;
  5306. menuActionRow++;
  5307. } else if (j3 == 2) {
  5308. menuActionName[menuActionRow] = "Take @lre@"
  5309. + itemDef.name;
  5310. menuActionID[menuActionRow] = 234;
  5311. menuActionCmd1[menuActionRow] = item.ID;
  5312. menuActionCmd2[menuActionRow] = i1;
  5313. menuActionCmd3[menuActionRow] = j1;
  5314. menuActionRow++;
  5315. }
  5316.  
  5317. // menuActionName[menuActionRow] = "Examine @lre@" +
  5318. // itemDef.name + " @gre@(@whi@" + item.ID +
  5319. // "@gre@)";
  5320. menuActionName[menuActionRow] = "Examine @lre@"
  5321. + itemDef.name;
  5322. menuActionID[menuActionRow] = 1448;
  5323. menuActionCmd1[menuActionRow] = item.ID;
  5324. menuActionCmd2[menuActionRow] = i1;
  5325. menuActionCmd3[menuActionRow] = j1;
  5326. menuActionRow++;
  5327. }
  5328. }
  5329. }
  5330. }
  5331. }
  5332. }
  5333.  
  5334. @Override
  5335. public void cleanUpForQuit() {
  5336. signlink.reporterror = false;
  5337. try {
  5338. if (socketStream != null)
  5339. socketStream.close();
  5340. } catch (Exception _ex) {
  5341. }
  5342. socketStream = null;
  5343. stopMidi();
  5344. if (mouseDetection != null)
  5345. mouseDetection.running = false;
  5346. mouseDetection = null;
  5347. onDemandFetcher.disable();
  5348. onDemandFetcher = null;
  5349. aStream_834 = null;
  5350. stream = null;
  5351. aStream_847 = null;
  5352. inStream = null;
  5353. anIntArray1234 = null;
  5354. aByteArrayArray1183 = null;
  5355. aByteArrayArray1247 = null;
  5356. anIntArray1235 = null;
  5357. anIntArray1236 = null;
  5358. intGroundArray = null;
  5359. byteGroundArray = null;
  5360. worldController = null;
  5361. aClass11Array1230 = null;
  5362. anIntArrayArray901 = null;
  5363. anIntArrayArray825 = null;
  5364. bigX = null;
  5365. bigY = null;
  5366. aByteArray912 = null;
  5367. aRSImageProducer_1163 = null;
  5368. mapEdgeIP = null;
  5369. leftFrame = null;
  5370. topFrame = null;
  5371. rightFrame = null;
  5372. aRSImageProducer_1164 = null;
  5373. aRSImageProducer_1165 = null;
  5374. aRSImageProducer_1166 = null;
  5375. aRSImageProducer_1125 = null;
  5376. /* Null pointers for custom sprites */
  5377. multiOverlay = null;
  5378. chatArea = null;
  5379. chatButtons = null;
  5380. ORBS = null;
  5381. worldMapIcon508 = null;
  5382. worldMapIcon525 = null;
  5383. logIconH = null;
  5384. logIconC = null;
  5385. tabArea = null;
  5386. tabArea474 = null;
  5387. tabArea508 = null;
  5388. mapArea508 = null;
  5389. mapArea474 = null;
  5390. mapArea = null;
  5391. /**/
  5392. mapBack = null;
  5393. sideIcons = null;
  5394. redStones = null;
  5395. compass = null;
  5396. hitMarks = null;
  5397. headIcons = null;
  5398. skullIcons = null;
  5399. headIconsHint = null;
  5400. crosses = null;
  5401. mapDotItem = null;
  5402. mapDotNPC = null;
  5403. mapDotPlayer = null;
  5404. mapDotFriend = null;
  5405. mapScenes = null;
  5406. mapFunctions = null;
  5407. anIntArrayArray929 = null;
  5408. playerArray = null;
  5409. playerIndices = null;
  5410. anIntArray894 = null;
  5411. aStreamArray895s = null;
  5412. anIntArray840 = null;
  5413. npcArray = null;
  5414. npcIndices = null;
  5415. groundArray = null;
  5416. aClass19_1179 = null;
  5417. aClass19_1013 = null;
  5418. aClass19_1056 = null;
  5419. menuActionCmd2 = null;
  5420. menuActionCmd3 = null;
  5421. menuActionID = null;
  5422. menuActionCmd1 = null;
  5423. menuActionName = null;
  5424. variousSettings = null;
  5425. anIntArray1072 = null;
  5426. anIntArray1073 = null;
  5427. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5428. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5429. friendsList = null;
  5430. friendsListAsLongs = null;
  5431. friendsNodeIDs = null;
  5432. aRSImageProducer_1110 = null;
  5433. aRSImageProducer_1111 = null;
  5434. aRSImageProducer_1107 = null;
  5435. aRSImageProducer_1108 = null;
  5436. aRSImageProducer_1109 = null;
  5437. aRSImageProducer_1112 = null;
  5438. aRSImageProducer_1113 = null;
  5439. aRSImageProducer_1114 = null;
  5440. aRSImageProducer_1115 = null;
  5441. nullLoader();
  5442. ObjectDef.nullLoader();
  5443. EntityDef.nullLoader();
  5444. ItemDef.nullLoader();
  5445. Flo.cache = null;
  5446. IDK.cache = null;
  5447. RSInterface.interfaceCache = null;
  5448. DummyClass.cache = null;
  5449. Animation.anims = null;
  5450. SpotAnim.cache = null;
  5451. SpotAnim.aMRUNodes_415 = null;
  5452. Varp.cache = null;
  5453. super.fullGameScreen = null;
  5454. Player.mruNodes = null;
  5455. Texture.nullLoader();
  5456. WorldController.nullLoader();
  5457. Model.nullLoader();
  5458. Class36.nullLoader();
  5459. System.gc();
  5460. }
  5461.  
  5462. public void printDebug() {
  5463. System.out.println("============");
  5464. System.out.println("flame-cycle:" + anInt1208);
  5465. if (onDemandFetcher != null)
  5466. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5467. System.out.println("loop-cycle:" + loopCycle);
  5468. System.out.println("draw-cycle:" + anInt1061);
  5469. System.out.println("ptype:" + pktType);
  5470. System.out.println("psize:" + pktSize);
  5471. if (socketStream != null)
  5472. socketStream.printDebug();
  5473. super.shouldDebug = true;
  5474. }
  5475.  
  5476. @Override
  5477. Component getGameComponent() {
  5478. if (signlink.mainapp != null)
  5479. return signlink.mainapp;
  5480. if (super.gameFrame != null)
  5481. return super.gameFrame;
  5482. else
  5483. return this;
  5484. }
  5485.  
  5486. public void pmTabToReply() {
  5487. String name = null;
  5488. for (int k = 0; k < 100; k++) {
  5489. if (chatMessages[k] == null) {
  5490. continue;
  5491. }
  5492. int l = chatTypes[k];
  5493. if (l == 3 || l == 7) {
  5494. name = chatNames[k];
  5495. break;
  5496. }
  5497. }
  5498.  
  5499. if (name == null) {
  5500. pushMessage(
  5501. "You haven't received any messages to which you can reply.",
  5502. 0, "");
  5503. return;
  5504. }
  5505.  
  5506. if (name.startsWith("@cr")) {
  5507. name = name.substring(5);
  5508. }
  5509.  
  5510. long nameAsLong = TextClass.longForName(name.trim());
  5511. int k3 = -1;
  5512. for (int i4 = 0; i4 < friendsCount; i4++) {
  5513. if (friendsListAsLongs[i4] != nameAsLong)
  5514. continue;
  5515. k3 = i4;
  5516. break;
  5517. }
  5518.  
  5519. if (k3 != -1) {
  5520. if (friendsNodeIDs[k3] > 0) {
  5521. inputTaken = true;
  5522. inputDialogState = 0;
  5523. messagePromptRaised = true;
  5524. promptInput = "";
  5525. friendsListAction = 3;
  5526. aLong953 = friendsListAsLongs[k3];
  5527. aString1121 = "Enter message to send to " + friendsList[k3];
  5528. } else {
  5529. pushMessage("That player is currently offline.", 0, "");
  5530. }
  5531. }
  5532. }
  5533.  
  5534. private void method73() {
  5535. do {
  5536. int j = readChar(-796);
  5537. if (j == -1)
  5538. break;
  5539. if (openInterfaceID != -1
  5540. && openInterfaceID == reportAbuseInterfaceID) {
  5541. if (j == 8 && reportAbuseInput.length() > 0)
  5542. reportAbuseInput = reportAbuseInput.substring(0,
  5543. reportAbuseInput.length() - 1);
  5544. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48
  5545. && j <= 57 || j == 32)
  5546. && reportAbuseInput.length() < 12)
  5547. reportAbuseInput += (char) j;
  5548. } else if (messagePromptRaised) {
  5549. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  5550. promptInput += (char) j;
  5551. inputTaken = true;
  5552. }
  5553. if (j == 8 && promptInput.length() > 0) {
  5554. promptInput = promptInput.substring(0,
  5555. promptInput.length() - 1);
  5556. inputTaken = true;
  5557. }
  5558. if (j == 13 || j == 10) {
  5559. messagePromptRaised = false;
  5560. inputTaken = true;
  5561. if (friendsListAction == 1) {
  5562. long l = TextClass.longForName(promptInput);
  5563. addFriend(l);
  5564. }
  5565. if (friendsListAction == 2 && friendsCount > 0) {
  5566. long l1 = TextClass.longForName(promptInput);
  5567. delFriend(l1);
  5568. }
  5569. if (friendsListAction == 3 && promptInput.length() > 0) {
  5570. stream.createFrame(126);
  5571. stream.writeWordBigEndian(0);
  5572. int k = stream.currentOffset;
  5573. stream.writeQWord(aLong953);
  5574. TextInput.method526(promptInput, stream);
  5575. stream.writeBytes(stream.currentOffset - k);
  5576. promptInput = TextInput.processText(promptInput);
  5577. // promptInput = Censor.doCensor(promptInput);
  5578. pushMessage(promptInput, 6, TextClass.fixName(TextClass
  5579. .nameForLong(aLong953)));
  5580. if (privateChatMode == 2) {
  5581. privateChatMode = 1;
  5582. stream.createFrame(95);
  5583. stream.writeWordBigEndian(publicChatMode);
  5584. stream.writeWordBigEndian(privateChatMode);
  5585. stream.writeWordBigEndian(tradeMode);
  5586. }
  5587. }
  5588. if (friendsListAction == 4 && ignoreCount < 100) {
  5589. long l2 = TextClass.longForName(promptInput);
  5590. addIgnore(l2);
  5591. }
  5592. if (friendsListAction == 5 && ignoreCount > 0) {
  5593. long l3 = TextClass.longForName(promptInput);
  5594. delIgnore(l3);
  5595. }
  5596. // clan chat
  5597. if (friendsListAction == 6) {
  5598. sendStringAsLong(promptInput);
  5599. } else if (friendsListAction == 8) {
  5600. sendString(1, promptInput);
  5601. } else if (friendsListAction == 9) {
  5602. sendString(2, promptInput);
  5603. } else if (friendsListAction == 10) {
  5604. sendString(3, promptInput);
  5605. }
  5606. }
  5607. } else if (inputDialogState == 1) {
  5608. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5609. amountOrNameInput += (char) j;
  5610. inputTaken = true;
  5611. }
  5612. if (j == 8 && amountOrNameInput.length() > 0) {
  5613. amountOrNameInput = amountOrNameInput.substring(0,
  5614. amountOrNameInput.length() - 1);
  5615. inputTaken = true;
  5616. }
  5617. if (j == 13 || j == 10) {
  5618. if (amountOrNameInput.length() > 0) {
  5619. int i1 = 0;
  5620. try {
  5621. i1 = Integer.parseInt(amountOrNameInput);
  5622. } catch (Exception _ex) {
  5623. }
  5624. stream.createFrame(208);
  5625. stream.writeDWord(i1);
  5626. }
  5627. inputDialogState = 0;
  5628. inputTaken = true;
  5629. }
  5630. } else if (inputDialogState == 2) {
  5631. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5632. amountOrNameInput += (char) j;
  5633. inputTaken = true;
  5634. }
  5635. if (j == 8 && amountOrNameInput.length() > 0) {
  5636. amountOrNameInput = amountOrNameInput.substring(0,
  5637. amountOrNameInput.length() - 1);
  5638. inputTaken = true;
  5639. }
  5640. if (j == 13 || j == 10) {
  5641. if (amountOrNameInput.length() > 0) {
  5642. stream.createFrame(60);
  5643. stream.writeQWord(TextClass
  5644. .longForName(amountOrNameInput));
  5645. }
  5646. inputDialogState = 0;
  5647. inputTaken = true;
  5648. }
  5649. } else if (backDialogID == -1) {
  5650. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  5651. inputString += (char) j;
  5652. inputTaken = true;
  5653. }
  5654. if (j == 8 && inputString.length() > 0) {
  5655. inputString = inputString.substring(0,
  5656. inputString.length() - 1);
  5657. inputTaken = true;
  5658. }
  5659. if (j == 9)
  5660. pmTabToReply();
  5661. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5662. if (myPrivilege == 3) {
  5663. if (inputString.startsWith("//setspecto")) {
  5664. int amt = Integer.parseInt(inputString
  5665. .substring(12));
  5666. anIntArray1045[300] = amt;
  5667. if (variousSettings[300] != amt) {
  5668. variousSettings[300] = amt;
  5669. method33(300);
  5670. needDrawTabArea = true;
  5671. if (dialogID != -1)
  5672. inputTaken = true;
  5673. }
  5674. }
  5675. if (inputString.equals("clientdrop"))
  5676. dropClient();
  5677. if (inputString.startsWith("full")) {
  5678. try {
  5679. String[] args = inputString.split(" ");
  5680. int id1 = Integer.parseInt(args[1]);
  5681. int id2 = Integer.parseInt(args[2]);
  5682. fullscreenInterfaceID = id1;
  5683. openInterfaceID = id2;
  5684. pushMessage("Opened Interface", 0, "");
  5685. } catch (Exception e) {
  5686. pushMessage("Interface Failed to load", 0, "");
  5687. }
  5688. }
  5689. if (inputString.equals("::lag"))
  5690. printDebug();
  5691. if (inputString.equals("::prefetchmusic")) {
  5692. for (int j1 = 0; j1 < onDemandFetcher
  5693. .getVersionCount(2); j1++)
  5694. onDemandFetcher.method563((byte) 1, 2, j1);
  5695.  
  5696. }
  5697. if (inputString.equals("::maps"))
  5698. addMaps();
  5699. if (inputString.equals("::models"))
  5700. addModels();
  5701. if (inputString.equals("::fpson"))
  5702. fpsOn = true;
  5703. if (inputString.equals("::fpsoff"))
  5704. fpsOn = false;
  5705. if (inputString.equals("::dataon"))
  5706. clientData = true;
  5707. if (inputString.equals("::dataoff"))
  5708. clientData = false;
  5709. if (inputString.equals("::noclip")) {
  5710. for (int k1 = 0; k1 < 4; k1++) {
  5711. for (int i2 = 1; i2 < 103; i2++) {
  5712. for (int k2 = 1; k2 < 103; k2++)
  5713. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5714.  
  5715. }
  5716. }
  5717. }
  5718. }
  5719.  
  5720. if (inputString.equals("add model")) {
  5721. try {
  5722. int ModelIndex = Integer.parseInt(JOptionPane
  5723. .showInputDialog(this, "Enter model ID",
  5724. "Model", 3));
  5725. byte[] abyte0 = getModel(ModelIndex);
  5726. if (abyte0 != null && abyte0.length > 0) {
  5727. decompressors[1].method234(abyte0.length,
  5728. abyte0, ModelIndex);
  5729. pushMessage("Model: [" + ModelIndex
  5730. + "] added successfully!", 0, "");
  5731. } else {
  5732. pushMessage("Unable to find the model. "
  5733. + ModelIndex, 0, "");
  5734. }
  5735. } catch (Exception e) {
  5736. pushMessage("Syntax - ::add model <path>", 0, "");
  5737. }
  5738. }
  5739. if (inputString.startsWith("/"))
  5740. inputString = "::" + inputString;
  5741. if (inputString.equals("::orbs")) {
  5742. OSOrbs = !OSOrbs;
  5743. pushMessage("You haved toggled Orbs", 0, "");
  5744. needDrawTabArea = true;
  5745. }
  5746. if (inputString.equals("::474")) {
  5747. revision474 = true;
  5748. revision498 = false;
  5749. revision508 = false;
  5750. pushMessage("You have toggled the 474 Gameframe", 0, "");
  5751. needDrawTabArea = true;
  5752. }
  5753. if (inputString.equals("::498")) {
  5754. revision474 = false;
  5755. revision498 = true;
  5756. revision508 = false;
  5757. pushMessage("You have toggled the 498 Gameframe", 0, "");
  5758. needDrawTabArea = true;
  5759. }
  5760. if (inputString.equals("::xp")) {
  5761. pushMessage("XP drops has been removed.", 0, "");
  5762. }
  5763. if (inputString.startsWith("::")) {
  5764. stream.createFrame(103);
  5765. stream.writeWordBigEndian(inputString.length() - 1);
  5766. stream.writeString(inputString.substring(2));
  5767. } else {
  5768. String s = inputString.toLowerCase();
  5769. int j2 = 0;
  5770. if (s.startsWith("yellow:")) {
  5771. j2 = 0;
  5772. inputString = inputString.substring(7);
  5773. } else if (s.startsWith("red:")) {
  5774. j2 = 1;
  5775. inputString = inputString.substring(4);
  5776. } else if (s.startsWith("green:")) {
  5777. j2 = 2;
  5778. inputString = inputString.substring(6);
  5779. } else if (s.startsWith("cyan:")) {
  5780. j2 = 3;
  5781. inputString = inputString.substring(5);
  5782. } else if (s.startsWith("purple:")) {
  5783. j2 = 4;
  5784. inputString = inputString.substring(7);
  5785. } else if (s.startsWith("white:")) {
  5786. j2 = 5;
  5787. inputString = inputString.substring(6);
  5788. } else if (s.startsWith("flash1:")) {
  5789. j2 = 6;
  5790. inputString = inputString.substring(7);
  5791. } else if (s.startsWith("flash2:")) {
  5792. j2 = 7;
  5793. inputString = inputString.substring(7);
  5794. } else if (s.startsWith("flash3:")) {
  5795. j2 = 8;
  5796. inputString = inputString.substring(7);
  5797. } else if (s.startsWith("glow1:")) {
  5798. j2 = 9;
  5799. inputString = inputString.substring(6);
  5800. } else if (s.startsWith("glow2:")) {
  5801. j2 = 10;
  5802. inputString = inputString.substring(6);
  5803. } else if (s.startsWith("glow3:")) {
  5804. j2 = 11;
  5805. inputString = inputString.substring(6);
  5806. }
  5807. s = inputString.toLowerCase();
  5808. int i3 = 0;
  5809. if (s.startsWith("wave:")) {
  5810. i3 = 1;
  5811. inputString = inputString.substring(5);
  5812. } else if (s.startsWith("wave2:")) {
  5813. i3 = 2;
  5814. inputString = inputString.substring(6);
  5815. } else if (s.startsWith("shake:")) {
  5816. i3 = 3;
  5817. inputString = inputString.substring(6);
  5818. } else if (s.startsWith("scroll:")) {
  5819. i3 = 4;
  5820. inputString = inputString.substring(7);
  5821. } else if (s.startsWith("slide:")) {
  5822. i3 = 5;
  5823. inputString = inputString.substring(6);
  5824. }
  5825. stream.createFrame(4);
  5826. stream.writeWordBigEndian(0);
  5827. int j3 = stream.currentOffset;
  5828. stream.method425(i3);
  5829. stream.method425(j2);
  5830. aStream_834.currentOffset = 0;
  5831. TextInput.method526(inputString, aStream_834);
  5832. stream.method441(0, aStream_834.buffer,
  5833. aStream_834.currentOffset);
  5834. stream.writeBytes(stream.currentOffset - j3);
  5835. inputString = TextInput.processText(inputString);
  5836. // inputString = Censor.doCensor(inputString);
  5837. myPlayer.textSpoken = inputString;
  5838. myPlayer.anInt1513 = j2;
  5839. myPlayer.anInt1531 = i3;
  5840. myPlayer.textCycle = 150;
  5841. String cr = "";
  5842. if (myPrivilege == 9)
  5843. cr = "@cr9@";
  5844. if (myPrivilege == 8)
  5845. cr = "@cr8@";
  5846. if (myPrivilege == 7)
  5847. cr = "@cr7@";
  5848. if (myPrivilege == 6)
  5849. cr = "@cr6@";
  5850. if (myPrivilege == 5)
  5851. cr = "@cr5@";
  5852. if (myPrivilege == 4)
  5853. cr = "@cr4@";
  5854. if (myPrivilege == 3)
  5855. cr = "@cr3@";
  5856. if (myPrivilege == 2)
  5857. cr = "@cr2@";
  5858. if (myPrivilege == 1)
  5859. cr = "@cr1@";
  5860. pushMessage(myPlayer.textSpoken, 2, cr + "<col="
  5861. + titleColor(myPlayer.titleColor, 0) + ">"
  5862. + myPlayer.title + "</col>" + myPlayer.name);
  5863. if (publicChatMode == 2) {
  5864. publicChatMode = 3;
  5865. stream.createFrame(95);
  5866. stream.writeWordBigEndian(publicChatMode);
  5867. stream.writeWordBigEndian(privateChatMode);
  5868. stream.writeWordBigEndian(tradeMode);
  5869. }
  5870. }
  5871. inputString = "";
  5872. inputTaken = true;
  5873. }
  5874. }
  5875. } while (true);
  5876. }
  5877.  
  5878. private void buildPublicChat(int j) {
  5879. int l = 0;
  5880. for (int i1 = 0; i1 < 500; i1++) {
  5881. if (chatMessages[i1] == null)
  5882. continue;
  5883. if (chatTypeView != 1)
  5884. continue;
  5885. int j1 = chatTypes[i1];
  5886. String s = chatNames[i1];
  5887. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5888. if (k1 < -23)
  5889. break;
  5890. if (s != null && s.startsWith("@cr"))
  5891. s = s.substring(5);
  5892. if (s != null && s.startsWith("<col=")) {
  5893. s = s.substring(s.indexOf("</col>") + 6);
  5894. }
  5895. if (s != null && s.startsWith("@cr1@"))
  5896. s = s.substring(5);
  5897. if (s != null && s.startsWith("@cr2@"))
  5898. s = s.substring(5);
  5899. if (s != null && s.startsWith("@cr3@"))
  5900. s = s.substring(5);
  5901. if (s != null && s.startsWith("@cr4@"))
  5902. s = s.substring(5);
  5903. if (s != null && s.startsWith("@cr5@"))
  5904. s = s.substring(5);
  5905. if (s != null && s.startsWith("@cr6@"))
  5906. s = s.substring(5);
  5907. if (s != null && s.startsWith("@cr7@"))
  5908. s = s.substring(5);
  5909. if (s != null && s.startsWith("@cr8@"))
  5910. s = s.substring(5);
  5911. if (s != null && s.startsWith("@cr9@"))
  5912. s = s.substring(5);
  5913. if (s != null && s.startsWith("@cr10@"))
  5914. s = s.substring(6);
  5915. if ((j1 == 1 || j1 == 2)
  5916. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  5917. && isFriendOrSelf(s))) {
  5918. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5919. if (myPrivilege >= 1) {
  5920. menuActionName[menuActionRow] = "Report abuse @whi@"
  5921. + s;
  5922. menuActionID[menuActionRow] = 606;
  5923. menuActionRow++;
  5924. }
  5925. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5926. menuActionID[menuActionRow] = 42;
  5927. menuActionRow++;
  5928. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5929. menuActionID[menuActionRow] = 337;
  5930. menuActionRow++;
  5931. }
  5932. l++;
  5933. }
  5934. }
  5935. }
  5936.  
  5937. private void buildFriendChat(int j) {
  5938. int l = 0;
  5939. for (int i1 = 0; i1 < 500; i1++) {
  5940. if (chatMessages[i1] == null)
  5941. continue;
  5942. if (chatTypeView != 2)
  5943. continue;
  5944. int j1 = chatTypes[i1];
  5945. String s = chatNames[i1];
  5946. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5947. if (k1 < -23)
  5948. break;
  5949. if (s != null && s.startsWith("@cr1@"))
  5950. s = s.substring(5);
  5951. if (s != null && s.startsWith("@cr2@"))
  5952. s = s.substring(5);
  5953. if (s != null && s.startsWith("@cr3@"))
  5954. s = s.substring(5);
  5955. if (s != null && s.startsWith("@cr4@"))
  5956. s = s.substring(5);
  5957. if (s != null && s.startsWith("@cr5@"))
  5958. s = s.substring(5);
  5959. if (s != null && s.startsWith("@cr6@"))
  5960. s = s.substring(5);
  5961. if ((j1 == 5 || j1 == 6)
  5962. && (splitPrivateChat == 0 || chatTypeView == 2)
  5963. && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1
  5964. && isFriendOrSelf(s)))
  5965. l++;
  5966. if ((j1 == 3 || j1 == 7)
  5967. && (splitPrivateChat == 0 || chatTypeView == 2)
  5968. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  5969. && isFriendOrSelf(s))) {
  5970. if (j > k1 - 14 && j <= k1) {
  5971. if (myPrivilege >= 1) {
  5972. menuActionName[menuActionRow] = "Report abuse @whi@"
  5973. + s;
  5974. menuActionID[menuActionRow] = 606;
  5975. menuActionRow++;
  5976. }
  5977. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5978. menuActionID[menuActionRow] = 42;
  5979. menuActionRow++;
  5980. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5981. menuActionID[menuActionRow] = 337;
  5982. menuActionRow++;
  5983. }
  5984. l++;
  5985. }
  5986. }
  5987. }
  5988.  
  5989. private void buildDuelorTrade(int j) {
  5990. int l = 0;
  5991. for (int i1 = 0; i1 < 500; i1++) {
  5992. if (chatMessages[i1] == null)
  5993. continue;
  5994. if (chatTypeView != 3 && chatTypeView != 4)
  5995. continue;
  5996. int j1 = chatTypes[i1];
  5997. String s = chatNames[i1];
  5998. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5999. if (k1 < -23)
  6000. break;
  6001. if (s != null && s.startsWith("@cr1@"))
  6002. s = s.substring(5);
  6003. if (s != null && s.startsWith("@cr2@"))
  6004. s = s.substring(5);
  6005. if (s != null && s.startsWith("@cr3@"))
  6006. s = s.substring(5);
  6007. if (s != null && s.startsWith("@cr4@"))
  6008. s = s.substring(5);
  6009. if (s != null && s.startsWith("@cr5@"))
  6010. s = s.substring(5);
  6011. if (s != null && s.startsWith("@cr6@"))
  6012. s = s.substring(5);
  6013. if (chatTypeView == 3 && j1 == 4
  6014. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6015. if (j > k1 - 14 && j <= k1) {
  6016. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6017. menuActionID[menuActionRow] = 484;
  6018. menuActionRow++;
  6019. }
  6020. l++;
  6021. }
  6022. if (chatTypeView == 4 && j1 == 8
  6023. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6024. if (j > k1 - 14 && j <= k1) {
  6025. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6026. + s;
  6027. menuActionID[menuActionRow] = 6;
  6028. menuActionRow++;
  6029. }
  6030. l++;
  6031. }
  6032. if (j1 == 12) {
  6033. if (j > k1 - 14 && j <= k1) {
  6034. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6035. menuActionID[menuActionRow] = 915;
  6036. menuActionRow++;
  6037. }
  6038. l++;
  6039. }
  6040. }
  6041. }
  6042.  
  6043. private void buildChatAreaMenu(int j) {
  6044. int l = 0;
  6045. for (int i1 = 0; i1 < 500; i1++) {
  6046. if (chatMessages[i1] == null)
  6047. continue;
  6048. int j1 = chatTypes[i1];
  6049. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6050. if (k1 < -23)
  6051. break;
  6052. String s = chatNames[i1];
  6053. if (chatTypeView == 1) {
  6054. buildPublicChat(j);
  6055. break;
  6056. }
  6057. if (chatTypeView == 2) {
  6058. buildFriendChat(j);
  6059. break;
  6060. }
  6061. if (chatTypeView == 3 || chatTypeView == 4) {
  6062. buildDuelorTrade(j);
  6063. break;
  6064. }
  6065. if (chatTypeView == 5) {
  6066. break;
  6067. }
  6068. if (s != null && s.startsWith("@cr1@")) {
  6069. s = s.substring(5);
  6070. }
  6071. if (s != null && s.startsWith("@cr2@")) {
  6072. s = s.substring(5);
  6073. }
  6074. if (s != null && s.startsWith("@cr3@")) {
  6075. s = s.substring(5);
  6076. }
  6077. if (s != null && s.startsWith("@cr4@")) {
  6078. s = s.substring(5);
  6079. }
  6080. if (s != null && s.startsWith("@cr5@")) {
  6081. s = s.substring(5);
  6082. }
  6083. if (s != null && s.startsWith("@cr6@")) {
  6084. s = s.substring(5);
  6085. }
  6086. if (s != null && s.startsWith("<col=")) {
  6087. s = s.substring(s.indexOf("</col>") + 6);
  6088. }
  6089. if (j1 == 0)
  6090. l++;
  6091. if ((j1 == 1 || j1 == 2)
  6092. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6093. && isFriendOrSelf(s))) {
  6094. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6095. if (myPrivilege >= 1) {
  6096. menuActionName[menuActionRow] = "Report abuse @whi@"
  6097. + s;
  6098. menuActionID[menuActionRow] = 606;
  6099. menuActionRow++;
  6100. }
  6101. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6102. menuActionID[menuActionRow] = 42;
  6103. menuActionRow++;
  6104. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6105. menuActionID[menuActionRow] = 337;
  6106. menuActionRow++;
  6107. }
  6108. l++;
  6109. }
  6110. if ((j1 == 3 || j1 == 7)
  6111. && splitPrivateChat == 0
  6112. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6113. && isFriendOrSelf(s))) {
  6114. if (j > k1 - 14 && j <= k1) {
  6115. if (myPrivilege >= 1) {
  6116. menuActionName[menuActionRow] = "Report abuse @whi@"
  6117. + s;
  6118. menuActionID[menuActionRow] = 606;
  6119. menuActionRow++;
  6120. }
  6121. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6122. menuActionID[menuActionRow] = 42;
  6123. menuActionRow++;
  6124. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6125. menuActionID[menuActionRow] = 337;
  6126. menuActionRow++;
  6127. }
  6128. l++;
  6129. }
  6130. if (j1 == 4
  6131. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6132. if (j > k1 - 14 && j <= k1) {
  6133. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6134. menuActionID[menuActionRow] = 484;
  6135. menuActionRow++;
  6136. }
  6137. l++;
  6138. }
  6139. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0
  6140. && privateChatMode < 2)
  6141. l++;
  6142. if (j1 == 8
  6143. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6144. if (j > k1 - 14 && j <= k1) {
  6145. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6146. + s;
  6147. menuActionID[menuActionRow] = 6;
  6148. menuActionRow++;
  6149. }
  6150. l++;
  6151. }
  6152. }
  6153. }
  6154.  
  6155. public void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6156. int j = class9.contentType;
  6157. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6158. if (j == 1 && anInt900 == 0) {
  6159. class9.message = "Loading friend list";
  6160. class9.atActionType = 0;
  6161. return;
  6162. }
  6163. if (j == 1 && anInt900 == 1) {
  6164. class9.message = "Connecting to friendserver";
  6165. class9.atActionType = 0;
  6166. return;
  6167. }
  6168. if (j == 2 && anInt900 != 2) {
  6169. class9.message = "Please wait...";
  6170. class9.atActionType = 0;
  6171. return;
  6172. }
  6173. int k = friendsCount;
  6174. if (anInt900 != 2)
  6175. k = 0;
  6176. if (j > 700)
  6177. j -= 601;
  6178. else
  6179. j--;
  6180. if (j >= k) {
  6181. class9.message = "";
  6182. class9.atActionType = 0;
  6183. return;
  6184. } else {
  6185. class9.message = friendsList[j];
  6186. class9.atActionType = 1;
  6187. return;
  6188. }
  6189. }
  6190. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6191. int l = friendsCount;
  6192. if (anInt900 != 2)
  6193. l = 0;
  6194. if (j > 800)
  6195. j -= 701;
  6196. else
  6197. j -= 101;
  6198. if (j >= l) {
  6199. class9.message = "";
  6200. class9.atActionType = 0;
  6201. return;
  6202. }
  6203. if (friendsNodeIDs[j] == 0)
  6204. class9.message = "@red@Offline";
  6205. else if (friendsNodeIDs[j] == nodeID)
  6206. class9.message = "@gre@World 1"/* + (friendsNodeIDs[j] - 9) */;
  6207. else
  6208. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  6209. class9.atActionType = 1;
  6210. return;
  6211. }
  6212. if (j == 203) {
  6213. int i1 = friendsCount;
  6214. if (anInt900 != 2)
  6215. i1 = 0;
  6216. class9.scrollMax = i1 * 15 + 20;
  6217. if (class9.scrollMax <= class9.height)
  6218. class9.scrollMax = class9.height + 1;
  6219. return;
  6220. }
  6221. if (j >= 401 && j <= 500) {
  6222. if ((j -= 401) == 0 && anInt900 == 0) {
  6223. class9.message = "Loading ignore list";
  6224. class9.atActionType = 0;
  6225. return;
  6226. }
  6227. if (j == 1 && anInt900 == 0) {
  6228. class9.message = "Please wait...";
  6229. class9.atActionType = 0;
  6230. return;
  6231. }
  6232. int j1 = ignoreCount;
  6233. if (anInt900 == 0)
  6234. j1 = 0;
  6235. if (j >= j1) {
  6236. class9.message = "";
  6237. class9.atActionType = 0;
  6238. return;
  6239. } else {
  6240. class9.message = TextClass.fixName(TextClass
  6241. .nameForLong(ignoreListAsLongs[j]));
  6242. class9.atActionType = 1;
  6243. return;
  6244. }
  6245. }
  6246. if (j == 503) {
  6247. class9.scrollMax = ignoreCount * 15 + 20;
  6248. if (class9.scrollMax <= class9.height)
  6249. class9.scrollMax = class9.height + 1;
  6250. return;
  6251. }
  6252. if (j == 327) {
  6253. class9.modelRotation1 = 150;
  6254. class9.modelRotation2 = (int) (Math.sin(loopCycle / 40D) * 256D) & 0x7ff;
  6255. if (aBoolean1031) {
  6256. for (int k1 = 0; k1 < 7; k1++) {
  6257. int l1 = anIntArray1065[k1];
  6258. if (l1 >= 0 && !IDK.cache[l1].method537())
  6259. return;
  6260. }
  6261.  
  6262. aBoolean1031 = false;
  6263. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6264. int i2 = 0;
  6265. for (int j2 = 0; j2 < 7; j2++) {
  6266. int k2 = anIntArray1065[j2];
  6267. if (k2 >= 0)
  6268. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  6269. .method538();
  6270. }
  6271.  
  6272. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6273. for (int l2 = 0; l2 < 5; l2++)
  6274. if (anIntArray990[l2] != 0) {
  6275. model.method476(anIntArrayArray1003[l2][0],
  6276. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6277. if (l2 == 1)
  6278. model.method476(anIntArray1204[0],
  6279. anIntArray1204[anIntArray990[l2]]);
  6280. // if(l2 == 1)
  6281. // model.method476(Legs2[0], Legs2[anIntArray990[l2]]);
  6282. }
  6283.  
  6284. model.method469();
  6285. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6286. model.method479(64, 1300, 0, -570, 0, true);
  6287. class9.anInt233 = 5;
  6288. class9.mediaID = 0;
  6289. RSInterface.method208(aBoolean994, model);
  6290. }
  6291. return;
  6292. }
  6293. if (j == 328) {
  6294. RSInterface rsInterface = class9;
  6295. int verticleTilt = 150;
  6296. int animationSpeed = (int) (Math.sin(loopCycle / 40D) * 256D) & 0x7ff;
  6297. rsInterface.modelRotation1 = verticleTilt;
  6298. rsInterface.modelRotation2 = animationSpeed;
  6299. if (aBoolean1031) {
  6300. Model characterDisplay = myPlayer.method452();
  6301. for (int l2 = 0; l2 < 5; l2++)
  6302. if (anIntArray990[l2] != 0) {
  6303. characterDisplay.method476(anIntArrayArray1003[l2][0],
  6304. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6305. if (l2 == 1)
  6306. characterDisplay.method476(anIntArray1204[0],
  6307. anIntArray1204[anIntArray990[l2]]);
  6308. }
  6309. int staticFrame = myPlayer.anInt1511;
  6310. characterDisplay.method469();
  6311. characterDisplay
  6312. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  6313. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6314. rsInterface.anInt233 = 5;
  6315. rsInterface.mediaID = 0;
  6316. RSInterface.method208(aBoolean994, characterDisplay);
  6317. }
  6318. return;
  6319. }
  6320. if (j == 324) {
  6321. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6322. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6323. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6324. }
  6325. if (aBoolean1047) {
  6326. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6327. return;
  6328. } else {
  6329. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6330. return;
  6331. }
  6332. }
  6333. if (j == 325) {
  6334. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6335. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6336. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6337. }
  6338. if (aBoolean1047) {
  6339. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6340. return;
  6341. } else {
  6342. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6343. return;
  6344. }
  6345. }
  6346. if (j == 600) {
  6347. class9.message = reportAbuseInput;
  6348. if (loopCycle % 20 < 10) {
  6349. class9.message += "|";
  6350. return;
  6351. } else {
  6352. class9.message += " ";
  6353. return;
  6354. }
  6355. }
  6356. if (j == 613)
  6357. if (myPrivilege >= 1) {
  6358. if (canMute) {
  6359. class9.textColor = 0xff0000;
  6360. // class9.message =
  6361. // "Moderator option: Mute player for 48 hours: <ON>";
  6362. } else {
  6363. class9.textColor = 0xffffff;
  6364. // class9.message =
  6365. // "Moderator option: Mute player for 48 hours: <OFF>";
  6366. }
  6367. } else {
  6368. class9.message = "";
  6369. }
  6370. if (j == 650 || j == 655)
  6371. if (anInt1193 != 0) {
  6372. String s;
  6373. if (daysSinceLastLogin == 0)
  6374. s = "earlier today";
  6375. else if (daysSinceLastLogin == 1)
  6376. s = "yesterday";
  6377. else
  6378. s = daysSinceLastLogin + " days ago";
  6379. class9.message = "You last logged in " + s + " from: "
  6380. + signlink.dns;
  6381. } else {
  6382. class9.message = "";
  6383. }
  6384. if (j == 651) {
  6385. if (unreadMessages == 0) {
  6386. class9.message = "0 unread messages";
  6387. class9.textColor = 0xffff00;
  6388. }
  6389. if (unreadMessages == 1) {
  6390. class9.message = "1 unread message";
  6391. class9.textColor = 65280;
  6392. }
  6393. if (unreadMessages > 1) {
  6394. class9.message = unreadMessages + " unread messages";
  6395. class9.textColor = 65280;
  6396. }
  6397. }
  6398. if (j == 652)
  6399. if (daysSinceRecovChange == 201) {
  6400. if (membersInt == 1)
  6401. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6402. else
  6403. class9.message = "";
  6404. } else if (daysSinceRecovChange == 200) {
  6405. class9.message = "You have not yet set any password recovery questions.";
  6406. } else {
  6407. String s1;
  6408. if (daysSinceRecovChange == 0)
  6409. s1 = "Earlier today";
  6410. else if (daysSinceRecovChange == 1)
  6411. s1 = "Yesterday";
  6412. else
  6413. s1 = daysSinceRecovChange + " days ago";
  6414. class9.message = s1 + " you changed your recovery questions";
  6415. }
  6416. if (j == 653)
  6417. if (daysSinceRecovChange == 201) {
  6418. if (membersInt == 1)
  6419. class9.message = "@whi@recommend you use a members world instead. You may use";
  6420. else
  6421. class9.message = "";
  6422. } else if (daysSinceRecovChange == 200)
  6423. class9.message = "We strongly recommend you do so now to secure your account.";
  6424. else
  6425. class9.message = "If you do not remember making this change then cancel it immediately";
  6426. if (j == 654) {
  6427. if (daysSinceRecovChange == 201)
  6428. if (membersInt == 1) {
  6429. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6430. return;
  6431. } else {
  6432. class9.message = "";
  6433. return;
  6434. }
  6435. if (daysSinceRecovChange == 200) {
  6436. class9.message = "Do this from the 'account management' area on our front webpage";
  6437. return;
  6438. }
  6439. class9.message = "Do this from the 'account management' area on our front webpage";
  6440. }
  6441. }
  6442.  
  6443. private void drawSplitPrivateChat() {
  6444. if (splitPrivateChat == 0)
  6445. return;
  6446. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6447. int i = 0;
  6448. if (anInt1104 != 0)
  6449. i = 1;
  6450. for (int j = 0; j < 100; j++)
  6451. if (chatMessages[j] != null) {
  6452. int k = chatTypes[j];
  6453. String s = chatNames[j];
  6454. byte byte1 = 0;
  6455. if (s != null && s.startsWith("@cr1@")) {
  6456. s = s.substring(5);
  6457. byte1 = 1;
  6458. }
  6459. if (s != null && s.startsWith("@cr2@")) {
  6460. s = s.substring(5);
  6461. byte1 = 2;
  6462. }
  6463. if (s != null && s.startsWith("@cr3@")) {
  6464. s = s.substring(5);
  6465. byte1 = 3;
  6466. }
  6467. if (s != null && s.startsWith("@cr4@")) {
  6468. s = s.substring(5);
  6469. byte1 = 4;
  6470. }
  6471. if (s != null && s.startsWith("@cr5@")) {
  6472. s = s.substring(5);
  6473. byte1 = 5;
  6474. }
  6475. if (s != null && s.startsWith("@cr6@")) {
  6476. s = s.substring(5);
  6477. byte1 = 6;
  6478. }
  6479.  
  6480. if ((k == 3 || k == 7)
  6481. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  6482. && isFriendOrSelf(s))) {
  6483. int l = 329 - i * 13;
  6484. int k1 = 4;
  6485. textDrawingArea.method385(0, "From", l, k1);
  6486. textDrawingArea.method385(65535, "From", l - 1, k1);
  6487. if (byte1 == 3 || byte1 == 2 || byte1 == 1 || byte1 == 0) {
  6488. k1 += textDrawingArea.getTextWidth("From ");
  6489. } else if (byte1 == 6 || byte1 == 5 || byte1 == 4) {
  6490. k1 += textDrawingArea.getTextWidth("From");
  6491. }
  6492. if (byte1 == 1) {
  6493. modIcons[0].drawSprite(k1 - 2, l - 12);
  6494. k1 += 12;
  6495. }
  6496. if (byte1 == 2) {
  6497. modIcons[2].drawSprite(k1 - 2, l - 13);
  6498. k1 += 12;
  6499. }
  6500. if (byte1 == 3) {
  6501. modIcons[1].drawSprite(k1 - 2, l - 12);
  6502. k1 += 12;
  6503. }
  6504. if (byte1 == 4) {
  6505. modIcons[3].drawSprite(k1, l - 11);
  6506. k1 += 12;
  6507. }
  6508. if (byte1 == 5) {
  6509. modIcons[4].drawSprite(k1, l - 11);
  6510. k1 += 12;
  6511. }
  6512. if (byte1 == 6) {
  6513. modIcons[5].drawSprite(k1, l - 11);
  6514. k1 += 12;
  6515. }
  6516. textDrawingArea.method385(0, s + ": " + chatMessages[j], l,
  6517. k1);
  6518. textDrawingArea.method385(65535,
  6519. s + ": " + chatMessages[j], l - 1, k1);
  6520. if (++i >= 5)
  6521. return;
  6522. }
  6523. if (k == 5 && privateChatMode < 2) {
  6524. int i1 = 329 - i * 13;
  6525. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6526. textDrawingArea
  6527. .method385(65535, chatMessages[j], i1 - 1, 4);
  6528. if (++i >= 5)
  6529. return;
  6530. }
  6531. if (k == 6 && privateChatMode < 2) {
  6532. int j1 = 329 - i * 13;
  6533. textDrawingArea.method385(0, "To " + s + ": "
  6534. + chatMessages[j], j1, 4);
  6535. textDrawingArea.method385(65535, "To " + s + ": "
  6536. + chatMessages[j], j1 - 1, 4);
  6537. if (++i >= 5)
  6538. return;
  6539. }
  6540. }
  6541.  
  6542. }
  6543.  
  6544. public void pushMessage(String s, int i, String s1) {
  6545. if (i == 0 && dialogID != -1) {
  6546. aString844 = s;
  6547. super.clickMode3 = 0;
  6548. }
  6549. if (backDialogID == -1)
  6550. inputTaken = true;
  6551. for (int j = 499; j > 0; j--) {
  6552. chatTypes[j] = chatTypes[j - 1];
  6553. chatNames[j] = chatNames[j - 1];
  6554. chatMessages[j] = chatMessages[j - 1];
  6555. chatRights[j] = chatRights[j - 1];
  6556. clanTitles[j] = clanTitles[j - 1];
  6557. }
  6558. chatTypes[0] = i;
  6559. chatNames[0] = s1;
  6560. chatMessages[0] = s;
  6561. chatRights[0] = channelRights;
  6562. clanTitles[0] = clanTitle;
  6563. }
  6564.  
  6565. public void setNorth() {
  6566. cameraOffsetX = 0;
  6567. cameraOffsetY = 0;
  6568. viewRotationOffset = 0;
  6569. viewRotation = 0;
  6570. minimapRotation = 0;
  6571. minimapZoom = 0;
  6572. }
  6573.  
  6574. public void processTabClick() {
  6575. if (super.clickMode3 == 1) {
  6576. if (super.saveClickX >= 524 && super.saveClickX <= 561
  6577. && super.saveClickY >= 169 && super.saveClickY < 205
  6578. && tabInterfaceIDs[0] != -1) {
  6579. needDrawTabArea = true;
  6580. tabID = 0;
  6581. tabAreaAltered = true;
  6582. }
  6583. if (super.saveClickX >= 562 && super.saveClickX <= 594
  6584. && super.saveClickY >= 168 && super.saveClickY < 205
  6585. && tabInterfaceIDs[1] != -1) {
  6586. needDrawTabArea = true;
  6587. tabID = 1;
  6588. tabAreaAltered = true;
  6589. }
  6590. if (super.saveClickX >= 595 && super.saveClickX <= 626
  6591. && super.saveClickY >= 168 && super.saveClickY < 205
  6592. && tabInterfaceIDs[2] != -1) {
  6593. needDrawTabArea = true;
  6594. tabID = 2;
  6595. tabAreaAltered = true;
  6596. }
  6597. if (super.saveClickX >= 627 && super.saveClickX <= 660
  6598. && super.saveClickY >= 168 && super.saveClickY < 203
  6599. && tabInterfaceIDs[3] != -1) {
  6600. needDrawTabArea = true;
  6601. tabID = 3;
  6602. tabAreaAltered = true;
  6603. }
  6604. if (super.saveClickX >= 661 && super.saveClickX <= 693
  6605. && super.saveClickY >= 168 && super.saveClickY < 205
  6606. && tabInterfaceIDs[4] != -1) {
  6607. needDrawTabArea = true;
  6608. tabID = 4;
  6609. tabAreaAltered = true;
  6610. }
  6611. if (super.saveClickX >= 694 && super.saveClickX <= 725
  6612. && super.saveClickY >= 168 && super.saveClickY < 205
  6613. && tabInterfaceIDs[5] != -1) {
  6614. needDrawTabArea = true;
  6615. tabID = 5;
  6616. tabAreaAltered = true;
  6617. }
  6618. if (super.saveClickX >= 726 && super.saveClickX <= 765
  6619. && super.saveClickY >= 169 && super.saveClickY < 205
  6620. && tabInterfaceIDs[6] != -1) {
  6621. needDrawTabArea = true;
  6622. tabID = 6;
  6623. tabAreaAltered = true;
  6624. }
  6625. if (super.saveClickX >= 524 && super.saveClickX <= 561
  6626. && super.saveClickY >= 466 && super.saveClickY < 503
  6627. && tabInterfaceIDs[7] != -1) {
  6628. needDrawTabArea = true;
  6629. tabID = 7;
  6630. tabAreaAltered = true;
  6631. }
  6632. if (super.saveClickX >= 562 && super.saveClickX <= 594
  6633. && super.saveClickY >= 466 && super.saveClickY < 503
  6634. && tabInterfaceIDs[8] != -1) {
  6635. needDrawTabArea = true;
  6636. tabID = 8;
  6637. tabAreaAltered = true;
  6638. }
  6639. if (super.saveClickX >= 595 && super.saveClickX <= 627
  6640. && super.saveClickY >= 466 && super.saveClickY < 503
  6641. && tabInterfaceIDs[9] != -1) {
  6642. needDrawTabArea = true;
  6643. tabID = 9;
  6644. tabAreaAltered = true;
  6645. }
  6646. if (super.saveClickX >= 627 && super.saveClickX <= 664
  6647. && super.saveClickY >= 466 && super.saveClickY < 503
  6648. && tabInterfaceIDs[10] != -1) {
  6649. needDrawTabArea = true;
  6650. tabID = 10;
  6651. tabAreaAltered = true;
  6652. }
  6653. if (super.saveClickX >= 661 && super.saveClickX <= 694
  6654. && super.saveClickY >= 466 && super.saveClickY < 503
  6655. && tabInterfaceIDs[11] != -1) {
  6656. needDrawTabArea = true;
  6657. tabID = 11;
  6658. tabAreaAltered = true;
  6659. }
  6660. if (super.saveClickX >= 695 && super.saveClickX <= 725
  6661. && super.saveClickY >= 466 && super.saveClickY < 503
  6662. && tabInterfaceIDs[12] != -1) {
  6663. needDrawTabArea = true;
  6664. tabID = 12;
  6665. tabAreaAltered = true;
  6666. }
  6667. if (super.saveClickX >= 726 && super.saveClickX <= 765
  6668. && super.saveClickY >= 466 && super.saveClickY < 502
  6669. && tabInterfaceIDs[13] != -1) {
  6670. needDrawTabArea = true;
  6671. tabID = 13;
  6672. tabAreaAltered = true;
  6673. }
  6674. }
  6675. }
  6676.  
  6677. private void resetImageProducers2() {
  6678. if (aRSImageProducer_1166 != null)
  6679. return;
  6680. nullLoader();
  6681. super.fullGameScreen = null;
  6682. aRSImageProducer_1107 = null;
  6683. aRSImageProducer_1108 = null;
  6684. aRSImageProducer_1109 = null;
  6685. aRSImageProducer_1110 = null;
  6686. aRSImageProducer_1111 = null;
  6687. aRSImageProducer_1112 = null;
  6688. aRSImageProducer_1113 = null;
  6689. aRSImageProducer_1114 = null;
  6690. aRSImageProducer_1115 = null;
  6691. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  6692. getGameComponent());
  6693. aRSImageProducer_1164 = new RSImageProducer(246, 168,
  6694. getGameComponent());
  6695. DrawingArea.setAllPixelsToZero();
  6696. if (revision508 == true) {
  6697. mapArea508.drawSprite(0, 0);
  6698. }
  6699. if (revision474 == true) {
  6700. mapArea474.drawSprite(0, 0);
  6701. }
  6702. if (revision498 == true) {
  6703. mapArea.drawSprite(0, 0);
  6704. }
  6705. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  6706. getGameComponent());
  6707. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  6708. getGameComponent());
  6709. DrawingArea.setAllPixelsToZero();
  6710. new RSImageProducer(496, 50, getGameComponent());
  6711. new RSImageProducer(269, 37, getGameComponent());
  6712. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6713. welcomeScreenRaised = true;
  6714. }
  6715.  
  6716. public String getDocumentBaseHost() {
  6717. if (signlink.mainapp != null) {
  6718. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6719. }
  6720. if (super.gameFrame != null) {
  6721. return "";
  6722. } else {
  6723. return "";
  6724. }
  6725. }
  6726.  
  6727. private void method81(Sprite sprite, int j, int k) {
  6728. int l = k * k + j * j;
  6729. if (l > 4225 && l < 0x15f90) {
  6730. int i1 = viewRotation + minimapRotation & 0x7ff;
  6731. int j1 = Model.modelIntArray1[i1];
  6732. int k1 = Model.modelIntArray2[i1];
  6733. j1 = (j1 * 256) / (minimapZoom + 256);
  6734. k1 = (k1 * 256) / (minimapZoom + 256);
  6735. int l1 = j * j1 + k * k1 >> 16;
  6736. int i2 = j * k1 - k * j1 >> 16;
  6737. double d = Math.atan2(l1, i2);
  6738. int j2 = (int) (Math.sin(d) * 63D);
  6739. int k2 = (int) (Math.cos(d) * 57D);
  6740. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6741. } else {
  6742. markMinimap(sprite, k, j);
  6743. }
  6744. }
  6745.  
  6746. public void rightClickChatButtons() {
  6747. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482
  6748. && super.mouseY <= 503) {
  6749. menuActionName[1] = "View All";
  6750. menuActionID[1] = 999;
  6751. menuActionRow = 2;
  6752. } else if (super.mouseX >= 71 && super.mouseX <= 127
  6753. && super.mouseY >= 482 && super.mouseY <= 503) {
  6754. menuActionName[1] = "View Game";
  6755. menuActionID[1] = 998;
  6756. menuActionRow = 2;
  6757. } else if (super.mouseX >= 137 && super.mouseX <= 193
  6758. && super.mouseY >= 482 && super.mouseY <= 503) {
  6759. menuActionName[1] = "Hide public";
  6760. menuActionID[1] = 997;
  6761. menuActionName[2] = "Off public";
  6762. menuActionID[2] = 996;
  6763. menuActionName[3] = "Friends public";
  6764. menuActionID[3] = 995;
  6765. menuActionName[4] = "On public";
  6766. menuActionID[4] = 994;
  6767. menuActionName[5] = "View public";
  6768. menuActionID[5] = 993;
  6769. menuActionRow = 6;
  6770. } else if (super.mouseX >= 203 && super.mouseX <= 259
  6771. && super.mouseY >= 482 && super.mouseY <= 503) {
  6772. menuActionName[1] = "Off private";
  6773. menuActionID[1] = 992;
  6774. menuActionName[2] = "Friends private";
  6775. menuActionID[2] = 991;
  6776. menuActionName[3] = "On private";
  6777. menuActionID[3] = 990;
  6778. menuActionName[4] = "View private";
  6779. menuActionID[4] = 989;
  6780. menuActionRow = 5;
  6781. } else if (super.mouseX >= 269 && super.mouseX <= 325
  6782. && super.mouseY >= 482 && super.mouseY <= 503) {
  6783. menuActionName[1] = "Off clan chat";
  6784. menuActionID[1] = 1003;
  6785. menuActionName[2] = "Friends clan chat";
  6786. menuActionID[2] = 1002;
  6787. menuActionName[3] = "On clan chat";
  6788. menuActionID[3] = 1001;
  6789. menuActionName[4] = "View clan chat";
  6790. menuActionID[4] = 1000;
  6791. menuActionRow = 5;
  6792. } else if (super.mouseX >= 335 && super.mouseX <= 391
  6793. && super.mouseY >= 482 && super.mouseY <= 503) {
  6794. menuActionName[1] = "Off trade";
  6795. menuActionID[1] = 987;
  6796. menuActionName[2] = "Friends trade";
  6797. menuActionID[2] = 986;
  6798. menuActionName[3] = "On trade";
  6799. menuActionID[3] = 985;
  6800. menuActionName[4] = "View trade";
  6801. menuActionID[4] = 984;
  6802. menuActionRow = 5;
  6803. }
  6804. }
  6805.  
  6806. public void processRightClick() {
  6807. if (activeInterfaceType != 0) {
  6808. return;
  6809. }
  6810. menuActionName[0] = "Cancel";
  6811. menuActionID[0] = 1107;
  6812. menuActionRow = 1;
  6813. if (fullscreenInterfaceID != -1) {
  6814. anInt886 = 0;
  6815. anInt1315 = 0;
  6816. buildInterfaceMenu(8,
  6817. RSInterface.interfaceCache[fullscreenInterfaceID],
  6818. super.mouseX, 8, super.mouseY, 0);
  6819. if (anInt886 != anInt1026) {
  6820. anInt1026 = anInt886;
  6821. }
  6822. if (anInt1315 != anInt1129) {
  6823. anInt1129 = anInt1315;
  6824. }
  6825. return;
  6826. }
  6827. buildSplitPrivateChatMenu();
  6828. anInt886 = 0;
  6829. anInt1315 = 0;
  6830. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516
  6831. && super.mouseY < 338) {
  6832. if (openInterfaceID != -1) {
  6833. buildInterfaceMenu(4,
  6834. RSInterface.interfaceCache[openInterfaceID],
  6835. super.mouseX, 4, super.mouseY, 0);
  6836. } else {
  6837. build3dScreenMenu();
  6838. }
  6839. }
  6840. if (anInt886 != anInt1026) {
  6841. anInt1026 = anInt886;
  6842. }
  6843. if (anInt1315 != anInt1129) {
  6844. anInt1129 = anInt1315;
  6845. }
  6846. anInt886 = 0;
  6847. anInt1315 = 0;
  6848. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740
  6849. && super.mouseY < 468) {
  6850. if (invOverlayInterfaceID != -1) {
  6851. buildInterfaceMenu(548,
  6852. RSInterface.interfaceCache[invOverlayInterfaceID],
  6853. super.mouseX, 207, super.mouseY, 0);
  6854. } else if (tabInterfaceIDs[tabID] != -1) {
  6855. buildInterfaceMenu(548,
  6856. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  6857. super.mouseX, 207, super.mouseY, 0);
  6858. }
  6859. }
  6860. if (anInt886 != anInt1048) {
  6861. needDrawTabArea = true;
  6862. tabAreaAltered = true;
  6863. anInt1048 = anInt886;
  6864. }
  6865. if (anInt1315 != anInt1044) {
  6866. needDrawTabArea = true;
  6867. tabAreaAltered = true;
  6868. anInt1044 = anInt1315;
  6869. }
  6870. anInt886 = 0;
  6871. anInt1315 = 0;
  6872. if (super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490
  6873. && super.mouseY < 463) {
  6874. if (backDialogID != -1) {
  6875. buildInterfaceMenu(20,
  6876. RSInterface.interfaceCache[backDialogID], super.mouseX,
  6877. 358, super.mouseY, 0);
  6878. } else if (super.mouseY < 463 && super.mouseX < 490) {
  6879. buildChatAreaMenu(super.mouseY - 338);
  6880. }
  6881. }
  6882. if (backDialogID != -1 && anInt886 != anInt1039) {
  6883. inputTaken = true;
  6884. anInt1039 = anInt886;
  6885. }
  6886. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6887. inputTaken = true;
  6888. anInt1500 = anInt1315;
  6889. }
  6890. /* Enable custom right click areas */
  6891. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516
  6892. && super.mouseY < 503)
  6893. rightClickChatButtons();
  6894. /**/
  6895. // processXPCounterClick();
  6896. boolean flag = false;
  6897. while (!flag) {
  6898. flag = true;
  6899. for (int j = 0; j < menuActionRow - 1; j++) {
  6900. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6901. String s = menuActionName[j];
  6902. menuActionName[j] = menuActionName[j + 1];
  6903. menuActionName[j + 1] = s;
  6904. int k = menuActionID[j];
  6905. menuActionID[j] = menuActionID[j + 1];
  6906. menuActionID[j + 1] = k;
  6907. k = menuActionCmd2[j];
  6908. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6909. menuActionCmd2[j + 1] = k;
  6910. k = menuActionCmd3[j];
  6911. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6912. menuActionCmd3[j + 1] = k;
  6913. k = menuActionCmd1[j];
  6914. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6915. menuActionCmd1[j + 1] = k;
  6916. flag = false;
  6917. }
  6918. }
  6919. }
  6920. }
  6921.  
  6922. private int method83(int i, int j, int k) {
  6923. int l = 256 - k;
  6924. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  6925. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6926. }
  6927.  
  6928. public void login(String s, String s1, boolean flag) {
  6929. signlink.errorname = s;
  6930. try {
  6931. if (!flag) {
  6932. loginMessage1 = "";
  6933. loginMessage2 = "Connecting to server...";
  6934. drawLoginScreen(true);
  6935. }
  6936. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6937. long l = TextClass.longForName(s);
  6938. int i = (int) (l >> 16 & 31L);
  6939. stream.currentOffset = 0;
  6940. stream.writeWordBigEndian(14);
  6941. stream.writeWordBigEndian(i);
  6942. socketStream.queueBytes(2, stream.buffer);
  6943. for (int j = 0; j < 8; j++)
  6944. socketStream.read();
  6945.  
  6946. int k = socketStream.read();
  6947. int i1 = k;
  6948. if (k == 0) {
  6949. socketStream.flushInputStream(inStream.buffer, 8);
  6950. inStream.currentOffset = 0;
  6951. aLong1215 = inStream.readQWord();
  6952. int ai[] = new int[4];
  6953. ai[0] = (int) (Math.random() * 99999999D);
  6954. ai[1] = (int) (Math.random() * 99999999D);
  6955. ai[2] = (int) (aLong1215 >> 32);
  6956. ai[3] = (int) aLong1215;
  6957. stream.currentOffset = 0;
  6958. stream.writeWordBigEndian(10);
  6959. stream.writeDWord(ai[0]);
  6960. stream.writeDWord(ai[1]);
  6961. stream.writeDWord(ai[2]);
  6962. stream.writeDWord(ai[3]);
  6963. stream.writeDWord(signlink.uid);
  6964. stream.writeString(s);
  6965. stream.writeString(s1);
  6966. stream.doKeys();
  6967. aStream_847.currentOffset = 0;
  6968. if (flag)
  6969. aStream_847.writeWordBigEndian(18);
  6970. else
  6971. aStream_847.writeWordBigEndian(16);
  6972. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  6973. + 1 + 2);
  6974. aStream_847.writeWordBigEndian(255);
  6975. aStream_847.writeWord(317);
  6976. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6977. for (int l1 = 0; l1 < 9; l1++)
  6978. aStream_847.writeDWord(expectedCRCs[l1]);
  6979.  
  6980. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6981. stream.encryption = new ISAACRandomGen(ai);
  6982. for (int j2 = 0; j2 < 4; j2++)
  6983. ai[j2] += 50;
  6984.  
  6985. encryption = new ISAACRandomGen(ai);
  6986. socketStream.queueBytes(aStream_847.currentOffset,
  6987. aStream_847.buffer);
  6988. k = socketStream.read();
  6989. }
  6990. if (k == 1) {
  6991. try {
  6992. Thread.sleep(2000L);
  6993. } catch (Exception _ex) {
  6994. }
  6995. login(s, s1, flag);
  6996. return;
  6997. }
  6998. if (k == 2) {
  6999. myPrivilege = socketStream.read();
  7000. flagged = socketStream.read() == 1;
  7001. aLong1220 = 0L;
  7002. anInt1022 = 0;
  7003. mouseDetection.coordsIndex = 0;
  7004. super.awtFocus = true;
  7005. aBoolean954 = true;
  7006. loggedIn = true;
  7007. stream.currentOffset = 0;
  7008. inStream.currentOffset = 0;
  7009. pktType = -1;
  7010. anInt841 = -1;
  7011. anInt842 = -1;
  7012. anInt843 = -1;
  7013. pktSize = 0;
  7014. anInt1009 = 0;
  7015. anInt1104 = 0;
  7016. anInt1011 = 0;
  7017. anInt855 = 0;
  7018. menuActionRow = 0;
  7019. menuOpen = false;
  7020. super.idleTime = 0;
  7021. for (int j1 = 0; j1 < 500; j1++)
  7022. chatMessages[j1] = null;
  7023.  
  7024. itemSelected = 0;
  7025. spellSelected = 0;
  7026. loadingStage = 0;
  7027. anInt1062 = 0;
  7028. setNorth();
  7029. anInt1021 = 0;
  7030. anInt985 = -1;
  7031. destX = 0;
  7032. destY = 0;
  7033. playerCount = 0;
  7034. npcCount = 0;
  7035. for (int i2 = 0; i2 < maxPlayers; i2++) {
  7036. playerArray[i2] = null;
  7037. aStreamArray895s[i2] = null;
  7038. }
  7039.  
  7040. for (int k2 = 0; k2 < 16384; k2++)
  7041. npcArray[k2] = null;
  7042.  
  7043. myPlayer = playerArray[myPlayerIndex] = new Player();
  7044. aClass19_1013.removeAll();
  7045. aClass19_1056.removeAll();
  7046. for (int l2 = 0; l2 < 4; l2++) {
  7047. for (int i3 = 0; i3 < 104; i3++) {
  7048. for (int k3 = 0; k3 < 104; k3++)
  7049. groundArray[l2][i3][k3] = null;
  7050.  
  7051. }
  7052.  
  7053. }
  7054.  
  7055. aClass19_1179 = new NodeList();
  7056. fullscreenInterfaceID = -1;
  7057. anInt900 = 0;
  7058. friendsCount = 0;
  7059. dialogID = -1;
  7060. backDialogID = -1;
  7061. openInterfaceID = -1;
  7062. invOverlayInterfaceID = -1;
  7063. anInt1018 = -1;
  7064. aBoolean1149 = false;
  7065. tabID = 3;
  7066. inputDialogState = 0;
  7067. menuOpen = false;
  7068. messagePromptRaised = false;
  7069. aString844 = null;
  7070. anInt1055 = 0;
  7071. anInt1054 = -1;
  7072. aBoolean1047 = true;
  7073. method45();
  7074. for (int j3 = 0; j3 < 5; j3++)
  7075. anIntArray990[j3] = 0;
  7076.  
  7077. for (int l3 = 0; l3 < 5; l3++) {
  7078. atPlayerActions[l3] = null;
  7079. atPlayerArray[l3] = false;
  7080. }
  7081.  
  7082. anInt1175 = 0;
  7083. anInt1134 = 0;
  7084. anInt986 = 0;
  7085. anInt1288 = 0;
  7086. anInt924 = 0;
  7087. anInt1188 = 0;
  7088. anInt1155 = 0;
  7089. anInt1226 = 0;
  7090. resetImageProducers2();
  7091. return;
  7092. }
  7093. if (k == 3) {
  7094. loginMessage1 = "";
  7095. loginMessage2 = "Invalid username or password.";
  7096. return;
  7097. }
  7098. if (k == 4) {
  7099. loginMessage1 = "Your account has been disabled.";
  7100. loginMessage2 = "Please check your message-center for details.";
  7101. return;
  7102. }
  7103. if (k == 5) {
  7104. loginMessage1 = "Your account is already logged in.";
  7105. loginMessage2 = "Try again in 60 secs...";
  7106. return;
  7107. }
  7108. if (k == 6) {
  7109. loginMessage1 = "RuneScape has been updated!";
  7110. loginMessage2 = "Please reload this page.";
  7111. return;
  7112. }
  7113. if (k == 7) {
  7114. loginMessage1 = "This world is full.";
  7115. loginMessage2 = "Please use a different world.";
  7116. return;
  7117. }
  7118. if (k == 8) {
  7119. loginMessage1 = "Unable to connect.";
  7120. loginMessage2 = "Login server offline.";
  7121. return;
  7122. }
  7123. if (k == 9) {
  7124. loginMessage1 = "Login limit exceeded.";
  7125. loginMessage2 = "Too many connections from your address.";
  7126. return;
  7127. }
  7128. if (k == 10) {
  7129. loginMessage1 = "Unable to connect.";
  7130. loginMessage2 = "Bad session id.";
  7131. return;
  7132. }
  7133. if (k == 11) {
  7134. loginMessage2 = "Login server rejected session.";
  7135. loginMessage2 = "Please try again.";
  7136. return;
  7137. }
  7138. if (k == 12) {
  7139. loginMessage1 = "You need a members account to login to this world.";
  7140. loginMessage2 = "Please subscribe, or use a different world.";
  7141. return;
  7142. }
  7143. if (k == 13) {
  7144. loginMessage1 = "Could not complete login.";
  7145. loginMessage2 = "Please try using a different world.";
  7146. return;
  7147. }
  7148. if (k == 14) {
  7149. loginMessage1 = "The server is being updated.";
  7150. loginMessage2 = "Please wait 1 minute and try again.";
  7151. return;
  7152. }
  7153. if (k == 15) {
  7154. loggedIn = true;
  7155. stream.currentOffset = 0;
  7156. inStream.currentOffset = 0;
  7157. pktType = -1;
  7158. anInt841 = -1;
  7159. anInt842 = -1;
  7160. anInt843 = -1;
  7161. pktSize = 0;
  7162. anInt1009 = 0;
  7163. anInt1104 = 0;
  7164. menuActionRow = 0;
  7165. menuOpen = false;
  7166. aLong824 = System.currentTimeMillis();
  7167. return;
  7168. }
  7169. if (k == 16) {
  7170. loginMessage1 = "Login attempts exceeded.";
  7171. loginMessage2 = "Please wait 1 minute and try again.";
  7172. return;
  7173. }
  7174. if (k == 17) {
  7175. loginMessage1 = "You are standing in a members-only area.";
  7176. loginMessage2 = "To play on this world move to a free area first";
  7177. return;
  7178. }
  7179. if (k == 20) {
  7180. loginMessage1 = "Invalid loginserver requested";
  7181. loginMessage2 = "Please try using a different world.";
  7182. return;
  7183. }
  7184. if (k == 21) {
  7185. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  7186. loginMessage1 = "You have only just left another world";
  7187. loginMessage2 = "Your profile will be transferred in: "
  7188. + k1 + " seconds";
  7189. drawLoginScreen(true);
  7190. try {
  7191. Thread.sleep(1000L);
  7192. } catch (Exception _ex) {
  7193. }
  7194. }
  7195.  
  7196. login(s, s1, flag);
  7197. return;
  7198. }
  7199. if (k == 22) {
  7200. loginMessage1 = "Your computer has been UUID banned.";
  7201. loginMessage2 = "Please appeal on the forums.";
  7202. return;
  7203. }
  7204. if (k == -1) {
  7205. if (i1 == 0) {
  7206. if (loginFailures < 2) {
  7207. try {
  7208. Thread.sleep(2000L);
  7209. } catch (Exception _ex) {
  7210. }
  7211. loginFailures++;
  7212. login(s, s1, flag);
  7213. return;
  7214. } else {
  7215. loginMessage1 = "No response from loginserver";
  7216. loginMessage2 = "Please wait 1 minute and try again.";
  7217. return;
  7218. }
  7219. } else {
  7220. loginMessage1 = "No response from server";
  7221. loginMessage2 = "Please try using a different world.";
  7222. return;
  7223. }
  7224. } else {
  7225. System.out.println("response:" + k);
  7226. loginMessage1 = "Unexpected server response";
  7227. loginMessage2 = "Please try using a different world.";
  7228. return;
  7229. }
  7230. } catch (IOException _ex) {
  7231. loginMessage1 = "";
  7232. } catch (Exception e) {
  7233. System.out.println("Error while generating uid. Skipping step.");
  7234. e.printStackTrace();
  7235. }
  7236. loginMessage2 = "Error connecting to server.";
  7237. }
  7238.  
  7239. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  7240. int l1, int i2, int j2, boolean flag, int k2) {
  7241. byte byte0 = 104;
  7242. byte byte1 = 104;
  7243. for (int l2 = 0; l2 < byte0; l2++) {
  7244. for (int i3 = 0; i3 < byte1; i3++) {
  7245. anIntArrayArray901[l2][i3] = 0;
  7246. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7247. }
  7248. }
  7249. int j3 = j2;
  7250. int k3 = j1;
  7251. anIntArrayArray901[j2][j1] = 99;
  7252. anIntArrayArray825[j2][j1] = 0;
  7253. int l3 = 0;
  7254. int i4 = 0;
  7255. bigX[l3] = j2;
  7256. bigY[l3++] = j1;
  7257. boolean flag1 = false;
  7258. int j4 = bigX.length;
  7259. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7260. while (i4 != l3) {
  7261. j3 = bigX[i4];
  7262. k3 = bigY[i4];
  7263. i4 = (i4 + 1) % j4;
  7264. if (j3 == k2 && k3 == i2) {
  7265. flag1 = true;
  7266. break;
  7267. }
  7268. if (i1 != 0) {
  7269. if ((i1 < 5 || i1 == 10)
  7270. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  7271. i1 - 1, i2)) {
  7272. flag1 = true;
  7273. break;
  7274. }
  7275. if (i1 < 10
  7276. && aClass11Array1230[plane].method220(k2, i2, k3,
  7277. i1 - 1, j, j3)) {
  7278. flag1 = true;
  7279. break;
  7280. }
  7281. }
  7282. if (k1 != 0
  7283. && k != 0
  7284. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  7285. k1, k3)) {
  7286. flag1 = true;
  7287. break;
  7288. }
  7289. int l4 = anIntArrayArray825[j3][k3] + 1;
  7290. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  7291. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  7292. bigX[l3] = j3 - 1;
  7293. bigY[l3] = k3;
  7294. l3 = (l3 + 1) % j4;
  7295. anIntArrayArray901[j3 - 1][k3] = 2;
  7296. anIntArrayArray825[j3 - 1][k3] = l4;
  7297. }
  7298. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  7299. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  7300. bigX[l3] = j3 + 1;
  7301. bigY[l3] = k3;
  7302. l3 = (l3 + 1) % j4;
  7303. anIntArrayArray901[j3 + 1][k3] = 8;
  7304. anIntArrayArray825[j3 + 1][k3] = l4;
  7305. }
  7306. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  7307. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7308. bigX[l3] = j3;
  7309. bigY[l3] = k3 - 1;
  7310. l3 = (l3 + 1) % j4;
  7311. anIntArrayArray901[j3][k3 - 1] = 1;
  7312. anIntArrayArray825[j3][k3 - 1] = l4;
  7313. }
  7314. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  7315. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7316. bigX[l3] = j3;
  7317. bigY[l3] = k3 + 1;
  7318. l3 = (l3 + 1) % j4;
  7319. anIntArrayArray901[j3][k3 + 1] = 4;
  7320. anIntArrayArray825[j3][k3 + 1] = l4;
  7321. }
  7322. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  7323. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  7324. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7325. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7326. bigX[l3] = j3 - 1;
  7327. bigY[l3] = k3 - 1;
  7328. l3 = (l3 + 1) % j4;
  7329. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7330. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7331. }
  7332. if (j3 < byte0 - 1 && k3 > 0
  7333. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  7334. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  7335. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7336. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7337. bigX[l3] = j3 + 1;
  7338. bigY[l3] = k3 - 1;
  7339. l3 = (l3 + 1) % j4;
  7340. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7341. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7342. }
  7343. if (j3 > 0 && k3 < byte1 - 1
  7344. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  7345. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  7346. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7347. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7348. bigX[l3] = j3 - 1;
  7349. bigY[l3] = k3 + 1;
  7350. l3 = (l3 + 1) % j4;
  7351. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7352. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7353. }
  7354. if (j3 < byte0 - 1 && k3 < byte1 - 1
  7355. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  7356. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  7357. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7358. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7359. bigX[l3] = j3 + 1;
  7360. bigY[l3] = k3 + 1;
  7361. l3 = (l3 + 1) % j4;
  7362. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7363. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7364. }
  7365. }
  7366. anInt1264 = 0;
  7367. if (!flag1) {
  7368. if (flag) {
  7369. int i5 = 100;
  7370. for (int k5 = 1; k5 < 2; k5++) {
  7371. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  7372. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7373. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  7374. && anIntArrayArray825[i6][l6] < i5) {
  7375. i5 = anIntArrayArray825[i6][l6];
  7376. j3 = i6;
  7377. k3 = l6;
  7378. anInt1264 = 1;
  7379. flag1 = true;
  7380. }
  7381.  
  7382. }
  7383.  
  7384. if (flag1)
  7385. break;
  7386. }
  7387.  
  7388. }
  7389. if (!flag1)
  7390. return false;
  7391. }
  7392. i4 = 0;
  7393. bigX[i4] = j3;
  7394. bigY[i4++] = k3;
  7395. int l5;
  7396. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  7397. if (j5 != l5) {
  7398. l5 = j5;
  7399. bigX[i4] = j3;
  7400. bigY[i4++] = k3;
  7401. }
  7402. if ((j5 & 2) != 0)
  7403. j3++;
  7404. else if ((j5 & 8) != 0)
  7405. j3--;
  7406. if ((j5 & 1) != 0)
  7407. k3++;
  7408. else if ((j5 & 4) != 0)
  7409. k3--;
  7410. }
  7411. // if(cancelWalk) { return i4 > 0; }
  7412.  
  7413. if (i4 > 0) {
  7414. int k4 = i4;
  7415. if (k4 > 25)
  7416. k4 = 25;
  7417. i4--;
  7418. int k6 = bigX[i4];
  7419. int i7 = bigY[i4];
  7420. anInt1288 += k4;
  7421. if (anInt1288 >= 92) {
  7422. stream.createFrame(36);
  7423. stream.writeDWord(0);
  7424. anInt1288 = 0;
  7425. }
  7426. if (i == 0) {
  7427. stream.createFrame(164);
  7428. stream.writeWordBigEndian(k4 + k4 + 3);
  7429. }
  7430. if (i == 1) {
  7431. stream.createFrame(248);
  7432. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7433. }
  7434. if (i == 2) {
  7435. stream.createFrame(98);
  7436. stream.writeWordBigEndian(k4 + k4 + 3);
  7437. }
  7438. stream.method433(k6 + baseX);
  7439. destX = bigX[0];
  7440. destY = bigY[0];
  7441. for (int j7 = 1; j7 < k4; j7++) {
  7442. i4--;
  7443. stream.writeWordBigEndian(bigX[i4] - k6);
  7444. stream.writeWordBigEndian(bigY[i4] - i7);
  7445. }
  7446.  
  7447. stream.method431(i7 + baseY);
  7448. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7449. return true;
  7450. }
  7451. return i != 1;
  7452. }
  7453.  
  7454. public void method86(Stream stream) {
  7455. for (int j = 0; j < anInt893; j++) {
  7456. int k = anIntArray894[j];
  7457. NPC npc = npcArray[k];
  7458. int l = stream.readUnsignedByte();
  7459. if ((l & 0x10) != 0) {
  7460. int i1 = stream.method434();
  7461. if (i1 == 65535)
  7462. i1 = -1;
  7463. int i2 = stream.readUnsignedByte();
  7464. if (i1 == npc.anim && i1 != -1) {
  7465. int l2 = Animation.anims[i1].anInt365;
  7466. if (l2 == 1) {
  7467. npc.anInt1527 = 0;
  7468. npc.anInt1528 = 0;
  7469. npc.anInt1529 = i2;
  7470. npc.anInt1530 = 0;
  7471. }
  7472. if (l2 == 2)
  7473. npc.anInt1530 = 0;
  7474. } else if (i1 == -1
  7475. || npc.anim == -1
  7476. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  7477. npc.anim = i1;
  7478. npc.anInt1527 = 0;
  7479. npc.anInt1528 = 0;
  7480. npc.anInt1529 = i2;
  7481. npc.anInt1530 = 0;
  7482. npc.anInt1542 = npc.smallXYIndex;
  7483. }
  7484. }
  7485. if ((l & 8) != 0) {
  7486. int j1 = stream.method426();
  7487. int j2 = stream.method427();
  7488. npc.updateHitData(j2, j1, loopCycle);
  7489. npc.loopCycleStatus = loopCycle + 300;
  7490. npc.currentHealth = stream.method426();
  7491. npc.maxHealth = stream.readUnsignedByte();
  7492. }
  7493. if ((l & 0x80) != 0) {
  7494. npc.anInt1520 = stream.readUnsignedWord();
  7495. int k1 = stream.readDWord();
  7496. npc.anInt1524 = k1 >> 16;
  7497. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7498. npc.anInt1521 = 0;
  7499. npc.anInt1522 = 0;
  7500. if (npc.anInt1523 > loopCycle)
  7501. npc.anInt1521 = -1;
  7502. if (npc.anInt1520 == 65535)
  7503. npc.anInt1520 = -1;
  7504. }
  7505. if ((l & 0x20) != 0) {
  7506. npc.interactingEntity = stream.readUnsignedWord();
  7507. if (npc.interactingEntity == 65535)
  7508. npc.interactingEntity = -1;
  7509. }
  7510. if ((l & 1) != 0) {
  7511. npc.textSpoken = stream.readString();
  7512. npc.textCycle = 100;
  7513. }
  7514. if ((l & 0x40) != 0) {
  7515. int l1 = stream.method427();
  7516. int k2 = stream.method428();
  7517. npc.updateHitData(k2, l1, loopCycle);
  7518. npc.loopCycleStatus = loopCycle + 300;
  7519. npc.currentHealth = stream.method428();
  7520. npc.maxHealth = stream.method427();
  7521. }
  7522. if ((l & 2) != 0) {
  7523. npc.desc = EntityDef.forID(stream.method436());
  7524. npc.anInt1540 = npc.desc.aByte68;
  7525. npc.anInt1504 = npc.desc.anInt79;
  7526. npc.anInt1554 = npc.desc.walkAnim;
  7527. npc.anInt1555 = npc.desc.anInt58;
  7528. npc.anInt1556 = npc.desc.anInt83;
  7529. npc.anInt1557 = npc.desc.anInt55;
  7530. npc.anInt1511 = npc.desc.standAnim;
  7531. }
  7532. if ((l & 4) != 0) {
  7533. npc.anInt1538 = stream.method434();
  7534. npc.anInt1539 = stream.method434();
  7535. }
  7536. }
  7537. }
  7538.  
  7539. public void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  7540. if (menuActionRow >= 400)
  7541. return;
  7542. if (entityDef.childrenIDs != null)
  7543. entityDef = entityDef.method161();
  7544. if (entityDef == null)
  7545. return;
  7546. if (!entityDef.aBoolean84)
  7547. return;
  7548. String s = entityDef.name;
  7549. if (entityDef.combatLevel != 0)
  7550. s = s
  7551. + combatDiffColor(myPlayer.combatLevel,
  7552. entityDef.combatLevel) + " (level-"
  7553. + entityDef.combatLevel + ")";
  7554. if (itemSelected == 1) {
  7555. menuActionName[menuActionRow] = "Use " + selectedItemName
  7556. + " with @yel@" + s;
  7557. menuActionID[menuActionRow] = 582;
  7558. menuActionCmd1[menuActionRow] = i;
  7559. menuActionCmd2[menuActionRow] = k;
  7560. menuActionCmd3[menuActionRow] = j;
  7561. menuActionRow++;
  7562. return;
  7563. }
  7564. if (spellSelected == 1) {
  7565. if ((spellUsableOn & 2) == 2) {
  7566. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7567. menuActionID[menuActionRow] = 413;
  7568. menuActionCmd1[menuActionRow] = i;
  7569. menuActionCmd2[menuActionRow] = k;
  7570. menuActionCmd3[menuActionRow] = j;
  7571. menuActionRow++;
  7572. }
  7573. } else {
  7574. if (entityDef.actions != null) {
  7575. for (int l = 4; l >= 0; l--)
  7576. if (entityDef.actions[l] != null
  7577. && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  7578. menuActionName[menuActionRow] = entityDef.actions[l]
  7579. + " @yel@" + s;
  7580. if (l == 0)
  7581. menuActionID[menuActionRow] = 20;
  7582. if (l == 1)
  7583. menuActionID[menuActionRow] = 412;
  7584. if (l == 2)
  7585. menuActionID[menuActionRow] = 225;
  7586. if (l == 3)
  7587. menuActionID[menuActionRow] = 965;
  7588. if (l == 4)
  7589. menuActionID[menuActionRow] = 478;
  7590. menuActionCmd1[menuActionRow] = i;
  7591. menuActionCmd2[menuActionRow] = k;
  7592. menuActionCmd3[menuActionRow] = j;
  7593. menuActionRow++;
  7594. }
  7595.  
  7596. }
  7597. if (entityDef.actions != null) {
  7598. for (int i1 = 4; i1 >= 0; i1--)
  7599. if (entityDef.actions[i1] != null
  7600. && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  7601. char c = '\0';
  7602. if (entityDef.combatLevel > myPlayer.combatLevel)
  7603. c = '\u07D0';
  7604. menuActionName[menuActionRow] = entityDef.actions[i1]
  7605. + " @yel@" + s;
  7606. if (i1 == 0)
  7607. menuActionID[menuActionRow] = 20 + c;
  7608. if (i1 == 1)
  7609. menuActionID[menuActionRow] = 412 + c;
  7610. if (i1 == 2)
  7611. menuActionID[menuActionRow] = 225 + c;
  7612. if (i1 == 3)
  7613. menuActionID[menuActionRow] = 965 + c;
  7614. if (i1 == 4)
  7615. menuActionID[menuActionRow] = 478 + c;
  7616. menuActionCmd1[menuActionRow] = i;
  7617. menuActionCmd2[menuActionRow] = k;
  7618. menuActionCmd3[menuActionRow] = j;
  7619. menuActionRow++;
  7620. }
  7621.  
  7622. }
  7623. // menuActionName[menuActionRow] = "Examine @yel@" + s +
  7624. // " @gre@(@whi@" + entityDef.type + "@gre@)";
  7625. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7626. menuActionID[menuActionRow] = 1025;
  7627. menuActionCmd1[menuActionRow] = i;
  7628. menuActionCmd2[menuActionRow] = k;
  7629. menuActionCmd3[menuActionRow] = j;
  7630. menuActionRow++;
  7631. }
  7632. }
  7633.  
  7634. public void buildAtPlayerMenu(int i, int j, Player player, int k) {
  7635. if (player == myPlayer)
  7636. return;
  7637. if (menuActionRow >= 400)
  7638. return;
  7639. String s;
  7640. if (player.title.length() < 0)
  7641. s = player.name
  7642. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  7643. + " (level: " + player.combatLevel + ")";
  7644. else if (player.title.length() != 0)
  7645. s = "@" + titleColor(player.titleColor, 1) + "@" + player.title
  7646. + "@whi@" + player.name
  7647. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  7648. + " (level: " + player.combatLevel + ")";
  7649. else
  7650. s = player.name
  7651. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  7652. + " (level: " + player.combatLevel + ")";
  7653. if (itemSelected == 1) {
  7654. menuActionName[menuActionRow] = "Use " + selectedItemName
  7655. + " with @whi@" + s;
  7656. menuActionID[menuActionRow] = 491;
  7657. menuActionCmd1[menuActionRow] = j;
  7658. menuActionCmd2[menuActionRow] = i;
  7659. menuActionCmd3[menuActionRow] = k;
  7660. menuActionRow++;
  7661. } else if (spellSelected == 1) {
  7662. if ((spellUsableOn & 8) == 8) {
  7663. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7664. menuActionID[menuActionRow] = 365;
  7665. menuActionCmd1[menuActionRow] = j;
  7666. menuActionCmd2[menuActionRow] = i;
  7667. menuActionCmd3[menuActionRow] = k;
  7668. menuActionRow++;
  7669. }
  7670. } else {
  7671. for (int l = 4; l >= 0; l--)
  7672. if (atPlayerActions[l] != null) {
  7673. menuActionName[menuActionRow] = atPlayerActions[l]
  7674. + " @whi@" + s;
  7675. char c = '\0';
  7676. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  7677. if (player.combatLevel > myPlayer.combatLevel)
  7678. c = '\u07D0';
  7679. if (myPlayer.team != 0 && player.team != 0)
  7680. if (myPlayer.team == player.team)
  7681. c = '\u07D0';
  7682. else
  7683. c = '\0';
  7684. } else if (atPlayerArray[l])
  7685. c = '\u07D0';
  7686. if (l == 0)
  7687. menuActionID[menuActionRow] = 561 + c;
  7688. if (l == 1)
  7689. menuActionID[menuActionRow] = 779 + c;
  7690. if (l == 2)
  7691. menuActionID[menuActionRow] = 27 + c;
  7692. if (l == 3)
  7693. menuActionID[menuActionRow] = 577 + c;
  7694. if (l == 4)
  7695. menuActionID[menuActionRow] = 729 + c;
  7696. menuActionCmd1[menuActionRow] = j;
  7697. menuActionCmd2[menuActionRow] = i;
  7698. menuActionCmd3[menuActionRow] = k;
  7699. menuActionRow++;
  7700. }
  7701.  
  7702. }
  7703. for (int i1 = 0; i1 < menuActionRow; i1++)
  7704. if (menuActionID[i1] == 516) {
  7705. menuActionName[i1] = "Walk here @whi@" + s;
  7706. return;
  7707. }
  7708.  
  7709. }
  7710.  
  7711. public void method89(Class30_Sub1 class30_sub1) {
  7712. int i = 0;
  7713. int j = -1;
  7714. int k = 0;
  7715. int l = 0;
  7716. if (class30_sub1.anInt1296 == 0)
  7717. i = worldController.method300(class30_sub1.anInt1295,
  7718. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7719. if (class30_sub1.anInt1296 == 1)
  7720. i = worldController.method301(class30_sub1.anInt1295,
  7721. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7722. if (class30_sub1.anInt1296 == 2)
  7723. i = worldController.method302(class30_sub1.anInt1295,
  7724. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7725. if (class30_sub1.anInt1296 == 3)
  7726. i = worldController.method303(class30_sub1.anInt1295,
  7727. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7728. if (i != 0) {
  7729. int i1 = worldController.method304(class30_sub1.anInt1295,
  7730. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7731. j = i >> 14 & 0x7fff;
  7732. k = i1 & 0x1f;
  7733. l = i1 >> 6;
  7734. }
  7735. class30_sub1.anInt1299 = j;
  7736. class30_sub1.anInt1301 = k;
  7737. class30_sub1.anInt1300 = l;
  7738. }
  7739.  
  7740. public void method90() {
  7741. for (int i = 0; i < anInt1062; i++)
  7742. if (anIntArray1250[i] <= 0) {
  7743. boolean flag1 = false;
  7744. try {
  7745. if (anIntArray1207[i] == anInt874
  7746. && anIntArray1241[i] == anInt1289) {
  7747. if (!replayWave())
  7748. flag1 = true;
  7749. } else {
  7750. Stream stream = Sounds.method241(anIntArray1241[i],
  7751. anIntArray1207[i]);
  7752. if (System.currentTimeMillis()
  7753. + stream.currentOffset / 22 > aLong1172
  7754. + anInt1257 / 22) {
  7755. anInt1257 = stream.currentOffset;
  7756. aLong1172 = System.currentTimeMillis();
  7757. if (saveWave(stream.buffer, stream.currentOffset)) {
  7758. anInt874 = anIntArray1207[i];
  7759. anInt1289 = anIntArray1241[i];
  7760. } else {
  7761. flag1 = true;
  7762. }
  7763. }
  7764. }
  7765. } catch (Exception exception) {
  7766. }
  7767. if (!flag1 || anIntArray1250[i] == -5) {
  7768. anInt1062--;
  7769. for (int j = i; j < anInt1062; j++) {
  7770. anIntArray1207[j] = anIntArray1207[j + 1];
  7771. anIntArray1241[j] = anIntArray1241[j + 1];
  7772. anIntArray1250[j] = anIntArray1250[j + 1];
  7773. }
  7774.  
  7775. i--;
  7776. } else {
  7777. anIntArray1250[i] = -5;
  7778. }
  7779. } else {
  7780. anIntArray1250[i]--;
  7781. }
  7782.  
  7783. if (prevSong > 0) {
  7784. prevSong -= 20;
  7785. if (prevSong < 0)
  7786. prevSong = 0;
  7787. if (prevSong == 0 && musicEnabled && !lowMem) {
  7788. nextSong = currentSong;
  7789. songChanging = true;
  7790. onDemandFetcher.method558(2, nextSong);
  7791. }
  7792. }
  7793. }
  7794.  
  7795. @Override
  7796. void startUp() {
  7797. drawLoadingText(20, "Starting up");
  7798. new CacheDownloader(this).downloadCache();
  7799. if (signlink.sunjava)
  7800. super.minDelay = 5;
  7801. if (aBoolean993) {
  7802. // rsAlreadyLoaded = true;
  7803. // return;
  7804. }
  7805. aBoolean993 = true;
  7806. getDocumentBaseHost();
  7807. if (signlink.cache_dat != null) {
  7808. for (int i = 0; i < 5; i++)
  7809. decompressors[i] = new Decompressor(signlink.cache_dat,
  7810. signlink.cache_idx[i], i + 1);
  7811. }
  7812. try {
  7813. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  7814. expectedCRCs[1], 25);
  7815. smallText = new TextDrawingArea(false, "p11_full",
  7816. titleStreamLoader);
  7817. XPFONT = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7818. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full",
  7819. titleStreamLoader);
  7820. chatTextDrawingArea = new TextDrawingArea(false, "b12_full",
  7821. titleStreamLoader);
  7822. aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full",
  7823. titleStreamLoader);
  7824. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  7825. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  7826. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  7827. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  7828. drawLogo();
  7829. loadTitleScreen();
  7830. StreamLoader streamLoader = streamLoaderForName(2, "config",
  7831. "config", expectedCRCs[2], 30);
  7832. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  7833. "interface", expectedCRCs[3], 35);
  7834. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  7835. "media", expectedCRCs[4], 40);
  7836. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  7837. "textures", expectedCRCs[6], 45);
  7838. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  7839. "wordenc", expectedCRCs[7], 50);
  7840. StreamLoader streamLoader_5 = streamLoaderForName(8,
  7841. "sound effects", "sounds", expectedCRCs[8], 55);
  7842. byteGroundArray = new byte[4][104][104];
  7843. intGroundArray = new int[4][105][105];
  7844. worldController = new WorldController(intGroundArray);
  7845. for (int j = 0; j < 4; j++)
  7846. aClass11Array1230[j] = new Class11();
  7847.  
  7848. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7849. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  7850. "versionlist", expectedCRCs[5], 60);
  7851. drawLoadingText(60, "Connecting to update server");
  7852. onDemandFetcher = new OnDemandFetcher();
  7853. onDemandFetcher.start(streamLoader_6, this);
  7854. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  7855. drawLoadingText(80, "Unpacking media");
  7856. Sprite[] clanIcons = new Sprite[9];
  7857. for (int index = 0; index < clanIcons.length; index++) {
  7858. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);
  7859. }
  7860. mapArea = new Sprite("maparea");
  7861. worldMapIcon508 = new Sprite("mapicon508");
  7862. worldMapIcon525 = new Sprite("mapicon525");
  7863. for (int i = 1; i <= 15; i++) {
  7864. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS " + i + "");
  7865. }
  7866. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7867. chatArea = new Sprite("Gameframe/chatarea");
  7868. tabArea = new Sprite("Gameframe/tabarea");
  7869. tabArea474 = new Sprite("tabarea474");
  7870. mapArea474 = new Sprite("maparea474");
  7871. mapArea508 = new Sprite("maparea508");
  7872. tabArea508 = new Sprite("tabarea508");
  7873. mapBack = new Background(streamLoader_2, "mapback", 0);
  7874. for (int c1 = 0; c1 <= 3; c1++)
  7875. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7876. for (int j3 = 0; j3 <= 14; j3++)
  7877. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7878. for (int r1 = 0; r1 < 5; r1++)
  7879. redStones[r1] = new Sprite("Gameframe/redstones " + r1);
  7880. RSFont.unpackImages(modIcons, clanIcons);
  7881. compass = new Sprite(streamLoader_2, "compass", 0);
  7882. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7883. mapEdge.method345();
  7884. try {
  7885. for (int k3 = 0; k3 < 100; k3++)
  7886. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  7887. k3);
  7888. } catch (Exception _ex) {
  7889. }
  7890. try {
  7891. for (int l3 = 0; l3 < 100; l3++)
  7892. mapFunctions[l3] = new Sprite(streamLoader_2,
  7893. "mapfunction", l3);
  7894. } catch (Exception _ex) {
  7895. }
  7896. try {
  7897. for (int i4 = 0; i4 < 20; i4++)
  7898. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7899. } catch (Exception _ex) {
  7900. }
  7901. try {
  7902. for (int h1 = 0; h1 < 6; h1++)
  7903. headIconsHint[h1] = new Sprite(streamLoader_2,
  7904. "headicons_hint", h1);
  7905. } catch (Exception _ex) {
  7906. }
  7907. try {
  7908. for (int j4 = 0; j4 < 8; j4++)
  7909. headIcons[j4] = new Sprite(streamLoader_2,
  7910. "headicons_prayer", j4);
  7911. for (int j45 = 0; j45 < 3; j45++)
  7912. skullIcons[j45] = new Sprite(streamLoader_2,
  7913. "headicons_pk", j45);
  7914. } catch (Exception _ex) {
  7915. }
  7916. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7917. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7918. for (int k4 = 0; k4 < 8; k4++)
  7919. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7920.  
  7921. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7922. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7923. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7924. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7925. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7926. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7927. new Sprite(streamLoader_2, "mapdots", 4);
  7928. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7929. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7930. for (int l4 = 0; l4 < 10; l4++)
  7931. modIcons[l4] = new Sprite(streamLoader_2, "mod_icons", l4);
  7932.  
  7933. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7934. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7935. getGameComponent());
  7936. sprite.method346(0, 0);
  7937. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7938. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7939. getGameComponent());
  7940. sprite.method346(0, 0);
  7941. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7942. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7943. getGameComponent());
  7944. sprite.method346(0, 0);
  7945. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7946. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7947. getGameComponent());
  7948. sprite.method346(0, 0);
  7949. int i5 = (int) (Math.random() * 21D) - 10;
  7950. int j5 = (int) (Math.random() * 21D) - 10;
  7951. int k5 = (int) (Math.random() * 21D) - 10;
  7952. int l5 = (int) (Math.random() * 41D) - 20;
  7953. for (int i6 = 0; i6 < 100; i6++) {
  7954. if (mapFunctions[i6] != null)
  7955. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7956. if (mapScenes[i6] != null)
  7957. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7958. }
  7959.  
  7960. drawLoadingText(83, "Unpacking textures");
  7961. Texture.method368(streamLoader_3);
  7962. Texture.method372(0.80000000000000004D);
  7963. Texture.method367();
  7964. drawLoadingText(86, "Unpacking config");
  7965. Animation.unpackConfig(streamLoader);
  7966. ObjectDef.unpackConfig(streamLoader);
  7967. Flo.unpackConfig(streamLoader);
  7968. ItemDef.unpackConfig(streamLoader);
  7969. EntityDef.unpackConfig(streamLoader);
  7970. IDK.unpackConfig(streamLoader);
  7971. SpotAnim.unpackConfig(streamLoader);
  7972. Varp.unpackConfig(streamLoader);
  7973. VarBit.unpackConfig(streamLoader);
  7974. ItemDef.isMembers = isMembers;
  7975. if (!lowMem) {
  7976. drawLoadingText(90, "Unpacking sounds");
  7977. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7978. Stream stream = new Stream(abyte0);
  7979. Sounds.unpack(stream);
  7980. }
  7981. drawLoadingText(95, "Unpacking interfaces");
  7982. TextDrawingArea allFonts[] = { smallText, aTextDrawingArea_1271,
  7983. chatTextDrawingArea, aTextDrawingArea_1273 };
  7984. RSInterface.unpack(streamLoader_1, allFonts, streamLoader_2);
  7985. drawLoadingText(100, "Preparing game engine");
  7986. for (int j6 = 0; j6 < 33; j6++) {
  7987. int k6 = 999;
  7988. int i7 = 0;
  7989. for (int k7 = 0; k7 < 34; k7++) {
  7990. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  7991. if (k6 == 999)
  7992. k6 = k7;
  7993. continue;
  7994. }
  7995. if (k6 == 999)
  7996. continue;
  7997. i7 = k7;
  7998. break;
  7999. }
  8000.  
  8001. anIntArray968[j6] = k6;
  8002. anIntArray1057[j6] = i7 - k6;
  8003. }
  8004.  
  8005. for (int l6 = 5; l6 < 156; l6++) {
  8006. int j7 = 999;
  8007. int l7 = 0;
  8008. for (int j8 = 25; j8 < 172; j8++) {
  8009. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0
  8010. && (j8 > 34 || l6 > 34)) {
  8011. if (j7 == 999)
  8012. j7 = j8;
  8013. continue;
  8014. }
  8015. if (j7 == 999)
  8016. continue;
  8017. l7 = j8;
  8018. break;
  8019. }
  8020.  
  8021. anIntArray1052[l6 - 5] = j7 - 25;
  8022. anIntArray1229[l6 - 5] = l7 - j7;
  8023. }
  8024.  
  8025. Texture.method365(765, 503);
  8026. fullScreenTextureArray = Texture.anIntArray1472;
  8027. Texture.method365(519, 165);
  8028. anIntArray1180 = Texture.anIntArray1472;
  8029. Texture.method365(246, 335);
  8030. anIntArray1181 = Texture.anIntArray1472;
  8031. Texture.method365(512, 334);
  8032. anIntArray1182 = Texture.anIntArray1472;
  8033. int ai[] = new int[9];
  8034. for (int i8 = 0; i8 < 9; i8++) {
  8035. int k8 = 128 + i8 * 32 + 15;
  8036. int l8 = 600 + k8 * 3;
  8037. int i9 = Texture.anIntArray1470[k8];
  8038. ai[i8] = l8 * i9 >> 16;
  8039. }
  8040.  
  8041. WorldController.method310(500, 800, 512, 334, ai);
  8042. Censor.loadConfig(streamLoader_4);
  8043. mouseDetection = new MouseDetection(this);
  8044. startRunnable(mouseDetection, 10);
  8045. Animable_Sub5.clientInstance = this;
  8046. ObjectDef.clientInstance = this;
  8047. EntityDef.clientInstance = this;
  8048. return;
  8049. } catch (Exception exception) {
  8050. exception.printStackTrace();
  8051. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8052. }
  8053. loadingError = true;
  8054. }
  8055.  
  8056. public void method91(Stream stream, int i) {
  8057. while (stream.bitPosition + 10 < i * 8) {
  8058. int j = stream.readBits(11);
  8059. if (j == 2047)
  8060. break;
  8061. if (playerArray[j] == null) {
  8062. playerArray[j] = new Player();
  8063. if (aStreamArray895s[j] != null)
  8064. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8065. }
  8066. playerIndices[playerCount++] = j;
  8067. Player player = playerArray[j];
  8068. player.anInt1537 = loopCycle;
  8069. int k = stream.readBits(1);
  8070. if (k == 1)
  8071. anIntArray894[anInt893++] = j;
  8072. int l = stream.readBits(1);
  8073. int i1 = stream.readBits(5);
  8074. if (i1 > 15)
  8075. i1 -= 32;
  8076. int j1 = stream.readBits(5);
  8077. if (j1 > 15)
  8078. j1 -= 32;
  8079. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  8080. l == 1);
  8081. }
  8082. stream.finishBitAccess();
  8083. }
  8084.  
  8085. private void processMainScreenClick() {
  8086. if (revision474 == true) {
  8087. if (anInt1021 != 0)
  8088. return;
  8089. if (super.clickMode3 == 1) {
  8090. int i = super.saveClickX - 25 - 550;
  8091. int j = super.saveClickY - 5 - 4;
  8092. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  8093. i -= 73;
  8094. j -= 75;
  8095. int k = viewRotation + minimapRotation & 0x7ff;
  8096. int i1 = Texture.anIntArray1470[k];
  8097. int j1 = Texture.anIntArray1471[k];
  8098. i1 = i1 * (minimapZoom + 256) >> 8;
  8099. j1 = j1 * (minimapZoom + 256) >> 8;
  8100. int k1 = j * i1 + i * j1 >> 11;
  8101. int l1 = j * j1 - i * i1 >> 11;
  8102. int i2 = myPlayer.x + k1 >> 7;
  8103. int j2 = myPlayer.y - l1 >> 7;
  8104. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0,
  8105. 0, j2, myPlayer.smallX[0], true, i2);
  8106. if (flag1) {
  8107. stream.writeWordBigEndian(i);
  8108. stream.writeWordBigEndian(j);
  8109. stream.writeWord(viewRotation);
  8110. stream.writeWordBigEndian(57);
  8111. stream.writeWordBigEndian(minimapRotation);
  8112. stream.writeWordBigEndian(minimapZoom);
  8113. stream.writeWordBigEndian(89);
  8114. stream.writeWord(myPlayer.x);
  8115. stream.writeWord(myPlayer.y);
  8116. stream.writeWordBigEndian(anInt1264);
  8117. stream.writeWordBigEndian(63);
  8118. }
  8119. }
  8120. anInt1117++;
  8121. if (anInt1117 > 1151) {
  8122. anInt1117 = 0;
  8123. stream.createFrame(246);
  8124. stream.writeWordBigEndian(0);
  8125. int l = stream.currentOffset;
  8126. if ((int) (Math.random() * 2D) == 0)
  8127. stream.writeWordBigEndian(101);
  8128. stream.writeWordBigEndian(197);
  8129. stream.writeWord((int) (Math.random() * 65536D));
  8130. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8131. stream.writeWordBigEndian(67);
  8132. stream.writeWord(14214);
  8133. if ((int) (Math.random() * 2D) == 0)
  8134. stream.writeWord(29487);
  8135. stream.writeWord((int) (Math.random() * 65536D));
  8136. if ((int) (Math.random() * 2D) == 0)
  8137. stream.writeWordBigEndian(220);
  8138. stream.writeWordBigEndian(180);
  8139. stream.writeBytes(stream.currentOffset - l);
  8140. }
  8141. }
  8142. } else if (revision498 == true || revision508 == true) {
  8143. if (anInt1021 != 0)
  8144. return;
  8145. if (super.clickMode3 == 1) {
  8146. if (super.clickMode3 == 1) {
  8147. int i = super.saveClickX - 20 - 545;
  8148. int j = super.saveClickY - 4 - 4;
  8149. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  8150. i -= 73;
  8151. j -= 75;
  8152. int k = viewRotation + minimapRotation & 0x7ff;
  8153. int i1 = Texture.anIntArray1470[k];
  8154. int j1 = Texture.anIntArray1471[k];
  8155. i1 = i1 * (minimapZoom + 256) >> 8;
  8156. j1 = j1 * (minimapZoom + 256) >> 8;
  8157. int k1 = j * i1 + i * j1 >> 11;
  8158. int l1 = j * j1 - i * i1 >> 11;
  8159. int i2 = myPlayer.x + k1 >> 7;
  8160. int j2 = myPlayer.y - l1 >> 7;
  8161. boolean flag1 = doWalkTo(1, 0, 0, 0,
  8162. myPlayer.smallY[0], 0, 0, j2,
  8163. myPlayer.smallX[0], true, i2);
  8164. if (flag1) {
  8165. stream.writeWordBigEndian(i);
  8166. stream.writeWordBigEndian(j);
  8167. stream.writeWord(viewRotation);
  8168. stream.writeWordBigEndian(57);
  8169. stream.writeWordBigEndian(minimapRotation);
  8170. stream.writeWordBigEndian(minimapZoom);
  8171. stream.writeWordBigEndian(89);
  8172. stream.writeWord(myPlayer.x);
  8173. stream.writeWord(myPlayer.y);
  8174. stream.writeWordBigEndian(anInt1264);
  8175. stream.writeWordBigEndian(63);
  8176. }
  8177. }
  8178. }
  8179. anInt1117++;
  8180. if (anInt1117 > 1151) {
  8181. anInt1117 = 0;
  8182. stream.createFrame(246);
  8183. stream.writeWordBigEndian(0);
  8184. int l = stream.currentOffset;
  8185. if ((int) (Math.random() * 2D) == 0)
  8186. stream.writeWordBigEndian(101);
  8187. stream.writeWordBigEndian(197);
  8188. stream.writeWord((int) (Math.random() * 65536D));
  8189. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8190. stream.writeWordBigEndian(67);
  8191. stream.writeWord(14214);
  8192. if ((int) (Math.random() * 2D) == 0)
  8193. stream.writeWord(29487);
  8194. stream.writeWord((int) (Math.random() * 65536D));
  8195. if ((int) (Math.random() * 2D) == 0)
  8196. stream.writeWordBigEndian(220);
  8197. stream.writeWordBigEndian(180);
  8198. stream.writeBytes(stream.currentOffset - l);
  8199. }
  8200. }
  8201. }
  8202. }
  8203.  
  8204. private String interfaceIntToString(int j) {
  8205. if (j < 0x3b9ac9ff)
  8206. return String.valueOf(j);
  8207. else
  8208. return "*";
  8209. }
  8210.  
  8211. public void showErrorScreen() {
  8212. Graphics g = getGameComponent().getGraphics();
  8213. g.setColor(Color.black);
  8214. g.fillRect(0, 0, 765, 503);
  8215. method4(1);
  8216. if (loadingError) {
  8217. aBoolean831 = false;
  8218. g.setFont(new Font("Helvetica", 1, 16));
  8219. g.setColor(Color.yellow);
  8220. int k = 35;
  8221. g.drawString(
  8222. "Sorry, an error has occured whilst loading RuneScape", 30,
  8223. k);
  8224. k += 50;
  8225. g.setColor(Color.white);
  8226. g.drawString("To fix this try the following (in order):", 30, k);
  8227. k += 50;
  8228. g.setColor(Color.white);
  8229. g.setFont(new Font("Helvetica", 1, 12));
  8230. g.drawString(
  8231. "1: Try closing ALL open web-browser windows, and reloading",
  8232. 30, k);
  8233. k += 30;
  8234. g.drawString(
  8235. "2: Try clearing your web-browsers cache from tools->internet options",
  8236. 30, k);
  8237. k += 30;
  8238. g.drawString("3: Try using a different game-world", 30, k);
  8239. k += 30;
  8240. g.drawString("4: Try rebooting your computer", 30, k);
  8241. k += 30;
  8242. g.drawString(
  8243. "5: Try selecting a different version of Java from the play-game menu",
  8244. 30, k);
  8245. }
  8246. if (genericLoadingError) {
  8247. aBoolean831 = false;
  8248. g.setFont(new Font("Helvetica", 1, 20));
  8249. g.setColor(Color.white);
  8250. g.drawString("Error - unable to load game!", 50, 50);
  8251. g.drawString("To play RuneScape make sure you play from", 50, 100);
  8252. g.drawString("http://www.RuneScape.com", 50, 150);
  8253. }
  8254. if (rsAlreadyLoaded) {
  8255. aBoolean831 = false;
  8256. g.setColor(Color.yellow);
  8257. int l = 35;
  8258. g.drawString(
  8259. "Error a copy of RuneScape already appears to be loaded",
  8260. 30, l);
  8261. l += 50;
  8262. g.setColor(Color.white);
  8263. g.drawString("To fix this try the following (in order):", 30, l);
  8264. l += 50;
  8265. g.setColor(Color.white);
  8266. g.setFont(new Font("Helvetica", 1, 12));
  8267. g.drawString(
  8268. "1: Try closing ALL open web-browser windows, and reloading",
  8269. 30, l);
  8270. l += 30;
  8271. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8272. l += 30;
  8273. }
  8274. }
  8275.  
  8276. @Override
  8277. public URL getCodeBase() {
  8278. try {
  8279. return new URL(server + ":" + (80 + portOff));
  8280. } catch (Exception _ex) {
  8281. }
  8282. return null;
  8283. }
  8284.  
  8285. public void method95() {
  8286. for (int j = 0; j < npcCount; j++) {
  8287. int k = npcIndices[j];
  8288. NPC npc = npcArray[k];
  8289. if (npc != null)
  8290. method96(npc);
  8291. }
  8292. }
  8293.  
  8294. public void method96(Entity entity) {
  8295. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  8296. || entity.y >= 13184) {
  8297. entity.anim = -1;
  8298. entity.anInt1520 = -1;
  8299. entity.anInt1547 = 0;
  8300. entity.anInt1548 = 0;
  8301. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8302. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8303. entity.method446();
  8304. }
  8305. if (entity == myPlayer
  8306. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  8307. entity.anim = -1;
  8308. entity.anInt1520 = -1;
  8309. entity.anInt1547 = 0;
  8310. entity.anInt1548 = 0;
  8311. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8312. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8313. entity.method446();
  8314. }
  8315. if (entity.anInt1547 > loopCycle)
  8316. method97(entity);
  8317. else if (entity.anInt1548 >= loopCycle)
  8318. method98(entity);
  8319. else
  8320. method99(entity);
  8321. method100(entity);
  8322. method101(entity);
  8323. }
  8324.  
  8325. public void method97(Entity entity) {
  8326. int i = entity.anInt1547 - loopCycle;
  8327. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8328. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8329. entity.x += (j - entity.x) / i;
  8330. entity.y += (k - entity.y) / i;
  8331. entity.anInt1503 = 0;
  8332. if (entity.anInt1549 == 0)
  8333. entity.turnDirection = 1024;
  8334. if (entity.anInt1549 == 1)
  8335. entity.turnDirection = 1536;
  8336. if (entity.anInt1549 == 2)
  8337. entity.turnDirection = 0;
  8338. if (entity.anInt1549 == 3)
  8339. entity.turnDirection = 512;
  8340. }
  8341.  
  8342. public void method98(Entity entity) {
  8343. if (entity.anInt1548 == loopCycle
  8344. || entity.anim == -1
  8345. || entity.anInt1529 != 0
  8346. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  8347. .method258(entity.anInt1527)) {
  8348. int i = entity.anInt1548 - entity.anInt1547;
  8349. int j = loopCycle - entity.anInt1547;
  8350. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8351. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8352. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8353. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8354. entity.x = (k * (i - j) + i1 * j) / i;
  8355. entity.y = (l * (i - j) + j1 * j) / i;
  8356. }
  8357. entity.anInt1503 = 0;
  8358. if (entity.anInt1549 == 0)
  8359. entity.turnDirection = 1024;
  8360. if (entity.anInt1549 == 1)
  8361. entity.turnDirection = 1536;
  8362. if (entity.anInt1549 == 2)
  8363. entity.turnDirection = 0;
  8364. if (entity.anInt1549 == 3)
  8365. entity.turnDirection = 512;
  8366. entity.anInt1552 = entity.turnDirection;
  8367. }
  8368.  
  8369. public void method99(Entity entity) {
  8370. entity.anInt1517 = entity.anInt1511;
  8371. if (entity.smallXYIndex == 0) {
  8372. entity.anInt1503 = 0;
  8373. return;
  8374. }
  8375. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8376. Animation animation = Animation.anims[entity.anim];
  8377. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  8378. entity.anInt1503++;
  8379. return;
  8380. }
  8381. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  8382. entity.anInt1503++;
  8383. return;
  8384. }
  8385. }
  8386. int i = entity.x;
  8387. int j = entity.y;
  8388. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8389. * 64;
  8390. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8391. * 64;
  8392. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  8393. entity.x = k;
  8394. entity.y = l;
  8395. return;
  8396. }
  8397. if (i < k) {
  8398. if (j < l)
  8399. entity.turnDirection = 1280;
  8400. else if (j > l)
  8401. entity.turnDirection = 1792;
  8402. else
  8403. entity.turnDirection = 1536;
  8404. } else if (i > k) {
  8405. if (j < l)
  8406. entity.turnDirection = 768;
  8407. else if (j > l)
  8408. entity.turnDirection = 256;
  8409. else
  8410. entity.turnDirection = 512;
  8411. } else if (j < l)
  8412. entity.turnDirection = 1024;
  8413. else
  8414. entity.turnDirection = 0;
  8415. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8416. if (i1 > 1024)
  8417. i1 -= 2048;
  8418. int j1 = entity.anInt1555;
  8419. if (i1 >= -256 && i1 <= 256)
  8420. j1 = entity.anInt1554;
  8421. else if (i1 >= 256 && i1 < 768)
  8422. j1 = entity.anInt1557;
  8423. else if (i1 >= -768 && i1 <= -256)
  8424. j1 = entity.anInt1556;
  8425. if (j1 == -1)
  8426. j1 = entity.anInt1554;
  8427. entity.anInt1517 = j1;
  8428. int k1 = 4;
  8429. if (entity.anInt1552 != entity.turnDirection
  8430. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8431. k1 = 2;
  8432. if (entity.smallXYIndex > 2)
  8433. k1 = 6;
  8434. if (entity.smallXYIndex > 3)
  8435. k1 = 8;
  8436. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  8437. k1 = 8;
  8438. entity.anInt1503--;
  8439. }
  8440. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8441. k1 <<= 1;
  8442. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  8443. && entity.anInt1505 != -1)
  8444. entity.anInt1517 = entity.anInt1505;
  8445. if (i < k) {
  8446. entity.x += k1;
  8447. if (entity.x > k)
  8448. entity.x = k;
  8449. } else if (i > k) {
  8450. entity.x -= k1;
  8451. if (entity.x < k)
  8452. entity.x = k;
  8453. }
  8454. if (j < l) {
  8455. entity.y += k1;
  8456. if (entity.y > l)
  8457. entity.y = l;
  8458. } else if (j > l) {
  8459. entity.y -= k1;
  8460. if (entity.y < l)
  8461. entity.y = l;
  8462. }
  8463. if (entity.x == k && entity.y == l) {
  8464. entity.smallXYIndex--;
  8465. if (entity.anInt1542 > 0)
  8466. entity.anInt1542--;
  8467. }
  8468. }
  8469.  
  8470. public void method100(Entity entity) {
  8471. if (entity.anInt1504 == 0)
  8472. return;
  8473. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  8474. NPC npc = npcArray[entity.interactingEntity];
  8475. if (npc != null) {
  8476. int i1 = entity.x - npc.x;
  8477. int k1 = entity.y - npc.y;
  8478. if (i1 != 0 || k1 != 0)
  8479. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8480. }
  8481. }
  8482. if (entity.interactingEntity >= 32768) {
  8483. int j = entity.interactingEntity - 32768;
  8484. if (j == unknownInt10)
  8485. j = myPlayerIndex;
  8486. Player player = playerArray[j];
  8487. if (player != null) {
  8488. int l1 = entity.x - player.x;
  8489. int i2 = entity.y - player.y;
  8490. if (l1 != 0 || i2 != 0)
  8491. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8492. }
  8493. }
  8494. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  8495. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  8496. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8497. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8498. if (k != 0 || j1 != 0)
  8499. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8500. entity.anInt1538 = 0;
  8501. entity.anInt1539 = 0;
  8502. }
  8503. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8504. if (l != 0) {
  8505. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8506. entity.anInt1552 = entity.turnDirection;
  8507. else if (l > 1024)
  8508. entity.anInt1552 -= entity.anInt1504;
  8509. else
  8510. entity.anInt1552 += entity.anInt1504;
  8511. entity.anInt1552 &= 0x7ff;
  8512. if (entity.anInt1517 == entity.anInt1511
  8513. && entity.anInt1552 != entity.turnDirection) {
  8514. if (entity.anInt1512 != -1) {
  8515. entity.anInt1517 = entity.anInt1512;
  8516. return;
  8517. }
  8518. entity.anInt1517 = entity.anInt1554;
  8519. }
  8520. }
  8521. }
  8522.  
  8523. public void method101(Entity entity) {
  8524. entity.aBoolean1541 = false;
  8525. if (entity.anInt1517 != -1) {
  8526. Animation animation = Animation.anims[entity.anInt1517];
  8527. entity.anInt1519++;
  8528. if (entity.anInt1518 < animation.anInt352
  8529. && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  8530. entity.anInt1519 = 1;
  8531. entity.anInt1518++;
  8532. }
  8533. if (entity.anInt1518 >= animation.anInt352) {
  8534. entity.anInt1519 = 1;
  8535. entity.anInt1518 = 0;
  8536. }
  8537. }
  8538. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  8539. if (entity.anInt1521 < 0)
  8540. entity.anInt1521 = 0;
  8541. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8542. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  8543. && entity.anInt1522 > animation_1
  8544. .method258(entity.anInt1521); entity.anInt1521++)
  8545. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8546.  
  8547. if (entity.anInt1521 >= animation_1.anInt352
  8548. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8549. entity.anInt1520 = -1;
  8550. }
  8551. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  8552. Animation animation_2 = Animation.anims[entity.anim];
  8553. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  8554. && entity.anInt1547 <= loopCycle
  8555. && entity.anInt1548 < loopCycle) {
  8556. entity.anInt1529 = 1;
  8557. return;
  8558. }
  8559. }
  8560. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8561. Animation animation_3 = Animation.anims[entity.anim];
  8562. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  8563. && entity.anInt1528 > animation_3
  8564. .method258(entity.anInt1527); entity.anInt1527++)
  8565. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8566.  
  8567. if (entity.anInt1527 >= animation_3.anInt352) {
  8568. entity.anInt1527 -= animation_3.anInt356;
  8569. entity.anInt1530++;
  8570. if (entity.anInt1530 >= animation_3.anInt362)
  8571. entity.anim = -1;
  8572. if (entity.anInt1527 < 0
  8573. || entity.anInt1527 >= animation_3.anInt352)
  8574. entity.anim = -1;
  8575. }
  8576. entity.aBoolean1541 = animation_3.aBoolean358;
  8577. }
  8578. if (entity.anInt1529 > 0)
  8579. entity.anInt1529--;
  8580. }
  8581.  
  8582. private void drawGameScreen() {
  8583. if (fullscreenInterfaceID != -1
  8584. && (loadingStage == 2 || super.fullGameScreen != null)) {
  8585. if (loadingStage == 2) {
  8586. method119(anInt945, fullscreenInterfaceID);
  8587. if (openInterfaceID != -1) {
  8588. method119(anInt945, openInterfaceID);
  8589. }
  8590. anInt945 = 0;
  8591. resetAllImageProducers();
  8592. super.fullGameScreen.initDrawingArea();
  8593. Texture.anIntArray1472 = fullScreenTextureArray;
  8594. DrawingArea.setAllPixelsToZero();
  8595. welcomeScreenRaised = true;
  8596. if (openInterfaceID != -1) {
  8597. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8598. if (rsInterface_1.width == 512
  8599. && rsInterface_1.height == 334
  8600. && rsInterface_1.type == 0) {
  8601. rsInterface_1.width = 765;
  8602. rsInterface_1.height = 503;
  8603. }
  8604. drawInterface(0, 0, rsInterface_1, 8);
  8605. }
  8606. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8607. if (rsInterface.width == 512 && rsInterface.height == 334
  8608. && rsInterface.type == 0) {
  8609. rsInterface.width = 765;
  8610. rsInterface.height = 503;
  8611. }
  8612. drawInterface(0, 0, rsInterface, 8);
  8613.  
  8614. if (!menuOpen) {
  8615. processRightClick();
  8616. drawTooltip();
  8617. } else {
  8618. drawMenu();
  8619. }
  8620. }
  8621. drawCount++;
  8622. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8623. return;
  8624. } else {
  8625. if (drawCount != 0) {
  8626. resetImageProducers2();
  8627. }
  8628. }
  8629. if (welcomeScreenRaised) {
  8630. welcomeScreenRaised = false;
  8631. topFrame.drawGraphics(0, super.graphics, 0);
  8632. leftFrame.drawGraphics(4, super.graphics, 0);
  8633. rightFrame.drawGraphics(4, super.graphics, 516);
  8634. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8635. needDrawTabArea = true;
  8636. inputTaken = true;
  8637. tabAreaAltered = true;
  8638. if (loadingStage != 2) {
  8639. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8640. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8641. }
  8642. }
  8643. if (menuOpen && menuScreenArea == 1)
  8644. needDrawTabArea = true;
  8645. if (invOverlayInterfaceID != -1) {
  8646. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8647. if (flag1)
  8648. needDrawTabArea = true;
  8649. }
  8650. if (atInventoryInterfaceType == 2)
  8651. needDrawTabArea = true;
  8652. if (activeInterfaceType == 2)
  8653. needDrawTabArea = true;
  8654. if (needDrawTabArea) {
  8655. drawTabArea();
  8656. needDrawTabArea = false;
  8657. }
  8658. if (backDialogID == -1) {
  8659. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8660. if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8661. method65(494, 110, super.mouseX - 0, super.mouseY - 348,
  8662. aClass9_1059, 0, false, anInt1211);
  8663. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8664. if (i < 0)
  8665. i = 0;
  8666. if (i > anInt1211 - 110)
  8667. i = anInt1211 - 110;
  8668. if (anInt1089 != i) {
  8669. anInt1089 = i;
  8670. inputTaken = true;
  8671. }
  8672. }
  8673. if (backDialogID != -1) {
  8674. boolean flag2 = method119(anInt945, backDialogID);
  8675. if (flag2)
  8676. inputTaken = true;
  8677. }
  8678. if (atInventoryInterfaceType == 3)
  8679. inputTaken = true;
  8680. if (activeInterfaceType == 3)
  8681. inputTaken = true;
  8682. if (aString844 != null)
  8683. inputTaken = true;
  8684. if (menuOpen && menuScreenArea == 2)
  8685. inputTaken = true;
  8686. if (inputTaken) {
  8687. drawChatArea();
  8688. inputTaken = false;
  8689. }
  8690. if (loadingStage == 2)
  8691. method146();
  8692. if (loadingStage == 2) {
  8693. drawMinimap();
  8694. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8695. }
  8696. if (anInt1054 != -1)
  8697. tabAreaAltered = true;
  8698. if (tabAreaAltered) {
  8699. if (anInt1054 != -1 && anInt1054 == tabID) {
  8700. anInt1054 = -1;
  8701. stream.createFrame(120);
  8702. stream.writeWordBigEndian(tabID);
  8703. }
  8704. tabAreaAltered = false;
  8705. aRSImageProducer_1125.initDrawingArea();
  8706. aRSImageProducer_1165.initDrawingArea();
  8707. }
  8708. anInt945 = 0;
  8709. }
  8710.  
  8711. private boolean buildFriendsListMenu(RSInterface class9) {
  8712. int i = class9.contentType;
  8713. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  8714. if (i >= 801)
  8715. i -= 701;
  8716. else if (i >= 701)
  8717. i -= 601;
  8718. else if (i >= 101)
  8719. i -= 101;
  8720. else
  8721. i--;
  8722. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8723. menuActionID[menuActionRow] = 792;
  8724. menuActionRow++;
  8725. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8726. menuActionID[menuActionRow] = 639;
  8727. menuActionRow++;
  8728. return true;
  8729. }
  8730. if (i >= 401 && i <= 500) {
  8731. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8732. menuActionID[menuActionRow] = 322;
  8733. menuActionRow++;
  8734. return true;
  8735. } else {
  8736. return false;
  8737. }
  8738. }
  8739.  
  8740. public void method104() {
  8741. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8742. .reverseGetFirst();
  8743. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8744. .reverseGetNext())
  8745. if (class30_sub2_sub4_sub3.anInt1560 != plane
  8746. || class30_sub2_sub4_sub3.aBoolean1567)
  8747. class30_sub2_sub4_sub3.unlink();
  8748. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  8749. class30_sub2_sub4_sub3.method454(anInt945);
  8750. if (class30_sub2_sub4_sub3.aBoolean1567)
  8751. class30_sub2_sub4_sub3.unlink();
  8752. else
  8753. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  8754. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  8755. class30_sub2_sub4_sub3.anInt1562, 60,
  8756. class30_sub2_sub4_sub3.anInt1561,
  8757. class30_sub2_sub4_sub3, false);
  8758. }
  8759.  
  8760. }
  8761.  
  8762. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8763. if (class9.type != 0 || class9.children == null)
  8764. return;
  8765. if (class9.isMouseoverTriggered && anInt1026 != class9.id
  8766. && anInt1048 != class9.id && anInt1039 != class9.id)
  8767. return;
  8768. int i1 = DrawingArea.topX;
  8769. int j1 = DrawingArea.topY;
  8770. int k1 = DrawingArea.bottomX;
  8771. int l1 = DrawingArea.bottomY;
  8772. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8773. int i2 = class9.children.length;
  8774. for (int j2 = 0; j2 < i2; j2++) {
  8775. int k2 = class9.childX[j2] + k;
  8776. int l2 = (class9.childY[j2] + l) - j;
  8777. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8778. k2 += class9_1.anInt263;
  8779. l2 += class9_1.anInt265;
  8780. if (class9_1.contentType > 0)
  8781. drawFriendsListOrWelcomeScreen(class9_1);
  8782. // here
  8783. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  8784. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  8785. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  8786. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  8787. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  8788. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  8789. 12436, 12446, 12456, 6004, 18471,
  8790. /* Ancients */
  8791. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  8792. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  8793. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  8794. for (int m5 = 0; m5 < IDs.length; m5++) {
  8795. if (class9_1.id == IDs[m5] + 1) {
  8796. if (m5 > 61)
  8797. drawBlackBox(k2 + 1, l2);
  8798. else
  8799. drawBlackBox(k2, l2 + 1);
  8800. }
  8801. }
  8802. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  8803. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  8804. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  8805. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  8806. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  8807. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  8808. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  8809. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  8810. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  8811. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  8812. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  8813. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  8814. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  8815. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  8816. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  8817. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  8818. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  8819. for (int r = 0; r < runeChildren.length; r++)
  8820. if (class9_1.id == runeChildren[r])
  8821. class9_1.modelZoom = 775;
  8822. if (class9_1.type == 0) {
  8823. if (class9_1.scrollPosition > class9_1.scrollMax
  8824. - class9_1.height)
  8825. class9_1.scrollPosition = class9_1.scrollMax
  8826. - class9_1.height;
  8827. if (class9_1.scrollPosition < 0)
  8828. class9_1.scrollPosition = 0;
  8829. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8830. if (class9_1.scrollMax > class9_1.height) {
  8831. // clan chat
  8832. if (class9_1.id == 18143) {
  8833. int clanMates = 0;
  8834. for (int i = 18155; i < 18244; i++) {
  8835. RSInterface line = RSInterface.interfaceCache[i];
  8836. if (line.message.length() > 0) {
  8837. clanMates++;
  8838. }
  8839. }
  8840. class9_1.scrollMax = (clanMates * 14) + class9_1.height
  8841. + 1;
  8842. }
  8843. if (class9_1.id == 18322 || class9_1.id == 18423) {
  8844. int members = 0;
  8845. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  8846. RSInterface line = RSInterface.interfaceCache[i];
  8847. if (line != null && line.message != null) {
  8848. if (line.message.length() > 0) {
  8849. members++;
  8850. }
  8851. }
  8852. }
  8853. class9_1.scrollMax = (members * 14) + 1;
  8854. }
  8855. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2,
  8856. k2 + class9_1.width, class9_1.scrollMax);
  8857. }
  8858. } else if (class9_1.type != 1)
  8859. if (class9_1.type == 2) {
  8860. int i3 = 0;
  8861. for (int l3 = 0; l3 < class9_1.height; l3++) {
  8862. for (int l4 = 0; l4 < class9_1.width; l4++) {
  8863. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8864. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8865. if (i3 < 20) {
  8866. k5 += class9_1.spritesX[i3];
  8867. j6 += class9_1.spritesY[i3];
  8868. }
  8869. if (class9_1.inv[i3] > 0) {
  8870. int k6 = 0;
  8871. int j7 = 0;
  8872. int j9 = class9_1.inv[i3] - 1;
  8873. if (k5 > DrawingArea.topX - 32
  8874. && k5 < DrawingArea.bottomX
  8875. && j6 > DrawingArea.topY - 32
  8876. && j6 < DrawingArea.bottomY
  8877. || activeInterfaceType != 0
  8878. && anInt1085 == i3) {
  8879. int l9 = 0;
  8880. if (itemSelected == 1 && anInt1283 == i3
  8881. && anInt1284 == class9_1.id)
  8882. l9 = 0xffffff;
  8883. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  8884. .getSprite(j9,
  8885. class9_1.invStackSizes[i3],
  8886. l9);
  8887. if (class30_sub2_sub1_sub1_2 != null) {
  8888. if (activeInterfaceType != 0
  8889. && anInt1085 == i3
  8890. && anInt1084 == class9_1.id) {
  8891. k6 = super.mouseX - anInt1087;
  8892. j7 = super.mouseY - anInt1088;
  8893. if (k6 < 5 && k6 > -5)
  8894. k6 = 0;
  8895. if (j7 < 5 && j7 > -5)
  8896. j7 = 0;
  8897. if (anInt989 < 12) {
  8898. k6 = 0;
  8899. j7 = 0;
  8900. }
  8901. class30_sub2_sub1_sub1_2
  8902. .drawSprite1(k5 + k6, j6
  8903. + j7);
  8904. if (j6 + j7 < DrawingArea.topY
  8905. && class9.scrollPosition > 0) {
  8906. int i10 = (anInt945 * (DrawingArea.topY
  8907. - j6 - j7)) / 3;
  8908. if (i10 > anInt945 * 10)
  8909. i10 = anInt945 * 10;
  8910. if (i10 > class9.scrollPosition)
  8911. i10 = class9.scrollPosition;
  8912. class9.scrollPosition -= i10;
  8913. anInt1088 += i10;
  8914. }
  8915. if (j6 + j7 + 32 > DrawingArea.bottomY
  8916. && class9.scrollPosition < class9.scrollMax
  8917. - class9.height) {
  8918. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8919. if (j10 > anInt945 * 10)
  8920. j10 = anInt945 * 10;
  8921. if (j10 > class9.scrollMax
  8922. - class9.height
  8923. - class9.scrollPosition)
  8924. j10 = class9.scrollMax
  8925. - class9.height
  8926. - class9.scrollPosition;
  8927. class9.scrollPosition += j10;
  8928. anInt1088 -= j10;
  8929. }
  8930. } else if (atInventoryInterfaceType != 0
  8931. && atInventoryIndex == i3
  8932. && atInventoryInterface == class9_1.id)
  8933. class30_sub2_sub1_sub1_2
  8934. .drawSprite1(k5, j6);
  8935. else
  8936. class30_sub2_sub1_sub1_2
  8937. .drawSprite(k5, j6);
  8938. if (class30_sub2_sub1_sub1_2.maxWidth == 33
  8939. || class9_1.invStackSizes[i3] != 1) {
  8940. int k10 = class9_1.invStackSizes[i3];
  8941. if (k10 >= 1)
  8942. smallText.method385(0xFFFF00,
  8943. intToKOrMil(k10), j6
  8944. + 9 + j7, k5
  8945. + k6);
  8946. smallText.method385(0,
  8947. intToKOrMil(k10), j6 + 10
  8948. + j7, k5 + 1 + k6);
  8949. if (k10 > 99999 && k10 < 10000000) {
  8950. smallText.method385(0xFFFFFF,
  8951. intToKOrMil(k10), j6
  8952. + 9 + j7, k5
  8953. + k6);
  8954. } else if (k10 > 9999999) {
  8955. smallText.method385(0x00ff80,
  8956. intToKOrMil(k10), j6
  8957. + 9 + j7, k5
  8958. + k6);
  8959. } else {
  8960. smallText.method385(0xFFFF00,
  8961. intToKOrMil(k10), j6
  8962. + 9 + j7, k5
  8963. + k6);
  8964. }
  8965.  
  8966. /*
  8967. * smallText.method385(0,
  8968. * intToKOrMil(k10), j6 + 10 + j7,
  8969. * k5 + 1 + k6);
  8970. * smallText.method385(0xffff00,
  8971. * intToKOrMil(k10), j6 + 9 + j7, k5
  8972. * + k6);
  8973. */
  8974. }
  8975. }
  8976. }
  8977. } else if (class9_1.sprites != null && i3 < 20) {
  8978. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8979. if (class30_sub2_sub1_sub1_1 != null)
  8980. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8981. }
  8982. i3++;
  8983. }
  8984. }
  8985. } else if (class9_1.type == 3) {
  8986. boolean flag = false;
  8987. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  8988. || anInt1026 == class9_1.id)
  8989. flag = true;
  8990. int j3;
  8991. if (interfaceIsSelected(class9_1)) {
  8992. j3 = class9_1.anInt219;
  8993. if (flag && class9_1.anInt239 != 0)
  8994. j3 = class9_1.anInt239;
  8995. } else {
  8996. j3 = class9_1.textColor;
  8997. if (flag && class9_1.anInt216 != 0)
  8998. j3 = class9_1.anInt216;
  8999. }
  9000. if (class9_1.aByte254 == 0) {
  9001. if (class9_1.aBoolean227)
  9002. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  9003. class9_1.width);
  9004. else
  9005. DrawingArea.fillPixels(k2, class9_1.width,
  9006. class9_1.height, j3, l2);
  9007. } else if (class9_1.aBoolean227)
  9008. DrawingArea.method335(j3, l2, class9_1.width,
  9009. class9_1.height,
  9010. 256 - (class9_1.aByte254 & 0xff), k2);
  9011. else
  9012. DrawingArea.method338(l2, class9_1.height,
  9013. 256 - (class9_1.aByte254 & 0xff), j3,
  9014. class9_1.width, k2);
  9015. } else if (class9_1.type == 4) {
  9016. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9017. String s = class9_1.message;
  9018. boolean flag1 = false;
  9019. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  9020. || anInt1026 == class9_1.id)
  9021. flag1 = true;
  9022. int i4;
  9023. if (interfaceIsSelected(class9_1)) {
  9024. i4 = class9_1.anInt219;
  9025. if (flag1 && class9_1.anInt239 != 0)
  9026. i4 = class9_1.anInt239;
  9027. if (class9_1.aString228.length() > 0)
  9028. s = class9_1.aString228;
  9029. } else {
  9030. i4 = class9_1.textColor;
  9031. if (flag1 && class9_1.anInt216 != 0)
  9032. i4 = class9_1.anInt216;
  9033. }
  9034. if (class9_1.atActionType == 6 && aBoolean1149) {
  9035. s = "Please wait...";
  9036. i4 = class9_1.textColor;
  9037. }
  9038. if (DrawingArea.width == 519) {
  9039. if (i4 == 0xffff00)
  9040. i4 = 255;
  9041. if (i4 == 49152)
  9042. i4 = 0xffffff;
  9043. }
  9044. if ((class9_1.parentID == 1151)
  9045. || (class9_1.parentID == 12855)) {
  9046. switch (i4) {
  9047. case 16773120:
  9048. i4 = 0xFE981F;
  9049. break;
  9050. case 7040819:
  9051. i4 = 0xAF6A1A;
  9052. break;
  9053. }
  9054. }
  9055. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  9056. if (s.indexOf("%") != -1) {
  9057. do {
  9058. int k7 = s.indexOf("%1");
  9059. if (k7 == -1)
  9060. break;
  9061. if (class9_1.id < 4000 || class9_1.id > 5000
  9062. && class9_1.id != 13921
  9063. && class9_1.id != 13922
  9064. && class9_1.id != 12171
  9065. && class9_1.id != 12172)
  9066. s = s.substring(0, k7)
  9067. + methodR(extractInterfaceValues(
  9068. class9_1, 0))
  9069. + s.substring(k7 + 2);
  9070. else
  9071. s = s.substring(0, k7)
  9072. + interfaceIntToString(extractInterfaceValues(
  9073. class9_1, 0))
  9074. + s.substring(k7 + 2);
  9075. } while (true);
  9076. do {
  9077. int l7 = s.indexOf("%2");
  9078. if (l7 == -1)
  9079. break;
  9080. s = s.substring(0, l7)
  9081. + interfaceIntToString(extractInterfaceValues(
  9082. class9_1, 1))
  9083. + s.substring(l7 + 2);
  9084. } while (true);
  9085. do {
  9086. int i8 = s.indexOf("%3");
  9087. if (i8 == -1)
  9088. break;
  9089. s = s.substring(0, i8)
  9090. + interfaceIntToString(extractInterfaceValues(
  9091. class9_1, 2))
  9092. + s.substring(i8 + 2);
  9093. } while (true);
  9094. do {
  9095. int j8 = s.indexOf("%4");
  9096. if (j8 == -1)
  9097. break;
  9098. s = s.substring(0, j8)
  9099. + interfaceIntToString(extractInterfaceValues(
  9100. class9_1, 3))
  9101. + s.substring(j8 + 2);
  9102. } while (true);
  9103. do {
  9104. int k8 = s.indexOf("%5");
  9105. if (k8 == -1)
  9106. break;
  9107. s = s.substring(0, k8)
  9108. + interfaceIntToString(extractInterfaceValues(
  9109. class9_1, 4))
  9110. + s.substring(k8 + 2);
  9111. } while (true);
  9112. }
  9113. int l8 = s.indexOf("\\n");
  9114. String s1;
  9115. if (l8 != -1) {
  9116. s1 = s.substring(0, l8);
  9117. s = s.substring(l8 + 2);
  9118. } else {
  9119. s1 = s;
  9120. s = "";
  9121. }
  9122. RSFont font = null;
  9123. if (textDrawingArea == smallText) {
  9124. font = newSmallFont;
  9125. } else if (textDrawingArea == aTextDrawingArea_1271) {
  9126. font = newRegularFont;
  9127. } else if (textDrawingArea == chatTextDrawingArea) {
  9128. font = newBoldFont;
  9129. } else if (textDrawingArea == aTextDrawingArea_1273) {
  9130. font = newFancyFont;
  9131. }
  9132. if (class9_1.centerText) {
  9133. font.drawCenteredString(s1,
  9134. k2 + class9_1.width / 2, l6, i4,
  9135. class9_1.textShadow ? 0 : -1);
  9136. } else {
  9137. font.drawBasicString(s1, k2, l6, i4,
  9138. class9_1.textShadow ? 0 : -1);
  9139. }
  9140. }
  9141. } else if (class9_1.type == 5) {
  9142. Sprite image;
  9143. Sprite hover;
  9144. if (interfaceIsSelected(class9_1)) {
  9145. image = class9_1.sprite2;
  9146. hover = class9_1.enabledHover;
  9147. } else {
  9148. image = class9_1.sprite1;
  9149. hover = class9_1.disabledHover;
  9150. }
  9151. if (image != null) {
  9152. if (spellSelected == 1 && class9_1.id == spellID
  9153. && spellID != 0) {
  9154. image.drawSprite(k2, l2, 0xffffff);
  9155. } else {
  9156. image.drawSprite(k2, l2);
  9157. }
  9158. if (hover != null) {
  9159. if (hoverId == class9_1.id) {
  9160. hover.drawSprite(k2, l2);
  9161. }
  9162. }
  9163. }
  9164. } else if (class9_1.type == 6) {
  9165. int k3 = Texture.textureInt1;
  9166. int j4 = Texture.textureInt2;
  9167. Texture.textureInt1 = k2 + class9_1.width / 2;
  9168. Texture.textureInt2 = l2 + class9_1.height / 2;
  9169. int i5 = Texture.anIntArray1470[class9_1.modelRotation1]
  9170. * class9_1.modelZoom >> 16;
  9171. int l5 = Texture.anIntArray1471[class9_1.modelRotation1]
  9172. * class9_1.modelZoom >> 16;
  9173. boolean flag2 = interfaceIsSelected(class9_1);
  9174. int i7;
  9175. if (flag2)
  9176. i7 = class9_1.anInt258;
  9177. else
  9178. i7 = class9_1.anInt257;
  9179. Model model;
  9180. if (i7 == -1) {
  9181. model = class9_1.method209(-1, -1, flag2);
  9182. } else {
  9183. Animation animation = Animation.anims[i7];
  9184. model = class9_1.method209(
  9185. animation.anIntArray354[class9_1.anInt246],
  9186. animation.anIntArray353[class9_1.anInt246],
  9187. flag2);
  9188. }
  9189. if (model != null)
  9190. model.method482(class9_1.modelRotation2, 0,
  9191. class9_1.modelRotation1, 0, i5, l5);
  9192. Texture.textureInt1 = k3;
  9193. Texture.textureInt2 = j4;
  9194. } else if (class9_1.type == 7) {
  9195. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9196. int k4 = 0;
  9197. for (int j5 = 0; j5 < class9_1.height; j5++) {
  9198. for (int i6 = 0; i6 < class9_1.width; i6++) {
  9199. if (class9_1.inv[k4] > 0) {
  9200. ItemDef itemDef = ItemDef
  9201. .forID(class9_1.inv[k4] - 1);
  9202. String s2 = itemDef.name;
  9203. if (itemDef.stackable
  9204. || class9_1.invStackSizes[k4] != 1)
  9205. s2 = s2
  9206. + " x"
  9207. + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9208. int i9 = k2 + i6
  9209. * (115 + class9_1.invSpritePadX);
  9210. int k9 = l2 + j5
  9211. * (12 + class9_1.invSpritePadY);
  9212. if (class9_1.centerText)
  9213. textDrawingArea_1.method382(
  9214. class9_1.textColor, i9
  9215. + class9_1.width / 2, s2,
  9216. k9, class9_1.textShadow);
  9217. else
  9218. textDrawingArea_1.method389(
  9219. class9_1.textShadow, i9,
  9220. class9_1.textColor, s2, k9);
  9221. }
  9222. k4++;
  9223. }
  9224. }
  9225. }
  9226. if (class9_1.type == 8
  9227. && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id)
  9228. && anInt1501 == 100) {
  9229.  
  9230. int boxWidth = 0;
  9231. int boxHeight = 0;
  9232. TextDrawingArea textDrawingArea_2 = class9_1.textDrawingAreas;
  9233. for (String s1 = class9_1.message; s1.length() > 0;) {
  9234. int l7 = s1.indexOf("\\n");
  9235. String s4;
  9236. if (l7 != -1) {
  9237. s4 = s1.substring(0, l7);
  9238. s1 = s1.substring(l7 + 2);
  9239. } else {
  9240. s4 = s1;
  9241. s1 = "";
  9242. }
  9243. int j10 = textDrawingArea_2.getTextWidth(s4);
  9244. if (j10 > boxWidth) {
  9245. boxWidth = j10;
  9246. }
  9247. boxHeight += textDrawingArea_2.anInt1497 + 1;
  9248. }
  9249. boxWidth += 6;
  9250. boxHeight += 7;
  9251. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  9252. int yPos = l2 + class9_1.height + 5;
  9253. if (xPos < k2 + 5) {
  9254. xPos = k2 + 5;
  9255. }
  9256. if (xPos + boxWidth > k + class9.width) {
  9257. xPos = (k + class9.width) - boxWidth;
  9258. }
  9259. if (yPos + boxHeight > l + class9.height) {
  9260. yPos = (l + class9.height) - boxHeight;
  9261. }
  9262. /*
  9263. * if(class9_1.inventoryhover){ if(xPos + boxWidth+k > 249){
  9264. * xPos = 251 - boxWidth-k; } if(yPos+boxHeight+l >261 ){ yPos =
  9265. * 245 - boxHeight - l; } }
  9266. */
  9267. switch (class9_1.id) {
  9268. case 9217:
  9269. case 9220:
  9270. case 9223:
  9271. case 9226:
  9272. case 9229:
  9273. case 9232:
  9274. case 9235:
  9275. case 9238:
  9276. xPos -= 80;
  9277. break;
  9278. case 9239:
  9279. yPos -= 100;
  9280. break;
  9281. }
  9282. DrawingArea
  9283. .method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  9284. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  9285. String s2 = class9_1.message;
  9286. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2
  9287. .length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {// anInt1497
  9288. int l11 = s2.indexOf("\\n");
  9289. String s5;
  9290. if (l11 != -1) {
  9291. s5 = s2.substring(0, l11);
  9292. s2 = s2.substring(l11 + 2);
  9293. } else {
  9294. s5 = s2;
  9295. s2 = "";
  9296. }
  9297. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  9298. }
  9299. // }
  9300. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9301. }
  9302. if (class9_1.type == 12) {
  9303. Sprite sprite;
  9304. if (interfaceIsSelected(class9_1))
  9305. sprite = class9_1.sprite2;
  9306. else
  9307. sprite = class9_1.sprite1;
  9308. if (sprite != null)
  9309. sprite.drawAdvancedSprite(k2, l2);
  9310. } else if (class9_1.type == 9) {
  9311. drawHoverBox(k2, l2, class9_1.message);
  9312. }
  9313. }
  9314. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9315. }
  9316.  
  9317. public final String methodR(int j) {
  9318. if (j >= 0 && j < 10000)
  9319. return String.valueOf(j);
  9320. if (j >= 10000 && j < 10000000)
  9321. return j / 1000 + "K";
  9322. if (j >= 10000000 && j < 999999999)
  9323. return j / 1000000 + "M";
  9324. if (j >= 999999999)
  9325. return "*";
  9326. else
  9327. return "?";
  9328. }
  9329.  
  9330. public void drawHoverBox(int xPos, int yPos, String text) {
  9331. String[] results = text.split("\n");
  9332. int height = (results.length * 16) + 3;
  9333. int width;
  9334. width = aTextDrawingArea_1271.getTextWidth(results[0]) + 6;
  9335. for (int i = 1; i < results.length; i++)
  9336. if (width <= aTextDrawingArea_1271.getTextWidth(results[i]) + 6)
  9337. width = aTextDrawingArea_1271.getTextWidth(results[i]) + 6;
  9338. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  9339. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  9340. yPos += 14;
  9341. for (int i = 0; i < results.length; i++) {
  9342. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i],
  9343. yPos);
  9344. yPos += 16;
  9345. }
  9346. }
  9347.  
  9348. public void drawBlackBox(int xPos, int yPos) {
  9349. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  9350. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  9351. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  9352. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  9353. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  9354. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  9355. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  9356. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  9357. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  9358. }
  9359.  
  9360. public void randomizeBackground(Background background) {
  9361. int j = 256;
  9362. for (int k = 0; k < anIntArray1190.length; k++)
  9363. anIntArray1190[k] = 0;
  9364.  
  9365. for (int l = 0; l < 5000; l++) {
  9366. int i1 = (int) (Math.random() * 128D * j);
  9367. anIntArray1190[i1] = (int) (Math.random() * 256D);
  9368. }
  9369. for (int j1 = 0; j1 < 20; j1++) {
  9370. for (int k1 = 1; k1 < j - 1; k1++) {
  9371. for (int i2 = 1; i2 < 127; i2++) {
  9372. int k2 = i2 + (k1 << 7);
  9373. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  9374. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9375. }
  9376.  
  9377. }
  9378. int ai[] = anIntArray1190;
  9379. anIntArray1190 = anIntArray1191;
  9380. anIntArray1191 = ai;
  9381. }
  9382. if (background != null) {
  9383. int l1 = 0;
  9384. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  9385. for (int l2 = 0; l2 < background.anInt1452; l2++)
  9386. if (background.aByteArray1450[l1++] != 0) {
  9387. int i3 = l2 + 16 + background.anInt1454;
  9388. int j3 = j2 + 16 + background.anInt1455;
  9389. int k3 = i3 + (j3 << 7);
  9390. anIntArray1190[k3] = 0;
  9391. }
  9392. }
  9393. }
  9394. }
  9395.  
  9396. private void method107(int i, int j, Stream stream, Player player) {
  9397. if ((i & 0x400) != 0) {
  9398. player.anInt1543 = stream.method428();
  9399. player.anInt1545 = stream.method428();
  9400. player.anInt1544 = stream.method428();
  9401. player.anInt1546 = stream.method428();
  9402. player.anInt1547 = stream.method436() + loopCycle;
  9403. player.anInt1548 = stream.method435() + loopCycle;
  9404. player.anInt1549 = stream.method428();
  9405. player.method446();
  9406. }
  9407. if ((i & 0x100) != 0) {
  9408. player.anInt1520 = stream.method434();
  9409. int k = stream.readDWord();
  9410. player.anInt1524 = k >> 16;
  9411. player.anInt1523 = loopCycle + (k & 0xffff);
  9412. player.anInt1521 = 0;
  9413. player.anInt1522 = 0;
  9414. if (player.anInt1523 > loopCycle)
  9415. player.anInt1521 = -1;
  9416. if (player.anInt1520 == 65535)
  9417. player.anInt1520 = -1;
  9418. }
  9419. if ((i & 8) != 0) {
  9420. int l = stream.method434();
  9421. if (l == 65535)
  9422. l = -1;
  9423. int i2 = stream.method427();
  9424. if (l == player.anim && l != -1) {
  9425. int i3 = Animation.anims[l].anInt365;
  9426. if (i3 == 1) {
  9427. player.anInt1527 = 0;
  9428. player.anInt1528 = 0;
  9429. player.anInt1529 = i2;
  9430. player.anInt1530 = 0;
  9431. }
  9432. if (i3 == 2)
  9433. player.anInt1530 = 0;
  9434. } else if (l == -1
  9435. || player.anim == -1
  9436. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  9437. player.anim = l;
  9438. player.anInt1527 = 0;
  9439. player.anInt1528 = 0;
  9440. player.anInt1529 = i2;
  9441. player.anInt1530 = 0;
  9442. player.anInt1542 = player.smallXYIndex;
  9443. }
  9444. }
  9445. if ((i & 4) != 0) {
  9446. player.textSpoken = stream.readString();
  9447. if (player.textSpoken.charAt(0) == '~') {
  9448. player.textSpoken = player.textSpoken.substring(1);
  9449. pushMessage(player.textSpoken, 2, player.name);
  9450. } else if (player == myPlayer)
  9451. pushMessage(player.textSpoken, 2, player.name);
  9452. player.anInt1513 = 0;
  9453. player.anInt1531 = 0;
  9454. player.textCycle = 150;
  9455. }
  9456. if ((i & 0x80) != 0) {
  9457. int i1 = stream.method434();
  9458. int j2 = stream.readUnsignedByte();
  9459. int j3 = stream.method427();
  9460. int k3 = stream.currentOffset;
  9461. if (player.name != null && player.visible) {
  9462. long l3 = TextClass.longForName(player.name);
  9463. boolean flag = false;
  9464. if (j2 <= 1) {
  9465. for (int i4 = 0; i4 < ignoreCount; i4++) {
  9466. if (ignoreListAsLongs[i4] != l3)
  9467. continue;
  9468. flag = true;
  9469. break;
  9470. }
  9471.  
  9472. }
  9473. if (!flag && anInt1251 == 0)
  9474. try {
  9475. aStream_834.currentOffset = 0;
  9476. stream.method442(j3, 0, aStream_834.buffer);
  9477. aStream_834.currentOffset = 0;
  9478. String s = TextInput.method525(j3, aStream_834);
  9479. player.textSpoken = s;
  9480. player.anInt1513 = i1 >> 8;
  9481. player.privelage = j2;
  9482. player.anInt1531 = i1 & 0xff;
  9483. player.textCycle = 150;
  9484. String cr = "";
  9485. if (j2 == 9)
  9486. cr = "@cr9@";
  9487. if (j2 == 8)
  9488. cr = "@cr8@";
  9489. if (j2 == 7)
  9490. cr = "@cr7@";
  9491. if (j2 == 6)
  9492. cr = "@cr6@";
  9493. if (j2 == 5)
  9494. cr = "@cr5@";
  9495. if (j2 == 4)
  9496. cr = "@cr4@";
  9497. if (j2 == 3)
  9498. cr = "@cr3@";
  9499. if (j2 == 2)
  9500. cr = "@cr2@";
  9501. if (j2 == 1)
  9502. cr = "@cr1@";
  9503. pushMessage(s, 2,
  9504. cr + "<col=" + titleColor(player.titleColor, 0)
  9505. + ">" + player.title + "</col>"
  9506. + player.name);
  9507. } catch (Exception exception) {
  9508. signlink.reporterror("cde2");
  9509. }
  9510. }
  9511. stream.currentOffset = k3 + j3;
  9512. }
  9513. if ((i & 1) != 0) {
  9514. player.interactingEntity = stream.method434();
  9515. if (player.interactingEntity == 65535)
  9516. player.interactingEntity = -1;
  9517. }
  9518. if ((i & 0x10) != 0) {
  9519. int j1 = stream.method427();
  9520. byte abyte0[] = new byte[j1];
  9521. Stream stream_1 = new Stream(abyte0);
  9522. stream.readBytes(j1, 0, abyte0);
  9523. aStreamArray895s[j] = stream_1;
  9524. player.updatePlayer(stream_1);
  9525. }
  9526. if ((i & 2) != 0) {
  9527. player.anInt1538 = stream.method436();
  9528. player.anInt1539 = stream.method434();
  9529. }
  9530. if ((i & 0x20) != 0) {
  9531. int k1 = stream.readUnsignedByte();
  9532. int k2 = stream.method426();
  9533. player.updateHitData(k2, k1, loopCycle);
  9534. player.loopCycleStatus = loopCycle + 300;
  9535. player.currentHealth = stream.method427();
  9536. player.maxHealth = stream.readUnsignedByte();
  9537. }
  9538. if ((i & 0x200) != 0) {
  9539. int l1 = stream.readUnsignedByte();
  9540. int l2 = stream.method428();
  9541. player.updateHitData(l2, l1, loopCycle);
  9542. player.loopCycleStatus = loopCycle + 300;
  9543. player.currentHealth = stream.readUnsignedByte();
  9544. player.maxHealth = stream.method427();
  9545. }
  9546. }
  9547.  
  9548. public void method108() {
  9549. try {
  9550. int j = myPlayer.x + cameraOffsetX;
  9551. int k = myPlayer.y + cameraOffsetY;
  9552. if (anInt1014 - j < -500 || anInt1014 - j > 500
  9553. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  9554. anInt1014 = j;
  9555. anInt1015 = k;
  9556. }
  9557. if (anInt1014 != j)
  9558. anInt1014 += (j - anInt1014) / 16;
  9559. if (anInt1015 != k)
  9560. anInt1015 += (k - anInt1015) / 16;
  9561. if (super.keyArray[1] == 1)
  9562. anInt1186 += (-24 - anInt1186) / 2;
  9563. else if (super.keyArray[2] == 1)
  9564. anInt1186 += (24 - anInt1186) / 2;
  9565. else
  9566. anInt1186 /= 2;
  9567. if (super.keyArray[3] == 1)
  9568. anInt1187 += (12 - anInt1187) / 2;
  9569. else if (super.keyArray[4] == 1)
  9570. anInt1187 += (-12 - anInt1187) / 2;
  9571. else
  9572. anInt1187 /= 2;
  9573. viewRotation = viewRotation + anInt1186 / 2 & 0x7ff;
  9574. anInt1184 += anInt1187 / 2;
  9575. if (anInt1184 < 128)
  9576. anInt1184 = 128;
  9577. if (anInt1184 > 383)
  9578. anInt1184 = 383;
  9579. int l = anInt1014 >> 7;
  9580. int i1 = anInt1015 >> 7;
  9581. int j1 = method42(plane, anInt1015, anInt1014);
  9582. int k1 = 0;
  9583. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  9584. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  9585. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  9586. int l2 = plane;
  9587. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9588. l2++;
  9589. int i3 = j1 - intGroundArray[l2][l1][k2];
  9590. if (i3 > k1)
  9591. k1 = i3;
  9592. }
  9593.  
  9594. }
  9595.  
  9596. }
  9597. anInt1005++;
  9598. if (anInt1005 > 1512) {
  9599. anInt1005 = 0;
  9600. stream.createFrame(77);
  9601. stream.writeWordBigEndian(0);
  9602. int i2 = stream.currentOffset;
  9603. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9604. stream.writeWordBigEndian(101);
  9605. stream.writeWordBigEndian(233);
  9606. stream.writeWord(45092);
  9607. if ((int) (Math.random() * 2D) == 0)
  9608. stream.writeWord(35784);
  9609. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9610. stream.writeWordBigEndian(64);
  9611. stream.writeWordBigEndian(38);
  9612. stream.writeWord((int) (Math.random() * 65536D));
  9613. stream.writeWord((int) (Math.random() * 65536D));
  9614. stream.writeBytes(stream.currentOffset - i2);
  9615. }
  9616. int j2 = k1 * 192;
  9617. if (j2 > 0x17f00)
  9618. j2 = 0x17f00;
  9619. if (j2 < 32768)
  9620. j2 = 32768;
  9621. if (j2 > anInt984) {
  9622. anInt984 += (j2 - anInt984) / 24;
  9623. return;
  9624. }
  9625. if (j2 < anInt984) {
  9626. anInt984 += (j2 - anInt984) / 80;
  9627. }
  9628. } catch (Exception _ex) {
  9629. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  9630. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  9631. + anInt1070 + "," + baseX + "," + baseY);
  9632. throw new RuntimeException("eek");
  9633. }
  9634. }
  9635.  
  9636. @Override
  9637. public void processDrawing() {
  9638. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  9639. showErrorScreen();
  9640. return;
  9641. }
  9642. anInt1061++;
  9643. if (!loggedIn)
  9644. drawLoginScreen(false);
  9645. else
  9646. drawGameScreen();
  9647. anInt1213 = 0;
  9648. }
  9649.  
  9650. private boolean isFriendOrSelf(String s) {
  9651. if (s == null)
  9652. return false;
  9653. for (int i = 0; i < friendsCount; i++)
  9654. if (s.equalsIgnoreCase(friendsList[i]))
  9655. return true;
  9656. return s.equalsIgnoreCase(myPlayer.name);
  9657. }
  9658.  
  9659. private static String combatDiffColor(int i, int j) {
  9660. int k = i - j;
  9661. if (k < -9)
  9662. return "@red@";
  9663. if (k < -6)
  9664. return "@or3@";
  9665. if (k < -3)
  9666. return "@or2@";
  9667. if (k < 0)
  9668. return "@or1@";
  9669. if (k > 9)
  9670. return "@gre@";
  9671. if (k > 6)
  9672. return "@gr3@";
  9673. if (k > 3)
  9674. return "@gr2@";
  9675. if (k > 0)
  9676. return "@gr1@";
  9677. else
  9678. return "@yel@";
  9679. }
  9680.  
  9681. public void setWaveVolume(int i) {
  9682. signlink.wavevol = i;
  9683. }
  9684.  
  9685. private void draw3dScreen() {
  9686. drawSplitPrivateChat();
  9687. if (crossType == 1) {
  9688. crosses[crossIndex / 100]
  9689. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9690. anInt1142++;
  9691. if (anInt1142 > 67) {
  9692. anInt1142 = 0;
  9693. stream.createFrame(78);
  9694. }
  9695. }
  9696. if (crossType == 2)
  9697. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  9698. crossY - 8 - 4);
  9699. if (anInt1018 != -1) {
  9700. method119(anInt945, anInt1018);
  9701. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9702. }
  9703. if (openInterfaceID != -1) {
  9704. method119(anInt945, openInterfaceID);
  9705. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9706. }
  9707. method70();
  9708. if (!menuOpen) {
  9709. processRightClick();
  9710. drawTooltip();
  9711. } else if (menuScreenArea == 0)
  9712. drawMenu();
  9713. if (anInt1055 == 1)
  9714. multiOverlay.drawSprite(472, 296);
  9715. if (fpsOn) {
  9716. char c = '\u01FB';
  9717. int k = 20;
  9718. int i1 = 0xffff00;
  9719. if (super.fps < 15)
  9720. i1 = 0xff0000;
  9721. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9722. k += 15;
  9723. Runtime runtime = Runtime.getRuntime();
  9724. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9725. i1 = 0xffff00;
  9726. if (j1 > 0x2000000 && lowMem)
  9727. i1 = 0xff0000;
  9728. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9729. k += 15;
  9730. }
  9731. int x = baseX + (myPlayer.x - 6 >> 7);
  9732. int y = baseY + (myPlayer.y - 6 >> 7);
  9733. if (clientData) {
  9734. if (super.fps < 15) {
  9735. }
  9736. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285,
  9737. 5);
  9738. Runtime runtime = Runtime.getRuntime();
  9739. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9740. if (j1 > 0x2000000 && lowMem) {
  9741. }
  9742. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299,
  9743. 5);
  9744. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: "
  9745. + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9746. aTextDrawingArea_1271.method385(0xffff00,
  9747. "Coords: " + x + ", " + y, 329, 5);
  9748. }
  9749. if (anInt1104 != 0) {
  9750. int j = anInt1104 / 50;
  9751. int l = j / 60;
  9752. j %= 60;
  9753. if (j < 10)
  9754. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  9755. + l + ":0" + j, 329, 4);
  9756. else
  9757. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  9758. + l + ":" + j, 329, 4);
  9759. anInt849++;
  9760. if (anInt849 > 75) {
  9761. anInt849 = 0;
  9762. stream.createFrame(148);
  9763. }
  9764. }
  9765. }
  9766.  
  9767. public void addIgnore(long l) {
  9768. try {
  9769. if (l == 0L)
  9770. return;
  9771. if (ignoreCount >= 100) {
  9772. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9773. return;
  9774. }
  9775. String s = TextClass.fixName(TextClass.nameForLong(l));
  9776. for (int j = 0; j < ignoreCount; j++)
  9777. if (ignoreListAsLongs[j] == l) {
  9778. pushMessage(s + " is already on your ignore list", 0, "");
  9779. return;
  9780. }
  9781. for (int k = 0; k < friendsCount; k++)
  9782. if (friendsListAsLongs[k] == l) {
  9783. pushMessage("Please remove " + s
  9784. + " from your friend list first", 0, "");
  9785. return;
  9786. }
  9787.  
  9788. ignoreListAsLongs[ignoreCount++] = l;
  9789. needDrawTabArea = true;
  9790. stream.createFrame(133);
  9791. stream.writeQWord(l);
  9792. return;
  9793. } catch (RuntimeException runtimeexception) {
  9794. signlink.reporterror("45688, " + l + ", " + 4 + ", "
  9795. + runtimeexception.toString());
  9796. }
  9797. throw new RuntimeException();
  9798. }
  9799.  
  9800. public void method114() {
  9801. for (int i = -1; i < playerCount; i++) {
  9802. int j;
  9803. if (i == -1)
  9804. j = myPlayerIndex;
  9805. else
  9806. j = playerIndices[i];
  9807. Player player = playerArray[j];
  9808. if (player != null)
  9809. method96(player);
  9810. }
  9811.  
  9812. }
  9813.  
  9814. public void method115() {
  9815. if (loadingStage == 2) {
  9816. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  9817. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  9818. .reverseGetNext()) {
  9819. if (class30_sub1.anInt1294 > 0)
  9820. class30_sub1.anInt1294--;
  9821. if (class30_sub1.anInt1294 == 0) {
  9822. if (class30_sub1.anInt1299 < 0
  9823. || ObjectManager.method178(class30_sub1.anInt1299,
  9824. class30_sub1.anInt1301)) {
  9825. method142(class30_sub1.anInt1298,
  9826. class30_sub1.anInt1295, class30_sub1.anInt1300,
  9827. class30_sub1.anInt1301, class30_sub1.anInt1297,
  9828. class30_sub1.anInt1296, class30_sub1.anInt1299);
  9829. class30_sub1.unlink();
  9830. }
  9831. } else {
  9832. if (class30_sub1.anInt1302 > 0)
  9833. class30_sub1.anInt1302--;
  9834. if (class30_sub1.anInt1302 == 0
  9835. && class30_sub1.anInt1297 >= 1
  9836. && class30_sub1.anInt1298 >= 1
  9837. && class30_sub1.anInt1297 <= 102
  9838. && class30_sub1.anInt1298 <= 102
  9839. && (class30_sub1.anInt1291 < 0 || ObjectManager
  9840. .method178(class30_sub1.anInt1291,
  9841. class30_sub1.anInt1293))) {
  9842. method142(class30_sub1.anInt1298,
  9843. class30_sub1.anInt1295, class30_sub1.anInt1292,
  9844. class30_sub1.anInt1293, class30_sub1.anInt1297,
  9845. class30_sub1.anInt1296, class30_sub1.anInt1291);
  9846. class30_sub1.anInt1302 = -1;
  9847. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  9848. && class30_sub1.anInt1299 == -1)
  9849. class30_sub1.unlink();
  9850. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  9851. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  9852. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9853. class30_sub1.unlink();
  9854. }
  9855. }
  9856. }
  9857.  
  9858. }
  9859. }
  9860.  
  9861. public void determineMenuSize() {
  9862. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9863. for (int j = 0; j < menuActionRow; j++) {
  9864. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9865. if (k > i)
  9866. i = k;
  9867. }
  9868.  
  9869. i += 8;
  9870. int l = 15 * menuActionRow + 21;
  9871. if (super.saveClickX > 4 && super.saveClickY > 4
  9872. && super.saveClickX < 516 && super.saveClickY < 338) {
  9873. int i1 = super.saveClickX - 4 - i / 2;
  9874. if (i1 + i > 512)
  9875. i1 = 512 - i;
  9876. if (i1 < 0)
  9877. i1 = 0;
  9878. int l1 = super.saveClickY - 4;
  9879. if (l1 + l > 334)
  9880. l1 = 334 - l;
  9881. if (l1 < 0)
  9882. l1 = 0;
  9883. menuOpen = true;
  9884. menuScreenArea = 0;
  9885. menuOffsetX = i1;
  9886. menuOffsetY = l1;
  9887. menuWidth = i;
  9888. menuHeight = 15 * menuActionRow + 22;
  9889. }
  9890. if (super.saveClickX > 519 && super.saveClickY > 168
  9891. && super.saveClickX < 765 && super.saveClickY < 503) {
  9892. int j1 = super.saveClickX - 519 - i / 2;
  9893. if (j1 < 0)
  9894. j1 = 0;
  9895. else if (j1 + i > 245)
  9896. j1 = 245 - i;
  9897. int i2 = super.saveClickY - 168;
  9898. if (i2 < 0)
  9899. i2 = 0;
  9900. else if (i2 + l > 333)
  9901. i2 = 333 - l;
  9902. menuOpen = true;
  9903. menuScreenArea = 1;
  9904. menuOffsetX = j1;
  9905. menuOffsetY = i2;
  9906. menuWidth = i;
  9907. menuHeight = 15 * menuActionRow + 22;
  9908. }
  9909. if (super.saveClickX > 0 && super.saveClickY > 338
  9910. && super.saveClickX < 516 && super.saveClickY < 503) {
  9911. int k1 = super.saveClickX - 0 - i / 2;
  9912. if (k1 < 0)
  9913. k1 = 0;
  9914. else if (k1 + i > 516)
  9915. k1 = 516 - i;
  9916. int j2 = super.saveClickY - 338;
  9917. if (j2 < 0)
  9918. j2 = 0;
  9919. else if (j2 + l > 165)
  9920. j2 = 165 - l;
  9921. menuOpen = true;
  9922. menuScreenArea = 2;
  9923. menuOffsetX = k1;
  9924. menuOffsetY = j2;
  9925. menuWidth = i;
  9926. menuHeight = 15 * menuActionRow + 22;
  9927. }
  9928. }
  9929.  
  9930. public void method117(Stream stream) {
  9931. stream.initBitAccess();
  9932. int j = stream.readBits(1);
  9933. if (j == 0)
  9934. return;
  9935. int k = stream.readBits(2);
  9936. if (k == 0) {
  9937. anIntArray894[anInt893++] = myPlayerIndex;
  9938. return;
  9939. }
  9940. if (k == 1) {
  9941. int l = stream.readBits(3);
  9942. myPlayer.moveInDir(false, l);
  9943. int k1 = stream.readBits(1);
  9944. if (k1 == 1)
  9945. anIntArray894[anInt893++] = myPlayerIndex;
  9946. return;
  9947. }
  9948. if (k == 2) {
  9949. int i1 = stream.readBits(3);
  9950. myPlayer.moveInDir(true, i1);
  9951. int l1 = stream.readBits(3);
  9952. myPlayer.moveInDir(true, l1);
  9953. int j2 = stream.readBits(1);
  9954. if (j2 == 1)
  9955. anIntArray894[anInt893++] = myPlayerIndex;
  9956. return;
  9957. }
  9958. if (k == 3) {
  9959. plane = stream.readBits(2);
  9960. int j1 = stream.readBits(1);
  9961. int i2 = stream.readBits(1);
  9962. if (i2 == 1)
  9963. anIntArray894[anInt893++] = myPlayerIndex;
  9964. int k2 = stream.readBits(7);
  9965. int l2 = stream.readBits(7);
  9966. myPlayer.setPos(l2, k2, j1 == 1);
  9967. }
  9968. }
  9969.  
  9970. public void nullLoader() {
  9971. aBoolean831 = false;
  9972. while (drawingFlames) {
  9973. aBoolean831 = false;
  9974. try {
  9975. Thread.sleep(50L);
  9976. } catch (Exception _ex) {
  9977. }
  9978. }
  9979. aBackground_966 = null;
  9980. aBackground_967 = null;
  9981. aBackgroundArray1152s = null;
  9982. anIntArray850 = null;
  9983. anIntArray851 = null;
  9984. anIntArray852 = null;
  9985. anIntArray853 = null;
  9986. anIntArray1190 = null;
  9987. anIntArray1191 = null;
  9988. anIntArray828 = null;
  9989. anIntArray829 = null;
  9990. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9991. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9992. }
  9993.  
  9994. private boolean method119(int i, int j) {
  9995. boolean flag1 = false;
  9996. RSInterface class9 = RSInterface.interfaceCache[j];
  9997. for (int k = 0; k < class9.children.length; k++) {
  9998. if (class9.children[k] == -1)
  9999. break;
  10000. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10001. if (class9_1.type == 1)
  10002. flag1 |= method119(i, class9_1.id);
  10003. if (class9_1.type == 6
  10004. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  10005. boolean flag2 = interfaceIsSelected(class9_1);
  10006. int l;
  10007. if (flag2)
  10008. l = class9_1.anInt258;
  10009. else
  10010. l = class9_1.anInt257;
  10011. if (l != -1) {
  10012. Animation animation = Animation.anims[l];
  10013. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  10014. .method258(class9_1.anInt246);) {
  10015. class9_1.anInt208 -= animation
  10016. .method258(class9_1.anInt246) + 1;
  10017. class9_1.anInt246++;
  10018. if (class9_1.anInt246 >= animation.anInt352) {
  10019. class9_1.anInt246 -= animation.anInt356;
  10020. if (class9_1.anInt246 < 0
  10021. || class9_1.anInt246 >= animation.anInt352)
  10022. class9_1.anInt246 = 0;
  10023. }
  10024. flag1 = true;
  10025. }
  10026.  
  10027. }
  10028. }
  10029. }
  10030.  
  10031. return flag1;
  10032. }
  10033.  
  10034. private int method120() {
  10035. int j = 3;
  10036. if (yCameraCurve < 310) {
  10037. int k = xCameraPos >> 7;
  10038. int l = yCameraPos >> 7;
  10039. int i1 = myPlayer.x >> 7;
  10040. int j1 = myPlayer.y >> 7;
  10041. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10042. j = plane;
  10043. int k1;
  10044. if (i1 > k)
  10045. k1 = i1 - k;
  10046. else
  10047. k1 = k - i1;
  10048. int l1;
  10049. if (j1 > l)
  10050. l1 = j1 - l;
  10051. else
  10052. l1 = l - j1;
  10053. if (k1 > l1) {
  10054. int i2 = (l1 * 0x10000) / k1;
  10055. int k2 = 32768;
  10056. while (k != i1) {
  10057. if (k < i1)
  10058. k++;
  10059. else if (k > i1)
  10060. k--;
  10061. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10062. j = plane;
  10063. k2 += i2;
  10064. if (k2 >= 0x10000) {
  10065. k2 -= 0x10000;
  10066. if (l < j1)
  10067. l++;
  10068. else if (l > j1)
  10069. l--;
  10070. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10071. j = plane;
  10072. }
  10073. }
  10074. } else {
  10075. int j2 = (k1 * 0x10000) / l1;
  10076. int l2 = 32768;
  10077. while (l != j1) {
  10078. if (l < j1)
  10079. l++;
  10080. else if (l > j1)
  10081. l--;
  10082. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10083. j = plane;
  10084. l2 += j2;
  10085. if (l2 >= 0x10000) {
  10086. l2 -= 0x10000;
  10087. if (k < i1)
  10088. k++;
  10089. else if (k > i1)
  10090. k--;
  10091. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10092. j = plane;
  10093. }
  10094. }
  10095. }
  10096. }
  10097. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10098. j = plane;
  10099. return j;
  10100. }
  10101.  
  10102. private int method121() {
  10103. int j = method42(plane, yCameraPos, xCameraPos);
  10104. if (j - zCameraPos < 800
  10105. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10106. return plane;
  10107. else
  10108. return 3;
  10109. }
  10110.  
  10111. public void delIgnore(long l) {
  10112. try {
  10113. if (l == 0L)
  10114. return;
  10115. for (int j = 0; j < ignoreCount; j++)
  10116. if (ignoreListAsLongs[j] == l) {
  10117. ignoreCount--;
  10118. needDrawTabArea = true;
  10119. System.arraycopy(ignoreListAsLongs, j + 1,
  10120. ignoreListAsLongs, j, ignoreCount - j);
  10121.  
  10122. stream.createFrame(74);
  10123. stream.writeQWord(l);
  10124. return;
  10125. }
  10126.  
  10127. return;
  10128. } catch (RuntimeException runtimeexception) {
  10129. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  10130. + runtimeexception.toString());
  10131. }
  10132. throw new RuntimeException();
  10133. }
  10134.  
  10135. @SuppressWarnings("unused")
  10136. private void chatJoin(long l) {
  10137. try {
  10138. if (l == 0L)
  10139. return;
  10140. stream.createFrame(60);
  10141. stream.writeQWord(l);
  10142. return;
  10143. } catch (RuntimeException runtimeexception) {
  10144. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  10145. + runtimeexception.toString());
  10146. }
  10147. throw new RuntimeException();
  10148.  
  10149. }
  10150.  
  10151. @Override
  10152. public String getParameter(String s) {
  10153. if (signlink.mainapp != null)
  10154. return signlink.mainapp.getParameter(s);
  10155. else
  10156. return super.getParameter(s);
  10157. }
  10158.  
  10159. public void adjustVolume(boolean flag, int i) {
  10160. signlink.midivol = i;
  10161. if (flag)
  10162. signlink.midi = "voladjust";
  10163. }
  10164.  
  10165. private int extractInterfaceValues(RSInterface class9, int j) {
  10166. if (class9.valueIndexArray == null
  10167. || j >= class9.valueIndexArray.length)
  10168. return -2;
  10169. try {
  10170. int ai[] = class9.valueIndexArray[j];
  10171. int k = 0;
  10172. int l = 0;
  10173. int i1 = 0;
  10174. do {
  10175. int j1 = ai[l++];
  10176. int k1 = 0;
  10177. byte byte0 = 0;
  10178. if (j1 == 0)
  10179. return k;
  10180. if (j1 == 1)
  10181. k1 = currentStats[ai[l++]];
  10182. if (j1 == 2)
  10183. k1 = maxStats[ai[l++]];
  10184. if (j1 == 3)
  10185. k1 = currentExp[ai[l++]];
  10186. if (j1 == 4) {
  10187. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10188. int k2 = ai[l++];
  10189. if (k2 >= 0 && k2 < ItemDef.totalItems
  10190. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  10191. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  10192. if (class9_1.inv[j3] == k2 + 1)
  10193. k1 += class9_1.invStackSizes[j3];
  10194.  
  10195. }
  10196. }
  10197. if (j1 == 5)
  10198. k1 = variousSettings[ai[l++]];
  10199. if (j1 == 6)
  10200. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10201. if (j1 == 7)
  10202. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10203. if (j1 == 8)
  10204. k1 = myPlayer.combatLevel;
  10205. if (j1 == 9) {
  10206. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  10207. if (Skills.skillEnabled[l1])
  10208. k1 += maxStats[l1];
  10209.  
  10210. }
  10211. if (j1 == 10) {
  10212. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10213. int l2 = ai[l++] + 1;
  10214. if (l2 >= 0 && l2 < ItemDef.totalItems
  10215. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  10216. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  10217. if (class9_2.inv[k3] != l2)
  10218. continue;
  10219. k1 = 0x3b9ac9ff;
  10220. break;
  10221. }
  10222.  
  10223. }
  10224. }
  10225. if (j1 == 11)
  10226. k1 = energy;
  10227. if (j1 == 12)
  10228. k1 = weight;
  10229. if (j1 == 13) {
  10230. int i2 = variousSettings[ai[l++]];
  10231. int i3 = ai[l++];
  10232. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10233. }
  10234. if (j1 == 14) {
  10235. int j2 = ai[l++];
  10236. VarBit varBit = VarBit.cache[j2];
  10237. int l3 = varBit.anInt648;
  10238. int i4 = varBit.anInt649;
  10239. int j4 = varBit.anInt650;
  10240. int k4 = anIntArray1232[j4 - i4];
  10241. k1 = variousSettings[l3] >> i4 & k4;
  10242. }
  10243. if (j1 == 15)
  10244. byte0 = 1;
  10245. if (j1 == 16)
  10246. byte0 = 2;
  10247. if (j1 == 17)
  10248. byte0 = 3;
  10249. if (j1 == 18)
  10250. k1 = (myPlayer.x >> 7) + baseX;
  10251. if (j1 == 19)
  10252. k1 = (myPlayer.y >> 7) + baseY;
  10253. if (j1 == 20)
  10254. k1 = ai[l++];
  10255. if (byte0 == 0) {
  10256. if (i1 == 0)
  10257. k += k1;
  10258. if (i1 == 1)
  10259. k -= k1;
  10260. if (i1 == 2 && k1 != 0)
  10261. k /= k1;
  10262. if (i1 == 3)
  10263. k *= k1;
  10264. i1 = 0;
  10265. } else {
  10266. i1 = byte0;
  10267. }
  10268. } while (true);
  10269. } catch (Exception _ex) {
  10270. return -1;
  10271. }
  10272. }
  10273.  
  10274. public void drawTooltip() {
  10275. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10276. return;
  10277. String s;
  10278. if (itemSelected == 1 && menuActionRow < 2)
  10279. s = "Use " + selectedItemName + " with...";
  10280. else if (spellSelected == 1 && menuActionRow < 2)
  10281. s = spellTooltip + "...";
  10282. else
  10283. s = menuActionName[menuActionRow - 1];
  10284. if (menuActionRow > 2)
  10285. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10286. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10287. }
  10288.  
  10289. private void drawMinimap() {
  10290. if (revision474 == true) {
  10291. aRSImageProducer_1164.initDrawingArea();
  10292. if (anInt1021 == 2) {
  10293. byte abyte0[] = mapBack.aByteArray1450;
  10294. int ai[] = DrawingArea.pixels;
  10295. int k2 = abyte0.length;
  10296. for (int i5 = 0; i5 < k2; i5++)
  10297. if (abyte0[i5] == 0)
  10298. ai[i5] = 0;
  10299. compass.method352(33, viewRotation, anIntArray1057, 256,
  10300. anIntArray968, 25, 0, 0, 33, 25);
  10301. aRSImageProducer_1165.initDrawingArea();
  10302. return;
  10303. }
  10304. int i = viewRotation + minimapRotation & 0x7ff;
  10305. int j = 48 + myPlayer.x / 32;
  10306. int l2 = 464 - myPlayer.y / 32;
  10307. for (int x = 0; x < anIntArray1229.length; x++) {
  10308. anIntArray1229[x] = 170;
  10309. anIntArray1052[x] = -23;
  10310. }
  10311. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  10312. 256 + minimapZoom, anIntArray1052, l2, 9, 54, 146, j);
  10313. compass.method352(33, viewRotation, anIntArray1057, 256,
  10314. anIntArray968, 25, 4, 25, 33, 25);
  10315. for (int j5 = 0; j5 < anInt1071; j5++) {
  10316. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10317. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10318. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10319. }
  10320. for (int k5 = 0; k5 < 104; k5++) {
  10321. for (int l5 = 0; l5 < 104; l5++) {
  10322. NodeList class19 = groundArray[plane][k5][l5];
  10323. if (class19 != null) {
  10324. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10325. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10326. markMinimap(mapDotItem, l, j3);
  10327. }
  10328. }
  10329. }
  10330.  
  10331. for (int i6 = 0; i6 < npcCount; i6++) {
  10332. NPC npc = npcArray[npcIndices[i6]];
  10333. if (npc != null && npc.isVisible()) {
  10334. EntityDef entityDef = npc.desc;
  10335. if (entityDef.childrenIDs != null)
  10336. entityDef = entityDef.method161();
  10337. if (entityDef != null && entityDef.aBoolean87
  10338. && entityDef.aBoolean84) {
  10339. int i1 = npc.x / 32 - myPlayer.x / 32;
  10340. int k3 = npc.y / 32 - myPlayer.y / 32;
  10341. markMinimap(mapDotNPC, i1, k3);
  10342. }
  10343. }
  10344. }
  10345. for(int j6 = 0; j6 < playerCount; j6++) {
  10346. Player player = playerArray[playerIndices[j6]];
  10347. if(player != null && player.isVisible()) {
  10348. int j1 = player.x / 32 - myPlayer.x / 32;
  10349. int l3 = player.y / 32 - myPlayer.y / 32;
  10350. boolean flag1 = false;
  10351. boolean flag3 = false;
  10352. for (int j3 = 0; j3 < clanList.length; j3++) {
  10353. if (clanList[j3] == null)
  10354. continue;
  10355. if (!clanList[j3].equalsIgnoreCase(player.name))
  10356. continue;
  10357. flag3 = true;
  10358. break;
  10359. }
  10360. long l6 = TextClass.longForName(player.name);
  10361. for(int k6 = 0; k6 < friendsCount; k6++) {
  10362. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10363. continue;
  10364. flag1 = true;
  10365. break;
  10366. }
  10367. boolean flag2 = false;
  10368. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10369. flag2 = true;
  10370. if(flag1)
  10371. markMinimap(mapDotFriend, j1, l3);
  10372. else if(flag3)
  10373. markMinimap(mapDotClan, j1, l3);
  10374. else if(flag2)
  10375. markMinimap(mapDotTeam, j1, l3);
  10376. else
  10377. markMinimap(mapDotPlayer, j1, l3);
  10378. }
  10379. }
  10380. if (anInt855 != 0 && loopCycle % 20 < 10) {
  10381. if (anInt855 == 1 && anInt1222 >= 0
  10382. && anInt1222 < npcArray.length) {
  10383. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10384. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  10385. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32
  10386. - myPlayer.x / 32;
  10387. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32
  10388. - myPlayer.y / 32;
  10389. method81(mapMarker, i4, k1);
  10390. }
  10391. }
  10392. if (anInt855 == 2) {
  10393. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10394. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10395. method81(mapMarker, j4, l1);
  10396. }
  10397. if (anInt855 == 10 && anInt933 >= 0
  10398. && anInt933 < playerArray.length) {
  10399. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10400. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  10401. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32
  10402. - myPlayer.x / 32;
  10403. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32
  10404. - myPlayer.y / 32;
  10405. method81(mapMarker, k4, i2);
  10406. }
  10407. }
  10408. }
  10409. if (destX != 0) {
  10410. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10411. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10412. markMinimap(mapFlag, j2, l4);
  10413. }
  10414. DrawingArea.drawPixels(3, 78 + 5, 97 + 30, 0xffffff, 3);
  10415. mapArea474.drawSprite(0, 0);
  10416. if (revision474 == true && OSOrbs == true) {
  10417. draw07Orbs();
  10418. }
  10419. if (menuOpen && menuScreenArea == 3) {
  10420. drawMenu();
  10421. }
  10422. aRSImageProducer_1165.initDrawingArea();
  10423. }
  10424. if (revision498 == true) {
  10425. aRSImageProducer_1164.initDrawingArea();
  10426. if (anInt1021 == 2) {
  10427. byte abyte0[] = mapBack.aByteArray1450;
  10428. int ai[] = DrawingArea.pixels;
  10429. int k2 = abyte0.length;
  10430. for (int i5 = 0; i5 < k2; i5++)
  10431. if (abyte0[i5] == 0)
  10432. ai[i5] = 0;
  10433. compass.method352(33, viewRotation, anIntArray1057, 256,
  10434. anIntArray968, 25, 8, 8, 33, 25);
  10435. aRSImageProducer_1165.initDrawingArea();
  10436. return;
  10437. }
  10438. int i = viewRotation + minimapRotation & 0x7ff;
  10439. int j = 48 + myPlayer.x / 32;
  10440. int l2 = 464 - myPlayer.y / 32;
  10441. for (int x = 0; x < anIntArray1229.length; x++) {
  10442. anIntArray1229[x] = 170;
  10443. anIntArray1052[x] = -23;
  10444. }
  10445. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  10446. 256 + minimapZoom, anIntArray1052, l2, 10, 45, 146, j);
  10447. compass.method352(33, viewRotation, anIntArray1057, 256,
  10448. anIntArray968, 25, 8, 8, 33, 25);
  10449. for (int j5 = 0; j5 < anInt1071; j5++) {
  10450. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10451. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10452. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10453. }
  10454. for (int k5 = 0; k5 < 104; k5++) {
  10455. for (int l5 = 0; l5 < 104; l5++) {
  10456. NodeList class19 = groundArray[plane][k5][l5];
  10457. if (class19 != null) {
  10458. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10459. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10460. markMinimap(mapDotItem, l, j3);
  10461. }
  10462. }
  10463. }
  10464.  
  10465. for (int i6 = 0; i6 < npcCount; i6++) {
  10466. NPC npc = npcArray[npcIndices[i6]];
  10467. if (npc != null && npc.isVisible()) {
  10468. EntityDef entityDef = npc.desc;
  10469. if (entityDef.childrenIDs != null)
  10470. entityDef = entityDef.method161();
  10471. if (entityDef != null && entityDef.aBoolean87
  10472. && entityDef.aBoolean84) {
  10473. int i1 = npc.x / 32 - myPlayer.x / 32;
  10474. int k3 = npc.y / 32 - myPlayer.y / 32;
  10475. markMinimap(mapDotNPC, i1, k3);
  10476. }
  10477. }
  10478. }
  10479.  
  10480. for (int j6 = 0; j6 < playerCount; j6++) {
  10481. Player player = playerArray[playerIndices[j6]];
  10482. if (player != null && player.isVisible()) {
  10483. int j1 = player.x / 32 - myPlayer.x / 32;
  10484. int l3 = player.y / 32 - myPlayer.y / 32;
  10485. boolean flag1 = false;
  10486. long l6 = TextClass.longForName(player.name);
  10487. for (int k6 = 0; k6 < friendsCount; k6++) {
  10488. if (l6 != friendsListAsLongs[k6]
  10489. || friendsNodeIDs[k6] == 0)
  10490. continue;
  10491. flag1 = true;
  10492. break;
  10493. }
  10494. @SuppressWarnings("unused")
  10495. boolean flag2 = false;
  10496. if (myPlayer.team != 0 && player.team != 0
  10497. && myPlayer.team == player.team)
  10498. flag2 = true;
  10499. if (flag1)
  10500. markMinimap(mapDotFriend, j1, l3);
  10501. else
  10502. markMinimap(mapDotPlayer, j1, l3);
  10503. }
  10504. }
  10505.  
  10506. if (anInt855 != 0 && loopCycle % 20 < 10) {
  10507. if (anInt855 == 1 && anInt1222 >= 0
  10508. && anInt1222 < npcArray.length) {
  10509. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10510. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  10511. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32
  10512. - myPlayer.x / 32;
  10513. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32
  10514. - myPlayer.y / 32;
  10515. method81(mapMarker, i4, k1);
  10516. }
  10517. }
  10518. if (anInt855 == 2) {
  10519. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10520. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10521. method81(mapMarker, j4, l1);
  10522. }
  10523. if (anInt855 == 10 && anInt933 >= 0
  10524. && anInt933 < playerArray.length) {
  10525. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10526. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  10527. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32
  10528. - myPlayer.x / 32;
  10529. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32
  10530. - myPlayer.y / 32;
  10531. method81(mapMarker, k4, i2);
  10532. }
  10533. }
  10534. }
  10535. if (destX != 0) {
  10536. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10537. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10538. markMinimap(mapFlag, j2, l4);
  10539. }
  10540. DrawingArea.drawPixels(3, 78 + 5, 97 + 20, 0xffffff, 3);
  10541. mapArea.drawSprite(0, 0);
  10542. drawHP();
  10543. drawPrayer();
  10544. drawRunOrb();
  10545. aRSImageProducer_1165.initDrawingArea();
  10546. }
  10547. }
  10548.  
  10549. public boolean runClicked = false;
  10550. public boolean Resting = false;
  10551. public boolean runHover;
  10552.  
  10553. public void drawPrayer() {
  10554. String s = (new StringBuilder()).append(signlink.findcachedir())
  10555. .append("/Sprites/Frame/").toString();
  10556. String s1 = RSInterface.interfaceCache[4012].message;
  10557. String s2 = RSInterface.interfaceCache[4013].message;
  10558. int i = Integer.parseInt(s1);
  10559. int j = Integer.parseInt(s2);
  10560. int k = (int) (((double) i / (double) j) * 100D);
  10561. ORBS[0] = new Sprite((new StringBuilder()).append(s)
  10562. .append("ORBS 0.png").toString(), 27, getOrbFill(k));
  10563. ORBS[1].drawSprite(190, 53);
  10564. ORBS[4].drawSprite(193, 56);
  10565. ORBS[0].drawSprite(194, 56);
  10566. ORBS[6].drawSprite(197, 60);
  10567. smallText.method382(getOrbTextColor(k), 234, (new StringBuilder())
  10568. .append("").append(i).toString(), 82, true);
  10569. }
  10570.  
  10571. public int getOrbTextColor(int i) {
  10572. if (i >= 75 && i <= 0x7fffffff)
  10573. return 65280;
  10574. if (i >= 50 && i <= 74)
  10575. return 0xffff00;
  10576. return i < 25 || i > 49 ? 0xff0000 : 0xff981f;
  10577. }
  10578.  
  10579. public int getOrbFill(int i) {
  10580. if (i <= 0x7fffffff && i >= 97)
  10581. return 0;
  10582. if (i <= 96 && i >= 93)
  10583. return 1;
  10584. if (i <= 92 && i >= 89)
  10585. return 2;
  10586. if (i <= 88 && i >= 85)
  10587. return 3;
  10588. if (i <= 84 && i >= 81)
  10589. return 4;
  10590. if (i <= 80 && i >= 77)
  10591. return 5;
  10592. if (i <= 76 && i >= 73)
  10593. return 6;
  10594. if (i <= 72 && i >= 69)
  10595. return 7;
  10596. if (i <= 68 && i >= 65)
  10597. return 8;
  10598. if (i <= 64 && i >= 61)
  10599. return 9;
  10600. if (i <= 60 && i >= 57)
  10601. return 10;
  10602. if (i <= 56 && i >= 53)
  10603. return 11;
  10604. if (i <= 52 && i >= 49)
  10605. return 12;
  10606. if (i <= 48 && i >= 45)
  10607. return 13;
  10608. if (i <= 44 && i >= 41)
  10609. return 14;
  10610. if (i <= 40 && i >= 37)
  10611. return 15;
  10612. if (i <= 36 && i >= 33)
  10613. return 16;
  10614. if (i <= 32 && i >= 29)
  10615. return 17;
  10616. if (i <= 28 && i >= 25)
  10617. return 18;
  10618. if (i <= 24 && i >= 21)
  10619. return 19;
  10620. if (i <= 20 && i >= 17)
  10621. return 20;
  10622. if (i <= 16 && i >= 13)
  10623. return 21;
  10624. if (i <= 12 && i >= 9)
  10625. return 22;
  10626. if (i <= 8 && i >= 7)
  10627. return 23;
  10628. if (i <= 6 && i >= 5)
  10629. return 24;
  10630. if (i <= 4 && i >= 3)
  10631. return 25;
  10632. if (i <= 2 && i >= 1)
  10633. return 26;
  10634. return i > 0 ? 0 : 27;
  10635. }
  10636.  
  10637. public void drawLogoutButton() {
  10638. if (tabInterfaceIDs[10] != -1 && anInt1054 == 9)
  10639. if (loopCycle % 20 >= 10)
  10640. ;
  10641. sideIcons[10].drawSprite(223, 1);
  10642. if (tabID == 10)
  10643. logIconC.drawSprite(223, 1);
  10644. }
  10645.  
  10646. public void drawPrayer07() {
  10647. String s = (new StringBuilder()).append(signlink.findcachedir())
  10648. .append("/Sprites/Frame/").toString();
  10649. String s1 = RSInterface.interfaceCache[4012].message;
  10650. String s2 = RSInterface.interfaceCache[4013].message;
  10651. int i = Integer.parseInt(s1);
  10652. int j = Integer.parseInt(s2);
  10653. int k = (int) (((double) i / (double) j) * 100D);
  10654. ORBS[0] = new Sprite((new StringBuilder()).append(s)
  10655. .append("ORBS 0.png").toString(), 28, getOrbFill(k));
  10656. ORBS[12].drawSprite(2, 80);
  10657. ORBS[4].drawSprite(30, 84);
  10658. ORBS[0].drawSprite(30, 84);
  10659. ORBS[6].drawSprite(33, 88);
  10660. smallText.method382(getOrbTextColor(k), 18, (new StringBuilder())
  10661. .append("").append(i).toString(), 106, true);
  10662. }
  10663.  
  10664. public void drawRun07() {
  10665. String s = (new StringBuilder()).append(signlink.findcachedir())
  10666. .append("/Sprites/Frame/").toString();
  10667. ORBS[0] = new Sprite((new StringBuilder()).append(s)
  10668. .append("ORBS 0.png").toString(), 27, getOrbFill(100));
  10669. if (energy != 100)
  10670. ORBS[0].drawSprite(53, 124);
  10671. runClicked = anIntArray1045[173] == 1;
  10672. ORBS[runHover ? 12 : 12].drawSprite(25, 120);
  10673. ORBS[runClicked ? 11 : 10].drawSprite(53, 124);
  10674. ORBS[runClicked ? 9 : 8].drawSprite(59, 128);
  10675. smallText.method382(getOrbTextColor(100), 40, "100", 146, true);
  10676. }
  10677.  
  10678. public void drawHP07() {
  10679. int health;
  10680. String OrbDirectory = signlink.findcachedir()
  10681. + "/Sprites/Gameframe/Orbs/";
  10682. String cHP = RSInterface.interfaceCache[4016].message;
  10683. cHP = cHP.replaceAll("%", "");
  10684. int currentHP = Integer.parseInt(cHP);
  10685. String mHP = RSInterface.interfaceCache[4017].message;
  10686. mHP = mHP.replaceAll("%", "");
  10687. int maxHP2 = Integer.parseInt(mHP);
  10688. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  10689. ORBS[0] = new Sprite(OrbDirectory + "ORBS 0.PNG", 27,
  10690. getOrbFill(health));
  10691. ORBS[12].drawSprite(0, 40);
  10692. ORBS[2].drawSprite(27, 45);
  10693. ORBS[0].drawSprite(27, 45);
  10694. if (health <= 20) {
  10695. if (loopCycle % 20 < 10) {
  10696. ORBS[3].drawSprite(33, 52);
  10697. }
  10698. } else {
  10699. ORBS[3].drawSprite(33, 52);
  10700. }
  10701. smallText.method382(getOrbTextColor(health), 17, currentHP + "", 66,
  10702. true);
  10703. }
  10704.  
  10705. public void draw07Orbs() {
  10706. drawHP07();
  10707. drawPrayer07();
  10708. }
  10709.  
  10710. public void drawRunOrb() {
  10711. String s = (new StringBuilder()).append(signlink.findcachedir())
  10712. .append("/Sprites/Frame/").toString();
  10713. ORBS[0] = new Sprite((new StringBuilder()).append(s)
  10714. .append("ORBS 0.png").toString(), 27, getOrbFill(100));
  10715. if (energy != 100)
  10716. ORBS[0].drawSprite(193, 95);
  10717. runClicked = anIntArray1045[173] == 1;
  10718. ORBS[runHover ? 7 : 1].drawSprite(190, 92);
  10719. ORBS[runClicked ? 11 : 10].drawSprite(193, 95);
  10720. ORBS[runClicked ? 9 : 8].drawSprite(199, 100);
  10721. smallText.method382(getOrbTextColor(100), 232, "100", 119, true);
  10722. }
  10723.  
  10724. public void drawHP() {
  10725. int health;
  10726. String OrbDirectory = signlink.findcachedir()
  10727. + "/Sprites/Gameframe/Orbs/";
  10728. String cHP = RSInterface.interfaceCache[4016].message;
  10729. cHP = cHP.replaceAll("%", "");
  10730. int currentHP = Integer.parseInt(cHP);
  10731. String mHP = RSInterface.interfaceCache[4017].message;
  10732. mHP = mHP.replaceAll("%", "");
  10733. int maxHP2 = Integer.parseInt(mHP);
  10734. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  10735. ORBS[0] = new Sprite(OrbDirectory + "ORBS 0.PNG", 27,
  10736. getOrbFill(health));
  10737. ORBS[1].drawSprite(174, 14);
  10738.  
  10739. ORBS[2].drawSprite(177, 17);
  10740. ORBS[0].drawSprite(177, 17);
  10741. if (health <= 20) {
  10742. if (loopCycle % 20 < 10) {
  10743. ORBS[3].drawSprite(183, 25);
  10744. }
  10745. } else {
  10746. ORBS[3].drawSprite(183, 25);
  10747. }
  10748. int Y = 42;
  10749. smallText.method382(getOrbTextColor(health), 218, currentHP + "", Y,
  10750. true);
  10751. }
  10752.  
  10753. public void loadExtraSprites() {
  10754. for (int k = 1; k <= 15; k++)
  10755. ORBS[k] = new Sprite((new StringBuilder()).append("Frame/ORBS ")
  10756. .append(k).append("").toString());
  10757. }
  10758.  
  10759. public void World508() {
  10760. worldMapIcon508.drawSprite(8, 124);
  10761. }
  10762.  
  10763. public void World525() {
  10764. worldMapIcon525.drawSprite(8, 124);
  10765. }
  10766.  
  10767. @SuppressWarnings("unused")
  10768. private void rightClickMapArea() {
  10769. if (super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1
  10770. && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
  10771. menuActionName[1] = "Logout";
  10772. menuActionID[1] = 1004;
  10773. menuActionRow = 2;
  10774. } else if (super.mouseX > 713 && super.mouseX < 765
  10775. && super.mouseY > 83 && super.mouseY < 118) {
  10776. menuActionName[1] = "Run";
  10777. menuActionID[1] = 1051;
  10778. menuActionRow = 2;
  10779. }
  10780. }
  10781.  
  10782. public void npcScreenPos(Entity entity, int i) {
  10783. calcEntityScreenPos(entity.x, i, entity.y);
  10784. }
  10785.  
  10786. public void calcEntityScreenPos(int i, int j, int l) {
  10787. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  10788. spriteDrawX = -1;
  10789. spriteDrawY = -1;
  10790. return;
  10791. }
  10792. int i1 = method42(plane, l, i) - j;
  10793. i -= xCameraPos;
  10794. i1 -= zCameraPos;
  10795. l -= yCameraPos;
  10796. int j1 = Model.modelIntArray1[yCameraCurve];
  10797. int k1 = Model.modelIntArray2[yCameraCurve];
  10798. int l1 = Model.modelIntArray1[xCameraCurve];
  10799. int i2 = Model.modelIntArray2[xCameraCurve];
  10800. int j2 = l * l1 + i * i2 >> 16;
  10801. l = l * i2 - i * l1 >> 16;
  10802. i = j2;
  10803. j2 = i1 * k1 - l * j1 >> 16;
  10804. l = i1 * j1 + l * k1 >> 16;
  10805. i1 = j2;
  10806. if (l >= 50) {
  10807. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  10808. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  10809. } else {
  10810. spriteDrawX = -1;
  10811. spriteDrawY = -1;
  10812. }
  10813. }
  10814.  
  10815. private void buildSplitPrivateChatMenu() {
  10816. if (splitPrivateChat == 0)
  10817. return;
  10818. int i = 0;
  10819. if (anInt1104 != 0)
  10820. i = 1;
  10821. for (int j = 0; j < 100; j++)
  10822. if (chatMessages[j] != null) {
  10823. int k = chatTypes[j];
  10824. String s = chatNames[j];
  10825. if (s != null && s.startsWith("@cr1@")) {
  10826. s = s.substring(5);
  10827. }
  10828. if (s != null && s.startsWith("@cr2@")) {
  10829. s = s.substring(5);
  10830. }
  10831. if (s != null && s.startsWith("@cr3@")) {
  10832. s = s.substring(5);
  10833. }
  10834. if (s != null && s.startsWith("@cr4@")) {
  10835. s = s.substring(5);
  10836. }
  10837. if (s != null && s.startsWith("@cr5@")) {
  10838. s = s.substring(5);
  10839. }
  10840. if (s != null && s.startsWith("@cr6@")) {
  10841. s = s.substring(5);
  10842. }
  10843. if ((k == 3 || k == 7)
  10844. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  10845. && isFriendOrSelf(s))) {
  10846. int l = 329 - i * 13;
  10847. if (super.mouseX > 4 && super.mouseY - 4 > l - 10
  10848. && super.mouseY - 4 <= l + 3) {
  10849. int i1 = aTextDrawingArea_1271.getTextWidth("From: "
  10850. + s + chatMessages[j]) + 25;
  10851. if (i1 > 450)
  10852. i1 = 450;
  10853. if (super.mouseX < 4 + i1) {
  10854. if (myPrivilege >= 1) {
  10855. menuActionName[menuActionRow] = "Report abuse @whi@"
  10856. + s;
  10857. menuActionID[menuActionRow] = 2606;
  10858. menuActionRow++;
  10859. }
  10860. menuActionName[menuActionRow] = "Add ignore @whi@"
  10861. + s;
  10862. menuActionID[menuActionRow] = 2042;
  10863. menuActionRow++;
  10864. menuActionName[menuActionRow] = "Add friend @whi@"
  10865. + s;
  10866. menuActionID[menuActionRow] = 2337;
  10867. menuActionRow++;
  10868. }
  10869. }
  10870. if (++i >= 5)
  10871. return;
  10872. }
  10873. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10874. return;
  10875. }
  10876.  
  10877. }
  10878.  
  10879. public void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  10880. int i2, int j2) {
  10881. Class30_Sub1 class30_sub1 = null;
  10882. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  10883. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  10884. .reverseGetNext()) {
  10885. if (class30_sub1_1.anInt1295 != l1
  10886. || class30_sub1_1.anInt1297 != i2
  10887. || class30_sub1_1.anInt1298 != j1
  10888. || class30_sub1_1.anInt1296 != i1)
  10889. continue;
  10890. class30_sub1 = class30_sub1_1;
  10891. break;
  10892. }
  10893.  
  10894. if (class30_sub1 == null) {
  10895. class30_sub1 = new Class30_Sub1();
  10896. class30_sub1.anInt1295 = l1;
  10897. class30_sub1.anInt1296 = i1;
  10898. class30_sub1.anInt1297 = i2;
  10899. class30_sub1.anInt1298 = j1;
  10900. method89(class30_sub1);
  10901. aClass19_1179.insertHead(class30_sub1);
  10902. }
  10903. class30_sub1.anInt1291 = k;
  10904. class30_sub1.anInt1293 = k1;
  10905. class30_sub1.anInt1292 = l;
  10906. class30_sub1.anInt1302 = j2;
  10907. class30_sub1.anInt1294 = j;
  10908. }
  10909.  
  10910. private boolean interfaceIsSelected(RSInterface class9) {
  10911. if (class9.anIntArray245 == null)
  10912. return false;
  10913. for (int i = 0; i < class9.anIntArray245.length; i++) {
  10914. int j = extractInterfaceValues(class9, i);
  10915. int k = class9.anIntArray212[i];
  10916. if (class9.anIntArray245[i] == 2) {
  10917. if (j >= k)
  10918. return false;
  10919. } else if (class9.anIntArray245[i] == 3) {
  10920. if (j <= k)
  10921. return false;
  10922. } else if (class9.anIntArray245[i] == 4) {
  10923. if (j == k)
  10924. return false;
  10925. } else if (j != k)
  10926. return false;
  10927. }
  10928.  
  10929. return true;
  10930. }
  10931.  
  10932. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  10933. // if(!aBoolean872)
  10934. // if(signlink.mainapp != null)
  10935. // return signlink.openurl(s);
  10936. // else
  10937. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10938. if (aSocket832 != null) {
  10939. try {
  10940. aSocket832.close();
  10941. } catch (Exception _ex) {
  10942. }
  10943. aSocket832 = null;
  10944. }
  10945. aSocket832 = openSocket(43595);
  10946. aSocket832.setSoTimeout(10000);
  10947. java.io.InputStream inputstream = aSocket832.getInputStream();
  10948. OutputStream outputstream = aSocket832.getOutputStream();
  10949. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10950. return new DataInputStream(inputstream);
  10951. }
  10952.  
  10953. public void doFlamesDrawing() {
  10954. char c = '\u0100';
  10955. if (anInt1040 > 0) {
  10956. for (int i = 0; i < 256; i++)
  10957. if (anInt1040 > 768)
  10958. anIntArray850[i] = method83(anIntArray851[i],
  10959. anIntArray852[i], 1024 - anInt1040);
  10960. else if (anInt1040 > 256)
  10961. anIntArray850[i] = anIntArray852[i];
  10962. else
  10963. anIntArray850[i] = method83(anIntArray852[i],
  10964. anIntArray851[i], 256 - anInt1040);
  10965.  
  10966. } else if (anInt1041 > 0) {
  10967. for (int j = 0; j < 256; j++)
  10968. if (anInt1041 > 768)
  10969. anIntArray850[j] = method83(anIntArray851[j],
  10970. anIntArray853[j], 1024 - anInt1041);
  10971. else if (anInt1041 > 256)
  10972. anIntArray850[j] = anIntArray853[j];
  10973. else
  10974. anIntArray850[j] = method83(anIntArray853[j],
  10975. anIntArray851[j], 256 - anInt1041);
  10976.  
  10977. } else {
  10978. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  10979.  
  10980. }
  10981. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  10982. aRSImageProducer_1110.anIntArray315, 0, 33920);
  10983.  
  10984. int i1 = 0;
  10985. int j1 = 1152;
  10986. for (int k1 = 1; k1 < c - 1; k1++) {
  10987. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  10988. int j2 = 22 + l1;
  10989. if (j2 < 0)
  10990. j2 = 0;
  10991. i1 += j2;
  10992. for (int l2 = j2; l2 < 128; l2++) {
  10993. int j3 = anIntArray828[i1++];
  10994. if (j3 != 0) {
  10995. int l3 = j3;
  10996. int j4 = 256 - j3;
  10997. j3 = anIntArray850[j3];
  10998. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  10999. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  11000. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  11001. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11002. } else {
  11003. j1++;
  11004. }
  11005. }
  11006.  
  11007. j1 += j2;
  11008. }
  11009.  
  11010. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  11011. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  11012. aRSImageProducer_1111.anIntArray315, 0, 33920);
  11013.  
  11014. i1 = 0;
  11015. j1 = 1176;
  11016. for (int k2 = 1; k2 < c - 1; k2++) {
  11017. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11018. int k3 = 103 - i3;
  11019. j1 += i3;
  11020. for (int i4 = 0; i4 < k3; i4++) {
  11021. int k4 = anIntArray828[i1++];
  11022. if (k4 != 0) {
  11023. int i5 = k4;
  11024. int j5 = 256 - k4;
  11025. k4 = anIntArray850[k4];
  11026. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  11027. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  11028. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  11029. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11030. } else {
  11031. j1++;
  11032. }
  11033. }
  11034.  
  11035. i1 += 128 - k3;
  11036. j1 += 128 - k3 - i3;
  11037. }
  11038.  
  11039. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11040. }
  11041.  
  11042. public void method134(Stream stream) {
  11043. int j = stream.readBits(8);
  11044. if (j < playerCount) {
  11045. for (int k = j; k < playerCount; k++)
  11046. anIntArray840[anInt839++] = playerIndices[k];
  11047.  
  11048. }
  11049. if (j > playerCount) {
  11050. signlink.reporterror(myUsername + " Too many players");
  11051. throw new RuntimeException("eek");
  11052. }
  11053. playerCount = 0;
  11054. for (int l = 0; l < j; l++) {
  11055. int i1 = playerIndices[l];
  11056. Player player = playerArray[i1];
  11057. int j1 = stream.readBits(1);
  11058. if (j1 == 0) {
  11059. playerIndices[playerCount++] = i1;
  11060. player.anInt1537 = loopCycle;
  11061. } else {
  11062. int k1 = stream.readBits(2);
  11063. if (k1 == 0) {
  11064. playerIndices[playerCount++] = i1;
  11065. player.anInt1537 = loopCycle;
  11066. anIntArray894[anInt893++] = i1;
  11067. } else if (k1 == 1) {
  11068. playerIndices[playerCount++] = i1;
  11069. player.anInt1537 = loopCycle;
  11070. int l1 = stream.readBits(3);
  11071. player.moveInDir(false, l1);
  11072. int j2 = stream.readBits(1);
  11073. if (j2 == 1)
  11074. anIntArray894[anInt893++] = i1;
  11075. } else if (k1 == 2) {
  11076. playerIndices[playerCount++] = i1;
  11077. player.anInt1537 = loopCycle;
  11078. int i2 = stream.readBits(3);
  11079. player.moveInDir(true, i2);
  11080. int k2 = stream.readBits(3);
  11081. player.moveInDir(true, k2);
  11082. int l2 = stream.readBits(1);
  11083. if (l2 == 1)
  11084. anIntArray894[anInt893++] = i1;
  11085. } else if (k1 == 3)
  11086. anIntArray840[anInt839++] = i1;
  11087. }
  11088. }
  11089. }
  11090.  
  11091. public void drawLoginScreen(boolean flag) {
  11092. resetImageProducers();
  11093. aRSImageProducer_1109.initDrawingArea();
  11094. aBackground_966.drawBackground(0, 0);
  11095. char c = '\u0168';
  11096. char c1 = '\310';
  11097. if (loginScreenState == 0) {
  11098. int i = c1 / 2 + 80;
  11099. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString,
  11100. i, true);
  11101. i = c1 / 2 - 20;
  11102. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to Ardi",
  11103. i, true);
  11104. i += 30;
  11105. int l = c / 2 - 80;
  11106. int k1 = c1 / 2 + 20;
  11107. aBackground_967.drawBackground(l - 73, k1 - 20);
  11108. chatTextDrawingArea.method382(0xffffff, l, "About Ardi", k1 + 5,
  11109. true);
  11110. l = c / 2 + 80;
  11111. aBackground_967.drawBackground(l - 73, k1 - 20);
  11112. chatTextDrawingArea.method382(0xffffff, l, "Play Ardi", k1 + 5,
  11113. true);
  11114. }
  11115. if (loginScreenState == 2) {
  11116. int j = c1 / 2 - 40;
  11117. if (loginMessage1.length() > 0) {
  11118. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1,
  11119. j - 15, true);
  11120. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2,
  11121. j, true);
  11122. j += 30;
  11123. } else {
  11124. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2,
  11125. j - 7, true);
  11126. j += 30;
  11127. }
  11128. chatTextDrawingArea
  11129. .method389(true, c / 2 - 90, 0xffffff, "Username: "
  11130. + capitalize(myUsername)
  11131. + ((loginScreenCursorPos == 0)
  11132. & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11133. // chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff,
  11134. // "Username: " + myUsername + ((loginScreenCursorPos == 0) &
  11135. // (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11136. j += 15;
  11137. chatTextDrawingArea
  11138. .method389(true, c / 2 - 88, 0xffffff, "Password: "
  11139. + TextClass.passwordAsterisks(myPassword)
  11140. + ((loginScreenCursorPos == 1)
  11141. & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11142. j += 15;
  11143. if (!flag) {
  11144. int i1 = c / 2 - 80;
  11145. int l1 = c1 / 2 + 50;
  11146. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  11147. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5,
  11148. true);
  11149. i1 = c / 2 + 80;
  11150. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  11151. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5,
  11152. true);
  11153. }
  11154. }
  11155. if (loginScreenState == 3) {
  11156. chatTextDrawingArea.method382(0xffff00, c / 2, "Information",
  11157. c1 / 2 - 60, true);
  11158. int k = c1 / 2 - 35;
  11159. chatTextDrawingArea.method382(0xffffff, c / 2,
  11160. "Ardi is an Oldschool", k, true);
  11161. k += 15;
  11162. chatTextDrawingArea.method382(0xffffff, c / 2,
  11163. "Economy and Pking server", k, true);
  11164. k += 15;
  11165. chatTextDrawingArea.method382(0xffffff, c / 2,
  11166. "aimed to provide a fun", k, true);
  11167. k += 15;
  11168. chatTextDrawingArea.method382(0xffffff, c / 2,
  11169. "and enjoyable game experience", k, true);
  11170. k += 15;
  11171. int j1 = c / 2;
  11172. int i2 = c1 / 2 + 50;
  11173. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  11174. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  11175. }
  11176. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  11177. if (welcomeScreenRaised) {
  11178. welcomeScreenRaised = false;
  11179. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  11180. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  11181. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  11182. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  11183. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  11184. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  11185. }
  11186. }
  11187.  
  11188. public void drawFlames() {
  11189. drawingFlames = true;
  11190. try {
  11191. long l = System.currentTimeMillis();
  11192. int i = 0;
  11193. int j = 20;
  11194. while (aBoolean831) {
  11195. anInt1208++;
  11196. calcFlamesPosition();
  11197. calcFlamesPosition();
  11198. doFlamesDrawing();
  11199. if (++i > 10) {
  11200. long l1 = System.currentTimeMillis();
  11201. int k = (int) (l1 - l) / 10 - j;
  11202. j = 40 - k;
  11203. if (j < 5)
  11204. j = 5;
  11205. i = 0;
  11206. l = l1;
  11207. }
  11208. try {
  11209. Thread.sleep(j);
  11210. } catch (Exception _ex) {
  11211. }
  11212. }
  11213. } catch (Exception _ex) {
  11214. }
  11215. drawingFlames = false;
  11216. }
  11217.  
  11218. @Override
  11219. public void raiseWelcomeScreen() {
  11220. welcomeScreenRaised = true;
  11221. }
  11222.  
  11223. public void method137(Stream stream, int j) {
  11224. if (j == 84) {
  11225. int k = stream.readUnsignedByte();
  11226. int j3 = anInt1268 + (k >> 4 & 7);
  11227. int i6 = anInt1269 + (k & 7);
  11228. int l8 = stream.readUnsignedWord();
  11229. int k11 = stream.readUnsignedWord();
  11230. int l13 = stream.readUnsignedWord();
  11231. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  11232. NodeList class19_1 = groundArray[plane][j3][i6];
  11233. if (class19_1 != null) {
  11234. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  11235. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  11236. .reverseGetNext()) {
  11237. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  11238. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11239. continue;
  11240. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11241. break;
  11242. }
  11243.  
  11244. spawnGroundItem(j3, i6);
  11245. }
  11246. }
  11247. return;
  11248. }
  11249. if (j == 105) {
  11250. int l = stream.readUnsignedByte();
  11251. int k3 = anInt1268 + (l >> 4 & 7);
  11252. int j6 = anInt1269 + (l & 7);
  11253. int i9 = stream.readUnsignedWord();
  11254. int l11 = stream.readUnsignedByte();
  11255. int i14 = l11 >> 4 & 0xf;
  11256. int i16 = l11 & 7;
  11257. if (myPlayer.smallX[0] >= k3 - i14
  11258. && myPlayer.smallX[0] <= k3 + i14
  11259. && myPlayer.smallY[0] >= j6 - i14
  11260. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  11261. && anInt1062 < 50) {
  11262. anIntArray1207[anInt1062] = i9;
  11263. anIntArray1241[anInt1062] = i16;
  11264. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11265. anInt1062++;
  11266. }
  11267. }
  11268. if (j == 215) {
  11269. int i1 = stream.method435();
  11270. int l3 = stream.method428();
  11271. int k6 = anInt1268 + (l3 >> 4 & 7);
  11272. int j9 = anInt1269 + (l3 & 7);
  11273. int i12 = stream.method435();
  11274. int j14 = stream.readUnsignedWord();
  11275. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  11276. && i12 != unknownInt10) {
  11277. Item class30_sub2_sub4_sub2_2 = new Item();
  11278. class30_sub2_sub4_sub2_2.ID = i1;
  11279. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11280. if (groundArray[plane][k6][j9] == null)
  11281. groundArray[plane][k6][j9] = new NodeList();
  11282. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11283. spawnGroundItem(k6, j9);
  11284. }
  11285. return;
  11286. }
  11287. if (j == 156) {
  11288. int j1 = stream.method426();
  11289. int i4 = anInt1268 + (j1 >> 4 & 7);
  11290. int l6 = anInt1269 + (j1 & 7);
  11291. int k9 = stream.readUnsignedWord();
  11292. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  11293. NodeList class19 = groundArray[plane][i4][l6];
  11294. if (class19 != null) {
  11295. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  11296. .reverseGetNext()) {
  11297. if (item.ID != (k9 & 0x7fff))
  11298. continue;
  11299. item.unlink();
  11300. break;
  11301. }
  11302.  
  11303. if (class19.reverseGetFirst() == null)
  11304. groundArray[plane][i4][l6] = null;
  11305. spawnGroundItem(i4, l6);
  11306. }
  11307. }
  11308. return;
  11309. }
  11310. if (j == 160) {
  11311. int k1 = stream.method428();
  11312. int j4 = anInt1268 + (k1 >> 4 & 7);
  11313. int i7 = anInt1269 + (k1 & 7);
  11314. int l9 = stream.method428();
  11315. int j12 = l9 >> 2;
  11316. int k14 = l9 & 3;
  11317. int j16 = anIntArray1177[j12];
  11318. int j17 = stream.method435();
  11319. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  11320. int j18 = intGroundArray[plane][j4][i7];
  11321. int i19 = intGroundArray[plane][j4 + 1][i7];
  11322. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11323. int k20 = intGroundArray[plane][j4][i7 + 1];
  11324. if (j16 == 0) {
  11325. Object1 class10 = worldController.method296(plane, j4, i7);
  11326. if (class10 != null) {
  11327. int k21 = class10.uid >> 14 & 0x7fff;
  11328. if (j12 == 2) {
  11329. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11330. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  11331. false);
  11332. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  11333. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  11334. j17, false);
  11335. } else {
  11336. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11337. k21, k14, j12, i19, l19, j18, k20, j17,
  11338. false);
  11339. }
  11340. }
  11341. }
  11342. if (j16 == 1) {
  11343. Object2 class26 = worldController.method297(j4, i7, plane);
  11344. if (class26 != null)
  11345. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  11346. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  11347. j18, k20, j17, false);
  11348. }
  11349. if (j16 == 2) {
  11350. Object5 class28 = worldController.method298(j4, i7, plane);
  11351. if (j12 == 11)
  11352. j12 = 10;
  11353. if (class28 != null)
  11354. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  11355. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  11356. j18, k20, j17, false);
  11357. }
  11358. if (j16 == 3) {
  11359. Object3 class49 = worldController.method299(i7, j4, plane);
  11360. if (class49 != null)
  11361. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  11362. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  11363. j18, k20, j17, false);
  11364. }
  11365. }
  11366. return;
  11367. }
  11368. if (j == 147) {
  11369. int l1 = stream.method428();
  11370. int k4 = anInt1268 + (l1 >> 4 & 7);
  11371. int j7 = anInt1269 + (l1 & 7);
  11372. int i10 = stream.readUnsignedWord();
  11373. byte byte0 = stream.method430();
  11374. int l14 = stream.method434();
  11375. byte byte1 = stream.method429();
  11376. int k17 = stream.readUnsignedWord();
  11377. int k18 = stream.method428();
  11378. int j19 = k18 >> 2;
  11379. int i20 = k18 & 3;
  11380. int l20 = anIntArray1177[j19];
  11381. byte byte2 = stream.readSignedByte();
  11382. int l21 = stream.readUnsignedWord();
  11383. byte byte3 = stream.method429();
  11384. Player player;
  11385. if (i10 == unknownInt10)
  11386. player = myPlayer;
  11387. else
  11388. player = playerArray[i10];
  11389. if (player != null) {
  11390. ObjectDef class46 = ObjectDef.forID(l21);
  11391. int i22 = intGroundArray[plane][k4][j7];
  11392. int j22 = intGroundArray[plane][k4 + 1][j7];
  11393. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11394. int l22 = intGroundArray[plane][k4][j7 + 1];
  11395. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  11396. -1);
  11397. if (model != null) {
  11398. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11399. player.anInt1707 = l14 + loopCycle;
  11400. player.anInt1708 = k17 + loopCycle;
  11401. player.aModel_1714 = model;
  11402. int i23 = class46.anInt744;
  11403. int j23 = class46.anInt761;
  11404. if (i20 == 1 || i20 == 3) {
  11405. i23 = class46.anInt761;
  11406. j23 = class46.anInt744;
  11407. }
  11408. player.anInt1711 = k4 * 128 + i23 * 64;
  11409. player.anInt1713 = j7 * 128 + j23 * 64;
  11410. player.anInt1712 = method42(plane, player.anInt1713,
  11411. player.anInt1711);
  11412. if (byte2 > byte0) {
  11413. byte byte4 = byte2;
  11414. byte2 = byte0;
  11415. byte0 = byte4;
  11416. }
  11417. if (byte3 > byte1) {
  11418. byte byte5 = byte3;
  11419. byte3 = byte1;
  11420. byte1 = byte5;
  11421. }
  11422. player.anInt1719 = k4 + byte2;
  11423. player.anInt1721 = k4 + byte0;
  11424. player.anInt1720 = j7 + byte3;
  11425. player.anInt1722 = j7 + byte1;
  11426. }
  11427. }
  11428. }
  11429. if (j == 151) {
  11430. int i2 = stream.method426();
  11431. int l4 = anInt1268 + (i2 >> 4 & 7);
  11432. int k7 = anInt1269 + (i2 & 7);
  11433. int j10 = stream.method434();
  11434. int k12 = stream.method428();
  11435. int i15 = k12 >> 2;
  11436. int k16 = k12 & 3;
  11437. int l17 = anIntArray1177[i15];
  11438. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11439. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11440. return;
  11441. }
  11442. if (j == 4) {
  11443. int j2 = stream.readUnsignedByte();
  11444. int i5 = anInt1268 + (j2 >> 4 & 7);
  11445. int l7 = anInt1269 + (j2 & 7);
  11446. int k10 = stream.readUnsignedWord();
  11447. int l12 = stream.readUnsignedByte();
  11448. int j15 = stream.readUnsignedWord();
  11449. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  11450. i5 = i5 * 128 + 64;
  11451. l7 = l7 * 128 + 64;
  11452. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  11453. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  11454. i5);
  11455. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11456. }
  11457. return;
  11458. }
  11459. if (j == 44) {
  11460. int k2 = stream.method436();
  11461. int j5 = stream.readUnsignedWord();
  11462. int i8 = stream.readUnsignedByte();
  11463. int l10 = anInt1268 + (i8 >> 4 & 7);
  11464. int i13 = anInt1269 + (i8 & 7);
  11465. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  11466. Item class30_sub2_sub4_sub2_1 = new Item();
  11467. class30_sub2_sub4_sub2_1.ID = k2;
  11468. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11469. if (groundArray[plane][l10][i13] == null)
  11470. groundArray[plane][l10][i13] = new NodeList();
  11471. groundArray[plane][l10][i13]
  11472. .insertHead(class30_sub2_sub4_sub2_1);
  11473. spawnGroundItem(l10, i13);
  11474. }
  11475. return;
  11476. }
  11477. if (j == 101) {
  11478. int l2 = stream.method427();
  11479. int k5 = l2 >> 2;
  11480. int j8 = l2 & 3;
  11481. int i11 = anIntArray1177[k5];
  11482. int j13 = stream.readUnsignedByte();
  11483. int k15 = anInt1268 + (j13 >> 4 & 7);
  11484. int l16 = anInt1269 + (j13 & 7);
  11485. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11486. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11487. return;
  11488. }
  11489. if (j == 117) {
  11490. int i3 = stream.readUnsignedByte();
  11491. int l5 = anInt1268 + (i3 >> 4 & 7);
  11492. int k8 = anInt1269 + (i3 & 7);
  11493. int j11 = l5 + stream.readSignedByte();
  11494. int k13 = k8 + stream.readSignedByte();
  11495. int l15 = stream.readSignedWord();
  11496. int i17 = stream.readUnsignedWord();
  11497. int i18 = stream.readUnsignedByte() * 4;
  11498. int l18 = stream.readUnsignedByte() * 4;
  11499. int k19 = stream.readUnsignedWord();
  11500. int j20 = stream.readUnsignedWord();
  11501. int i21 = stream.readUnsignedByte();
  11502. int j21 = stream.readUnsignedByte();
  11503. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  11504. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  11505. l5 = l5 * 128 + 64;
  11506. k8 = k8 * 128 + 64;
  11507. j11 = j11 * 128 + 64;
  11508. k13 = k13 * 128 + 64;
  11509. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  11510. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  11511. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  11512. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  11513. method42(plane, k13, j11) - l18, j11);
  11514. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11515. }
  11516. }
  11517. }
  11518.  
  11519. @SuppressWarnings("unused")
  11520. private static void setLowMem() {
  11521. WorldController.lowMem = true;
  11522. Texture.lowMem = true;
  11523. lowMem = true;
  11524. ObjectManager.lowMem = true;
  11525. ObjectDef.lowMem = true;
  11526. }
  11527.  
  11528. public void method139(Stream stream) {
  11529. stream.initBitAccess();
  11530. int k = stream.readBits(8);
  11531. if (k < npcCount) {
  11532. for (int l = k; l < npcCount; l++)
  11533. anIntArray840[anInt839++] = npcIndices[l];
  11534.  
  11535. }
  11536. if (k > npcCount) {
  11537. signlink.reporterror(myUsername + " Too many npcs");
  11538. throw new RuntimeException("eek");
  11539. }
  11540. npcCount = 0;
  11541. for (int i1 = 0; i1 < k; i1++) {
  11542. int j1 = npcIndices[i1];
  11543. NPC npc = npcArray[j1];
  11544. int k1 = stream.readBits(1);
  11545. if (k1 == 0) {
  11546. npcIndices[npcCount++] = j1;
  11547. npc.anInt1537 = loopCycle;
  11548. } else {
  11549. int l1 = stream.readBits(2);
  11550. if (l1 == 0) {
  11551. npcIndices[npcCount++] = j1;
  11552. npc.anInt1537 = loopCycle;
  11553. anIntArray894[anInt893++] = j1;
  11554. } else if (l1 == 1) {
  11555. npcIndices[npcCount++] = j1;
  11556. npc.anInt1537 = loopCycle;
  11557. int i2 = stream.readBits(3);
  11558. npc.moveInDir(false, i2);
  11559. int k2 = stream.readBits(1);
  11560. if (k2 == 1)
  11561. anIntArray894[anInt893++] = j1;
  11562. } else if (l1 == 2) {
  11563. npcIndices[npcCount++] = j1;
  11564. npc.anInt1537 = loopCycle;
  11565. int j2 = stream.readBits(3);
  11566. npc.moveInDir(true, j2);
  11567. int l2 = stream.readBits(3);
  11568. npc.moveInDir(true, l2);
  11569. int i3 = stream.readBits(1);
  11570. if (i3 == 1)
  11571. anIntArray894[anInt893++] = j1;
  11572. } else if (l1 == 3)
  11573. anIntArray840[anInt839++] = j1;
  11574. }
  11575. }
  11576.  
  11577. }
  11578.  
  11579. public void processLoginScreenInput() {
  11580. if (loginScreenState == 0) {
  11581. int i = super.myWidth / 2 - 80;
  11582. int l = super.myHeight / 2 + 20;
  11583. l += 20;
  11584. if (super.clickMode3 == 1 && super.saveClickX >= i - 75
  11585. && super.saveClickX <= i + 75 && super.saveClickY >= l - 20
  11586. && super.saveClickY <= l + 20) {
  11587. loginScreenState = 3;
  11588. loginScreenCursorPos = 0;
  11589. }
  11590. i = super.myWidth / 2 + 80;
  11591. if (super.clickMode3 == 1 && super.saveClickX >= i - 75
  11592. && super.saveClickX <= i + 75 && super.saveClickY >= l - 20
  11593. && super.saveClickY <= l + 20) {
  11594. loginMessage1 = "";
  11595. loginMessage2 = "Enter your username & password.";
  11596. loginScreenState = 2;
  11597. loginScreenCursorPos = 0;
  11598. }
  11599. } else {
  11600. if (loginScreenState == 2) {
  11601. int j = super.myHeight / 2 - 40;
  11602. j += 30;
  11603. j += 25;
  11604. if (super.clickMode3 == 1 && super.saveClickY >= j - 15
  11605. && super.saveClickY < j)
  11606. loginScreenCursorPos = 0;
  11607. j += 15;
  11608. if (super.clickMode3 == 1 && super.saveClickY >= j - 15
  11609. && super.saveClickY < j)
  11610. loginScreenCursorPos = 1;
  11611. j += 15;
  11612. int i1 = super.myWidth / 2 - 80;
  11613. int k1 = super.myHeight / 2 + 50;
  11614. k1 += 20;
  11615. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75
  11616. && super.saveClickX <= i1 + 75
  11617. && super.saveClickY >= k1 - 20
  11618. && super.saveClickY <= k1 + 20) {
  11619. loginFailures = 0;
  11620. login(myUsername, myPassword, false);
  11621. if (loggedIn)
  11622. return;
  11623. }
  11624. i1 = super.myWidth / 2 + 80;
  11625. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75
  11626. && super.saveClickX <= i1 + 75
  11627. && super.saveClickY >= k1 - 20
  11628. && super.saveClickY <= k1 + 20) {
  11629. loginScreenState = 0;
  11630. // myUsername = "";
  11631. // myPassword = "";
  11632. }
  11633. do {
  11634. int l1 = readChar(-796);
  11635. if (l1 == -1)
  11636. break;
  11637. boolean flag1 = false;
  11638. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  11639. if (l1 != validUserPassChars.charAt(i2))
  11640. continue;
  11641. flag1 = true;
  11642. break;
  11643. }
  11644.  
  11645. if (loginScreenCursorPos == 0) {
  11646. if (l1 == 8 && myUsername.length() > 0)
  11647. myUsername = myUsername.substring(0,
  11648. myUsername.length() - 1);
  11649. if (l1 == 9 || l1 == 10 || l1 == 13)
  11650. loginScreenCursorPos = 1;
  11651. if (flag1)
  11652. myUsername += (char) l1;
  11653. if (myUsername.length() > 12)
  11654. myUsername = myUsername.substring(0, 12);
  11655. } else if (loginScreenCursorPos == 1) {
  11656. if (l1 == 8 && myPassword.length() > 0)
  11657. myPassword = myPassword.substring(0,
  11658. myPassword.length() - 1);
  11659. if (l1 == 9 || l1 == 10 || l1 == 13)
  11660. loginScreenCursorPos = 0;
  11661. if (flag1)
  11662. myPassword += (char) l1;
  11663. if (myPassword.length() > 20)
  11664. myPassword = myPassword.substring(0, 20);
  11665. }
  11666. } while (true);
  11667. return;
  11668. }
  11669. if (loginScreenState == 3) {
  11670. int k = super.myWidth / 2;
  11671. int j1 = super.myHeight / 2 + 50;
  11672. j1 += 20;
  11673. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  11674. && super.saveClickX <= k + 75
  11675. && super.saveClickY >= j1 - 20
  11676. && super.saveClickY <= j1 + 20)
  11677. loginScreenState = 0;
  11678. }
  11679. }
  11680. }
  11681.  
  11682. private void markMinimap(Sprite sprite, int i, int j) {
  11683. if (revision474 == true) {
  11684. int k = viewRotation + minimapRotation & 0x7ff;
  11685. int l = i * i + j * j;
  11686. if (l > 6400)
  11687. return;
  11688. int i1 = Model.modelIntArray1[k];
  11689. int j1 = Model.modelIntArray2[k];
  11690. i1 = (i1 * 256) / (minimapZoom + 256);
  11691. j1 = (j1 * 256) / (minimapZoom + 256);
  11692. int k1 = j * i1 + i * j1 >> 16;
  11693. int l1 = j * j1 - i * i1 >> 16;
  11694. if (l > 2500) {
  11695. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4 + 30,
  11696. 83 - l1 - sprite.maxHeight / 2 - 4 + 5);
  11697. } else {
  11698. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4 + 30,
  11699. 83 - l1 - sprite.maxHeight / 2 - 4 + 5);
  11700. }
  11701. } else {
  11702. int k = viewRotation + minimapRotation & 0x7ff;
  11703. int l = i * i + j * j;
  11704. if (l > 6400)
  11705. return;
  11706. int i1 = Model.modelIntArray1[k];
  11707. int j1 = Model.modelIntArray2[k];
  11708. i1 = (i1 * 256) / (minimapZoom + 256);
  11709. j1 = (j1 * 256) / (minimapZoom + 256);
  11710. int k1 = j * i1 + i * j1 >> 16;
  11711. int l1 = j * j1 - i * i1 >> 16;
  11712. try {
  11713. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4 + 20,
  11714. 83 - l1 - sprite.maxHeight / 2 - 4 + 5);
  11715. } catch (Exception e) {
  11716. e.printStackTrace();
  11717. return;
  11718. }
  11719. }
  11720. }
  11721.  
  11722. public void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  11723. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  11724. if (lowMem && j != plane)
  11725. return;
  11726. int i2 = 0;
  11727. if (j1 == 0)
  11728. i2 = worldController.method300(j, i1, i);
  11729. if (j1 == 1)
  11730. i2 = worldController.method301(j, i1, i);
  11731. if (j1 == 2)
  11732. i2 = worldController.method302(j, i1, i);
  11733. if (j1 == 3)
  11734. i2 = worldController.method303(j, i1, i);
  11735. if (i2 != 0) {
  11736. int i3 = worldController.method304(j, i1, i, i2);
  11737. int j2 = i2 >> 14 & 0x7fff;
  11738. int k2 = i3 & 0x1f;
  11739. int l2 = i3 >> 6;
  11740. if (j1 == 0) {
  11741. worldController.method291(i1, j, i, (byte) -119);
  11742. ObjectDef class46 = ObjectDef.forID(j2);
  11743. if (class46.aBoolean767)
  11744. aClass11Array1230[j].method215(l2, k2,
  11745. class46.aBoolean757, i1, i);
  11746. }
  11747. if (j1 == 1)
  11748. worldController.method292(i, j, i1);
  11749. if (j1 == 2) {
  11750. worldController.method293(j, i1, i);
  11751. ObjectDef class46_1 = ObjectDef.forID(j2);
  11752. if (i1 + class46_1.anInt744 > 103
  11753. || i + class46_1.anInt744 > 103
  11754. || i1 + class46_1.anInt761 > 103
  11755. || i + class46_1.anInt761 > 103)
  11756. return;
  11757. if (class46_1.aBoolean767)
  11758. aClass11Array1230[j].method216(l2, class46_1.anInt744,
  11759. i1, i, class46_1.anInt761,
  11760. class46_1.aBoolean757);
  11761. }
  11762. if (j1 == 3) {
  11763. worldController.method294(j, i, i1);
  11764. ObjectDef class46_2 = ObjectDef.forID(j2);
  11765. if (class46_2.aBoolean767 && class46_2.hasActions)
  11766. aClass11Array1230[j].method218(i, i1);
  11767. }
  11768. }
  11769. if (k1 >= 0) {
  11770. int j3 = j;
  11771. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11772. j3++;
  11773. ObjectManager.method188(worldController, k, i, l, j3,
  11774. aClass11Array1230[j], intGroundArray, i1, k1, j);
  11775. }
  11776. }
  11777. }
  11778.  
  11779. public void updatePlayers(int i, Stream stream) {
  11780. anInt839 = 0;
  11781. anInt893 = 0;
  11782. method117(stream);
  11783. method134(stream);
  11784. method91(stream, i);
  11785. method49(stream);
  11786. for (int k = 0; k < anInt839; k++) {
  11787. int l = anIntArray840[k];
  11788. if (playerArray[l].anInt1537 != loopCycle)
  11789. playerArray[l] = null;
  11790. }
  11791.  
  11792. if (stream.currentOffset != i) {
  11793. signlink.reporterror("Error packet size mismatch in getplayer pos:"
  11794. + stream.currentOffset + " psize:" + i);
  11795. throw new RuntimeException("eek");
  11796. }
  11797. for (int i1 = 0; i1 < playerCount; i1++)
  11798. if (playerArray[playerIndices[i1]] == null) {
  11799. signlink.reporterror(myUsername
  11800. + " null entry in pl list - pos:" + i1 + " size:"
  11801. + playerCount);
  11802. throw new RuntimeException("eek");
  11803. }
  11804.  
  11805. }
  11806.  
  11807. public void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  11808. int l1 = 2048 - k & 0x7ff;
  11809. int i2 = 2048 - j1 & 0x7ff;
  11810. int j2 = 0;
  11811. int k2 = 0;
  11812. int l2 = j;
  11813. if (l1 != 0) {
  11814. int i3 = Model.modelIntArray1[l1];
  11815. int k3 = Model.modelIntArray2[l1];
  11816. int i4 = k2 * k3 - l2 * i3 >> 16;
  11817. l2 = k2 * i3 + l2 * k3 >> 16;
  11818. k2 = i4;
  11819. }
  11820. if (i2 != 0) {
  11821. /*
  11822. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  11823. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  11824. * l2 = fwdbwd; }
  11825. */
  11826. int j3 = Model.modelIntArray1[i2];
  11827. int l3 = Model.modelIntArray2[i2];
  11828. int j4 = l2 * j3 + j2 * l3 >> 16;
  11829. l2 = l2 * l3 - j2 * j3 >> 16;
  11830. j2 = j4;
  11831. }
  11832. xCameraPos = l - j2;
  11833. zCameraPos = i1 - k2;
  11834. yCameraPos = k1 - l2;
  11835. yCameraCurve = k;
  11836. xCameraCurve = j1;
  11837. }
  11838.  
  11839. public void updateStrings(String str, int i) {
  11840. switch (i) {
  11841. case 1675:
  11842. sendFrame126(str, 17508);
  11843. break;// Stab
  11844. case 1676:
  11845. sendFrame126(str, 17509);
  11846. break;// Slash
  11847. case 1678:
  11848. sendFrame126(str, 17511);
  11849. break;// Magic
  11850. case 1679:
  11851. sendFrame126(str, 17512);
  11852. break;// Range
  11853. case 1680:
  11854. sendFrame126(str, 17513);
  11855. break;// Stab
  11856. case 1681:
  11857. sendFrame126(str, 17514);
  11858. break;// Slash
  11859. case 1682:
  11860. sendFrame126(str, 17515);
  11861. break;// Crush
  11862. case 1683:
  11863. sendFrame126(str, 17516);
  11864. break;// Magic
  11865. case 1684:
  11866. sendFrame126(str, 17517);
  11867. break;// Range
  11868. case 1686:
  11869. sendFrame126(str, 17518);
  11870. break;// Strength
  11871. case 1687:
  11872. sendFrame126(str, 17519);
  11873. break;// Prayer
  11874. }
  11875. }
  11876.  
  11877. public void sendFrame126(String str, int i) {
  11878. RSInterface.interfaceCache[i].message = str;
  11879. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  11880. needDrawTabArea = true;
  11881. }
  11882.  
  11883. public void sendPacket185(int button, int toggle, int type) {
  11884. switch (type) {
  11885. case 135:
  11886. RSInterface class9 = RSInterface.interfaceCache[button];
  11887. boolean flag8 = true;
  11888. if (class9.contentType > 0)
  11889. flag8 = promptUserForInput(class9);
  11890. if (flag8) {
  11891. stream.createFrame(185);
  11892. stream.writeWord(button);
  11893. }
  11894. break;
  11895. case 646:
  11896. stream.createFrame(185);
  11897. stream.writeWord(button);
  11898. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11899. if (class9_2.valueIndexArray != null
  11900. && class9_2.valueIndexArray[0][0] == 5) {
  11901. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11902. variousSettings[toggle] = class9_2.anIntArray212[0];
  11903. method33(toggle);
  11904. needDrawTabArea = true;
  11905. }
  11906. }
  11907. break;
  11908. case 169:
  11909. stream.createFrame(185);
  11910. stream.writeWord(button);
  11911. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11912. if (class9_3.valueIndexArray != null
  11913. && class9_3.valueIndexArray[0][0] == 5) {
  11914. variousSettings[toggle] = 1 - variousSettings[toggle];
  11915. method33(toggle);
  11916. needDrawTabArea = true;
  11917. }
  11918. switch (button) {
  11919. case 19136:
  11920. System.out.println("toggle = " + toggle);
  11921. if (toggle == 0)
  11922. sendFrame36(173, toggle);
  11923. if (toggle == 1)
  11924. sendPacket185(153, 173, 646);
  11925. break;
  11926. }
  11927. break;
  11928. }
  11929. }
  11930.  
  11931. public void sendFrame36(int id, int state) {
  11932. anIntArray1045[id] = state;
  11933. if (variousSettings[id] != state) {
  11934. variousSettings[id] = state;
  11935. method33(id);
  11936. needDrawTabArea = true;
  11937. if (dialogID != -1)
  11938. inputTaken = true;
  11939. }
  11940. }
  11941.  
  11942. public void sendFrame219() {
  11943. if (invOverlayInterfaceID != -1) {
  11944. invOverlayInterfaceID = -1;
  11945. needDrawTabArea = true;
  11946. tabAreaAltered = true;
  11947. }
  11948. if (backDialogID != -1) {
  11949. backDialogID = -1;
  11950. inputTaken = true;
  11951. }
  11952. if (inputDialogState != 0) {
  11953. inputDialogState = 0;
  11954. inputTaken = true;
  11955. }
  11956. openInterfaceID = -1;
  11957. aBoolean1149 = false;
  11958. }
  11959.  
  11960. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  11961. if (backDialogID != -1) {
  11962. backDialogID = -1;
  11963. inputTaken = true;
  11964. }
  11965. if (inputDialogState != 0) {
  11966. inputDialogState = 0;
  11967. inputTaken = true;
  11968. }
  11969. openInterfaceID = interfaceID;
  11970. invOverlayInterfaceID = sideInterfaceID;
  11971. needDrawTabArea = true;
  11972. tabAreaAltered = true;
  11973. aBoolean1149 = false;
  11974. }
  11975.  
  11976. private boolean parsePacket() {
  11977. if (socketStream == null)
  11978. return false;
  11979. try {
  11980. int i = socketStream.available();
  11981. if (i == 0)
  11982. return false;
  11983. if (pktType == -1) {
  11984. socketStream.flushInputStream(inStream.buffer, 1);
  11985. pktType = inStream.buffer[0] & 0xff;
  11986. if (encryption != null)
  11987. pktType = pktType - encryption.getNextKey() & 0xff;
  11988. pktSize = SizeConstants.packetSizes[pktType];
  11989. i--;
  11990. }
  11991. if (pktSize == -1)
  11992. if (i > 0) {
  11993. socketStream.flushInputStream(inStream.buffer, 1);
  11994. pktSize = inStream.buffer[0] & 0xff;
  11995. i--;
  11996. } else {
  11997. return false;
  11998. }
  11999. if (pktSize == -2)
  12000. if (i > 1) {
  12001. socketStream.flushInputStream(inStream.buffer, 2);
  12002. inStream.currentOffset = 0;
  12003. pktSize = inStream.readUnsignedWord();
  12004. i -= 2;
  12005. } else {
  12006. return false;
  12007. }
  12008. if (i < pktSize)
  12009. return false;
  12010. inStream.currentOffset = 0;
  12011. socketStream.flushInputStream(inStream.buffer, pktSize);
  12012. anInt1009 = 0;
  12013. anInt843 = anInt842;
  12014. anInt842 = anInt841;
  12015. anInt841 = pktType;
  12016. switch (pktType) {
  12017. case 81:
  12018. updatePlayers(pktSize, inStream);
  12019. aBoolean1080 = false;
  12020. pktType = -1;
  12021. return true;
  12022.  
  12023. case 176:
  12024. daysSinceRecovChange = inStream.method427();
  12025. unreadMessages = inStream.method435();
  12026. membersInt = inStream.readUnsignedByte();
  12027. anInt1193 = inStream.method440();
  12028. daysSinceLastLogin = inStream.readUnsignedWord();
  12029. if (anInt1193 != 0 && openInterfaceID == -1) {
  12030. signlink.dnslookup(TextClass.method586(anInt1193));
  12031. clearTopInterfaces();
  12032. char c = '\u028A';
  12033. if (daysSinceRecovChange != 201 || membersInt == 1)
  12034. c = '\u028F';
  12035. reportAbuseInput = "";
  12036. canMute = false;
  12037. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  12038. if (RSInterface.interfaceCache[k9] == null
  12039. || RSInterface.interfaceCache[k9].contentType != c)
  12040. continue;
  12041. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  12042.  
  12043. }
  12044. }
  12045. pktType = -1;
  12046. return true;
  12047.  
  12048. case 64:
  12049. anInt1268 = inStream.method427();
  12050. anInt1269 = inStream.method428();
  12051. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  12052. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  12053. if (groundArray[plane][j][l9] != null) {
  12054. groundArray[plane][j][l9] = null;
  12055. spawnGroundItem(j, l9);
  12056. }
  12057. }
  12058. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  12059. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  12060. .reverseGetNext())
  12061. if (class30_sub1.anInt1297 >= anInt1268
  12062. && class30_sub1.anInt1297 < anInt1268 + 8
  12063. && class30_sub1.anInt1298 >= anInt1269
  12064. && class30_sub1.anInt1298 < anInt1269 + 8
  12065. && class30_sub1.anInt1295 == plane)
  12066. class30_sub1.anInt1294 = 0;
  12067. pktType = -1;
  12068. return true;
  12069.  
  12070. case 185:
  12071. int k = inStream.method436();
  12072. RSInterface.interfaceCache[k].anInt233 = 3;
  12073. if (myPlayer.desc == null)
  12074. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  12075. + (myPlayer.anIntArray1700[4] << 20)
  12076. + (myPlayer.equipment[0] << 15)
  12077. + (myPlayer.equipment[8] << 10)
  12078. + (myPlayer.equipment[11] << 5)
  12079. + myPlayer.equipment[1];
  12080. else
  12081. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  12082. pktType = -1;
  12083. return true;
  12084.  
  12085. /* Clan message packet */
  12086. case 217:
  12087. try {
  12088. clanUsername = inStream.readString();
  12089. clanMessage = TextInput.processText(inStream.readString());
  12090. clanTitle = inStream.readString();
  12091. channelRights = inStream.readUnsignedWord();
  12092. pushMessage(clanMessage, 12, clanUsername);
  12093. } catch (Exception e) {
  12094. e.printStackTrace();
  12095. }
  12096. pktType = -1;
  12097. return true;
  12098.  
  12099. case 107:
  12100. aBoolean1160 = false;
  12101. for (int l = 0; l < 5; l++)
  12102. aBooleanArray876[l] = false;
  12103. pktType = -1;
  12104. return true;
  12105.  
  12106. case 72:
  12107. int i1 = inStream.method434();
  12108. RSInterface class9 = RSInterface.interfaceCache[i1];
  12109. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  12110. class9.inv[k15] = -1;
  12111. class9.inv[k15] = 0;
  12112. }
  12113. pktType = -1;
  12114. return true;
  12115.  
  12116. case 214:
  12117. ignoreCount = pktSize / 8;
  12118. for (int j1 = 0; j1 < ignoreCount; j1++)
  12119. ignoreListAsLongs[j1] = inStream.readQWord();
  12120. pktType = -1;
  12121. return true;
  12122.  
  12123. case 166:
  12124. aBoolean1160 = true;
  12125. anInt1098 = inStream.readUnsignedByte();
  12126. anInt1099 = inStream.readUnsignedByte();
  12127. anInt1100 = inStream.readUnsignedWord();
  12128. anInt1101 = inStream.readUnsignedByte();
  12129. anInt1102 = inStream.readUnsignedByte();
  12130. if (anInt1102 >= 100) {
  12131. xCameraPos = anInt1098 * 128 + 64;
  12132. yCameraPos = anInt1099 * 128 + 64;
  12133. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  12134. - anInt1100;
  12135. }
  12136. pktType = -1;
  12137. return true;
  12138.  
  12139. case 134:
  12140. needDrawTabArea = true;
  12141. int k1 = inStream.readUnsignedByte();
  12142. int i10 = inStream.method439();
  12143. int l15 = inStream.readUnsignedByte();
  12144. int xp = currentExp[k1];
  12145. currentExp[k1] = i10;
  12146. currentStats[k1] = l15;
  12147. maxStats[k1] = 1;
  12148. //xpCounter += currentExp[k1] - xp;
  12149. //expAdded = currentExp[k1] - xp;
  12150. for (int k20 = 0; k20 < 98; k20++)
  12151. if (i10 >= anIntArray1019[k20])
  12152. maxStats[k1] = k20 + 2;
  12153. pktType = -1;
  12154. return true;
  12155.  
  12156. case 71:
  12157. int l1 = inStream.readUnsignedWord();
  12158. int j10 = inStream.method426();
  12159. if (l1 == 65535)
  12160. l1 = -1;
  12161. tabInterfaceIDs[j10] = l1;
  12162. needDrawTabArea = true;
  12163. tabAreaAltered = true;
  12164. pktType = -1;
  12165. return true;
  12166.  
  12167. case 74:
  12168. int i2 = inStream.method434();
  12169. if (i2 == 65535)
  12170. i2 = -1;
  12171. if (i2 != currentSong && musicEnabled && !lowMem
  12172. && prevSong == 0) {
  12173. nextSong = i2;
  12174. songChanging = true;
  12175. onDemandFetcher.method558(2, nextSong);
  12176. }
  12177. currentSong = i2;
  12178. pktType = -1;
  12179. return true;
  12180.  
  12181. case 121:
  12182. int j2 = inStream.method436();
  12183. int k10 = inStream.method435();
  12184. if (musicEnabled && !lowMem) {
  12185. nextSong = j2;
  12186. songChanging = false;
  12187. onDemandFetcher.method558(2, nextSong);
  12188. prevSong = k10;
  12189. }
  12190. pktType = -1;
  12191. return true;
  12192.  
  12193. case 109:
  12194. resetLogout();
  12195. pktType = -1;
  12196. return false;
  12197.  
  12198. case 70:
  12199. int k2 = inStream.readSignedWord();
  12200. int l10 = inStream.method437();
  12201. int i16 = inStream.method434();
  12202. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  12203. class9_5.anInt263 = k2;
  12204. class9_5.anInt265 = l10;
  12205. pktType = -1;
  12206. return true;
  12207.  
  12208. case 73:
  12209. case 241:
  12210. int l2 = anInt1069;
  12211. int i11 = anInt1070;
  12212. if (pktType == 73) {
  12213. l2 = inStream.method435();
  12214. i11 = inStream.readUnsignedWord();
  12215. aBoolean1159 = false;
  12216. }
  12217. if (pktType == 241) {
  12218. i11 = inStream.method435();
  12219. inStream.initBitAccess();
  12220. for (int j16 = 0; j16 < 4; j16++) {
  12221. for (int l20 = 0; l20 < 13; l20++) {
  12222. for (int j23 = 0; j23 < 13; j23++) {
  12223. int i26 = inStream.readBits(1);
  12224. if (i26 == 1)
  12225. anIntArrayArrayArray1129[j16][l20][j23] = inStream
  12226. .readBits(26);
  12227. else
  12228. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12229. }
  12230. }
  12231. }
  12232. inStream.finishBitAccess();
  12233. l2 = inStream.readUnsignedWord();
  12234. aBoolean1159 = true;
  12235. }
  12236. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12237. pktType = -1;
  12238. return true;
  12239. }
  12240. anInt1069 = l2;
  12241. anInt1070 = i11;
  12242. baseX = (anInt1069 - 6) * 8;
  12243. baseY = (anInt1070 - 6) * 8;
  12244. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49)
  12245. && anInt1070 / 8 == 48;
  12246. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12247. aBoolean1141 = true;
  12248. loadingStage = 1;
  12249. aLong824 = System.currentTimeMillis();
  12250. aRSImageProducer_1165.initDrawingArea();
  12251. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2);
  12252. DrawingArea.drawPixels(20, 3, 3, 0, 128);
  12253. aTextDrawingArea_1271.drawText(0, "Loading - Please Wait", 18,
  12254. 68);
  12255. aTextDrawingArea_1271.drawText(0xffffff,
  12256. "Loading - Please Wait", 17, 67);
  12257. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12258. if (pktType == 73) {
  12259. int k16 = 0;
  12260. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12261. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12262. k16++;
  12263. }
  12264. aByteArrayArray1183 = new byte[k16][];
  12265. aByteArrayArray1247 = new byte[k16][];
  12266. anIntArray1234 = new int[k16];
  12267. anIntArray1235 = new int[k16];
  12268. anIntArray1236 = new int[k16];
  12269. k16 = 0;
  12270. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12271. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12272. anIntArray1234[k16] = (l23 << 8) + j26;
  12273. if (aBoolean1141
  12274. && (j26 == 49 || j26 == 149 || j26 == 147
  12275. || l23 == 50 || l23 == 49
  12276. && j26 == 47)) {
  12277. anIntArray1235[k16] = -1;
  12278. anIntArray1236[k16] = -1;
  12279. k16++;
  12280. } else {
  12281. int k28 = anIntArray1235[k16] = onDemandFetcher
  12282. .method562(0, j26, l23);
  12283. if (k28 != -1)
  12284. onDemandFetcher.method558(3, k28);
  12285. int j30 = anIntArray1236[k16] = onDemandFetcher
  12286. .method562(1, j26, l23);
  12287. if (j30 != -1)
  12288. onDemandFetcher.method558(3, j30);
  12289. k16++;
  12290. }
  12291. }
  12292. }
  12293. }
  12294. if (pktType == 241) {
  12295. int l16 = 0;
  12296. int ai[] = new int[676];
  12297. for (int i24 = 0; i24 < 4; i24++) {
  12298. for (int k26 = 0; k26 < 13; k26++) {
  12299. for (int l28 = 0; l28 < 13; l28++) {
  12300. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12301. if (k30 != -1) {
  12302. int k31 = k30 >> 14 & 0x3ff;
  12303. int i32 = k30 >> 3 & 0x7ff;
  12304. int k32 = (k31 / 8 << 8) + i32 / 8;
  12305. for (int j33 = 0; j33 < l16; j33++) {
  12306. if (ai[j33] != k32)
  12307. continue;
  12308. k32 = -1;
  12309.  
  12310. }
  12311. if (k32 != -1)
  12312. ai[l16++] = k32;
  12313. }
  12314. }
  12315. }
  12316. }
  12317. aByteArrayArray1183 = new byte[l16][];
  12318. aByteArrayArray1247 = new byte[l16][];
  12319. anIntArray1234 = new int[l16];
  12320. anIntArray1235 = new int[l16];
  12321. anIntArray1236 = new int[l16];
  12322. for (int l26 = 0; l26 < l16; l26++) {
  12323. int i29 = anIntArray1234[l26] = ai[l26];
  12324. int l30 = i29 >> 8 & 0xff;
  12325. int l31 = i29 & 0xff;
  12326. int j32 = anIntArray1235[l26] = onDemandFetcher
  12327. .method562(0, l31, l30);
  12328. if (j32 != -1)
  12329. onDemandFetcher.method558(3, j32);
  12330. int i33 = anIntArray1236[l26] = onDemandFetcher
  12331. .method562(1, l31, l30);
  12332. if (i33 != -1)
  12333. onDemandFetcher.method558(3, i33);
  12334. }
  12335. }
  12336. int i17 = baseX - anInt1036;
  12337. int j21 = baseY - anInt1037;
  12338. anInt1036 = baseX;
  12339. anInt1037 = baseY;
  12340. for (int j24 = 0; j24 < 16384; j24++) {
  12341. NPC npc = npcArray[j24];
  12342. if (npc != null) {
  12343. for (int j29 = 0; j29 < 10; j29++) {
  12344. npc.smallX[j29] -= i17;
  12345. npc.smallY[j29] -= j21;
  12346. }
  12347. npc.x -= i17 * 128;
  12348. npc.y -= j21 * 128;
  12349. }
  12350. }
  12351. for (int i27 = 0; i27 < maxPlayers; i27++) {
  12352. Player player = playerArray[i27];
  12353. if (player != null) {
  12354. for (int i31 = 0; i31 < 10; i31++) {
  12355. player.smallX[i31] -= i17;
  12356. player.smallY[i31] -= j21;
  12357. }
  12358. player.x -= i17 * 128;
  12359. player.y -= j21 * 128;
  12360. }
  12361. }
  12362. aBoolean1080 = true;
  12363. byte byte1 = 0;
  12364. byte byte2 = 104;
  12365. byte byte3 = 1;
  12366. if (i17 < 0) {
  12367. byte1 = 103;
  12368. byte2 = -1;
  12369. byte3 = -1;
  12370. }
  12371. byte byte4 = 0;
  12372. byte byte5 = 104;
  12373. byte byte6 = 1;
  12374. if (j21 < 0) {
  12375. byte4 = 103;
  12376. byte5 = -1;
  12377. byte6 = -1;
  12378. }
  12379. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  12380. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  12381. int i34 = k33 + i17;
  12382. int j34 = l33 + j21;
  12383. for (int k34 = 0; k34 < 4; k34++)
  12384. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12385. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12386. else
  12387. groundArray[k34][k33][l33] = null;
  12388. }
  12389. }
  12390. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12391. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12392. .reverseGetNext()) {
  12393. class30_sub1_1.anInt1297 -= i17;
  12394. class30_sub1_1.anInt1298 -= j21;
  12395. if (class30_sub1_1.anInt1297 < 0
  12396. || class30_sub1_1.anInt1298 < 0
  12397. || class30_sub1_1.anInt1297 >= 104
  12398. || class30_sub1_1.anInt1298 >= 104)
  12399. class30_sub1_1.unlink();
  12400. }
  12401. if (destX != 0) {
  12402. destX -= i17;
  12403. destY -= j21;
  12404. }
  12405. aBoolean1160 = false;
  12406. pktType = -1;
  12407. return true;
  12408.  
  12409. case 208:
  12410. int i3 = inStream.method437();
  12411. if (i3 >= 0)
  12412. method60(i3);
  12413. anInt1018 = i3;
  12414. pktType = -1;
  12415. return true;
  12416.  
  12417. case 99:
  12418. /*
  12419. * Black map, mape state 2, causes blackness
  12420. */
  12421. anInt1021 = inStream.readUnsignedByte();
  12422. pktType = -1;
  12423. return true;
  12424.  
  12425. case 75:
  12426. int j3 = inStream.method436();
  12427. int j11 = inStream.method436();
  12428. RSInterface.interfaceCache[j11].anInt233 = 2;
  12429. RSInterface.interfaceCache[j11].mediaID = j3;
  12430. pktType = -1;
  12431. return true;
  12432.  
  12433. case 114:
  12434. anInt1104 = inStream.method434() * 30;
  12435. pktType = -1;
  12436. return true;
  12437.  
  12438. case 60:
  12439. anInt1269 = inStream.readUnsignedByte();
  12440. anInt1268 = inStream.method427();
  12441. while (inStream.currentOffset < pktSize) {
  12442. int k3 = inStream.readUnsignedByte();
  12443. method137(inStream, k3);
  12444. }
  12445. pktType = -1;
  12446. return true;
  12447.  
  12448. case 35:
  12449. int l3 = inStream.readUnsignedByte();
  12450. int k11 = inStream.readUnsignedByte();
  12451. int j17 = inStream.readUnsignedByte();
  12452. int k21 = inStream.readUnsignedByte();
  12453. aBooleanArray876[l3] = true;
  12454. anIntArray873[l3] = k11;
  12455. anIntArray1203[l3] = j17;
  12456. anIntArray928[l3] = k21;
  12457. anIntArray1030[l3] = 0;
  12458. pktType = -1;
  12459. return true;
  12460.  
  12461. case 174:
  12462. int i4 = inStream.readUnsignedWord();
  12463. int l11 = inStream.readUnsignedByte();
  12464. int k17 = inStream.readUnsignedWord();
  12465. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  12466. anIntArray1207[anInt1062] = i4;
  12467. anIntArray1241[anInt1062] = l11;
  12468. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  12469. anInt1062++;
  12470. }
  12471. pktType = -1;
  12472. return true;
  12473.  
  12474. case 104:
  12475. int j4 = inStream.method427();
  12476. int i12 = inStream.method426();
  12477. String s6 = inStream.readString();
  12478. if (j4 >= 1 && j4 <= 5) {
  12479. if (s6.equalsIgnoreCase("null"))
  12480. s6 = null;
  12481. atPlayerActions[j4 - 1] = s6;
  12482. atPlayerArray[j4 - 1] = i12 == 0;
  12483. }
  12484. pktType = -1;
  12485. return true;
  12486.  
  12487. case 78:
  12488. destX = 0;
  12489. pktType = -1;
  12490. return true;
  12491.  
  12492. case 253:
  12493. String s = inStream.readString();
  12494. if (s.endsWith(":tradereq:")) {
  12495. String s3 = s.substring(0, s.indexOf(":"));
  12496. long l17 = TextClass.longForName(s3);
  12497. boolean flag2 = false;
  12498. for (int j27 = 0; j27 < ignoreCount; j27++) {
  12499. if (ignoreListAsLongs[j27] != l17)
  12500. continue;
  12501. flag2 = true;
  12502. }
  12503. if (!flag2 && anInt1251 == 0)
  12504. pushMessage("wishes to trade with you.", 4, s3);
  12505. } else if (s.endsWith(":clan:")) {
  12506. String s4 = s.substring(0, s.indexOf(":"));
  12507. TextClass.longForName(s4);
  12508. pushMessage("Clan: ", 8, s4);
  12509. } else if (s.endsWith("#url#")) {
  12510. String link = s.substring(0, s.indexOf("#"));
  12511. pushMessage("Join us at: ", 9, link);
  12512. } else if (s.endsWith(":duelreq:")) {
  12513. String s4 = s.substring(0, s.indexOf(":"));
  12514. long l18 = TextClass.longForName(s4);
  12515. boolean flag3 = false;
  12516. for (int k27 = 0; k27 < ignoreCount; k27++) {
  12517. if (ignoreListAsLongs[k27] != l18)
  12518. continue;
  12519. flag3 = true;
  12520.  
  12521. }
  12522. if (!flag3 && anInt1251 == 0)
  12523. pushMessage("wishes to duel with you.", 8, s4);
  12524. } else if (s.endsWith(":chalreq:")) {
  12525. String s5 = s.substring(0, s.indexOf(":"));
  12526. long l19 = TextClass.longForName(s5);
  12527. boolean flag4 = false;
  12528. for (int l27 = 0; l27 < ignoreCount; l27++) {
  12529. if (ignoreListAsLongs[l27] != l19)
  12530. continue;
  12531. flag4 = true;
  12532.  
  12533. }
  12534. if (!flag4 && anInt1251 == 0) {
  12535. String s8 = s.substring(s.indexOf(":") + 1,
  12536. s.length() - 9);
  12537. pushMessage(s8, 8, s5);
  12538. }
  12539. } else {
  12540. pushMessage(s, 0, "");
  12541. }
  12542. pktType = -1;
  12543. return true;
  12544.  
  12545. case 1:
  12546. for (int k4 = 0; k4 < playerArray.length; k4++)
  12547. if (playerArray[k4] != null)
  12548. playerArray[k4].anim = -1;
  12549. for (int j12 = 0; j12 < npcArray.length; j12++)
  12550. if (npcArray[j12] != null)
  12551. npcArray[j12].anim = -1;
  12552. pktType = -1;
  12553. return true;
  12554.  
  12555. case 50:
  12556. long l4 = inStream.readQWord();
  12557. int i18 = inStream.readUnsignedByte();
  12558. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12559. for (int k24 = 0; k24 < friendsCount; k24++) {
  12560. if (l4 != friendsListAsLongs[k24])
  12561. continue;
  12562. if (friendsNodeIDs[k24] != i18) {
  12563. friendsNodeIDs[k24] = i18;
  12564. needDrawTabArea = true;
  12565. if (i18 >= 2) {
  12566. pushMessage(s7 + " has logged in.", 5, "");
  12567. }
  12568. if (i18 <= 1) {
  12569. pushMessage(s7 + " has logged out.", 5, "");
  12570. }
  12571. }
  12572. s7 = null;
  12573.  
  12574. }
  12575. if (s7 != null && friendsCount < 200) {
  12576. friendsListAsLongs[friendsCount] = l4;
  12577. friendsList[friendsCount] = s7;
  12578. friendsNodeIDs[friendsCount] = i18;
  12579. friendsCount++;
  12580. needDrawTabArea = true;
  12581. }
  12582. for (boolean flag6 = false; !flag6;) {
  12583. flag6 = true;
  12584. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  12585. if (friendsNodeIDs[k29] != nodeID
  12586. && friendsNodeIDs[k29 + 1] == nodeID
  12587. || friendsNodeIDs[k29] == 0
  12588. && friendsNodeIDs[k29 + 1] != 0) {
  12589. int j31 = friendsNodeIDs[k29];
  12590. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12591. friendsNodeIDs[k29 + 1] = j31;
  12592. String s10 = friendsList[k29];
  12593. friendsList[k29] = friendsList[k29 + 1];
  12594. friendsList[k29 + 1] = s10;
  12595. long l32 = friendsListAsLongs[k29];
  12596. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12597. friendsListAsLongs[k29 + 1] = l32;
  12598. needDrawTabArea = true;
  12599. flag6 = false;
  12600. }
  12601. }
  12602. pktType = -1;
  12603. return true;
  12604.  
  12605. case 110:
  12606. if (tabID == 12)
  12607. needDrawTabArea = true;
  12608. energy = inStream.readUnsignedByte();
  12609. pktType = -1;
  12610. return true;
  12611.  
  12612. case 254:
  12613. anInt855 = inStream.readUnsignedByte();
  12614. if (anInt855 == 1)
  12615. anInt1222 = inStream.readUnsignedWord();
  12616. if (anInt855 >= 2 && anInt855 <= 6) {
  12617. if (anInt855 == 2) {
  12618. anInt937 = 64;
  12619. anInt938 = 64;
  12620. }
  12621. if (anInt855 == 3) {
  12622. anInt937 = 0;
  12623. anInt938 = 64;
  12624. }
  12625. if (anInt855 == 4) {
  12626. anInt937 = 128;
  12627. anInt938 = 64;
  12628. }
  12629. if (anInt855 == 5) {
  12630. anInt937 = 64;
  12631. anInt938 = 0;
  12632. }
  12633. if (anInt855 == 6) {
  12634. anInt937 = 64;
  12635. anInt938 = 128;
  12636. }
  12637. anInt855 = 2;
  12638. anInt934 = inStream.readUnsignedWord();
  12639. anInt935 = inStream.readUnsignedWord();
  12640. anInt936 = inStream.readUnsignedByte();
  12641. }
  12642. if (anInt855 == 10)
  12643. anInt933 = inStream.readUnsignedWord();
  12644. pktType = -1;
  12645. return true;
  12646.  
  12647. case 248:
  12648. int i5 = inStream.method435();
  12649. int k12 = inStream.readUnsignedWord();
  12650. if (backDialogID != -1) {
  12651. backDialogID = -1;
  12652. inputTaken = true;
  12653. }
  12654. if (inputDialogState != 0) {
  12655. inputDialogState = 0;
  12656. inputTaken = true;
  12657. }
  12658. openInterfaceID = i5;
  12659. invOverlayInterfaceID = k12;
  12660. needDrawTabArea = true;
  12661. tabAreaAltered = true;
  12662. aBoolean1149 = false;
  12663. pktType = -1;
  12664. return true;
  12665.  
  12666. case 79:
  12667. int j5 = inStream.method434();
  12668. int l12 = inStream.method435();
  12669. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12670. if (class9_3 != null && class9_3.type == 0) {
  12671. if (l12 < 0)
  12672. l12 = 0;
  12673. if (l12 > class9_3.scrollMax - class9_3.height)
  12674. l12 = class9_3.scrollMax - class9_3.height;
  12675. class9_3.scrollPosition = l12;
  12676. }
  12677. pktType = -1;
  12678. return true;
  12679.  
  12680. case 68:
  12681. for (int k5 = 0; k5 < variousSettings.length; k5++)
  12682. if (variousSettings[k5] != anIntArray1045[k5]) {
  12683. variousSettings[k5] = anIntArray1045[k5];
  12684. method33(k5);
  12685. needDrawTabArea = true;
  12686. }
  12687. pktType = -1;
  12688. return true;
  12689.  
  12690. case 196:
  12691. long l5 = inStream.readQWord();
  12692. inStream.readDWord();
  12693. int l21 = inStream.readUnsignedByte();
  12694. boolean flag5 = false;
  12695. if (l21 <= 1) {
  12696. for (int l29 = 0; l29 < ignoreCount; l29++) {
  12697. if (ignoreListAsLongs[l29] != l5)
  12698. continue;
  12699. flag5 = true;
  12700.  
  12701. }
  12702. }
  12703. if (!flag5 && anInt1251 == 0)
  12704. try {
  12705. String s9 = TextInput.method525(pktSize - 13, inStream);
  12706. switch (l21) {
  12707. case 1:
  12708. pushMessage(
  12709. s9,
  12710. 7,
  12711. "@cr1@"
  12712. + TextClass.fixName(TextClass
  12713. .nameForLong(l5)));
  12714. break;
  12715. case 2:
  12716. pushMessage(
  12717. s9,
  12718. 7,
  12719. "@cr2@"
  12720. + TextClass.fixName(TextClass
  12721. .nameForLong(l5)));
  12722. break;
  12723. case 3:
  12724. pushMessage(
  12725. s9,
  12726. 7,
  12727. "@cr3@"
  12728. + TextClass.fixName(TextClass
  12729. .nameForLong(l5)));
  12730. break;
  12731. case 4:
  12732. pushMessage(
  12733. s9,
  12734. 7,
  12735. "@cr4@"
  12736. + TextClass.fixName(TextClass
  12737. .nameForLong(l5)));
  12738. break;
  12739. case 5:
  12740. pushMessage(
  12741. s9,
  12742. 7,
  12743. "@cr5@"
  12744. + TextClass.fixName(TextClass
  12745. .nameForLong(l5)));
  12746. break;
  12747. case 6:
  12748. pushMessage(
  12749. s9,
  12750. 7,
  12751. "@cr6@"
  12752. + TextClass.fixName(TextClass
  12753. .nameForLong(l5)));
  12754. break;
  12755. default:
  12756. pushMessage(s9, 3, TextClass.fixName(TextClass
  12757. .nameForLong(l5)));
  12758. }
  12759. } catch (Exception exception1) {
  12760. signlink.reporterror("cde1");
  12761. }
  12762. pktType = -1;
  12763. return true;
  12764.  
  12765. case 85:
  12766. anInt1269 = inStream.method427();
  12767. anInt1268 = inStream.method427();
  12768. pktType = -1;
  12769. return true;
  12770.  
  12771. case 24:
  12772. anInt1054 = inStream.method428();
  12773. if (anInt1054 == tabID) {
  12774. if (anInt1054 == 3)
  12775. tabID = 1;
  12776. else
  12777. tabID = 3;
  12778. needDrawTabArea = true;
  12779. }
  12780. pktType = -1;
  12781. return true;
  12782.  
  12783. case 246:
  12784. int i6 = inStream.method434();
  12785. int i13 = inStream.readUnsignedWord();
  12786. int k18 = inStream.readUnsignedWord();
  12787. if (k18 == 65535) {
  12788. RSInterface.interfaceCache[i6].anInt233 = 0;
  12789. pktType = -1;
  12790. return true;
  12791. } else {
  12792. ItemDef itemDef = ItemDef.forID(k18);
  12793. RSInterface.interfaceCache[i6].anInt233 = 4;
  12794. RSInterface.interfaceCache[i6].mediaID = k18;
  12795. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  12796. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  12797. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100)
  12798. / i13;
  12799. pktType = -1;
  12800. return true;
  12801. }
  12802.  
  12803. case 171:
  12804. boolean flag1 = inStream.readUnsignedByte() == 1;
  12805. int j13 = inStream.readUnsignedWord();
  12806. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  12807. pktType = -1;
  12808. return true;
  12809.  
  12810. case 142:
  12811. int j6 = inStream.method434();
  12812. method60(j6);
  12813. if (backDialogID != -1) {
  12814. backDialogID = -1;
  12815. inputTaken = true;
  12816. }
  12817. if (inputDialogState != 0) {
  12818. inputDialogState = 0;
  12819. inputTaken = true;
  12820. }
  12821. invOverlayInterfaceID = j6;
  12822. needDrawTabArea = true;
  12823. tabAreaAltered = true;
  12824. openInterfaceID = -1;
  12825. aBoolean1149 = false;
  12826. pktType = -1;
  12827. return true;
  12828.  
  12829. /*case 126:
  12830. try {
  12831. String text = inStream.readString();
  12832. int frame = inStream.method435();
  12833. if (text.startsWith("www.")) {
  12834. launchURL(text);
  12835. pktType = -1;
  12836. return true;
  12837. }
  12838. RSInterface.interfaceCache[frame].message = text;
  12839. if (RSInterface.interfaceCache[frame].parentID == tabInterfaceIDs[tabID]
  12840. || frame >= 7562 && frame <= 7586)
  12841. needDrawTabArea = true;
  12842. pktType = -1;
  12843. } catch (Exception e) {
  12844. }
  12845. pktType = -1;
  12846. return true;*/
  12847.  
  12848. case 126:
  12849. String text = inStream.readString();
  12850. int frame = inStream.method435();
  12851. if (text.startsWith("www.")) {
  12852. launchURL(text);
  12853. pktType = -1;
  12854. return true;
  12855. }
  12856. updateStrings(text, frame);
  12857. sendFrame126(text, frame);
  12858. if (frame >= 18144 && frame <= 18244) {
  12859. clanList[frame - 18144] = text;
  12860. }
  12861. pktType = -1;
  12862. return true;
  12863.  
  12864. case 206:
  12865. publicChatMode = inStream.readUnsignedByte();
  12866. privateChatMode = inStream.readUnsignedByte();
  12867. tradeMode = inStream.readUnsignedByte();
  12868. inputTaken = true;
  12869. pktType = -1;
  12870. return true;
  12871.  
  12872. case 240:
  12873. if (tabID == 12)
  12874. needDrawTabArea = true;
  12875. weight = inStream.readSignedWord();
  12876. pktType = -1;
  12877. return true;
  12878.  
  12879. case 8:
  12880. int k6 = inStream.method436();
  12881. int l13 = inStream.readUnsignedWord();
  12882. RSInterface.interfaceCache[k6].anInt233 = 1;
  12883. RSInterface.interfaceCache[k6].mediaID = l13;
  12884. pktType = -1;
  12885. return true;
  12886.  
  12887. case 122:
  12888. int l6 = inStream.method436();
  12889. int i14 = inStream.method436();
  12890. int i19 = i14 >> 10 & 0x1f;
  12891. int i22 = i14 >> 5 & 0x1f;
  12892. int l24 = i14 & 0x1f;
  12893. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  12894. + (i22 << 11) + (l24 << 3);
  12895. pktType = -1;
  12896. return true;
  12897.  
  12898. case 53:
  12899. needDrawTabArea = true;
  12900. int i7 = inStream.readUnsignedWord();
  12901. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12902. int j19 = inStream.readUnsignedWord();
  12903. for (int j22 = 0; j22 < j19; j22++) {
  12904. int i25 = inStream.readUnsignedByte();
  12905. if (i25 == 255)
  12906. i25 = inStream.method440();
  12907. class9_1.inv[j22] = inStream.method436();
  12908. class9_1.invStackSizes[j22] = i25;
  12909. }
  12910. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12911. class9_1.inv[j25] = 0;
  12912. class9_1.invStackSizes[j25] = 0;
  12913. }
  12914. pktType = -1;
  12915. return true;
  12916.  
  12917. case 230:
  12918. int j7 = inStream.method435();
  12919. int j14 = inStream.readUnsignedWord();
  12920. int k19 = inStream.readUnsignedWord();
  12921. int k22 = inStream.method436();
  12922. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12923. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12924. RSInterface.interfaceCache[j14].modelZoom = j7;
  12925. pktType = -1;
  12926. return true;
  12927.  
  12928. case 221:
  12929. anInt900 = inStream.readUnsignedByte();
  12930. needDrawTabArea = true;
  12931. pktType = -1;
  12932. return true;
  12933.  
  12934. case 177:
  12935. aBoolean1160 = true;
  12936. anInt995 = inStream.readUnsignedByte();
  12937. anInt996 = inStream.readUnsignedByte();
  12938. anInt997 = inStream.readUnsignedWord();
  12939. anInt998 = inStream.readUnsignedByte();
  12940. anInt999 = inStream.readUnsignedByte();
  12941. if (anInt999 >= 100) {
  12942. int k7 = anInt995 * 128 + 64;
  12943. int k14 = anInt996 * 128 + 64;
  12944. int i20 = method42(plane, k14, k7) - anInt997;
  12945. int l22 = k7 - xCameraPos;
  12946. int k25 = i20 - zCameraPos;
  12947. int j28 = k14 - yCameraPos;
  12948. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  12949. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12950. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12951. if (yCameraCurve < 128)
  12952. yCameraCurve = 128;
  12953. if (yCameraCurve > 383)
  12954. yCameraCurve = 383;
  12955. }
  12956. pktType = -1;
  12957. return true;
  12958.  
  12959. case 249:
  12960. anInt1046 = inStream.method426();
  12961. unknownInt10 = inStream.method436();
  12962. pktType = -1;
  12963. return true;
  12964.  
  12965. case 65:
  12966. updateNPCs(inStream, pktSize);
  12967. pktType = -1;
  12968. return true;
  12969.  
  12970. case 27:
  12971. messagePromptRaised = false;
  12972. inputDialogState = 1;
  12973. amountOrNameInput = "";
  12974. inputTaken = true;
  12975. pktType = -1;
  12976. return true;
  12977.  
  12978. case 187:
  12979. messagePromptRaised = false;
  12980. inputDialogState = 2;
  12981. amountOrNameInput = "";
  12982. inputTaken = true;
  12983. pktType = -1;
  12984. return true;
  12985.  
  12986. case 97:
  12987. int l7 = inStream.readUnsignedWord();
  12988. method60(l7);
  12989. if (invOverlayInterfaceID != -1) {
  12990. invOverlayInterfaceID = -1;
  12991. needDrawTabArea = true;
  12992. tabAreaAltered = true;
  12993. }
  12994. if (backDialogID != -1) {
  12995. backDialogID = -1;
  12996. inputTaken = true;
  12997. }
  12998. if (inputDialogState != 0) {
  12999. inputDialogState = 0;
  13000. inputTaken = true;
  13001. }
  13002. // 17511 = Question Type
  13003. // 15819 = Christmas Type
  13004. // 15812 = Security Type
  13005. // 15801 = Item Scam Type
  13006. // 15791 = Password Safety ?
  13007. // 15774 = Good/Bad Password
  13008. // 15767 = Drama Type ????
  13009. if (l7 == 15244) {
  13010. openInterfaceID = 15767;
  13011. fullscreenInterfaceID = 15244;
  13012. } else {
  13013. openInterfaceID = l7;
  13014. }
  13015. aBoolean1149 = false;
  13016. pktType = -1;
  13017. return true;
  13018.  
  13019. case 218:
  13020. int i8 = inStream.method438();
  13021. dialogID = i8;
  13022. inputTaken = true;
  13023. pktType = -1;
  13024. return true;
  13025.  
  13026. case 87:
  13027. int j8 = inStream.method434();
  13028. int l14 = inStream.method439();
  13029. anIntArray1045[j8] = l14;
  13030. if (variousSettings[j8] != l14) {
  13031. variousSettings[j8] = l14;
  13032. method33(j8);
  13033. needDrawTabArea = true;
  13034. if (dialogID != -1)
  13035. inputTaken = true;
  13036. }
  13037. pktType = -1;
  13038. return true;
  13039.  
  13040. case 36:
  13041. int k8 = inStream.method434();
  13042. byte byte0 = inStream.readSignedByte();
  13043. anIntArray1045[k8] = byte0;
  13044. if (variousSettings[k8] != byte0) {
  13045. variousSettings[k8] = byte0;
  13046. method33(k8);
  13047. needDrawTabArea = true;
  13048. if (dialogID != -1)
  13049. inputTaken = true;
  13050. }
  13051. pktType = -1;
  13052. return true;
  13053.  
  13054. case 61:
  13055. anInt1055 = inStream.readUnsignedByte();
  13056. pktType = -1;
  13057. return true;
  13058.  
  13059. case 200:
  13060. int l8 = inStream.readUnsignedWord();
  13061. int i15 = inStream.readSignedWord();
  13062. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  13063. class9_4.anInt257 = i15;
  13064. if (i15 == 591 || i15 == 588) {
  13065. class9_4.modelZoom = 900; // anInt269
  13066. }
  13067. if (i15 == -1) {
  13068. class9_4.anInt246 = 0;
  13069. class9_4.anInt208 = 0;
  13070. }
  13071. pktType = -1;
  13072. return true;
  13073.  
  13074. case 219:
  13075. if (invOverlayInterfaceID != -1) {
  13076. invOverlayInterfaceID = -1;
  13077. needDrawTabArea = true;
  13078. tabAreaAltered = true;
  13079. }
  13080. if (backDialogID != -1) {
  13081. backDialogID = -1;
  13082. inputTaken = true;
  13083. }
  13084. if (inputDialogState != 0) {
  13085. inputDialogState = 0;
  13086. inputTaken = true;
  13087. }
  13088. openInterfaceID = -1;
  13089. aBoolean1149 = false;
  13090. pktType = -1;
  13091. return true;
  13092.  
  13093. case 34:
  13094. needDrawTabArea = true;
  13095. int i9 = inStream.readUnsignedWord();
  13096. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  13097. while (inStream.currentOffset < pktSize) {
  13098. int j20 = inStream.method422();
  13099. int i23 = inStream.readUnsignedWord();
  13100. int l25 = inStream.readUnsignedByte();
  13101. if (l25 == 255)
  13102. l25 = inStream.readDWord();
  13103. if (j20 >= 0 && j20 < class9_2.inv.length) {
  13104. class9_2.inv[j20] = i23;
  13105. class9_2.invStackSizes[j20] = l25;
  13106. }
  13107. }
  13108. pktType = -1;
  13109. return true;
  13110.  
  13111. case 4:
  13112. case 44:
  13113. case 84:
  13114. case 101:
  13115. case 105:
  13116. case 117:
  13117. case 147:
  13118. case 151:
  13119. case 156:
  13120. case 160:
  13121. case 215:
  13122. method137(inStream, pktType);
  13123. pktType = -1;
  13124. return true;
  13125.  
  13126. case 106:
  13127. tabID = inStream.method427();
  13128. needDrawTabArea = true;
  13129. tabAreaAltered = true;
  13130. pktType = -1;
  13131. return true;
  13132.  
  13133. case 164:
  13134. int j9 = inStream.method434();
  13135. method60(j9);
  13136. if (invOverlayInterfaceID != -1) {
  13137. invOverlayInterfaceID = -1;
  13138. needDrawTabArea = true;
  13139. tabAreaAltered = true;
  13140. }
  13141. backDialogID = j9;
  13142. inputTaken = true;
  13143. openInterfaceID = -1;
  13144. aBoolean1149 = false;
  13145. pktType = -1;
  13146. return true;
  13147.  
  13148. }
  13149. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  13150. + anInt842 + "," + anInt843);
  13151. resetLogout();
  13152. } catch (IOException _ex) {
  13153. dropClient();
  13154. } catch (Exception exception) {
  13155. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  13156. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  13157. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  13158. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  13159. s2 = s2 + inStream.buffer[j15] + ",";
  13160. signlink.reporterror(s2);
  13161. resetLogout();
  13162. }
  13163. return true;
  13164. }
  13165.  
  13166. public void method146() {
  13167. anInt1265++;
  13168. method47(true);
  13169. method26(true);
  13170. method47(false);
  13171. method26(false);
  13172. method55();
  13173. method104();
  13174. if (!aBoolean1160) {
  13175. int i = anInt1184;
  13176. if (anInt984 / 256 > i)
  13177. i = anInt984 / 256;
  13178. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  13179. i = anIntArray1203[4] + 128;
  13180. int k = viewRotation + viewRotationOffset & 0x7ff;
  13181. setCameraPos(600 + i * 3, i, anInt1014,
  13182. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  13183. }
  13184. int j;
  13185. if (!aBoolean1160)
  13186. j = method120();
  13187. else
  13188. j = method121();
  13189. int l = xCameraPos;
  13190. int i1 = zCameraPos;
  13191. int j1 = yCameraPos;
  13192. int k1 = yCameraCurve;
  13193. int l1 = xCameraCurve;
  13194. for (int i2 = 0; i2 < 5; i2++)
  13195. if (aBooleanArray876[i2]) {
  13196. int j2 = (int) ((Math.random()
  13197. * (anIntArray873[i2] * 2 + 1) - anIntArray873[i2]) + Math
  13198. .sin(anIntArray1030[i2]
  13199. * (anIntArray928[i2] / 100D))
  13200. * anIntArray1203[i2]);
  13201. if (i2 == 0)
  13202. xCameraPos += j2;
  13203. if (i2 == 1)
  13204. zCameraPos += j2;
  13205. if (i2 == 2)
  13206. yCameraPos += j2;
  13207. if (i2 == 3)
  13208. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  13209. if (i2 == 4) {
  13210. yCameraCurve += j2;
  13211. if (yCameraCurve < 128)
  13212. yCameraCurve = 128;
  13213. if (yCameraCurve > 383)
  13214. yCameraCurve = 383;
  13215. }
  13216. }
  13217. int k2 = Texture.anInt1481;
  13218. Model.aBoolean1684 = true;
  13219. Model.anInt1687 = 0;
  13220. Model.anInt1685 = super.mouseX - 4;
  13221. Model.anInt1686 = super.mouseY - 4;
  13222. DrawingArea.setAllPixelsToZero();
  13223. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  13224. zCameraPos, j, yCameraCurve);
  13225. worldController.clearObj5Cache();
  13226. updateEntities();
  13227. drawHeadIcon();
  13228. method37(k2);
  13229. draw3dScreen();
  13230. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  13231. xCameraPos = l;
  13232. zCameraPos = i1;
  13233. yCameraPos = j1;
  13234. yCameraCurve = k1;
  13235. xCameraCurve = l1;
  13236. }
  13237.  
  13238. public void clearTopInterfaces() {
  13239. stream.createFrame(130);
  13240. if (invOverlayInterfaceID != -1) {
  13241. invOverlayInterfaceID = -1;
  13242. needDrawTabArea = true;
  13243. aBoolean1149 = false;
  13244. tabAreaAltered = true;
  13245. }
  13246. if (backDialogID != -1) {
  13247. backDialogID = -1;
  13248. inputTaken = true;
  13249. aBoolean1149 = false;
  13250. }
  13251. openInterfaceID = -1;
  13252. fullscreenInterfaceID = -1;
  13253. }
  13254.  
  13255. private Sprite worldMapIcon508;
  13256. private Sprite worldMapIcon525;
  13257. @SuppressWarnings("unused")
  13258. private Sprite logIconH;
  13259. private Sprite logIconC;
  13260. private Sprite[] chatButtons;
  13261.  
  13262. private Sprite[] ORBS = new Sprite[16];
  13263. private DecimalFormat format;
  13264.  
  13265. /*client() {
  13266. revision474 = true;
  13267. OSOrbs = true;
  13268. xpAddedPos = expAdded = 0;
  13269. xpLock = false;
  13270. xpCounter = 0;
  13271. setFormat(new DecimalFormat());
  13272. chatRights = new int[500];
  13273. fullscreenInterfaceID = -1;
  13274. chatTypeView = 0;
  13275. clanTitles = new String[500];
  13276. clanChatMode = 0;
  13277. cButtonHPos = -1;
  13278. cButtonCPos = 0;
  13279. server = "192.95.1.187";
  13280. anIntArrayArray825 = new int[104][104];
  13281. friendsNodeIDs = new int[200];
  13282. groundArray = new NodeList[4][104][104];
  13283. aBoolean831 = false;
  13284. aStream_834 = new Stream(new byte[5000]);
  13285. npcArray = new NPC[16384];
  13286. npcIndices = new int[16384];
  13287. anIntArray840 = new int[1000];
  13288. aStream_847 = Stream.create();
  13289. aBoolean848 = true;
  13290. openInterfaceID = -1;
  13291. currentExp = new int[Skills.skillsCount];
  13292. aBoolean872 = false;
  13293. anIntArray873 = new int[5];
  13294. anInt874 = -1;
  13295. aBooleanArray876 = new boolean[5];
  13296. drawFlames = false;
  13297. reportAbuseInput = "";
  13298. unknownInt10 = -1;
  13299. menuOpen = false;
  13300. inputString = "";
  13301. maxPlayers = 2048;
  13302. myPlayerIndex = 2047;
  13303. playerArray = new Player[maxPlayers];
  13304. playerIndices = new int[maxPlayers];
  13305. anIntArray894 = new int[maxPlayers];
  13306. aStreamArray895s = new Stream[maxPlayers];
  13307. anIntArrayArray901 = new int[104][104];
  13308. aByteArray912 = new byte[16384];
  13309. currentStats = new int[Skills.skillsCount];
  13310. ignoreListAsLongs = new long[100];
  13311. loadingError = false;
  13312. anIntArray928 = new int[5];
  13313. anIntArrayArray929 = new int[104][104];
  13314. chatTypes = new int[500];
  13315. chatNames = new String[500];
  13316. chatMessages = new String[500];
  13317. chatButtons = new Sprite[4];
  13318. sideIcons = new Sprite[15];
  13319. redStones = new Sprite[5];
  13320. aBoolean954 = true;
  13321. friendsListAsLongs = new long[200];
  13322. currentSong = -1;
  13323. drawingFlames = false;
  13324. spriteDrawX = -1;
  13325. spriteDrawY = -1;
  13326. anIntArray968 = new int[33];
  13327. anIntArray969 = new int[256];
  13328. decompressors = new Decompressor[5];
  13329. variousSettings = new int[2000];
  13330. aBoolean972 = false;
  13331. anInt975 = 50;
  13332. anIntArray976 = new int[anInt975];
  13333. anIntArray977 = new int[anInt975];
  13334. anIntArray978 = new int[anInt975];
  13335. anIntArray979 = new int[anInt975];
  13336. anIntArray980 = new int[anInt975];
  13337. anIntArray981 = new int[anInt975];
  13338. anIntArray982 = new int[anInt975];
  13339. aStringArray983 = new String[anInt975];
  13340. anInt985 = -1;
  13341. hitMarks = new Sprite[20];
  13342. anIntArray990 = new int[5];
  13343. aBoolean994 = false;
  13344. amountOrNameInput = "";
  13345. aClass19_1013 = new NodeList();
  13346. aBoolean1017 = false;
  13347. anInt1018 = -1;
  13348. anIntArray1030 = new int[5];
  13349. aBoolean1031 = false;
  13350. mapFunctions = new Sprite[100];
  13351. dialogID = -1;
  13352. maxStats = new int[Skills.skillsCount];
  13353. anIntArray1045 = new int[2000];
  13354. aBoolean1047 = true;
  13355. anIntArray1052 = new int[151];
  13356. anInt1054 = -1;
  13357. aClass19_1056 = new NodeList();
  13358. anIntArray1057 = new int[33];
  13359. aClass9_1059 = new RSInterface();
  13360. mapScenes = new Background[100];
  13361. barFillColor = 0x4d4233;
  13362. anIntArray1065 = new int[7];
  13363. anIntArray1072 = new int[1000];
  13364. anIntArray1073 = new int[1000];
  13365. aBoolean1080 = false;
  13366. friendsList = new String[200];
  13367. inStream = Stream.create();
  13368. expectedCRCs = new int[9];
  13369. menuActionCmd2 = new int[500];
  13370. menuActionCmd3 = new int[500];
  13371. menuActionID = new int[500];
  13372. menuActionCmd1 = new int[500];
  13373. headIcons = new Sprite[20];
  13374. skullIcons = new Sprite[20];
  13375. headIconsHint = new Sprite[20];
  13376. tabAreaAltered = false;
  13377. aString1121 = "";
  13378. atPlayerActions = new String[5];
  13379. atPlayerArray = new boolean[5];
  13380. anIntArrayArrayArray1129 = new int[4][13][13];
  13381. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13382. aBoolean1141 = false;
  13383. aBoolean1149 = false;
  13384. crosses = new Sprite[8];
  13385. musicEnabled = true;
  13386. needDrawTabArea = false;
  13387. loggedIn = false;
  13388. canMute = false;
  13389. aBoolean1159 = false;
  13390. aBoolean1160 = false;
  13391. myUsername = "";
  13392. myPassword = "";
  13393. genericLoadingError = false;
  13394. reportAbuseInterfaceID = -1;
  13395. aClass19_1179 = new NodeList();
  13396. anInt1184 = 128;
  13397. invOverlayInterfaceID = -1;
  13398. stream = Stream.create();
  13399. menuActionName = new String[500];
  13400. anIntArray1203 = new int[5];
  13401. anIntArray1207 = new int[50];
  13402. anInt1211 = 78;
  13403. promptInput = "";
  13404. modIcons = new Sprite[10];
  13405. tabID = 3;
  13406. inputTaken = false;
  13407. songChanging = true;
  13408. anIntArray1229 = new int[151];
  13409. aClass11Array1230 = new Class11[4];
  13410. anIntArray1241 = new int[50];
  13411. aBoolean1242 = false;
  13412. anIntArray1250 = new int[50];
  13413. rsAlreadyLoaded = false;
  13414. welcomeScreenRaised = false;
  13415. messagePromptRaised = false;
  13416. loginMessage1 = "";
  13417. loginMessage2 = "";
  13418. backDialogID = -1;
  13419. bigX = new int[4000];
  13420. bigY = new int[4000];
  13421. anInt1289 = -1;
  13422. }*/
  13423.  
  13424. private final int[] chatRights;
  13425. private int hoverId;
  13426.  
  13427. /**
  13428. * Ardi Gameframes *bang bang*
  13429. */
  13430.  
  13431. private Sprite tabArea;
  13432. private Sprite tabArea474;
  13433. private Sprite tabArea508;
  13434. private Sprite mapArea;
  13435. private Sprite mapArea474;
  13436. private Sprite mapArea508;
  13437.  
  13438. public int rights;
  13439. public String name;
  13440. public String message;
  13441. public String clanname;
  13442. public int chatTypeView;
  13443. public int clanChatMode;
  13444. public int duelMode;
  13445. private Sprite chatArea;
  13446. private Background mapBack;
  13447.  
  13448. private RSImageProducer leftFrame;
  13449. private RSImageProducer topFrame;
  13450. private RSImageProducer rightFrame;
  13451. private int ignoreCount;
  13452. private long aLong824;
  13453. private int[][] anIntArrayArray825;
  13454. private int[] friendsNodeIDs;
  13455. private NodeList[][][] groundArray;
  13456. private int[] anIntArray828;
  13457. private int[] anIntArray829;
  13458. private volatile boolean aBoolean831;
  13459. private Socket aSocket832;
  13460. private int loginScreenState;
  13461. private Stream aStream_834;
  13462. private NPC[] npcArray;
  13463. private int npcCount;
  13464. private int[] npcIndices;
  13465. private int anInt839;
  13466. private int[] anIntArray840;
  13467. private int anInt841;
  13468. private int anInt842;
  13469. private int anInt843;
  13470. private String aString844;
  13471. private int privateChatMode;
  13472. private Stream aStream_847;
  13473. private boolean aBoolean848;
  13474. private static int anInt849;
  13475. private int[] anIntArray850;
  13476. private int[] anIntArray851;
  13477. private int[] anIntArray852;
  13478. private int[] anIntArray853;
  13479. private static int anInt854;
  13480. private int anInt855;
  13481. public static int openInterfaceID;
  13482. private int xCameraPos;
  13483. private int zCameraPos;
  13484. private int yCameraPos;
  13485. private int yCameraCurve;
  13486. private int xCameraCurve;
  13487. private int myPrivilege;
  13488. private final int[] currentExp;
  13489. private Sprite[] redStones;
  13490. private Sprite mapFlag;
  13491. private Sprite mapMarker;
  13492. private boolean aBoolean872;
  13493. private final int[] anIntArray873;
  13494. private int anInt874;
  13495. private final boolean[] aBooleanArray876;
  13496. private int weight;
  13497. private MouseDetection mouseDetection;
  13498. private volatile boolean drawFlames;
  13499. private String reportAbuseInput;
  13500. private int unknownInt10;
  13501. private boolean menuOpen;
  13502. private int anInt886;
  13503. private String inputString;
  13504. private final int maxPlayers;
  13505. private final int myPlayerIndex;
  13506. private Player[] playerArray;
  13507. private int playerCount;
  13508. private int[] playerIndices;
  13509. private int anInt893;
  13510. private int[] anIntArray894;
  13511. private Stream[] aStreamArray895s;
  13512. private int viewRotationOffset;
  13513. private int friendsCount;
  13514. private int anInt900;
  13515. private int[][] anIntArrayArray901;
  13516. private byte[] aByteArray912;
  13517. private int anInt913;
  13518. private int crossX;
  13519. private int crossY;
  13520. private int crossIndex;
  13521. private int crossType;
  13522. private int plane;
  13523. private final int[] currentStats;
  13524. private static int anInt924;
  13525. private final long[] ignoreListAsLongs;
  13526. private boolean loadingError;
  13527. private final int[] anIntArray928;
  13528. private int[][] anIntArrayArray929;
  13529. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  13530. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  13531. private int anInt933;
  13532. private int anInt934;
  13533. private int anInt935;
  13534. private int anInt936;
  13535. private int anInt937;
  13536. private int anInt938;
  13537. private final int[] chatTypes;
  13538. private final String[] chatNames;
  13539. private final String[] chatMessages;
  13540. private int anInt945;
  13541. private WorldController worldController;
  13542. private Sprite[] sideIcons;
  13543. private int menuScreenArea;
  13544. private int menuOffsetX;
  13545. private int menuOffsetY;
  13546. private int menuWidth;
  13547. private int menuHeight;
  13548. private long aLong953;
  13549. private boolean aBoolean954;
  13550. private long[] friendsListAsLongs;
  13551. private int currentSong;
  13552. private static int nodeID = 10;
  13553. static int portOff;
  13554. static boolean clientData;
  13555. private static boolean isMembers = true;
  13556. private static boolean lowMem;
  13557. private volatile boolean drawingFlames;
  13558. private int spriteDrawX;
  13559. private int spriteDrawY;
  13560. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  13561. 0xff00ff, 0xffffff };
  13562. private Background aBackground_966;
  13563. private Background aBackground_967;
  13564. private final int[] anIntArray968;
  13565. private final int[] anIntArray969;
  13566. final Decompressor[] decompressors;
  13567. public int variousSettings[];
  13568. private boolean aBoolean972;
  13569. private final int anInt975;
  13570. private final int[] anIntArray976;
  13571. private final int[] anIntArray977;
  13572. private final int[] anIntArray978;
  13573. private final int[] anIntArray979;
  13574. private final int[] anIntArray980;
  13575. private final int[] anIntArray981;
  13576. private final int[] anIntArray982;
  13577. private final String[] aStringArray983;
  13578. private int anInt984;
  13579. private int anInt985;
  13580. private static int anInt986;
  13581. private Sprite[] hitMarks;
  13582. private int anInt989;
  13583. private final int[] anIntArray990;
  13584. private static boolean aBoolean993;
  13585. private final boolean aBoolean994;
  13586. private int anInt995;
  13587. private int anInt996;
  13588. private int anInt997;
  13589. private int anInt998;
  13590. private int anInt999;
  13591. private ISAACRandomGen encryption;
  13592. private Sprite mapEdge;
  13593. static final int[][] anIntArrayArray1003 = {
  13594. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  13595. 54193 },
  13596. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13597. 56621, 4783, 1341, 16578, 35003, 25239 },
  13598. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13599. 10153, 56621, 4783, 1341, 16578, 35003 },
  13600. { 4626, 11146, 6439, 12, 4758, 10270 },
  13601. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  13602.  
  13603. private Sprite multiOverlay;
  13604. private String amountOrNameInput;
  13605. private static int anInt1005;
  13606. private int daysSinceLastLogin;
  13607. private int pktSize;
  13608. private int pktType;
  13609. private int anInt1009;
  13610. private int anInt1010;
  13611. private int anInt1011;
  13612. private NodeList aClass19_1013;
  13613. private int anInt1014;
  13614. private int anInt1015;
  13615. private int anInt1016;
  13616. private boolean aBoolean1017;
  13617. public static int anInt1018;
  13618. private static final int[] anIntArray1019;
  13619. private int anInt1021;
  13620. private int anInt1022;
  13621. private int loadingStage;
  13622. private Sprite scrollBar1;
  13623. private Sprite scrollBar2;
  13624. private int anInt1026;
  13625. private final int[] anIntArray1030;
  13626. private boolean aBoolean1031;
  13627. private static Sprite[] mapFunctions;
  13628. private static int baseX;
  13629. private static int baseY;
  13630. private int anInt1036;
  13631. private int anInt1037;
  13632. private int loginFailures;
  13633. private int anInt1039;
  13634. private int anInt1040;
  13635. private int anInt1041;
  13636. private int dialogID;
  13637. private final int[] maxStats;
  13638. private final int[] anIntArray1045;
  13639. private int anInt1046;
  13640. private boolean aBoolean1047;
  13641. public TextDrawingArea smallText;
  13642. public TextDrawingArea XPFONT;
  13643. public TextDrawingArea aTextDrawingArea_1271;
  13644. public TextDrawingArea chatTextDrawingArea;
  13645. public TextDrawingArea aTextDrawingArea_1273;
  13646. public RSFont newSmallFont;
  13647. public RSFont newRegularFont;
  13648. public RSFont newBoldFont;
  13649. public RSFont newFancyFont;
  13650. private int anInt1048;
  13651. private String aString1049;
  13652. private static int anInt1051;
  13653. private final int[] anIntArray1052;
  13654. private StreamLoader titleStreamLoader;
  13655. private int anInt1054;
  13656. private int anInt1055;
  13657. private NodeList aClass19_1056;
  13658. private final int[] anIntArray1057;
  13659. public final RSInterface aClass9_1059;
  13660. private Background[] mapScenes;
  13661. private static int anInt1061;
  13662. private int anInt1062;
  13663. private final int barFillColor;
  13664. private int friendsListAction;
  13665. private final int[] anIntArray1065;
  13666. private int mouseInvInterfaceIndex;
  13667. private int lastActiveInvInterface;
  13668. public OnDemandFetcher onDemandFetcher;
  13669. private int anInt1069;
  13670. private int anInt1070;
  13671. private int anInt1071;
  13672. private int[] anIntArray1072;
  13673. private int[] anIntArray1073;
  13674. private Sprite mapDotItem;
  13675. private Sprite mapDotNPC;
  13676. private Sprite mapDotPlayer;
  13677. private Sprite mapDotFriend;
  13678. private Sprite mapDotTeam;
  13679. private Sprite mapDotClan;
  13680. private int anInt1079;
  13681. private boolean aBoolean1080;
  13682. private String[] friendsList;
  13683. private Stream inStream;
  13684. private int anInt1084;
  13685. private int anInt1085;
  13686. private int activeInterfaceType;
  13687. private int anInt1087;
  13688. private int anInt1088;
  13689. public static int anInt1089;
  13690. private final int[] expectedCRCs;
  13691. private int[] menuActionCmd2;
  13692. private int[] menuActionCmd3;
  13693. private int[] menuActionID;
  13694. private int[] menuActionCmd1;
  13695. private Sprite[] headIcons;
  13696. private Sprite[] skullIcons;
  13697. private Sprite[] headIconsHint;
  13698. private static int anInt1097;
  13699. private int anInt1098;
  13700. private int anInt1099;
  13701. private int anInt1100;
  13702. private int anInt1101;
  13703. private int anInt1102;
  13704. public static boolean tabAreaAltered;
  13705. private int anInt1104;
  13706. private RSImageProducer aRSImageProducer_1107;
  13707. private RSImageProducer aRSImageProducer_1108;
  13708. private RSImageProducer aRSImageProducer_1109;
  13709. private RSImageProducer aRSImageProducer_1110;
  13710. private RSImageProducer aRSImageProducer_1111;
  13711. private RSImageProducer aRSImageProducer_1112;
  13712. private RSImageProducer aRSImageProducer_1113;
  13713. private RSImageProducer aRSImageProducer_1114;
  13714. private RSImageProducer aRSImageProducer_1115;
  13715. private static int anInt1117;
  13716. private int membersInt;
  13717. private String aString1121;
  13718. private Sprite compass;
  13719. private RSImageProducer aRSImageProducer_1125;
  13720. public static Player myPlayer;
  13721. private final String[] atPlayerActions;
  13722. private final boolean[] atPlayerArray;
  13723. private final int[][][] anIntArrayArrayArray1129;
  13724. final static int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
  13725. -1, -1, -1, -1, -1, -1, -1, -1 };
  13726. private int cameraOffsetY;
  13727. private int menuActionRow;
  13728. private static int anInt1134;
  13729. private int spellSelected;
  13730. private int anInt1137;
  13731. private int spellUsableOn;
  13732. private String spellTooltip;
  13733. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  13734. private boolean aBoolean1141;
  13735. private static int anInt1142;
  13736. private int energy;
  13737. private boolean aBoolean1149;
  13738. private Sprite[] crosses;
  13739. private boolean musicEnabled;
  13740. private Background[] aBackgroundArray1152s;
  13741. public static boolean needDrawTabArea;
  13742. private int unreadMessages;
  13743. private static int anInt1155;
  13744. private static boolean fpsOn;
  13745. public boolean loggedIn;
  13746. private boolean canMute;
  13747. private boolean aBoolean1159;
  13748. private boolean aBoolean1160;
  13749. static int loopCycle;
  13750. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  13751. private RSImageProducer aRSImageProducer_1163;
  13752. private RSImageProducer mapEdgeIP;
  13753. private RSImageProducer aRSImageProducer_1164;
  13754. private RSImageProducer aRSImageProducer_1165;
  13755. private RSImageProducer aRSImageProducer_1166;
  13756. private int daysSinceRecovChange;
  13757. private RSSocket socketStream;
  13758. private static int minimapZoom;
  13759. private long aLong1172;
  13760. private String myUsername;
  13761. private String myPassword;
  13762. private static int anInt1175;
  13763. private boolean genericLoadingError;
  13764. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  13765. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  13766. private int reportAbuseInterfaceID;
  13767. private NodeList aClass19_1179;
  13768. private int[] anIntArray1180;
  13769. private int[] anIntArray1181;
  13770. private int[] anIntArray1182;
  13771. private byte[][] aByteArrayArray1183;
  13772. private int anInt1184;
  13773. private static int viewRotation;
  13774. private int anInt1186;
  13775. private int anInt1187;
  13776. private static int anInt1188;
  13777. private int invOverlayInterfaceID;
  13778. private int[] anIntArray1190;
  13779. private int[] anIntArray1191;
  13780. private Stream stream;
  13781. private int anInt1193;
  13782. private int splitPrivateChat;
  13783. private String[] clanList = new String[100];
  13784. private String[] menuActionName;
  13785. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  13786. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  13787. private final int[] anIntArray1203;
  13788. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  13789. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  13790. private static boolean flagged;
  13791. private final int[] anIntArray1207;
  13792. private int anInt1208;
  13793. private static int minimapRotation;
  13794. public static int anInt1211;
  13795. private String promptInput;
  13796. private int anInt1213;
  13797. private int[][][] intGroundArray;
  13798. private long aLong1215;
  13799. private int loginScreenCursorPos;
  13800. private final Sprite[] modIcons;
  13801. private long aLong1220;
  13802. public static int tabID;
  13803. private int anInt1222;
  13804. public static boolean inputTaken;
  13805. private int inputDialogState;
  13806. private static int anInt1226;
  13807. private int nextSong;
  13808. private boolean songChanging;
  13809. private final int[] anIntArray1229;
  13810. private Class11[] aClass11Array1230;
  13811. public static int anIntArray1232[];
  13812. private int[] anIntArray1234;
  13813. private int[] anIntArray1235;
  13814. private int[] anIntArray1236;
  13815. private int anInt1237;
  13816. private int anInt1238;
  13817. public final int anInt1239 = 100;
  13818. private final int[] anIntArray1241;
  13819. private boolean aBoolean1242;
  13820. private int atInventoryLoopCycle;
  13821. private int atInventoryInterface;
  13822. private int atInventoryIndex;
  13823. private int atInventoryInterfaceType;
  13824. private byte[][] aByteArrayArray1247;
  13825. private int tradeMode;
  13826. private int anInt1249;
  13827. private final int[] anIntArray1250;
  13828. private int anInt1251;
  13829. private final boolean rsAlreadyLoaded;
  13830. private int anInt1253;
  13831. private boolean welcomeScreenRaised;
  13832. private boolean messagePromptRaised;
  13833. private int anInt1257;
  13834. private byte[][][] byteGroundArray;
  13835. private int prevSong;
  13836. private int destX;
  13837. private int destY;
  13838. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  13839. private int anInt1264;
  13840. private int anInt1265;
  13841. private String loginMessage1;
  13842. private String loginMessage2;
  13843. private int anInt1268;
  13844. private int anInt1269;
  13845. private int anInt1275;
  13846. private int backDialogID;
  13847. private int cameraOffsetX;
  13848. private int[] bigX;
  13849. private int[] bigY;
  13850. private int itemSelected;
  13851. private int anInt1283;
  13852. private int anInt1284;
  13853. private int anInt1285;
  13854. private String selectedItemName;
  13855. private int publicChatMode;
  13856. private static int anInt1288;
  13857. private int anInt1289;
  13858. public static int anInt1290;
  13859. public static String server = "localhost";
  13860. public int drawCount;
  13861. public int fullscreenInterfaceID;
  13862. public int anInt1044;// 377
  13863. public int anInt1129;// 377
  13864. public int anInt1315;// 377
  13865. public int anInt1500;// 377
  13866. public int anInt1501;// 377
  13867. public int[] fullScreenTextureArray;
  13868.  
  13869. public void resetAllImageProducers() {
  13870. if (super.fullGameScreen != null) {
  13871. return;
  13872. }
  13873. aRSImageProducer_1166 = null;
  13874. aRSImageProducer_1164 = null;
  13875. aRSImageProducer_1163 = null;
  13876. aRSImageProducer_1165 = null;
  13877. aRSImageProducer_1125 = null;
  13878. aRSImageProducer_1107 = null;
  13879. aRSImageProducer_1108 = null;
  13880. aRSImageProducer_1109 = null;
  13881. aRSImageProducer_1110 = null;
  13882. aRSImageProducer_1111 = null;
  13883. aRSImageProducer_1112 = null;
  13884. aRSImageProducer_1113 = null;
  13885. aRSImageProducer_1114 = null;
  13886. aRSImageProducer_1115 = null;
  13887. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  13888. welcomeScreenRaised = true;
  13889. }
  13890.  
  13891. public void launchURL(String url) {
  13892. String osName = System.getProperty("os.name");
  13893. try {
  13894. if (osName.startsWith("Mac OS")) {
  13895. @SuppressWarnings("rawtypes")
  13896. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  13897. @SuppressWarnings("unchecked")
  13898. Method openURL = fileMgr.getDeclaredMethod("openURL",
  13899. new Class[] { String.class });
  13900. openURL.invoke(null, new Object[] { url });
  13901. } else if (osName.startsWith("Windows"))
  13902. Runtime.getRuntime().exec(
  13903. "rundll32 url.dll,FileProtocolHandler " + url);
  13904. else { // assume Unix or Linux
  13905. String[] browsers = { "firefox", "opera", "konqueror",
  13906. "epiphany", "mozilla", "netscape", "safari" };
  13907. String browser = null;
  13908. for (int count = 0; count < browsers.length && browser == null; count++)
  13909. if (Runtime.getRuntime()
  13910. .exec(new String[] { "which", browsers[count] })
  13911. .waitFor() == 0)
  13912. browser = browsers[count];
  13913. if (browser == null) {
  13914. throw new Exception("Could not find web browser");
  13915. } else
  13916. Runtime.getRuntime().exec(new String[] { browser, url });
  13917. }
  13918. } catch (Exception e) {
  13919. pushMessage("Failed to open URL.", 0, "");
  13920. }
  13921. }
  13922.  
  13923. public DecimalFormat getFormat() {
  13924. return format;
  13925. }
  13926.  
  13927. public void setFormat(DecimalFormat format) {
  13928. this.format = format;
  13929. }
  13930.  
  13931. static {
  13932. anIntArray1019 = new int[99];
  13933. int i = 0;
  13934. for (int j = 0; j < 99; j++) {
  13935. int l = j + 1;
  13936. int i1 = (int) (l + 300D * Math.pow(2D, l / 7D));
  13937. i += i1;
  13938. anIntArray1019[j] = i / 4;
  13939. }
  13940. anIntArray1232 = new int[32];
  13941. i = 2;
  13942. for (int k = 0; k < 32; k++) {
  13943. anIntArray1232[k] = i - 1;
  13944. i += i;
  13945. }
  13946. }
  13947. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement