PageRenderTime 61ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 3ms

/src/client.java

https://github.com/CramerGG/ResizableClient
Java | 14250 lines | 13574 code | 515 blank | 161 comment | 5747 complexity | c84f324eb1577dbe3c4ea323038d9df6 MD5 | raw file

Large files files are truncated, but you can click here to view the full 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);

Large files files are truncated, but you can click here to view the full file