PageRenderTime 64ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 2ms

/src/client.java

https://github.com/CramerGG/ResizableClient
Java | 14250 lines | 13574 code | 515 blank | 161 comment | 5747 complexity | c84f324eb1577dbe3c4ea323038d9df6 MD5 | raw file
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4. import java.applet.AppletContext;
  5. import java.awt.*;
  6. import java.io.*;
  7. import java.math.BigInteger;
  8. import java.net.*;
  9. import java.text.NumberFormat;
  10. import java.util.zip.CRC32;
  11. import java.lang.reflect.Method;
  12. import sign.signlink;
  13. import javax.swing.*;
  14. public class client extends RSApplet {
  15. public int MapX, MapY;
  16. public static int spellID = 0;
  17. public static boolean newDamage = false;
  18. /**fullscreen**/
  19. public boolean drawLongTabs;
  20. private Graphics bufferGraphics;
  21. private Image buffer;
  22. private Sprite multiOverlay2;
  23. public static int Zoom = 0;
  24. public boolean menuToggle = true;
  25. public static boolean fog = true;
  26. public static boolean newMap;
  27. public static boolean is474 = false;
  28. public static boolean is554 = false;
  29. public static boolean isFullScreen, hasBeenBlanked;
  30. public static int extraWidth = 1280 -765, extraHeight = 1024 - 503,
  31. clientWidth = 0, clientHeight = 0;
  32. private static String intToKOrMilLongName(int i) {
  33. String s = String.valueOf(i);
  34. for(int k = s.length() - 3; k > 0; k -= 3)
  35. s = s.substring(0, k) + "," + s.substring(k);
  36. //if(j != 0)
  37. // aBoolean1224 = !aBoolean1224;
  38. if(s.length() > 8)
  39. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  40. else
  41. if(s.length() > 4)
  42. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  43. return " " + s;
  44. }
  45. public final String methodR(/*int i,*/ int j)
  46. {
  47. //if(i <= 0)
  48. // pktType = inStream.readUnsignedByte();
  49. if(j >= 0 && j < 10000)
  50. return String.valueOf(j);
  51. if(j >= 10000 && j < 10000000)
  52. return j / 1000 + "K";
  53. if(j >= 10000000 && j < 999999999)
  54. return j / 1000000 + "M";
  55. if(j >= 999999999)
  56. return "*";
  57. else
  58. return "?";
  59. }
  60. public static final byte[] ReadFile(String s) {
  61. try {
  62. byte abyte0[];
  63. File file = new File(s);
  64. int i = (int)file.length();
  65. abyte0 = new byte[i];
  66. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  67. datainputstream.readFully(abyte0, 0, i);
  68. datainputstream.close();
  69. return abyte0;
  70. } catch(Exception e) {
  71. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  72. return null;
  73. }
  74. }
  75. public void models() {
  76. for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  77. byte[] abyte0 = getModel(ModelIndex);
  78. if(abyte0 != null && abyte0.length > 0) {
  79. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  80. pushMessage("Model added successfully!", 0, "");
  81. }
  82. }
  83. }
  84. public byte[] getModel(int Index) {
  85. try {
  86. File Model = new File("./model/"+Index+".gz");
  87. byte[] aByte = new byte[(int)Model.length()];
  88. FileInputStream fis = new FileInputStream(Model);
  89. fis.read(aByte);
  90. pushMessage("aByte = ["+aByte+"]!", 0, "");
  91. fis.close();
  92. return aByte;
  93. }
  94. catch(Exception e)
  95. {return null;}
  96. }
  97. private void stopMidi() {
  98. signlink.midifade = 0;
  99. signlink.midi = "stop";
  100. }
  101. private boolean menuHasAddFriend(int j) {
  102. if(j < 0)
  103. return false;
  104. int k = menuActionID[j];
  105. if(k >= 2000)
  106. k -= 2000;
  107. return k == 337;
  108. }
  109. public void drawChannelButtons() {
  110. int y = isFullScreen ? extraHeight + 334 : 0;
  111. String text[] = { "On", "Friends", "Off", "Hide" };
  112. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  113. /* Button hovering */
  114. if(!newMap && isFullScreen) {
  115. /* Draws main buttons sprite */
  116. chatButtons.drawSprite2(5, 143+y);
  117. if(cButtonHPos == 7) {
  118. reportH.drawSprite(404, 143+y);
  119. }
  120. if(cButtonCPos == 0)
  121. chatButtonC.drawSprite(5, 143+y);
  122. else if(cButtonCPos == 1)
  123. chatButtonC.drawSprite(62, 143+y);
  124. else if(cButtonCPos == 2)
  125. chatButtonC.drawSprite(119, 143+y);
  126. else if(cButtonCPos == 3)
  127. chatButtonC.drawSprite(176, 143+y);
  128. else if(cButtonCPos == 4)
  129. chatButtonC.drawSprite(233, 143+y);
  130. else if(cButtonCPos == 5)
  131. chatButtonC.drawSprite(290, 143+y);
  132. else if(cButtonCPos == 6)
  133. chatButtonC.drawSprite(347, 143+y);
  134. if(cButtonHPos == cButtonCPos) {
  135. if(cButtonHPos == 0)
  136. chatButtonHC.drawSprite(5, 143+y);
  137. else if(cButtonHPos == 1)
  138. chatButtonHC.drawSprite(62, 143+y);
  139. else if(cButtonHPos == 2)
  140. chatButtonHC.drawSprite(119, 143+y);
  141. else if(cButtonHPos == 3)
  142. chatButtonHC.drawSprite(176, 143+y);
  143. else if(cButtonHPos == 4)
  144. chatButtonHC.drawSprite(233, 143+y);
  145. else if(cButtonHPos == 5)
  146. chatButtonHC.drawSprite(290, 143+y);
  147. else if(cButtonHPos == 6)
  148. chatButtonHC.drawSprite(347, 143+y);
  149. } else {
  150. if(cButtonHPos == 0)
  151. chatButtonH.drawSprite(5, 143+y);
  152. else if(cButtonHPos == 1)
  153. chatButtonH.drawSprite(62, 143+y);
  154. else if(cButtonHPos == 2)
  155. chatButtonH.drawSprite(119, 143+y);
  156. else if(cButtonHPos == 3)
  157. chatButtonH.drawSprite(176, 143+y);
  158. else if(cButtonHPos == 4)
  159. chatButtonH.drawSprite(233, 143+y);
  160. else if(cButtonHPos == 5)
  161. chatButtonH.drawSprite(290, 143+y);
  162. else if(cButtonHPos == 6)
  163. chatButtonH.drawSprite(347, 143+y);
  164. }
  165. /* Button text */
  166. smallText.method389(true, 427, 0xffffff, "Report Abuse", 158+y);
  167. smallText.method389(true, 26, 0xffffff, "All", 158+y);
  168. smallText.method389(true, 77, 0xffffff, "Game", 158+y);
  169. smallText.method389(true, 131, 0xffffff, "Public", 153+y);
  170. smallText.method389(true, 185, 0xffffff, "Private", 153+y);
  171. smallText.method389(true, 249, 0xffffff, "Clan", 153+y);
  172. smallText.method389(true, 304, 0xffffff, "Trade", 153+y);
  173. smallText.method389(true, 363, 0xffffff, "Duel", 153+y);
  174. /* Chat modes */
  175. smallText.method382(textColor[publicChatMode], 146, text[publicChatMode], 164+y, true);
  176. smallText.method382(textColor[privateChatMode], 203, text[privateChatMode], 164+y, true);
  177. smallText.method382(textColor[clanChatMode], 260, text[clanChatMode], 164+y, true);
  178. smallText.method382(textColor[tradeMode], 317, text[tradeMode], 164+y, true);
  179. smallText.method382(textColor[duelMode], 374, text[duelMode], 164+y, true);
  180. } else
  181. /* Button hovering */
  182. if(!newMap) {
  183. /* Draws main buttons sprite */
  184. chatButtons.drawSprite(5, 143+y);
  185. if(cButtonHPos == 7) {
  186. reportH.drawSprite(404, 143+y);
  187. }
  188. if(cButtonCPos == 0)
  189. chatButtonC.drawSprite(5, 143+y);
  190. else if(cButtonCPos == 1)
  191. chatButtonC.drawSprite(62, 143+y);
  192. else if(cButtonCPos == 2)
  193. chatButtonC.drawSprite(119, 143+y);
  194. else if(cButtonCPos == 3)
  195. chatButtonC.drawSprite(176, 143+y);
  196. else if(cButtonCPos == 4)
  197. chatButtonC.drawSprite(233, 143+y);
  198. else if(cButtonCPos == 5)
  199. chatButtonC.drawSprite(290, 143+y);
  200. else if(cButtonCPos == 6)
  201. chatButtonC.drawSprite(347, 143+y);
  202. if(cButtonHPos == cButtonCPos) {
  203. if(cButtonHPos == 0)
  204. chatButtonHC.drawSprite(5, 143+y);
  205. else if(cButtonHPos == 1)
  206. chatButtonHC.drawSprite(62, 143+y);
  207. else if(cButtonHPos == 2)
  208. chatButtonHC.drawSprite(119, 143+y);
  209. else if(cButtonHPos == 3)
  210. chatButtonHC.drawSprite(176, 143+y);
  211. else if(cButtonHPos == 4)
  212. chatButtonHC.drawSprite(233, 143+y);
  213. else if(cButtonHPos == 5)
  214. chatButtonHC.drawSprite(290, 143+y);
  215. else if(cButtonHPos == 6)
  216. chatButtonHC.drawSprite(347, 143+y);
  217. } else {
  218. if(cButtonHPos == 0)
  219. chatButtonH.drawSprite(5, 143+y);
  220. else if(cButtonHPos == 1)
  221. chatButtonH.drawSprite(62, 143+y);
  222. else if(cButtonHPos == 2)
  223. chatButtonH.drawSprite(119, 143+y);
  224. else if(cButtonHPos == 3)
  225. chatButtonH.drawSprite(176, 143+y);
  226. else if(cButtonHPos == 4)
  227. chatButtonH.drawSprite(233, 143+y);
  228. else if(cButtonHPos == 5)
  229. chatButtonH.drawSprite(290, 143+y);
  230. else if(cButtonHPos == 6)
  231. chatButtonH.drawSprite(347, 143+y);
  232. }
  233. /* Button text */
  234. smallText.method389(true, 427, 0xffffff, "Report Abuse", 158+y);
  235. smallText.method389(true, 26, 0xffffff, "All", 158+y);
  236. smallText.method389(true, 77, 0xffffff, "Game", 158+y);
  237. smallText.method389(true, 131, 0xffffff, "Public", 153+y);
  238. smallText.method389(true, 185, 0xffffff, "Private", 153+y);
  239. smallText.method389(true, 249, 0xffffff, "Clan", 153+y);
  240. smallText.method389(true, 304, 0xffffff, "Trade", 153+y);
  241. smallText.method389(true, 363, 0xffffff, "Duel", 153+y);
  242. /* Chat modes */
  243. smallText.method382(textColor[publicChatMode], 146, text[publicChatMode], 164+y, true);
  244. smallText.method382(textColor[privateChatMode], 203, text[privateChatMode], 164+y, true);
  245. smallText.method382(textColor[clanChatMode], 260, text[clanChatMode], 164+y, true);
  246. smallText.method382(textColor[tradeMode], 317, text[tradeMode], 164+y, true);
  247. smallText.method382(textColor[duelMode], 374, text[duelMode], 164+y, true);
  248. } else
  249. if(newMap) {
  250. /* Draws main buttons sprite */
  251. chatButtons.drawSprite2(5, 142+y);
  252. /* Button hovering */
  253. if(cButtonHPos == 7) {
  254. reportH.drawSprite(404, 142+y);
  255. }
  256. if(cButtonCPos == 0)
  257. chatButtonC.drawSprite(5, 142+y);
  258. else if(cButtonCPos == 1)
  259. chatButtonC.drawSprite(71, 142+y);
  260. else if(cButtonCPos == 2)
  261. chatButtonC.drawSprite(137, 142+y);
  262. else if(cButtonCPos == 3)
  263. chatButtonC.drawSprite(203, 142+y);
  264. else if(cButtonCPos == 4)
  265. chatButtonC.drawSprite(269, 142+y);
  266. else if(cButtonCPos == 5)
  267. chatButtonC.drawSprite(335, 142+y);
  268. if(cButtonHPos == cButtonCPos) {
  269. if(cButtonHPos == 0)
  270. chatButtonHC.drawSprite(5, 140+y);
  271. else if(cButtonHPos == 1)
  272. chatButtonHC.drawSprite(71, 140+y);
  273. else if(cButtonHPos == 2)
  274. chatButtonHC.drawSprite(137, 140+y);
  275. else if(cButtonHPos == 3)
  276. chatButtonHC.drawSprite(203, 142+y);
  277. else if(cButtonHPos == 4)
  278. chatButtonHC.drawSprite(269, 142+y);
  279. else if(cButtonHPos == 5)
  280. chatButtonHC.drawSprite(335, 142+y);
  281. } else {
  282. if(cButtonHPos == 0)
  283. chatButtonH.drawSprite(5, 142+y);
  284. else if(cButtonHPos == 1)
  285. chatButtonH.drawSprite(71, 142+y);
  286. else if(cButtonHPos == 2)
  287. chatButtonH.drawSprite(137, 142+y);
  288. else if(cButtonHPos == 3)
  289. chatButtonH.drawSprite(203, 142+y);
  290. else if(cButtonHPos == 4)
  291. chatButtonH.drawSprite(269, 142+y);
  292. else if(cButtonHPos == 5)
  293. chatButtonH.drawSprite(335, 142+y);
  294. }
  295. /* Button text */
  296. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157+y);
  297. smallText.method389(true, 26, 0xffffff, "All", 157+y);
  298. smallText.method389(true, 86, 0xffffff, "Game", 157+y);
  299. smallText.method389(true, 150, 0xffffff, "Public", 152+y);
  300. smallText.method389(true, 212, 0xffffff, "Private", 152+y);
  301. smallText.method389(true, 286, 0xffffff, "Clan", 152+y);
  302. smallText.method389(true, 349, 0xffffff, "Trade", 152+y);
  303. /* Chat modes */
  304. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163+y, true);
  305. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163+y, true);
  306. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163+y, true);
  307. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163+y, true);
  308. } else
  309. if(newMap) {
  310. /* Draws main buttons sprite */
  311. chatButtons.drawSprite(5, 142+y);
  312. /* Button hovering */
  313. if(cButtonHPos == 7) {
  314. reportH.drawSprite(404, 142+y);
  315. }
  316. if(cButtonCPos == 0)
  317. chatButtonC.drawSprite(5, 142+y);
  318. else if(cButtonCPos == 1)
  319. chatButtonC.drawSprite(71, 142+y);
  320. else if(cButtonCPos == 2)
  321. chatButtonC.drawSprite(137, 142+y);
  322. else if(cButtonCPos == 3)
  323. chatButtonC.drawSprite(203, 142+y);
  324. else if(cButtonCPos == 4)
  325. chatButtonC.drawSprite(269, 142+y);
  326. else if(cButtonCPos == 5)
  327. chatButtonC.drawSprite(335, 142+y);
  328. if(cButtonHPos == cButtonCPos) {
  329. if(cButtonHPos == 0)
  330. chatButtonHC.drawSprite(5, 140+y);
  331. else if(cButtonHPos == 1)
  332. chatButtonHC.drawSprite(71, 140+y);
  333. else if(cButtonHPos == 2)
  334. chatButtonHC.drawSprite(137, 140+y);
  335. else if(cButtonHPos == 3)
  336. chatButtonHC.drawSprite(203, 142+y);
  337. else if(cButtonHPos == 4)
  338. chatButtonHC.drawSprite(269, 142+y);
  339. else if(cButtonHPos == 5)
  340. chatButtonHC.drawSprite(335, 142+y);
  341. } else {
  342. if(cButtonHPos == 0)
  343. chatButtonH.drawSprite(5, 142+y);
  344. else if(cButtonHPos == 1)
  345. chatButtonH.drawSprite(71, 142+y);
  346. else if(cButtonHPos == 2)
  347. chatButtonH.drawSprite(137, 142+y);
  348. else if(cButtonHPos == 3)
  349. chatButtonH.drawSprite(203, 142+y);
  350. else if(cButtonHPos == 4)
  351. chatButtonH.drawSprite(269, 142+y);
  352. else if(cButtonHPos == 5)
  353. chatButtonH.drawSprite(335, 142+y);
  354. }
  355. /* Button text */
  356. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157+y);
  357. smallText.method389(true, 26, 0xffffff, "All", 157+y);
  358. smallText.method389(true, 86, 0xffffff, "Game", 157+y);
  359. smallText.method389(true, 150, 0xffffff, "Public", 152+y);
  360. smallText.method389(true, 212, 0xffffff, "Private", 152+y);
  361. smallText.method389(true, 286, 0xffffff, "Clan", 152+y);
  362. smallText.method389(true, 349, 0xffffff, "Trade", 152+y);
  363. /* Chat modes */
  364. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163+y, true);
  365. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163+y, true);
  366. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163+y, true);
  367. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163+y, true);
  368. }
  369. }
  370. private void drawChatArea()
  371. {
  372. int yPosOffset = isFullScreen ? clientHeight - 166 : 0;
  373. int xPosOffset = isFullScreen ? 0 : 0;
  374. if (!isFullScreen)
  375. aRSImageProducer_1166.initDrawingArea();
  376. Texture.anIntArray1472 = anIntArray1180;
  377. int y = isFullScreen ? extraHeight + 334 : 0;
  378. if (isFullScreen && displayChat)
  379. chatArea.drawSprite2(0, 0+y);
  380. else if(!isFullScreen){
  381. chatArea.drawSprite(0, 0);
  382. }
  383. drawChannelButtons();
  384. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  385. if(displayChat || !isFullScreen) {
  386. if(messagePromptRaised) {
  387. chatTextDrawingArea.drawText(0, aString1121, 60+y, 259);
  388. chatTextDrawingArea.drawText(128, promptInput + "*", 80+y, 259);
  389. } else if(inputDialogState == 1) {
  390. chatTextDrawingArea.drawText(0, "Enter amount:", 60+y, 259);
  391. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80+y, 259);
  392. } else if(inputDialogState == 2) {
  393. chatTextDrawingArea.drawText(0, "Enter name:", 60+y, 259);
  394. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80+y, 259);
  395. } else if(aString844 != null) {
  396. chatTextDrawingArea.drawText(0, aString844, 60+y, 259);
  397. chatTextDrawingArea.drawText(128, "Click to continue", 80+y, 259);
  398. } else if(backDialogID != -1) {
  399. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20+y);
  400. } else if(dialogID != -1d) {
  401. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20+y);
  402. } else {
  403. int j77 = -3;
  404. int j = 0;
  405. DrawingArea.setDrawingArea(122+y, 8, 497, 7+y);
  406. for(int k = 0; k < 500; k++)
  407. if(chatMessages[k] != null) {
  408. int chatType = chatTypes[k];
  409. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  410. String s1 = chatNames[k];
  411. byte byte0 = 0;
  412. if(s1 != null && s1.startsWith("@cr1@")) {
  413. s1 = s1.substring(5);
  414. byte0 = 1;
  415. } else if(s1 != null && s1.startsWith("@cr2@")) {
  416. s1 = s1.substring(5);
  417. byte0 = 2;
  418. } else if(s1 != null && s1.startsWith("@cr3@")) {
  419. s1 = s1.substring(5);
  420. byte0 = 3;
  421. }
  422. if(chatType == 0) {
  423. if (chatTypeView == 5 || chatTypeView == 0) {
  424. if(yPos > 0 && yPos < 210)
  425. textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos+y);//chat color enabled
  426. j++;
  427. j77++;
  428. }
  429. }
  430. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  431. if (chatTypeView == 1 || chatTypeView == 0) {
  432. if(yPos > 0 && yPos < 210) {
  433. int xPos = 11;
  434. if(byte0 == 1) {
  435. modIcons[0].drawBackground(xPos + 1, yPos - 12+y);
  436. xPos += 14;
  437. } else if(byte0 == 2) {
  438. modIcons[1].drawBackground(xPos + 1, yPos - 12+y);
  439. xPos += 14;
  440. } else if(byte0 == 3) {
  441. modIcons[2].drawBackground(xPos + 1, yPos - 12+y);
  442. xPos += 14;
  443. }
  444. textDrawingArea.method385(0, s1 + ":", yPos+y, xPos);
  445. xPos += textDrawingArea.getTextWidth(s1) + 8;
  446. textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos+y);
  447. }
  448. j++;
  449. j77++;
  450. }
  451. }
  452. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  453. if (chatTypeView == 2 || chatTypeView == 0) {
  454. if(yPos > 0 && yPos < 210) {
  455. int k1 = 11;
  456. textDrawingArea.method385(0, "From", yPos+y, k1);
  457. k1 += textDrawingArea.getTextWidth("From ");
  458. if(byte0 == 1) {
  459. modIcons[0].drawBackground(k1, yPos - 12+y);
  460. k1 += 12;
  461. } else if(byte0 == 2) {
  462. modIcons[1].drawBackground(k1, yPos - 12+y);
  463. k1 += 12;
  464. } else if(byte0 == 3) {
  465. modIcons[2].drawBackground(k1, yPos - 12+y);
  466. k1 += 12;
  467. }
  468. textDrawingArea.method385(0, s1 + ":", yPos+y, k1);
  469. k1 += textDrawingArea.getTextWidth(s1) + 8;
  470. textDrawingArea.method385(0x800000, chatMessages[k], yPos+y, k1);
  471. }
  472. j++;
  473. j77++;
  474. }
  475. }
  476. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  477. if (chatTypeView == 3 || chatTypeView == 0) {
  478. if(yPos > 0 && yPos < 210)
  479. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos+y, 11);
  480. j++;
  481. j77++;
  482. }
  483. }
  484. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  485. if (chatTypeView == 2 || chatTypeView == 0) {
  486. if(yPos > 0 && yPos < 210)
  487. textDrawingArea.method385(0x800000, chatMessages[k], yPos+y, 11);
  488. j++;
  489. j77++;
  490. }
  491. }
  492. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  493. if (chatTypeView == 2 || chatTypeView == 0) {
  494. if(yPos > 0 && yPos < 210) {
  495. textDrawingArea.method385(0, "To " + s1 + ":", yPos+y, 11);
  496. textDrawingArea.method385(0x800000, chatMessages[k], yPos+y, 15 + textDrawingArea.getTextWidth("To :" + s1));
  497. }
  498. j++;
  499. j77++;
  500. }
  501. }
  502. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  503. if (chatTypeView == 3 || chatTypeView == 0) {
  504. if(yPos > 0 && yPos < 210)
  505. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos+y, 11);
  506. j++;
  507. j77++;
  508. }
  509. if(chatType == 11 && (clanChatMode == 0)) {
  510. if (chatTypeView == 11) {
  511. if(yPos > 0 && yPos < 210)
  512. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos+y, 11);
  513. j++;
  514. j77++;
  515. }
  516. if(chatType == 12) {
  517. if(yPos > 0 && yPos < 110)
  518. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos+y, 11);
  519. j++;
  520. }
  521. }
  522. }
  523. if(chatType == 16) {
  524. int j2 = 40;
  525. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  526. if(chatTypeView == 11 || chatTypeView == 0) {
  527. if(yPos > 0 && yPos < 210)
  528. switch(chatRights[k]) {
  529. case 1:
  530. j2 += clanNameWidth;
  531. modIcons[0].drawBackground(j2 - 18, yPos - 12+y);
  532. j2 += 14;
  533. break;
  534. case 2:
  535. j2 += clanNameWidth;
  536. modIcons[1].drawBackground(j2 - 18, yPos - 12+y);
  537. j2 += 14;
  538. break;
  539. case 3:
  540. j2 += clanNameWidth;
  541. modIcons[1].drawBackground(j2 - 18, yPos - 12+y);
  542. j2 += 14;
  543. break;
  544. default:
  545. j2 += clanNameWidth;
  546. break;
  547. }
  548. textDrawingArea.method385(0, "[", yPos+y, 8);
  549. textDrawingArea.method385(255, ""+clanname+"", yPos+y, 14);
  550. textDrawingArea.method385(0, "]", yPos+y, clanNameWidth + 14);
  551. textDrawingArea.method385(0, chatNames[k]+":", yPos+y, j2 - 17); //j2
  552. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  553. textDrawingArea.method385(0x800000, chatMessages[k], yPos+y, j2 - 16);//j2
  554. j++;
  555. j77++;
  556. }
  557. }
  558. }
  559. DrawingArea.defaultDrawingAreaSize();
  560. anInt1211 = j * 14 + 7 + 5;
  561. if(anInt1211 < 111)
  562. anInt1211 = 111;
  563. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7+y, 496, anInt1211);
  564. String s;
  565. if(myPlayer != null && myPlayer.name != null)
  566. s = myPlayer.name;
  567. else
  568. s = TextClass.fixName(myUsername);
  569. textDrawingArea.method385(0, s + ":", 133+y, 11);
  570. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133+y, false);
  571. DrawingArea.method339(121+y, 0x807660, 506, 7);
  572. }
  573. if(menuOpen && menuScreenArea == 2) {
  574. drawMenu();
  575. }
  576. if (!isFullScreen)
  577. aRSImageProducer_1166.drawGraphics(338+extraHeight, isFullScreen ? bufferGraphics : super.graphics, 0);
  578. aRSImageProducer_1165.initDrawingArea();
  579. Texture.anIntArray1472 = anIntArray1182;
  580. }
  581. }
  582. public void init() {
  583. nodeID = 10;
  584. portOff = 0;
  585. setHighMem();
  586. isMembers = true;
  587. initClientFrame(482, 765);
  588. }
  589. public void startRunnable(Runnable runnable, int i) {
  590. if(i > 10)
  591. i = 10;
  592. if(signlink.mainapp != null) {
  593. signlink.startthread(runnable, i);
  594. } else {
  595. super.startRunnable(runnable, i);
  596. }
  597. }
  598. public Socket openSocket(int port) throws IOException {
  599. return new Socket(InetAddress.getByName(server), port);
  600. }
  601. private void processMenuClick() {
  602. if(activeInterfaceType != 0)
  603. return;
  604. int j = super.clickMode3;
  605. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  606. j = 0;
  607. if(menuOpen) {
  608. if(j != 1) {
  609. int k = super.mouseX;
  610. int j1 = super.mouseY;
  611. if(menuScreenArea == 0) {
  612. k -= 4;
  613. j1 -= 4;
  614. }
  615. if(menuScreenArea == 1) {
  616. k -= 519;
  617. j1 -= 168;
  618. }
  619. if(menuScreenArea == 2) {
  620. k -= 17;
  621. j1 -= 338;
  622. }
  623. if(menuScreenArea == 3) {
  624. k -= 519;
  625. j1 -= 0;
  626. }
  627. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  628. menuOpen = false;
  629. if(menuScreenArea == 1)
  630. needDrawTabArea = true;
  631. if(menuScreenArea == 2)
  632. inputTaken = true;
  633. }
  634. }
  635. if(j == 1) {
  636. int l = menuOffsetX;
  637. int k1 = menuOffsetY;
  638. int i2 = menuWidth;
  639. int k2 = super.saveClickX;
  640. int l2 = super.saveClickY;
  641. if(menuScreenArea == 0) {
  642. k2 -= 4;
  643. l2 -= 4;
  644. }
  645. if(menuScreenArea == 1) {
  646. k2 -= 519;
  647. l2 -= 168;
  648. }
  649. if(menuScreenArea == 2) {
  650. k2 -= 17;
  651. l2 -= 338;
  652. }
  653. if(menuScreenArea == 3) {
  654. k2 -= 519;
  655. l2 -= 0;
  656. }
  657. int i3 = -1;
  658. for(int j3 = 0; j3 < menuActionRow; j3++) {
  659. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  660. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  661. i3 = j3;
  662. }
  663. System.out.println(i3);
  664. if(i3 != -1)
  665. doAction(i3);
  666. menuOpen = false;
  667. if(menuScreenArea == 1)
  668. needDrawTabArea = true;
  669. if(menuScreenArea == 2) {
  670. inputTaken = true;
  671. }
  672. }
  673. } else {
  674. if(j == 1 && menuActionRow > 0) {
  675. int i1 = menuActionID[menuActionRow - 1];
  676. if(i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125) {
  677. int l1 = menuActionCmd2[menuActionRow - 1];
  678. int j2 = menuActionCmd3[menuActionRow - 1];
  679. RSInterface class9 = RSInterface.interfaceCache[j2];
  680. if(class9.aBoolean259 || class9.aBoolean235) {
  681. aBoolean1242 = false;
  682. anInt989 = 0;
  683. anInt1084 = j2;
  684. anInt1085 = l1;
  685. activeInterfaceType = 2;
  686. anInt1087 = super.saveClickX;
  687. anInt1088 = super.saveClickY;
  688. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  689. activeInterfaceType = 1;
  690. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  691. activeInterfaceType = 3;
  692. return;
  693. }
  694. }
  695. }
  696. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  697. j = 2;
  698. if(j == 1 && menuActionRow > 0)
  699. doAction(menuActionRow - 1);
  700. if(j == 2 && menuActionRow > 0)
  701. determineMenuSize();
  702. }
  703. }
  704. public static int totalRead = 0;
  705. public static String getFileNameWithoutExtension(String fileName) {
  706. File tmpFile = new File(fileName);
  707. tmpFile.getName();
  708. int whereDot = tmpFile.getName().lastIndexOf('.');
  709. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  710. return tmpFile.getName().substring(0, whereDot);
  711. }
  712. return "";
  713. }
  714. public void preloadModels() {
  715. File file = new File("./Raw/");
  716. File[] fileArray = file.listFiles();
  717. for(int y = 0; y < fileArray.length; y++) {
  718. String s = fileArray[y].getName();
  719. byte[] buffer = ReadFile("./Raw/"+s);
  720. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  721. }
  722. }
  723. private void saveMidi(boolean flag, byte abyte0[])
  724. {
  725. signlink.midifade = flag ? 1 : 0;
  726. signlink.midisave(abyte0, abyte0.length);
  727. }
  728. private void method22()
  729. {
  730. try
  731. {
  732. anInt985 = -1;
  733. aClass19_1056.removeAll();
  734. aClass19_1013.removeAll();
  735. Texture.method366();
  736. unlinkMRUNodes();
  737. worldController.initToNull();
  738. System.gc();
  739. for(int i = 0; i < 4; i++)
  740. aClass11Array1230[i].method210();
  741. for(int l = 0; l < 4; l++)
  742. {
  743. for(int k1 = 0; k1 < 104; k1++)
  744. {
  745. for(int j2 = 0; j2 < 104; j2++)
  746. byteGroundArray[l][k1][j2] = 0;
  747. }
  748. }
  749. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  750. int k2 = aByteArrayArray1183.length;
  751. stream.createFrame(0);
  752. if(!aBoolean1159)
  753. {
  754. for(int i3 = 0; i3 < k2; i3++)
  755. {
  756. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  757. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  758. byte abyte0[] = aByteArrayArray1183[i3];
  759. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  760. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  761. if(abyte0 != null)
  762. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  763. }
  764. for(int j4 = 0; j4 < k2; j4++)
  765. {
  766. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  767. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  768. byte abyte2[] = aByteArrayArray1183[j4];
  769. if(abyte2 == null && anInt1070 < 800)
  770. objectManager.method174(k7, 64, 64, l5);
  771. }
  772. anInt1097++;
  773. if(anInt1097 > 160)
  774. {
  775. anInt1097 = 0;
  776. stream.createFrame(238);
  777. stream.writeWordBigEndian(96);
  778. }
  779. stream.createFrame(0);
  780. for(int i6 = 0; i6 < k2; i6++)
  781. {
  782. byte abyte1[] = aByteArrayArray1247[i6];
  783. if(abyte1 != null)
  784. {
  785. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  786. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  787. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  788. }
  789. }
  790. }
  791. if(aBoolean1159)
  792. {
  793. for(int j3 = 0; j3 < 4; j3++)
  794. {
  795. for(int k4 = 0; k4 < 13; k4++)
  796. {
  797. for(int j6 = 0; j6 < 13; j6++)
  798. {
  799. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  800. if(l7 != -1)
  801. {
  802. int i9 = l7 >> 24 & 3;
  803. int l9 = l7 >> 1 & 3;
  804. int j10 = l7 >> 14 & 0x3ff;
  805. int l10 = l7 >> 3 & 0x7ff;
  806. int j11 = (j10 / 8 << 8) + l10 / 8;
  807. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  808. {
  809. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  810. continue;
  811. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  812. break;
  813. }
  814. }
  815. }
  816. }
  817. }
  818. for(int l4 = 0; l4 < 13; l4++)
  819. {
  820. for(int k6 = 0; k6 < 13; k6++)
  821. {
  822. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  823. if(i8 == -1)
  824. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  825. }
  826. }
  827. stream.createFrame(0);
  828. for(int l6 = 0; l6 < 4; l6++)
  829. {
  830. for(int j8 = 0; j8 < 13; j8++)
  831. {
  832. for(int j9 = 0; j9 < 13; j9++)
  833. {
  834. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  835. if(i10 != -1)
  836. {
  837. int k10 = i10 >> 24 & 3;
  838. int i11 = i10 >> 1 & 3;
  839. int k11 = i10 >> 14 & 0x3ff;
  840. int i12 = i10 >> 3 & 0x7ff;
  841. int j12 = (k11 / 8 << 8) + i12 / 8;
  842. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  843. {
  844. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  845. continue;
  846. //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  847. byte abyte0[] = aByteArrayArray1247[k12];
  848. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  849. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  850. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  851. break;
  852. }
  853. }
  854. }
  855. }
  856. }
  857. }
  858. stream.createFrame(0);
  859. objectManager.method171(aClass11Array1230, worldController);
  860. aRSImageProducer_1165.initDrawingArea();
  861. stream.createFrame(0);
  862. int k3 = ObjectManager.anInt145;
  863. if(k3 > plane)
  864. k3 = plane;
  865. if(k3 < plane - 1)
  866. k3 = plane - 1;
  867. if(lowMem)
  868. worldController.method275(ObjectManager.anInt145);
  869. else
  870. worldController.method275(0);
  871. for(int i5 = 0; i5 < 104; i5++)
  872. {
  873. for(int i7 = 0; i7 < 104; i7++)
  874. spawnGroundItem(i5, i7);
  875. }
  876. anInt1051++;
  877. if(anInt1051 > 98)
  878. {
  879. anInt1051 = 0;
  880. stream.createFrame(150);
  881. }
  882. method63();
  883. }
  884. catch(Exception exception) { }
  885. ObjectDef.mruNodes1.unlinkAll();
  886. if(super.gameFrame != null)
  887. {
  888. stream.createFrame(210);
  889. stream.writeDWord(0x3f008edd);
  890. }
  891. if(lowMem && signlink.cache_dat != null)
  892. {
  893. int j = onDemandFetcher.getVersionCount(0);
  894. for(int i1 = 0; i1 < j; i1++)
  895. {
  896. int l1 = onDemandFetcher.getModelIndex(i1);
  897. if((l1 & 0x79) == 0)
  898. Model.method461(i1);
  899. }
  900. }
  901. System.gc();
  902. Texture.method367();
  903. onDemandFetcher.method566();
  904. int k = (anInt1069 - 6) / 8 - 1;
  905. int j1 = (anInt1069 + 6) / 8 + 1;
  906. int i2 = (anInt1070 - 6) / 8 - 1;
  907. int l2 = (anInt1070 + 6) / 8 + 1;
  908. if(aBoolean1141)
  909. {
  910. k = 49;
  911. j1 = 50;
  912. i2 = 49;
  913. l2 = 50;
  914. }
  915. for(int l3 = k; l3 <= j1; l3++)
  916. {
  917. for(int j5 = i2; j5 <= l2; j5++)
  918. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  919. {
  920. int j7 = onDemandFetcher.method562(0, j5, l3);
  921. if(j7 != -1)
  922. onDemandFetcher.method560(j7, 3);
  923. int k8 = onDemandFetcher.method562(1, j5, l3);
  924. if(k8 != -1)
  925. onDemandFetcher.method560(k8, 3);
  926. }
  927. }
  928. }
  929. private void unlinkMRUNodes()
  930. {
  931. ObjectDef.mruNodes1.unlinkAll();
  932. ObjectDef.mruNodes2.unlinkAll();
  933. EntityDef.mruNodes.unlinkAll();
  934. ItemDef.mruNodes2.unlinkAll();
  935. ItemDef.mruNodes1.unlinkAll();
  936. Player.mruNodes.unlinkAll();
  937. SpotAnim.aMRUNodes_415.unlinkAll();
  938. }
  939. private void method24(int i)
  940. {
  941. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  942. int j = ai.length;
  943. for(int k = 0; k < j; k++)
  944. ai[k] = 0;
  945. for(int l = 1; l < 103; l++)
  946. {
  947. int i1 = 24628 + (103 - l) * 512 * 4;
  948. for(int k1 = 1; k1 < 103; k1++)
  949. {
  950. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  951. worldController.method309(ai, i1, i, k1, l);
  952. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  953. worldController.method309(ai, i1, i + 1, k1, l);
  954. i1 += 4;
  955. }
  956. }
  957. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  958. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  959. aClass30_Sub2_Sub1_Sub1_1263.method343();
  960. for(int i2 = 1; i2 < 103; i2++)
  961. {
  962. for(int j2 = 1; j2 < 103; j2++)
  963. {
  964. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  965. method50(i2, j1, j2, l1, i);
  966. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  967. method50(i2, j1, j2, l1, i + 1);
  968. }
  969. }
  970. aRSImageProducer_1165.initDrawingArea();
  971. anInt1071 = 0;
  972. for(int k2 = 0; k2 < 104; k2++)
  973. {
  974. for(int l2 = 0; l2 < 104; l2++)
  975. {
  976. int i3 = worldController.method303(plane, k2, l2);
  977. if(i3 != 0)
  978. {
  979. i3 = i3 >> 14 & 0x7fff;
  980. int j3 = ObjectDef.forID(i3).anInt746;
  981. if(j3 >= 0)
  982. {
  983. int k3 = k2;
  984. int l3 = l2;
  985. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  986. {
  987. byte byte0 = 104;
  988. byte byte1 = 104;
  989. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  990. for(int i4 = 0; i4 < 10; i4++)
  991. {
  992. int j4 = (int)(Math.random() * 4D);
  993. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  994. k3--;
  995. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  996. k3++;
  997. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  998. l3--;
  999. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1000. l3++;
  1001. }
  1002. }
  1003. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1004. anIntArray1072[anInt1071] = k3;
  1005. anIntArray1073[anInt1071] = l3;
  1006. anInt1071++;
  1007. }
  1008. }
  1009. }
  1010. }
  1011. }
  1012. private void spawnGroundItem(int i, int j)
  1013. {
  1014. NodeList class19 = groundArray[plane][i][j];
  1015. if(class19 == null)
  1016. {
  1017. worldController.method295(plane, i, j);
  1018. return;
  1019. }
  1020. int k = 0xfa0a1f01;
  1021. Object obj = null;
  1022. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1023. {
  1024. ItemDef itemDef = ItemDef.forID(item.ID);
  1025. int l = itemDef.value;
  1026. if(itemDef.stackable)
  1027. l *= item.anInt1559 + 1;
  1028. // notifyItemSpawn(item, i + baseX, j + baseY);
  1029. if(l > k)
  1030. {
  1031. k = l;
  1032. obj = item;
  1033. }
  1034. }
  1035. class19.insertTail(((Node) (obj)));
  1036. Object obj1 = null;
  1037. Object obj2 = null;
  1038. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1039. {
  1040. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1041. obj1 = class30_sub2_sub4_sub2_1;
  1042. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1043. obj2 = class30_sub2_sub4_sub2_1;
  1044. }
  1045. int i1 = i + (j << 7) + 0x60000000;
  1046. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1047. }
  1048. private void method26(boolean flag)
  1049. {
  1050. for(int j = 0; j < npcCount; j++)
  1051. {
  1052. NPC npc = npcArray[npcIndices[j]];
  1053. int k = 0x20000000 + (npcIndices[j] << 14);
  1054. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1055. continue;
  1056. int l = npc.x >> 7;
  1057. int i1 = npc.y >> 7;
  1058. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1059. continue;
  1060. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1061. {
  1062. if(anIntArrayArray929[l][i1] == anInt1265)
  1063. continue;
  1064. anIntArrayArray929[l][i1] = anInt1265;
  1065. }
  1066. if(!npc.desc.aBoolean84)
  1067. k += 0x80000000;
  1068. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1069. }
  1070. }
  1071. private boolean replayWave()
  1072. {
  1073. return signlink.wavereplay();
  1074. }
  1075. private void loadError()
  1076. {
  1077. String s = "ondemand";//was a constant parameter
  1078. System.out.println(s);
  1079. try
  1080. {
  1081. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1082. }
  1083. catch(Exception exception)
  1084. {
  1085. exception.printStackTrace();
  1086. }
  1087. do
  1088. try
  1089. {
  1090. Thread.sleep(1000L);
  1091. }
  1092. catch(Exception _ex) { }
  1093. while(true);
  1094. }
  1095. public void drawHoverBox(int xPos, int yPos, String text) {
  1096. String[] results = text.split("\n");
  1097. int height = (results.length * 16) + 6;
  1098. int width;
  1099. width = chatTextDrawingArea.getTextWidth(results[0]) + 6;
  1100. for(int i = 1; i < results.length; i++)
  1101. if(width <= chatTextDrawingArea.getTextWidth(results[i]) + 6)
  1102. width = chatTextDrawingArea.getTextWidth(results[i]) + 6;
  1103. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1104. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1105. yPos += 14;
  1106. for(int i = 0; i < results.length; i++) {
  1107. chatTextDrawingArea.method389(false, xPos + 3, 0, results[i], yPos);
  1108. yPos += 16;
  1109. }
  1110. }
  1111. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1112. {
  1113. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1114. return;
  1115. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1116. return;
  1117. int k1 = class9.children.length;
  1118. for(int l1 = 0; l1 < k1; l1++)
  1119. {
  1120. int i2 = class9.childX[l1] + i;
  1121. int j2 = (class9.childY[l1] + l) - j1;
  1122. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1123. i2 += class9_1.anInt263;
  1124. j2 += class9_1.anInt265;
  1125. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1126. if(class9_1.mOverInterToTrigger >= 0)
  1127. anInt886 = class9_1.mOverInterToTrigger;
  1128. else
  1129. anInt886 = class9_1.id;
  1130. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1131. anInt1315 = class9_1.id;
  1132. }
  1133. if(class9_1.type == 0)
  1134. {
  1135. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1136. if(class9_1.scrollMax > class9_1.height)
  1137. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1138. } else
  1139. {
  1140. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1141. {
  1142. boolean flag = false;
  1143. if(class9_1.contentType != 0)
  1144. flag = buildFriendsListMenu(class9_1);
  1145. if(!flag)
  1146. {
  1147. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1148. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1149. menuActionID[menuActionRow] = 315;
  1150. menuActionCmd3[menuActionRow] = class9_1.id;
  1151. menuActionRow++;
  1152. }
  1153. }
  1154. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1155. {
  1156. String s = class9_1.selectedActionName;
  1157. if(s.indexOf(" ") != -1)
  1158. s = s.substring(0, s.indexOf(" "));
  1159. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1160. menuActionID[menuActionRow] = 626;
  1161. menuActionCmd3[menuActionRow] = class9_1.id;
  1162. menuActionRow++;
  1163. }
  1164. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1165. {
  1166. menuActionName[menuActionRow] = "Close";
  1167. menuActionID[menuActionRow] = 200;
  1168. menuActionCmd3[menuActionRow] = class9_1.id;
  1169. menuActionRow++;
  1170. }
  1171. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1172. {
  1173. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1174. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1175. menuActionID[menuActionRow] = 169;
  1176. menuActionCmd3[menuActionRow] = class9_1.id;
  1177. menuActionRow++;
  1178. if (class9_1.hoverText != null) {
  1179. //drawHoverBox(k, l, class9_1.hoverText);
  1180. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1181. }
  1182. }
  1183. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1184. {
  1185. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1186. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1187. menuActionID[menuActionRow] = 646;
  1188. menuActionCmd3[menuActionRow] = class9_1.id;
  1189. menuActionRow++;
  1190. }
  1191. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1192. {
  1193. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1194. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1195. menuActionID[menuActionRow] = 679;
  1196. menuActionCmd3[menuActionRow] = class9_1.id;
  1197. menuActionRow++;
  1198. }
  1199. if(class9_1.type == 2)
  1200. {
  1201. int k2 = 0;
  1202. for(int l2 = 0; l2 < class9_1.height; l2++)
  1203. {
  1204. for(int i3 = 0; i3 < class9_1.width; i3++)
  1205. {
  1206. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1207. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1208. if(k2 < 20)
  1209. {
  1210. j3 += class9_1.spritesX[k2];
  1211. k3 += class9_1.spritesY[k2];
  1212. }
  1213. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1214. {
  1215. mouseInvInterfaceIndex = k2;
  1216. lastActiveInvInterface = class9_1.id;
  1217. if(class9_1.inv[k2] > 0)
  1218. {
  1219. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1220. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1221. {
  1222. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1223. {
  1224. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1225. menuActionID[menuActionRow] = 870;
  1226. menuActionCmd1[menuActionRow] = itemDef.id;
  1227. menuActionCmd2[menuActionRow] = k2;
  1228. menuActionCmd3[menuActionRow] = class9_1.id;
  1229. menuActionRow++;
  1230. }
  1231. } else
  1232. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1233. {
  1234. if((spellUsableOn & 0x10) == 16)
  1235. {
  1236. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1237. menuActionID[menuActionRow] = 543;
  1238. menuActionCmd1[menuActionRow] = itemDef.id;
  1239. menuActionCmd2[menuActionRow] = k2;
  1240. menuActionCmd3[menuActionRow] = class9_1.id;
  1241. menuActionRow++;
  1242. }
  1243. } else
  1244. {
  1245. if(class9_1.isInventoryInterface)
  1246. {
  1247. for(int l3 = 4; l3 >= 3; l3--)
  1248. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1249. {
  1250. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1251. if(l3 == 3)
  1252. menuActionID[menuActionRow] = 493;
  1253. if(l3 == 4)
  1254. menuActionID[menuActionRow] = 847;
  1255. menuActionCmd1[menuActionRow] = itemDef.id;
  1256. menuActionCmd2[menuActionRow] = k2;
  1257. menuActionCmd3[menuActionRow] = class9_1.id;
  1258. menuActionRow++;
  1259. } else
  1260. if(l3 == 4)
  1261. {
  1262. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1263. menuActionID[menuActionRow] = 847;
  1264. menuActionCmd1[menuActionRow] = itemDef.id;
  1265. menuActionCmd2[menuActionRow] = k2;
  1266. menuActionCmd3[menuActionRow] = class9_1.id;
  1267. menuActionRow++;
  1268. }
  1269. }
  1270. if(class9_1.usableItemInterface)
  1271. {
  1272. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1273. menuActionID[menuActionRow] = 447;
  1274. menuActionCmd1[menuActionRow] = itemDef.id;
  1275. //k2 = inventory spot
  1276. //System.out.println(k2);
  1277. menuActionCmd2[menuActionRow] = k2;
  1278. menuActionCmd3[menuActionRow] = class9_1.id;
  1279. menuActionRow++;
  1280. }
  1281. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1282. {
  1283. for(int i4 = 2; i4 >= 0; i4--)
  1284. if(itemDef.actions[i4] != null)
  1285. {
  1286. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1287. if(i4 == 0)
  1288. menuActionID[menuActionRow] = 74;
  1289. if(i4 == 1)
  1290. menuActionID[menuActionRow] = 454;
  1291. if(i4 == 2)
  1292. menuActionID[menuActionRow] = 539;
  1293. menuActionCmd1[menuActionRow] = itemDef.id;
  1294. menuActionCmd2[menuActionRow] = k2;
  1295. menuActionCmd3[menuActionRow] = class9_1.id;
  1296. menuActionRow++;
  1297. }
  1298. }
  1299. if(class9_1.actions != null)
  1300. {
  1301. for(int j4 = 4; j4 >= 0; j4--)
  1302. if(class9_1.actions[j4] != null)
  1303. {
  1304. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1305. if(j4 == 0)
  1306. menuActionID[menuActionRow] = 632;
  1307. if(j4 == 1)
  1308. menuActionID[menuActionRow] = 78;
  1309. if(j4 == 2)
  1310. menuActionID[menuActionRow] = 867;
  1311. if(j4 == 3)
  1312. menuActionID[menuActionRow] = 431;
  1313. if(j4 == 4)
  1314. menuActionID[menuActionRow] = 53;
  1315. menuActionCmd1[menuActionRow] = itemDef.id;
  1316. menuActionCmd2[menuActionRow] = k2;
  1317. menuActionCmd3[menuActionRow] = class9_1.id;
  1318. menuActionRow++;
  1319. }
  1320. }
  1321. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1322. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1323. menuActionID[menuActionRow] = 1125;
  1324. menuActionCmd1[menuActionRow] = itemDef.id;
  1325. menuActionCmd2[menuActionRow] = k2;
  1326. menuActionCmd3[menuActionRow] = class9_1.id;
  1327. menuActionRow++;
  1328. }
  1329. }
  1330. }
  1331. k2++;
  1332. }
  1333. }
  1334. }
  1335. }
  1336. }
  1337. }
  1338. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1339. scrollBar1.drawSprite(i1, l);
  1340. scrollBar2.drawSprite(i1, (l + j) - 16);
  1341. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1342. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1343. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1344. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1345. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1346. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1347. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1348. int k1 = ((j - 32) * j) / j1;
  1349. if(k1 < 8)
  1350. k1 = 8;
  1351. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1352. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1353. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1354. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1355. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1356. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1357. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1358. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1359. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1360. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1361. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1362. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1363. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1364. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1365. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1366. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1367. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1368. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1369. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1370. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1371. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1372. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1373. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1374. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1375. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1376. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1377. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1378. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1379. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1380. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1381. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1382. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1383. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1384. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1385. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1386. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1387. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1388. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1389. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1390. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1391. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1392. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1393. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1394. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1395. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1396. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1397. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1398. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1399. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1400. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1401. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1402. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1403. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1404. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1405. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1406. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1407. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1408. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1409. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1410. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1411. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1412. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1413. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1414. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1415. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1416. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1417. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1418. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1419. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1420. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1421. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1422. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1423. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1424. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1425. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1426. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1427. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1428. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1429. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1430. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1431. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1432. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1433. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1434. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1435. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1436. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1437. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1438. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1439. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1440. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1441. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1442. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1443. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1444. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1445. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1446. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1447. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1448. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1449. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1450. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1451. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1452. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1453. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1454. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1455. }
  1456. private void updateNPCs(Stream stream, int i)
  1457. {
  1458. anInt839 = 0;
  1459. anInt893 = 0;
  1460. method139(stream);
  1461. method46(i, stream);
  1462. method86(stream);
  1463. for(int k = 0; k < anInt839; k++)
  1464. {
  1465. int l = anIntArray840[k];
  1466. if(npcArray[l].anInt1537 != loopCycle)
  1467. {
  1468. npcArray[l].desc = null;
  1469. npcArray[l] = null;
  1470. }
  1471. }
  1472. if(stream.currentOffset != i)
  1473. {
  1474. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1475. throw new RuntimeException("eek");
  1476. }
  1477. for(int i1 = 0; i1 < npcCount; i1++)
  1478. if(npcArray[npcIndices[i1]] == null)
  1479. {
  1480. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1481. throw new RuntimeException("eek");
  1482. }
  1483. }
  1484. private int cButtonHPos;
  1485. private int cButtonHCPos;
  1486. private int cButtonCPos;
  1487. private void processChatModeClick() {
  1488. int x = isFullScreen ? extraWidth : 0;
  1489. int y = isFullScreen ? extraHeight : 0;
  1490. if(!newMap) {
  1491. if(super.mouseX >= 6 && super.mouseX <= 62 && super.mouseY >= 482+y && super.mouseY <= 505+y) {
  1492. cButtonHPos = 0;
  1493. //aBoolean1233 = true;
  1494. inputTaken = true;
  1495. }
  1496. else if(super.mouseX >= 63 && super.mouseX <= 118 && super.mouseY >= 482+y && super.mouseY <= 505+y) {
  1497. cButtonHPos = 1;
  1498. //aBoolean1233 = true;
  1499. inputTaken = true;
  1500. }
  1501. else if(super.mouseX >= 119 && super.mouseX <= 175 && super.mouseY >= 482+y && super.mouseY <= 505+y) {
  1502. cButtonHPos = 2;
  1503. //aBoolean1233 = true;
  1504. inputTaken = true;
  1505. }
  1506. else if(super.mouseX >= 177 && super.mouseX <= 232 && super.mouseY >= 482+y && super.mouseY <= 505+y) {
  1507. cButtonHPos = 3;
  1508. //aBoolean1233 = true;
  1509. inputTaken = true;
  1510. }
  1511. else if(super.mouseX >= 233 && super.mouseX <= 289 && super.mouseY >= 482+y && super.mouseY <= 505+y) {
  1512. cButtonHPos = 4;
  1513. //aBoolean1233 = true;
  1514. inputTaken = true;
  1515. }
  1516. else if(super.mouseX >= 290 && super.mouseX <= 346 && super.mouseY >= 482+y && super.mouseY <= 505+y) {
  1517. cButtonHPos = 5;
  1518. //aBoolean1233 = true;
  1519. inputTaken = true;
  1520. }
  1521. else if(super.mouseX >= 347 && super.mouseX <= 403 && super.mouseY >= 482+y && super.mouseY <= 505+y) {
  1522. cButtonHPos = 6;
  1523. //aBoolean1233 = true;
  1524. inputTaken = true;
  1525. }
  1526. else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482+y && super.mouseY <= 505+y) {
  1527. cButtonHPos = 7;
  1528. //aBoolean1233 = true;
  1529. inputTaken = true;
  1530. } else {
  1531. cButtonHPos = -1;
  1532. //aBoolean1233 = true;
  1533. inputTaken = true;
  1534. }
  1535. if(super.clickMode3 == 1) {
  1536. if(super.saveClickX >= 6 && super.saveClickX <= 62 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1537. cButtonCPos = 0;
  1538. chatTypeView = 0;
  1539. //aBoolean1233 = true;
  1540. inputTaken = true;
  1541. }
  1542. if(super.saveClickX >= 63 && super.saveClickX <= 118 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1543. cButtonCPos = 1;
  1544. chatTypeView = 5;
  1545. //aBoolean1233 = true;
  1546. inputTaken = true;
  1547. }
  1548. if(super.saveClickX >= 119 && super.saveClickX <= 175 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1549. cButtonCPos = 2;
  1550. chatTypeView = 1;
  1551. //aBoolean1233 = true;
  1552. inputTaken = true;
  1553. }
  1554. if(super.saveClickX >= 177 && super.saveClickX <= 232 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1555. cButtonCPos = 3;
  1556. chatTypeView = 2;
  1557. //aBoolean1233 = true;
  1558. inputTaken = true;
  1559. }
  1560. if(super.saveClickX >= 233 && super.saveClickX <= 289 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1561. cButtonCPos = 4;
  1562. chatTypeView = 11;
  1563. //aBoolean1233 = true;
  1564. inputTaken = true;
  1565. }
  1566. if(super.saveClickX >= 290 && super.saveClickX <= 346 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1567. cButtonCPos = 5;
  1568. chatTypeView = 3;
  1569. //aBoolean1233 = true;
  1570. inputTaken = true;
  1571. }
  1572. if(super.saveClickX >= 347 && super.saveClickX <= 403 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1573. cButtonCPos = 6;
  1574. chatTypeView = 4;
  1575. //aBoolean1233 = true;
  1576. inputTaken = true;
  1577. }
  1578. if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1579. if(openInterfaceID == -1) {
  1580. clearTopInterfaces();
  1581. reportAbuseInput = "";
  1582. canMute = false;
  1583. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1584. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1585. continue;
  1586. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1587. break;
  1588. }
  1589. } else {
  1590. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1591. }
  1592. }
  1593. }
  1594. } else
  1595. if(newMap) {
  1596. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  1597. cButtonHPos = 0;
  1598. //aBoolean1233 = true;
  1599. inputTaken = true;
  1600. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  1601. cButtonHPos = 1;
  1602. //aBoolean1233 = true;
  1603. inputTaken = true;
  1604. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  1605. cButtonHPos = 2;
  1606. //aBoolean1233 = true;
  1607. inputTaken = true;
  1608. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  1609. cButtonHPos = 3;
  1610. //aBoolean1233 = true;
  1611. inputTaken = true;
  1612. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  1613. cButtonHPos = 4;
  1614. //aBoolean1233 = true;
  1615. inputTaken = true;
  1616. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  1617. cButtonHPos = 5;
  1618. //aBoolean1233 = true;
  1619. inputTaken = true;
  1620. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  1621. cButtonHPos = 6;
  1622. //aBoolean1233 = true;
  1623. inputTaken = true;
  1624. } else {
  1625. cButtonHPos = -1;
  1626. //aBoolean1233 = true;
  1627. inputTaken = true;
  1628. }
  1629. if(super.clickMode3 == 1) {
  1630. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1631. cButtonCPos = 0;
  1632. chatTypeView = 0;
  1633. //aBoolean1233 = true;
  1634. inputTaken = true;
  1635. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1636. cButtonCPos = 1;
  1637. chatTypeView = 5;
  1638. //aBoolean1233 = true;
  1639. inputTaken = true;
  1640. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1641. cButtonCPos = 2;
  1642. chatTypeView = 1;
  1643. //aBoolean1233 = true;
  1644. inputTaken = true;
  1645. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1646. cButtonCPos = 3;
  1647. chatTypeView = 2;
  1648. //aBoolean1233 = true;
  1649. inputTaken = true;
  1650. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1651. cButtonCPos = 4;
  1652. chatTypeView = 11;
  1653. //aBoolean1233 = true;
  1654. inputTaken = true;
  1655. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1656. cButtonCPos = 5;
  1657. chatTypeView = 3;
  1658. //aBoolean1233 = true;
  1659. inputTaken = true;
  1660. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482+y && super.saveClickY <= 505+y) {
  1661. if(openInterfaceID == -1) {
  1662. clearTopInterfaces();
  1663. reportAbuseInput = "";
  1664. canMute = false;
  1665. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1666. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1667. continue;
  1668. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1669. break;
  1670. }
  1671. } else {
  1672. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1673. }
  1674. }
  1675. }
  1676. }
  1677. }
  1678. private void method33(int i)
  1679. {
  1680. int j = Varp.cache[i].anInt709;
  1681. if(j == 0)
  1682. return;
  1683. int k = variousSettings[i];
  1684. if(j == 1)
  1685. {
  1686. if(k == 1)
  1687. Texture.method372(0.90000000000000002D);
  1688. if(k == 2)
  1689. Texture.method372(0.80000000000000004D);
  1690. if(k == 3)
  1691. Texture.method372(0.69999999999999996D);
  1692. if(k == 4)
  1693. Texture.method372(0.59999999999999998D);
  1694. ItemDef.mruNodes1.unlinkAll();
  1695. welcomeScreenRaised = true;
  1696. }
  1697. if(j == 3)
  1698. {
  1699. boolean flag1 = musicEnabled;
  1700. if(k == 0)
  1701. {
  1702. adjustVolume(musicEnabled, 0);
  1703. musicEnabled = true;
  1704. }
  1705. if(k == 1)
  1706. {
  1707. adjustVolume(musicEnabled, -400);
  1708. musicEnabled = true;
  1709. }
  1710. if(k == 2)
  1711. {
  1712. adjustVolume(musicEnabled, -800);
  1713. musicEnabled = true;
  1714. }
  1715. if(k == 3)
  1716. {
  1717. adjustVolume(musicEnabled, -1200);
  1718. musicEnabled = true;
  1719. }
  1720. if(k == 4)
  1721. musicEnabled = false;
  1722. if(musicEnabled != flag1 && !lowMem)
  1723. {
  1724. if(musicEnabled)
  1725. {
  1726. nextSong = currentSong;
  1727. songChanging = true;
  1728. onDemandFetcher.method558(2, nextSong);
  1729. } else
  1730. {
  1731. stopMidi();
  1732. }
  1733. prevSong = 0;
  1734. }
  1735. }
  1736. if(j == 4)
  1737. {
  1738. if(k == 0)
  1739. {
  1740. aBoolean848 = true;
  1741. setWaveVolume(0);
  1742. }
  1743. if(k == 1)
  1744. {
  1745. aBoolean848 = true;
  1746. setWaveVolume(-400);
  1747. }
  1748. if(k == 2)
  1749. {
  1750. aBoolean848 = true;
  1751. setWaveVolume(-800);
  1752. }
  1753. if(k == 3)
  1754. {
  1755. aBoolean848 = true;
  1756. setWaveVolume(-1200);
  1757. }
  1758. if(k == 4)
  1759. aBoolean848 = false;
  1760. }
  1761. if(j == 5)
  1762. anInt1253 = k;
  1763. if(j == 6)
  1764. anInt1249 = k;
  1765. if(j == 8)
  1766. {
  1767. splitPrivateChat = k;
  1768. inputTaken = true;
  1769. }
  1770. if(j == 9)
  1771. anInt913 = k;
  1772. }
  1773. private void updateEntities() {
  1774. try{
  1775. int anInt974 = 0;
  1776. for(int j = -1; j < playerCount + npcCount; j++) {
  1777. Object obj;
  1778. if(j == -1)
  1779. obj = myPlayer;
  1780. else
  1781. if(j < playerCount)
  1782. obj = playerArray[playerIndices[j]];
  1783. else
  1784. obj = npcArray[npcIndices[j - playerCount]];
  1785. if(obj == null || !((Entity) (obj)).isVisible())
  1786. continue;
  1787. if(obj instanceof NPC) {
  1788. EntityDef entityDef = ((NPC)obj).desc;
  1789. if(entityDef.childrenIDs != null)
  1790. entityDef = entityDef.method161();
  1791. if(entityDef == null)
  1792. continue;
  1793. }
  1794. if(j < playerCount) {
  1795. int l = 30;
  1796. Player player = (Player)obj;
  1797. if(player.headIcon >= 0) {
  1798. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1799. if(spriteDrawX > -1) {
  1800. if (player.skullIcon < 2) {
  1801. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1802. l += 25;
  1803. }
  1804. if (player.headIcon < 7) {
  1805. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1806. l += 18;
  1807. }
  1808. }
  1809. }
  1810. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1811. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1812. if(spriteDrawX > -1)
  1813. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1814. }
  1815. } else {
  1816. EntityDef entityDef_1 = ((NPC)obj).desc;
  1817. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1818. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1819. if(spriteDrawX > -1)
  1820. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1821. }
  1822. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1823. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1824. if(spriteDrawX > -1)
  1825. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1826. }
  1827. }
  1828. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1829. {
  1830. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1831. if(spriteDrawX > -1 && anInt974 < anInt975)
  1832. {
  1833. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1834. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1835. anIntArray976[anInt974] = spriteDrawX;
  1836. anIntArray977[anInt974] = spriteDrawY;
  1837. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1838. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1839. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1840. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1841. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1842. {
  1843. anIntArray978[anInt974] += 10;
  1844. anIntArray977[anInt974] += 5;
  1845. }
  1846. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1847. anIntArray979[anInt974] = 60;
  1848. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1849. anIntArray978[anInt974] += 5;
  1850. }
  1851. }
  1852. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1853. {
  1854. try{
  1855. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1856. if(spriteDrawX > -1)
  1857. {
  1858. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1859. if(i1 > 30)
  1860. i1 = 30;
  1861. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1862. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1863. }
  1864. }catch(Exception e){ }
  1865. }
  1866. for(int j1 = 0; j1 < 4; j1++)
  1867. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1868. {
  1869. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1870. if(spriteDrawX > -1)
  1871. {
  1872. if(j1 == 1)
  1873. spriteDrawY -= 20;
  1874. if(j1 == 2)
  1875. {
  1876. spriteDrawX -= 15;
  1877. spriteDrawY -= 10;
  1878. }
  1879. if(j1 == 3)
  1880. {
  1881. spriteDrawX += 15;
  1882. spriteDrawY -= 10;
  1883. }
  1884. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1885. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1886. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1887. }
  1888. }
  1889. }
  1890. for(int k = 0; k < anInt974; k++) {
  1891. int k1 = anIntArray976[k];
  1892. int l1 = anIntArray977[k];
  1893. int j2 = anIntArray979[k];
  1894. int k2 = anIntArray978[k];
  1895. boolean flag = true;
  1896. while(flag)
  1897. {
  1898. flag = false;
  1899. for(int l2 = 0; l2 < k; l2++)
  1900. if(l1 + 2 > anIntArray977[l2] - anIntArray978[l2] && l1 - k2 < anIntArray977[l2] + 2 && k1 - j2 < anIntArray976[l2] + anIntArray979[l2] && k1 + j2 > anIntArray976[l2] - anIntArray979[l2] && anIntArray977[l2] - anIntArray978[l2] < l1)
  1901. {
  1902. l1 = anIntArray977[l2] - anIntArray978[l2];
  1903. flag = true;
  1904. }
  1905. }
  1906. spriteDrawX = anIntArray976[k];
  1907. spriteDrawY = anIntArray977[k] = l1;
  1908. String s = aStringArray983[k];
  1909. if(anInt1249 == 0)
  1910. {
  1911. int i3 = 0xffff00;
  1912. if(anIntArray980[k] < 6)
  1913. i3 = anIntArray965[anIntArray980[k]];
  1914. if(anIntArray980[k] == 6)
  1915. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1916. if(anIntArray980[k] == 7)
  1917. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1918. if(anIntArray980[k] == 8)
  1919. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1920. if(anIntArray980[k] == 9) {
  1921. int j3 = 150 - anIntArray982[k];
  1922. if(j3 < 50)
  1923. i3 = 0xff0000 + 1280 * j3;
  1924. else
  1925. if(j3 < 100)
  1926. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1927. else
  1928. if(j3 < 150)
  1929. i3 = 65280 + 5 * (j3 - 100);
  1930. }
  1931. if(anIntArray980[k] == 10) {
  1932. int k3 = 150 - anIntArray982[k];
  1933. if(k3 < 50)
  1934. i3 = 0xff0000 + 5 * k3;
  1935. else
  1936. if(k3 < 100)
  1937. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1938. else
  1939. if(k3 < 150)
  1940. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1941. }
  1942. if(anIntArray980[k] == 11) {
  1943. int l3 = 150 - anIntArray982[k];
  1944. if(l3 < 50)
  1945. i3 = 0xffffff - 0x50005 * l3;
  1946. else
  1947. if(l3 < 100)
  1948. i3 = 65280 + 0x50005 * (l3 - 50);
  1949. else
  1950. if(l3 < 150)
  1951. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1952. }
  1953. if(anIntArray981[k] == 0) {
  1954. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1955. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1956. }
  1957. if(anIntArray981[k] == 1) {
  1958. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1959. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1960. }
  1961. if(anIntArray981[k] == 2) {
  1962. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1963. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1964. }
  1965. if(anIntArray981[k] == 3) {
  1966. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1967. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1968. }
  1969. if(anIntArray981[k] == 4) {
  1970. int i4 = chatTextDrawingArea.method384(s);
  1971. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1972. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1973. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1974. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1975. DrawingArea.defaultDrawingAreaSize();
  1976. }
  1977. if(anIntArray981[k] == 5) {
  1978. int j4 = 150 - anIntArray982[k];
  1979. int l4 = 0;
  1980. if(j4 < 25)
  1981. l4 = j4 - 25;
  1982. else
  1983. if(j4 > 125)
  1984. l4 = j4 - 125;
  1985. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1986. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1987. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1988. DrawingArea.defaultDrawingAreaSize();
  1989. }
  1990. } else {
  1991. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1992. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1993. }
  1994. }
  1995. } catch(Exception e){ }
  1996. }
  1997. private void delFriend(long l)
  1998. {
  1999. try
  2000. {
  2001. if(l == 0L)
  2002. return;
  2003. for(int i = 0; i < friendsCount; i++)
  2004. {
  2005. if(friendsListAsLongs[i] != l)
  2006. continue;
  2007. friendsCount--;
  2008. needDrawTabArea = true;
  2009. for(int j = i; j < friendsCount; j++)
  2010. {
  2011. friendsList[j] = friendsList[j + 1];
  2012. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2013. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2014. }
  2015. stream.createFrame(215);
  2016. stream.writeQWord(l);
  2017. break;
  2018. }
  2019. }
  2020. catch(RuntimeException runtimeexception)
  2021. {
  2022. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2023. throw new RuntimeException();
  2024. }
  2025. }
  2026. public void drawSideIcons(){
  2027. int extraXX = drawLongTabs ? -241 : 0;
  2028. int extraYY = drawLongTabs ? +35 : 0;
  2029. int mhm = drawLongTabs ? +4 : 0;
  2030. int mhm2 = drawLongTabs ? -4 : 0;
  2031. int extraXX1 = drawLongTabs ? -233 : 0;
  2032. int extraX = isFullScreen ? extraWidth + 519 : 0;
  2033. int extraY = isFullScreen ? extraHeight + 168+262 : 0;
  2034. int extraX2 = !drawLongTabs ? extraWidth - 8 : 0;
  2035. int extraY2 = !drawLongTabs ? extraHeight - 5 : 0;
  2036. /* Top sideIcons */
  2037. if(tabInterfaceIDs[0] != -1)//attack
  2038. sideIcons[0].drawSprite(10+extraX+extraXX1, 4+extraY+extraYY);
  2039. if(tabInterfaceIDs[1] != -1)//stat
  2040. sideIcons[1].drawSprite(43+extraX+extraXX1, 4+extraY+extraYY);
  2041. if(tabInterfaceIDs[2] != -1)//quest
  2042. sideIcons[2].drawSprite(76+extraX+extraXX1, 3+extraY+extraYY);
  2043. if(tabInterfaceIDs[3] != -1)//inventory
  2044. sideIcons[3].drawSprite(111+extraX+extraXX1, 5+extraY+extraYY);
  2045. if(tabInterfaceIDs[4] != -1)//equipment
  2046. sideIcons[4].drawSprite(140+extraX+extraXX1, 1+extraY+extraYY);
  2047. if(tabInterfaceIDs[5] != -1)//prayer
  2048. sideIcons[5].drawSprite(174+extraX+extraXX1, 1+extraY+extraYY);
  2049. if(tabInterfaceIDs[6] != -1)//magic
  2050. sideIcons[6].drawSprite(208+extraX+extraXX1, 4+extraY+extraYY);
  2051. if (isFullScreen)
  2052. extraY -= 262;
  2053. /* Bottom sideIcons */
  2054. if (newMap) {
  2055. if(tabInterfaceIDs[7] != -1)//clan
  2056. sideIcons[7].drawSprite(11+extraX, 303+extraY);
  2057. if(tabInterfaceIDs[10] != -1)//options
  2058. sideIcons[10].drawSprite(113+extraX, 302+extraY);
  2059. }
  2060. if (!newMap) {
  2061. if(tabInterfaceIDs[10] != -1)//options
  2062. sideIcons[7].drawSprite(113+extraX, 302+extraY);
  2063. }
  2064. if(tabInterfaceIDs[8] != -1)//friends
  2065. sideIcons[8].drawSprite(46+extraX, 306+extraY);
  2066. if(tabInterfaceIDs[9] != -1)//ignore
  2067. sideIcons[9].drawSprite(79+extraX, 306+extraY);
  2068. if(tabInterfaceIDs[11] != -1)//options
  2069. sideIcons[11].drawSprite(145+extraX, 304+extraY);
  2070. if(tabInterfaceIDs[12] != -1)//emotes
  2071. sideIcons[12].drawSprite(181+extraX, 302+extraY);
  2072. if(tabInterfaceIDs[13] != -1)//music
  2073. sideIcons[13].drawSprite(213+extraX, 303+extraY);
  2074. }
  2075. public void drawRedStones() {
  2076. int extraX = isFullScreen ? extraWidth + 519 : 0;
  2077. int extraX2 = isFullScreen ? +4 : 0;
  2078. int extraX22 = isFullScreen ? -3 : 0;
  2079. int extraY = isFullScreen ? extraHeight + 168+262 : 0;
  2080. int extraY2 = isFullScreen ? extraHeight + 168 : 0;
  2081. int extraXX = drawLongTabs ? -232 : 0;
  2082. int extraYY = drawLongTabs ? +35 : 0;
  2083. int mhm = drawLongTabs ? +4 : 0;
  2084. int mhm2 = drawLongTabs ? -6 : 0;
  2085. int mhm4 = drawLongTabs ? +1 : 0;
  2086. int extraXX22 = drawLongTabs ? -241 : 0;
  2087. int extraYY22 = drawLongTabs ? +37 : 0;
  2088. if(isFullScreen && tabInterfaceIDs[tabID] != -1)
  2089. switch(tabID) {
  2090. case 0:
  2091. if(!drawLongTabs) {
  2092. redStones[0].drawSprite(3+extraX+extraXX, 0+extraY+extraYY);
  2093. } else {
  2094. redStones[4].drawSprite(3+extraX+extraXX+extraX2, 0+extraY+extraYY);
  2095. }
  2096. break;
  2097. case 1:
  2098. redStones[4].drawSprite(41+extraX+extraXX, 0+extraY+extraYY);
  2099. break;
  2100. case 2:
  2101. redStones[4].drawSprite(74+extraX+extraXX, 0+extraY+extraYY);
  2102. break;
  2103. case 3:
  2104. redStones[4].drawSprite(107+extraX+extraXX, 0+extraY+extraYY);
  2105. break;
  2106. case 4:
  2107. redStones[4].drawSprite(140+extraX+extraXX, 0+extraY+extraYY);
  2108. break;
  2109. case 5:
  2110. redStones[4].drawSprite(173+extraX+extraXX, 0+extraY+extraYY);
  2111. break;
  2112. case 6:
  2113. if(!drawLongTabs) {
  2114. redStones[1].drawSprite(206+extraX+extraXX, 0+extraY+extraYY);
  2115. } else {
  2116. redStones[4].drawSprite(206+extraX+extraXX, 0+extraY+extraYY);
  2117. }
  2118. break;
  2119. case 7:
  2120. if(!newMap) {
  2121. redStones[4].drawSprite(107+extraX, 298+extraY-262);
  2122. } else if(!drawLongTabs && newMap) {
  2123. redStones[2].drawSprite(3+extraX, 298+extraY-262);
  2124. } else {
  2125. redStones[4].drawSprite(3+extraX+extraX2, 298+extraY-262);
  2126. }
  2127. break;
  2128. case 8:
  2129. redStones[4].drawSprite(41+extraX, 298+extraY-262);
  2130. break;
  2131. case 9:
  2132. redStones[4].drawSprite(74+extraX, 298+extraY-262);
  2133. break;
  2134. case 10:
  2135. if (newMap) {
  2136. redStones[4].drawSprite(107+extraX, 298+extraY-262);
  2137. }
  2138. break;
  2139. case 11:
  2140. redStones[4].drawSprite(140+extraX, 298+extraY-262);
  2141. break;
  2142. case 12:
  2143. redStones[4].drawSprite(173+extraX, 298+extraY-262);
  2144. break;
  2145. case 13:
  2146. if(!drawLongTabs) {
  2147. redStones[3].drawSprite(206+extraX, 298+extraY-262);
  2148. } else {
  2149. redStones[4].drawSprite(206+extraX+extraX22, 298+extraY-262);
  2150. }
  2151. break;
  2152. } else if(isFullScreen == false && tabInterfaceIDs[tabID] != -1)
  2153. switch(tabID) {
  2154. case 0:
  2155. redStones[0].drawSprite(3, 0);
  2156. break;
  2157. case 1:
  2158. redStones[4].drawSprite(41, 0);
  2159. break;
  2160. case 2:
  2161. redStones[4].drawSprite(74, 0);
  2162. break;
  2163. case 3:
  2164. redStones[4].drawSprite(107, 0);
  2165. break;
  2166. case 4:
  2167. redStones[4].drawSprite(140, 0);
  2168. break;
  2169. case 5:
  2170. redStones[4].drawSprite(173, 0);
  2171. break;
  2172. case 6:
  2173. redStones[1].drawSprite(206, 0);
  2174. break;
  2175. case 7:
  2176. if(!newMap) {
  2177. redStones[4].drawSprite(107, 298);
  2178. } else {
  2179. redStones[2].drawSprite(3, 298);
  2180. }
  2181. break;
  2182. case 8:
  2183. redStones[4].drawSprite(41, 298);
  2184. break;
  2185. case 9:
  2186. redStones[4].drawSprite(74, 298);
  2187. break;
  2188. case 10:
  2189. if(newMap) {
  2190. redStones[4].drawSprite(107, 298);
  2191. }
  2192. break;
  2193. case 11:
  2194. redStones[4].drawSprite(140, 298);
  2195. break;
  2196. case 12:
  2197. redStones[4].drawSprite(173, 298);
  2198. break;
  2199. case 13:
  2200. redStones[3].drawSprite(206, 298);
  2201. break;
  2202. }
  2203. }
  2204. private void drawTabArea() {
  2205. int x = isFullScreen ? extraWidth + 519 : 0;
  2206. int y = isFullScreen ? extraHeight + 168 : 0;
  2207. if(!isFullScreen)
  2208. aRSImageProducer_1163.initDrawingArea();
  2209. Texture.anIntArray1472 = anIntArray1181;
  2210. if (!isFullScreen) {
  2211. tabArea.drawSprite(0+x, 0+y);
  2212. }
  2213. if(isFullScreen && !is554 && drawLongTabs) {
  2214. fullScreenSprites[1].drawSprite(-247 + x, 299 + y);
  2215. }
  2216. if(isFullScreen && !is554 && !drawLongTabs) {
  2217. fullScreenSprites[2].drawSprite(-3+x, 262+y);
  2218. }
  2219. if(isFullScreen && is554 && !drawLongTabs) {
  2220. //tabs554.drawSprite(-3+x, 262+y);
  2221. }
  2222. if(invOverlayInterfaceID == -1) {
  2223. drawRedStones();
  2224. drawSideIcons();
  2225. }
  2226. if (isFullScreen)
  2227. drawTabBack();
  2228. else {
  2229. if(invOverlayInterfaceID != -1)
  2230. drawInterface(0, 28+x, RSInterface.interfaceCache[invOverlayInterfaceID], 37+y);
  2231. else if(tabInterfaceIDs[tabID] != -1)
  2232. drawInterface(0, 28+x, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37+y);
  2233. }
  2234. if(menuOpen && menuScreenArea == 1)
  2235. drawMenu();
  2236. if(!isFullScreen)
  2237. aRSImageProducer_1163.drawGraphics(168+extraHeight, isFullScreen ? bufferGraphics : super.graphics, 519+extraWidth);
  2238. aRSImageProducer_1165.initDrawingArea();
  2239. Texture.anIntArray1472 = anIntArray1182;
  2240. }
  2241. public void drawTabBack() {
  2242. if(!drawLongTabs)
  2243. fullScreenSprites[0].drawSprite2(554+extraWidth, 156+extraHeight);
  2244. if(invOverlayInterfaceID != -1 && !drawLongTabs)
  2245. drawInterface(0, 519+41+extraWidth, RSInterface.interfaceCache[invOverlayInterfaceID], 168+extraHeight-3);
  2246. else
  2247. if(tabInterfaceIDs[tabID] != -1 && !drawLongTabs)
  2248. drawInterface(0, 519+41+extraWidth, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 168+extraHeight-3);
  2249. if(drawLongTabs && is554)
  2250. fullScreenSprites[0].drawSprite2(554+extraWidth, 187+extraHeight);//193
  2251. if(invOverlayInterfaceID != -1 && drawLongTabs && is554)
  2252. drawInterface(0, 519+41+extraWidth, RSInterface.interfaceCache[invOverlayInterfaceID], 168+35-6+extraHeight-3);
  2253. else
  2254. if(tabInterfaceIDs[tabID] != -1 && drawLongTabs && is554)
  2255. drawInterface(0, 519+41+extraWidth, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 168+35-6+extraHeight-3);
  2256. if(drawLongTabs && !is554)
  2257. fullScreenSprites[0].drawSprite2(554+extraWidth, 193+extraHeight);//25
  2258. if(invOverlayInterfaceID != -1 && drawLongTabs && !is554)
  2259. drawInterface(0, 519+41+extraWidth, RSInterface.interfaceCache[invOverlayInterfaceID], 168+35+extraHeight-3);
  2260. else
  2261. if(tabInterfaceIDs[tabID] != -1 && drawLongTabs && !is554)
  2262. drawInterface(0, 519+41+extraWidth, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 168+35+extraHeight-3);
  2263. }
  2264. private void method37(int j) {
  2265. if(!lowMem) {
  2266. if(Texture.anIntArray1480[17] >= j) {
  2267. Background background = Texture.aBackgroundArray1474s[17];
  2268. int k = background.anInt1452 * background.anInt1453 - 1;
  2269. //fire cape apparently?
  2270. int j1 = background.anInt1452 * anInt945 * 2;
  2271. byte abyte0[] = background.aByteArray1450;
  2272. byte abyte3[] = aByteArray912;
  2273. for(int i2 = 0; i2 <= k; i2++)
  2274. abyte3[i2] = abyte0[i2 - j1 & k];
  2275. background.aByteArray1450 = abyte3;
  2276. aByteArray912 = abyte0;
  2277. Texture.method370(17);
  2278. anInt854++;
  2279. if(anInt854 > 1235) {
  2280. anInt854 = 0;
  2281. stream.createFrame(226);
  2282. stream.writeWordBigEndian(0);
  2283. int l2 = stream.currentOffset;
  2284. stream.writeWord(58722);
  2285. stream.writeWordBigEndian(240);
  2286. stream.writeWord((int)(Math.random() * 65536D));
  2287. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2288. if((int)(Math.random() * 2D) == 0)
  2289. stream.writeWord(51825);
  2290. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2291. stream.writeWord((int)(Math.random() * 65536D));
  2292. stream.writeWord(7130);
  2293. stream.writeWord((int)(Math.random() * 65536D));
  2294. stream.writeWord(61657);
  2295. stream.writeBytes(stream.currentOffset - l2);
  2296. }
  2297. }
  2298. if(Texture.anIntArray1480[24] >= j) {
  2299. Background background_1 = Texture.aBackgroundArray1474s[24];
  2300. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2301. int k1 = background_1.anInt1452 * anInt945 * 2;
  2302. byte abyte1[] = background_1.aByteArray1450;
  2303. byte abyte4[] = aByteArray912;
  2304. for(int j2 = 0; j2 <= l; j2++)
  2305. abyte4[j2] = abyte1[j2 - k1 & l];
  2306. background_1.aByteArray1450 = abyte4;
  2307. aByteArray912 = abyte1;
  2308. Texture.method370(24);
  2309. }
  2310. if(Texture.anIntArray1480[34] >= j) {
  2311. Background background_2 = Texture.aBackgroundArray1474s[34];
  2312. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2313. int l1 = background_2.anInt1452 * anInt945 * 2;
  2314. byte abyte2[] = background_2.aByteArray1450;
  2315. byte abyte5[] = aByteArray912;
  2316. for(int k2 = 0; k2 <= i1; k2++)
  2317. abyte5[k2] = abyte2[k2 - l1 & i1];
  2318. background_2.aByteArray1450 = abyte5;
  2319. aByteArray912 = abyte2;
  2320. Texture.method370(34);
  2321. }
  2322. if(Texture.anIntArray1480[40] >= j)
  2323. {
  2324. Background background_2 = Texture.aBackgroundArray1474s[40];
  2325. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2326. int l1 = background_2.anInt1452 * anInt945 * 2;
  2327. byte abyte2[] = background_2.aByteArray1450;
  2328. byte abyte5[] = aByteArray912;
  2329. for(int k2 = 0; k2 <= i1; k2++)
  2330. abyte5[k2] = abyte2[k2 - l1 & i1];
  2331. background_2.aByteArray1450 = abyte5;
  2332. aByteArray912 = abyte2;
  2333. Texture.method370(40);
  2334. }
  2335. }
  2336. }
  2337. private void method38() {
  2338. for(int i = -1; i < playerCount; i++) {
  2339. int j;
  2340. if(i == -1)
  2341. j = myPlayerIndex;
  2342. else
  2343. j = playerIndices[i];
  2344. Player player = playerArray[j];
  2345. if(player != null && player.textCycle > 0) {
  2346. player.textCycle--;
  2347. if(player.textCycle == 0)
  2348. player.textSpoken = null;
  2349. }
  2350. }
  2351. for(int k = 0; k < npcCount; k++) {
  2352. int l = npcIndices[k];
  2353. NPC npc = npcArray[l];
  2354. if(npc != null && npc.textCycle > 0) {
  2355. npc.textCycle--;
  2356. if(npc.textCycle == 0)
  2357. npc.textSpoken = null;
  2358. }
  2359. }
  2360. }
  2361. private void calcCameraPos() {
  2362. int i = anInt1098 * 128 + 64;
  2363. int j = anInt1099 * 128 + 64;
  2364. int k = method42(plane, j, i) - anInt1100;
  2365. if(xCameraPos < i) {
  2366. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2367. if(xCameraPos > i)
  2368. xCameraPos = i;
  2369. }
  2370. if(xCameraPos > i) {
  2371. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2372. if(xCameraPos < i)
  2373. xCameraPos = i;
  2374. }
  2375. if(zCameraPos < k) {
  2376. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2377. if(zCameraPos > k)
  2378. zCameraPos = k;
  2379. }
  2380. if(zCameraPos > k) {
  2381. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2382. if(zCameraPos < k)
  2383. zCameraPos = k;
  2384. }
  2385. if(yCameraPos < j) {
  2386. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2387. if(yCameraPos > j)
  2388. yCameraPos = j;
  2389. }
  2390. if(yCameraPos > j) {
  2391. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2392. if(yCameraPos < j)
  2393. yCameraPos = j;
  2394. }
  2395. i = anInt995 * 128 + 64;
  2396. j = anInt996 * 128 + 64;
  2397. k = method42(plane, j, i) - anInt997;
  2398. int l = i - xCameraPos;
  2399. int i1 = k - zCameraPos;
  2400. int j1 = j - yCameraPos;
  2401. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2402. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2403. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2404. if(l1 < 128)
  2405. l1 = 128;
  2406. if(l1 > 383)
  2407. l1 = 383;
  2408. if(yCameraCurve < l1) {
  2409. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2410. if(yCameraCurve > l1)
  2411. yCameraCurve = l1;
  2412. }
  2413. if(yCameraCurve > l1) {
  2414. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2415. if(yCameraCurve < l1)
  2416. yCameraCurve = l1;
  2417. }
  2418. int j2 = i2 - xCameraCurve;
  2419. if(j2 > 1024)
  2420. j2 -= 2048;
  2421. if(j2 < -1024)
  2422. j2 += 2048;
  2423. if(j2 > 0) {
  2424. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2425. xCameraCurve &= 0x7ff;
  2426. }
  2427. if(j2 < 0) {
  2428. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2429. xCameraCurve &= 0x7ff;
  2430. }
  2431. int k2 = i2 - xCameraCurve;
  2432. if(k2 > 1024)
  2433. k2 -= 2048;
  2434. if(k2 < -1024)
  2435. k2 += 2048;
  2436. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2437. xCameraCurve = i2;
  2438. }
  2439. private void drawMenu() {
  2440. int i = menuOffsetX;
  2441. int j = menuOffsetY;
  2442. int k = menuWidth;
  2443. int j1 = super.mouseX;
  2444. int k1 = super.mouseY;
  2445. int l = menuHeight + 1;
  2446. int i1 = 0x5d5447;
  2447. if (menuScreenArea == 1 && isFullScreen) {
  2448. i += 519;//+extraWidth;
  2449. j += 168;//+extraHeight;
  2450. }
  2451. if (menuScreenArea == 2 && isFullScreen) {
  2452. j += 338;
  2453. }
  2454. if (menuScreenArea == 3 && isFullScreen) {
  2455. i += 515;
  2456. j += 0;
  2457. }
  2458. if(menuScreenArea == 0) {
  2459. j1 -= 4;
  2460. k1 -= 4;
  2461. }
  2462. if(menuScreenArea == 1) {
  2463. if (!isFullScreen) {
  2464. j1 -= 519;
  2465. k1 -= 168;
  2466. }
  2467. }
  2468. if(menuScreenArea == 2) {
  2469. if (!isFullScreen) {
  2470. j1 -= 17;
  2471. k1 -= 338;
  2472. }
  2473. }
  2474. if(menuScreenArea == 3 && !isFullScreen) {
  2475. j1 -= 515;
  2476. k1 -= 0;
  2477. }
  2478. if(menuToggle == false) {
  2479. DrawingArea.method335(i1, j, k, l, 150, i);
  2480. DrawingArea.method335(0, j + 1, k - 2, 16, 150, i + 1);
  2481. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2482. DrawingArea.method338(j + 18, l - 19, 150, 0, k - 2, i + 1);
  2483. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14, i + 3);
  2484. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14, i + 3);
  2485. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2486. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2487. int j2 = 0xffffff;
  2488. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2489. j2 = 0xffff00;
  2490. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2491. }
  2492. } else if(menuToggle == true) {
  2493. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2494. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2495. DrawingArea.drawPixels(l - 4, j + 2, i, 0x706a5e, k);
  2496. DrawingArea.drawPixels(l - 2, j + 1, i + 1, 0x706a5e, k - 2);
  2497. DrawingArea.drawPixels(l, j, i + 2, 0x706a5e, k - 4);
  2498. DrawingArea.drawPixels(l - 2, j + 1, i + 3, 0x2d2822, k - 6);
  2499. DrawingArea.drawPixels(l - 4, j + 2, i + 2, 0x2d2822, k - 4);
  2500. DrawingArea.drawPixels(l - 6, j + 3, i + 1, 0x2d2822, k - 2);
  2501. DrawingArea.drawPixels(l - 22, j + 19, i + 2, 0x524a3d, k - 4);
  2502. DrawingArea.drawPixels(l - 22, j + 20, i + 3, 0x524a3d, k - 6);
  2503. DrawingArea.drawPixels(l - 23, j + 20, i + 3, 0x2b271c, k - 6);
  2504. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x2a291b, j + 2);
  2505. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a261b, j + 3);
  2506. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x252116, j + 4);
  2507. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x211e15, j + 5);
  2508. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1e1b12, j + 6);
  2509. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1a170e, j + 7);
  2510. DrawingArea.fillPixels(i + 2, k - 4, 2, 0x15120b, j + 8);
  2511. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x100d08, j + 10);
  2512. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 11);
  2513. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x080703, j + 12);
  2514. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 13);
  2515. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 14);
  2516. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 15);
  2517. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 16);
  2518. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 17);
  2519. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a291b, j + 18);
  2520. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x564943, j + 19);
  2521. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14, i + 3);
  2522. int x = isFullScreen ? extraWidth : 0;
  2523. int y = isFullScreen ? extraHeight : 0;
  2524. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2525. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2526. int j2 = 0xc6b895;
  2527. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3) {
  2528. DrawingArea.drawPixels(15, i2 - 11, i + 3, 0x6f695d, menuWidth - 6);
  2529. j2 = 0xeee5c6;
  2530. }
  2531. chatTextDrawingArea.method389(true, i + 4, j2, menuActionName[l1], i2 + 1);
  2532. }
  2533. }
  2534. }
  2535. private void addFriend(long l) {
  2536. try {
  2537. if(l == 0L)
  2538. return;
  2539. if(friendsCount >= 100 && anInt1046 != 1) {
  2540. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2541. return;
  2542. }
  2543. if(friendsCount >= 200) {
  2544. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2545. return;
  2546. }
  2547. String s = TextClass.fixName(TextClass.nameForLong(l));
  2548. for(int i = 0; i < friendsCount; i++)
  2549. if(friendsListAsLongs[i] == l) {
  2550. pushMessage(s + " is already on your friend list", 0, "");
  2551. return;
  2552. }
  2553. for(int j = 0; j < ignoreCount; j++)
  2554. if(ignoreListAsLongs[j] == l) {
  2555. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2556. return;
  2557. }
  2558. if(s.equals(myPlayer.name)) {
  2559. return;
  2560. } else {
  2561. friendsList[friendsCount] = s;
  2562. friendsListAsLongs[friendsCount] = l;
  2563. friendsNodeIDs[friendsCount] = 0;
  2564. friendsCount++;
  2565. needDrawTabArea = true;
  2566. stream.createFrame(188);
  2567. stream.writeQWord(l);
  2568. return;
  2569. }
  2570. } catch(RuntimeException runtimeexception) {
  2571. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2572. }
  2573. throw new RuntimeException();
  2574. }
  2575. private int method42(int i, int j, int k) {
  2576. int l = k >> 7;
  2577. int i1 = j >> 7;
  2578. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2579. return 0;
  2580. int j1 = i;
  2581. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2582. j1++;
  2583. int k1 = k & 0x7f;
  2584. int l1 = j & 0x7f;
  2585. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2586. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2587. return i2 * (128 - l1) + j2 * l1 >> 7;
  2588. }
  2589. private static String intToKOrMil(int j) {
  2590. if(j < 0x186a0)
  2591. return String.valueOf(j);
  2592. if(j < 0x989680)
  2593. return j / 1000 + "K";
  2594. else
  2595. return j / 0xf4240 + "M";
  2596. }
  2597. private void resetLogout() {
  2598. try {
  2599. if(socketStream != null)
  2600. socketStream.close();
  2601. }
  2602. catch(Exception _ex) { }
  2603. socketStream = null;
  2604. loggedIn = false;
  2605. loginScreenState = 0;
  2606. // myUsername = "";
  2607. // myPassword = "";
  2608. unlinkMRUNodes();
  2609. worldController.initToNull();
  2610. for(int i = 0; i < 4; i++)
  2611. aClass11Array1230[i].method210();
  2612. System.gc();
  2613. stopMidi();
  2614. currentSong = -1;
  2615. nextSong = -1;
  2616. prevSong = 0;
  2617. }
  2618. private void method45() {
  2619. aBoolean1031 = true;
  2620. for(int j = 0; j < 7; j++) {
  2621. anIntArray1065[j] = -1;
  2622. for(int k = 0; k < IDK.length; k++) {
  2623. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2624. continue;
  2625. anIntArray1065[j] = k;
  2626. break;
  2627. }
  2628. }
  2629. }
  2630. private void method46(int i, Stream stream) {
  2631. while(stream.bitPosition + 21 < i * 8) {
  2632. int k = stream.readBits(14);
  2633. if(k == 16383)
  2634. break;
  2635. if(npcArray[k] == null)
  2636. npcArray[k] = new NPC();
  2637. NPC npc = npcArray[k];
  2638. npcIndices[npcCount++] = k;
  2639. npc.anInt1537 = loopCycle;
  2640. int l = stream.readBits(5);
  2641. if(l > 15)
  2642. l -= 32;
  2643. int i1 = stream.readBits(5);
  2644. if(i1 > 15)
  2645. i1 -= 32;
  2646. int j1 = stream.readBits(1);
  2647. npc.desc = EntityDef.forID(stream.readBits(12));
  2648. int k1 = stream.readBits(1);
  2649. if(k1 == 1)
  2650. anIntArray894[anInt893++] = k;
  2651. npc.anInt1540 = npc.desc.aByte68;
  2652. npc.anInt1504 = npc.desc.anInt79;
  2653. npc.anInt1554 = npc.desc.walkAnim;
  2654. npc.anInt1555 = npc.desc.anInt58;
  2655. npc.anInt1556 = npc.desc.anInt83;
  2656. npc.anInt1557 = npc.desc.anInt55;
  2657. npc.anInt1511 = npc.desc.standAnim;
  2658. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2659. }
  2660. stream.finishBitAccess();
  2661. }
  2662. public void processGameLoop() {
  2663. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2664. return;
  2665. loopCycle++;
  2666. if(!loggedIn)
  2667. processLoginScreenInput();
  2668. else
  2669. mainGameProcessor();
  2670. processOnDemandQueue();
  2671. }
  2672. private void method47(boolean flag) {
  2673. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2674. destX = 0;
  2675. int j = playerCount;
  2676. if(flag)
  2677. j = 1;
  2678. for(int l = 0; l < j; l++) {
  2679. Player player;
  2680. int i1;
  2681. if(flag) {
  2682. player = myPlayer;
  2683. i1 = myPlayerIndex << 14;
  2684. } else {
  2685. player = playerArray[playerIndices[l]];
  2686. i1 = playerIndices[l] << 14;
  2687. }
  2688. if(player == null || !player.isVisible())
  2689. continue;
  2690. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2691. int j1 = player.x >> 7;
  2692. int k1 = player.y >> 7;
  2693. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2694. continue;
  2695. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2696. player.aBoolean1699 = false;
  2697. player.anInt1709 = method42(plane, player.y, player.x);
  2698. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2699. continue;
  2700. }
  2701. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2702. if(anIntArrayArray929[j1][k1] == anInt1265)
  2703. continue;
  2704. anIntArrayArray929[j1][k1] = anInt1265;
  2705. }
  2706. player.anInt1709 = method42(plane, player.y, player.x);
  2707. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2708. }
  2709. }
  2710. private boolean promptUserForInput(RSInterface class9) {
  2711. int j = class9.contentType;
  2712. if(anInt900 == 2) {
  2713. if(j == 201) {
  2714. inputTaken = true;
  2715. inputDialogState = 0;
  2716. messagePromptRaised = true;
  2717. promptInput = "";
  2718. friendsListAction = 1;
  2719. aString1121 = "Enter name of friend to add to list";
  2720. }
  2721. if(j == 202) {
  2722. inputTaken = true;
  2723. inputDialogState = 0;
  2724. messagePromptRaised = true;
  2725. promptInput = "";
  2726. friendsListAction = 2;
  2727. aString1121 = "Enter name of friend to delete from list";
  2728. }
  2729. }
  2730. if(j == 205) {
  2731. anInt1011 = 250;
  2732. return true;
  2733. }
  2734. if(j == 501) {
  2735. inputTaken = true;
  2736. inputDialogState = 0;
  2737. messagePromptRaised = true;
  2738. promptInput = "";
  2739. friendsListAction = 4;
  2740. aString1121 = "Enter name of player to add to list";
  2741. }
  2742. if(j == 502) {
  2743. inputTaken = true;
  2744. inputDialogState = 0;
  2745. messagePromptRaised = true;
  2746. promptInput = "";
  2747. friendsListAction = 5;
  2748. aString1121 = "Enter name of player to delete from list";
  2749. }
  2750. if(j == 550) {
  2751. inputTaken = true;
  2752. inputDialogState = 0;
  2753. messagePromptRaised = true;
  2754. promptInput = "";
  2755. friendsListAction = 6;
  2756. aString1121 = "Enter the name of the chat you wish to join";
  2757. }
  2758. if(j >= 300 && j <= 313) {
  2759. int k = (j - 300) / 2;
  2760. int j1 = j & 1;
  2761. int i2 = anIntArray1065[k];
  2762. if(i2 != -1) {
  2763. do {
  2764. if(j1 == 0 && --i2 < 0)
  2765. i2 = IDK.length - 1;
  2766. if(j1 == 1 && ++i2 >= IDK.length)
  2767. i2 = 0;
  2768. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2769. anIntArray1065[k] = i2;
  2770. aBoolean1031 = true;
  2771. }
  2772. }
  2773. if(j >= 314 && j <= 323) {
  2774. int l = (j - 314) / 2;
  2775. int k1 = j & 1;
  2776. int j2 = anIntArray990[l];
  2777. if(k1 == 0 && --j2 < 0)
  2778. j2 = anIntArrayArray1003[l].length - 1;
  2779. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2780. j2 = 0;
  2781. anIntArray990[l] = j2;
  2782. aBoolean1031 = true;
  2783. }
  2784. if(j == 324 && !aBoolean1047) {
  2785. aBoolean1047 = true;
  2786. method45();
  2787. }
  2788. if(j == 325 && aBoolean1047) {
  2789. aBoolean1047 = false;
  2790. method45();
  2791. }
  2792. if(j == 326) {
  2793. stream.createFrame(101);
  2794. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2795. for(int i1 = 0; i1 < 7; i1++)
  2796. stream.writeWordBigEndian(anIntArray1065[i1]);
  2797. for(int l1 = 0; l1 < 5; l1++)
  2798. stream.writeWordBigEndian(anIntArray990[l1]);
  2799. return true;
  2800. }
  2801. if(j == 613)
  2802. canMute = !canMute;
  2803. if(j >= 601 && j <= 612) {
  2804. clearTopInterfaces();
  2805. if(reportAbuseInput.length() > 0) {
  2806. stream.createFrame(218);
  2807. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2808. stream.writeWordBigEndian(j - 601);
  2809. stream.writeWordBigEndian(canMute ? 1 : 0);
  2810. }
  2811. }
  2812. return false;
  2813. }
  2814. private void method49(Stream stream) {
  2815. for(int j = 0; j < anInt893; j++) {
  2816. int k = anIntArray894[j];
  2817. Player player = playerArray[k];
  2818. int l = stream.readUnsignedByte();
  2819. if((l & 0x40) != 0)
  2820. l += stream.readUnsignedByte() << 8;
  2821. method107(l, k, stream, player);
  2822. }
  2823. }
  2824. private void method50(int i, int k, int l, int i1, int j1) {
  2825. int k1 = worldController.method300(j1, l, i);
  2826. if(k1 != 0) {
  2827. int l1 = worldController.method304(j1, l, i, k1);
  2828. int k2 = l1 >> 6 & 3;
  2829. int i3 = l1 & 0x1f;
  2830. int k3 = k;
  2831. if(k1 > 0)
  2832. k3 = i1;
  2833. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2834. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2835. int i5 = k1 >> 14 & 0x7fff;
  2836. ObjectDef class46_2 = ObjectDef.forID(i5);
  2837. if(class46_2.anInt758 != -1) {
  2838. Background background_2 = mapScenes[class46_2.anInt758];
  2839. if(background_2 != null) {
  2840. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2841. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2842. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2843. }
  2844. } else {
  2845. if(i3 == 0 || i3 == 2)
  2846. if(k2 == 0) {
  2847. ai[k4] = k3;
  2848. ai[k4 + 512] = k3;
  2849. ai[k4 + 1024] = k3;
  2850. ai[k4 + 1536] = k3;
  2851. } else if(k2 == 1) {
  2852. ai[k4] = k3;
  2853. ai[k4 + 1] = k3;
  2854. ai[k4 + 2] = k3;
  2855. ai[k4 + 3] = k3;
  2856. } else if(k2 == 2) {
  2857. ai[k4 + 3] = k3;
  2858. ai[k4 + 3 + 512] = k3;
  2859. ai[k4 + 3 + 1024] = k3;
  2860. ai[k4 + 3 + 1536] = k3;
  2861. } else if(k2 == 3) {
  2862. ai[k4 + 1536] = k3;
  2863. ai[k4 + 1536 + 1] = k3;
  2864. ai[k4 + 1536 + 2] = k3;
  2865. ai[k4 + 1536 + 3] = k3;
  2866. }
  2867. if(i3 == 3)
  2868. if(k2 == 0)
  2869. ai[k4] = k3;
  2870. else if(k2 == 1)
  2871. ai[k4 + 3] = k3;
  2872. else if(k2 == 2)
  2873. ai[k4 + 3 + 1536] = k3;
  2874. else if(k2 == 3)
  2875. ai[k4 + 1536] = k3;
  2876. if(i3 == 2)
  2877. if(k2 == 3) {
  2878. ai[k4] = k3;
  2879. ai[k4 + 512] = k3;
  2880. ai[k4 + 1024] = k3;
  2881. ai[k4 + 1536] = k3;
  2882. } else if(k2 == 0) {
  2883. ai[k4] = k3;
  2884. ai[k4 + 1] = k3;
  2885. ai[k4 + 2] = k3;
  2886. ai[k4 + 3] = k3;
  2887. } else if(k2 == 1) {
  2888. ai[k4 + 3] = k3;
  2889. ai[k4 + 3 + 512] = k3;
  2890. ai[k4 + 3 + 1024] = k3;
  2891. ai[k4 + 3 + 1536] = k3;
  2892. } else if(k2 == 2) {
  2893. ai[k4 + 1536] = k3;
  2894. ai[k4 + 1536 + 1] = k3;
  2895. ai[k4 + 1536 + 2] = k3;
  2896. ai[k4 + 1536 + 3] = k3;
  2897. }
  2898. }
  2899. }
  2900. k1 = worldController.method302(j1, l, i);
  2901. if(k1 != 0) {
  2902. int i2 = worldController.method304(j1, l, i, k1);
  2903. int l2 = i2 >> 6 & 3;
  2904. int j3 = i2 & 0x1f;
  2905. int l3 = k1 >> 14 & 0x7fff;
  2906. ObjectDef class46_1 = ObjectDef.forID(l3);
  2907. if(class46_1.anInt758 != -1) {
  2908. Background background_1 = mapScenes[class46_1.anInt758];
  2909. if(background_1 != null) {
  2910. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2911. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2912. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2913. }
  2914. } else if(j3 == 9) {
  2915. int l4 = 0xeeeeee;
  2916. if(k1 > 0)
  2917. l4 = 0xee0000;
  2918. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2919. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2920. if(l2 == 0 || l2 == 2) {
  2921. ai1[l5 + 1536] = l4;
  2922. ai1[l5 + 1024 + 1] = l4;
  2923. ai1[l5 + 512 + 2] = l4;
  2924. ai1[l5 + 3] = l4;
  2925. } else {
  2926. ai1[l5] = l4;
  2927. ai1[l5 + 512 + 1] = l4;
  2928. ai1[l5 + 1024 + 2] = l4;
  2929. ai1[l5 + 1536 + 3] = l4;
  2930. }
  2931. }
  2932. }
  2933. k1 = worldController.method303(j1, l, i);
  2934. if(k1 != 0) {
  2935. int j2 = k1 >> 14 & 0x7fff;
  2936. ObjectDef class46 = ObjectDef.forID(j2);
  2937. if(class46.anInt758 != -1) {
  2938. Background background = mapScenes[class46.anInt758];
  2939. if(background != null) {
  2940. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2941. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2942. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2943. }
  2944. }
  2945. }
  2946. }
  2947. private void loadTitleScreen() {
  2948. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2949. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2950. aBackgroundArray1152s = new Background[12];
  2951. int j = 0;
  2952. try {
  2953. j = Integer.parseInt(getParameter("fl_icon"));
  2954. } catch(Exception _ex) {
  2955. }
  2956. if(j == 0) {
  2957. for(int k = 0; k < 12; k++)
  2958. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2959. } else {
  2960. for(int l = 0; l < 12; l++)
  2961. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2962. }
  2963. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2964. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2965. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2966. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2967. anIntArray851 = new int[256];
  2968. for(int k1 = 0; k1 < 64; k1++)
  2969. anIntArray851[k1] = k1 * 0x40000;
  2970. for(int l1 = 0; l1 < 64; l1++)
  2971. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2972. for(int i2 = 0; i2 < 64; i2++)
  2973. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2974. for(int j2 = 0; j2 < 64; j2++)
  2975. anIntArray851[j2 + 192] = 0xffffff;
  2976. anIntArray852 = new int[256];
  2977. for(int k2 = 0; k2 < 64; k2++)
  2978. anIntArray852[k2] = k2 * 1024;
  2979. for(int l2 = 0; l2 < 64; l2++)
  2980. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2981. for(int i3 = 0; i3 < 64; i3++)
  2982. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2983. for(int j3 = 0; j3 < 64; j3++)
  2984. anIntArray852[j3 + 192] = 0xffffff;
  2985. anIntArray853 = new int[256];
  2986. for(int k3 = 0; k3 < 64; k3++)
  2987. anIntArray853[k3] = k3 * 4;
  2988. for(int l3 = 0; l3 < 64; l3++)
  2989. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2990. for(int i4 = 0; i4 < 64; i4++)
  2991. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2992. for(int j4 = 0; j4 < 64; j4++)
  2993. anIntArray853[j4 + 192] = 0xffffff;
  2994. anIntArray850 = new int[256];
  2995. anIntArray1190 = new int[32768];
  2996. anIntArray1191 = new int[32768];
  2997. randomizeBackground(null);
  2998. anIntArray828 = new int[32768];
  2999. anIntArray829 = new int[32768];
  3000. drawLoadingText(10, "Connecting to fileserver");
  3001. if(!aBoolean831) {
  3002. drawFlames = true;
  3003. aBoolean831 = true;
  3004. startRunnable(this, 2);
  3005. }
  3006. }
  3007. private static void setHighMem() {
  3008. WorldController.lowMem = false;
  3009. Texture.lowMem = false;
  3010. lowMem = false;
  3011. ObjectManager.lowMem = false;
  3012. ObjectDef.lowMem = false;
  3013. }
  3014. public static Jframe jframe;
  3015. public static void main(String args[])
  3016. {
  3017. try
  3018. {
  3019. nodeID = 10;
  3020. portOff = 0;
  3021. setHighMem();
  3022. isMembers = true;
  3023. signlink.storeid = 32;
  3024. jframe = new Jframe(args);
  3025. }
  3026. catch(Exception exception)
  3027. {
  3028. return;
  3029. }
  3030. }
  3031. public void processMapAreaClick() {
  3032. int x = isFullScreen ? extraWidth+17 : 0;
  3033. int y = isFullScreen ? -30: 0;
  3034. int x29 = isFullScreen ? extraWidth : 0;
  3035. int x2 = isFullScreen ? 358+extraWidth : 0;
  3036. int y2 = isFullScreen ? +32 : 0;
  3037. // XP Button
  3038. if(super.mouseX >= 519+x && super.mouseX <= 550+x && super.mouseY >= 50+y && super.mouseY <= 78+y) {
  3039. xpIconHPos = 1;
  3040. } else {
  3041. xpIconHPos = 0;
  3042. }
  3043. if (!newMap) {
  3044. if(super.mouseX >= 742+x29 && super.mouseX <= 764+x29 && super.mouseY >= 1+y2 && super.mouseY <= 23+y2) {
  3045. logIconHPos = 1;
  3046. } else {
  3047. logIconHPos = 0;
  3048. }
  3049. }
  3050. }
  3051. private void loadingStages() {
  3052. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3053. aRSImageProducer_1165.initDrawingArea();
  3054. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  3055. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  3056. aRSImageProducer_1165.drawGraphics(isFullScreen ? 0 : 4, super.graphics, isFullScreen ? 0 : 4);
  3057. loadingStage = 1;
  3058. aLong824 = System.currentTimeMillis();
  3059. }
  3060. if(loadingStage == 1) {
  3061. int j = method54();
  3062. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3063. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3064. aLong824 = System.currentTimeMillis();
  3065. }
  3066. }
  3067. if(loadingStage == 2 && plane != anInt985) {
  3068. anInt985 = plane;
  3069. method24(plane);
  3070. }
  3071. }
  3072. private int method54() {
  3073. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  3074. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3075. return -1;
  3076. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3077. return -2;
  3078. }
  3079. boolean flag = true;
  3080. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  3081. byte abyte0[] = aByteArrayArray1247[j];
  3082. if(abyte0 != null) {
  3083. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3084. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3085. if(aBoolean1159) {
  3086. k = 10;
  3087. l = 10;
  3088. }
  3089. flag &= ObjectManager.method189(k, abyte0, l);
  3090. }
  3091. }
  3092. if(!flag)
  3093. return -3;
  3094. if(aBoolean1080) {
  3095. return -4;
  3096. } else {
  3097. loadingStage = 2;
  3098. ObjectManager.anInt131 = plane;
  3099. method22();
  3100. stream.createFrame(121);
  3101. return 0;
  3102. }
  3103. }
  3104. private void method55()
  3105. {
  3106. for(Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetNext())
  3107. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3108. class30_sub2_sub4_sub4.unlink();
  3109. else
  3110. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  3111. {
  3112. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  3113. {
  3114. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3115. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3116. class30_sub2_sub4_sub4.method455(loopCycle, npc.y, method42(class30_sub2_sub4_sub4.anInt1597, npc.y, npc.x) - class30_sub2_sub4_sub4.anInt1583, npc.x);
  3117. }
  3118. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  3119. {
  3120. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3121. Player player;
  3122. if(j == unknownInt10)
  3123. player = myPlayer;
  3124. else
  3125. player = playerArray[j];
  3126. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3127. class30_sub2_sub4_sub4.method455(loopCycle, player.y, method42(class30_sub2_sub4_sub4.anInt1597, player.y, player.x) - class30_sub2_sub4_sub4.anInt1583, player.x);
  3128. }
  3129. class30_sub2_sub4_sub4.method456(anInt945);
  3130. worldController.method285(plane, class30_sub2_sub4_sub4.anInt1595, (int)class30_sub2_sub4_sub4.aDouble1587, -1, (int)class30_sub2_sub4_sub4.aDouble1586, 60, (int)class30_sub2_sub4_sub4.aDouble1585, class30_sub2_sub4_sub4, false);
  3131. }
  3132. }
  3133. public AppletContext getAppletContext()
  3134. {
  3135. if(signlink.mainapp != null)
  3136. return signlink.mainapp.getAppletContext();
  3137. else
  3138. return super.getAppletContext();
  3139. }
  3140. private void drawLogo() {
  3141. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3142. Sprite sprite = new Sprite(abyte0, this);
  3143. aRSImageProducer_1110.initDrawingArea();
  3144. sprite.method346(0, 0);
  3145. aRSImageProducer_1111.initDrawingArea();
  3146. sprite.method346(-637, 0);
  3147. aRSImageProducer_1107.initDrawingArea();
  3148. sprite.method346(-128, 0);
  3149. aRSImageProducer_1108.initDrawingArea();
  3150. sprite.method346(-202, -371);
  3151. aRSImageProducer_1109.initDrawingArea();
  3152. sprite.method346(-202, -171);
  3153. aRSImageProducer_1112.initDrawingArea();
  3154. sprite.method346(0, -265);
  3155. aRSImageProducer_1113.initDrawingArea();
  3156. sprite.method346(-562, -265);
  3157. aRSImageProducer_1114.initDrawingArea();
  3158. sprite.method346(-128, -171);
  3159. aRSImageProducer_1115.initDrawingArea();
  3160. sprite.method346(-562, -171);
  3161. int ai[] = new int[sprite.myWidth];
  3162. for(int j = 0; j < sprite.myHeight; j++) {
  3163. for(int k = 0; k < sprite.myWidth; k++)
  3164. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3165. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3166. }
  3167. aRSImageProducer_1110.initDrawingArea();
  3168. sprite.method346(382, 0);
  3169. aRSImageProducer_1111.initDrawingArea();
  3170. sprite.method346(-255, 0);
  3171. aRSImageProducer_1107.initDrawingArea();
  3172. sprite.method346(254, 0);
  3173. aRSImageProducer_1108.initDrawingArea();
  3174. sprite.method346(180, -371);
  3175. aRSImageProducer_1109.initDrawingArea();
  3176. sprite.method346(180, -171);
  3177. aRSImageProducer_1112.initDrawingArea();
  3178. sprite.method346(382, -265);
  3179. aRSImageProducer_1113.initDrawingArea();
  3180. sprite.method346(-180, -265);
  3181. aRSImageProducer_1114.initDrawingArea();
  3182. sprite.method346(254, -171);
  3183. aRSImageProducer_1115.initDrawingArea();
  3184. sprite.method346(-180, -171);
  3185. sprite = new Sprite(titleStreamLoader, "logo", 0);
  3186. aRSImageProducer_1107.initDrawingArea();
  3187. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3188. sprite = null;
  3189. Object obj = null;
  3190. Object obj1 = null;
  3191. System.gc();
  3192. }
  3193. private void processOnDemandQueue()
  3194. {
  3195. do
  3196. {
  3197. OnDemandData onDemandData;
  3198. do
  3199. {
  3200. onDemandData = onDemandFetcher.getNextNode();
  3201. if(onDemandData == null)
  3202. return;
  3203. if(onDemandData.dataType == 0)
  3204. {
  3205. Model.method460(onDemandData.buffer, onDemandData.ID);
  3206. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  3207. {
  3208. needDrawTabArea = true;
  3209. if(backDialogID != -1)
  3210. inputTaken = true;
  3211. }
  3212. }
  3213. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  3214. Class36.method529(onDemandData.buffer);
  3215. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3216. saveMidi(songChanging, onDemandData.buffer);
  3217. if(onDemandData.dataType == 3 && loadingStage == 1)
  3218. {
  3219. for(int i = 0; i < aByteArrayArray1183.length; i++)
  3220. {
  3221. if(anIntArray1235[i] == onDemandData.ID)
  3222. {
  3223. aByteArrayArray1183[i] = onDemandData.buffer;
  3224. if(onDemandData.buffer == null)
  3225. anIntArray1235[i] = -1;
  3226. break;
  3227. }
  3228. if(anIntArray1236[i] != onDemandData.ID)
  3229. continue;
  3230. aByteArrayArray1247[i] = onDemandData.buffer;
  3231. if(onDemandData.buffer == null)
  3232. anIntArray1236[i] = -1;
  3233. break;
  3234. }
  3235. }
  3236. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3237. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3238. } while(true);
  3239. }
  3240. private void calcFlamesPosition()
  3241. {
  3242. char c = '\u0100';
  3243. for(int j = 10; j < 117; j++)
  3244. {
  3245. int k = (int)(Math.random() * 100D);
  3246. if(k < 50)
  3247. anIntArray828[j + (c - 2 << 7)] = 255;
  3248. }
  3249. for(int l = 0; l < 100; l++)
  3250. {
  3251. int i1 = (int)(Math.random() * 124D) + 2;
  3252. int k1 = (int)(Math.random() * 128D) + 128;
  3253. int k2 = i1 + (k1 << 7);
  3254. anIntArray828[k2] = 192;
  3255. }
  3256. for(int j1 = 1; j1 < c - 1; j1++)
  3257. {
  3258. for(int l1 = 1; l1 < 127; l1++)
  3259. {
  3260. int l2 = l1 + (j1 << 7);
  3261. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3262. }
  3263. }
  3264. anInt1275 += 128;
  3265. if(anInt1275 > anIntArray1190.length)
  3266. {
  3267. anInt1275 -= anIntArray1190.length;
  3268. int i2 = (int)(Math.random() * 12D);
  3269. randomizeBackground(aBackgroundArray1152s[i2]);
  3270. }
  3271. for(int j2 = 1; j2 < c - 1; j2++)
  3272. {
  3273. for(int i3 = 1; i3 < 127; i3++)
  3274. {
  3275. int k3 = i3 + (j2 << 7);
  3276. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3277. if(i4 < 0)
  3278. i4 = 0;
  3279. anIntArray828[k3] = i4;
  3280. }
  3281. }
  3282. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3283. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  3284. if(anInt1040 > 0)
  3285. anInt1040 -= 4;
  3286. if(anInt1041 > 0)
  3287. anInt1041 -= 4;
  3288. if(anInt1040 == 0 && anInt1041 == 0)
  3289. {
  3290. int l3 = (int)(Math.random() * 2000D);
  3291. if(l3 == 0)
  3292. anInt1040 = 1024;
  3293. if(l3 == 1)
  3294. anInt1041 = 1024;
  3295. }
  3296. }
  3297. private boolean saveWave(byte abyte0[], int i)
  3298. {
  3299. return abyte0 == null || signlink.wavesave(abyte0, i);
  3300. }
  3301. private void method60(int i)
  3302. {
  3303. RSInterface class9 = RSInterface.interfaceCache[i];
  3304. for(int j = 0; j < class9.children.length; j++)
  3305. {
  3306. if(class9.children[j] == -1)
  3307. break;
  3308. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3309. if(class9_1.type == 1)
  3310. method60(class9_1.id);
  3311. class9_1.anInt246 = 0;
  3312. class9_1.anInt208 = 0;
  3313. }
  3314. }
  3315. private void drawHeadIcon()
  3316. {
  3317. if(anInt855 != 2)
  3318. return;
  3319. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3320. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3321. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3322. }
  3323. private void mainGameProcessor()
  3324. {
  3325. if(anInt1104 > 1)
  3326. anInt1104--;
  3327. if(anInt1011 > 0)
  3328. anInt1011--;
  3329. for(int j = 0; j < 5; j++)
  3330. if(!parsePacket())
  3331. break;
  3332. if(!loggedIn)
  3333. return;
  3334. synchronized(mouseDetection.syncObject)
  3335. {
  3336. if (clientWidth-765 != extraWidth || clientHeight-503 != extraHeight || (isFullScreen && (Jframe.frame.getWidth()-11 != clientWidth || Jframe.frame.getHeight()-58 != clientHeight)))
  3337. {
  3338. hasBeenBlanked = false;
  3339. if (isFullScreen) {
  3340. extraWidth = Jframe.frame.getWidth()-765 - 11;
  3341. extraHeight = Jframe.frame.getHeight()-503 - 58;
  3342. clientWidth = extraWidth+765;
  3343. clientHeight = extraHeight+503;
  3344. } else {
  3345. clientWidth = 765;
  3346. clientHeight = 503;
  3347. extraWidth = 0;
  3348. extraHeight = 0;
  3349. }
  3350. if(isFullScreen && extraWidth >= 230) {
  3351. drawLongTabs = true;
  3352. } else {
  3353. drawLongTabs = false;
  3354. }
  3355. if (isFullScreen) {
  3356. try {
  3357. Texture.method365(clientWidth, clientHeight);
  3358. anIntArray1180 = Texture.anIntArray1472;
  3359. Texture.method365(clientWidth, clientHeight);
  3360. anIntArray1181 = Texture.anIntArray1472;
  3361. Texture.method365(clientWidth, clientHeight);
  3362. } catch(Exception e) {
  3363. e.printStackTrace();
  3364. }
  3365. anIntArray1182 = Texture.anIntArray1472;
  3366. int ai[] = new int[9];
  3367. for(int i8 = 0; i8 < 9; i8++) {
  3368. int k8 = 128 + i8 * 32 + 15;
  3369. int l8 = 600 + k8 * 3;
  3370. int i9 = Texture.anIntArray1470[k8];
  3371. ai[i8] = l8 * i9 >> 16;
  3372. }
  3373. WorldController.method310(500, 800, clientWidth, clientHeight, ai);
  3374. buffer = getGameComponent().createImage(765+extraWidth, 503+extraHeight);
  3375. bufferGraphics = buffer.getGraphics();
  3376. try {
  3377. super.fullGameScreen = new RSImageProducer(clientWidth, clientHeight, getGameComponent());
  3378. aRSImageProducer_1165 = new RSImageProducer(clientWidth, clientHeight, getGameComponent());
  3379. //Jframe.frame.resize(new Dimension(765+extraWidth, 503+extraHeight+46));
  3380. } catch(Exception e) {
  3381. e.printStackTrace();
  3382. }
  3383. } else {
  3384. Texture.method365(765, 503);
  3385. fullScreenTextureArray = Texture.anIntArray1472;
  3386. Texture.method365(519, 165);
  3387. anIntArray1180 = Texture.anIntArray1472;
  3388. Texture.method365(246, 335);
  3389. anIntArray1181 = Texture.anIntArray1472;
  3390. Texture.method365(512, 334);
  3391. anIntArray1182 = Texture.anIntArray1472;
  3392. int ai[] = new int[9];
  3393. for(int i8 = 0; i8 < 9; i8++)
  3394. {
  3395. int k8 = 128 + i8 * 32 + 15;
  3396. int l8 = 600 + k8 * 3;
  3397. int i9 = Texture.anIntArray1470[k8];
  3398. ai[i8] = l8 * i9 >> 16;
  3399. }
  3400. WorldController.method310(500, 800, 512, 334, ai);
  3401. try {
  3402. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  3403. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  3404. Jframe.frame.resize(new Dimension(765+16, 503+46+14));
  3405. } catch(Exception e) {
  3406. e.printStackTrace();
  3407. }
  3408. }
  3409. }
  3410. if(flagged)
  3411. {
  3412. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  3413. {
  3414. stream.createFrame(45);
  3415. stream.writeWordBigEndian(0);
  3416. int j2 = stream.currentOffset;
  3417. int j3 = 0;
  3418. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  3419. {
  3420. if(j2 - stream.currentOffset >= 240)
  3421. break;
  3422. j3++;
  3423. int l4 = mouseDetection.coordsY[j4];
  3424. if(l4 < 0)
  3425. l4 = 0;
  3426. else
  3427. if(l4 > 502)
  3428. l4 = 502;
  3429. int k5 = mouseDetection.coordsX[j4];
  3430. if(k5 < 0)
  3431. k5 = 0;
  3432. else
  3433. if(k5 > 764)
  3434. k5 = 764;
  3435. int i6 = l4 * 765 + k5;
  3436. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3437. {
  3438. k5 = -1;
  3439. l4 = -1;
  3440. i6 = 0x7ffff;
  3441. }
  3442. if(k5 == anInt1237 && l4 == anInt1238)
  3443. {
  3444. if(anInt1022 < 2047)
  3445. anInt1022++;
  3446. } else
  3447. {
  3448. int j6 = k5 - anInt1237;
  3449. anInt1237 = k5;
  3450. int k6 = l4 - anInt1238;
  3451. anInt1238 = l4;
  3452. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3453. {
  3454. j6 += 32;
  3455. k6 += 32;
  3456. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3457. anInt1022 = 0;
  3458. } else
  3459. if(anInt1022 < 8)
  3460. {
  3461. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3462. anInt1022 = 0;
  3463. } else
  3464. {
  3465. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3466. anInt1022 = 0;
  3467. }
  3468. }
  3469. }
  3470. stream.writeBytes(stream.currentOffset - j2);
  3471. if(j3 >= mouseDetection.coordsIndex)
  3472. {
  3473. mouseDetection.coordsIndex = 0;
  3474. } else
  3475. {
  3476. mouseDetection.coordsIndex -= j3;
  3477. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3478. {
  3479. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3480. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3481. }
  3482. }
  3483. }
  3484. } else
  3485. {
  3486. mouseDetection.coordsIndex = 0;
  3487. }
  3488. }
  3489. if(super.clickMode3 != 0)
  3490. {
  3491. long l = (super.aLong29 - aLong1220) / 50L;
  3492. if(l > 4095L)
  3493. l = 4095L;
  3494. aLong1220 = super.aLong29;
  3495. int k2 = super.saveClickY;
  3496. if(k2 < 0)
  3497. k2 = 0;
  3498. else
  3499. if(k2 > 502)
  3500. k2 = 502;
  3501. int k3 = super.saveClickX;
  3502. if(k3 < 0)
  3503. k3 = 0;
  3504. else
  3505. if(k3 > 764)
  3506. k3 = 764;
  3507. int k4 = k2 * 765 + k3;
  3508. int j5 = 0;
  3509. if(super.clickMode3 == 2)
  3510. j5 = 1;
  3511. int l5 = (int)l;
  3512. stream.createFrame(241);
  3513. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3514. }
  3515. if(anInt1016 > 0)
  3516. anInt1016--;
  3517. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3518. aBoolean1017 = true;
  3519. if(aBoolean1017 && anInt1016 <= 0)
  3520. {
  3521. anInt1016 = 20;
  3522. aBoolean1017 = false;
  3523. stream.createFrame(86);
  3524. stream.writeWord(anInt1184);
  3525. stream.method432(minimapInt1);
  3526. }
  3527. if(super.awtFocus && !aBoolean954)
  3528. {
  3529. aBoolean954 = true;
  3530. stream.createFrame(3);
  3531. stream.writeWordBigEndian(1);
  3532. }
  3533. if(!super.awtFocus && aBoolean954)
  3534. {
  3535. aBoolean954 = false;
  3536. stream.createFrame(3);
  3537. stream.writeWordBigEndian(0);
  3538. }
  3539. loadingStages();
  3540. method115();
  3541. method90();
  3542. anInt1009++;
  3543. if(anInt1009 > 750)
  3544. dropClient();
  3545. method114();
  3546. method95();
  3547. method38();
  3548. anInt945++;
  3549. if(crossType != 0)
  3550. {
  3551. crossIndex += 20;
  3552. if(crossIndex >= 400)
  3553. crossType = 0;
  3554. }
  3555. if(atInventoryInterfaceType != 0)
  3556. {
  3557. atInventoryLoopCycle++;
  3558. if(atInventoryLoopCycle >= 15)
  3559. {
  3560. if(atInventoryInterfaceType == 2)
  3561. needDrawTabArea = true;
  3562. if(atInventoryInterfaceType == 3)
  3563. inputTaken = true;
  3564. atInventoryInterfaceType = 0;
  3565. }
  3566. }
  3567. if(activeInterfaceType != 0)
  3568. {
  3569. anInt989++;
  3570. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3571. aBoolean1242 = true;
  3572. if(super.clickMode2 == 0)
  3573. {
  3574. if(activeInterfaceType == 2)
  3575. needDrawTabArea = true;
  3576. if(activeInterfaceType == 3)
  3577. inputTaken = true;
  3578. activeInterfaceType = 0;
  3579. if(aBoolean1242 && anInt989 >= 5)
  3580. {
  3581. lastActiveInvInterface = -1;
  3582. processRightClick();
  3583. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3584. {
  3585. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3586. int j1 = 0;
  3587. if(anInt913 == 1 && class9.contentType == 206)
  3588. j1 = 1;
  3589. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3590. j1 = 0;
  3591. if(class9.aBoolean235)
  3592. {
  3593. int l2 = anInt1085;
  3594. int l3 = mouseInvInterfaceIndex;
  3595. class9.inv[l3] = class9.inv[l2];
  3596. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3597. class9.inv[l2] = -1;
  3598. class9.invStackSizes[l2] = 0;
  3599. } else
  3600. if(j1 == 1)
  3601. {
  3602. int i3 = anInt1085;
  3603. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3604. if(i3 > i4)
  3605. {
  3606. class9.swapInventoryItems(i3, i3 - 1);
  3607. i3--;
  3608. } else
  3609. if(i3 < i4)
  3610. {
  3611. class9.swapInventoryItems(i3, i3 + 1);
  3612. i3++;
  3613. }
  3614. } else
  3615. {
  3616. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3617. }
  3618. stream.createFrame(214);
  3619. stream.method433(anInt1084);
  3620. stream.method424(j1);
  3621. stream.method433(anInt1085);
  3622. stream.method431(mouseInvInterfaceIndex);
  3623. }
  3624. } else
  3625. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3626. determineMenuSize();
  3627. else
  3628. if(menuActionRow > 0)
  3629. doAction(menuActionRow - 1);
  3630. atInventoryLoopCycle = 10;
  3631. super.clickMode3 = 0;
  3632. }
  3633. }
  3634. if(WorldController.anInt470 != -1)
  3635. {
  3636. int k = WorldController.anInt470;
  3637. int k1 = WorldController.anInt471;
  3638. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3639. WorldController.anInt470 = -1;
  3640. if(flag)
  3641. {
  3642. crossX = super.saveClickX;
  3643. crossY = super.saveClickY;
  3644. crossType = 1;
  3645. crossIndex = 0;
  3646. }
  3647. }
  3648. if(super.clickMode3 == 1 && aString844 != null)
  3649. {
  3650. aString844 = null;
  3651. inputTaken = true;
  3652. super.clickMode3 = 0;
  3653. }
  3654. processMenuClick();
  3655. processMainScreenClick();
  3656. processTabClick();
  3657. processMapAreaClick();
  3658. processChatModeClick();
  3659. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3660. anInt1213++;
  3661. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3662. if (anInt1501 < 100) {
  3663. anInt1501++;
  3664. if (anInt1501 == 100) {
  3665. if (anInt1500 != 0) {
  3666. inputTaken = true;
  3667. }
  3668. if (anInt1044 != 0) {
  3669. needDrawTabArea = true;
  3670. }
  3671. }
  3672. }
  3673. } else if (anInt1501 > 0) {
  3674. anInt1501--;
  3675. }
  3676. if(loadingStage == 2)
  3677. method108();
  3678. if(loadingStage == 2 && aBoolean1160)
  3679. calcCameraPos();
  3680. for(int i1 = 0; i1 < 5; i1++)
  3681. anIntArray1030[i1]++;
  3682. method73();
  3683. super.idleTime++;
  3684. if(super.idleTime > 4500)
  3685. {
  3686. anInt1011 = 250;
  3687. super.idleTime -= 500;
  3688. stream.createFrame(202);
  3689. }
  3690. anInt988++;
  3691. if(anInt988 > 500)
  3692. {
  3693. anInt988 = 0;
  3694. int l1 = (int)(Math.random() * 8D);
  3695. if((l1 & 1) == 1)
  3696. anInt1278 += anInt1279;
  3697. if((l1 & 2) == 2)
  3698. anInt1131 += anInt1132;
  3699. if((l1 & 4) == 4)
  3700. anInt896 += anInt897;
  3701. }
  3702. if(anInt1278 < -50)
  3703. anInt1279 = 2;
  3704. if(anInt1278 > 50)
  3705. anInt1279 = -2;
  3706. if(anInt1131 < -55)
  3707. anInt1132 = 2;
  3708. if(anInt1131 > 55)
  3709. anInt1132 = -2;
  3710. if(anInt896 < -40)
  3711. anInt897 = 1;
  3712. if(anInt896 > 40)
  3713. anInt897 = -1;
  3714. anInt1254++;
  3715. if(anInt1254 > 500)
  3716. {
  3717. anInt1254 = 0;
  3718. int i2 = (int)(Math.random() * 8D);
  3719. if((i2 & 1) == 1)
  3720. minimapInt2 += anInt1210;
  3721. if((i2 & 2) == 2)
  3722. minimapInt3 += anInt1171;
  3723. }
  3724. if(minimapInt2 < -60)
  3725. anInt1210 = 2;
  3726. if(minimapInt2 > 60)
  3727. anInt1210 = -2;
  3728. if(minimapInt3 < -20)
  3729. anInt1171 = 1;
  3730. if(minimapInt3 > 10)
  3731. anInt1171 = -1;
  3732. anInt1010++;
  3733. if(anInt1010 > 50)
  3734. stream.createFrame(0);
  3735. try
  3736. {
  3737. if(socketStream != null && stream.currentOffset > 0)
  3738. {
  3739. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3740. stream.currentOffset = 0;
  3741. anInt1010 = 0;
  3742. }
  3743. }
  3744. catch(IOException _ex)
  3745. {
  3746. dropClient();
  3747. }
  3748. catch(Exception exception)
  3749. {
  3750. resetLogout();
  3751. }
  3752. }
  3753. private void method63()
  3754. {
  3755. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3756. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3757. if(class30_sub1.anInt1294 == -1)
  3758. {
  3759. class30_sub1.anInt1302 = 0;
  3760. method89(class30_sub1);
  3761. } else
  3762. {
  3763. class30_sub1.unlink();
  3764. }
  3765. }
  3766. private void resetImageProducers()
  3767. {
  3768. if(aRSImageProducer_1107 != null)
  3769. return;
  3770. super.fullGameScreen = null;
  3771. aRSImageProducer_1166 = null;
  3772. aRSImageProducer_1164 = null;
  3773. aRSImageProducer_1163 = null;
  3774. aRSImageProducer_1165 = null;
  3775. aRSImageProducer_1123 = null;
  3776. aRSImageProducer_1124 = null;
  3777. aRSImageProducer_1125 = null;
  3778. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3779. DrawingArea.setAllPixelsToZero();
  3780. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3781. DrawingArea.setAllPixelsToZero();
  3782. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3783. DrawingArea.setAllPixelsToZero();
  3784. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3785. DrawingArea.setAllPixelsToZero();
  3786. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3787. DrawingArea.setAllPixelsToZero();
  3788. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3789. DrawingArea.setAllPixelsToZero();
  3790. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3791. DrawingArea.setAllPixelsToZero();
  3792. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3793. DrawingArea.setAllPixelsToZero();
  3794. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3795. DrawingArea.setAllPixelsToZero();
  3796. if(titleStreamLoader != null)
  3797. {
  3798. drawLogo();
  3799. loadTitleScreen();
  3800. }
  3801. welcomeScreenRaised = true;
  3802. }
  3803. void drawLoadingText(int i, String s)
  3804. {
  3805. anInt1079 = i;
  3806. aString1049 = s;
  3807. resetImageProducers();
  3808. if(titleStreamLoader == null)
  3809. {
  3810. super.drawLoadingText(i, s);
  3811. return;
  3812. }
  3813. aRSImageProducer_1109.initDrawingArea();
  3814. char c = '\u0168';
  3815. char c1 = '\310';
  3816. byte byte1 = 20;
  3817. chatTextDrawingArea.drawText(0xffffff, "RuneScape is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3818. int j = c1 / 2 - 18 - byte1;
  3819. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3820. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3821. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3822. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3823. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3824. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3825. if(welcomeScreenRaised)
  3826. {
  3827. welcomeScreenRaised = false;
  3828. if(!aBoolean831)
  3829. {
  3830. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3831. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3832. }
  3833. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3834. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3835. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3836. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3837. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3838. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3839. }
  3840. }
  3841. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3842. int j1)
  3843. {
  3844. int anInt992;
  3845. if(aBoolean972)
  3846. anInt992 = 32;
  3847. else
  3848. anInt992 = 0;
  3849. aBoolean972 = false;
  3850. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3851. {
  3852. class9.scrollPosition -= anInt1213 * 4;
  3853. if(flag)
  3854. {
  3855. needDrawTabArea = true;
  3856. }
  3857. } else
  3858. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3859. {
  3860. class9.scrollPosition += anInt1213 * 4;
  3861. if(flag)
  3862. {
  3863. needDrawTabArea = true;
  3864. }
  3865. } else
  3866. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3867. {
  3868. int l1 = ((j - 32) * j) / j1;
  3869. if(l1 < 8)
  3870. l1 = 8;
  3871. int i2 = l - i1 - 16 - l1 / 2;
  3872. int j2 = j - 32 - l1;
  3873. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3874. if(flag)
  3875. needDrawTabArea = true;
  3876. aBoolean972 = true;
  3877. }
  3878. }
  3879. private boolean method66(int i, int j, int k)
  3880. {
  3881. int i1 = i >> 14 & 0x7fff;
  3882. int j1 = worldController.method304(plane, k, j, i);
  3883. if(j1 == -1)
  3884. return false;
  3885. int k1 = j1 & 0x1f;
  3886. int l1 = j1 >> 6 & 3;
  3887. if(k1 == 10 || k1 == 11 || k1 == 22)
  3888. {
  3889. ObjectDef class46 = ObjectDef.forID(i1);
  3890. int i2;
  3891. int j2;
  3892. if(l1 == 0 || l1 == 2)
  3893. {
  3894. i2 = class46.anInt744;
  3895. j2 = class46.anInt761;
  3896. } else
  3897. {
  3898. i2 = class46.anInt761;
  3899. j2 = class46.anInt744;
  3900. }
  3901. int k2 = class46.anInt768;
  3902. if(l1 != 0)
  3903. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3904. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3905. } else
  3906. {
  3907. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3908. }
  3909. crossX = super.saveClickX;
  3910. crossY = super.saveClickY;
  3911. crossType = 2;
  3912. crossIndex = 0;
  3913. return true;
  3914. }
  3915. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3916. {
  3917. byte abyte0[] = null;
  3918. int l = 5;
  3919. try
  3920. {
  3921. if(decompressors[0] != null)
  3922. abyte0 = decompressors[0].decompress(i);
  3923. }
  3924. catch(Exception _ex) { }
  3925. if(abyte0 != null)
  3926. {
  3927. // aCRC32_930.reset();
  3928. // aCRC32_930.update(abyte0);
  3929. // int i1 = (int)aCRC32_930.getValue();
  3930. // if(i1 != j)
  3931. }
  3932. if(abyte0 != null)
  3933. {
  3934. StreamLoader streamLoader = new StreamLoader(abyte0);
  3935. return streamLoader;
  3936. }
  3937. int j1 = 0;
  3938. while(abyte0 == null)
  3939. {
  3940. String s2 = "Unknown error";
  3941. drawLoadingText(k, "Requesting " + s);
  3942. Object obj = null;
  3943. try
  3944. {
  3945. int k1 = 0;
  3946. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3947. byte abyte1[] = new byte[6];
  3948. datainputstream.readFully(abyte1, 0, 6);
  3949. Stream stream = new Stream(abyte1);
  3950. stream.currentOffset = 3;
  3951. int i2 = stream.read3Bytes() + 6;
  3952. int j2 = 6;
  3953. abyte0 = new byte[i2];
  3954. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3955. while(j2 < i2)
  3956. {
  3957. int l2 = i2 - j2;
  3958. if(l2 > 1000)
  3959. l2 = 1000;
  3960. int j3 = datainputstream.read(abyte0, j2, l2);
  3961. if(j3 < 0)
  3962. {
  3963. s2 = "Length error: " + j2 + "/" + i2;
  3964. throw new IOException("EOF");
  3965. }
  3966. j2 += j3;
  3967. int k3 = (j2 * 100) / i2;
  3968. if(k3 != k1)
  3969. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3970. k1 = k3;
  3971. }
  3972. datainputstream.close();
  3973. try
  3974. {
  3975. if(decompressors[0] != null)
  3976. decompressors[0].method234(abyte0.length, abyte0, i);
  3977. }
  3978. catch(Exception _ex)
  3979. {
  3980. decompressors[0] = null;
  3981. }
  3982. /* if(abyte0 != null)
  3983. {
  3984. aCRC32_930.reset();
  3985. aCRC32_930.update(abyte0);
  3986. int i3 = (int)aCRC32_930.getValue();
  3987. if(i3 != j)
  3988. {
  3989. abyte0 = null;
  3990. j1++;
  3991. s2 = "Checksum error: " + i3;
  3992. }
  3993. }
  3994. */
  3995. }
  3996. catch(IOException ioexception)
  3997. {
  3998. if(s2.equals("Unknown error"))
  3999. s2 = "Connection error";
  4000. abyte0 = null;
  4001. }
  4002. catch(NullPointerException _ex)
  4003. {
  4004. s2 = "Null error";
  4005. abyte0 = null;
  4006. if(!signlink.reporterror)
  4007. return null;
  4008. }
  4009. catch(ArrayIndexOutOfBoundsException _ex)
  4010. {
  4011. s2 = "Bounds error";
  4012. abyte0 = null;
  4013. if(!signlink.reporterror)
  4014. return null;
  4015. }
  4016. catch(Exception _ex)
  4017. {
  4018. s2 = "Unexpected error";
  4019. abyte0 = null;
  4020. if(!signlink.reporterror)
  4021. return null;
  4022. }
  4023. if(abyte0 == null)
  4024. {
  4025. for(int l1 = l; l1 > 0; l1--)
  4026. {
  4027. if(j1 >= 3)
  4028. {
  4029. drawLoadingText(k, "Game updated - please reload page");
  4030. l1 = 10;
  4031. } else
  4032. {
  4033. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4034. }
  4035. try
  4036. {
  4037. Thread.sleep(1000L);
  4038. }
  4039. catch(Exception _ex) { }
  4040. }
  4041. l *= 2;
  4042. if(l > 60)
  4043. l = 60;
  4044. aBoolean872 = !aBoolean872;
  4045. }
  4046. }
  4047. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  4048. return streamLoader_1;
  4049. }
  4050. private void dropClient()
  4051. {
  4052. if(anInt1011 > 0)
  4053. {
  4054. resetLogout();
  4055. return;
  4056. }
  4057. aRSImageProducer_1165.initDrawingArea();
  4058. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  4059. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  4060. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  4061. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  4062. aRSImageProducer_1165.drawGraphics(isFullScreen ? 0 : 4, super.graphics, isFullScreen ? 0 : 4);
  4063. anInt1021 = 0;
  4064. destX = 0;
  4065. RSSocket rsSocket = socketStream;
  4066. loggedIn = false;
  4067. loginFailures = 0;
  4068. login(myUsername, myPassword, true);
  4069. if(!loggedIn)
  4070. resetLogout();
  4071. try
  4072. {
  4073. rsSocket.close();
  4074. }
  4075. catch(Exception _ex)
  4076. {
  4077. }
  4078. }
  4079. private void doAction(int i)
  4080. {
  4081. if(i < 0)
  4082. return;
  4083. if(inputDialogState != 0)
  4084. {
  4085. inputDialogState = 0;
  4086. inputTaken = true;
  4087. }
  4088. int j = menuActionCmd2[i];
  4089. int k = menuActionCmd3[i];
  4090. int l = menuActionID[i];
  4091. int i1 = menuActionCmd1[i];
  4092. if(l >= 2000)
  4093. l -= 2000;
  4094. if (l == 474) {
  4095. counterOn = !counterOn;
  4096. }
  4097. if (l == 475) {
  4098. xpCounter = 0;
  4099. }
  4100. if(l == 582)
  4101. {
  4102. NPC npc = npcArray[i1];
  4103. if(npc != null)
  4104. {
  4105. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4106. crossX = super.saveClickX;
  4107. crossY = super.saveClickY;
  4108. crossType = 2;
  4109. crossIndex = 0;
  4110. stream.createFrame(57);
  4111. stream.method432(anInt1285);
  4112. stream.method432(i1);
  4113. stream.method431(anInt1283);
  4114. stream.method432(anInt1284);
  4115. }
  4116. }
  4117. if(l == 234)
  4118. {
  4119. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4120. if(!flag1)
  4121. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4122. crossX = super.saveClickX;
  4123. crossY = super.saveClickY;
  4124. crossType = 2;
  4125. crossIndex = 0;
  4126. stream.createFrame(236);
  4127. stream.method431(k + baseY);
  4128. stream.writeWord(i1);
  4129. stream.method431(j + baseX);
  4130. }
  4131. if(l == 62 && method66(i1, k, j))
  4132. {
  4133. stream.createFrame(192);
  4134. stream.writeWord(anInt1284);
  4135. stream.method431(i1 >> 14 & 0x7fff);
  4136. stream.method433(k + baseY);
  4137. stream.method431(anInt1283);
  4138. stream.method433(j + baseX);
  4139. stream.writeWord(anInt1285);
  4140. }
  4141. if(l == 511)
  4142. {
  4143. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4144. if(!flag2)
  4145. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4146. crossX = super.saveClickX;
  4147. crossY = super.saveClickY;
  4148. crossType = 2;
  4149. crossIndex = 0;
  4150. stream.createFrame(25);
  4151. stream.method431(anInt1284);
  4152. stream.method432(anInt1285);
  4153. stream.writeWord(i1);
  4154. stream.method432(k + baseY);
  4155. stream.method433(anInt1283);
  4156. stream.writeWord(j + baseX);
  4157. }
  4158. if(l == 74)
  4159. {
  4160. stream.createFrame(122);
  4161. stream.method433(k);
  4162. stream.method432(j);
  4163. stream.method431(i1);
  4164. atInventoryLoopCycle = 0;
  4165. atInventoryInterface = k;
  4166. atInventoryIndex = j;
  4167. atInventoryInterfaceType = 2;
  4168. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4169. atInventoryInterfaceType = 1;
  4170. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4171. atInventoryInterfaceType = 3;
  4172. }
  4173. if (l == 315) {
  4174. RSInterface class9 = RSInterface.interfaceCache[k];
  4175. boolean flag8 = true;
  4176. if (class9.contentType > 0)
  4177. flag8 = promptUserForInput(class9);
  4178. if (flag8) {
  4179. switch(k){
  4180. case 40004:
  4181. if(isFullScreen) {
  4182. isFullScreen = false;
  4183. extraHeight = 100;
  4184. extraWidth = 50;
  4185. hasBeenBlanked = false;
  4186. //Jframe.frame.resize(new Dimension(765+16, 503+46+15));
  4187. } else {
  4188. isFullScreen = true;
  4189. extraWidth = 300;
  4190. extraHeight = 100;
  4191. aRSImageProducer_1164.blankImage();
  4192. }
  4193. break;
  4194. case 19144:
  4195. sendFrame248(15106,3213);
  4196. method60(15106);
  4197. inputTaken = true;
  4198. break;
  4199. default:
  4200. stream.createFrame(185);
  4201. stream.writeWord(k);
  4202. break;
  4203. }
  4204. }
  4205. }
  4206. if(l == 561)
  4207. {
  4208. Player player = playerArray[i1];
  4209. if(player != null)
  4210. {
  4211. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4212. crossX = super.saveClickX;
  4213. crossY = super.saveClickY;
  4214. crossType = 2;
  4215. crossIndex = 0;
  4216. anInt1188 += i1;
  4217. if(anInt1188 >= 90)
  4218. {
  4219. stream.createFrame(136);
  4220. anInt1188 = 0;
  4221. }
  4222. stream.createFrame(128);
  4223. stream.writeWord(i1);
  4224. }
  4225. }
  4226. if(l == 20)
  4227. {
  4228. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4229. if(class30_sub2_sub4_sub1_sub1_1 != null)
  4230. {
  4231. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  4232. crossX = super.saveClickX;
  4233. crossY = super.saveClickY;
  4234. crossType = 2;
  4235. crossIndex = 0;
  4236. stream.createFrame(155);
  4237. stream.method431(i1);
  4238. }
  4239. }
  4240. if(l == 779)
  4241. {
  4242. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4243. if(class30_sub2_sub4_sub1_sub2_1 != null)
  4244. {
  4245. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  4246. crossX = super.saveClickX;
  4247. crossY = super.saveClickY;
  4248. crossType = 2;
  4249. crossIndex = 0;
  4250. stream.createFrame(153);
  4251. stream.method431(i1);
  4252. }
  4253. }
  4254. if(l == 516)
  4255. if(!menuOpen)
  4256. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4257. else
  4258. worldController.method312(k - 4, j - 4);
  4259. if(l == 1062)
  4260. {
  4261. anInt924 += baseX;
  4262. if(anInt924 >= 113)
  4263. {
  4264. stream.createFrame(183);
  4265. stream.writeDWordBigEndian(0xe63271);
  4266. anInt924 = 0;
  4267. }
  4268. method66(i1, k, j);
  4269. stream.createFrame(228);
  4270. stream.method432(i1 >> 14 & 0x7fff);
  4271. stream.method432(k + baseY);
  4272. stream.writeWord(j + baseX);
  4273. }
  4274. if(l == 679 && !aBoolean1149)
  4275. {
  4276. stream.createFrame(40);
  4277. stream.writeWord(k);
  4278. aBoolean1149 = true;
  4279. }
  4280. if(l == 431)
  4281. {
  4282. stream.createFrame(129);
  4283. stream.method432(j);
  4284. stream.writeWord(k);
  4285. stream.method432(i1);
  4286. atInventoryLoopCycle = 0;
  4287. atInventoryInterface = k;
  4288. atInventoryIndex = j;
  4289. atInventoryInterfaceType = 2;
  4290. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4291. atInventoryInterfaceType = 1;
  4292. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4293. atInventoryInterfaceType = 3;
  4294. }
  4295. if(l == 337 || l == 42 || l == 792 || l == 322)
  4296. {
  4297. String s = menuActionName[i];
  4298. int k1 = s.indexOf("@whi@");
  4299. if(k1 != -1)
  4300. {
  4301. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4302. if(l == 337)
  4303. addFriend(l3);
  4304. if(l == 42)
  4305. addIgnore(l3);
  4306. if(l == 792)
  4307. delFriend(l3);
  4308. if(l == 322)
  4309. delIgnore(l3);
  4310. }
  4311. }
  4312. if(l == 53)
  4313. {
  4314. stream.createFrame(135);
  4315. stream.method431(j);
  4316. stream.method432(k);
  4317. stream.method431(i1);
  4318. atInventoryLoopCycle = 0;
  4319. atInventoryInterface = k;
  4320. atInventoryIndex = j;
  4321. atInventoryInterfaceType = 2;
  4322. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4323. atInventoryInterfaceType = 1;
  4324. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4325. atInventoryInterfaceType = 3;
  4326. }
  4327. if(l == 539)
  4328. {
  4329. stream.createFrame(16);
  4330. stream.method432(i1);
  4331. stream.method433(j);
  4332. stream.method433(k);
  4333. atInventoryLoopCycle = 0;
  4334. atInventoryInterface = k;
  4335. atInventoryIndex = j;
  4336. atInventoryInterfaceType = 2;
  4337. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4338. atInventoryInterfaceType = 1;
  4339. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4340. atInventoryInterfaceType = 3;
  4341. }
  4342. if(l == 484 || l == 6)
  4343. {
  4344. String s1 = menuActionName[i];
  4345. int l1 = s1.indexOf("@whi@");
  4346. if(l1 != -1)
  4347. {
  4348. s1 = s1.substring(l1 + 5).trim();
  4349. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4350. boolean flag9 = false;
  4351. for(int j3 = 0; j3 < playerCount; j3++)
  4352. {
  4353. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4354. if(class30_sub2_sub4_sub1_sub2_7 == null || class30_sub2_sub4_sub1_sub2_7.name == null || !class30_sub2_sub4_sub1_sub2_7.name.equalsIgnoreCase(s7))
  4355. continue;
  4356. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  4357. if(l == 484)
  4358. {
  4359. stream.createFrame(139);
  4360. stream.method431(playerIndices[j3]);
  4361. }
  4362. if(l == 6)
  4363. {
  4364. anInt1188 += i1;
  4365. if(anInt1188 >= 90)
  4366. {
  4367. stream.createFrame(136);
  4368. anInt1188 = 0;
  4369. }
  4370. stream.createFrame(128);
  4371. stream.writeWord(playerIndices[j3]);
  4372. }
  4373. flag9 = true;
  4374. break;
  4375. }
  4376. if(!flag9)
  4377. pushMessage("Unable to find " + s7, 0, "");
  4378. }
  4379. }
  4380. if(l == 870)
  4381. {
  4382. stream.createFrame(53);
  4383. stream.writeWord(j);
  4384. stream.method432(anInt1283);
  4385. stream.method433(i1);
  4386. stream.writeWord(anInt1284);
  4387. stream.method431(anInt1285);
  4388. stream.writeWord(k);
  4389. atInventoryLoopCycle = 0;
  4390. atInventoryInterface = k;
  4391. atInventoryIndex = j;
  4392. atInventoryInterfaceType = 2;
  4393. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4394. atInventoryInterfaceType = 1;
  4395. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4396. atInventoryInterfaceType = 3;
  4397. }
  4398. if(l == 847)
  4399. {
  4400. stream.createFrame(87);
  4401. stream.method432(i1);
  4402. stream.writeWord(k);
  4403. stream.method432(j);
  4404. atInventoryLoopCycle = 0;
  4405. atInventoryInterface = k;
  4406. atInventoryIndex = j;
  4407. atInventoryInterfaceType = 2;
  4408. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4409. atInventoryInterfaceType = 1;
  4410. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4411. atInventoryInterfaceType = 3;
  4412. }
  4413. if(l == 626)
  4414. {
  4415. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4416. spellSelected = 1;
  4417. spellID = class9_1.id;
  4418. anInt1137 = k;
  4419. spellUsableOn = class9_1.spellUsableOn;
  4420. itemSelected = 0;
  4421. needDrawTabArea = true;
  4422. spellID = class9_1.id;
  4423. String s4 = class9_1.selectedActionName;
  4424. if(s4.indexOf(" ") != -1)
  4425. s4 = s4.substring(0, s4.indexOf(" "));
  4426. String s8 = class9_1.selectedActionName;
  4427. if(s8.indexOf(" ") != -1)
  4428. s8 = s8.substring(s8.indexOf(" ") + 1);
  4429. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4430. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  4431. //class9_1.sprite1.drawSprite(200,200);
  4432. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  4433. if(spellUsableOn == 16)
  4434. {
  4435. needDrawTabArea = true;
  4436. tabID = 3;
  4437. tabAreaAltered = true;
  4438. }
  4439. return;
  4440. }
  4441. if(l == 78)
  4442. {
  4443. stream.createFrame(117);
  4444. stream.method433(k);
  4445. stream.method433(i1);
  4446. stream.method431(j);
  4447. atInventoryLoopCycle = 0;
  4448. atInventoryInterface = k;
  4449. atInventoryIndex = j;
  4450. atInventoryInterfaceType = 2;
  4451. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4452. atInventoryInterfaceType = 1;
  4453. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4454. atInventoryInterfaceType = 3;
  4455. }
  4456. if(l == 27)
  4457. {
  4458. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4459. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4460. {
  4461. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4462. crossX = super.saveClickX;
  4463. crossY = super.saveClickY;
  4464. crossType = 2;
  4465. crossIndex = 0;
  4466. anInt986 += i1;
  4467. if(anInt986 >= 54)
  4468. {
  4469. stream.createFrame(189);
  4470. stream.writeWordBigEndian(234);
  4471. anInt986 = 0;
  4472. }
  4473. stream.createFrame(73);
  4474. stream.method431(i1);
  4475. }
  4476. }
  4477. if(l == 213)
  4478. {
  4479. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4480. if(!flag3)
  4481. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4482. crossX = super.saveClickX;
  4483. crossY = super.saveClickY;
  4484. crossType = 2;
  4485. crossIndex = 0;
  4486. stream.createFrame(79);
  4487. stream.method431(k + baseY);
  4488. stream.writeWord(i1);
  4489. stream.method432(j + baseX);
  4490. }
  4491. if(l == 632)
  4492. {
  4493. stream.createFrame(145);
  4494. stream.method432(k);
  4495. stream.method432(j);
  4496. stream.method432(i1);
  4497. atInventoryLoopCycle = 0;
  4498. atInventoryInterface = k;
  4499. atInventoryIndex = j;
  4500. atInventoryInterfaceType = 2;
  4501. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4502. atInventoryInterfaceType = 1;
  4503. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4504. atInventoryInterfaceType = 3;
  4505. }
  4506. if(l == 1004) {
  4507. if(tabInterfaceIDs[10] != -1) {
  4508. needDrawTabArea = true;
  4509. tabID = 10;
  4510. tabAreaAltered = true;
  4511. }
  4512. }
  4513. if(l == 1003) {
  4514. clanChatMode = 2;
  4515. aBoolean1233 = true;
  4516. inputTaken = true;
  4517. }
  4518. if(l == 1002) {
  4519. clanChatMode = 1;
  4520. aBoolean1233 = true;
  4521. inputTaken = true;
  4522. }
  4523. if(l == 1001) {
  4524. clanChatMode = 0;
  4525. aBoolean1233 = true;
  4526. inputTaken = true;
  4527. }
  4528. if(l == 1000) {
  4529. cButtonCPos = 4;
  4530. chatTypeView = 11;
  4531. aBoolean1233 = true;
  4532. inputTaken = true;
  4533. }
  4534. if(l == 999) {
  4535. cButtonCPos = 0;
  4536. chatTypeView = 0;
  4537. aBoolean1233 = true;
  4538. inputTaken = true;
  4539. }
  4540. if(l == 998) {
  4541. cButtonCPos = 1;
  4542. chatTypeView = 5;
  4543. aBoolean1233 = true;
  4544. inputTaken = true;
  4545. }
  4546. if(l == 997) {
  4547. publicChatMode = 3;
  4548. aBoolean1233 = true;
  4549. inputTaken = true;
  4550. }
  4551. if(l == 996) {
  4552. publicChatMode = 2;
  4553. aBoolean1233 = true;
  4554. inputTaken = true;
  4555. }
  4556. if(l == 995) {
  4557. publicChatMode = 1;
  4558. aBoolean1233 = true;
  4559. inputTaken = true;
  4560. }
  4561. if(l == 994) {
  4562. publicChatMode = 0;
  4563. aBoolean1233 = true;
  4564. inputTaken = true;
  4565. }
  4566. if(l == 993) {
  4567. cButtonCPos = 2;
  4568. chatTypeView = 1;
  4569. aBoolean1233 = true;
  4570. inputTaken = true;
  4571. }
  4572. if(l == 992) {
  4573. privateChatMode = 2;
  4574. aBoolean1233 = true;
  4575. inputTaken = true;
  4576. }
  4577. if(l == 991) {
  4578. privateChatMode = 1;
  4579. aBoolean1233 = true;
  4580. inputTaken = true;
  4581. }
  4582. if(l == 990) {
  4583. privateChatMode = 0;
  4584. aBoolean1233 = true;
  4585. inputTaken = true;
  4586. }
  4587. if(l == 989) {
  4588. cButtonCPos = 3;
  4589. chatTypeView = 2;
  4590. aBoolean1233 = true;
  4591. inputTaken = true;
  4592. }
  4593. if(l == 987) {
  4594. tradeMode = 2;
  4595. aBoolean1233 = true;
  4596. inputTaken = true;
  4597. }
  4598. if(l == 986) {
  4599. tradeMode = 1;
  4600. aBoolean1233 = true;
  4601. inputTaken = true;
  4602. }
  4603. if(l == 985) {
  4604. tradeMode = 0;
  4605. aBoolean1233 = true;
  4606. inputTaken = true;
  4607. }
  4608. if(l == 984) {
  4609. cButtonCPos = 5;
  4610. chatTypeView = 3;
  4611. aBoolean1233 = true;
  4612. inputTaken = true;
  4613. }
  4614. if(l == 983) {
  4615. duelMode = 2;
  4616. aBoolean1233 = true;
  4617. inputTaken = true;
  4618. }
  4619. if(l == 982) {
  4620. duelMode = 1;
  4621. aBoolean1233 = true;
  4622. inputTaken = true;
  4623. }
  4624. if(l == 981) {
  4625. duelMode = 0;
  4626. aBoolean1233 = true;
  4627. inputTaken = true;
  4628. }
  4629. if(l == 980) {
  4630. cButtonCPos = 6;
  4631. chatTypeView = 4;
  4632. aBoolean1233 = true;
  4633. inputTaken = true;
  4634. }
  4635. if(l == 493)
  4636. {
  4637. stream.createFrame(75);
  4638. stream.method433(k);
  4639. stream.method431(j);
  4640. stream.method432(i1);
  4641. atInventoryLoopCycle = 0;
  4642. atInventoryInterface = k;
  4643. atInventoryIndex = j;
  4644. atInventoryInterfaceType = 2;
  4645. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4646. atInventoryInterfaceType = 1;
  4647. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4648. atInventoryInterfaceType = 3;
  4649. }
  4650. if(l == 652)
  4651. {
  4652. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4653. if(!flag4)
  4654. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4655. crossX = super.saveClickX;
  4656. crossY = super.saveClickY;
  4657. crossType = 2;
  4658. crossIndex = 0;
  4659. stream.createFrame(156);
  4660. stream.method432(j + baseX);
  4661. stream.method431(k + baseY);
  4662. stream.method433(i1);
  4663. }
  4664. if(l == 94)
  4665. {
  4666. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4667. if(!flag5)
  4668. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4669. crossX = super.saveClickX;
  4670. crossY = super.saveClickY;
  4671. crossType = 2;
  4672. crossIndex = 0;
  4673. stream.createFrame(181);
  4674. stream.method431(k + baseY);
  4675. stream.writeWord(i1);
  4676. stream.method431(j + baseX);
  4677. stream.method432(anInt1137);
  4678. }
  4679. if(l == 646)
  4680. {
  4681. stream.createFrame(185);
  4682. stream.writeWord(k);
  4683. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4684. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4685. {
  4686. int i2 = class9_2.valueIndexArray[0][1];
  4687. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4688. {
  4689. variousSettings[i2] = class9_2.anIntArray212[0];
  4690. method33(i2);
  4691. needDrawTabArea = true;
  4692. }
  4693. }
  4694. }
  4695. if(l == 225)
  4696. {
  4697. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4698. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4699. {
  4700. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4701. crossX = super.saveClickX;
  4702. crossY = super.saveClickY;
  4703. crossType = 2;
  4704. crossIndex = 0;
  4705. anInt1226 += i1;
  4706. if(anInt1226 >= 85)
  4707. {
  4708. stream.createFrame(230);
  4709. stream.writeWordBigEndian(239);
  4710. anInt1226 = 0;
  4711. }
  4712. stream.createFrame(17);
  4713. stream.method433(i1);
  4714. }
  4715. }
  4716. if(l == 965)
  4717. {
  4718. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4719. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4720. {
  4721. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4722. crossX = super.saveClickX;
  4723. crossY = super.saveClickY;
  4724. crossType = 2;
  4725. crossIndex = 0;
  4726. anInt1134++;
  4727. if(anInt1134 >= 96)
  4728. {
  4729. stream.createFrame(152);
  4730. stream.writeWordBigEndian(88);
  4731. anInt1134 = 0;
  4732. }
  4733. stream.createFrame(21);
  4734. stream.writeWord(i1);
  4735. }
  4736. }
  4737. if(l == 413)
  4738. {
  4739. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4740. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4741. {
  4742. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4743. crossX = super.saveClickX;
  4744. crossY = super.saveClickY;
  4745. crossType = 2;
  4746. crossIndex = 0;
  4747. stream.createFrame(131);
  4748. stream.method433(i1);
  4749. stream.method432(anInt1137);
  4750. }
  4751. }
  4752. if(l == 200)
  4753. clearTopInterfaces();
  4754. if(l == 1025)
  4755. {
  4756. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4757. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4758. {
  4759. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4760. if(entityDef.childrenIDs != null)
  4761. entityDef = entityDef.method161();
  4762. if(entityDef != null)
  4763. {
  4764. String s9;
  4765. if(entityDef.description != null)
  4766. s9 = new String(entityDef.description);
  4767. else
  4768. s9 = "It's a " + entityDef.name + ".";
  4769. pushMessage(s9, 0, "");
  4770. }
  4771. }
  4772. }
  4773. if(l == 900)
  4774. {
  4775. method66(i1, k, j);
  4776. stream.createFrame(252);
  4777. stream.method433(i1 >> 14 & 0x7fff);
  4778. stream.method431(k + baseY);
  4779. stream.method432(j + baseX);
  4780. }
  4781. if(l == 412)
  4782. {
  4783. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4784. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4785. {
  4786. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  4787. crossX = super.saveClickX;
  4788. crossY = super.saveClickY;
  4789. crossType = 2;
  4790. crossIndex = 0;
  4791. stream.createFrame(72);
  4792. stream.method432(i1);
  4793. }
  4794. }
  4795. if(l == 365)
  4796. {
  4797. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4798. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4799. {
  4800. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4801. crossX = super.saveClickX;
  4802. crossY = super.saveClickY;
  4803. crossType = 2;
  4804. crossIndex = 0;
  4805. stream.createFrame(249);
  4806. stream.method432(i1);
  4807. stream.method431(anInt1137);
  4808. }
  4809. }
  4810. if(l == 729)
  4811. {
  4812. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4813. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4814. {
  4815. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4816. crossX = super.saveClickX;
  4817. crossY = super.saveClickY;
  4818. crossType = 2;
  4819. crossIndex = 0;
  4820. stream.createFrame(39);
  4821. stream.method431(i1);
  4822. }
  4823. }
  4824. if(l == 577)
  4825. {
  4826. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4827. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4828. {
  4829. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_5.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4830. crossX = super.saveClickX;
  4831. crossY = super.saveClickY;
  4832. crossType = 2;
  4833. crossIndex = 0;
  4834. stream.createFrame(139);
  4835. stream.method431(i1);
  4836. }
  4837. }
  4838. if(l == 956 && method66(i1, k, j))
  4839. {
  4840. stream.createFrame(35);
  4841. stream.method431(j + baseX);
  4842. stream.method432(anInt1137);
  4843. stream.method432(k + baseY);
  4844. stream.method431(i1 >> 14 & 0x7fff);
  4845. }
  4846. if(l == 567)
  4847. {
  4848. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4849. if(!flag6)
  4850. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4851. crossX = super.saveClickX;
  4852. crossY = super.saveClickY;
  4853. crossType = 2;
  4854. crossIndex = 0;
  4855. stream.createFrame(23);
  4856. stream.method431(k + baseY);
  4857. stream.method431(i1);
  4858. stream.method431(j + baseX);
  4859. }
  4860. if(l == 867)
  4861. {
  4862. if((i1 & 3) == 0)
  4863. anInt1175++;
  4864. if(anInt1175 >= 59)
  4865. {
  4866. stream.createFrame(200);
  4867. stream.writeWord(25501);
  4868. anInt1175 = 0;
  4869. }
  4870. stream.createFrame(43);
  4871. stream.method431(k);
  4872. stream.method432(i1);
  4873. stream.method432(j);
  4874. atInventoryLoopCycle = 0;
  4875. atInventoryInterface = k;
  4876. atInventoryIndex = j;
  4877. atInventoryInterfaceType = 2;
  4878. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4879. atInventoryInterfaceType = 1;
  4880. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4881. atInventoryInterfaceType = 3;
  4882. }
  4883. if(l == 543)
  4884. {
  4885. stream.createFrame(237);
  4886. stream.writeWord(j);
  4887. stream.method432(i1);
  4888. stream.writeWord(k);
  4889. stream.method432(anInt1137);
  4890. atInventoryLoopCycle = 0;
  4891. atInventoryInterface = k;
  4892. atInventoryIndex = j;
  4893. atInventoryInterfaceType = 2;
  4894. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4895. atInventoryInterfaceType = 1;
  4896. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4897. atInventoryInterfaceType = 3;
  4898. }
  4899. if(l == 606)
  4900. {
  4901. String s2 = menuActionName[i];
  4902. int j2 = s2.indexOf("@whi@");
  4903. if(j2 != -1)
  4904. if(openInterfaceID == -1)
  4905. {
  4906. clearTopInterfaces();
  4907. reportAbuseInput = s2.substring(j2 + 5).trim();
  4908. canMute = false;
  4909. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4910. {
  4911. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4912. continue;
  4913. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4914. break;
  4915. }
  4916. } else
  4917. {
  4918. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4919. }
  4920. }
  4921. if(l == 491)
  4922. {
  4923. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4924. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4925. {
  4926. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  4927. crossX = super.saveClickX;
  4928. crossY = super.saveClickY;
  4929. crossType = 2;
  4930. crossIndex = 0;
  4931. stream.createFrame(14);
  4932. stream.method432(anInt1284);
  4933. stream.writeWord(i1);
  4934. stream.writeWord(anInt1285);
  4935. stream.method431(anInt1283);
  4936. }
  4937. }
  4938. if(l == 639)
  4939. {
  4940. String s3 = menuActionName[i];
  4941. int k2 = s3.indexOf("@whi@");
  4942. if(k2 != -1)
  4943. {
  4944. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4945. int k3 = -1;
  4946. for(int i4 = 0; i4 < friendsCount; i4++)
  4947. {
  4948. if(friendsListAsLongs[i4] != l4)
  4949. continue;
  4950. k3 = i4;
  4951. break;
  4952. }
  4953. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4954. {
  4955. inputTaken = true;
  4956. inputDialogState = 0;
  4957. messagePromptRaised = true;
  4958. promptInput = "";
  4959. friendsListAction = 3;
  4960. aLong953 = friendsListAsLongs[k3];
  4961. aString1121 = "Enter message to send to " + friendsList[k3];
  4962. }
  4963. }
  4964. }
  4965. if(l == 454)
  4966. {
  4967. stream.createFrame(41);
  4968. stream.writeWord(i1);
  4969. stream.method432(j);
  4970. stream.method432(k);
  4971. atInventoryLoopCycle = 0;
  4972. atInventoryInterface = k;
  4973. atInventoryIndex = j;
  4974. atInventoryInterfaceType = 2;
  4975. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4976. atInventoryInterfaceType = 1;
  4977. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4978. atInventoryInterfaceType = 3;
  4979. }
  4980. if(l == 478)
  4981. {
  4982. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4983. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4984. {
  4985. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  4986. crossX = super.saveClickX;
  4987. crossY = super.saveClickY;
  4988. crossType = 2;
  4989. crossIndex = 0;
  4990. if((i1 & 3) == 0)
  4991. anInt1155++;
  4992. if(anInt1155 >= 53)
  4993. {
  4994. stream.createFrame(85);
  4995. stream.writeWordBigEndian(66);
  4996. anInt1155 = 0;
  4997. }
  4998. stream.createFrame(18);
  4999. stream.method431(i1);
  5000. }
  5001. }
  5002. if(l == 113)
  5003. {
  5004. method66(i1, k, j);
  5005. stream.createFrame(70);
  5006. stream.method431(j + baseX);
  5007. stream.writeWord(k + baseY);
  5008. stream.method433(i1 >> 14 & 0x7fff);
  5009. }
  5010. if(l == 872)
  5011. {
  5012. method66(i1, k, j);
  5013. stream.createFrame(234);
  5014. stream.method433(j + baseX);
  5015. stream.method432(i1 >> 14 & 0x7fff);
  5016. stream.method433(k + baseY);
  5017. }
  5018. if(l == 502)
  5019. {
  5020. method66(i1, k, j);
  5021. stream.createFrame(132);
  5022. stream.method433(j + baseX);
  5023. stream.writeWord(i1 >> 14 & 0x7fff);
  5024. stream.method432(k + baseY);
  5025. }
  5026. if(l == 1125)
  5027. {
  5028. ItemDef itemDef = ItemDef.forID(i1);
  5029. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5030. String s5;
  5031. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5032. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5033. else
  5034. if(itemDef.description != null)
  5035. s5 = new String(itemDef.description);
  5036. else
  5037. s5 = "It's a " + itemDef.name + ".";
  5038. pushMessage(s5, 0, "");
  5039. }
  5040. if(l == 169)
  5041. {
  5042. stream.createFrame(185);
  5043. stream.writeWord(k);
  5044. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5045. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  5046. {
  5047. int l2 = class9_3.valueIndexArray[0][1];
  5048. variousSettings[l2] = 1 - variousSettings[l2];
  5049. method33(l2);
  5050. needDrawTabArea = true;
  5051. }
  5052. }
  5053. if(l == 447)
  5054. {
  5055. itemSelected = 1;
  5056. anInt1283 = j;
  5057. anInt1284 = k;
  5058. anInt1285 = i1;
  5059. selectedItemName = ItemDef.forID(i1).name;
  5060. spellSelected = 0;
  5061. needDrawTabArea = true;
  5062. return;
  5063. }
  5064. if(l == 1226)
  5065. {
  5066. int j1 = i1 >> 14 & 0x7fff;
  5067. ObjectDef class46 = ObjectDef.forID(j1);
  5068. String s10;
  5069. if(class46.description != null)
  5070. s10 = new String(class46.description);
  5071. else
  5072. s10 = "It's a " + class46.name + ".";
  5073. pushMessage(s10, 0, "");
  5074. }
  5075. if(l == 244)
  5076. {
  5077. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5078. if(!flag7)
  5079. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5080. crossX = super.saveClickX;
  5081. crossY = super.saveClickY;
  5082. crossType = 2;
  5083. crossIndex = 0;
  5084. stream.createFrame(253);
  5085. stream.method431(j + baseX);
  5086. stream.method433(k + baseY);
  5087. stream.method432(i1);
  5088. }
  5089. if(l == 1448)
  5090. {
  5091. ItemDef itemDef_1 = ItemDef.forID(i1);
  5092. String s6;
  5093. if(itemDef_1.description != null)
  5094. s6 = new String(itemDef_1.description);
  5095. else
  5096. s6 = "It's a " + itemDef_1.name + ".";
  5097. pushMessage(s6, 0, "");
  5098. }
  5099. itemSelected = 0;
  5100. spellSelected = 0;
  5101. needDrawTabArea = true;
  5102. }
  5103. private void method70()
  5104. {
  5105. anInt1251 = 0;
  5106. int j = (myPlayer.x >> 7) + baseX;
  5107. int k = (myPlayer.y >> 7) + baseY;
  5108. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5109. anInt1251 = 1;
  5110. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5111. anInt1251 = 1;
  5112. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5113. anInt1251 = 0;
  5114. }
  5115. public void run() {
  5116. if(drawFlames) {
  5117. drawFlames();
  5118. } else {
  5119. super.run();
  5120. }
  5121. }
  5122. private void build3dScreenMenu()
  5123. {
  5124. if(itemSelected == 0 && spellSelected == 0)
  5125. {
  5126. menuActionName[menuActionRow] = "Walk here";
  5127. menuActionID[menuActionRow] = 516;
  5128. menuActionCmd2[menuActionRow] = super.mouseX;
  5129. menuActionCmd3[menuActionRow] = super.mouseY;
  5130. menuActionRow++;
  5131. }
  5132. int j = -1;
  5133. for(int k = 0; k < Model.anInt1687; k++)
  5134. {
  5135. int l = Model.anIntArray1688[k];
  5136. int i1 = l & 0x7f;
  5137. int j1 = l >> 7 & 0x7f;
  5138. int k1 = l >> 29 & 3;
  5139. int l1 = l >> 14 & 0x7fff;
  5140. if(l == j)
  5141. continue;
  5142. j = l;
  5143. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  5144. {
  5145. ObjectDef class46 = ObjectDef.forID(l1);
  5146. if(class46.childrenIDs != null)
  5147. class46 = class46.method580();
  5148. if(class46 == null)
  5149. continue;
  5150. if(itemSelected == 1)
  5151. {
  5152. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  5153. menuActionID[menuActionRow] = 62;
  5154. menuActionCmd1[menuActionRow] = l;
  5155. menuActionCmd2[menuActionRow] = i1;
  5156. menuActionCmd3[menuActionRow] = j1;
  5157. menuActionRow++;
  5158. } else
  5159. if(spellSelected == 1)
  5160. {
  5161. if((spellUsableOn & 4) == 4)
  5162. {
  5163. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5164. menuActionID[menuActionRow] = 956;
  5165. menuActionCmd1[menuActionRow] = l;
  5166. menuActionCmd2[menuActionRow] = i1;
  5167. menuActionCmd3[menuActionRow] = j1;
  5168. menuActionRow++;
  5169. }
  5170. } else
  5171. {
  5172. if(class46.actions != null)
  5173. {
  5174. for(int i2 = 4; i2 >= 0; i2--)
  5175. if(class46.actions[i2] != null)
  5176. {
  5177. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5178. if(i2 == 0)
  5179. menuActionID[menuActionRow] = 502;
  5180. if(i2 == 1)
  5181. menuActionID[menuActionRow] = 900;
  5182. if(i2 == 2)
  5183. menuActionID[menuActionRow] = 113;
  5184. if(i2 == 3)
  5185. menuActionID[menuActionRow] = 872;
  5186. if(i2 == 4)
  5187. menuActionID[menuActionRow] = 1062;
  5188. menuActionCmd1[menuActionRow] = l;
  5189. menuActionCmd2[menuActionRow] = i1;
  5190. menuActionCmd3[menuActionRow] = j1;
  5191. menuActionRow++;
  5192. }
  5193. }
  5194. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  5195. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5196. menuActionID[menuActionRow] = 1226;
  5197. menuActionCmd1[menuActionRow] = class46.type << 14;
  5198. menuActionCmd2[menuActionRow] = i1;
  5199. menuActionCmd3[menuActionRow] = j1;
  5200. menuActionRow++;
  5201. }
  5202. }
  5203. if(k1 == 1)
  5204. {
  5205. NPC npc = npcArray[l1];
  5206. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  5207. {
  5208. for(int j2 = 0; j2 < npcCount; j2++)
  5209. {
  5210. NPC npc2 = npcArray[npcIndices[j2]];
  5211. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5212. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5213. }
  5214. for(int l2 = 0; l2 < playerCount; l2++)
  5215. {
  5216. Player player = playerArray[playerIndices[l2]];
  5217. if(player != null && player.x == npc.x && player.y == npc.y)
  5218. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5219. }
  5220. }
  5221. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5222. }
  5223. if(k1 == 0)
  5224. {
  5225. Player player = playerArray[l1];
  5226. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  5227. {
  5228. for(int k2 = 0; k2 < npcCount; k2++)
  5229. {
  5230. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5231. if(class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1 && class30_sub2_sub4_sub1_sub1_2.x == player.x && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  5232. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5233. }
  5234. for(int i3 = 0; i3 < playerCount; i3++)
  5235. {
  5236. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5237. if(class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player && class30_sub2_sub4_sub1_sub2_2.x == player.x && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  5238. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5239. }
  5240. }
  5241. buildAtPlayerMenu(i1, l1, player, j1);
  5242. }
  5243. if(k1 == 3)
  5244. {
  5245. NodeList class19 = groundArray[plane][i1][j1];
  5246. if(class19 != null)
  5247. {
  5248. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5249. {
  5250. ItemDef itemDef = ItemDef.forID(item.ID);
  5251. if(itemSelected == 1)
  5252. {
  5253. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5254. menuActionID[menuActionRow] = 511;
  5255. menuActionCmd1[menuActionRow] = item.ID;
  5256. menuActionCmd2[menuActionRow] = i1;
  5257. menuActionCmd3[menuActionRow] = j1;
  5258. menuActionRow++;
  5259. } else
  5260. if(spellSelected == 1)
  5261. {
  5262. if((spellUsableOn & 1) == 1)
  5263. {
  5264. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5265. menuActionID[menuActionRow] = 94;
  5266. menuActionCmd1[menuActionRow] = item.ID;
  5267. menuActionCmd2[menuActionRow] = i1;
  5268. menuActionCmd3[menuActionRow] = j1;
  5269. menuActionRow++;
  5270. }
  5271. } else
  5272. {
  5273. for(int j3 = 4; j3 >= 0; j3--)
  5274. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5275. {
  5276. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5277. if(j3 == 0)
  5278. menuActionID[menuActionRow] = 652;
  5279. if(j3 == 1)
  5280. menuActionID[menuActionRow] = 567;
  5281. if(j3 == 2)
  5282. menuActionID[menuActionRow] = 234;
  5283. if(j3 == 3)
  5284. menuActionID[menuActionRow] = 244;
  5285. if(j3 == 4)
  5286. menuActionID[menuActionRow] = 213;
  5287. menuActionCmd1[menuActionRow] = item.ID;
  5288. menuActionCmd2[menuActionRow] = i1;
  5289. menuActionCmd3[menuActionRow] = j1;
  5290. menuActionRow++;
  5291. } else
  5292. if(j3 == 2)
  5293. {
  5294. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5295. menuActionID[menuActionRow] = 234;
  5296. menuActionCmd1[menuActionRow] = item.ID;
  5297. menuActionCmd2[menuActionRow] = i1;
  5298. menuActionCmd3[menuActionRow] = j1;
  5299. menuActionRow++;
  5300. }
  5301. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5302. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5303. menuActionID[menuActionRow] = 1448;
  5304. menuActionCmd1[menuActionRow] = item.ID;
  5305. menuActionCmd2[menuActionRow] = i1;
  5306. menuActionCmd3[menuActionRow] = j1;
  5307. menuActionRow++;
  5308. }
  5309. }
  5310. }
  5311. }
  5312. }
  5313. }
  5314. private Sprite logIconH;
  5315. private Sprite logIconC;
  5316. public void cleanUpForQuit()
  5317. {
  5318. signlink.reporterror = false;
  5319. try
  5320. {
  5321. if(socketStream != null)
  5322. socketStream.close();
  5323. }
  5324. catch(Exception _ex) { }
  5325. socketStream = null;
  5326. stopMidi();
  5327. if(mouseDetection != null)
  5328. mouseDetection.running = false;
  5329. mouseDetection = null;
  5330. onDemandFetcher.disable();
  5331. onDemandFetcher = null;
  5332. aStream_834 = null;
  5333. stream = null;
  5334. aStream_847 = null;
  5335. inStream = null;
  5336. anIntArray1234 = null;
  5337. aByteArrayArray1183 = null;
  5338. aByteArrayArray1247 = null;
  5339. anIntArray1235 = null;
  5340. anIntArray1236 = null;
  5341. intGroundArray = null;
  5342. byteGroundArray = null;
  5343. worldController = null;
  5344. emptyOrb = null;
  5345. hoverOrb = null;
  5346. orbDrawn1 = null;
  5347. orbDrawn2 = null;
  5348. orbFill = null;
  5349. hoveredEmpty = null;
  5350. summonFill = null;
  5351. summonFill2 = null;
  5352. summonIcon = null;
  5353. hitPointsFill = null;
  5354. hitPointsIcon = null;
  5355. logIconH = null;
  5356. logIconC = null;
  5357. logIcon = null;
  5358. prayerFill = null;
  5359. prayerIcon = null;
  5360. aClass11Array1230 = null;
  5361. anIntArrayArray901 = null;
  5362. anIntArrayArray825 = null;
  5363. bigX = null;
  5364. bigY = null;
  5365. aByteArray912 = null;
  5366. aRSImageProducer_1163 = null;
  5367. leftFrame = null;
  5368. topFrame = null;
  5369. rightFrame = null;
  5370. aRSImageProducer_1164 = null;
  5371. aRSImageProducer_1165 = null;
  5372. aRSImageProducer_1166 = null;
  5373. aRSImageProducer_1123 = null;
  5374. aRSImageProducer_1124 = null;
  5375. aRSImageProducer_1125 = null;
  5376. /* Null pointers for custom sprites */
  5377. chatArea = null;
  5378. chatButtonH = null;
  5379. chatButtonHC = null;
  5380. chatButtonC = null;
  5381. chatButtons = null;
  5382. tabArea = null;
  5383. mapArea = null;
  5384. /**/
  5385. mapBack = null;
  5386. sideIcons = null;
  5387. redStones = null;
  5388. worldMapIcon = null;
  5389. compass = null;
  5390. hitMarks = null;
  5391. headIcons = null;
  5392. skullIcons = null;
  5393. headIconsHint = null;
  5394. crosses = null;
  5395. mapDotItem = null;
  5396. mapDotNPC = null;
  5397. mapDotPlayer = null;
  5398. mapDotFriend = null;
  5399. mapDotTeam = null;
  5400. mapScenes = null;
  5401. mapFunctions = null;
  5402. anIntArrayArray929 = null;
  5403. playerArray = null;
  5404. playerIndices = null;
  5405. anIntArray894 = null;
  5406. aStreamArray895s = null;
  5407. anIntArray840 = null;
  5408. npcArray = null;
  5409. npcIndices = null;
  5410. groundArray = null;
  5411. aClass19_1179 = null;
  5412. aClass19_1013 = null;
  5413. aClass19_1056 = null;
  5414. menuActionCmd2 = null;
  5415. menuActionCmd3 = null;
  5416. menuActionID = null;
  5417. menuActionCmd1 = null;
  5418. menuActionName = null;
  5419. variousSettings = null;
  5420. anIntArray1072 = null;
  5421. anIntArray1073 = null;
  5422. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5423. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5424. friendsList = null;
  5425. friendsListAsLongs = null;
  5426. friendsNodeIDs = null;
  5427. aRSImageProducer_1110 = null;
  5428. aRSImageProducer_1111 = null;
  5429. aRSImageProducer_1107 = null;
  5430. aRSImageProducer_1108 = null;
  5431. aRSImageProducer_1109 = null;
  5432. aRSImageProducer_1112 = null;
  5433. aRSImageProducer_1113 = null;
  5434. aRSImageProducer_1114 = null;
  5435. aRSImageProducer_1115 = null;
  5436. multiOverlay = null;
  5437. nullLoader();
  5438. ObjectDef.nullLoader();
  5439. EntityDef.nullLoader();
  5440. ItemDef.nullLoader();
  5441. Flo.cache = null;
  5442. IDK.cache = null;
  5443. RSInterface.interfaceCache = null;
  5444. DummyClass.cache = null;
  5445. Animation.anims = null;
  5446. SpotAnim.cache = null;
  5447. SpotAnim.aMRUNodes_415 = null;
  5448. Varp.cache = null;
  5449. super.fullGameScreen = null;
  5450. Player.mruNodes = null;
  5451. Texture.nullLoader();
  5452. WorldController.nullLoader();
  5453. Model.nullLoader();
  5454. Class36.nullLoader();
  5455. System.gc();
  5456. }
  5457. private void printDebug()
  5458. {
  5459. System.out.println("============");
  5460. System.out.println("flame-cycle:" + anInt1208);
  5461. if(onDemandFetcher != null)
  5462. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5463. System.out.println("loop-cycle:" + loopCycle);
  5464. System.out.println("draw-cycle:" + anInt1061);
  5465. System.out.println("ptype:" + pktType);
  5466. System.out.println("psize:" + pktSize);
  5467. if(socketStream != null)
  5468. socketStream.printDebug();
  5469. super.shouldDebug = true;
  5470. }
  5471. Component getGameComponent() {
  5472. if(signlink.mainapp != null)
  5473. return signlink.mainapp;
  5474. if(super.gameFrame != null)
  5475. return super.gameFrame;
  5476. else
  5477. return this;
  5478. }
  5479. private void method73() {
  5480. do {
  5481. int j = readChar(-796);
  5482. if(j == -1)
  5483. break;
  5484. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5485. if(j == 8 && reportAbuseInput.length() > 0)
  5486. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5487. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5488. reportAbuseInput += (char)j;
  5489. } else if(messagePromptRaised) {
  5490. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5491. promptInput += (char)j;
  5492. inputTaken = true;
  5493. }
  5494. if(j == 8 && promptInput.length() > 0) {
  5495. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5496. inputTaken = true;
  5497. }
  5498. if(j == 13 || j == 10) {
  5499. messagePromptRaised = false;
  5500. inputTaken = true;
  5501. if(friendsListAction == 1) {
  5502. long l = TextClass.longForName(promptInput);
  5503. addFriend(l);
  5504. }
  5505. if(friendsListAction == 2 && friendsCount > 0) {
  5506. long l1 = TextClass.longForName(promptInput);
  5507. delFriend(l1);
  5508. }
  5509. if(friendsListAction == 3 && promptInput.length() > 0) {
  5510. stream.createFrame(126);
  5511. stream.writeWordBigEndian(0);
  5512. int k = stream.currentOffset;
  5513. stream.writeQWord(aLong953);
  5514. TextInput.method526(promptInput, stream);
  5515. stream.writeBytes(stream.currentOffset - k);
  5516. promptInput = TextInput.processText(promptInput);
  5517. //promptInput = Censor.doCensor(promptInput);
  5518. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5519. if(privateChatMode == 2) {
  5520. privateChatMode = 1;
  5521. aBoolean1233 = true;
  5522. stream.createFrame(95);
  5523. stream.writeWordBigEndian(publicChatMode);
  5524. stream.writeWordBigEndian(privateChatMode);
  5525. stream.writeWordBigEndian(tradeMode);
  5526. }
  5527. }
  5528. if(friendsListAction == 4 && ignoreCount < 100) {
  5529. long l2 = TextClass.longForName(promptInput);
  5530. addIgnore(l2);
  5531. }
  5532. if(friendsListAction == 5 && ignoreCount > 0) {
  5533. long l3 = TextClass.longForName(promptInput);
  5534. delIgnore(l3);
  5535. }
  5536. if(friendsListAction == 6) {
  5537. long l3 = TextClass.longForName(promptInput);
  5538. chatJoin(l3);
  5539. }
  5540. }
  5541. } else if(inputDialogState == 1) {
  5542. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5543. amountOrNameInput += (char)j;
  5544. inputTaken = true;
  5545. }
  5546. if(j == 8 && amountOrNameInput.length() > 0) {
  5547. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5548. inputTaken = true;
  5549. }
  5550. if(j == 13 || j == 10) {
  5551. if(amountOrNameInput.length() > 0) {
  5552. int i1 = 0;
  5553. try {
  5554. i1 = Integer.parseInt(amountOrNameInput);
  5555. }
  5556. catch(Exception _ex) { }
  5557. stream.createFrame(208);
  5558. stream.writeDWord(i1);
  5559. }
  5560. inputDialogState = 0;
  5561. inputTaken = true;
  5562. }
  5563. } else if(inputDialogState == 2) {
  5564. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5565. amountOrNameInput += (char)j;
  5566. inputTaken = true;
  5567. }
  5568. if(j == 8 && amountOrNameInput.length() > 0) {
  5569. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5570. inputTaken = true;
  5571. }
  5572. if(j == 13 || j == 10) {
  5573. if(amountOrNameInput.length() > 0) {
  5574. stream.createFrame(60);
  5575. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5576. }
  5577. inputDialogState = 0;
  5578. inputTaken = true;
  5579. }
  5580. } else if(backDialogID == -1) {
  5581. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5582. inputString += (char)j;
  5583. inputTaken = true;
  5584. }
  5585. if(j == 8 && inputString.length() > 0) {
  5586. inputString = inputString.substring(0, inputString.length() - 1);
  5587. inputTaken = true;
  5588. }
  5589. if((j == 13 || j == 10) && inputString.length() > 0) {
  5590. if(myPrivilege == 2 || server.equals("127.0.0.1") || 1 == 1/*to remove*/) {
  5591. if(inputString.startsWith("//setspecto")) {
  5592. int amt = Integer.parseInt(inputString.substring(12));
  5593. anIntArray1045[300] = amt;
  5594. if(variousSettings[300] != amt) {
  5595. variousSettings[300] = amt;
  5596. method33(300);
  5597. needDrawTabArea = true;
  5598. if(dialogID != -1)
  5599. inputTaken = true;
  5600. }
  5601. }
  5602. if(inputString.equals("clientdrop"))
  5603. dropClient();
  5604. if(inputString.equals("::dumpmodels"))
  5605. models();
  5606. if(inputString.equals("dumpnpcs"))
  5607. EntityDef.rewriteNpcs();
  5608. if (inputString.startsWith("full")) {
  5609. try {
  5610. String[] args = inputString.split(" ");
  5611. int id1 = Integer.parseInt(args[1]);
  5612. int id2 = Integer.parseInt(args[2]);
  5613. fullscreenInterfaceID = id1;
  5614. openInterfaceID = id2;
  5615. pushMessage("Opened Interface", 0, "");
  5616. } catch (Exception e) {
  5617. pushMessage("Interface Failed to load", 0, "");
  5618. }
  5619. }
  5620. if(inputString.equals("::lag"))
  5621. printDebug();
  5622. if(inputString.equals("::prefetchmusic")) {
  5623. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5624. onDemandFetcher.method563((byte)1, 2, j1);
  5625. }
  5626. if(inputString.equals("::fpson"))
  5627. fpsOn = true;
  5628. if(inputString.equals("::fpsoff"))
  5629. fpsOn = false;
  5630. if(inputString.equals("::dataon"))
  5631. clientData = true;
  5632. if (inputString.equals("::full"))
  5633. //case 37005:
  5634. isFullScreen = true;
  5635. extraWidth = 300;
  5636. extraHeight = 100;
  5637. aRSImageProducer_1164.blankImage();
  5638. if (inputString.equals("::nofull"))
  5639. //break;
  5640. //case 37029:
  5641. //if(isFullScreen) {
  5642. isFullScreen = false;
  5643. extraHeight = 0;
  5644. extraWidth = 0;
  5645. hasBeenBlanked = false;
  5646. //Jframe.frame.resize(new Dimension(765+16, 503+46+15));
  5647. /*}
  5648. break;*/
  5649. if(inputString.equals("::dataoff"))
  5650. clientData = false;
  5651. if(inputString.equals("::noclip")) {
  5652. for(int k1 = 0; k1 < 4; k1++) {
  5653. for(int i2 = 1; i2 < 103; i2++) {
  5654. for(int k2 = 1; k2 < 103; k2++)
  5655. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5656. }
  5657. }
  5658. }
  5659. }
  5660. if(inputString.startsWith("/"))
  5661. inputString = "::" + inputString;
  5662. if(inputString.equals("add model")) {
  5663. try {
  5664. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5665. byte[] abyte0 = getModel(ModelIndex);
  5666. if(abyte0 != null && abyte0.length > 0) {
  5667. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5668. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5669. } else {
  5670. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5671. }
  5672. } catch(Exception e) {
  5673. pushMessage("Syntax - ::add model <path>", 0, "");
  5674. }
  5675. }
  5676. if(inputString.startsWith("::")) {
  5677. stream.createFrame(103);
  5678. stream.writeWordBigEndian(inputString.length() - 1);
  5679. stream.writeString(inputString.substring(2));
  5680. } else {
  5681. String s = inputString.toLowerCase();
  5682. int j2 = 0;
  5683. if(s.startsWith("yellow:"))
  5684. {
  5685. j2 = 0;
  5686. inputString = inputString.substring(7);
  5687. } else if(s.startsWith("red:"))
  5688. {
  5689. j2 = 1;
  5690. inputString = inputString.substring(4);
  5691. } else if(s.startsWith("green:"))
  5692. {
  5693. j2 = 2;
  5694. inputString = inputString.substring(6);
  5695. } else if(s.startsWith("cyan:"))
  5696. {
  5697. j2 = 3;
  5698. inputString = inputString.substring(5);
  5699. } else if(s.startsWith("purple:"))
  5700. {
  5701. j2 = 4;
  5702. inputString = inputString.substring(7);
  5703. } else if(s.startsWith("white:"))
  5704. {
  5705. j2 = 5;
  5706. inputString = inputString.substring(6);
  5707. } else if(s.startsWith("flash1:"))
  5708. {
  5709. j2 = 6;
  5710. inputString = inputString.substring(7);
  5711. } else if(s.startsWith("flash2:"))
  5712. {
  5713. j2 = 7;
  5714. inputString = inputString.substring(7);
  5715. } else if(s.startsWith("flash3:"))
  5716. {
  5717. j2 = 8;
  5718. inputString = inputString.substring(7);
  5719. } else if(s.startsWith("glow1:"))
  5720. {
  5721. j2 = 9;
  5722. inputString = inputString.substring(6);
  5723. } else if(s.startsWith("glow2:"))
  5724. {
  5725. j2 = 10;
  5726. inputString = inputString.substring(6);
  5727. } else if(s.startsWith("glow3:"))
  5728. {
  5729. j2 = 11;
  5730. inputString = inputString.substring(6);
  5731. }
  5732. s = inputString.toLowerCase();
  5733. int i3 = 0;
  5734. if(s.startsWith("wave:"))
  5735. {
  5736. i3 = 1;
  5737. inputString = inputString.substring(5);
  5738. } else if(s.startsWith("wave2:"))
  5739. {
  5740. i3 = 2;
  5741. inputString = inputString.substring(6);
  5742. } else if(s.startsWith("shake:"))
  5743. {
  5744. i3 = 3;
  5745. inputString = inputString.substring(6);
  5746. } else if(s.startsWith("scroll:"))
  5747. {
  5748. i3 = 4;
  5749. inputString = inputString.substring(7);
  5750. } else if(s.startsWith("slide:"))
  5751. {
  5752. i3 = 5;
  5753. inputString = inputString.substring(6);
  5754. }
  5755. stream.createFrame(4);
  5756. stream.writeWordBigEndian(0);
  5757. int j3 = stream.currentOffset;
  5758. stream.method425(i3);
  5759. stream.method425(j2);
  5760. aStream_834.currentOffset = 0;
  5761. TextInput.method526(inputString, aStream_834);
  5762. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5763. stream.writeBytes(stream.currentOffset - j3);
  5764. inputString = TextInput.processText(inputString);
  5765. //inputString = Censor.doCensor(inputString);
  5766. myPlayer.textSpoken = inputString;
  5767. myPlayer.anInt1513 = j2;
  5768. myPlayer.anInt1531 = i3;
  5769. myPlayer.textCycle = 150;
  5770. if(myPrivilege == 2)
  5771. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5772. else
  5773. if(myPrivilege == 1)
  5774. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5775. else
  5776. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5777. if(publicChatMode == 2)
  5778. {
  5779. publicChatMode = 3;
  5780. aBoolean1233 = true;
  5781. stream.createFrame(95);
  5782. stream.writeWordBigEndian(publicChatMode);
  5783. stream.writeWordBigEndian(privateChatMode);
  5784. stream.writeWordBigEndian(tradeMode);
  5785. }
  5786. }
  5787. inputString = "";
  5788. inputTaken = true;
  5789. }
  5790. }
  5791. } while(true);
  5792. }
  5793. private void buildPublicChat(int j)
  5794. {
  5795. int l = 0;
  5796. for(int i1 = 0; i1 < 500; i1++)
  5797. {
  5798. if(chatMessages[i1] == null)
  5799. continue;
  5800. if(chatTypeView != 1)
  5801. continue;
  5802. int j1 = chatTypes[i1];
  5803. String s = chatNames[i1];
  5804. String ct = chatMessages[i1];
  5805. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5806. if(k1 < -23)
  5807. break;
  5808. if(s != null && s.startsWith("@cr1@"))
  5809. s = s.substring(5);
  5810. if(s != null && s.startsWith("@cr2@"))
  5811. s = s.substring(5);
  5812. if(s != null && s.startsWith("@cr3@"))
  5813. s = s.substring(5);
  5814. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5815. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5816. if(myPrivilege >= 1) {
  5817. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5818. menuActionID[menuActionRow] = 606;
  5819. menuActionRow++;
  5820. }
  5821. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5822. menuActionID[menuActionRow] = 42;
  5823. menuActionRow++;
  5824. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5825. menuActionID[menuActionRow] = 337;
  5826. menuActionRow++;
  5827. }
  5828. l++;
  5829. }
  5830. }
  5831. }
  5832. private void buildFriendChat(int j)
  5833. {
  5834. int l = 0;
  5835. for(int i1 = 0; i1 < 500; i1++) {
  5836. if(chatMessages[i1] == null)
  5837. continue;
  5838. if(chatTypeView != 2)
  5839. continue;
  5840. int j1 = chatTypes[i1];
  5841. String s = chatNames[i1];
  5842. String ct = chatMessages[i1];
  5843. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5844. if(k1 < -23)
  5845. break;
  5846. if(s != null && s.startsWith("@cr1@"))
  5847. s = s.substring(5);
  5848. if(s != null && s.startsWith("@cr2@"))
  5849. s = s.substring(5);
  5850. if(s != null && s.startsWith("@cr3@"))
  5851. s = s.substring(5);
  5852. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5853. l++;
  5854. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5855. {
  5856. if(j > k1 - 14 && j <= k1) {
  5857. if(myPrivilege >= 1) {
  5858. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5859. menuActionID[menuActionRow] = 606;
  5860. menuActionRow++;
  5861. }
  5862. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5863. menuActionID[menuActionRow] = 42;
  5864. menuActionRow++;
  5865. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5866. menuActionID[menuActionRow] = 337;
  5867. menuActionRow++;
  5868. }
  5869. l++;
  5870. }
  5871. }
  5872. }
  5873. private void buildDuelorTrade(int j) {
  5874. int l = 0;
  5875. for(int i1 = 0; i1 < 500; i1++) {
  5876. if(chatMessages[i1] == null)
  5877. continue;
  5878. if(chatTypeView != 3 && chatTypeView != 4)
  5879. continue;
  5880. int j1 = chatTypes[i1];
  5881. String s = chatNames[i1];
  5882. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5883. if(k1 < -23)
  5884. break;
  5885. if(s != null && s.startsWith("@cr1@"))
  5886. s = s.substring(5);
  5887. if(s != null && s.startsWith("@cr2@"))
  5888. s = s.substring(5);
  5889. if(s != null && s.startsWith("@cr3@"))
  5890. s = s.substring(5);
  5891. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5892. if(j > k1 - 14 && j <= k1) {
  5893. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5894. menuActionID[menuActionRow] = 484;
  5895. menuActionRow++;
  5896. }
  5897. l++;
  5898. }
  5899. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5900. if(j > k1 - 14 && j <= k1) {
  5901. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5902. menuActionID[menuActionRow] = 6;
  5903. menuActionRow++;
  5904. }
  5905. l++;
  5906. }
  5907. if(j1 == 12) {
  5908. if(j > k1 - 14 && j <= k1) {
  5909. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5910. menuActionID[menuActionRow] = 915;
  5911. menuActionRow++;
  5912. }
  5913. l++;
  5914. }
  5915. }
  5916. }
  5917. private void buildChatAreaMenu(int j) {
  5918. int l = 0;
  5919. int test = 0;
  5920. for(int i1 = 0; i1 < 500; i1++) {
  5921. if(chatMessages[i1] == null)
  5922. continue;
  5923. int j1 = chatTypes[i1];
  5924. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5925. if(k1 < -23)
  5926. break;
  5927. String s = chatNames[i1];
  5928. String ct = chatMessages[i1];
  5929. boolean flag = false;
  5930. if(chatTypeView == 1) {
  5931. buildPublicChat(j);
  5932. break;
  5933. }
  5934. if(chatTypeView == 2) {
  5935. buildFriendChat(j);
  5936. break;
  5937. }
  5938. if(chatTypeView == 3 || chatTypeView == 4) {
  5939. buildDuelorTrade(j);
  5940. break;
  5941. }
  5942. if(chatTypeView == 5) {
  5943. break;
  5944. }
  5945. if(s != null && s.startsWith("@cr1@")) {
  5946. s = s.substring(5);
  5947. boolean flag1 = true;
  5948. byte byte0 = 1;
  5949. }
  5950. if(s != null && s.startsWith("@cr2@")) {
  5951. s = s.substring(5);
  5952. byte byte0 = 2;
  5953. }
  5954. if(s != null && s.startsWith("@cr3@")) {
  5955. s = s.substring(5);
  5956. byte byte0 = 3;
  5957. }
  5958. if(j1 == 0)
  5959. l++;
  5960. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5961. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5962. if(myPrivilege >= 1) {
  5963. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5964. menuActionID[menuActionRow] = 606;
  5965. menuActionRow++;
  5966. }
  5967. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5968. menuActionID[menuActionRow] = 42;
  5969. menuActionRow++;
  5970. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5971. menuActionID[menuActionRow] = 337;
  5972. menuActionRow++;
  5973. }
  5974. l++;
  5975. }
  5976. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5977. if(j > k1 - 14 && j <= k1) {
  5978. if(myPrivilege >= 1) {
  5979. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5980. menuActionID[menuActionRow] = 606;
  5981. menuActionRow++;
  5982. }
  5983. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5984. menuActionID[menuActionRow] = 42;
  5985. menuActionRow++;
  5986. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5987. menuActionID[menuActionRow] = 337;
  5988. menuActionRow++;
  5989. }
  5990. l++;
  5991. }
  5992. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5993. if(j > k1 - 14 && j <= k1) {
  5994. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5995. menuActionID[menuActionRow] = 484;
  5996. menuActionRow++;
  5997. }
  5998. l++;
  5999. }
  6000. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6001. l++;
  6002. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6003. if(j > k1 - 14 && j <= k1) {
  6004. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6005. menuActionID[menuActionRow] = 6;
  6006. menuActionRow++;
  6007. }
  6008. l++;
  6009. }
  6010. }
  6011. }
  6012. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  6013. {
  6014. int j = class9.contentType;
  6015. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  6016. {
  6017. if(j == 1 && anInt900 == 0)
  6018. {
  6019. class9.message = "Loading friend list";
  6020. class9.atActionType = 0;
  6021. return;
  6022. }
  6023. if(j == 1 && anInt900 == 1)
  6024. {
  6025. class9.message = "Connecting to friendserver";
  6026. class9.atActionType = 0;
  6027. return;
  6028. }
  6029. if(j == 2 && anInt900 != 2)
  6030. {
  6031. class9.message = "Please wait...";
  6032. class9.atActionType = 0;
  6033. return;
  6034. }
  6035. int k = friendsCount;
  6036. if(anInt900 != 2)
  6037. k = 0;
  6038. if(j > 700)
  6039. j -= 601;
  6040. else
  6041. j--;
  6042. if(j >= k)
  6043. {
  6044. class9.message = "";
  6045. class9.atActionType = 0;
  6046. return;
  6047. } else
  6048. {
  6049. class9.message = friendsList[j];
  6050. class9.atActionType = 1;
  6051. return;
  6052. }
  6053. }
  6054. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  6055. {
  6056. int l = friendsCount;
  6057. if(anInt900 != 2)
  6058. l = 0;
  6059. if(j > 800)
  6060. j -= 701;
  6061. else
  6062. j -= 101;
  6063. if(j >= l)
  6064. {
  6065. class9.message = "";
  6066. class9.atActionType = 0;
  6067. return;
  6068. }
  6069. if(friendsNodeIDs[j] == 0)
  6070. class9.message = "@red@Offline";
  6071. else if(friendsNodeIDs[j] == nodeID)
  6072. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  6073. else
  6074. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  6075. class9.atActionType = 1;
  6076. return;
  6077. }
  6078. if(j == 203)
  6079. {
  6080. int i1 = friendsCount;
  6081. if(anInt900 != 2)
  6082. i1 = 0;
  6083. class9.scrollMax = i1 * 15 + 20;
  6084. if(class9.scrollMax <= class9.height)
  6085. class9.scrollMax = class9.height + 1;
  6086. return;
  6087. }
  6088. if(j >= 401 && j <= 500)
  6089. {
  6090. if((j -= 401) == 0 && anInt900 == 0)
  6091. {
  6092. class9.message = "Loading ignore list";
  6093. class9.atActionType = 0;
  6094. return;
  6095. }
  6096. if(j == 1 && anInt900 == 0)
  6097. {
  6098. class9.message = "Please wait...";
  6099. class9.atActionType = 0;
  6100. return;
  6101. }
  6102. int j1 = ignoreCount;
  6103. if(anInt900 == 0)
  6104. j1 = 0;
  6105. if(j >= j1)
  6106. {
  6107. class9.message = "";
  6108. class9.atActionType = 0;
  6109. return;
  6110. } else
  6111. {
  6112. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  6113. class9.atActionType = 1;
  6114. return;
  6115. }
  6116. }
  6117. if(j == 503)
  6118. {
  6119. class9.scrollMax = ignoreCount * 15 + 20;
  6120. if(class9.scrollMax <= class9.height)
  6121. class9.scrollMax = class9.height + 1;
  6122. return;
  6123. }
  6124. if(j == 327)
  6125. {
  6126. class9.modelRotation1 = 150;
  6127. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6128. if(aBoolean1031)
  6129. {
  6130. for(int k1 = 0; k1 < 7; k1++)
  6131. {
  6132. int l1 = anIntArray1065[k1];
  6133. if(l1 >= 0 && !IDK.cache[l1].method537())
  6134. return;
  6135. }
  6136. aBoolean1031 = false;
  6137. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6138. int i2 = 0;
  6139. for(int j2 = 0; j2 < 7; j2++)
  6140. {
  6141. int k2 = anIntArray1065[j2];
  6142. if(k2 >= 0)
  6143. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  6144. }
  6145. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6146. for(int l2 = 0; l2 < 5; l2++)
  6147. if(anIntArray990[l2] != 0)
  6148. {
  6149. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6150. if(l2 == 1)
  6151. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6152. }
  6153. model.method469();
  6154. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6155. model.method479(64, 850, -30, -50, -30, true);
  6156. class9.anInt233 = 5;
  6157. class9.mediaID = 0;
  6158. RSInterface.method208(aBoolean994, model);
  6159. }
  6160. return;
  6161. }
  6162. if(j == 328) {
  6163. RSInterface rsInterface = class9;
  6164. int verticleTilt = 150;
  6165. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6166. rsInterface.modelRotation1 = verticleTilt;
  6167. rsInterface.modelRotation2 = animationSpeed;
  6168. if(aBoolean1031) {
  6169. Model characterDisplay = myPlayer.method452();
  6170. for(int l2 = 0; l2 < 5; l2++)
  6171. if(anIntArray990[l2] != 0) {
  6172. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6173. if(l2 == 1)
  6174. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6175. }
  6176. int staticFrame = myPlayer.anInt1511;
  6177. characterDisplay.method469();
  6178. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  6179. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  6180. rsInterface.anInt233 = 5;
  6181. rsInterface.mediaID = 0;
  6182. RSInterface.method208(aBoolean994, characterDisplay);
  6183. }
  6184. return;
  6185. }
  6186. if(j == 324)
  6187. {
  6188. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6189. {
  6190. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6191. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6192. }
  6193. if(aBoolean1047)
  6194. {
  6195. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6196. return;
  6197. } else
  6198. {
  6199. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6200. return;
  6201. }
  6202. }
  6203. if(j == 325)
  6204. {
  6205. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6206. {
  6207. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6208. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6209. }
  6210. if(aBoolean1047)
  6211. {
  6212. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6213. return;
  6214. } else
  6215. {
  6216. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6217. return;
  6218. }
  6219. }
  6220. if(j == 600)
  6221. {
  6222. class9.message = reportAbuseInput;
  6223. if(loopCycle % 20 < 10)
  6224. {
  6225. class9.message += "|";
  6226. return;
  6227. } else
  6228. {
  6229. class9.message += " ";
  6230. return;
  6231. }
  6232. }
  6233. if(j == 613)
  6234. if(myPrivilege >= 1)
  6235. {
  6236. if(canMute)
  6237. {
  6238. class9.textColor = 0xff0000;
  6239. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  6240. } else
  6241. {
  6242. class9.textColor = 0xffffff;
  6243. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  6244. }
  6245. } else
  6246. {
  6247. class9.message = "";
  6248. }
  6249. if(j == 650 || j == 655)
  6250. if(anInt1193 != 0)
  6251. {
  6252. String s;
  6253. if(daysSinceLastLogin == 0)
  6254. s = "earlier today";
  6255. else
  6256. if(daysSinceLastLogin == 1)
  6257. s = "yesterday";
  6258. else
  6259. s = daysSinceLastLogin + " days ago";
  6260. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  6261. } else
  6262. {
  6263. class9.message = "";
  6264. }
  6265. if(j == 651)
  6266. {
  6267. if(unreadMessages == 0)
  6268. {
  6269. class9.message = "0 unread messages";
  6270. class9.textColor = 0xffff00;
  6271. }
  6272. if(unreadMessages == 1)
  6273. {
  6274. class9.message = "1 unread message";
  6275. class9.textColor = 65280;
  6276. }
  6277. if(unreadMessages > 1)
  6278. {
  6279. class9.message = unreadMessages + " unread messages";
  6280. class9.textColor = 65280;
  6281. }
  6282. }
  6283. if(j == 652)
  6284. if(daysSinceRecovChange == 201)
  6285. {
  6286. if(membersInt == 1)
  6287. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6288. else
  6289. class9.message = "";
  6290. } else
  6291. if(daysSinceRecovChange == 200)
  6292. {
  6293. class9.message = "You have not yet set any password recovery questions.";
  6294. } else
  6295. {
  6296. String s1;
  6297. if(daysSinceRecovChange == 0)
  6298. s1 = "Earlier today";
  6299. else
  6300. if(daysSinceRecovChange == 1)
  6301. s1 = "Yesterday";
  6302. else
  6303. s1 = daysSinceRecovChange + " days ago";
  6304. class9.message = s1 + " you changed your recovery questions";
  6305. }
  6306. if(j == 653)
  6307. if(daysSinceRecovChange == 201)
  6308. {
  6309. if(membersInt == 1)
  6310. class9.message = "@whi@recommend you use a members world instead. You may use";
  6311. else
  6312. class9.message = "";
  6313. } else
  6314. if(daysSinceRecovChange == 200)
  6315. class9.message = "We strongly recommend you do so now to secure your account.";
  6316. else
  6317. class9.message = "If you do not remember making this change then cancel it immediately";
  6318. if(j == 654)
  6319. {
  6320. if(daysSinceRecovChange == 201)
  6321. if(membersInt == 1)
  6322. {
  6323. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6324. return;
  6325. } else
  6326. {
  6327. class9.message = "";
  6328. return;
  6329. }
  6330. if(daysSinceRecovChange == 200)
  6331. {
  6332. class9.message = "Do this from the 'account management' area on our front webpage";
  6333. return;
  6334. }
  6335. class9.message = "Do this from the 'account management' area on our front webpage";
  6336. }
  6337. }
  6338. private void drawSplitPrivateChat()
  6339. {
  6340. if(splitPrivateChat == 0)
  6341. return;
  6342. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6343. int i = 0;
  6344. if(anInt1104 != 0)
  6345. i = 1;
  6346. for(int j = 0; j < 100; j++)
  6347. if(chatMessages[j] != null)
  6348. {
  6349. int k = chatTypes[j];
  6350. String s = chatNames[j];
  6351. byte byte1 = 0;
  6352. if(s != null && s.startsWith("@cr1@"))
  6353. {
  6354. s = s.substring(5);
  6355. byte1 = 1;
  6356. }
  6357. if(s != null && s.startsWith("@cr2@"))
  6358. {
  6359. s = s.substring(5);
  6360. byte1 = 2;
  6361. }
  6362. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6363. {
  6364. int l = 329 - i * 13;
  6365. int k1 = 4;
  6366. textDrawingArea.method385(0, "From", l, k1);
  6367. textDrawingArea.method385(65535, "From", l - 1, k1);
  6368. k1 += textDrawingArea.getTextWidth("From ");
  6369. if(byte1 == 1)
  6370. {
  6371. modIcons[0].drawBackground(k1, l - 12);
  6372. k1 += 12;
  6373. }
  6374. if(byte1 == 2)
  6375. {
  6376. modIcons[1].drawBackground(k1, l - 12);
  6377. k1 += 12;
  6378. }
  6379. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  6380. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  6381. if(++i >= 5)
  6382. return;
  6383. }
  6384. if(k == 5 && privateChatMode < 2)
  6385. {
  6386. int i1 = 329 - i * 13;
  6387. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6388. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  6389. if(++i >= 5)
  6390. return;
  6391. }
  6392. if(k == 6 && privateChatMode < 2)
  6393. {
  6394. int j1 = 329 - i * 13;
  6395. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6396. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6397. if(++i >= 5)
  6398. return;
  6399. }
  6400. }
  6401. }
  6402. public void pushMessage(String s, int i, String s1) {
  6403. if(i == 0 && dialogID != -1) {
  6404. aString844 = s;
  6405. super.clickMode3 = 0;
  6406. }
  6407. if(backDialogID == -1)
  6408. inputTaken = true;
  6409. for(int j = 499; j > 0; j--) {
  6410. chatTypes[j] = chatTypes[j - 1];
  6411. chatNames[j] = chatNames[j - 1];
  6412. chatMessages[j] = chatMessages[j - 1];
  6413. chatRights[j] = chatRights[j - 1];
  6414. }
  6415. chatTypes[0] = i;
  6416. chatNames[0] = s1;
  6417. chatMessages[0] = s;
  6418. chatRights[0] = rights;
  6419. }
  6420. public static void setTab(int id) {
  6421. needDrawTabArea = true;
  6422. tabID = id;
  6423. tabAreaAltered = true;
  6424. }
  6425. private void processTabClick() {
  6426. int x = isFullScreen ? extraWidth : 0;
  6427. int y = isFullScreen ? extraHeight+262 : 0;
  6428. int extraXX = drawLongTabs ? -232 : 0;
  6429. int extraYY = drawLongTabs ? +35 : 0;
  6430. int extraXX1 = drawLongTabs ? -241 : 0;
  6431. int extraYY1 = drawLongTabs ? +35 : 0;
  6432. int y2 = isFullScreen ? -262 : 0;
  6433. if (!newMap) {
  6434. if(super.clickMode3 == 1) {
  6435. if(super.saveClickX >= 524+x+extraXX && super.saveClickX <= 561+x+extraXX && super.saveClickY >= 169+y+extraYY && super.saveClickY < 205+y+extraYY && tabInterfaceIDs[0] != -1)
  6436. {
  6437. needDrawTabArea = true;
  6438. tabID = 0;
  6439. tabAreaAltered = true;
  6440. }
  6441. if(super.saveClickX >= 562+x+extraXX && super.saveClickX <= 594+x+extraXX && super.saveClickY >= 168+y+extraYY && super.saveClickY < 205+y+extraYY && tabInterfaceIDs[1] != -1)
  6442. {
  6443. needDrawTabArea = true;
  6444. tabID = 1;
  6445. tabAreaAltered = true;
  6446. }
  6447. if(super.saveClickX >= 595+x+extraXX && super.saveClickX <= 626+x+extraXX && super.saveClickY >= 168+y+extraYY && super.saveClickY < 205+y+extraYY && tabInterfaceIDs[2] != -1)
  6448. {
  6449. needDrawTabArea = true;
  6450. tabID = 2;
  6451. tabAreaAltered = true;
  6452. }
  6453. if(super.saveClickX >= 627+x+extraXX && super.saveClickX <= 660+x+extraXX && super.saveClickY >= 168+y+extraYY && super.saveClickY < 203+y+extraYY && tabInterfaceIDs[3] != -1)
  6454. {
  6455. needDrawTabArea = true;
  6456. tabID = 3;
  6457. tabAreaAltered = true;
  6458. }
  6459. if(super.saveClickX >= 661+x+extraXX && super.saveClickX <= 693+x+extraXX && super.saveClickY >= 168+y+extraYY && super.saveClickY < 205+y+extraYY && tabInterfaceIDs[4] != -1)
  6460. {
  6461. needDrawTabArea = true;
  6462. tabID = 4;
  6463. tabAreaAltered = true;
  6464. }
  6465. if(super.saveClickX >= 694+x+extraXX && super.saveClickX <= 725+x+extraXX && super.saveClickY >= 168+y+extraYY && super.saveClickY < 205+y+extraYY && tabInterfaceIDs[5] != -1)
  6466. {
  6467. needDrawTabArea = true;
  6468. tabID = 5;
  6469. tabAreaAltered = true;
  6470. }
  6471. if(super.saveClickX >= 726+x+extraXX && super.saveClickX <= 765+x+extraXX && super.saveClickY >= 169+y+extraYY && super.saveClickY < 205+y+extraYY && tabInterfaceIDs[6] != -1)
  6472. {
  6473. needDrawTabArea = true;
  6474. tabID = 6;
  6475. tabAreaAltered = true;
  6476. }
  6477. if (isFullScreen)
  6478. y -= 262;
  6479. if(super.saveClickX >= 562+x && super.saveClickX <= 594+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[8] != -1)
  6480. {
  6481. needDrawTabArea = true;
  6482. tabID = 8;
  6483. tabAreaAltered = true;
  6484. }
  6485. if(super.saveClickX >= 595+x && super.saveClickX <= 627+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[9] != -1)
  6486. {
  6487. needDrawTabArea = true;
  6488. tabID = 9;
  6489. tabAreaAltered = true;
  6490. }
  6491. if(super.saveClickX >= 661+x && super.saveClickX <= 694+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[11] != -1)
  6492. {
  6493. needDrawTabArea = true;
  6494. tabID = 11;
  6495. tabAreaAltered = true;
  6496. }
  6497. if(super.saveClickX >= 695+x && super.saveClickX <= 725+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[12] != -1)
  6498. {
  6499. needDrawTabArea = true;
  6500. tabID = 12;
  6501. tabAreaAltered = true;
  6502. }
  6503. if(super.saveClickX >= 726+x && super.saveClickX <= 765+x && super.saveClickY >= 466+y && super.saveClickY < 502+y && tabInterfaceIDs[13] != -1)
  6504. {
  6505. needDrawTabArea = true;
  6506. tabID = 13;
  6507. tabAreaAltered = true;
  6508. }
  6509. if (newMap)
  6510. {
  6511. if(super.saveClickX >= 524+x && super.saveClickX <= 561+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[7] != -1)
  6512. {
  6513. needDrawTabArea = true;
  6514. tabID = 7;
  6515. tabAreaAltered = true;
  6516. }
  6517. if(super.saveClickX >= 627+x && super.saveClickX <= 664+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[10] != -1)
  6518. {
  6519. needDrawTabArea = true;
  6520. tabID = 10;
  6521. tabAreaAltered = true;
  6522. }
  6523. }
  6524. if (!newMap)
  6525. {
  6526. if(super.saveClickX >= 742+x && super.saveClickX <= 764+x && super.saveClickY >= 1+y && super.saveClickY < 24+y && tabInterfaceIDs[10] != -1)
  6527. {
  6528. needDrawTabArea = true;
  6529. tabID = 10;
  6530. tabAreaAltered = true;
  6531. }
  6532. if(super.saveClickX >= 627+x && super.saveClickX <= 664+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[7] != -1)
  6533. {
  6534. needDrawTabArea = true;
  6535. tabID = 7;
  6536. tabAreaAltered = true;
  6537. }
  6538. }
  6539. } else
  6540. if(super.clickMode3 == 1)
  6541. {
  6542. if (newMap)
  6543. {
  6544. if(super.saveClickX >= 524+x && super.saveClickX <= 561+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[7] != -1)
  6545. {
  6546. needDrawTabArea = true;
  6547. tabID = 7;
  6548. tabAreaAltered = true;
  6549. }
  6550. if(super.saveClickX >= 627+x && super.saveClickX <= 664+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[10] != -1)
  6551. {
  6552. needDrawTabArea = true;
  6553. tabID = 10;
  6554. tabAreaAltered = true;
  6555. }
  6556. }
  6557. if (!newMap)
  6558. {
  6559. if(super.saveClickX >= 742+x && super.saveClickX <= 764+x && super.saveClickY >= 1+y && super.saveClickY < 24+y && tabInterfaceIDs[10] != -1)
  6560. {
  6561. needDrawTabArea = true;
  6562. tabID = 10;
  6563. tabAreaAltered = true;
  6564. }
  6565. if(super.saveClickX >= 627+x && super.saveClickX <= 664+x && super.saveClickY >= 466+y && super.saveClickY < 503+y && tabInterfaceIDs[7] != -1)
  6566. {
  6567. needDrawTabArea = true;
  6568. tabID = 7;
  6569. tabAreaAltered = true;
  6570. }
  6571. }
  6572. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6573. {
  6574. needDrawTabArea = true;
  6575. tabID = 0;
  6576. tabAreaAltered = true;
  6577. }
  6578. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6579. {
  6580. needDrawTabArea = true;
  6581. tabID = 1;
  6582. tabAreaAltered = true;
  6583. }
  6584. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6585. {
  6586. needDrawTabArea = true;
  6587. tabID = 2;
  6588. tabAreaAltered = true;
  6589. }
  6590. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6591. {
  6592. needDrawTabArea = true;
  6593. tabID = 3;
  6594. tabAreaAltered = true;
  6595. }
  6596. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6597. {
  6598. needDrawTabArea = true;
  6599. tabID = 4;
  6600. tabAreaAltered = true;
  6601. }
  6602. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6603. {
  6604. needDrawTabArea = true;
  6605. tabID = 5;
  6606. tabAreaAltered = true;
  6607. }
  6608. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6609. {
  6610. needDrawTabArea = true;
  6611. tabID = 6;
  6612. tabAreaAltered = true;
  6613. }
  6614. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6615. {
  6616. needDrawTabArea = true;
  6617. tabID = 8;
  6618. tabAreaAltered = true;
  6619. }
  6620. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6621. {
  6622. needDrawTabArea = true;
  6623. tabID = 9;
  6624. tabAreaAltered = true;
  6625. }
  6626. if(super.saveClickX >= 742+x && super.saveClickX <= 764+x && super.saveClickY >= 1+y+y2 && super.saveClickY < 24+y+y2 && tabInterfaceIDs[10] != -1)
  6627. {
  6628. needDrawTabArea = true;
  6629. tabID = 10;
  6630. tabAreaAltered = true;
  6631. }
  6632. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6633. {
  6634. needDrawTabArea = true;
  6635. tabID = 11;
  6636. tabAreaAltered = true;
  6637. }
  6638. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6639. {
  6640. needDrawTabArea = true;
  6641. tabID = 12;
  6642. tabAreaAltered = true;
  6643. }
  6644. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6645. {
  6646. needDrawTabArea = true;
  6647. tabID = 13;
  6648. tabAreaAltered = true;
  6649. }
  6650. if(super.saveClickX >= 520 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[14] != -1)
  6651. {
  6652. needDrawTabArea = true;
  6653. tabID = 14;
  6654. tabAreaAltered = true;
  6655. }
  6656. }
  6657. }
  6658. }
  6659. private void resetImageProducers2() {
  6660. if(aRSImageProducer_1166 != null)
  6661. return;
  6662. nullLoader();
  6663. super.fullGameScreen = null;
  6664. aRSImageProducer_1107 = null;
  6665. aRSImageProducer_1108 = null;
  6666. aRSImageProducer_1109 = null;
  6667. aRSImageProducer_1110 = null;
  6668. aRSImageProducer_1111 = null;
  6669. aRSImageProducer_1112 = null;
  6670. aRSImageProducer_1113 = null;
  6671. aRSImageProducer_1114 = null;
  6672. aRSImageProducer_1115 = null;
  6673. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6674. aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
  6675. DrawingArea.setAllPixelsToZero();
  6676. mapArea[1].drawSprite(0, 0);
  6677. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6678. if (isFullScreen)
  6679. aRSImageProducer_1165 = new RSImageProducer(clientWidth, clientHeight, getGameComponent());
  6680. else
  6681. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6682. DrawingArea.setAllPixelsToZero();
  6683. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6684. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6685. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6686. welcomeScreenRaised = true;
  6687. }
  6688. public String getDocumentBaseHost() {
  6689. if (signlink.mainapp != null) {
  6690. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6691. }
  6692. if (super.gameFrame != null) {
  6693. return ""; // runescape.com <- removed for Jframe to work
  6694. } else {
  6695. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6696. }
  6697. }
  6698. public Sprite mapRing;
  6699. private Sprite worldMapIcon;
  6700. public void drawWorldMapButton() {
  6701. int x = isFullScreen ? 700+extraWidth : 0;
  6702. int y = isFullScreen ? -0 : 0;
  6703. int xm = isFullScreen ? 706+extraWidth : 0;
  6704. int ym = isFullScreen ? +5 : 0;
  6705. if(isFullScreen) {
  6706. mapRing.drawSprite(8+x, 124+y);
  6707. }
  6708. worldMapIcon.drawSprite(8+xm, 124+ym);
  6709. }
  6710. private void method81(Sprite sprite, int j, int k)
  6711. {
  6712. int l = k * k + j * j;
  6713. if(l > 4225 && l < 0x15f90)
  6714. {
  6715. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6716. int j1 = Model.modelIntArray1[i1];
  6717. int k1 = Model.modelIntArray2[i1];
  6718. j1 = (j1 * 256) / (minimapInt3 + 256);
  6719. k1 = (k1 * 256) / (minimapInt3 + 256);
  6720. int l1 = j * j1 + k * k1 >> 16;
  6721. int i2 = j * k1 - k * j1 >> 16;
  6722. double d = Math.atan2(l1, i2);
  6723. int j2 = (int)(Math.sin(d) * 63D);
  6724. int k2 = (int)(Math.cos(d) * 57D);
  6725. } else
  6726. {
  6727. markMinimap(sprite, k, j);
  6728. }
  6729. }
  6730. private void rightClickChatButtons() {
  6731. int y = extraHeight;
  6732. if(!newMap) {
  6733. if(super.mouseX >= 6 && super.mouseX <= 62 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6734. menuActionName[1] = "View All";
  6735. menuActionID[1] = 999;
  6736. menuActionRow = 2;
  6737. }
  6738. else if(super.mouseX >= 63 && super.mouseX <= 118 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6739. menuActionName[1] = "View Game";
  6740. menuActionID[1] = 998;
  6741. menuActionRow = 2;
  6742. }
  6743. else if(super.mouseX >= 119 && super.mouseX <= 175 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6744. menuActionName[1] = "Hide public";
  6745. menuActionID[1] = 997;
  6746. menuActionName[2] = "Off public";
  6747. menuActionID[2] = 996;
  6748. menuActionName[3] = "Friends public";
  6749. menuActionID[3] = 995;
  6750. menuActionName[4] = "On public";
  6751. menuActionID[4] = 994;
  6752. menuActionName[5] = "View public";
  6753. menuActionID[5] = 993;
  6754. menuActionRow = 6;
  6755. }
  6756. else if(super.mouseX >= 177 && super.mouseX <= 232 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6757. menuActionName[1] = "Off private";
  6758. menuActionID[1] = 992;
  6759. menuActionName[2] = "Friends private";
  6760. menuActionID[2] = 991;
  6761. menuActionName[3] = "On private";
  6762. menuActionID[3] = 990;
  6763. menuActionName[4] = "View private";
  6764. menuActionID[4] = 989;
  6765. menuActionRow = 5;
  6766. }
  6767. else if(super.mouseX >= 233 && super.mouseX <= 289 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6768. menuActionName[1] = "Off clan chat";
  6769. menuActionID[1] = 1003;
  6770. menuActionName[2] = "Friends clan chat";
  6771. menuActionID[2] = 1002;
  6772. menuActionName[3] = "On clan chat";
  6773. menuActionID[3] = 1001;
  6774. menuActionName[4] = "View clan chat";
  6775. menuActionID[4] = 1000;
  6776. menuActionRow = 5;
  6777. }
  6778. else if(super.mouseX >= 290 && super.mouseX <= 346 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6779. menuActionName[1] = "Off trade";
  6780. menuActionID[1] = 987;
  6781. menuActionName[2] = "Friends trade";
  6782. menuActionID[2] = 986;
  6783. menuActionName[3] = "On trade";
  6784. menuActionID[3] = 985;
  6785. menuActionName[4] = "View trade";
  6786. menuActionID[4] = 984;
  6787. menuActionRow = 5;
  6788. }
  6789. else if(super.mouseX >= 347 && super.mouseX <= 403 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6790. menuActionName[1] = "Off duel";
  6791. menuActionID[1] = 983;
  6792. menuActionName[2] = "Friends duel";
  6793. menuActionID[2] = 982;
  6794. menuActionName[3] = "On duel";
  6795. menuActionID[3] = 981;
  6796. menuActionName[4] = "View duel";
  6797. menuActionID[4] = 980;
  6798. menuActionRow = 5;
  6799. }
  6800. } else
  6801. if(newMap) {
  6802. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6803. menuActionName[1] = "View All";
  6804. menuActionID[1] = 999;
  6805. menuActionRow = 2;
  6806. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6807. menuActionName[1] = "View Game";
  6808. menuActionID[1] = 998;
  6809. menuActionRow = 2;
  6810. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6811. menuActionName[1] = "Hide public";
  6812. menuActionID[1] = 997;
  6813. menuActionName[2] = "Off public";
  6814. menuActionID[2] = 996;
  6815. menuActionName[3] = "Friends public";
  6816. menuActionID[3] = 995;
  6817. menuActionName[4] = "On public";
  6818. menuActionID[4] = 994;
  6819. menuActionName[5] = "View public";
  6820. menuActionID[5] = 993;
  6821. menuActionRow = 6;
  6822. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6823. menuActionName[1] = "Off private";
  6824. menuActionID[1] = 992;
  6825. menuActionName[2] = "Friends private";
  6826. menuActionID[2] = 991;
  6827. menuActionName[3] = "On private";
  6828. menuActionID[3] = 990;
  6829. menuActionName[4] = "View private";
  6830. menuActionID[4] = 989;
  6831. menuActionRow = 5;
  6832. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6833. menuActionName[1] = "Off clan chat";
  6834. menuActionID[1] = 1003;
  6835. menuActionName[2] = "Friends clan chat";
  6836. menuActionID[2] = 1002;
  6837. menuActionName[3] = "On clan chat";
  6838. menuActionID[3] = 1001;
  6839. menuActionName[4] = "View clan chat";
  6840. menuActionID[4] = 1000;
  6841. menuActionRow = 5;
  6842. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482+y && super.mouseY <= 503+y) {
  6843. menuActionName[1] = "Off trade";
  6844. menuActionID[1] = 987;
  6845. menuActionName[2] = "Friends trade";
  6846. menuActionID[2] = 986;
  6847. menuActionName[3] = "On trade";
  6848. menuActionID[3] = 985;
  6849. menuActionName[4] = "View trade";
  6850. menuActionID[4] = 984;
  6851. menuActionRow = 5;
  6852. }
  6853. }
  6854. }
  6855. public void processRightClick() {
  6856. int x = isFullScreen ? extraWidth+13 : 0;
  6857. int y = isFullScreen ? extraHeight-40 : 0;
  6858. if (activeInterfaceType != 0) {
  6859. return;
  6860. }
  6861. menuActionName[0] = "Cancel";
  6862. menuActionID[0] = 1107;
  6863. menuActionRow = 1;
  6864. if (fullscreenInterfaceID != -1) {
  6865. anInt886 = 0;
  6866. anInt1315 = 0;
  6867. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6868. if (anInt886 != anInt1026) {
  6869. anInt1026 = anInt886;
  6870. }
  6871. if (anInt1315 != anInt1129) {
  6872. anInt1129 = anInt1315;
  6873. }
  6874. return;
  6875. }
  6876. buildSplitPrivateChatMenu();
  6877. anInt886 = 0;
  6878. anInt1315 = 0;
  6879. if(!isFullScreen)
  6880. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338)
  6881. if (openInterfaceID != -1)
  6882. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6883. else
  6884. build3dScreenMenu();
  6885. if(isFullScreen) {
  6886. if(canClickScreen())
  6887. if (super.mouseX > (clientWidth / 2) - 256 && super.mouseY > (clientHeight / 2) - 167 && super.mouseX < ((clientWidth / 2) + 256) && super.mouseY < (clientHeight / 2) + 167 && openInterfaceID != -1)
  6888. buildInterfaceMenu((clientWidth / 2) - 256, RSInterface.interfaceCache[openInterfaceID], super.mouseX, (clientHeight / 2) - 167, super.mouseY, 0);
  6889. else
  6890. build3dScreenMenu();
  6891. }
  6892. if (anInt886 != anInt1026) {
  6893. anInt1026 = anInt886;
  6894. }
  6895. if (anInt1315 != anInt1129) {
  6896. anInt1129 = anInt1315;
  6897. }
  6898. anInt886 = 0;
  6899. anInt1315 = 0;
  6900. if(super.mouseX > 560+extraWidth && super.mouseY > 165+extraHeight && super.mouseX < 752+extraWidth && super.mouseY < 426+extraHeight && isFullScreen && !drawLongTabs) {
  6901. if(invOverlayInterfaceID != -1 && isFullScreen) {
  6902. buildInterfaceMenu(560+extraWidth, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 165+extraHeight, super.mouseY, 0);
  6903. } else if(tabInterfaceIDs[tabID] != -1 && isFullScreen) {
  6904. buildInterfaceMenu(560+extraWidth, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 165+extraHeight, super.mouseY, 0);
  6905. }
  6906. }
  6907. if(super.mouseX > 560+extraWidth && super.mouseY > 165+extraHeight && super.mouseX < 752+35+extraWidth && super.mouseY < 426+35+extraHeight && isFullScreen && drawLongTabs && !newMap) {
  6908. if(invOverlayInterfaceID != -1 && isFullScreen && !newMap) {
  6909. buildInterfaceMenu(560+extraWidth, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 165+35+extraHeight, super.mouseY, 0);
  6910. } else if(tabInterfaceIDs[tabID] != -1 && isFullScreen && !newMap) {
  6911. buildInterfaceMenu(560+extraWidth, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 165+35+extraHeight, super.mouseY, 0);
  6912. }
  6913. }
  6914. if(super.mouseX > 560+extraWidth && super.mouseY > 165+extraHeight && super.mouseX < 752+35+extraWidth && super.mouseY < 426+35-6+extraHeight && isFullScreen && drawLongTabs && newMap) {
  6915. if(invOverlayInterfaceID != -1 && isFullScreen && newMap) {
  6916. buildInterfaceMenu(560+extraWidth, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 165+35-6+extraHeight, super.mouseY, 0);
  6917. } else if(tabInterfaceIDs[tabID] != -1 && isFullScreen && newMap) {
  6918. buildInterfaceMenu(560+extraWidth, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 165+35-6+extraHeight, super.mouseY, 0);
  6919. }
  6920. }
  6921. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468 && !isFullScreen) {
  6922. if(invOverlayInterfaceID != -1 && !isFullScreen) {
  6923. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6924. } else if(tabInterfaceIDs[tabID] != -1 && !isFullScreen) {
  6925. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6926. }
  6927. }
  6928. if (anInt886 != anInt1048) {
  6929. needDrawTabArea = true;
  6930. tabAreaAltered = true;
  6931. anInt1048 = anInt886;
  6932. }
  6933. if (anInt1315 != anInt1044) {
  6934. needDrawTabArea = true;
  6935. tabAreaAltered = true;
  6936. anInt1044 = anInt1315;
  6937. }
  6938. anInt886 = 0;
  6939. anInt1315 = 0;
  6940. if(super.mouseX > 0 && super.mouseY > 334+extraHeight && super.mouseX < 490 && super.mouseY < 459+extraHeight) {
  6941. if(backDialogID != -1) {
  6942. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 354+extraHeight, super.mouseY, 0);
  6943. } else if(super.mouseY < 459+extraHeight && super.mouseX < 490) {
  6944. buildChatAreaMenu(super.mouseY - (334+extraHeight));
  6945. }
  6946. }
  6947. if(backDialogID != -1 && anInt886 != anInt1039) {
  6948. inputTaken = true;
  6949. anInt1039 = anInt886;
  6950. }
  6951. if (super.mouseX >= 515+extraWidth && super.mouseY >= 0+extraHeight && super.mouseX <= 765+extraWidth && super.mouseY <= 167+extraHeight)
  6952. if (openInterfaceID != -1)
  6953. buildInterfaceMenu(0, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 0, super.mouseY, 0);
  6954. if (anInt886 != anInt1026)
  6955. anInt1026 = anInt886;
  6956. anInt886 = 0;
  6957. if(super.mouseX > 4 && super.mouseY > clientHeight - 23 && super.mouseX < 516 && super.mouseY < clientHeight){
  6958. rightClickChatButtons();
  6959. }
  6960. /**/
  6961. processXPCounterClick();
  6962. rightClickMapArea();
  6963. boolean flag = false;
  6964. while (!flag) {
  6965. flag = true;
  6966. for (int j = 0; j < menuActionRow - 1; j++) {
  6967. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6968. String s = menuActionName[j];
  6969. menuActionName[j] = menuActionName[j + 1];
  6970. menuActionName[j + 1] = s;
  6971. int k = menuActionID[j];
  6972. menuActionID[j] = menuActionID[j + 1];
  6973. menuActionID[j + 1] = k;
  6974. k = menuActionCmd2[j];
  6975. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6976. menuActionCmd2[j + 1] = k;
  6977. k = menuActionCmd3[j];
  6978. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6979. menuActionCmd3[j + 1] = k;
  6980. k = menuActionCmd1[j];
  6981. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6982. menuActionCmd1[j + 1] = k;
  6983. flag = false;
  6984. }
  6985. }
  6986. }
  6987. }
  6988. private int method83(int i, int j, int k)
  6989. {
  6990. int l = 256 - k;
  6991. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6992. }
  6993. private void login(String s, String s1, boolean flag)
  6994. {
  6995. signlink.errorname = s;
  6996. try
  6997. {
  6998. if(!flag)
  6999. {
  7000. loginMessage1 = "";
  7001. loginMessage2 = "Connecting to server...";
  7002. drawLoginScreen(true);
  7003. }
  7004. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7005. long l = TextClass.longForName(s);
  7006. int i = (int)(l >> 16 & 31L);
  7007. stream.currentOffset = 0;
  7008. stream.writeWordBigEndian(14);
  7009. stream.writeWordBigEndian(i);
  7010. socketStream.queueBytes(2, stream.buffer);
  7011. for(int j = 0; j < 8; j++)
  7012. socketStream.read();
  7013. int k = socketStream.read();
  7014. int i1 = k;
  7015. if(k == 0)
  7016. {
  7017. socketStream.flushInputStream(inStream.buffer, 8);
  7018. inStream.currentOffset = 0;
  7019. aLong1215 = inStream.readQWord();
  7020. int ai[] = new int[4];
  7021. ai[0] = (int)(Math.random() * 99999999D);
  7022. ai[1] = (int)(Math.random() * 99999999D);
  7023. ai[2] = (int)(aLong1215 >> 32);
  7024. ai[3] = (int)aLong1215;
  7025. stream.currentOffset = 0;
  7026. stream.writeWordBigEndian(10);
  7027. stream.writeDWord(ai[0]);
  7028. stream.writeDWord(ai[1]);
  7029. stream.writeDWord(ai[2]);
  7030. stream.writeDWord(ai[3]);
  7031. stream.writeDWord(/*signlink.uid*/999999);
  7032. stream.writeString(s);
  7033. stream.writeString(s1);
  7034. stream.doKeys();
  7035. aStream_847.currentOffset = 0;
  7036. if(flag)
  7037. aStream_847.writeWordBigEndian(18);
  7038. else
  7039. aStream_847.writeWordBigEndian(16);
  7040. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7041. aStream_847.writeWordBigEndian(255);
  7042. aStream_847.writeWord(317);
  7043. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7044. for(int l1 = 0; l1 < 9; l1++)
  7045. aStream_847.writeDWord(expectedCRCs[l1]);
  7046. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7047. stream.encryption = new ISAACRandomGen(ai);
  7048. for(int j2 = 0; j2 < 4; j2++)
  7049. ai[j2] += 50;
  7050. encryption = new ISAACRandomGen(ai);
  7051. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7052. k = socketStream.read();
  7053. }
  7054. if(k == 1)
  7055. {
  7056. try
  7057. {
  7058. Thread.sleep(2000L);
  7059. }
  7060. catch(Exception _ex) { }
  7061. login(s, s1, flag);
  7062. return;
  7063. }
  7064. if(k == 2)
  7065. {
  7066. myPrivilege = socketStream.read();
  7067. flagged = socketStream.read() == 1;
  7068. aLong1220 = 0L;
  7069. anInt1022 = 0;
  7070. mouseDetection.coordsIndex = 0;
  7071. super.awtFocus = true;
  7072. aBoolean954 = true;
  7073. loggedIn = true;
  7074. stream.currentOffset = 0;
  7075. inStream.currentOffset = 0;
  7076. pktType = -1;
  7077. anInt841 = -1;
  7078. anInt842 = -1;
  7079. anInt843 = -1;
  7080. pktSize = 0;
  7081. anInt1009 = 0;
  7082. anInt1104 = 0;
  7083. anInt1011 = 0;
  7084. anInt855 = 0;
  7085. menuActionRow = 0;
  7086. menuOpen = false;
  7087. super.idleTime = 0;
  7088. for(int j1 = 0; j1 < 100; j1++)
  7089. chatMessages[j1] = null;
  7090. itemSelected = 0;
  7091. spellSelected = 0;
  7092. loadingStage = 0;
  7093. anInt1062 = 0;
  7094. anInt1278 = (int)(Math.random() * 100D) - 50;
  7095. anInt1131 = (int)(Math.random() * 110D) - 55;
  7096. anInt896 = (int)(Math.random() * 80D) - 40;
  7097. minimapInt2 = (int)(Math.random() * 120D) - 60;
  7098. minimapInt3 = (int)(Math.random() * 30D) - 20;
  7099. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  7100. anInt1021 = 0;
  7101. anInt985 = -1;
  7102. destX = 0;
  7103. destY = 0;
  7104. playerCount = 0;
  7105. npcCount = 0;
  7106. for(int i2 = 0; i2 < maxPlayers; i2++)
  7107. {
  7108. playerArray[i2] = null;
  7109. aStreamArray895s[i2] = null;
  7110. }
  7111. for(int k2 = 0; k2 < 16384; k2++)
  7112. npcArray[k2] = null;
  7113. myPlayer = playerArray[myPlayerIndex] = new Player();
  7114. aClass19_1013.removeAll();
  7115. aClass19_1056.removeAll();
  7116. for(int l2 = 0; l2 < 4; l2++)
  7117. {
  7118. for(int i3 = 0; i3 < 104; i3++)
  7119. {
  7120. for(int k3 = 0; k3 < 104; k3++)
  7121. groundArray[l2][i3][k3] = null;
  7122. }
  7123. }
  7124. aClass19_1179 = new NodeList();
  7125. fullscreenInterfaceID = -1;
  7126. anInt900 = 0;
  7127. friendsCount = 0;
  7128. dialogID = -1;
  7129. backDialogID = -1;
  7130. openInterfaceID = -1;
  7131. invOverlayInterfaceID = -1;
  7132. anInt1018 = -1;
  7133. aBoolean1149 = false;
  7134. tabID = 3;
  7135. inputDialogState = 0;
  7136. menuOpen = false;
  7137. messagePromptRaised = false;
  7138. aString844 = null;
  7139. anInt1055 = 0;
  7140. anInt1054 = -1;
  7141. aBoolean1047 = true;
  7142. method45();
  7143. for(int j3 = 0; j3 < 5; j3++)
  7144. anIntArray990[j3] = 0;
  7145. for(int l3 = 0; l3 < 5; l3++)
  7146. {
  7147. atPlayerActions[l3] = null;
  7148. atPlayerArray[l3] = false;
  7149. }
  7150. anInt1175 = 0;
  7151. anInt1134 = 0;
  7152. anInt986 = 0;
  7153. anInt1288 = 0;
  7154. anInt924 = 0;
  7155. anInt1188 = 0;
  7156. anInt1155 = 0;
  7157. anInt1226 = 0;
  7158. int anInt941 = 0;
  7159. int anInt1260 = 0;
  7160. resetImageProducers2();
  7161. return;
  7162. }
  7163. if(k == 3)
  7164. {
  7165. loginMessage1 = "";
  7166. loginMessage2 = "Invalid username or password.";
  7167. return;
  7168. }
  7169. if(k == 4)
  7170. {
  7171. loginMessage1 = "Your account has been disabled.";
  7172. loginMessage2 = "Please check your message-center for details.";
  7173. return;
  7174. }
  7175. if(k == 5)
  7176. {
  7177. loginMessage1 = "Your account is already logged in.";
  7178. loginMessage2 = "Try again in 60 secs...";
  7179. return;
  7180. }
  7181. if(k == 6)
  7182. {
  7183. loginMessage1 = "RuneScape has been updated!";
  7184. loginMessage2 = "Please reload this page.";
  7185. return;
  7186. }
  7187. if(k == 7)
  7188. {
  7189. loginMessage1 = "This world is full.";
  7190. loginMessage2 = "Please use a different world.";
  7191. return;
  7192. }
  7193. if(k == 8)
  7194. {
  7195. loginMessage1 = "Unable to connect.";
  7196. loginMessage2 = "Login server offline.";
  7197. return;
  7198. }
  7199. if(k == 9)
  7200. {
  7201. loginMessage1 = "Login limit exceeded.";
  7202. loginMessage2 = "Too many connections from your address.";
  7203. return;
  7204. }
  7205. if(k == 10)
  7206. {
  7207. loginMessage1 = "Unable to connect.";
  7208. loginMessage2 = "Bad session id.";
  7209. return;
  7210. }
  7211. if(k == 11)
  7212. {
  7213. loginMessage2 = "Login server rejected session.";
  7214. loginMessage2 = "Please try again.";
  7215. return;
  7216. }
  7217. if(k == 12)
  7218. {
  7219. loginMessage1 = "You need a members account to login to this world.";
  7220. loginMessage2 = "Please subscribe, or use a different world.";
  7221. return;
  7222. }
  7223. if(k == 13)
  7224. {
  7225. loginMessage1 = "Could not complete login.";
  7226. loginMessage2 = "Please try using a different world.";
  7227. return;
  7228. }
  7229. if(k == 14)
  7230. {
  7231. loginMessage1 = "The server is being updated.";
  7232. loginMessage2 = "Please wait 1 minute and try again.";
  7233. return;
  7234. }
  7235. if(k == 15)
  7236. {
  7237. loggedIn = true;
  7238. stream.currentOffset = 0;
  7239. inStream.currentOffset = 0;
  7240. pktType = -1;
  7241. anInt841 = -1;
  7242. anInt842 = -1;
  7243. anInt843 = -1;
  7244. pktSize = 0;
  7245. anInt1009 = 0;
  7246. anInt1104 = 0;
  7247. menuActionRow = 0;
  7248. menuOpen = false;
  7249. aLong824 = System.currentTimeMillis();
  7250. return;
  7251. }
  7252. if(k == 16)
  7253. {
  7254. loginMessage1 = "Login attempts exceeded.";
  7255. loginMessage2 = "Please wait 1 minute and try again.";
  7256. return;
  7257. }
  7258. if(k == 17)
  7259. {
  7260. loginMessage1 = "You are standing in a members-only area.";
  7261. loginMessage2 = "To play on this world move to a free area first";
  7262. return;
  7263. }
  7264. if(k == 20)
  7265. {
  7266. loginMessage1 = "Invalid loginserver requested";
  7267. loginMessage2 = "Please try using a different world.";
  7268. return;
  7269. }
  7270. if(k == 21)
  7271. {
  7272. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  7273. {
  7274. loginMessage1 = "You have only just left another world";
  7275. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  7276. drawLoginScreen(true);
  7277. try
  7278. {
  7279. Thread.sleep(1000L);
  7280. }
  7281. catch(Exception _ex) { }
  7282. }
  7283. login(s, s1, flag);
  7284. return;
  7285. }
  7286. if(k == -1)
  7287. {
  7288. if(i1 == 0)
  7289. {
  7290. if(loginFailures < 2)
  7291. {
  7292. try
  7293. {
  7294. Thread.sleep(2000L);
  7295. }
  7296. catch(Exception _ex) { }
  7297. loginFailures++;
  7298. login(s, s1, flag);
  7299. return;
  7300. } else
  7301. {
  7302. loginMessage1 = "No response from loginserver";
  7303. loginMessage2 = "Please wait 1 minute and try again.";
  7304. return;
  7305. }
  7306. } else
  7307. {
  7308. loginMessage1 = "No response from server";
  7309. loginMessage2 = "Please try using a different world.";
  7310. return;
  7311. }
  7312. } else
  7313. {
  7314. System.out.println("response:" + k);
  7315. loginMessage1 = "Unexpected server response";
  7316. loginMessage2 = "Please try using a different world.";
  7317. return;
  7318. }
  7319. }
  7320. catch(IOException _ex)
  7321. {
  7322. loginMessage1 = "";
  7323. }
  7324. loginMessage2 = "Error connecting to server.";
  7325. }
  7326. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag, int k2) {
  7327. byte byte0 = 104;
  7328. byte byte1 = 104;
  7329. for(int l2 = 0; l2 < byte0; l2++) {
  7330. for(int i3 = 0; i3 < byte1; i3++) {
  7331. anIntArrayArray901[l2][i3] = 0;
  7332. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7333. }
  7334. }
  7335. int j3 = j2;
  7336. int k3 = j1;
  7337. anIntArrayArray901[j2][j1] = 99;
  7338. anIntArrayArray825[j2][j1] = 0;
  7339. int l3 = 0;
  7340. int i4 = 0;
  7341. bigX[l3] = j2;
  7342. bigY[l3++] = j1;
  7343. boolean flag1 = false;
  7344. int j4 = bigX.length;
  7345. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7346. while(i4 != l3)
  7347. {
  7348. j3 = bigX[i4];
  7349. k3 = bigY[i4];
  7350. i4 = (i4 + 1) % j4;
  7351. if(j3 == k2 && k3 == i2)
  7352. {
  7353. flag1 = true;
  7354. break;
  7355. }
  7356. if(i1 != 0)
  7357. {
  7358. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  7359. {
  7360. flag1 = true;
  7361. break;
  7362. }
  7363. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  7364. {
  7365. flag1 = true;
  7366. break;
  7367. }
  7368. }
  7369. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  7370. {
  7371. flag1 = true;
  7372. break;
  7373. }
  7374. int l4 = anIntArrayArray825[j3][k3] + 1;
  7375. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  7376. {
  7377. bigX[l3] = j3 - 1;
  7378. bigY[l3] = k3;
  7379. l3 = (l3 + 1) % j4;
  7380. anIntArrayArray901[j3 - 1][k3] = 2;
  7381. anIntArrayArray825[j3 - 1][k3] = l4;
  7382. }
  7383. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  7384. {
  7385. bigX[l3] = j3 + 1;
  7386. bigY[l3] = k3;
  7387. l3 = (l3 + 1) % j4;
  7388. anIntArrayArray901[j3 + 1][k3] = 8;
  7389. anIntArrayArray825[j3 + 1][k3] = l4;
  7390. }
  7391. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  7392. {
  7393. bigX[l3] = j3;
  7394. bigY[l3] = k3 - 1;
  7395. l3 = (l3 + 1) % j4;
  7396. anIntArrayArray901[j3][k3 - 1] = 1;
  7397. anIntArrayArray825[j3][k3 - 1] = l4;
  7398. }
  7399. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  7400. {
  7401. bigX[l3] = j3;
  7402. bigY[l3] = k3 + 1;
  7403. l3 = (l3 + 1) % j4;
  7404. anIntArrayArray901[j3][k3 + 1] = 4;
  7405. anIntArrayArray825[j3][k3 + 1] = l4;
  7406. }
  7407. if(j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0 && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  7408. {
  7409. bigX[l3] = j3 - 1;
  7410. bigY[l3] = k3 - 1;
  7411. l3 = (l3 + 1) % j4;
  7412. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7413. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7414. }
  7415. if(j3 < byte0 - 1 && k3 > 0 && anIntArrayArray901[j3 + 1][k3 - 1] == 0 && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  7416. {
  7417. bigX[l3] = j3 + 1;
  7418. bigY[l3] = k3 - 1;
  7419. l3 = (l3 + 1) % j4;
  7420. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7421. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7422. }
  7423. if(j3 > 0 && k3 < byte1 - 1 && anIntArrayArray901[j3 - 1][k3 + 1] == 0 && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  7424. {
  7425. bigX[l3] = j3 - 1;
  7426. bigY[l3] = k3 + 1;
  7427. l3 = (l3 + 1) % j4;
  7428. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7429. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7430. }
  7431. if(j3 < byte0 - 1 && k3 < byte1 - 1 && anIntArrayArray901[j3 + 1][k3 + 1] == 0 && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  7432. {
  7433. bigX[l3] = j3 + 1;
  7434. bigY[l3] = k3 + 1;
  7435. l3 = (l3 + 1) % j4;
  7436. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7437. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7438. }
  7439. }
  7440. anInt1264 = 0;
  7441. if(!flag1)
  7442. {
  7443. if(flag)
  7444. {
  7445. int i5 = 100;
  7446. for(int k5 = 1; k5 < 2; k5++)
  7447. {
  7448. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  7449. {
  7450. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7451. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  7452. {
  7453. i5 = anIntArrayArray825[i6][l6];
  7454. j3 = i6;
  7455. k3 = l6;
  7456. anInt1264 = 1;
  7457. flag1 = true;
  7458. }
  7459. }
  7460. if(flag1)
  7461. break;
  7462. }
  7463. }
  7464. if(!flag1)
  7465. return false;
  7466. }
  7467. i4 = 0;
  7468. bigX[i4] = j3;
  7469. bigY[i4++] = k3;
  7470. int l5;
  7471. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  7472. {
  7473. if(j5 != l5)
  7474. {
  7475. l5 = j5;
  7476. bigX[i4] = j3;
  7477. bigY[i4++] = k3;
  7478. }
  7479. if((j5 & 2) != 0)
  7480. j3++;
  7481. else
  7482. if((j5 & 8) != 0)
  7483. j3--;
  7484. if((j5 & 1) != 0)
  7485. k3++;
  7486. else
  7487. if((j5 & 4) != 0)
  7488. k3--;
  7489. }
  7490. // if(cancelWalk) { return i4 > 0; }
  7491. if(i4 > 0)
  7492. {
  7493. int k4 = i4;
  7494. if(k4 > 25)
  7495. k4 = 25;
  7496. i4--;
  7497. int k6 = bigX[i4];
  7498. int i7 = bigY[i4];
  7499. anInt1288 += k4;
  7500. if(anInt1288 >= 92)
  7501. {
  7502. stream.createFrame(36);
  7503. stream.writeDWord(0);
  7504. anInt1288 = 0;
  7505. }
  7506. if(i == 0)
  7507. {
  7508. stream.createFrame(164);
  7509. stream.writeWordBigEndian(k4 + k4 + 3);
  7510. }
  7511. if(i == 1)
  7512. {
  7513. stream.createFrame(248);
  7514. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7515. }
  7516. if(i == 2)
  7517. {
  7518. stream.createFrame(98);
  7519. stream.writeWordBigEndian(k4 + k4 + 3);
  7520. }
  7521. stream.method433(k6 + baseX);
  7522. destX = bigX[0];
  7523. destY = bigY[0];
  7524. for(int j7 = 1; j7 < k4; j7++)
  7525. {
  7526. i4--;
  7527. stream.writeWordBigEndian(bigX[i4] - k6);
  7528. stream.writeWordBigEndian(bigY[i4] - i7);
  7529. }
  7530. stream.method431(i7 + baseY);
  7531. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7532. return true;
  7533. }
  7534. return i != 1;
  7535. }
  7536. private void method86(Stream stream)
  7537. {
  7538. for(int j = 0; j < anInt893; j++)
  7539. {
  7540. int k = anIntArray894[j];
  7541. NPC npc = npcArray[k];
  7542. int l = stream.readUnsignedByte();
  7543. if((l & 0x10) != 0)
  7544. {
  7545. int i1 = stream.method434();
  7546. if(i1 == 65535)
  7547. i1 = -1;
  7548. int i2 = stream.readUnsignedByte();
  7549. if(i1 == npc.anim && i1 != -1)
  7550. {
  7551. int l2 = Animation.anims[i1].anInt365;
  7552. if(l2 == 1)
  7553. {
  7554. npc.anInt1527 = 0;
  7555. npc.anInt1528 = 0;
  7556. npc.anInt1529 = i2;
  7557. npc.anInt1530 = 0;
  7558. }
  7559. if(l2 == 2)
  7560. npc.anInt1530 = 0;
  7561. } else
  7562. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  7563. {
  7564. npc.anim = i1;
  7565. npc.anInt1527 = 0;
  7566. npc.anInt1528 = 0;
  7567. npc.anInt1529 = i2;
  7568. npc.anInt1530 = 0;
  7569. npc.anInt1542 = npc.smallXYIndex;
  7570. }
  7571. }
  7572. if((l & 8) != 0)
  7573. {
  7574. int j1 = stream.method426();
  7575. int j2 = stream.method427();
  7576. npc.updateHitData(j2, j1, loopCycle);
  7577. npc.loopCycleStatus = loopCycle + 300;
  7578. npc.currentHealth = stream.method426();
  7579. npc.maxHealth = stream.readUnsignedByte();
  7580. }
  7581. if((l & 0x80) != 0)
  7582. {
  7583. npc.anInt1520 = stream.readUnsignedWord();
  7584. int k1 = stream.readDWord();
  7585. npc.anInt1524 = k1 >> 16;
  7586. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7587. npc.anInt1521 = 0;
  7588. npc.anInt1522 = 0;
  7589. if(npc.anInt1523 > loopCycle)
  7590. npc.anInt1521 = -1;
  7591. if(npc.anInt1520 == 65535)
  7592. npc.anInt1520 = -1;
  7593. }
  7594. if((l & 0x20) != 0)
  7595. {
  7596. npc.interactingEntity = stream.readUnsignedWord();
  7597. if(npc.interactingEntity == 65535)
  7598. npc.interactingEntity = -1;
  7599. }
  7600. if((l & 1) != 0)
  7601. {
  7602. npc.textSpoken = stream.readString();
  7603. npc.textCycle = 100;
  7604. // entityMessage(npc);
  7605. }
  7606. if((l & 0x40) != 0)
  7607. {
  7608. int l1 = stream.method427();
  7609. int k2 = stream.method428();
  7610. npc.updateHitData(k2, l1, loopCycle);
  7611. npc.loopCycleStatus = loopCycle + 300;
  7612. npc.currentHealth = stream.method428();
  7613. npc.maxHealth = stream.method427();
  7614. }
  7615. if((l & 2) != 0)
  7616. {
  7617. npc.desc = EntityDef.forID(stream.method436());
  7618. npc.anInt1540 = npc.desc.aByte68;
  7619. npc.anInt1504 = npc.desc.anInt79;
  7620. npc.anInt1554 = npc.desc.walkAnim;
  7621. npc.anInt1555 = npc.desc.anInt58;
  7622. npc.anInt1556 = npc.desc.anInt83;
  7623. npc.anInt1557 = npc.desc.anInt55;
  7624. npc.anInt1511 = npc.desc.standAnim;
  7625. }
  7626. if((l & 4) != 0)
  7627. {
  7628. npc.anInt1538 = stream.method434();
  7629. npc.anInt1539 = stream.method434();
  7630. }
  7631. }
  7632. }
  7633. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  7634. {
  7635. if(menuActionRow >= 400)
  7636. return;
  7637. if(entityDef.childrenIDs != null)
  7638. entityDef = entityDef.method161();
  7639. if(entityDef == null)
  7640. return;
  7641. if(!entityDef.aBoolean84)
  7642. return;
  7643. String s = entityDef.name;
  7644. if(entityDef.combatLevel != 0)
  7645. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7646. if(itemSelected == 1)
  7647. {
  7648. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7649. menuActionID[menuActionRow] = 582;
  7650. menuActionCmd1[menuActionRow] = i;
  7651. menuActionCmd2[menuActionRow] = k;
  7652. menuActionCmd3[menuActionRow] = j;
  7653. menuActionRow++;
  7654. return;
  7655. }
  7656. if(spellSelected == 1)
  7657. {
  7658. if((spellUsableOn & 2) == 2)
  7659. {
  7660. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7661. menuActionID[menuActionRow] = 413;
  7662. menuActionCmd1[menuActionRow] = i;
  7663. menuActionCmd2[menuActionRow] = k;
  7664. menuActionCmd3[menuActionRow] = j;
  7665. menuActionRow++;
  7666. }
  7667. } else
  7668. {
  7669. if(entityDef.actions != null)
  7670. {
  7671. for(int l = 4; l >= 0; l--)
  7672. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  7673. {
  7674. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7675. if(l == 0)
  7676. menuActionID[menuActionRow] = 20;
  7677. if(l == 1)
  7678. menuActionID[menuActionRow] = 412;
  7679. if(l == 2)
  7680. menuActionID[menuActionRow] = 225;
  7681. if(l == 3)
  7682. menuActionID[menuActionRow] = 965;
  7683. if(l == 4)
  7684. menuActionID[menuActionRow] = 478;
  7685. menuActionCmd1[menuActionRow] = i;
  7686. menuActionCmd2[menuActionRow] = k;
  7687. menuActionCmd3[menuActionRow] = j;
  7688. menuActionRow++;
  7689. }
  7690. }
  7691. if(entityDef.actions != null)
  7692. {
  7693. for(int i1 = 4; i1 >= 0; i1--)
  7694. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7695. {
  7696. char c = '\0';
  7697. if(entityDef.combatLevel > myPlayer.combatLevel)
  7698. c = '\u07D0';
  7699. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7700. if(i1 == 0)
  7701. menuActionID[menuActionRow] = 20 + c;
  7702. if(i1 == 1)
  7703. menuActionID[menuActionRow] = 412 + c;
  7704. if(i1 == 2)
  7705. menuActionID[menuActionRow] = 225 + c;
  7706. if(i1 == 3)
  7707. menuActionID[menuActionRow] = 965 + c;
  7708. if(i1 == 4)
  7709. menuActionID[menuActionRow] = 478 + c;
  7710. menuActionCmd1[menuActionRow] = i;
  7711. menuActionCmd2[menuActionRow] = k;
  7712. menuActionCmd3[menuActionRow] = j;
  7713. menuActionRow++;
  7714. }
  7715. }
  7716. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7717. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7718. menuActionID[menuActionRow] = 1025;
  7719. menuActionCmd1[menuActionRow] = i;
  7720. menuActionCmd2[menuActionRow] = k;
  7721. menuActionCmd3[menuActionRow] = j;
  7722. menuActionRow++;
  7723. }
  7724. }
  7725. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7726. {
  7727. if(player == myPlayer)
  7728. return;
  7729. if(menuActionRow >= 400)
  7730. return;
  7731. String s;
  7732. if(player.skill == 0)
  7733. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7734. else
  7735. s = player.name + " (skill-" + player.skill + ")";
  7736. if(itemSelected == 1)
  7737. {
  7738. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7739. menuActionID[menuActionRow] = 491;
  7740. menuActionCmd1[menuActionRow] = j;
  7741. menuActionCmd2[menuActionRow] = i;
  7742. menuActionCmd3[menuActionRow] = k;
  7743. menuActionRow++;
  7744. } else
  7745. if(spellSelected == 1)
  7746. {
  7747. if((spellUsableOn & 8) == 8)
  7748. {
  7749. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7750. menuActionID[menuActionRow] = 365;
  7751. menuActionCmd1[menuActionRow] = j;
  7752. menuActionCmd2[menuActionRow] = i;
  7753. menuActionCmd3[menuActionRow] = k;
  7754. menuActionRow++;
  7755. }
  7756. } else
  7757. {
  7758. for(int l = 4; l >= 0; l--)
  7759. if(atPlayerActions[l] != null)
  7760. {
  7761. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7762. char c = '\0';
  7763. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7764. {
  7765. if(player.combatLevel > myPlayer.combatLevel)
  7766. c = '\u07D0';
  7767. if(myPlayer.team != 0 && player.team != 0)
  7768. if(myPlayer.team == player.team)
  7769. c = '\u07D0';
  7770. else
  7771. c = '\0';
  7772. } else
  7773. if(atPlayerArray[l])
  7774. c = '\u07D0';
  7775. if(l == 0)
  7776. menuActionID[menuActionRow] = 561 + c;
  7777. if(l == 1)
  7778. menuActionID[menuActionRow] = 779 + c;
  7779. if(l == 2)
  7780. menuActionID[menuActionRow] = 27 + c;
  7781. if(l == 3)
  7782. menuActionID[menuActionRow] = 577 + c;
  7783. if(l == 4)
  7784. menuActionID[menuActionRow] = 729 + c;
  7785. menuActionCmd1[menuActionRow] = j;
  7786. menuActionCmd2[menuActionRow] = i;
  7787. menuActionCmd3[menuActionRow] = k;
  7788. menuActionRow++;
  7789. }
  7790. }
  7791. for(int i1 = 0; i1 < menuActionRow; i1++)
  7792. if(menuActionID[i1] == 516)
  7793. {
  7794. menuActionName[i1] = "Walk here @whi@" + s;
  7795. return;
  7796. }
  7797. }
  7798. private void method89(Class30_Sub1 class30_sub1)
  7799. {
  7800. int i = 0;
  7801. int j = -1;
  7802. int k = 0;
  7803. int l = 0;
  7804. if(class30_sub1.anInt1296 == 0)
  7805. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7806. if(class30_sub1.anInt1296 == 1)
  7807. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7808. if(class30_sub1.anInt1296 == 2)
  7809. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7810. if(class30_sub1.anInt1296 == 3)
  7811. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7812. if(i != 0)
  7813. {
  7814. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7815. j = i >> 14 & 0x7fff;
  7816. k = i1 & 0x1f;
  7817. l = i1 >> 6;
  7818. }
  7819. class30_sub1.anInt1299 = j;
  7820. class30_sub1.anInt1301 = k;
  7821. class30_sub1.anInt1300 = l;
  7822. }
  7823. private void method90()
  7824. {
  7825. for(int i = 0; i < anInt1062; i++)
  7826. if(anIntArray1250[i] <= 0)
  7827. {
  7828. boolean flag1 = false;
  7829. try
  7830. {
  7831. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7832. {
  7833. if(!replayWave())
  7834. flag1 = true;
  7835. } else
  7836. {
  7837. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7838. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7839. {
  7840. anInt1257 = stream.currentOffset;
  7841. aLong1172 = System.currentTimeMillis();
  7842. if(saveWave(stream.buffer, stream.currentOffset))
  7843. {
  7844. anInt874 = anIntArray1207[i];
  7845. anInt1289 = anIntArray1241[i];
  7846. } else
  7847. {
  7848. flag1 = true;
  7849. }
  7850. }
  7851. }
  7852. }
  7853. catch(Exception exception) { }
  7854. if(!flag1 || anIntArray1250[i] == -5)
  7855. {
  7856. anInt1062--;
  7857. for(int j = i; j < anInt1062; j++)
  7858. {
  7859. anIntArray1207[j] = anIntArray1207[j + 1];
  7860. anIntArray1241[j] = anIntArray1241[j + 1];
  7861. anIntArray1250[j] = anIntArray1250[j + 1];
  7862. }
  7863. i--;
  7864. } else
  7865. {
  7866. anIntArray1250[i] = -5;
  7867. }
  7868. } else
  7869. {
  7870. anIntArray1250[i]--;
  7871. }
  7872. if(prevSong > 0)
  7873. {
  7874. prevSong -= 20;
  7875. if(prevSong < 0)
  7876. prevSong = 0;
  7877. if(prevSong == 0 && musicEnabled && !lowMem)
  7878. {
  7879. nextSong = currentSong;
  7880. songChanging = true;
  7881. onDemandFetcher.method558(2, nextSong);
  7882. }
  7883. }
  7884. }
  7885. void startUp()
  7886. {
  7887. drawLoadingText(20, "Starting up");
  7888. if(signlink.sunjava)
  7889. super.minDelay = 5;
  7890. if(aBoolean993)
  7891. {
  7892. // rsAlreadyLoaded = true;
  7893. // return;
  7894. }
  7895. aBoolean993 = true;
  7896. boolean flag = true;
  7897. String s = getDocumentBaseHost();
  7898. if(signlink.cache_dat != null)
  7899. {
  7900. for(int i = 0; i < 5; i++)
  7901. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7902. } try {
  7903. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7904. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7905. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7906. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7907. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7908. drawLogo();
  7909. loadTitleScreen();
  7910. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7911. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7912. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7913. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7914. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7915. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7916. byteGroundArray = new byte[4][104][104];
  7917. intGroundArray = new int[4][105][105];
  7918. worldController = new WorldController(intGroundArray);
  7919. for(int j = 0; j < 4; j++)
  7920. aClass11Array1230[j] = new Class11();
  7921. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7922. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7923. drawLoadingText(60, "Connecting to update server");
  7924. onDemandFetcher = new OnDemandFetcher();
  7925. onDemandFetcher.start(streamLoader_6, this);
  7926. Class36.method528(onDemandFetcher.getAnimCount());
  7927. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7928. ModelDecompressor.loadModels();
  7929. //preloadModels();
  7930. if(!lowMem)
  7931. {
  7932. nextSong = 0;
  7933. try
  7934. {
  7935. nextSong = Integer.parseInt(getParameter("music"));
  7936. }
  7937. catch(Exception _ex) { }
  7938. songChanging = true;
  7939. onDemandFetcher.method558(2, nextSong);
  7940. while(onDemandFetcher.getNodeCount() > 0)
  7941. {
  7942. processOnDemandQueue();
  7943. try
  7944. {
  7945. Thread.sleep(100L);
  7946. }
  7947. catch(Exception _ex) { }
  7948. if(onDemandFetcher.anInt1349 > 3)
  7949. {
  7950. loadError();
  7951. return;
  7952. }
  7953. }
  7954. }
  7955. drawLoadingText(65, "Requesting animations");
  7956. int k = onDemandFetcher.getVersionCount(1);
  7957. for(int i1 = 0; i1 < k; i1++)
  7958. onDemandFetcher.method558(1, i1);
  7959. while(onDemandFetcher.getNodeCount() > 0)
  7960. {
  7961. int j1 = k - onDemandFetcher.getNodeCount();
  7962. if(j1 > 0)
  7963. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7964. processOnDemandQueue();
  7965. try
  7966. {
  7967. Thread.sleep(100L);
  7968. }
  7969. catch(Exception _ex) { }
  7970. if(onDemandFetcher.anInt1349 > 3)
  7971. {
  7972. loadError();
  7973. return;
  7974. }
  7975. }
  7976. drawLoadingText(70, "Requesting models");
  7977. k = onDemandFetcher.getVersionCount(0);
  7978. for(int k1 = 0; k1 < k; k1++)
  7979. {
  7980. int l1 = onDemandFetcher.getModelIndex(k1);
  7981. if((l1 & 1) != 0)
  7982. onDemandFetcher.method558(0, k1);
  7983. }
  7984. k = onDemandFetcher.getNodeCount();
  7985. while(onDemandFetcher.getNodeCount() > 0)
  7986. {
  7987. int i2 = k - onDemandFetcher.getNodeCount();
  7988. if(i2 > 0)
  7989. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7990. processOnDemandQueue();
  7991. try
  7992. {
  7993. Thread.sleep(100L);
  7994. }
  7995. catch(Exception _ex) { }
  7996. }
  7997. if(decompressors[0] != null)
  7998. {
  7999. drawLoadingText(75, "Requesting maps");
  8000. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  8001. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  8002. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  8003. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  8004. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  8005. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  8006. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  8007. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  8008. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  8009. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  8010. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  8011. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  8012. k = onDemandFetcher.getNodeCount();
  8013. while(onDemandFetcher.getNodeCount() > 0)
  8014. {
  8015. int j2 = k - onDemandFetcher.getNodeCount();
  8016. if(j2 > 0)
  8017. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  8018. processOnDemandQueue();
  8019. try
  8020. {
  8021. Thread.sleep(100L);
  8022. }
  8023. catch(Exception _ex) { }
  8024. }
  8025. }
  8026. k = onDemandFetcher.getVersionCount(0);
  8027. for(int k2 = 0; k2 < k; k2++)
  8028. {
  8029. int l2 = onDemandFetcher.getModelIndex(k2);
  8030. byte byte0 = 0;
  8031. if((l2 & 8) != 0)
  8032. byte0 = 10;
  8033. else
  8034. if((l2 & 0x20) != 0)
  8035. byte0 = 9;
  8036. else
  8037. if((l2 & 0x10) != 0)
  8038. byte0 = 8;
  8039. else
  8040. if((l2 & 0x40) != 0)
  8041. byte0 = 7;
  8042. else
  8043. if((l2 & 0x80) != 0)
  8044. byte0 = 6;
  8045. else
  8046. if((l2 & 2) != 0)
  8047. byte0 = 5;
  8048. else
  8049. if((l2 & 4) != 0)
  8050. byte0 = 4;
  8051. if((l2 & 1) != 0)
  8052. byte0 = 3;
  8053. if(byte0 != 0)
  8054. onDemandFetcher.method563(byte0, 0, k2);
  8055. }
  8056. onDemandFetcher.method554(isMembers);
  8057. if(!lowMem)
  8058. {
  8059. int l = onDemandFetcher.getVersionCount(2);
  8060. for(int i3 = 1; i3 < l; i3++)
  8061. if(onDemandFetcher.method569(i3))
  8062. onDemandFetcher.method563((byte)1, 2, i3);
  8063. }
  8064. drawLoadingText(80, "Unpacking media");
  8065. /*Preloaded sprites*/
  8066. for(int i = 0; i < 4; i++)
  8067. counter[i] = new Sprite("GameFrame/Orbs/XP/XP "+i);
  8068. chatButtonH = new Sprite("Fullscreen/chathover");
  8069. chatButtonC = new Sprite("Fullscreen/chatclicked");
  8070. logIconH = new Sprite("GameFrame/Orbs/logiconh");
  8071. logIconC = new Sprite("GameFrame/Orbs/logiconc");
  8072. chatButtonHC = new Sprite("Fullscreen/chatclickedh");
  8073. reportH = new Sprite("Fullscreen/reporthover");
  8074. mapRing = new Sprite("Fullscreen/mapring");
  8075. worldMapIcon = new Sprite("Fullscreen/mapicon");
  8076. summonFill = new Sprite("GameFrame/Orbs/summonFill");
  8077. summonFill2 = new Sprite("GameFrame/Orbs/summoned");
  8078. runIcon2 = new Sprite("GameFrame/Orbs/runicon2");
  8079. runOrb1 = new Sprite("GameFrame/Orbs/runorb1");
  8080. runOrb2 = new Sprite("GameFrame/Orbs/runorb2");
  8081. runIcon1 = new Sprite("GameFrame/Orbs/runicon1");
  8082. hitPointsFill = new Sprite("GameFrame/Orbs/hitpointsfill");
  8083. hitPointsIcon = new Sprite("GameFrame/Orbs/hitpointsicon");
  8084. prayerFill = new Sprite("GameFrame/Orbs/prayerfill");
  8085. prayerIcon = new Sprite("GameFrame/Orbs/prayericon");
  8086. if (!newMap && !isFullScreen) {
  8087. chatArea = new Sprite("Fullscreen/chatarea");
  8088. tabArea = new Sprite("Fullscreen/tabarea");
  8089. chatButtons = new Sprite("Fullscreen/chatbuttons");
  8090. logIcon = new Sprite("Fullscreen/logout");
  8091. }
  8092. if (newMap && !isFullScreen) {
  8093. chatArea = new Sprite("Fullscreen/chat");
  8094. tabArea = new Sprite("Fullscreen/tab");
  8095. chatButtons = new Sprite("Fullscreen/chatb");
  8096. logIcon = new Sprite("Fullscreen/logout");
  8097. }
  8098. try
  8099. {
  8100. for(int i = 0; i <= 3; i++) {
  8101. mapArea[i] = new Sprite("Fullscreen/map "+i+"");
  8102. }
  8103. }
  8104. catch(Exception _ex) { }
  8105. try
  8106. {
  8107. for(int i = 0; i <= 3; i++) {
  8108. fullScreenSprites[i] = new Sprite("Fullscreen/tab "+i+"");
  8109. }
  8110. }
  8111. catch(Exception _ex) { }
  8112. /*Cache packed sprites*/
  8113. emptyOrb = new Sprite(streamLoader_2, "orbs", 0);
  8114. deplete = new Sprite(streamLoader_2, "orbs", 1);
  8115. depleteP = new Sprite(streamLoader_2, "orbs", 1);
  8116. depleteR = new Sprite(streamLoader_2, "orbs", 1);
  8117. hitPointsFill = new Sprite(streamLoader_2, "orbs", 2);
  8118. hitPointsIcon = new Sprite(streamLoader_2, "orbs", 3);
  8119. prayerFill = new Sprite(streamLoader_2, "orbs", 4);
  8120. prayerIcon = new Sprite(streamLoader_2, "orbs", 5);
  8121. for (int j3 = 0; j3 < 12; j3++) {
  8122. scrollPart[j3] = new Sprite(streamLoader_2, "scrollpart",
  8123. j3);
  8124. }
  8125. for (int id = 0; id < 6; id++) {
  8126. scrollBar[id] = new Sprite(streamLoader_2, "scrollbar", id);
  8127. }
  8128. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8129. mapBack = new Background(streamLoader_2, "mapback", 0);
  8130. for(int j3 = 0; j3 <= 14; j3++)
  8131. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  8132. for(int r1 = 0; r1 < 5; r1++)
  8133. redStones[r1] = new Sprite("redstones " + r1);
  8134. compass = new Sprite(streamLoader_2, "compass", 0);
  8135. try
  8136. {
  8137. for(int k3 = 0; k3 < 100; k3++)
  8138. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  8139. }
  8140. catch(Exception _ex) { }
  8141. try
  8142. {
  8143. for(int l3 = 0; l3 < 100; l3++)
  8144. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  8145. }
  8146. catch(Exception _ex) { }
  8147. try
  8148. {
  8149. for(int i4 = 0; i4 < 20; i4++)
  8150. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8151. }
  8152. catch(Exception _ex) { }
  8153. try
  8154. {
  8155. for(int h1 = 0; h1 < 6; h1++)
  8156. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  8157. } catch(Exception _ex) { }
  8158. try {
  8159. for(int j4 = 0; j4 < 8; j4++)
  8160. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  8161. for(int j45 = 0; j45 < 3; j45++)
  8162. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  8163. }
  8164. catch(Exception _ex) { }
  8165. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8166. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8167. for(int k4 = 0; k4 < 8; k4++)
  8168. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8169. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8170. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8171. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8172. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8173. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8174. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  8175. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8176. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8177. for(int l4 = 0; l4 < 2; l4++)
  8178. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  8179. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8180. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8181. sprite.method346(0, 0);
  8182. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8183. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8184. sprite.method346(0, 0);
  8185. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  8186. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8187. sprite.method346(0, 0);
  8188. int i5 = (int)(Math.random() * 21D) - 10;
  8189. int j5 = (int)(Math.random() * 21D) - 10;
  8190. int k5 = (int)(Math.random() * 21D) - 10;
  8191. int l5 = (int)(Math.random() * 41D) - 20;
  8192. for(int i6 = 0; i6 < 100; i6++)
  8193. {
  8194. if(mapFunctions[i6] != null)
  8195. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8196. if(mapScenes[i6] != null)
  8197. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8198. }
  8199. drawLoadingText(83, "Unpacking textures");
  8200. Texture.method368(streamLoader_3);
  8201. Texture.method372(0.80000000000000004D);
  8202. Texture.method367();
  8203. drawLoadingText(86, "Unpacking config");
  8204. Animation.unpackConfig(streamLoader);
  8205. ObjectDef.unpackConfig(streamLoader);
  8206. Flo.unpackConfig(streamLoader);
  8207. ItemDef.unpackConfig(streamLoader);
  8208. EntityDef.unpackConfig(streamLoader);
  8209. IDK.unpackConfig(streamLoader);
  8210. SpotAnim.unpackConfig(streamLoader);
  8211. Varp.unpackConfig(streamLoader);
  8212. VarBit.unpackConfig(streamLoader);
  8213. ItemDef.isMembers = isMembers;
  8214. if(!lowMem)
  8215. {
  8216. drawLoadingText(90, "Unpacking sounds");
  8217. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  8218. Stream stream = new Stream(abyte0);
  8219. Sounds.unpack(stream);
  8220. }
  8221. drawLoadingText(95, "Unpacking interfaces");
  8222. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  8223. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  8224. };
  8225. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  8226. drawLoadingText(100, "Preparing game engine");
  8227. for(int j6 = 0; j6 < 33; j6++)
  8228. {
  8229. int k6 = 0;
  8230. int i7 = 0;
  8231. for(int k7 = 0; k7 < 34; k7++)
  8232. {
  8233. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  8234. {
  8235. if(k6 == 0)
  8236. k6 = k7;
  8237. continue;
  8238. }
  8239. if(k6 == 0)
  8240. continue;
  8241. i7 = k7;
  8242. break;
  8243. }
  8244. anIntArray968[j6] = k6;
  8245. anIntArray1057[j6] = i7 - k6;
  8246. }
  8247. for(int l6 = 5; l6 < 156; l6++)
  8248. {
  8249. int j7 = 999;
  8250. int l7 = 0;
  8251. for(int j8 = 20; j8 < 172; j8++)
  8252. {
  8253. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  8254. {
  8255. if(j7 == 999)
  8256. j7 = j8;
  8257. continue;
  8258. }
  8259. if(j7 == 999)
  8260. continue;
  8261. l7 = j8;
  8262. break;
  8263. }
  8264. anIntArray1052[l6 - 5] = j7 - 20;
  8265. anIntArray1229[l6 - 5] = l7 - j7;
  8266. if(anIntArray1229[l6 - 5] == -20)
  8267. anIntArray1229[l6 - 5] = 152;
  8268. }
  8269. Texture.method365(765, 503);
  8270. fullScreenTextureArray = Texture.anIntArray1472;
  8271. Texture.method365(519, 165);
  8272. anIntArray1180 = Texture.anIntArray1472;
  8273. Texture.method365(246, 335);
  8274. anIntArray1181 = Texture.anIntArray1472;
  8275. Texture.method365(512, 334);
  8276. anIntArray1182 = Texture.anIntArray1472;
  8277. int ai[] = new int[9];
  8278. for(int i8 = 0; i8 < 9; i8++)
  8279. {
  8280. int k8 = 128 + i8 * 32 + 15;
  8281. int l8 = 600 + k8 * 3;
  8282. int i9 = Texture.anIntArray1470[k8];
  8283. ai[i8] = l8 * i9 >> 16;
  8284. }
  8285. WorldController.method310(500, 800, 512, 334, ai);
  8286. Censor.loadConfig(streamLoader_4);
  8287. mouseDetection = new MouseDetection(this);
  8288. startRunnable(mouseDetection, 10);
  8289. Animable_Sub5.clientInstance = this;
  8290. ObjectDef.clientInstance = this;
  8291. EntityDef.clientInstance = this;
  8292. return;
  8293. }
  8294. catch(Exception exception)
  8295. {
  8296. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8297. }
  8298. loadingError = true;
  8299. }
  8300. private void method91(Stream stream, int i)
  8301. {
  8302. while(stream.bitPosition + 10 < i * 8)
  8303. {
  8304. int j = stream.readBits(11);
  8305. if(j == 2047)
  8306. break;
  8307. if(playerArray[j] == null)
  8308. {
  8309. playerArray[j] = new Player();
  8310. if(aStreamArray895s[j] != null)
  8311. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8312. }
  8313. playerIndices[playerCount++] = j;
  8314. Player player = playerArray[j];
  8315. player.anInt1537 = loopCycle;
  8316. int k = stream.readBits(1);
  8317. if(k == 1)
  8318. anIntArray894[anInt893++] = j;
  8319. int l = stream.readBits(1);
  8320. int i1 = stream.readBits(5);
  8321. if(i1 > 15)
  8322. i1 -= 32;
  8323. int j1 = stream.readBits(5);
  8324. if(j1 > 15)
  8325. j1 -= 32;
  8326. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  8327. }
  8328. stream.finishBitAccess();
  8329. }
  8330. private void processMainScreenClick() {
  8331. if(anInt1021 != 0)
  8332. return;
  8333. if(super.clickMode3 == 1) {
  8334. int x = isFullScreen ? extraWidth : 0;
  8335. int y = isFullScreen ? extraHeight : 0;
  8336. if (newMap && !isFullScreen) {
  8337. int i = super.saveClickX - 25 - 545;//545
  8338. int j = super.saveClickY - 5 - 4;
  8339. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  8340. i -= 73;
  8341. j -= 75;
  8342. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8343. int i1 = Texture.anIntArray1470[k];
  8344. int j1 = Texture.anIntArray1471[k];
  8345. i1 = i1 * (minimapInt3 + 256) >> 8;
  8346. j1 = j1 * (minimapInt3 + 256) >> 8;
  8347. int k1 = j * i1 + i * j1 >> 11;
  8348. int l1 = j * j1 - i * i1 >> 11;
  8349. int i2 = myPlayer.x + k1 >> 7;
  8350. int j2 = myPlayer.y - l1 >> 7;
  8351. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8352. if(flag1) {
  8353. stream.writeWordBigEndian(i);
  8354. stream.writeWordBigEndian(j);
  8355. stream.writeWord(minimapInt1);
  8356. stream.writeWordBigEndian(57);
  8357. stream.writeWordBigEndian(minimapInt2);
  8358. stream.writeWordBigEndian(minimapInt3);
  8359. stream.writeWordBigEndian(89);
  8360. stream.writeWord(myPlayer.x);
  8361. stream.writeWord(myPlayer.y);
  8362. stream.writeWordBigEndian(anInt1264);
  8363. stream.writeWordBigEndian(63);
  8364. }
  8365. }
  8366. }
  8367. if (!newMap && !isFullScreen) {
  8368. int x2 = isFullScreen ? 558 : 528;
  8369. int i = super.saveClickX - 25 - x2 - x;
  8370. int j = super.saveClickY - 5 - 4;
  8371. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  8372. i -= 73;
  8373. j -= 75;
  8374. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8375. int i1 = Texture.anIntArray1470[k];
  8376. int j1 = Texture.anIntArray1471[k];
  8377. i1 = i1 * (minimapInt3 + 256) >> 8;
  8378. j1 = j1 * (minimapInt3 + 256) >> 8;
  8379. int k1 = j * i1 + i * j1 >> 11;
  8380. int l1 = j * j1 - i * i1 >> 11;
  8381. int i2 = myPlayer.x + k1 >> 7;
  8382. int j2 = myPlayer.y - l1 >> 7;
  8383. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8384. if(flag1) {
  8385. stream.writeWordBigEndian(i);
  8386. stream.writeWordBigEndian(j);
  8387. stream.writeWord(minimapInt1);
  8388. stream.writeWordBigEndian(57);
  8389. stream.writeWordBigEndian(minimapInt2);
  8390. stream.writeWordBigEndian(minimapInt3);
  8391. stream.writeWordBigEndian(89);
  8392. stream.writeWord(myPlayer.x);
  8393. stream.writeWord(myPlayer.y);
  8394. stream.writeWordBigEndian(anInt1264);
  8395. stream.writeWordBigEndian(63);
  8396. }
  8397. }
  8398. }
  8399. if(isFullScreen) {
  8400. int x2 = isFullScreen ? 558 : 528;
  8401. int i = super.saveClickX - 25 - x2 - x;
  8402. int j = super.saveClickY - 5 - 4;
  8403. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  8404. i -= 73;
  8405. j -= 75;
  8406. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8407. int i1 = Texture.anIntArray1470[k];
  8408. int j1 = Texture.anIntArray1471[k];
  8409. i1 = i1 * (minimapInt3 + 256) >> 8;
  8410. j1 = j1 * (minimapInt3 + 256) >> 8;
  8411. int k1 = j * i1 + i * j1 >> 11;
  8412. int l1 = j * j1 - i * i1 >> 11;
  8413. int i2 = myPlayer.x + k1 >> 7;
  8414. int j2 = myPlayer.y - l1 >> 7;
  8415. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8416. if(flag1) {
  8417. stream.writeWordBigEndian(i);
  8418. stream.writeWordBigEndian(j);
  8419. stream.writeWord(minimapInt1);
  8420. stream.writeWordBigEndian(57);
  8421. stream.writeWordBigEndian(minimapInt2);
  8422. stream.writeWordBigEndian(minimapInt3);
  8423. stream.writeWordBigEndian(89);
  8424. stream.writeWord(myPlayer.x);
  8425. stream.writeWord(myPlayer.y);
  8426. stream.writeWordBigEndian(anInt1264);
  8427. stream.writeWordBigEndian(63);
  8428. }
  8429. }
  8430. }
  8431. anInt1117++;
  8432. if(anInt1117 > 1151) {
  8433. anInt1117 = 0;
  8434. stream.createFrame(246);
  8435. stream.writeWordBigEndian(0);
  8436. int l = stream.currentOffset;
  8437. if((int)(Math.random() * 2D) == 0)
  8438. stream.writeWordBigEndian(101);
  8439. stream.writeWordBigEndian(197);
  8440. stream.writeWord((int)(Math.random() * 65536D));
  8441. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8442. stream.writeWordBigEndian(67);
  8443. stream.writeWord(14214);
  8444. if((int)(Math.random() * 2D) == 0)
  8445. stream.writeWord(29487);
  8446. stream.writeWord((int)(Math.random() * 65536D));
  8447. if((int)(Math.random() * 2D) == 0)
  8448. stream.writeWordBigEndian(220);
  8449. stream.writeWordBigEndian(180);
  8450. stream.writeBytes(stream.currentOffset - l);
  8451. }
  8452. }
  8453. }
  8454. private String interfaceIntToString(int j) {
  8455. if(j < 0x3b9ac9ff)
  8456. return String.valueOf(j);
  8457. else
  8458. return "*";
  8459. }
  8460. private void showErrorScreen()
  8461. {
  8462. Graphics g = getGameComponent().getGraphics();
  8463. g.setColor(Color.black);
  8464. g.fillRect(0, 0, 765, 503);
  8465. method4(1);
  8466. if(loadingError)
  8467. {
  8468. aBoolean831 = false;
  8469. g.setFont(new Font("Helvetica", 1, 16));
  8470. g.setColor(Color.yellow);
  8471. int k = 35;
  8472. g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  8473. k += 50;
  8474. g.setColor(Color.white);
  8475. g.drawString("To fix this try the following (in order):", 30, k);
  8476. k += 50;
  8477. g.setColor(Color.white);
  8478. g.setFont(new Font("Helvetica", 1, 12));
  8479. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  8480. k += 30;
  8481. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  8482. k += 30;
  8483. g.drawString("3: Try using a different game-world", 30, k);
  8484. k += 30;
  8485. g.drawString("4: Try rebooting your computer", 30, k);
  8486. k += 30;
  8487. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  8488. }
  8489. if(genericLoadingError)
  8490. {
  8491. aBoolean831 = false;
  8492. g.setFont(new Font("Helvetica", 1, 20));
  8493. g.setColor(Color.white);
  8494. g.drawString("Error - unable to load game!", 50, 50);
  8495. g.drawString("To play RuneScape make sure you play from", 50, 100);
  8496. g.drawString("http://www.runescape.com", 50, 150);
  8497. }
  8498. if(rsAlreadyLoaded)
  8499. {
  8500. aBoolean831 = false;
  8501. g.setColor(Color.yellow);
  8502. int l = 35;
  8503. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  8504. l += 50;
  8505. g.setColor(Color.white);
  8506. g.drawString("To fix this try the following (in order):", 30, l);
  8507. l += 50;
  8508. g.setColor(Color.white);
  8509. g.setFont(new Font("Helvetica", 1, 12));
  8510. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  8511. l += 30;
  8512. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8513. l += 30;
  8514. }
  8515. }
  8516. public URL getCodeBase() {
  8517. try {
  8518. return new URL(server +":" + (80 + portOff));
  8519. } catch(Exception _ex) {
  8520. }
  8521. return null;
  8522. }
  8523. private void method95() {
  8524. for(int j = 0; j < npcCount; j++) {
  8525. int k = npcIndices[j];
  8526. NPC npc = npcArray[k];
  8527. if(npc != null)
  8528. method96(npc);
  8529. }
  8530. }
  8531. private void method96(Entity entity)
  8532. {
  8533. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  8534. {
  8535. entity.anim = -1;
  8536. entity.anInt1520 = -1;
  8537. entity.anInt1547 = 0;
  8538. entity.anInt1548 = 0;
  8539. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8540. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8541. entity.method446();
  8542. }
  8543. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  8544. {
  8545. entity.anim = -1;
  8546. entity.anInt1520 = -1;
  8547. entity.anInt1547 = 0;
  8548. entity.anInt1548 = 0;
  8549. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8550. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8551. entity.method446();
  8552. }
  8553. if(entity.anInt1547 > loopCycle)
  8554. method97(entity);
  8555. else
  8556. if(entity.anInt1548 >= loopCycle)
  8557. method98(entity);
  8558. else
  8559. method99(entity);
  8560. method100(entity);
  8561. method101(entity);
  8562. }
  8563. private void method97(Entity entity)
  8564. {
  8565. int i = entity.anInt1547 - loopCycle;
  8566. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8567. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8568. entity.x += (j - entity.x) / i;
  8569. entity.y += (k - entity.y) / i;
  8570. entity.anInt1503 = 0;
  8571. if(entity.anInt1549 == 0)
  8572. entity.turnDirection = 1024;
  8573. if(entity.anInt1549 == 1)
  8574. entity.turnDirection = 1536;
  8575. if(entity.anInt1549 == 2)
  8576. entity.turnDirection = 0;
  8577. if(entity.anInt1549 == 3)
  8578. entity.turnDirection = 512;
  8579. }
  8580. private void method98(Entity entity)
  8581. {
  8582. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  8583. {
  8584. int i = entity.anInt1548 - entity.anInt1547;
  8585. int j = loopCycle - entity.anInt1547;
  8586. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8587. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8588. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8589. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8590. entity.x = (k * (i - j) + i1 * j) / i;
  8591. entity.y = (l * (i - j) + j1 * j) / i;
  8592. }
  8593. entity.anInt1503 = 0;
  8594. if(entity.anInt1549 == 0)
  8595. entity.turnDirection = 1024;
  8596. if(entity.anInt1549 == 1)
  8597. entity.turnDirection = 1536;
  8598. if(entity.anInt1549 == 2)
  8599. entity.turnDirection = 0;
  8600. if(entity.anInt1549 == 3)
  8601. entity.turnDirection = 512;
  8602. entity.anInt1552 = entity.turnDirection;
  8603. }
  8604. private void method99(Entity entity)
  8605. {
  8606. entity.anInt1517 = entity.anInt1511;
  8607. if(entity.smallXYIndex == 0)
  8608. {
  8609. entity.anInt1503 = 0;
  8610. return;
  8611. }
  8612. if(entity.anim != -1 && entity.anInt1529 == 0)
  8613. {
  8614. Animation animation = Animation.anims[entity.anim];
  8615. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  8616. {
  8617. entity.anInt1503++;
  8618. return;
  8619. }
  8620. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  8621. {
  8622. entity.anInt1503++;
  8623. return;
  8624. }
  8625. }
  8626. int i = entity.x;
  8627. int j = entity.y;
  8628. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8629. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8630. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  8631. {
  8632. entity.x = k;
  8633. entity.y = l;
  8634. return;
  8635. }
  8636. if(i < k)
  8637. {
  8638. if(j < l)
  8639. entity.turnDirection = 1280;
  8640. else
  8641. if(j > l)
  8642. entity.turnDirection = 1792;
  8643. else
  8644. entity.turnDirection = 1536;
  8645. } else
  8646. if(i > k)
  8647. {
  8648. if(j < l)
  8649. entity.turnDirection = 768;
  8650. else
  8651. if(j > l)
  8652. entity.turnDirection = 256;
  8653. else
  8654. entity.turnDirection = 512;
  8655. } else
  8656. if(j < l)
  8657. entity.turnDirection = 1024;
  8658. else
  8659. entity.turnDirection = 0;
  8660. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8661. if(i1 > 1024)
  8662. i1 -= 2048;
  8663. int j1 = entity.anInt1555;
  8664. if(i1 >= -256 && i1 <= 256)
  8665. j1 = entity.anInt1554;
  8666. else
  8667. if(i1 >= 256 && i1 < 768)
  8668. j1 = entity.anInt1557;
  8669. else
  8670. if(i1 >= -768 && i1 <= -256)
  8671. j1 = entity.anInt1556;
  8672. if(j1 == -1)
  8673. j1 = entity.anInt1554;
  8674. entity.anInt1517 = j1;
  8675. int k1 = 4;
  8676. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8677. k1 = 2;
  8678. if(entity.smallXYIndex > 2)
  8679. k1 = 6;
  8680. if(entity.smallXYIndex > 3)
  8681. k1 = 8;
  8682. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  8683. {
  8684. k1 = 8;
  8685. entity.anInt1503--;
  8686. }
  8687. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8688. k1 <<= 1;
  8689. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8690. entity.anInt1517 = entity.anInt1505;
  8691. if(i < k)
  8692. {
  8693. entity.x += k1;
  8694. if(entity.x > k)
  8695. entity.x = k;
  8696. } else
  8697. if(i > k)
  8698. {
  8699. entity.x -= k1;
  8700. if(entity.x < k)
  8701. entity.x = k;
  8702. }
  8703. if(j < l)
  8704. {
  8705. entity.y += k1;
  8706. if(entity.y > l)
  8707. entity.y = l;
  8708. } else
  8709. if(j > l)
  8710. {
  8711. entity.y -= k1;
  8712. if(entity.y < l)
  8713. entity.y = l;
  8714. }
  8715. if(entity.x == k && entity.y == l)
  8716. {
  8717. entity.smallXYIndex--;
  8718. if(entity.anInt1542 > 0)
  8719. entity.anInt1542--;
  8720. }
  8721. }
  8722. private void method100(Entity entity)
  8723. {
  8724. if(entity.anInt1504 == 0)
  8725. return;
  8726. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8727. {
  8728. NPC npc = npcArray[entity.interactingEntity];
  8729. if(npc != null)
  8730. {
  8731. int i1 = entity.x - npc.x;
  8732. int k1 = entity.y - npc.y;
  8733. if(i1 != 0 || k1 != 0)
  8734. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8735. }
  8736. }
  8737. if(entity.interactingEntity >= 32768)
  8738. {
  8739. int j = entity.interactingEntity - 32768;
  8740. if(j == unknownInt10)
  8741. j = myPlayerIndex;
  8742. Player player = playerArray[j];
  8743. if(player != null)
  8744. {
  8745. int l1 = entity.x - player.x;
  8746. int i2 = entity.y - player.y;
  8747. if(l1 != 0 || i2 != 0)
  8748. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8749. }
  8750. }
  8751. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8752. {
  8753. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8754. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8755. if(k != 0 || j1 != 0)
  8756. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8757. entity.anInt1538 = 0;
  8758. entity.anInt1539 = 0;
  8759. }
  8760. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8761. if(l != 0)
  8762. {
  8763. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8764. entity.anInt1552 = entity.turnDirection;
  8765. else
  8766. if(l > 1024)
  8767. entity.anInt1552 -= entity.anInt1504;
  8768. else
  8769. entity.anInt1552 += entity.anInt1504;
  8770. entity.anInt1552 &= 0x7ff;
  8771. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8772. {
  8773. if(entity.anInt1512 != -1)
  8774. {
  8775. entity.anInt1517 = entity.anInt1512;
  8776. return;
  8777. }
  8778. entity.anInt1517 = entity.anInt1554;
  8779. }
  8780. }
  8781. }
  8782. private void method101(Entity entity)
  8783. {
  8784. entity.aBoolean1541 = false;
  8785. if(entity.anInt1517 != -1)
  8786. {
  8787. Animation animation = Animation.anims[entity.anInt1517];
  8788. entity.anInt1519++;
  8789. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8790. {
  8791. entity.anInt1519 = 0;
  8792. entity.anInt1518++;
  8793. }
  8794. if(entity.anInt1518 >= animation.anInt352)
  8795. {
  8796. entity.anInt1519 = 0;
  8797. entity.anInt1518 = 0;
  8798. }
  8799. }
  8800. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8801. {
  8802. if(entity.anInt1521 < 0)
  8803. entity.anInt1521 = 0;
  8804. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8805. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8806. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8807. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8808. entity.anInt1520 = -1;
  8809. }
  8810. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8811. {
  8812. Animation animation_2 = Animation.anims[entity.anim];
  8813. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8814. {
  8815. entity.anInt1529 = 1;
  8816. return;
  8817. }
  8818. }
  8819. if(entity.anim != -1 && entity.anInt1529 == 0)
  8820. {
  8821. Animation animation_3 = Animation.anims[entity.anim];
  8822. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8823. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8824. if(entity.anInt1527 >= animation_3.anInt352)
  8825. {
  8826. entity.anInt1527 -= animation_3.anInt356;
  8827. entity.anInt1530++;
  8828. if(entity.anInt1530 >= animation_3.anInt362)
  8829. entity.anim = -1;
  8830. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8831. entity.anim = -1;
  8832. }
  8833. entity.aBoolean1541 = animation_3.aBoolean358;
  8834. }
  8835. if(entity.anInt1529 > 0)
  8836. entity.anInt1529--;
  8837. }
  8838. private void drawGameScreen()
  8839. {
  8840. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8841. if (loadingStage == 2) {
  8842. method119(anInt945, fullscreenInterfaceID);
  8843. if (openInterfaceID != -1) {
  8844. method119(anInt945, openInterfaceID);
  8845. }
  8846. anInt945 = 0;
  8847. resetAllImageProducers();
  8848. super.fullGameScreen.initDrawingArea();
  8849. Texture.anIntArray1472 = fullScreenTextureArray;
  8850. DrawingArea.setAllPixelsToZero();
  8851. welcomeScreenRaised = true;
  8852. if (openInterfaceID != -1) {
  8853. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8854. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8855. rsInterface_1.width = 765;
  8856. rsInterface_1.height = 503;
  8857. }
  8858. drawInterface(0, 0, rsInterface_1, 8);
  8859. }
  8860. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8861. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8862. rsInterface.width = 765;
  8863. rsInterface.height = 503;
  8864. }
  8865. drawInterface(0, 0, rsInterface, 8);
  8866. if (!menuOpen) {
  8867. processRightClick();
  8868. drawTooltip();
  8869. } else {
  8870. drawMenu();
  8871. }
  8872. }
  8873. drawCount++;
  8874. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8875. return;
  8876. } else {
  8877. if (drawCount != 0) {
  8878. resetImageProducers2();
  8879. }
  8880. }
  8881. if(welcomeScreenRaised) {
  8882. welcomeScreenRaised = false;
  8883. if (!isFullScreen) {
  8884. topFrame.drawGraphics(0, super.graphics, 0);
  8885. leftFrame.drawGraphics(4, super.graphics, 0);
  8886. rightFrame.drawGraphics(4, super.graphics, 516);
  8887. }
  8888. needDrawTabArea = true;
  8889. inputTaken = true;
  8890. tabAreaAltered = true;
  8891. aBoolean1233 = true;
  8892. if(loadingStage != 2) {
  8893. aRSImageProducer_1165.drawGraphics(isFullScreen ? 0 : 4, super.graphics, isFullScreen ? 0 : 4);
  8894. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8895. }
  8896. }
  8897. if(menuOpen && menuScreenArea == 1)
  8898. needDrawTabArea = true;
  8899. if(invOverlayInterfaceID != -1)
  8900. {
  8901. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8902. if(flag1)
  8903. needDrawTabArea = true;
  8904. }
  8905. if(atInventoryInterfaceType == 2)
  8906. needDrawTabArea = true;
  8907. if(activeInterfaceType == 2)
  8908. needDrawTabArea = true;
  8909. if(needDrawTabArea)
  8910. {
  8911. if (!isFullScreen)
  8912. drawTabArea();
  8913. needDrawTabArea = false;
  8914. }
  8915. if(backDialogID == -1)
  8916. {
  8917. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8918. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8919. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8920. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8921. if(i < 0)
  8922. i = 0;
  8923. if(i > anInt1211 - 110)
  8924. i = anInt1211 - 110;
  8925. if(anInt1089 != i)
  8926. {
  8927. anInt1089 = i;
  8928. inputTaken = true;
  8929. }
  8930. }
  8931. if(backDialogID != -1) {
  8932. boolean flag2 = method119(anInt945, backDialogID);
  8933. if(flag2)
  8934. inputTaken = true;
  8935. }
  8936. if(atInventoryInterfaceType == 3)
  8937. inputTaken = true;
  8938. if(activeInterfaceType == 3)
  8939. inputTaken = true;
  8940. if(aString844 != null)
  8941. inputTaken = true;
  8942. if(menuOpen && menuScreenArea == 2)
  8943. inputTaken = true;
  8944. if(inputTaken && !isFullScreen) {
  8945. try {
  8946. drawChatArea();
  8947. } catch(Exception e) {
  8948. e.printStackTrace();
  8949. }
  8950. inputTaken = false;
  8951. }
  8952. if(loadingStage == 2)
  8953. try {
  8954. method146();
  8955. } catch(Exception e) {
  8956. }
  8957. if(loadingStage == 2 && !isFullScreen) {
  8958. drawMinimap();
  8959. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8960. }
  8961. if(anInt1054 != -1)
  8962. tabAreaAltered = true;
  8963. if(tabAreaAltered)
  8964. {
  8965. if(anInt1054 != -1 && anInt1054 == tabID)
  8966. {
  8967. anInt1054 = -1;
  8968. stream.createFrame(120);
  8969. stream.writeWordBigEndian(tabID);
  8970. }
  8971. tabAreaAltered = false;
  8972. aRSImageProducer_1125.initDrawingArea();
  8973. aRSImageProducer_1165.initDrawingArea();
  8974. }
  8975. anInt945 = 0;
  8976. }
  8977. private boolean buildFriendsListMenu(RSInterface class9)
  8978. {
  8979. int i = class9.contentType;
  8980. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8981. {
  8982. if(i >= 801)
  8983. i -= 701;
  8984. else
  8985. if(i >= 701)
  8986. i -= 601;
  8987. else
  8988. if(i >= 101)
  8989. i -= 101;
  8990. else
  8991. i--;
  8992. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8993. menuActionID[menuActionRow] = 792;
  8994. menuActionRow++;
  8995. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8996. menuActionID[menuActionRow] = 639;
  8997. menuActionRow++;
  8998. return true;
  8999. }
  9000. if(i >= 401 && i <= 500)
  9001. {
  9002. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  9003. menuActionID[menuActionRow] = 322;
  9004. menuActionRow++;
  9005. return true;
  9006. } else
  9007. {
  9008. return false;
  9009. }
  9010. }
  9011. private void method104()
  9012. {
  9013. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  9014. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  9015. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  9016. class30_sub2_sub4_sub3.unlink();
  9017. else
  9018. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  9019. {
  9020. class30_sub2_sub4_sub3.method454(anInt945);
  9021. if(class30_sub2_sub4_sub3.aBoolean1567)
  9022. class30_sub2_sub4_sub3.unlink();
  9023. else
  9024. worldController.method285(class30_sub2_sub4_sub3.anInt1560, 0, class30_sub2_sub4_sub3.anInt1563, -1, class30_sub2_sub4_sub3.anInt1562, 60, class30_sub2_sub4_sub3.anInt1561, class30_sub2_sub4_sub3, false);
  9025. }
  9026. }
  9027. public void drawBlackBox(int xPos, int yPos) {
  9028. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  9029. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  9030. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  9031. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  9032. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  9033. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  9034. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  9035. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  9036. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  9037. }
  9038. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9039. if(class9.type != 0 || class9.children == null)
  9040. return;
  9041. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  9042. return;
  9043. int i1 = DrawingArea.topX;
  9044. int j1 = DrawingArea.topY;
  9045. int k1 = DrawingArea.bottomX;
  9046. int l1 = DrawingArea.bottomY;
  9047. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9048. int i2 = class9.children.length;
  9049. for(int j2 = 0; j2 < i2; j2++) {
  9050. int k2 = class9.childX[j2] + k;
  9051. int l2 = (class9.childY[j2] + l) - j;
  9052. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9053. k2 += class9_1.anInt263;
  9054. l2 += class9_1.anInt265;
  9055. if(class9_1.contentType > 0)
  9056. drawFriendsListOrWelcomeScreen(class9_1);
  9057. //here
  9058. int[] IDs = {
  9059. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  9060. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  9061. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  9062. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  9063. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  9064. /* Ancients */
  9065. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  9066. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9067. };
  9068. for(int m5 = 0; m5 < IDs.length; m5++) {
  9069. if(class9_1.id == IDs[m5] + 1) {
  9070. if(m5 > 61)
  9071. drawBlackBox(k2 + 1, l2);
  9072. else
  9073. drawBlackBox(k2, l2 + 1);
  9074. }
  9075. }
  9076. int[] runeChildren = {
  9077. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  9078. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  9079. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  9080. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  9081. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  9082. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  9083. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  9084. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  9085. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  9086. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  9087. 15885, 18474, 18475, 18478
  9088. };
  9089. for(int r = 0; r < runeChildren.length; r++)
  9090. if(class9_1.id == runeChildren[r])
  9091. class9_1.modelZoom = 775;
  9092. if(class9_1.type == 0) {
  9093. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  9094. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  9095. if(class9_1.scrollPosition < 0)
  9096. class9_1.scrollPosition = 0;
  9097. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9098. if(class9_1.scrollMax > class9_1.height)
  9099. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  9100. } else if(class9_1.type != 1)
  9101. if(class9_1.type == 2) {
  9102. int i3 = 0;
  9103. for(int l3 = 0; l3 < class9_1.height; l3++) {
  9104. for(int l4 = 0; l4 < class9_1.width; l4++) {
  9105. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9106. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9107. if(i3 < 20) {
  9108. k5 += class9_1.spritesX[i3];
  9109. j6 += class9_1.spritesY[i3];
  9110. }
  9111. if(class9_1.inv[i3] > 0) {
  9112. int k6 = 0;
  9113. int j7 = 0;
  9114. int j9 = class9_1.inv[i3] - 1;
  9115. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  9116. int l9 = 0;
  9117. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  9118. l9 = 0xffffff;
  9119. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  9120. if(class30_sub2_sub1_sub1_2 != null) {
  9121. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  9122. k6 = super.mouseX - anInt1087;
  9123. j7 = super.mouseY - anInt1088;
  9124. if(k6 < 5 && k6 > -5)
  9125. k6 = 0;
  9126. if(j7 < 5 && j7 > -5)
  9127. j7 = 0;
  9128. if(anInt989 < 5) {
  9129. k6 = 0;
  9130. j7 = 0;
  9131. }
  9132. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  9133. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  9134. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9135. if(i10 > anInt945 * 10)
  9136. i10 = anInt945 * 10;
  9137. if(i10 > class9.scrollPosition)
  9138. i10 = class9.scrollPosition;
  9139. class9.scrollPosition -= i10;
  9140. anInt1088 += i10;
  9141. }
  9142. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9143. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9144. if(j10 > anInt945 * 10)
  9145. j10 = anInt945 * 10;
  9146. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9147. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9148. class9.scrollPosition += j10;
  9149. anInt1088 -= j10;
  9150. }
  9151. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9152. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  9153. else
  9154. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  9155. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  9156. {
  9157. int k10 = class9_1.invStackSizes[i3];
  9158. if(k10 >= 1)
  9159. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9160. if(k10 >= 100000)
  9161. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9162. if(k10 >= 10000000)
  9163. smallText.method385(0x49E20E, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9164. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  9165. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  9166. }
  9167. }
  9168. }
  9169. } else if(class9_1.sprites != null && i3 < 20) {
  9170. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9171. if(class30_sub2_sub1_sub1_1 != null)
  9172. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9173. }
  9174. i3++;
  9175. }
  9176. }
  9177. } else if(class9_1.type == 3) {
  9178. boolean flag = false;
  9179. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9180. flag = true;
  9181. int j3;
  9182. if(interfaceIsSelected(class9_1)) {
  9183. j3 = class9_1.anInt219;
  9184. if(flag && class9_1.anInt239 != 0)
  9185. j3 = class9_1.anInt239;
  9186. } else {
  9187. j3 = class9_1.textColor;
  9188. if(flag && class9_1.anInt216 != 0)
  9189. j3 = class9_1.anInt216;
  9190. }
  9191. if(class9_1.aByte254 == 0) {
  9192. if(class9_1.aBoolean227)
  9193. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  9194. else
  9195. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  9196. } else if(class9_1.aBoolean227)
  9197. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  9198. else
  9199. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  9200. } else if(class9_1.type == 4) {
  9201. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9202. String s = class9_1.message;
  9203. boolean flag1 = false;
  9204. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9205. flag1 = true;
  9206. int i4;
  9207. if(interfaceIsSelected(class9_1)) {
  9208. i4 = class9_1.anInt219;
  9209. if(flag1 && class9_1.anInt239 != 0)
  9210. i4 = class9_1.anInt239;
  9211. if(class9_1.aString228.length() > 0)
  9212. s = class9_1.aString228;
  9213. } else {
  9214. i4 = class9_1.textColor;
  9215. if(flag1 && class9_1.anInt216 != 0)
  9216. i4 = class9_1.anInt216;
  9217. }
  9218. if(class9_1.atActionType == 6 && aBoolean1149) {
  9219. s = "Please wait...";
  9220. i4 = class9_1.textColor;
  9221. }
  9222. if(DrawingArea.width == 519) {
  9223. if(i4 == 0xffff00)
  9224. i4 = 255;
  9225. if(i4 == 49152)
  9226. i4 = 0xffffff;
  9227. }
  9228. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9229. switch (i4) {
  9230. case 16773120: i4 = 0xFE981F; break;
  9231. case 7040819: i4 = 0xAF6A1A; break;
  9232. }
  9233. }
  9234. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  9235. {
  9236. if(s.indexOf("%") != -1)
  9237. {
  9238. do
  9239. {
  9240. int k7 = s.indexOf("%1");
  9241. if(k7 == -1)
  9242. break;
  9243. if(class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id !=13921 && class9_1.id !=13922 && class9_1.id !=12171 && class9_1.id !=12172)
  9244. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9245. else
  9246. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9247. } while(true);
  9248. do
  9249. {
  9250. int l7 = s.indexOf("%2");
  9251. if(l7 == -1)
  9252. break;
  9253. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  9254. } while(true);
  9255. do
  9256. {
  9257. int i8 = s.indexOf("%3");
  9258. if(i8 == -1)
  9259. break;
  9260. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  9261. } while(true);
  9262. do
  9263. {
  9264. int j8 = s.indexOf("%4");
  9265. if(j8 == -1)
  9266. break;
  9267. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  9268. } while(true);
  9269. do
  9270. {
  9271. int k8 = s.indexOf("%5");
  9272. if(k8 == -1)
  9273. break;
  9274. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  9275. } while(true);
  9276. }
  9277. int l8 = s.indexOf("\\n");
  9278. String s1;
  9279. if(l8 != -1)
  9280. {
  9281. s1 = s.substring(0, l8);
  9282. s = s.substring(l8 + 2);
  9283. } else
  9284. {
  9285. s1 = s;
  9286. s = "";
  9287. }
  9288. if(class9_1.centerText)
  9289. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  9290. else
  9291. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  9292. }
  9293. } else if(class9_1.type == 5) {
  9294. //whats this?
  9295. Sprite sprite;
  9296. if(interfaceIsSelected(class9_1))
  9297. sprite = class9_1.sprite2;
  9298. else
  9299. sprite = class9_1.sprite1;
  9300. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  9301. sprite.drawSprite(k2, l2, 0xffffff);
  9302. } else {
  9303. if (sprite != null)
  9304. sprite.drawSprite(k2, l2);
  9305. }
  9306. if(sprite != null)
  9307. sprite.drawSprite(k2, l2);
  9308. } else if(class9_1.type == 6) {
  9309. int k3 = Texture.textureInt1;
  9310. int j4 = Texture.textureInt2;
  9311. Texture.textureInt1 = k2 + class9_1.width / 2;
  9312. Texture.textureInt2 = l2 + class9_1.height / 2;
  9313. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9314. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9315. boolean flag2 = interfaceIsSelected(class9_1);
  9316. int i7;
  9317. if(flag2)
  9318. i7 = class9_1.anInt258;
  9319. else
  9320. i7 = class9_1.anInt257;
  9321. Model model;
  9322. if(i7 == -1) {
  9323. model = class9_1.method209(-1, -1, flag2);
  9324. } else {
  9325. Animation animation = Animation.anims[i7];
  9326. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  9327. }
  9328. if(model != null)
  9329. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  9330. Texture.textureInt1 = k3;
  9331. Texture.textureInt2 = j4;
  9332. } else if(class9_1.type == 7) {
  9333. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9334. int k4 = 0;
  9335. for(int j5 = 0; j5 < class9_1.height; j5++) {
  9336. for(int i6 = 0; i6 < class9_1.width; i6++) {
  9337. if(class9_1.inv[k4] > 0) {
  9338. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  9339. String s2 = itemDef.name;
  9340. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  9341. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9342. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  9343. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  9344. if(class9_1.centerText)
  9345. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  9346. else
  9347. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  9348. }
  9349. k4++;
  9350. }
  9351. }
  9352. } else if (class9_1.type == 8) {
  9353. drawHoverBox(k2, l2, class9_1.popupString);
  9354. }
  9355. }
  9356. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9357. }
  9358. private void randomizeBackground(Background background) {
  9359. int j = 256;
  9360. for(int k = 0; k < anIntArray1190.length; k++)
  9361. anIntArray1190[k] = 0;
  9362. for(int l = 0; l < 5000; l++) {
  9363. int i1 = (int)(Math.random() * 128D * (double)j);
  9364. anIntArray1190[i1] = (int)(Math.random() * 256D);
  9365. }
  9366. for(int j1 = 0; j1 < 20; j1++) {
  9367. for(int k1 = 1; k1 < j - 1; k1++) {
  9368. for(int i2 = 1; i2 < 127; i2++) {
  9369. int k2 = i2 + (k1 << 7);
  9370. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9371. }
  9372. }
  9373. int ai[] = anIntArray1190;
  9374. anIntArray1190 = anIntArray1191;
  9375. anIntArray1191 = ai;
  9376. }
  9377. if(background != null) {
  9378. int l1 = 0;
  9379. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  9380. for(int l2 = 0; l2 < background.anInt1452; l2++)
  9381. if(background.aByteArray1450[l1++] != 0) {
  9382. int i3 = l2 + 16 + background.anInt1454;
  9383. int j3 = j2 + 16 + background.anInt1455;
  9384. int k3 = i3 + (j3 << 7);
  9385. anIntArray1190[k3] = 0;
  9386. }
  9387. }
  9388. }
  9389. }
  9390. private void method107(int i, int j, Stream stream, Player player)
  9391. {
  9392. if((i & 0x400) != 0)
  9393. {
  9394. player.anInt1543 = stream.method428();
  9395. player.anInt1545 = stream.method428();
  9396. player.anInt1544 = stream.method428();
  9397. player.anInt1546 = stream.method428();
  9398. player.anInt1547 = stream.method436() + loopCycle;
  9399. player.anInt1548 = stream.method435() + loopCycle;
  9400. player.anInt1549 = stream.method428();
  9401. player.method446();
  9402. }
  9403. if((i & 0x100) != 0)
  9404. {
  9405. player.anInt1520 = stream.method434();
  9406. int k = stream.readDWord();
  9407. player.anInt1524 = k >> 16;
  9408. player.anInt1523 = loopCycle + (k & 0xffff);
  9409. player.anInt1521 = 0;
  9410. player.anInt1522 = 0;
  9411. if(player.anInt1523 > loopCycle)
  9412. player.anInt1521 = -1;
  9413. if(player.anInt1520 == 65535)
  9414. player.anInt1520 = -1;
  9415. }
  9416. if((i & 8) != 0)
  9417. {
  9418. int l = stream.method434();
  9419. if(l == 65535)
  9420. l = -1;
  9421. int i2 = stream.method427();
  9422. if(l == player.anim && l != -1)
  9423. {
  9424. int i3 = Animation.anims[l].anInt365;
  9425. if(i3 == 1)
  9426. {
  9427. player.anInt1527 = 0;
  9428. player.anInt1528 = 0;
  9429. player.anInt1529 = i2;
  9430. player.anInt1530 = 0;
  9431. }
  9432. if(i3 == 2)
  9433. player.anInt1530 = 0;
  9434. } else
  9435. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  9436. {
  9437. player.anim = l;
  9438. player.anInt1527 = 0;
  9439. player.anInt1528 = 0;
  9440. player.anInt1529 = i2;
  9441. player.anInt1530 = 0;
  9442. player.anInt1542 = player.smallXYIndex;
  9443. }
  9444. }
  9445. if((i & 4) != 0)
  9446. {
  9447. player.textSpoken = stream.readString();
  9448. if(player.textSpoken.charAt(0) == '~')
  9449. {
  9450. player.textSpoken = player.textSpoken.substring(1);
  9451. pushMessage(player.textSpoken, 2, player.name);
  9452. } else
  9453. if(player == myPlayer)
  9454. pushMessage(player.textSpoken, 2, player.name);
  9455. player.anInt1513 = 0;
  9456. player.anInt1531 = 0;
  9457. player.textCycle = 150;
  9458. }
  9459. if((i & 0x80) != 0)
  9460. {
  9461. //right fucking here
  9462. int i1 = stream.method434();
  9463. int j2 = stream.readUnsignedByte();
  9464. int j3 = stream.method427();
  9465. int k3 = stream.currentOffset;
  9466. if(player.name != null && player.visible)
  9467. {
  9468. long l3 = TextClass.longForName(player.name);
  9469. boolean flag = false;
  9470. if(j2 <= 1)
  9471. {
  9472. for(int i4 = 0; i4 < ignoreCount; i4++)
  9473. {
  9474. if(ignoreListAsLongs[i4] != l3)
  9475. continue;
  9476. flag = true;
  9477. break;
  9478. }
  9479. }
  9480. if(!flag && anInt1251 == 0)
  9481. try
  9482. {
  9483. aStream_834.currentOffset = 0;
  9484. stream.method442(j3, 0, aStream_834.buffer);
  9485. aStream_834.currentOffset = 0;
  9486. String s = TextInput.method525(j3, aStream_834);
  9487. //s = Censor.doCensor(s);
  9488. player.textSpoken = s;
  9489. player.anInt1513 = i1 >> 8;
  9490. player.privelage = j2;
  9491. player.anInt1531 = i1 & 0xff;
  9492. player.textCycle = 150;
  9493. if(j2 == 2 || j2 == 3)
  9494. pushMessage(s, 1, "@cr2@" + player.name);
  9495. else if(j2 == 1)
  9496. pushMessage(s, 1, "@cr1@" + player.name);
  9497. else
  9498. pushMessage(s, 2, player.name);
  9499. }
  9500. catch(Exception exception)
  9501. {
  9502. signlink.reporterror("cde2");
  9503. }
  9504. }
  9505. stream.currentOffset = k3 + j3;
  9506. }
  9507. if((i & 1) != 0)
  9508. {
  9509. player.interactingEntity = stream.method434();
  9510. if(player.interactingEntity == 65535)
  9511. player.interactingEntity = -1;
  9512. }
  9513. if((i & 0x10) != 0)
  9514. {
  9515. int j1 = stream.method427();
  9516. byte abyte0[] = new byte[j1];
  9517. Stream stream_1 = new Stream(abyte0);
  9518. stream.readBytes(j1, 0, abyte0);
  9519. aStreamArray895s[j] = stream_1;
  9520. player.updatePlayer(stream_1);
  9521. }
  9522. if((i & 2) != 0)
  9523. {
  9524. player.anInt1538 = stream.method436();
  9525. player.anInt1539 = stream.method434();
  9526. }
  9527. if((i & 0x20) != 0)
  9528. {
  9529. int k1 = stream.readUnsignedByte();
  9530. int k2 = stream.method426();
  9531. player.updateHitData(k2, k1, loopCycle);
  9532. player.loopCycleStatus = loopCycle + 300;
  9533. player.currentHealth = stream.method427();
  9534. player.maxHealth = stream.readUnsignedByte();
  9535. }
  9536. if((i & 0x200) != 0)
  9537. {
  9538. int l1 = stream.readUnsignedByte();
  9539. int l2 = stream.method428();
  9540. player.updateHitData(l2, l1, loopCycle);
  9541. player.loopCycleStatus = loopCycle + 300;
  9542. player.currentHealth = stream.readUnsignedByte();
  9543. player.maxHealth = stream.method427();
  9544. }
  9545. }
  9546. private void method108()
  9547. {
  9548. try
  9549. {
  9550. int j = myPlayer.x + anInt1278;
  9551. int k = myPlayer.y + anInt1131;
  9552. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  9553. {
  9554. anInt1014 = j;
  9555. anInt1015 = k;
  9556. }
  9557. if(anInt1014 != j)
  9558. anInt1014 += (j - anInt1014) / 16;
  9559. if(anInt1015 != k)
  9560. anInt1015 += (k - anInt1015) / 16;
  9561. if(super.keyArray[1] == 1)
  9562. anInt1186 += (-24 - anInt1186) / 2;
  9563. else
  9564. if(super.keyArray[2] == 1)
  9565. anInt1186 += (24 - anInt1186) / 2;
  9566. else
  9567. anInt1186 /= 2;
  9568. if(super.keyArray[3] == 1)
  9569. anInt1187 += (12 - anInt1187) / 2;
  9570. else
  9571. if(super.keyArray[4] == 1)
  9572. anInt1187 += (-12 - anInt1187) / 2;
  9573. else
  9574. anInt1187 /= 2;
  9575. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  9576. anInt1184 += anInt1187 / 2;
  9577. if(anInt1184 < 128)
  9578. anInt1184 = 128;
  9579. if(anInt1184 > 383)
  9580. anInt1184 = 383;
  9581. int l = anInt1014 >> 7;
  9582. int i1 = anInt1015 >> 7;
  9583. int j1 = method42(plane, anInt1015, anInt1014);
  9584. int k1 = 0;
  9585. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  9586. {
  9587. for(int l1 = l - 4; l1 <= l + 4; l1++)
  9588. {
  9589. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  9590. {
  9591. int l2 = plane;
  9592. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9593. l2++;
  9594. int i3 = j1 - intGroundArray[l2][l1][k2];
  9595. if(i3 > k1)
  9596. k1 = i3;
  9597. }
  9598. }
  9599. }
  9600. anInt1005++;
  9601. if(anInt1005 > 1512)
  9602. {
  9603. anInt1005 = 0;
  9604. stream.createFrame(77);
  9605. stream.writeWordBigEndian(0);
  9606. int i2 = stream.currentOffset;
  9607. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9608. stream.writeWordBigEndian(101);
  9609. stream.writeWordBigEndian(233);
  9610. stream.writeWord(45092);
  9611. if((int)(Math.random() * 2D) == 0)
  9612. stream.writeWord(35784);
  9613. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9614. stream.writeWordBigEndian(64);
  9615. stream.writeWordBigEndian(38);
  9616. stream.writeWord((int)(Math.random() * 65536D));
  9617. stream.writeWord((int)(Math.random() * 65536D));
  9618. stream.writeBytes(stream.currentOffset - i2);
  9619. }
  9620. int j2 = k1 * 192;
  9621. if(j2 > 0x17f00)
  9622. j2 = 0x17f00;
  9623. if(j2 < 32768)
  9624. j2 = 32768;
  9625. if(j2 > anInt984)
  9626. {
  9627. anInt984 += (j2 - anInt984) / 24;
  9628. return;
  9629. }
  9630. if(j2 < anInt984)
  9631. {
  9632. anInt984 += (j2 - anInt984) / 80;
  9633. }
  9634. }
  9635. catch(Exception _ex)
  9636. {
  9637. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  9638. throw new RuntimeException("eek");
  9639. }
  9640. }
  9641. public void processDrawing()
  9642. {
  9643. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  9644. {
  9645. showErrorScreen();
  9646. return;
  9647. }
  9648. anInt1061++;
  9649. if(!loggedIn)
  9650. drawLoginScreen(false);
  9651. else
  9652. drawGameScreen();
  9653. anInt1213 = 0;
  9654. }
  9655. private boolean isFriendOrSelf(String s)
  9656. {
  9657. if(s == null)
  9658. return false;
  9659. for(int i = 0; i < friendsCount; i++)
  9660. if(s.equalsIgnoreCase(friendsList[i]))
  9661. return true;
  9662. return s.equalsIgnoreCase(myPlayer.name);
  9663. }
  9664. private static String combatDiffColor(int i, int j)
  9665. {
  9666. int k = i - j;
  9667. if(k < -9)
  9668. return "@red@";
  9669. if(k < -6)
  9670. return "@or3@";
  9671. if(k < -3)
  9672. return "@or2@";
  9673. if(k < 0)
  9674. return "@or1@";
  9675. if(k > 9)
  9676. return "@gre@";
  9677. if(k > 6)
  9678. return "@gr3@";
  9679. if(k > 3)
  9680. return "@gr2@";
  9681. if(k > 0)
  9682. return "@gr1@";
  9683. else
  9684. return "@yel@";
  9685. }
  9686. private void setWaveVolume(int i)
  9687. {
  9688. signlink.wavevol = i;
  9689. }
  9690. private void draw3dScreen()
  9691. {
  9692. int xs = isFullScreen ? extraWidth+200 : 0;
  9693. int ys = isFullScreen ? extraHeight-200 : 0;
  9694. int xPo3s = isFullScreen ? (clientWidth / 2) - 256 : 0;
  9695. int yPo3s = isFullScreen ? (clientHeight / 2) - 167 : 0;
  9696. int xs2 = isFullScreen ? 200+extraWidth : 0;
  9697. int ys2 = isFullScreen ? extraHeight-450 : 0;
  9698. drawSplitPrivateChat();
  9699. if(crossType == 1)
  9700. {
  9701. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9702. anInt1142++;
  9703. if(anInt1142 > 67)
  9704. {
  9705. anInt1142 = 0;
  9706. stream.createFrame(78);
  9707. }
  9708. }
  9709. if(crossType == 2)
  9710. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9711. if(anInt1018 != -1 && anInt1018 != 21119 && anInt1018 != 21100)
  9712. {
  9713. method119(anInt945, anInt1018);
  9714. drawInterface(0, 0+xs2, RSInterface.interfaceCache[anInt1018], 0+ys2);
  9715. }
  9716. if(anInt1018 == 21119 || anInt1018 == 21100)
  9717. {
  9718. method119(anInt945, anInt1018);
  9719. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9720. }
  9721. if(openInterfaceID != -1)
  9722. {
  9723. method119(anInt945, openInterfaceID);
  9724. drawInterface(0, xPo3s, RSInterface.interfaceCache[openInterfaceID], yPo3s);
  9725. }
  9726. method70();
  9727. if(!menuOpen)
  9728. {
  9729. processRightClick();
  9730. drawTooltip();
  9731. } else
  9732. if(menuScreenArea == 0)
  9733. drawMenu();
  9734. if(anInt1055 == 1 && !isFullScreen)
  9735. multiOverlay.drawSprite(472, 296);
  9736. if(anInt1055 == 1 && isFullScreen)
  9737. multiOverlay2.drawSprite(472+xs, 296+ys);
  9738. if(fpsOn)
  9739. {
  9740. char c = '\u01FB';
  9741. int k = 20;
  9742. int i1 = 0xffff00;
  9743. if(super.fps < 15)
  9744. i1 = 0xff0000;
  9745. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9746. k += 15;
  9747. Runtime runtime = Runtime.getRuntime();
  9748. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9749. i1 = 0xffff00;
  9750. if(j1 > 0x2000000 && lowMem)
  9751. i1 = 0xff0000;
  9752. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9753. k += 15;
  9754. }
  9755. int i1 = 0xffff00;
  9756. int x = baseX + (myPlayer.x - 6 >> 7);
  9757. int y = baseY + (myPlayer.y - 6 >> 7);
  9758. if (clientData)
  9759. {
  9760. char c = '\u01FB';
  9761. int k = 20;
  9762. if(super.fps < 15)
  9763. i1 = 0xff0000;
  9764. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9765. Runtime runtime = Runtime.getRuntime();
  9766. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9767. i1 = 0xffff00;
  9768. if(j1 > 0x2000000 && lowMem)
  9769. i1 = 0xff0000;
  9770. k += 15;
  9771. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9772. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9773. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9774. }
  9775. if(anInt1104 != 0)
  9776. {
  9777. int j = anInt1104 / 50;
  9778. int l = j / 60;
  9779. j %= 60;
  9780. if(j < 10)
  9781. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9782. else
  9783. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9784. anInt849++;
  9785. if(anInt849 > 75)
  9786. {
  9787. anInt849 = 0;
  9788. stream.createFrame(148);
  9789. }
  9790. }
  9791. }
  9792. private void addIgnore(long l)
  9793. {
  9794. try
  9795. {
  9796. if(l == 0L)
  9797. return;
  9798. if(ignoreCount >= 100)
  9799. {
  9800. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9801. return;
  9802. }
  9803. String s = TextClass.fixName(TextClass.nameForLong(l));
  9804. for(int j = 0; j < ignoreCount; j++)
  9805. if(ignoreListAsLongs[j] == l)
  9806. {
  9807. pushMessage(s + " is already on your ignore list", 0, "");
  9808. return;
  9809. }
  9810. for(int k = 0; k < friendsCount; k++)
  9811. if(friendsListAsLongs[k] == l)
  9812. {
  9813. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9814. return;
  9815. }
  9816. ignoreListAsLongs[ignoreCount++] = l;
  9817. needDrawTabArea = true;
  9818. stream.createFrame(133);
  9819. stream.writeQWord(l);
  9820. return;
  9821. }
  9822. catch(RuntimeException runtimeexception)
  9823. {
  9824. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9825. }
  9826. throw new RuntimeException();
  9827. }
  9828. private void method114()
  9829. {
  9830. for(int i = -1; i < playerCount; i++)
  9831. {
  9832. int j;
  9833. if(i == -1)
  9834. j = myPlayerIndex;
  9835. else
  9836. j = playerIndices[i];
  9837. Player player = playerArray[j];
  9838. if(player != null)
  9839. method96(player);
  9840. }
  9841. }
  9842. private void method115()
  9843. {
  9844. if(loadingStage == 2)
  9845. {
  9846. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9847. {
  9848. if(class30_sub1.anInt1294 > 0)
  9849. class30_sub1.anInt1294--;
  9850. if(class30_sub1.anInt1294 == 0)
  9851. {
  9852. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9853. {
  9854. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9855. class30_sub1.unlink();
  9856. }
  9857. } else
  9858. {
  9859. if(class30_sub1.anInt1302 > 0)
  9860. class30_sub1.anInt1302--;
  9861. if(class30_sub1.anInt1302 == 0 && class30_sub1.anInt1297 >= 1 && class30_sub1.anInt1298 >= 1 && class30_sub1.anInt1297 <= 102 && class30_sub1.anInt1298 <= 102 && (class30_sub1.anInt1291 < 0 || ObjectManager.method178(class30_sub1.anInt1291, class30_sub1.anInt1293)))
  9862. {
  9863. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9864. class30_sub1.anInt1302 = -1;
  9865. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9866. class30_sub1.unlink();
  9867. else
  9868. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9869. class30_sub1.unlink();
  9870. }
  9871. }
  9872. }
  9873. }
  9874. }
  9875. //stops the click from going over sprite
  9876. private void determineMenuSize()
  9877. {
  9878. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9879. for(int j = 0; j < menuActionRow; j++)
  9880. {
  9881. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9882. if(k > i)
  9883. i = k;
  9884. }
  9885. int x = isFullScreen ? extraWidth : 0;
  9886. int y = isFullScreen ? extraHeight : 0;
  9887. i += 8;
  9888. int l = 15 * menuActionRow + 21;
  9889. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9890. {
  9891. int i1 = super.saveClickX - 4 - i / 2;
  9892. if(i1 + i > 512+x)
  9893. i1 = 512+x - i;
  9894. if(i1 < 0)
  9895. i1 = 0;
  9896. int l1 = super.saveClickY - 4;
  9897. if(l1 + l > 334+y)
  9898. l1 = 334+y - l;
  9899. if(l1 < 0)
  9900. l1 = 0;
  9901. menuOpen = true;
  9902. menuScreenArea = 0;
  9903. menuOffsetX = i1;
  9904. menuOffsetY = l1;
  9905. menuWidth = i;
  9906. menuHeight = 15 * menuActionRow + 22;
  9907. }
  9908. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765+x && super.saveClickY < 503+y )
  9909. {
  9910. int j1 = super.saveClickX - 519 - i / 2;
  9911. if(j1 < 0)
  9912. j1 = 0;
  9913. else
  9914. if(j1 + i > 245+x)
  9915. j1 = 245+x - i;
  9916. int i2 = super.saveClickY - 168 ;
  9917. if(i2 < 0)
  9918. i2 = 0;
  9919. else
  9920. if(i2 + l > 333+y )
  9921. i2 = 333+y - l;
  9922. menuOpen = true;
  9923. menuOffsetX = j1;
  9924. menuOffsetY = i2;
  9925. menuScreenArea = 1;
  9926. menuWidth = i;
  9927. menuHeight = 15 * menuActionRow + 22;
  9928. }
  9929. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503+y )
  9930. {
  9931. int k1 = super.saveClickX - 0 - i / 2;
  9932. if(k1 < 0)
  9933. k1 = 0;
  9934. else
  9935. if(k1 + i > 516)
  9936. k1 = 516 - i;
  9937. int j2 = super.saveClickY - 338 ;
  9938. if(j2 < 0)
  9939. j2 = 0;
  9940. else
  9941. if(j2 + l > 165+y )
  9942. j2 = 165+y - l;
  9943. menuOpen = true;
  9944. menuOffsetX = k1;
  9945. menuOffsetY = j2;
  9946. menuWidth = i;
  9947. menuScreenArea = 2;
  9948. menuHeight = 15 * menuActionRow + 22;
  9949. }
  9950. if (super.saveClickX >= 515+extraWidth && super.saveClickY >= 0 && super.saveClickX <= 765+extraWidth && super.saveClickY <= 169) {
  9951. int k1 = super.saveClickX -515- i / 2;
  9952. if (k1 < 0)
  9953. k1 = 0;
  9954. else if (k1 + i > 249+extraWidth)
  9955. k1 =249+extraWidth-i;
  9956. int j2 = super.saveClickY;
  9957. if (j2 < 0)
  9958. j2 = 0;
  9959. else if (j2 + l > 168)
  9960. j2 = 168 - l;
  9961. menuOpen = true;
  9962. menuScreenArea = 3;
  9963. menuOffsetX = k1;
  9964. menuOffsetY = j2;
  9965. menuWidth = i;
  9966. menuHeight = 15 * menuActionRow + 22;
  9967. }
  9968. }
  9969. private void method117(Stream stream)
  9970. {
  9971. stream.initBitAccess();
  9972. int j = stream.readBits(1);
  9973. if(j == 0)
  9974. return;
  9975. int k = stream.readBits(2);
  9976. if(k == 0)
  9977. {
  9978. anIntArray894[anInt893++] = myPlayerIndex;
  9979. return;
  9980. }
  9981. if(k == 1)
  9982. {
  9983. int l = stream.readBits(3);
  9984. myPlayer.moveInDir(false, l);
  9985. int k1 = stream.readBits(1);
  9986. if(k1 == 1)
  9987. anIntArray894[anInt893++] = myPlayerIndex;
  9988. return;
  9989. }
  9990. if(k == 2)
  9991. {
  9992. int i1 = stream.readBits(3);
  9993. myPlayer.moveInDir(true, i1);
  9994. int l1 = stream.readBits(3);
  9995. myPlayer.moveInDir(true, l1);
  9996. int j2 = stream.readBits(1);
  9997. if(j2 == 1)
  9998. anIntArray894[anInt893++] = myPlayerIndex;
  9999. return;
  10000. }
  10001. if(k == 3)
  10002. {
  10003. plane = stream.readBits(2);
  10004. int j1 = stream.readBits(1);
  10005. int i2 = stream.readBits(1);
  10006. if(i2 == 1)
  10007. anIntArray894[anInt893++] = myPlayerIndex;
  10008. int k2 = stream.readBits(7);
  10009. int l2 = stream.readBits(7);
  10010. myPlayer.setPos(l2, k2, j1 == 1);
  10011. }
  10012. }
  10013. private void nullLoader()
  10014. {
  10015. aBoolean831 = false;
  10016. while(drawingFlames)
  10017. {
  10018. aBoolean831 = false;
  10019. try
  10020. {
  10021. Thread.sleep(50L);
  10022. }
  10023. catch(Exception _ex) { }
  10024. }
  10025. aBackground_966 = null;
  10026. aBackground_967 = null;
  10027. aBackgroundArray1152s = null;
  10028. anIntArray850 = null;
  10029. anIntArray851 = null;
  10030. anIntArray852 = null;
  10031. anIntArray853 = null;
  10032. anIntArray1190 = null;
  10033. anIntArray1191 = null;
  10034. anIntArray828 = null;
  10035. anIntArray829 = null;
  10036. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10037. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10038. }
  10039. private boolean method119(int i, int j)
  10040. {
  10041. boolean flag1 = false;
  10042. RSInterface class9 = RSInterface.interfaceCache[j];
  10043. for(int k = 0; k < class9.children.length; k++)
  10044. {
  10045. if(class9.children[k] == -1)
  10046. break;
  10047. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10048. if(class9_1.type == 1)
  10049. flag1 |= method119(i, class9_1.id);
  10050. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  10051. {
  10052. boolean flag2 = interfaceIsSelected(class9_1);
  10053. int l;
  10054. if(flag2)
  10055. l = class9_1.anInt258;
  10056. else
  10057. l = class9_1.anInt257;
  10058. if(l != -1)
  10059. {
  10060. Animation animation = Animation.anims[l];
  10061. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  10062. {
  10063. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  10064. class9_1.anInt246++;
  10065. if(class9_1.anInt246 >= animation.anInt352)
  10066. {
  10067. class9_1.anInt246 -= animation.anInt356;
  10068. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  10069. class9_1.anInt246 = 0;
  10070. }
  10071. flag1 = true;
  10072. }
  10073. }
  10074. }
  10075. }
  10076. return flag1;
  10077. }
  10078. private int method120()
  10079. {
  10080. int j = 3;
  10081. if(yCameraCurve < 310)
  10082. {
  10083. int k = xCameraPos >> 7;
  10084. int l = yCameraPos >> 7;
  10085. int i1 = myPlayer.x >> 7;
  10086. int j1 = myPlayer.y >> 7;
  10087. if((byteGroundArray[plane][k][l] & 4) != 0)
  10088. j = plane;
  10089. int k1;
  10090. if(i1 > k)
  10091. k1 = i1 - k;
  10092. else
  10093. k1 = k - i1;
  10094. int l1;
  10095. if(j1 > l)
  10096. l1 = j1 - l;
  10097. else
  10098. l1 = l - j1;
  10099. if(k1 > l1)
  10100. {
  10101. int i2 = (l1 * 0x10000) / k1;
  10102. int k2 = 32768;
  10103. while(k != i1)
  10104. {
  10105. if(k < i1)
  10106. k++;
  10107. else
  10108. if(k > i1)
  10109. k--;
  10110. if((byteGroundArray[plane][k][l] & 4) != 0)
  10111. j = plane;
  10112. k2 += i2;
  10113. if(k2 >= 0x10000)
  10114. {
  10115. k2 -= 0x10000;
  10116. if(l < j1)
  10117. l++;
  10118. else
  10119. if(l > j1)
  10120. l--;
  10121. if((byteGroundArray[plane][k][l] & 4) != 0)
  10122. j = plane;
  10123. }
  10124. }
  10125. } else
  10126. {
  10127. int j2 = (k1 * 0x10000) / l1;
  10128. int l2 = 32768;
  10129. while(l != j1)
  10130. {
  10131. if(l < j1)
  10132. l++;
  10133. else
  10134. if(l > j1)
  10135. l--;
  10136. if((byteGroundArray[plane][k][l] & 4) != 0)
  10137. j = plane;
  10138. l2 += j2;
  10139. if(l2 >= 0x10000)
  10140. {
  10141. l2 -= 0x10000;
  10142. if(k < i1)
  10143. k++;
  10144. else
  10145. if(k > i1)
  10146. k--;
  10147. if((byteGroundArray[plane][k][l] & 4) != 0)
  10148. j = plane;
  10149. }
  10150. }
  10151. }
  10152. }
  10153. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10154. j = plane;
  10155. return j;
  10156. }
  10157. private int method121()
  10158. {
  10159. int j = method42(plane, yCameraPos, xCameraPos);
  10160. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10161. return plane;
  10162. else
  10163. return 3;
  10164. }
  10165. private void delIgnore(long l)
  10166. {
  10167. try
  10168. {
  10169. if(l == 0L)
  10170. return;
  10171. for(int j = 0; j < ignoreCount; j++)
  10172. if(ignoreListAsLongs[j] == l)
  10173. {
  10174. ignoreCount--;
  10175. needDrawTabArea = true;
  10176. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10177. stream.createFrame(74);
  10178. stream.writeQWord(l);
  10179. return;
  10180. }
  10181. return;
  10182. }
  10183. catch(RuntimeException runtimeexception)
  10184. {
  10185. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10186. }
  10187. throw new RuntimeException();
  10188. }
  10189. private void chatJoin(long l) {
  10190. try {
  10191. if(l == 0L)
  10192. return;
  10193. stream.createFrame(60);
  10194. stream.writeQWord(l);
  10195. return;
  10196. }
  10197. catch(RuntimeException runtimeexception)
  10198. {
  10199. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10200. }
  10201. throw new RuntimeException();
  10202. }
  10203. public String getParameter(String s)
  10204. {
  10205. if(signlink.mainapp != null)
  10206. return signlink.mainapp.getParameter(s);
  10207. else
  10208. return super.getParameter(s);
  10209. }
  10210. private void adjustVolume(boolean flag, int i)
  10211. {
  10212. signlink.midivol = i;
  10213. if(flag)
  10214. signlink.midi = "voladjust";
  10215. }
  10216. private int extractInterfaceValues(RSInterface class9, int j)
  10217. {
  10218. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10219. return -2;
  10220. try
  10221. {
  10222. int ai[] = class9.valueIndexArray[j];
  10223. int k = 0;
  10224. int l = 0;
  10225. int i1 = 0;
  10226. do
  10227. {
  10228. int j1 = ai[l++];
  10229. int k1 = 0;
  10230. byte byte0 = 0;
  10231. if(j1 == 0)
  10232. return k;
  10233. if(j1 == 1)
  10234. k1 = currentStats[ai[l++]];
  10235. if(j1 == 2)
  10236. k1 = maxStats[ai[l++]];
  10237. if(j1 == 3)
  10238. k1 = currentExp[ai[l++]];
  10239. if(j1 == 4)
  10240. {
  10241. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10242. int k2 = ai[l++];
  10243. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  10244. {
  10245. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  10246. if(class9_1.inv[j3] == k2 + 1)
  10247. k1 += class9_1.invStackSizes[j3];
  10248. }
  10249. }
  10250. if(j1 == 5)
  10251. k1 = variousSettings[ai[l++]];
  10252. if(j1 == 6)
  10253. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10254. if(j1 == 7)
  10255. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10256. if(j1 == 8)
  10257. k1 = myPlayer.combatLevel;
  10258. if(j1 == 9)
  10259. {
  10260. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  10261. if(Skills.skillEnabled[l1])
  10262. k1 += maxStats[l1];
  10263. }
  10264. if(j1 == 10)
  10265. {
  10266. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10267. int l2 = ai[l++] + 1;
  10268. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  10269. {
  10270. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  10271. {
  10272. if(class9_2.inv[k3] != l2)
  10273. continue;
  10274. k1 = 0x3b9ac9ff;
  10275. break;
  10276. }
  10277. }
  10278. }
  10279. if(j1 == 11)
  10280. k1 = energy;
  10281. if(j1 == 12)
  10282. k1 = weight;
  10283. if(j1 == 13)
  10284. {
  10285. int i2 = variousSettings[ai[l++]];
  10286. int i3 = ai[l++];
  10287. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10288. }
  10289. if(j1 == 14)
  10290. {
  10291. int j2 = ai[l++];
  10292. VarBit varBit = VarBit.cache[j2];
  10293. int l3 = varBit.anInt648;
  10294. int i4 = varBit.anInt649;
  10295. int j4 = varBit.anInt650;
  10296. int k4 = anIntArray1232[j4 - i4];
  10297. k1 = variousSettings[l3] >> i4 & k4;
  10298. }
  10299. if(j1 == 15)
  10300. byte0 = 1;
  10301. if(j1 == 16)
  10302. byte0 = 2;
  10303. if(j1 == 17)
  10304. byte0 = 3;
  10305. if(j1 == 18)
  10306. k1 = (myPlayer.x >> 7) + baseX;
  10307. if(j1 == 19)
  10308. k1 = (myPlayer.y >> 7) + baseY;
  10309. if(j1 == 20)
  10310. k1 = ai[l++];
  10311. if(byte0 == 0)
  10312. {
  10313. if(i1 == 0)
  10314. k += k1;
  10315. if(i1 == 1)
  10316. k -= k1;
  10317. if(i1 == 2 && k1 != 0)
  10318. k /= k1;
  10319. if(i1 == 3)
  10320. k *= k1;
  10321. i1 = 0;
  10322. } else
  10323. {
  10324. i1 = byte0;
  10325. }
  10326. } while(true);
  10327. }
  10328. catch(Exception _ex)
  10329. {
  10330. return -1;
  10331. }
  10332. }
  10333. private void drawTooltip() {
  10334. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10335. return;
  10336. String s;
  10337. if(itemSelected == 1 && menuActionRow < 2)
  10338. s = "Use " + selectedItemName + " with...";
  10339. else if(spellSelected == 1 && menuActionRow < 2)
  10340. s = spellTooltip + "...";
  10341. else
  10342. s = menuActionName[menuActionRow - 1];
  10343. if(menuActionRow > 2)
  10344. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10345. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10346. }
  10347. private void drawMinimap() {
  10348. int x = isFullScreen ? 549+extraWidth : 0;
  10349. int markY = isFullScreen ? 6 : 0;
  10350. int markX = isFullScreen ? 9 : 0;
  10351. if (!isFullScreen)
  10352. aRSImageProducer_1164.initDrawingArea();
  10353. if(anInt1021 == 2) {
  10354. byte abyte0[] = mapBack.aByteArray1450;
  10355. int ai[] = DrawingArea.pixels;
  10356. int k2 = abyte0.length;
  10357. for(int i5 = 0; i5 < k2; i5++)
  10358. if(abyte0[i5] == 0)
  10359. ai[i5] = 0;
  10360. aRSImageProducer_1165.initDrawingArea();
  10361. return;
  10362. }
  10363. int i = minimapInt1 + minimapInt2 & 0x7ff;
  10364. int j = 48 + myPlayer.x / 32;
  10365. int l2 = 464 - myPlayer.y / 32;
  10366. if(!isFullScreen) {
  10367. aClass30_Sub2_Sub1_Sub1_1263.method352(152, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 10, 32, 146, j);
  10368. }
  10369. if(isFullScreen) {
  10370. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 12, 34+x, 146, j);
  10371. }
  10372. if(!newMap && !isFullScreen) {
  10373. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 9, 34+x, 146, j);
  10374. }
  10375. if(newMap && !isFullScreen) {
  10376. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 9, 55, 146, j);
  10377. }
  10378. for(int j5 = 0; j5 < anInt1071; j5++) {
  10379. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10380. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10381. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10382. }
  10383. for(int k5 = 0; k5 < 104; k5++) {
  10384. for(int l5 = 0; l5 < 104; l5++) {
  10385. NodeList class19 = groundArray[plane][k5][l5];
  10386. if(class19 != null) {
  10387. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10388. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10389. markMinimap(mapDotItem, l, j3);
  10390. }
  10391. }
  10392. }
  10393. for(int i6 = 0; i6 < npcCount; i6++) {
  10394. NPC npc = npcArray[npcIndices[i6]];
  10395. if(npc != null && npc.isVisible()) {
  10396. EntityDef entityDef = npc.desc;
  10397. if(entityDef.childrenIDs != null)
  10398. entityDef = entityDef.method161();
  10399. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10400. int i1 = npc.x / 32 - myPlayer.x / 32;
  10401. int k3 = npc.y / 32 - myPlayer.y / 32;
  10402. markMinimap(mapDotNPC, i1, k3);
  10403. }
  10404. }
  10405. }
  10406. for(int j6 = 0; j6 < playerCount; j6++) {
  10407. Player player = playerArray[playerIndices[j6]];
  10408. if(player != null && player.isVisible()) {
  10409. int j1 = player.x / 32 - myPlayer.x / 32;
  10410. int l3 = player.y / 32 - myPlayer.y / 32;
  10411. boolean flag1 = false;
  10412. boolean flag3 = false;
  10413. for (int j3 = 0; j3 < clanList.length; j3++) {
  10414. if (clanList[j3] == null)
  10415. continue;
  10416. if (!clanList[j3].equalsIgnoreCase(player.name))
  10417. continue;
  10418. flag3 = true;
  10419. break;
  10420. }
  10421. long l6 = TextClass.longForName(player.name);
  10422. for(int k6 = 0; k6 < friendsCount; k6++) {
  10423. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10424. continue;
  10425. flag1 = true;
  10426. break;
  10427. }
  10428. boolean flag2 = false;
  10429. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10430. flag2 = true;
  10431. if(flag1)
  10432. markMinimap(mapDotFriend, j1, l3);
  10433. else if(flag3)
  10434. markMinimap(mapDotClan, j1, l3);
  10435. else if(flag2)
  10436. markMinimap(mapDotTeam, j1, l3);
  10437. else
  10438. markMinimap(mapDotPlayer, j1, l3);
  10439. }
  10440. }
  10441. if(anInt855 != 0 && loopCycle % 20 < 10) {
  10442. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10443. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10444. if(class30_sub2_sub4_sub1_sub1_1 != null)
  10445. {
  10446. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10447. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10448. method81(mapMarker, i4, k1);
  10449. }
  10450. }
  10451. if(anInt855 == 2) {
  10452. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10453. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10454. method81(mapMarker, j4, l1);
  10455. }
  10456. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  10457. {
  10458. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10459. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  10460. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10461. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10462. method81(mapMarker, k4, i2);
  10463. }
  10464. }
  10465. }
  10466. if(destX != 0) {
  10467. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10468. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10469. markMinimap(mapFlag, j2, l4);
  10470. }
  10471. if(newMap && !isFullScreen) {
  10472. DrawingArea.drawPixels(3, 78+5, 97+20, 0xffffff, 3);
  10473. }
  10474. if(!newMap && !isFullScreen) {
  10475. DrawingArea.drawPixels(3, 78+5, 97+20, 0xffffff, 3);
  10476. }
  10477. if(isFullScreen) {
  10478. DrawingArea.drawPixels(3, 78+markY, 97+x+markX, 0xffffff, 3);
  10479. }
  10480. //Compass
  10481. if(isFullScreen) {
  10482. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, isFullScreen ? 12 : 8, isFullScreen ? 30+x: 8, 33, 25);
  10483. }
  10484. if(!newMap && !isFullScreen) {
  10485. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10486. }
  10487. if(newMap && !isFullScreen) {
  10488. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 4, 26, 33, 25);
  10489. }
  10490. if (isFullScreen) {
  10491. mapArea[0].drawSprite(25+x, 7);
  10492. }
  10493. if(!newMap && !isFullScreen) {
  10494. mapArea[1].drawSprite(0, 0);
  10495. }
  10496. if(newMap && !isFullScreen) {
  10497. mapArea[1].drawSprite(0, 0);
  10498. }
  10499. if(!newMap) {
  10500. drawWorldMapButton();
  10501. drawHPOrb();
  10502. drawXPCounter();
  10503. drawPrayerOrb();
  10504. drawRunOrb();
  10505. drawLogoutButton();
  10506. }
  10507. if (!hasBeenBlanked) {
  10508. aRSImageProducer_1164.blankImage();
  10509. hasBeenBlanked = true;
  10510. }
  10511. if(menuOpen && menuScreenArea == 3){
  10512. drawMenu();
  10513. }
  10514. aRSImageProducer_1165.initDrawingArea();
  10515. }
  10516. private void rightClickMapArea() {
  10517. int x = super.mouseX;
  10518. int y = super.mouseY;
  10519. if (super.mouseX >= 742 && super.mouseX <= 764
  10520. && super.mouseY >= 1 && super.mouseY <= 23
  10521. && tabInterfaceIDs[10] != -1) {
  10522. menuActionName[1] = "Logout";
  10523. menuActionID[1] = 1004;
  10524. menuActionRow = 2;
  10525. } else if (super.mouseX > 707 && super.mouseX < 762
  10526. && super.mouseY > 93 && super.mouseY < 124) {
  10527. menuActionName[2] = "Run";
  10528. menuActionID[2] = 1051;
  10529. menuActionName[1] = "Rest";
  10530. menuActionID[1] = 1052;
  10531. menuActionRow = 3;
  10532. }
  10533. }
  10534. private void npcScreenPos(Entity entity, int i) {
  10535. calcEntityScreenPos(entity.x, i, entity.y);
  10536. }
  10537. private void calcEntityScreenPos(int i, int j, int l) {
  10538. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  10539. spriteDrawX = -1;
  10540. spriteDrawY = -1;
  10541. return;
  10542. }
  10543. int i1 = method42(plane, l, i) - j;
  10544. i -= xCameraPos;
  10545. i1 -= zCameraPos;
  10546. l -= yCameraPos;
  10547. int j1 = Model.modelIntArray1[yCameraCurve];
  10548. int k1 = Model.modelIntArray2[yCameraCurve];
  10549. int l1 = Model.modelIntArray1[xCameraCurve];
  10550. int i2 = Model.modelIntArray2[xCameraCurve];
  10551. int j2 = l * l1 + i * i2 >> 16;
  10552. l = l * i2 - i * l1 >> 16;
  10553. i = j2;
  10554. j2 = i1 * k1 - l * j1 >> 16;
  10555. l = i1 * j1 + l * k1 >> 16;
  10556. i1 = j2;
  10557. if(l >= 50) {
  10558. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  10559. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  10560. } else {
  10561. spriteDrawX = -1;
  10562. spriteDrawY = -1;
  10563. }
  10564. }
  10565. private void buildSplitPrivateChatMenu()
  10566. {
  10567. if(splitPrivateChat == 0)
  10568. return;
  10569. int i = 0;
  10570. if(anInt1104 != 0)
  10571. i = 1;
  10572. for(int j = 0; j < 100; j++)
  10573. if(chatMessages[j] != null)
  10574. {
  10575. int k = chatTypes[j];
  10576. String s = chatNames[j];
  10577. boolean flag1 = false;
  10578. if(s != null && s.startsWith("@cr1@"))
  10579. {
  10580. s = s.substring(5);
  10581. boolean flag2 = true;
  10582. }
  10583. if(s != null && s.startsWith("@cr2@"))
  10584. {
  10585. s = s.substring(5);
  10586. byte byte0 = 2;
  10587. }
  10588. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  10589. {
  10590. int l = 329 - i * 13;
  10591. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  10592. {
  10593. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  10594. if(i1 > 450)
  10595. i1 = 450;
  10596. if(super.mouseX < 4 + i1)
  10597. {
  10598. if(myPrivilege >= 1)
  10599. {
  10600. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  10601. menuActionID[menuActionRow] = 2606;
  10602. menuActionRow++;
  10603. }
  10604. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  10605. menuActionID[menuActionRow] = 2042;
  10606. menuActionRow++;
  10607. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  10608. menuActionID[menuActionRow] = 2337;
  10609. menuActionRow++;
  10610. }
  10611. }
  10612. if(++i >= 5)
  10613. return;
  10614. }
  10615. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10616. return;
  10617. }
  10618. }
  10619. private void method130(int j, int k, int l, int i1, int j1, int k1,
  10620. int l1, int i2, int j2)
  10621. {
  10622. Class30_Sub1 class30_sub1 = null;
  10623. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10624. {
  10625. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  10626. continue;
  10627. class30_sub1 = class30_sub1_1;
  10628. break;
  10629. }
  10630. if(class30_sub1 == null)
  10631. {
  10632. class30_sub1 = new Class30_Sub1();
  10633. class30_sub1.anInt1295 = l1;
  10634. class30_sub1.anInt1296 = i1;
  10635. class30_sub1.anInt1297 = i2;
  10636. class30_sub1.anInt1298 = j1;
  10637. method89(class30_sub1);
  10638. aClass19_1179.insertHead(class30_sub1);
  10639. }
  10640. class30_sub1.anInt1291 = k;
  10641. class30_sub1.anInt1293 = k1;
  10642. class30_sub1.anInt1292 = l;
  10643. class30_sub1.anInt1302 = j2;
  10644. class30_sub1.anInt1294 = j;
  10645. }
  10646. private boolean interfaceIsSelected(RSInterface class9)
  10647. {
  10648. if(class9.anIntArray245 == null)
  10649. return false;
  10650. for(int i = 0; i < class9.anIntArray245.length; i++)
  10651. {
  10652. int j = extractInterfaceValues(class9, i);
  10653. int k = class9.anIntArray212[i];
  10654. if(class9.anIntArray245[i] == 2)
  10655. {
  10656. if(j >= k)
  10657. return false;
  10658. } else
  10659. if(class9.anIntArray245[i] == 3)
  10660. {
  10661. if(j <= k)
  10662. return false;
  10663. } else
  10664. if(class9.anIntArray245[i] == 4)
  10665. {
  10666. if(j == k)
  10667. return false;
  10668. } else
  10669. if(j != k)
  10670. return false;
  10671. }
  10672. return true;
  10673. }
  10674. private DataInputStream openJagGrabInputStream(String s)
  10675. throws IOException
  10676. {
  10677. // if(!aBoolean872)
  10678. // if(signlink.mainapp != null)
  10679. // return signlink.openurl(s);
  10680. // else
  10681. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10682. if(aSocket832 != null)
  10683. {
  10684. try
  10685. {
  10686. aSocket832.close();
  10687. }
  10688. catch(Exception _ex) { }
  10689. aSocket832 = null;
  10690. }
  10691. aSocket832 = openSocket(43595);
  10692. aSocket832.setSoTimeout(10000);
  10693. java.io.InputStream inputstream = aSocket832.getInputStream();
  10694. OutputStream outputstream = aSocket832.getOutputStream();
  10695. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10696. return new DataInputStream(inputstream);
  10697. }
  10698. private void doFlamesDrawing()
  10699. {
  10700. char c = '\u0100';
  10701. if(anInt1040 > 0)
  10702. {
  10703. for(int i = 0; i < 256; i++)
  10704. if(anInt1040 > 768)
  10705. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  10706. else
  10707. if(anInt1040 > 256)
  10708. anIntArray850[i] = anIntArray852[i];
  10709. else
  10710. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  10711. } else
  10712. if(anInt1041 > 0)
  10713. {
  10714. for(int j = 0; j < 256; j++)
  10715. if(anInt1041 > 768)
  10716. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  10717. else
  10718. if(anInt1041 > 256)
  10719. anIntArray850[j] = anIntArray853[j];
  10720. else
  10721. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  10722. } else
  10723. {
  10724. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  10725. }
  10726. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  10727. int i1 = 0;
  10728. int j1 = 1152;
  10729. for(int k1 = 1; k1 < c - 1; k1++)
  10730. {
  10731. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  10732. int j2 = 22 + l1;
  10733. if(j2 < 0)
  10734. j2 = 0;
  10735. i1 += j2;
  10736. for(int l2 = j2; l2 < 128; l2++)
  10737. {
  10738. int j3 = anIntArray828[i1++];
  10739. if(j3 != 0)
  10740. {
  10741. int l3 = j3;
  10742. int j4 = 256 - j3;
  10743. j3 = anIntArray850[j3];
  10744. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  10745. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  10746. } else
  10747. {
  10748. j1++;
  10749. }
  10750. }
  10751. j1 += j2;
  10752. }
  10753. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  10754. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  10755. i1 = 0;
  10756. j1 = 1176;
  10757. for(int k2 = 1; k2 < c - 1; k2++)
  10758. {
  10759. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10760. int k3 = 103 - i3;
  10761. j1 += i3;
  10762. for(int i4 = 0; i4 < k3; i4++)
  10763. {
  10764. int k4 = anIntArray828[i1++];
  10765. if(k4 != 0)
  10766. {
  10767. int i5 = k4;
  10768. int j5 = 256 - k4;
  10769. k4 = anIntArray850[k4];
  10770. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10771. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10772. } else
  10773. {
  10774. j1++;
  10775. }
  10776. }
  10777. i1 += 128 - k3;
  10778. j1 += 128 - k3 - i3;
  10779. }
  10780. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10781. }
  10782. private void method134(Stream stream)
  10783. {
  10784. int j = stream.readBits(8);
  10785. if(j < playerCount)
  10786. {
  10787. for(int k = j; k < playerCount; k++)
  10788. anIntArray840[anInt839++] = playerIndices[k];
  10789. }
  10790. if(j > playerCount)
  10791. {
  10792. signlink.reporterror(myUsername + " Too many players");
  10793. throw new RuntimeException("eek");
  10794. }
  10795. playerCount = 0;
  10796. for(int l = 0; l < j; l++)
  10797. {
  10798. int i1 = playerIndices[l];
  10799. Player player = playerArray[i1];
  10800. int j1 = stream.readBits(1);
  10801. if(j1 == 0)
  10802. {
  10803. playerIndices[playerCount++] = i1;
  10804. player.anInt1537 = loopCycle;
  10805. } else
  10806. {
  10807. int k1 = stream.readBits(2);
  10808. if(k1 == 0)
  10809. {
  10810. playerIndices[playerCount++] = i1;
  10811. player.anInt1537 = loopCycle;
  10812. anIntArray894[anInt893++] = i1;
  10813. } else
  10814. if(k1 == 1)
  10815. {
  10816. playerIndices[playerCount++] = i1;
  10817. player.anInt1537 = loopCycle;
  10818. int l1 = stream.readBits(3);
  10819. player.moveInDir(false, l1);
  10820. int j2 = stream.readBits(1);
  10821. if(j2 == 1)
  10822. anIntArray894[anInt893++] = i1;
  10823. } else
  10824. if(k1 == 2)
  10825. {
  10826. playerIndices[playerCount++] = i1;
  10827. player.anInt1537 = loopCycle;
  10828. int i2 = stream.readBits(3);
  10829. player.moveInDir(true, i2);
  10830. int k2 = stream.readBits(3);
  10831. player.moveInDir(true, k2);
  10832. int l2 = stream.readBits(1);
  10833. if(l2 == 1)
  10834. anIntArray894[anInt893++] = i1;
  10835. } else
  10836. if(k1 == 3)
  10837. anIntArray840[anInt839++] = i1;
  10838. }
  10839. }
  10840. }
  10841. private void drawLoginScreen(boolean flag)
  10842. {
  10843. resetImageProducers();
  10844. aRSImageProducer_1109.initDrawingArea();
  10845. aBackground_966.drawBackground(0, 0);
  10846. char c = '\u0168';
  10847. char c1 = '\310';
  10848. if(loginScreenState == 0)
  10849. {
  10850. int i = c1 / 2 + 80;
  10851. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10852. i = c1 / 2 - 20;
  10853. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to RuneScape", i, true);
  10854. i += 30;
  10855. int l = c / 2 - 80;
  10856. int k1 = c1 / 2 + 20;
  10857. aBackground_967.drawBackground(l - 73, k1 - 20);
  10858. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  10859. l = c / 2 + 80;
  10860. aBackground_967.drawBackground(l - 73, k1 - 20);
  10861. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10862. }
  10863. if(loginScreenState == 2)
  10864. {
  10865. int j = c1 / 2 - 40;
  10866. if(loginMessage1.length() > 0)
  10867. {
  10868. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10869. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10870. j += 30;
  10871. } else
  10872. {
  10873. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10874. j += 30;
  10875. }
  10876. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10877. j += 15;
  10878. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10879. j += 15;
  10880. if(!flag)
  10881. {
  10882. int i1 = c / 2 - 80;
  10883. int l1 = c1 / 2 + 50;
  10884. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10885. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10886. i1 = c / 2 + 80;
  10887. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10888. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10889. }
  10890. }
  10891. if(loginScreenState == 3)
  10892. {
  10893. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  10894. int k = c1 / 2 - 35;
  10895. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10896. k += 15;
  10897. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
  10898. k += 15;
  10899. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10900. k += 15;
  10901. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10902. k += 15;
  10903. int j1 = c / 2;
  10904. int i2 = c1 / 2 + 50;
  10905. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10906. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10907. }
  10908. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10909. if(welcomeScreenRaised)
  10910. {
  10911. welcomeScreenRaised = false;
  10912. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10913. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10914. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10915. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10916. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10917. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10918. }
  10919. }
  10920. private void drawFlames()
  10921. {
  10922. drawingFlames = true;
  10923. try
  10924. {
  10925. long l = System.currentTimeMillis();
  10926. int i = 0;
  10927. int j = 20;
  10928. while(aBoolean831)
  10929. {
  10930. anInt1208++;
  10931. calcFlamesPosition();
  10932. calcFlamesPosition();
  10933. doFlamesDrawing();
  10934. if(++i > 10)
  10935. {
  10936. long l1 = System.currentTimeMillis();
  10937. int k = (int)(l1 - l) / 10 - j;
  10938. j = 40 - k;
  10939. if(j < 5)
  10940. j = 5;
  10941. i = 0;
  10942. l = l1;
  10943. }
  10944. try
  10945. {
  10946. Thread.sleep(j);
  10947. }
  10948. catch(Exception _ex) { }
  10949. }
  10950. }
  10951. catch(Exception _ex) { }
  10952. drawingFlames = false;
  10953. }
  10954. public void raiseWelcomeScreen()
  10955. {
  10956. welcomeScreenRaised = true;
  10957. }
  10958. private void method137(Stream stream, int j)
  10959. {
  10960. if(j == 84)
  10961. {
  10962. int k = stream.readUnsignedByte();
  10963. int j3 = anInt1268 + (k >> 4 & 7);
  10964. int i6 = anInt1269 + (k & 7);
  10965. int l8 = stream.readUnsignedWord();
  10966. int k11 = stream.readUnsignedWord();
  10967. int l13 = stream.readUnsignedWord();
  10968. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10969. {
  10970. NodeList class19_1 = groundArray[plane][j3][i6];
  10971. if(class19_1 != null)
  10972. {
  10973. for(Item class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetNext())
  10974. {
  10975. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10976. continue;
  10977. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10978. break;
  10979. }
  10980. spawnGroundItem(j3, i6);
  10981. }
  10982. }
  10983. return;
  10984. }
  10985. if(j == 105)
  10986. {
  10987. int l = stream.readUnsignedByte();
  10988. int k3 = anInt1268 + (l >> 4 & 7);
  10989. int j6 = anInt1269 + (l & 7);
  10990. int i9 = stream.readUnsignedWord();
  10991. int l11 = stream.readUnsignedByte();
  10992. int i14 = l11 >> 4 & 0xf;
  10993. int i16 = l11 & 7;
  10994. if(myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14 && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem && anInt1062 < 50)
  10995. {
  10996. anIntArray1207[anInt1062] = i9;
  10997. anIntArray1241[anInt1062] = i16;
  10998. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10999. anInt1062++;
  11000. }
  11001. }
  11002. if(j == 215)
  11003. {
  11004. int i1 = stream.method435();
  11005. int l3 = stream.method428();
  11006. int k6 = anInt1268 + (l3 >> 4 & 7);
  11007. int j9 = anInt1269 + (l3 & 7);
  11008. int i12 = stream.method435();
  11009. int j14 = stream.readUnsignedWord();
  11010. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  11011. {
  11012. Item class30_sub2_sub4_sub2_2 = new Item();
  11013. class30_sub2_sub4_sub2_2.ID = i1;
  11014. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11015. if(groundArray[plane][k6][j9] == null)
  11016. groundArray[plane][k6][j9] = new NodeList();
  11017. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11018. spawnGroundItem(k6, j9);
  11019. }
  11020. return;
  11021. }
  11022. if(j == 156)
  11023. {
  11024. int j1 = stream.method426();
  11025. int i4 = anInt1268 + (j1 >> 4 & 7);
  11026. int l6 = anInt1269 + (j1 & 7);
  11027. int k9 = stream.readUnsignedWord();
  11028. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  11029. {
  11030. NodeList class19 = groundArray[plane][i4][l6];
  11031. if(class19 != null)
  11032. {
  11033. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  11034. {
  11035. if(item.ID != (k9 & 0x7fff))
  11036. continue;
  11037. item.unlink();
  11038. break;
  11039. }
  11040. if(class19.reverseGetFirst() == null)
  11041. groundArray[plane][i4][l6] = null;
  11042. spawnGroundItem(i4, l6);
  11043. }
  11044. }
  11045. return;
  11046. }
  11047. if(j == 160)
  11048. {
  11049. int k1 = stream.method428();
  11050. int j4 = anInt1268 + (k1 >> 4 & 7);
  11051. int i7 = anInt1269 + (k1 & 7);
  11052. int l9 = stream.method428();
  11053. int j12 = l9 >> 2;
  11054. int k14 = l9 & 3;
  11055. int j16 = anIntArray1177[j12];
  11056. int j17 = stream.method435();
  11057. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  11058. {
  11059. int j18 = intGroundArray[plane][j4][i7];
  11060. int i19 = intGroundArray[plane][j4 + 1][i7];
  11061. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11062. int k20 = intGroundArray[plane][j4][i7 + 1];
  11063. if(j16 == 0)
  11064. {
  11065. Object1 class10 = worldController.method296(plane, j4, i7);
  11066. if(class10 != null)
  11067. {
  11068. int k21 = class10.uid >> 14 & 0x7fff;
  11069. if(j12 == 2)
  11070. {
  11071. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11072. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11073. } else
  11074. {
  11075. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11076. }
  11077. }
  11078. }
  11079. if(j16 == 1)
  11080. {
  11081. Object2 class26 = worldController.method297(j4, i7, plane);
  11082. if(class26 != null)
  11083. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11084. }
  11085. if(j16 == 2)
  11086. {
  11087. Object5 class28 = worldController.method298(j4, i7, plane);
  11088. if(j12 == 11)
  11089. j12 = 10;
  11090. if(class28 != null)
  11091. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11092. }
  11093. if(j16 == 3)
  11094. {
  11095. Object3 class49 = worldController.method299(i7, j4, plane);
  11096. if(class49 != null)
  11097. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11098. }
  11099. }
  11100. return;
  11101. }
  11102. if(j == 147)
  11103. {
  11104. int l1 = stream.method428();
  11105. int k4 = anInt1268 + (l1 >> 4 & 7);
  11106. int j7 = anInt1269 + (l1 & 7);
  11107. int i10 = stream.readUnsignedWord();
  11108. byte byte0 = stream.method430();
  11109. int l14 = stream.method434();
  11110. byte byte1 = stream.method429();
  11111. int k17 = stream.readUnsignedWord();
  11112. int k18 = stream.method428();
  11113. int j19 = k18 >> 2;
  11114. int i20 = k18 & 3;
  11115. int l20 = anIntArray1177[j19];
  11116. byte byte2 = stream.readSignedByte();
  11117. int l21 = stream.readUnsignedWord();
  11118. byte byte3 = stream.method429();
  11119. Player player;
  11120. if(i10 == unknownInt10)
  11121. player = myPlayer;
  11122. else
  11123. player = playerArray[i10];
  11124. if(player != null)
  11125. {
  11126. ObjectDef class46 = ObjectDef.forID(l21);
  11127. int i22 = intGroundArray[plane][k4][j7];
  11128. int j22 = intGroundArray[plane][k4 + 1][j7];
  11129. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11130. int l22 = intGroundArray[plane][k4][j7 + 1];
  11131. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11132. if(model != null)
  11133. {
  11134. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11135. player.anInt1707 = l14 + loopCycle;
  11136. player.anInt1708 = k17 + loopCycle;
  11137. player.aModel_1714 = model;
  11138. int i23 = class46.anInt744;
  11139. int j23 = class46.anInt761;
  11140. if(i20 == 1 || i20 == 3)
  11141. {
  11142. i23 = class46.anInt761;
  11143. j23 = class46.anInt744;
  11144. }
  11145. player.anInt1711 = k4 * 128 + i23 * 64;
  11146. player.anInt1713 = j7 * 128 + j23 * 64;
  11147. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11148. if(byte2 > byte0)
  11149. {
  11150. byte byte4 = byte2;
  11151. byte2 = byte0;
  11152. byte0 = byte4;
  11153. }
  11154. if(byte3 > byte1)
  11155. {
  11156. byte byte5 = byte3;
  11157. byte3 = byte1;
  11158. byte1 = byte5;
  11159. }
  11160. player.anInt1719 = k4 + byte2;
  11161. player.anInt1721 = k4 + byte0;
  11162. player.anInt1720 = j7 + byte3;
  11163. player.anInt1722 = j7 + byte1;
  11164. }
  11165. }
  11166. }
  11167. if(j == 151)
  11168. {
  11169. int i2 = stream.method426();
  11170. int l4 = anInt1268 + (i2 >> 4 & 7);
  11171. int k7 = anInt1269 + (i2 & 7);
  11172. int j10 = stream.method434();
  11173. int k12 = stream.method428();
  11174. int i15 = k12 >> 2;
  11175. int k16 = k12 & 3;
  11176. int l17 = anIntArray1177[i15];
  11177. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11178. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11179. return;
  11180. }
  11181. if(j == 4)
  11182. {
  11183. int j2 = stream.readUnsignedByte();
  11184. int i5 = anInt1268 + (j2 >> 4 & 7);
  11185. int l7 = anInt1269 + (j2 & 7);
  11186. int k10 = stream.readUnsignedWord();
  11187. int l12 = stream.readUnsignedByte();
  11188. int j15 = stream.readUnsignedWord();
  11189. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  11190. {
  11191. i5 = i5 * 128 + 64;
  11192. l7 = l7 * 128 + 64;
  11193. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11194. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11195. }
  11196. return;
  11197. }
  11198. if(j == 44)
  11199. {
  11200. int k2 = stream.method436();
  11201. int j5 = stream.readUnsignedWord();
  11202. int i8 = stream.readUnsignedByte();
  11203. int l10 = anInt1268 + (i8 >> 4 & 7);
  11204. int i13 = anInt1269 + (i8 & 7);
  11205. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  11206. {
  11207. Item class30_sub2_sub4_sub2_1 = new Item();
  11208. class30_sub2_sub4_sub2_1.ID = k2;
  11209. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11210. if(groundArray[plane][l10][i13] == null)
  11211. groundArray[plane][l10][i13] = new NodeList();
  11212. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11213. spawnGroundItem(l10, i13);
  11214. }
  11215. return;
  11216. }
  11217. if(j == 101)
  11218. {
  11219. int l2 = stream.method427();
  11220. int k5 = l2 >> 2;
  11221. int j8 = l2 & 3;
  11222. int i11 = anIntArray1177[k5];
  11223. int j13 = stream.readUnsignedByte();
  11224. int k15 = anInt1268 + (j13 >> 4 & 7);
  11225. int l16 = anInt1269 + (j13 & 7);
  11226. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11227. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11228. return;
  11229. }
  11230. if(j == 117)
  11231. {
  11232. int i3 = stream.readUnsignedByte();
  11233. int l5 = anInt1268 + (i3 >> 4 & 7);
  11234. int k8 = anInt1269 + (i3 & 7);
  11235. int j11 = l5 + stream.readSignedByte();
  11236. int k13 = k8 + stream.readSignedByte();
  11237. int l15 = stream.readSignedWord();
  11238. int i17 = stream.readUnsignedWord();
  11239. int i18 = stream.readUnsignedByte() * 4;
  11240. int l18 = stream.readUnsignedByte() * 4;
  11241. int k19 = stream.readUnsignedWord();
  11242. int j20 = stream.readUnsignedWord();
  11243. int i21 = stream.readUnsignedByte();
  11244. int j21 = stream.readUnsignedByte();
  11245. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  11246. {
  11247. l5 = l5 * 128 + 64;
  11248. k8 = k8 * 128 + 64;
  11249. j11 = j11 * 128 + 64;
  11250. k13 = k13 * 128 + 64;
  11251. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21, l18, k19 + loopCycle, j20 + loopCycle, j21, plane, method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  11252. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  11253. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11254. }
  11255. }
  11256. }
  11257. private static void setLowMem()
  11258. {
  11259. WorldController.lowMem = true;
  11260. Texture.lowMem = true;
  11261. lowMem = true;
  11262. ObjectManager.lowMem = true;
  11263. ObjectDef.lowMem = true;
  11264. }
  11265. private void method139(Stream stream)
  11266. {
  11267. stream.initBitAccess();
  11268. int k = stream.readBits(8);
  11269. if(k < npcCount)
  11270. {
  11271. for(int l = k; l < npcCount; l++)
  11272. anIntArray840[anInt839++] = npcIndices[l];
  11273. }
  11274. if(k > npcCount)
  11275. {
  11276. signlink.reporterror(myUsername + " Too many npcs");
  11277. throw new RuntimeException("eek");
  11278. }
  11279. npcCount = 0;
  11280. for(int i1 = 0; i1 < k; i1++)
  11281. {
  11282. int j1 = npcIndices[i1];
  11283. NPC npc = npcArray[j1];
  11284. int k1 = stream.readBits(1);
  11285. if(k1 == 0)
  11286. {
  11287. npcIndices[npcCount++] = j1;
  11288. npc.anInt1537 = loopCycle;
  11289. } else
  11290. {
  11291. int l1 = stream.readBits(2);
  11292. if(l1 == 0)
  11293. {
  11294. npcIndices[npcCount++] = j1;
  11295. npc.anInt1537 = loopCycle;
  11296. anIntArray894[anInt893++] = j1;
  11297. } else
  11298. if(l1 == 1)
  11299. {
  11300. npcIndices[npcCount++] = j1;
  11301. npc.anInt1537 = loopCycle;
  11302. int i2 = stream.readBits(3);
  11303. npc.moveInDir(false, i2);
  11304. int k2 = stream.readBits(1);
  11305. if(k2 == 1)
  11306. anIntArray894[anInt893++] = j1;
  11307. } else
  11308. if(l1 == 2)
  11309. {
  11310. npcIndices[npcCount++] = j1;
  11311. npc.anInt1537 = loopCycle;
  11312. int j2 = stream.readBits(3);
  11313. npc.moveInDir(true, j2);
  11314. int l2 = stream.readBits(3);
  11315. npc.moveInDir(true, l2);
  11316. int i3 = stream.readBits(1);
  11317. if(i3 == 1)
  11318. anIntArray894[anInt893++] = j1;
  11319. } else
  11320. if(l1 == 3)
  11321. anIntArray840[anInt839++] = j1;
  11322. }
  11323. }
  11324. }
  11325. private void processLoginScreenInput()
  11326. {
  11327. if(loginScreenState == 0)
  11328. {
  11329. int i = super.myWidth / 2 - 80;
  11330. int l = super.myHeight / 2 + 20;
  11331. l += 20;
  11332. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  11333. {
  11334. loginScreenState = 3;
  11335. loginScreenCursorPos = 0;
  11336. }
  11337. i = super.myWidth / 2 + 80;
  11338. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  11339. {
  11340. loginMessage1 = "";
  11341. loginMessage2 = "Enter your username & password.";
  11342. loginScreenState = 2;
  11343. loginScreenCursorPos = 0;
  11344. }
  11345. } else
  11346. {
  11347. if(loginScreenState == 2)
  11348. {
  11349. int j = super.myHeight / 2 - 40;
  11350. j += 30;
  11351. j += 25;
  11352. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  11353. loginScreenCursorPos = 0;
  11354. j += 15;
  11355. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  11356. loginScreenCursorPos = 1;
  11357. j += 15;
  11358. int i1 = super.myWidth / 2 - 80;
  11359. int k1 = super.myHeight / 2 + 50;
  11360. k1 += 20;
  11361. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  11362. {
  11363. loginFailures = 0;
  11364. login(myUsername, myPassword, false);
  11365. if(loggedIn)
  11366. return;
  11367. }
  11368. i1 = super.myWidth / 2 + 80;
  11369. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  11370. {
  11371. loginScreenState = 0;
  11372. // myUsername = "";
  11373. // myPassword = "";
  11374. }
  11375. do
  11376. {
  11377. int l1 = readChar(-796);
  11378. if(l1 == -1)
  11379. break;
  11380. boolean flag1 = false;
  11381. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  11382. {
  11383. if(l1 != validUserPassChars.charAt(i2))
  11384. continue;
  11385. flag1 = true;
  11386. break;
  11387. }
  11388. if(loginScreenCursorPos == 0)
  11389. {
  11390. if(l1 == 8 && myUsername.length() > 0)
  11391. myUsername = myUsername.substring(0, myUsername.length() - 1);
  11392. if(l1 == 9 || l1 == 10 || l1 == 13)
  11393. loginScreenCursorPos = 1;
  11394. if(flag1)
  11395. myUsername += (char)l1;
  11396. if(myUsername.length() > 12)
  11397. myUsername = myUsername.substring(0, 12);
  11398. } else
  11399. if(loginScreenCursorPos == 1)
  11400. {
  11401. if(l1 == 8 && myPassword.length() > 0)
  11402. myPassword = myPassword.substring(0, myPassword.length() - 1);
  11403. if(l1 == 9 || l1 == 10 || l1 == 13)
  11404. loginScreenCursorPos = 0;
  11405. if(flag1)
  11406. myPassword += (char)l1;
  11407. if(myPassword.length() > 20)
  11408. myPassword = myPassword.substring(0, 20);
  11409. }
  11410. } while(true);
  11411. return;
  11412. }
  11413. if(loginScreenState == 3)
  11414. {
  11415. int k = super.myWidth / 2;
  11416. int j1 = super.myHeight / 2 + 50;
  11417. j1 += 20;
  11418. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  11419. loginScreenState = 0;
  11420. }
  11421. }
  11422. }
  11423. private void markMinimap(Sprite sprite, int i, int j) {
  11424. int x = isFullScreen ? 549+extraWidth : 0;
  11425. int markY = 6;
  11426. int markX = 9;
  11427. int k = minimapInt1 + minimapInt2 & 0x7ff;
  11428. int l = i * i + j * j;
  11429. if(l > 6400)
  11430. return;
  11431. int i1 = Model.modelIntArray1[k];
  11432. int j1 = Model.modelIntArray2[k];
  11433. i1 = (i1 * 256) / (minimapInt3 + 256);
  11434. j1 = (j1 * 256) / (minimapInt3 + 256);
  11435. int k1 = j * i1 + i * j1 >> 16;
  11436. int l1 = j * j1 - i * i1 >> 16;
  11437. if(!newMap && !isFullScreen) {
  11438. sprite.drawSprite((((94 + k1) - sprite.anInt1444 / 2) + 4)+x+markX, (83 - l1 - sprite.anInt1445 / 2 - 4)+markY);
  11439. }
  11440. if(isFullScreen) {
  11441. sprite.drawSprite((((94 + k1) - sprite.anInt1444 / 2) + 4)+x+markX, (83 - l1 - sprite.anInt1445 / 2 - 4)+markY);
  11442. }
  11443. if(newMap && !isFullScreen) {
  11444. sprite.drawSprite(((123 + k1) - sprite.anInt1444 / 2) + 4 , 89 - l1 - sprite.anInt1445 / 2 - 4);
  11445. }
  11446. }
  11447. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  11448. )
  11449. {
  11450. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  11451. {
  11452. if(lowMem && j != plane)
  11453. return;
  11454. int i2 = 0;
  11455. if(j1 == 0)
  11456. i2 = worldController.method300(j, i1, i);
  11457. if(j1 == 1)
  11458. i2 = worldController.method301(j, i1, i);
  11459. if(j1 == 2)
  11460. i2 = worldController.method302(j, i1, i);
  11461. if(j1 == 3)
  11462. i2 = worldController.method303(j, i1, i);
  11463. if(i2 != 0)
  11464. {
  11465. int i3 = worldController.method304(j, i1, i, i2);
  11466. int j2 = i2 >> 14 & 0x7fff;
  11467. int k2 = i3 & 0x1f;
  11468. int l2 = i3 >> 6;
  11469. if(j1 == 0)
  11470. {
  11471. worldController.method291(i1, j, i, (byte)-119);
  11472. ObjectDef class46 = ObjectDef.forID(j2);
  11473. if(class46.aBoolean767)
  11474. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  11475. }
  11476. if(j1 == 1)
  11477. worldController.method292(i, j, i1);
  11478. if(j1 == 2)
  11479. {
  11480. worldController.method293(j, i1, i);
  11481. ObjectDef class46_1 = ObjectDef.forID(j2);
  11482. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  11483. return;
  11484. if(class46_1.aBoolean767)
  11485. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  11486. }
  11487. if(j1 == 3)
  11488. {
  11489. worldController.method294(j, i, i1);
  11490. ObjectDef class46_2 = ObjectDef.forID(j2);
  11491. if(class46_2.aBoolean767 && class46_2.hasActions)
  11492. aClass11Array1230[j].method218(i, i1);
  11493. }
  11494. }
  11495. if(k1 >= 0)
  11496. {
  11497. int j3 = j;
  11498. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11499. j3++;
  11500. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  11501. }
  11502. }
  11503. }
  11504. private void updatePlayers(int i, Stream stream)
  11505. {
  11506. anInt839 = 0;
  11507. anInt893 = 0;
  11508. method117(stream);
  11509. method134(stream);
  11510. method91(stream, i);
  11511. method49(stream);
  11512. for(int k = 0; k < anInt839; k++)
  11513. {
  11514. int l = anIntArray840[k];
  11515. if(playerArray[l].anInt1537 != loopCycle)
  11516. playerArray[l] = null;
  11517. }
  11518. if(stream.currentOffset != i)
  11519. {
  11520. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  11521. throw new RuntimeException("eek");
  11522. }
  11523. for(int i1 = 0; i1 < playerCount; i1++)
  11524. if(playerArray[playerIndices[i1]] == null)
  11525. {
  11526. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  11527. throw new RuntimeException("eek");
  11528. }
  11529. }
  11530. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  11531. {
  11532. int l1 = 2048 - k & 0x7ff;
  11533. int i2 = 2048 - j1 & 0x7ff;
  11534. int j2 = 0;
  11535. int k2 = 0;
  11536. int l2 = j;
  11537. if(l1 != 0)
  11538. {
  11539. int i3 = Model.modelIntArray1[l1];
  11540. int k3 = Model.modelIntArray2[l1];
  11541. int i4 = k2 * k3 - l2 * i3 >> 16;
  11542. l2 = k2 * i3 + l2 * k3 >> 16;
  11543. k2 = i4;
  11544. }
  11545. if(i2 != 0)
  11546. {
  11547. /* xxx if(cameratoggle){
  11548. if(zoom == 0)
  11549. zoom = k2;
  11550. if(lftrit == 0)
  11551. lftrit = j2;
  11552. if(fwdbwd == 0)
  11553. fwdbwd = l2;
  11554. k2 = zoom;
  11555. j2 = lftrit;
  11556. l2 = fwdbwd;
  11557. }
  11558. */
  11559. int j3 = Model.modelIntArray1[i2];
  11560. int l3 = Model.modelIntArray2[i2];
  11561. int j4 = l2 * j3 + j2 * l3 >> 16;
  11562. l2 = l2 * l3 - j2 * j3 >> 16;
  11563. j2 = j4;
  11564. }
  11565. xCameraPos = l - j2;
  11566. zCameraPos = i1 - k2;
  11567. yCameraPos = k1 - l2;
  11568. yCameraCurve = k;
  11569. xCameraCurve = j1;
  11570. }
  11571. public void updateStrings(String str, int i) {
  11572. switch(i) {
  11573. case 1675: sendFrame126(str, 17508); break;//Stab
  11574. case 1676: sendFrame126(str, 17509); break;//Slash
  11575. case 1677: sendFrame126(str, 17510); break;//Cursh
  11576. case 1678: sendFrame126(str, 17511); break;//Magic
  11577. case 1679: sendFrame126(str, 17512); break;//Range
  11578. case 1680: sendFrame126(str, 17513); break;//Stab
  11579. case 1681: sendFrame126(str, 17514); break;//Slash
  11580. case 1682: sendFrame126(str, 17515); break;//Crush
  11581. case 1683: sendFrame126(str, 17516); break;//Magic
  11582. case 1684: sendFrame126(str, 17517); break;//Range
  11583. case 1686: sendFrame126(str, 17518); break;//Strength
  11584. case 1687: sendFrame126(str, 17519); break;//Prayer
  11585. }
  11586. }
  11587. public void sendFrame126(String str,int i) {
  11588. RSInterface.interfaceCache[i].message = str;
  11589. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  11590. needDrawTabArea = true;
  11591. }
  11592. public void sendPacket185(int button,int toggle,int type) {
  11593. switch(type) {
  11594. case 135:
  11595. RSInterface class9 = RSInterface.interfaceCache[button];
  11596. boolean flag8 = true;
  11597. if(class9.contentType > 0)
  11598. flag8 = promptUserForInput(class9);
  11599. if(flag8) {
  11600. stream.createFrame(185);
  11601. stream.writeWord(button);
  11602. }
  11603. break;
  11604. case 646:
  11605. stream.createFrame(185);
  11606. stream.writeWord(button);
  11607. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11608. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  11609. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11610. variousSettings[toggle] = class9_2.anIntArray212[0];
  11611. method33(toggle);
  11612. needDrawTabArea = true;
  11613. }
  11614. }
  11615. break;
  11616. case 169:
  11617. stream.createFrame(185);
  11618. stream.writeWord(button);
  11619. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11620. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  11621. variousSettings[toggle] = 1 - variousSettings[toggle];
  11622. method33(toggle);
  11623. needDrawTabArea = true;
  11624. }
  11625. switch(button) {
  11626. case 19136:
  11627. System.out.println("toggle = "+toggle);
  11628. if(toggle == 0)
  11629. sendFrame36(173,toggle);
  11630. if(toggle == 1)
  11631. sendPacket185(153,173,646);
  11632. break;
  11633. }
  11634. break;
  11635. }
  11636. }
  11637. public void sendFrame36(int id,int state) {
  11638. anIntArray1045[id] = state;
  11639. if(variousSettings[id] != state) {
  11640. variousSettings[id] = state;
  11641. method33(id);
  11642. needDrawTabArea = true;
  11643. if(dialogID != -1)
  11644. inputTaken = true;
  11645. }
  11646. }
  11647. public void sendFrame219() {
  11648. if(invOverlayInterfaceID != -1) {
  11649. invOverlayInterfaceID = -1;
  11650. needDrawTabArea = true;
  11651. tabAreaAltered = true;
  11652. }
  11653. if(backDialogID != -1) {
  11654. backDialogID = -1;
  11655. inputTaken = true;
  11656. }
  11657. if(inputDialogState != 0) {
  11658. inputDialogState = 0;
  11659. inputTaken = true;
  11660. }
  11661. openInterfaceID = -1;
  11662. aBoolean1149 = false;
  11663. }
  11664. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  11665. if(backDialogID != -1) {
  11666. backDialogID = -1;
  11667. inputTaken = true;
  11668. }
  11669. if(inputDialogState != 0) {
  11670. inputDialogState = 0;
  11671. inputTaken = true;
  11672. }
  11673. openInterfaceID = interfaceID;
  11674. invOverlayInterfaceID = sideInterfaceID;
  11675. needDrawTabArea = true;
  11676. tabAreaAltered = true;
  11677. aBoolean1149 = false;
  11678. }
  11679. private boolean parsePacket() {
  11680. if(socketStream == null)
  11681. return false;
  11682. try {
  11683. int i = socketStream.available();
  11684. if(i == 0)
  11685. return false;
  11686. if(pktType == -1) {
  11687. socketStream.flushInputStream(inStream.buffer, 1);
  11688. pktType = inStream.buffer[0] & 0xff;
  11689. if(encryption != null)
  11690. pktType = pktType - encryption.getNextKey() & 0xff;
  11691. pktSize = SizeConstants.packetSizes[pktType];
  11692. i--;
  11693. }
  11694. if(pktSize == -1)
  11695. if(i > 0) {
  11696. socketStream.flushInputStream(inStream.buffer, 1);
  11697. pktSize = inStream.buffer[0] & 0xff;
  11698. i--;
  11699. } else {
  11700. return false;
  11701. }
  11702. if(pktSize == -2)
  11703. if(i > 1) {
  11704. socketStream.flushInputStream(inStream.buffer, 2);
  11705. inStream.currentOffset = 0;
  11706. pktSize = inStream.readUnsignedWord();
  11707. i -= 2;
  11708. } else {
  11709. return false;
  11710. }
  11711. if(i < pktSize)
  11712. return false;
  11713. inStream.currentOffset = 0;
  11714. socketStream.flushInputStream(inStream.buffer, pktSize);
  11715. anInt1009 = 0;
  11716. anInt843 = anInt842;
  11717. anInt842 = anInt841;
  11718. anInt841 = pktType;
  11719. switch(pktType) {
  11720. case 81:
  11721. updatePlayers(pktSize, inStream);
  11722. aBoolean1080 = false;
  11723. pktType = -1;
  11724. return true;
  11725. case 176:
  11726. daysSinceRecovChange = inStream.method427();
  11727. unreadMessages = inStream.method435();
  11728. membersInt = inStream.readUnsignedByte();
  11729. anInt1193 = inStream.method440();
  11730. daysSinceLastLogin = inStream.readUnsignedWord();
  11731. if(anInt1193 != 0 && openInterfaceID == -1) {
  11732. signlink.dnslookup(TextClass.method586(anInt1193));
  11733. clearTopInterfaces();
  11734. char c = '\u028A';
  11735. if(daysSinceRecovChange != 201 || membersInt == 1)
  11736. c = '\u028F';
  11737. reportAbuseInput = "";
  11738. canMute = false;
  11739. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11740. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11741. continue;
  11742. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11743. }
  11744. }
  11745. pktType = -1;
  11746. return true;
  11747. case 64:
  11748. anInt1268 = inStream.method427();
  11749. anInt1269 = inStream.method428();
  11750. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  11751. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11752. if(groundArray[plane][j][l9] != null) {
  11753. groundArray[plane][j][l9] = null;
  11754. spawnGroundItem(j, l9);
  11755. }
  11756. }
  11757. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11758. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11759. class30_sub1.anInt1294 = 0;
  11760. pktType = -1;
  11761. return true;
  11762. case 185:
  11763. int k = inStream.method436();
  11764. RSInterface.interfaceCache[k].anInt233 = 3;
  11765. if(myPlayer.desc == null)
  11766. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25) + (myPlayer.anIntArray1700[4] << 20) + (myPlayer.equipment[0] << 15) + (myPlayer.equipment[8] << 10) + (myPlayer.equipment[11] << 5) + myPlayer.equipment[1];
  11767. else
  11768. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  11769. pktType = -1;
  11770. return true;
  11771. /* Clan chat packet */
  11772. case 217:
  11773. try {
  11774. name = inStream.readString();
  11775. message = inStream.readString();
  11776. clanname = inStream.readString();
  11777. rights = inStream.readUnsignedWord();
  11778. //message = TextInput.processText(message);
  11779. //message = Censor.doCensor(message);
  11780. System.out.println(clanname);
  11781. pushMessage(message, 16, name);
  11782. } catch(Exception e) {
  11783. e.printStackTrace();
  11784. }
  11785. pktType = -1;
  11786. return true;
  11787. case 107:
  11788. aBoolean1160 = false;
  11789. for(int l = 0; l < 5; l++)
  11790. aBooleanArray876[l] = false;
  11791. xpCounter = 0;
  11792. pktType = -1;
  11793. return true;
  11794. case 72:
  11795. int i1 = inStream.method434();
  11796. RSInterface class9 = RSInterface.interfaceCache[i1];
  11797. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11798. class9.inv[k15] = -1;
  11799. class9.inv[k15] = 0;
  11800. }
  11801. pktType = -1;
  11802. return true;
  11803. case 214:
  11804. ignoreCount = pktSize / 8;
  11805. for(int j1 = 0; j1 < ignoreCount; j1++)
  11806. ignoreListAsLongs[j1] = inStream.readQWord();
  11807. pktType = -1;
  11808. return true;
  11809. case 166:
  11810. aBoolean1160 = true;
  11811. anInt1098 = inStream.readUnsignedByte();
  11812. anInt1099 = inStream.readUnsignedByte();
  11813. anInt1100 = inStream.readUnsignedWord();
  11814. anInt1101 = inStream.readUnsignedByte();
  11815. anInt1102 = inStream.readUnsignedByte();
  11816. if(anInt1102 >= 100) {
  11817. xCameraPos = anInt1098 * 128 + 64;
  11818. yCameraPos = anInt1099 * 128 + 64;
  11819. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11820. }
  11821. pktType = -1;
  11822. return true;
  11823. case 134:
  11824. needDrawTabArea = true;
  11825. int k1 = inStream.readUnsignedByte();
  11826. int i10 = inStream.method439();
  11827. int l15 = inStream.readUnsignedByte();
  11828. int xp = currentExp[k1];
  11829. currentExp[k1] = i10;
  11830. currentStats[k1] = l15;
  11831. maxStats[k1] = 1;
  11832. xpCounter += currentExp[k1]-xp;
  11833. expAdded = currentExp[k1]-xp;
  11834. for(int k20 = 0; k20 < 98; k20++)
  11835. if(i10 >= anIntArray1019[k20])
  11836. maxStats[k1] = k20 + 2;
  11837. pktType = -1;
  11838. return true;
  11839. case 71:
  11840. int l1 = inStream.readUnsignedWord();
  11841. int j10 = inStream.method426();
  11842. if(l1 == 65535)
  11843. l1 = -1;
  11844. tabInterfaceIDs[j10] = l1;
  11845. needDrawTabArea = true;
  11846. tabAreaAltered = true;
  11847. pktType = -1;
  11848. return true;
  11849. case 74:
  11850. int i2 = inStream.method434();
  11851. if(i2 == 65535)
  11852. i2 = -1;
  11853. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11854. nextSong = i2;
  11855. songChanging = true;
  11856. onDemandFetcher.method558(2, nextSong);
  11857. }
  11858. currentSong = i2;
  11859. pktType = -1;
  11860. return true;
  11861. case 121:
  11862. int j2 = inStream.method436();
  11863. int k10 = inStream.method435();
  11864. if(musicEnabled && !lowMem) {
  11865. nextSong = j2;
  11866. songChanging = false;
  11867. onDemandFetcher.method558(2, nextSong);
  11868. prevSong = k10;
  11869. }
  11870. pktType = -1;
  11871. return true;
  11872. case 109:
  11873. resetLogout();
  11874. pktType = -1;
  11875. return false;
  11876. case 70:
  11877. int k2 = inStream.readSignedWord();
  11878. int l10 = inStream.method437();
  11879. int i16 = inStream.method434();
  11880. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11881. class9_5.anInt263 = k2;
  11882. class9_5.anInt265 = l10;
  11883. pktType = -1;
  11884. return true;
  11885. case 73:
  11886. case 241:
  11887. int l2 = anInt1069;
  11888. int i11 = anInt1070;
  11889. if(pktType == 73) {
  11890. l2 = inStream.method435();
  11891. i11 = inStream.readUnsignedWord();
  11892. aBoolean1159 = false;
  11893. }
  11894. if(pktType == 241) {
  11895. i11 = inStream.method435();
  11896. inStream.initBitAccess();
  11897. for(int j16 = 0; j16 < 4; j16++) {
  11898. for(int l20 = 0; l20 < 13; l20++) {
  11899. for(int j23 = 0; j23 < 13; j23++) {
  11900. int i26 = inStream.readBits(1);
  11901. if(i26 == 1)
  11902. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11903. else
  11904. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11905. }
  11906. }
  11907. }
  11908. inStream.finishBitAccess();
  11909. l2 = inStream.readUnsignedWord();
  11910. aBoolean1159 = true;
  11911. }
  11912. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11913. pktType = -1;
  11914. return true;
  11915. }
  11916. anInt1069 = l2;
  11917. anInt1070 = i11;
  11918. baseX = (anInt1069 - 6) * 8;
  11919. baseY = (anInt1070 - 6) * 8;
  11920. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11921. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11922. aBoolean1141 = true;
  11923. loadingStage = 1;
  11924. aLong824 = System.currentTimeMillis();
  11925. aRSImageProducer_1165.initDrawingArea();
  11926. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11927. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11928. aRSImageProducer_1165.drawGraphics(isFullScreen ? 0 : 4, super.graphics, isFullScreen ? 0 : 4);
  11929. if(pktType == 73) {
  11930. int k16 = 0;
  11931. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11932. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11933. k16++;
  11934. }
  11935. aByteArrayArray1183 = new byte[k16][];
  11936. aByteArrayArray1247 = new byte[k16][];
  11937. anIntArray1234 = new int[k16];
  11938. anIntArray1235 = new int[k16];
  11939. anIntArray1236 = new int[k16];
  11940. k16 = 0;
  11941. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11942. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11943. anIntArray1234[k16] = (l23 << 8) + j26;
  11944. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11945. anIntArray1235[k16] = -1;
  11946. anIntArray1236[k16] = -1;
  11947. k16++;
  11948. } else {
  11949. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11950. if(k28 != -1)
  11951. onDemandFetcher.method558(3, k28);
  11952. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11953. if(j30 != -1)
  11954. onDemandFetcher.method558(3, j30);
  11955. k16++;
  11956. }
  11957. }
  11958. }
  11959. }
  11960. if(pktType == 241) {
  11961. int l16 = 0;
  11962. int ai[] = new int[676];
  11963. for(int i24 = 0; i24 < 4; i24++) {
  11964. for(int k26 = 0; k26 < 13; k26++) {
  11965. for(int l28 = 0; l28 < 13; l28++) {
  11966. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11967. if(k30 != -1) {
  11968. int k31 = k30 >> 14 & 0x3ff;
  11969. int i32 = k30 >> 3 & 0x7ff;
  11970. int k32 = (k31 / 8 << 8) + i32 / 8;
  11971. for(int j33 = 0; j33 < l16; j33++) {
  11972. if(ai[j33] != k32)
  11973. continue;
  11974. k32 = -1;
  11975. }
  11976. if(k32 != -1)
  11977. ai[l16++] = k32;
  11978. }
  11979. }
  11980. }
  11981. }
  11982. aByteArrayArray1183 = new byte[l16][];
  11983. aByteArrayArray1247 = new byte[l16][];
  11984. anIntArray1234 = new int[l16];
  11985. anIntArray1235 = new int[l16];
  11986. anIntArray1236 = new int[l16];
  11987. for(int l26 = 0; l26 < l16; l26++) {
  11988. int i29 = anIntArray1234[l26] = ai[l26];
  11989. int l30 = i29 >> 8 & 0xff;
  11990. int l31 = i29 & 0xff;
  11991. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11992. if(j32 != -1)
  11993. onDemandFetcher.method558(3, j32);
  11994. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11995. if(i33 != -1)
  11996. onDemandFetcher.method558(3, i33);
  11997. }
  11998. }
  11999. int i17 = baseX - anInt1036;
  12000. int j21 = baseY - anInt1037;
  12001. anInt1036 = baseX;
  12002. anInt1037 = baseY;
  12003. for(int j24 = 0; j24 < 16384; j24++) {
  12004. NPC npc = npcArray[j24];
  12005. if(npc != null) {
  12006. for(int j29 = 0; j29 < 10; j29++) {
  12007. npc.smallX[j29] -= i17;
  12008. npc.smallY[j29] -= j21;
  12009. }
  12010. npc.x -= i17 * 128;
  12011. npc.y -= j21 * 128;
  12012. }
  12013. }
  12014. for(int i27 = 0; i27 < maxPlayers; i27++) {
  12015. Player player = playerArray[i27];
  12016. if(player != null) {
  12017. for(int i31 = 0; i31 < 10; i31++) {
  12018. player.smallX[i31] -= i17;
  12019. player.smallY[i31] -= j21;
  12020. }
  12021. player.x -= i17 * 128;
  12022. player.y -= j21 * 128;
  12023. }
  12024. }
  12025. aBoolean1080 = true;
  12026. byte byte1 = 0;
  12027. byte byte2 = 104;
  12028. byte byte3 = 1;
  12029. if(i17 < 0) {
  12030. byte1 = 103;
  12031. byte2 = -1;
  12032. byte3 = -1;
  12033. }
  12034. byte byte4 = 0;
  12035. byte byte5 = 104;
  12036. byte byte6 = 1;
  12037. if(j21 < 0) {
  12038. byte4 = 103;
  12039. byte5 = -1;
  12040. byte6 = -1;
  12041. }
  12042. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  12043. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  12044. int i34 = k33 + i17;
  12045. int j34 = l33 + j21;
  12046. for(int k34 = 0; k34 < 4; k34++)
  12047. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12048. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12049. else
  12050. groundArray[k34][k33][l33] = null;
  12051. }
  12052. }
  12053. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  12054. class30_sub1_1.anInt1297 -= i17;
  12055. class30_sub1_1.anInt1298 -= j21;
  12056. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  12057. class30_sub1_1.unlink();
  12058. }
  12059. if(destX != 0) {
  12060. destX -= i17;
  12061. destY -= j21;
  12062. }
  12063. aBoolean1160 = false;
  12064. pktType = -1;
  12065. return true;
  12066. case 208:
  12067. int i3 = inStream.method437();
  12068. if(i3 >= 0)
  12069. method60(i3);
  12070. anInt1018 = i3;
  12071. pktType = -1;
  12072. return true;
  12073. case 99:
  12074. anInt1021 = inStream.readUnsignedByte();
  12075. pktType = -1;
  12076. return true;
  12077. case 75:
  12078. int j3 = inStream.method436();
  12079. int j11 = inStream.method436();
  12080. RSInterface.interfaceCache[j11].anInt233 = 2;
  12081. RSInterface.interfaceCache[j11].mediaID = j3;
  12082. pktType = -1;
  12083. return true;
  12084. case 114:
  12085. anInt1104 = inStream.method434() * 30;
  12086. pktType = -1;
  12087. return true;
  12088. case 60:
  12089. anInt1269 = inStream.readUnsignedByte();
  12090. anInt1268 = inStream.method427();
  12091. while(inStream.currentOffset < pktSize) {
  12092. int k3 = inStream.readUnsignedByte();
  12093. method137(inStream, k3);
  12094. }
  12095. pktType = -1;
  12096. return true;
  12097. case 35:
  12098. int l3 = inStream.readUnsignedByte();
  12099. int k11 = inStream.readUnsignedByte();
  12100. int j17 = inStream.readUnsignedByte();
  12101. int k21 = inStream.readUnsignedByte();
  12102. aBooleanArray876[l3] = true;
  12103. anIntArray873[l3] = k11;
  12104. anIntArray1203[l3] = j17;
  12105. anIntArray928[l3] = k21;
  12106. anIntArray1030[l3] = 0;
  12107. pktType = -1;
  12108. return true;
  12109. case 174:
  12110. int i4 = inStream.readUnsignedWord();
  12111. int l11 = inStream.readUnsignedByte();
  12112. int k17 = inStream.readUnsignedWord();
  12113. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  12114. anIntArray1207[anInt1062] = i4;
  12115. anIntArray1241[anInt1062] = l11;
  12116. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  12117. anInt1062++;
  12118. }
  12119. pktType = -1;
  12120. return true;
  12121. case 104:
  12122. int j4 = inStream.method427();
  12123. int i12 = inStream.method426();
  12124. String s6 = inStream.readString();
  12125. if(j4 >= 1 && j4 <= 5) {
  12126. if(s6.equalsIgnoreCase("null"))
  12127. s6 = null;
  12128. atPlayerActions[j4 - 1] = s6;
  12129. atPlayerArray[j4 - 1] = i12 == 0;
  12130. }
  12131. pktType = -1;
  12132. return true;
  12133. case 78:
  12134. destX = 0;
  12135. pktType = -1;
  12136. return true;
  12137. case 253:
  12138. String s = inStream.readString();
  12139. if(s.endsWith(":tradereq:")) {
  12140. String s3 = s.substring(0, s.indexOf(":"));
  12141. long l17 = TextClass.longForName(s3);
  12142. boolean flag2 = false;
  12143. for(int j27 = 0; j27 < ignoreCount; j27++) {
  12144. if(ignoreListAsLongs[j27] != l17)
  12145. continue;
  12146. flag2 = true;
  12147. }
  12148. if(!flag2 && anInt1251 == 0)
  12149. pushMessage("wishes to trade with you.", 4, s3);
  12150. } else if (s.endsWith(":clan:")) {
  12151. String s4 = s.substring(0, s.indexOf(":"));
  12152. long l18 = TextClass.longForName(s4);
  12153. pushMessage("Clan: ", 8, s4);
  12154. } else if(s.endsWith("#url#")) {
  12155. String link = s.substring(0, s.indexOf("#"));
  12156. pushMessage("Join us at: ", 9, link);
  12157. } else if(s.endsWith(":duelreq:")) {
  12158. String s4 = s.substring(0, s.indexOf(":"));
  12159. long l18 = TextClass.longForName(s4);
  12160. boolean flag3 = false;
  12161. for(int k27 = 0; k27 < ignoreCount; k27++) {
  12162. if(ignoreListAsLongs[k27] != l18)
  12163. continue;
  12164. flag3 = true;
  12165. }
  12166. if(!flag3 && anInt1251 == 0)
  12167. pushMessage("wishes to duel with you.", 8, s4);
  12168. } else if(s.endsWith(":chalreq:")) {
  12169. String s5 = s.substring(0, s.indexOf(":"));
  12170. long l19 = TextClass.longForName(s5);
  12171. boolean flag4 = false;
  12172. for(int l27 = 0; l27 < ignoreCount; l27++) {
  12173. if(ignoreListAsLongs[l27] != l19)
  12174. continue;
  12175. flag4 = true;
  12176. }
  12177. if(!flag4 && anInt1251 == 0) {
  12178. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12179. pushMessage(s8, 8, s5);
  12180. }
  12181. } else {
  12182. pushMessage(s, 0, "");
  12183. }
  12184. pktType = -1;
  12185. return true;
  12186. case 1:
  12187. for(int k4 = 0; k4 < playerArray.length; k4++)
  12188. if(playerArray[k4] != null)
  12189. playerArray[k4].anim = -1;
  12190. for(int j12 = 0; j12 < npcArray.length; j12++)
  12191. if(npcArray[j12] != null)
  12192. npcArray[j12].anim = -1;
  12193. pktType = -1;
  12194. return true;
  12195. case 50:
  12196. long l4 = inStream.readQWord();
  12197. int i18 = inStream.readUnsignedByte();
  12198. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12199. for(int k24 = 0; k24 < friendsCount; k24++) {
  12200. if(l4 != friendsListAsLongs[k24])
  12201. continue;
  12202. if(friendsNodeIDs[k24] != i18) {
  12203. friendsNodeIDs[k24] = i18;
  12204. needDrawTabArea = true;
  12205. if(i18 >= 2) {
  12206. pushMessage(s7 + " has logged in.", 5, "");
  12207. }
  12208. if(i18 <= 1) {
  12209. pushMessage(s7 + " has logged out.", 5, "");
  12210. }
  12211. }
  12212. s7 = null;
  12213. }
  12214. if(s7 != null && friendsCount < 200) {
  12215. friendsListAsLongs[friendsCount] = l4;
  12216. friendsList[friendsCount] = s7;
  12217. friendsNodeIDs[friendsCount] = i18;
  12218. friendsCount++;
  12219. needDrawTabArea = true;
  12220. }
  12221. for(boolean flag6 = false; !flag6;) {
  12222. flag6 = true;
  12223. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  12224. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  12225. int j31 = friendsNodeIDs[k29];
  12226. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12227. friendsNodeIDs[k29 + 1] = j31;
  12228. String s10 = friendsList[k29];
  12229. friendsList[k29] = friendsList[k29 + 1];
  12230. friendsList[k29 + 1] = s10;
  12231. long l32 = friendsListAsLongs[k29];
  12232. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12233. friendsListAsLongs[k29 + 1] = l32;
  12234. needDrawTabArea = true;
  12235. flag6 = false;
  12236. }
  12237. }
  12238. pktType = -1;
  12239. return true;
  12240. case 110:
  12241. if(tabID == 12)
  12242. needDrawTabArea = true;
  12243. energy = inStream.readUnsignedByte();
  12244. pktType = -1;
  12245. return true;
  12246. case 254:
  12247. anInt855 = inStream.readUnsignedByte();
  12248. if(anInt855 == 1)
  12249. anInt1222 = inStream.readUnsignedWord();
  12250. if(anInt855 >= 2 && anInt855 <= 6) {
  12251. if(anInt855 == 2) {
  12252. anInt937 = 64;
  12253. anInt938 = 64;
  12254. }
  12255. if(anInt855 == 3) {
  12256. anInt937 = 0;
  12257. anInt938 = 64;
  12258. }
  12259. if(anInt855 == 4) {
  12260. anInt937 = 128;
  12261. anInt938 = 64;
  12262. }
  12263. if(anInt855 == 5) {
  12264. anInt937 = 64;
  12265. anInt938 = 0;
  12266. }
  12267. if(anInt855 == 6) {
  12268. anInt937 = 64;
  12269. anInt938 = 128;
  12270. }
  12271. anInt855 = 2;
  12272. anInt934 = inStream.readUnsignedWord();
  12273. anInt935 = inStream.readUnsignedWord();
  12274. anInt936 = inStream.readUnsignedByte();
  12275. }
  12276. if(anInt855 == 10)
  12277. anInt933 = inStream.readUnsignedWord();
  12278. pktType = -1;
  12279. return true;
  12280. case 248:
  12281. int i5 = inStream.method435();
  12282. int k12 = inStream.readUnsignedWord();
  12283. if(backDialogID != -1) {
  12284. backDialogID = -1;
  12285. inputTaken = true;
  12286. }
  12287. if(inputDialogState != 0) {
  12288. inputDialogState = 0;
  12289. inputTaken = true;
  12290. }
  12291. openInterfaceID = i5;
  12292. invOverlayInterfaceID = k12;
  12293. needDrawTabArea = true;
  12294. tabAreaAltered = true;
  12295. aBoolean1149 = false;
  12296. pktType = -1;
  12297. return true;
  12298. case 79:
  12299. int j5 = inStream.method434();
  12300. int l12 = inStream.method435();
  12301. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12302. if(class9_3 != null && class9_3.type == 0) {
  12303. if(l12 < 0)
  12304. l12 = 0;
  12305. if(l12 > class9_3.scrollMax - class9_3.height)
  12306. l12 = class9_3.scrollMax - class9_3.height;
  12307. class9_3.scrollPosition = l12;
  12308. }
  12309. pktType = -1;
  12310. return true;
  12311. case 68:
  12312. for(int k5 = 0; k5 < variousSettings.length; k5++)
  12313. if(variousSettings[k5] != anIntArray1045[k5]) {
  12314. variousSettings[k5] = anIntArray1045[k5];
  12315. method33(k5);
  12316. needDrawTabArea = true;
  12317. }
  12318. pktType = -1;
  12319. return true;
  12320. case 196:
  12321. long l5 = inStream.readQWord();
  12322. int j18 = inStream.readDWord();
  12323. int l21 = inStream.readUnsignedByte();
  12324. boolean flag5 = false;
  12325. for(int i28 = 0; i28 < 100; i28++) {
  12326. if(anIntArray1240[i28] != j18)
  12327. continue;
  12328. flag5 = true;
  12329. }
  12330. if(l21 <= 1) {
  12331. for(int l29 = 0; l29 < ignoreCount; l29++) {
  12332. if(ignoreListAsLongs[l29] != l5)
  12333. continue;
  12334. flag5 = true;
  12335. }
  12336. }
  12337. if(!flag5 && anInt1251 == 0)
  12338. try {
  12339. anIntArray1240[anInt1169] = j18;
  12340. anInt1169 = (anInt1169 + 1) % 100;
  12341. String s9 = TextInput.method525(pktSize - 13, inStream);
  12342. //if(l21 != 3)
  12343. //s9 = Censor.doCensor(s9);
  12344. if(l21 == 2 || l21 == 3)
  12345. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12346. else
  12347. if(l21 == 1)
  12348. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12349. else
  12350. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  12351. } catch(Exception exception1) {
  12352. signlink.reporterror("cde1");
  12353. }
  12354. pktType = -1;
  12355. return true;
  12356. case 85:
  12357. anInt1269 = inStream.method427();
  12358. anInt1268 = inStream.method427();
  12359. pktType = -1;
  12360. return true;
  12361. case 24:
  12362. anInt1054 = inStream.method428();
  12363. if(anInt1054 == tabID) {
  12364. if(anInt1054 == 3)
  12365. tabID = 1;
  12366. else
  12367. tabID = 3;
  12368. needDrawTabArea = true;
  12369. }
  12370. pktType = -1;
  12371. return true;
  12372. case 246:
  12373. int i6 = inStream.method434();
  12374. int i13 = inStream.readUnsignedWord();
  12375. int k18 = inStream.readUnsignedWord();
  12376. if(k18 == 65535) {
  12377. RSInterface.interfaceCache[i6].anInt233 = 0;
  12378. pktType = -1;
  12379. return true;
  12380. } else {
  12381. ItemDef itemDef = ItemDef.forID(k18);
  12382. RSInterface.interfaceCache[i6].anInt233 = 4;
  12383. RSInterface.interfaceCache[i6].mediaID = k18;
  12384. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  12385. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  12386. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  12387. pktType = -1;
  12388. return true;
  12389. }
  12390. case 171:
  12391. boolean flag1 = inStream.readUnsignedByte() == 1;
  12392. int j13 = inStream.readUnsignedWord();
  12393. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  12394. pktType = -1;
  12395. return true;
  12396. case 142:
  12397. int j6 = inStream.method434();
  12398. method60(j6);
  12399. if(backDialogID != -1) {
  12400. backDialogID = -1;
  12401. inputTaken = true;
  12402. }
  12403. if(inputDialogState != 0) {
  12404. inputDialogState = 0;
  12405. inputTaken = true;
  12406. }
  12407. invOverlayInterfaceID = j6;
  12408. needDrawTabArea = true;
  12409. tabAreaAltered = true;
  12410. openInterfaceID = -1;
  12411. aBoolean1149 = false;
  12412. pktType = -1;
  12413. return true;
  12414. case 126:
  12415. String text = inStream.readString();
  12416. int frame = inStream.method435();
  12417. if (text.startsWith("www.")) {
  12418. launchURL(text);
  12419. pktType = -1;
  12420. return true;
  12421. }
  12422. updateStrings(text, frame);
  12423. sendFrame126(text, frame);
  12424. if (frame >= 18144 && frame <= 18244) {
  12425. clanList[frame - 18144] = text;
  12426. }
  12427. pktType = -1;
  12428. return true;
  12429. case 206:
  12430. publicChatMode = inStream.readUnsignedByte();
  12431. privateChatMode = inStream.readUnsignedByte();
  12432. tradeMode = inStream.readUnsignedByte();
  12433. aBoolean1233 = true;
  12434. inputTaken = true;
  12435. pktType = -1;
  12436. return true;
  12437. case 240:
  12438. if(tabID == 12)
  12439. needDrawTabArea = true;
  12440. weight = inStream.readSignedWord();
  12441. pktType = -1;
  12442. return true;
  12443. case 8:
  12444. int k6 = inStream.method436();
  12445. int l13 = inStream.readUnsignedWord();
  12446. RSInterface.interfaceCache[k6].anInt233 = 1;
  12447. RSInterface.interfaceCache[k6].mediaID = l13;
  12448. pktType = -1;
  12449. return true;
  12450. case 122:
  12451. int l6 = inStream.method436();
  12452. int i14 = inStream.method436();
  12453. int i19 = i14 >> 10 & 0x1f;
  12454. int i22 = i14 >> 5 & 0x1f;
  12455. int l24 = i14 & 0x1f;
  12456. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  12457. pktType = -1;
  12458. return true;
  12459. case 53:
  12460. needDrawTabArea = true;
  12461. int i7 = inStream.readUnsignedWord();
  12462. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12463. int j19 = inStream.readUnsignedWord();
  12464. for(int j22 = 0; j22 < j19; j22++) {
  12465. int i25 = inStream.readUnsignedByte();
  12466. if(i25 == 255)
  12467. i25 = inStream.method440();
  12468. class9_1.inv[j22] = inStream.method436();
  12469. class9_1.invStackSizes[j22] = i25;
  12470. }
  12471. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12472. class9_1.inv[j25] = 0;
  12473. class9_1.invStackSizes[j25] = 0;
  12474. }
  12475. pktType = -1;
  12476. return true;
  12477. case 230:
  12478. int j7 = inStream.method435();
  12479. int j14 = inStream.readUnsignedWord();
  12480. int k19 = inStream.readUnsignedWord();
  12481. int k22 = inStream.method436();
  12482. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12483. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12484. RSInterface.interfaceCache[j14].modelZoom = j7;
  12485. pktType = -1;
  12486. return true;
  12487. case 221:
  12488. anInt900 = inStream.readUnsignedByte();
  12489. needDrawTabArea = true;
  12490. pktType = -1;
  12491. return true;
  12492. case 177:
  12493. aBoolean1160 = true;
  12494. anInt995 = inStream.readUnsignedByte();
  12495. anInt996 = inStream.readUnsignedByte();
  12496. anInt997 = inStream.readUnsignedWord();
  12497. anInt998 = inStream.readUnsignedByte();
  12498. anInt999 = inStream.readUnsignedByte();
  12499. if(anInt999 >= 100) {
  12500. int k7 = anInt995 * 128 + 64;
  12501. int k14 = anInt996 * 128 + 64;
  12502. int i20 = method42(plane, k14, k7) - anInt997;
  12503. int l22 = k7 - xCameraPos;
  12504. int k25 = i20 - zCameraPos;
  12505. int j28 = k14 - yCameraPos;
  12506. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  12507. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12508. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12509. if(yCameraCurve < 128)
  12510. yCameraCurve = 128;
  12511. if(yCameraCurve > 383)
  12512. yCameraCurve = 383;
  12513. }
  12514. pktType = -1;
  12515. return true;
  12516. case 249:
  12517. anInt1046 = inStream.method426();
  12518. unknownInt10 = inStream.method436();
  12519. pktType = -1;
  12520. return true;
  12521. case 65:
  12522. updateNPCs(inStream, pktSize);
  12523. pktType = -1;
  12524. return true;
  12525. case 27:
  12526. messagePromptRaised = false;
  12527. inputDialogState = 1;
  12528. amountOrNameInput = "";
  12529. inputTaken = true;
  12530. pktType = -1;
  12531. return true;
  12532. case 187:
  12533. messagePromptRaised = false;
  12534. inputDialogState = 2;
  12535. amountOrNameInput = "";
  12536. inputTaken = true;
  12537. pktType = -1;
  12538. return true;
  12539. case 97:
  12540. int l7 = inStream.readUnsignedWord();
  12541. method60(l7);
  12542. if(invOverlayInterfaceID != -1) {
  12543. invOverlayInterfaceID = -1;
  12544. needDrawTabArea = true;
  12545. tabAreaAltered = true;
  12546. }
  12547. if(backDialogID != -1) {
  12548. backDialogID = -1;
  12549. inputTaken = true;
  12550. }
  12551. if(inputDialogState != 0) {
  12552. inputDialogState = 0;
  12553. inputTaken = true;
  12554. }
  12555. openInterfaceID = l7;
  12556. aBoolean1149 = false;
  12557. pktType = -1;
  12558. return true;
  12559. case 218:
  12560. int i8 = inStream.method438();
  12561. dialogID = i8;
  12562. inputTaken = true;
  12563. pktType = -1;
  12564. return true;
  12565. case 87:
  12566. int j8 = inStream.method434();
  12567. int l14 = inStream.method439();
  12568. anIntArray1045[j8] = l14;
  12569. if(variousSettings[j8] != l14) {
  12570. variousSettings[j8] = l14;
  12571. method33(j8);
  12572. needDrawTabArea = true;
  12573. if(dialogID != -1)
  12574. inputTaken = true;
  12575. }
  12576. pktType = -1;
  12577. return true;
  12578. case 36:
  12579. int k8 = inStream.method434();
  12580. byte byte0 = inStream.readSignedByte();
  12581. anIntArray1045[k8] = byte0;
  12582. if(variousSettings[k8] != byte0) {
  12583. variousSettings[k8] = byte0;
  12584. method33(k8);
  12585. needDrawTabArea = true;
  12586. if(dialogID != -1)
  12587. inputTaken = true;
  12588. }
  12589. pktType = -1;
  12590. return true;
  12591. case 61:
  12592. anInt1055 = inStream.readUnsignedByte();
  12593. pktType = -1;
  12594. return true;
  12595. case 200:
  12596. int l8 = inStream.readUnsignedWord();
  12597. int i15 = inStream.readSignedWord();
  12598. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12599. class9_4.anInt257 = i15;
  12600. if(i15 == -1) {
  12601. class9_4.anInt246 = 0;
  12602. class9_4.anInt208 = 0;
  12603. }
  12604. pktType = -1;
  12605. return true;
  12606. case 219:
  12607. if(invOverlayInterfaceID != -1) {
  12608. invOverlayInterfaceID = -1;
  12609. needDrawTabArea = true;
  12610. tabAreaAltered = true;
  12611. }
  12612. if(backDialogID != -1) {
  12613. backDialogID = -1;
  12614. inputTaken = true;
  12615. }
  12616. if(inputDialogState != 0) {
  12617. inputDialogState = 0;
  12618. inputTaken = true;
  12619. }
  12620. openInterfaceID = -1;
  12621. aBoolean1149 = false;
  12622. pktType = -1;
  12623. return true;
  12624. case 34:
  12625. needDrawTabArea = true;
  12626. int i9 = inStream.readUnsignedWord();
  12627. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12628. while(inStream.currentOffset < pktSize) {
  12629. int j20 = inStream.method422();
  12630. int i23 = inStream.readUnsignedWord();
  12631. int l25 = inStream.readUnsignedByte();
  12632. if(l25 == 255)
  12633. l25 = inStream.readDWord();
  12634. if(j20 >= 0 && j20 < class9_2.inv.length) {
  12635. class9_2.inv[j20] = i23;
  12636. class9_2.invStackSizes[j20] = l25;
  12637. }
  12638. }
  12639. pktType = -1;
  12640. return true;
  12641. case 4:
  12642. case 44:
  12643. case 84:
  12644. case 101:
  12645. case 105:
  12646. case 117:
  12647. case 147:
  12648. case 151:
  12649. case 156:
  12650. case 160:
  12651. case 215:
  12652. method137(inStream, pktType);
  12653. pktType = -1;
  12654. return true;
  12655. case 106:
  12656. tabID = inStream.method427();
  12657. needDrawTabArea = true;
  12658. tabAreaAltered = true;
  12659. pktType = -1;
  12660. return true;
  12661. case 164:
  12662. int j9 = inStream.method434();
  12663. method60(j9);
  12664. if(invOverlayInterfaceID != -1) {
  12665. invOverlayInterfaceID = -1;
  12666. needDrawTabArea = true;
  12667. tabAreaAltered = true;
  12668. }
  12669. backDialogID = j9;
  12670. inputTaken = true;
  12671. openInterfaceID = -1;
  12672. aBoolean1149 = false;
  12673. pktType = -1;
  12674. return true;
  12675. }
  12676. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12677. //resetLogout();
  12678. } catch(IOException _ex) {
  12679. dropClient();
  12680. } catch(Exception exception) {
  12681. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12682. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12683. s2 = s2 + inStream.buffer[j15] + ",";
  12684. signlink.reporterror(s2);
  12685. //resetLogout();
  12686. }
  12687. pktType = -1;
  12688. return true;
  12689. }
  12690. private void method146() {
  12691. anInt1265++;
  12692. method47(true);
  12693. method26(true);
  12694. method47(false);
  12695. method26(false);
  12696. method55();
  12697. method104();
  12698. if(!aBoolean1160) {
  12699. int i = anInt1184;
  12700. if(anInt984 / 256 > i)
  12701. i = anInt984 / 256;
  12702. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12703. i = anIntArray1203[4] + 128;
  12704. int k = minimapInt1 + anInt896 & 0x7ff;
  12705. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12706. }
  12707. int j;
  12708. if(!aBoolean1160)
  12709. j = method120();
  12710. else
  12711. j = method121();
  12712. int l = xCameraPos;
  12713. int i1 = zCameraPos;
  12714. int j1 = yCameraPos;
  12715. int k1 = yCameraCurve;
  12716. int l1 = xCameraCurve;
  12717. for(int i2 = 0; i2 < 5; i2++)
  12718. if(aBooleanArray876[i2]) {
  12719. int j2 = (int)((Math.random() * (double)(anIntArray873[i2] * 2 + 1) - (double)anIntArray873[i2]) + Math.sin((double)anIntArray1030[i2] * ((double)anIntArray928[i2] / 100D)) * (double)anIntArray1203[i2]);
  12720. if(i2 == 0)
  12721. xCameraPos += j2;
  12722. if(i2 == 1)
  12723. zCameraPos += j2;
  12724. if(i2 == 2)
  12725. yCameraPos += j2;
  12726. if(i2 == 3)
  12727. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12728. if(i2 == 4) {
  12729. yCameraCurve += j2;
  12730. if(yCameraCurve < 128)
  12731. yCameraCurve = 128;
  12732. if(yCameraCurve > 383)
  12733. yCameraCurve = 383;
  12734. }
  12735. }
  12736. int k2 = Texture.anInt1481;
  12737. Model.aBoolean1684 = true;
  12738. Model.anInt1687 = 0;
  12739. Model.anInt1685 = super.mouseX - 4;
  12740. Model.anInt1686 = super.mouseY - 4;
  12741. DrawingArea.setAllPixelsToZero();
  12742. if(fog && !isFullScreen) {
  12743. DrawingArea.drawPixels(503, 0, 0, 0xC8C0A8, 765);
  12744. }
  12745. if(fog && isFullScreen) {
  12746. DrawingArea.drawPixels(clientHeight, 0, 0, 0xC8C0A8, clientWidth);
  12747. }
  12748. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12749. worldController.clearObj5Cache();
  12750. updateEntities();
  12751. drawHeadIcon();
  12752. method37(k2);
  12753. draw3dScreen();
  12754. if (counterOn)
  12755. drawCounterOnScreen();
  12756. if (isFullScreen) {
  12757. drawMinimap();
  12758. drawTabArea();
  12759. drawChatArea();
  12760. aRSImageProducer_1165.drawGraphics(0, bufferGraphics, 0);//Don't use super.graphics here, makes it update alot
  12761. super.graphics.drawImage(buffer, 0, 0, getGameComponent());
  12762. } else aRSImageProducer_1165.drawGraphics(isFullScreen ? 0 : 4, super.graphics, isFullScreen ? 0 : 4);
  12763. xCameraPos = l;
  12764. zCameraPos = i1;
  12765. yCameraPos = j1;
  12766. yCameraCurve = k1;
  12767. xCameraCurve = l1;
  12768. }
  12769. /* Orbs */
  12770. private void processXPCounterClick() {
  12771. int x = super.mouseX;
  12772. int y = super.mouseY;
  12773. int x2 = isFullScreen ? 20+extraWidth : 0;
  12774. int y2 = isFullScreen ? -32 : 0;
  12775. if (x >= 520+x2 && x <= 554+x2 && y >= 47+y2 && y <= 81+y2) {
  12776. menuActionName[menuActionRow] = "Reset XP Total";
  12777. menuActionID[menuActionRow] = 475;
  12778. menuActionRow++;
  12779. menuActionName[menuActionRow] = "Toggle XP Total";
  12780. menuActionID[menuActionRow] = 474;
  12781. menuActionRow++;
  12782. }
  12783. }
  12784. public int logIconHPos = 0;
  12785. public void drawLogoutButton() {
  12786. int x = isFullScreen ? extraWidth+510 : 0;
  12787. int y = isFullScreen ? -30: 0;
  12788. if(tabInterfaceIDs[10] != -1 && anInt1054 == 9)
  12789. if(loopCycle % 20 >= 10);
  12790. logIcon.drawSprite(225+x, 0);
  12791. if(logIconHPos == 1) {
  12792. logIconH.drawSprite(225+x, 0);
  12793. }
  12794. if(tabID == 10)
  12795. logIconC.drawSprite(225+x, 0);
  12796. }
  12797. private int xpAddedPos;
  12798. private int expAdded;
  12799. Sprite[] counter = new Sprite[4];
  12800. private void drawCounterOnScreen() {
  12801. int x = 520;
  12802. int y = 47;
  12803. int x2 = isFullScreen ? 20+extraWidth : 0;
  12804. int y2 = isFullScreen ? -32 : 0;
  12805. counter[2].drawSprite(x - 113+x2, y + 8+y2);
  12806. int length = Integer.toString(xpCounter).length();
  12807. int i = length == 1 ? 5 : ((length - 1) * 5);
  12808. smallText.method382(0xFFFFFD, x - 98+x2, "XP:", y + 21+y2, true);
  12809. if (xpCounter <= 214700000) {
  12810. smallText.method382(0xFFFFFD, x - 19+x2 - i, NumberFormat.getIntegerInstance().format(xpCounter), y + 21+y2, true);
  12811. } else if (xpCounter >= 214700000) {
  12812. smallText.method382(0xFF0000, x - 18+x2 - i, "Lots!", y + 21+y2, true);
  12813. }
  12814. if (expAdded <= 0) {
  12815. expAdded = 0;
  12816. }
  12817. if (expAdded > 0) {
  12818. counter[3].drawSprite(x - 30+x2 - i - 45, y + 18 + xpAddedPos+y2);
  12819. i = smallText.getTextWidth("" + NumberFormat.getIntegerInstance().format(expAdded) + "xp");
  12820. smallText.method382(0xff9933, x - 2+x2 - i, "" + NumberFormat.getIntegerInstance().format(expAdded) + "xp", y + 21 + 18 + xpAddedPos+y2, true);
  12821. xpAddedPos++;
  12822. if (xpAddedPos >= 50) {
  12823. xpAddedPos = 0;
  12824. expAdded = 0;
  12825. }
  12826. }
  12827. }
  12828. public int xpIconHPos = 0;
  12829. private void drawXPCounter() {
  12830. int x = isFullScreen ? 535+extraWidth : 0;
  12831. int y = isFullScreen ? -36 : 0;
  12832. if(tabInterfaceIDs[12] != -1 && anInt1054 == 9)
  12833. if(loopCycle % 20 >= 12);
  12834. counter[0].drawSprite(0+x, 47+y);
  12835. if(xpIconHPos == 1) {
  12836. counter[1].drawSprite(0+x, 47+y);
  12837. }
  12838. }
  12839. public double fillPrayer;
  12840. public boolean prayHover = false;
  12841. public boolean prayClicked = false;
  12842. public void drawPrayerOrb() {
  12843. int prayer;
  12844. String cP = RSInterface.interfaceCache[4012].message;
  12845. int currentPrayer = Integer.parseInt(cP);
  12846. String mP = RSInterface.interfaceCache[4013].message;
  12847. int maxPrayer = Integer.parseInt(mP);
  12848. prayer = (int) (((double) currentPrayer / (double) maxPrayer) * 100D);
  12849. int x = isFullScreen ? 347+extraWidth : 0;
  12850. int y = isFullScreen ? +32 : 0;
  12851. int xPos = isFullScreen ? 387+extraWidth-17 : 0;
  12852. int xPosTXT = isFullScreen ? 335+extraWidth-17 : 0;
  12853. int yPos = isFullScreen ? +32 : 0;
  12854. if(!prayClicked) {
  12855. if(prayHover && !isFullScreen) {
  12856. emptyOrbH.drawSprite(186+x, 49+y);
  12857. } else
  12858. emptyOrb.drawSprite(186+x, 49+y);
  12859. if(isFullScreen) {
  12860. //emptyOrbH = new Sprite("508/oporbH");
  12861. } else if(!prayHover) {
  12862. emptyOrb.drawSprite(186+x, 49+y);
  12863. }
  12864. prayerFill.drawSprite(189+xPos, 52+yPos);
  12865. } else if(prayClicked) {
  12866. if(prayHover) {
  12867. emptyOrbH.drawSprite(186+x, 49+y);
  12868. } else if(!prayHover) {
  12869. emptyOrb.drawSprite(186+x, 49+y);
  12870. }
  12871. prayerFillH.drawSprite(189+xPos, 52+yPos);
  12872. }
  12873. if (prayer <= 100 && prayer >= 75) {
  12874. smallText.method382(65280, 229+xPosTXT, cP, 75+yPos, true);
  12875. } else if (prayer <= 74 && prayer >= 50) {
  12876. smallText.method382(0xffff00, 229+xPosTXT, cP, 75+yPos, true);
  12877. } else if (prayer <= 49 && prayer >= 25) {
  12878. smallText.method382(0xfca607, 229+xPosTXT, cP, 75+yPos, true);
  12879. } else if (prayer <= 24 && prayer >= 0) {
  12880. smallText.method382(0xf50d0d, 229+xPosTXT, cP, 75+yPos, true);
  12881. }
  12882. double percent = (prayer / 100D);
  12883. fillPrayer = 27 * percent;
  12884. int depleteFill = 27 - (int) fillPrayer;
  12885. depleteP.myHeight = depleteFill;
  12886. depleteP.height = depleteFill;
  12887. depleteP.drawSprite(189+xPos, 52+yPos);
  12888. if (prayer <= 25) {
  12889. if (loopCycle % 20 < 10) {
  12890. prayerIcon.drawSprite(193+xPos, 56+yPos);
  12891. }
  12892. } else {
  12893. prayerIcon.drawSprite(193+xPos, 56+yPos);
  12894. }
  12895. }
  12896. public boolean runClicked = false;
  12897. public void drawRunOrb() {
  12898. Sprite orb = (runClicked ? runOrb2 : runOrb1);
  12899. Sprite icon = (runClicked ? runIcon2 : runIcon1);
  12900. int x = isFullScreen ? 358+extraWidth : 0;
  12901. int y = isFullScreen ? +32 : 0;
  12902. int x2 = isFullScreen ? extraWidth-160 : 0;
  12903. int y2 = isFullScreen ? +36 : 0;
  12904. int xPos = isFullScreen ? 387+extraWidth-5 : 0;
  12905. int xPosTXT = isFullScreen ? 335+extraWidth-5 : 0;
  12906. int yPos = isFullScreen ? +32 : 0;
  12907. if(isFullScreen) {
  12908. hoveredEmpty = new Sprite("GameFrame/Orbs/1127");
  12909. } else {
  12910. hoveredEmpty = new Sprite("GameFrame/Orbs/hoveredempty");
  12911. }
  12912. emptyOrb.drawSprite(185+x, 85+y);
  12913. if (super.mouseX > 713+x2 && super.mouseX < 765+x2 && super.mouseY > 83+y2 && super.mouseY < 118+y2){
  12914. hoveredEmpty.drawSprite(185+x, 85+y);
  12915. }
  12916. orb.drawSprite(188+xPos, 88+yPos);
  12917. icon.drawSprite(195+xPos, 93+yPos);
  12918. int colour;
  12919. colour = 65280;
  12920. smallText.method382(colour, 229+xPosTXT, "100", 111+yPos, true);
  12921. }
  12922. public double fillHP;
  12923. public void drawHPOrb() {
  12924. int health;
  12925. String cHP = RSInterface.interfaceCache[4016].message;
  12926. int currentHP = Integer.parseInt(cHP);
  12927. String mHP = RSInterface.interfaceCache[4017].message;
  12928. int maxHP2 = Integer.parseInt(mHP);
  12929. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  12930. int x = isFullScreen ? 363+extraWidth : 0;
  12931. int y = isFullScreen ? +32 : 0;
  12932. int xPos = isFullScreen ? 387+extraWidth : 0;
  12933. int xPosTXT = isFullScreen ? 335+extraWidth : 0;
  12934. int yPos = isFullScreen ? +32 : 0;
  12935. if(isFullScreen) {
  12936. emptyOrb = new Sprite("Fullscreen/oporb");
  12937. } else {
  12938. emptyOrb = new Sprite("Fullscreen/emptyorb");
  12939. }
  12940. emptyOrb.drawSprite(170+x, 13+y);
  12941. if (health <= 100 && health >= 75) {
  12942. smallText.method382(65280, 213+xPosTXT, cHP, 39+yPos, true);
  12943. } else if (health <= 74 && health >= 50) {
  12944. smallText.method382(0xffff00, 213+xPosTXT, cHP, 39+yPos, true);
  12945. } else if (health <= 49 && health >= 25) {
  12946. smallText.method382(0xfca607, 213+xPosTXT, cHP, 39+yPos, true);
  12947. } else if (health <= 24 && health >= 0) {
  12948. smallText.method382(0xf50d0d, 213+xPosTXT, cHP, 39+yPos, true);
  12949. }
  12950. hitPointsFill.drawSprite(173+xPos, 16+yPos);
  12951. double percent = (health / 100D);
  12952. fillHP = 27 * percent;
  12953. int depleteFill = 27 - (int) fillHP;
  12954. deplete.myHeight = depleteFill;
  12955. deplete.height = depleteFill;
  12956. deplete.drawSprite(173+xPos, 16+yPos);
  12957. if (health <= 20) {
  12958. if (loopCycle % 20 < 10) {
  12959. hitPointsIcon.drawSprite(179+xPos, 24+yPos);
  12960. }
  12961. } else {
  12962. hitPointsIcon.drawSprite(179+xPos, 24+yPos);
  12963. }
  12964. }
  12965. //orbs
  12966. public Sprite emptyOrbH;
  12967. public Sprite prayerFillH;
  12968. public Sprite deplete;
  12969. public Sprite depleteP;
  12970. public Sprite depleteR;
  12971. public Sprite runFill;
  12972. public Sprite runIcon;
  12973. private Sprite logIcon;
  12974. public Sprite runFillClicked;
  12975. public Sprite runIconClicked;
  12976. //end
  12977. public void clearTopInterfaces() {
  12978. stream.createFrame(130);
  12979. if (invOverlayInterfaceID != -1) {
  12980. invOverlayInterfaceID = -1;
  12981. needDrawTabArea = true;
  12982. aBoolean1149 = false;
  12983. tabAreaAltered = true;
  12984. }
  12985. if (backDialogID != -1) {
  12986. backDialogID = -1;
  12987. inputTaken = true;
  12988. aBoolean1149 = false;
  12989. }
  12990. openInterfaceID = -1;
  12991. fullscreenInterfaceID = -1;
  12992. }
  12993. public boolean isChatInterface, displayChat;
  12994. public boolean canClickScreen() {
  12995. if(super.mouseX > 0 && super.mouseY > clientHeight - 165 && super.mouseX < 519 && super.mouseY < clientHeight && displayChat || super.mouseX > clientWidth - 246 && super.mouseY > clientHeight - 335 && super.mouseX < clientWidth && super.mouseY < clientHeight
  12996. || super.mouseX > clientWidth - 220 && super.mouseY > 0 && super.mouseX < clientWidth && super.mouseY < 164
  12997. || (super.mouseX > 247 && super.mouseX < 260 && super.mouseY > clientHeight - 173 && super.mouseY < clientHeight - 166 || super.mouseY > clientHeight - 15)
  12998. || super.mouseX > clientWidth - 462 && super.mouseY > clientHeight - 36 && super.mouseX < clientWidth && super.mouseY < clientHeight)
  12999. return false;
  13000. else
  13001. return true;
  13002. }
  13003. public int xpGained = 0;
  13004. public boolean xpClicked = false;
  13005. public client() {
  13006. xpAddedPos = expAdded = 0;
  13007. xpLock = false;
  13008. xpCounter = 0;
  13009. counter = new Sprite[4];
  13010. /*fullscreen*/
  13011. fullScreenSprites = new Sprite[3];
  13012. drawLongTabs = false;
  13013. isFullScreen = false;
  13014. hasBeenBlanked = false;
  13015. displayChat = true;
  13016. fullscreenInterfaceID = -1;
  13017. chatRights = new int[500];
  13018. chatTypeView = 0;
  13019. clanChatMode = 0;
  13020. cButtonHPos = -1;
  13021. cButtonHCPos = -1;
  13022. cButtonCPos = 0;
  13023. server = "127.0.0.1";
  13024. anIntArrayArray825 = new int[104][104];
  13025. friendsNodeIDs = new int[200];
  13026. groundArray = new NodeList[4][104][104];
  13027. aBoolean831 = false;
  13028. aStream_834 = new Stream(new byte[5000]);
  13029. npcArray = new NPC[16384];
  13030. npcIndices = new int[16384];
  13031. anIntArray840 = new int[1000];
  13032. aStream_847 = Stream.create();
  13033. aBoolean848 = true;
  13034. openInterfaceID = -1;
  13035. currentExp = new int[Skills.skillsCount];
  13036. aBoolean872 = false;
  13037. anIntArray873 = new int[5];
  13038. anInt874 = -1;
  13039. aBooleanArray876 = new boolean[5];
  13040. drawFlames = false;
  13041. reportAbuseInput = "";
  13042. unknownInt10 = -1;
  13043. menuOpen = false;
  13044. inputString = "";
  13045. maxPlayers = 2048;
  13046. myPlayerIndex = 2047;
  13047. playerArray = new Player[maxPlayers];
  13048. playerIndices = new int[maxPlayers];
  13049. anIntArray894 = new int[maxPlayers];
  13050. aStreamArray895s = new Stream[maxPlayers];
  13051. anInt897 = 1;
  13052. anIntArrayArray901 = new int[104][104];
  13053. anInt902 = 0x766654;
  13054. aByteArray912 = new byte[16384];
  13055. currentStats = new int[Skills.skillsCount];
  13056. ignoreListAsLongs = new long[100];
  13057. loadingError = false;
  13058. anInt927 = 0x332d25;
  13059. anIntArray928 = new int[5];
  13060. anIntArrayArray929 = new int[104][104];
  13061. chatTypes = new int[500];
  13062. chatNames = new String[500];
  13063. chatMessages = new String[500];
  13064. sideIcons = new Sprite[15];
  13065. redStones = new Sprite[5];
  13066. scrollPart = new Sprite[12];
  13067. scrollBar = new Sprite[6];
  13068. aBoolean954 = true;
  13069. friendsListAsLongs = new long[200];
  13070. currentSong = -1;
  13071. drawingFlames = false;
  13072. spriteDrawX = -1;
  13073. spriteDrawY = -1;
  13074. anIntArray968 = new int[33];
  13075. anIntArray969 = new int[256];
  13076. decompressors = new Decompressor[5];
  13077. variousSettings = new int[2000];
  13078. aBoolean972 = false;
  13079. anInt975 = 50;
  13080. anIntArray976 = new int[anInt975];
  13081. anIntArray977 = new int[anInt975];
  13082. anIntArray978 = new int[anInt975];
  13083. anIntArray979 = new int[anInt975];
  13084. anIntArray980 = new int[anInt975];
  13085. anIntArray981 = new int[anInt975];
  13086. anIntArray982 = new int[anInt975];
  13087. aStringArray983 = new String[anInt975];
  13088. anInt985 = -1;
  13089. hitMarks = new Sprite[20];
  13090. anIntArray990 = new int[5];
  13091. aBoolean994 = false;
  13092. anInt1002 = 0x23201b;
  13093. amountOrNameInput = "";
  13094. aClass19_1013 = new NodeList();
  13095. aBoolean1017 = false;
  13096. anInt1018 = -1;
  13097. anIntArray1030 = new int[5];
  13098. aBoolean1031 = false;
  13099. mapFunctions = new Sprite[100];
  13100. dialogID = -1;
  13101. maxStats = new int[Skills.skillsCount];
  13102. anIntArray1045 = new int[2000];
  13103. aBoolean1047 = true;
  13104. anIntArray1052 = new int[151];
  13105. anInt1054 = -1;
  13106. aClass19_1056 = new NodeList();
  13107. anIntArray1057 = new int[33];
  13108. aClass9_1059 = new RSInterface();
  13109. mapScenes = new Background[100];
  13110. barFillColor = 0x4d4233;
  13111. anIntArray1065 = new int[7];
  13112. anIntArray1072 = new int[1000];
  13113. anIntArray1073 = new int[1000];
  13114. aBoolean1080 = false;
  13115. friendsList = new String[200];
  13116. inStream = Stream.create();
  13117. expectedCRCs = new int[9];
  13118. menuActionCmd2 = new int[500];
  13119. menuActionCmd3 = new int[500];
  13120. menuActionID = new int[500];
  13121. menuActionCmd1 = new int[500];
  13122. headIcons = new Sprite[20];
  13123. skullIcons = new Sprite[20];
  13124. headIconsHint = new Sprite[20];
  13125. tabAreaAltered = false;
  13126. aString1121 = "";
  13127. atPlayerActions = new String[5];
  13128. atPlayerArray = new boolean[5];
  13129. anIntArrayArrayArray1129 = new int[4][13][13];
  13130. anInt1132 = 2;
  13131. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13132. aBoolean1141 = false;
  13133. aBoolean1149 = false;
  13134. crosses = new Sprite[8];
  13135. musicEnabled = true;
  13136. needDrawTabArea = false;
  13137. loggedIn = false;
  13138. canMute = false;
  13139. aBoolean1159 = false;
  13140. aBoolean1160 = false;
  13141. anInt1171 = 1;
  13142. myUsername = "";
  13143. myPassword = "";
  13144. genericLoadingError = false;
  13145. reportAbuseInterfaceID = -1;
  13146. aClass19_1179 = new NodeList();
  13147. anInt1184 = 128;
  13148. invOverlayInterfaceID = -1;
  13149. stream = Stream.create();
  13150. menuActionName = new String[500];
  13151. anIntArray1203 = new int[5];
  13152. anIntArray1207 = new int[50];
  13153. anInt1210 = 2;
  13154. anInt1211 = 78;
  13155. promptInput = "";
  13156. modIcons = new Background[2];
  13157. tabID = 3;
  13158. inputTaken = false;
  13159. songChanging = true;
  13160. anIntArray1229 = new int[151];
  13161. aClass11Array1230 = new Class11[4];
  13162. aBoolean1233 = false;
  13163. anIntArray1240 = new int[100];
  13164. anIntArray1241 = new int[50];
  13165. aBoolean1242 = false;
  13166. anIntArray1250 = new int[50];
  13167. rsAlreadyLoaded = false;
  13168. welcomeScreenRaised = false;
  13169. messagePromptRaised = false;
  13170. loginMessage1 = "";
  13171. loginMessage2 = "";
  13172. backDialogID = -1;
  13173. anInt1279 = 2;
  13174. bigX = new int[4000];
  13175. bigY = new int[4000];
  13176. anInt1289 = -1;
  13177. }
  13178. public int rights;
  13179. public boolean xpLock;
  13180. public int xpCounter;
  13181. private boolean counterOn = false;
  13182. private Sprite emptyOrb;
  13183. @SuppressWarnings("unused")
  13184. private Sprite orbFill;
  13185. @SuppressWarnings("unused")
  13186. private Sprite orbDrawn1;
  13187. @SuppressWarnings("unused")
  13188. private Sprite hoverOrb;
  13189. @SuppressWarnings("unused")
  13190. private Sprite orbDrawn2;
  13191. public Sprite sumOrb;
  13192. public Sprite summoningfill;
  13193. public Sprite infinity;
  13194. public Sprite summonFill;
  13195. public Sprite summonFill2;
  13196. public Sprite summonIcon;
  13197. private Sprite hoveredEmpty;
  13198. private Sprite runIcon1;
  13199. private Sprite runIcon2;
  13200. private Sprite runOrb1;
  13201. private Sprite runOrb2;
  13202. private Sprite hitPointsFill;
  13203. private Sprite hitPointsIcon;
  13204. private Sprite prayerFill;
  13205. private Sprite prayerIcon;
  13206. public String name;
  13207. private Sprite[] scrollBar;
  13208. public Sprite[] scrollPart;
  13209. public String message;
  13210. public String clanname;
  13211. private final int[] chatRights;
  13212. public int chatTypeView;
  13213. public int clanChatMode;
  13214. public int duelMode;
  13215. /* Declare custom sprites */
  13216. private Sprite chatArea;
  13217. private Sprite[] fullScreenSprites;
  13218. private Sprite chatButtons;
  13219. private Sprite tabArea;
  13220. public Sprite[] mapArea = new Sprite[3];
  13221. private Sprite chatButtonH;
  13222. private Sprite chatButtonHC;
  13223. private Sprite chatButtonC;
  13224. private Sprite reportH;
  13225. /**/
  13226. private RSImageProducer leftFrame;
  13227. private RSImageProducer topFrame;
  13228. private RSImageProducer rightFrame;
  13229. private int ignoreCount;
  13230. private long aLong824;
  13231. private int[][] anIntArrayArray825;
  13232. private int[] friendsNodeIDs;
  13233. private NodeList[][][] groundArray;
  13234. private int[] anIntArray828;
  13235. private int[] anIntArray829;
  13236. private volatile boolean aBoolean831;
  13237. private Socket aSocket832;
  13238. private int loginScreenState;
  13239. private Stream aStream_834;
  13240. private NPC[] npcArray;
  13241. private int npcCount;
  13242. private int[] npcIndices;
  13243. private int anInt839;
  13244. private int[] anIntArray840;
  13245. private int anInt841;
  13246. private int anInt842;
  13247. private int anInt843;
  13248. private String aString844;
  13249. private int privateChatMode;
  13250. private Stream aStream_847;
  13251. private boolean aBoolean848;
  13252. private static int anInt849;
  13253. private int[] anIntArray850;
  13254. private int[] anIntArray851;
  13255. private int[] anIntArray852;
  13256. private int[] anIntArray853;
  13257. private static int anInt854;
  13258. private int anInt855;
  13259. private int openInterfaceID;
  13260. private int xCameraPos;
  13261. private int zCameraPos;
  13262. private int yCameraPos;
  13263. private int yCameraCurve;
  13264. private int xCameraCurve;
  13265. private int myPrivilege;
  13266. private final int[] currentExp;
  13267. private Sprite[] redStones;
  13268. private Sprite mapFlag;
  13269. private Sprite mapMarker;
  13270. private boolean aBoolean872;
  13271. private final int[] anIntArray873;
  13272. private int anInt874;
  13273. private final boolean[] aBooleanArray876;
  13274. private int weight;
  13275. private MouseDetection mouseDetection;
  13276. private volatile boolean drawFlames;
  13277. private String reportAbuseInput;
  13278. private int unknownInt10;
  13279. private boolean menuOpen;
  13280. private int anInt886;
  13281. private String inputString;
  13282. private final int maxPlayers;
  13283. private final int myPlayerIndex;
  13284. private Player[] playerArray;
  13285. private int playerCount;
  13286. private int[] playerIndices;
  13287. private int anInt893;
  13288. private int[] anIntArray894;
  13289. private Stream[] aStreamArray895s;
  13290. private int anInt896;
  13291. private int anInt897;
  13292. private int friendsCount;
  13293. private int anInt900;
  13294. private int[][] anIntArrayArray901;
  13295. private final int anInt902;
  13296. private byte[] aByteArray912;
  13297. private int anInt913;
  13298. private int crossX;
  13299. private int crossY;
  13300. private int crossIndex;
  13301. private int crossType;
  13302. private int plane;
  13303. private final int[] currentStats;
  13304. private static int anInt924;
  13305. private final long[] ignoreListAsLongs;
  13306. private boolean loadingError;
  13307. private final int anInt927;
  13308. private final int[] anIntArray928;
  13309. private int[][] anIntArrayArray929;
  13310. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  13311. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  13312. private int anInt933;
  13313. private int anInt934;
  13314. private int anInt935;
  13315. private int anInt936;
  13316. private int anInt937;
  13317. private int anInt938;
  13318. private static int anInt940;
  13319. private final int[] chatTypes;
  13320. private final String[] chatNames;
  13321. private final String[] chatMessages;
  13322. private int anInt945;
  13323. private WorldController worldController;
  13324. private Sprite[] sideIcons;
  13325. private int menuScreenArea;
  13326. private int menuOffsetX;
  13327. private int menuOffsetY;
  13328. private int menuWidth;
  13329. private int menuHeight;
  13330. private long aLong953;
  13331. private boolean aBoolean954;
  13332. private long[] friendsListAsLongs;
  13333. private String[] clanList = new String[100];
  13334. private int currentSong;
  13335. private static int nodeID = 10;
  13336. static int portOff;
  13337. static boolean clientData;
  13338. private static boolean isMembers = true;
  13339. private static boolean lowMem;
  13340. private volatile boolean drawingFlames;
  13341. private int spriteDrawX;
  13342. private int spriteDrawY;
  13343. private final int[] anIntArray965 = {
  13344. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  13345. };
  13346. private Background aBackground_966;
  13347. private Background aBackground_967;
  13348. private final int[] anIntArray968;
  13349. private final int[] anIntArray969;
  13350. final Decompressor[] decompressors;
  13351. public int variousSettings[];
  13352. private boolean aBoolean972;
  13353. private final int anInt975;
  13354. private final int[] anIntArray976;
  13355. private final int[] anIntArray977;
  13356. private final int[] anIntArray978;
  13357. private final int[] anIntArray979;
  13358. private final int[] anIntArray980;
  13359. private final int[] anIntArray981;
  13360. private final int[] anIntArray982;
  13361. private final String[] aStringArray983;
  13362. private int anInt984;
  13363. private int anInt985;
  13364. private static int anInt986;
  13365. private Sprite[] hitMarks;
  13366. private int anInt988;
  13367. private int anInt989;
  13368. private final int[] anIntArray990;
  13369. private static boolean aBoolean993;
  13370. private final boolean aBoolean994;
  13371. private int anInt995;
  13372. private int anInt996;
  13373. private int anInt997;
  13374. private int anInt998;
  13375. private int anInt999;
  13376. private ISAACRandomGen encryption;
  13377. private Sprite multiOverlay;
  13378. private final int anInt1002;
  13379. static final int[][] anIntArrayArray1003 = {
  13380. {
  13381. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  13382. 2983, 54193
  13383. }, {
  13384. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13385. 56621, 4783, 1341, 16578, 35003, 25239
  13386. }, {
  13387. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13388. 10153, 56621, 4783, 1341, 16578, 35003
  13389. }, {
  13390. 4626, 11146, 6439, 12, 4758, 10270
  13391. }, {
  13392. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  13393. }
  13394. };
  13395. private String amountOrNameInput;
  13396. private static int anInt1005;
  13397. private int daysSinceLastLogin;
  13398. private int pktSize;
  13399. private int pktType;
  13400. private int anInt1009;
  13401. private int anInt1010;
  13402. private int anInt1011;
  13403. private NodeList aClass19_1013;
  13404. private int anInt1014;
  13405. private int anInt1015;
  13406. private int anInt1016;
  13407. private boolean aBoolean1017;
  13408. private int anInt1018;
  13409. private static final int[] anIntArray1019;
  13410. private int anInt1021;
  13411. private int anInt1022;
  13412. private int loadingStage;
  13413. private Sprite scrollBar1;
  13414. private Sprite scrollBar2;
  13415. private int anInt1026;
  13416. private Background backBase1;
  13417. private Background backBase2;
  13418. private Background backHmid1;
  13419. private final int[] anIntArray1030;
  13420. private boolean aBoolean1031;
  13421. private Sprite[] mapFunctions;
  13422. private int baseX;
  13423. private int baseY;
  13424. private int anInt1036;
  13425. private int anInt1037;
  13426. private int loginFailures;
  13427. private int anInt1039;
  13428. private int anInt1040;
  13429. private int anInt1041;
  13430. private int dialogID;
  13431. private final int[] maxStats;
  13432. private final int[] anIntArray1045;
  13433. private int anInt1046;
  13434. private boolean aBoolean1047;
  13435. private int anInt1048;
  13436. private String aString1049;
  13437. private static int anInt1051;
  13438. private final int[] anIntArray1052;
  13439. private StreamLoader titleStreamLoader;
  13440. private int anInt1054;
  13441. private int anInt1055;
  13442. private NodeList aClass19_1056;
  13443. private final int[] anIntArray1057;
  13444. public final RSInterface aClass9_1059;
  13445. private Background[] mapScenes;
  13446. private static int anInt1061;
  13447. private int anInt1062;
  13448. private final int barFillColor;
  13449. private int friendsListAction;
  13450. private final int[] anIntArray1065;
  13451. private int mouseInvInterfaceIndex;
  13452. private int lastActiveInvInterface;
  13453. private OnDemandFetcher onDemandFetcher;
  13454. private int anInt1069;
  13455. private int anInt1070;
  13456. private int anInt1071;
  13457. private int[] anIntArray1072;
  13458. private int[] anIntArray1073;
  13459. private Sprite mapDotItem;
  13460. private Sprite mapDotNPC;
  13461. private Sprite mapDotPlayer;
  13462. private Sprite mapDotFriend;
  13463. private Sprite mapDotTeam;
  13464. private Sprite mapDotClan;
  13465. private int anInt1079;
  13466. private boolean aBoolean1080;
  13467. private String[] friendsList;
  13468. private Stream inStream;
  13469. private int anInt1084;
  13470. private int anInt1085;
  13471. private int activeInterfaceType;
  13472. private int anInt1087;
  13473. private int anInt1088;
  13474. public static int anInt1089;
  13475. private final int[] expectedCRCs;
  13476. private int[] menuActionCmd2;
  13477. private int[] menuActionCmd3;
  13478. private int[] menuActionID;
  13479. private int[] menuActionCmd1;
  13480. private Sprite[] headIcons;
  13481. private Sprite[] skullIcons;
  13482. private Sprite[] headIconsHint;
  13483. private static int anInt1097;
  13484. private int anInt1098;
  13485. private int anInt1099;
  13486. private int anInt1100;
  13487. private int anInt1101;
  13488. private int anInt1102;
  13489. private static boolean tabAreaAltered;
  13490. private int anInt1104;
  13491. private RSImageProducer aRSImageProducer_1107;
  13492. private RSImageProducer aRSImageProducer_1108;
  13493. private RSImageProducer aRSImageProducer_1109;
  13494. private RSImageProducer aRSImageProducer_1110;
  13495. private RSImageProducer aRSImageProducer_1111;
  13496. private RSImageProducer aRSImageProducer_1112;
  13497. private RSImageProducer aRSImageProducer_1113;
  13498. private RSImageProducer aRSImageProducer_1114;
  13499. private RSImageProducer aRSImageProducer_1115;
  13500. private static int anInt1117;
  13501. private int membersInt;
  13502. private String aString1121;
  13503. private Sprite compass;
  13504. private RSImageProducer aRSImageProducer_1123;
  13505. private RSImageProducer aRSImageProducer_1124;
  13506. private RSImageProducer aRSImageProducer_1125;
  13507. public static Player myPlayer;
  13508. private final String[] atPlayerActions;
  13509. private final boolean[] atPlayerArray;
  13510. private final int[][][] anIntArrayArrayArray1129;
  13511. private final int[] tabInterfaceIDs = {
  13512. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  13513. -1, -1, -1, -1, -1
  13514. };
  13515. private int anInt1131;
  13516. private int anInt1132;
  13517. private int menuActionRow;
  13518. private static int anInt1134;
  13519. private int spellSelected;
  13520. private int anInt1137;
  13521. private int spellUsableOn;
  13522. private String spellTooltip;
  13523. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  13524. private boolean aBoolean1141;
  13525. private static int anInt1142;
  13526. private int energy;
  13527. private boolean aBoolean1149;
  13528. private Sprite[] crosses;
  13529. private boolean musicEnabled;
  13530. private Background[] aBackgroundArray1152s;
  13531. private static boolean needDrawTabArea;
  13532. private int unreadMessages;
  13533. private static int anInt1155;
  13534. private static boolean fpsOn;
  13535. public boolean loggedIn;
  13536. private boolean canMute;
  13537. private boolean aBoolean1159;
  13538. private boolean aBoolean1160;
  13539. static int loopCycle;
  13540. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  13541. private RSImageProducer aRSImageProducer_1163;
  13542. private RSImageProducer aRSImageProducer_1164;
  13543. private RSImageProducer aRSImageProducer_1165;
  13544. private RSImageProducer aRSImageProducer_1166;
  13545. private int daysSinceRecovChange;
  13546. private RSSocket socketStream;
  13547. private int anInt1169;
  13548. private int minimapInt3;
  13549. private int anInt1171;
  13550. private long aLong1172;
  13551. private String myUsername;
  13552. private String myPassword;
  13553. private static int anInt1175;
  13554. private boolean genericLoadingError;
  13555. private final int[] anIntArray1177 = {
  13556. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  13557. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  13558. 2, 2, 3
  13559. };
  13560. private int reportAbuseInterfaceID;
  13561. private NodeList aClass19_1179;
  13562. private int[] anIntArray1180;
  13563. private int[] anIntArray1181;
  13564. private int[] anIntArray1182;
  13565. private byte[][] aByteArrayArray1183;
  13566. private int anInt1184;
  13567. private int minimapInt1;
  13568. private int anInt1186;
  13569. private int anInt1187;
  13570. private static int anInt1188;
  13571. private int invOverlayInterfaceID;
  13572. private int[] anIntArray1190;
  13573. private int[] anIntArray1191;
  13574. private Stream stream;
  13575. private int anInt1193;
  13576. private int splitPrivateChat;
  13577. private Background mapBack;
  13578. private String[] menuActionName;
  13579. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  13580. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  13581. private final int[] anIntArray1203;
  13582. static final int[] anIntArray1204 = {
  13583. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  13584. 58654, 5027, 1457, 16565, 34991, 25486
  13585. };
  13586. private static boolean flagged;
  13587. private final int[] anIntArray1207;
  13588. private int anInt1208;
  13589. private int minimapInt2;
  13590. private int anInt1210;
  13591. private int anInt1211;
  13592. private String promptInput;
  13593. private int anInt1213;
  13594. private int[][][] intGroundArray;
  13595. private long aLong1215;
  13596. private int loginScreenCursorPos;
  13597. private final Background[] modIcons;
  13598. private long aLong1220;
  13599. private static int tabID;
  13600. private int anInt1222;
  13601. public static boolean inputTaken;
  13602. private int inputDialogState;
  13603. private static int anInt1226;
  13604. private int nextSong;
  13605. private boolean songChanging;
  13606. private final int[] anIntArray1229;
  13607. private Class11[] aClass11Array1230;
  13608. public static int anIntArray1232[];
  13609. private boolean aBoolean1233;
  13610. private int[] anIntArray1234;
  13611. private int[] anIntArray1235;
  13612. private int[] anIntArray1236;
  13613. private int anInt1237;
  13614. private int anInt1238;
  13615. public final int anInt1239 = 100;
  13616. private final int[] anIntArray1240;
  13617. private final int[] anIntArray1241;
  13618. private boolean aBoolean1242;
  13619. private int atInventoryLoopCycle;
  13620. private int atInventoryInterface;
  13621. private int atInventoryIndex;
  13622. private int atInventoryInterfaceType;
  13623. private byte[][] aByteArrayArray1247;
  13624. private int tradeMode;
  13625. private int anInt1249;
  13626. private final int[] anIntArray1250;
  13627. private int anInt1251;
  13628. private final boolean rsAlreadyLoaded;
  13629. private int anInt1253;
  13630. private int anInt1254;
  13631. private boolean welcomeScreenRaised;
  13632. private boolean messagePromptRaised;
  13633. private int anInt1257;
  13634. private byte[][][] byteGroundArray;
  13635. private int prevSong;
  13636. private int destX;
  13637. private int destY;
  13638. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  13639. private int anInt1264;
  13640. private int anInt1265;
  13641. private String loginMessage1;
  13642. private String loginMessage2;
  13643. private int anInt1268;
  13644. private int anInt1269;
  13645. private TextDrawingArea smallText;
  13646. private TextDrawingArea aTextDrawingArea_1271;
  13647. private TextDrawingArea chatTextDrawingArea;
  13648. private int anInt1275;
  13649. private int backDialogID;
  13650. private int anInt1278;
  13651. private int anInt1279;
  13652. private int[] bigX;
  13653. private int[] bigY;
  13654. private int itemSelected;
  13655. private int anInt1283;
  13656. private int anInt1284;
  13657. private int anInt1285;
  13658. private String selectedItemName;
  13659. private int publicChatMode;
  13660. private static int anInt1288;
  13661. private int anInt1289;
  13662. public static int anInt1290;
  13663. public static String server = "";
  13664. public int drawCount;
  13665. public int fullscreenInterfaceID;
  13666. public int anInt1044;//377
  13667. public int anInt1129;//377
  13668. public int anInt1315;//377
  13669. public int anInt1500;//377
  13670. public int anInt1501;//377
  13671. public int[] fullScreenTextureArray;
  13672. public void resetAllImageProducers() {
  13673. if (super.fullGameScreen != null) {
  13674. return;
  13675. }
  13676. aRSImageProducer_1166 = null;
  13677. aRSImageProducer_1164 = null;
  13678. aRSImageProducer_1163 = null;
  13679. aRSImageProducer_1165 = null;
  13680. aRSImageProducer_1123 = null;
  13681. aRSImageProducer_1124 = null;
  13682. aRSImageProducer_1125 = null;
  13683. aRSImageProducer_1107 = null;
  13684. aRSImageProducer_1108 = null;
  13685. aRSImageProducer_1109 = null;
  13686. aRSImageProducer_1110 = null;
  13687. aRSImageProducer_1111 = null;
  13688. aRSImageProducer_1112 = null;
  13689. aRSImageProducer_1113 = null;
  13690. aRSImageProducer_1114 = null;
  13691. aRSImageProducer_1115 = null;
  13692. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  13693. welcomeScreenRaised = true;
  13694. }
  13695. public void launchURL(String url) {
  13696. String osName = System.getProperty("os.name");
  13697. try {
  13698. if (osName.startsWith("Mac OS")) {
  13699. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  13700. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  13701. openURL.invoke(null, new Object[] {url});
  13702. } else if (osName.startsWith("Windows"))
  13703. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  13704. else { //assume Unix or Linux
  13705. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  13706. String browser = null;
  13707. for (int count = 0; count < browsers.length && browser == null; count++)
  13708. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  13709. browser = browsers[count];
  13710. if (browser == null) {
  13711. throw new Exception("Could not find web browser");
  13712. } else
  13713. Runtime.getRuntime().exec(new String[] {browser, url});
  13714. }
  13715. } catch (Exception e) {
  13716. pushMessage("Failed to open URL.", 0, "");
  13717. }
  13718. }
  13719. static {
  13720. anIntArray1019 = new int[99];
  13721. int i = 0;
  13722. for(int j = 0; j < 99; j++) {
  13723. int l = j + 1;
  13724. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  13725. i += i1;
  13726. anIntArray1019[j] = i / 4;
  13727. }
  13728. anIntArray1232 = new int[32];
  13729. i = 2;
  13730. for(int k = 0; k < 32; k++) {
  13731. anIntArray1232[k] = i - 1;
  13732. i += i;
  13733. }
  13734. }
  13735. }