Guest User

Untitled

a guest
Sep 3rd, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 470.27 KB | None | 0 0
  1. package com;
  2.  
  3. import java.applet.AppletContext;
  4. import java.awt.*;
  5. import java.io.*;
  6. import java.net.*;
  7. import java.text.DecimalFormat;
  8. import java.text.NumberFormat;
  9. import java.util.ArrayList;
  10. import java.util.Arrays;
  11. import java.util.Queue;
  12. import java.util.Calendar;
  13. import java.util.Collection;
  14. import java.util.GregorianCalendar;
  15. import java.util.LinkedList;
  16. import java.util.Objects;
  17. import java.util.regex.Matcher;
  18. import java.util.regex.Pattern;
  19. import java.util.zip.GZIPOutputStream;
  20. import java.lang.reflect.Method;
  21.  
  22. import javax.swing.JOptionPane;
  23.  
  24. import com.Configuration;
  25.  
  26. import sign.signlink;
  27.  
  28. public class client extends RSApplet {
  29. public enum ScreenMode {
  30. FIXED, RESIZABLE, FULLSCREEN;
  31. }
  32. private static final long serialVersionUID = 1L;
  33. private Sprite[] inputSprites = new Sprite[7];
  34. private boolean revision474 = true;
  35. private boolean revision498 = false;
  36. private boolean revision508;
  37. private boolean OSOrbs = true;
  38. private boolean OSCounter = true;
  39. public static int lastChat = 0;
  40. public static String[] chatHistory = new String[25];
  41. private static String broadcast = "";
  42. private int modifiableXValue;
  43. private int achievementCutoff = 100;
  44. private Sprite[] minimapIcons = new Sprite[2];
  45. private Sprite[] expDrops = new Sprite[25];
  46. public int port = Configuration.getPort();
  47. private String macAddress;
  48.  
  49. public static void dumpModels() {
  50. int id = 6610;
  51. EntityDef npc = EntityDef.forID(id);
  52. System.out.println(npc.name);
  53. if (npc.anIntArray94 != null) {
  54. for (int modelid = 0; modelid < npc.anIntArray94.length; modelid++) {
  55. System.out.println(npc.anIntArray94[modelid]);
  56. }
  57. }
  58. }
  59.  
  60. private static String intToKOrMilLongName(int i) {
  61. String s = String.valueOf(i);
  62. for (int k = s.length() - 3; k > 0; k -= 3)
  63. s = s.substring(0, k) + "," + s.substring(k);
  64. if (s.length() > 8)
  65. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  66. + s + ")";
  67. else if (s.length() > 4)
  68. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  69. return " " + s;
  70. }
  71.  
  72. private static String intToKOrMil(int j) {
  73. if (j < 0x186a0)
  74. return String.valueOf(j);
  75. if (j < 0x989680)
  76. return j / 1000 + "K";
  77. else
  78. return j / 0xf4240 + "M";
  79. }
  80.  
  81. public void stopMidi() {
  82. signlink.midifade = 0;
  83. signlink.midi = "stop";
  84. }
  85.  
  86. public Sprite[] chatImages = new Sprite[2];
  87. public static int spellID = 0;
  88. public int MapX, MapY;
  89.  
  90. public static void setTab(int id) {
  91. needDrawTabArea = true;
  92. tabID = id;
  93. tabAreaAltered = true;
  94. }
  95.  
  96. public void setSidebarInterface(int sidebarID, int interfaceID) {
  97. tabInterfaceIDs[sidebarID] = interfaceID;
  98. tabID = sidebarID;
  99. needDrawTabArea = true;
  100. tabAreaAltered = true;
  101. }
  102.  
  103. private boolean menuHasAddFriend(int j) {
  104. if (j < 0)
  105. return false;
  106. int k = menuActionID[j];
  107. if (k >= 2000)
  108. k -= 2000;
  109. return k == 337;
  110. }
  111.  
  112. public void drawChannelButtons() {
  113. String text[] = { "On", "Friends", "Off", "Hide" };
  114. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  115. switch (cButtonCPos) {
  116. case 0:
  117. chatButtons[1].drawSprite(5, 142);
  118. break;
  119. case 1:
  120. chatButtons[1].drawSprite(71, 142);
  121. break;
  122. case 2:
  123. chatButtons[1].drawSprite(137, 142);
  124. break;
  125. case 3:
  126. chatButtons[1].drawSprite(203, 142);
  127. break;
  128. case 4:
  129. chatButtons[1].drawSprite(269, 142);
  130. break;
  131. case 5:
  132. chatButtons[1].drawSprite(335, 142);
  133. break;
  134. }
  135. if (cButtonHPos == cButtonCPos) {
  136. switch (cButtonHPos) {
  137. case 0:
  138. chatButtons[2].drawSprite(5, 142);
  139. break;
  140. case 1:
  141. chatButtons[2].drawSprite(71, 142);
  142. break;
  143. case 2:
  144. chatButtons[2].drawSprite(137, 142);
  145. break;
  146. case 3:
  147. chatButtons[2].drawSprite(203, 142);
  148. break;
  149. case 4:
  150. chatButtons[2].drawSprite(269, 142);
  151. break;
  152. case 5:
  153. chatButtons[2].drawSprite(335, 142);
  154. break;
  155. case 6:
  156. chatButtons[3].drawSprite(404, 142);
  157. break;
  158. }
  159. } else {
  160. switch (cButtonHPos) {
  161. case 0:
  162. chatButtons[0].drawSprite(5, 142);
  163. break;
  164. case 1:
  165. chatButtons[0].drawSprite(71, 142);
  166. break;
  167. case 2:
  168. chatButtons[0].drawSprite(137, 142);
  169. break;
  170. case 3:
  171. chatButtons[0].drawSprite(203, 142);
  172. break;
  173. case 4:
  174. chatButtons[0].drawSprite(269, 142);
  175. break;
  176. case 5:
  177. chatButtons[0].drawSprite(335, 142);
  178. break;
  179. case 6:
  180. chatButtons[3].drawSprite(404, 142);
  181. break;
  182. }
  183. }
  184. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  185. smallText.method389(true, 26, 0xffffff, "All", 157);
  186. smallText.method389(true, 86, 0xffffff, "Game", 157);
  187. smallText.method389(true, 150, 0xffffff, "Public", 152);
  188. smallText.method389(true, 212, 0xffffff, "Private", 152);
  189. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  190. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  191. smallText.method382(textColor[publicChatMode], 164,
  192. text[publicChatMode], 163, true);
  193. smallText.method382(textColor[privateChatMode], 230,
  194. text[privateChatMode], 163, true);
  195. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode],
  196. 163, true);
  197. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163,
  198. true);
  199. }
  200.  
  201. private void drawChatArea() {
  202. aRSImageProducer_1166.initDrawingArea();
  203. Texture.anIntArray1472 = anIntArray1180;
  204. chatArea.drawSprite(0, 0);
  205. drawChannelButtons();
  206. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  207. if (super.saveClickX >= 0 && super.saveClickX <= 522
  208. && super.saveClickY >= 343 && super.saveClickY <= 484) {
  209. if (this.isFieldInFocus()) {
  210. this.inputString = "";
  211. this.resetInputFieldFocus();
  212. }
  213. }
  214. if (this.isFieldInFocus())
  215. this.inputString = "[Click chat box to enable]";
  216. if (messagePromptRaised) {
  217. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  218. newBoldFont.drawCenteredString(promptInput + "*", 259, 80, 128, -1);
  219. } else if (inputDialogState == 1) {
  220. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  221. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  222. 128, -1);
  223. } else if (inputDialogState == 2) {
  224. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  225. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  226. 128, -1);
  227. } else if (aString844 != null) {
  228. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  229. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128,
  230. -1);
  231. } else if (backDialogID != -1) {
  232. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  233. } else if (dialogID != -1) {
  234. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  235. } else {
  236. int j77 = -3;
  237. int j = 0;
  238. DrawingArea.setDrawingArea(122, 8, 497, 7);
  239. for (int k = 0; k < 500; k++)
  240. if (chatMessages[k] != null) {
  241. int chatType = chatTypes[k];
  242. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  243. String s1 = chatNames[k];
  244. byte byte0 = 0;
  245. if (s1 != null && s1.startsWith("@cr1@")) {
  246. s1 = s1.substring(5);
  247. byte0 = 1;
  248. } else if (s1 != null && s1.startsWith("@cr2@")) {
  249. s1 = s1.substring(5);
  250. byte0 = 2;
  251. } else if (s1 != null && s1.startsWith("@cr3@")) {
  252. s1 = s1.substring(5);
  253. byte0 = 3;
  254. } else if (s1 != null && s1.startsWith("@cr4@")) {
  255. s1 = s1.substring(5);
  256. byte0 = 4;
  257. } else if (s1 != null && s1.startsWith("@cr5@")) {
  258. s1 = s1.substring(5);
  259. byte0 = 5;
  260. } else if (s1 != null && s1.startsWith("@cr6@")) {
  261. s1 = s1.substring(5);
  262. byte0 = 6;
  263. } else if (s1 != null && s1.startsWith("@cr7@")) {
  264. s1 = s1.substring(5);
  265. byte0 = 7;
  266. } else if (s1 != null && s1.startsWith("@cr8@")) {
  267. s1 = s1.substring(5);
  268. byte0 = 8;
  269. } else if (s1 != null && s1.startsWith("@cr9@")) {
  270. s1 = s1.substring(5);
  271. byte0 = 9;
  272. } else if (s1 != null && s1.startsWith("@cr10@")) {
  273. s1 = s1.substring(6);
  274. byte0 = 10;
  275. } else if (s1 != null && s1.startsWith("@cr11@")) {
  276. s1 = s1.substring(6);
  277. byte0 = 11;
  278. }
  279. if (chatType == 0) {
  280. if (chatTypeView == 5 || chatTypeView == 0) {
  281. if (yPos > 0 && yPos < 210) {
  282. newRegularFont.drawBasicString(chatMessages[k],
  283. 11, yPos, 0, -1);
  284. }
  285. j++;
  286. j77++;
  287. }
  288. }
  289. if ((chatType == 1 || chatType == 2)
  290. && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1
  291. && isFriendOrSelf(s1))) {
  292. if (chatTypeView == 1 || chatTypeView == 0) {
  293. if (yPos > 0 && yPos < 210) {
  294. int xPos = 11;
  295. if (byte0 == 1) {
  296. modIcons[0].drawSprite(xPos + 1, yPos - 11);
  297. xPos += 14;
  298. } else if (byte0 == 2) {
  299. modIcons[2].drawSprite(xPos, yPos - 11);
  300. xPos += 14;
  301. } else if (byte0 == 3) {
  302. modIcons[1].drawSprite(xPos + 1, yPos - 11);
  303. xPos += 14;
  304. } else if (byte0 == 4) {
  305. modIcons[3].drawSprite(xPos + 1, yPos - 10);
  306. xPos += 14;
  307. } else if (byte0 == 5) {
  308. modIcons[4].drawSprite(xPos + 1, yPos - 10);
  309. xPos += 14;
  310. } else if (byte0 == 6) {
  311. modIcons[5].drawSprite(xPos + 1, yPos - 10);
  312. xPos += 14;
  313. } else if (byte0 == 7) {
  314. modIcons[6].drawSprite(xPos + 1, yPos - 10);
  315. xPos += 14;
  316. } else if (byte0 == 8) {
  317. modIcons[7].drawSprite(xPos + 1, yPos - 10);
  318. xPos += 14;
  319. } else if (byte0 == 9) {
  320. modIcons[8].drawSprite(xPos + 1, yPos - 10);
  321. xPos += 14;
  322. } else if (byte0 == 10) {
  323. modIcons[9].drawSprite(xPos + 1, yPos - 10);
  324. xPos += 14;
  325. } else if (byte0 == 11) {
  326. modIcons[10]
  327. .drawSprite(xPos + 1, yPos - 10);
  328. xPos += 14;
  329. }
  330. newRegularFont.drawBasicString(s1 + ":", xPos,
  331. yPos, 0, -1);
  332. xPos += newRegularFont.getTextWidth(s1) + 8;
  333. newRegularFont.drawBasicString(chatMessages[k],
  334. xPos, yPos, 255, -1);
  335. }
  336. j++;
  337. j77++;
  338. }
  339. }
  340. if ((chatType == 3 || chatType == 7)
  341. && (splitPrivateChat == 0 || chatTypeView == 2)
  342. && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1
  343. && isFriendOrSelf(s1))) {
  344. if (chatTypeView == 2 || chatTypeView == 0) {
  345. if (yPos > 0 && yPos < 210) {
  346. int k1 = 11;
  347. newRegularFont.drawBasicString("From", k1,
  348. yPos, 0, -1);
  349. if (byte0 == 3 || byte0 == 2 || byte0 == 1
  350. || byte0 == 0) {
  351. k1 += textDrawingArea.getTextWidth("From ");
  352. } else if (byte0 == 9 || byte0 == 10
  353. || byte0 == 11 || byte0 == 7
  354. || byte0 == 8 || byte0 == 6
  355. || byte0 == 5 || byte0 == 4) {
  356. k1 += textDrawingArea.getTextWidth("From");
  357. }
  358. if (byte0 == 1) {
  359. modIcons[0].drawSprite(k1 - 1, yPos - 11);
  360. k1 += 12;
  361. } else if (byte0 == 2) {
  362. modIcons[2].drawSprite(k1 - 2, yPos - 13);
  363. k1 += 12;
  364. } else if (byte0 == 3) {
  365. modIcons[1].drawSprite(k1 - 1, yPos - 11);
  366. k1 += 12;
  367. } else if (byte0 == 4) {
  368. modIcons[3].drawSprite(k1, yPos - 10);
  369. k1 += 12;
  370. } else if (byte0 == 5) {
  371. modIcons[4].drawSprite(k1, yPos - 10);
  372. k1 += 12;
  373. } else if (byte0 == 6) {
  374. modIcons[5].drawSprite(k1, yPos - 10);
  375. k1 += 12;
  376. } else if (byte0 == 7) {
  377. modIcons[6].drawSprite(k1, yPos - 10);
  378. k1 += 12;
  379. } else if (byte0 == 8) {
  380. modIcons[7].drawSprite(k1, yPos - 10);
  381. k1 += 12;
  382. } else if (byte0 == 9) {
  383. modIcons[8].drawSprite(k1, yPos - 10);
  384. k1 += 12;
  385. } else if (byte0 == 10) {
  386. modIcons[9].drawSprite(k1, yPos - 10);
  387. k1 += 12;
  388. } else if (byte0 == 11) {
  389. modIcons[10].drawSprite(k1, yPos - 10);
  390. k1 += 12;
  391. }
  392. newRegularFont.drawBasicString(s1 + ":", k1,
  393. yPos, 0, -1);
  394. k1 += newRegularFont.getTextWidth(s1) + 8;
  395. newRegularFont.drawBasicString(chatMessages[k],
  396. k1, yPos, 0x800000, -1);
  397. }
  398. j++;
  399. j77++;
  400. }
  401. }
  402. if (chatType == 4
  403. && (tradeMode == 0 || tradeMode == 1
  404. && isFriendOrSelf(s1))) {
  405. if (chatTypeView == 3 || chatTypeView == 0) {
  406. if (yPos > 0 && yPos < 210)
  407. newRegularFont.drawBasicString(s1 + " "
  408. + chatMessages[k], 11, yPos, 0x800080,
  409. -1);
  410. j++;
  411. j77++;
  412. }
  413. }
  414. if (chatType == 5 && splitPrivateChat == 0
  415. && privateChatMode < 2) {
  416. if (chatTypeView == 2 || chatTypeView == 0) {
  417. if (yPos > 0 && yPos < 210)
  418. newRegularFont.drawBasicString(chatMessages[k],
  419. 11, yPos, 0x800000, -1);
  420. j++;
  421. j77++;
  422. }
  423. }
  424. if (chatType == 6
  425. && (splitPrivateChat == 0 || chatTypeView == 2)
  426. && privateChatMode < 2) {
  427. if (chatTypeView == 2 || chatTypeView == 0) {
  428. if (yPos > 0 && yPos < 210) {
  429. newRegularFont.drawBasicString(
  430. "To " + s1 + ":", 11, yPos, 0, -1);
  431. newRegularFont.drawBasicString(
  432. chatMessages[k],
  433. 15 + newRegularFont.getTextWidth("To :"
  434. + s1), yPos, 0x800000, -1);
  435. }
  436. j++;
  437. j77++;
  438. }
  439. }
  440. if (chatType == 11 && (clanChatMode == 0)) {
  441. if (chatTypeView == 11 || chatTypeView == 0) {
  442. if (yPos > 0 && yPos < 210)
  443. newRegularFont.drawBasicString(s1 + " "
  444. + chatMessages[k], 8, yPos, 0x7e3200,
  445. -1);
  446. j++;
  447. j77++;
  448. }
  449. }
  450. if (chatType == 13 && chatTypeView == 12) {
  451. if (yPos > 0 && yPos < 210)
  452. newRegularFont.drawBasicString(s1 + " "
  453. + chatMessages[k], 8, yPos, 0x7e3200, -1);
  454. j++;
  455. j77++;
  456. }
  457. if (chatType == 8
  458. && (tradeMode == 0 || tradeMode == 1
  459. && isFriendOrSelf(s1))) {
  460. if (chatTypeView == 3 || chatTypeView == 0) {
  461. if (yPos > 0 && yPos < 210)
  462. newRegularFont.drawBasicString(s1 + " "
  463. + chatMessages[k], 11, yPos, 0x7e3200,
  464. -1);
  465. j++;
  466. j77++;
  467. }
  468. if (chatType == 11 && (clanChatMode == 0)) {
  469. if (chatTypeView == 11) {
  470. if (yPos > 0 && yPos < 110)
  471. newRegularFont.drawBasicString(s1 + " "
  472. + chatMessages[k], 19, yPos,
  473. 0x7e3200, -1);
  474. j++;
  475. j77++;
  476. }
  477. }
  478. if (chatType == 12) {
  479. if (chatTypeView == 11 || chatTypeView == 0) {
  480. if (yPos > 3 && yPos < 130) {
  481. String title = "<col=0000FF>"
  482. + clanTitles[k] + "</col>";
  483. String username = (chatRights[k] > 0 ? "<img="
  484. + (chatRights[k] - 1) + ">"
  485. : "")
  486. + TextClass.fixName(chatNames[k]);
  487. String message = "<col=800000>"
  488. + chatMessages[k] + "</col>";
  489. newRegularFont.drawBasicString("[" + title
  490. + "] " + username + ": " + message,
  491. 11, yPos, 0, -1);
  492. }
  493. j++;
  494. j77++;
  495. }
  496. }
  497. }
  498. if (chatType == 16) {
  499. int j2 = 40 + 11;
  500. String clanname = clanList[k];
  501. int clanNameWidth = textDrawingArea
  502. .getTextWidth(clanname);
  503. if (chatTypeView == 11 || chatTypeView == 0) {
  504. if (yPos > 0 && yPos < 110)
  505. switch (chatRights[k]) {
  506. case 1:
  507. j2 += clanNameWidth;
  508. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  509. j2 += 15;
  510. break;
  511. case 2:
  512. j2 += clanNameWidth;
  513. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  514. j2 += 15;
  515. break;
  516. case 3:
  517. j2 += clanNameWidth;
  518. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  519. j2 += 15;
  520. break;
  521. case 4:
  522. j2 += clanNameWidth;
  523. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  524. j2 += 15;
  525. break;
  526. default:
  527. j2 += clanNameWidth;
  528. break;
  529. }
  530. newRegularFont
  531. .drawBasicString("[", 19, yPos, 0, -1);
  532. newRegularFont.drawBasicString("]",
  533. clanNameWidth + 16 + 11, yPos, 0, -1);
  534. newRegularFont.drawBasicString(""
  535. + capitalize(clanname) + "", 25, yPos, 255,
  536. -1);
  537. newRegularFont.drawBasicString(
  538. capitalize(chatNames[k]) + ":", j2 - 17,
  539. yPos);
  540. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  541. newRegularFont.drawBasicString(
  542. capitalize(chatMessages[k]), j2 - 16, yPos,
  543. 0x800000, -1);
  544.  
  545. j++;
  546. j77++;
  547. }
  548. }
  549. }
  550. DrawingArea.defaultDrawingAreaSize();
  551. anInt1211 = j * 14 + 7 + 5;
  552. if (anInt1211 < 111)
  553. anInt1211 = 111;
  554. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  555. String fixedString;
  556. if (myPlayer != null && myPlayer.name != null) {
  557. if (myPlayer.title.length() > 0) {
  558. fixedString = "<col="+myPlayer.titleColor+">" + myPlayer.title + "</col>" + " " + myPlayer.name;
  559. } else {
  560. fixedString = myPlayer.name;
  561. }
  562. } else {
  563. fixedString = TextClass.fixName(capitalize(myUsername));
  564. }
  565. String s;
  566. if (myPlayer != null && myPlayer.name != null)
  567. s = myPlayer.title + " " + myPlayer.name;
  568. else
  569. s = TextClass.fixName(capitalize(myUsername));
  570. int xPos = 0;
  571. int yPos = 0;
  572. if (myPrivilege == 0) { // Player
  573. newRegularFont
  574. .drawBasicString(fixedString + "", 11, 133, 0, -1);
  575. textDrawingArea.method385(0, ": ", 133, (8) + textDrawingArea.getTextWidth(s));
  576. newRegularFont.drawBasicString(inputString + ("*"),
  577. 9 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
  578. DrawingArea.method339(121, 0x807660, 506, 7);
  579. } else if (myPrivilege == 1) { // Moderator
  580. modIcons[0].drawSprite(10 + xPos, 122 + yPos);
  581. xPos += 14;
  582. newRegularFont
  583. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  584. textDrawingArea.method385(0, ": ", 133,
  585. (20 + textDrawingArea.getTextWidth(s)));
  586. newRegularFont.drawBasicString(inputString
  587. + ("*"),
  588. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  589. -1);
  590. DrawingArea.method339(121, 0x807660, 506, 7);
  591. } else if (myPrivilege == 2) { // Administrator
  592. modIcons[1].drawSprite(10 + xPos, 122 + yPos);
  593. xPos += 14;
  594. newRegularFont
  595. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  596. textDrawingArea.method385(0, ": ", 133,
  597. (20 + textDrawingArea.getTextWidth(s)));
  598. newRegularFont.drawBasicString(inputString
  599. + ("*"),
  600. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  601. -1);
  602. DrawingArea.method339(121, 0x807660, 506, 7);
  603. } else if (myPrivilege == 3) { // Developer
  604. modIcons[2].drawSprite(10 + xPos, 121 + yPos);
  605. xPos += 14;
  606. newRegularFont
  607. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  608. textDrawingArea.method385(0, ": ", 133,
  609. (20 + textDrawingArea.getTextWidth(s)));
  610. newRegularFont.drawBasicString(inputString
  611. + ("*"),
  612. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  613. -1);
  614. DrawingArea.method339(121, 0x807660, 506, 7);
  615. } else if (myPrivilege == 4) { // Donator
  616. modIcons[3].drawSprite(10 + xPos, 122 + yPos);
  617. xPos += 14;
  618. newRegularFont
  619. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  620. textDrawingArea.method385(0, ": ", 133,
  621. (20 + textDrawingArea.getTextWidth(s)));
  622. newRegularFont.drawBasicString(inputString
  623. + ("*"),
  624. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  625. -1);
  626. DrawingArea.method339(121, 0x807660, 506, 7);
  627. } else if (myPrivilege == 5) { // Super Donator
  628. modIcons[4].drawSprite(10 + xPos, 122 + yPos);
  629. xPos += 14;
  630. newRegularFont
  631. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  632. textDrawingArea.method385(0, ": ", 133,
  633. (20 + textDrawingArea.getTextWidth(s)));
  634. newRegularFont.drawBasicString(inputString
  635. + ("*"),
  636. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  637. -1);
  638. DrawingArea.method339(121, 0x807660, 506, 7);
  639. } else if (myPrivilege == 6) { // Extreme Donator
  640. modIcons[5].drawSprite(10 + xPos, 122 + yPos);
  641. xPos += 14;
  642. newRegularFont
  643. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  644. textDrawingArea.method385(0, ": ", 133,
  645. (20 + textDrawingArea.getTextWidth(s)));
  646. newRegularFont.drawBasicString(inputString
  647. + ("*"),
  648. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  649. -1);
  650. DrawingArea.method339(121, 0x807660, 506, 7);
  651. } else if (myPrivilege == 7) { // Extreme Donator
  652. modIcons[6].drawSprite(10 + xPos, 122 + yPos);
  653. xPos += 14;
  654. newRegularFont
  655. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  656. textDrawingArea.method385(0, ": ", 133,
  657. (20 + textDrawingArea.getTextWidth(s)));
  658. newRegularFont.drawBasicString(inputString
  659. + ("*"),
  660. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  661. -1);
  662. DrawingArea.method339(121, 0x807660, 506, 7);
  663. } else if (myPrivilege == 8) { // Respected Member
  664. modIcons[7].drawSprite(10 + xPos, 122 + yPos);
  665. xPos += 14;
  666. newRegularFont
  667. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  668. textDrawingArea.method385(0, ": ", 133,
  669. (20 + textDrawingArea.getTextWidth(s)));
  670. newRegularFont.drawBasicString(inputString
  671. + ("*"),
  672. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  673. -1);
  674. DrawingArea.method339(121, 0x807660, 506, 7);
  675. } else if (myPrivilege == 9) { // Veteran
  676. modIcons[8].drawSprite(10 + xPos, 122 + yPos);
  677. xPos += 14;
  678. newRegularFont
  679. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  680. textDrawingArea.method385(0, ": ", 133,
  681. (20 + textDrawingArea.getTextWidth(s)));
  682. newRegularFont.drawBasicString(inputString
  683. + ("*"),
  684. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  685. -1);
  686. DrawingArea.method339(121, 0x807660, 506, 7);
  687. } else if (myPrivilege == 10) { // Veteran
  688. modIcons[9].drawSprite(10 + xPos, 122 + yPos);
  689. xPos += 14;
  690. newRegularFont
  691. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  692. textDrawingArea.method385(0, ": ", 133,
  693. (20 + textDrawingArea.getTextWidth(s)));
  694. newRegularFont.drawBasicString(inputString
  695. + ("*"),
  696. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  697. -1);
  698. DrawingArea.method339(121, 0x807660, 506, 7);
  699. } else if (myPrivilege == 11) { // Veteran
  700. modIcons[10].drawSprite(10 + xPos, 122 + yPos);
  701. xPos += 14;
  702. newRegularFont
  703. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  704. textDrawingArea.method385(0, ": ", 133,
  705. (20 + textDrawingArea.getTextWidth(s)));
  706. newRegularFont.drawBasicString(inputString
  707. + ("*"),
  708. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  709. -1);
  710. DrawingArea.method339(121, 0x807660, 506, 7);
  711. }
  712. }
  713. if (menuOpen && menuScreenArea == 2) {
  714. drawMenu();
  715. }
  716. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  717. aRSImageProducer_1165.initDrawingArea();
  718. Texture.anIntArray1472 = anIntArray1182;
  719. }
  720.  
  721. private String clanUsername;
  722. private String clanMessage;
  723. private String clanTitle;
  724. private final String[] clanTitles;
  725. private int channelRights;
  726.  
  727. @Override
  728. public void init() {
  729. try {
  730. nodeID = 1;
  731. portOff = 0;
  732. setHighMem();
  733. isMembers = true;
  734. signlink.storeid = 32;
  735. signlink.startpriv(InetAddress.getLocalHost());
  736. initClientFrame(503, 765);
  737. instance = this;
  738. } catch (Exception exception) {
  739. return;
  740. }
  741. try {
  742. readSettings();
  743. } catch (IOException e) {
  744. }
  745. }
  746.  
  747. @Override
  748. public void startRunnable(Runnable runnable, int i) {
  749. if (i > 10)
  750. i = 10;
  751. if (signlink.mainapp != null) {
  752. signlink.startthread(runnable, i);
  753. } else {
  754. super.startRunnable(runnable, i);
  755. }
  756. }
  757.  
  758. public Socket openSocket(int port) throws IOException {
  759. return new Socket(InetAddress.getByName(server), port);
  760. }
  761.  
  762. public boolean processMenuClick() {
  763. if (activeInterfaceType != 0)
  764. return false;
  765. int j = super.clickMode3;
  766. if (spellSelected == 1 && super.saveClickX >= 516
  767. && super.saveClickY >= 160 && super.saveClickX <= 765
  768. && super.saveClickY <= 205)
  769. j = 0;
  770. if (menuOpen) {
  771. if (j != 1) {
  772. int k = super.mouseX;
  773. int j1 = super.mouseY;
  774. if (menuScreenArea == 0) {
  775. k -= 4;
  776. j1 -= 4;
  777. }
  778. if (menuScreenArea == 1) {
  779. k -= 519;
  780. j1 -= 168;
  781. }
  782. if (menuScreenArea == 2) {
  783. k -= 17;
  784. j1 -= 338;
  785. }
  786. if (menuScreenArea == 3) {
  787. k -= 519;
  788. j1 -= 0;
  789. }
  790. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  791. || j1 < menuOffsetY - 10
  792. || j1 > menuOffsetY + menuHeight + 10) {
  793. menuOpen = false;
  794. if (menuScreenArea == 1)
  795. needDrawTabArea = true;
  796. if (menuScreenArea == 2)
  797. inputTaken = true;
  798. }
  799. }
  800. if (j == 1) {
  801. int l = menuOffsetX;
  802. int k1 = menuOffsetY;
  803. int i2 = menuWidth;
  804. int k2 = super.saveClickX;
  805. int l2 = super.saveClickY;
  806. if (menuScreenArea == 0) {
  807. k2 -= 4;
  808. l2 -= 4;
  809. }
  810. if (menuScreenArea == 1) {
  811. k2 -= 519;
  812. l2 -= 168;
  813. }
  814. if (menuScreenArea == 2) {
  815. k2 -= 17;
  816. l2 -= 338;
  817. }
  818. if (menuScreenArea == 3) {
  819. k2 -= 519;
  820. l2 -= 0;
  821. }
  822. int i3 = -1;
  823. for (int j3 = 0; j3 < menuActionRow; j3++) {
  824. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  825. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  826. i3 = j3;
  827. }
  828. if (i3 != -1)
  829. doAction(i3);
  830. menuOpen = false;
  831. if (menuScreenArea == 1)
  832. needDrawTabArea = true;
  833. if (menuScreenArea == 2) {
  834. inputTaken = true;
  835. }
  836. }
  837. return true;
  838. } else {
  839. if (j == 1 && menuActionRow > 0) {
  840. int i1 = menuActionID[menuActionRow - 1];
  841. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  842. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  843. || i1 == 847 || i1 == 447 || i1 == 1125) {
  844. int l1 = menuActionCmd2[menuActionRow - 1];
  845. int j2 = menuActionCmd3[menuActionRow - 1];
  846. RSInterface class9 = RSInterface.interfaceCache[j2];
  847. if (class9.aBoolean259 || class9.aBoolean235) {
  848. aBoolean1242 = false;
  849. anInt989 = 0;
  850. anInt1084 = j2;
  851. anInt1085 = l1;
  852. activeInterfaceType = 2;
  853. anInt1087 = super.saveClickX;
  854. anInt1088 = super.saveClickY;
  855. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  856. activeInterfaceType = 1;
  857. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  858. activeInterfaceType = 3;
  859. return true;
  860. }
  861. }
  862. }
  863. if (j == 1
  864. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  865. && menuActionRow > 2)
  866. j = 2;
  867. if (j == 1 && menuActionRow > 0)
  868. doAction(menuActionRow - 1);
  869. if (j == 2 && menuActionRow > 0)
  870. determineMenuSize();
  871. return false;
  872. }
  873. }
  874.  
  875. public static int totalRead = 0;
  876.  
  877. public static String getFileNameWithoutExtension(String fileName) {
  878. File tmpFile = new File(fileName);
  879. tmpFile.getName();
  880. int whereDot = tmpFile.getName().lastIndexOf('.');
  881. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  882. return tmpFile.getName().substring(0, whereDot);
  883. }
  884. return "";
  885. }
  886.  
  887. public String indexLocation(int cacheIndex, int index) {
  888. return signlink.findcachedir() + "index" + cacheIndex + "/"
  889. + (index != -1 ? index + ".gz" : "");
  890. }
  891.  
  892. public void repackCacheIndex(int cacheIndex) {
  893. System.out.println("Started repacking index " + cacheIndex + ".");
  894. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  895. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  896. try {
  897. for (int index = 0; index < indexLength; index++) {
  898. String name = getFileNameWithoutExtension(file[index]
  899. .toString());
  900. if (name.isEmpty()) {
  901. continue;
  902. }
  903. int fileIndex = Integer.parseInt(name);
  904. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  905. if (data != null && data.length > 0) {
  906. decompressors[cacheIndex].method234(data.length, data,
  907. fileIndex);
  908. System.out.println("Repacked " + fileIndex + ".");
  909. } else {
  910. System.out.println("Unable to locate index " + fileIndex
  911. + ".");
  912. }
  913. }
  914. } catch (Exception e) {
  915. System.out.println("Error packing cache index " + cacheIndex + ".");
  916. e.printStackTrace();
  917. }
  918. System.out.println("Finished repacking " + cacheIndex + ".");
  919. }
  920.  
  921. public byte[] fileToByteArray(int cacheIndex, int index) {
  922. try {
  923. if (indexLocation(cacheIndex, index).length() <= 0
  924. || indexLocation(cacheIndex, index) == null) {
  925. return null;
  926. }
  927. File file = new File(indexLocation(cacheIndex, index));
  928. byte[] fileData = new byte[(int) file.length()];
  929. FileInputStream fis = new FileInputStream(file);
  930. fis.read(fileData);
  931. fis.close();
  932. return fileData;
  933. } catch (Exception e) {
  934. return null;
  935. }
  936. }
  937.  
  938. public void preloadModels() {
  939. File models = new File(signlink.findcachedir() + "/Raw/");
  940. File[] modelList = models.listFiles();
  941. for (int model = 0; model < modelList.length; model++) {
  942. String modelID = modelList[model].getName();
  943. byte[] modelData = ReadFile(signlink.findcachedir() + "/Raw/"
  944. + modelID);
  945. Model.method460(modelData,
  946. Integer.parseInt(getFileNameWithoutExtension(modelID)));
  947. }
  948. }
  949.  
  950. public static final byte[] ReadFile(String s) {
  951. try {
  952. byte abyte0[];
  953. File file = new File(s);
  954. int i = (int) file.length();
  955. abyte0 = new byte[i];
  956. DataInputStream datainputstream = new DataInputStream(
  957. new BufferedInputStream(new FileInputStream(s)));
  958. datainputstream.readFully(abyte0, 0, i);
  959. datainputstream.close();
  960. totalRead++;
  961. return abyte0;
  962. } catch (Exception e) {
  963. System.out.println((new StringBuilder()).append("Read Error: ")
  964. .append(s).toString());
  965. return null;
  966. }
  967. }
  968.  
  969. public void addModels() {
  970. for (int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  971. byte[] abyte0 = getModel(ModelIndex);
  972. if (abyte0 != null && abyte0.length > 0) {
  973. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  974. }
  975. }
  976. }
  977.  
  978. public byte[] getModel(int Index) {
  979. try {
  980. File Model = new File(signlink.findcachedir() + "./pModels/"
  981. + Index + ".gz");
  982. byte[] aByte = new byte[(int) Model.length()];
  983. FileInputStream fis = new FileInputStream(Model);
  984. fis.read(aByte);
  985. System.out.println("" + Index + " aByte = [" + aByte + "]!");
  986. fis.close();
  987. return aByte;
  988. } catch (Exception e) {
  989. return null;
  990. }
  991. }
  992.  
  993. public void addMaps() {
  994. for (int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  995. byte[] abyte0 = getMaps(MapIndex);
  996. if (abyte0 != null && abyte0.length > 0) {
  997. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  998. System.out.println("Maps Added");
  999. }
  1000. }
  1001. }
  1002.  
  1003. public byte[] getMaps(int Index) {
  1004. try {
  1005. File Map = new File(signlink.findcachedir() + "./pMaps/" + Index
  1006. + ".gz");
  1007. byte[] aByte = new byte[(int) Map.length()];
  1008. FileInputStream fis = new FileInputStream(Map);
  1009. fis.read(aByte);
  1010. pushMessage("aByte = [" + aByte + "]!", 0, "");
  1011. fis.close();
  1012. return aByte;
  1013. } catch (Exception e) {
  1014. return null;
  1015. }
  1016. }
  1017.  
  1018. public void saveMidi(boolean flag, byte abyte0[]) {
  1019. signlink.midifade = flag ? 1 : 0;
  1020. signlink.midisave(abyte0, abyte0.length);
  1021. }
  1022.  
  1023. public int positions[] = new int[2000];
  1024. public int landScapes[] = new int[2000];
  1025. public int objects[] = new int[2000];
  1026.  
  1027. public final void method22() {
  1028. try {
  1029. anInt985 = -1;
  1030. aClass19_1056.removeAll();
  1031. aClass19_1013.removeAll();
  1032. Texture.method366();
  1033. unlinkMRUNodes();
  1034. loadNewObjects();
  1035. worldController.initToNull();
  1036.  
  1037. System.gc();
  1038. for (int i = 0; i < 4; i++)
  1039. aClass11Array1230[i].method210();
  1040.  
  1041. for (int l = 0; l < 4; l++) {
  1042. for (int k1 = 0; k1 < 104; k1++) {
  1043. for (int j2 = 0; j2 < 104; j2++)
  1044. byteGroundArray[l][k1][j2] = 0;
  1045.  
  1046. }
  1047.  
  1048. }
  1049.  
  1050. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  1051. intGroundArray);
  1052.  
  1053. int k2 = aByteArrayArray1183.length;
  1054.  
  1055. int k18 = 62;
  1056. for (int A = 0; A < k2; A++)
  1057. for (int B = 0; B < 2000; B++)
  1058. if (anIntArray1234[A] == positions[B]) {
  1059. anIntArray1235[A] = landScapes[B];
  1060. anIntArray1236[A] = objects[B];
  1061. }
  1062.  
  1063. stream.createFrame(0);
  1064.  
  1065. if (!aBoolean1159) {
  1066. for (int i3 = 0; i3 < k2; i3++) {
  1067. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1068. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1069.  
  1070. byte abyte0[] = aByteArrayArray1183[i3];
  1071. if (FileOperations
  1072. .FileExists("./.ss_474/Null.map/mapsFloor/"
  1073. + anIntArray1235[i3] + ".dat"))
  1074. abyte0 = FileOperations
  1075. .ReadFile("./.ss_474/Null.map/mapsFloor/"
  1076. + anIntArray1235[i3] + ".dat");
  1077.  
  1078. if (abyte0 != null)
  1079. // objectManager.method180(abyte0, k5, i4, (anInt1069 -
  1080. // 6) * 8, (anInt1070 - 6) * 8, (byte)4,
  1081. // aClass11Array1230);
  1082. objectManager.method180(abyte0, k5, i4,
  1083. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  1084. aClass11Array1230);
  1085. }
  1086.  
  1087. for (int j4 = 0; j4 < k2; j4++) {
  1088. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1089. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1090. byte abyte2[] = aByteArrayArray1183[j4];
  1091. if (abyte2 == null && anInt1070 < 800)
  1092. // ObjectManager.method174(k7, 64, 0, 64, l5);
  1093. objectManager.method174(k7, 64, 64, l5);
  1094. }
  1095.  
  1096. anInt1097++;
  1097. if (anInt1097 > 160) {
  1098. anInt1097 = 0;
  1099. stream.createFrame(238);
  1100. stream.writeWordBigEndian(96);
  1101.  
  1102. }
  1103. stream.createFrame(0);
  1104.  
  1105. for (int i6 = 0; i6 < k2; i6++) {
  1106. byte abyte1[] = aByteArrayArray1247[i6];
  1107. if (FileOperations
  1108. .FileExists("./.ss_474/Null.map/spawnObject/"
  1109. + anIntArray1236[i6] + ".dat"))
  1110. abyte1 = FileOperations
  1111. .ReadFile("./.ss_474/Null.map/spawnObject/"
  1112. + anIntArray1236[i6] + ".dat");
  1113. if (abyte1 != null) {
  1114. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1115. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1116. // ObjectManager.method190(l8, aClass11Array1230, k9, 7,
  1117. // aClass25_946, abyte1);
  1118. objectManager.method190(l8, aClass11Array1230, k9,
  1119. worldController, abyte1);
  1120. }
  1121. }
  1122.  
  1123. }
  1124. if (aBoolean1159) {
  1125. for (int j3 = 0; j3 < 4; j3++) {
  1126. for (int k4 = 0; k4 < 13; k4++) {
  1127. for (int j6 = 0; j6 < 13; j6++) {
  1128. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1129. if (l7 != -1) {
  1130. int i9 = l7 >> 24 & 3;
  1131. int l9 = l7 >> 1 & 3;
  1132. int j10 = l7 >> 14 & 0x3ff;
  1133. int l10 = l7 >> 3 & 0x7ff;
  1134. int j11 = (j10 / 8 << 8) + l10 / 8;
  1135. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1136. if (anIntArray1234[l11] != j11
  1137. || aByteArrayArray1183[l11] == null)
  1138. continue;
  1139. // ObjectManager.method179(i9, l9,
  1140. // aClass11Array1230, 9, k4 * 8, (j10 & 7) *
  1141. // 8, aByteArrayArray1183[l11], (l10 & 7) *
  1142. // 8, j3, j6 * 8);
  1143. objectManager.method179(i9, l9,
  1144. aClass11Array1230, k4 * 8,
  1145. (j10 & 7) * 8,
  1146. aByteArrayArray1183[l11],
  1147. (l10 & 7) * 8, j3, j6 * 8);
  1148. break;
  1149. }
  1150.  
  1151. }
  1152. }
  1153.  
  1154. }
  1155.  
  1156. }
  1157.  
  1158. for (int l4 = 0; l4 < 13; l4++) {
  1159. for (int k6 = 0; k6 < 13; k6++) {
  1160. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1161. if (i8 == -1)
  1162. // ObjectManager.method174(k6 * 8, 8, 0, 8, l4 * 8);
  1163. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1164. }
  1165.  
  1166. }
  1167.  
  1168. stream.createFrame(0);
  1169.  
  1170. for (int l6 = 0; l6 < 4; l6++) {
  1171. for (int j8 = 0; j8 < 13; j8++) {
  1172. for (int j9 = 0; j9 < 13; j9++) {
  1173. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1174. if (i10 != -1) {
  1175. int k10 = i10 >> 24 & 3;
  1176. int i11 = i10 >> 1 & 3;
  1177. int k11 = i10 >> 14 & 0x3ff;
  1178. int i12 = i10 >> 3 & 0x7ff;
  1179. int j12 = (k11 / 8 << 8) + i12 / 8;
  1180. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1181. if (anIntArray1234[k12] != j12
  1182. || aByteArrayArray1247[k12] == null)
  1183. continue;
  1184. if (FileOperations
  1185. .FileExists("./Cache/FloorMaps/"
  1186. + anIntArray1235[k12]
  1187. + ".dat"))
  1188. FileOperations.ReadFile(signlink
  1189. .findcachedir()
  1190. + "FloorMaps/"
  1191. + anIntArray1235[k12] + ".dat");
  1192. // ObjectManager.method183(aClass11Array1230,
  1193. // aClass25_946, k10, j8 * 8, (i12 & 7) * 8,
  1194. // true, l6, abyte0, (k11 & 7) * 8, i11, j9
  1195. // * 8);
  1196. objectManager.method183(aClass11Array1230,
  1197. worldController, k10, j8 * 8,
  1198. (i12 & 7) * 8, l6,
  1199. aByteArrayArray1247[k12],
  1200. (k11 & 7) * 8, i11, j9 * 8);
  1201. break;
  1202. }
  1203.  
  1204. }
  1205. }
  1206.  
  1207. }
  1208.  
  1209. }
  1210.  
  1211. }
  1212. stream.createFrame(0);
  1213. objectManager.method171(aClass11Array1230, worldController);
  1214. aRSImageProducer_1165.initDrawingArea();
  1215. stream.createFrame(0);
  1216.  
  1217. int k3 = ObjectManager.anInt145;
  1218. if (k3 > plane)
  1219. k3 = plane;
  1220.  
  1221. if (k3 < plane - 1)
  1222. k3 = plane - 1;
  1223. if (lowMem)
  1224.  
  1225. worldController.method275(ObjectManager.anInt145);
  1226. else
  1227. worldController.method275(0);
  1228. for (int i5 = 0; i5 < 104; i5++) {
  1229. for (int i7 = 0; i7 < 104; i7++)
  1230. spawnGroundItem(i5, i7);
  1231.  
  1232. }
  1233.  
  1234. anInt1051++;
  1235. if (anInt1051 > 98) {
  1236. anInt1051 = 0;
  1237. stream.createFrame(150);
  1238.  
  1239. }
  1240. method63();
  1241. } catch (Exception e) {
  1242. e.printStackTrace();
  1243. }
  1244. ObjectDef.mruNodes1.unlinkAll();
  1245.  
  1246. if (super.gameFrame != null) {
  1247. stream.createFrame(210);
  1248.  
  1249. stream.writeDWord(0x3f008edd);
  1250. }
  1251. System.gc();
  1252. Texture.method367();
  1253. onDemandFetcher.method566();
  1254.  
  1255. int k = (anInt1069 - 6) / 8 - 1;
  1256. int j1 = (anInt1069 + 6) / 8 + 1;
  1257. int i2 = (anInt1070 - 6) / 8 - 1;
  1258. int l2 = (anInt1070 + 6) / 8 + 1;
  1259. if (aBoolean1141) {
  1260. k = 49;
  1261. j1 = 50;
  1262. i2 = 49;
  1263. l2 = 50;
  1264. }
  1265. for (int l3 = k; l3 <= j1; l3++) {
  1266. for (int j5 = i2; j5 <= l2; j5++)
  1267. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1268. int j7 = onDemandFetcher.method562(0, j5, l3);
  1269. if (j7 != -1)
  1270. onDemandFetcher.method560(j7, 3);
  1271. int k8 = onDemandFetcher.method562(1, j5, l3);
  1272. if (k8 != -1)
  1273. onDemandFetcher.method560(k8, 3);
  1274. }
  1275.  
  1276. }
  1277.  
  1278. }
  1279.  
  1280. public void unlinkMRUNodes() {
  1281. ObjectDef.mruNodes1.unlinkAll();
  1282. ObjectDef.mruNodes2.unlinkAll();
  1283. EntityDef.mruNodes.unlinkAll();
  1284. ItemDef.mruNodes2.unlinkAll();
  1285. ItemDef.mruNodes1.unlinkAll();
  1286. Player.mruNodes.unlinkAll();
  1287. SpotAnim.aMRUNodes_415.unlinkAll();
  1288. }
  1289.  
  1290. public void method24(int i) {
  1291. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1292. int j = ai.length;
  1293. for (int k = 0; k < j; k++)
  1294. ai[k] = 0;
  1295.  
  1296. for (int l = 1; l < 103; l++) {
  1297. int i1 = 24628 + (103 - l) * 512 * 4;
  1298. for (int k1 = 1; k1 < 103; k1++) {
  1299. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1300. worldController.method309(ai, i1, i, k1, l);
  1301. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1302. worldController.method309(ai, i1, i + 1, k1, l);
  1303. i1 += 4;
  1304. }
  1305.  
  1306. }
  1307.  
  1308. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16)
  1309. + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  1310. + ((238 + (int) (Math.random() * 20D)) - 10);
  1311. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  1312. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1313. for (int i2 = 1; i2 < 103; i2++) {
  1314. for (int j2 = 1; j2 < 103; j2++) {
  1315. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1316. method50(i2, j1, j2, l1, i);
  1317. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1318. method50(i2, j1, j2, l1, i + 1);
  1319. }
  1320.  
  1321. }
  1322.  
  1323. aRSImageProducer_1165.initDrawingArea();
  1324. anInt1071 = 0;
  1325. for (int k2 = 0; k2 < 104; k2++) {
  1326. for (int l2 = 0; l2 < 104; l2++) {
  1327. int i3 = worldController.method303(plane, k2, l2);
  1328. if (i3 != 0) {
  1329. i3 = i3 >> 14 & 0x7fff;
  1330. int j3 = ObjectDef.forID(i3).anInt746;
  1331. if (j3 >= 0) {
  1332. int k3 = k2;
  1333. int l3 = l2;
  1334. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36
  1335. && j3 != 46 && j3 != 47 && j3 != 48) {
  1336. byte byte0 = 104;
  1337. byte byte1 = 104;
  1338. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1339. for (int i4 = 0; i4 < 10; i4++) {
  1340. int j4 = (int) (Math.random() * 4D);
  1341. if (j4 == 0 && k3 > 0 && k3 > k2 - 3
  1342. && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1343. k3--;
  1344. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3
  1345. && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1346. k3++;
  1347. if (j4 == 2 && l3 > 0 && l3 > l2 - 3
  1348. && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1349. l3--;
  1350. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3
  1351. && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1352. l3++;
  1353. }
  1354.  
  1355. }
  1356. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1357. anIntArray1072[anInt1071] = k3;
  1358. anIntArray1073[anInt1071] = l3;
  1359. anInt1071++;
  1360. }
  1361. }
  1362. }
  1363.  
  1364. }
  1365.  
  1366. }
  1367.  
  1368. public void spawnGroundItem(int i, int j) {
  1369. NodeList class19 = groundArray[plane][i][j];
  1370. if (class19 == null) {
  1371. worldController.method295(plane, i, j);
  1372. return;
  1373. }
  1374. int k = 0xfa0a1f01;
  1375. Object obj = null;
  1376. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1377. .reverseGetNext()) {
  1378. ItemDef itemDef = ItemDef.forID(item.ID);
  1379. int l = itemDef.value;
  1380. if (itemDef.stackable)
  1381. l *= item.anInt1559 + 1;
  1382. // notifyItemSpawn(item, i + baseX, j + baseY);
  1383.  
  1384. if (l > k) {
  1385. k = l;
  1386. obj = item;
  1387. }
  1388. }
  1389.  
  1390. class19.insertTail(((Node) (obj)));
  1391. Object obj1 = null;
  1392. Object obj2 = null;
  1393. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1394. .reverseGetNext()) {
  1395. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1396. && obj1 == null)
  1397. obj1 = class30_sub2_sub4_sub2_1;
  1398. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1399. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1400. && obj2 == null)
  1401. obj2 = class30_sub2_sub4_sub2_1;
  1402. }
  1403.  
  1404. int i1 = i + (j << 7) + 0x60000000;
  1405. worldController.method281(i, i1, ((Animable) (obj1)),
  1406. method42(plane, j * 128 + 64, i * 128 + 64),
  1407. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1408. }
  1409.  
  1410. public void method26(boolean flag) {
  1411. for (int j = 0; j < npcCount; j++) {
  1412. NPC npc = npcArray[npcIndices[j]];
  1413. int k = 0x20000000 + (npcIndices[j] << 14);
  1414. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1415. continue;
  1416. int l = npc.x >> 7;
  1417. int i1 = npc.y >> 7;
  1418. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1419. continue;
  1420. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1421. && (npc.y & 0x7f) == 64) {
  1422. if (anIntArrayArray929[l][i1] == anInt1265)
  1423. continue;
  1424. anIntArrayArray929[l][i1] = anInt1265;
  1425. }
  1426. if (!npc.desc.aBoolean84)
  1427. k += 0x80000000;
  1428. worldController
  1429. .method285(plane, npc.anInt1552,
  1430. method42(plane, npc.y, npc.x), k, npc.y,
  1431. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1432. npc.aBoolean1541);
  1433. }
  1434. }
  1435.  
  1436. private boolean replayWave() {
  1437. return signlink.wavereplay();
  1438. }
  1439.  
  1440. public void loadError() {
  1441. String s = "ondemand";// was a constant parameter
  1442. System.out.println(s);
  1443. try {
  1444. getAppletContext().showDocument(
  1445. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1446. } catch (Exception exception) {
  1447. exception.printStackTrace();
  1448. }
  1449. do
  1450. try {
  1451. Thread.sleep(1000L);
  1452. } catch (Exception _ex) {
  1453. }
  1454. while (true);
  1455. }
  1456.  
  1457. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
  1458. int i1, int j1) {
  1459. if (class9 == null) {
  1460. return;
  1461. }
  1462. if (class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1463. return;
  1464. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1465. return;
  1466. int k1 = class9.children.length;
  1467. for (int l1 = 0; l1 < k1; l1++) {
  1468. int i2 = class9.childX[l1] + i;
  1469. int j2 = (class9.childY[l1] + l) - j1;
  1470. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1471. if (class9_1 == null) {
  1472. break;
  1473. }
  1474. i2 += class9_1.anInt263;
  1475. j2 += class9_1.anInt265;
  1476. if ((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0)
  1477. && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1478. && i1 < j2 + class9_1.height) {
  1479. if (class9_1.mOverInterToTrigger >= 0)
  1480. anInt886 = class9_1.mOverInterToTrigger;
  1481. else
  1482. anInt886 = class9_1.id;
  1483. }
  1484. if (class9_1.type == 8 && k >= i2 && i1 >= j2
  1485. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1486. anInt1315 = class9_1.id;
  1487. }
  1488. if (class9_1.type == 9 && k >= i2 && i1 >= j2
  1489. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1490. anInt1315 = class9_1.id;
  1491. }
  1492. if (class9_1.type == 5 && k >= i2 && i1 >= j2
  1493. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1494. hoverId = class9_1.id;
  1495. } else {
  1496. hoverId = -1;
  1497. }
  1498. if (class9_1.type == 0) {
  1499. buildInterfaceMenu(i2, class9_1, k, j2, i1,
  1500. class9_1.scrollPosition);
  1501. if (class9_1.scrollMax > class9_1.height)
  1502. if (scrollbarVisible(class9_1))
  1503. method65(i2 + class9_1.width, class9_1.height, k, i1,
  1504. class9_1, j2, true, class9_1.scrollMax);
  1505. } else {
  1506. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
  1507. && k < i2 + class9_1.width && i1 < j2 + class9_1.height + 10) {
  1508. boolean flag = false;
  1509. if (class9_1.contentType != 0)
  1510. flag = buildFriendsListMenu(class9_1);
  1511. if (!flag) {
  1512. menuActionName[menuActionRow] = class9_1.tooltip;
  1513. menuActionID[menuActionRow] = 315;
  1514. menuActionCmd3[menuActionRow] = class9_1.id;
  1515. menuActionRow++;
  1516. }
  1517. }
  1518. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
  1519. && i1 >= j2 && k < i2 + class9_1.width
  1520. && i1 < j2 + class9_1.height) {
  1521. String s = class9_1.selectedActionName;
  1522. if (s.indexOf(" ") != -1)
  1523. s = s.substring(0, s.indexOf(" "));
  1524. menuActionName[menuActionRow] = "Autocast" + "@gre@ "
  1525. + class9_1.spellName;
  1526. menuActionID[menuActionRow] = 104;// autocast
  1527. menuActionCmd3[menuActionRow] = class9_1.id;
  1528. menuActionRow++;
  1529. menuActionName[menuActionRow] = s + " @gre@"
  1530. + class9_1.spellName;
  1531. menuActionID[menuActionRow] = 626;
  1532. menuActionCmd3[menuActionRow] = class9_1.id;
  1533. menuActionRow++;
  1534. }
  1535. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
  1536. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1537. menuActionName[menuActionRow] = "Close";
  1538. menuActionID[menuActionRow] = 200;
  1539. menuActionCmd3[menuActionRow] = class9_1.id;
  1540. menuActionRow++;
  1541. }
  1542. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
  1543. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1544. menuActionName[menuActionRow] = class9_1.tooltip;
  1545. menuActionID[menuActionRow] = 169;
  1546. menuActionCmd3[menuActionRow] = class9_1.id;
  1547. menuActionRow++;
  1548. }
  1549. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
  1550. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1551. menuActionName[menuActionRow] = class9_1.tooltip;
  1552. menuActionID[menuActionRow] = 646;
  1553. menuActionCmd3[menuActionRow] = class9_1.id;
  1554. menuActionRow++;
  1555. }
  1556. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
  1557. && i1 >= j2 && k < i2 + class9_1.width
  1558. && i1 < j2 + class9_1.height) {
  1559. menuActionName[menuActionRow] = class9_1.tooltip;
  1560. menuActionID[menuActionRow] = 679;
  1561. menuActionCmd3[menuActionRow] = class9_1.id;
  1562. menuActionRow++;
  1563. }
  1564. if (class9_1.atActionType == 8 && !aBoolean1149 && k >= i2
  1565. && i1 >= j2 && k < i2 + class9_1.width
  1566. && i1 < j2 + class9_1.height) {
  1567. for (int s1 = 0; s1 < class9_1.tooltips.length; s1++) {
  1568. if (!RSInterface.interfaceCache[32007].isMouseoverTriggered) {
  1569. if (class9_1.id > 32016) {
  1570. continue;
  1571. }
  1572. }
  1573. menuActionName[menuActionRow] = class9_1.tooltips[s1];
  1574. menuActionID[menuActionRow] = 1700 + s1;
  1575. menuActionCmd3[menuActionRow] = class9_1.id;
  1576. menuActionRow++;
  1577. }
  1578. }
  1579. if (class9_1.atActionType == 9 && !aBoolean1149 && k >= i2
  1580. && i1 >= j2 && k < i2 + class9_1.width
  1581. && i1 < j2 + class9_1.height) {
  1582. menuActionName[menuActionRow] = class9_1.tooltip;
  1583. menuActionID[menuActionRow] = 1100;
  1584. menuActionCmd3[menuActionRow] = class9_1.id;
  1585. menuActionRow++;
  1586. }
  1587. if (class9_1.atActionType == 10 && !aBoolean1149 && k >= i2
  1588. && i1 >= j2 && k < i2 + class9_1.width
  1589. && i1 < j2 + class9_1.height) {
  1590. menuActionName[menuActionRow] = class9_1.getMenuItem().getText();
  1591. menuActionID[menuActionRow] = 1200;
  1592. menuActionCmd3[menuActionRow] = class9_1.id;
  1593. menuActionRow++;
  1594. }
  1595. if (k >= i2 && i1 >= j2
  1596. && k < i2 + (class9_1.type == 4 ? 100 : class9_1.width)
  1597. && i1 < j2 + class9_1.height) {
  1598. if (class9_1.actions != null) {
  1599. if ((class9_1.type == 4 && class9_1.message.length() > 0)
  1600. || class9_1.type == 5) {
  1601. for (int action = class9_1.actions.length - 1; action >= 0; action--) {
  1602. if (class9_1.actions[action] != null) {
  1603. menuActionName[menuActionRow] = class9_1.actions[action]
  1604. + (class9_1.type == 4 ? " "
  1605. + class9_1.message : "");
  1606. menuActionID[menuActionRow] = 647;
  1607. menuActionCmd2[menuActionRow] = action;
  1608. menuActionCmd3[menuActionRow] = class9_1.id;
  1609. menuActionRow++;
  1610. }
  1611. }
  1612. }
  1613. }
  1614. }
  1615. if (class9_1.type == 2) {
  1616. int k2 = 0;
  1617. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1618. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1619. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1620. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1621. if (k2 < 20) {
  1622. j3 += class9_1.spritesX[k2];
  1623. k3 += class9_1.spritesY[k2];
  1624. }
  1625. if (k >= j3 && i1 >= k3 && k < j3 + 32
  1626. && i1 < k3 + 32) {
  1627. mouseInvInterfaceIndex = k2;
  1628. lastActiveInvInterface = class9_1.id;
  1629. if (class9_1.inv[k2] > 0) {
  1630. ItemDef itemDef = ItemDef
  1631. .forID(class9_1.inv[k2] - 1);
  1632. if (itemSelected == 1
  1633. && class9_1.isInventoryInterface) {
  1634. if (class9_1.id != anInt1284
  1635. || k2 != anInt1283) {
  1636. menuActionName[menuActionRow] = "Use "
  1637. + selectedItemName
  1638. + " with @lre@"
  1639. + itemDef.name;
  1640. menuActionID[menuActionRow] = 870;
  1641. menuActionCmd1[menuActionRow] = itemDef.id;
  1642. menuActionCmd2[menuActionRow] = k2;
  1643. menuActionCmd3[menuActionRow] = class9_1.id;
  1644. menuActionRow++;
  1645. }
  1646. } else if (spellSelected == 1
  1647. && class9_1.isInventoryInterface) {
  1648. if ((spellUsableOn & 0x10) == 16) {
  1649. menuActionName[menuActionRow] = spellTooltip
  1650. + " @lre@" + itemDef.name;
  1651. menuActionID[menuActionRow] = 543;
  1652. menuActionCmd1[menuActionRow] = itemDef.id;
  1653. menuActionCmd2[menuActionRow] = k2;
  1654. menuActionCmd3[menuActionRow] = class9_1.id;
  1655. menuActionRow++;
  1656. }
  1657. } else {
  1658. if (class9_1.isInventoryInterface) {
  1659. for (int l3 = 4; l3 >= 3; l3--)
  1660. if (itemDef.options != null
  1661. && itemDef.options[l3] != null) {
  1662. menuActionName[menuActionRow] = itemDef.options[l3]
  1663. + " @lre@"
  1664. + itemDef.name;
  1665. if (l3 == 3)
  1666. menuActionID[menuActionRow] = 493;
  1667. if (l3 == 4)
  1668. menuActionID[menuActionRow] = 847;
  1669. menuActionCmd1[menuActionRow] = itemDef.id;
  1670. menuActionCmd2[menuActionRow] = k2;
  1671. menuActionCmd3[menuActionRow] = class9_1.id;
  1672. menuActionRow++;
  1673. } else if (l3 == 4) {
  1674. menuActionName[menuActionRow] = "Drop @lre@"
  1675. + itemDef.name;
  1676. menuActionID[menuActionRow] = 847;
  1677. menuActionCmd1[menuActionRow] = itemDef.id;
  1678. menuActionCmd2[menuActionRow] = k2;
  1679. menuActionCmd3[menuActionRow] = class9_1.id;
  1680. menuActionRow++;
  1681. }
  1682.  
  1683. }
  1684. if (class9_1.usableItemInterface) {
  1685. menuActionName[menuActionRow] = "Use @lre@"
  1686. + itemDef.name;
  1687. menuActionID[menuActionRow] = 447;
  1688. menuActionCmd1[menuActionRow] = itemDef.id;
  1689. // k2 = inventory spot
  1690. // System.out.println(k2);
  1691. menuActionCmd2[menuActionRow] = k2;
  1692. menuActionCmd3[menuActionRow] = class9_1.id;
  1693. menuActionRow++;
  1694. }
  1695. if (class9_1.isInventoryInterface
  1696. && itemDef.options != null) {
  1697. for (int i4 = 2; i4 >= 0; i4--)
  1698. if (itemDef.options[i4] != null) {
  1699. menuActionName[menuActionRow] = itemDef.options[i4]
  1700. + " @lre@"
  1701. + itemDef.name;
  1702. if (i4 == 0)
  1703. menuActionID[menuActionRow] = 74;
  1704. if (i4 == 1)
  1705. menuActionID[menuActionRow] = 454;
  1706. if (i4 == 2)
  1707. menuActionID[menuActionRow] = 539;
  1708. menuActionCmd1[menuActionRow] = itemDef.id;
  1709. menuActionCmd2[menuActionRow] = k2;
  1710. menuActionCmd3[menuActionRow] = class9_1.id;
  1711. menuActionRow++;
  1712. }
  1713.  
  1714. }
  1715. if (class9_1.actions != null) {
  1716. for (int j4 = 6; j4 >= 0; j4--) {
  1717. if (j4 > class9_1.actions.length - 1)
  1718. continue;
  1719. if (class9_1.actions[j4] != null) {
  1720. if (class9_1.parentID == 5292) {
  1721. if (modifiableXValue > 0) {
  1722. if (class9_1.actions.length < 7) {
  1723. class9_1.actions = new String[] {
  1724. "Withdraw 1",
  1725. "Withdraw 5",
  1726. "Withdraw 10",
  1727. "Withdraw All",
  1728. "Withdraw X",
  1729. "Withdraw "
  1730. + modifiableXValue,
  1731. "Withdraw All but one" };
  1732. }
  1733. class9_1.actions[5] = "Withdraw "
  1734. + modifiableXValue;
  1735. }
  1736. }
  1737. menuActionName[menuActionRow] = class9_1.actions[j4]
  1738. + " @lre@"
  1739. + itemDef.name;
  1740. if (j4 == 0)
  1741. menuActionID[menuActionRow] = 632;
  1742. if (j4 == 1)
  1743. menuActionID[menuActionRow] = 78;
  1744. if (j4 == 2)
  1745. menuActionID[menuActionRow] = 867;
  1746. if (j4 == 3)
  1747. menuActionID[menuActionRow] = 431;
  1748. if (j4 == 4)
  1749. menuActionID[menuActionRow] = 53;
  1750. if (class9_1.parentID == 5292) {
  1751. if (class9_1.actions.length < 7) {
  1752. if (j4 == 5)
  1753. menuActionID[menuActionRow] = 291;
  1754. } else {
  1755. if (j4 == 5)
  1756. menuActionID[menuActionRow] = 300;
  1757. if (j4 == 6)
  1758. menuActionID[menuActionRow] = 291;
  1759. }
  1760. }
  1761. menuActionCmd1[menuActionRow] = itemDef.id;
  1762. menuActionCmd2[menuActionRow] = k2;
  1763. menuActionCmd3[menuActionRow] = class9_1.id;
  1764. menuActionRow++;
  1765. }
  1766. }
  1767. }
  1768. if (class9_1.parentID >= 58040
  1769. && class9_1.parentID <= 58048
  1770. || class9_1.parentID >= 32100
  1771. && class9_1.parentID <= 32156
  1772. || class9_1.parentID >= 32200
  1773. && class9_1.parentID <= 32222) {
  1774. return;
  1775. }
  1776. if (class9_1.isItemSearchComponent) {
  1777. menuActionName[menuActionRow] = "Select @lre@"
  1778. + itemDef.name;
  1779. menuActionID[menuActionRow] = 1130;
  1780. menuActionCmd1[menuActionRow] = itemDef.id;
  1781. menuActionCmd2[menuActionRow] = k2;
  1782. menuActionCmd3[menuActionRow] = class9_1.id;
  1783. menuActionRow++;
  1784. } else {
  1785. if (!RSInterface.interfaceCache[32007].isMouseoverTriggered) {
  1786. if (class9_1.id > 32016) {
  1787. continue;
  1788. }
  1789. }
  1790. menuActionName[menuActionRow] = "Examine @lre@"
  1791. + itemDef.name;
  1792. menuActionID[menuActionRow] = 1125;
  1793. menuActionCmd1[menuActionRow] = itemDef.id;
  1794. menuActionCmd2[menuActionRow] = k2;
  1795. menuActionCmd3[menuActionRow] = class9_1.id;
  1796. menuActionRow++;
  1797. }
  1798. }
  1799. }
  1800. }
  1801. k2++;
  1802. }
  1803.  
  1804. }
  1805.  
  1806. }
  1807. }
  1808. }
  1809. }
  1810.  
  1811. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1812. scrollBar1.drawSprite(i1, l);
  1813. scrollBar2.drawSprite(i1, (l + j) - 16);
  1814. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1815. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1816. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1817. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1818. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1819. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1820. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1821. int k1 = ((j - 32) * j) / j1;
  1822. if (k1 < 8)
  1823. k1 = 8;
  1824. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1825. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1826. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1827. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1828. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1829. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1830. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1831. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1832. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1833. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1834. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1835. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1836. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1837. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1838. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1839. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1840. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1841. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1842. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1843. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1844. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1845. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1846. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1847. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1848. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1849. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1850. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1851. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1852. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1853. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1854. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1855. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1856. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1857. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1858. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1859. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1860. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1861. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1862. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1863. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1864. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1865. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1866. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1867. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1868. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1869. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1870. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1871. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1872. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1873. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1874. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1875. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1876. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1877. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1878. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1879. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1880. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1881. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1882. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1883. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1884. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1885. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1886. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1887. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1888. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1889. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1890. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1891. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1892. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1893. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1894. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1895. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1896. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1897. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1898. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1899. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1900. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1901. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1902. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1903. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1904. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1905. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1906. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1907. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1908. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1909. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1910. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1911. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1912. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1913. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1914. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1915. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1916. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1917. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1918. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1919. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1920. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1921. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1922. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1923. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1924. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1925. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1926. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1927. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1928. }
  1929.  
  1930. public void updateNPCs(Stream stream, int i) {
  1931. anInt839 = 0;
  1932. anInt893 = 0;
  1933. method139(stream);
  1934. method46(i, stream);
  1935. method86(stream);
  1936. for (int k = 0; k < anInt839; k++) {
  1937. int l = anIntArray840[k];
  1938. if (npcArray[l].anInt1537 != loopCycle) {
  1939. npcArray[l].desc = null;
  1940. npcArray[l] = null;
  1941. }
  1942. }
  1943.  
  1944. if (stream.currentOffset != i) {
  1945. signlink.reporterror(myUsername
  1946. + " size mismatch in getnpcpos - pos:"
  1947. + stream.currentOffset + " psize:" + i);
  1948. throw new RuntimeException("eek");
  1949. }
  1950. for (int i1 = 0; i1 < npcCount; i1++)
  1951. if (npcArray[npcIndices[i1]] == null) {
  1952. signlink.reporterror(myUsername
  1953. + " null entry in npc list - pos:" + i1 + " size:"
  1954. + npcCount);
  1955. throw new RuntimeException("eek");
  1956. }
  1957.  
  1958. }
  1959.  
  1960. private int cButtonHPos;
  1961. private int cButtonCPos;
  1962.  
  1963. public void processChatModeClick() {
  1964. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482
  1965. && super.mouseY <= 503) {
  1966. cButtonHPos = 0;
  1967. aBoolean1233 = true;
  1968. inputTaken = true;
  1969. } else if (super.mouseX >= 71 && super.mouseX <= 127
  1970. && super.mouseY >= 482 && super.mouseY <= 503) {
  1971. cButtonHPos = 1;
  1972. aBoolean1233 = true;
  1973. inputTaken = true;
  1974. } else if (super.mouseX >= 137 && super.mouseX <= 193
  1975. && super.mouseY >= 482 && super.mouseY <= 503) {
  1976. cButtonHPos = 2;
  1977. aBoolean1233 = true;
  1978. inputTaken = true;
  1979. } else if (super.mouseX >= 203 && super.mouseX <= 259
  1980. && super.mouseY >= 482 && super.mouseY <= 503) {
  1981. cButtonHPos = 3;
  1982. aBoolean1233 = true;
  1983. inputTaken = true;
  1984. } else if (super.mouseX >= 269 && super.mouseX <= 325
  1985. && super.mouseY >= 482 && super.mouseY <= 503) {
  1986. cButtonHPos = 4;
  1987. aBoolean1233 = true;
  1988. inputTaken = true;
  1989. } else if (super.mouseX >= 335 && super.mouseX <= 391
  1990. && super.mouseY >= 482 && super.mouseY <= 503) {
  1991. cButtonHPos = 5;
  1992. aBoolean1233 = true;
  1993. inputTaken = true;
  1994. } else if (super.mouseX >= 404 && super.mouseX <= 515
  1995. && super.mouseY >= 482 && super.mouseY <= 503) {
  1996. cButtonHPos = 6;
  1997. aBoolean1233 = true;
  1998. inputTaken = true;
  1999. } else {
  2000. cButtonHPos = -1;
  2001. aBoolean1233 = true;
  2002. inputTaken = true;
  2003. }
  2004. if (super.clickMode3 == 1) {
  2005. if (super.saveClickX >= 5 && super.saveClickX <= 61
  2006. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2007. cButtonCPos = 0;
  2008. chatTypeView = 0;
  2009. inputTaken = true;
  2010. } else if (super.saveClickX >= 71 && super.saveClickX <= 127
  2011. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2012. cButtonCPos = 1;
  2013. chatTypeView = 5;
  2014. inputTaken = true;
  2015. } else if (super.saveClickX >= 137 && super.saveClickX <= 193
  2016. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2017. cButtonCPos = 2;
  2018. chatTypeView = 1;
  2019. inputTaken = true;
  2020. } else if (super.saveClickX >= 203 && super.saveClickX <= 259
  2021. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2022. cButtonCPos = 3;
  2023. chatTypeView = 2;
  2024. inputTaken = true;
  2025. } else if (super.saveClickX >= 269 && super.saveClickX <= 325
  2026. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2027. cButtonCPos = 4;
  2028. chatTypeView = 11;
  2029. inputTaken = true;
  2030. } else if (super.saveClickX >= 335 && super.saveClickX <= 391
  2031. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2032. cButtonCPos = 5;
  2033. chatTypeView = 3;
  2034. inputTaken = true;
  2035. }
  2036. }
  2037. }
  2038.  
  2039. public void method33(int i) {
  2040. if (Varp.cache[i] == null)
  2041. return;
  2042. int j = Varp.cache[i].anInt709;
  2043. if (j == 0)
  2044. return;
  2045. int k = variousSettings[i];
  2046. if (j == 1) {
  2047. if (k == 1)
  2048. Texture.method372(0.90000000000000002D);
  2049. if (k == 2)
  2050. Texture.method372(0.80000000000000004D);
  2051. if (k == 3)
  2052. Texture.method372(0.69999999999999996D);
  2053. if (k == 4)
  2054. Texture.method372(0.59999999999999998D);
  2055. ItemDef.mruNodes1.unlinkAll();
  2056. welcomeScreenRaised = true;
  2057. }
  2058. if (j == 3) {
  2059. boolean flag1 = musicEnabled;
  2060. if (k == 0) {
  2061. adjustVolume(musicEnabled, 0);
  2062. musicEnabled = true;
  2063. }
  2064. if (k == 1) {
  2065. adjustVolume(musicEnabled, -400);
  2066. musicEnabled = true;
  2067. }
  2068. if (k == 2) {
  2069. adjustVolume(musicEnabled, -800);
  2070. musicEnabled = true;
  2071. }
  2072. if (k == 3) {
  2073. adjustVolume(musicEnabled, -1200);
  2074. musicEnabled = true;
  2075. }
  2076. if (k == 4)
  2077. musicEnabled = false;
  2078. if (musicEnabled != flag1 && !lowMem) {
  2079. if (musicEnabled) {
  2080. nextSong = currentSong;
  2081. songChanging = true;
  2082. onDemandFetcher.method558(2, nextSong);
  2083. } else {
  2084. stopMidi();
  2085. }
  2086. prevSong = 0;
  2087. }
  2088. }
  2089. if (j == 4) {
  2090. if (k == 0) {
  2091. aBoolean848 = true;
  2092. setWaveVolume(0);
  2093. }
  2094. if (k == 1) {
  2095. aBoolean848 = true;
  2096. setWaveVolume(-400);
  2097. }
  2098. if (k == 2) {
  2099. aBoolean848 = true;
  2100. setWaveVolume(-800);
  2101. }
  2102. if (k == 3) {
  2103. aBoolean848 = true;
  2104. setWaveVolume(-1200);
  2105. }
  2106. if (k == 4)
  2107. aBoolean848 = false;
  2108. }
  2109. if (j == 5)
  2110. anInt1253 = k;
  2111. if (j == 6)
  2112. anInt1249 = k;
  2113. if (j == 8) {
  2114. splitPrivateChat = k;
  2115. inputTaken = true;
  2116. }
  2117. if (j == 9)
  2118. anInt913 = k;
  2119. }
  2120.  
  2121. public void updateEntities() {
  2122. try {
  2123. int anInt974 = 0;
  2124. for (int j = -1; j < playerCount + npcCount; j++) {
  2125. Object obj;
  2126. if (j == -1)
  2127. obj = myPlayer;
  2128. else if (j < playerCount)
  2129. obj = playerArray[playerIndices[j]];
  2130. else
  2131. obj = npcArray[npcIndices[j - playerCount]];
  2132. if (obj == null || !((Entity) (obj)).isVisible())
  2133. continue;
  2134. if (obj instanceof NPC) {
  2135. EntityDef entityDef = ((NPC) obj).desc;
  2136. if (entityDef.childrenIDs != null)
  2137. entityDef = entityDef.method161();
  2138. if (entityDef == null)
  2139. continue;
  2140. }
  2141. if (j < playerCount) {
  2142. int l = 30;
  2143. Player player = (Player) obj;
  2144. if (player.headIcon >= 0) {
  2145. npcScreenPos(((Entity) (obj)),
  2146. ((Entity) (obj)).height + 15);
  2147. if (spriteDrawX > -1) {
  2148. if (player.skullIcon < 2) {
  2149. skullIcons[player.skullIcon].drawSprite(
  2150. spriteDrawX - 12, spriteDrawY - l);
  2151. l += 25;
  2152. }
  2153. if (player.headIcon < 7) {
  2154. headIcons[player.headIcon].drawSprite(
  2155. spriteDrawX - 12, spriteDrawY - l);
  2156. l += 18;
  2157. }
  2158. }
  2159. }
  2160. if (j >= 0 && anInt855 == 10
  2161. && anInt933 == playerIndices[j]) {
  2162. npcScreenPos(((Entity) (obj)),
  2163. ((Entity) (obj)).height + 15);
  2164. if (spriteDrawX > -1)
  2165. headIconsHint[player.hintIcon].drawSprite(
  2166. spriteDrawX - 12, spriteDrawY - l);
  2167. }
  2168. } else {
  2169. EntityDef entityDef_1 = ((NPC) obj).desc;
  2170. if (entityDef_1.anInt75 >= 0
  2171. && entityDef_1.anInt75 < headIcons.length) {
  2172. npcScreenPos(((Entity) (obj)),
  2173. ((Entity) (obj)).height + 15);
  2174. if (spriteDrawX > -1)
  2175. headIcons[entityDef_1.anInt75].drawSprite(
  2176. spriteDrawX - 12, spriteDrawY - 30);
  2177. }
  2178. if (anInt855 == 1
  2179. && anInt1222 == npcIndices[j - playerCount]
  2180. && loopCycle % 20 < 10) {
  2181. npcScreenPos(((Entity) (obj)),
  2182. ((Entity) (obj)).height + 15);
  2183. if (spriteDrawX > -1)
  2184. headIconsHint[0].drawSprite(spriteDrawX - 12,
  2185. spriteDrawY - 28);
  2186. }
  2187. }
  2188. if (((Entity) (obj)).textSpoken != null
  2189. && (j >= playerCount || publicChatMode == 0
  2190. || publicChatMode == 3 || publicChatMode == 1
  2191. && isFriendOrSelf(((Player) obj).name))) {
  2192. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2193. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2194. anIntArray979[anInt974] = chatTextDrawingArea
  2195. .method384(((Entity) (obj)).textSpoken) / 2;
  2196. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2197. anIntArray976[anInt974] = spriteDrawX;
  2198. anIntArray977[anInt974] = spriteDrawY;
  2199. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2200. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2201. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2202. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2203. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  2204. && ((Entity) (obj)).anInt1531 <= 3) {
  2205. anIntArray978[anInt974] += 10;
  2206. anIntArray977[anInt974] += 5;
  2207. }
  2208. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2209. anIntArray979[anInt974] = 60;
  2210. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2211. anIntArray978[anInt974] += 5;
  2212. }
  2213. }
  2214. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2215. try {
  2216. npcScreenPos(((Entity) (obj)),
  2217. ((Entity) (obj)).height + 15);
  2218. if (spriteDrawX > -1) {
  2219. int i1 = (((Entity) (obj)).currentHealth * 30)
  2220. / ((Entity) (obj)).maxHealth;
  2221. if (i1 > 30)
  2222. i1 = 30;
  2223. DrawingArea.drawPixels(5, spriteDrawY - 3,
  2224. spriteDrawX - 15, 65280, i1);
  2225. DrawingArea.drawPixels(5, spriteDrawY - 3,
  2226. (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2227. }
  2228. } catch (Exception e) {
  2229. }
  2230. }
  2231. for (int j1 = 0; j1 < 4; j1++)
  2232. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2233. npcScreenPos(((Entity) (obj)),
  2234. ((Entity) (obj)).height / 2);
  2235. if (spriteDrawX > -1) {
  2236. if (j1 == 1)
  2237. spriteDrawY -= 20;
  2238. if (j1 == 2) {
  2239. spriteDrawX -= 15;
  2240. spriteDrawY -= 10;
  2241. }
  2242. if (j1 == 3) {
  2243. spriteDrawX += 15;
  2244. spriteDrawY -= 10;
  2245. }
  2246. hitMarks[((Entity) (obj)).hitMarkTypes[j1]]
  2247. .drawSprite(spriteDrawX - 12,
  2248. spriteDrawY - 12);
  2249. smallText.drawText(0, String
  2250. .valueOf(((Entity) (obj)).hitArray[j1]),
  2251. spriteDrawY + 4, spriteDrawX);
  2252. smallText.drawText(0xffffff, String
  2253. .valueOf(((Entity) (obj)).hitArray[j1]),
  2254. spriteDrawY + 3, spriteDrawX - 1);
  2255. }
  2256. }
  2257. }
  2258. for (int k = 0; k < anInt974; k++) {
  2259. int k1 = anIntArray976[k];
  2260. int l1 = anIntArray977[k];
  2261. int j2 = anIntArray979[k];
  2262. int k2 = anIntArray978[k];
  2263. boolean flag = true;
  2264. while (flag) {
  2265. flag = false;
  2266. for (int l2 = 0; l2 < k; l2++)
  2267. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2]
  2268. && l1 - k2 < anIntArray977[l2] + 2
  2269. && k1 - j2 < anIntArray976[l2]
  2270. + anIntArray979[l2]
  2271. && k1 + j2 > anIntArray976[l2]
  2272. - anIntArray979[l2]
  2273. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  2274. l1 = anIntArray977[l2] - anIntArray978[l2];
  2275. flag = true;
  2276. }
  2277.  
  2278. }
  2279. spriteDrawX = anIntArray976[k];
  2280. spriteDrawY = anIntArray977[k] = l1;
  2281. String s = aStringArray983[k];
  2282. if (anInt1249 == 0) {
  2283. int i3 = 0xffff00;
  2284. if (anIntArray980[k] < 6)
  2285. i3 = anIntArray965[anIntArray980[k]];
  2286. if (anIntArray980[k] == 6)
  2287. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2288. if (anIntArray980[k] == 7)
  2289. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2290. if (anIntArray980[k] == 8)
  2291. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2292. if (anIntArray980[k] == 9) {
  2293. int j3 = 150 - anIntArray982[k];
  2294. if (j3 < 50)
  2295. i3 = 0xff0000 + 1280 * j3;
  2296. else if (j3 < 100)
  2297. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2298. else if (j3 < 150)
  2299. i3 = 65280 + 5 * (j3 - 100);
  2300. }
  2301. if (anIntArray980[k] == 10) {
  2302. int k3 = 150 - anIntArray982[k];
  2303. if (k3 < 50)
  2304. i3 = 0xff0000 + 5 * k3;
  2305. else if (k3 < 100)
  2306. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2307. else if (k3 < 150)
  2308. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2309. }
  2310. if (anIntArray980[k] == 11) {
  2311. int l3 = 150 - anIntArray982[k];
  2312. if (l3 < 50)
  2313. i3 = 0xffffff - 0x50005 * l3;
  2314. else if (l3 < 100)
  2315. i3 = 65280 + 0x50005 * (l3 - 50);
  2316. else if (l3 < 150)
  2317. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2318. }
  2319. if (anIntArray981[k] == 0) {
  2320. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2321. spriteDrawX);
  2322. chatTextDrawingArea.drawText(i3, s, spriteDrawY,
  2323. spriteDrawX);
  2324. }
  2325. if (anIntArray981[k] == 1) {
  2326. chatTextDrawingArea.method386(0, s, spriteDrawX,
  2327. anInt1265, spriteDrawY + 1);
  2328. chatTextDrawingArea.method386(i3, s, spriteDrawX,
  2329. anInt1265, spriteDrawY);
  2330. }
  2331. if (anIntArray981[k] == 2) {
  2332. chatTextDrawingArea.method387(spriteDrawX, s,
  2333. anInt1265, spriteDrawY + 1, 0);
  2334. chatTextDrawingArea.method387(spriteDrawX, s,
  2335. anInt1265, spriteDrawY, i3);
  2336. }
  2337. if (anIntArray981[k] == 3) {
  2338. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2339. s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2340. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2341. s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2342. }
  2343. if (anIntArray981[k] == 4) {
  2344. int i4 = chatTextDrawingArea.method384(s);
  2345. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2346. DrawingArea.setDrawingArea(334, spriteDrawX - 50,
  2347. spriteDrawX + 50, 0);
  2348. chatTextDrawingArea.method385(0, s, spriteDrawY + 1,
  2349. (spriteDrawX + 50) - k4);
  2350. chatTextDrawingArea.method385(i3, s, spriteDrawY,
  2351. (spriteDrawX + 50) - k4);
  2352. DrawingArea.defaultDrawingAreaSize();
  2353. }
  2354. if (anIntArray981[k] == 5) {
  2355. int j4 = 150 - anIntArray982[k];
  2356. int l4 = 0;
  2357. if (j4 < 25)
  2358. l4 = j4 - 25;
  2359. else if (j4 > 125)
  2360. l4 = j4 - 125;
  2361. DrawingArea
  2362. .setDrawingArea(spriteDrawY + 5, 0, 512,
  2363. spriteDrawY
  2364. - chatTextDrawingArea.anInt1497
  2365. - 1);
  2366. chatTextDrawingArea.drawText(0, s,
  2367. spriteDrawY + 1 + l4, spriteDrawX);
  2368. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4,
  2369. spriteDrawX);
  2370. DrawingArea.defaultDrawingAreaSize();
  2371. }
  2372. } else {
  2373. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2374. spriteDrawX);
  2375. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY,
  2376. spriteDrawX);
  2377. }
  2378. }
  2379. } catch (Exception e) {
  2380. }
  2381. }
  2382.  
  2383. private void delFriend(long l) {
  2384. try {
  2385. if (l == 0L)
  2386. return;
  2387. for (int i = 0; i < friendsCount; i++) {
  2388. if (friendsListAsLongs[i] != l)
  2389. continue;
  2390. friendsCount--;
  2391. needDrawTabArea = true;
  2392. for (int j = i; j < friendsCount; j++) {
  2393. friendsList[j] = friendsList[j + 1];
  2394. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2395. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2396. }
  2397.  
  2398. stream.createFrame(215);
  2399. stream.writeQWord(l);
  2400. break;
  2401. }
  2402. } catch (RuntimeException runtimeexception) {
  2403. signlink.reporterror("18622, " + false + ", " + l + ", "
  2404. + runtimeexception.toString());
  2405. throw new RuntimeException();
  2406. }
  2407. }
  2408.  
  2409. public void drawSideIcons() {
  2410. /* Top sideIcons */
  2411.  
  2412. if (tabInterfaceIDs[0] != -1)// attack
  2413. sideIcons[0].drawSprite(10, 4);
  2414. if (tabInterfaceIDs[1] != -1)// stat
  2415. sideIcons[1].drawSprite(43, 4);
  2416. if (tabInterfaceIDs[2] != -1)// quest
  2417. sideIcons[2].drawSprite(76, 3);
  2418. if (tabInterfaceIDs[3] != -1)// inventory
  2419. sideIcons[3].drawSprite(111, 5);
  2420. if (tabInterfaceIDs[4] != -1)// equipment
  2421. sideIcons[4].drawSprite(140, 1);
  2422. if (tabInterfaceIDs[5] != -1)// prayer
  2423. sideIcons[5].drawSprite(174, 1);
  2424. if (tabInterfaceIDs[6] != -1)// magic
  2425. sideIcons[6].drawSprite(208, 4);
  2426. /* Bottom sideIcons */
  2427. /*
  2428. * if(tabInterfaceIDs[7] != -1)//summoning sIcons483[7].drawSprite(11+3,
  2429. * 303);
  2430. */
  2431. if (tabInterfaceIDs[7] != -1)
  2432. sideIcons[7].drawSprite(11+3, 300);
  2433. if (tabInterfaceIDs[8] != -1)// friends
  2434. sideIcons[8].drawSprite(46, 306);
  2435. if (tabInterfaceIDs[9] != -1)// ignore
  2436. sideIcons[9].drawSprite(79, 306);
  2437. if (tabInterfaceIDs[10] != -1)// logout
  2438. sideIcons[7].drawSprite(113, 302);
  2439. if (tabInterfaceIDs[11] != -1)// options
  2440. sideIcons[11].drawSprite(145, 304);
  2441. if (tabInterfaceIDs[12] != -1)// emotes
  2442. sideIcons[12].drawSprite(181, 302);
  2443. }
  2444.  
  2445. public void drawRedStones() {
  2446. if (tabInterfaceIDs[tabID] != -1) {
  2447. switch (tabID) {
  2448. case 0:
  2449. redStones[0].drawSprite(3, 0);
  2450. break;
  2451. case 1:
  2452. redStones[4].drawSprite(41, 0);
  2453. break;
  2454. case 2:
  2455. redStones[4].drawSprite(74, 0);
  2456. break;
  2457. case 3:
  2458. redStones[4].drawSprite(107, 0);
  2459. break;
  2460. case 4:
  2461. redStones[4].drawSprite(140, 0);
  2462. break;
  2463. case 5:
  2464. redStones[4].drawSprite(173, 0);
  2465. break;
  2466. case 6:
  2467. redStones[1].drawSprite(206, 0);
  2468. break;
  2469. case 7:
  2470. redStones[2].drawSprite(3, 298);
  2471. break;
  2472. case 8:
  2473. redStones[4].drawSprite(41, 298);
  2474. break;
  2475. case 9:
  2476. redStones[4].drawSprite(74, 298);
  2477. break;
  2478. case 10:
  2479. redStones[4].drawSprite(107, 298);
  2480. break;
  2481. case 11:
  2482. redStones[4].drawSprite(140, 298);
  2483. break;
  2484. case 12:
  2485. redStones[4].drawSprite(173, 298);
  2486. break;
  2487. case 13:
  2488. redStones[3].drawSprite(206, 298);
  2489. break;
  2490. }
  2491. }
  2492. }
  2493.  
  2494. private void drawTabArea() {
  2495. if (revision508 == true) {
  2496. aRSImageProducer_1163.initDrawingArea();
  2497. Texture.anIntArray1472 = anIntArray1181;
  2498. tabArea508.drawSprite(0, 0);
  2499. if (invOverlayInterfaceID == -1) {
  2500. drawRedStones();
  2501. drawSideIcons();
  2502. }
  2503. if (invOverlayInterfaceID != -1)
  2504. drawInterface(0, 30,
  2505. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2506. else if (tabInterfaceIDs[tabID] != -1)
  2507. drawInterface(0, 30,
  2508. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2509. if (menuOpen && menuScreenArea == 1)
  2510. drawMenu();
  2511. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2512. aRSImageProducer_1165.initDrawingArea();
  2513. Texture.anIntArray1472 = anIntArray1182;
  2514. }
  2515. if (revision474 == true) {
  2516. aRSImageProducer_1163.initDrawingArea();
  2517. Texture.anIntArray1472 = anIntArray1181;
  2518. tabArea474.drawSprite(0, 0);
  2519. if (invOverlayInterfaceID == -1) {
  2520. drawRedStones();
  2521. drawSideIcons();
  2522. }
  2523. if (invOverlayInterfaceID != -1)
  2524. drawInterface(0, 30,
  2525. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2526. else if (tabInterfaceIDs[tabID] != -1)
  2527. drawInterface(0, 30,
  2528. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2529. if (menuOpen && menuScreenArea == 1)
  2530. drawMenu();
  2531. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2532. aRSImageProducer_1165.initDrawingArea();
  2533. Texture.anIntArray1472 = anIntArray1182;
  2534. }
  2535. if (revision498 == true) {
  2536. aRSImageProducer_1163.initDrawingArea();
  2537. Texture.anIntArray1472 = anIntArray1181;
  2538. tabArea.drawSprite(0, 0);
  2539. if (invOverlayInterfaceID == -1) {
  2540. drawRedStones();
  2541. drawSideIcons();
  2542. }
  2543. if (invOverlayInterfaceID != -1)
  2544. drawInterface(0, 28,
  2545. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2546. else if (tabInterfaceIDs[tabID] != -1)
  2547. drawInterface(0, 28,
  2548. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2549. if (menuOpen && menuScreenArea == 1)
  2550. drawMenu();
  2551. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2552. aRSImageProducer_1165.initDrawingArea();
  2553. Texture.anIntArray1472 = anIntArray1182;
  2554. }
  2555. }
  2556.  
  2557. public void method37(int j) {
  2558. if (!lowMem) {
  2559. if (Texture.anIntArray1480[17] >= j) {
  2560. Background background = Texture.aBackgroundArray1474s[17];
  2561. int k = background.anInt1452 * background.anInt1453 - 1;
  2562. int j1 = background.anInt1452 * anInt945 * 2;
  2563. byte abyte0[] = background.aByteArray1450;
  2564. byte abyte3[] = aByteArray912;
  2565. for (int i2 = 0; i2 <= k; i2++)
  2566. abyte3[i2] = abyte0[i2 - j1 & k];
  2567.  
  2568. background.aByteArray1450 = abyte3;
  2569. aByteArray912 = abyte0;
  2570. Texture.method370(17);
  2571. anInt854++;
  2572. if (anInt854 > 1235) {
  2573. anInt854 = 0;
  2574. stream.createFrame(226);
  2575. stream.writeWordBigEndian(0);
  2576. int l2 = stream.currentOffset;
  2577. stream.writeWord(58722);
  2578. stream.writeWordBigEndian(240);
  2579. stream.writeWord((int) (Math.random() * 65536D));
  2580. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2581. if ((int) (Math.random() * 2D) == 0)
  2582. stream.writeWord(51825);
  2583. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2584. stream.writeWord((int) (Math.random() * 65536D));
  2585. stream.writeWord(7130);
  2586. stream.writeWord((int) (Math.random() * 65536D));
  2587. stream.writeWord(61657);
  2588. stream.writeBytes(stream.currentOffset - l2);
  2589. }
  2590. }
  2591. if (Texture.anIntArray1480[24] >= j) {
  2592. Background background_1 = Texture.aBackgroundArray1474s[24];
  2593. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2594. int k1 = background_1.anInt1452 * anInt945 * 2;
  2595. byte abyte1[] = background_1.aByteArray1450;
  2596. byte abyte4[] = aByteArray912;
  2597. for (int j2 = 0; j2 <= l; j2++)
  2598. abyte4[j2] = abyte1[j2 - k1 & l];
  2599.  
  2600. background_1.aByteArray1450 = abyte4;
  2601. aByteArray912 = abyte1;
  2602. Texture.method370(24);
  2603. }
  2604. if (Texture.anIntArray1480[34] >= j) {
  2605. Background background_2 = Texture.aBackgroundArray1474s[34];
  2606. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2607. int l1 = background_2.anInt1452 * anInt945 * 2;
  2608. byte abyte2[] = background_2.aByteArray1450;
  2609. byte abyte5[] = aByteArray912;
  2610. for (int k2 = 0; k2 <= i1; k2++)
  2611. abyte5[k2] = abyte2[k2 - l1 & i1];
  2612.  
  2613. background_2.aByteArray1450 = abyte5;
  2614. aByteArray912 = abyte2;
  2615. Texture.method370(34);
  2616. }
  2617. if (Texture.anIntArray1480[40] >= j) {
  2618. Background background_2 = Texture.aBackgroundArray1474s[40];
  2619. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2620. int l1 = background_2.anInt1452 * anInt945 * 2;
  2621. byte abyte2[] = background_2.aByteArray1450;
  2622. byte abyte5[] = aByteArray912;
  2623. for (int k2 = 0; k2 <= i1; k2++)
  2624. abyte5[k2] = abyte2[k2 - l1 & i1];
  2625. background_2.aByteArray1450 = abyte5;
  2626. aByteArray912 = abyte2;
  2627. Texture.method370(40);
  2628. }
  2629. }
  2630. }
  2631.  
  2632. public void method38() {
  2633. for (int i = -1; i < playerCount; i++) {
  2634. int j;
  2635. if (i == -1)
  2636. j = myPlayerIndex;
  2637. else
  2638. j = playerIndices[i];
  2639. Player player = playerArray[j];
  2640. if (player != null && player.textCycle > 0) {
  2641. player.textCycle--;
  2642. if (player.textCycle == 0)
  2643. player.textSpoken = null;
  2644. }
  2645. }
  2646. for (int k = 0; k < npcCount; k++) {
  2647. int l = npcIndices[k];
  2648. NPC npc = npcArray[l];
  2649. if (npc != null && npc.textCycle > 0) {
  2650. npc.textCycle--;
  2651. if (npc.textCycle == 0)
  2652. npc.textSpoken = null;
  2653. }
  2654. }
  2655. }
  2656.  
  2657. public void calcCameraPos() {
  2658. int i = anInt1098 * 128 + 64;
  2659. int j = anInt1099 * 128 + 64;
  2660. int k = method42(plane, j, i) - anInt1100;
  2661. if (xCameraPos < i) {
  2662. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2663. if (xCameraPos > i)
  2664. xCameraPos = i;
  2665. }
  2666. if (xCameraPos > i) {
  2667. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2668. if (xCameraPos < i)
  2669. xCameraPos = i;
  2670. }
  2671. if (zCameraPos < k) {
  2672. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2673. if (zCameraPos > k)
  2674. zCameraPos = k;
  2675. }
  2676. if (zCameraPos > k) {
  2677. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2678. if (zCameraPos < k)
  2679. zCameraPos = k;
  2680. }
  2681. if (yCameraPos < j) {
  2682. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2683. if (yCameraPos > j)
  2684. yCameraPos = j;
  2685. }
  2686. if (yCameraPos > j) {
  2687. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2688. if (yCameraPos < j)
  2689. yCameraPos = j;
  2690. }
  2691. i = anInt995 * 128 + 64;
  2692. j = anInt996 * 128 + 64;
  2693. k = method42(plane, j, i) - anInt997;
  2694. int l = i - xCameraPos;
  2695. int i1 = k - zCameraPos;
  2696. int j1 = j - yCameraPos;
  2697. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2698. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2699. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2700. if (l1 < 128)
  2701. l1 = 128;
  2702. if (l1 > 383)
  2703. l1 = 383;
  2704. if (yCameraCurve < l1) {
  2705. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2706. if (yCameraCurve > l1)
  2707. yCameraCurve = l1;
  2708. }
  2709. if (yCameraCurve > l1) {
  2710. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2711. if (yCameraCurve < l1)
  2712. yCameraCurve = l1;
  2713. }
  2714. int j2 = i2 - xCameraCurve;
  2715. if (j2 > 1024)
  2716. j2 -= 2048;
  2717. if (j2 < -1024)
  2718. j2 += 2048;
  2719. if (j2 > 0) {
  2720. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2721. xCameraCurve &= 0x7ff;
  2722. }
  2723. if (j2 < 0) {
  2724. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2725. xCameraCurve &= 0x7ff;
  2726. }
  2727. int k2 = i2 - xCameraCurve;
  2728. if (k2 > 1024)
  2729. k2 -= 2048;
  2730. if (k2 < -1024)
  2731. k2 += 2048;
  2732. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2733. xCameraCurve = i2;
  2734. }
  2735.  
  2736. public void drawMenu() {
  2737. int i = menuOffsetX;
  2738. int j = menuOffsetY;
  2739. int k = menuWidth;
  2740. int l = menuHeight + 1;
  2741. int i1 = 0x5d5447;
  2742. // DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2743. // DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2744. DrawingArea.drawPixels(l, j, i, i1, k);
  2745. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2746. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2747. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2748. int j1 = super.mouseX;
  2749. int k1 = super.mouseY;
  2750. if (menuScreenArea == 0) {
  2751. j1 -= 4;
  2752. k1 -= 4;
  2753. }
  2754. if (menuScreenArea == 1) {
  2755. j1 -= 519;
  2756. k1 -= 168;
  2757. }
  2758. if (menuScreenArea == 2) {
  2759. j1 -= 17;
  2760. k1 -= 338;
  2761. }
  2762. if (menuScreenArea == 3) {
  2763. j1 -= 519;
  2764. k1 -= 0;
  2765. }
  2766. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2767. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2768. int j2 = 0xffffff;
  2769. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2770. j2 = 0xffff00;
  2771. newBoldFont.drawBasicString(menuActionName[l1], i + 3, i2, j2, 0);
  2772. }
  2773. }
  2774.  
  2775. private void addFriend(long l) {
  2776. try {
  2777. if (l == 0L)
  2778. return;
  2779. if (friendsCount >= 100 && anInt1046 != 1) {
  2780. pushMessage(
  2781. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2782. 0, "");
  2783. return;
  2784. }
  2785. if (friendsCount >= 200) {
  2786. pushMessage(
  2787. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2788. 0, "");
  2789. return;
  2790. }
  2791. String s = TextClass.fixName(TextClass.nameForLong(l));
  2792. for (int i = 0; i < friendsCount; i++)
  2793. if (friendsListAsLongs[i] == l) {
  2794. pushMessage(s + " is already on your friend list", 0, "");
  2795. return;
  2796. }
  2797. for (int j = 0; j < ignoreCount; j++)
  2798. if (ignoreListAsLongs[j] == l) {
  2799. pushMessage("Please remove " + s
  2800. + " from your ignore list first", 0, "");
  2801. return;
  2802. }
  2803.  
  2804. if (s.equals(myPlayer.name)) {
  2805. return;
  2806. } else {
  2807. friendsList[friendsCount] = s;
  2808. friendsListAsLongs[friendsCount] = l;
  2809. friendsNodeIDs[friendsCount] = 0;
  2810. friendsCount++;
  2811. needDrawTabArea = true;
  2812. stream.createFrame(188);
  2813. stream.writeQWord(l);
  2814. return;
  2815. }
  2816. } catch (RuntimeException runtimeexception) {
  2817. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  2818. + runtimeexception.toString());
  2819. }
  2820. throw new RuntimeException();
  2821. }
  2822.  
  2823. private int method42(int i, int j, int k) {
  2824. int l = k >> 7;
  2825. int i1 = j >> 7;
  2826. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2827. return 0;
  2828. int j1 = i;
  2829. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2830. j1++;
  2831. int k1 = k & 0x7f;
  2832. int l1 = j & 0x7f;
  2833. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  2834. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2835. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  2836. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2837. return i2 * (128 - l1) + j2 * l1 >> 7;
  2838. }
  2839.  
  2840. public void resetLogout() {
  2841. try {
  2842. if (socketStream != null)
  2843. socketStream.close();
  2844. } catch (Exception _ex) {
  2845. }
  2846. socketStream = null;
  2847. loggedIn = false;
  2848. loginScreenState = 0;
  2849. // myUsername = "";
  2850. // myPassword = "";
  2851. unlinkMRUNodes();
  2852. worldController.initToNull();
  2853. for (int i = 0; i < 4; i++)
  2854. aClass11Array1230[i].method210();
  2855. System.gc();
  2856. stopMidi();
  2857. currentSong = -1;
  2858. nextSong = -1;
  2859. prevSong = 0;
  2860. try {
  2861. writeSettings();
  2862. } catch (IOException e) {
  2863. e.printStackTrace();
  2864. }
  2865. }
  2866.  
  2867. public void method45() {
  2868. aBoolean1031 = true;
  2869. for (int j = 0; j < 7; j++) {
  2870. anIntArray1065[j] = -1;
  2871. for (int k = 0; k < IDK.length; k++) {
  2872. if (IDK.cache[k].aBoolean662
  2873. || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2874. continue;
  2875. anIntArray1065[j] = k;
  2876. break;
  2877. }
  2878. }
  2879. }
  2880.  
  2881. private void method46(int i, Stream stream) {
  2882. while (stream.bitPosition + 21 < i * 8) {
  2883. int k = stream.readBits(14);
  2884. if (k == 16383)
  2885. break;
  2886. if (npcArray[k] == null)
  2887. npcArray[k] = new NPC();
  2888. NPC npc = npcArray[k];
  2889. npcIndices[npcCount++] = k;
  2890. npc.anInt1537 = loopCycle;
  2891. int l = stream.readBits(5);
  2892. if (l > 15)
  2893. l -= 32;
  2894. int i1 = stream.readBits(5);
  2895. if (i1 > 15)
  2896. i1 -= 32;
  2897. int j1 = stream.readBits(1);
  2898. npc.desc = EntityDef.forID(stream.readBits(14));
  2899. int k1 = stream.readBits(1);
  2900. if (k1 == 1)
  2901. anIntArray894[anInt893++] = k;
  2902. npc.anInt1540 = npc.desc.aByte68;
  2903. npc.anInt1504 = npc.desc.anInt79;
  2904. npc.anInt1554 = npc.desc.walkAnim;
  2905. npc.anInt1555 = npc.desc.anInt58;
  2906. npc.anInt1556 = npc.desc.anInt83;
  2907. npc.anInt1557 = npc.desc.anInt55;
  2908. npc.anInt1511 = npc.desc.standAnim;
  2909. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2910. }
  2911. stream.finishBitAccess();
  2912. }
  2913.  
  2914.  
  2915. @Override
  2916. public void processGameLoop() {
  2917. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2918. return;
  2919. loopCycle++;
  2920. if (!loggedIn)
  2921. processLoginScreenInput();
  2922. else
  2923. mainGameProcessor();
  2924. processOnDemandQueue();
  2925. }
  2926.  
  2927. public void method47(boolean flag) {
  2928. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2929. destX = 0;
  2930. int j = playerCount;
  2931. if (flag)
  2932. j = 1;
  2933. for (int l = 0; l < j; l++) {
  2934. Player player;
  2935. int i1;
  2936. if (flag) {
  2937. player = myPlayer;
  2938. i1 = myPlayerIndex << 14;
  2939. } else {
  2940. player = playerArray[playerIndices[l]];
  2941. i1 = playerIndices[l] << 14;
  2942. }
  2943. if (player == null || !player.isVisible())
  2944. continue;
  2945. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  2946. && !flag && player.anInt1517 == player.anInt1511;
  2947. int j1 = player.x >> 7;
  2948. int k1 = player.y >> 7;
  2949. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2950. continue;
  2951. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  2952. && loopCycle < player.anInt1708) {
  2953. player.aBoolean1699 = false;
  2954. player.anInt1709 = method42(plane, player.y, player.x);
  2955. worldController.method286(plane, player.y, player,
  2956. player.anInt1552, player.anInt1722, player.x,
  2957. player.anInt1709, player.anInt1719, player.anInt1721,
  2958. i1, player.anInt1720);
  2959. continue;
  2960. }
  2961. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2962. if (anIntArrayArray929[j1][k1] == anInt1265)
  2963. continue;
  2964. anIntArrayArray929[j1][k1] = anInt1265;
  2965. }
  2966. player.anInt1709 = method42(plane, player.y, player.x);
  2967. worldController.method285(plane, player.anInt1552,
  2968. player.anInt1709, i1, player.y, 60, player.x, player,
  2969. player.aBoolean1541);
  2970. }
  2971. }
  2972.  
  2973. private boolean promptUserForInput(RSInterface class9) {
  2974. int j = class9.contentType;
  2975. if (anInt900 == 2) {
  2976. if (j == 201) {
  2977. inputTaken = true;
  2978. inputDialogState = 0;
  2979. messagePromptRaised = true;
  2980. promptInput = "";
  2981. friendsListAction = 1;
  2982. aString1121 = "Enter name of friend to add to list";
  2983. }
  2984. if (j == 202) {
  2985. inputTaken = true;
  2986. inputDialogState = 0;
  2987. messagePromptRaised = true;
  2988. promptInput = "";
  2989. friendsListAction = 2;
  2990. aString1121 = "Enter name of friend to delete from list";
  2991. }
  2992. }
  2993. if (j == 205) {
  2994. anInt1011 = 250;
  2995. return true;
  2996. }
  2997. if (j == 501) {
  2998. inputTaken = true;
  2999. inputDialogState = 0;
  3000. messagePromptRaised = true;
  3001. promptInput = "";
  3002. friendsListAction = 4;
  3003. aString1121 = "Enter name of player to add to list";
  3004. }
  3005. if (j == 502) {
  3006. inputTaken = true;
  3007. inputDialogState = 0;
  3008. messagePromptRaised = true;
  3009. promptInput = "";
  3010. friendsListAction = 5;
  3011. aString1121 = "Enter name of player to delete from list";
  3012. }
  3013. if (j == 550) {
  3014. inputTaken = true;
  3015. inputDialogState = 0;
  3016. messagePromptRaised = true;
  3017. promptInput = "";
  3018. friendsListAction = 6;
  3019. aString1121 = "Enter the name of the chat you wish to join";
  3020. }
  3021. if (j >= 300 && j <= 313) {
  3022. int k = (j - 300) / 2;
  3023. int j1 = j & 1;
  3024. int i2 = anIntArray1065[k];
  3025. if (i2 != -1) {
  3026. do {
  3027. if (j1 == 0 && --i2 < 0)
  3028. i2 = IDK.length - 1;
  3029. if (j1 == 1 && ++i2 >= IDK.length)
  3030. i2 = 0;
  3031. } while (IDK.cache[i2].aBoolean662
  3032. || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3033. anIntArray1065[k] = i2;
  3034. aBoolean1031 = true;
  3035. }
  3036. }
  3037. if (j >= 314 && j <= 323) {
  3038. int l = (j - 314) / 2;
  3039. int k1 = j & 1;
  3040. int j2 = anIntArray990[l];
  3041. if (k1 == 0 && --j2 < 0)
  3042. j2 = anIntArrayArray1003[l].length - 1;
  3043. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3044. j2 = 0;
  3045. anIntArray990[l] = j2;
  3046. aBoolean1031 = true;
  3047. }
  3048. if (j == 324 && !aBoolean1047) {
  3049. aBoolean1047 = true;
  3050. method45();
  3051. }
  3052. if (j == 325 && aBoolean1047) {
  3053. aBoolean1047 = false;
  3054. method45();
  3055. }
  3056. if (j == 326) {
  3057. stream.createFrame(101);
  3058. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3059. for (int i1 = 0; i1 < 7; i1++)
  3060. stream.writeWordBigEndian(anIntArray1065[i1]);
  3061.  
  3062. for (int l1 = 0; l1 < 5; l1++)
  3063. stream.writeWordBigEndian(anIntArray990[l1]);
  3064.  
  3065. return true;
  3066. }
  3067. if (j == 613)
  3068. canMute = !canMute;
  3069. if (j >= 601 && j <= 612) {
  3070. clearTopInterfaces();
  3071. if (reportAbuseInput.length() > 0) {
  3072. stream.createFrame(218);
  3073. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3074. stream.writeWordBigEndian(j - 601);
  3075. stream.writeWordBigEndian(canMute ? 1 : 0);
  3076. }
  3077. }
  3078. return false;
  3079. }
  3080.  
  3081. public void method49(Stream stream) {
  3082. for (int j = 0; j < anInt893; j++) {
  3083. int k = anIntArray894[j];
  3084. Player player = playerArray[k];
  3085. int l = stream.readUnsignedByte();
  3086. if ((l & 0x40) != 0)
  3087. l += stream.readUnsignedByte() << 8;
  3088. method107(l, k, stream, player);
  3089. }
  3090. }
  3091.  
  3092. public void method50(int i, int k, int l, int i1, int j1) {
  3093. int k1 = worldController.method300(j1, l, i);
  3094. if (k1 != 0) {
  3095. int l1 = worldController.method304(j1, l, i, k1);
  3096. int k2 = l1 >> 6 & 3;
  3097. int i3 = l1 & 0x1f;
  3098. int k3 = k;
  3099. if (k1 > 0)
  3100. k3 = i1;
  3101. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3102. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3103. int i5 = k1 >> 14 & 0x7fff;
  3104. ObjectDef class46_2 = ObjectDef.forID(i5);
  3105. if (class46_2.anInt758 != -1) {
  3106. Background background_2 = mapScenes[class46_2.anInt758];
  3107. if (background_2 != null) {
  3108. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3109. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3110. background_2.drawBackground(48 + l * 4 + i6, 48
  3111. + (104 - i - class46_2.anInt761) * 4 + j6);
  3112. }
  3113. } else {
  3114. if (i3 == 0 || i3 == 2)
  3115. if (k2 == 0) {
  3116. ai[k4] = k3;
  3117. ai[k4 + 512] = k3;
  3118. ai[k4 + 1024] = k3;
  3119. ai[k4 + 1536] = k3;
  3120. } else if (k2 == 1) {
  3121. ai[k4] = k3;
  3122. ai[k4 + 1] = k3;
  3123. ai[k4 + 2] = k3;
  3124. ai[k4 + 3] = k3;
  3125. } else if (k2 == 2) {
  3126. ai[k4 + 3] = k3;
  3127. ai[k4 + 3 + 512] = k3;
  3128. ai[k4 + 3 + 1024] = k3;
  3129. ai[k4 + 3 + 1536] = k3;
  3130. } else if (k2 == 3) {
  3131. ai[k4 + 1536] = k3;
  3132. ai[k4 + 1536 + 1] = k3;
  3133. ai[k4 + 1536 + 2] = k3;
  3134. ai[k4 + 1536 + 3] = k3;
  3135. }
  3136. if (i3 == 3)
  3137. if (k2 == 0)
  3138. ai[k4] = k3;
  3139. else if (k2 == 1)
  3140. ai[k4 + 3] = k3;
  3141. else if (k2 == 2)
  3142. ai[k4 + 3 + 1536] = k3;
  3143. else if (k2 == 3)
  3144. ai[k4 + 1536] = k3;
  3145. if (i3 == 2)
  3146. if (k2 == 3) {
  3147. ai[k4] = k3;
  3148. ai[k4 + 512] = k3;
  3149. ai[k4 + 1024] = k3;
  3150. ai[k4 + 1536] = k3;
  3151. } else if (k2 == 0) {
  3152. ai[k4] = k3;
  3153. ai[k4 + 1] = k3;
  3154. ai[k4 + 2] = k3;
  3155. ai[k4 + 3] = k3;
  3156. } else if (k2 == 1) {
  3157. ai[k4 + 3] = k3;
  3158. ai[k4 + 3 + 512] = k3;
  3159. ai[k4 + 3 + 1024] = k3;
  3160. ai[k4 + 3 + 1536] = k3;
  3161. } else if (k2 == 2) {
  3162. ai[k4 + 1536] = k3;
  3163. ai[k4 + 1536 + 1] = k3;
  3164. ai[k4 + 1536 + 2] = k3;
  3165. ai[k4 + 1536 + 3] = k3;
  3166. }
  3167. }
  3168. }
  3169. k1 = worldController.method302(j1, l, i);
  3170. if (k1 != 0) {
  3171. int i2 = worldController.method304(j1, l, i, k1);
  3172. int l2 = i2 >> 6 & 3;
  3173. int j3 = i2 & 0x1f;
  3174. int l3 = k1 >> 14 & 0x7fff;
  3175. ObjectDef class46_1 = ObjectDef.forID(l3);
  3176. if (class46_1.anInt758 != -1) {
  3177. Background background_1 = mapScenes[class46_1.anInt758];
  3178. if (background_1 != null) {
  3179. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3180. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3181. background_1.drawBackground(48 + l * 4 + j5, 48
  3182. + (104 - i - class46_1.anInt761) * 4 + k5);
  3183. }
  3184. } else if (j3 == 9) {
  3185. int l4 = 0xeeeeee;
  3186. if (k1 > 0)
  3187. l4 = 0xee0000;
  3188. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3189. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3190. if (l2 == 0 || l2 == 2) {
  3191. ai1[l5 + 1536] = l4;
  3192. ai1[l5 + 1024 + 1] = l4;
  3193. ai1[l5 + 512 + 2] = l4;
  3194. ai1[l5 + 3] = l4;
  3195. } else {
  3196. ai1[l5] = l4;
  3197. ai1[l5 + 512 + 1] = l4;
  3198. ai1[l5 + 1024 + 2] = l4;
  3199. ai1[l5 + 1536 + 3] = l4;
  3200. }
  3201. }
  3202. }
  3203. k1 = worldController.method303(j1, l, i);
  3204. if (k1 != 0) {
  3205. int j2 = k1 >> 14 & 0x7fff;
  3206. ObjectDef class46 = ObjectDef.forID(j2);
  3207. if (class46.anInt758 != -1) {
  3208. Background background = mapScenes[class46.anInt758];
  3209. if (background != null) {
  3210. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3211. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3212. background.drawBackground(48 + l * 4 + i4, 48
  3213. + (104 - i - class46.anInt761) * 4 + j4);
  3214. }
  3215. }
  3216. }
  3217. }
  3218.  
  3219. private Sprite aSprite_1201;
  3220. private Sprite aSprite_1202;
  3221.  
  3222. private void loadTitleScreen() {
  3223. titleBox = new Background(titleStreamLoader, "titlebox", 0);
  3224. boxHover = new Sprite(titleStreamLoader, "titlebox", 1);
  3225. titleButton = new Background(titleStreamLoader, "titlebutton", 0);
  3226. loginHover = new Sprite(titleStreamLoader, "titlebutton", 1);
  3227. aBackgroundArray1152s = new Background[12];
  3228. int j = 0;
  3229. try {
  3230. j = Integer.parseInt(getParameter("fl_icon"));
  3231. } catch (Exception _ex) {
  3232. }
  3233. if (j == 0) {
  3234. for (int k = 0; k < 12; k++)
  3235. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3236. "runes", k);
  3237.  
  3238. } else {
  3239. for (int l = 0; l < 12; l++)
  3240. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3241. "runes", 12 + (l & 3));
  3242.  
  3243. }
  3244. aSprite_1201 = new Sprite(128, 265);
  3245. aSprite_1202 = new Sprite(128, 265);
  3246. // aSprite_1201 = new Sprite(0, 266);
  3247. // aSprite_1202 = new Sprite(0, 266);
  3248. System.arraycopy(leftSideFlame.anIntArray315, 0, aSprite_1201.myPixels,
  3249. 0, 33920);
  3250.  
  3251. System.arraycopy(rightSideFlame.anIntArray315, 0,
  3252. aSprite_1202.myPixels, 0, 33920);
  3253.  
  3254. anIntArray851 = new int[256];
  3255. for (int k1 = 0; k1 < 64; k1++)
  3256. anIntArray851[k1] = k1 * 0x40000;
  3257.  
  3258. for (int l1 = 0; l1 < 64; l1++)
  3259. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3260.  
  3261. for (int i2 = 0; i2 < 64; i2++)
  3262. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3263.  
  3264. for (int j2 = 0; j2 < 64; j2++)
  3265. anIntArray851[j2 + 192] = 0xffffff;
  3266.  
  3267. anIntArray852 = new int[256];
  3268. for (int k2 = 0; k2 < 64; k2++)
  3269. anIntArray852[k2] = k2 * 1024;
  3270.  
  3271. for (int l2 = 0; l2 < 64; l2++)
  3272. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3273.  
  3274. for (int i3 = 0; i3 < 64; i3++)
  3275. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3276.  
  3277. for (int j3 = 0; j3 < 64; j3++)
  3278. anIntArray852[j3 + 192] = 0xffffff;
  3279.  
  3280. anIntArray853 = new int[256];
  3281. for (int k3 = 0; k3 < 64; k3++)
  3282. anIntArray853[k3] = k3 * 4;
  3283.  
  3284. for (int l3 = 0; l3 < 64; l3++)
  3285. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3286.  
  3287. for (int i4 = 0; i4 < 64; i4++)
  3288. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3289.  
  3290. for (int j4 = 0; j4 < 64; j4++)
  3291. anIntArray853[j4 + 192] = 0xffffff;
  3292.  
  3293. anIntArray850 = new int[256];
  3294. anIntArray1190 = new int[32768];
  3295. anIntArray1191 = new int[32768];
  3296. randomizeBackground(null);
  3297. anIntArray828 = new int[32768];
  3298. anIntArray829 = new int[32768];
  3299. if (!aBoolean831) {
  3300. drawFlames = true;
  3301. aBoolean831 = true;
  3302. startRunnable(this, 2);
  3303. }
  3304. }
  3305.  
  3306. private static void setHighMem() {
  3307. WorldController.lowMem = false;
  3308. Texture.lowMem = false;
  3309. lowMem = false;
  3310. ObjectManager.lowMem = false;
  3311. ObjectDef.lowMem = false;
  3312. }
  3313.  
  3314. public static void main(String args[]) {
  3315. try {
  3316. nodeID = 1;
  3317. portOff = 0;
  3318. setHighMem();
  3319. isMembers = true;
  3320. signlink.storeid = 32;
  3321. signlink.startpriv(InetAddress.getLocalHost());
  3322. instance = new Jframe(args);
  3323. } catch (Exception exception) {
  3324. }
  3325. }
  3326.  
  3327. public static client instance;
  3328.  
  3329. public void loadingStages() {
  3330. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3331. aRSImageProducer_1165.initDrawingArea();
  3332. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151,
  3333. 257);
  3334. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.",
  3335. 150, 256);
  3336. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3337. loadingStage = 1;
  3338. aLong824 = System.currentTimeMillis();
  3339. }
  3340. if (loadingStage == 1) {
  3341. int j = method54();
  3342. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3343. signlink.reporterror(myUsername + " glcfb " + aLong1215 + ","
  3344. + j + "," + lowMem + "," + decompressors[0] + ","
  3345. + onDemandFetcher.getNodeCount() + "," + plane + ","
  3346. + anInt1069 + "," + anInt1070);
  3347. aLong824 = System.currentTimeMillis();
  3348. }
  3349. }
  3350. if (loadingStage == 2 && plane != anInt985) {
  3351. anInt985 = plane;
  3352. method24(plane);
  3353. }
  3354. }
  3355.  
  3356. private int method54() {
  3357. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3358. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3359. return -1;
  3360. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3361. return -2;
  3362. }
  3363. boolean flag = true;
  3364. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3365. byte abyte0[] = aByteArrayArray1247[j];
  3366. if (abyte0 != null) {
  3367. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3368. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3369. if (aBoolean1159) {
  3370. k = 10;
  3371. l = 10;
  3372. }
  3373. flag &= ObjectManager.method189(k, abyte0, l);
  3374. }
  3375. }
  3376. if (!flag)
  3377. return -3;// couldn't parse all landscapes
  3378. if (aBoolean1080) {
  3379. return -4;
  3380. } else {
  3381. loadingStage = 2;
  3382. ObjectManager.anInt131 = plane;
  3383. method22();
  3384. stream.createFrame(121);
  3385. return 0;
  3386. }
  3387. }
  3388.  
  3389. public void method55() {
  3390. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3391. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3392. .reverseGetNext())
  3393. if (class30_sub2_sub4_sub4.anInt1597 != plane
  3394. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3395. class30_sub2_sub4_sub4.unlink();
  3396. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3397. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3398. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3399. if (npc != null && npc.x >= 0 && npc.x < 13312
  3400. && npc.y >= 0 && npc.y < 13312)
  3401. class30_sub2_sub4_sub4.method455(
  3402. loopCycle,
  3403. npc.y,
  3404. method42(class30_sub2_sub4_sub4.anInt1597,
  3405. npc.y, npc.x)
  3406. - class30_sub2_sub4_sub4.anInt1583,
  3407. npc.x);
  3408. }
  3409. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3410. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3411. Player player;
  3412. if (j == unknownInt10)
  3413. player = myPlayer;
  3414. else
  3415. player = playerArray[j];
  3416. if (player != null && player.x >= 0 && player.x < 13312
  3417. && player.y >= 0 && player.y < 13312)
  3418. class30_sub2_sub4_sub4.method455(
  3419. loopCycle,
  3420. player.y,
  3421. method42(class30_sub2_sub4_sub4.anInt1597,
  3422. player.y, player.x)
  3423. - class30_sub2_sub4_sub4.anInt1583,
  3424. player.x);
  3425. }
  3426. class30_sub2_sub4_sub4.method456(anInt945);
  3427. worldController.method285(plane,
  3428. class30_sub2_sub4_sub4.anInt1595,
  3429. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  3430. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  3431. (int) class30_sub2_sub4_sub4.aDouble1585,
  3432. class30_sub2_sub4_sub4, false);
  3433. }
  3434.  
  3435. }
  3436.  
  3437. @Override
  3438. public AppletContext getAppletContext() {
  3439. if (signlink.mainapp != null)
  3440. return signlink.mainapp.getAppletContext();
  3441. else
  3442. return super.getAppletContext();
  3443. }
  3444.  
  3445. public static String capitalize(String s) {
  3446. for (int i = 0; i < s.length(); i++) {
  3447. if (i == 0) {
  3448. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)),
  3449. s.substring(1));
  3450. }
  3451. if (!Character.isLetterOrDigit(s.charAt(i))) {
  3452. if (i + 1 < s.length()) {
  3453. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  3454. Character.toUpperCase(s.charAt(i + 1)),
  3455. s.substring(i + 2));
  3456. }
  3457. }
  3458. }
  3459. return s;
  3460. }
  3461.  
  3462. private void drawLogo() {
  3463. /*
  3464. * byte abyte0[] = titleStreamLoader.getDataForName("title.dat"); Sprite
  3465. * sprite = new Sprite(abyte0, this); leftSideFlame.initDrawingArea();
  3466. * sprite.method346(0, 0); rightSideFlame.initDrawingArea();
  3467. * sprite.method346(-637, 0); aRSImageProducer_1107.initDrawingArea();
  3468. * sprite.method346(-128, 0); aRSImageProducer_1108.initDrawingArea();
  3469. * sprite.method346(-202, -371); loginScreenArea.initDrawingArea();
  3470. * sprite.method346(-202, -171); gameLogo.initDrawingArea();
  3471. * sprite.method346(0, -265); aRSImageProducer_1113.initDrawingArea();
  3472. * sprite.method346(-562, -265);
  3473. * aRSImageProducer_1114.initDrawingArea(); sprite.method346(-128,
  3474. * -171); aRSImageProducer_1115.initDrawingArea();
  3475. * sprite.method346(-562, -171); int ai[] = new int[sprite.myWidth]; for
  3476. * (int j = 0; j < sprite.myHeight; j++) { for (int k = 0; k <
  3477. * sprite.myWidth; k++) ai[k] = sprite.myPixels[(sprite.myWidth - k - 1)
  3478. * + sprite.myWidth * j];
  3479. *
  3480. * System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j,
  3481. * sprite.myWidth); } leftSideFlame.initDrawingArea();
  3482. * sprite.method346(382, 0); rightSideFlame.initDrawingArea();
  3483. * sprite.method346(-255, 0); aRSImageProducer_1107.initDrawingArea();
  3484. * sprite.method346(254, 0); aRSImageProducer_1108.initDrawingArea();
  3485. * sprite.method346(180, -371); loginScreenArea.initDrawingArea();
  3486. * sprite.method346(180, -171); gameLogo.initDrawingArea();
  3487. * sprite.method346(382, -265); aRSImageProducer_1113.initDrawingArea();
  3488. * sprite.method346(-180, -265);
  3489. * aRSImageProducer_1114.initDrawingArea(); sprite.method346(254, -171);
  3490. * aRSImageProducer_1115.initDrawingArea(); sprite.method346(-180,
  3491. * -171); sprite = new Sprite(titleStreamLoader, "logo", 0);
  3492. * aRSImageProducer_1107.initDrawingArea(); sprite.drawSprite(382 -
  3493. * sprite.myWidth / 2 - 128, 18); sprite = null; System.gc();
  3494. */
  3495. }
  3496.  
  3497. @SuppressWarnings("unused")
  3498. private static void writeFile(byte[] fileData, String fileName) throws IOException{
  3499. OutputStream out = new FileOutputStream(fileName);
  3500. out.write(fileData);
  3501. out.close();
  3502. }
  3503.  
  3504. private void processOnDemandQueue() {
  3505. do {
  3506. OnDemandData onDemandData;
  3507. do {
  3508. onDemandData = onDemandFetcher.getNextNode();
  3509. if (onDemandData == null)
  3510. return;
  3511. if (onDemandData.dataType == 0) {
  3512. Model.method460(onDemandData.buffer, onDemandData.ID);
  3513.  
  3514. /*try {
  3515. writeFile(onDemandData.buffer, "./dumpedModel/" + onDemandData.ID + ".dat") ;
  3516. }catch(Exception e) {
  3517. e.printStackTrace();
  3518. }*/
  3519.  
  3520. needDrawTabArea = true;
  3521. if (backDialogID != -1)
  3522. inputTaken = true;
  3523. }
  3524. if (onDemandData.dataType == 1 && onDemandData.buffer != null)
  3525. Class36.load(onDemandData.ID, onDemandData.buffer);
  3526. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong
  3527. && onDemandData.buffer != null)
  3528. saveMidi(songChanging, onDemandData.buffer);
  3529. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3530. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3531. if (anIntArray1235[i] == onDemandData.ID) {
  3532. System.out.println("Floor Map Loaded: "
  3533. + anIntArray1235[i]);
  3534. // aByteArrayArray1183[i] =
  3535. // FileOperations.readFile("maps/floors/" +
  3536. // anIntArray1235[i]);
  3537. if (aByteArrayArray1183[i] == null)
  3538. aByteArrayArray1183[i] = onDemandData.buffer;
  3539. if (onDemandData.buffer == null)
  3540. anIntArray1235[i] = -1;
  3541. break;
  3542. }
  3543. if (anIntArray1236[i] != onDemandData.ID)
  3544. continue;
  3545. System.out.println("Object Map Loaded: "
  3546. + anIntArray1236[i]);
  3547. // aByteArrayArray1247[i] =
  3548. // FileOperations.readFile("maps/objects/" +
  3549. // anIntArray1236[i]);
  3550. if (aByteArrayArray1247[i] == null)
  3551. aByteArrayArray1247[i] = onDemandData.buffer;
  3552. if (onDemandData.buffer == null)
  3553. anIntArray1236[i] = -1;
  3554. break;
  3555. }
  3556.  
  3557. }
  3558. } while (onDemandData.dataType != 93
  3559. || !onDemandFetcher.method564(onDemandData.ID));
  3560. ObjectManager.method173(new Stream(onDemandData.buffer),
  3561. onDemandFetcher);
  3562. } while (true);
  3563. }
  3564.  
  3565. public void calcFlamesPosition() {
  3566. char c = '\u0100';
  3567. for (int j = 10; j < 117; j++) {
  3568. int k = (int) (Math.random() * 100D);
  3569. if (k < 50)
  3570. anIntArray828[j + (c - 2 << 7)] = 255;
  3571. }
  3572. for (int l = 0; l < 100; l++) {
  3573. int i1 = (int) (Math.random() * 124D) + 2;
  3574. int k1 = (int) (Math.random() * 128D) + 128;
  3575. int k2 = i1 + (k1 << 7);
  3576. anIntArray828[k2] = 192;
  3577. }
  3578.  
  3579. for (int j1 = 1; j1 < c - 1; j1++) {
  3580. for (int l1 = 1; l1 < 127; l1++) {
  3581. int l2 = l1 + (j1 << 7);
  3582. anIntArray829[l2] = (anIntArray828[l2 - 1]
  3583. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3584. }
  3585.  
  3586. }
  3587.  
  3588. anInt1275 += 128;
  3589. if (anInt1275 > anIntArray1190.length) {
  3590. anInt1275 -= anIntArray1190.length;
  3591. int i2 = (int) (Math.random() * 12D);
  3592. randomizeBackground(aBackgroundArray1152s[i2]);
  3593. }
  3594. for (int j2 = 1; j2 < c - 1; j2++) {
  3595. for (int i3 = 1; i3 < 127; i3++) {
  3596. int k3 = i3 + (j2 << 7);
  3597. int i4 = anIntArray829[k3 + 128]
  3598. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  3599. - 1] / 5;
  3600. if (i4 < 0)
  3601. i4 = 0;
  3602. anIntArray828[k3] = i4;
  3603. }
  3604.  
  3605. }
  3606.  
  3607. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3608.  
  3609. anIntArray969[c - 1] = (int) (Math.sin(loopCycle / 14D) * 16D
  3610. + Math.sin(loopCycle / 15D) * 14D + Math.sin(loopCycle / 16D) * 12D);
  3611. if (anInt1040 > 0)
  3612. anInt1040 -= 4;
  3613. if (anInt1041 > 0)
  3614. anInt1041 -= 4;
  3615. if (anInt1040 == 0 && anInt1041 == 0) {
  3616. int l3 = (int) (Math.random() * 2000D);
  3617. if (l3 == 0)
  3618. anInt1040 = 1024;
  3619. if (l3 == 1)
  3620. anInt1041 = 1024;
  3621. }
  3622. }
  3623.  
  3624. private boolean saveWave(byte abyte0[], int i) {
  3625. return abyte0 == null || signlink.wavesave(abyte0, i);
  3626. }
  3627.  
  3628. public void method60(int i) {
  3629. RSInterface class9 = RSInterface.interfaceCache[i];
  3630. for (int j = 0; j < class9.children.length; j++) {
  3631. if (class9.children[j] == -1)
  3632. break;
  3633. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3634. if (class9_1.type == 1)
  3635. method60(class9_1.id);
  3636. class9_1.anInt246 = 0;
  3637. class9_1.anInt208 = 0;
  3638. }
  3639. }
  3640.  
  3641. public void drawHeadIcon() {
  3642. if (anInt855 != 2)
  3643. return;
  3644. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2,
  3645. (anInt935 - baseY << 7) + anInt938);
  3646. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  3647. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3648. }
  3649.  
  3650. private void mainGameProcessor() {
  3651. if (anInt1104 > 1)
  3652. anInt1104--;
  3653. if (anInt1011 > 0)
  3654. anInt1011--;
  3655. for (int j = 0; j < 5; j++)
  3656. if (!parsePacket())
  3657. break;
  3658.  
  3659. if (!this.loggedIn)
  3660. return;
  3661. synchronized (mouseDetection.syncObject) {
  3662. if (flagged) {
  3663. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3664. stream.createFrame(45);
  3665. stream.writeWordBigEndian(0);
  3666. int j2 = stream.currentOffset;
  3667. int j3 = 0;
  3668. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3669. if (j2 - stream.currentOffset >= 240)
  3670. break;
  3671. j3++;
  3672. int l4 = mouseDetection.coordsY[j4];
  3673. if (l4 < 0)
  3674. l4 = 0;
  3675. else if (l4 > 502)
  3676. l4 = 502;
  3677. int k5 = mouseDetection.coordsX[j4];
  3678. if (k5 < 0)
  3679. k5 = 0;
  3680. else if (k5 > 764)
  3681. k5 = 764;
  3682. int i6 = l4 * 765 + k5;
  3683. if (mouseDetection.coordsY[j4] == -1
  3684. && mouseDetection.coordsX[j4] == -1) {
  3685. k5 = -1;
  3686. l4 = -1;
  3687. i6 = 0x7ffff;
  3688. }
  3689. if (k5 == anInt1237 && l4 == anInt1238) {
  3690. if (anInt1022 < 2047)
  3691. anInt1022++;
  3692. } else {
  3693. int j6 = k5 - anInt1237;
  3694. anInt1237 = k5;
  3695. int k6 = l4 - anInt1238;
  3696. anInt1238 = l4;
  3697. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31
  3698. && k6 >= -32 && k6 <= 31) {
  3699. j6 += 32;
  3700. k6 += 32;
  3701. stream.writeWord((anInt1022 << 12) + (j6 << 6)
  3702. + k6);
  3703. anInt1022 = 0;
  3704. } else if (anInt1022 < 8) {
  3705. stream.writeDWordBigEndian(0x800000
  3706. + (anInt1022 << 19) + i6);
  3707. anInt1022 = 0;
  3708. } else {
  3709. stream.writeDWord(0xc0000000
  3710. + (anInt1022 << 19) + i6);
  3711. anInt1022 = 0;
  3712. }
  3713. }
  3714. }
  3715.  
  3716. stream.writeBytes(stream.currentOffset - j2);
  3717. if (j3 >= mouseDetection.coordsIndex) {
  3718. mouseDetection.coordsIndex = 0;
  3719. } else {
  3720. mouseDetection.coordsIndex -= j3;
  3721. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3722. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5
  3723. + j3];
  3724. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5
  3725. + j3];
  3726. }
  3727.  
  3728. }
  3729. }
  3730. } else {
  3731. mouseDetection.coordsIndex = 0;
  3732. }
  3733. }
  3734. if (super.clickMode3 != 0) {
  3735. long l = (super.aLong29 - aLong1220) / 50L;
  3736. if (l > 4095L)
  3737. l = 4095L;
  3738. aLong1220 = super.aLong29;
  3739. int k2 = super.saveClickY;
  3740. if (k2 < 0)
  3741. k2 = 0;
  3742. else if (k2 > 502)
  3743. k2 = 502;
  3744. int k3 = super.saveClickX;
  3745. if (k3 < 0)
  3746. k3 = 0;
  3747. else if (k3 > 764)
  3748. k3 = 764;
  3749. int k4 = k2 * 765 + k3;
  3750. int j5 = 0;
  3751. if (super.clickMode3 == 2)
  3752. j5 = 1;
  3753. int l5 = (int) l;
  3754. stream.createFrame(241);
  3755. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3756. }
  3757. if (anInt1016 > 0)
  3758. anInt1016--;
  3759. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  3760. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3761. aBoolean1017 = true;
  3762. if (aBoolean1017 && anInt1016 <= 0) {
  3763. anInt1016 = 20;
  3764. aBoolean1017 = false;
  3765. stream.createFrame(86);
  3766. stream.writeWord(anInt1184);
  3767. stream.method432(viewRotation);
  3768. }
  3769. if (super.awtFocus && !aBoolean954) {
  3770. aBoolean954 = true;
  3771. stream.createFrame(3);
  3772. stream.writeWordBigEndian(1);
  3773. }
  3774. if (!super.awtFocus && aBoolean954) {
  3775. aBoolean954 = false;
  3776. stream.createFrame(3);
  3777. stream.writeWordBigEndian(0);
  3778. }
  3779. loadingStages();
  3780. method115();
  3781. method90();
  3782. anInt1009++;
  3783. if (anInt1009 > 750)
  3784. dropClient();
  3785. method114();
  3786. method95();
  3787. method38();
  3788. anInt945++;
  3789. if (crossType != 0) {
  3790. crossIndex += 20;
  3791. if (crossIndex >= 400)
  3792. crossType = 0;
  3793. }
  3794. if (atInventoryInterfaceType != 0) {
  3795. atInventoryLoopCycle++;
  3796. if (atInventoryLoopCycle >= 15) {
  3797. if (atInventoryInterfaceType == 2)
  3798. needDrawTabArea = true;
  3799. if (atInventoryInterfaceType == 3)
  3800. inputTaken = true;
  3801. atInventoryInterfaceType = 0;
  3802. }
  3803. }
  3804. if (activeInterfaceType != 0) {
  3805. anInt989++;
  3806. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  3807. || super.mouseY > anInt1088 + 5
  3808. || super.mouseY < anInt1088 - 5)
  3809. aBoolean1242 = true;
  3810. if (super.clickMode2 == 0) {
  3811. if (activeInterfaceType == 2)
  3812. needDrawTabArea = true;
  3813. if (activeInterfaceType == 3)
  3814. inputTaken = true;
  3815. activeInterfaceType = 0;
  3816. if (aBoolean1242 && anInt989 >= 10) {
  3817. lastActiveInvInterface = -1;
  3818. processRightClick();
  3819. if (anInt1084 == 5382) {
  3820. Point southWest, northEast;
  3821. southWest = new Point(68, 75);
  3822. northEast = new Point(457, 41);
  3823. int[] slots = new int[9];
  3824. for (int i = 0; i < slots.length; i++)
  3825. slots[i] = i == 0 ? (int) southWest.getX()
  3826. : (41 * i) + (int) southWest.getX();
  3827. for (int i = 0; i < slots.length; i++) {
  3828. if (super.mouseX >= slots[i]
  3829. && super.mouseX <= slots[i] + 42
  3830. && super.mouseY >= northEast.getY()
  3831. && super.mouseY <= southWest.getY()) {
  3832. RSInterface rsi = RSInterface.interfaceCache[58050 + i];
  3833. if (rsi.isMouseoverTriggered) {
  3834. continue;
  3835. }
  3836. stream.createFrame(214);
  3837. stream.method433(anInt1084);
  3838. stream.method424(0);
  3839. stream.method433(anInt1085);
  3840. stream.method431(1000 + i);
  3841. return;
  3842. }
  3843. }
  3844. }
  3845. if (lastActiveInvInterface == anInt1084
  3846. && mouseInvInterfaceIndex != anInt1085) {
  3847. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3848. int j1 = 0;
  3849. if (anInt913 == 1 && class9.contentType == 206)
  3850. j1 = 1;
  3851. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3852. j1 = 0;
  3853. if (class9.aBoolean235) {
  3854. int l2 = anInt1085;
  3855. int l3 = mouseInvInterfaceIndex;
  3856. class9.inv[l3] = class9.inv[l2];
  3857. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3858. class9.inv[l2] = -1;
  3859. class9.invStackSizes[l2] = 0;
  3860. } else if (j1 == 1) {
  3861. int i3 = anInt1085;
  3862. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3863. if (i3 > i4) {
  3864. class9.swapInventoryItems(i3, i3 - 1);
  3865. i3--;
  3866. } else if (i3 < i4) {
  3867. class9.swapInventoryItems(i3, i3 + 1);
  3868. i3++;
  3869. }
  3870.  
  3871. } else {
  3872. class9.swapInventoryItems(anInt1085,
  3873. mouseInvInterfaceIndex);
  3874. }
  3875. stream.createFrame(214);
  3876. stream.method433(anInt1084);
  3877. stream.method424(j1);
  3878. stream.method433(anInt1085);
  3879. stream.method431(mouseInvInterfaceIndex);
  3880. }
  3881. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  3882. && menuActionRow > 2)
  3883. determineMenuSize();
  3884. else if (menuActionRow > 0)
  3885. doAction(menuActionRow - 1);
  3886. atInventoryLoopCycle = 10;
  3887. super.clickMode3 = 0;
  3888. }
  3889. }
  3890. if (WorldController.anInt470 != -1) {
  3891. int k = WorldController.anInt470;
  3892. int k1 = WorldController.anInt471;
  3893. if (myPrivilege == 2 && ctrlPressed) {
  3894. teleport(baseX + k, baseY + k1);
  3895. } else {
  3896. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  3897. myPlayer.smallX[0], true, k);
  3898. WorldController.anInt470 = -1;
  3899. if (flag) {
  3900. crossX = super.saveClickX;
  3901. crossY = super.saveClickY;
  3902. crossType = 1;
  3903. crossIndex = 0;
  3904. }
  3905. }
  3906. }
  3907. if (super.clickMode3 == 1 && aString844 != null) {
  3908. aString844 = null;
  3909. inputTaken = true;
  3910. super.clickMode3 = 0;
  3911. }
  3912. if (!processMenuClick()) {
  3913. processMainScreenClick();
  3914. processTabClick();
  3915. processTabClick2();
  3916. processChatModeClick();
  3917. }
  3918. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3919. anInt1213++;
  3920. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3921. if (anInt1501 < 50 && !menuOpen) {
  3922. anInt1501++;
  3923. if (anInt1501 == 50) {
  3924. if (anInt1500 != 0) {
  3925. inputTaken = true;
  3926. }
  3927. if (anInt1044 != 0) {
  3928. needDrawTabArea = true;
  3929. }
  3930. }
  3931. }
  3932. } else if (anInt1501 > 0) {
  3933. anInt1501--;
  3934. }
  3935. if (loadingStage == 2)
  3936. method108();
  3937. if (loadingStage == 2 && aBoolean1160)
  3938. calcCameraPos();
  3939. for (int i1 = 0; i1 < 5; i1++)
  3940. anIntArray1030[i1]++;
  3941. method73();
  3942. super.idleTime++;
  3943. if (super.idleTime > 4500) {
  3944. anInt1011 = 250;
  3945. super.idleTime -= 500;
  3946. stream.createFrame(202);
  3947. }
  3948. anInt1010++;
  3949. if (anInt1010 > 50)
  3950. stream.createFrame(0);
  3951. try {
  3952. if (socketStream != null && stream.currentOffset > 0) {
  3953. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3954. stream.currentOffset = 0;
  3955. anInt1010 = 0;
  3956. }
  3957. } catch (IOException _ex) {
  3958. dropClient();
  3959. } catch (Exception exception) {
  3960. resetLogout();
  3961. }
  3962. }
  3963.  
  3964. public void method63() {
  3965. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  3966. .reverseGetFirst();
  3967. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  3968. .reverseGetNext())
  3969. if (class30_sub1.anInt1294 == -1) {
  3970. class30_sub1.anInt1302 = 0;
  3971. method89(class30_sub1);
  3972. } else {
  3973. class30_sub1.unlink();
  3974. }
  3975.  
  3976. }
  3977.  
  3978. private void resetImageProducers() {
  3979. if (aRSImageProducer_1107 != null)
  3980. return;
  3981. super.fullGameScreen = null;
  3982. aRSImageProducer_1166 = null;
  3983. aRSImageProducer_1164 = null;
  3984. aRSImageProducer_1163 = null;
  3985. aRSImageProducer_1165 = null;
  3986. aRSImageProducer_1125 = null;
  3987. leftSideFlame = new RSImageProducer(128, 265, getGameComponent());
  3988. DrawingArea.setAllPixelsToZero();
  3989. rightSideFlame = new RSImageProducer(128, 265, getGameComponent());
  3990. DrawingArea.setAllPixelsToZero();
  3991. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  3992. getGameComponent());
  3993. DrawingArea.setAllPixelsToZero();
  3994. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  3995. getGameComponent());
  3996. DrawingArea.setAllPixelsToZero();
  3997. loginScreenArea = new RSImageProducer(765, 503, getGameComponent());
  3998. DrawingArea.setAllPixelsToZero();
  3999. gameLogo = new RSImageProducer(202, 238, getGameComponent());
  4000. DrawingArea.setAllPixelsToZero();
  4001. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  4002. getGameComponent());
  4003. DrawingArea.setAllPixelsToZero();
  4004. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4005. DrawingArea.setAllPixelsToZero();
  4006. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4007. DrawingArea.setAllPixelsToZero();
  4008. if (titleStreamLoader != null) {
  4009. drawLogo();
  4010. loadTitleScreen();
  4011. }
  4012. welcomeScreenRaised = true;
  4013. }
  4014.  
  4015. public int rememberMe = 0;
  4016. public int loginButtonint;
  4017. public int rememberMehover;
  4018. public int textbox;
  4019. public int textbox1;
  4020.  
  4021. @Override
  4022. void drawLoadingText(int i, String s) {
  4023. anInt1079 = i;
  4024. aString1049 = s;
  4025. resetImageProducers();
  4026. if (titleStreamLoader == null) {
  4027. super.drawLoadingText(i, s);
  4028. return;
  4029. }
  4030. loginScreenArea.initDrawingArea();
  4031. Sprite background = new Sprite("loginscreen/general/background");
  4032. background.drawAdvancedSprite(0, 0);
  4033. int x = 765 / 2 - 543 / 2;
  4034. int y = 503 / 2 - 20 + 8;
  4035. int width = 540;
  4036. int height = 32;
  4037. double offset = 5.43;
  4038. new Sprite("loginscreen/general/emptybar").drawAdvancedSprite(765 / 2 - width / 2, 503 / 2 - height / 2);
  4039. new Sprite("loginscreen/general/fullbar").drawAdvancedSprite(765 / 2 - width / 2, 503 / 2 - height / 2);
  4040. new DrawingArea().drawAlphaGradient(
  4041. x + ((int) Math.round(i * offset) / 2), y,
  4042. width - ((int) Math.round(i * offset) / 2), height, 0x000000, 0x000000, 200);
  4043. if (i >= 198) {
  4044. newBoldFont.drawCenteredString("Finished loading OS PvP", (765 / 2), 503 / 2 + 5, 0xffffff, 1);
  4045. } else {
  4046. newBoldFont.drawCenteredString("Loading OS PvP - Please wait - " + (i / 2) + "%", (765 / 2), 503 / 2 + 5, 0xffffff, 1);
  4047. }
  4048. loginScreenArea.drawGraphics(0, super.graphics, 0);
  4049. }
  4050.  
  4051. public void method65(int i, int j, int k, int l, RSInterface class9,
  4052. int i1, boolean flag, int j1) {
  4053. int anInt992;
  4054. if (aBoolean972)
  4055. anInt992 = 32;
  4056. else
  4057. anInt992 = 0;
  4058. aBoolean972 = false;
  4059. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  4060. class9.scrollPosition -= anInt1213 * 4;
  4061. if (flag) {
  4062. needDrawTabArea = true;
  4063. }
  4064. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  4065. class9.scrollPosition += anInt1213 * 4;
  4066. if (flag) {
  4067. needDrawTabArea = true;
  4068. }
  4069. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  4070. && l < (i1 + j) - 16 && anInt1213 > 0) {
  4071. int l1 = ((j - 32) * j) / j1;
  4072. if (l1 < 8)
  4073. l1 = 8;
  4074. int i2 = l - i1 - 16 - l1 / 2;
  4075. int j2 = j - 32 - l1;
  4076. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4077. if (flag)
  4078. needDrawTabArea = true;
  4079. aBoolean972 = true;
  4080. }
  4081. }
  4082.  
  4083. private boolean method66(int i, int j, int k) {
  4084. int i1 = i >> 14 & 0x7fff;
  4085. int j1 = worldController.method304(plane, k, j, i);
  4086. if (j1 == -1)
  4087. return false;
  4088. int k1 = j1 & 0x1f;
  4089. int l1 = j1 >> 6 & 3;
  4090. if (k1 == 10 || k1 == 11 || k1 == 22) {
  4091. ObjectDef class46 = ObjectDef.forID(i1);
  4092. int i2;
  4093. int j2;
  4094. if (l1 == 0 || l1 == 2) {
  4095. i2 = class46.anInt744;
  4096. j2 = class46.anInt761;
  4097. } else {
  4098. i2 = class46.anInt761;
  4099. j2 = class46.anInt744;
  4100. }
  4101. int k2 = class46.anInt768;
  4102. if (l1 != 0)
  4103. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4104. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j,
  4105. myPlayer.smallX[0], false, k);
  4106. } else {
  4107. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j,
  4108. myPlayer.smallX[0], false, k);
  4109. }
  4110. crossX = super.saveClickX;
  4111. crossY = super.saveClickY;
  4112. crossType = 2;
  4113. crossIndex = 0;
  4114. return true;
  4115. }
  4116.  
  4117. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  4118. int k) {
  4119. byte abyte0[] = null;
  4120. int l = 5;
  4121. try {
  4122. if (decompressors[0] != null)
  4123. abyte0 = decompressors[0].decompress(i);
  4124. } catch (Exception _ex) {
  4125. }
  4126. if (abyte0 != null) {
  4127. // aCRC32_930.reset();
  4128. // aCRC32_930.update(abyte0);
  4129. // int i1 = (int)aCRC32_930.getValue();
  4130. // if(i1 != j)
  4131. }
  4132. if (abyte0 != null) {
  4133. StreamLoader streamLoader = new StreamLoader(abyte0, s);
  4134. return streamLoader;
  4135. }
  4136. int j1 = 0;
  4137. while (abyte0 == null) {
  4138. String s2 = "Unknown error";
  4139. drawLoadingText(k, "Requesting " + s);
  4140. try {
  4141. int k1 = 0;
  4142. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  4143. byte abyte1[] = new byte[6];
  4144. datainputstream.readFully(abyte1, 0, 6);
  4145. Stream stream = new Stream(abyte1);
  4146. stream.currentOffset = 3;
  4147. int i2 = stream.read3Bytes() + 6;
  4148. int j2 = 6;
  4149. abyte0 = new byte[i2];
  4150. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  4151.  
  4152. while (j2 < i2) {
  4153. int l2 = i2 - j2;
  4154. if (l2 > 1000)
  4155. l2 = 1000;
  4156. int j3 = datainputstream.read(abyte0, j2, l2);
  4157. if (j3 < 0) {
  4158. s2 = "Length error: " + j2 + "/" + i2;
  4159. throw new IOException("EOF");
  4160. }
  4161. j2 += j3;
  4162. int k3 = (j2 * 100) / i2;
  4163. if (k3 != k1)
  4164. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  4165. k1 = k3;
  4166. }
  4167. datainputstream.close();
  4168. try {
  4169. if (decompressors[0] != null)
  4170. decompressors[0].method234(abyte0.length, abyte0, i);
  4171. } catch (Exception _ex) {
  4172. decompressors[0] = null;
  4173. }
  4174. /*
  4175. * if(abyte0 != null) { aCRC32_930.reset();
  4176. * aCRC32_930.update(abyte0); int i3 =
  4177. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  4178. * j1++; s2 = "Checksum error: " + i3; } }
  4179. */
  4180. } catch (IOException ioexception) {
  4181. if (s2.equals("Unknown error"))
  4182. s2 = "Connection error";
  4183. abyte0 = null;
  4184. } catch (NullPointerException _ex) {
  4185. s2 = "Null error";
  4186. abyte0 = null;
  4187. if (!signlink.reporterror)
  4188. return null;
  4189. } catch (ArrayIndexOutOfBoundsException _ex) {
  4190. s2 = "Bounds error";
  4191. abyte0 = null;
  4192. if (!signlink.reporterror)
  4193. return null;
  4194. } catch (Exception _ex) {
  4195. s2 = "Unexpected error";
  4196. abyte0 = null;
  4197. if (!signlink.reporterror)
  4198. return null;
  4199. }
  4200. if (abyte0 == null) {
  4201. for (int l1 = l; l1 > 0; l1--) {
  4202. if (j1 >= 3) {
  4203. drawLoadingText(k, "Game updated - please reload page");
  4204. l1 = 10;
  4205. } else {
  4206. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4207. }
  4208. try {
  4209. Thread.sleep(1000L);
  4210. } catch (Exception _ex) {
  4211. }
  4212. }
  4213.  
  4214. l *= 2;
  4215. if (l > 60)
  4216. l = 60;
  4217. aBoolean872 = !aBoolean872;
  4218. }
  4219.  
  4220. }
  4221.  
  4222. StreamLoader streamLoader_1 = new StreamLoader(abyte0, s);
  4223. return streamLoader_1;
  4224. }
  4225.  
  4226. public void sendStringAsLong(String string) {
  4227. stream.createFrame(60);
  4228. stream.writeQWord(TextClass.longForName(string));
  4229. }
  4230.  
  4231. public void sendString(int identifier, String text) {
  4232. text = identifier + "," + text;
  4233. stream.createFrame(127);
  4234. stream.writeWordBigEndian(text.length() + 1);
  4235. stream.writeString(text);
  4236. }
  4237.  
  4238. public void dropClient() {
  4239. if (anInt1011 > 0) {
  4240. resetLogout();
  4241. return;
  4242. }
  4243. aRSImageProducer_1165.initDrawingArea();
  4244. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2);
  4245. DrawingArea.drawPixels(37, 3, 3, 0, 227);
  4246. aTextDrawingArea_1271.drawText(0, "Connection Lost", 19, 120);
  4247. aTextDrawingArea_1271.drawText(0xffffff, "Connection Lost", 18, 119);
  4248. aTextDrawingArea_1271
  4249. .drawText(0, "Please Wait - Reconnecting", 34, 117);
  4250. aTextDrawingArea_1271.drawText(0xffffff, "Please Wait - Reconnecting",
  4251. 34, 116);
  4252. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4253. anInt1021 = 0;
  4254. destX = 0;
  4255. RSSocket rsSocket = socketStream;
  4256. loggedIn = false;
  4257. loginFailures = 0;
  4258. login(myUsername, myPassword, true);
  4259. if (!loggedIn)
  4260. resetLogout();
  4261. try {
  4262. rsSocket.close();
  4263. } catch (Exception _ex) {
  4264. }
  4265. }
  4266.  
  4267. public void readSettings() throws IOException {
  4268. DataInputStream in = new DataInputStream(new BufferedInputStream(
  4269. new FileInputStream(signlink.findcachedir() + "settings.dat")));
  4270. OSOrbs = in.readInt() == 1 ? true : false;
  4271. revision474 = in.readInt() == 1 ? true : false;
  4272. revision498 = in.readInt() == 1 ? true : false;
  4273. OSCounter = in.readInt() == 1 ? true : false;
  4274. RSApplet.hotKeyToggle = in.readInt() == 1 ? true : false;
  4275. in.close();
  4276. }
  4277.  
  4278. public void writeSettings() throws IOException {
  4279. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(
  4280. new FileOutputStream(signlink.findcachedir() + "settings.dat")));
  4281. // out.writeInt(gameFrame554 ? 1 : 0);
  4282. // out.writeInt(gameFrame474 ? 1 : 0);
  4283. // out.writeInt(gameFrame525 ? 1 : 0);
  4284. out.writeInt(OSOrbs ? 1 : 0);
  4285. out.writeInt(revision474 ? 1 : 0);
  4286. out.writeInt(revision498 ? 1 : 0);
  4287. out.writeInt(OSCounter ? 1 : 0);
  4288. out.writeInt(RSApplet.hotKeyToggle ? 1 : 0);
  4289. out.close();
  4290. }
  4291.  
  4292. private void doAction(int i) {
  4293. if (i < 0)
  4294. return;
  4295. if (inputDialogState != 0) {
  4296. inputDialogState = 0;
  4297. inputTaken = true;
  4298. }
  4299. int j = menuActionCmd2[i];
  4300. int k = menuActionCmd3[i];
  4301. int l = menuActionID[i];
  4302. int i1 = menuActionCmd1[i];
  4303.  
  4304. if (l >= 2000)
  4305. l -= 2000;
  4306. if (l == 1100) {
  4307. RSInterface button = RSInterface.interfaceCache[k];
  4308. button.setMenuVisible(button.isMenuVisible() ? false : true);
  4309. }
  4310. if (l == 1200) {
  4311. stream.createFrame(185);
  4312. stream.writeWord(k);
  4313. RSInterface item = RSInterface.interfaceCache[k];
  4314. RSInterface menu = RSInterface.interfaceCache[item.mOverInterToTrigger];
  4315. menu.setMenuItem(item.getMenuItem());
  4316. menu.setMenuVisible(false);
  4317. }
  4318. if (l >= 1700 && l <= 1710) {
  4319. stream.createFrame(185);
  4320. int offset = 0;
  4321. offset = k + (k - 58030) * 10 + (l - 1700);
  4322. stream.writeWord(offset);
  4323. }
  4324. if (l == 300) {
  4325. stream.createFrame(141);
  4326. stream.method432(j);
  4327. stream.writeWord(k);
  4328. stream.method432(i1);
  4329. stream.writeDWord(modifiableXValue);
  4330. }
  4331. if (l == 291) {
  4332. stream.createFrame(140);
  4333. stream.method433(k);
  4334. stream.method433(i1);
  4335. stream.method431(j);
  4336. atInventoryLoopCycle = 0;
  4337. atInventoryInterface = k;
  4338. atInventoryIndex = j;
  4339. atInventoryInterfaceType = 2;
  4340. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4341. atInventoryInterfaceType = 1;
  4342. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4343. atInventoryInterfaceType = 3;
  4344. }
  4345. if (l == 582) {
  4346. NPC npc = npcArray[i1];
  4347. if (npc != null) {
  4348. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  4349. myPlayer.smallX[0], false, npc.smallX[0]);
  4350. crossX = super.saveClickX;
  4351. crossY = super.saveClickY;
  4352. crossType = 2;
  4353. crossIndex = 0;
  4354. stream.createFrame(57);
  4355. stream.method432(anInt1285);
  4356. stream.method432(i1);
  4357. stream.method431(anInt1283);
  4358. stream.method432(anInt1284);
  4359. }
  4360. }
  4361. if (l == 234) {
  4362. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4363. myPlayer.smallX[0], false, j);
  4364. if (!flag1)
  4365. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4366. myPlayer.smallX[0], false, j);
  4367. crossX = super.saveClickX;
  4368. crossY = super.saveClickY;
  4369. crossType = 2;
  4370. crossIndex = 0;
  4371. stream.createFrame(236);
  4372. stream.method431(k + baseY);
  4373. stream.writeWord(i1);
  4374. stream.method431(j + baseX);
  4375. }
  4376. if (l == 62 && method66(i1, k, j)) {
  4377. stream.createFrame(192);
  4378. stream.writeWord(anInt1284);
  4379. stream.method431(i1 >> 14 & 0x7fff);
  4380. stream.method433(k + baseY);
  4381. stream.method431(anInt1283);
  4382. stream.method433(j + baseX);
  4383. stream.writeWord(anInt1285);
  4384. }
  4385. if (l == 474) {
  4386. counterOn = !counterOn;
  4387. }
  4388. if (l == 475) {
  4389. xpCounter = 0;
  4390. }
  4391. if (l == 511) {
  4392. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4393. myPlayer.smallX[0], false, j);
  4394. if (!flag2)
  4395. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4396. myPlayer.smallX[0], false, j);
  4397. crossX = super.saveClickX;
  4398. crossY = super.saveClickY;
  4399. crossType = 2;
  4400. crossIndex = 0;
  4401. stream.createFrame(25);
  4402. stream.method431(anInt1284);
  4403. stream.method432(anInt1285);
  4404. stream.writeWord(i1);
  4405. stream.method432(k + baseY);
  4406. stream.method433(anInt1283);
  4407. stream.writeWord(j + baseX);
  4408. }
  4409. if (l == 74) {
  4410. stream.createFrame(122);
  4411. stream.method433(k);
  4412. stream.method432(j);
  4413. stream.method431(i1);
  4414. atInventoryLoopCycle = 0;
  4415. atInventoryInterface = k;
  4416. atInventoryIndex = j;
  4417. atInventoryInterfaceType = 2;
  4418. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4419. atInventoryInterfaceType = 1;
  4420. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4421. atInventoryInterfaceType = 3;
  4422. }
  4423. if (l == 315) {
  4424. RSInterface class9 = RSInterface.interfaceCache[k];
  4425. boolean flag8 = true;
  4426. if (class9.contentType > 0)
  4427. flag8 = promptUserForInput(class9);
  4428. if (flag8) {
  4429. System.out.println("Config ButtonId: " + k); //remove when done
  4430. switch (k) {
  4431. case 31011:
  4432. tabInterfaceIDs[11] = 31080;
  4433. tabAreaAltered = true;
  4434. break;
  4435. case 31041:
  4436. tabInterfaceIDs[11] = 904;
  4437. tabAreaAltered = true;
  4438. break;
  4439. case 31022:
  4440. launchURL(Configuration.getForumURL);
  4441. break;
  4442. case 31023:
  4443. launchURL(Configuration.getStoreURL);
  4444. break;
  4445. case 31108:
  4446. pushMessage("This feature is not yet available!", 0, "");
  4447. break;
  4448. case 32013:
  4449. if (RSInterface.selectedItemInterfaceId <= 0) {
  4450. return;
  4451. }
  4452. RSInterface input = RSInterface.interfaceCache[RSInterface.selectedItemInterfaceId + 1];
  4453. RSInterface itemContainer = RSInterface.interfaceCache[RSInterface.selectedItemInterfaceId];
  4454. if (input != null && itemContainer != null) {
  4455. int amount = -1;
  4456. try {
  4457. amount = Integer.parseInt(input.message);
  4458. } catch (NumberFormatException nfe) {
  4459. pushMessage(
  4460. "The amount must be a non-negative numerical value.",
  4461. 0, "");
  4462. break;
  4463. }
  4464. if (itemContainer.itemSearchSelectedId < 0) {
  4465. itemContainer.itemSearchSelectedId = 0;
  4466. }
  4467. if (itemContainer.itemSearchSelectedSlot < 0) {
  4468. itemContainer.itemSearchSelectedSlot = 0;
  4469. }
  4470. stream.createFrame(124);
  4471. stream.writeDWord(RSInterface.selectedItemInterfaceId);
  4472. stream.writeDWord(itemContainer.itemSearchSelectedSlot);
  4473. stream.writeDWord(itemContainer.itemSearchSelectedId - 1);
  4474. stream.writeDWord(amount);
  4475. }
  4476. break;
  4477. case 19144:
  4478. sendFrame248(15106, 3213);
  4479. method60(15106);
  4480. inputTaken = true;
  4481. break;
  4482. default:
  4483. stream.createFrame(185);
  4484. stream.writeWord(k);
  4485. break;
  4486.  
  4487. }
  4488. }
  4489. }
  4490. if (l == 561) {
  4491. Player player = playerArray[i1];
  4492. if (player != null) {
  4493. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4494. player.smallY[0], myPlayer.smallX[0], false,
  4495. player.smallX[0]);
  4496. crossX = super.saveClickX;
  4497. crossY = super.saveClickY;
  4498. crossType = 2;
  4499. crossIndex = 0;
  4500. anInt1188 += i1;
  4501. if (anInt1188 >= 90) {
  4502. stream.createFrame(136);
  4503. anInt1188 = 0;
  4504. }
  4505. stream.createFrame(128);
  4506. stream.writeWord(i1);
  4507. }
  4508. }
  4509. if (l == 745) {
  4510. stream.createFrame(8);
  4511. stream.writeDWord(i1);
  4512. }
  4513. if (l == 20) {
  4514. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4515. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4516. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4517. class30_sub2_sub4_sub1_sub1_1.smallY[0],
  4518. myPlayer.smallX[0], false,
  4519. class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  4520. crossX = super.saveClickX;
  4521. crossY = super.saveClickY;
  4522. crossType = 2;
  4523. crossIndex = 0;
  4524. stream.createFrame(155);
  4525. stream.method431(i1);
  4526. }
  4527. }
  4528. if (l == 779) {
  4529. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4530. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4531. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4532. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  4533. myPlayer.smallX[0], false,
  4534. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  4535. crossX = super.saveClickX;
  4536. crossY = super.saveClickY;
  4537. crossType = 2;
  4538. crossIndex = 0;
  4539. stream.createFrame(153);
  4540. stream.method431(i1);
  4541. }
  4542. }
  4543. if (l == 516)
  4544. if (!menuOpen)
  4545. worldController.method312(super.saveClickY - 4,
  4546. super.saveClickX - 4);
  4547. else
  4548. worldController.method312(k - 4, j - 4);
  4549. if (l == 1062) {
  4550. anInt924 += baseX;
  4551. if (anInt924 >= 113) {
  4552. stream.createFrame(183);
  4553. stream.writeDWordBigEndian(0xe63271);
  4554. anInt924 = 0;
  4555. }
  4556. method66(i1, k, j);
  4557. stream.createFrame(228);
  4558. stream.method432(i1 >> 14 & 0x7fff);
  4559. stream.method432(k + baseY);
  4560. stream.writeWord(j + baseX);
  4561. }
  4562. if (l == 679 && !aBoolean1149) {
  4563. stream.createFrame(40);
  4564. stream.writeWord(k);
  4565. aBoolean1149 = true;
  4566. }
  4567. if (l == 431) {
  4568. stream.createFrame(129);
  4569. stream.method432(j);
  4570. stream.writeWord(k);
  4571. stream.method432(i1);
  4572. atInventoryLoopCycle = 0;
  4573. atInventoryInterface = k;
  4574. atInventoryIndex = j;
  4575. atInventoryInterfaceType = 2;
  4576. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4577. atInventoryInterfaceType = 1;
  4578. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4579. atInventoryInterfaceType = 3;
  4580. }
  4581. if (l == 337 || l == 42 || l == 792 || l == 322) {
  4582. String s = menuActionName[i];
  4583. int k1 = s.indexOf("@whi@");
  4584. if (k1 != -1) {
  4585. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4586. if (l == 337)
  4587. addFriend(l3);
  4588. if (l == 42)
  4589. addIgnore(l3);
  4590. if (l == 792)
  4591. delFriend(l3);
  4592. if (l == 322)
  4593. delIgnore(l3);
  4594. }
  4595. }
  4596. if (l == 53) {
  4597. stream.createFrame(135);
  4598. stream.method431(j);
  4599. stream.method432(k);
  4600. stream.method431(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 == 539) {
  4611. stream.createFrame(16);
  4612. stream.method432(i1);
  4613. stream.method433(j);
  4614. stream.method433(k);
  4615. atInventoryLoopCycle = 0;
  4616. atInventoryInterface = k;
  4617. atInventoryIndex = j;
  4618. atInventoryInterfaceType = 2;
  4619. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4620. atInventoryInterfaceType = 1;
  4621. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4622. atInventoryInterfaceType = 3;
  4623. }
  4624. if (l == 484 || l == 6) {
  4625. String s1 = menuActionName[i];
  4626. int l1 = s1.indexOf("@whi@");
  4627. if (l1 != -1) {
  4628. s1 = s1.substring(l1 + 5).trim();
  4629. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass
  4630. .longForName(s1)));
  4631. boolean flag9 = false;
  4632. for (int j3 = 0; j3 < playerCount; j3++) {
  4633. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4634. if (class30_sub2_sub4_sub1_sub2_7 == null
  4635. || class30_sub2_sub4_sub1_sub2_7.name == null
  4636. || !class30_sub2_sub4_sub1_sub2_7.name
  4637. .equalsIgnoreCase(s7))
  4638. continue;
  4639. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4640. class30_sub2_sub4_sub1_sub2_7.smallY[0],
  4641. myPlayer.smallX[0], false,
  4642. class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  4643. if (l == 484) {
  4644. stream.createFrame(39);
  4645. stream.method431(playerIndices[j3]);
  4646. }
  4647. if (l == 6) {
  4648. anInt1188 += i1;
  4649. if (anInt1188 >= 90) {
  4650. stream.createFrame(136);
  4651. anInt1188 = 0;
  4652. }
  4653. stream.createFrame(128);
  4654. stream.writeWord(playerIndices[j3]);
  4655. }
  4656. flag9 = true;
  4657. break;
  4658. }
  4659.  
  4660. if (!flag9)
  4661. pushMessage("Unable to find " + s7, 0, "");
  4662. }
  4663. }
  4664. if (l == 870) {
  4665. stream.createFrame(53);
  4666. stream.writeWord(j);
  4667. stream.method432(anInt1283);
  4668. stream.method433(i1);
  4669. stream.writeWord(anInt1284);
  4670. stream.method431(anInt1285);
  4671. stream.writeWord(k);
  4672. atInventoryLoopCycle = 0;
  4673. atInventoryInterface = k;
  4674. atInventoryIndex = j;
  4675. atInventoryInterfaceType = 2;
  4676. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4677. atInventoryInterfaceType = 1;
  4678. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4679. atInventoryInterfaceType = 3;
  4680. }
  4681. if (l == 847) {
  4682. stream.createFrame(87);
  4683. stream.method432(i1);
  4684. stream.writeWord(k);
  4685. stream.method432(j);
  4686. atInventoryLoopCycle = 0;
  4687. atInventoryInterface = k;
  4688. atInventoryIndex = j;
  4689. atInventoryInterfaceType = 2;
  4690. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4691. atInventoryInterfaceType = 1;
  4692. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4693. atInventoryInterfaceType = 3;
  4694. }
  4695. if (l == 626) {
  4696. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4697. spellSelected = 1;
  4698. spellID = class9_1.id;
  4699. anInt1137 = k;
  4700. spellUsableOn = class9_1.spellUsableOn;
  4701. itemSelected = 0;
  4702. needDrawTabArea = true;
  4703. spellID = class9_1.id;
  4704. String s4 = class9_1.selectedActionName;
  4705. if (s4.indexOf(" ") != -1)
  4706. s4 = s4.substring(0, s4.indexOf(" "));
  4707. String s8 = class9_1.selectedActionName;
  4708. if (s8.indexOf(" ") != -1)
  4709. s8 = s8.substring(s8.indexOf(" ") + 1);
  4710. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4711. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4712. // 0xffffff);
  4713. // class9_1.sprite1.drawSprite(200,200);
  4714. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4715. if (spellUsableOn == 16) {
  4716. needDrawTabArea = true;
  4717. tabID = 3;
  4718. tabAreaAltered = true;
  4719. }
  4720. return;
  4721. }
  4722. if (l == 104) {
  4723. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4724. spellID = class9_1.id;
  4725. if (!Autocast) {
  4726. Autocast = true;
  4727. pushMessage("Autocast spell selected.", 0, "");
  4728. autocastId = class9_1.id;
  4729. stream.createFrame(185);
  4730. stream.writeWord(class9_1.id);
  4731. } else if (autocastId == class9_1.id) {
  4732. Autocast = false;
  4733. autocastId = 0;
  4734. pushMessage("Autocast spell cleared.", 0, "");
  4735. stream.createFrame(185);
  4736. stream.writeWord(6666); // reset server side
  4737. } else if (autocastId != class9_1.id) {
  4738. Autocast = true;
  4739. pushMessage("Autocast spell selected.", 0, "");
  4740. autocastId = class9_1.id;
  4741. stream.createFrame(185);
  4742. stream.writeWord(class9_1.id);
  4743. }
  4744. }
  4745. if (l == 78) {
  4746. stream.createFrame(117);
  4747. stream.method433(k);
  4748. stream.method433(i1);
  4749. stream.method431(j);
  4750. atInventoryLoopCycle = 0;
  4751. atInventoryInterface = k;
  4752. atInventoryIndex = j;
  4753. atInventoryInterfaceType = 2;
  4754. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4755. atInventoryInterfaceType = 1;
  4756. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4757. atInventoryInterfaceType = 3;
  4758. }
  4759. if (l == 27) {
  4760. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4761. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4762. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4763. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  4764. myPlayer.smallX[0], false,
  4765. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4766. crossX = super.saveClickX;
  4767. crossY = super.saveClickY;
  4768. crossType = 2;
  4769. crossIndex = 0;
  4770. anInt986 += i1;
  4771. if (anInt986 >= 54) {
  4772. stream.createFrame(189);
  4773. stream.writeWordBigEndian(234);
  4774. anInt986 = 0;
  4775. }
  4776. stream.createFrame(73);
  4777. stream.method431(i1);
  4778. }
  4779. }
  4780. if (l == 213) {
  4781. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4782. myPlayer.smallX[0], false, j);
  4783. if (!flag3)
  4784. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4785. myPlayer.smallX[0], false, j);
  4786. crossX = super.saveClickX;
  4787. crossY = super.saveClickY;
  4788. crossType = 2;
  4789. crossIndex = 0;
  4790. stream.createFrame(79);
  4791. stream.method431(k + baseY);
  4792. stream.writeWord(i1);
  4793. stream.method432(j + baseX);
  4794. }
  4795. if (l == 632) {
  4796. stream.createFrame(145);
  4797. stream.method432(k);
  4798. stream.method432(j);
  4799. stream.method432(i1);
  4800. atInventoryLoopCycle = 0;
  4801. atInventoryInterface = k;
  4802. atInventoryIndex = j;
  4803. atInventoryInterfaceType = 2;
  4804. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4805. atInventoryInterfaceType = 1;
  4806. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4807. atInventoryInterfaceType = 3;
  4808. }
  4809. if (l == 1050) {
  4810. if (!runClicked1) {
  4811. runClicked1 = true;
  4812. stream.createFrame(185);
  4813. stream.writeWord(152);
  4814. } else {
  4815. runClicked1 = false;
  4816. stream.createFrame(185);
  4817. stream.writeWord(152);
  4818. }
  4819. }
  4820. if (l == 1004) {
  4821. if (tabInterfaceIDs[10] != -1) {
  4822. needDrawTabArea = true;
  4823. setSidebarInterface(14, 2449);
  4824. tabID = 10;
  4825. tabAreaAltered = true;
  4826. }
  4827. }
  4828. if (l == 1003) {
  4829. clanChatMode = 2;
  4830. aBoolean1233 = true;
  4831. inputTaken = true;
  4832. }
  4833. if (l == 1002) {
  4834. clanChatMode = 1;
  4835. aBoolean1233 = true;
  4836. inputTaken = true;
  4837. }
  4838. if (l == 1001) {
  4839. clanChatMode = 0;
  4840. aBoolean1233 = true;
  4841. inputTaken = true;
  4842. }
  4843. if (l == 1000) {
  4844. cButtonCPos = 4;
  4845. chatTypeView = 11;
  4846. aBoolean1233 = true;
  4847. inputTaken = true;
  4848. }
  4849. if (l == 999) {
  4850. cButtonCPos = 0;
  4851. chatTypeView = 0;
  4852. aBoolean1233 = true;
  4853. inputTaken = true;
  4854. }
  4855. if (l == 998) {
  4856. cButtonCPos = 1;
  4857. chatTypeView = 5;
  4858. aBoolean1233 = true;
  4859. inputTaken = true;
  4860. }
  4861. if (l == 1005) {
  4862. cButtonCPos = 1;
  4863. chatTypeView = 12;
  4864. aBoolean1233 = true;
  4865. inputTaken = true;
  4866. }
  4867. if (l == 997) {
  4868. publicChatMode = 3;
  4869. stream.createFrame(95);
  4870. stream.writeWordBigEndian(publicChatMode);
  4871. stream.writeWordBigEndian(privateChatMode);
  4872. stream.writeWordBigEndian(tradeMode);
  4873. inputTaken = true;
  4874. }
  4875. if (l == 996) {
  4876. publicChatMode = 2;
  4877. stream.createFrame(95);
  4878. stream.writeWordBigEndian(publicChatMode);
  4879. stream.writeWordBigEndian(privateChatMode);
  4880. stream.writeWordBigEndian(tradeMode);
  4881. inputTaken = true;
  4882. }
  4883. if (l == 995) {
  4884. publicChatMode = 1;
  4885. stream.createFrame(95);
  4886. stream.writeWordBigEndian(publicChatMode);
  4887. stream.writeWordBigEndian(privateChatMode);
  4888. stream.writeWordBigEndian(tradeMode);
  4889. inputTaken = true;
  4890. }
  4891. if (l == 994) {
  4892. publicChatMode = 0;
  4893. inputTaken = true;
  4894. }
  4895. if (l == 993) {
  4896. cButtonCPos = 2;
  4897. chatTypeView = 1;
  4898. inputTaken = true;
  4899. }
  4900. if (l == 992) {
  4901. privateChatMode = 2;
  4902. stream.createFrame(95);
  4903. stream.writeWordBigEndian(publicChatMode);
  4904. stream.writeWordBigEndian(privateChatMode);
  4905. stream.writeWordBigEndian(tradeMode);
  4906. inputTaken = true;
  4907. }
  4908. if (l == 991) {
  4909. privateChatMode = 1;
  4910. stream.createFrame(95);
  4911. stream.writeWordBigEndian(publicChatMode);
  4912. stream.writeWordBigEndian(privateChatMode);
  4913. stream.writeWordBigEndian(tradeMode);
  4914. inputTaken = true;
  4915. }
  4916. if (l == 990) {
  4917. privateChatMode = 0;
  4918. stream.createFrame(95);
  4919. stream.writeWordBigEndian(publicChatMode);
  4920. stream.writeWordBigEndian(privateChatMode);
  4921. stream.writeWordBigEndian(tradeMode);
  4922. aBoolean1233 = true;
  4923. inputTaken = true;
  4924. }
  4925. if (l == 989) {
  4926. cButtonCPos = 3;
  4927. chatTypeView = 2;
  4928. inputTaken = true;
  4929. }
  4930. if (l == 987) {
  4931. tradeMode = 2;
  4932. stream.createFrame(95);
  4933. stream.writeWordBigEndian(publicChatMode);
  4934. stream.writeWordBigEndian(privateChatMode);
  4935. stream.writeWordBigEndian(tradeMode);
  4936. aBoolean1233 = true;
  4937. inputTaken = true;
  4938. }
  4939. if (l == 986) {
  4940. tradeMode = 1;
  4941. stream.createFrame(95);
  4942. stream.writeWordBigEndian(publicChatMode);
  4943. stream.writeWordBigEndian(privateChatMode);
  4944. stream.writeWordBigEndian(tradeMode);
  4945. aBoolean1233 = true;
  4946. inputTaken = true;
  4947. }
  4948. if (l == 985) {
  4949. tradeMode = 0;
  4950. stream.createFrame(95);
  4951. stream.writeWordBigEndian(publicChatMode);
  4952. stream.writeWordBigEndian(privateChatMode);
  4953. stream.writeWordBigEndian(tradeMode);
  4954. aBoolean1233 = true;
  4955. inputTaken = true;
  4956. }
  4957. if (l == 984) {
  4958. cButtonCPos = 5;
  4959. chatTypeView = 3;
  4960. inputTaken = true;
  4961. }
  4962. if (l == 983) {
  4963. duelMode = 2;
  4964. inputTaken = true;
  4965. }
  4966. if (l == 982) {
  4967. duelMode = 1;
  4968. inputTaken = true;
  4969. }
  4970. if (l == 981) {
  4971. duelMode = 0;
  4972. inputTaken = true;
  4973. }
  4974. if (l == 980) {
  4975. cButtonCPos = 6;
  4976. chatTypeView = 4;
  4977. inputTaken = true;
  4978. }
  4979. if (l == 493) {
  4980. stream.createFrame(75);
  4981. stream.method433(k);
  4982. stream.method431(j);
  4983. stream.method432(i1);
  4984. atInventoryLoopCycle = 0;
  4985. atInventoryInterface = k;
  4986. atInventoryIndex = j;
  4987. atInventoryInterfaceType = 2;
  4988. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4989. atInventoryInterfaceType = 1;
  4990. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4991. atInventoryInterfaceType = 3;
  4992. }
  4993. if (l == 652) {
  4994. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4995. myPlayer.smallX[0], false, j);
  4996. if (!flag4)
  4997. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4998. myPlayer.smallX[0], false, j);
  4999. crossX = super.saveClickX;
  5000. crossY = super.saveClickY;
  5001. crossType = 2;
  5002. crossIndex = 0;
  5003. stream.createFrame(156);
  5004. stream.method432(j + baseX);
  5005. stream.method431(k + baseY);
  5006. stream.method433(i1);
  5007. }
  5008. if (l == 94) {
  5009. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5010. myPlayer.smallX[0], false, j);
  5011. if (!flag5)
  5012. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5013. myPlayer.smallX[0], false, j);
  5014. crossX = super.saveClickX;
  5015. crossY = super.saveClickY;
  5016. crossType = 2;
  5017. crossIndex = 0;
  5018. stream.createFrame(181);
  5019. stream.method431(k + baseY);
  5020. stream.writeWord(i1);
  5021. stream.method431(j + baseX);
  5022. stream.method432(anInt1137);
  5023. }
  5024. // clan chat
  5025. if (l == 647) {
  5026. stream.createFrame(213);
  5027. stream.writeWord(k);
  5028. stream.writeWord(j);
  5029. switch (k) {
  5030. case 18304:
  5031. if (j == 0) {
  5032. inputTaken = true;
  5033. inputDialogState = 0;
  5034. messagePromptRaised = true;
  5035. promptInput = "";
  5036. friendsListAction = 8;
  5037. aString1121 = "Enter your clan chat title";
  5038. }
  5039. break;
  5040. }
  5041. }
  5042. if (l == 646) {
  5043. stream.createFrame(185);
  5044. stream.writeWord(k);
  5045. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5046. if (class9_2.valueIndexArray != null
  5047. && class9_2.valueIndexArray[0][0] == 5) {
  5048. int i2 = class9_2.valueIndexArray[0][1];
  5049. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  5050. variousSettings[i2] = class9_2.anIntArray212[0];
  5051. method33(i2);
  5052. needDrawTabArea = true;
  5053. }
  5054. System.out.println(class9_2.id + ", " + i2 + ", "
  5055. + variousSettings[i2] + ", "
  5056. + class9_2.anIntArray212[0]);
  5057. switch (i2) {
  5058. case 810:
  5059. break;
  5060. }
  5061. }
  5062. switch (k) {
  5063. // clan chat
  5064. case 18129:
  5065. if (RSInterface.interfaceCache[18135].message.toLowerCase()
  5066. .contains("join")) {
  5067. inputTaken = true;
  5068. inputDialogState = 0;
  5069. messagePromptRaised = true;
  5070. promptInput = "";
  5071. friendsListAction = 6;
  5072. aString1121 = "Enter the name of the chat you wish to join";
  5073. } else {
  5074. sendString(0, "");
  5075. }
  5076. break;
  5077. case 18132:
  5078. openInterfaceID = 18300;
  5079. break;
  5080. case 18526:
  5081. inputTaken = true;
  5082. inputDialogState = 0;
  5083. messagePromptRaised = true;
  5084. promptInput = "";
  5085. friendsListAction = 9;
  5086. aString1121 = "Enter a name to add";
  5087. break;
  5088. case 18527:
  5089. inputTaken = true;
  5090. inputDialogState = 0;
  5091. messagePromptRaised = true;
  5092. promptInput = "";
  5093. friendsListAction = 10;
  5094. aString1121 = "Enter a name to add";
  5095. break;
  5096. }
  5097. }
  5098. if (l == 225) {
  5099. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5100. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  5101. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5102. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  5103. myPlayer.smallX[0], false,
  5104. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  5105. crossX = super.saveClickX;
  5106. crossY = super.saveClickY;
  5107. crossType = 2;
  5108. crossIndex = 0;
  5109. anInt1226 += i1;
  5110. if (anInt1226 >= 85) {
  5111. stream.createFrame(230);
  5112. stream.writeWordBigEndian(239);
  5113. anInt1226 = 0;
  5114. }
  5115. stream.createFrame(17);
  5116. stream.method433(i1);
  5117. }
  5118. }
  5119. if (l == 965) {
  5120. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5121. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  5122. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5123. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  5124. myPlayer.smallX[0], false,
  5125. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  5126. crossX = super.saveClickX;
  5127. crossY = super.saveClickY;
  5128. crossType = 2;
  5129. crossIndex = 0;
  5130. anInt1134++;
  5131. if (anInt1134 >= 96) {
  5132. stream.createFrame(152);
  5133. stream.writeWordBigEndian(88);
  5134. anInt1134 = 0;
  5135. }
  5136. stream.createFrame(21);
  5137. stream.writeWord(i1);
  5138. }
  5139. }
  5140. if (l == 413) {
  5141. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5142. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  5143. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5144. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  5145. myPlayer.smallX[0], false,
  5146. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  5147. crossX = super.saveClickX;
  5148. crossY = super.saveClickY;
  5149. crossType = 2;
  5150. crossIndex = 0;
  5151. stream.createFrame(131);
  5152. stream.method433(i1);
  5153. stream.method432(anInt1137);
  5154. }
  5155. }
  5156. if (l == 200)
  5157. clearTopInterfaces();
  5158. if (l == 1025) {
  5159. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5160. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  5161. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5162. if (entityDef.childrenIDs != null)
  5163. entityDef = entityDef.method161();
  5164. if (entityDef != null) {
  5165. String s9;
  5166. if (entityDef.description != null)
  5167. s9 = new String(entityDef.description);
  5168. else
  5169. s9 = "It's a " + entityDef.name + ".";
  5170. pushMessage(s9, 0, "");
  5171. }
  5172. }
  5173. }
  5174. if (l == 900) {
  5175. method66(i1, k, j);
  5176. stream.createFrame(252);
  5177. stream.method433(i1 >> 14 & 0x7fff);
  5178. stream.method431(k + baseY);
  5179. stream.method432(j + baseX);
  5180. }
  5181. if (l == 412) {
  5182. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5183. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  5184. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5185. class30_sub2_sub4_sub1_sub1_6.smallY[0],
  5186. myPlayer.smallX[0], false,
  5187. class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  5188. crossX = super.saveClickX;
  5189. crossY = super.saveClickY;
  5190. crossType = 2;
  5191. crossIndex = 0;
  5192. stream.createFrame(72);
  5193. stream.method432(i1);
  5194. }
  5195. }
  5196. if (l == 365) {
  5197. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5198. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  5199. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5200. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  5201. myPlayer.smallX[0], false,
  5202. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  5203. crossX = super.saveClickX;
  5204. crossY = super.saveClickY;
  5205. crossType = 2;
  5206. crossIndex = 0;
  5207. stream.createFrame(249);
  5208. stream.method432(i1);
  5209. stream.method431(anInt1137);
  5210. }
  5211. }
  5212. if (l == 729) {
  5213. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5214. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  5215. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5216. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  5217. myPlayer.smallX[0], false,
  5218. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  5219. crossX = super.saveClickX;
  5220. crossY = super.saveClickY;
  5221. crossType = 2;
  5222. crossIndex = 0;
  5223. stream.createFrame(39);
  5224. stream.method431(i1);
  5225. }
  5226. }
  5227. if (l == 577) {
  5228. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5229. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  5230. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5231. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  5232. myPlayer.smallX[0], false,
  5233. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  5234. crossX = super.saveClickX;
  5235. crossY = super.saveClickY;
  5236. crossType = 2;
  5237. crossIndex = 0;
  5238. stream.createFrame(139);
  5239. stream.method431(i1);
  5240. }
  5241. }
  5242. if (l == 956 && method66(i1, k, j)) {
  5243. stream.createFrame(35);
  5244. stream.method431(j + baseX);
  5245. stream.method432(anInt1137);
  5246. stream.method432(k + baseY);
  5247. stream.method431(i1 >> 14 & 0x7fff);
  5248. }
  5249. if (l == 567) {
  5250. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5251. myPlayer.smallX[0], false, j);
  5252. if (!flag6)
  5253. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5254. myPlayer.smallX[0], false, j);
  5255. crossX = super.saveClickX;
  5256. crossY = super.saveClickY;
  5257. crossType = 2;
  5258. crossIndex = 0;
  5259. stream.createFrame(23);
  5260. stream.method431(k + baseY);
  5261. stream.method431(i1);
  5262. stream.method431(j + baseX);
  5263. }
  5264. if (l == 867) {
  5265. if ((i1 & 3) == 0)
  5266. anInt1175++;
  5267. if (anInt1175 >= 59) {
  5268. stream.createFrame(200);
  5269. stream.createFrame(201);
  5270. stream.writeWord(25501);
  5271. anInt1175 = 0;
  5272. }
  5273. stream.createFrame(43);
  5274. stream.method431(k);
  5275. stream.method432(i1);
  5276. stream.method432(j);
  5277. atInventoryLoopCycle = 0;
  5278. atInventoryInterface = k;
  5279. atInventoryIndex = j;
  5280. atInventoryInterfaceType = 2;
  5281. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5282. atInventoryInterfaceType = 1;
  5283. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5284. atInventoryInterfaceType = 3;
  5285. }
  5286. if (l == 543) {
  5287. stream.createFrame(237);
  5288. stream.writeWord(j);
  5289. stream.method432(i1);
  5290. stream.writeWord(k);
  5291. stream.method432(anInt1137);
  5292. atInventoryLoopCycle = 0;
  5293. atInventoryInterface = k;
  5294. atInventoryIndex = j;
  5295. atInventoryInterfaceType = 2;
  5296. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5297. atInventoryInterfaceType = 1;
  5298. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5299. atInventoryInterfaceType = 3;
  5300. }
  5301. if (l == 606) {
  5302. String s2 = menuActionName[i];
  5303. int j2 = s2.indexOf("@whi@");
  5304. if (j2 != -1)
  5305. if (openInterfaceID == -1) {
  5306. clearTopInterfaces();
  5307. reportAbuseInput = s2.substring(j2 + 5).trim();
  5308. canMute = false;
  5309. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  5310. if (RSInterface.interfaceCache[i3] == null
  5311. || RSInterface.interfaceCache[i3].contentType != 600)
  5312. continue;
  5313. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5314. break;
  5315. }
  5316.  
  5317. } else {
  5318. pushMessage(
  5319. "Please close the interface you have open before using 'report abuse'",
  5320. 0, "");
  5321. }
  5322. }
  5323. if (l == 491) {
  5324. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5325. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  5326. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5327. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  5328. myPlayer.smallX[0], false,
  5329. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  5330. crossX = super.saveClickX;
  5331. crossY = super.saveClickY;
  5332. crossType = 2;
  5333. crossIndex = 0;
  5334. stream.createFrame(14);
  5335. stream.method432(anInt1284);
  5336. stream.writeWord(i1);
  5337. stream.writeWord(anInt1285);
  5338. stream.method431(anInt1283);
  5339. }
  5340. }
  5341. if (l == 639) {
  5342. String s3 = menuActionName[i];
  5343. int k2 = s3.indexOf("@whi@");
  5344. if (k2 != -1) {
  5345. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5346. int k3 = -1;
  5347. for (int i4 = 0; i4 < friendsCount; i4++) {
  5348. if (friendsListAsLongs[i4] != l4)
  5349. continue;
  5350. k3 = i4;
  5351. break;
  5352. }
  5353.  
  5354. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  5355. inputTaken = true;
  5356. inputDialogState = 0;
  5357. messagePromptRaised = true;
  5358. promptInput = "";
  5359. friendsListAction = 3;
  5360. aLong953 = friendsListAsLongs[k3];
  5361. aString1121 = "Enter message to send to " + friendsList[k3];
  5362. }
  5363. }
  5364. }
  5365. if (l == 1052) {
  5366. stream.createFrame(185);
  5367. stream.writeWord(154);
  5368. }
  5369.  
  5370. if (l == 1004) {
  5371. if (tabInterfaceIDs[14] != -1) {
  5372. needDrawTabArea = true;
  5373. tabID = 14;
  5374. tabAreaAltered = true;
  5375. }
  5376. }
  5377.  
  5378. if (l == 454) {
  5379. stream.createFrame(41);
  5380. stream.writeWord(i1);
  5381. stream.method432(j);
  5382. stream.method432(k);
  5383. atInventoryLoopCycle = 0;
  5384. atInventoryInterface = k;
  5385. atInventoryIndex = j;
  5386. atInventoryInterfaceType = 2;
  5387. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5388. atInventoryInterfaceType = 1;
  5389. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5390. atInventoryInterfaceType = 3;
  5391. }
  5392. if (l == 696) {
  5393. viewRotation = 0;
  5394. anInt1184 = 120;
  5395.  
  5396. }
  5397. if (l == 478) {
  5398. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5399. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  5400. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5401. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  5402. myPlayer.smallX[0], false,
  5403. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  5404. crossX = super.saveClickX;
  5405. crossY = super.saveClickY;
  5406. crossType = 2;
  5407. crossIndex = 0;
  5408. if ((i1 & 3) == 0)
  5409. anInt1155++;
  5410. if (anInt1155 >= 53) {
  5411. stream.createFrame(85);
  5412. stream.writeWordBigEndian(66);
  5413. anInt1155 = 0;
  5414. }
  5415. stream.createFrame(18);
  5416. stream.method431(i1);
  5417. }
  5418. }
  5419. if (l == 113) {
  5420. method66(i1, k, j);
  5421. stream.createFrame(70);
  5422. stream.method431(j + baseX);
  5423. stream.writeWord(k + baseY);
  5424. stream.method433(i1 >> 14 & 0x7fff);
  5425. }
  5426. if (l == 872) {
  5427. method66(i1, k, j);
  5428. stream.createFrame(234);
  5429. stream.method433(j + baseX);
  5430. stream.method432(i1 >> 14 & 0x7fff);
  5431. stream.method433(k + baseY);
  5432. }
  5433. if (l == 502) {
  5434. method66(i1, k, j);
  5435. stream.createFrame(132);
  5436. stream.method433(j + baseX);
  5437. stream.writeWord(i1 >> 14 & 0x7fff);
  5438. stream.method432(k + baseY);
  5439. }
  5440. if (l == 1125) {
  5441. ItemDef itemDef = ItemDef.forID(i1);
  5442. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5443. String s5;
  5444. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5445. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5446. else if (itemDef.description != null)
  5447. s5 = new String(itemDef.description);
  5448. else
  5449. s5 = "It's a " + itemDef.name + ".";
  5450. pushMessage(s5, 0, "");
  5451. }
  5452. if (l == 1130) {
  5453. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5454. if (class9_4 != null) {
  5455. class9_4.itemSearchSelectedId = class9_4.inv[j];
  5456. class9_4.itemSearchSelectedSlot = j;
  5457. RSInterface.selectedItemInterfaceId = class9_4.id;
  5458. }
  5459. }
  5460. if (l == 169) {
  5461. stream.createFrame(185);
  5462. stream.writeWord(k);
  5463. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5464. if (class9_3.valueIndexArray != null
  5465. && class9_3.valueIndexArray[0][0] == 5) {
  5466. int l2 = class9_3.valueIndexArray[0][1];
  5467. variousSettings[l2] = 1 - variousSettings[l2];
  5468. method33(l2);
  5469. needDrawTabArea = true;
  5470. }
  5471. }
  5472. if (l == 447) {
  5473. itemSelected = 1;
  5474. anInt1283 = j;
  5475. anInt1284 = k;
  5476. anInt1285 = i1;
  5477. selectedItemName = ItemDef.forID(i1).name;
  5478. spellSelected = 0;
  5479. needDrawTabArea = true;
  5480. return;
  5481. }
  5482. if (l == 1226) {
  5483. int j1 = i1 >> 14 & 0x7fff;
  5484. ObjectDef class46 = ObjectDef.forID(j1);
  5485. String s10;
  5486. if (class46.description != null)
  5487. s10 = new String(class46.description);
  5488. else
  5489. s10 = "It's a " + class46.name + ".";
  5490. pushMessage(s10, 0, "");
  5491. }
  5492. if (l == 244) {
  5493. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5494. myPlayer.smallX[0], false, j);
  5495. if (!flag7)
  5496. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5497. myPlayer.smallX[0], false, j);
  5498. crossX = super.saveClickX;
  5499. crossY = super.saveClickY;
  5500. crossType = 2;
  5501. crossIndex = 0;
  5502. stream.createFrame(253);
  5503. stream.method431(j + baseX);
  5504. stream.method433(k + baseY);
  5505. stream.method432(i1);
  5506. }
  5507. if (l == 1448) {
  5508. ItemDef itemDef_1 = ItemDef.forID(i1);
  5509. String s6;
  5510. if (itemDef_1.description != null)
  5511. s6 = new String(itemDef_1.description);
  5512. else
  5513. s6 = "It's a " + itemDef_1.name + ".";
  5514. pushMessage(s6, 0, "");
  5515. }
  5516. itemSelected = 0;
  5517. spellSelected = 0;
  5518. needDrawTabArea = true;
  5519.  
  5520. }
  5521.  
  5522. public void method70() {
  5523. anInt1251 = 0;
  5524. int j = (myPlayer.x >> 7) + baseX;
  5525. int k = (myPlayer.y >> 7) + baseY;
  5526. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5527. anInt1251 = 1;
  5528. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5529. anInt1251 = 1;
  5530. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5531. anInt1251 = 0;
  5532. }
  5533.  
  5534. @Override
  5535. public void run() {
  5536. if (drawFlames) {
  5537. drawFlames();
  5538. } else {
  5539. super.run();
  5540. }
  5541. }
  5542.  
  5543. private void build3dScreenMenu() {
  5544. if (itemSelected == 0 && spellSelected == 0) {
  5545. menuActionName[menuActionRow] = "Walk here";
  5546. menuActionID[menuActionRow] = 516;
  5547. menuActionCmd2[menuActionRow] = super.mouseX;
  5548. menuActionCmd3[menuActionRow] = super.mouseY;
  5549. menuActionRow++;
  5550. }
  5551. int j = -1;
  5552. for (int k = 0; k < Model.anInt1687; k++) {
  5553. int l = Model.anIntArray1688[k];
  5554. int i1 = l & 0x7f;
  5555. int j1 = l >> 7 & 0x7f;
  5556. int k1 = l >> 29 & 3;
  5557. int l1 = l >> 14 & 0x7fff;
  5558. if (l == j)
  5559. continue;
  5560. j = l;
  5561. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5562. ObjectDef class46 = ObjectDef.forID(l1);
  5563. if (class46.childrenIDs != null)
  5564. class46 = class46.method580();
  5565. if (class46 == null)
  5566. continue;
  5567. if (itemSelected == 1) {
  5568. menuActionName[menuActionRow] = "Use " + selectedItemName
  5569. + " with @cya@" + class46.name;
  5570. menuActionID[menuActionRow] = 62;
  5571. menuActionCmd1[menuActionRow] = l;
  5572. menuActionCmd2[menuActionRow] = i1;
  5573. menuActionCmd3[menuActionRow] = j1;
  5574. menuActionRow++;
  5575. } else if (spellSelected == 1) {
  5576. if ((spellUsableOn & 4) == 4) {
  5577. menuActionName[menuActionRow] = spellTooltip + " @cya@"
  5578. + class46.name;
  5579. menuActionID[menuActionRow] = 956;
  5580. menuActionCmd1[menuActionRow] = l;
  5581. menuActionCmd2[menuActionRow] = i1;
  5582. menuActionCmd3[menuActionRow] = j1;
  5583. menuActionRow++;
  5584. }
  5585. } else {
  5586. if (class46.actions != null) {
  5587. for (int i2 = 4; i2 >= 0; i2--)
  5588. if (class46.actions[i2] != null) {
  5589. menuActionName[menuActionRow] = class46.actions[i2]
  5590. + " @cya@" + class46.name;
  5591. if (i2 == 0)
  5592. menuActionID[menuActionRow] = 502;
  5593. if (i2 == 1)
  5594. menuActionID[menuActionRow] = 900;
  5595. if (i2 == 2)
  5596. menuActionID[menuActionRow] = 113;
  5597. if (i2 == 3)
  5598. menuActionID[menuActionRow] = 872;
  5599. if (i2 == 4)
  5600. menuActionID[menuActionRow] = 1062;
  5601. menuActionCmd1[menuActionRow] = l;
  5602. menuActionCmd2[menuActionRow] = i1;
  5603. menuActionCmd3[menuActionRow] = j1;
  5604. menuActionRow++;
  5605. }
  5606.  
  5607. }
  5608. menuActionName[menuActionRow] = "Examine @cya@"
  5609. + class46.name;
  5610. menuActionID[menuActionRow] = 1226;
  5611. menuActionCmd1[menuActionRow] = class46.type << 14;
  5612. menuActionCmd2[menuActionRow] = i1;
  5613. menuActionCmd3[menuActionRow] = j1;
  5614. menuActionRow++;
  5615. }
  5616. }
  5617. if (k1 == 1) {
  5618. NPC npc = npcArray[l1];
  5619. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64
  5620. && (npc.y & 0x7f) == 64) {
  5621. for (int j2 = 0; j2 < npcCount; j2++) {
  5622. NPC npc2 = npcArray[npcIndices[j2]];
  5623. if (npc2 != null && npc2 != npc
  5624. && npc2.desc.aByte68 == 1 && npc2.x == npc.x
  5625. && npc2.y == npc.y)
  5626. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5627. }
  5628.  
  5629. for (int l2 = 0; l2 < playerCount; l2++) {
  5630. Player player = playerArray[playerIndices[l2]];
  5631. if (player != null && player.x == npc.x
  5632. && player.y == npc.y)
  5633. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5634. }
  5635.  
  5636. }
  5637. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5638. }
  5639. if (k1 == 0) {
  5640. Player player = playerArray[l1];
  5641. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  5642. for (int k2 = 0; k2 < npcCount; k2++) {
  5643. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5644. if (class30_sub2_sub4_sub1_sub1_2 != null
  5645. && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1
  5646. && class30_sub2_sub4_sub1_sub1_2.x == player.x
  5647. && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  5648. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc,
  5649. npcIndices[k2], j1, i1);
  5650. }
  5651.  
  5652. for (int i3 = 0; i3 < playerCount; i3++) {
  5653. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5654. if (class30_sub2_sub4_sub1_sub2_2 != null
  5655. && class30_sub2_sub4_sub1_sub2_2 != player
  5656. && class30_sub2_sub4_sub1_sub2_2.x == player.x
  5657. && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  5658. buildAtPlayerMenu(i1, playerIndices[i3],
  5659. class30_sub2_sub4_sub1_sub2_2, j1);
  5660. }
  5661.  
  5662. }
  5663. buildAtPlayerMenu(i1, l1, player, j1);
  5664. }
  5665. if (k1 == 3) {
  5666. NodeList class19 = groundArray[plane][i1][j1];
  5667. if (class19 != null) {
  5668. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19
  5669. .getNext()) {
  5670. ItemDef itemDef = ItemDef.forID(item.ID);
  5671. if (itemSelected == 1) {
  5672. menuActionName[menuActionRow] = "Use "
  5673. + selectedItemName + " with @lre@"
  5674. + itemDef.name;
  5675. menuActionID[menuActionRow] = 511;
  5676. menuActionCmd1[menuActionRow] = item.ID;
  5677. menuActionCmd2[menuActionRow] = i1;
  5678. menuActionCmd3[menuActionRow] = j1;
  5679. menuActionRow++;
  5680. } else if (spellSelected == 1) {
  5681. if ((spellUsableOn & 1) == 1) {
  5682. menuActionName[menuActionRow] = spellTooltip
  5683. + " @lre@" + itemDef.name;
  5684. menuActionID[menuActionRow] = 94;
  5685. menuActionCmd1[menuActionRow] = item.ID;
  5686. menuActionCmd2[menuActionRow] = i1;
  5687. menuActionCmd3[menuActionRow] = j1;
  5688. menuActionRow++;
  5689. }
  5690. } else {
  5691. for (int j3 = 4; j3 >= 0; j3--)
  5692. if (itemDef.groundOptions != null
  5693. && itemDef.groundOptions[j3] != null) {
  5694. menuActionName[menuActionRow] = itemDef.groundOptions[j3]
  5695. + " @lre@" + itemDef.name;
  5696. if (j3 == 0)
  5697. menuActionID[menuActionRow] = 652;
  5698. if (j3 == 1)
  5699. menuActionID[menuActionRow] = 567;
  5700. if (j3 == 2)
  5701. menuActionID[menuActionRow] = 234;
  5702. if (j3 == 3)
  5703. menuActionID[menuActionRow] = 244;
  5704. if (j3 == 4)
  5705. menuActionID[menuActionRow] = 213;
  5706. menuActionCmd1[menuActionRow] = item.ID;
  5707. menuActionCmd2[menuActionRow] = i1;
  5708. menuActionCmd3[menuActionRow] = j1;
  5709. menuActionRow++;
  5710. } else if (j3 == 2) {
  5711. menuActionName[menuActionRow] = "Take @lre@"
  5712. + itemDef.name;
  5713. menuActionID[menuActionRow] = 234;
  5714. menuActionCmd1[menuActionRow] = item.ID;
  5715. menuActionCmd2[menuActionRow] = i1;
  5716. menuActionCmd3[menuActionRow] = j1;
  5717. menuActionRow++;
  5718. }
  5719.  
  5720. // menuActionName[menuActionRow] = "Examine @lre@" +
  5721. // itemDef.name + " @gre@(@whi@" + item.ID +
  5722. // "@gre@)";
  5723. menuActionName[menuActionRow] = "Examine @lre@"
  5724. + itemDef.name;
  5725. menuActionID[menuActionRow] = 1448;
  5726. menuActionCmd1[menuActionRow] = item.ID;
  5727. menuActionCmd2[menuActionRow] = i1;
  5728. menuActionCmd3[menuActionRow] = j1;
  5729. menuActionRow++;
  5730. }
  5731. }
  5732. }
  5733. }
  5734. }
  5735. }
  5736.  
  5737. @Override
  5738. public void cleanUpForQuit() {
  5739. signlink.reporterror = false;
  5740. try {
  5741. if (socketStream != null)
  5742. socketStream.close();
  5743. } catch (Exception _ex) {
  5744. }
  5745. socketStream = null;
  5746. stopMidi();
  5747. if (mouseDetection != null)
  5748. mouseDetection.running = false;
  5749. mouseDetection = null;
  5750. onDemandFetcher.disable();
  5751. onDemandFetcher = null;
  5752. aStream_834 = null;
  5753. stream = null;
  5754. aStream_847 = null;
  5755. inStream = null;
  5756. anIntArray1234 = null;
  5757. aByteArrayArray1183 = null;
  5758. aByteArrayArray1247 = null;
  5759. anIntArray1235 = null;
  5760. anIntArray1236 = null;
  5761. intGroundArray = null;
  5762. byteGroundArray = null;
  5763. worldController = null;
  5764. aClass11Array1230 = null;
  5765. anIntArrayArray901 = null;
  5766. anIntArrayArray825 = null;
  5767. bigX = null;
  5768. bigY = null;
  5769. aByteArray912 = null;
  5770. aRSImageProducer_1163 = null;
  5771. mapEdgeIP = null;
  5772. leftFrame = null;
  5773. topFrame = null;
  5774. rightFrame = null;
  5775. aRSImageProducer_1164 = null;
  5776. aRSImageProducer_1165 = null;
  5777. aRSImageProducer_1166 = null;
  5778. aRSImageProducer_1125 = null;
  5779. /* Null pointers for custom sprites */
  5780. multiOverlay = null;
  5781. chatArea = null;
  5782. chatButtons = null;
  5783. ORBS = null;
  5784. worldMapIcon508 = null;
  5785. worldMapIcon525 = null;
  5786. logIconH = null;
  5787. logIconC = null;
  5788. logIcon = null;
  5789. tabArea = null;
  5790. tabArea474 = null;
  5791. tabArea508 = null;
  5792. mapArea508 = null;
  5793. mapArea474 = null;
  5794. mapArea = null;
  5795. /**/
  5796. globe = null;
  5797. loginScreenArea = null;
  5798. magicAuto = null;
  5799. mapBack = null;
  5800. sideIcons = null;
  5801. redStones = null;
  5802. compass = null;
  5803. hitMarks = null;
  5804. headIcons = null;
  5805. skullIcons = null;
  5806. headIconsHint = null;
  5807. crosses = null;
  5808. mapDotItem = null;
  5809. mapDotNPC = null;
  5810. mapDotPlayer = null;
  5811. mapDotFriend = null;
  5812. mapScenes = null;
  5813. mapFunctions = null;
  5814. anIntArrayArray929 = null;
  5815. playerArray = null;
  5816. playerIndices = null;
  5817. anIntArray894 = null;
  5818. aStreamArray895s = null;
  5819. anIntArray840 = null;
  5820. npcArray = null;
  5821. npcIndices = null;
  5822. groundArray = null;
  5823. aClass19_1179 = null;
  5824. aClass19_1013 = null;
  5825. aClass19_1056 = null;
  5826. menuActionCmd2 = null;
  5827. menuActionCmd3 = null;
  5828. menuActionID = null;
  5829. menuActionCmd1 = null;
  5830. menuActionName = null;
  5831. variousSettings = null;
  5832. anIntArray1072 = null;
  5833. anIntArray1073 = null;
  5834. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5835. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5836. friendsList = null;
  5837. friendsListAsLongs = null;
  5838. friendsNodeIDs = null;
  5839. aRSImageProducer_1110 = null;
  5840. aRSImageProducer_1111 = null;
  5841. aRSImageProducer_1107 = null;
  5842. aRSImageProducer_1108 = null;
  5843. aRSImageProducer_1109 = null;
  5844. aRSImageProducer_1112 = null;
  5845. aRSImageProducer_1113 = null;
  5846. aRSImageProducer_1114 = null;
  5847. aRSImageProducer_1115 = null;
  5848. nullLoader();
  5849. ObjectDef.nullLoader();
  5850. EntityDef.nullLoader();
  5851. ItemDef.nullLoader();
  5852. Flo.cache = null;
  5853. IDK.cache = null;
  5854. RSInterface.interfaceCache = null;
  5855. DummyClass.cache = null;
  5856. Animation.anims = null;
  5857. SpotAnim.cache = null;
  5858. SpotAnim.aMRUNodes_415 = null;
  5859. Varp.cache = null;
  5860. super.fullGameScreen = null;
  5861. Player.mruNodes = null;
  5862. Texture.nullLoader();
  5863. WorldController.nullLoader();
  5864. Model.nullLoader();
  5865. Class36.nullLoader();
  5866. System.gc();
  5867. }
  5868.  
  5869. public void printDebug() {
  5870. System.out.println("============");
  5871. System.out.println("flame-cycle:" + anInt1208);
  5872. if (onDemandFetcher != null)
  5873. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5874. System.out.println("loop-cycle:" + loopCycle);
  5875. System.out.println("draw-cycle:" + anInt1061);
  5876. System.out.println("ptype:" + pktType);
  5877. System.out.println("psize:" + pktSize);
  5878. if (socketStream != null)
  5879. socketStream.printDebug();
  5880. super.shouldDebug = true;
  5881. }
  5882.  
  5883. @Override
  5884. Component getGameComponent() {
  5885. if (signlink.mainapp != null)
  5886. return signlink.mainapp;
  5887. if (super.gameFrame != null)
  5888. return super.gameFrame;
  5889. else
  5890. return this;
  5891. }
  5892.  
  5893. public void pmTabToReply() {
  5894. String name = null;
  5895. for (int k = 0; k < 100; k++) {
  5896. if (chatMessages[k] == null) {
  5897. continue;
  5898. }
  5899. int l = chatTypes[k];
  5900. if (l == 3 || l == 7) {
  5901. name = chatNames[k];
  5902. break;
  5903. }
  5904. }
  5905.  
  5906. if (name == null) {
  5907. pushMessage(
  5908. "You haven't received any messages to which you can reply.",
  5909. 0, "");
  5910. return;
  5911. }
  5912.  
  5913. if (name.startsWith("@cr")) {
  5914. name = name.substring(5);
  5915. }
  5916.  
  5917. long nameAsLong = TextClass.longForName(name.trim());
  5918. int k3 = -1;
  5919. for (int i4 = 0; i4 < friendsCount; i4++) {
  5920. if (friendsListAsLongs[i4] != nameAsLong)
  5921. continue;
  5922. k3 = i4;
  5923. break;
  5924. }
  5925.  
  5926. if (k3 != -1) {
  5927. if (friendsNodeIDs[k3] > 0) {
  5928. inputTaken = true;
  5929. inputDialogState = 0;
  5930. messagePromptRaised = true;
  5931. promptInput = "";
  5932. friendsListAction = 3;
  5933. aLong953 = friendsListAsLongs[k3];
  5934. aString1121 = "Enter message to send to " + friendsList[k3];
  5935. } else {
  5936. pushMessage("That player is currently offline.", 0, "");
  5937. }
  5938. }
  5939. }
  5940.  
  5941. private void method73() {
  5942. do {
  5943. int j = readChar(-796);
  5944. if (j == -1)
  5945. break;
  5946. if (openInterfaceID != -1
  5947. && openInterfaceID == reportAbuseInterfaceID) {
  5948. if (j == 8 && reportAbuseInput.length() > 0)
  5949. reportAbuseInput = reportAbuseInput.substring(0,
  5950. reportAbuseInput.length() - 1);
  5951. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48
  5952. && j <= 57 || j == 32)
  5953. && reportAbuseInput.length() < 12)
  5954. reportAbuseInput += (char) j;
  5955. } else if (messagePromptRaised) {
  5956. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  5957. promptInput += (char) j;
  5958. inputTaken = true;
  5959. }
  5960. if (j == 8 && promptInput.length() > 0) {
  5961. promptInput = promptInput.substring(0,
  5962. promptInput.length() - 1);
  5963. inputTaken = true;
  5964. }
  5965. if (j == 13 || j == 10) {
  5966. messagePromptRaised = false;
  5967. inputTaken = true;
  5968. if (friendsListAction == 1) {
  5969. long l = TextClass.longForName(promptInput);
  5970. addFriend(l);
  5971. }
  5972. if (friendsListAction == 2 && friendsCount > 0) {
  5973. long l1 = TextClass.longForName(promptInput);
  5974. delFriend(l1);
  5975. }
  5976. if (friendsListAction == 3 && promptInput.length() > 0) {
  5977. stream.createFrame(126);
  5978. stream.writeWordBigEndian(0);
  5979. int k = stream.currentOffset;
  5980. stream.writeQWord(aLong953);
  5981. TextInput.method526(promptInput, stream);
  5982. stream.writeBytes(stream.currentOffset - k);
  5983. promptInput = TextInput.processText(promptInput);
  5984. // promptInput = Censor.doCensor(promptInput);
  5985. pushMessage(promptInput, 6, TextClass.fixName(TextClass
  5986. .nameForLong(aLong953)));
  5987. if (privateChatMode == 2) {
  5988. privateChatMode = 1;
  5989. stream.createFrame(95);
  5990. stream.writeWordBigEndian(publicChatMode);
  5991. stream.writeWordBigEndian(privateChatMode);
  5992. stream.writeWordBigEndian(tradeMode);
  5993. }
  5994. }
  5995. if (friendsListAction == 4 && ignoreCount < 100) {
  5996. long l2 = TextClass.longForName(promptInput);
  5997. addIgnore(l2);
  5998. }
  5999. if (friendsListAction == 5 && ignoreCount > 0) {
  6000. long l3 = TextClass.longForName(promptInput);
  6001. delIgnore(l3);
  6002. }
  6003. // clan chat
  6004. if (friendsListAction == 6) {
  6005. sendStringAsLong(promptInput);
  6006. } else if (friendsListAction == 8) {
  6007. sendString(1, promptInput);
  6008. } else if (friendsListAction == 9) {
  6009. sendString(2, promptInput);
  6010. } else if (friendsListAction == 10) {
  6011. sendString(3, promptInput);
  6012. }
  6013. }
  6014. } else if (inputDialogState == 1) {
  6015. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6016. amountOrNameInput += (char) j;
  6017. inputTaken = true;
  6018. }
  6019. if ((!amountOrNameInput.toLowerCase().contains("k")
  6020. && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput
  6021. .toLowerCase().contains("b"))
  6022. && (j == 107 || j == 109)
  6023. || j == 98) {
  6024. amountOrNameInput += (char) j;
  6025. inputTaken = true;
  6026. }
  6027. if (j == 8 && amountOrNameInput.length() > 0) {
  6028. amountOrNameInput = amountOrNameInput.substring(0,
  6029. amountOrNameInput.length() - 1);
  6030. inputTaken = true;
  6031. }
  6032. if (j == 13 || j == 10) {
  6033. if (amountOrNameInput.length() > 0) {
  6034. if (amountOrNameInput.toLowerCase().contains("k")) {
  6035. amountOrNameInput = amountOrNameInput.replaceAll(
  6036. "k", "000");
  6037. } else if (amountOrNameInput.toLowerCase()
  6038. .contains("m")) {
  6039. amountOrNameInput = amountOrNameInput.replaceAll(
  6040. "m", "000000");
  6041. } else if (amountOrNameInput.toLowerCase()
  6042. .contains("b")) {
  6043. amountOrNameInput = amountOrNameInput.replaceAll(
  6044. "b", "000000000");
  6045. }
  6046. int i1 = 0;
  6047. try {
  6048. i1 = Integer.parseInt(amountOrNameInput);
  6049. } catch (Exception _ex) {
  6050. }
  6051. stream.createFrame(208);
  6052. stream.writeDWord(i1);
  6053. modifiableXValue = i1;
  6054. }
  6055. inputDialogState = 0;
  6056. inputTaken = true;
  6057. }
  6058. } else if (inputDialogState == 2) {
  6059. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6060. amountOrNameInput += (char) j;
  6061. inputTaken = true;
  6062. }
  6063. if (j == 8 && amountOrNameInput.length() > 0) {
  6064. amountOrNameInput = amountOrNameInput.substring(0,
  6065. amountOrNameInput.length() - 1);
  6066. inputTaken = true;
  6067. }
  6068. if (j == 13 || j == 10) {
  6069. if (amountOrNameInput.length() > 0) {
  6070. stream.createFrame(60);
  6071. stream.writeQWord(TextClass
  6072. .longForName(amountOrNameInput));
  6073. }
  6074. inputDialogState = 0;
  6075. inputTaken = true;
  6076. }
  6077. } else if (backDialogID == -1) {
  6078. if (this.isFieldInFocus()) {
  6079. RSInterface rsi = this.getInputFieldFocusOwner();
  6080. if (rsi == null) {
  6081. return;
  6082. }
  6083. if (j >= 32 && j <= 122
  6084. && rsi.message.length() < rsi.characterLimit) {
  6085. if (rsi.inputRegex.length() > 0) {
  6086. Pattern regex = Pattern.compile(rsi.inputRegex);
  6087. Matcher match = regex.matcher(Character
  6088. .toString(((char) j)));
  6089. if (match.matches()) {
  6090. rsi.message += (char) j;
  6091. inputTaken = true;
  6092. }
  6093. } else {
  6094. rsi.message += (char) j;
  6095. inputTaken = true;
  6096. }
  6097. }
  6098. if (j == 8 && rsi.message.length() > 0) {
  6099. rsi.message = rsi.message.substring(0,
  6100. rsi.message.length() - 1);
  6101. inputTaken = true;
  6102. }
  6103. if (rsi.isItemSearchComponent && rsi.message.length() > 2
  6104. && rsi.defaultInputFieldText.equals("Name")) {
  6105. RSInterface subcomponent = RSInterface.interfaceCache[rsi.id + 2];
  6106. RSInterface scroll = RSInterface.interfaceCache[rsi.id + 4];
  6107. RSInterface toggle = RSInterface.interfaceCache[rsi.id + 9];
  6108. scroll.itemSearchSelectedId = 0;
  6109. scroll.itemSearchSelectedSlot = -1;
  6110. RSInterface.selectedItemInterfaceId = 0;
  6111. rsi.itemSearchSelectedSlot = -1;
  6112. rsi.itemSearchSelectedId = 0;
  6113.  
  6114. if (subcomponent != null && scroll != null
  6115. && toggle != null
  6116. && toggle.valueIndexArray != null) {
  6117. int[] results = ItemDef
  6118. .getResults(
  6119. rsi.message.toLowerCase(),
  6120. 60,
  6121. variousSettings[toggle.valueIndexArray[0][1]] == toggle.anIntArray212[0] ? true
  6122. : false);
  6123. if (subcomponent != null) {
  6124. int position = 0;
  6125. int length = subcomponent.inv.length;
  6126. subcomponent.inv = new int[length];
  6127. subcomponent.invStackSizes = new int[subcomponent.inv.length];
  6128. for (int result : results) {
  6129. if (result > 0) {
  6130. subcomponent.inv[position] = result + 1;
  6131. subcomponent.invStackSizes[position] = 1;
  6132. position++;
  6133. }
  6134. }
  6135. }
  6136. }
  6137. } else if (rsi.updatesEveryInput && rsi.message.length() > 0 && j != 10 && j != 13) {
  6138. stream.createFrame(142);
  6139. stream.writeWordBigEndian(4 + rsi.message.length() + 1);
  6140. stream.writeDWord(rsi.id);
  6141. stream.writeString(rsi.message);
  6142. inputString = "";
  6143. promptInput = "";
  6144. break;
  6145. } else if ((j == 10 || j == 13) && rsi.message.length() > 0 && !rsi.updatesEveryInput) {
  6146. stream.createFrame(142);
  6147. stream.writeWordBigEndian(4 + rsi.message.length() + 1);
  6148. stream.writeDWord(rsi.id);
  6149. stream.writeString(rsi.message);
  6150. inputString = "";
  6151. promptInput = "";
  6152. break;
  6153. }
  6154. } else {
  6155. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  6156. inputString += (char) j;
  6157. inputTaken = true;
  6158. }
  6159. if (j == 8 && inputString.length() > 0) {
  6160. inputString = inputString.substring(0,
  6161. inputString.length() - 1);
  6162. inputTaken = true;
  6163. }
  6164. if (j == 9)
  6165. pmTabToReply();
  6166. if (inputString.equals("::packrsi") && (j == 13 || j == 10)) {
  6167. Interfaces.loadInterfaces();
  6168. this.pushMessage("Reloaded interface configurations.",
  6169. 0, "");
  6170. }
  6171. if (inputString.startsWith("::nullrsi")
  6172. && (j == 13 || j == 10)) {
  6173. int id = 0;
  6174. int offset = 0;
  6175. String[] data = null;
  6176. try {
  6177. data = inputString.split(" ");
  6178. id = Integer.parseInt(data[1]);
  6179. offset = Integer.parseInt(data[2]);
  6180. if (id <= 0 || offset <= 0) {
  6181. pushMessage(
  6182. "Identification value and or offset is negative.",
  6183. 0, "");
  6184. } else if (id + offset > RSInterface.interfaceCache.length - 1) {
  6185. pushMessage(
  6186. "The total sum of the id and offset are greater than the size of the cache.",
  6187. 0, "");
  6188. } else {
  6189. Collection<Integer> nullList = new ArrayList<>(
  6190. offset);
  6191. for (int interfaceId = id; interfaceId < id
  6192. + offset; interfaceId++) {
  6193. RSInterface rsi = RSInterface.interfaceCache[interfaceId];
  6194. if (rsi == null) {
  6195. nullList.add(interfaceId);
  6196. }
  6197. }
  6198. pushMessage(
  6199. "There are a total of "
  6200. + nullList.size() + "/"
  6201. + offset
  6202. + " null interfaces from " + id
  6203. + " to " + (id + offset) + ".",
  6204. 0, "");
  6205. }
  6206. } catch (ArrayIndexOutOfBoundsException
  6207. | NumberFormatException exception) {
  6208.  
  6209. }
  6210. }
  6211. if ((j == 13 || j == 10) && inputString.length() > 0) {
  6212. if (myPrivilege >= 2 && myPrivilege <= 5) {
  6213. if (inputString.startsWith("//setspecto")) {
  6214. int amt = Integer.parseInt(inputString
  6215. .substring(12));
  6216. anIntArray1045[300] = amt;
  6217. if (variousSettings[300] != amt) {
  6218. variousSettings[300] = amt;
  6219. method33(300);
  6220. needDrawTabArea = true;
  6221. if (dialogID != -1)
  6222. inputTaken = true;
  6223. }
  6224. }
  6225. if (inputString.equals("clientdrop"))
  6226. dropClient();
  6227. if (inputString.startsWith("full")) {
  6228. try {
  6229. String[] args = inputString.split(" ");
  6230. int id1 = Integer.parseInt(args[1]);
  6231. int id2 = Integer.parseInt(args[2]);
  6232. fullscreenInterfaceID = id1;
  6233. openInterfaceID = id2;
  6234. pushMessage("Opened Interface", 0, "");
  6235. } catch (Exception e) {
  6236. pushMessage("Interface Failed to load", 0,
  6237. "");
  6238. }
  6239. }
  6240. if (inputString.equals("::lag"))
  6241. printDebug();
  6242. if (inputString.equals("::prefetchmusic")) {
  6243. for (int j1 = 0; j1 < onDemandFetcher
  6244. .getVersionCount(2); j1++)
  6245. onDemandFetcher.method563((byte) 1, 2, j1);
  6246.  
  6247. }
  6248. /*
  6249. * if (inputString.equals("::maps")) addMaps(); if
  6250. * (inputString.equals("::models")) addModels();
  6251. */
  6252. /*
  6253. * if (inputString.equals("::noclip")) { for (int k1
  6254. * = 0; k1 < 4; k1++) { for (int i2 = 1; i2 < 103;
  6255. * i2++) { for (int k2 = 1; k2 < 103; k2++)
  6256. * aClass11Array1230[k1].anIntArrayArray294[i2][k2]
  6257. * = 0;
  6258. *
  6259. * } } }
  6260. */
  6261. }
  6262.  
  6263.  
  6264. /* if (inputString.equals("add model")) { try { int
  6265. ModelIndex = Integer.parseInt(JOptionPane
  6266. .showInputDialog(this, "Enter model ID", "Model",
  6267. 3)); byte[] abyte0 = getModel(ModelIndex); if (abyte0
  6268. != null && abyte0.length > 0) {
  6269. decompressors[1].method234(abyte0.length, abyte0,
  6270. ModelIndex); pushMessage("Model: [" + ModelIndex +
  6271. "] added successfully!", 0, ""); } else {
  6272. pushMessage("Unable to find the model. " +
  6273. ModelIndex, 0, ""); } } catch (Exception e) {
  6274. pushMessage("Syntax - ::add model <path>", 0, ""); }
  6275. }*/
  6276.  
  6277. if (inputString.equals("::orbs")) {
  6278. OSOrbs = !OSOrbs;
  6279. pushMessage("You haved toggled Orbs", 0, "");
  6280. needDrawTabArea = true;
  6281. try {
  6282. writeSettings();
  6283. } catch (IOException e) {
  6284. e.printStackTrace();
  6285. }
  6286. }
  6287. if (inputString.equals("::fpson"))
  6288. fpsOn = true;
  6289. if (inputString.equals("::fpsoff"))
  6290. fpsOn = false;
  6291. if (inputString.equals("::dataon"))
  6292. clientData = true;
  6293. if (inputString.equals("::dataoff"))
  6294. clientData = false;
  6295. if (inputString.equals("::counter")) {
  6296. OSCounter = !OSCounter;
  6297. pushMessage("You haved toggled the counter", 0, "");
  6298. needDrawTabArea = true;
  6299. try {
  6300. writeSettings();
  6301. } catch (IOException e) {
  6302. e.printStackTrace();
  6303. }
  6304. }
  6305. if (inputString.equals("::hotkeys")) {
  6306. RSApplet.hotKeyToggle = !RSApplet.hotKeyToggle;
  6307. pushMessage("You haved toggled your hotkeys", 0, "");
  6308. needDrawTabArea = true;
  6309. try {
  6310. writeSettings();
  6311. } catch (IOException e) {
  6312. e.printStackTrace();
  6313. }
  6314. }
  6315. /*
  6316. * if (inputString.equals("::474")) { revision474 =
  6317. * true; revision498 = false; revision508 = false;
  6318. * pushMessage("You have toggled the 474 Gameframe", 0,
  6319. * ""); needDrawTabArea = true; } if
  6320. * (inputString.equals("::498")) { revision474 = false;
  6321. * revision498 = true; revision508 = false;
  6322. * pushMessage("You have toggled the 498 Gameframe", 0,
  6323. * ""); needDrawTabArea = true; }
  6324. */
  6325. if (inputString.startsWith("::testb")) {
  6326. pushMessage("broadcast flag: " + broadcastUpdate, 0, "");
  6327. pushMessage("message: [" + broadcast + "]", 0, "");
  6328. pushMessage("anInt1104: " + anInt1104, 0, "");
  6329. }
  6330. if (inputString.startsWith("::chath")) {
  6331. pushMessage("keyInput: " + keyInput, 0, "");
  6332. pushMessage("lastChat: [" + lastChat + "]", 0, "");
  6333. }
  6334. if (inputString.startsWith("::modelsitem"))
  6335. pushMessage(ItemDef.itemModels(Integer
  6336. .parseInt(inputString.substring(13))), 0,
  6337. "");
  6338. if (inputString.equals("::hd")) {
  6339. setHighMem();
  6340. method22();
  6341. }
  6342. if (inputString.equals("::ld")) {
  6343. setLowMem();
  6344. method22();
  6345. }
  6346. /*
  6347. * if (inputString.equals("::gameframe")) { if
  6348. * (revision474 == true) { revision474 = false;
  6349. * revision498 = true;
  6350. * pushMessage("You have toggled on the 525 Gameframe",
  6351. * 0, ""); needDrawTabArea = true; try {
  6352. * writeSettings(); } catch (IOException e) {
  6353. * e.printStackTrace(); } } else { revision474 = true;
  6354. * revision498 = false;
  6355. * pushMessage("You have toggled on the 474 Gameframe",
  6356. * 0, ""); needDrawTabArea = true; try {
  6357. * writeSettings(); } catch (IOException e) {
  6358. * e.printStackTrace(); } } }
  6359. */
  6360. if (inputString.startsWith("::")) {
  6361. stream.createFrame(103);
  6362. stream.writeWordBigEndian(inputString.length() - 1);
  6363. stream.writeString(inputString.substring(2));
  6364. } else if (inputString.startsWith("/")) {
  6365. stream.createFrame(103);
  6366. stream.writeWordBigEndian(inputString.length() + 1);
  6367. stream.writeString(inputString);
  6368. } else {
  6369. String s = inputString.toLowerCase();
  6370. int j2 = 0;
  6371. if (s.startsWith("yellow:")) {
  6372. j2 = 0;
  6373. inputString = inputString.substring(7);
  6374. } else if (s.startsWith("red:")) {
  6375. j2 = 1;
  6376. inputString = inputString.substring(4);
  6377. } else if (s.startsWith("green:")) {
  6378. j2 = 2;
  6379. inputString = inputString.substring(6);
  6380. } else if (s.startsWith("cyan:")) {
  6381. j2 = 3;
  6382. inputString = inputString.substring(5);
  6383. } else if (s.startsWith("purple:")) {
  6384. j2 = 4;
  6385. inputString = inputString.substring(7);
  6386. } else if (s.startsWith("white:")) {
  6387. j2 = 5;
  6388. inputString = inputString.substring(6);
  6389. } else if (s.startsWith("flash1:")) {
  6390. j2 = 6;
  6391. inputString = inputString.substring(7);
  6392. } else if (s.startsWith("flash2:")) {
  6393. j2 = 7;
  6394. inputString = inputString.substring(7);
  6395. } else if (s.startsWith("flash3:")) {
  6396. j2 = 8;
  6397. inputString = inputString.substring(7);
  6398. } else if (s.startsWith("glow1:")) {
  6399. j2 = 9;
  6400. inputString = inputString.substring(6);
  6401. } else if (s.startsWith("glow2:")) {
  6402. j2 = 10;
  6403. inputString = inputString.substring(6);
  6404. } else if (s.startsWith("glow3:")) {
  6405. j2 = 11;
  6406. inputString = inputString.substring(6);
  6407. }
  6408. s = inputString.toLowerCase();
  6409. int i3 = 0;
  6410. if (s.startsWith("wave:")) {
  6411. i3 = 1;
  6412. inputString = inputString.substring(5);
  6413. } else if (s.startsWith("wave2:")) {
  6414. i3 = 2;
  6415. inputString = inputString.substring(6);
  6416. } else if (s.startsWith("shake:")) {
  6417. i3 = 3;
  6418. inputString = inputString.substring(6);
  6419. } else if (s.startsWith("scroll:")) {
  6420. i3 = 4;
  6421. inputString = inputString.substring(7);
  6422. } else if (s.startsWith("slide:")) {
  6423. i3 = 5;
  6424. inputString = inputString.substring(6);
  6425. }
  6426. stream.createFrame(4);
  6427. stream.writeWordBigEndian(0);
  6428. int j3 = stream.currentOffset;
  6429. stream.method425(i3);
  6430. stream.method425(j2);
  6431. aStream_834.currentOffset = 0;
  6432. TextInput.method526(inputString, aStream_834);
  6433. stream.method441(0, aStream_834.buffer,
  6434. aStream_834.currentOffset);
  6435. stream.writeBytes(stream.currentOffset - j3);
  6436. inputString = TextInput.processText(inputString);
  6437. // inputString = Censor.doCensor(inputString);
  6438. myPlayer.textSpoken = inputString;
  6439. myPlayer.anInt1513 = j2;
  6440. myPlayer.anInt1531 = i3;
  6441. myPlayer.textCycle = 150;
  6442. String cr = "";
  6443. if (myPrivilege == 11)
  6444. cr = "@cr11@";
  6445. if (myPrivilege == 10)
  6446. cr = "@cr10@";
  6447. if (myPrivilege == 9)
  6448. cr = "@cr9@";
  6449. if (myPrivilege == 8)
  6450. cr = "@cr8@";
  6451. if (myPrivilege == 7)
  6452. cr = "@cr7@";
  6453. if (myPrivilege == 6)
  6454. cr = "@cr6@";
  6455. if (myPrivilege == 5)
  6456. cr = "@cr5@";
  6457. if (myPrivilege == 4)
  6458. cr = "@cr4@";
  6459. if (myPrivilege == 3)
  6460. cr = "@cr3@";
  6461. if (myPrivilege == 2)
  6462. cr = "@cr2@";
  6463. if (myPrivilege == 1)
  6464. cr = "@cr1@";
  6465. if (myPlayer.title.length() > 0) {
  6466. pushMessage(myPlayer.textSpoken, 2, cr + "<col="+ myPlayer.titleColor + "> "+ myPlayer.title + "</col> " + myPlayer.name);
  6467. } else {
  6468. pushMessage(myPlayer.textSpoken, 2, cr + myPlayer.name);
  6469. }
  6470. if (publicChatMode == 2) {
  6471. publicChatMode = 3;
  6472. stream.createFrame(95);
  6473. stream.writeWordBigEndian(publicChatMode);
  6474. stream.writeWordBigEndian(privateChatMode);
  6475. stream.writeWordBigEndian(tradeMode);
  6476. }
  6477. }
  6478. incrementChatHistory();
  6479. inputString = "";
  6480. inputTaken = true;
  6481. }
  6482. }
  6483. }
  6484. } while (true);
  6485. }
  6486.  
  6487. private void incrementChatHistory() {
  6488. //NOTE: Max array index is 3!!!
  6489. //ARRAY LENGTH IS 4 TOTAL.
  6490. if (myPrivilege == 3 || myPrivilege == 2) {
  6491. chatHistory[lastChat] = inputString;
  6492. if ((lastChat + 1) == (chatHistory.length - 1)) {
  6493. lastChat = 0;
  6494. } else {
  6495. lastChat++;
  6496. }
  6497. keyInput = lastChat;
  6498. }
  6499. }
  6500.  
  6501. private void buildPublicChat(int j) {
  6502. int l = 0;
  6503. for (int i1 = 0; i1 < 500; i1++) {
  6504. if (chatMessages[i1] == null)
  6505. continue;
  6506. if (chatTypeView != 1)
  6507. continue;
  6508. int j1 = chatTypes[i1];
  6509. String s = chatNames[i1];
  6510. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6511. if (k1 < -23)
  6512. break;
  6513. if (s != null && s.startsWith("@cr"))
  6514. s = s.substring(5);
  6515. if (s != null && s.startsWith("<col=")) {
  6516. s = s.substring(s.indexOf("</col>") + 6);
  6517. }
  6518. if (s != null && s.startsWith("@cr1@"))
  6519. s = s.substring(5);
  6520. if (s != null && s.startsWith("@cr2@"))
  6521. s = s.substring(5);
  6522. if (s != null && s.startsWith("@cr3@"))
  6523. s = s.substring(5);
  6524. if (s != null && s.startsWith("@cr4@"))
  6525. s = s.substring(5);
  6526. if (s != null && s.startsWith("@cr5@"))
  6527. s = s.substring(5);
  6528. if (s != null && s.startsWith("@cr6@"))
  6529. s = s.substring(5);
  6530. if (s != null && s.startsWith("@cr7@"))
  6531. s = s.substring(5);
  6532. if (s != null && s.startsWith("@cr8@"))
  6533. s = s.substring(5);
  6534. if (s != null && s.startsWith("@cr9@"))
  6535. s = s.substring(5);
  6536. if (s != null && s.startsWith("@cr10@"))
  6537. s = s.substring(6);
  6538. if (s != null && s.startsWith("@cr11@"))
  6539. s = s.substring(6);
  6540. if ((j1 == 1 || j1 == 2)
  6541. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6542. && isFriendOrSelf(s))) {
  6543. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6544. if (myPrivilege >= 1) {
  6545. menuActionName[menuActionRow] = "Report abuse @whi@"
  6546. + s;
  6547. menuActionID[menuActionRow] = 606;
  6548. menuActionRow++;
  6549. }
  6550. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6551. menuActionID[menuActionRow] = 42;
  6552. menuActionRow++;
  6553. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6554. menuActionID[menuActionRow] = 337;
  6555. menuActionRow++;
  6556. }
  6557. l++;
  6558. }
  6559. }
  6560. }
  6561.  
  6562. private void buildFriendChat(int j) {
  6563. int l = 0;
  6564. for (int i1 = 0; i1 < 500; i1++) {
  6565. if (chatMessages[i1] == null)
  6566. continue;
  6567. if (chatTypeView != 2)
  6568. continue;
  6569. int j1 = chatTypes[i1];
  6570. String s = chatNames[i1];
  6571. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6572. if (k1 < -23)
  6573. break;
  6574. if (s != null && s.startsWith("@cr1@"))
  6575. s = s.substring(5);
  6576. if (s != null && s.startsWith("@cr2@"))
  6577. s = s.substring(5);
  6578. if (s != null && s.startsWith("@cr3@"))
  6579. s = s.substring(5);
  6580. if (s != null && s.startsWith("@cr4@"))
  6581. s = s.substring(5);
  6582. if (s != null && s.startsWith("@cr5@"))
  6583. s = s.substring(5);
  6584. if (s != null && s.startsWith("@cr6@"))
  6585. s = s.substring(5);
  6586. if (s != null && s.startsWith("@cr7@"))
  6587. s = s.substring(5);
  6588. if (s != null && s.startsWith("@cr8@"))
  6589. s = s.substring(5);
  6590. if (s != null && s.startsWith("@cr9@"))
  6591. s = s.substring(5);
  6592. if (s != null && s.startsWith("@cr10@"))
  6593. s = s.substring(6);
  6594. if (s != null && s.startsWith("@cr11@"))
  6595. s = s.substring(6);
  6596. if ((j1 == 5 || j1 == 6)
  6597. && (splitPrivateChat == 0 || chatTypeView == 2)
  6598. && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1
  6599. && isFriendOrSelf(s)))
  6600. l++;
  6601. if ((j1 == 3 || j1 == 7)
  6602. && (splitPrivateChat == 0 || chatTypeView == 2)
  6603. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6604. && isFriendOrSelf(s))) {
  6605. if (j > k1 - 14 && j <= k1) {
  6606. if (myPrivilege >= 1) {
  6607. menuActionName[menuActionRow] = "Report abuse @whi@"
  6608. + s;
  6609. menuActionID[menuActionRow] = 606;
  6610. menuActionRow++;
  6611. }
  6612. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6613. menuActionID[menuActionRow] = 42;
  6614. menuActionRow++;
  6615. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6616. menuActionID[menuActionRow] = 337;
  6617. menuActionRow++;
  6618. }
  6619. l++;
  6620. }
  6621. }
  6622. }
  6623.  
  6624. private void buildDuelorTrade(int j) {
  6625. int l = 0;
  6626. for (int i1 = 0; i1 < 500; i1++) {
  6627. if (chatMessages[i1] == null)
  6628. continue;
  6629. if (chatTypeView != 3 && chatTypeView != 4)
  6630. continue;
  6631. int j1 = chatTypes[i1];
  6632. String s = chatNames[i1];
  6633. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6634. if (k1 < -23)
  6635. break;
  6636. if (s != null && s.startsWith("@cr1@"))
  6637. s = s.substring(5);
  6638. if (s != null && s.startsWith("@cr2@"))
  6639. s = s.substring(5);
  6640. if (s != null && s.startsWith("@cr3@"))
  6641. s = s.substring(5);
  6642. if (s != null && s.startsWith("@cr4@"))
  6643. s = s.substring(5);
  6644. if (s != null && s.startsWith("@cr5@"))
  6645. s = s.substring(5);
  6646. if (s != null && s.startsWith("@cr6@"))
  6647. s = s.substring(5);
  6648. if (s != null && s.startsWith("@cr7@"))
  6649. s = s.substring(5);
  6650. if (s != null && s.startsWith("@cr8@"))
  6651. s = s.substring(5);
  6652. if (s != null && s.startsWith("@cr9@"))
  6653. s = s.substring(5);
  6654. if (s != null && s.startsWith("@cr10@"))
  6655. s = s.substring(6);
  6656. if (s != null && s.startsWith("@cr11@"))
  6657. s = s.substring(6);
  6658. if (chatTypeView == 3 && j1 == 4
  6659. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6660. if (j > k1 - 14 && j <= k1) {
  6661. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6662. menuActionID[menuActionRow] = 484;
  6663. menuActionRow++;
  6664. }
  6665. l++;
  6666. }
  6667. if (chatTypeView == 4 && j1 == 8
  6668. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6669. if (j > k1 - 14 && j <= k1) {
  6670. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6671. + s;
  6672. menuActionID[menuActionRow] = 6;
  6673. menuActionRow++;
  6674. }
  6675. l++;
  6676. }
  6677. if (j1 == 12) {
  6678. if (j > k1 - 14 && j <= k1) {
  6679. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6680. menuActionID[menuActionRow] = 915;
  6681. menuActionRow++;
  6682. }
  6683. l++;
  6684. }
  6685. }
  6686. }
  6687.  
  6688. private void buildChatAreaMenu(int j) {
  6689. int l = 0;
  6690. for (int i1 = 0; i1 < 500; i1++) {
  6691. if (chatMessages[i1] == null)
  6692. continue;
  6693. int j1 = chatTypes[i1];
  6694. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6695. if (k1 < -23)
  6696. break;
  6697. String s = chatNames[i1];
  6698. if (chatTypeView == 1) {
  6699. buildPublicChat(j);
  6700. break;
  6701. }
  6702. if (chatTypeView == 2) {
  6703. buildFriendChat(j);
  6704. break;
  6705. }
  6706. if (chatTypeView == 3 || chatTypeView == 4) {
  6707. buildDuelorTrade(j);
  6708. break;
  6709. }
  6710. if (chatTypeView == 5) {
  6711. break;
  6712. }
  6713. if (s != null && s.startsWith("@cr1@")) {
  6714. s = s.substring(5);
  6715. }
  6716. if (s != null && s.startsWith("@cr2@")) {
  6717. s = s.substring(5);
  6718. }
  6719. if (s != null && s.startsWith("@cr3@")) {
  6720. s = s.substring(5);
  6721. }
  6722. if (s != null && s.startsWith("@cr4@")) {
  6723. s = s.substring(5);
  6724. }
  6725. if (s != null && s.startsWith("@cr5@")) {
  6726. s = s.substring(5);
  6727. }
  6728. if (s != null && s.startsWith("@cr6@")) {
  6729. s = s.substring(5);
  6730. }
  6731. if (s != null && s.startsWith("@cr7@")) {
  6732. s = s.substring(5);
  6733. }
  6734. if (s != null && s.startsWith("@cr8@")) {
  6735. s = s.substring(5);
  6736. }
  6737. if (s != null && s.startsWith("@cr9@")) {
  6738. s = s.substring(5);
  6739. }
  6740. if (s != null && s.startsWith("@cr10@")) {
  6741. s = s.substring(6);
  6742. }
  6743. if (s != null && s.startsWith("@cr11@")) {
  6744. s = s.substring(6);
  6745. }
  6746. if (s != null && s.startsWith("<col=")) {
  6747. s = s.substring(s.indexOf("</col>") + 6);
  6748. }
  6749. if (j1 == 0)
  6750. l++;
  6751. if ((j1 == 1 || j1 == 2)
  6752. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6753. && isFriendOrSelf(s))) {
  6754. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6755. if (myPrivilege >= 1) {
  6756. menuActionName[menuActionRow] = "Report abuse @whi@"
  6757. + s;
  6758. menuActionID[menuActionRow] = 606;
  6759. menuActionRow++;
  6760. }
  6761. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6762. menuActionID[menuActionRow] = 42;
  6763. menuActionRow++;
  6764. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6765. menuActionID[menuActionRow] = 337;
  6766. menuActionRow++;
  6767. }
  6768. l++;
  6769. }
  6770. if ((j1 == 3 || j1 == 7)
  6771. && splitPrivateChat == 0
  6772. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6773. && isFriendOrSelf(s))) {
  6774. if (j > k1 - 14 && j <= k1) {
  6775. if (myPrivilege >= 1) {
  6776. menuActionName[menuActionRow] = "Report abuse @whi@"
  6777. + s;
  6778. menuActionID[menuActionRow] = 606;
  6779. menuActionRow++;
  6780. }
  6781. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6782. menuActionID[menuActionRow] = 42;
  6783. menuActionRow++;
  6784. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6785. menuActionID[menuActionRow] = 337;
  6786. menuActionRow++;
  6787. }
  6788. l++;
  6789. }
  6790. if (j1 == 4
  6791. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6792. if (j > k1 - 14 && j <= k1) {
  6793. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6794. menuActionID[menuActionRow] = 484;
  6795. menuActionRow++;
  6796. }
  6797. l++;
  6798. }
  6799. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0
  6800. && privateChatMode < 2)
  6801. l++;
  6802. if (j1 == 8
  6803. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6804. if (j > k1 - 14 && j <= k1) {
  6805. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6806. + s;
  6807. menuActionID[menuActionRow] = 6;
  6808. menuActionRow++;
  6809. }
  6810. l++;
  6811. }
  6812. }
  6813. }
  6814.  
  6815. public void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6816. int j = class9.contentType;
  6817. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6818. if (j == 1 && anInt900 == 0) {
  6819. class9.message = "Loading friend list";
  6820. class9.atActionType = 0;
  6821. return;
  6822. }
  6823. if (j == 1 && anInt900 == 1) {
  6824. class9.message = "Connecting to friendserver";
  6825. class9.atActionType = 0;
  6826. return;
  6827. }
  6828. if (j == 2 && anInt900 != 2) {
  6829. class9.message = "Please wait...";
  6830. class9.atActionType = 0;
  6831. return;
  6832. }
  6833. int k = friendsCount;
  6834. if (anInt900 != 2)
  6835. k = 0;
  6836. if (j > 700)
  6837. j -= 601;
  6838. else
  6839. j--;
  6840. if (j >= k) {
  6841. class9.message = "";
  6842. class9.atActionType = 0;
  6843. return;
  6844. } else {
  6845. class9.message = friendsList[j];
  6846. class9.atActionType = 1;
  6847. return;
  6848. }
  6849. }
  6850. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6851. int l = friendsCount;
  6852. if (anInt900 != 2)
  6853. l = 0;
  6854. if (j > 800)
  6855. j -= 701;
  6856. else
  6857. j -= 101;
  6858. if (j >= l) {
  6859. class9.message = "";
  6860. class9.atActionType = 0;
  6861. return;
  6862. }
  6863. if (friendsNodeIDs[j] == 0)
  6864. class9.message = "@red@Offline";
  6865. else if (friendsNodeIDs[j] == nodeID)
  6866. class9.message = "@gre@World 1"/* + (friendsNodeIDs[j] - 9) */;
  6867. else
  6868. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  6869. class9.atActionType = 1;
  6870. return;
  6871. }
  6872. if (j == 203) {
  6873. int i1 = friendsCount;
  6874. if (anInt900 != 2)
  6875. i1 = 0;
  6876. class9.scrollMax = i1 * 15 + 20;
  6877. if (class9.scrollMax <= class9.height)
  6878. class9.scrollMax = class9.height + 1;
  6879. return;
  6880. }
  6881. if (j >= 401 && j <= 500) {
  6882. if ((j -= 401) == 0 && anInt900 == 0) {
  6883. class9.message = "Loading ignore list";
  6884. class9.atActionType = 0;
  6885. return;
  6886. }
  6887. if (j == 1 && anInt900 == 0) {
  6888. class9.message = "Please wait...";
  6889. class9.atActionType = 0;
  6890. return;
  6891. }
  6892. int j1 = ignoreCount;
  6893. if (anInt900 == 0)
  6894. j1 = 0;
  6895. if (j >= j1) {
  6896. class9.message = "";
  6897. class9.atActionType = 0;
  6898. return;
  6899. } else {
  6900. class9.message = TextClass.fixName(TextClass
  6901. .nameForLong(ignoreListAsLongs[j]));
  6902. class9.atActionType = 1;
  6903. return;
  6904. }
  6905. }
  6906. if (j == 503) {
  6907. class9.scrollMax = ignoreCount * 15 + 20;
  6908. if (class9.scrollMax <= class9.height)
  6909. class9.scrollMax = class9.height + 1;
  6910. return;
  6911. }
  6912. if (j == 327) {
  6913. class9.modelRotation1 = 150;
  6914. class9.modelRotation2 = (int) (Math.sin(loopCycle / 40D) * 256D) & 0x7ff;
  6915. if (aBoolean1031) {
  6916. for (int k1 = 0; k1 < 7; k1++) {
  6917. int l1 = anIntArray1065[k1];
  6918. if (l1 >= 0 && !IDK.cache[l1].method537())
  6919. return;
  6920. }
  6921.  
  6922. aBoolean1031 = false;
  6923. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6924. int i2 = 0;
  6925. for (int j2 = 0; j2 < 7; j2++) {
  6926. int k2 = anIntArray1065[j2];
  6927. if (k2 >= 0)
  6928. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  6929. .method538();
  6930. }
  6931.  
  6932. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6933. for (int l2 = 0; l2 < 5; l2++)
  6934. if (anIntArray990[l2] != 0) {
  6935. model.method476(anIntArrayArray1003[l2][0],
  6936. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6937. if (l2 == 1)
  6938. model.method476(anIntArray1204[0],
  6939. anIntArray1204[anIntArray990[l2]]);
  6940. // if(l2 == 1)
  6941. // model.method476(Legs2[0], Legs2[anIntArray990[l2]]);
  6942. }
  6943.  
  6944. model.method469();
  6945. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6946. model.method479(64, 1300, 0, -570, 0, true);
  6947. class9.anInt233 = 5;
  6948. class9.mediaID = 0;
  6949. RSInterface.method208(aBoolean994, model);
  6950. }
  6951. return;
  6952. }
  6953. if (j == 328) {
  6954. RSInterface rsInterface = class9;
  6955. int verticleTilt = 150;
  6956. int animationSpeed = (int) (Math.sin(loopCycle / 40D) * 256D) & 0x7ff;
  6957. rsInterface.modelRotation1 = verticleTilt;
  6958. rsInterface.modelRotation2 = animationSpeed;
  6959. if (aBoolean1031) {
  6960. Model characterDisplay = myPlayer.method452();
  6961. for (int l2 = 0; l2 < 5; l2++)
  6962. if (anIntArray990[l2] != 0) {
  6963. characterDisplay.method476(anIntArrayArray1003[l2][0],
  6964. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6965. if (l2 == 1)
  6966. characterDisplay.method476(anIntArray1204[0],
  6967. anIntArray1204[anIntArray990[l2]]);
  6968. }
  6969. int staticFrame = myPlayer.anInt1511;
  6970. characterDisplay.method469();
  6971. characterDisplay
  6972. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  6973. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6974. rsInterface.anInt233 = 5;
  6975. rsInterface.mediaID = 0;
  6976. RSInterface.method208(aBoolean994, characterDisplay);
  6977. }
  6978. return;
  6979. }
  6980. if (j == 324) {
  6981. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6982. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6983. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6984. }
  6985. if (aBoolean1047) {
  6986. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6987. return;
  6988. } else {
  6989. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6990. return;
  6991. }
  6992. }
  6993. if (j == 325) {
  6994. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6995. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6996. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6997. }
  6998. if (aBoolean1047) {
  6999. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  7000. return;
  7001. } else {
  7002. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  7003. return;
  7004. }
  7005. }
  7006. if (j == 600) {
  7007. class9.message = reportAbuseInput;
  7008. if (loopCycle % 20 < 10) {
  7009. class9.message += "|";
  7010. return;
  7011. } else {
  7012. class9.message += " ";
  7013. return;
  7014. }
  7015. }
  7016. if (j == 613)
  7017. if (myPrivilege >= 1) {
  7018. if (canMute) {
  7019. class9.textColor = 0xff0000;
  7020. // class9.message =
  7021. // "Moderator option: Mute player for 48 hours: <ON>";
  7022. } else {
  7023. class9.textColor = 0xffffff;
  7024. // class9.message =
  7025. // "Moderator option: Mute player for 48 hours: <OFF>";
  7026. }
  7027. } else {
  7028. class9.message = "";
  7029. }
  7030. if (j == 650 || j == 655)
  7031. if (anInt1193 != 0) {
  7032. String s;
  7033. if (daysSinceLastLogin == 0)
  7034. s = "earlier today";
  7035. else if (daysSinceLastLogin == 1)
  7036. s = "yesterday";
  7037. else
  7038. s = daysSinceLastLogin + " days ago";
  7039. class9.message = "You last logged in " + s + " from: "
  7040. + signlink.dns;
  7041. } else {
  7042. class9.message = "";
  7043. }
  7044. if (j == 651) {
  7045. if (unreadMessages == 0) {
  7046. class9.message = "0 unread messages";
  7047. class9.textColor = 0xffff00;
  7048. }
  7049. if (unreadMessages == 1) {
  7050. class9.message = "1 unread message";
  7051. class9.textColor = 65280;
  7052. }
  7053. if (unreadMessages > 1) {
  7054. class9.message = unreadMessages + " unread messages";
  7055. class9.textColor = 65280;
  7056. }
  7057. }
  7058. if (j == 652)
  7059. if (daysSinceRecovChange == 201) {
  7060. if (membersInt == 1)
  7061. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  7062. else
  7063. class9.message = "";
  7064. } else if (daysSinceRecovChange == 200) {
  7065. class9.message = "You have not yet set any password recovery questions.";
  7066. } else {
  7067. String s1;
  7068. if (daysSinceRecovChange == 0)
  7069. s1 = "Earlier today";
  7070. else if (daysSinceRecovChange == 1)
  7071. s1 = "Yesterday";
  7072. else
  7073. s1 = daysSinceRecovChange + " days ago";
  7074. class9.message = s1 + " you changed your recovery questions";
  7075. }
  7076. if (j == 653)
  7077. if (daysSinceRecovChange == 201) {
  7078. if (membersInt == 1)
  7079. class9.message = "@whi@recommend you use a members world instead. You may use";
  7080. else
  7081. class9.message = "";
  7082. } else if (daysSinceRecovChange == 200)
  7083. class9.message = "We strongly recommend you do so now to secure your account.";
  7084. else
  7085. class9.message = "If you do not remember making this change then cancel it immediately";
  7086. if (j == 654) {
  7087. if (daysSinceRecovChange == 201)
  7088. if (membersInt == 1) {
  7089. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  7090. return;
  7091. } else {
  7092. class9.message = "";
  7093. return;
  7094. }
  7095. if (daysSinceRecovChange == 200) {
  7096. class9.message = "Do this from the 'account management' area on our front webpage";
  7097. return;
  7098. }
  7099. class9.message = "Do this from the 'account management' area on our front webpage";
  7100. }
  7101. }
  7102.  
  7103. private void drawSplitPrivateChat() {
  7104. if (splitPrivateChat == 0)
  7105. return;
  7106. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  7107. int i = 0;
  7108. if (anInt1104 != 0)
  7109. i = 1;
  7110. for (int j = 0; j < 100; j++)
  7111. if (chatMessages[j] != null) {
  7112. int k = chatTypes[j];
  7113. String s = chatNames[j];
  7114. byte byte1 = 0;
  7115. if (s != null && s.startsWith("@cr1@")) {
  7116. s = s.substring(5);
  7117. byte1 = 1;
  7118. }
  7119. if (s != null && s.startsWith("@cr2@")) {
  7120. s = s.substring(5);
  7121. byte1 = 2;
  7122. }
  7123. if (s != null && s.startsWith("@cr3@")) {
  7124. s = s.substring(5);
  7125. byte1 = 3;
  7126. }
  7127. if (s != null && s.startsWith("@cr4@")) {
  7128. s = s.substring(5);
  7129. byte1 = 4;
  7130. }
  7131. if (s != null && s.startsWith("@cr5@")) {
  7132. s = s.substring(5);
  7133. byte1 = 5;
  7134. }
  7135. if (s != null && s.startsWith("@cr6@")) {
  7136. s = s.substring(5);
  7137. byte1 = 6;
  7138. }
  7139. if (s != null && s.startsWith("@cr7@")) {
  7140. s = s.substring(5);
  7141. byte1 = 7;
  7142. }
  7143. if (s != null && s.startsWith("@cr8@")) {
  7144. s = s.substring(5);
  7145. byte1 = 8;
  7146. }
  7147. if (s != null && s.startsWith("@cr9@")) {
  7148. s = s.substring(5);
  7149. byte1 = 9;
  7150. }
  7151. if (s != null && s.startsWith("@cr10@")) {
  7152. s = s.substring(6);
  7153. byte1 = 10;
  7154. }
  7155. if (s != null && s.startsWith("@cr11@")) {
  7156. s = s.substring(6);
  7157. byte1 = 11;
  7158. }
  7159. if ((k == 3 || k == 7)
  7160. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  7161. && isFriendOrSelf(s))) {
  7162. int l = 329 - i * 13;
  7163. int k1 = 4;
  7164. textDrawingArea.method385(0, "From", l, k1);
  7165. textDrawingArea.method385(65535, "From", l - 1, k1);
  7166. if (byte1 == 3 || byte1 == 2 || byte1 == 1 || byte1 == 0) {
  7167. k1 += textDrawingArea.getTextWidth("From ");
  7168. } else if (byte1 == 9 || byte1 == 10 || byte1 == 11
  7169. || byte1 == 7 || byte1 == 8 || byte1 == 6
  7170. || byte1 == 5 || byte1 == 4) {
  7171. k1 += textDrawingArea.getTextWidth("From");
  7172. }
  7173. if (byte1 == 1) {
  7174. modIcons[0].drawSprite(k1 - 2, l - 12);
  7175. k1 += 12;
  7176. }
  7177. if (byte1 == 2) {
  7178. modIcons[2].drawSprite(k1 - 2, l - 13);
  7179. k1 += 12;
  7180. }
  7181. if (byte1 == 3) {
  7182. modIcons[1].drawSprite(k1 - 2, l - 12);
  7183. k1 += 12;
  7184. }
  7185. if (byte1 == 4) {
  7186. modIcons[3].drawSprite(k1, l - 11);
  7187. k1 += 12;
  7188. }
  7189. if (byte1 == 5) {
  7190. modIcons[4].drawSprite(k1, l - 11);
  7191. k1 += 12;
  7192. }
  7193. if (byte1 == 6) {
  7194. modIcons[5].drawSprite(k1, l - 11);
  7195. k1 += 12;
  7196. }
  7197. if (byte1 == 7) {
  7198. modIcons[6].drawSprite(k1, l - 11);
  7199. k1 += 12;
  7200. }
  7201. if (byte1 == 8) {
  7202. modIcons[7].drawSprite(k1, l - 11);
  7203. k1 += 12;
  7204. }
  7205. if (byte1 == 9) {
  7206. modIcons[8].drawSprite(k1, l - 11);
  7207. k1 += 12;
  7208. }
  7209. if (byte1 == 10) {
  7210. modIcons[9].drawSprite(k1, l - 11);
  7211. k1 += 12;
  7212. }
  7213. if (byte1 == 11) {
  7214. modIcons[10].drawSprite(k1, l - 11);
  7215. k1 += 12;
  7216. }
  7217. textDrawingArea.method385(0, s + ": " + chatMessages[j], l,
  7218. k1);
  7219. textDrawingArea.method385(65535,
  7220. s + ": " + chatMessages[j], l - 1, k1);
  7221. if (++i >= 5)
  7222. return;
  7223. }
  7224. if (k == 5 && privateChatMode < 2) {
  7225. int i1 = 329 - i * 13;
  7226. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  7227. textDrawingArea
  7228. .method385(65535, chatMessages[j], i1 - 1, 4);
  7229. if (++i >= 5)
  7230. return;
  7231. }
  7232. if (k == 6 && privateChatMode < 2) {
  7233. int j1 = 329 - i * 13;
  7234. textDrawingArea.method385(0, "To " + s + ": "
  7235. + chatMessages[j], j1, 4);
  7236. textDrawingArea.method385(65535, "To " + s + ": "
  7237. + chatMessages[j], j1 - 1, 4);
  7238. if (++i >= 5)
  7239. return;
  7240. }
  7241. }
  7242.  
  7243. }
  7244.  
  7245. public void pushMessage(String s, int i, String s1) {
  7246. if (i == 0 && dialogID != -1) {
  7247. aString844 = s;
  7248. super.clickMode3 = 0;
  7249. }
  7250. if (backDialogID == -1)
  7251. inputTaken = true;
  7252. for (int j = 499; j > 0; j--) {
  7253. chatTypes[j] = chatTypes[j - 1];
  7254. chatNames[j] = chatNames[j - 1];
  7255. chatMessages[j] = chatMessages[j - 1];
  7256. chatRights[j] = chatRights[j - 1];
  7257. clanTitles[j] = clanTitles[j - 1];
  7258. }
  7259. chatTypes[0] = i;
  7260. chatNames[0] = s1;
  7261. chatMessages[0] = s;
  7262. chatRights[0] = channelRights;
  7263. clanTitles[0] = clanTitle;
  7264. }
  7265.  
  7266. public void setNorth() {
  7267. cameraOffsetX = 0;
  7268. cameraOffsetY = 0;
  7269. viewRotationOffset = 0;
  7270. viewRotation = 0;
  7271. minimapRotation = 0;
  7272. minimapZoom = 0;
  7273. }
  7274. public static ScreenMode frameMode = ScreenMode.FIXED;
  7275. public static int frameWidth = 765;
  7276. public static int frameHeight = 503;
  7277. public static int screenAreaWidth = 512;
  7278. public static int screenAreaHeight = 334;
  7279. public static int cameraZoom = 600;
  7280. public static boolean showChatComponents = true;
  7281. public static boolean showTabComponents = true;
  7282. public static int viewDistance = 9;
  7283. public static boolean changeTabArea = frameMode == ScreenMode.FIXED ? false
  7284. : true;
  7285. public static boolean changeChatArea = frameMode == ScreenMode.FIXED ? false
  7286. : true;
  7287. public static boolean transparentTabArea = false;
  7288.  
  7289. public static void frameMode(ScreenMode screenMode) {
  7290. if (frameMode != screenMode) {
  7291. frameMode = screenMode;
  7292. if (screenMode == ScreenMode.FIXED) {
  7293. frameWidth = 765;
  7294. frameHeight = 503;
  7295. cameraZoom = 600;
  7296. changeChatArea = false;
  7297. changeTabArea = false;
  7298. } else if (screenMode == ScreenMode.RESIZABLE) {
  7299. frameWidth = 766;
  7300. frameHeight = 529;
  7301. cameraZoom = 850;
  7302. } else if (screenMode == ScreenMode.FULLSCREEN) {
  7303. cameraZoom = 600;
  7304. frameWidth = (int) Toolkit.getDefaultToolkit().getScreenSize()
  7305. .getWidth();
  7306. frameHeight = (int) Toolkit.getDefaultToolkit().getScreenSize()
  7307. .getHeight();
  7308. }
  7309. rebuildFrameSize(screenMode, frameWidth, frameHeight);
  7310. System.out.println("ScreenMode: " + screenMode.toString());
  7311. }
  7312. showChatComponents = screenMode == ScreenMode.FIXED ? true
  7313. : showChatComponents;
  7314. showTabComponents = screenMode == ScreenMode.FIXED ? true
  7315. : showTabComponents;
  7316. }
  7317.  
  7318. public static void rebuildFrameSize(ScreenMode screenMode, int screenWidth,
  7319. int screenHeight) {
  7320. try {
  7321. screenAreaWidth = (screenMode == ScreenMode.FIXED) ? 512
  7322. : screenWidth;
  7323. screenAreaHeight = (screenMode == ScreenMode.FIXED) ? 334
  7324. : screenHeight;
  7325. frameWidth = screenWidth;
  7326. frameHeight = screenHeight;
  7327. } catch (Exception e) {
  7328. e.printStackTrace();
  7329. }
  7330. }
  7331. public boolean isApplet;
  7332. public boolean appletClient() {
  7333. return gameFrame == null && isApplet == true;
  7334. }
  7335.  
  7336. public int getFrameWidth() {
  7337. Insets insets = this.getInsets();
  7338. return getWidth() - (insets.left + insets.right);
  7339. }
  7340.  
  7341. public int getFrameHeight() {
  7342. Insets insets = this.getInsets();
  7343. return getHeight() - (insets.top + insets.bottom);
  7344. }
  7345.  
  7346. public boolean getMousePositions() {
  7347. if (mouseInRegion(frameWidth - (frameWidth <= 1000 ? 240 : 420),
  7348. frameHeight - (frameWidth <= 1000 ? 90 : 37), frameWidth,
  7349. frameHeight)) {
  7350. return false;
  7351. }
  7352. if (showChatComponents) {
  7353. if (changeChatArea) {
  7354. if (super.mouseX > 0 && super.mouseX < 494
  7355. && super.mouseY > frameHeight - 175
  7356. && super.mouseY < frameHeight) {
  7357. return true;
  7358. } else {
  7359. if (super.mouseX > 494 && super.mouseX < 515
  7360. && super.mouseY > frameHeight - 175
  7361. && super.mouseY < frameHeight) {
  7362. return false;
  7363. }
  7364. }
  7365. } else if (!changeChatArea) {
  7366. if (super.mouseX > 0 && super.mouseX < 519
  7367. && super.mouseY > frameHeight - 175
  7368. && super.mouseY < frameHeight) {
  7369. return false;
  7370. }
  7371. }
  7372. }
  7373. if (mouseInRegion(frameWidth - 216, 0, frameWidth, 172)) {
  7374. return false;
  7375. }
  7376. if (!changeTabArea) {
  7377. if (super.mouseX > 0 && super.mouseY > 0
  7378. && super.mouseY < frameWidth && super.mouseY < frameHeight) {
  7379. if (super.mouseX >= frameWidth - 242
  7380. && super.mouseY >= frameHeight - 335) {
  7381. return false;
  7382. }
  7383. return true;
  7384. }
  7385. return false;
  7386. }
  7387. if (showTabComponents) {
  7388. if (frameWidth > 1000) {
  7389. if (super.mouseX >= frameWidth - 420
  7390. && super.mouseX <= frameWidth
  7391. && super.mouseY >= frameHeight - 37
  7392. && super.mouseY <= frameHeight
  7393. || super.mouseX > frameWidth - 225
  7394. && super.mouseX < frameWidth
  7395. && super.mouseY > frameHeight - 37 - 274
  7396. && super.mouseY < frameHeight) {
  7397. return false;
  7398. }
  7399. } else {
  7400. if (super.mouseX >= frameWidth - 210
  7401. && super.mouseX <= frameWidth
  7402. && super.mouseY >= frameHeight - 74
  7403. && super.mouseY <= frameHeight
  7404. || super.mouseX > frameWidth - 225
  7405. && super.mouseX < frameWidth
  7406. && super.mouseY > frameHeight - 74 - 274
  7407. && super.mouseY < frameHeight) {
  7408. return false;
  7409. }
  7410. }
  7411. }
  7412. return true;
  7413. }
  7414.  
  7415. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  7416. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1
  7417. && super.mouseY <= y2) {
  7418. return true;
  7419. }
  7420. return false;
  7421. }
  7422.  
  7423. public boolean mouseMapPosition() {
  7424. if (super.mouseX >= frameWidth - 21 && super.mouseX <= frameWidth
  7425. && super.mouseY >= 0 && super.mouseY <= 21) {
  7426. return false;
  7427. }
  7428. return true;
  7429. }
  7430.  
  7431. public boolean hitmarks554 = false, hpBar554 = false, runEnergy = false;
  7432. public boolean isPoisoned, clickedQuickPrayers;
  7433. public static Sprite[] cacheSprite = new Sprite[62];
  7434. public final int[]
  7435. orbX = { 0, 0, 25 },
  7436. orbY = { 41, 85, 121 },
  7437. orbTextX = { 15, 15, 40 },
  7438. orbTextY = { 67, 111, 147 },
  7439. coloredOrbX = { 27, 27, 52 },
  7440. coloredOrbY = { 45, 89, 125 },
  7441. currentInterface = { 4016, 4012, 149 },
  7442. maximumInterface = { 4017, 4013, 149 },
  7443. orbIconX = { 33, 30, 58 },
  7444. orbIconY = { 52, 93, 129 };
  7445.  
  7446. private void loadAllOrbs(int xOffset) {
  7447. expDrops[counterHover ? 24 : 23].drawSprite(0, 20);
  7448. int[] spriteID = { isPoisoned && hpHover ? 8 : 7, prayHover ? 8 : 7,
  7449. runHover ? 8 : 7, sumActive && sumHover ? 8 : 7 }, coloredOrbSprite = {
  7450. myPlayer.getHealthState() != 0 ? (myPlayer.getHealthState() == 1 ? 6 : 5) : 0, clickedQuickPrayers ? 2 : 1, runClicked1 ? 4 : 3,
  7451. sumActive ? 6 : 5 }, orbSprite = { 9, 10,
  7452. (runClicked1 ? 12 : 11), 13 };
  7453. String cEnergy = RSInterface.interfaceCache[149].message.replaceAll(
  7454. "%", "");
  7455. String hp = RSInterface.interfaceCache[4016].message
  7456. .replaceAll("%", "");
  7457. int currentHP = Integer.parseInt(hp), currentEnergy = Integer
  7458. .parseInt(cEnergy);
  7459. for (int i = 0; i < 3; i++) {
  7460. String currentStats = RSInterface.interfaceCache[currentInterface[i]].message
  7461. .replaceAll("%", ""), maxStats = RSInterface.interfaceCache[maximumInterface[i]].message
  7462. .replaceAll("%", "");
  7463. int currentLevel = Integer.parseInt(currentStats), maxLevel = Integer
  7464. .parseInt(maxStats), level = (int) (((double) currentLevel / (double) maxLevel) * 100D);
  7465. cacheSprite[spriteID[i]].drawSprite(orbX[i] + xOffset, orbY[i]);
  7466. cacheSprite[coloredOrbSprite[i]].drawSprite(coloredOrbX[i]
  7467. + xOffset, coloredOrbY[i]);
  7468. double percent = (i == 2 ? runEnergy ? currentEnergy / 100D : 100
  7469. : level / 100D), fillHp = 26 * percent, fillPrayer = 26 * percent, fillRun = 26 * percent;
  7470. double[] fill = { fillHp, fillPrayer, fillRun };
  7471. int depleteFill = 26 - (int) fill[i];
  7472. cacheSprite[14].myHeight = depleteFill;
  7473. try {
  7474. cacheSprite[14].drawSprite(coloredOrbX[i] + xOffset,
  7475. coloredOrbY[i]);
  7476. } catch (Exception e) {
  7477. }
  7478. cacheSprite[orbSprite[i]].drawSprite(orbIconX[i] + xOffset,
  7479. orbIconY[i]);
  7480. smallText
  7481. .method382(
  7482. getOrbTextColor(i == 2 ? runEnergy ? currentEnergy
  7483. : 100 : level),
  7484. orbTextX[i] + xOffset,
  7485. ""
  7486. + (i == 2 ? runEnergy ? cEnergy : 100
  7487. : i == 0 && newDamage ? currentHP * 10
  7488. : RSInterface.interfaceCache[currentInterface[i]].message
  7489. .replaceAll("%", "")),
  7490. orbTextY[i], true);
  7491. }
  7492. }
  7493.  
  7494. public int digits = 0;
  7495.  
  7496. private boolean runHover1, prayHover1, hpHover, prayClicked1, sumHover,
  7497. sumActive, specialHover, worldHover, autocast, runClicked1 = true;
  7498.  
  7499. public int getOrbTextColor(int statusInt) {
  7500. if (statusInt >= 75 && statusInt <= Integer.MAX_VALUE)
  7501. return 0x00FF00;
  7502. else if (statusInt >= 50 && statusInt <= 74)
  7503. return 0xFFFF00;
  7504. else if (statusInt >= 25 && statusInt <= 49)
  7505. return 0xFF981F;
  7506. else
  7507. return 0xFF0000;
  7508. }
  7509.  
  7510. public int getOrbFill(int statusInt) {
  7511. if (statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  7512. return 0;
  7513. else if (statusInt <= 96 && statusInt >= 93)
  7514. return 1;
  7515. else if (statusInt <= 92 && statusInt >= 89)
  7516. return 2;
  7517. else if (statusInt <= 88 && statusInt >= 85)
  7518. return 3;
  7519. else if (statusInt <= 84 && statusInt >= 81)
  7520. return 4;
  7521. else if (statusInt <= 80 && statusInt >= 77)
  7522. return 5;
  7523. else if (statusInt <= 76 && statusInt >= 73)
  7524. return 6;
  7525. else if (statusInt <= 72 && statusInt >= 69)
  7526. return 7;
  7527. else if (statusInt <= 68 && statusInt >= 65)
  7528. return 8;
  7529. else if (statusInt <= 64 && statusInt >= 61)
  7530. return 9;
  7531. else if (statusInt <= 60 && statusInt >= 57)
  7532. return 10;
  7533. else if (statusInt <= 56 && statusInt >= 53)
  7534. return 11;
  7535. else if (statusInt <= 52 && statusInt >= 49)
  7536. return 12;
  7537. else if (statusInt <= 48 && statusInt >= 45)
  7538. return 13;
  7539. else if (statusInt <= 44 && statusInt >= 41)
  7540. return 14;
  7541. else if (statusInt <= 40 && statusInt >= 37)
  7542. return 15;
  7543. else if (statusInt <= 36 && statusInt >= 33)
  7544. return 16;
  7545. else if (statusInt <= 32 && statusInt >= 29)
  7546. return 17;
  7547. else if (statusInt <= 28 && statusInt >= 25)
  7548. return 18;
  7549. else if (statusInt <= 24 && statusInt >= 21)
  7550. return 19;
  7551. else if (statusInt <= 20 && statusInt >= 17)
  7552. return 20;
  7553. else if (statusInt <= 16 && statusInt >= 13)
  7554. return 21;
  7555. else if (statusInt <= 12 && statusInt >= 9)
  7556. return 22;
  7557. else if (statusInt <= 8 && statusInt >= 7)
  7558. return 23;
  7559. else if (statusInt <= 6 && statusInt >= 5)
  7560. return 24;
  7561. else if (statusInt <= 4 && statusInt >= 3)
  7562. return 25;
  7563. else if (statusInt <= 2 && statusInt >= 1)
  7564. return 26;
  7565. else if (statusInt <= 0)
  7566. return 27;
  7567. return 0;
  7568. }
  7569.  
  7570. private void processTabClick2() {
  7571. if (super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95
  7572. && super.mouseY < 128) {
  7573. runHover1 = true;
  7574. } else {
  7575. runHover1 = false;
  7576. }
  7577. if (super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52
  7578. && super.mouseY < 87) {
  7579. prayHover1 = true;
  7580. } else {
  7581. prayHover1 = false;
  7582. }
  7583. if (super.mouseX >= 765 - 24 && super.mouseX <= 765
  7584. && super.mouseY >= 3 && super.mouseY <= 25) {
  7585. logHover = true;
  7586. } else {
  7587. logHover = false;
  7588. }
  7589. }
  7590.  
  7591. public void processTabClick() {
  7592. minimapHovers();
  7593. if (super.clickMode3 == 1) {
  7594. if (super.saveClickX >= 524 && super.saveClickX <= 561
  7595. && super.saveClickY >= 169 && super.saveClickY < 205
  7596. && tabInterfaceIDs[0] != -1) {
  7597. needDrawTabArea = true;
  7598. tabID = 0;
  7599. tabAreaAltered = true;
  7600. }
  7601. if (super.saveClickX >= 562 && super.saveClickX <= 594
  7602. && super.saveClickY >= 168 && super.saveClickY < 205
  7603. && tabInterfaceIDs[1] != -1) {
  7604. needDrawTabArea = true;
  7605. tabID = 1;
  7606. tabAreaAltered = true;
  7607. }
  7608. if (super.saveClickX >= 595 && super.saveClickX <= 626
  7609. && super.saveClickY >= 168 && super.saveClickY < 205
  7610. && tabInterfaceIDs[2] != -1) {
  7611. needDrawTabArea = true;
  7612. tabID = 2;
  7613. tabAreaAltered = true;
  7614. }
  7615. if (super.saveClickX >= 627 && super.saveClickX <= 660
  7616. && super.saveClickY >= 168 && super.saveClickY < 203
  7617. && tabInterfaceIDs[3] != -1) {
  7618. needDrawTabArea = true;
  7619. tabID = 3;
  7620. tabAreaAltered = true;
  7621. }
  7622. if (super.saveClickX >= 661 && super.saveClickX <= 693
  7623. && super.saveClickY >= 168 && super.saveClickY < 205
  7624. && tabInterfaceIDs[4] != -1) {
  7625. needDrawTabArea = true;
  7626. tabID = 4;
  7627. tabAreaAltered = true;
  7628. }
  7629. if (super.saveClickX >= 694 && super.saveClickX <= 725
  7630. && super.saveClickY >= 168 && super.saveClickY < 205
  7631. && tabInterfaceIDs[5] != -1) {
  7632. needDrawTabArea = true;
  7633. tabID = 5;
  7634. tabAreaAltered = true;
  7635. }
  7636. if (super.saveClickX >= 726 && super.saveClickX <= 765
  7637. && super.saveClickY >= 169 && super.saveClickY < 205
  7638. && tabInterfaceIDs[6] != -1) {
  7639. needDrawTabArea = true;
  7640. tabID = 6;
  7641. tabAreaAltered = true;
  7642. }
  7643. if (super.saveClickX >= 524 && super.saveClickX <= 561
  7644. && super.saveClickY >= 466 && super.saveClickY < 503
  7645. && tabInterfaceIDs[7] != -1) {
  7646. needDrawTabArea = true;
  7647. tabID = 7;
  7648. tabAreaAltered = true;
  7649. }
  7650. if (super.saveClickX >= 562 && super.saveClickX <= 594
  7651. && super.saveClickY >= 466 && super.saveClickY < 503
  7652. && tabInterfaceIDs[8] != -1) {
  7653. needDrawTabArea = true;
  7654. tabID = 8;
  7655. tabAreaAltered = true;
  7656. }
  7657. if (super.saveClickX >= 595 && super.saveClickX <= 627
  7658. && super.saveClickY >= 466 && super.saveClickY < 503
  7659. && tabInterfaceIDs[9] != -1) {
  7660. needDrawTabArea = true;
  7661. tabID = 9;
  7662. tabAreaAltered = true;
  7663. }
  7664. if (super.saveClickX >= 627 && super.saveClickX <= 664
  7665. && super.saveClickY >= 466 && super.saveClickY < 503
  7666. && tabInterfaceIDs[10] != -1) {
  7667. needDrawTabArea = true;
  7668. tabID = 10;
  7669. tabAreaAltered = true;
  7670. }
  7671. if (super.saveClickX >= 661 && super.saveClickX <= 694
  7672. && super.saveClickY >= 466 && super.saveClickY < 503
  7673. && tabInterfaceIDs[11] != -1) {
  7674. needDrawTabArea = true;
  7675. tabID = 11;
  7676. tabAreaAltered = true;
  7677. }
  7678. if (super.saveClickX >= 695 && super.saveClickX <= 725
  7679. && super.saveClickY >= 466 && super.saveClickY < 503
  7680. && tabInterfaceIDs[12] != -1) {
  7681. needDrawTabArea = true;
  7682. tabID = 12;
  7683. tabAreaAltered = true;
  7684. }
  7685. if (super.saveClickX >= 726 && super.saveClickX <= 765
  7686. && super.saveClickY >= 466 && super.saveClickY < 502
  7687. && tabInterfaceIDs[13] != -1) {
  7688. needDrawTabArea = true;
  7689. tabID = 13;
  7690. tabAreaAltered = true;
  7691. }
  7692. }
  7693. }
  7694.  
  7695. private void resetImageProducers2() {
  7696. if (aRSImageProducer_1166 != null)
  7697. return;
  7698. nullLoader();
  7699. super.fullGameScreen = null;
  7700. aRSImageProducer_1107 = null;
  7701. aRSImageProducer_1108 = null;
  7702. loginScreenArea = null;
  7703. leftSideFlame = null;
  7704. rightSideFlame = null;
  7705. gameLogo = null;
  7706. aRSImageProducer_1113 = null;
  7707. aRSImageProducer_1114 = null;
  7708. aRSImageProducer_1115 = null;
  7709. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  7710. getGameComponent());
  7711. aRSImageProducer_1164 = new RSImageProducer(246, 168,
  7712. getGameComponent());
  7713. DrawingArea.setAllPixelsToZero();
  7714. if (revision508 == true) {
  7715. mapArea508.drawSprite(0, 0);
  7716. }
  7717. if (revision474 == true) {
  7718. mapArea474.drawSprite(0, 0);
  7719. }
  7720. if (revision498 == true) {
  7721. mapArea.drawSprite(0, 0);
  7722. }
  7723. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  7724. getGameComponent());
  7725. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  7726. getGameComponent());
  7727. DrawingArea.setAllPixelsToZero();
  7728. new RSImageProducer(496, 50, getGameComponent());
  7729. new RSImageProducer(269, 37, getGameComponent());
  7730. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7731. welcomeScreenRaised = true;
  7732. }
  7733.  
  7734. public String getDocumentBaseHost() {
  7735. if (signlink.mainapp != null) {
  7736. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7737. }
  7738. if (super.gameFrame != null) {
  7739. return "";
  7740. } else {
  7741. return "";
  7742. }
  7743. }
  7744.  
  7745. private void method81(Sprite sprite, int j, int k) {
  7746. int l = k * k + j * j;
  7747. if (l > 4225 && l < 0x15f90) {
  7748. int i1 = viewRotation + minimapRotation & 0x7ff;
  7749. int j1 = Model.modelIntArray1[i1];
  7750. int k1 = Model.modelIntArray2[i1];
  7751. j1 = (j1 * 256) / (minimapZoom + 256);
  7752. k1 = (k1 * 256) / (minimapZoom + 256);
  7753. int l1 = j * j1 + k * k1 >> 16;
  7754. int i2 = j * k1 - k * j1 >> 16;
  7755. double d = Math.atan2(l1, i2);
  7756. int j2 = (int) (Math.sin(d) * 63D);
  7757. int k2 = (int) (Math.cos(d) * 57D);
  7758. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7759. } else {
  7760. markMinimap(sprite, k, j);
  7761. }
  7762. }
  7763. public void rightClickChatButtons() {
  7764. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482
  7765. && super.mouseY <= 503) {
  7766. menuActionName[1] = "View All";
  7767. menuActionID[1] = 999;
  7768. menuActionRow = 2;
  7769. } else if (super.mouseX >= 71 && super.mouseX <= 127
  7770. && super.mouseY >= 482 && super.mouseY <= 503) {
  7771. menuActionName[1] = "View Game";
  7772. menuActionID[1] = 998;
  7773. menuActionName[2] = "View Market";
  7774. menuActionID[2] = 1005;
  7775. menuActionRow = 3;
  7776. } else if (super.mouseX >= 137 && super.mouseX <= 193
  7777. && super.mouseY >= 482 && super.mouseY <= 503) {
  7778. menuActionName[1] = "Hide public";
  7779. menuActionID[1] = 997;
  7780. menuActionName[2] = "Off public";
  7781. menuActionID[2] = 996;
  7782. menuActionName[3] = "Friends public";
  7783. menuActionID[3] = 995;
  7784. menuActionName[4] = "On public";
  7785. menuActionID[4] = 994;
  7786. menuActionName[5] = "View public";
  7787. menuActionID[5] = 993;
  7788. menuActionRow = 6;
  7789. } else if (super.mouseX >= 203 && super.mouseX <= 259
  7790. && super.mouseY >= 482 && super.mouseY <= 503) {
  7791. menuActionName[1] = "Off private";
  7792. menuActionID[1] = 992;
  7793. menuActionName[2] = "Friends private";
  7794. menuActionID[2] = 991;
  7795. menuActionName[3] = "On private";
  7796. menuActionID[3] = 990;
  7797. menuActionName[4] = "View private";
  7798. menuActionID[4] = 989;
  7799. menuActionRow = 5;
  7800. } else if (super.mouseX >= 269 && super.mouseX <= 325
  7801. && super.mouseY >= 482 && super.mouseY <= 503) {
  7802. menuActionName[1] = "Off clan chat";
  7803. menuActionID[1] = 1003;
  7804. menuActionName[2] = "Friends clan chat";
  7805. menuActionID[2] = 1002;
  7806. menuActionName[3] = "On clan chat";
  7807. menuActionID[3] = 1001;
  7808. menuActionName[4] = "View clan chat";
  7809. menuActionID[4] = 1000;
  7810. menuActionRow = 5;
  7811. } else if (super.mouseX >= 335 && super.mouseX <= 391
  7812. && super.mouseY >= 482 && super.mouseY <= 503) {
  7813. menuActionName[1] = "Off trade";
  7814. menuActionID[1] = 987;
  7815. menuActionName[2] = "Friends trade";
  7816. menuActionID[2] = 986;
  7817. menuActionName[3] = "On trade";
  7818. menuActionID[3] = 985;
  7819. menuActionName[4] = "View trade";
  7820. menuActionID[4] = 984;
  7821. menuActionRow = 5;
  7822. }
  7823. }
  7824.  
  7825. public void processRightClick() {
  7826. if (activeInterfaceType != 0) {
  7827. return;
  7828. }
  7829. menuActionName[0] = "Cancel";
  7830. menuActionID[0] = 1107;
  7831. menuActionRow = 1;
  7832. if (fullscreenInterfaceID != -1) {
  7833. anInt886 = 0;
  7834. anInt1315 = 0;
  7835. buildInterfaceMenu(8,
  7836. RSInterface.interfaceCache[fullscreenInterfaceID],
  7837. super.mouseX, 8, super.mouseY, 0);
  7838. if (anInt886 != anInt1026) {
  7839. anInt1026 = anInt886;
  7840. }
  7841. if (anInt1315 != anInt1129) {
  7842. anInt1129 = anInt1315;
  7843. }
  7844. return;
  7845. }
  7846. buildSplitPrivateChatMenu();
  7847. anInt886 = 0;
  7848. anInt1315 = 0;
  7849. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516
  7850. && super.mouseY < 338) {
  7851. if (openInterfaceID != -1) {
  7852. buildInterfaceMenu(4,
  7853. RSInterface.interfaceCache[openInterfaceID],
  7854. super.mouseX, 4, super.mouseY, 0);
  7855. } else {
  7856. build3dScreenMenu();
  7857. }
  7858. }
  7859. if (anInt886 != anInt1026) {
  7860. anInt1026 = anInt886;
  7861. }
  7862. if (anInt1315 != anInt1129) {
  7863. anInt1129 = anInt1315;
  7864. }
  7865. anInt886 = 0;
  7866. anInt1315 = 0;
  7867. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740
  7868. && super.mouseY < 468) {
  7869. if (invOverlayInterfaceID != -1) {
  7870. buildInterfaceMenu(548,
  7871. RSInterface.interfaceCache[invOverlayInterfaceID],
  7872. super.mouseX, 207, super.mouseY, 0);
  7873. } else if (tabInterfaceIDs[tabID] != -1) {
  7874. buildInterfaceMenu(548,
  7875. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  7876. super.mouseX, 207, super.mouseY, 0);
  7877. }
  7878. }
  7879. if (anInt886 != anInt1048) {
  7880. needDrawTabArea = true;
  7881. tabAreaAltered = true;
  7882. anInt1048 = anInt886;
  7883. }
  7884. if (anInt1315 != anInt1044) {
  7885. needDrawTabArea = true;
  7886. tabAreaAltered = true;
  7887. anInt1044 = anInt1315;
  7888. }
  7889. anInt886 = 0;
  7890. anInt1315 = 0;
  7891. if (super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490
  7892. && super.mouseY < 463) {
  7893. if (backDialogID != -1) {
  7894. buildInterfaceMenu(20,
  7895. RSInterface.interfaceCache[backDialogID], super.mouseX,
  7896. 358, super.mouseY, 0);
  7897. } else if (super.mouseY < 463 && super.mouseX < 490) {
  7898. buildChatAreaMenu(super.mouseY - 338);
  7899. }
  7900. }
  7901. if (backDialogID != -1 && anInt886 != anInt1039) {
  7902. inputTaken = true;
  7903. anInt1039 = anInt886;
  7904. }
  7905. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7906. inputTaken = true;
  7907. anInt1500 = anInt1315;
  7908. }
  7909. /* Enable custom right click areas */
  7910. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516
  7911. && super.mouseY < 503)
  7912. rightClickChatButtons();
  7913. processMinimapActions();
  7914. boolean flag = false;
  7915. while (!flag) {
  7916. flag = true;
  7917. for (int j = 0; j < menuActionRow - 1; j++) {
  7918. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7919. String s = menuActionName[j];
  7920. menuActionName[j] = menuActionName[j + 1];
  7921. menuActionName[j + 1] = s;
  7922. int k = menuActionID[j];
  7923. menuActionID[j] = menuActionID[j + 1];
  7924. menuActionID[j + 1] = k;
  7925. k = menuActionCmd2[j];
  7926. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7927. menuActionCmd2[j + 1] = k;
  7928. k = menuActionCmd3[j];
  7929. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7930. menuActionCmd3[j + 1] = k;
  7931. k = menuActionCmd1[j];
  7932. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7933. menuActionCmd1[j + 1] = k;
  7934. flag = false;
  7935. }
  7936. }
  7937. }
  7938. }
  7939.  
  7940. private int method83(int i, int j, int k) {
  7941. int l = 256 - k;
  7942. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  7943. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7944. }
  7945.  
  7946. public void login(String s, String s1, boolean flag) {
  7947. signlink.errorname = s;
  7948. try {
  7949. if (!flag) {
  7950. loginMessage1 = "";
  7951. loginMessage2 = "";
  7952. drawLoginScreen(true);
  7953. }
  7954. socketStream = new RSSocket(this, openSocket(port + portOff));
  7955. long l = TextClass.longForName(s);
  7956. int i = (int) (l >> 16 & 31L);
  7957. stream.currentOffset = 0;
  7958. stream.writeWordBigEndian(14);
  7959. stream.writeWordBigEndian(i);
  7960. socketStream.queueBytes(2, stream.buffer);
  7961. for (int j = 0; j < 8; j++)
  7962. socketStream.read();
  7963.  
  7964. int k = socketStream.read();
  7965. int i1 = k;
  7966. if (k == 0) {
  7967. socketStream.flushInputStream(inStream.buffer, 8);
  7968. inStream.currentOffset = 0;
  7969. aLong1215 = inStream.readQWord();
  7970. int ai[] = new int[4];
  7971. ai[0] = (int) (Math.random() * 99999999D);
  7972. ai[1] = (int) (Math.random() * 99999999D);
  7973. ai[2] = (int) (aLong1215 >> 32);
  7974. ai[3] = (int) aLong1215;
  7975. stream.currentOffset = 0;
  7976. stream.writeWordBigEndian(10);
  7977. stream.writeDWord(ai[0]);
  7978. stream.writeDWord(ai[1]);
  7979. stream.writeDWord(ai[2]);
  7980. stream.writeDWord(ai[3]);
  7981. stream.writeDWord(signlink.uid);
  7982. stream.writeString(s);
  7983. stream.writeString(s1);
  7984. stream.writeString(macAddress);
  7985. stream.doKeys();
  7986. aStream_847.currentOffset = 0;
  7987. if (flag)
  7988. aStream_847.writeWordBigEndian(18);
  7989. else
  7990. aStream_847.writeWordBigEndian(16);
  7991. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  7992. + 1 + 2);
  7993. aStream_847.writeWordBigEndian(255);
  7994. aStream_847.writeWord(317);
  7995. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7996. for (int l1 = 0; l1 < 9; l1++)
  7997. aStream_847.writeDWord(expectedCRCs[l1]);
  7998.  
  7999. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  8000. stream.encryption = new ISAACRandomGen(ai);
  8001. for (int j2 = 0; j2 < 4; j2++)
  8002. ai[j2] += 50;
  8003.  
  8004. encryption = new ISAACRandomGen(ai);
  8005. socketStream.queueBytes(aStream_847.currentOffset,
  8006. aStream_847.buffer);
  8007. k = socketStream.read();
  8008. }
  8009. if (k == 1) {
  8010. try {
  8011. Thread.sleep(2000L);
  8012. } catch (Exception _ex) {
  8013. }
  8014. login(s, s1, flag);
  8015. return;
  8016. }
  8017. counterOn = false;
  8018. if (k == 2) {
  8019. myPrivilege = socketStream.read();
  8020. flagged = socketStream.read() == 1;
  8021. aLong1220 = 0L;
  8022. anInt1022 = 0;
  8023. mouseDetection.coordsIndex = 0;
  8024. super.awtFocus = true;
  8025. aBoolean954 = true;
  8026. loggedIn = true;
  8027. stream.currentOffset = 0;
  8028. inStream.currentOffset = 0;
  8029. pktType = -1;
  8030. anInt841 = -1;
  8031. anInt842 = -1;
  8032. anInt843 = -1;
  8033. pktSize = 0;
  8034. anInt1009 = 0;
  8035. anInt1104 = 0;
  8036. anInt1011 = 0;
  8037. anInt855 = 0;
  8038. menuActionRow = 0;
  8039. menuOpen = false;
  8040. super.idleTime = 0;
  8041. for (int j1 = 0; j1 < 500; j1++)
  8042. chatMessages[j1] = null;
  8043.  
  8044. itemSelected = 0;
  8045. spellSelected = 0;
  8046. loadingStage = 0;
  8047. anInt1062 = 0;
  8048. setNorth();
  8049. anInt1021 = 0;
  8050. anInt985 = -1;
  8051. destX = 0;
  8052. destY = 0;
  8053. playerCount = 0;
  8054. npcCount = 0;
  8055. for (int i2 = 0; i2 < maxPlayers; i2++) {
  8056. playerArray[i2] = null;
  8057. aStreamArray895s[i2] = null;
  8058. }
  8059.  
  8060. for (int k2 = 0; k2 < 16384; k2++)
  8061. npcArray[k2] = null;
  8062.  
  8063. myPlayer = playerArray[myPlayerIndex] = new Player();
  8064. aClass19_1013.removeAll();
  8065. aClass19_1056.removeAll();
  8066. for (int l2 = 0; l2 < 4; l2++) {
  8067. for (int i3 = 0; i3 < 104; i3++) {
  8068. for (int k3 = 0; k3 < 104; k3++)
  8069. groundArray[l2][i3][k3] = null;
  8070.  
  8071. }
  8072.  
  8073. }
  8074.  
  8075. aClass19_1179 = new NodeList();
  8076. fullscreenInterfaceID = -1;
  8077. anInt900 = 0;
  8078. friendsCount = 0;
  8079. dialogID = -1;
  8080. backDialogID = -1;
  8081. openInterfaceID = -1;
  8082. invOverlayInterfaceID = -1;
  8083. anInt1018 = -1;
  8084. aBoolean1149 = false;
  8085. tabID = 3;
  8086. inputDialogState = 0;
  8087. menuOpen = false;
  8088. messagePromptRaised = false;
  8089. aString844 = null;
  8090. anInt1055 = 0;
  8091. anInt1054 = -1;
  8092. aBoolean1047 = true;
  8093. method45();
  8094. for (int j3 = 0; j3 < 5; j3++)
  8095. anIntArray990[j3] = 0;
  8096.  
  8097. for (int l3 = 0; l3 < 6; l3++) {
  8098. atPlayerActions[l3] = null;
  8099. atPlayerArray[l3] = false;
  8100. }
  8101.  
  8102. anInt1175 = 0;
  8103. anInt1134 = 0;
  8104. anInt986 = 0;
  8105. anInt1288 = 0;
  8106. anInt924 = 0;
  8107. anInt1188 = 0;
  8108. anInt1155 = 0;
  8109. anInt1226 = 0;
  8110. resetImageProducers2();
  8111. return;
  8112. }
  8113. if (k == 3) {
  8114. loginMessage1 = "";
  8115. loginMessage2 = "Invalid username or password.";
  8116. return;
  8117. }
  8118. if (k == 4) {
  8119. loginMessage1 = "Your account has been disabled.";
  8120. loginMessage2 = "Please check your message-center for details.";
  8121. return;
  8122. }
  8123. if (k == 5) {
  8124. loginMessage1 = "Your account is already logged in.";
  8125. loginMessage2 = "Try again in 60 secs...";
  8126. return;
  8127. }
  8128. if (k == 6) {
  8129. loginMessage1 = "RuneScape has been updated!";
  8130. loginMessage2 = "Please reload this page.";
  8131. return;
  8132. }
  8133. if (k == 7) {
  8134. loginMessage1 = "This world is full.";
  8135. loginMessage2 = "Please use a different world.";
  8136. return;
  8137. }
  8138. if (k == 8) {
  8139. loginMessage1 = "Unable to connect.";
  8140. loginMessage2 = "Login server offline.";
  8141. return;
  8142. }
  8143. if (k == 9) {
  8144. loginMessage1 = "Login limit exceeded.";
  8145. loginMessage2 = "Too many connections from your address.";
  8146. return;
  8147. }
  8148. if (k == 10) {
  8149. loginMessage1 = "Unable to connect.";
  8150. loginMessage2 = "Bad session id.";
  8151. return;
  8152. }
  8153. if (k == 11) {
  8154. loginMessage2 = "Login server rejected session.";
  8155. loginMessage2 = "Please try again.";
  8156. return;
  8157. }
  8158. if (k == 12) {
  8159. loginMessage1 = "You need a members account to login to this world.";
  8160. loginMessage2 = "Please subscribe, or use a different world.";
  8161. return;
  8162. }
  8163. if (k == 13) {
  8164. loginMessage1 = "Could not complete login.";
  8165. loginMessage2 = "Please try using a different world.";
  8166. return;
  8167. }
  8168. if (k == 14) {
  8169. loginMessage1 = "The server is being updated.";
  8170. loginMessage2 = "Please wait 1 minute and try again.";
  8171. return;
  8172. }
  8173. if (k == 15) {
  8174. loggedIn = true;
  8175. stream.currentOffset = 0;
  8176. inStream.currentOffset = 0;
  8177. pktType = -1;
  8178. anInt841 = -1;
  8179. anInt842 = -1;
  8180. anInt843 = -1;
  8181. pktSize = 0;
  8182. anInt1009 = 0;
  8183. anInt1104 = 0;
  8184. menuActionRow = 0;
  8185. menuOpen = false;
  8186. aLong824 = System.currentTimeMillis();
  8187. return;
  8188. }
  8189. if (k == 16) {
  8190. loginMessage1 = "Login attempts exceeded.";
  8191. loginMessage2 = "Please wait 1 minute and try again.";
  8192. return;
  8193. }
  8194. if (k == 17) {
  8195. loginMessage1 = "You are standing in a members-only area.";
  8196. loginMessage2 = "To play on this world move to a free area first";
  8197. return;
  8198. }
  8199. if (k == 20) {
  8200. loginMessage1 = "Invalid loginserver requested";
  8201. loginMessage2 = "Please try using a different world.";
  8202. return;
  8203. }
  8204. if (k == 21) {
  8205. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  8206. loginMessage1 = "You have only just left another world";
  8207. loginMessage2 = "Your profile will be transferred in: "
  8208. + k1 + " seconds";
  8209. drawLoginScreen(true);
  8210. try {
  8211. Thread.sleep(1000L);
  8212. } catch (Exception _ex) {
  8213. }
  8214. }
  8215.  
  8216. login(s, s1, flag);
  8217. return;
  8218. }
  8219. if (k == 22) {
  8220. loginMessage1 = "Your computer has been UUID banned.";
  8221. loginMessage2 = "Please appeal on the forums.";
  8222. return;
  8223. }
  8224. if (k == 23) {
  8225. loginState = LoginScreenState.DOWNLOADING_CLIENT;
  8226. new UpdateClient().start();
  8227. return;
  8228. }
  8229. if (k == 24) {
  8230. loginMessage1 = "This world is running a closed Beta.";
  8231. loginMessage2 = "Sorry invited players only.";
  8232. return;
  8233. }
  8234. if (k == 25) {
  8235. loginMessage1 = "Account locked as we suspect it has been stolen.";
  8236. loginMessage2 = "Please visit os-pvp.org for details.";
  8237. return;
  8238. }
  8239. if (k == -1) {
  8240. if (i1 == 0) {
  8241. if (loginFailures < 2) {
  8242. try {
  8243. Thread.sleep(2000L);
  8244. } catch (Exception _ex) {
  8245. }
  8246. loginFailures++;
  8247. login(s, s1, flag);
  8248. return;
  8249. }
  8250. } else {
  8251. loginState = LoginScreenState.DOWNLOADING_CLIENT;
  8252. new UpdateClient().start();
  8253. return;
  8254. }
  8255. } else {
  8256. loginState = LoginScreenState.DOWNLOADING_CLIENT;
  8257. new UpdateClient().start();
  8258. return;
  8259. }
  8260. } catch (IOException _ex) {
  8261. loginMessage1 = "";
  8262. } catch (Exception e) {
  8263. System.out.println("Error while generating uid. Skipping step.");
  8264. e.printStackTrace();
  8265. }
  8266. loginMessage1 = "Error connecting to server.";
  8267. loginMessage2 = "Go to http://os-pvp.org/ for info.";
  8268. }
  8269.  
  8270. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  8271. int l1, int i2, int j2, boolean flag, int k2) {
  8272. byte byte0 = 104;
  8273. byte byte1 = 104;
  8274. for (int l2 = 0; l2 < byte0; l2++) {
  8275. for (int i3 = 0; i3 < byte1; i3++) {
  8276. anIntArrayArray901[l2][i3] = 0;
  8277. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  8278. }
  8279. }
  8280. int j3 = j2;
  8281. int k3 = j1;
  8282. anIntArrayArray901[j2][j1] = 99;
  8283. anIntArrayArray825[j2][j1] = 0;
  8284. int l3 = 0;
  8285. int i4 = 0;
  8286. bigX[l3] = j2;
  8287. bigY[l3++] = j1;
  8288. boolean flag1 = false;
  8289. int j4 = bigX.length;
  8290. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  8291. while (i4 != l3) {
  8292. j3 = bigX[i4];
  8293. k3 = bigY[i4];
  8294. i4 = (i4 + 1) % j4;
  8295. if (j3 == k2 && k3 == i2) {
  8296. flag1 = true;
  8297. break;
  8298. }
  8299. if (i1 != 0) {
  8300. if ((i1 < 5 || i1 == 10)
  8301. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  8302. i1 - 1, i2)) {
  8303. flag1 = true;
  8304. break;
  8305. }
  8306. if (i1 < 10
  8307. && aClass11Array1230[plane].method220(k2, i2, k3,
  8308. i1 - 1, j, j3)) {
  8309. flag1 = true;
  8310. break;
  8311. }
  8312. }
  8313. if (k1 != 0
  8314. && k != 0
  8315. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  8316. k1, k3)) {
  8317. flag1 = true;
  8318. break;
  8319. }
  8320. int l4 = anIntArrayArray825[j3][k3] + 1;
  8321. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  8322. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  8323. bigX[l3] = j3 - 1;
  8324. bigY[l3] = k3;
  8325. l3 = (l3 + 1) % j4;
  8326. anIntArrayArray901[j3 - 1][k3] = 2;
  8327. anIntArrayArray825[j3 - 1][k3] = l4;
  8328. }
  8329. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  8330. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  8331. bigX[l3] = j3 + 1;
  8332. bigY[l3] = k3;
  8333. l3 = (l3 + 1) % j4;
  8334. anIntArrayArray901[j3 + 1][k3] = 8;
  8335. anIntArrayArray825[j3 + 1][k3] = l4;
  8336. }
  8337. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  8338. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8339. bigX[l3] = j3;
  8340. bigY[l3] = k3 - 1;
  8341. l3 = (l3 + 1) % j4;
  8342. anIntArrayArray901[j3][k3 - 1] = 1;
  8343. anIntArrayArray825[j3][k3 - 1] = l4;
  8344. }
  8345. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  8346. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8347. bigX[l3] = j3;
  8348. bigY[l3] = k3 + 1;
  8349. l3 = (l3 + 1) % j4;
  8350. anIntArrayArray901[j3][k3 + 1] = 4;
  8351. anIntArrayArray825[j3][k3 + 1] = l4;
  8352. }
  8353. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  8354. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  8355. && (ai[j3 - 1][k3] & 0x1280108) == 0
  8356. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8357. bigX[l3] = j3 - 1;
  8358. bigY[l3] = k3 - 1;
  8359. l3 = (l3 + 1) % j4;
  8360. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  8361. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  8362. }
  8363. if (j3 < byte0 - 1 && k3 > 0
  8364. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  8365. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  8366. && (ai[j3 + 1][k3] & 0x1280180) == 0
  8367. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8368. bigX[l3] = j3 + 1;
  8369. bigY[l3] = k3 - 1;
  8370. l3 = (l3 + 1) % j4;
  8371. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  8372. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  8373. }
  8374. if (j3 > 0 && k3 < byte1 - 1
  8375. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  8376. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  8377. && (ai[j3 - 1][k3] & 0x1280108) == 0
  8378. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8379. bigX[l3] = j3 - 1;
  8380. bigY[l3] = k3 + 1;
  8381. l3 = (l3 + 1) % j4;
  8382. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  8383. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  8384. }
  8385. if (j3 < byte0 - 1 && k3 < byte1 - 1
  8386. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  8387. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  8388. && (ai[j3 + 1][k3] & 0x1280180) == 0
  8389. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8390. bigX[l3] = j3 + 1;
  8391. bigY[l3] = k3 + 1;
  8392. l3 = (l3 + 1) % j4;
  8393. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  8394. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  8395. }
  8396. }
  8397. anInt1264 = 0;
  8398. if (!flag1) {
  8399. if (flag) {
  8400. int i5 = 100;
  8401. for (int k5 = 1; k5 < 2; k5++) {
  8402. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  8403. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  8404. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  8405. && anIntArrayArray825[i6][l6] < i5) {
  8406. i5 = anIntArrayArray825[i6][l6];
  8407. j3 = i6;
  8408. k3 = l6;
  8409. anInt1264 = 1;
  8410. flag1 = true;
  8411. }
  8412.  
  8413. }
  8414.  
  8415. if (flag1)
  8416. break;
  8417. }
  8418.  
  8419. }
  8420. if (!flag1)
  8421. return false;
  8422. }
  8423. i4 = 0;
  8424. bigX[i4] = j3;
  8425. bigY[i4++] = k3;
  8426. int l5;
  8427. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  8428. if (j5 != l5) {
  8429. l5 = j5;
  8430. bigX[i4] = j3;
  8431. bigY[i4++] = k3;
  8432. }
  8433. if ((j5 & 2) != 0)
  8434. j3++;
  8435. else if ((j5 & 8) != 0)
  8436. j3--;
  8437. if ((j5 & 1) != 0)
  8438. k3++;
  8439. else if ((j5 & 4) != 0)
  8440. k3--;
  8441. }
  8442. // if(cancelWalk) { return i4 > 0; }
  8443.  
  8444. if (i4 > 0) {
  8445. int k4 = i4;
  8446. if (k4 > 25)
  8447. k4 = 25;
  8448. i4--;
  8449. int k6 = bigX[i4];
  8450. int i7 = bigY[i4];
  8451. anInt1288 += k4;
  8452. if (anInt1288 >= 92) {
  8453. stream.createFrame(36);
  8454. stream.writeDWord(0);
  8455. anInt1288 = 0;
  8456. }
  8457. if (i == 0) {
  8458. stream.createFrame(164);
  8459. stream.writeWordBigEndian(k4 + k4 + 3);
  8460. }
  8461. if (i == 1) {
  8462. stream.createFrame(248);
  8463. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8464. }
  8465. if (i == 2) {
  8466. stream.createFrame(98);
  8467. stream.writeWordBigEndian(k4 + k4 + 3);
  8468. }
  8469. stream.method433(k6 + baseX);
  8470. destX = bigX[0];
  8471. destY = bigY[0];
  8472. for (int j7 = 1; j7 < k4; j7++) {
  8473. i4--;
  8474. stream.writeWordBigEndian(bigX[i4] - k6);
  8475. stream.writeWordBigEndian(bigY[i4] - i7);
  8476. }
  8477.  
  8478. stream.method431(i7 + baseY);
  8479. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8480. return true;
  8481. }
  8482. return i != 1;
  8483. }
  8484.  
  8485. public void method86(Stream stream) {
  8486. for (int j = 0; j < anInt893; j++) {
  8487. int k = anIntArray894[j];
  8488. NPC npc = npcArray[k];
  8489. int l = stream.readUnsignedByte();
  8490. if ((l & 0x10) != 0) {
  8491. int i1 = stream.method434();
  8492. if (i1 == 65535)
  8493. i1 = -1;
  8494. int i2 = stream.readUnsignedByte();
  8495. if (i1 == npc.anim && i1 != -1) {
  8496. int l2 = Animation.anims[i1].anInt365;
  8497. if (l2 == 1) {
  8498. npc.anInt1527 = 0;
  8499. npc.anInt1528 = 0;
  8500. npc.anInt1529 = i2;
  8501. npc.anInt1530 = 0;
  8502. }
  8503. if (l2 == 2)
  8504. npc.anInt1530 = 0;
  8505. } else if (i1 == -1
  8506. || npc.anim == -1
  8507. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  8508. npc.anim = i1;
  8509. npc.anInt1527 = 0;
  8510. npc.anInt1528 = 0;
  8511. npc.anInt1529 = i2;
  8512. npc.anInt1530 = 0;
  8513. npc.anInt1542 = npc.smallXYIndex;
  8514. }
  8515. }
  8516. if ((l & 8) != 0) {
  8517. int j1 = stream.method426();
  8518. int j2 = stream.method427();
  8519. npc.updateHitData(j2, j1, loopCycle);
  8520. npc.loopCycleStatus = loopCycle + 300;
  8521. npc.currentHealth = stream.method426();
  8522. npc.maxHealth = stream.readUnsignedByte();
  8523. }
  8524. if ((l & 0x80) != 0) {
  8525. npc.anInt1520 = stream.readUnsignedWord();
  8526. int k1 = stream.readDWord();
  8527. npc.anInt1524 = k1 >> 16;
  8528. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8529. npc.anInt1521 = 0;
  8530. npc.anInt1522 = 0;
  8531. if (npc.anInt1523 > loopCycle)
  8532. npc.anInt1521 = -1;
  8533. if (npc.anInt1520 == 65535)
  8534. npc.anInt1520 = -1;
  8535. }
  8536. if ((l & 0x20) != 0) {
  8537. npc.interactingEntity = stream.readUnsignedWord();
  8538. if (npc.interactingEntity == 65535)
  8539. npc.interactingEntity = -1;
  8540. }
  8541. if ((l & 1) != 0) {
  8542. npc.textSpoken = stream.readString();
  8543. npc.textCycle = 100;
  8544. }
  8545. if ((l & 0x40) != 0) {
  8546. int l1 = stream.method427();
  8547. int k2 = stream.method428();
  8548. npc.updateHitData(k2, l1, loopCycle);
  8549. npc.loopCycleStatus = loopCycle + 300;
  8550. npc.currentHealth = stream.method428();
  8551. npc.maxHealth = stream.method427();
  8552. }
  8553. if ((l & 2) != 0) {
  8554. npc.desc = EntityDef.forID(stream.method436());
  8555. npc.anInt1540 = npc.desc.aByte68;
  8556. npc.anInt1504 = npc.desc.anInt79;
  8557. npc.anInt1554 = npc.desc.walkAnim;
  8558. npc.anInt1555 = npc.desc.anInt58;
  8559. npc.anInt1556 = npc.desc.anInt83;
  8560. npc.anInt1557 = npc.desc.anInt55;
  8561. npc.anInt1511 = npc.desc.standAnim;
  8562. }
  8563. if ((l & 4) != 0) {
  8564. npc.anInt1538 = stream.method434();
  8565. npc.anInt1539 = stream.method434();
  8566. }
  8567. }
  8568. }
  8569.  
  8570. public void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  8571. if (menuActionRow >= 400)
  8572. return;
  8573. if (entityDef.childrenIDs != null)
  8574. entityDef = entityDef.method161();
  8575. if (entityDef == null)
  8576. return;
  8577. if (!entityDef.aBoolean84)
  8578. return;
  8579. String s = entityDef.name;
  8580. if (entityDef.combatLevel != 0)
  8581. s = s
  8582. + combatDiffColor(myPlayer.combatLevel,
  8583. entityDef.combatLevel) + " (level-"
  8584. + entityDef.combatLevel + ")";
  8585. if (itemSelected == 1) {
  8586. menuActionName[menuActionRow] = "Use " + selectedItemName
  8587. + " with @yel@" + s;
  8588. menuActionID[menuActionRow] = 582;
  8589. menuActionCmd1[menuActionRow] = i;
  8590. menuActionCmd2[menuActionRow] = k;
  8591. menuActionCmd3[menuActionRow] = j;
  8592. menuActionRow++;
  8593. return;
  8594. }
  8595. if (spellSelected == 1) {
  8596. if ((spellUsableOn & 2) == 2) {
  8597. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8598. menuActionID[menuActionRow] = 413;
  8599. menuActionCmd1[menuActionRow] = i;
  8600. menuActionCmd2[menuActionRow] = k;
  8601. menuActionCmd3[menuActionRow] = j;
  8602. menuActionRow++;
  8603. }
  8604. } else {
  8605. if (entityDef.actions != null) {
  8606. for (int l = 4; l >= 0; l--)
  8607. if (entityDef.actions[l] != null
  8608. && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  8609. menuActionName[menuActionRow] = entityDef.actions[l]
  8610. + " @yel@" + s;
  8611. if (l == 0)
  8612. menuActionID[menuActionRow] = 20;
  8613. if (l == 1)
  8614. menuActionID[menuActionRow] = 412;
  8615. if (l == 2)
  8616. menuActionID[menuActionRow] = 225;
  8617. if (l == 3)
  8618. menuActionID[menuActionRow] = 965;
  8619. if (l == 4)
  8620. menuActionID[menuActionRow] = 478;
  8621. menuActionCmd1[menuActionRow] = i;
  8622. menuActionCmd2[menuActionRow] = k;
  8623. menuActionCmd3[menuActionRow] = j;
  8624. menuActionRow++;
  8625. }
  8626.  
  8627. }
  8628. if (entityDef.actions != null) {
  8629. for (int i1 = 4; i1 >= 0; i1--)
  8630. if (entityDef.actions[i1] != null
  8631. && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  8632. char c = '\0';
  8633. if (variousSettings[315] != 0) {
  8634. c = '\u07D0';
  8635. }
  8636. menuActionName[menuActionRow] = entityDef.actions[i1]
  8637. + " @yel@" + s;
  8638. if (i1 == 0)
  8639. menuActionID[menuActionRow] = 20 + c;
  8640. if (i1 == 1)
  8641. menuActionID[menuActionRow] = 412 + c;
  8642. if (i1 == 2)
  8643. menuActionID[menuActionRow] = 225 + c;
  8644. if (i1 == 3)
  8645. menuActionID[menuActionRow] = 965 + c;
  8646. if (i1 == 4)
  8647. menuActionID[menuActionRow] = 478 + c;
  8648. menuActionCmd1[menuActionRow] = i;
  8649. menuActionCmd2[menuActionRow] = k;
  8650. menuActionCmd3[menuActionRow] = j;
  8651. menuActionRow++;
  8652. }
  8653.  
  8654. }
  8655. // menuActionName[menuActionRow] = "Examine @yel@" + s +
  8656. // " @gre@(@whi@" + entityDef.type + "@gre@)";
  8657. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8658. menuActionID[menuActionRow] = 1025;
  8659. menuActionCmd1[menuActionRow] = i;
  8660. menuActionCmd2[menuActionRow] = k;
  8661. menuActionCmd3[menuActionRow] = j;
  8662. menuActionRow++;
  8663. }
  8664. }
  8665.  
  8666. public void buildAtPlayerMenu(int i, int j, Player player, int k) {
  8667. if (player == myPlayer)
  8668. return;
  8669. if (!player.visible)
  8670. return;
  8671. if (menuActionRow >= 400)
  8672. return;
  8673. String s;
  8674. if (player.title.length() < 0)
  8675. s = player.name
  8676. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8677. + " (level: " + player.combatLevel + ")";
  8678. else if (player.title.length() != 0)
  8679. s = "@or1@" + player.title + "@whi@ " + player.name
  8680. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8681. + " (level: " + player.combatLevel + ")";
  8682. else
  8683. s = player.name
  8684. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8685. + " (level: " + player.combatLevel + ")";
  8686. if (itemSelected == 1) {
  8687. menuActionName[menuActionRow] = "Use " + selectedItemName
  8688. + " with @whi@" + s;
  8689. menuActionID[menuActionRow] = 491;
  8690. menuActionCmd1[menuActionRow] = j;
  8691. menuActionCmd2[menuActionRow] = i;
  8692. menuActionCmd3[menuActionRow] = k;
  8693. menuActionRow++;
  8694. } else if (spellSelected == 1) {
  8695. if ((spellUsableOn & 8) == 8) {
  8696. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8697. menuActionID[menuActionRow] = 365;
  8698. menuActionCmd1[menuActionRow] = j;
  8699. menuActionCmd2[menuActionRow] = i;
  8700. menuActionCmd3[menuActionRow] = k;
  8701. menuActionRow++;
  8702. }
  8703. } else {
  8704. for (int l = 5; l >= 0; l--)
  8705. if (atPlayerActions[l] != null) {
  8706. menuActionName[menuActionRow] = atPlayerActions[l]
  8707. + " @whi@" + s;
  8708. char c = '\0';
  8709. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  8710. if (variousSettings[315] != 0) {
  8711. c = '\u07D0';
  8712. }
  8713. if (myPlayer.team != 0 && player.team != 0)
  8714. if (myPlayer.team == player.team)
  8715. c = '\u07D0';
  8716. else
  8717. c = '\0';
  8718. } else if (atPlayerArray[l])
  8719. c = '\u07D0';
  8720. if (l == 0)
  8721. menuActionID[menuActionRow] = 561 + c;
  8722. if (l == 1)
  8723. menuActionID[menuActionRow] = 779 + c;
  8724. if (l == 2)
  8725. menuActionID[menuActionRow] = 27 + c;
  8726. if (l == 3)
  8727. menuActionID[menuActionRow] = 577 + c;
  8728. if (l == 4)
  8729. menuActionID[menuActionRow] = 729 + c;
  8730. if (l == 5) {
  8731. if (myPlayer.getRights() > 0 && myPlayer.getRights() < 4) {
  8732. menuActionID[menuActionRow] = 745 + c;
  8733. } else {
  8734. continue;
  8735. }
  8736. }
  8737. menuActionCmd1[menuActionRow] = j;
  8738. menuActionCmd2[menuActionRow] = i;
  8739. menuActionCmd3[menuActionRow] = k;
  8740. menuActionRow++;
  8741. }
  8742.  
  8743. }
  8744. for (int i1 = 0; i1 < menuActionRow; i1++)
  8745. if (menuActionID[i1] == 516) {
  8746. menuActionName[i1] = "Walk here @whi@" + s;
  8747. return;
  8748. }
  8749.  
  8750. }
  8751.  
  8752. public void method89(Class30_Sub1 class30_sub1) {
  8753. int i = 0;
  8754. int j = -1;
  8755. int k = 0;
  8756. int l = 0;
  8757. if (class30_sub1.anInt1296 == 0)
  8758. i = worldController.method300(class30_sub1.anInt1295,
  8759. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8760. if (class30_sub1.anInt1296 == 1)
  8761. i = worldController.method301(class30_sub1.anInt1295,
  8762. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8763. if (class30_sub1.anInt1296 == 2)
  8764. i = worldController.method302(class30_sub1.anInt1295,
  8765. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8766. if (class30_sub1.anInt1296 == 3)
  8767. i = worldController.method303(class30_sub1.anInt1295,
  8768. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8769. if (i != 0) {
  8770. int i1 = worldController.method304(class30_sub1.anInt1295,
  8771. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8772. j = i >> 14 & 0x7fff;
  8773. k = i1 & 0x1f;
  8774. l = i1 >> 6;
  8775. }
  8776. class30_sub1.anInt1299 = j;
  8777. class30_sub1.anInt1301 = k;
  8778. class30_sub1.anInt1300 = l;
  8779. }
  8780.  
  8781. public void method90() {
  8782. for (int i = 0; i < anInt1062; i++)
  8783. if (anIntArray1250[i] <= 0) {
  8784. boolean flag1 = false;
  8785. try {
  8786. if (anIntArray1207[i] == anInt874
  8787. && anIntArray1241[i] == anInt1289) {
  8788. if (!replayWave())
  8789. flag1 = true;
  8790. } else {
  8791. Stream stream = Sounds.method241(anIntArray1241[i],
  8792. anIntArray1207[i]);
  8793. if (System.currentTimeMillis() + stream.currentOffset
  8794. / 22 > aLong1172 + anInt1257 / 22) {
  8795. anInt1257 = stream.currentOffset;
  8796. aLong1172 = System.currentTimeMillis();
  8797. if (saveWave(stream.buffer, stream.currentOffset)) {
  8798. anInt874 = anIntArray1207[i];
  8799. anInt1289 = anIntArray1241[i];
  8800. } else {
  8801. flag1 = true;
  8802. }
  8803. }
  8804. }
  8805. } catch (Exception exception) {
  8806. }
  8807. if (!flag1 || anIntArray1250[i] == -5) {
  8808. anInt1062--;
  8809. for (int j = i; j < anInt1062; j++) {
  8810. anIntArray1207[j] = anIntArray1207[j + 1];
  8811. anIntArray1241[j] = anIntArray1241[j + 1];
  8812. anIntArray1250[j] = anIntArray1250[j + 1];
  8813. }
  8814.  
  8815. i--;
  8816. } else {
  8817. anIntArray1250[i] = -5;
  8818. }
  8819. } else {
  8820. anIntArray1250[i]--;
  8821. }
  8822.  
  8823. if (prevSong > 0) {
  8824. prevSong -= 20;
  8825. if (prevSong < 0)
  8826. prevSong = 0;
  8827. if (prevSong == 0 && musicEnabled && !lowMem) {
  8828. nextSong = currentSong;
  8829. songChanging = true;
  8830. onDemandFetcher.method558(2, nextSong);
  8831. }
  8832. }
  8833. }
  8834.  
  8835. public void objectFill(final int objectId, final int x1, final int y1,
  8836. final int x2, final int y2, final int type, final int face,
  8837. final int height) {
  8838. // if(height == height) // dunno your height variable but refactor
  8839. // yourself
  8840. for (int x = x1; x <= x2; x++) {
  8841. for (int y = y1; y <= y2; y++) {
  8842. addObject(objectId, x, y, face, type, height);
  8843. }
  8844. }
  8845. }
  8846.  
  8847. public void addObject(int objectId, int x, int y, int face, int type,
  8848. int height) {
  8849. int mX = MapX - 6;
  8850. int mY = MapY - 6;
  8851. int x2 = x - (mX * 8);
  8852. int y2 = y - (mY * 8);
  8853. int i15 = 40 >> 2;
  8854. int l17 = anIntArray1177[i15];
  8855. if (y2 > 0 && y2 < 103 && x2 > 0 && x2 < 103) {
  8856. method130(-1, objectId, face, l17, y2, type, height, x2, 0);
  8857. }
  8858. }
  8859.  
  8860. public void loadNewObjects() {
  8861. /*
  8862. * Lumbridge
  8863. */
  8864. objectFill(-1, 3205, 3209, 3214, 3228, 10, 0, 0); // Lumb
  8865. objectFill(3045, 3207, 3219, 3210, 3219, 10, 0, 0); // Bank
  8866. addObject(1000, 3206, 3218, 0, 2, 0); // Rope
  8867. addObject(1000, 3211, 3218, 1, 2, 0); // Rope
  8868. addObject(2734, 3209, 3224, 1, 22, 0); // Shop Icon
  8869. addObject(2738, 3209, 3220, 1, 22, 0); // Bank Icon
  8870. addObject(-1, 3221, 3210, 1, 10, 0); // Remove
  8871. addObject(-1, 3221, 3226, 1, 10, 0); // Remove
  8872. addObject(2752, 3222, 3211, 1, 22, 0); // Prayer Icon
  8873. addObject(2752, 3222, 3226, 1, 22, 0); // Prayer Icon
  8874. addObject(409, 3221, 3210, 0, 10, 0); // Prayer
  8875. addObject(412, 3221, 3227, 0, 10, 0); // Special
  8876. addObject(6552, 3212, 3223, 1, 10, 0); // Ancient
  8877. }
  8878.  
  8879. public void cachePackAnimations() {
  8880. for (int AnimIndex = 0; AnimIndex <= 5000; AnimIndex++) {
  8881. byte[] abyte0 = getAnimsToPack(AnimIndex);
  8882. if (abyte0 != null && abyte0.length > 0) {
  8883. decompressors[2].method234(abyte0.length, abyte0, AnimIndex);
  8884. System.out.println("Animation File ID: " + AnimIndex
  8885. + " has been added to the cache");
  8886. }
  8887. }
  8888. }
  8889.  
  8890. public byte[] getAnimsToPack(int index) {
  8891. try {
  8892. File model = new File("Animfiles/" + index + ".gz");
  8893. byte[] aByte = new byte[(int) model.length()];
  8894. FileInputStream Fis = new FileInputStream(model);
  8895. Fis.read(aByte);
  8896. Fis.close();
  8897. return aByte;
  8898. } catch (Exception e) {
  8899. return null;
  8900. }
  8901. }
  8902.  
  8903. @Override
  8904. void startUp() {
  8905. drawSmoothLoading(16, "Starting up - This can take a few minutes");
  8906. new CacheDownloader(this).downloadCache();
  8907. if (signlink.sunjava)
  8908. super.minDelay = 5;
  8909. if (aBoolean993) {
  8910. // rsAlreadyLoaded = true;
  8911. // return;
  8912. }
  8913. aBoolean993 = true;
  8914. getDocumentBaseHost();
  8915. if (signlink.cache_dat != null) {
  8916. for (int i = 0; i < 5; i++)
  8917. decompressors[i] = new Decompressor(signlink.cache_dat,
  8918. signlink.cache_idx[i], i + 1);
  8919. }
  8920. try {
  8921. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  8922. expectedCRCs[1], 25);
  8923. smallText = new TextDrawingArea(false, "p11_full",
  8924. titleStreamLoader);
  8925. XPFONT = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8926. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full",
  8927. titleStreamLoader);
  8928. chatTextDrawingArea = new TextDrawingArea(false, "b12_full",
  8929. titleStreamLoader);
  8930. aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full",
  8931. titleStreamLoader);
  8932. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  8933. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  8934. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  8935. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  8936. drawLogo();
  8937. loadTitleScreen();
  8938. StreamLoader streamLoader = streamLoaderForName(2, "config",
  8939. "config", expectedCRCs[2], 30);
  8940. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  8941. "interface", expectedCRCs[3], 35);
  8942. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  8943. "media", expectedCRCs[4], 40);
  8944. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  8945. "textures", expectedCRCs[6], 45);
  8946. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  8947. "wordenc", expectedCRCs[7], 50);
  8948. StreamLoader streamLoader_5 = streamLoaderForName(8,
  8949. "sound effects", "sounds", expectedCRCs[8], 55);
  8950. byteGroundArray = new byte[4][104][104];
  8951. intGroundArray = new int[4][105][105];
  8952. worldController = new WorldController(intGroundArray);
  8953. for (int j = 0; j < 4; j++)
  8954. aClass11Array1230[j] = new Class11();
  8955.  
  8956. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  8957. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  8958. "versionlist", expectedCRCs[5], 60);
  8959. drawSmoothLoading(48, "Connecting to update server");
  8960. onDemandFetcher = new OnDemandFetcher();
  8961. onDemandFetcher.start(streamLoader_6, this);// hold ur thumbs i was
  8962. // gonna say lol oops
  8963.  
  8964. Class36.method528();
  8965.  
  8966. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8967. // preloadModels();
  8968. drawSmoothLoading(112, "Unpacking media");
  8969. Sprite[] clanIcons = new Sprite[9];
  8970. for (int index = 0; index < clanIcons.length; index++) {
  8971. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);
  8972. }
  8973. mapArea = new Sprite("maparea");
  8974. worldMapIcon508 = new Sprite("mapicon508");
  8975. worldMapIcon525 = new Sprite("mapicon525");
  8976. for (int i = 1; i <= ORBS.length - 1; i++) {
  8977. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS " + i + "");
  8978. }
  8979. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8980. chatArea = new Sprite("Gameframe/chatarea");
  8981. tabArea = new Sprite("Gameframe/tabarea");
  8982. globe = new Sprite("globe");
  8983. magicAuto = new Sprite("magicAuto");
  8984. backgroundFix = new Sprite("loginscreen/background");
  8985. logIconH = new Sprite("logiconh");
  8986. logIconC = new Sprite("logiconc");
  8987. logIcon = new Sprite("logicon");
  8988. xpSprite = new Sprite("medal");
  8989. for (int i = 0; i < inputSprites.length; i++)
  8990. inputSprites[i] = new Sprite("Interfaces/Inputfield/SPRITE "
  8991. + (i + 1));
  8992. //repackCacheIndex(1);
  8993. //repackCacheIndex(2);
  8994. //repackCacheIndex(4);
  8995. // cachePackAnimations();
  8996. for (int i = 0; i < 4; i++) {
  8997. counter[i] = new Sprite("Gameframe/XP " + i);
  8998. }
  8999. for (int i = 0; i < 60; i ++) {
  9000. cacheSprite[i] = new Sprite("Sprites/" + i);
  9001. }
  9002. tabArea474 = new Sprite("tabarea474");
  9003. mapArea474 = new Sprite("maparea474");
  9004. mapArea508 = new Sprite("maparea508");
  9005. tabArea508 = new Sprite("tabarea508");
  9006. mapBack = new Background(streamLoader_2, "mapback", 0);
  9007. for (int c1 = 0; c1 <= 3; c1++)
  9008. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  9009. for (int j3 = 0; j3 <= 14; j3++)
  9010. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  9011. for (int r1 = 0; r1 < 5; r1++)
  9012. redStones[r1] = new Sprite("Gameframe/redstones " + r1);
  9013. RSFont.unpackImages(modIcons, clanIcons);
  9014. compass = new Sprite(streamLoader_2, "compass", 0);
  9015. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  9016. mapEdge.method345();
  9017. try {
  9018. for (int k3 = 0; k3 < 100; k3++)
  9019. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  9020. k3);
  9021. } catch (Exception _ex) {
  9022. }
  9023. try {
  9024. for (int l3 = 0; l3 < 100; l3++)
  9025. mapFunctions[l3] = new Sprite(streamLoader_2,
  9026. "mapfunction", l3);
  9027. } catch (Exception _ex) {
  9028. }
  9029. try {
  9030. for (int i4 = 0; i4 < 20; i4++) {
  9031. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  9032. }
  9033. } catch (Exception _ex) {
  9034. }
  9035. try {
  9036. for (int h1 = 0; h1 < 6; h1++)
  9037. headIconsHint[h1] = new Sprite(streamLoader_2,
  9038. "headicons_hint", h1);
  9039. } catch (Exception _ex) {
  9040. }
  9041. try {
  9042. for (int j4 = 0; j4 < 8; j4++)
  9043. headIcons[j4] = new Sprite(streamLoader_2,
  9044. "headicons_prayer", j4);
  9045. for (int j45 = 0; j45 < 3; j45++)
  9046. skullIcons[j45] = new Sprite(streamLoader_2,
  9047. "headicons_pk", j45);
  9048. } catch (Exception _ex) {
  9049. }
  9050. for (int i = 0; i < minimapIcons.length; i++) {
  9051. minimapIcons[i] = new Sprite("Mapicons/ICON " + i);
  9052. }
  9053. for (int i = 0; i < expDrops.length; i++) {
  9054. expDrops[i] = new Sprite("expcounter/" + i);
  9055. }
  9056. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  9057. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  9058. for (int k4 = 0; k4 < 8; k4++)
  9059. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  9060.  
  9061. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  9062. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  9063. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  9064. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  9065. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  9066. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  9067. new Sprite(streamLoader_2, "mapdots", 4);
  9068. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  9069. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  9070. for (int i = 0; i <= 14; i++) {
  9071. modIcons[i] = new Sprite("Player/MODICONS " + i + "");
  9072. }
  9073.  
  9074. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  9075. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9076. getGameComponent());
  9077. sprite.method346(0, 0);
  9078. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  9079. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9080. getGameComponent());
  9081. sprite.method346(0, 0);
  9082. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  9083. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9084. getGameComponent());
  9085. sprite.method346(0, 0);
  9086. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  9087. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9088. getGameComponent());
  9089. sprite.method346(0, 0);
  9090. int i5 = (int) (Math.random() * 21D) - 10;
  9091. int j5 = (int) (Math.random() * 21D) - 10;
  9092. int k5 = (int) (Math.random() * 21D) - 10;
  9093. int l5 = (int) (Math.random() * 41D) - 20;
  9094. for (int i6 = 0; i6 < 100; i6++) {
  9095. if (mapFunctions[i6] != null)
  9096. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  9097. if (mapScenes[i6] != null)
  9098. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  9099. }
  9100.  
  9101. drawSmoothLoading(140, "Unpacking textures");
  9102. Texture.method368(streamLoader_3);
  9103. Texture.method372(0.80000000000000004D);
  9104. Texture.method367();
  9105. drawSmoothLoading(150, "Unpacking config");
  9106. Animation.unpackConfig(streamLoader);
  9107. ObjectDef.unpackConfig(streamLoader);
  9108. Flo.unpackConfig(streamLoader);
  9109. OverlayFlo.unpackConfig(streamLoader);
  9110. ItemDef.unpackConfig(streamLoader);
  9111. EntityDef.unpackConfig(streamLoader);
  9112. IDK.unpackConfig(streamLoader);
  9113. SpotAnim.unpackConfig(streamLoader);
  9114. Varp.unpackConfig(streamLoader);
  9115. VarBit.unpackConfig(streamLoader);
  9116. //dumpModels();
  9117. ItemDef.isMembers = isMembers;
  9118. //EntityDef.dumpSizes();
  9119. /*
  9120. * if (!lowMem) { drawSmoothLoading(150, "Unpacking sounds"); byte
  9121. * abyte0[] = streamLoader_5.getDataForName("sounds.dat"); Stream
  9122. * stream = new Stream(abyte0); Sounds.unpack(stream); }
  9123. */
  9124. drawSmoothLoading(180, "Unpacking interfaces");
  9125. TextDrawingArea allFonts[] = { smallText, aTextDrawingArea_1271,
  9126. chatTextDrawingArea, aTextDrawingArea_1273 };
  9127. RSInterface.unpack(streamLoader_1, allFonts, streamLoader_2);
  9128. drawSmoothLoading(203, "Preparing game engine");
  9129. for (int j6 = 0; j6 < 33; j6++) {
  9130. int k6 = 999;
  9131. int i7 = 0;
  9132. for (int k7 = 0; k7 < 34; k7++) {
  9133. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  9134. if (k6 == 999)
  9135. k6 = k7;
  9136. continue;
  9137. }
  9138. if (k6 == 999)
  9139. continue;
  9140. i7 = k7;
  9141. break;
  9142. }
  9143.  
  9144. anIntArray968[j6] = k6;
  9145. anIntArray1057[j6] = i7 - k6;
  9146. }
  9147.  
  9148. for (int l6 = 5; l6 < 156; l6++) {
  9149. int j7 = 999;
  9150. int l7 = 0;
  9151. for (int j8 = 25; j8 < 172; j8++) {
  9152. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0
  9153. && (j8 > 34 || l6 > 34)) {
  9154. if (j7 == 999)
  9155. j7 = j8;
  9156. continue;
  9157. }
  9158. if (j7 == 999)
  9159. continue;
  9160. l7 = j8;
  9161. break;
  9162. }
  9163.  
  9164. anIntArray1052[l6 - 5] = j7 - 25;
  9165. anIntArray1229[l6 - 5] = l7 - j7;
  9166. }
  9167.  
  9168. Texture.method365(765, 503);
  9169. fullScreenTextureArray = Texture.anIntArray1472;
  9170. Texture.method365(519, 165);
  9171. anIntArray1180 = Texture.anIntArray1472;
  9172. Texture.method365(246, 335);
  9173. anIntArray1181 = Texture.anIntArray1472;
  9174. Texture.method365(512, 334);
  9175. anIntArray1182 = Texture.anIntArray1472;
  9176. int ai[] = new int[9];
  9177. for (int i8 = 0; i8 < 9; i8++) {
  9178. int k8 = 128 + i8 * 32 + 15;
  9179. int l8 = 600 + k8 * 3;
  9180. int i9 = Texture.anIntArray1470[k8];
  9181. ai[i8] = l8 * i9 >> 16;
  9182. }
  9183. try {
  9184. macAddress = new MacAddress(InetAddress.getLocalHost())
  9185. .toString();
  9186. } catch (Exception e) {
  9187. e.printStackTrace();
  9188. }
  9189. WorldController.method310(500, 800, 512, 334, ai);
  9190. Censor.loadConfig(streamLoader_4);
  9191. // dumpModels();
  9192. mouseDetection = new MouseDetection(this);
  9193. startRunnable(mouseDetection, 10);
  9194. Animable_Sub5.clientInstance = this;
  9195. ObjectDef.clientInstance = this;
  9196. EntityDef.clientInstance = this;
  9197. Class36.clientInstance = this;
  9198. return;
  9199. } catch (Exception exception) {
  9200. exception.printStackTrace();
  9201. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  9202. }
  9203. loadingError = true;
  9204. }
  9205.  
  9206. public void method91(Stream stream, int i) {
  9207. while (stream.bitPosition + 10 < i * 8) {
  9208. int j = stream.readBits(11);
  9209. if (j == 2047)
  9210. break;
  9211. if (playerArray[j] == null) {
  9212. playerArray[j] = new Player();
  9213. if (aStreamArray895s[j] != null)
  9214. playerArray[j].updatePlayer(aStreamArray895s[j]);
  9215. }
  9216. playerIndices[playerCount++] = j;
  9217. Player player = playerArray[j];
  9218. player.anInt1537 = loopCycle;
  9219. int k = stream.readBits(1);
  9220. if (k == 1)
  9221. anIntArray894[anInt893++] = j;
  9222. int l = stream.readBits(1);
  9223. int i1 = stream.readBits(5);
  9224. if (i1 > 15)
  9225. i1 -= 32;
  9226. int j1 = stream.readBits(5);
  9227. if (j1 > 15)
  9228. j1 -= 32;
  9229. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  9230. l == 1);
  9231. }
  9232. stream.finishBitAccess();
  9233. }
  9234. public boolean inCircle(int circleX, int circleY, int clickX, int clickY, int radius) {
  9235. return java.lang.Math.pow((circleX + radius - clickX), 2) + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math.pow(radius, 2);
  9236. }
  9237.  
  9238. private void teleport(int x, int z) {
  9239. String text = "::tele " + x + " " + z;
  9240. stream.createFrame(103);
  9241. stream.writeWordBigEndian(text.length() - 1);
  9242. stream.writeString(text.substring(2));
  9243. }
  9244.  
  9245. private void processMainScreenClick() {
  9246. if (revision474 == true) {
  9247. if (anInt1021 != 0)
  9248. return;
  9249. if (super.clickMode3 == 1) {
  9250. int i = super.saveClickX - 25 - 547;
  9251. int j = super.saveClickY - 5 - 3;
  9252. if (inCircle(0, 0, i, j, 72) && !runHover) {
  9253. i -= 73;
  9254. j -= 75;
  9255. int k = viewRotation + minimapRotation & 0x7ff;
  9256. int i1 = Texture.anIntArray1470[k];
  9257. int j1 = Texture.anIntArray1471[k];
  9258. i1 = i1 * (minimapZoom + 256) >> 8;
  9259. j1 = j1 * (minimapZoom + 256) >> 8;
  9260. int k1 = j * i1 + i * j1 >> 11;
  9261. int l1 = j * j1 - i * i1 >> 11;
  9262. int i2 = myPlayer.x + k1 >> 7;
  9263. int j2 = myPlayer.y - l1 >> 7;
  9264. if (myPrivilege == 2 && ctrlPressed) {
  9265. teleport(baseX + i2, baseY + j2);
  9266. } else {
  9267. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0,
  9268. 0, j2, myPlayer.smallX[0], true, i2);
  9269. if (flag1) {
  9270. stream.writeWordBigEndian(i);
  9271. stream.writeWordBigEndian(j);
  9272. stream.writeWord(viewRotation);
  9273. stream.writeWordBigEndian(57);
  9274. stream.writeWordBigEndian(minimapRotation);
  9275. stream.writeWordBigEndian(minimapZoom);
  9276. stream.writeWordBigEndian(89);
  9277. stream.writeWord(myPlayer.x);
  9278. stream.writeWord(myPlayer.y);
  9279. stream.writeWordBigEndian(anInt1264);
  9280. stream.writeWordBigEndian(63);
  9281. }
  9282. }
  9283. }
  9284. anInt1117++;
  9285. if (anInt1117 > 1151) {
  9286. anInt1117 = 0;
  9287. stream.createFrame(246);
  9288. stream.writeWordBigEndian(0);
  9289. int l = stream.currentOffset;
  9290. if ((int) (Math.random() * 2D) == 0)
  9291. stream.writeWordBigEndian(101);
  9292. stream.writeWordBigEndian(197);
  9293. stream.writeWord((int) (Math.random() * 65536D));
  9294. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9295. stream.writeWordBigEndian(67);
  9296. stream.writeWord(14214);
  9297. if ((int) (Math.random() * 2D) == 0)
  9298. stream.writeWord(29487);
  9299. stream.writeWord((int) (Math.random() * 65536D));
  9300. if ((int) (Math.random() * 2D) == 0)
  9301. stream.writeWordBigEndian(220);
  9302. stream.writeWordBigEndian(180);
  9303. stream.writeBytes(stream.currentOffset - l);
  9304. }
  9305. }
  9306. } else if (revision498 == true || revision508 == true) {
  9307. if (anInt1021 != 0)
  9308. return;
  9309. if (super.clickMode3 == 1) {
  9310. if (super.clickMode3 == 1) {
  9311. int i = super.saveClickX - 20 - 545;
  9312. int j = super.saveClickY - 4 - 4;
  9313. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  9314. i -= 73;
  9315. j -= 75;
  9316. int k = viewRotation + minimapRotation & 0x7ff;
  9317. int i1 = Texture.anIntArray1470[k];
  9318. int j1 = Texture.anIntArray1471[k];
  9319. i1 = i1 * (minimapZoom + 256) >> 8;
  9320. j1 = j1 * (minimapZoom + 256) >> 8;
  9321. int k1 = j * i1 + i * j1 >> 11;
  9322. int l1 = j * j1 - i * i1 >> 11;
  9323. int i2 = myPlayer.x + k1 >> 7;
  9324. int j2 = myPlayer.y - l1 >> 7;
  9325. boolean flag1 = doWalkTo(1, 0, 0, 0,
  9326. myPlayer.smallY[0], 0, 0, j2,
  9327. myPlayer.smallX[0], true, i2);
  9328. if (flag1) {
  9329. stream.writeWordBigEndian(i);
  9330. stream.writeWordBigEndian(j);
  9331. stream.writeWord(viewRotation);
  9332. stream.writeWordBigEndian(57);
  9333. stream.writeWordBigEndian(minimapRotation);
  9334. stream.writeWordBigEndian(minimapZoom);
  9335. stream.writeWordBigEndian(89);
  9336. stream.writeWord(myPlayer.x);
  9337. stream.writeWord(myPlayer.y);
  9338. stream.writeWordBigEndian(anInt1264);
  9339. stream.writeWordBigEndian(63);
  9340. }
  9341. }
  9342. }
  9343. anInt1117++;
  9344. if (anInt1117 > 1151) {
  9345. anInt1117 = 0;
  9346. stream.createFrame(246);
  9347. stream.writeWordBigEndian(0);
  9348. int l = stream.currentOffset;
  9349. if ((int) (Math.random() * 2D) == 0)
  9350. stream.writeWordBigEndian(101);
  9351. stream.writeWordBigEndian(197);
  9352. stream.writeWord((int) (Math.random() * 65536D));
  9353. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9354. stream.writeWordBigEndian(67);
  9355. stream.writeWord(14214);
  9356. if ((int) (Math.random() * 2D) == 0)
  9357. stream.writeWord(29487);
  9358. stream.writeWord((int) (Math.random() * 65536D));
  9359. if ((int) (Math.random() * 2D) == 0)
  9360. stream.writeWordBigEndian(220);
  9361. stream.writeWordBigEndian(180);
  9362. stream.writeBytes(stream.currentOffset - l);
  9363. }
  9364. }
  9365. }
  9366. }
  9367.  
  9368. private String interfaceIntToString(int j) {
  9369. if (j < 0x3b9ac9ff)
  9370. return String.valueOf(j);
  9371. else
  9372. return "*";
  9373. }
  9374.  
  9375. public void showErrorScreen() {
  9376. Graphics g = getGameComponent().getGraphics();
  9377. g.setColor(Color.black);
  9378. g.fillRect(0, 0, 765, 503);
  9379. method4(1);
  9380. if (loadingError) {
  9381. aBoolean831 = false;
  9382. g.setFont(new Font("Helvetica", 1, 16));
  9383. g.setColor(Color.yellow);
  9384. int k = 35;
  9385. g.drawString(
  9386. "Sorry, an error has occured whilst loading RuneScape", 30,
  9387. k);
  9388. k += 50;
  9389. g.setColor(Color.white);
  9390. g.drawString("To fix this try the following (in order):", 30, k);
  9391. k += 50;
  9392. g.setColor(Color.white);
  9393. g.setFont(new Font("Helvetica", 1, 12));
  9394. g.drawString(
  9395. "1: Try closing ALL open web-browser windows, and reloading",
  9396. 30, k);
  9397. k += 30;
  9398. g.drawString(
  9399. "2: Try clearing your web-browsers cache from tools->internet options",
  9400. 30, k);
  9401. k += 30;
  9402. g.drawString("3: Try using a different game-world", 30, k);
  9403. k += 30;
  9404. g.drawString("4: Try rebooting your computer", 30, k);
  9405. k += 30;
  9406. g.drawString(
  9407. "5: Try selecting a different version of Java from the play-game menu",
  9408. 30, k);
  9409. }
  9410. if (genericLoadingError) {
  9411. aBoolean831 = false;
  9412. g.setFont(new Font("Helvetica", 1, 20));
  9413. g.setColor(Color.white);
  9414. g.drawString("Error - unable to load game!", 50, 50);
  9415. g.drawString("To play RuneScape make sure you play from", 50, 100);
  9416. g.drawString("http://www.RuneScape.com", 50, 150);
  9417. }
  9418. if (rsAlreadyLoaded) {
  9419. aBoolean831 = false;
  9420. g.setColor(Color.yellow);
  9421. int l = 35;
  9422. g.drawString(
  9423. "Error a copy of RuneScape already appears to be loaded",
  9424. 30, l);
  9425. l += 50;
  9426. g.setColor(Color.white);
  9427. g.drawString("To fix this try the following (in order):", 30, l);
  9428. l += 50;
  9429. g.setColor(Color.white);
  9430. g.setFont(new Font("Helvetica", 1, 12));
  9431. g.drawString(
  9432. "1: Try closing ALL open web-browser windows, and reloading",
  9433. 30, l);
  9434. l += 30;
  9435. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  9436. l += 30;
  9437. }
  9438. }
  9439.  
  9440. @Override
  9441. public URL getCodeBase() {
  9442. try {
  9443. return new URL(server + ":" + (80 + portOff));
  9444. } catch (Exception _ex) {
  9445. }
  9446. return null;
  9447. }
  9448.  
  9449. public void method95() {
  9450. for (int j = 0; j < npcCount; j++) {
  9451. int k = npcIndices[j];
  9452. NPC npc = npcArray[k];
  9453. if (npc != null)
  9454. method96(npc);
  9455. }
  9456. }
  9457.  
  9458. public void method96(Entity entity) {
  9459. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  9460. || entity.y >= 13184) {
  9461. entity.anim = -1;
  9462. entity.anInt1520 = -1;
  9463. entity.anInt1547 = 0;
  9464. entity.anInt1548 = 0;
  9465. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9466. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9467. entity.method446();
  9468. }
  9469. if (entity == myPlayer
  9470. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  9471. entity.anim = -1;
  9472. entity.anInt1520 = -1;
  9473. entity.anInt1547 = 0;
  9474. entity.anInt1548 = 0;
  9475. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9476. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9477. entity.method446();
  9478. }
  9479. if (entity.anInt1547 > loopCycle)
  9480. method97(entity);
  9481. else if (entity.anInt1548 >= loopCycle)
  9482. method98(entity);
  9483. else
  9484. method99(entity);
  9485. method100(entity);
  9486. method101(entity);
  9487. }
  9488.  
  9489. public void method97(Entity entity) {
  9490. int i = entity.anInt1547 - loopCycle;
  9491. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9492. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9493. entity.x += (j - entity.x) / i;
  9494. entity.y += (k - entity.y) / i;
  9495. entity.anInt1503 = 0;
  9496. if (entity.anInt1549 == 0)
  9497. entity.turnDirection = 1024;
  9498. if (entity.anInt1549 == 1)
  9499. entity.turnDirection = 1536;
  9500. if (entity.anInt1549 == 2)
  9501. entity.turnDirection = 0;
  9502. if (entity.anInt1549 == 3)
  9503. entity.turnDirection = 512;
  9504. }
  9505.  
  9506. public void method98(Entity entity) {
  9507. if (entity.anInt1548 == loopCycle
  9508. || entity.anim == -1
  9509. || entity.anInt1529 != 0
  9510. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  9511. .method258(entity.anInt1527)) {
  9512. int i = entity.anInt1548 - entity.anInt1547;
  9513. int j = loopCycle - entity.anInt1547;
  9514. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9515. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9516. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9517. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9518. entity.x = (k * (i - j) + i1 * j) / i;
  9519. entity.y = (l * (i - j) + j1 * j) / i;
  9520. }
  9521. entity.anInt1503 = 0;
  9522. if (entity.anInt1549 == 0)
  9523. entity.turnDirection = 1024;
  9524. if (entity.anInt1549 == 1)
  9525. entity.turnDirection = 1536;
  9526. if (entity.anInt1549 == 2)
  9527. entity.turnDirection = 0;
  9528. if (entity.anInt1549 == 3)
  9529. entity.turnDirection = 512;
  9530. entity.anInt1552 = entity.turnDirection;
  9531. }
  9532.  
  9533. public void method99(Entity entity) {
  9534. entity.anInt1517 = entity.anInt1511;
  9535. if (entity.smallXYIndex == 0) {
  9536. entity.anInt1503 = 0;
  9537. return;
  9538. }
  9539. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9540. Animation animation = Animation.anims[entity.anim];
  9541. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  9542. entity.anInt1503++;
  9543. return;
  9544. }
  9545. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  9546. entity.anInt1503++;
  9547. return;
  9548. }
  9549. }
  9550. int i = entity.x;
  9551. int j = entity.y;
  9552. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9553. * 64;
  9554. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9555. * 64;
  9556. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  9557. entity.x = k;
  9558. entity.y = l;
  9559. return;
  9560. }
  9561. if (i < k) {
  9562. if (j < l)
  9563. entity.turnDirection = 1280;
  9564. else if (j > l)
  9565. entity.turnDirection = 1792;
  9566. else
  9567. entity.turnDirection = 1536;
  9568. } else if (i > k) {
  9569. if (j < l)
  9570. entity.turnDirection = 768;
  9571. else if (j > l)
  9572. entity.turnDirection = 256;
  9573. else
  9574. entity.turnDirection = 512;
  9575. } else if (j < l)
  9576. entity.turnDirection = 1024;
  9577. else
  9578. entity.turnDirection = 0;
  9579. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9580. if (i1 > 1024)
  9581. i1 -= 2048;
  9582. int j1 = entity.anInt1555;
  9583. if (i1 >= -256 && i1 <= 256)
  9584. j1 = entity.anInt1554;
  9585. else if (i1 >= 256 && i1 < 768)
  9586. j1 = entity.anInt1557;
  9587. else if (i1 >= -768 && i1 <= -256)
  9588. j1 = entity.anInt1556;
  9589. if (j1 == -1)
  9590. j1 = entity.anInt1554;
  9591. entity.anInt1517 = j1;
  9592. int k1 = 4;
  9593. if (entity.anInt1552 != entity.turnDirection
  9594. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9595. k1 = 2;
  9596. if (entity.smallXYIndex > 2)
  9597. k1 = 6;
  9598. if (entity.smallXYIndex > 3)
  9599. k1 = 8;
  9600. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  9601. k1 = 8;
  9602. entity.anInt1503--;
  9603. }
  9604. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9605. k1 <<= 1;
  9606. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  9607. && entity.anInt1505 != -1)
  9608. entity.anInt1517 = entity.anInt1505;
  9609. if (i < k) {
  9610. entity.x += k1;
  9611. if (entity.x > k)
  9612. entity.x = k;
  9613. } else if (i > k) {
  9614. entity.x -= k1;
  9615. if (entity.x < k)
  9616. entity.x = k;
  9617. }
  9618. if (j < l) {
  9619. entity.y += k1;
  9620. if (entity.y > l)
  9621. entity.y = l;
  9622. } else if (j > l) {
  9623. entity.y -= k1;
  9624. if (entity.y < l)
  9625. entity.y = l;
  9626. }
  9627. if (entity.x == k && entity.y == l) {
  9628. entity.smallXYIndex--;
  9629. if (entity.anInt1542 > 0)
  9630. entity.anInt1542--;
  9631. }
  9632. }
  9633.  
  9634. public void method100(Entity entity) {
  9635. if (entity.anInt1504 == 0)
  9636. return;
  9637. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  9638. NPC npc = npcArray[entity.interactingEntity];
  9639. if (npc != null) {
  9640. int i1 = entity.x - npc.x;
  9641. int k1 = entity.y - npc.y;
  9642. if (i1 != 0 || k1 != 0)
  9643. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9644. }
  9645. }
  9646. if (entity.interactingEntity >= 32768) {
  9647. int j = entity.interactingEntity - 32768;
  9648. if (j == unknownInt10)
  9649. j = myPlayerIndex;
  9650. Player player = playerArray[j];
  9651. if (player != null) {
  9652. int l1 = entity.x - player.x;
  9653. int i2 = entity.y - player.y;
  9654. if (l1 != 0 || i2 != 0)
  9655. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9656. }
  9657. }
  9658. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  9659. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  9660. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9661. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9662. if (k != 0 || j1 != 0)
  9663. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9664. entity.anInt1538 = 0;
  9665. entity.anInt1539 = 0;
  9666. }
  9667. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9668. if (l != 0) {
  9669. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9670. entity.anInt1552 = entity.turnDirection;
  9671. else if (l > 1024)
  9672. entity.anInt1552 -= entity.anInt1504;
  9673. else
  9674. entity.anInt1552 += entity.anInt1504;
  9675. entity.anInt1552 &= 0x7ff;
  9676. if (entity.anInt1517 == entity.anInt1511
  9677. && entity.anInt1552 != entity.turnDirection) {
  9678. if (entity.anInt1512 != -1) {
  9679. entity.anInt1517 = entity.anInt1512;
  9680. return;
  9681. }
  9682. entity.anInt1517 = entity.anInt1554;
  9683. }
  9684. }
  9685. }
  9686.  
  9687. public void method101(Entity entity) {
  9688. entity.aBoolean1541 = false;
  9689. if (entity.anInt1517 >= 65535)
  9690. entity.anInt1517 = -1;
  9691. if (entity.anInt1517 != -1) {
  9692. Animation animation = Animation.anims[entity.anInt1517];
  9693. entity.anInt1519++;
  9694. if (entity.anInt1518 < animation.anInt352
  9695. && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  9696. entity.anInt1519 = 1;
  9697. entity.anInt1518++;
  9698. }
  9699. if (entity.anInt1518 >= animation.anInt352) {
  9700. entity.anInt1519 = 1;
  9701. entity.anInt1518 = 0;
  9702. }
  9703. }
  9704. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  9705. if (entity.anInt1521 < 0)
  9706. entity.anInt1521 = 0;
  9707. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9708. if (animation_1 == null) {
  9709. return;
  9710. }
  9711. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  9712. && entity.anInt1522 > animation_1
  9713. .method258(entity.anInt1521); entity.anInt1521++)
  9714. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9715.  
  9716. if (entity.anInt1521 >= animation_1.anInt352
  9717. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9718. entity.anInt1520 = -1;
  9719. }
  9720. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  9721. Animation animation_2 = Animation.anims[entity.anim];
  9722. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  9723. && entity.anInt1547 <= loopCycle
  9724. && entity.anInt1548 < loopCycle) {
  9725. entity.anInt1529 = 1;
  9726. return;
  9727. }
  9728. }
  9729. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9730. Animation animation_3 = Animation.anims[entity.anim];
  9731. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  9732. && entity.anInt1528 > animation_3
  9733. .method258(entity.anInt1527); entity.anInt1527++)
  9734. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9735.  
  9736. if (entity.anInt1527 >= animation_3.anInt352) {
  9737. entity.anInt1527 -= animation_3.anInt356;
  9738. entity.anInt1530++;
  9739. if (entity.anInt1530 >= animation_3.anInt362)
  9740. entity.anim = -1;
  9741. if (entity.anInt1527 < 0
  9742. || entity.anInt1527 >= animation_3.anInt352)
  9743. entity.anim = -1;
  9744. }
  9745. entity.aBoolean1541 = animation_3.aBoolean358;
  9746. }
  9747. if (entity.anInt1529 > 0)
  9748. entity.anInt1529--;
  9749. }
  9750.  
  9751. private void drawGameScreen() {
  9752. if (fullscreenInterfaceID != -1
  9753. && (loadingStage == 2 || super.fullGameScreen != null)) {
  9754. if (loadingStage == 2) {
  9755. method119(anInt945, fullscreenInterfaceID);
  9756. if (openInterfaceID != -1) {
  9757. method119(anInt945, openInterfaceID);
  9758. }
  9759. anInt945 = 0;
  9760. resetAllImageProducers();
  9761. super.fullGameScreen.initDrawingArea();
  9762. Texture.anIntArray1472 = fullScreenTextureArray;
  9763. DrawingArea.setAllPixelsToZero();
  9764. welcomeScreenRaised = true;
  9765. if (openInterfaceID != -1) {
  9766. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  9767. if (rsInterface_1.width == 512
  9768. && rsInterface_1.height == 334
  9769. && rsInterface_1.type == 0) {
  9770. rsInterface_1.width = 765;
  9771. rsInterface_1.height = 503;
  9772. }
  9773. drawInterface(0, 0, rsInterface_1, 8);
  9774. }
  9775. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9776. if (rsInterface.width == 512 && rsInterface.height == 334
  9777. && rsInterface.type == 0) {
  9778. rsInterface.width = 765;
  9779. rsInterface.height = 503;
  9780. }
  9781. drawInterface(0, 0, rsInterface, 8);
  9782. if (!menuOpen) {
  9783. processRightClick();
  9784. drawTooltip();
  9785. } else {
  9786. drawMenu();
  9787. }
  9788. }
  9789. drawCount++;
  9790. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9791. return;
  9792. } else {
  9793. if (drawCount != 0) {
  9794. resetImageProducers2();
  9795. }
  9796. }
  9797. if (welcomeScreenRaised) {
  9798. welcomeScreenRaised = false;
  9799. topFrame.drawGraphics(0, super.graphics, 0);
  9800. leftFrame.drawGraphics(4, super.graphics, 0);
  9801. rightFrame.drawGraphics(4, super.graphics, 516);
  9802. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  9803. needDrawTabArea = true;
  9804. inputTaken = true;
  9805. tabAreaAltered = true;
  9806. if (loadingStage != 2) {
  9807. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  9808. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  9809. }
  9810. }
  9811. if (menuOpen && menuScreenArea == 1)
  9812. needDrawTabArea = true;
  9813. if (invOverlayInterfaceID != -1) {
  9814. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9815. if (flag1)
  9816. needDrawTabArea = true;
  9817. }
  9818. if (atInventoryInterfaceType == 2)
  9819. needDrawTabArea = true;
  9820. if (activeInterfaceType == 2)
  9821. needDrawTabArea = true;
  9822. if (needDrawTabArea) {
  9823. drawTabArea();
  9824. needDrawTabArea = false;
  9825. }
  9826. if (backDialogID == -1) {
  9827. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  9828. if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  9829. method65(494, 110, super.mouseX - 0, super.mouseY - 348,
  9830. aClass9_1059, 0, false, anInt1211);
  9831. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  9832. if (i < 0)
  9833. i = 0;
  9834. if (i > anInt1211 - 110)
  9835. i = anInt1211 - 110;
  9836. if (anInt1089 != i) {
  9837. anInt1089 = i;
  9838. inputTaken = true;
  9839. }
  9840. }
  9841. if (backDialogID != -1) {
  9842. boolean flag2 = method119(anInt945, backDialogID);
  9843. if (flag2)
  9844. inputTaken = true;
  9845. }
  9846. if (atInventoryInterfaceType == 3)
  9847. inputTaken = true;
  9848. if (activeInterfaceType == 3)
  9849. inputTaken = true;
  9850. if (aString844 != null)
  9851. inputTaken = true;
  9852. if (menuOpen && menuScreenArea == 2)
  9853. inputTaken = true;
  9854. if (inputTaken) {
  9855. drawChatArea();
  9856. inputTaken = false;
  9857. }
  9858. if (loadingStage == 2)
  9859. method146();
  9860. if (loadingStage == 2) {
  9861. drawMinimap();
  9862. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  9863. }
  9864. if (anInt1054 != -1)
  9865. tabAreaAltered = true;
  9866. if (tabAreaAltered) {
  9867. if (anInt1054 != -1 && anInt1054 == tabID) {
  9868. anInt1054 = -1;
  9869. stream.createFrame(120);
  9870. stream.writeWordBigEndian(tabID);
  9871. }
  9872. tabAreaAltered = false;
  9873. aRSImageProducer_1125.initDrawingArea();
  9874. aRSImageProducer_1165.initDrawingArea();
  9875. }
  9876. anInt945 = 0;
  9877. }
  9878.  
  9879. private boolean buildFriendsListMenu(RSInterface class9) {
  9880. int i = class9.contentType;
  9881. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  9882. if (i >= 801)
  9883. i -= 701;
  9884. else if (i >= 701)
  9885. i -= 601;
  9886. else if (i >= 101)
  9887. i -= 101;
  9888. else
  9889. i--;
  9890. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9891. menuActionID[menuActionRow] = 792;
  9892. menuActionRow++;
  9893. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9894. menuActionID[menuActionRow] = 639;
  9895. menuActionRow++;
  9896. return true;
  9897. }
  9898. if (i >= 401 && i <= 500) {
  9899. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  9900. menuActionID[menuActionRow] = 322;
  9901. menuActionRow++;
  9902. return true;
  9903. } else {
  9904. return false;
  9905. }
  9906. }
  9907.  
  9908. public void method104() {
  9909. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  9910. .reverseGetFirst();
  9911. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  9912. .reverseGetNext())
  9913. if (class30_sub2_sub4_sub3.anInt1560 != plane
  9914. || class30_sub2_sub4_sub3.aBoolean1567)
  9915. class30_sub2_sub4_sub3.unlink();
  9916. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  9917. class30_sub2_sub4_sub3.method454(anInt945);
  9918. if (class30_sub2_sub4_sub3.aBoolean1567)
  9919. class30_sub2_sub4_sub3.unlink();
  9920. else
  9921. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  9922. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  9923. class30_sub2_sub4_sub3.anInt1562, 60,
  9924. class30_sub2_sub4_sub3.anInt1561,
  9925. class30_sub2_sub4_sub3, false);
  9926. }
  9927.  
  9928. }
  9929.  
  9930. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9931. if (class9.type != 0 || class9.children == null)
  9932. return;
  9933. if (class9.isMouseoverTriggered && anInt1026 != class9.id
  9934. && anInt1048 != class9.id && anInt1039 != class9.id)
  9935. return;
  9936. int i1 = DrawingArea.topX;
  9937. int j1 = DrawingArea.topY;
  9938. int k1 = DrawingArea.bottomX;
  9939. int l1 = DrawingArea.bottomY;
  9940. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9941. if (class9.id >= 59570 && class9.id <= 59670) {
  9942. DrawingArea.setDrawingArea(200, 110, 450, 30);
  9943. }
  9944. int i2 = class9.children.length;
  9945. for (int j2 = 0; j2 < i2; j2++) {
  9946. int k2 = class9.childX[j2] + k;
  9947. int l2 = (class9.childY[j2] + l) - j;
  9948. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9949. k2 += class9_1.anInt263;
  9950. l2 += class9_1.anInt265;
  9951. if (class9_1.contentType > 0)
  9952. drawFriendsListOrWelcomeScreen(class9_1);
  9953. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  9954. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  9955. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  9956. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  9957. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  9958. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  9959. 12436, 12446, 12456, 6004, 18471,
  9960. /* Ancients */
  9961. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  9962. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  9963. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  9964. if (class9_1.id != 28060 && class9_1.id != 28061) {
  9965. for (int m5 = 0; m5 < IDs.length; m5++) {
  9966. if (class9_1.id == IDs[m5] + 1) {
  9967. if (m5 > 61) {
  9968. drawBlackBox(k2 + 1, l2);
  9969. } else {
  9970. drawBlackBox(k2, l2 + 1);
  9971. }
  9972. }
  9973. }
  9974. }
  9975. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  9976. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  9977. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  9978. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  9979. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  9980. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  9981. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  9982. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  9983. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  9984. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  9985. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  9986. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  9987. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  9988. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  9989. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  9990. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  9991. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  9992. for (int r = 0; r < runeChildren.length; r++)
  9993. if (class9_1.id == runeChildren[r])
  9994. class9_1.modelZoom = 775;
  9995. if (class9_1.type == 0) {
  9996. if (class9_1.scrollPosition > class9_1.scrollMax
  9997. - class9_1.height)
  9998. class9_1.scrollPosition = class9_1.scrollMax
  9999. - class9_1.height;
  10000. if (class9_1.scrollPosition < 0)
  10001. class9_1.scrollPosition = 0;
  10002. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  10003. if (class9_1.scrollMax > class9_1.height) {
  10004. // clan chat
  10005. if (class9_1.id == 18143) {
  10006. int clanMates = 0;
  10007. for (int i = 18155; i < 18244; i++) {
  10008. RSInterface line = RSInterface.interfaceCache[i];
  10009. if (line.message.length() > 0) {
  10010. clanMates++;
  10011. }
  10012. }
  10013. class9_1.scrollMax = (clanMates * 14) + class9_1.height
  10014. + 1;
  10015. }
  10016. if (class9_1.id == 18322 || class9_1.id == 18423) {
  10017. int members = 0;
  10018. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  10019. RSInterface line = RSInterface.interfaceCache[i];
  10020. if (line != null && line.message != null) {
  10021. if (line.message.length() > 0) {
  10022. members++;
  10023. }
  10024. }
  10025. }
  10026. class9_1.scrollMax = (members * 14) + 1;
  10027. }
  10028. if (class9.parentID == 49000 || class9.parentID == 49100
  10029. || class9.parentID == 51100
  10030. || class9.parentID == 53100) {
  10031. int scrollMax = class9_1.scrollMax;
  10032. if (achievementCutoff > 1)
  10033. scrollMax = achievementCutoff * 65;
  10034. else
  10035. achievementCutoff = 282;
  10036. class9_1.scrollMax = scrollMax;
  10037. }
  10038. if (scrollbarVisible(class9_1)) {
  10039. drawScrollbar(class9_1.height, class9_1.scrollPosition,
  10040. l2, k2 + class9_1.width, class9_1.scrollMax);
  10041. }
  10042. }
  10043. } else if (class9_1.type != 1)
  10044. if (class9_1.type == 2) {
  10045. int i3 = 0;
  10046. for (int l3 = 0; l3 < class9_1.height; l3++) {
  10047. for (int l4 = 0; l4 < class9_1.width; l4++) {
  10048. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  10049. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  10050. if (i3 < 20) {
  10051. k5 += class9_1.spritesX[i3];
  10052. j6 += class9_1.spritesY[i3];
  10053. }
  10054. if (class9_1.inv[i3] > 0) {
  10055. int k6 = 0;
  10056. int j7 = 0;
  10057. int j9 = class9_1.inv[i3] - 1;
  10058. if (k5 > DrawingArea.topX - 32
  10059. && k5 < DrawingArea.bottomX
  10060. && j6 > DrawingArea.topY - 32
  10061. && j6 < DrawingArea.bottomY
  10062. || activeInterfaceType != 0
  10063. && anInt1085 == i3) {
  10064. int l9 = 0;
  10065. if (itemSelected == 1 && anInt1283 == i3
  10066. && anInt1284 == class9_1.id)
  10067. l9 = 0xffffff;
  10068. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  10069. .getSprite(j9,
  10070. class9_1.invStackSizes[i3],
  10071. l9);
  10072. if (class9_1.id >= 32212
  10073. && class9_1.id <= 32212 + 11) {
  10074. if (class9_1.inv[i3] > 0) {
  10075. if (class9_1.sprite2 != null) {
  10076. class9_1.sprite2.drawSprite(k5
  10077. + k6 - 2, j6 + j7 - 2);
  10078. }
  10079. }
  10080. }
  10081. if (class30_sub2_sub1_sub1_2 != null) {
  10082. if (activeInterfaceType != 0
  10083. && anInt1085 == i3
  10084. && anInt1084 == class9_1.id) {
  10085. k6 = super.mouseX - anInt1087;
  10086. j7 = super.mouseY - anInt1088;
  10087. if (k6 < 5 && k6 > -5)
  10088. k6 = 0;
  10089. if (j7 < 5 && j7 > -5)
  10090. j7 = 0;
  10091. if (anInt989 < 10) {
  10092. k6 = 0;
  10093. j7 = 0;
  10094. }
  10095. class30_sub2_sub1_sub1_2
  10096. .drawSprite1(k5 + k6, j6
  10097. + j7);
  10098. if (j6 + j7 < DrawingArea.topY
  10099. && class9.scrollPosition > 0) {
  10100. int i10 = (anInt945 * (DrawingArea.topY
  10101. - j6 - j7)) / 3;
  10102. if (i10 > anInt945 * 10)
  10103. i10 = anInt945 * 10;
  10104. if (i10 > class9.scrollPosition)
  10105. i10 = class9.scrollPosition;
  10106. class9.scrollPosition -= i10;
  10107. anInt1088 += i10;
  10108. }
  10109. if (j6 + j7 + 32 > DrawingArea.bottomY
  10110. && class9.scrollPosition < class9.scrollMax
  10111. - class9.height) {
  10112. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  10113. if (j10 > anInt945 * 10)
  10114. j10 = anInt945 * 10;
  10115. if (j10 > class9.scrollMax
  10116. - class9.height
  10117. - class9.scrollPosition)
  10118. j10 = class9.scrollMax
  10119. - class9.height
  10120. - class9.scrollPosition;
  10121. class9.scrollPosition += j10;
  10122. anInt1088 -= j10;
  10123. }
  10124. } else if (atInventoryInterfaceType != 0
  10125. && atInventoryIndex == i3
  10126. && atInventoryInterface == class9_1.id)
  10127. class30_sub2_sub1_sub1_2
  10128. .drawSprite1(k5, j6);
  10129. else
  10130. class30_sub2_sub1_sub1_2
  10131. .drawSprite(k5, j6);
  10132. if (class9_1.id == RSInterface.selectedItemInterfaceId
  10133. && class9_1.itemSearchSelectedSlot > -1
  10134. && class9_1.itemSearchSelectedSlot == i3) {
  10135. for (int i = 32; i > 0; i--) {
  10136. DrawingArea.method338(j6 + j7,
  10137. i,
  10138. 256 - Byte.MAX_VALUE,
  10139. 0x395D84, i, k5 + k6);
  10140. }
  10141. DrawingArea.method338(j6 + j7, 32,
  10142. 256, 0x395D84, 32, k5 + k6);
  10143. }
  10144. if (class9_1.parentID < 58040
  10145. || class9_1.parentID > 58048) {
  10146. if (class30_sub2_sub1_sub1_2.maxWidth == 33
  10147. || class9_1.invStackSizes[i3] != 1) {
  10148. int k10 = class9_1.invStackSizes[i3];
  10149. if (k10 >= 1)
  10150. smallText.method385(
  10151. 0xFFFF00,
  10152. intToKOrMil(k10),
  10153. j6 + 9 + j7, k5
  10154. + k6);
  10155. smallText.method385(0,
  10156. intToKOrMil(k10), j6
  10157. + 10 + j7, k5
  10158. + 1 + k6);
  10159. if (k10 > 99999
  10160. && k10 < 10000000) {
  10161. smallText.method385(
  10162. 0xFFFFFF,
  10163. intToKOrMil(k10),
  10164. j6 + 9 + j7, k5
  10165. + k6);
  10166. } else if (k10 > 9999999) {
  10167. smallText.method385(
  10168. 0x00ff80,
  10169. intToKOrMil(k10),
  10170. j6 + 9 + j7, k5
  10171. + k6);
  10172. } else {
  10173. smallText.method385(
  10174. 0xFFFF00,
  10175. intToKOrMil(k10),
  10176. j6 + 9 + j7, k5
  10177. + k6);
  10178. }
  10179.  
  10180. /*
  10181. * smallText.method385(0,
  10182. * intToKOrMil(k10), j6 + 10 +
  10183. * j7, k5 + 1 + k6);
  10184. * smallText.method385(0xffff00,
  10185. * intToKOrMil(k10), j6 + 9 +
  10186. * j7, k5 + k6);
  10187. */
  10188. }
  10189. }
  10190. }
  10191. }
  10192. } else if (class9_1.sprites != null && i3 < 20) {
  10193. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  10194. if (class30_sub2_sub1_sub1_1 != null)
  10195. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  10196. }
  10197. i3++;
  10198. }
  10199. }
  10200. } else if (class9_1.type == 3) {
  10201. boolean flag = false;
  10202. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  10203. || anInt1026 == class9_1.id)
  10204. flag = true;
  10205. int j3;
  10206. if (interfaceIsSelected(class9_1)) {
  10207. j3 = class9_1.anInt219;
  10208. if (flag && class9_1.anInt239 != 0)
  10209. j3 = class9_1.anInt239;
  10210. } else {
  10211. j3 = class9_1.textColor;
  10212. if (flag && class9_1.anInt216 != 0)
  10213. j3 = class9_1.anInt216;
  10214. }
  10215. if (class9_1.aByte254 == 0) {
  10216. if (class9_1.aBoolean227)
  10217. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  10218. class9_1.width);
  10219. else
  10220. DrawingArea.fillPixels(k2, class9_1.width,
  10221. class9_1.height, j3, l2);
  10222. } else if (class9_1.aBoolean227)
  10223. DrawingArea.method335(j3, l2, class9_1.width,
  10224. class9_1.height,
  10225. 256 - (class9_1.aByte254 & 0xff), k2);
  10226. else
  10227. DrawingArea.method338(l2, class9_1.height,
  10228. 256 - (class9_1.aByte254 & 0xff), j3,
  10229. class9_1.width, k2);
  10230. } else if (class9_1.type == 4) {
  10231. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  10232. String s = class9_1.message;
  10233. boolean flag1 = false;
  10234. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  10235. || anInt1026 == class9_1.id)
  10236. flag1 = true;
  10237. int i4;
  10238. if (interfaceIsSelected(class9_1)) {
  10239. i4 = class9_1.anInt219;
  10240. if (flag1 && class9_1.anInt239 != 0)
  10241. i4 = class9_1.anInt239;
  10242. if (class9_1.aString228.length() > 0)
  10243. s = class9_1.aString228;
  10244. } else {
  10245. i4 = class9_1.textColor;
  10246. if (flag1 && class9_1.anInt216 != 0)
  10247. i4 = class9_1.anInt216;
  10248. }
  10249. if (class9_1.atActionType == 6 && aBoolean1149) {
  10250. s = "Please wait...";
  10251. i4 = class9_1.textColor;
  10252. }
  10253. if (DrawingArea.width == 519) {
  10254. if (i4 == 0xffff00)
  10255. i4 = 255;
  10256. if (i4 == 49152)
  10257. i4 = 0xffffff;
  10258. }
  10259. if ((class9_1.parentID == 1151)
  10260. || (class9_1.parentID == 12855)) {
  10261. switch (i4) {
  10262. case 16773120:
  10263. i4 = 0xFE981F;
  10264. break;
  10265. case 7040819:
  10266. i4 = 0xAF6A1A;
  10267. break;
  10268. }
  10269. }
  10270. if (class9_1.hoverText != null && !class9_1.hoverText.isEmpty()) {
  10271. if (super.mouseX > k2 && super.mouseX < k2 + class9_1.textDrawingAreas.getTextWidth(class9_1.message)
  10272. && super.mouseY > l2 + 10 && super.mouseY < l2 + 25) {
  10273. s = class9_1.hoverText;
  10274. i4 = class9_1.hoverTextColor;
  10275. }
  10276. }
  10277. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  10278. if (s.indexOf("%") != -1) {
  10279. do {
  10280. int k7 = s.indexOf("%1");
  10281. if (k7 == -1)
  10282. break;
  10283. if (class9_1.id < 4000 || class9_1.id > 5000
  10284. && class9_1.id != 13921
  10285. && class9_1.id != 13922
  10286. && class9_1.id != 12171
  10287. && class9_1.id != 12172)
  10288. s = s.substring(0, k7)
  10289. + methodR(extractInterfaceValues(
  10290. class9_1, 0))
  10291. + s.substring(k7 + 2);
  10292. else
  10293. s = s.substring(0, k7)
  10294. + interfaceIntToString(extractInterfaceValues(
  10295. class9_1, 0))
  10296. + s.substring(k7 + 2);
  10297. } while (true);
  10298. do {
  10299. int l7 = s.indexOf("%2");
  10300. if (l7 == -1)
  10301. break;
  10302. s = s.substring(0, l7)
  10303. + interfaceIntToString(extractInterfaceValues(
  10304. class9_1, 1))
  10305. + s.substring(l7 + 2);
  10306. } while (true);
  10307. do {
  10308. int i8 = s.indexOf("%3");
  10309. if (i8 == -1)
  10310. break;
  10311. s = s.substring(0, i8)
  10312. + interfaceIntToString(extractInterfaceValues(
  10313. class9_1, 2))
  10314. + s.substring(i8 + 2);
  10315. } while (true);
  10316. do {
  10317. int j8 = s.indexOf("%4");
  10318. if (j8 == -1)
  10319. break;
  10320. s = s.substring(0, j8)
  10321. + interfaceIntToString(extractInterfaceValues(
  10322. class9_1, 3))
  10323. + s.substring(j8 + 2);
  10324. } while (true);
  10325. do {
  10326. int k8 = s.indexOf("%5");
  10327. if (k8 == -1)
  10328. break;
  10329. s = s.substring(0, k8)
  10330. + interfaceIntToString(extractInterfaceValues(
  10331. class9_1, 4))
  10332. + s.substring(k8 + 2);
  10333. } while (true);
  10334. }
  10335. int l8 = s.indexOf("\\n");
  10336. String s1;
  10337. if (l8 != -1) {
  10338. s1 = s.substring(0, l8);
  10339. s = s.substring(l8 + 2);
  10340. } else {
  10341. s1 = s;
  10342. s = "";
  10343. }
  10344. RSFont font = null;
  10345. if (textDrawingArea == smallText) {
  10346. font = newSmallFont;
  10347. } else if (textDrawingArea == aTextDrawingArea_1271) {
  10348. font = newRegularFont;
  10349. } else if (textDrawingArea == chatTextDrawingArea) {
  10350. font = newBoldFont;
  10351. } else if (textDrawingArea == aTextDrawingArea_1273) {
  10352. font = newFancyFont;
  10353. }
  10354. if (class9.parentID == 49100
  10355. || class9.parentID == 51100
  10356. || class9.parentID == 53100) {
  10357. int parent = class9.parentID == 49100 ? 49100
  10358. : class9.parentID == 51100 ? 51100 : 53100;
  10359. int subId = (class9_1.id - parent) % 100;
  10360. if (subId > achievementCutoff) {
  10361. continue;
  10362. }
  10363. }
  10364. if (class9_1.centerText) {
  10365. font.drawCenteredString(s1,
  10366. k2 + class9_1.width / 2, l6, i4,
  10367. class9_1.textShadow ? 0 : -1);
  10368. } else {
  10369. font.drawBasicString(s1, k2, l6, i4,
  10370. class9_1.textShadow ? 0 : -1);
  10371. }
  10372. }
  10373. } else if (class9_1.type == 5) {
  10374. Sprite sprite;
  10375. Sprite sprite2 = null;
  10376. if (interfaceIsSelected(class9_1)) {
  10377. sprite = class9_1.sprite2;
  10378. } else {
  10379. sprite = class9_1.sprite1;
  10380. }
  10381. if (class9_1.id >= 58032 && class9_1.id <= 58040) {
  10382. int tabId = 0;
  10383. try {
  10384. tabId = Integer
  10385. .parseInt(RSInterface.interfaceCache[5292].message);
  10386. } catch (NumberFormatException nfe) {
  10387. }
  10388. if (RSInterface.interfaceCache[class9.id + 1] != null
  10389. && !RSInterface.interfaceCache[class9.id + 1].isMouseoverTriggered
  10390. || class9_1.id == 58039
  10391. && interfaceContainsItem(58048))
  10392. sprite = new Sprite("BankTab/TAB 3");
  10393. if (tabId > 0) {
  10394. if (tabId + 58031 == class9_1.id) {
  10395. sprite = new Sprite("BankTab/TAB 2");
  10396. }
  10397. }
  10398. }
  10399. if (class9.parentID == 49100 || class9.parentID == 51100
  10400. || class9.parentID == 53100) {
  10401. int parent = class9.parentID == 49100 ? 49100
  10402. : class9.parentID == 51100 ? 51100 : 53100;
  10403. int subId = (class9_1.id - parent) % 100;
  10404. if (subId > achievementCutoff) {
  10405. continue;
  10406. }
  10407. if (class9_1.id - parent > 600
  10408. && class9_1.id - parent < 700) {
  10409. String message = RSInterface.interfaceCache[class9_1.id + 100].message;
  10410. if (message != null) {
  10411. if (message.split("/").length == 2) {
  10412. int currentValue = Integer.parseInt(message
  10413. .split("/")[0]);
  10414. if (currentValue <= 0) {
  10415. sprite = new Sprite(
  10416. "Interfaces/Achievements/IMAGE 6");
  10417. } else {
  10418. int maxValue = Integer.parseInt(message
  10419. .split("/")[1]);
  10420. double modifier = 2.07;
  10421. double percentage = (((double) currentValue / (double) maxValue) * 100D);
  10422. int width = (int) (percentage * modifier) + 1;
  10423. if (percentage <= 0.0)
  10424. sprite = new Sprite(
  10425. signlink.findcachedir()
  10426. + "Sprites/Interfaces/Achievements/IMAGE 6.png",
  10427. width, 16);
  10428. else if (percentage <= 50.0)
  10429. sprite = new Sprite(
  10430. signlink.findcachedir()
  10431. + "Sprites/Interfaces/Achievements/IMAGE 8.png",
  10432. width, 16);
  10433. else if (percentage <= 75.0)
  10434. sprite = new Sprite(
  10435. signlink.findcachedir()
  10436. + "Sprites/Interfaces/Achievements/IMAGE 9.png",
  10437. width, 16);
  10438. else
  10439. sprite = new Sprite(
  10440. signlink.findcachedir()
  10441. + "Sprites/Interfaces/Achievements/IMAGE 7.png",
  10442. width, 16);
  10443. sprite2 = new Sprite(
  10444. "Interfaces/Achievements/IMAGE 6");
  10445. }
  10446. }
  10447. }
  10448. }
  10449. }
  10450. if (sprite2 != null) {
  10451. sprite2.drawSprite(k2, l2);
  10452. }
  10453. if (spellSelected == 1 && class9_1.id == spellID
  10454. && spellID != 0 && sprite != null) {
  10455. sprite.drawSprite(k2, l2, 0xffffff);
  10456. } else {
  10457. if (sprite != null)
  10458. sprite.drawSprite(k2, l2);
  10459. }
  10460. if (Autocast && class9_1.id == spellID
  10461. && class9_1.id == autocastId) {
  10462. magicAuto.drawSprite(k2 - 3, l2 - 3);
  10463. }
  10464. } else if (class9_1.type == 6) {
  10465. int k3 = Texture.textureInt1;
  10466. int j4 = Texture.textureInt2;
  10467. Texture.textureInt1 = k2 + class9_1.width / 2;
  10468. Texture.textureInt2 = l2 + class9_1.height / 2;
  10469. int i5 = Texture.anIntArray1470[class9_1.modelRotation1]
  10470. * class9_1.modelZoom >> 16;
  10471. int l5 = Texture.anIntArray1471[class9_1.modelRotation1]
  10472. * class9_1.modelZoom >> 16;
  10473. boolean flag2 = interfaceIsSelected(class9_1);
  10474. int i7;
  10475. if (flag2)
  10476. i7 = class9_1.anInt258;
  10477. else
  10478. i7 = class9_1.anInt257;
  10479. Model model;
  10480. if (i7 == -1) {
  10481. model = class9_1.method209(-1, -1, flag2);
  10482. } else {
  10483. Animation animation = Animation.anims[i7];
  10484. model = class9_1.method209(
  10485. animation.anIntArray354[class9_1.anInt246],
  10486. animation.anIntArray353[class9_1.anInt246],
  10487. flag2);
  10488. }
  10489. if (model != null)
  10490. model.method482(class9_1.modelRotation2, 0,
  10491. class9_1.modelRotation1, 0, i5, l5);
  10492. Texture.textureInt1 = k3;
  10493. Texture.textureInt2 = j4;
  10494. } else if (class9_1.type == 7) {
  10495. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  10496. int k4 = 0;
  10497. for (int j5 = 0; j5 < class9_1.height; j5++) {
  10498. for (int i6 = 0; i6 < class9_1.width; i6++) {
  10499. if (class9_1.inv[k4] > 0) {
  10500. ItemDef itemDef = ItemDef
  10501. .forID(class9_1.inv[k4] - 1);
  10502. String s2 = itemDef.name;
  10503. if (itemDef.stackable
  10504. || class9_1.invStackSizes[k4] != 1)
  10505. s2 = s2
  10506. + " x"
  10507. + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  10508. int i9 = k2 + i6
  10509. * (115 + class9_1.invSpritePadX);
  10510. int k9 = l2 + j5
  10511. * (12 + class9_1.invSpritePadY);
  10512. if (class9_1.centerText)
  10513. textDrawingArea_1.method382(
  10514. class9_1.textColor, i9
  10515. + class9_1.width / 2, s2,
  10516. k9, class9_1.textShadow);
  10517. else
  10518. textDrawingArea_1.method389(
  10519. class9_1.textShadow, i9,
  10520. class9_1.textColor, s2, k9);
  10521. }
  10522. k4++;
  10523. }
  10524. }
  10525. }
  10526. if (class9_1.type == 8
  10527. && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id)
  10528. && anInt1501 == 100) {
  10529. int boxWidth = 0;
  10530. int boxHeight = 0;
  10531. TextDrawingArea textDrawingArea_2 = class9_1.textDrawingAreas;
  10532. for (String s1 = class9_1.message; s1.length() > 0;) {
  10533. int l7 = s1.indexOf("\\n");
  10534. String s4;
  10535. if (l7 != -1) {
  10536. s4 = s1.substring(0, l7);
  10537. s1 = s1.substring(l7 + 2);
  10538. } else {
  10539. s4 = s1;
  10540. s1 = "";
  10541. }
  10542. int j10 = textDrawingArea_2.getTextWidth(s4);
  10543. if (j10 > boxWidth) {
  10544. boxWidth = j10;
  10545. }
  10546. boxHeight += textDrawingArea_2.anInt1497 + 1;
  10547. }
  10548. boxWidth += 6;
  10549. boxHeight += 7;
  10550. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  10551. int yPos = l2 + class9_1.height + 5;
  10552. if (xPos < k2 + 5) {
  10553. xPos = k2 + 5;
  10554. }
  10555. if (xPos + boxWidth > k + class9.width) {
  10556. xPos = (k + class9.width) - boxWidth;
  10557. }
  10558. if (yPos + boxHeight > l + class9.height) {
  10559. yPos = (l + class9.height) - boxHeight;
  10560. }
  10561. switch (class9_1.id) {
  10562. case 9217:
  10563. case 9220:
  10564. case 9223:
  10565. case 9226:
  10566. case 9229:
  10567. case 9232:
  10568. case 9235:
  10569. case 9238:
  10570. xPos -= 80;
  10571. break;
  10572. case 9239:
  10573. yPos -= 100;
  10574. break;
  10575. }
  10576. DrawingArea
  10577. .method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  10578. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  10579. String s2 = class9_1.message;
  10580. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2
  10581. .length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {// anInt1497
  10582. int l11 = s2.indexOf("\\n");
  10583. String s5;
  10584. if (l11 != -1) {
  10585. s5 = s2.substring(0, l11);
  10586. s2 = s2.substring(l11 + 2);
  10587. } else {
  10588. s5 = s2;
  10589. s2 = "";
  10590. }
  10591. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  10592. }
  10593. // }
  10594. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10595. } else if (class9_1.type == 12) {
  10596. Sprite sprite;
  10597. if (interfaceIsSelected(class9_1))
  10598. sprite = class9_1.sprite2;
  10599. else
  10600. sprite = class9_1.sprite1;
  10601. if (sprite != null)
  10602. sprite.drawAdvancedSprite(k2, l2);
  10603. } else if (class9_1.type == 9) {
  10604. drawHoverBox(k2, l2, class9_1.message);
  10605. } else if (class9_1.type == 10) {
  10606. Sprite sprite;
  10607. if (interfaceIsSelected(class9_1)) {
  10608. sprite = class9_1.sprite2;
  10609. } else {
  10610. sprite = class9_1.sprite1;
  10611. }
  10612. if (sprite != null) {
  10613. sprite.drawSpriteWithOpacity(k2, l2, class9_1.opacity);
  10614. }
  10615. } else if (class9_1.type == 12 || class9_1.type == 13) {
  10616. Sprite interfaceSprite = null;
  10617. if (interfaceIsSelected(class9_1) || anInt886 == class9_1.id)
  10618. interfaceSprite = class9_1.sprite2;
  10619. else
  10620. interfaceSprite = class9_1.sprite1;
  10621. if (interfaceSprite != null)
  10622. interfaceSprite.drawAdvancedSprite(k2, l2);
  10623. } else if (class9_1.type == 16) {
  10624. drawInputField(class9_1, k, l, k2, l2, class9_1.width,
  10625. class9_1.height);
  10626. } else if(class9_1.type == 17) {
  10627. if (class9.id != 37010) {
  10628. DrawingArea.setDrawingArea(334, 0, 512, 0);
  10629. }
  10630. DrawingArea.drawAlphaBox(k2, l2, class9_1.width, class9_1.height, class9_1.fillColor, class9_1.opacity);
  10631. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  10632. } else if(class9_1.type == 18) {
  10633. DrawingArea.drawRoundedRectangle(k2, l2, class9_1.width, class9_1.height, class9_1.fillColor,
  10634. class9_1.opacity, class9_1.filled, class9_1.textShadow);
  10635. } else if(class9_1.type == 19) {
  10636. if (class9_1.backgroundSprites.length > 1) {
  10637. if (class9_1.sprite1 != null) {
  10638. class9_1.sprite1.drawAdvancedSprite(k2, l2);
  10639. }
  10640. }
  10641. } else if (class9_1.type == 20) {
  10642. DrawingArea.drawAlphaBox(k2, l2, class9_1.width, class9_1.height, 0x403B2B, class9_1.opacity);
  10643. DrawingArea.drawAlphaBox(k2 + 1, l2 + 1, class9_1.width - 2, class9_1.height - 2, 0xABAE83, class9_1.opacity);
  10644. if (class9_1.getMenuItem() != null) {
  10645. Sprite sprite = class9_1.getMenuItem().getSprite();
  10646. int x = 0;
  10647. if (sprite != null) {
  10648. sprite.drawAdvancedSprite(k2 + 4, l2 + sprite.myHeight / 2);
  10649. x = sprite.myWidth;
  10650. }
  10651. class9_1.textDrawingAreas.drawText(0x000000, class9_1.getMenuItem().getText(), l2 + 14, k2 + 23 + x);
  10652. }
  10653. } else if (class9_1.type == 21) {
  10654. RSInterface menu = RSInterface.interfaceCache[class9_1.mOverInterToTrigger];
  10655. if (menu != null && menu.isMenuVisible()) {
  10656. RSMenuItem item = class9_1.getMenuItem();
  10657. if (item != null) {
  10658. DrawingArea.drawAlphaBox(k2, l2, class9_1.width, class9_1.height, 0x403B2B, class9_1.opacity);
  10659. DrawingArea.drawAlphaBox(k2 + 1, l2 + 1, class9_1.width - 2, class9_1.height - 2, 0xABAE83, class9_1.opacity);
  10660. Sprite sprite = class9_1.getMenuItem().getSprite();
  10661. int x = 0;
  10662. if (sprite != null) {
  10663. sprite.drawAdvancedSprite(k2 + 4, l2 + sprite.myHeight / 2);
  10664. x = sprite.myWidth;
  10665. }
  10666. class9_1.textDrawingAreas.drawText(0x000000, class9_1.getMenuItem().getText(), l2 + 14, k2 + 23 + x);
  10667. }
  10668. }
  10669. }
  10670. }
  10671. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10672. }
  10673.  
  10674. public final String methodR(int j) {
  10675. if (j >= 0 && j < 10000)
  10676. return String.valueOf(j);
  10677. if (j >= 10000 && j < 10000000)
  10678. return j / 1000 + "K";
  10679. if (j >= 10000000 && j < 999999999)
  10680. return j / 1000000 + "M";
  10681. if (j >= 999999999)
  10682. return "*";
  10683. else
  10684. return "?";
  10685. }
  10686.  
  10687. public void drawHoverBox(int xPos, int yPos, String text) {
  10688. String[] results = text.split("\n");
  10689. int height = (results.length * 16) + 3;
  10690. int width;
  10691. width = aTextDrawingArea_1271.getTextWidth(results[0]) + 6;
  10692. for (int i = 1; i < results.length; i++)
  10693. if (width <= aTextDrawingArea_1271.getTextWidth(results[i]) + 6)
  10694. width = aTextDrawingArea_1271.getTextWidth(results[i]) + 6;
  10695. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  10696. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  10697. yPos += 14;
  10698. for (int i = 0; i < results.length; i++) {
  10699. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i],
  10700. yPos);
  10701. yPos += 16;
  10702. }
  10703. }
  10704.  
  10705. public void drawBlackBox(int xPos, int yPos) {
  10706. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  10707. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  10708. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  10709. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  10710. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  10711. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  10712. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  10713. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  10714. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  10715. }
  10716.  
  10717. public void randomizeBackground(Background background) {
  10718. int j = 256;
  10719. for (int k = 0; k < anIntArray1190.length; k++)
  10720. anIntArray1190[k] = 0;
  10721.  
  10722. for (int l = 0; l < 5000; l++) {
  10723. int i1 = (int) (Math.random() * 128D * j);
  10724. anIntArray1190[i1] = (int) (Math.random() * 256D);
  10725. }
  10726. for (int j1 = 0; j1 < 20; j1++) {
  10727. for (int k1 = 1; k1 < j - 1; k1++) {
  10728. for (int i2 = 1; i2 < 127; i2++) {
  10729. int k2 = i2 + (k1 << 7);
  10730. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  10731. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10732. }
  10733.  
  10734. }
  10735. int ai[] = anIntArray1190;
  10736. anIntArray1190 = anIntArray1191;
  10737. anIntArray1191 = ai;
  10738. }
  10739. if (background != null) {
  10740. int l1 = 0;
  10741. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  10742. for (int l2 = 0; l2 < background.anInt1452; l2++)
  10743. if (background.aByteArray1450[l1++] != 0) {
  10744. int i3 = l2 + 16 + background.anInt1454;
  10745. int j3 = j2 + 16 + background.anInt1455;
  10746. int k3 = i3 + (j3 << 7);
  10747. anIntArray1190[k3] = 0;
  10748. }
  10749. }
  10750. }
  10751. }
  10752.  
  10753. private void method107(int i, int j, Stream stream, Player player) {
  10754. if ((i & 0x400) != 0) {
  10755. player.anInt1543 = stream.method428();
  10756. player.anInt1545 = stream.method428();
  10757. player.anInt1544 = stream.method428();
  10758. player.anInt1546 = stream.method428();
  10759. player.anInt1547 = stream.method436() + loopCycle;
  10760. player.anInt1548 = stream.method435() + loopCycle;
  10761. player.anInt1549 = stream.method428();
  10762. player.method446();
  10763. }
  10764. if ((i & 0x100) != 0) {
  10765. player.anInt1520 = stream.method434();
  10766. int k = stream.readDWord();
  10767. player.anInt1524 = k >> 16;
  10768. player.anInt1523 = loopCycle + (k & 0xffff);
  10769. player.anInt1521 = 0;
  10770. player.anInt1522 = 0;
  10771. if (player.anInt1523 > loopCycle)
  10772. player.anInt1521 = -1;
  10773. if (player.anInt1520 == 65535)
  10774. player.anInt1520 = -1;
  10775. }
  10776. if ((i & 8) != 0) {
  10777. int l = stream.method434();
  10778. if (l == 65535)
  10779. l = -1;
  10780. int i2 = stream.method427();
  10781. if (l == player.anim && l != -1) {
  10782. int i3 = Animation.anims[l].anInt365;
  10783. if (i3 == 1) {
  10784. player.anInt1527 = 0;
  10785. player.anInt1528 = 0;
  10786. player.anInt1529 = i2;
  10787. player.anInt1530 = 0;
  10788. }
  10789. if (i3 == 2)
  10790. player.anInt1530 = 0;
  10791. } else if (l == -1
  10792. || player.anim == -1
  10793. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  10794. player.anim = l;
  10795. player.anInt1527 = 0;
  10796. player.anInt1528 = 0;
  10797. player.anInt1529 = i2;
  10798. player.anInt1530 = 0;
  10799. player.anInt1542 = player.smallXYIndex;
  10800. }
  10801. }
  10802. if ((i & 4) != 0) {
  10803. player.textSpoken = stream.readString();
  10804. if (player.textSpoken.charAt(0) == '~') {
  10805. player.textSpoken = player.textSpoken.substring(1);
  10806. pushMessage(player.textSpoken, 2, player.name);
  10807. } else if (player == myPlayer)
  10808. pushMessage(player.textSpoken, 2, player.name);
  10809. player.anInt1513 = 0;
  10810. player.anInt1531 = 0;
  10811. player.textCycle = 150;
  10812. }
  10813. if ((i & 0x80) != 0) {
  10814. int i1 = stream.method434();
  10815. int j2 = stream.readUnsignedByte();
  10816. int j3 = stream.method427();
  10817. int k3 = stream.currentOffset;
  10818. if (player.name != null && player.visible) {
  10819. long l3 = TextClass.longForName(player.name);
  10820. boolean flag = false;
  10821. if (j2 <= 1) {
  10822. for (int i4 = 0; i4 < ignoreCount; i4++) {
  10823. if (ignoreListAsLongs[i4] != l3)
  10824. continue;
  10825. flag = true;
  10826. break;
  10827. }
  10828.  
  10829. }
  10830. if (!flag && anInt1251 == 0)
  10831. try {
  10832. aStream_834.currentOffset = 0;
  10833. stream.method442(j3, 0, aStream_834.buffer);
  10834. aStream_834.currentOffset = 0;
  10835. String s = TextInput.method525(j3, aStream_834);
  10836. player.textSpoken = s;
  10837. player.anInt1513 = i1 >> 8;
  10838. player.privilege = j2;
  10839. player.anInt1531 = i1 & 0xff;
  10840. player.textCycle = 150;
  10841. String cr = "";
  10842. if (j2 == 11)
  10843. cr = "@cr11@";
  10844. if (j2 == 10)
  10845. cr = "@cr10@";
  10846. if (j2 == 9)
  10847. cr = "@cr9@";
  10848. if (j2 == 8)
  10849. cr = "@cr8@";
  10850. if (j2 == 7)
  10851. cr = "@cr7@";
  10852. if (j2 == 6)
  10853. cr = "@cr6@";
  10854. if (j2 == 5)
  10855. cr = "@cr5@";
  10856. if (j2 == 4)
  10857. cr = "@cr4@";
  10858. if (j2 == 3)
  10859. cr = "@cr3@";
  10860. if (j2 == 2)
  10861. cr = "@cr2@";
  10862. if (j2 == 1)
  10863. cr = "@cr1@";
  10864. pushMessage(s, 2,
  10865. cr + "<col=" + player.titleColor
  10866. + ">" + player.title + "</col> "
  10867. + player.name);
  10868. } catch (Exception exception) {
  10869. signlink.reporterror("cde2");
  10870. }
  10871. }
  10872. stream.currentOffset = k3 + j3;
  10873. }
  10874. if ((i & 1) != 0) {
  10875. player.interactingEntity = stream.method434();
  10876. if (player.interactingEntity == 65535)
  10877. player.interactingEntity = -1;
  10878. }
  10879. if ((i & 0x10) != 0) {
  10880. int j1 = stream.method427();
  10881. byte abyte0[] = new byte[j1];
  10882. Stream stream_1 = new Stream(abyte0);
  10883. stream.readBytes(j1, 0, abyte0);
  10884. aStreamArray895s[j] = stream_1;
  10885. player.updatePlayer(stream_1);
  10886. }
  10887. if ((i & 2) != 0) {
  10888. player.anInt1538 = stream.method436();
  10889. player.anInt1539 = stream.method434();
  10890. }
  10891. if ((i & 0x20) != 0) {
  10892. int k1 = stream.readUnsignedByte();
  10893. int k2 = stream.method426();
  10894. player.updateHitData(k2, k1, loopCycle);
  10895. player.loopCycleStatus = loopCycle + 300;
  10896. player.currentHealth = stream.method427();
  10897. player.maxHealth = stream.readUnsignedByte();
  10898. }
  10899. if ((i & 0x200) != 0) {
  10900. int l1 = stream.readUnsignedByte();
  10901. int l2 = stream.method428();
  10902. player.updateHitData(l2, l1, loopCycle);
  10903. player.loopCycleStatus = loopCycle + 300;
  10904. player.currentHealth = stream.readUnsignedByte();
  10905. player.maxHealth = stream.method427();
  10906. }
  10907. }
  10908.  
  10909. public void method108() {
  10910. try {
  10911. int j = myPlayer.x + cameraOffsetX;
  10912. int k = myPlayer.y + cameraOffsetY;
  10913. if (anInt1014 - j < -500 || anInt1014 - j > 500
  10914. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  10915. anInt1014 = j;
  10916. anInt1015 = k;
  10917. }
  10918. if (anInt1014 != j)
  10919. anInt1014 += (j - anInt1014) / 16;
  10920. if (anInt1015 != k)
  10921. anInt1015 += (k - anInt1015) / 16;
  10922. if (super.keyArray[1] == 1)
  10923. anInt1186 += (-24 - anInt1186) / 2;
  10924. else if (super.keyArray[2] == 1)
  10925. anInt1186 += (24 - anInt1186) / 2;
  10926. else
  10927. anInt1186 /= 2;
  10928. if (super.keyArray[3] == 1)
  10929. anInt1187 += (12 - anInt1187) / 2;
  10930. else if (super.keyArray[4] == 1)
  10931. anInt1187 += (-12 - anInt1187) / 2;
  10932. else
  10933. anInt1187 /= 2;
  10934. viewRotation = viewRotation + anInt1186 / 2 & 0x7ff;
  10935. anInt1184 += anInt1187 / 2;
  10936. if (anInt1184 < 128)
  10937. anInt1184 = 128;
  10938. if (anInt1184 > 383)
  10939. anInt1184 = 383;
  10940. int l = anInt1014 >> 7;
  10941. int i1 = anInt1015 >> 7;
  10942. int j1 = method42(plane, anInt1015, anInt1014);
  10943. int k1 = 0;
  10944. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  10945. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  10946. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  10947. int l2 = plane;
  10948. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10949. l2++;
  10950. int i3 = j1 - intGroundArray[l2][l1][k2];
  10951. if (i3 > k1)
  10952. k1 = i3;
  10953. }
  10954.  
  10955. }
  10956.  
  10957. }
  10958. anInt1005++;
  10959. if (anInt1005 > 1512) {
  10960. anInt1005 = 0;
  10961. stream.createFrame(77);
  10962. stream.writeWordBigEndian(0);
  10963. int i2 = stream.currentOffset;
  10964. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10965. stream.writeWordBigEndian(101);
  10966. stream.writeWordBigEndian(233);
  10967. stream.writeWord(45092);
  10968. if ((int) (Math.random() * 2D) == 0)
  10969. stream.writeWord(35784);
  10970. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10971. stream.writeWordBigEndian(64);
  10972. stream.writeWordBigEndian(38);
  10973. stream.writeWord((int) (Math.random() * 65536D));
  10974. stream.writeWord((int) (Math.random() * 65536D));
  10975. stream.writeBytes(stream.currentOffset - i2);
  10976. }
  10977. int j2 = k1 * 192;
  10978. if (j2 > 0x17f00)
  10979. j2 = 0x17f00;
  10980. if (j2 < 32768)
  10981. j2 = 32768;
  10982. if (j2 > anInt984) {
  10983. anInt984 += (j2 - anInt984) / 24;
  10984. return;
  10985. }
  10986. if (j2 < anInt984) {
  10987. anInt984 += (j2 - anInt984) / 80;
  10988. }
  10989. } catch (Exception _ex) {
  10990. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  10991. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  10992. + anInt1070 + "," + baseX + "," + baseY);
  10993. throw new RuntimeException("eek");
  10994. }
  10995. }
  10996.  
  10997. @Override
  10998. public void processDrawing() {
  10999. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  11000. showErrorScreen();
  11001. return;
  11002. }
  11003. anInt1061++;
  11004. if (!loggedIn)
  11005. drawLoginScreen(false);
  11006. else
  11007. drawGameScreen();
  11008. anInt1213 = 0;
  11009. }
  11010.  
  11011. private boolean isFriendOrSelf(String s) {
  11012. if (s == null)
  11013. return false;
  11014. for (int i = 0; i < friendsCount; i++)
  11015. if (s.equalsIgnoreCase(friendsList[i]))
  11016. return true;
  11017. return s.equalsIgnoreCase(myPlayer.name);
  11018. }
  11019.  
  11020. private static String combatDiffColor(int i, int j) {
  11021. int k = i - j;
  11022. if (k < -9)
  11023. return "@red@";
  11024. if (k < -6)
  11025. return "@or3@";
  11026. if (k < -3)
  11027. return "@or2@";
  11028. if (k < 0)
  11029. return "@or1@";
  11030. if (k > 9)
  11031. return "@gre@";
  11032. if (k > 6)
  11033. return "@gr3@";
  11034. if (k > 3)
  11035. return "@gr2@";
  11036. if (k > 0)
  11037. return "@gr1@";
  11038. else
  11039. return "@yel@";
  11040. }
  11041.  
  11042. public void setWaveVolume(int i) {
  11043. signlink.wavevol = i;
  11044. }
  11045.  
  11046. private void draw3dScreen() {
  11047. if (counterOn)
  11048. drawCounterOnScreen();
  11049. drawSplitPrivateChat();
  11050. if (crossType == 1) {
  11051. crosses[crossIndex / 100]
  11052. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  11053. anInt1142++;
  11054. if (anInt1142 > 67) {
  11055. anInt1142 = 0;
  11056. stream.createFrame(78);
  11057. }
  11058. }
  11059. if (crossType == 2)
  11060. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  11061. crossY - 8 - 4);
  11062. if (anInt1018 != -1) {
  11063. method119(anInt945, anInt1018);
  11064. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  11065. }
  11066. if (openInterfaceID != -1) {
  11067. method119(anInt945, openInterfaceID);
  11068. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  11069. }
  11070. method70();
  11071.  
  11072. fadingScreen.draw();
  11073.  
  11074. if (!menuOpen) {
  11075. processRightClick();
  11076. drawTooltip();
  11077. } else if (menuScreenArea == 0)
  11078. drawMenu();
  11079. if (anInt1055 == 1)
  11080. multiOverlay.drawSprite(472, 296);
  11081. if (fpsOn) {
  11082. char c = '\u01FB';
  11083. int k = 20;
  11084. int i1 = 0xffff00;
  11085. if (super.fps < 15)
  11086. i1 = 0xff0000;
  11087. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  11088. k += 15;
  11089. Runtime runtime = Runtime.getRuntime();
  11090. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11091. i1 = 0xffff00;
  11092. if (j1 > 0x2000000 && lowMem)
  11093. i1 = 0xff0000;
  11094. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  11095. k += 15;
  11096. }
  11097. int x = baseX + (myPlayer.x - 6 >> 7);
  11098. int y = baseY + (myPlayer.y - 6 >> 7);
  11099. if (clientData) {
  11100. if (super.fps < 15) {
  11101. }
  11102. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285,
  11103. 5);
  11104. Runtime runtime = Runtime.getRuntime();
  11105. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11106. if (j1 > 0x2000000 && lowMem) {
  11107. }
  11108. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299,
  11109. 5);
  11110. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: "
  11111. + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  11112. aTextDrawingArea_1271.method385(0xffff00,
  11113. "Coords: " + x + ", " + y, 329, 5);
  11114. }
  11115. if (broadcastUpdate && anInt1104 != 0) {
  11116. int j = anInt1104 / 100;
  11117. j %= 60;
  11118. if (j > 0) {
  11119. aTextDrawingArea_1271.method385(0xffff00, broadcast, 329, 4);
  11120. } else {
  11121. anInt1104 = 0;
  11122. broadcast = "";
  11123. broadcastUpdate = false;
  11124. }
  11125. }
  11126. if (anInt1104 != 0 && !broadcastUpdate) {
  11127. int j = anInt1104 / 50;
  11128. int l = j / 60;
  11129. j %= 60;
  11130. if (j < 10)
  11131. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  11132. + l + ":0" + j, 329, 4);
  11133. else
  11134. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  11135. + l + ":" + j, 329, 4);
  11136. anInt849++;
  11137. if (anInt849 > 75) {
  11138. anInt849 = 0;
  11139. stream.createFrame(148);
  11140. }
  11141. }
  11142. }
  11143.  
  11144. private void addIgnore(long l) {
  11145. try {
  11146. if (l == 0L)
  11147. return;
  11148. if (ignoreCount >= 100) {
  11149. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  11150. return;
  11151. }
  11152. String s = TextClass.fixName(TextClass.nameForLong(l));
  11153. for (int j = 0; j < ignoreCount; j++)
  11154. if (ignoreListAsLongs[j] == l) {
  11155. pushMessage(s + " is already on your ignore list", 0, "");
  11156. return;
  11157. }
  11158. for (int k = 0; k < friendsCount; k++)
  11159. if (friendsListAsLongs[k] == l) {
  11160. pushMessage("Please remove " + s
  11161. + " from your friend list first", 0, "");
  11162. return;
  11163. }
  11164.  
  11165. ignoreListAsLongs[ignoreCount++] = l;
  11166. needDrawTabArea = true;
  11167. stream.createFrame(133);
  11168. stream.writeQWord(l);
  11169. return;
  11170. } catch (RuntimeException runtimeexception) {
  11171. signlink.reporterror("45688, " + l + ", " + 4 + ", "
  11172. + runtimeexception.toString());
  11173. }
  11174. throw new RuntimeException();
  11175. }
  11176.  
  11177. public void method114() {
  11178. for (int i = -1; i < playerCount; i++) {
  11179. int j;
  11180. if (i == -1)
  11181. j = myPlayerIndex;
  11182. else
  11183. j = playerIndices[i];
  11184. Player player = playerArray[j];
  11185. if (player != null)
  11186. method96(player);
  11187. }
  11188.  
  11189. }
  11190.  
  11191. public void method115() {
  11192. if (loadingStage == 2) {
  11193. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  11194. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  11195. .reverseGetNext()) {
  11196. if (class30_sub1.anInt1294 > 0)
  11197. class30_sub1.anInt1294--;
  11198. if (class30_sub1.anInt1294 == 0) {
  11199. if (class30_sub1.anInt1299 < 0
  11200. || ObjectManager.method178(class30_sub1.anInt1299,
  11201. class30_sub1.anInt1301)) {
  11202. method142(class30_sub1.anInt1298,
  11203. class30_sub1.anInt1295, class30_sub1.anInt1300,
  11204. class30_sub1.anInt1301, class30_sub1.anInt1297,
  11205. class30_sub1.anInt1296, class30_sub1.anInt1299);
  11206. class30_sub1.unlink();
  11207. }
  11208. } else {
  11209. if (class30_sub1.anInt1302 > 0)
  11210. class30_sub1.anInt1302--;
  11211. if (class30_sub1.anInt1302 == 0
  11212. && class30_sub1.anInt1297 >= 1
  11213. && class30_sub1.anInt1298 >= 1
  11214. && class30_sub1.anInt1297 <= 102
  11215. && class30_sub1.anInt1298 <= 102
  11216. && (class30_sub1.anInt1291 < 0 || ObjectManager
  11217. .method178(class30_sub1.anInt1291,
  11218. class30_sub1.anInt1293))) {
  11219. method142(class30_sub1.anInt1298,
  11220. class30_sub1.anInt1295, class30_sub1.anInt1292,
  11221. class30_sub1.anInt1293, class30_sub1.anInt1297,
  11222. class30_sub1.anInt1296, class30_sub1.anInt1291);
  11223. class30_sub1.anInt1302 = -1;
  11224. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  11225. && class30_sub1.anInt1299 == -1)
  11226. class30_sub1.unlink();
  11227. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  11228. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  11229. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  11230. class30_sub1.unlink();
  11231. }
  11232. }
  11233. }
  11234.  
  11235. }
  11236. }
  11237.  
  11238. public void determineMenuSize() {
  11239. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  11240. for (int j = 0; j < menuActionRow; j++) {
  11241. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  11242. if (k > i)
  11243. i = k;
  11244. }
  11245.  
  11246. i += 8;
  11247. int l = 15 * menuActionRow + 21;
  11248. if (super.saveClickX > 4 && super.saveClickY > 4
  11249. && super.saveClickX < 516 && super.saveClickY < 338) {
  11250. int i1 = super.saveClickX - 4 - i / 2;
  11251. if (i1 + i > 512)
  11252. i1 = 512 - i;
  11253. if (i1 < 0)
  11254. i1 = 0;
  11255. int l1 = super.saveClickY - 4;
  11256. if (l1 + l > 334)
  11257. l1 = 334 - l;
  11258. if (l1 < 0)
  11259. l1 = 0;
  11260. menuOpen = true;
  11261. menuScreenArea = 0;
  11262. menuOffsetX = i1;
  11263. menuOffsetY = l1;
  11264. menuWidth = i;
  11265. menuHeight = 15 * menuActionRow + 22;
  11266. }
  11267. if (super.saveClickX > 519 && super.saveClickY > 168
  11268. && super.saveClickX < 765 && super.saveClickY < 503) {
  11269. int j1 = super.saveClickX - 519 - i / 2;
  11270. if (j1 < 0)
  11271. j1 = 0;
  11272. else if (j1 + i > 245)
  11273. j1 = 245 - i;
  11274. int i2 = super.saveClickY - 168;
  11275. if (i2 < 0)
  11276. i2 = 0;
  11277. else if (i2 + l > 333)
  11278. i2 = 333 - l;
  11279. menuOpen = true;
  11280. menuScreenArea = 1;
  11281. menuOffsetX = j1;
  11282. menuOffsetY = i2;
  11283. menuWidth = i;
  11284. menuHeight = 15 * menuActionRow + 22;
  11285. }
  11286. if (super.saveClickX > 0 && super.saveClickY > 338
  11287. && super.saveClickX < 516 && super.saveClickY < 503) {
  11288. int k1 = super.saveClickX - 0 - i / 2;
  11289. if (k1 < 0)
  11290. k1 = 0;
  11291. else if (k1 + i > 516)
  11292. k1 = 516 - i;
  11293. int j2 = super.saveClickY - 338;
  11294. if (j2 < 0)
  11295. j2 = 0;
  11296. else if (j2 + l > 165)
  11297. j2 = 165 - l;
  11298. menuOpen = true;
  11299. menuScreenArea = 2;
  11300. menuOffsetX = k1;
  11301. menuOffsetY = j2;
  11302. menuWidth = i;
  11303. menuHeight = 15 * menuActionRow + 22;
  11304. }
  11305. }
  11306.  
  11307. public void method117(Stream stream) {
  11308. stream.initBitAccess();
  11309. int j = stream.readBits(1);
  11310. if (j == 0)
  11311. return;
  11312. int k = stream.readBits(2);
  11313. if (k == 0) {
  11314. anIntArray894[anInt893++] = myPlayerIndex;
  11315. return;
  11316. }
  11317. if (k == 1) {
  11318. int l = stream.readBits(3);
  11319. myPlayer.moveInDir(false, l);
  11320. int k1 = stream.readBits(1);
  11321. if (k1 == 1)
  11322. anIntArray894[anInt893++] = myPlayerIndex;
  11323. return;
  11324. }
  11325. if (k == 2) {
  11326. int i1 = stream.readBits(3);
  11327. myPlayer.moveInDir(true, i1);
  11328. int l1 = stream.readBits(3);
  11329. myPlayer.moveInDir(true, l1);
  11330. int j2 = stream.readBits(1);
  11331. if (j2 == 1)
  11332. anIntArray894[anInt893++] = myPlayerIndex;
  11333. return;
  11334. }
  11335. if (k == 3) {
  11336. plane = stream.readBits(2);
  11337. int j1 = stream.readBits(1);
  11338. int i2 = stream.readBits(1);
  11339. if (i2 == 1)
  11340. anIntArray894[anInt893++] = myPlayerIndex;
  11341. int k2 = stream.readBits(7);
  11342. int l2 = stream.readBits(7);
  11343. myPlayer.setPos(l2, k2, j1 == 1);
  11344. }
  11345. }
  11346.  
  11347. public void nullLoader() {
  11348. aBoolean831 = false;
  11349. while (drawingFlames) {
  11350. aBoolean831 = false;
  11351. try {
  11352. Thread.sleep(50L);
  11353. } catch (Exception _ex) {
  11354. }
  11355. }
  11356. aBackground_966 = null;
  11357. aBackground_967 = null;
  11358. aBackgroundArray1152s = null;
  11359. anIntArray850 = null;
  11360. anIntArray851 = null;
  11361. anIntArray852 = null;
  11362. anIntArray853 = null;
  11363. anIntArray1190 = null;
  11364. anIntArray1191 = null;
  11365. anIntArray828 = null;
  11366. anIntArray829 = null;
  11367. aClass30_Sub2_Sub1_Sub1_1201 = null;
  11368. aClass30_Sub2_Sub1_Sub1_1202 = null;
  11369. }
  11370.  
  11371. private boolean method119(int i, int j) {
  11372. boolean flag1 = false;
  11373. RSInterface class9 = RSInterface.interfaceCache[j];
  11374. for (int k = 0; k < class9.children.length; k++) {
  11375. if (class9.children[k] == -1)
  11376. break;
  11377. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  11378. if (class9_1.type == 1)
  11379. flag1 |= method119(i, class9_1.id);
  11380. if (class9_1.type == 6
  11381. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  11382. boolean flag2 = interfaceIsSelected(class9_1);
  11383. int l;
  11384. if (flag2)
  11385. l = class9_1.anInt258;
  11386. else
  11387. l = class9_1.anInt257;
  11388. if (l != -1) {
  11389. Animation animation = Animation.anims[l];
  11390. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  11391. .method258(class9_1.anInt246);) {
  11392. class9_1.anInt208 -= animation
  11393. .method258(class9_1.anInt246) + 1;
  11394. class9_1.anInt246++;
  11395. if (class9_1.anInt246 >= animation.anInt352) {
  11396. class9_1.anInt246 -= animation.anInt356;
  11397. if (class9_1.anInt246 < 0
  11398. || class9_1.anInt246 >= animation.anInt352)
  11399. class9_1.anInt246 = 0;
  11400. }
  11401. flag1 = true;
  11402. }
  11403.  
  11404. }
  11405. }
  11406. }
  11407.  
  11408. return flag1;
  11409. }
  11410.  
  11411. private int method120() {
  11412. if (variousSettings[307] == 1) {
  11413. return plane;
  11414. }
  11415. int j = 3;
  11416. if (yCameraCurve < 310) {
  11417. int k = xCameraPos >> 7;
  11418. int l = yCameraPos >> 7;
  11419. int i1 = myPlayer.x >> 7;
  11420. int j1 = myPlayer.y >> 7;
  11421. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11422. j = plane;
  11423. int k1;
  11424. if (i1 > k)
  11425. k1 = i1 - k;
  11426. else
  11427. k1 = k - i1;
  11428. int l1;
  11429. if (j1 > l)
  11430. l1 = j1 - l;
  11431. else
  11432. l1 = l - j1;
  11433. if (k1 > l1) {
  11434. int i2 = (l1 * 0x10000) / k1;
  11435. int k2 = 32768;
  11436. while (k != i1) {
  11437. if (k < i1)
  11438. k++;
  11439. else if (k > i1)
  11440. k--;
  11441. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11442. j = plane;
  11443. k2 += i2;
  11444. if (k2 >= 0x10000) {
  11445. k2 -= 0x10000;
  11446. if (l < j1)
  11447. l++;
  11448. else if (l > j1)
  11449. l--;
  11450. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11451. j = plane;
  11452. }
  11453. }
  11454. } else {
  11455. int j2 = (k1 * 0x10000) / l1;
  11456. int l2 = 32768;
  11457. while (l != j1) {
  11458. if (l < j1)
  11459. l++;
  11460. else if (l > j1)
  11461. l--;
  11462. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11463. j = plane;
  11464. l2 += j2;
  11465. if (l2 >= 0x10000) {
  11466. l2 -= 0x10000;
  11467. if (k < i1)
  11468. k++;
  11469. else if (k > i1)
  11470. k--;
  11471. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11472. j = plane;
  11473. }
  11474. }
  11475. }
  11476. }
  11477. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  11478. j = plane;
  11479. return j;
  11480. }
  11481.  
  11482. private int method121() {
  11483. if (variousSettings[307] == 1) {
  11484. return plane;
  11485. }
  11486. int j = method42(plane, yCameraPos, xCameraPos);
  11487. if (j - zCameraPos < 800
  11488. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  11489. return plane;
  11490. else
  11491. return 3;
  11492. }
  11493.  
  11494. private void delIgnore(long l) {
  11495. try {
  11496. if (l == 0L)
  11497. return;
  11498. for (int j = 0; j < ignoreCount; j++)
  11499. if (ignoreListAsLongs[j] == l) {
  11500. ignoreCount--;
  11501. needDrawTabArea = true;
  11502. System.arraycopy(ignoreListAsLongs, j + 1,
  11503. ignoreListAsLongs, j, ignoreCount - j);
  11504.  
  11505. stream.createFrame(74);
  11506. stream.writeQWord(l);
  11507. return;
  11508. }
  11509.  
  11510. return;
  11511. } catch (RuntimeException runtimeexception) {
  11512. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  11513. + runtimeexception.toString());
  11514. }
  11515. throw new RuntimeException();
  11516. }
  11517.  
  11518. @SuppressWarnings("unused")
  11519. private void chatJoin(long l) {
  11520. try {
  11521. if (l == 0L)
  11522. return;
  11523. stream.createFrame(60);
  11524. stream.writeQWord(l);
  11525. return;
  11526. } catch (RuntimeException runtimeexception) {
  11527. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  11528. + runtimeexception.toString());
  11529. }
  11530. throw new RuntimeException();
  11531.  
  11532. }
  11533.  
  11534. @Override
  11535. public String getParameter(String s) {
  11536. if (signlink.mainapp != null)
  11537. return signlink.mainapp.getParameter(s);
  11538. else
  11539. return super.getParameter(s);
  11540. }
  11541.  
  11542. public void adjustVolume(boolean flag, int i) {
  11543. signlink.midivol = i;
  11544. if (flag)
  11545. signlink.midi = "voladjust";
  11546. }
  11547.  
  11548. private int extractInterfaceValues(RSInterface class9, int j) {
  11549. if (class9.valueIndexArray == null
  11550. || j >= class9.valueIndexArray.length)
  11551. return -2;
  11552. try {
  11553. int ai[] = class9.valueIndexArray[j];
  11554. int k = 0;
  11555. int l = 0;
  11556. int i1 = 0;
  11557. do {
  11558. int j1 = ai[l++];
  11559. int k1 = 0;
  11560. byte byte0 = 0;
  11561. if (j1 == 0)
  11562. return k;
  11563. if (j1 == 1)
  11564. k1 = currentStats[ai[l++]];
  11565. if (j1 == 2)
  11566. k1 = maxStats[ai[l++]];
  11567. if (j1 == 3)
  11568. k1 = currentExp[ai[l++]];
  11569. if (j1 == 4) {
  11570. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  11571. int k2 = ai[l++];
  11572. if (k2 >= 0 && k2 < ItemDef.totalItems
  11573. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  11574. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  11575. if (class9_1.inv[j3] == k2 + 1)
  11576. k1 += class9_1.invStackSizes[j3];
  11577.  
  11578. }
  11579. }
  11580. if (j1 == 5)
  11581. k1 = variousSettings[ai[l++]];
  11582. if (j1 == 6)
  11583. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  11584. if (j1 == 7)
  11585. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11586. if (j1 == 8)
  11587. k1 = myPlayer.combatLevel;
  11588. if (j1 == 9) {
  11589. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  11590. if (Skills.skillEnabled[l1])
  11591. k1 += maxStats[l1];
  11592.  
  11593. }
  11594. if (j1 == 10) {
  11595. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11596. int l2 = ai[l++] + 1;
  11597. if (l2 >= 0 && l2 < ItemDef.totalItems
  11598. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  11599. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  11600. if (class9_2.inv[k3] != l2)
  11601. continue;
  11602. k1 = 0x3b9ac9ff;
  11603. break;
  11604. }
  11605.  
  11606. }
  11607. }
  11608. if (j1 == 11)
  11609. k1 = energy;
  11610. if (j1 == 12)
  11611. k1 = weight;
  11612. if (j1 == 13) {
  11613. int i2 = variousSettings[ai[l++]];
  11614. int i3 = ai[l++];
  11615. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11616. }
  11617. if (j1 == 14) {
  11618. int j2 = ai[l++];
  11619. VarBit varBit = VarBit.cache[j2];
  11620. int l3 = varBit.anInt648;
  11621. int i4 = varBit.anInt649;
  11622. int j4 = varBit.anInt650;
  11623. int k4 = anIntArray1232[j4 - i4];
  11624. k1 = variousSettings[l3] >> i4 & k4;
  11625. }
  11626. if (j1 == 15)
  11627. byte0 = 1;
  11628. if (j1 == 16)
  11629. byte0 = 2;
  11630. if (j1 == 17)
  11631. byte0 = 3;
  11632. if (j1 == 18)
  11633. k1 = (myPlayer.x >> 7) + baseX;
  11634. if (j1 == 19)
  11635. k1 = (myPlayer.y >> 7) + baseY;
  11636. if (j1 == 20)
  11637. k1 = ai[l++];
  11638. if (byte0 == 0) {
  11639. if (i1 == 0)
  11640. k += k1;
  11641. if (i1 == 1)
  11642. k -= k1;
  11643. if (i1 == 2 && k1 != 0)
  11644. k /= k1;
  11645. if (i1 == 3)
  11646. k *= k1;
  11647. i1 = 0;
  11648. } else {
  11649. i1 = byte0;
  11650. }
  11651. } while (true);
  11652. } catch (Exception _ex) {
  11653. return -1;
  11654. }
  11655. }
  11656.  
  11657. public void drawTooltip() {
  11658. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11659. return;
  11660. String s;
  11661. if (itemSelected == 1 && menuActionRow < 2)
  11662. s = "Use " + selectedItemName + " with...";
  11663. else if (spellSelected == 1 && menuActionRow < 2)
  11664. s = spellTooltip + "...";
  11665. else
  11666. s = menuActionName[menuActionRow - 1];
  11667. if (menuActionRow > 2)
  11668. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11669. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11670. }
  11671.  
  11672. private void drawMinimap() {
  11673. if (revision474 == true) {
  11674. aRSImageProducer_1164.initDrawingArea();
  11675. if (anInt1021 == 2) {
  11676. byte abyte0[] = mapBack.aByteArray1450;
  11677. int ai[] = DrawingArea.pixels;
  11678. int k2 = abyte0.length;
  11679. for (int i5 = 0; i5 < k2; i5++)
  11680. if (abyte0[i5] == 0)
  11681. ai[i5] = 0;
  11682. compass.method352(33, viewRotation, anIntArray1057, 256,
  11683. anIntArray968, 25, 0, 0, 33, 25);
  11684. aRSImageProducer_1165.initDrawingArea();
  11685. return;
  11686. }
  11687. int i = viewRotation + minimapRotation & 0x7ff;
  11688. int j = 48 + myPlayer.x / 32;
  11689. int l2 = 464 - myPlayer.y / 32;
  11690. for (int x = 0; x < anIntArray1229.length; x++) {
  11691. anIntArray1229[x] = 170;
  11692. anIntArray1052[x] = -23;
  11693. }
  11694. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  11695. 256 + minimapZoom, anIntArray1052, l2, 9, 54, 146, j);
  11696. compass.method352(33, viewRotation, anIntArray1057, 256,
  11697. anIntArray968, 25, 4, 26, 33, 25);
  11698. for (int j5 = 0; j5 < anInt1071; j5++) {
  11699. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11700. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11701. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  11702. }
  11703. for (int k5 = 0; k5 < 104; k5++) {
  11704. for (int l5 = 0; l5 < 104; l5++) {
  11705. NodeList class19 = groundArray[plane][k5][l5];
  11706. if (class19 != null) {
  11707. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11708. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11709. markMinimap(mapDotItem, l, j3);
  11710. }
  11711. }
  11712. }
  11713.  
  11714. for (int i6 = 0; i6 < npcCount; i6++) {
  11715. NPC npc = npcArray[npcIndices[i6]];
  11716. if (npc != null && npc.isVisible()) {
  11717. EntityDef entityDef = npc.desc;
  11718. if (entityDef.childrenIDs != null)
  11719. entityDef = entityDef.method161();
  11720. if (entityDef != null && entityDef.aBoolean87
  11721. && entityDef.aBoolean84) {
  11722. int i1 = npc.x / 32 - myPlayer.x / 32;
  11723. int k3 = npc.y / 32 - myPlayer.y / 32;
  11724. markMinimap(mapDotNPC, i1, k3);
  11725. }
  11726. }
  11727. }
  11728. for (int j6 = 0; j6 < playerCount; j6++) {
  11729. Player player = playerArray[playerIndices[j6]];
  11730. if (player != null && player.isVisible()) {
  11731. int j1 = player.x / 32 - myPlayer.x / 32;
  11732. int l3 = player.y / 32 - myPlayer.y / 32;
  11733. boolean flag1 = false;
  11734. boolean flag3 = false;
  11735. String clanname;
  11736. for (int j3 = 0; j3 < clanList.length; j3++) {
  11737. if (clanList[j3] == null)
  11738. continue;
  11739. clanname = clanList[j3];
  11740. if (clanname.startsWith("<clan"))
  11741. clanname = clanname.substring(
  11742. clanname.indexOf(">") + 1,
  11743. clanname.length());
  11744. if (!clanname.equalsIgnoreCase(player.name))
  11745. continue;
  11746. flag3 = true;
  11747. break;
  11748. }
  11749. long l6 = TextClass.longForName(player.name);
  11750. for (int k6 = 0; k6 < friendsCount; k6++) {
  11751. if (l6 != friendsListAsLongs[k6]
  11752. || friendsNodeIDs[k6] == 0)
  11753. continue;
  11754. flag1 = true;
  11755. break;
  11756. }
  11757. boolean flag2 = false;
  11758. if (myPlayer.team != 0 && player.team != 0
  11759. && myPlayer.team == player.team)
  11760. flag2 = true;
  11761. if (flag1)
  11762. markMinimap(mapDotFriend, j1, l3);
  11763. else if (flag3)
  11764. markMinimap(mapDotClan, j1, l3);
  11765. else if (flag2)
  11766. markMinimap(mapDotTeam, j1, l3);
  11767. else
  11768. markMinimap(mapDotPlayer, j1, l3);
  11769. }
  11770. }
  11771. if (anInt855 != 0 && loopCycle % 20 < 10) {
  11772. if (anInt855 == 1 && anInt1222 >= 0
  11773. && anInt1222 < npcArray.length) {
  11774. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11775. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  11776. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32
  11777. - myPlayer.x / 32;
  11778. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32
  11779. - myPlayer.y / 32;
  11780. method81(mapMarker, i4, k1);
  11781. }
  11782. }
  11783. if (anInt855 == 2) {
  11784. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11785. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11786. method81(mapMarker, j4, l1);
  11787. }
  11788. if (anInt855 == 10 && anInt933 >= 0
  11789. && anInt933 < playerArray.length) {
  11790. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11791. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  11792. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32
  11793. - myPlayer.x / 32;
  11794. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32
  11795. - myPlayer.y / 32;
  11796. method81(mapMarker, k4, i2);
  11797. }
  11798. }
  11799. }
  11800. if (destX != 0) {
  11801. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11802. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11803. markMinimap(mapFlag, j2, l4);
  11804. }
  11805. if (Configuration.isEvent()) {
  11806. markMinimap(mapFunctions[72], ((Configuration.eventX - baseX) * 4 + 2) - myPlayer.x
  11807. / 32, ((Configuration.eventY - baseY) * 4 + 2) - myPlayer.y / 32);
  11808. }
  11809. DrawingArea.drawPixels(3, 78 + 5, 97 + 30, 0xffffff, 3);
  11810. mapArea474.drawSprite(0, 0);
  11811. if (revision474 == true) {
  11812. if (variousSettings[306] == 0) {
  11813. loadAllOrbs(0);
  11814. }
  11815. drawLogout();
  11816. if (OSCounter == true) {
  11817. rightClickMapArea();
  11818. }
  11819. }
  11820. if (menuOpen && menuScreenArea == 3) {
  11821. drawMenu();
  11822. }
  11823. aRSImageProducer_1165.initDrawingArea();
  11824. } else if (revision498 == true) {
  11825. aRSImageProducer_1164.initDrawingArea();
  11826. if (anInt1021 == 2) {
  11827. byte abyte0[] = mapBack.aByteArray1450;
  11828. int ai[] = DrawingArea.pixels;
  11829. int k2 = abyte0.length;
  11830. for (int i5 = 0; i5 < k2; i5++)
  11831. if (abyte0[i5] == 0)
  11832. ai[i5] = 0;
  11833. compass.method352(33, viewRotation, anIntArray1057, 256,
  11834. anIntArray968, 25, 8, 10, 33, 25);
  11835. aRSImageProducer_1165.initDrawingArea();
  11836. return;
  11837. }
  11838. int i = viewRotation + minimapRotation & 0x7ff;
  11839. int j = 48 + myPlayer.x / 32;
  11840. int l2 = 464 - myPlayer.y / 32;
  11841. for (int x = 0; x < anIntArray1229.length; x++) {
  11842. anIntArray1229[x] = 170;
  11843. anIntArray1052[x] = -23;
  11844. }
  11845. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  11846. 256 + minimapZoom, anIntArray1052, l2, 10, 45, 146, j);
  11847. compass.method352(33, viewRotation, anIntArray1057, 256,
  11848. anIntArray968, 25, 8, 8, 33, 25);
  11849. for (int j5 = 0; j5 < anInt1071; j5++) {
  11850. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11851. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11852. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  11853. }
  11854. markMinimap(minimapIcons[1], ((3095 - baseX) * 4 + 2) - myPlayer.x
  11855. / 32, ((3504 - baseY) * 4 + 2) - myPlayer.y / 32);
  11856. for (int k5 = 0; k5 < 104; k5++) {
  11857. for (int l5 = 0; l5 < 104; l5++) {
  11858. NodeList class19 = groundArray[plane][k5][l5];
  11859. if (class19 != null) {
  11860. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11861. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11862. markMinimap(mapDotItem, l, j3);
  11863. }
  11864. }
  11865. }
  11866.  
  11867. for (int i6 = 0; i6 < npcCount; i6++) {
  11868. NPC npc = npcArray[npcIndices[i6]];
  11869. if (npc != null && npc.isVisible()) {
  11870. EntityDef entityDef = npc.desc;
  11871. if (entityDef.childrenIDs != null)
  11872. entityDef = entityDef.method161();
  11873. if (entityDef != null && entityDef.aBoolean87
  11874. && entityDef.aBoolean84) {
  11875. int i1 = npc.x / 32 - myPlayer.x / 32;
  11876. int k3 = npc.y / 32 - myPlayer.y / 32;
  11877. markMinimap(mapDotNPC, i1, k3);
  11878. }
  11879. }
  11880. }
  11881. for (int j6 = 0; j6 < playerCount; j6++) {
  11882. Player player = playerArray[playerIndices[j6]];
  11883. if (player != null && player.isVisible()) {
  11884. int j1 = player.x / 32 - myPlayer.x / 32;
  11885. int l3 = player.y / 32 - myPlayer.y / 32;
  11886. boolean flag1 = false;
  11887. boolean clanMember = false;
  11888. long l6 = TextClass.longForName(player.name);
  11889. for (int k6 = 0; k6 < friendsCount; k6++) {
  11890. if (l6 != friendsListAsLongs[k6]
  11891. || friendsNodeIDs[k6] == 0)
  11892. continue;
  11893. flag1 = true;
  11894. break;
  11895. }
  11896. String clanname;
  11897. for (int j3 = 0; j3 < clanList.length; j3++) {
  11898. if (clanList[j3] == null)
  11899. continue;
  11900. clanname = clanList[j3];
  11901. if (clanname.startsWith("<clan"))
  11902. clanname = clanname.substring(
  11903. clanname.indexOf(">") + 1,
  11904. clanname.length());
  11905. if (!clanname.equalsIgnoreCase(player.name))
  11906. continue;
  11907. clanMember = true;
  11908. break;
  11909. }
  11910. if (flag1)
  11911. markMinimap(mapDotFriend, j1, l3);
  11912. else if (clanMember)
  11913. markMinimap(mapDotClan, j1, l3);
  11914. else
  11915. markMinimap(mapDotPlayer, j1, l3);
  11916. }
  11917. }
  11918. if (anInt855 != 0 && loopCycle % 20 < 10) {
  11919. if (anInt855 == 1 && anInt1222 >= 0
  11920. && anInt1222 < npcArray.length) {
  11921. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11922. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  11923. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32
  11924. - myPlayer.x / 32;
  11925. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32
  11926. - myPlayer.y / 32;
  11927. method81(mapMarker, i4, k1);
  11928. }
  11929. }
  11930. if (anInt855 == 2) {
  11931. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11932. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11933. method81(mapMarker, j4, l1);
  11934. }
  11935. if (anInt855 == 10 && anInt933 >= 0
  11936. && anInt933 < playerArray.length) {
  11937. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11938. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  11939. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32
  11940. - myPlayer.x / 32;
  11941. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32
  11942. - myPlayer.y / 32;
  11943. method81(mapMarker, k4, i2);
  11944. }
  11945. }
  11946. }
  11947. if (destX != 0) {
  11948. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11949. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11950. markMinimap(mapFlag, j2, l4);
  11951. }
  11952. DrawingArea.drawPixels(3, 78 + 5, 97 + 20, 0xffffff, 3);
  11953. mapArea.drawSprite(0, 0);
  11954. //drawXPCounter();
  11955. rightClickMapArea();
  11956. globe.drawSprite(8, 124);
  11957. // loadExtraSprites();
  11958. drawLogout();
  11959.  
  11960. aRSImageProducer_1165.initDrawingArea();
  11961. }
  11962. }
  11963.  
  11964. public boolean runClicked = false;
  11965. public boolean Resting = false;
  11966. public boolean runHover;
  11967. public boolean prayClicked = false;
  11968. public boolean is480 = false;
  11969. public boolean prayHover = false;
  11970.  
  11971. public void drawLogoutButton() {
  11972. if (tabInterfaceIDs[10] != -1 && anInt1054 == 9)
  11973. if (loopCycle % 20 >= 10)
  11974. ;
  11975. sideIcons[10].drawSprite(223, 1);
  11976. if (tabID == 10)
  11977. logIconC.drawSprite(223, 1);
  11978. }
  11979.  
  11980. public boolean logHover = false;
  11981. public Sprite globe;
  11982. public Sprite magicAuto;
  11983.  
  11984. public void drawLogout() {
  11985. if (!logHover) {
  11986. logIcon.drawSprite(223, 1);
  11987. } else {
  11988. logIconH.drawSprite(223, 1);
  11989. }
  11990. if (super.clickMode2 == 1 && super.mouseX >= 765 - 24
  11991. && super.mouseX <= 765 && super.mouseY >= 1
  11992. && super.mouseY <= 25) {
  11993. logIconC.drawSprite(223, 1);
  11994. }
  11995. }
  11996.  
  11997. public void loadExtraSprites() {
  11998. for (int k = 1; k <= 15; k++)
  11999. ORBS[k] = new Sprite((new StringBuilder()).append("Frame/ORBS ")
  12000. .append(k).append("").toString());
  12001. }
  12002.  
  12003. public void World508() {
  12004. worldMapIcon508.drawSprite(8, 124);
  12005. }
  12006.  
  12007. public void World525() {
  12008. worldMapIcon525.drawSprite(8, 124);
  12009. }
  12010.  
  12011. public Sprite[] xpOrb = new Sprite[2];
  12012. public Sprite xpSprite;
  12013. Sprite[] counter;
  12014.  
  12015. private void drawCounterOnScreen() {
  12016. int x = 500;
  12017. int y = 46;
  12018. digits = xpCounter == 0 ? 1 : 1 + (int) Math.floor(Math.log10(xpCounter));
  12019. int lengthToRemove = Integer.toString(xpCounter).length();
  12020. int i = smallText.getTextWidth(Integer.toString(xpCounter)) - smallText.getTextWidth(Integer.toString(xpCounter)) / 2;
  12021. int a = lengthToRemove == 1 ? 5 : ((lengthToRemove - 1) * 5);
  12022. String formattedCounter = NumberFormat.getIntegerInstance().format(xpCounter);
  12023. final boolean xpHover = super.mouseX >= 395 && super.mouseX <= 515 && super.mouseY >= 7 && super.mouseY <= 33;
  12024. if (xpHover) {
  12025. final boolean mostRecent = variousSettings[308] == 1;
  12026. String experience = NumberFormat.getIntegerInstance().format((Integer) currentExp[expSkill]);
  12027. int formatCounterWidth = aTextDrawingArea_1271.getTextWidth(formattedCounter);
  12028. int totalXPWidth = aTextDrawingArea_1271.getTextWidth(Skills.skillNames[expSkill] + " XP: " + experience);
  12029. int b = (mostRecent ? (formatCounterWidth > totalXPWidth ? formatCounterWidth : totalXPWidth) : formatCounterWidth);
  12030. int xOffset = 404 - b + (mostRecent ? 97 : 50);
  12031. drawHoverBox(xOffset, 40, "Total XP: " + formattedCounter +
  12032. (mostRecent ? ("\n@blu@" + capitalize(Skills.skillNames[expSkill]) + " XP: " + experience) : ""));
  12033. }
  12034. expDrops[22].drawAdvancedSprite(390, 2);
  12035. expDrops[variousSettings[308] == 1 ? expSkill : 21].drawSprite(393, 6);
  12036. if (xpCounter >= 0) {
  12037. smallText.method382(0xFFFFFD, x + 1 - i, formattedCounter, y - 25, true);
  12038. } else {
  12039. expAdded = 0;
  12040. }
  12041. if (expAdded > 0) {
  12042. a = smallText.getTextWidth(" " + NumberFormat.getIntegerInstance().format(expAdded) + "xp");
  12043. smallText.method382(0xFFFFFD, x - a + 30, NumberFormat.getIntegerInstance().format(expAdded), y + 120 - xpAddedPos, true);
  12044. expDrops[expSkill].drawSprite(x - a, y + 105 - xpAddedPos);
  12045. xpAddedPos++;
  12046. if (xpAddedPos >= 120) {
  12047. xpAddedPos = expAdded = 0;
  12048. }
  12049. } else {
  12050. expAdded = 0;
  12051. }
  12052. }
  12053. private boolean counterHover;
  12054. private void processMinimapActions() {
  12055. if (super.mouseX >= 542 && super.mouseX <= 579 && super.mouseY >= 2 && super.mouseY <= 38) {
  12056. menuActionName[1] = "Face North";
  12057. menuActionID[1] = 696;
  12058. menuActionRow = 2;
  12059. }
  12060. if (variousSettings[306] == 0) {
  12061. if (counterHover) {
  12062. menuActionName[2] = counterOn ? "Hide @or2@XP drops" : "Show @or2@XP drops";
  12063. menuActionID[2] = 474;
  12064. menuActionName[1] = "Reset @or2@XP drops";
  12065. menuActionID[1] = 475;
  12066. menuActionRow = 3;
  12067. }
  12068. if (runHover) {
  12069. menuActionName[1] = !runClicked ? "Turn run mode on" : "Turn run mode off";
  12070. menuActionID[1] = 1050;
  12071. menuActionRow = 2;
  12072. }
  12073. }
  12074. }
  12075. private boolean counterOn = false;
  12076.  
  12077. private final void minimapHovers() {
  12078. final boolean fixed = frameMode == ScreenMode.FIXED;
  12079. hpHover = fixed ? super.mouseX >= 518 && super.mouseX <= 571 && super.mouseY >= 49 && super.mouseY < 70 : super.mouseX >= frameWidth - 216 && super.mouseX <= 159 && super.mouseY >= 49 && super.mouseY < 71;
  12080. prayHover = fixed ? super.mouseX >= 519 && super.mouseX <= 571 && super.mouseY >= 89 && super.mouseY < 111 : super.mouseX >= frameWidth - 207 && super.mouseX <= frameWidth - 151 && super.mouseY >= 92 && super.mouseY < 115;
  12081. runHover = fixed ? super.mouseX >= 542 && super.mouseX <= 595 && super.mouseY >= 127 && super.mouseY < 152 : super.mouseX >= frameWidth - 174 && super.mouseX <= frameWidth - 120 && super.mouseY >= 130 && super.mouseY < 152;
  12082. counterHover = fixed ? super.mouseX >= 519 && super.mouseX <= 545 && super.mouseY >= 18 && super.mouseY < 46 : super.mouseX >= frameWidth - 174 && super.mouseX <= frameWidth - 120 && super.mouseY >= 130 && super.mouseY < 152;
  12083. }
  12084.  
  12085. private void rightClickMapArea() {
  12086. if (revision498 == true) {
  12087. int x = super.mouseX;
  12088. int y = super.mouseY;
  12089. if (x >= 531 && x <= 557 && y >= 7 && y <= 40) {
  12090. menuActionName[1] = "Face North";
  12091. menuActionID[1] = 696;
  12092. menuActionRow = 2;
  12093. }
  12094. }
  12095. if (super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1
  12096. && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
  12097. menuActionName[1] = "Logout";
  12098. menuActionID[1] = 1004;
  12099. menuActionRow = 2;
  12100. } else if (super.mouseX > 713 && super.mouseX < 765
  12101. && super.mouseY > 83 && super.mouseY < 118) {
  12102. menuActionName[1] = "Run";
  12103. menuActionID[1] = 1050;
  12104. menuActionRow = 2;
  12105.  
  12106. }
  12107. }
  12108.  
  12109. public void npcScreenPos(Entity entity, int i) {
  12110. calcEntityScreenPos(entity.x, i, entity.y);
  12111. }
  12112.  
  12113. public void calcEntityScreenPos(int i, int j, int l) {
  12114. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  12115. spriteDrawX = -1;
  12116. spriteDrawY = -1;
  12117. return;
  12118. }
  12119. int i1 = method42(plane, l, i) - j;
  12120. i -= xCameraPos;
  12121. i1 -= zCameraPos;
  12122. l -= yCameraPos;
  12123. int j1 = Model.modelIntArray1[yCameraCurve];
  12124. int k1 = Model.modelIntArray2[yCameraCurve];
  12125. int l1 = Model.modelIntArray1[xCameraCurve];
  12126. int i2 = Model.modelIntArray2[xCameraCurve];
  12127. int j2 = l * l1 + i * i2 >> 16;
  12128. l = l * i2 - i * l1 >> 16;
  12129. i = j2;
  12130. j2 = i1 * k1 - l * j1 >> 16;
  12131. l = i1 * j1 + l * k1 >> 16;
  12132. i1 = j2;
  12133. if (l >= 50) {
  12134. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  12135. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  12136. } else {
  12137. spriteDrawX = -1;
  12138. spriteDrawY = -1;
  12139. }
  12140. }
  12141.  
  12142. private void buildSplitPrivateChatMenu() {
  12143. if (splitPrivateChat == 0)
  12144. return;
  12145. int i = 0;
  12146. if (anInt1104 != 0)
  12147. i = 1;
  12148. for (int j = 0; j < 100; j++)
  12149. if (chatMessages[j] != null) {
  12150. int k = chatTypes[j];
  12151. String s = chatNames[j];
  12152. if (s != null && s.startsWith("@cr1@")) {
  12153. s = s.substring(5);
  12154. }
  12155. if (s != null && s.startsWith("@cr2@")) {
  12156. s = s.substring(5);
  12157. }
  12158. if (s != null && s.startsWith("@cr3@")) {
  12159. s = s.substring(5);
  12160. }
  12161. if (s != null && s.startsWith("@cr4@")) {
  12162. s = s.substring(5);
  12163. }
  12164. if (s != null && s.startsWith("@cr5@")) {
  12165. s = s.substring(5);
  12166. }
  12167. if (s != null && s.startsWith("@cr6@")) {
  12168. s = s.substring(5);
  12169. }
  12170. if (s != null && s.startsWith("@cr7@")) {
  12171. s = s.substring(5);
  12172. }
  12173. if (s != null && s.startsWith("@cr8@")) {
  12174. s = s.substring(5);
  12175. }
  12176. if (s != null && s.startsWith("@cr9@")) {
  12177. s = s.substring(5);
  12178. }
  12179. if (s != null && s.startsWith("@cr10@")) {
  12180. s = s.substring(6);
  12181. }
  12182. if (s != null && s.startsWith("@cr11@")) {
  12183. s = s.substring(6);
  12184. }
  12185. if ((k == 3 || k == 7)
  12186. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  12187. && isFriendOrSelf(s))) {
  12188. int l = 329 - i * 13;
  12189. if (super.mouseX > 4 && super.mouseY - 4 > l - 10
  12190. && super.mouseY - 4 <= l + 3) {
  12191. int i1 = aTextDrawingArea_1271.getTextWidth("From: "
  12192. + s + chatMessages[j]) + 25;
  12193. if (i1 > 450)
  12194. i1 = 450;
  12195. if (super.mouseX < 4 + i1) {
  12196. if (myPrivilege >= 1) {
  12197. menuActionName[menuActionRow] = "Report abuse @whi@"
  12198. + s;
  12199. menuActionID[menuActionRow] = 2606;
  12200. menuActionRow++;
  12201. }
  12202. menuActionName[menuActionRow] = "Add ignore @whi@"
  12203. + s;
  12204. menuActionID[menuActionRow] = 2042;
  12205. menuActionRow++;
  12206. menuActionName[menuActionRow] = "Add friend @whi@"
  12207. + s;
  12208. menuActionID[menuActionRow] = 2337;
  12209. menuActionRow++;
  12210. }
  12211. }
  12212. if (++i >= 5)
  12213. return;
  12214. }
  12215. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  12216. return;
  12217. }
  12218.  
  12219. }
  12220.  
  12221. public void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  12222. int i2, int j2) {
  12223. Class30_Sub1 class30_sub1 = null;
  12224. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12225. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12226. .reverseGetNext()) {
  12227. if (class30_sub1_1.anInt1295 != l1
  12228. || class30_sub1_1.anInt1297 != i2
  12229. || class30_sub1_1.anInt1298 != j1
  12230. || class30_sub1_1.anInt1296 != i1)
  12231. continue;
  12232. class30_sub1 = class30_sub1_1;
  12233. break;
  12234. }
  12235.  
  12236. if (class30_sub1 == null) {
  12237. class30_sub1 = new Class30_Sub1();
  12238. class30_sub1.anInt1295 = l1;
  12239. class30_sub1.anInt1296 = i1;
  12240. class30_sub1.anInt1297 = i2;
  12241. class30_sub1.anInt1298 = j1;
  12242. method89(class30_sub1);
  12243. aClass19_1179.insertHead(class30_sub1);
  12244. }
  12245. class30_sub1.anInt1291 = k;
  12246. class30_sub1.anInt1293 = k1;
  12247. class30_sub1.anInt1292 = l;
  12248. class30_sub1.anInt1302 = j2;
  12249. class30_sub1.anInt1294 = j;
  12250. }
  12251.  
  12252. private boolean interfaceIsSelected(RSInterface class9) {
  12253. if (class9.anIntArray245 == null)
  12254. return false;
  12255. for (int i = 0; i < class9.anIntArray245.length; i++) {
  12256. int j = extractInterfaceValues(class9, i);
  12257. int k = class9.anIntArray212[i];
  12258. if (class9.anIntArray245[i] == 2) {
  12259. if (j >= k)
  12260. return false;
  12261. } else if (class9.anIntArray245[i] == 3) {
  12262. if (j <= k)
  12263. return false;
  12264. } else if (class9.anIntArray245[i] == 4) {
  12265. if (j == k)
  12266. return false;
  12267. } else if (j != k)
  12268. return false;
  12269. }
  12270.  
  12271. return true;
  12272. }
  12273.  
  12274. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  12275. // if(!aBoolean872)
  12276. // if(signlink.mainapp != null)
  12277. // return signlink.openurl(s);
  12278. // else
  12279. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  12280. if (aSocket832 != null) {
  12281. try {
  12282. aSocket832.close();
  12283. } catch (Exception _ex) {
  12284. }
  12285. aSocket832 = null;
  12286. }
  12287. aSocket832 = openSocket(port);
  12288. aSocket832.setSoTimeout(10000);
  12289. java.io.InputStream inputstream = aSocket832.getInputStream();
  12290. OutputStream outputstream = aSocket832.getOutputStream();
  12291. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  12292. return new DataInputStream(inputstream);
  12293. }
  12294.  
  12295. public void doFlamesDrawing() {
  12296. char c = '\u0100';
  12297. if (anInt1040 > 0) {
  12298. for (int i = 0; i < 256; i++)
  12299. if (anInt1040 > 768)
  12300. anIntArray850[i] = method83(anIntArray851[i],
  12301. anIntArray852[i], 1024 - anInt1040);
  12302. else if (anInt1040 > 256)
  12303. anIntArray850[i] = anIntArray852[i];
  12304. else
  12305. anIntArray850[i] = method83(anIntArray852[i],
  12306. anIntArray851[i], 256 - anInt1040);
  12307.  
  12308. } else if (anInt1041 > 0) {
  12309. for (int j = 0; j < 256; j++)
  12310. if (anInt1041 > 768)
  12311. anIntArray850[j] = method83(anIntArray851[j],
  12312. anIntArray853[j], 1024 - anInt1041);
  12313. else if (anInt1041 > 256)
  12314. anIntArray850[j] = anIntArray853[j];
  12315. else
  12316. anIntArray850[j] = method83(anIntArray853[j],
  12317. anIntArray851[j], 256 - anInt1041);
  12318.  
  12319. } else {
  12320. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  12321.  
  12322. }
  12323. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  12324. aRSImageProducer_1110.anIntArray315, 0, 33920);
  12325.  
  12326. int i1 = 0;
  12327. int j1 = 1152;
  12328. for (int k1 = 1; k1 < c - 1; k1++) {
  12329. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  12330. int j2 = 22 + l1;
  12331. if (j2 < 0)
  12332. j2 = 0;
  12333. i1 += j2;
  12334. for (int l2 = j2; l2 < 128; l2++) {
  12335. int j3 = anIntArray828[i1++];
  12336. if (j3 != 0) {
  12337. int l3 = j3;
  12338. int j4 = 256 - j3;
  12339. j3 = anIntArray850[j3];
  12340. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  12341. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  12342. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  12343. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  12344. } else {
  12345. j1++;
  12346. }
  12347. }
  12348.  
  12349. j1 += j2;
  12350. }
  12351.  
  12352. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  12353. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  12354. aRSImageProducer_1111.anIntArray315, 0, 33920);
  12355.  
  12356. i1 = 0;
  12357. j1 = 1176;
  12358. for (int k2 = 1; k2 < c - 1; k2++) {
  12359. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  12360. int k3 = 103 - i3;
  12361. j1 += i3;
  12362. for (int i4 = 0; i4 < k3; i4++) {
  12363. int k4 = anIntArray828[i1++];
  12364. if (k4 != 0) {
  12365. int i5 = k4;
  12366. int j5 = 256 - k4;
  12367. k4 = anIntArray850[k4];
  12368. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  12369. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  12370. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  12371. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  12372. } else {
  12373. j1++;
  12374. }
  12375. }
  12376.  
  12377. i1 += 128 - k3;
  12378. j1 += 128 - k3 - i3;
  12379. }
  12380.  
  12381. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  12382. }
  12383.  
  12384. public void method134(Stream stream) {
  12385. int j = stream.readBits(8);
  12386. if (j < playerCount) {
  12387. for (int k = j; k < playerCount; k++)
  12388. anIntArray840[anInt839++] = playerIndices[k];
  12389.  
  12390. }
  12391. if (j > playerCount) {
  12392. signlink.reporterror(myUsername + " Too many players");
  12393. throw new RuntimeException("eek");
  12394. }
  12395. playerCount = 0;
  12396. for (int l = 0; l < j; l++) {
  12397. int i1 = playerIndices[l];
  12398. Player player = playerArray[i1];
  12399. int j1 = stream.readBits(1);
  12400. if (j1 == 0) {
  12401. playerIndices[playerCount++] = i1;
  12402. player.anInt1537 = loopCycle;
  12403. } else {
  12404. int k1 = stream.readBits(2);
  12405. if (k1 == 0) {
  12406. playerIndices[playerCount++] = i1;
  12407. player.anInt1537 = loopCycle;
  12408. anIntArray894[anInt893++] = i1;
  12409. } else if (k1 == 1) {
  12410. playerIndices[playerCount++] = i1;
  12411. player.anInt1537 = loopCycle;
  12412. int l1 = stream.readBits(3);
  12413. player.moveInDir(false, l1);
  12414. int j2 = stream.readBits(1);
  12415. if (j2 == 1)
  12416. anIntArray894[anInt893++] = i1;
  12417. } else if (k1 == 2) {
  12418. playerIndices[playerCount++] = i1;
  12419. player.anInt1537 = loopCycle;
  12420. int i2 = stream.readBits(3);
  12421. player.moveInDir(true, i2);
  12422. int k2 = stream.readBits(3);
  12423. player.moveInDir(true, k2);
  12424. int l2 = stream.readBits(1);
  12425. if (l2 == 1)
  12426. anIntArray894[anInt893++] = i1;
  12427. } else if (k1 == 3)
  12428. anIntArray840[anInt839++] = i1;
  12429. }
  12430. }
  12431. }
  12432.  
  12433. private enum LoginScreenState {
  12434. LOGIN, DOWNLOADING_CLIENT;
  12435. }
  12436.  
  12437. private LoginScreenState loginState = LoginScreenState.LOGIN;
  12438.  
  12439. public void drawLoginScreen(boolean flag) {
  12440. if (this.loggedIn)
  12441. return;
  12442. resetAllImageProducers();
  12443. resetImageProducers();
  12444. loginScreenArea.initDrawingArea();
  12445.  
  12446. DrawingArea.drawPixels(0, 0, 765, 503, 0x000000);
  12447. if (loginState == LoginScreenState.DOWNLOADING_CLIENT) {
  12448. aTextDrawingArea_1271.drawText(0xCC9900, "Client is out of date.",
  12449. 225, 375);
  12450. aTextDrawingArea_1271.drawText(0xCC9900,
  12451. "Downloading client, Please wait...", 240, 375);
  12452. loginScreenArea.drawGraphics(0, super.graphics, 0);
  12453. return;
  12454. }
  12455. if (backgroundFix == null)
  12456. backgroundFix = new Sprite("loginscreen/general/background");
  12457. backgroundFix.drawSprite(0, 0);
  12458. new Sprite("loginscreen/general/login_box").drawAdvancedSprite(765 / 2 - 364 / 2, 503 / 2 - 360 / 2 + 50);
  12459. new Sprite("loginscreen/general/logo").drawAdvancedSprite(765 / 2 - 118 / 2, 20);
  12460. //new Sprite("loginscreen/general/stacked_logo").drawAdvancedSprite(765 / 2 - 358 / 2, 10);
  12461.  
  12462. newRegularFont.drawBasicString("Username:", 224, 198, 0xFF981F, 0x000000);
  12463. newRegularFont.drawBasicString("Password:", 224, 254, 0xFF981F, 0x000000);
  12464. char c = '\u0168';
  12465. if (loginScreenState == 0 || loginScreenState == 2) {
  12466. /**
  12467. * Input hover
  12468. */
  12469. if (super.mouseX >= 239 && super.mouseX <= 529 && super.mouseY > 202 && super.mouseY < 237) {
  12470. new Sprite("loginscreen/general/input_hover").drawAdvancedSprite(234, 202);
  12471. } else {
  12472. new Sprite("loginscreen/general/input").drawAdvancedSprite(234, 202);
  12473. }
  12474. /**
  12475. * Password input
  12476. */
  12477. if (super.mouseX >= 239 && super.mouseX <= 529 && super.mouseY > 258 && super.mouseY < 293) {
  12478. new Sprite("loginscreen/general/input_hover").drawAdvancedSprite(234, 258);
  12479. } else {
  12480. new Sprite("loginscreen/general/input").drawAdvancedSprite(234, 258);
  12481. }
  12482. /**
  12483. * Login button
  12484. */
  12485. if (super.mouseX >= 318 && super.mouseX <= 449 && super.mouseY > 320 && super.mouseY < 347) {
  12486. new Sprite("loginscreen/general/login_hover").drawAdvancedSprite((765 / 2) - (142 / 2), 310);
  12487. } else {
  12488. new Sprite("loginscreen/general/login").drawAdvancedSprite((765 / 2) - (142 / 2), 310);
  12489. }
  12490. new Sprite("loginscreen/general/message_background").drawAdvancedSprite(765 / 2 - 286 / 2, 350);
  12491. int i = 100;
  12492. aTextDrawingArea_1271.method382(0x75a9a9, c / 190,
  12493. onDemandFetcher.statusString, i, true);
  12494. this.smallText.method382(0xFF981F, 765 / 2, this.loginMessage1,
  12495. 380, true);
  12496. this.smallText.method382(0xFF981F, 765 / 2, this.loginMessage2,
  12497. 400, true);
  12498. this.aTextDrawingArea_1271
  12499. .method389(
  12500. false,
  12501. 245,
  12502. 0xFF981F,
  12503. new StringBuilder()
  12504. .append("")
  12505. .append(capitalize(myUsername))
  12506. .append(((this.loginScreenCursorPos == 0 ? 1
  12507. : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|"
  12508. : "").toString(),
  12509. 224);
  12510. this.aTextDrawingArea_1271
  12511. .method389(
  12512. true,
  12513. 245,
  12514. 0xFF981F,
  12515. new StringBuilder()
  12516. .append("")
  12517. .append(TextClass
  12518. .passwordAsterisks(myPassword))
  12519. .append(((this.loginScreenCursorPos == 1 ? 1
  12520. : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|"
  12521. : "").toString(),
  12522. 281);
  12523. }
  12524. boolean debug = false;
  12525. if (debug) {
  12526. this.newRegularFont.drawBasicString("Mouse X: " + super.mouseX, 25,
  12527. 50);
  12528. this.newRegularFont.drawBasicString("Mouse Y: " + super.mouseY, 25,
  12529. 65);
  12530. this.newRegularFont.drawBasicString("Click X: " + super.saveClickX,
  12531. 25, 80);
  12532. this.newRegularFont.drawBasicString("Click Y: " + super.saveClickY,
  12533. 25, 95);
  12534. }
  12535. loginScreenArea.drawGraphics(0, super.graphics, 0);
  12536. }
  12537.  
  12538. public void drawSmoothLoading(int i, String s) {
  12539. for (float f = LP; f < (float) i; f = (float) ((double) f + 1.49999999999999999D))
  12540. drawLoadingText((int) f, s);
  12541.  
  12542. LP = i;
  12543. }
  12544.  
  12545. private void drawFlames() {
  12546. try {
  12547. long l = System.currentTimeMillis();
  12548. int i = 0;
  12549. int j = 20;
  12550. while (aBoolean831) {
  12551. anInt1208++;
  12552. if (showFlames) {
  12553. // calcFlamesPosition();
  12554. // calcFlamesPosition();
  12555. }
  12556. // doFlamesDrawing();
  12557. if (++i > 10) {
  12558. long l1 = System.currentTimeMillis();
  12559. int k = (int) (l1 - l) / 10 - j;
  12560. j = 40 - k;
  12561. if (j < 5)
  12562. j = 5;
  12563. i = 0;
  12564. l = l1;
  12565. }
  12566. try {
  12567. Thread.sleep(j);
  12568. } catch (Exception _ex) {
  12569. }
  12570. }
  12571. } catch (Exception _ex) {
  12572. drawingFlames = false;
  12573. }
  12574. }
  12575.  
  12576. @Override
  12577. public void raiseWelcomeScreen() {
  12578. welcomeScreenRaised = true;
  12579. }
  12580.  
  12581. public void method137(Stream stream, int j) {
  12582. if (j == 84) {
  12583. int k = stream.readUnsignedByte();
  12584. int j3 = anInt1268 + (k >> 4 & 7);
  12585. int i6 = anInt1269 + (k & 7);
  12586. int l8 = stream.readUnsignedWord();
  12587. int k11 = stream.readUnsignedWord();
  12588. int l13 = stream.readUnsignedWord();
  12589. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  12590. NodeList class19_1 = groundArray[plane][j3][i6];
  12591. if (class19_1 != null) {
  12592. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  12593. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  12594. .reverseGetNext()) {
  12595. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  12596. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  12597. continue;
  12598. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  12599. break;
  12600. }
  12601.  
  12602. spawnGroundItem(j3, i6);
  12603. }
  12604. }
  12605. return;
  12606. }
  12607. if (j == 105) {
  12608. int l = stream.readUnsignedByte();
  12609. int k3 = anInt1268 + (l >> 4 & 7);
  12610. int j6 = anInt1269 + (l & 7);
  12611. int i9 = stream.readUnsignedWord();
  12612. int l11 = stream.readUnsignedByte();
  12613. int i14 = l11 >> 4 & 0xf;
  12614. int i16 = l11 & 7;
  12615. if (myPlayer.smallX[0] >= k3 - i14
  12616. && myPlayer.smallX[0] <= k3 + i14
  12617. && myPlayer.smallY[0] >= j6 - i14
  12618. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  12619. && anInt1062 < 50) {
  12620. anIntArray1207[anInt1062] = i9;
  12621. anIntArray1241[anInt1062] = i16;
  12622. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  12623. anInt1062++;
  12624. }
  12625. }
  12626. if (j == 215) {
  12627. int i1 = stream.method435();
  12628. int l3 = stream.method428();
  12629. int k6 = anInt1268 + (l3 >> 4 & 7);
  12630. int j9 = anInt1269 + (l3 & 7);
  12631. int i12 = stream.method435();
  12632. int j14 = stream.readUnsignedWord();
  12633. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  12634. && i12 != unknownInt10) {
  12635. Item class30_sub2_sub4_sub2_2 = new Item();
  12636. class30_sub2_sub4_sub2_2.ID = i1;
  12637. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  12638. if (groundArray[plane][k6][j9] == null)
  12639. groundArray[plane][k6][j9] = new NodeList();
  12640. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  12641. spawnGroundItem(k6, j9);
  12642. }
  12643. return;
  12644. }
  12645. if (j == 156) {
  12646. int j1 = stream.method426();
  12647. int i4 = anInt1268 + (j1 >> 4 & 7);
  12648. int l6 = anInt1269 + (j1 & 7);
  12649. int k9 = stream.readUnsignedWord();
  12650. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  12651. NodeList class19 = groundArray[plane][i4][l6];
  12652. if (class19 != null) {
  12653. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  12654. .reverseGetNext()) {
  12655. if (item.ID != (k9 & 0x7fff))
  12656. continue;
  12657. item.unlink();
  12658. break;
  12659. }
  12660.  
  12661. if (class19.reverseGetFirst() == null)
  12662. groundArray[plane][i4][l6] = null;
  12663. spawnGroundItem(i4, l6);
  12664. }
  12665. }
  12666. return;
  12667. }
  12668. if (j == 160) {
  12669. int k1 = stream.method428();
  12670. int j4 = anInt1268 + (k1 >> 4 & 7);
  12671. int i7 = anInt1269 + (k1 & 7);
  12672. int l9 = stream.method428();
  12673. int j12 = l9 >> 2;
  12674. int k14 = l9 & 3;
  12675. int j16 = anIntArray1177[j12];
  12676. int j17 = stream.method435();
  12677. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  12678. int j18 = intGroundArray[plane][j4][i7];
  12679. int i19 = intGroundArray[plane][j4 + 1][i7];
  12680. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  12681. int k20 = intGroundArray[plane][j4][i7 + 1];
  12682. if (j16 == 0) {
  12683. Object1 class10 = worldController.method296(plane, j4, i7);
  12684. if (class10 != null) {
  12685. int k21 = class10.uid >> 14 & 0x7fff;
  12686. if (j12 == 2) {
  12687. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  12688. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  12689. false);
  12690. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  12691. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  12692. j17, false);
  12693. } else {
  12694. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  12695. k21, k14, j12, i19, l19, j18, k20, j17,
  12696. false);
  12697. }
  12698. }
  12699. }
  12700. if (j16 == 1) {
  12701. Object2 class26 = worldController.method297(j4, i7, plane);
  12702. if (class26 != null)
  12703. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  12704. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  12705. j18, k20, j17, false);
  12706. }
  12707. if (j16 == 2) {
  12708. Object5 class28 = worldController.method298(j4, i7, plane);
  12709. if (j12 == 11)
  12710. j12 = 10;
  12711. if (class28 != null)
  12712. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  12713. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  12714. j18, k20, j17, false);
  12715. }
  12716. if (j16 == 3) {
  12717. Object3 class49 = worldController.method299(i7, j4, plane);
  12718. if (class49 != null)
  12719. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  12720. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  12721. j18, k20, j17, false);
  12722. }
  12723. }
  12724. return;
  12725. }
  12726. if (j == 147) {
  12727. int l1 = stream.method428();
  12728. int k4 = anInt1268 + (l1 >> 4 & 7);
  12729. int j7 = anInt1269 + (l1 & 7);
  12730. int i10 = stream.readUnsignedWord();
  12731. byte byte0 = stream.method430();
  12732. int l14 = stream.method434();
  12733. byte byte1 = stream.method429();
  12734. int k17 = stream.readUnsignedWord();
  12735. int k18 = stream.method428();
  12736. int j19 = k18 >> 2;
  12737. int i20 = k18 & 3;
  12738. int l20 = anIntArray1177[j19];
  12739. byte byte2 = stream.readSignedByte();
  12740. int l21 = stream.readUnsignedWord();
  12741. byte byte3 = stream.method429();
  12742. Player player;
  12743. if (i10 == unknownInt10)
  12744. player = myPlayer;
  12745. else
  12746. player = playerArray[i10];
  12747. if (player != null) {
  12748. ObjectDef class46 = ObjectDef.forID(l21);
  12749. int i22 = intGroundArray[plane][k4][j7];
  12750. int j22 = intGroundArray[plane][k4 + 1][j7];
  12751. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  12752. int l22 = intGroundArray[plane][k4][j7 + 1];
  12753. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  12754. -1);
  12755. if (model != null) {
  12756. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  12757. player.anInt1707 = l14 + loopCycle;
  12758. player.anInt1708 = k17 + loopCycle;
  12759. player.aModel_1714 = model;
  12760. int i23 = class46.anInt744;
  12761. int j23 = class46.anInt761;
  12762. if (i20 == 1 || i20 == 3) {
  12763. i23 = class46.anInt761;
  12764. j23 = class46.anInt744;
  12765. }
  12766. player.anInt1711 = k4 * 128 + i23 * 64;
  12767. player.anInt1713 = j7 * 128 + j23 * 64;
  12768. player.anInt1712 = method42(plane, player.anInt1713,
  12769. player.anInt1711);
  12770. if (byte2 > byte0) {
  12771. byte byte4 = byte2;
  12772. byte2 = byte0;
  12773. byte0 = byte4;
  12774. }
  12775. if (byte3 > byte1) {
  12776. byte byte5 = byte3;
  12777. byte3 = byte1;
  12778. byte1 = byte5;
  12779. }
  12780. player.anInt1719 = k4 + byte2;
  12781. player.anInt1721 = k4 + byte0;
  12782. player.anInt1720 = j7 + byte3;
  12783. player.anInt1722 = j7 + byte1;
  12784. }
  12785. }
  12786. }
  12787. if (j == 151) {
  12788. int i2 = stream.method426();
  12789. int l4 = anInt1268 + (i2 >> 4 & 7);
  12790. int k7 = anInt1269 + (i2 & 7);
  12791. int j10 = stream.method434();
  12792. int k12 = stream.method428();
  12793. int i15 = k12 >> 2;
  12794. int k16 = k12 & 3;
  12795. int l17 = anIntArray1177[i15];
  12796. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  12797. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  12798. return;
  12799. }
  12800. if (j == 4) {
  12801. int j2 = stream.readUnsignedByte();
  12802. int i5 = anInt1268 + (j2 >> 4 & 7);
  12803. int l7 = anInt1269 + (j2 & 7);
  12804. int k10 = stream.readUnsignedWord();
  12805. int l12 = stream.readUnsignedByte();
  12806. int j15 = stream.readUnsignedWord();
  12807. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  12808. i5 = i5 * 128 + 64;
  12809. l7 = l7 * 128 + 64;
  12810. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  12811. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  12812. i5);
  12813. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  12814. }
  12815. return;
  12816. }
  12817. if (j == 44) {
  12818. int k2 = stream.method436();
  12819. int j5 = stream.readUnsignedWord();
  12820. int i8 = stream.readUnsignedByte();
  12821. int l10 = anInt1268 + (i8 >> 4 & 7);
  12822. int i13 = anInt1269 + (i8 & 7);
  12823. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  12824. Item class30_sub2_sub4_sub2_1 = new Item();
  12825. class30_sub2_sub4_sub2_1.ID = k2;
  12826. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  12827. if (groundArray[plane][l10][i13] == null)
  12828. groundArray[plane][l10][i13] = new NodeList();
  12829. groundArray[plane][l10][i13]
  12830. .insertHead(class30_sub2_sub4_sub2_1);
  12831. spawnGroundItem(l10, i13);
  12832. }
  12833. return;
  12834. }
  12835. if (j == 101) {
  12836. int l2 = stream.method427();
  12837. int k5 = l2 >> 2;
  12838. int j8 = l2 & 3;
  12839. int i11 = anIntArray1177[k5];
  12840. int j13 = stream.readUnsignedByte();
  12841. int k15 = anInt1268 + (j13 >> 4 & 7);
  12842. int l16 = anInt1269 + (j13 & 7);
  12843. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  12844. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  12845. return;
  12846. }
  12847. if (j == 117) {
  12848. int i3 = stream.readUnsignedByte();
  12849. int l5 = anInt1268 + (i3 >> 4 & 7);
  12850. int k8 = anInt1269 + (i3 & 7);
  12851. int j11 = l5 + stream.readSignedByte();
  12852. int k13 = k8 + stream.readSignedByte();
  12853. int l15 = stream.readSignedWord();
  12854. int i17 = stream.readUnsignedWord();
  12855. int i18 = stream.readUnsignedByte() * 4;
  12856. int l18 = stream.readUnsignedByte() * 4;
  12857. int k19 = stream.readUnsignedWord();
  12858. int j20 = stream.readUnsignedWord();
  12859. int i21 = stream.readUnsignedByte();
  12860. int j21 = stream.readUnsignedByte();
  12861. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  12862. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  12863. l5 = l5 * 128 + 64;
  12864. k8 = k8 * 128 + 64;
  12865. j11 = j11 * 128 + 64;
  12866. k13 = k13 * 128 + 64;
  12867. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  12868. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  12869. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  12870. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  12871. method42(plane, k13, j11) - l18, j11);
  12872. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  12873. }
  12874. }
  12875. }
  12876.  
  12877. @SuppressWarnings("unused")
  12878. private static void setLowMem() {
  12879. WorldController.lowMem = true;
  12880. Texture.lowMem = true;
  12881. lowMem = true;
  12882. ObjectManager.lowMem = true;
  12883. ObjectDef.lowMem = true;
  12884. }
  12885.  
  12886. public void method139(Stream stream) {
  12887. stream.initBitAccess();
  12888. int k = stream.readBits(8);
  12889. if (k < npcCount) {
  12890. for (int l = k; l < npcCount; l++)
  12891. anIntArray840[anInt839++] = npcIndices[l];
  12892.  
  12893. }
  12894. if (k > npcCount) {
  12895. signlink.reporterror(myUsername + " Too many npcs");
  12896. throw new RuntimeException("eek");
  12897. }
  12898. npcCount = 0;
  12899. for (int i1 = 0; i1 < k; i1++) {
  12900. int j1 = npcIndices[i1];
  12901. NPC npc = npcArray[j1];
  12902. int k1 = stream.readBits(1);
  12903. if (k1 == 0) {
  12904. npcIndices[npcCount++] = j1;
  12905. npc.anInt1537 = loopCycle;
  12906. } else {
  12907. int l1 = stream.readBits(2);
  12908. if (l1 == 0) {
  12909. npcIndices[npcCount++] = j1;
  12910. npc.anInt1537 = loopCycle;
  12911. anIntArray894[anInt893++] = j1;
  12912. } else if (l1 == 1) {
  12913. npcIndices[npcCount++] = j1;
  12914. npc.anInt1537 = loopCycle;
  12915. int i2 = stream.readBits(3);
  12916. npc.moveInDir(false, i2);
  12917. int k2 = stream.readBits(1);
  12918. if (k2 == 1)
  12919. anIntArray894[anInt893++] = j1;
  12920. } else if (l1 == 2) {
  12921. npcIndices[npcCount++] = j1;
  12922. npc.anInt1537 = loopCycle;
  12923. int j2 = stream.readBits(3);
  12924. npc.moveInDir(true, j2);
  12925. int l2 = stream.readBits(3);
  12926. npc.moveInDir(true, l2);
  12927. int i3 = stream.readBits(1);
  12928. if (i3 == 1)
  12929. anIntArray894[anInt893++] = j1;
  12930. } else if (l1 == 3)
  12931. anIntArray840[anInt839++] = j1;
  12932. }
  12933. }
  12934.  
  12935. }
  12936.  
  12937. private void processLoginScreenInput() {
  12938. if (this.loginScreenState == 0 || this.loginScreenState == 2) {
  12939. resetImage();
  12940. if (super.clickMode3 == 1) {
  12941. if (super.mouseX >= 239 && super.mouseX <= 529 && super.mouseY > 202 && super.mouseY < 237) {
  12942. loginScreenCursorPos = 0;
  12943. }
  12944. if (super.mouseX >= 239 && super.mouseX <= 529 && super.mouseY > 258 && super.mouseY < 293) {
  12945. loginScreenCursorPos = 1;
  12946. }
  12947. if (super.mouseX >= 318 && super.mouseX <= 449 && super.mouseY > 320 && super.mouseY < 347) {
  12948. loginFailures = 0;
  12949. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  12950. login(myUsername, myPassword, false);
  12951. } else {
  12952. this.loginScreenCursorPos = 0;
  12953. this.loginMessage1 = "Username & Password";
  12954. this.loginMessage2 = "Must be more than 1 character";
  12955. }
  12956. try {
  12957. writeSettings();
  12958. } catch (IOException e) {
  12959. e.printStackTrace();
  12960. }
  12961. if (loggedIn)
  12962. return;
  12963. }
  12964. }
  12965. do {
  12966. int l1 = readChar(-796);
  12967. if (l1 == -1)
  12968. break;
  12969. boolean flag1 = false;
  12970. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  12971. if (l1 != validUserPassChars.charAt(i2))
  12972. continue;
  12973. flag1 = true;
  12974. break;
  12975. }
  12976.  
  12977. if (loginScreenCursorPos == 0) {
  12978. if (l1 == 8 && myUsername.length() > 0)
  12979. myUsername = myUsername.substring(0,
  12980. myUsername.length() - 1);
  12981. if (l1 == 9 || l1 == 10 || l1 == 13)
  12982. loginScreenCursorPos = 1;
  12983. if (flag1)
  12984. myUsername += (char) l1;
  12985. if (myUsername.length() > 12)
  12986. myUsername = myUsername.substring(0, 12);
  12987. } else if (loginScreenCursorPos == 1) {
  12988. if (l1 == 8 && myPassword.length() > 0)
  12989. myPassword = myPassword.substring(0,
  12990. myPassword.length() - 1);
  12991. if (l1 == 9 || l1 == 10 || l1 == 13)
  12992. login(myUsername, myPassword, false);
  12993. if (flag1)
  12994. myPassword += (char) l1;
  12995. if (myPassword.length() > 20)
  12996. myPassword = myPassword.substring(0, 20);
  12997. }
  12998. } while (true);
  12999. return;
  13000. }
  13001. if (loginScreenState == 3) {
  13002. int k = super.myWidth / 2;
  13003. int j1 = super.myHeight / 2 + 50;
  13004. j1 += 20;
  13005. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  13006. && super.saveClickX <= k + 75
  13007. && super.saveClickY >= j1 - 20
  13008. && super.saveClickY <= j1 + 20)
  13009. loginScreenState = 0;
  13010. }
  13011. }
  13012.  
  13013. private void resetImage() {
  13014. DrawingArea.setAllPixelsToZero();
  13015. }
  13016.  
  13017. private void markMinimap(Sprite sprite, int i, int j) {
  13018. if (revision474 == true) {
  13019. int k = viewRotation + minimapRotation & 0x7ff;
  13020. int l = i * i + j * j;
  13021. if (l > 6400)
  13022. return;
  13023. int i1 = Model.modelIntArray1[k];
  13024. int j1 = Model.modelIntArray2[k];
  13025. i1 = (i1 * 256) / (minimapZoom + 256);
  13026. j1 = (j1 * 256) / (minimapZoom + 256);
  13027. int k1 = j * i1 + i * j1 >> 16;
  13028. int l1 = j * j1 - i * i1 >> 16;
  13029. if (l > 2500) {
  13030. try {
  13031. sprite.drawSprite(
  13032. ((94 + k1) - sprite.maxWidth / 2) + 4 + 30, 83 - l1
  13033. - sprite.maxHeight / 2 - 4 + 5);
  13034. } catch (Exception e) {
  13035. }
  13036. } else {
  13037. try {
  13038. sprite.drawSprite(
  13039. ((94 + k1) - sprite.maxWidth / 2) + 4 + 30, 83 - l1
  13040. - sprite.maxHeight / 2 - 4 + 5);
  13041. } catch (Exception e) {
  13042. }
  13043. }
  13044. } else {
  13045. int k = viewRotation + minimapRotation & 0x7ff;
  13046. int l = i * i + j * j;
  13047. if (l > 6400)
  13048. return;
  13049. int i1 = Model.modelIntArray1[k];
  13050. int j1 = Model.modelIntArray2[k];
  13051. i1 = (i1 * 256) / (minimapZoom + 256);
  13052. j1 = (j1 * 256) / (minimapZoom + 256);
  13053. int k1 = j * i1 + i * j1 >> 16;
  13054. int l1 = j * j1 - i * i1 >> 16;
  13055. try {
  13056. if (sprite != null)
  13057. sprite.drawSprite(
  13058. ((94 + k1) - sprite.maxWidth / 2) + 4 + 20, 83 - l1
  13059. - sprite.maxHeight / 2 - 4 + 5);
  13060. } catch (Exception e) {
  13061. e.printStackTrace();
  13062. return;
  13063. }
  13064. }
  13065. }
  13066.  
  13067. public void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  13068. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  13069. if (lowMem && j != plane)
  13070. return;
  13071. int i2 = 0;
  13072. if (j1 == 0)
  13073. i2 = worldController.method300(j, i1, i);
  13074. if (j1 == 1)
  13075. i2 = worldController.method301(j, i1, i);
  13076. if (j1 == 2)
  13077. i2 = worldController.method302(j, i1, i);
  13078. if (j1 == 3)
  13079. i2 = worldController.method303(j, i1, i);
  13080. if (i2 != 0) {
  13081. int i3 = worldController.method304(j, i1, i, i2);
  13082. int j2 = i2 >> 14 & 0x7fff;
  13083. int k2 = i3 & 0x1f;
  13084. int l2 = i3 >> 6;
  13085. if (j1 == 0) {
  13086. worldController.method291(i1, j, i, (byte) -119);
  13087. ObjectDef class46 = ObjectDef.forID(j2);
  13088. if (class46.aBoolean767)
  13089. aClass11Array1230[j].method215(l2, k2,
  13090. class46.aBoolean757, i1, i);
  13091. }
  13092. if (j1 == 1)
  13093. worldController.method292(i, j, i1);
  13094. if (j1 == 2) {
  13095. worldController.method293(j, i1, i);
  13096. ObjectDef class46_1 = ObjectDef.forID(j2);
  13097. if (i1 + class46_1.anInt744 > 103
  13098. || i + class46_1.anInt744 > 103
  13099. || i1 + class46_1.anInt761 > 103
  13100. || i + class46_1.anInt761 > 103)
  13101. return;
  13102. if (class46_1.aBoolean767)
  13103. aClass11Array1230[j].method216(l2, class46_1.anInt744,
  13104. i1, i, class46_1.anInt761,
  13105. class46_1.aBoolean757);
  13106. }
  13107. if (j1 == 3) {
  13108. worldController.method294(j, i, i1);
  13109. ObjectDef class46_2 = ObjectDef.forID(j2);
  13110. if (class46_2.aBoolean767 && class46_2.hasActions)
  13111. aClass11Array1230[j].method218(i, i1);
  13112. }
  13113. }
  13114. if (k1 >= 0) {
  13115. int j3 = j;
  13116. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  13117. j3++;
  13118. ObjectManager.method188(worldController, k, i, l, j3,
  13119. aClass11Array1230[j], intGroundArray, i1, k1, j);
  13120. }
  13121. }
  13122. }
  13123.  
  13124. public void updatePlayers(int i, Stream stream) {
  13125. anInt839 = 0;
  13126. anInt893 = 0;
  13127. method117(stream);
  13128. method134(stream);
  13129. method91(stream, i);
  13130. method49(stream);
  13131. for (int k = 0; k < anInt839; k++) {
  13132. int l = anIntArray840[k];
  13133. if (playerArray[l].anInt1537 != loopCycle)
  13134. playerArray[l] = null;
  13135. }
  13136.  
  13137. if (stream.currentOffset != i) {
  13138. signlink.reporterror("Error packet size mismatch in getplayer pos:"
  13139. + stream.currentOffset + " psize:" + i);
  13140. throw new RuntimeException("eek");
  13141. }
  13142. for (int i1 = 0; i1 < playerCount; i1++)
  13143. if (playerArray[playerIndices[i1]] == null) {
  13144. signlink.reporterror(myUsername
  13145. + " null entry in pl list - pos:" + i1 + " size:"
  13146. + playerCount);
  13147. throw new RuntimeException("eek");
  13148. }
  13149.  
  13150. }
  13151.  
  13152. public void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  13153. int l1 = 2048 - k & 0x7ff;
  13154. int i2 = 2048 - j1 & 0x7ff;
  13155. int j2 = 0;
  13156. int k2 = 0;
  13157. int l2 = j;
  13158. if (l1 != 0) {
  13159. int i3 = Model.modelIntArray1[l1];
  13160. int k3 = Model.modelIntArray2[l1];
  13161. int i4 = k2 * k3 - l2 * i3 >> 16;
  13162. l2 = k2 * i3 + l2 * k3 >> 16;
  13163. k2 = i4;
  13164. }
  13165. if (i2 != 0) {
  13166. /*
  13167. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  13168. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  13169. * l2 = fwdbwd; }
  13170. */
  13171. int j3 = Model.modelIntArray1[i2];
  13172. int l3 = Model.modelIntArray2[i2];
  13173. int j4 = l2 * j3 + j2 * l3 >> 16;
  13174. l2 = l2 * l3 - j2 * j3 >> 16;
  13175. j2 = j4;
  13176. }
  13177. xCameraPos = l - j2;
  13178. zCameraPos = i1 - k2;
  13179. yCameraPos = k1 - l2;
  13180. yCameraCurve = k;
  13181. xCameraCurve = j1;
  13182. }
  13183.  
  13184. public void updateStrings(String str, int i) {
  13185. switch (i) {
  13186. case 49020:
  13187. achievementCutoff = Integer.parseInt(str);
  13188. break;
  13189. case 1675:
  13190. sendFrame126(str, 17508);
  13191. break;// Stab
  13192. case 1676:
  13193. sendFrame126(str, 17509);
  13194. break;// Slash
  13195. case 1678:
  13196. sendFrame126(str, 17511);
  13197. break;// Magic
  13198. case 1679:
  13199. sendFrame126(str, 17512);
  13200. break;// Range
  13201. case 1680:
  13202. sendFrame126(str, 17513);
  13203. break;// Stab
  13204. case 1681:
  13205. sendFrame126(str, 17514);
  13206. break;// Slash
  13207. case 1682:
  13208. sendFrame126(str, 17515);
  13209. break;// Crush
  13210. case 1683:
  13211. sendFrame126(str, 17516);
  13212. break;// Magic
  13213. case 1684:
  13214. sendFrame126(str, 17517);
  13215. break;// Range
  13216. case 1686:
  13217. sendFrame126(str, 17518);
  13218. break;// Strength
  13219. case 1687:
  13220. sendFrame126(str, 17519);
  13221. break;// Prayer
  13222. }
  13223. }
  13224.  
  13225. private boolean broadcastUpdate = false;
  13226. public void sendFrame126(String str, int i) {
  13227. RSInterface.interfaceCache[i].message = str;
  13228. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  13229. needDrawTabArea = true;
  13230. if (i == 3755) {
  13231. broadcast = str;
  13232. broadcastUpdate = true;
  13233. pushMessage("<col=006600>Broadcast:</col> " + str, 0, "");
  13234. anInt1104 = 3000;
  13235. }
  13236. }
  13237.  
  13238. public void sendPacket185(int button, int toggle, int type) {
  13239. switch (type) {
  13240. case 135:
  13241. RSInterface class9 = RSInterface.interfaceCache[button];
  13242. boolean flag8 = true;
  13243. if (class9.contentType > 0)
  13244. flag8 = promptUserForInput(class9);
  13245. if (flag8) {
  13246. stream.createFrame(185);
  13247. stream.writeWord(button);
  13248. }
  13249. break;
  13250. case 646:
  13251. stream.createFrame(185);
  13252. stream.writeWord(button);
  13253. RSInterface class9_2 = RSInterface.interfaceCache[button];
  13254. if (class9_2.valueIndexArray != null
  13255. && class9_2.valueIndexArray[0][0] == 5) {
  13256. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  13257. variousSettings[toggle] = class9_2.anIntArray212[0];
  13258. method33(toggle);
  13259. needDrawTabArea = true;
  13260. }
  13261. }
  13262. break;
  13263. case 169:
  13264. stream.createFrame(185);
  13265. stream.writeWord(button);
  13266. RSInterface class9_3 = RSInterface.interfaceCache[button];
  13267. if (class9_3.valueIndexArray != null
  13268. && class9_3.valueIndexArray[0][0] == 5) {
  13269. variousSettings[toggle] = 1 - variousSettings[toggle];
  13270. method33(toggle);
  13271. needDrawTabArea = true;
  13272. }
  13273. switch (button) {
  13274. case 19136:
  13275. System.out.println("toggle = " + toggle);
  13276. if (toggle == 0)
  13277. sendFrame36(173, toggle);
  13278. if (toggle == 1)
  13279. sendPacket185(153, 173, 646);
  13280. break;
  13281. }
  13282. break;
  13283. }
  13284. }
  13285.  
  13286. public void sendFrame36(int id, int state) {
  13287. anIntArray1045[id] = state;
  13288. if (variousSettings[id] != state) {
  13289. variousSettings[id] = state;
  13290. method33(id);
  13291. needDrawTabArea = true;
  13292. if (dialogID != -1)
  13293. inputTaken = true;
  13294. }
  13295. }
  13296.  
  13297. public void sendFrame219() {
  13298. if (invOverlayInterfaceID != -1) {
  13299. invOverlayInterfaceID = -1;
  13300. needDrawTabArea = true;
  13301. tabAreaAltered = true;
  13302. }
  13303. if (backDialogID != -1) {
  13304. backDialogID = -1;
  13305. inputTaken = true;
  13306. }
  13307. if (inputDialogState != 0) {
  13308. inputDialogState = 0;
  13309. inputTaken = true;
  13310. }
  13311. openInterfaceID = -1;
  13312. aBoolean1149 = false;
  13313. }
  13314.  
  13315. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  13316. if (backDialogID != -1) {
  13317. backDialogID = -1;
  13318. inputTaken = true;
  13319. }
  13320. if (inputDialogState != 0) {
  13321. inputDialogState = 0;
  13322. inputTaken = true;
  13323. }
  13324. openInterfaceID = interfaceID;
  13325. invOverlayInterfaceID = sideInterfaceID;
  13326. needDrawTabArea = true;
  13327. tabAreaAltered = true;
  13328. aBoolean1149 = false;
  13329. }
  13330.  
  13331. private boolean parsePacket() {
  13332. if (socketStream == null)
  13333. return false;
  13334. try {
  13335. int i = socketStream.available();
  13336. if (i == 0)
  13337. return false;
  13338. if (pktType == -1) {
  13339. socketStream.flushInputStream(inStream.buffer, 1);
  13340. pktType = inStream.buffer[0] & 0xff;
  13341. if (encryption != null)
  13342. pktType = pktType - encryption.getNextKey() & 0xff;
  13343. pktSize = SizeConstants.packetSizes[pktType];
  13344. i--;
  13345. }
  13346. if (pktSize == -1)
  13347. if (i > 0) {
  13348. socketStream.flushInputStream(inStream.buffer, 1);
  13349. pktSize = inStream.buffer[0] & 0xff;
  13350. i--;
  13351. } else {
  13352. return false;
  13353. }
  13354. if (pktSize == -2)
  13355. if (i > 1) {
  13356. socketStream.flushInputStream(inStream.buffer, 2);
  13357. inStream.currentOffset = 0;
  13358. pktSize = inStream.readUnsignedWord();
  13359. i -= 2;
  13360. } else {
  13361. return false;
  13362. }
  13363. if (i < pktSize)
  13364. return false;
  13365. inStream.currentOffset = 0;
  13366. socketStream.flushInputStream(inStream.buffer, pktSize);
  13367. anInt1009 = 0;
  13368. anInt843 = anInt842;
  13369. anInt842 = anInt841;
  13370. anInt841 = pktType;
  13371. switch (pktType) {
  13372. case 81:
  13373. updatePlayers(pktSize, inStream);
  13374. aBoolean1080 = false;
  13375. pktType = -1;
  13376. return true;
  13377.  
  13378. case 176:
  13379. daysSinceRecovChange = inStream.method427();
  13380. unreadMessages = inStream.method435();
  13381. membersInt = inStream.readUnsignedByte();
  13382. anInt1193 = inStream.method440();
  13383. daysSinceLastLogin = inStream.readUnsignedWord();
  13384. if (anInt1193 != 0 && openInterfaceID == -1) {
  13385. signlink.dnslookup(TextClass.method586(anInt1193));
  13386. clearTopInterfaces();
  13387. char c = '\u028A';
  13388. if (daysSinceRecovChange != 201 || membersInt == 1)
  13389. c = '\u028F';
  13390. reportAbuseInput = "";
  13391. canMute = false;
  13392. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13393. if (RSInterface.interfaceCache[k9] == null
  13394. || RSInterface.interfaceCache[k9].contentType != c)
  13395. continue;
  13396. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13397.  
  13398. }
  13399. }
  13400. pktType = -1;
  13401. return true;
  13402.  
  13403. case 64:
  13404. anInt1268 = inStream.method427();
  13405. anInt1269 = inStream.method428();
  13406. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  13407. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  13408. if (groundArray[plane][j][l9] != null) {
  13409. groundArray[plane][j][l9] = null;
  13410. spawnGroundItem(j, l9);
  13411. }
  13412. }
  13413. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  13414. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  13415. .reverseGetNext())
  13416. if (class30_sub1.anInt1297 >= anInt1268
  13417. && class30_sub1.anInt1297 < anInt1268 + 8
  13418. && class30_sub1.anInt1298 >= anInt1269
  13419. && class30_sub1.anInt1298 < anInt1269 + 8
  13420. && class30_sub1.anInt1295 == plane)
  13421. class30_sub1.anInt1294 = 0;
  13422. pktType = -1;
  13423. return true;
  13424.  
  13425. case 9:
  13426. String text = inStream.readString();
  13427. byte state = inStream.readSignedByte();
  13428. byte seconds = inStream.readSignedByte();
  13429. fadingScreen = new FadingScreen(text, state, seconds);
  13430. pktType = -1;
  13431. return true;
  13432.  
  13433. case 185:
  13434. int k = inStream.method436();
  13435. RSInterface.interfaceCache[k].anInt233 = 3;
  13436. if (myPlayer.desc == null)
  13437. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  13438. + (myPlayer.anIntArray1700[4] << 20)
  13439. + (myPlayer.equipment[0] << 15)
  13440. + (myPlayer.equipment[8] << 10)
  13441. + (myPlayer.equipment[11] << 5)
  13442. + myPlayer.equipment[1];
  13443. else
  13444. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  13445. pktType = -1;
  13446. return true;
  13447.  
  13448. /* Clan message packet */
  13449. case 217:
  13450. try {
  13451. clanUsername = inStream.readString();
  13452. clanMessage = TextInput.processText(inStream.readString());
  13453. clanTitle = inStream.readString();
  13454. channelRights = inStream.readUnsignedWord();
  13455. pushMessage(clanMessage, 12, clanUsername);
  13456. } catch (Exception e) {
  13457. e.printStackTrace();
  13458. }
  13459. pktType = -1;
  13460. return true;
  13461.  
  13462. case 107:
  13463. aBoolean1160 = false;
  13464. for (int l = 0; l < 5; l++)
  13465. aBooleanArray876[l] = false;
  13466. xpCounter = 0;
  13467. pktType = -1;
  13468. return true;
  13469. case 72:
  13470. int i1 = inStream.method434();
  13471. RSInterface class9 = RSInterface.interfaceCache[i1];
  13472. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  13473. class9.inv[k15] = -1;
  13474. class9.inv[k15] = 0;
  13475. }
  13476. pktType = -1;
  13477. return true;
  13478.  
  13479. case 214:
  13480. ignoreCount = pktSize / 8;
  13481. for (int j1 = 0; j1 < ignoreCount; j1++)
  13482. ignoreListAsLongs[j1] = inStream.readQWord();
  13483. pktType = -1;
  13484. return true;
  13485.  
  13486. case 166:
  13487. aBoolean1160 = true;
  13488. anInt1098 = inStream.readUnsignedByte();
  13489. anInt1099 = inStream.readUnsignedByte();
  13490. anInt1100 = inStream.readUnsignedWord();
  13491. anInt1101 = inStream.readUnsignedByte();
  13492. anInt1102 = inStream.readUnsignedByte();
  13493. if (anInt1102 >= 100) {
  13494. xCameraPos = anInt1098 * 128 + 64;
  13495. yCameraPos = anInt1099 * 128 + 64;
  13496. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  13497. - anInt1100;
  13498. }
  13499. pktType = -1;
  13500. return true;
  13501.  
  13502. case 134:
  13503. needDrawTabArea = true;
  13504. int k1 = inStream.readUnsignedByte();
  13505. int i10 = inStream.method439();
  13506. int l15 = inStream.readUnsignedByte();
  13507. int xp = currentExp[k1];
  13508. currentExp[k1] = i10;
  13509. currentStats[k1] = l15;
  13510. maxStats[k1] = 1;
  13511. xpCounter += currentExp[k1] - xp;
  13512. expAdded = currentExp[k1] - xp;
  13513. expSkill = k1;
  13514. for (int k20 = 0; k20 < 98; k20++)
  13515. if (i10 >= anIntArray1019[k20])
  13516. maxStats[k1] = k20 + 2;
  13517. pktType = -1;
  13518. return true;
  13519.  
  13520. case 71:
  13521. int l1 = inStream.readUnsignedWord();
  13522. int j10 = inStream.method426();
  13523. if (l1 == 65535)
  13524. l1 = -1;
  13525. tabInterfaceIDs[j10] = l1;
  13526. needDrawTabArea = true;
  13527. tabAreaAltered = true;
  13528. pktType = -1;
  13529. return true;
  13530.  
  13531. case 74:
  13532. int i2 = inStream.method434();
  13533. if (i2 == 65535)
  13534. i2 = -1;
  13535. if (i2 != currentSong && musicEnabled && !lowMem
  13536. && prevSong == 0) {
  13537. nextSong = i2;
  13538. songChanging = true;
  13539. onDemandFetcher.method558(2, nextSong);
  13540. }
  13541. currentSong = i2;
  13542. pktType = -1;
  13543. return true;
  13544.  
  13545. case 121:
  13546. int j2 = inStream.method436();
  13547. int k10 = inStream.method435();
  13548. if (musicEnabled && !lowMem) {
  13549. nextSong = j2;
  13550. songChanging = false;
  13551. onDemandFetcher.method558(2, nextSong);
  13552. prevSong = k10;
  13553. }
  13554. pktType = -1;
  13555. return true;
  13556.  
  13557. case 7:
  13558. int componentId = inStream.readDWord();
  13559. byte spriteIndex = inStream.readSignedByte();
  13560. RSInterface component = RSInterface.interfaceCache[componentId];
  13561. if (component != null) {
  13562. if (component.backgroundSprites != null && spriteIndex <= component.backgroundSprites.length - 1) {
  13563. Sprite sprite = component.backgroundSprites[spriteIndex];
  13564. if (sprite != null) {
  13565. component.sprite1 = component.backgroundSprites[spriteIndex];
  13566. }
  13567. }
  13568. }
  13569. pktType = -1;
  13570. return true;
  13571.  
  13572. case 109:
  13573. resetLogout();
  13574. pktType = -1;
  13575. return false;
  13576.  
  13577. case 70:
  13578. int k2 = inStream.readSignedWord();
  13579. int l10 = inStream.method437();
  13580. int i16 = inStream.method434();
  13581. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  13582. class9_5.anInt263 = k2;
  13583. class9_5.anInt265 = l10;
  13584. pktType = -1;
  13585. return true;
  13586.  
  13587. case 73:
  13588. case 241:
  13589. int l2 = anInt1069;
  13590. int i11 = anInt1070;
  13591. if (pktType == 73) {
  13592. l2 = inStream.method435();
  13593. i11 = inStream.readUnsignedWord();
  13594. aBoolean1159 = false;
  13595. }
  13596. if (pktType == 241) {
  13597. i11 = inStream.method435();
  13598. inStream.initBitAccess();
  13599. for (int j16 = 0; j16 < 4; j16++) {
  13600. for (int l20 = 0; l20 < 13; l20++) {
  13601. for (int j23 = 0; j23 < 13; j23++) {
  13602. int i26 = inStream.readBits(1);
  13603. if (i26 == 1)
  13604. anIntArrayArrayArray1129[j16][l20][j23] = inStream
  13605. .readBits(26);
  13606. else
  13607. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  13608. }
  13609. }
  13610. }
  13611. inStream.finishBitAccess();
  13612. l2 = inStream.readUnsignedWord();
  13613. aBoolean1159 = true;
  13614. }
  13615. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  13616. pktType = -1;
  13617. return true;
  13618. }
  13619. anInt1069 = l2;
  13620. anInt1070 = i11;
  13621. baseX = (anInt1069 - 6) * 8;
  13622. baseY = (anInt1070 - 6) * 8;
  13623. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49)
  13624. && anInt1070 / 8 == 48;
  13625. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  13626. aBoolean1141 = true;
  13627. loadingStage = 1;
  13628. aLong824 = System.currentTimeMillis();
  13629. aRSImageProducer_1165.initDrawingArea();
  13630. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2);
  13631. DrawingArea.drawPixels(20, 3, 3, 0, 128);
  13632. aTextDrawingArea_1271.drawText(0, "Loading - Please Wait", 18,
  13633. 68);
  13634. aTextDrawingArea_1271.drawText(0xffffff,
  13635. "Loading - Please Wait", 17, 67);
  13636. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  13637. if (pktType == 73) {
  13638. int k16 = 0;
  13639. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  13640. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  13641. k16++;
  13642. }
  13643. aByteArrayArray1183 = new byte[k16][];
  13644. aByteArrayArray1247 = new byte[k16][];
  13645. anIntArray1234 = new int[k16];
  13646. anIntArray1235 = new int[k16];
  13647. anIntArray1236 = new int[k16];
  13648. k16 = 0;
  13649. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  13650. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  13651. anIntArray1234[k16] = (l23 << 8) + j26;
  13652. if (aBoolean1141
  13653. && (j26 == 49 || j26 == 149 || j26 == 147
  13654. || l23 == 50 || l23 == 49
  13655. && j26 == 47)) {
  13656. anIntArray1235[k16] = -1;
  13657. anIntArray1236[k16] = -1;
  13658. k16++;
  13659. } else {
  13660. int k28 = anIntArray1235[k16] = onDemandFetcher
  13661. .method562(0, j26, l23);
  13662. if (k28 != -1)
  13663. onDemandFetcher.method558(3, k28);
  13664. int j30 = anIntArray1236[k16] = onDemandFetcher
  13665. .method562(1, j26, l23);
  13666. if (j30 != -1)
  13667. onDemandFetcher.method558(3, j30);
  13668. k16++;
  13669. }
  13670. }
  13671. }
  13672. }
  13673. if (pktType == 241) {
  13674. int l16 = 0;
  13675. int ai[] = new int[676];
  13676. for (int i24 = 0; i24 < 4; i24++) {
  13677. for (int k26 = 0; k26 < 13; k26++) {
  13678. for (int l28 = 0; l28 < 13; l28++) {
  13679. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  13680. if (k30 != -1) {
  13681. int k31 = k30 >> 14 & 0x3ff;
  13682. int i32 = k30 >> 3 & 0x7ff;
  13683. int k32 = (k31 / 8 << 8) + i32 / 8;
  13684. for (int j33 = 0; j33 < l16; j33++) {
  13685. if (ai[j33] != k32)
  13686. continue;
  13687. k32 = -1;
  13688.  
  13689. }
  13690. if (k32 != -1)
  13691. ai[l16++] = k32;
  13692. }
  13693. }
  13694. }
  13695. }
  13696. aByteArrayArray1183 = new byte[l16][];
  13697. aByteArrayArray1247 = new byte[l16][];
  13698. anIntArray1234 = new int[l16];
  13699. anIntArray1235 = new int[l16];
  13700. anIntArray1236 = new int[l16];
  13701. for (int l26 = 0; l26 < l16; l26++) {
  13702. int i29 = anIntArray1234[l26] = ai[l26];
  13703. int l30 = i29 >> 8 & 0xff;
  13704. int l31 = i29 & 0xff;
  13705. int j32 = anIntArray1235[l26] = onDemandFetcher
  13706. .method562(0, l31, l30);
  13707. if (j32 != -1)
  13708. onDemandFetcher.method558(3, j32);
  13709. int i33 = anIntArray1236[l26] = onDemandFetcher
  13710. .method562(1, l31, l30);
  13711. if (i33 != -1)
  13712. onDemandFetcher.method558(3, i33);
  13713. }
  13714. }
  13715. int i17 = baseX - anInt1036;
  13716. int j21 = baseY - anInt1037;
  13717. anInt1036 = baseX;
  13718. anInt1037 = baseY;
  13719. for (int j24 = 0; j24 < 16384; j24++) {
  13720. NPC npc = npcArray[j24];
  13721. if (npc != null) {
  13722. for (int j29 = 0; j29 < 10; j29++) {
  13723. npc.smallX[j29] -= i17;
  13724. npc.smallY[j29] -= j21;
  13725. }
  13726. npc.x -= i17 * 128;
  13727. npc.y -= j21 * 128;
  13728. }
  13729. }
  13730. for (int i27 = 0; i27 < maxPlayers; i27++) {
  13731. Player player = playerArray[i27];
  13732. if (player != null) {
  13733. for (int i31 = 0; i31 < 10; i31++) {
  13734. player.smallX[i31] -= i17;
  13735. player.smallY[i31] -= j21;
  13736. }
  13737. player.x -= i17 * 128;
  13738. player.y -= j21 * 128;
  13739. }
  13740. }
  13741. aBoolean1080 = true;
  13742. byte byte1 = 0;
  13743. byte byte2 = 104;
  13744. byte byte3 = 1;
  13745. if (i17 < 0) {
  13746. byte1 = 103;
  13747. byte2 = -1;
  13748. byte3 = -1;
  13749. }
  13750. byte byte4 = 0;
  13751. byte byte5 = 104;
  13752. byte byte6 = 1;
  13753. if (j21 < 0) {
  13754. byte4 = 103;
  13755. byte5 = -1;
  13756. byte6 = -1;
  13757. }
  13758. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  13759. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  13760. int i34 = k33 + i17;
  13761. int j34 = l33 + j21;
  13762. for (int k34 = 0; k34 < 4; k34++)
  13763. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  13764. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  13765. else
  13766. groundArray[k34][k33][l33] = null;
  13767. }
  13768. }
  13769. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  13770. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  13771. .reverseGetNext()) {
  13772. class30_sub1_1.anInt1297 -= i17;
  13773. class30_sub1_1.anInt1298 -= j21;
  13774. if (class30_sub1_1.anInt1297 < 0
  13775. || class30_sub1_1.anInt1298 < 0
  13776. || class30_sub1_1.anInt1297 >= 104
  13777. || class30_sub1_1.anInt1298 >= 104)
  13778. class30_sub1_1.unlink();
  13779. }
  13780. if (destX != 0) {
  13781. destX -= i17;
  13782. destY -= j21;
  13783. }
  13784. aBoolean1160 = false;
  13785. pktType = -1;
  13786. return true;
  13787.  
  13788. case 208:
  13789. int i3 = inStream.method437();
  13790. if (i3 >= 0)
  13791. method60(i3);
  13792. anInt1018 = i3;
  13793. pktType = -1;
  13794. return true;
  13795.  
  13796. case 99:
  13797. /*
  13798. * Black map, mape state 2, causes blackness
  13799. */
  13800. anInt1021 = inStream.readUnsignedByte();
  13801. pktType = -1;
  13802. return true;
  13803.  
  13804. case 75:
  13805. int j3 = inStream.method436();
  13806. int j11 = inStream.method436();
  13807. RSInterface.interfaceCache[j11].anInt233 = 2;
  13808. RSInterface.interfaceCache[j11].mediaID = j3;
  13809. pktType = -1;
  13810. return true;
  13811.  
  13812. case 114:
  13813. anInt1104 = inStream.method434() * 30;
  13814. pktType = -1;
  13815. return true;
  13816.  
  13817. case 60:
  13818. anInt1269 = inStream.readUnsignedByte();
  13819. anInt1268 = inStream.method427();
  13820. while (inStream.currentOffset < pktSize) {
  13821. int k3 = inStream.readUnsignedByte();
  13822. method137(inStream, k3);
  13823. }
  13824. pktType = -1;
  13825. return true;
  13826.  
  13827. case 35:
  13828. int l3 = inStream.readUnsignedByte();
  13829. int k11 = inStream.readUnsignedByte();
  13830. int j17 = inStream.readUnsignedByte();
  13831. int k21 = inStream.readUnsignedByte();
  13832. aBooleanArray876[l3] = true;
  13833. anIntArray873[l3] = k11;
  13834. anIntArray1203[l3] = j17;
  13835. anIntArray928[l3] = k21;
  13836. anIntArray1030[l3] = 0;
  13837. pktType = -1;
  13838. return true;
  13839.  
  13840. case 174:
  13841. int i4 = inStream.readUnsignedWord();
  13842. int l11 = inStream.readUnsignedByte();
  13843. int k17 = inStream.readUnsignedWord();
  13844. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  13845. anIntArray1207[anInt1062] = i4;
  13846. anIntArray1241[anInt1062] = l11;
  13847. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  13848. anInt1062++;
  13849. }
  13850. pktType = -1;
  13851. return true;
  13852.  
  13853. case 104:
  13854. int j4 = inStream.method427();
  13855. int i12 = inStream.method426();
  13856. String s6 = inStream.readString();
  13857. if (j4 >= 1 && j4 <= atPlayerActions.length) {
  13858. if (s6.equalsIgnoreCase("null"))
  13859. s6 = null;
  13860. atPlayerActions[j4 - 1] = s6;
  13861. atPlayerArray[j4 - 1] = i12 == 0;
  13862. }
  13863. pktType = -1;
  13864. return true;
  13865.  
  13866. case 78:
  13867. destX = 0;
  13868. pktType = -1;
  13869. return true;
  13870.  
  13871. case 253:
  13872. String s = inStream.readString();
  13873. if (s.endsWith(":tradereq:")) {
  13874. String s3 = s.substring(0, s.indexOf(":"));
  13875. long l17 = TextClass.longForName(s3);
  13876. boolean flag2 = false;
  13877. for (int j27 = 0; j27 < ignoreCount; j27++) {
  13878. if (ignoreListAsLongs[j27] != l17)
  13879. continue;
  13880. flag2 = true;
  13881. }
  13882. if (!flag2 && anInt1251 == 0)
  13883. pushMessage("wishes to trade with you.", 4, s3);
  13884. } else if (s.startsWith("//")) {
  13885. s = s.replaceAll("//", "");
  13886. pushMessage(s, 13, "");
  13887. } else if (s.startsWith("/")) {
  13888. s = s.replaceAll("/", "");
  13889. pushMessage(s, 11, "");
  13890. } else if (s.endsWith("#url#")) {
  13891. String link = s.substring(0, s.indexOf("#"));
  13892. pushMessage("Join us at: ", 9, link);
  13893. } else if (s.endsWith(":duelreq:")) {
  13894. String s4 = s.substring(0, s.indexOf(":"));
  13895. long l18 = TextClass.longForName(s4);
  13896. boolean flag3 = false;
  13897. for (int k27 = 0; k27 < ignoreCount; k27++) {
  13898. if (ignoreListAsLongs[k27] != l18)
  13899. continue;
  13900. flag3 = true;
  13901.  
  13902. }
  13903. if (!flag3 && anInt1251 == 0)
  13904. pushMessage("wishes to duel with you.", 8, s4);
  13905. } else if (s.endsWith(":chalreq:")) {
  13906. String s5 = s.substring(0, s.indexOf(":"));
  13907. long l19 = TextClass.longForName(s5);
  13908. boolean flag4 = false;
  13909. for (int l27 = 0; l27 < ignoreCount; l27++) {
  13910. if (ignoreListAsLongs[l27] != l19)
  13911. continue;
  13912. flag4 = true;
  13913.  
  13914. }
  13915. if (!flag4 && anInt1251 == 0) {
  13916. String s8 = s.substring(s.indexOf(":") + 1,
  13917. s.length() - 9);
  13918. pushMessage(s8, 8, s5);
  13919. }
  13920. } else {
  13921. pushMessage(s, 0, "");
  13922. }
  13923. pktType = -1;
  13924. return true;
  13925.  
  13926. case 1:
  13927. for (int k4 = 0; k4 < playerArray.length; k4++)
  13928. if (playerArray[k4] != null)
  13929. playerArray[k4].anim = -1;
  13930. for (int j12 = 0; j12 < npcArray.length; j12++)
  13931. if (npcArray[j12] != null)
  13932. npcArray[j12].anim = -1;
  13933. pktType = -1;
  13934. return true;
  13935.  
  13936. case 50:
  13937. long l4 = inStream.readQWord();
  13938. int i18 = inStream.readUnsignedByte();
  13939. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  13940. for (int k24 = 0; k24 < friendsCount; k24++) {
  13941. if (l4 != friendsListAsLongs[k24])
  13942. continue;
  13943. if (friendsNodeIDs[k24] != i18) {
  13944. friendsNodeIDs[k24] = i18;
  13945. needDrawTabArea = true;
  13946. if (i18 > 0)
  13947. pushMessage(s7 + " has logged in.", 5, "");
  13948. if (i18 == 0)
  13949. pushMessage(s7 + " has logged out.", 5, "");
  13950. }
  13951. s7 = null;
  13952. break;
  13953. }
  13954. if (s7 != null && friendsCount < 200) {
  13955. friendsListAsLongs[friendsCount] = l4;
  13956. friendsList[friendsCount] = s7;
  13957. friendsNodeIDs[friendsCount] = i18;
  13958. friendsCount++;
  13959. needDrawTabArea = true;
  13960. }
  13961. for (boolean flag6 = false; !flag6;) {
  13962. flag6 = true;
  13963. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  13964. if (friendsNodeIDs[k29] != nodeID
  13965. && friendsNodeIDs[k29 + 1] == nodeID
  13966. || friendsNodeIDs[k29] == 0
  13967. && friendsNodeIDs[k29 + 1] != 0) {
  13968. int j31 = friendsNodeIDs[k29];
  13969. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  13970. friendsNodeIDs[k29 + 1] = j31;
  13971. String s10 = friendsList[k29];
  13972. friendsList[k29] = friendsList[k29 + 1];
  13973. friendsList[k29 + 1] = s10;
  13974. long l32 = friendsListAsLongs[k29];
  13975. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  13976. friendsListAsLongs[k29 + 1] = l32;
  13977. needDrawTabArea = true;
  13978. flag6 = false;
  13979. }
  13980. }
  13981. pktType = -1;
  13982. return true;
  13983.  
  13984. case 110:
  13985. if (tabID == 12)
  13986. needDrawTabArea = true;
  13987. energy = inStream.readUnsignedByte();
  13988. pktType = -1;
  13989. return true;
  13990.  
  13991. case 254:
  13992. anInt855 = inStream.readUnsignedByte();
  13993. if (anInt855 == 1)
  13994. anInt1222 = inStream.readUnsignedWord();
  13995. if (anInt855 >= 2 && anInt855 <= 6) {
  13996. if (anInt855 == 2) {
  13997. anInt937 = 64;
  13998. anInt938 = 64;
  13999. }
  14000. if (anInt855 == 3) {
  14001. anInt937 = 0;
  14002. anInt938 = 64;
  14003. }
  14004. if (anInt855 == 4) {
  14005. anInt937 = 128;
  14006. anInt938 = 64;
  14007. }
  14008. if (anInt855 == 5) {
  14009. anInt937 = 64;
  14010. anInt938 = 0;
  14011. }
  14012. if (anInt855 == 6) {
  14013. anInt937 = 64;
  14014. anInt938 = 128;
  14015. }
  14016. anInt855 = 2;
  14017. anInt934 = inStream.readUnsignedWord();
  14018. anInt935 = inStream.readUnsignedWord();
  14019. anInt936 = inStream.readUnsignedByte();
  14020. }
  14021. if (anInt855 == 10)
  14022. anInt933 = inStream.readUnsignedWord();
  14023. pktType = -1;
  14024. return true;
  14025.  
  14026. case 248:
  14027. int i5 = inStream.method435();
  14028. int k12 = inStream.readUnsignedWord();
  14029. if (backDialogID != -1) {
  14030. backDialogID = -1;
  14031. inputTaken = true;
  14032. }
  14033. if (inputDialogState != 0) {
  14034. inputDialogState = 0;
  14035. inputTaken = true;
  14036. }
  14037. if (i5 == 55000) {
  14038. RSInterface.interfaceCache[55010].scrollPosition = 0;
  14039. RSInterface.interfaceCache[55050].scrollPosition = 0;
  14040. }
  14041. openInterfaceID = i5;
  14042. invOverlayInterfaceID = k12;
  14043. needDrawTabArea = true;
  14044. tabAreaAltered = true;
  14045. aBoolean1149 = false;
  14046. pktType = -1;
  14047. return true;
  14048.  
  14049. case 79:
  14050. int j5 = inStream.method434();
  14051. int l12 = inStream.method435();
  14052. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  14053. if (class9_3 != null && class9_3.type == 0) {
  14054. if (l12 < 0)
  14055. l12 = 0;
  14056. if (l12 > class9_3.scrollMax - class9_3.height)
  14057. l12 = class9_3.scrollMax - class9_3.height;
  14058. class9_3.scrollPosition = l12;
  14059. }
  14060. pktType = -1;
  14061. return true;
  14062.  
  14063. case 68:
  14064. for (int k5 = 0; k5 < variousSettings.length; k5++)
  14065. if (variousSettings[k5] != anIntArray1045[k5]) {
  14066. variousSettings[k5] = anIntArray1045[k5];
  14067. method33(k5);
  14068. needDrawTabArea = true;
  14069. }
  14070. pktType = -1;
  14071. return true;
  14072.  
  14073. case 196:
  14074. long l5 = inStream.readQWord();
  14075. inStream.readDWord();
  14076. int l21 = inStream.readUnsignedByte();
  14077. boolean flag5 = false;
  14078. if (l21 <= 1) {
  14079. for (int l29 = 0; l29 < ignoreCount; l29++) {
  14080. if (ignoreListAsLongs[l29] != l5)
  14081. continue;
  14082. flag5 = true;
  14083.  
  14084. }
  14085. }
  14086. if (!flag5 && anInt1251 == 0)
  14087. try {
  14088. String s9 = TextInput.method525(pktSize - 13, inStream);
  14089. switch (l21) {
  14090. case 1:
  14091. pushMessage(
  14092. s9,
  14093. 7,
  14094. "@cr1@"
  14095. + TextClass.fixName(TextClass
  14096. .nameForLong(l5)));
  14097. break;
  14098. case 2:
  14099. pushMessage(
  14100. s9,
  14101. 7,
  14102. "@cr2@"
  14103. + TextClass.fixName(TextClass
  14104. .nameForLong(l5)));
  14105. break;
  14106. case 3:
  14107. pushMessage(
  14108. s9,
  14109. 7,
  14110. "@cr3@"
  14111. + TextClass.fixName(TextClass
  14112. .nameForLong(l5)));
  14113. break;
  14114. case 4:
  14115. pushMessage(
  14116. s9,
  14117. 7,
  14118. "@cr4@"
  14119. + TextClass.fixName(TextClass
  14120. .nameForLong(l5)));
  14121. break;
  14122. case 5:
  14123. pushMessage(
  14124. s9,
  14125. 7,
  14126. "@cr5@"
  14127. + TextClass.fixName(TextClass
  14128. .nameForLong(l5)));
  14129. break;
  14130. case 6:
  14131. pushMessage(
  14132. s9,
  14133. 7,
  14134. "@cr6@"
  14135. + TextClass.fixName(TextClass
  14136. .nameForLong(l5)));
  14137. break;
  14138. case 7:
  14139. pushMessage(
  14140. s9,
  14141. 7,
  14142. "@cr7@"
  14143. + TextClass.fixName(TextClass
  14144. .nameForLong(l5)));
  14145. break;
  14146. case 8:
  14147. pushMessage(
  14148. s9,
  14149. 7,
  14150. "@cr8@"
  14151. + TextClass.fixName(TextClass
  14152. .nameForLong(l5)));
  14153. break;
  14154. case 9:
  14155. pushMessage(
  14156. s9,
  14157. 7,
  14158. "@cr9@"
  14159. + TextClass.fixName(TextClass
  14160. .nameForLong(l5)));
  14161. break;
  14162. case 10:
  14163. pushMessage(
  14164. s9,
  14165. 7,
  14166. "@cr10@"
  14167. + TextClass.fixName(TextClass
  14168. .nameForLong(l5)));
  14169. break;
  14170. case 11:
  14171. pushMessage(
  14172. s9,
  14173. 7,
  14174. "@cr11@"
  14175. + TextClass.fixName(TextClass
  14176. .nameForLong(l5)));
  14177. break;
  14178. default:
  14179. pushMessage(s9, 3, TextClass.fixName(TextClass
  14180. .nameForLong(l5)));
  14181. }
  14182. } catch (Exception exception1) {
  14183. signlink.reporterror("cde1");
  14184. }
  14185. pktType = -1;
  14186. return true;
  14187.  
  14188. case 85:
  14189. anInt1269 = inStream.method427();
  14190. anInt1268 = inStream.method427();
  14191. pktType = -1;
  14192. return true;
  14193.  
  14194. case 24:
  14195. anInt1054 = inStream.method428();
  14196. if (anInt1054 == tabID) {
  14197. if (anInt1054 == 3)
  14198. tabID = 1;
  14199. else
  14200. tabID = 3;
  14201. needDrawTabArea = true;
  14202. }
  14203. pktType = -1;
  14204. return true;
  14205.  
  14206. case 246:
  14207. int i6 = inStream.method434();
  14208. int i13 = inStream.readUnsignedWord();
  14209. int k18 = inStream.readUnsignedWord();
  14210. if (k18 == 65535) {
  14211. RSInterface.interfaceCache[i6].anInt233 = 0;
  14212. pktType = -1;
  14213. return true;
  14214. } else {
  14215. ItemDef itemDef = ItemDef.forID(k18);
  14216. RSInterface.interfaceCache[i6].anInt233 = 4;
  14217. RSInterface.interfaceCache[i6].mediaID = k18;
  14218. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.rotationX;
  14219. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.rotationY;
  14220. RSInterface.interfaceCache[i6].modelZoom = (itemDef.zoom * 100)
  14221. / i13;
  14222. pktType = -1;
  14223. return true;
  14224. }
  14225.  
  14226. case 171:
  14227. boolean flag1 = inStream.readUnsignedByte() == 1;
  14228. int j13 = inStream.readUnsignedWord();
  14229. if (RSInterface.interfaceCache[j13] != null)
  14230. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  14231. pktType = -1;
  14232. return true;
  14233.  
  14234. case 142:
  14235. int j6 = inStream.method434();
  14236. method60(j6);
  14237. if (backDialogID != -1) {
  14238. backDialogID = -1;
  14239. inputTaken = true;
  14240. }
  14241. if (inputDialogState != 0) {
  14242. inputDialogState = 0;
  14243. inputTaken = true;
  14244. }
  14245. invOverlayInterfaceID = j6;
  14246. needDrawTabArea = true;
  14247. tabAreaAltered = true;
  14248. openInterfaceID = -1;
  14249. aBoolean1149 = false;
  14250. pktType = -1;
  14251. return true;
  14252.  
  14253. case 126:
  14254. try {
  14255. text = inStream.readString();
  14256. int frame = inStream.method435();
  14257. if (text.startsWith("www.")) {
  14258. launchURL(text);
  14259. pktType = -1;
  14260. return true;
  14261. }
  14262. updateStrings(text, frame);
  14263. sendFrame126(text, frame);
  14264. if (frame >= 18144 && frame <= 18244) {
  14265. clanList[frame - 18144] = text;
  14266. }
  14267. } catch (Exception e) {
  14268. e.printStackTrace();
  14269. }
  14270. pktType = -1;
  14271. return true;
  14272.  
  14273. case 206:
  14274. publicChatMode = inStream.readUnsignedByte();
  14275. privateChatMode = inStream.readUnsignedByte();
  14276. tradeMode = inStream.readUnsignedByte();
  14277. aBoolean1233 = true;
  14278. inputTaken = true;
  14279. pktType = -1;
  14280. return true;
  14281.  
  14282. case 240:
  14283. if (tabID == 12)
  14284. needDrawTabArea = true;
  14285. weight = inStream.readSignedWord();
  14286. pktType = -1;
  14287. return true;
  14288.  
  14289. case 8:
  14290. int k6 = inStream.method436();
  14291. int l13 = inStream.readUnsignedWord();
  14292. RSInterface.interfaceCache[k6].anInt233 = 1;
  14293. RSInterface.interfaceCache[k6].mediaID = l13;
  14294. pktType = -1;
  14295. return true;
  14296.  
  14297. case 122:
  14298. int l6 = inStream.method436();
  14299. int i14 = inStream.method436();
  14300. int i19 = i14 >> 10 & 0x1f;
  14301. int i22 = i14 >> 5 & 0x1f;
  14302. int l24 = i14 & 0x1f;
  14303. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  14304. + (i22 << 11) + (l24 << 3);
  14305. pktType = -1;
  14306. return true;
  14307.  
  14308. case 53:
  14309. needDrawTabArea = true;
  14310. int i7 = inStream.readUnsignedWord();
  14311. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  14312. int j19 = inStream.readUnsignedWord();
  14313. for (int j22 = 0; j22 < j19; j22++) {
  14314. int i25 = inStream.readUnsignedByte();
  14315. if (i25 == 255)
  14316. i25 = inStream.method440();
  14317. class9_1.inv[j22] = inStream.method436();
  14318. class9_1.invStackSizes[j22] = i25;
  14319. }
  14320. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  14321. class9_1.inv[j25] = 0;
  14322. class9_1.invStackSizes[j25] = 0;
  14323. }
  14324. pktType = -1;
  14325. return true;
  14326.  
  14327. case 230:
  14328. int j7 = inStream.method435();
  14329. int j14 = inStream.readUnsignedWord();
  14330. int k19 = inStream.readUnsignedWord();
  14331. int k22 = inStream.method436();
  14332. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  14333. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  14334. RSInterface.interfaceCache[j14].modelZoom = j7;
  14335. pktType = -1;
  14336. return true;
  14337.  
  14338. case 221:
  14339. anInt900 = inStream.readUnsignedByte();
  14340. needDrawTabArea = true;
  14341. pktType = -1;
  14342. return true;
  14343.  
  14344. case 177:
  14345. //setNorth();
  14346. aBoolean1160 = true;
  14347. anInt995 = inStream.readUnsignedByte();
  14348. anInt996 = inStream.readUnsignedByte();
  14349. anInt997 = inStream.readUnsignedWord();
  14350. anInt998 = inStream.readUnsignedByte();
  14351. anInt999 = inStream.readUnsignedByte();
  14352. if (anInt999 >= 100) {
  14353. int k7 = anInt995 * 128 + 64;
  14354. int k14 = anInt996 * 128 + 64;
  14355. int i20 = method42(plane, k14, k7) - anInt997;
  14356. int l22 = k7 - xCameraPos;
  14357. int k25 = i20 - zCameraPos;
  14358. int j28 = k14 - yCameraPos;
  14359. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  14360. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14361. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14362. if (yCameraCurve < 128)
  14363. yCameraCurve = 128;
  14364. if (yCameraCurve > 383)
  14365. yCameraCurve = 383;
  14366. }
  14367. pktType = -1;
  14368. return true;
  14369.  
  14370. case 249:
  14371. anInt1046 = inStream.method426();
  14372. unknownInt10 = inStream.method436();
  14373. pktType = -1;
  14374. return true;
  14375.  
  14376. case 65:
  14377. updateNPCs(inStream, pktSize);
  14378. pktType = -1;
  14379. return true;
  14380.  
  14381. case 27:
  14382. messagePromptRaised = false;
  14383. inputDialogState = 1;
  14384. amountOrNameInput = "";
  14385. inputTaken = true;
  14386. pktType = -1;
  14387. return true;
  14388.  
  14389. case 187:
  14390. messagePromptRaised = false;
  14391. inputDialogState = 2;
  14392. amountOrNameInput = "";
  14393. inputTaken = true;
  14394. pktType = -1;
  14395. return true;
  14396.  
  14397. case 97:
  14398. int l7 = inStream.readUnsignedWord();
  14399. method60(l7);
  14400. if (invOverlayInterfaceID != -1) {
  14401. invOverlayInterfaceID = -1;
  14402. needDrawTabArea = true;
  14403. tabAreaAltered = true;
  14404. }
  14405. if (backDialogID != -1) {
  14406. backDialogID = -1;
  14407. inputTaken = true;
  14408. }
  14409. if (inputDialogState != 0) {
  14410. inputDialogState = 0;
  14411. inputTaken = true;
  14412. }
  14413. // 17511 = Question Type
  14414. // 15819 = Christmas Type
  14415. // 15812 = Security Type
  14416. // 15801 = Item Scam Type
  14417. // 15791 = Password Safety ?
  14418. // 15774 = Good/Bad Password
  14419. // 15767 = Drama Type ????
  14420. if (l7 == 15244) {
  14421. openInterfaceID = 15767;
  14422. fullscreenInterfaceID = 15244;
  14423. } else {
  14424. openInterfaceID = l7;
  14425. }
  14426. aBoolean1149 = false;
  14427. pktType = -1;
  14428. return true;
  14429.  
  14430. case 218:
  14431. int i8 = inStream.method438();
  14432. dialogID = i8;
  14433. inputTaken = true;
  14434. pktType = -1;
  14435. return true;
  14436.  
  14437. case 87:
  14438. int j8 = inStream.method434();
  14439. int l14 = inStream.method439();
  14440. anIntArray1045[j8] = l14;
  14441. if (variousSettings[j8] != l14) {
  14442. variousSettings[j8] = l14;
  14443. method33(j8);
  14444. needDrawTabArea = true;
  14445. if (dialogID != -1)
  14446. inputTaken = true;
  14447. }
  14448. pktType = -1;
  14449. return true;
  14450.  
  14451. case 36:
  14452. int k8 = inStream.method434();
  14453. byte byte0 = inStream.readSignedByte();
  14454. anIntArray1045[k8] = byte0;
  14455. if (variousSettings[k8] != byte0) {
  14456. variousSettings[k8] = byte0;
  14457. method33(k8);
  14458. needDrawTabArea = true;
  14459. if (dialogID != -1)
  14460. inputTaken = true;
  14461. }
  14462. pktType = -1;
  14463. return true;
  14464.  
  14465. case 61:
  14466. anInt1055 = inStream.readUnsignedByte();
  14467. pktType = -1;
  14468. return true;
  14469.  
  14470. case 200:
  14471. int l8 = inStream.readUnsignedWord();
  14472. int i15 = inStream.readSignedWord();
  14473. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14474. class9_4.anInt257 = i15;
  14475. if (i15 == 591 || i15 == 588) {
  14476. class9_4.modelZoom = 900; // anInt269
  14477. }
  14478. if (i15 == -1) {
  14479. class9_4.anInt246 = 0;
  14480. class9_4.anInt208 = 0;
  14481. }
  14482. pktType = -1;
  14483. return true;
  14484.  
  14485. case 219:
  14486. if (invOverlayInterfaceID != -1) {
  14487. invOverlayInterfaceID = -1;
  14488. needDrawTabArea = true;
  14489. tabAreaAltered = true;
  14490. }
  14491. if (backDialogID != -1) {
  14492. backDialogID = -1;
  14493. inputTaken = true;
  14494. }
  14495. if (inputDialogState != 0) {
  14496. inputDialogState = 0;
  14497. inputTaken = true;
  14498. }
  14499. if (this.isFieldInFocus()) {
  14500. this.resetInputFieldFocus();
  14501. this.inputString = "";
  14502. }
  14503. openInterfaceID = -1;
  14504. aBoolean1149 = false;
  14505. pktType = -1;
  14506. return true;
  14507.  
  14508. case 34:
  14509. needDrawTabArea = true;
  14510. int i9 = inStream.readUnsignedWord();
  14511. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14512. while (inStream.currentOffset < pktSize) {
  14513. int j20 = inStream.method422();
  14514. int i23 = inStream.readUnsignedWord();
  14515. int l25 = inStream.readUnsignedByte();
  14516. if (l25 == 255)
  14517. l25 = inStream.readDWord();
  14518. if (j20 >= 0 && j20 < class9_2.inv.length) {
  14519. class9_2.inv[j20] = i23;
  14520. class9_2.invStackSizes[j20] = l25;
  14521. }
  14522. }
  14523. pktType = -1;
  14524. return true;
  14525.  
  14526. case 4:
  14527. case 44:
  14528. case 84:
  14529. case 101:
  14530. case 105:
  14531. case 117:
  14532. case 147:
  14533. case 151:
  14534. case 156:
  14535. case 160:
  14536. case 215:
  14537. method137(inStream, pktType);
  14538. pktType = -1;
  14539. return true;
  14540.  
  14541. case 106:
  14542. tabID = inStream.method427();
  14543. needDrawTabArea = true;
  14544. tabAreaAltered = true;
  14545. pktType = -1;
  14546. return true;
  14547.  
  14548. case 164:
  14549. int j9 = inStream.method434();
  14550. method60(j9);
  14551. if (invOverlayInterfaceID != -1) {
  14552. invOverlayInterfaceID = -1;
  14553. needDrawTabArea = true;
  14554. tabAreaAltered = true;
  14555. }
  14556. backDialogID = j9;
  14557. inputTaken = true;
  14558. openInterfaceID = -1;
  14559. aBoolean1149 = false;
  14560. pktType = -1;
  14561. return true;
  14562.  
  14563. }
  14564. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  14565. + anInt842 + "," + anInt843);
  14566. resetLogout();
  14567. } catch (IOException _ex) {
  14568. dropClient();
  14569. } catch (Exception exception) {
  14570. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  14571. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  14572. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  14573. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  14574. s2 = s2 + inStream.buffer[j15] + ",";
  14575. exception.printStackTrace();
  14576. signlink.reporterror(s2);
  14577. resetLogout();
  14578. }
  14579. return true;
  14580. }
  14581.  
  14582. public void method146() {
  14583. anInt1265++;
  14584. method47(true);
  14585. method26(true);
  14586. method47(false);
  14587. method26(false);
  14588. method55();
  14589. method104();
  14590. if (!aBoolean1160) {
  14591. int i = anInt1184;
  14592. if (anInt984 / 256 > i)
  14593. i = anInt984 / 256;
  14594. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  14595. i = anIntArray1203[4] + 128;
  14596. int k = viewRotation + viewRotationOffset & 0x7ff;
  14597. setCameraPos(600 + i * 3, i, anInt1014,
  14598. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  14599. }
  14600. int j;
  14601. if (!aBoolean1160)
  14602. j = method120();
  14603. else
  14604. j = method121();
  14605. int l = xCameraPos;
  14606. int i1 = zCameraPos;
  14607. int j1 = yCameraPos;
  14608. int k1 = yCameraCurve;
  14609. int l1 = xCameraCurve;
  14610. for (int i2 = 0; i2 < 5; i2++)
  14611. if (aBooleanArray876[i2]) {
  14612. int j2 = (int) ((Math.random() * (anIntArray873[i2] * 2 + 1) - anIntArray873[i2]) + Math
  14613. .sin(anIntArray1030[i2] * (anIntArray928[i2] / 100D))
  14614. * anIntArray1203[i2]);
  14615. if (i2 == 0)
  14616. xCameraPos += j2;
  14617. if (i2 == 1)
  14618. zCameraPos += j2;
  14619. if (i2 == 2)
  14620. yCameraPos += j2;
  14621. if (i2 == 3)
  14622. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  14623. if (i2 == 4) {
  14624. yCameraCurve += j2;
  14625. if (yCameraCurve < 128)
  14626. yCameraCurve = 128;
  14627. if (yCameraCurve > 383)
  14628. yCameraCurve = 383;
  14629. }
  14630. }
  14631. int k2 = Texture.anInt1481;
  14632. Model.aBoolean1684 = true;
  14633. Model.anInt1687 = 0;
  14634. Model.anInt1685 = super.mouseX - 4;
  14635. Model.anInt1686 = super.mouseY - 4;
  14636. DrawingArea.setAllPixelsToZero();
  14637. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  14638. zCameraPos, j, yCameraCurve);
  14639. worldController.clearObj5Cache();
  14640. updateEntities();
  14641. drawHeadIcon();
  14642. method37(k2);
  14643. draw3dScreen();
  14644. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  14645. xCameraPos = l;
  14646. zCameraPos = i1;
  14647. yCameraPos = j1;
  14648. yCameraCurve = k1;
  14649. xCameraCurve = l1;
  14650. }
  14651.  
  14652. public void clearTopInterfaces() {
  14653. stream.createFrame(130);
  14654. if (invOverlayInterfaceID != -1) {
  14655. invOverlayInterfaceID = -1;
  14656. needDrawTabArea = true;
  14657. aBoolean1149 = false;
  14658. tabAreaAltered = true;
  14659. }
  14660. if (backDialogID != -1) {
  14661. backDialogID = -1;
  14662. inputTaken = true;
  14663. aBoolean1149 = false;
  14664. }
  14665. openInterfaceID = -1;
  14666. fullscreenInterfaceID = -1;
  14667. }
  14668.  
  14669. public static boolean newDamage = false, normalLogin = true,
  14670. showFlames = false, showLogo = false, normalLogin2 = true;// KEEP
  14671. // TRUE!
  14672. private Sprite worldMapIcon508;
  14673. private Sprite worldMapIcon525;
  14674. private Sprite logIconH;
  14675. private Sprite logIconC;
  14676. private Sprite logIcon;
  14677. private Sprite[] chatButtons;
  14678.  
  14679. private Sprite[] ORBS = new Sprite[57];
  14680. private DecimalFormat format;
  14681. public float LP;
  14682.  
  14683. client() {
  14684. try {
  14685. readSettings();
  14686. } catch (IOException e) {
  14687. }
  14688. if (revision474 == true) {
  14689. revision498 = false;
  14690. }
  14691. if (revision498 = true) {
  14692. revision498 = false;
  14693. revision474 = true;
  14694. }
  14695. xpAddedPos = expAdded = 0;
  14696. xpLock = false;
  14697. xpCounter = 0;
  14698. counter = new Sprite[4];
  14699. setFormat(new DecimalFormat());
  14700. chatRights = new int[500];
  14701. fullscreenInterfaceID = -1;
  14702. chatTypeView = 0;
  14703. clanTitles = new String[500];
  14704. clanChatMode = 0;
  14705. cButtonHPos = -1;
  14706. cButtonCPos = 0;
  14707. server = Configuration.getAddress();
  14708. anIntArrayArray825 = new int[104][104];
  14709. friendsNodeIDs = new int[200];
  14710. groundArray = new NodeList[4][104][104];
  14711. aBoolean831 = false;
  14712. aStream_834 = new Stream(new byte[5000]);
  14713. npcArray = new NPC[16384];
  14714. npcIndices = new int[16384];
  14715. anIntArray840 = new int[1000];
  14716. aStream_847 = Stream.create();
  14717. aBoolean848 = true;
  14718. openInterfaceID = -1;
  14719. currentExp = new int[Skills.skillsCount];
  14720. aBoolean872 = false;
  14721. anIntArray873 = new int[5];
  14722. anInt874 = -1;
  14723. aBooleanArray876 = new boolean[5];
  14724. drawFlames = false;
  14725. reportAbuseInput = "";
  14726. unknownInt10 = -1;
  14727. menuOpen = false;
  14728. inputString = "";
  14729. maxPlayers = 2048;
  14730. myPlayerIndex = 2047;
  14731. playerArray = new Player[maxPlayers];
  14732. playerIndices = new int[maxPlayers];
  14733. anIntArray894 = new int[maxPlayers];
  14734. aStreamArray895s = new Stream[maxPlayers];
  14735. anIntArrayArray901 = new int[104][104];
  14736. aByteArray912 = new byte[16384];
  14737. currentStats = new int[Skills.skillsCount];
  14738. ignoreListAsLongs = new long[100];
  14739. loadingError = false;
  14740. anIntArray928 = new int[5];
  14741. anIntArrayArray929 = new int[104][104];
  14742. chatTypes = new int[500];
  14743. chatNames = new String[500];
  14744. chatMessages = new String[500];
  14745. chatButtons = new Sprite[4];
  14746. sideIcons = new Sprite[15];
  14747. redStones = new Sprite[5];
  14748. aBoolean954 = true;
  14749. friendsListAsLongs = new long[200];
  14750. currentSong = -1;
  14751. drawingFlames = false;
  14752. spriteDrawX = -1;
  14753. spriteDrawY = -1;
  14754. anIntArray968 = new int[33];
  14755. anIntArray969 = new int[256];
  14756. decompressors = new Decompressor[5];
  14757. variousSettings = new int[2000];
  14758. aBoolean972 = false;
  14759. anInt975 = 50;
  14760. anIntArray976 = new int[anInt975];
  14761. anIntArray977 = new int[anInt975];
  14762. anIntArray978 = new int[anInt975];
  14763. anIntArray979 = new int[anInt975];
  14764. anIntArray980 = new int[anInt975];
  14765. anIntArray981 = new int[anInt975];
  14766. anIntArray982 = new int[anInt975];
  14767. aStringArray983 = new String[anInt975];
  14768. anInt985 = -1;
  14769. hitMarks = new Sprite[20];
  14770. anIntArray990 = new int[5];
  14771. aBoolean994 = false;
  14772. amountOrNameInput = "";
  14773. aClass19_1013 = new NodeList();
  14774. aBoolean1017 = false;
  14775. anInt1018 = -1;
  14776. anIntArray1030 = new int[5];
  14777. aBoolean1031 = false;
  14778. mapFunctions = new Sprite[100];
  14779. dialogID = -1;
  14780. maxStats = new int[Skills.skillsCount];
  14781. anIntArray1045 = new int[2000];
  14782. aBoolean1047 = true;
  14783. anIntArray1052 = new int[151];
  14784. anInt1054 = -1;
  14785. aClass19_1056 = new NodeList();
  14786. anIntArray1057 = new int[33];
  14787. aClass9_1059 = new RSInterface();
  14788. mapScenes = new Background[100];
  14789. barFillColor = 0x4d4233;
  14790. anIntArray1065 = new int[7];
  14791. anIntArray1072 = new int[1000];
  14792. anIntArray1073 = new int[1000];
  14793. aBoolean1080 = false;
  14794. friendsList = new String[200];
  14795. inStream = Stream.create();
  14796. expectedCRCs = new int[9];
  14797. menuActionCmd2 = new int[500];
  14798. menuActionCmd3 = new int[500];
  14799. menuActionID = new int[500];
  14800. menuActionCmd1 = new int[500];
  14801. headIcons = new Sprite[20];
  14802. skullIcons = new Sprite[20];
  14803. headIconsHint = new Sprite[20];
  14804. tabAreaAltered = false;
  14805. aString1121 = "";
  14806. atPlayerActions = new String[6];
  14807. atPlayerArray = new boolean[6];
  14808. anIntArrayArrayArray1129 = new int[4][13][13];
  14809. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  14810. aBoolean1141 = false;
  14811. aBoolean1149 = false;
  14812. crosses = new Sprite[8];
  14813. musicEnabled = true;
  14814. needDrawTabArea = false;
  14815. loggedIn = false;
  14816. canMute = false;
  14817. aBoolean1159 = false;
  14818. aBoolean1160 = false;
  14819. myUsername = "";
  14820. myPassword = "";
  14821. genericLoadingError = false;
  14822. reportAbuseInterfaceID = -1;
  14823. aClass19_1179 = new NodeList();
  14824. anInt1184 = 128;
  14825. invOverlayInterfaceID = -1;
  14826. stream = Stream.create();
  14827. menuActionName = new String[500];
  14828. anIntArray1203 = new int[5];
  14829. anIntArray1207 = new int[50];
  14830. anInt1211 = 78;
  14831. promptInput = "";
  14832. modIcons = new Sprite[15];
  14833. tabID = 3;
  14834. inputTaken = false;
  14835. songChanging = true;
  14836. anIntArray1229 = new int[151];
  14837. aClass11Array1230 = new Class11[4];
  14838. anIntArray1241 = new int[50];
  14839. aBoolean1242 = false;
  14840. anIntArray1250 = new int[50];
  14841. rsAlreadyLoaded = false;
  14842. welcomeScreenRaised = false;
  14843. messagePromptRaised = false;
  14844. loginMessage1 = "Welcome to OS-PvP";
  14845. loginMessage2 = "Enter your credentials to login";
  14846. backDialogID = -1;
  14847. bigX = new int[4000];
  14848. bigY = new int[4000];
  14849. anInt1289 = -1;
  14850. }
  14851.  
  14852. private final int[] chatRights;
  14853. private int hoverId;
  14854. public int xpCounter;
  14855. public int expAdded;
  14856. public int expSkill;
  14857. public int xpAddedPos;
  14858. public boolean xpLock;
  14859.  
  14860. private Sprite tabArea;
  14861. private Sprite tabArea474;
  14862. private Sprite tabArea508;
  14863. private Sprite mapArea;
  14864. private Sprite mapArea474;
  14865. private Sprite mapArea508;
  14866.  
  14867. public String name;
  14868. public String message;
  14869. public int chatTypeView;
  14870. public int clanChatMode;
  14871. public int duelMode;
  14872. public int autocastId = 0;
  14873. public boolean Autocast = false;
  14874. private Sprite chatArea;
  14875. private Background mapBack;
  14876.  
  14877. private Background titleBox;
  14878. private Sprite loginHover;
  14879. private Sprite boxHover;
  14880. public Sprite[] hoverLogin = new Sprite[3];
  14881. private Background titleButton;
  14882. private RSImageProducer leftFrame;
  14883. private RSImageProducer topFrame;
  14884. private RSImageProducer rightFrame;
  14885. private int ignoreCount;
  14886. private long aLong824;
  14887. private int[][] anIntArrayArray825;
  14888. private int[] friendsNodeIDs;
  14889. private NodeList[][][] groundArray;
  14890. private int[] anIntArray828;
  14891. private int[] anIntArray829;
  14892. private volatile boolean aBoolean831;
  14893. private Socket aSocket832;
  14894. private int loginScreenState;
  14895. private Stream aStream_834;
  14896. private NPC[] npcArray;
  14897. private int npcCount;
  14898. private int[] npcIndices;
  14899. private int anInt839;
  14900. private int[] anIntArray840;
  14901. private int anInt841;
  14902. private int anInt842;
  14903. private int anInt843;
  14904. private String aString844;
  14905. private int privateChatMode;
  14906. private Stream aStream_847;
  14907. private boolean aBoolean848;
  14908. private boolean aBoolean1233;
  14909. private static int anInt849;
  14910. private int[] anIntArray850;
  14911. private int[] anIntArray851;
  14912. private int[] anIntArray852;
  14913. private int[] anIntArray853;
  14914. private static int anInt854;
  14915. private int anInt855;
  14916. public static int openInterfaceID;
  14917. private int xCameraPos;
  14918. private int zCameraPos;
  14919. private int yCameraPos;
  14920. private int yCameraCurve;
  14921. private int xCameraCurve;
  14922. private int myPrivilege;
  14923. private final int[] currentExp;
  14924. private Sprite[] redStones;
  14925. private Sprite mapFlag;
  14926. private Sprite mapMarker;
  14927. private boolean aBoolean872;
  14928. private final int[] anIntArray873;
  14929. private int anInt874;
  14930. private final boolean[] aBooleanArray876;
  14931. private int weight;
  14932. private MouseDetection mouseDetection;
  14933. private volatile boolean drawFlames;
  14934. private String reportAbuseInput;
  14935. private int unknownInt10;
  14936. private boolean menuOpen;
  14937. private int anInt886;
  14938. public String inputString;
  14939. private final int maxPlayers;
  14940. private final int myPlayerIndex;
  14941. private Player[] playerArray;
  14942. private int playerCount;
  14943. private int[] playerIndices;
  14944. private int anInt893;
  14945. private int[] anIntArray894;
  14946. private Stream[] aStreamArray895s;
  14947. private int viewRotationOffset;
  14948. private int friendsCount;
  14949. private int anInt900;
  14950. private int[][] anIntArrayArray901;
  14951. private byte[] aByteArray912;
  14952. private int anInt913;
  14953. private int crossX;
  14954. private int crossY;
  14955. private int crossIndex;
  14956. private int crossType;
  14957. private int plane;
  14958. private final int[] currentStats;
  14959. private static int anInt924;
  14960. private final long[] ignoreListAsLongs;
  14961. private boolean loadingError;
  14962. private final int[] anIntArray928;
  14963. private int[][] anIntArrayArray929;
  14964. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  14965. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  14966. private int anInt933;
  14967. private int anInt934;
  14968. private int anInt935;
  14969. private int anInt936;
  14970. private int anInt937;
  14971. private int anInt938;
  14972. private final int[] chatTypes;
  14973. private final String[] chatNames;
  14974. private final String[] chatMessages;
  14975. private int anInt945;
  14976. private WorldController worldController;
  14977. private Sprite[] sideIcons;
  14978. private int menuScreenArea;
  14979. private int menuOffsetX;
  14980. private int menuOffsetY;
  14981. private int menuWidth;
  14982. private int menuHeight;
  14983. private long aLong953;
  14984. private boolean aBoolean954;
  14985. private long[] friendsListAsLongs;
  14986. private int currentSong;
  14987. private static int nodeID = 1;
  14988. static int portOff;
  14989. static boolean clientData;
  14990. private static boolean isMembers = true;
  14991. private static boolean lowMem;
  14992. private volatile boolean drawingFlames;
  14993. private int spriteDrawX;
  14994. private int spriteDrawY;
  14995. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  14996. 0xff00ff, 0xffffff };
  14997. private Background aBackground_966;
  14998. private Background aBackground_967;
  14999. private final int[] anIntArray968;
  15000. private final int[] anIntArray969;
  15001. final Decompressor[] decompressors;
  15002. public int variousSettings[];
  15003. private boolean aBoolean972;
  15004. private final int anInt975;
  15005. private final int[] anIntArray976;
  15006. private final int[] anIntArray977;
  15007. private final int[] anIntArray978;
  15008. private final int[] anIntArray979;
  15009. private final int[] anIntArray980;
  15010. private final int[] anIntArray981;
  15011. private final int[] anIntArray982;
  15012. private final String[] aStringArray983;
  15013. private int anInt984;
  15014. private int anInt985;
  15015. private static int anInt986;
  15016. private Sprite[] hitMarks;
  15017. private int anInt989;
  15018. private final int[] anIntArray990;
  15019. private static boolean aBoolean993;
  15020. private final boolean aBoolean994;
  15021. private int anInt995;
  15022. private int anInt996;
  15023. private int anInt997;
  15024. private int anInt998;
  15025. private int anInt999;
  15026. private ISAACRandomGen encryption;
  15027. private Sprite mapEdge;
  15028. public static int[][] anIntArrayArray1003 = {
  15029. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, -31839, 22433,
  15030. 2983, -11343, 8, 5281, 10438, 3650, -27322, -21845, 200,
  15031. 571, 908, 21830, 28946, -15701, -14010 },
  15032. { 8741, 12, -1506, -22374, 7735, 8404, 1701, -27106, 24094, 10153,
  15033. -8915, 4783, 1341, 16578, -30533, 25239, 8, 5281, 10438,
  15034. 3650, -27322, -21845, 200, 571, 908, 21830, 28946, -15701,
  15035. -14010 },
  15036. { 25238, 8742, 12, -1506, -22374, 7735, 8404, 1701, -27106, 24094,
  15037. 10153, -8915, 4783, 1341, 16578, -30533, 8, 5281, 10438,
  15038. 3650, -27322, -21845, 200, 571, 908, 21830, 28946, -15701,
  15039. -14010 }, { 4626, 11146, 6439, 12, 4758, 10270 },
  15040. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  15041.  
  15042. private Sprite multiOverlay;
  15043. private String amountOrNameInput;
  15044. private static int anInt1005;
  15045. private int daysSinceLastLogin;
  15046. private int pktSize;
  15047. private int pktType;
  15048. private int anInt1009;
  15049. private int anInt1010;
  15050. private int anInt1011;
  15051. private NodeList aClass19_1013;
  15052. private int anInt1014;
  15053. private int anInt1015;
  15054. private int anInt1016;
  15055. private boolean aBoolean1017;
  15056. public static int anInt1018;
  15057. private static final int[] anIntArray1019;
  15058. private int anInt1021;
  15059. private int anInt1022;
  15060. private int loadingStage;
  15061. private Sprite scrollBar1;
  15062. private Sprite scrollBar2;
  15063. private int anInt1026;
  15064. private final int[] anIntArray1030;
  15065. private boolean aBoolean1031;
  15066. private static Sprite[] mapFunctions;
  15067. private static int baseX;
  15068. private static int baseY;
  15069. private int anInt1036;
  15070. private int anInt1037;
  15071. private int loginFailures;
  15072. private int anInt1039;
  15073. private int anInt1040;
  15074. private int anInt1041;
  15075. private int dialogID;
  15076. private final int[] maxStats;
  15077. private final int[] anIntArray1045;
  15078. private int anInt1046;
  15079. private boolean aBoolean1047;
  15080. public TextDrawingArea smallText;
  15081. public TextDrawingArea XPFONT;
  15082. public TextDrawingArea aTextDrawingArea_1271;
  15083. public TextDrawingArea chatTextDrawingArea;
  15084. public TextDrawingArea aTextDrawingArea_1273;
  15085. public RSFont newSmallFont;
  15086. public RSFont newRegularFont;
  15087. public RSFont newBoldFont;
  15088. public RSFont newFancyFont;
  15089. private int anInt1048;
  15090. private String aString1049;
  15091. private static int anInt1051;
  15092. private final int[] anIntArray1052;
  15093. private StreamLoader titleStreamLoader;
  15094. private int anInt1054;
  15095. private int anInt1055;
  15096. private NodeList aClass19_1056;
  15097. private final int[] anIntArray1057;
  15098. public final RSInterface aClass9_1059;
  15099. private Background[] mapScenes;
  15100. private static int anInt1061;
  15101. private int anInt1062;
  15102. private final int barFillColor;
  15103. private int friendsListAction;
  15104. private final int[] anIntArray1065;
  15105. private int mouseInvInterfaceIndex;
  15106. private int lastActiveInvInterface;
  15107. public OnDemandFetcher onDemandFetcher;
  15108. private int anInt1069;
  15109. private int anInt1070;
  15110. private int anInt1071;
  15111. private int[] anIntArray1072;
  15112. private int[] anIntArray1073;
  15113. private Sprite mapDotItem;
  15114. private Sprite mapDotNPC;
  15115. private Sprite mapDotPlayer;
  15116. private Sprite mapDotFriend;
  15117. private Sprite mapDotTeam;
  15118. private Sprite mapDotClan;
  15119. private int anInt1079;
  15120. private boolean aBoolean1080;
  15121. private String[] friendsList;
  15122. private Stream inStream;
  15123. private int anInt1084;
  15124. private int anInt1085;
  15125. private int activeInterfaceType;
  15126. private int anInt1087;
  15127. private int anInt1088;
  15128. public static int anInt1089;
  15129. private final int[] expectedCRCs;
  15130. private int[] menuActionCmd2;
  15131. private int[] menuActionCmd3;
  15132. private int[] menuActionID;
  15133. private int[] menuActionCmd1;
  15134. private Sprite[] headIcons;
  15135. private Sprite[] skullIcons;
  15136. private Sprite[] headIconsHint;
  15137. private static int anInt1097;
  15138. private int anInt1098;
  15139. private int anInt1099;
  15140. private int anInt1100;
  15141. private int anInt1101;
  15142. private int anInt1102;
  15143. public static boolean tabAreaAltered;
  15144. private RSImageProducer aRSImageProducer_1107;
  15145. private RSImageProducer aRSImageProducer_1108;
  15146. private RSImageProducer loginScreenArea;
  15147. private RSImageProducer leftSideFlame;
  15148. private RSImageProducer rightSideFlame;
  15149. private RSImageProducer gameLogo;
  15150. private RSImageProducer aRSImageProducer_1113;
  15151. private RSImageProducer aRSImageProducer_1114;
  15152. private RSImageProducer aRSImageProducer_1115;
  15153. private int anInt1104;
  15154. private RSImageProducer aRSImageProducer_1109;
  15155. private RSImageProducer aRSImageProducer_1110;
  15156. private RSImageProducer aRSImageProducer_1111;
  15157. private RSImageProducer aRSImageProducer_1112;
  15158. private static int anInt1117;
  15159. private int membersInt;
  15160. private String aString1121;
  15161. private Sprite compass;
  15162. private RSImageProducer aRSImageProducer_1125;
  15163. public static Player myPlayer;
  15164. private final String[] atPlayerActions;
  15165. private final boolean[] atPlayerArray;
  15166. private final int[][][] anIntArrayArrayArray1129;
  15167. final static int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
  15168. -1, -1, -1, -1, -1, -1, -1, -1 };
  15169. private int cameraOffsetY;
  15170. private int menuActionRow;
  15171. private static int anInt1134;
  15172. private int spellSelected;
  15173. private int anInt1137;
  15174. private int spellUsableOn;
  15175. private String spellTooltip;
  15176. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  15177. private boolean aBoolean1141;
  15178. private static int anInt1142;
  15179. private int energy;
  15180. private boolean aBoolean1149;
  15181. private Sprite[] crosses;
  15182. private boolean musicEnabled;
  15183. private Background[] aBackgroundArray1152s;
  15184. public static boolean needDrawTabArea;
  15185. private int unreadMessages;
  15186. private static int anInt1155;
  15187. private static boolean fpsOn;
  15188. public static boolean loggedIn;
  15189. private boolean canMute;
  15190. private boolean aBoolean1159;
  15191. private boolean aBoolean1160;
  15192. static int loopCycle;
  15193. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  15194. private RSImageProducer aRSImageProducer_1166;
  15195. private static RSImageProducer aRSImageProducer_1163;
  15196. private RSImageProducer mapEdgeIP;
  15197. private RSImageProducer aRSImageProducer_1164;
  15198. private static RSImageProducer aRSImageProducer_1165;
  15199. private int daysSinceRecovChange;
  15200. private RSSocket socketStream;
  15201. private static int minimapZoom;
  15202. private long aLong1172;
  15203. private String myUsername;
  15204. private String myPassword;
  15205. private static int anInt1175;
  15206. private boolean genericLoadingError;
  15207. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  15208. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  15209. private int reportAbuseInterfaceID;
  15210. private NodeList aClass19_1179;
  15211. private static int[] anIntArray1180;
  15212. private static int[] anIntArray1181;
  15213. private static int[] anIntArray1182;
  15214. private byte[][] aByteArrayArray1183;
  15215. private int anInt1184;
  15216. private static int viewRotation;
  15217. private int anInt1186;
  15218. private int anInt1187;
  15219. private static int anInt1188;
  15220. private int invOverlayInterfaceID;
  15221. private int[] anIntArray1190;
  15222. private int[] anIntArray1191;
  15223. private Stream stream;
  15224. private int anInt1193;
  15225. private int splitPrivateChat;
  15226. private String[] clanList = new String[100];
  15227. private String[] menuActionName;
  15228. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  15229. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  15230. private final int[] anIntArray1203;
  15231. public static int anIntArray1204[] = { 9104, 10275, 7595, 3610, 7975, 8526,
  15232. 918, -26734, 24466, 10145, -6882, 5027, 1457, 16565, -30545, 25486,
  15233. 24, 5392, 10429, 3673, -27335, -21957, 192, 687, 412, 21821, 28835,
  15234. -15460, -14019 };
  15235. private static boolean flagged;
  15236. private final int[] anIntArray1207;
  15237. private int anInt1208;
  15238. private static int minimapRotation;
  15239. public static int anInt1211;
  15240. private String promptInput;
  15241. private int anInt1213;
  15242. private int[][][] intGroundArray;
  15243. private long aLong1215;
  15244. private int loginScreenCursorPos;
  15245. private final Sprite[] modIcons;
  15246. private long aLong1220;
  15247. public static int tabID;
  15248. private int anInt1222;
  15249. public static boolean inputTaken;
  15250. private int inputDialogState;
  15251. private static int anInt1226;
  15252. private int nextSong;
  15253. private boolean songChanging;
  15254. private final int[] anIntArray1229;
  15255. private Class11[] aClass11Array1230;
  15256. public static int anIntArray1232[];
  15257. private int[] anIntArray1234;
  15258. private int[] anIntArray1235;
  15259. private int[] anIntArray1236;
  15260. private int anInt1237;
  15261. private int anInt1238;
  15262. public final int anInt1239 = 100;
  15263. private final int[] anIntArray1241;
  15264. private boolean aBoolean1242;
  15265. private int atInventoryLoopCycle;
  15266. private int atInventoryInterface;
  15267. private int atInventoryIndex;
  15268. private int atInventoryInterfaceType;
  15269. private byte[][] aByteArrayArray1247;
  15270. private int tradeMode;
  15271. private int anInt1249;
  15272. private final int[] anIntArray1250;
  15273. private int anInt1251;
  15274. private final boolean rsAlreadyLoaded;
  15275. private int anInt1253;
  15276. private boolean welcomeScreenRaised;
  15277. private boolean messagePromptRaised;
  15278. private int anInt1257;
  15279. private byte[][][] byteGroundArray;
  15280. private int prevSong;
  15281. private int destX;
  15282. private int destY;
  15283. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  15284. public Sprite backgroundFix;
  15285. private int anInt1264;
  15286. private int anInt1265;
  15287. private String loginMessage1 = "Welcome to OS-PvP";
  15288. private String loginMessage2 = "Enter your credentials to login";
  15289. private int anInt1268;
  15290. private int anInt1269;
  15291. private int anInt1275;
  15292. private int backDialogID;
  15293. private int cameraOffsetX;
  15294. private int[] bigX;
  15295. private int[] bigY;
  15296. private int itemSelected;
  15297. private int anInt1283;
  15298. private int anInt1284;
  15299. private int anInt1285;
  15300. private String selectedItemName;
  15301. private int publicChatMode;
  15302. private static int anInt1288;
  15303. private int anInt1289;
  15304. public static int anInt1290;
  15305. public static String server = "104.197.84.246";
  15306. public int drawCount;
  15307. public int fullscreenInterfaceID;
  15308. public int anInt1044;// 377
  15309. public int anInt1129;// 377
  15310. public int anInt1315;// 377
  15311. public int anInt1500;// 377
  15312. public int anInt1501;// 377
  15313. public static int[] fullScreenTextureArray;
  15314.  
  15315. public void resetAllImageProducers() {
  15316. if (super.fullGameScreen != null) {
  15317. return;
  15318. }
  15319. aRSImageProducer_1166 = null;
  15320. aRSImageProducer_1164 = null;
  15321. aRSImageProducer_1163 = null;
  15322. aRSImageProducer_1165 = null;
  15323. aRSImageProducer_1125 = null;
  15324. aRSImageProducer_1107 = null;
  15325. aRSImageProducer_1108 = null;
  15326. loginScreenArea = null;
  15327. backgroundFix = null;
  15328. leftSideFlame = null;
  15329. rightSideFlame = null;
  15330. gameLogo = null;
  15331. aRSImageProducer_1113 = null;
  15332. aRSImageProducer_1114 = null;
  15333. aRSImageProducer_1115 = null;
  15334. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  15335. welcomeScreenRaised = true;
  15336. }
  15337.  
  15338. public void launchURL(String url) {
  15339. String osName = System.getProperty("os.name");
  15340. try {
  15341. if (osName.startsWith("Mac OS")) {
  15342. @SuppressWarnings("rawtypes")
  15343. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  15344. @SuppressWarnings("unchecked")
  15345. Method openURL = fileMgr.getDeclaredMethod("openURL",
  15346. new Class[] { String.class });
  15347. openURL.invoke(null, new Object[] { url });
  15348. } else if (osName.startsWith("Windows"))
  15349. Runtime.getRuntime().exec(
  15350. "rundll32 url.dll,FileProtocolHandler " + url);
  15351. else { // assume Unix or Linux
  15352. String[] browsers = { "firefox", "opera", "konqueror",
  15353. "epiphany", "mozilla", "netscape", "safari" };
  15354. String browser = null;
  15355. for (int count = 0; count < browsers.length && browser == null; count++)
  15356. if (Runtime.getRuntime()
  15357. .exec(new String[] { "which", browsers[count] })
  15358. .waitFor() == 0)
  15359. browser = browsers[count];
  15360. if (browser == null) {
  15361. throw new Exception("Could not find web browser");
  15362. } else
  15363. Runtime.getRuntime().exec(new String[] { browser, url });
  15364. }
  15365. } catch (Exception e) {
  15366. pushMessage("Failed to open URL.", 0, "");
  15367. }
  15368. }
  15369.  
  15370. public DecimalFormat getFormat() {
  15371. return format;
  15372. }
  15373.  
  15374. public void setFormat(DecimalFormat format) {
  15375. this.format = format;
  15376. }
  15377.  
  15378. private void drawInputField(RSInterface child, int interfaceX,
  15379. int interfaceY, int x, int y, int width, int height) {
  15380. int clickX = super.saveClickX, clickY = super.saveClickY;
  15381. // if(clientSize == 0) {
  15382. if (clickX >= 512 && clickY >= 169) {
  15383. clickX -= 512;
  15384. clickY -= 169;
  15385. }
  15386. Sprite[] inputSprites = this.inputSprites;
  15387. int xOffset = width % 12;
  15388. int yOffset = height % 12;
  15389. int xModification = 0, yModification = 0;
  15390. for (int row = 0; row < width; row += 12) {
  15391. if (row + 12 > width)
  15392. row -= 12 - (width - row);
  15393. inputSprites[6].drawSprite(xModification <= 0 ? x + row : x
  15394. + xModification, y);
  15395. for (int collumn = 0; collumn < height; collumn += 12) {
  15396. if (collumn + 12 > height)
  15397. collumn -= 12 - (height - collumn);
  15398. inputSprites[6].drawSprite(x + row, yModification <= 0 ? y
  15399. + collumn : y + yModification);
  15400. }
  15401. }
  15402. inputSprites[1].drawSprite(x, y);
  15403. inputSprites[0].drawSprite(x, y + height - 8);
  15404. inputSprites[2].drawSprite(x + width - 4, y);
  15405. inputSprites[3].drawSprite(x + width - 4, y + height - 8);
  15406. xOffset = width % 8;
  15407. yOffset = height % 8;
  15408. xModification = 0;
  15409. yModification = 0;
  15410. for (int top = 0; top < width; top += 8) {
  15411. if (top + 8 > width)
  15412. top -= 8 - (width - top);
  15413. inputSprites[5].drawSprite(x + top, y);
  15414. inputSprites[5].drawSprite(x + top, y + height - 1);
  15415. }
  15416. for (int bottom = 0; bottom < height; bottom += 8) {
  15417. if (bottom + 8 > height)
  15418. bottom -= 8 - (height - bottom);
  15419. inputSprites[4].drawSprite(x, y + bottom);
  15420. inputSprites[4].drawSprite(x + width - 1, y + bottom);
  15421. }
  15422. String message = child.message;
  15423. if (aTextDrawingArea_1271.getTextWidth(message) > child.width - 10)
  15424. message = message.substring(message.length() - (child.width / 10)
  15425. - 1, message.length());
  15426. if (child.displayAsterisks)
  15427. this.aTextDrawingArea_1271
  15428. .method389(
  15429. false,
  15430. (x + 4),
  15431. child.textColor,
  15432. new StringBuilder()
  15433. .append("")
  15434. .append(TextClass
  15435. .passwordAsterisks(message))
  15436. .append(((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1
  15437. : 0)) != 0 ? "|" : "").toString(),
  15438. (y + (height / 2) + 6));
  15439. else
  15440. this.aTextDrawingArea_1271
  15441. .method389(
  15442. false,
  15443. (x + 4),
  15444. child.textColor,
  15445. new StringBuilder()
  15446. .append("")
  15447. .append(message)
  15448. .append(((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1
  15449. : 0)) != 0 ? "|" : "").toString(),
  15450. (y + (height / 2) + 6));
  15451. if (clickX >= x && clickX <= x + child.width && clickY >= y
  15452. && clickY <= y + child.height) {
  15453. if (!child.isInFocus && getInputFieldFocusOwner() != child) {
  15454. if ((super.clickMode2 == 1 && !menuOpen)) {
  15455. RSInterface.currentInputFieldId = child.id;
  15456. setInputFieldFocusOwner(child);
  15457. if (child.message != null
  15458. && child.message
  15459. .equals(child.defaultInputFieldText))
  15460. child.message = "";
  15461. if (child.message == null)
  15462. child.message = "";
  15463. }
  15464. }
  15465. }
  15466. }
  15467.  
  15468. public void setInputFieldFocusOwner(RSInterface owner) {
  15469. for (RSInterface rsi : RSInterface.interfaceCache)
  15470. if (rsi != null)
  15471. if (rsi == owner)
  15472. rsi.isInFocus = true;
  15473. else
  15474. rsi.isInFocus = false;
  15475. }
  15476.  
  15477. public RSInterface getInputFieldFocusOwner() {
  15478. for (RSInterface rsi : RSInterface.interfaceCache)
  15479. if (rsi != null)
  15480. if (rsi.isInFocus)
  15481. return rsi;
  15482. return null;
  15483. }
  15484.  
  15485. public void resetInputFieldFocus() {
  15486. for (RSInterface rsi : RSInterface.interfaceCache)
  15487. if (rsi != null)
  15488. rsi.isInFocus = false;
  15489. RSInterface.currentInputFieldId = -1;
  15490. }
  15491.  
  15492. public boolean isFieldInFocus() {
  15493. for (RSInterface rsi : RSInterface.interfaceCache)
  15494. if (rsi != null)
  15495. if (rsi.type == 16 && rsi.isInFocus)
  15496. return true;
  15497. return false;
  15498. }
  15499.  
  15500. private boolean interfaceContainsItem(int interfaceId) {
  15501. RSInterface rsi = RSInterface.interfaceCache[interfaceId];
  15502. if (rsi == null)
  15503. return false;
  15504. if (rsi.inv == null) {
  15505. return false;
  15506. }
  15507. int count = 0;
  15508. for (int i = 0; i < rsi.inv.length; i++) {
  15509. if (rsi.inv[i] > 0) {
  15510. count++;
  15511. }
  15512. }
  15513. return count > 0;
  15514. }
  15515.  
  15516. public static boolean scrollbarVisible(RSInterface widget) {
  15517. if (widget.id == 55010) {
  15518. if (RSInterface.interfaceCache[55024].message.length() <= 0) {
  15519. return false;
  15520. }
  15521. } else if (widget.id == 55050) {
  15522. if (RSInterface.interfaceCache[55064].message.length() <= 0) {
  15523. return false;
  15524. }
  15525. }
  15526. return true;
  15527. }
  15528.  
  15529. void mouseWheelDragged(int i, int j) {
  15530. if (!mouseWheelDown)
  15531. return;
  15532. this.anInt1186 += i * 3;
  15533. this.anInt1187 += (j << 1);
  15534. }
  15535.  
  15536. static {
  15537. anIntArray1019 = new int[99];
  15538. int i = 0;
  15539. for (int j = 0; j < 99; j++) {
  15540. int l = j + 1;
  15541. int i1 = (int) (l + 300D * Math.pow(2D, l / 7D));
  15542. i += i1;
  15543. anIntArray1019[j] = i / 4;
  15544. }
  15545. anIntArray1232 = new int[32];
  15546. i = 2;
  15547. for (int k = 0; k < 32; k++) {
  15548. anIntArray1232[k] = i - 1;
  15549. i += i;
  15550. }
  15551. }
  15552.  
  15553. private FadingScreen fadingScreen = new FadingScreen();
  15554.  
  15555. private class FadingScreen {
  15556. /**
  15557. * The state of the fade on the screen
  15558. */
  15559. private byte state;
  15560.  
  15561. /**
  15562. * How many seconds the fade exists for
  15563. */
  15564. private byte seconds;
  15565.  
  15566. /**
  15567. * The string of text that will be displayed on the screen
  15568. */
  15569. private String text;
  15570.  
  15571. /**
  15572. * Controls how long it's been since the screen started its last fade
  15573. */
  15574. private StopWatch watch;
  15575.  
  15576. /**
  15577. * Acts as a means to instance the local {@link FadingScreen} object.
  15578. * Since the value of state by default is 0, nothing will be drawn on
  15579. * the screen.
  15580. */
  15581. private FadingScreen() { }
  15582.  
  15583. /**
  15584. * Creates a new fading screen
  15585. * @param state the state of the fade
  15586. * @param seconds the duration of the fade
  15587. */
  15588. private FadingScreen(String text, byte state, byte seconds) {
  15589. this.text = text;
  15590. this.state = state;
  15591. this.seconds = seconds;
  15592. this.watch = new StopWatch();
  15593. this.watch.start();
  15594. }
  15595.  
  15596. /**
  15597. * Draws the animation on the screen. If the state of the
  15598. * screen is currenly 0 the animation will not be drawn.
  15599. */
  15600. private void draw() {
  15601. if(state == 0) {
  15602. return;
  15603. }
  15604. long end = watch.getStartTime() + (1000L * seconds);
  15605. long increment = ((end - watch.getStartTime()) / 100);
  15606. if (increment > 0) {
  15607. long percentile = watch.getTime() / increment;
  15608. int opacity = (int) ((percentile * (Byte.MAX_VALUE / 100)) * 2);
  15609. if (state < 0) {
  15610. opacity = 255 - opacity;
  15611. }
  15612. if (percentile > -1 && percentile <= 100) {
  15613. DrawingArea.setDrawingArea(334, 0, 512, 0);
  15614. DrawingArea.drawAlphaBox(0, 0, 512, 334, 0x000000, opacity);
  15615. if (percentile > 85 && state == 1 || percentile < 50 && state == -1) {
  15616. newRegularFont.drawCenteredString(text, 512 / 2, 334 / 2, 0xFFFFFF, 0);
  15617. } else if (percentile == 100) {
  15618. watch.stop();
  15619. state = 0;
  15620. }
  15621. }
  15622. }
  15623. }
  15624. }
  15625. }
Add Comment
Please, Sign In to add comment