Guest User

Untitled

a guest
Feb 28th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 471.29 KB | None | 0 0
  1. package com.ospvp;
  2.  
  3. import java.applet.AppletContext;
  4. import java.awt.*;
  5. import java.io.*;
  6. import java.net.*;
  7. import java.text.DecimalFormat;
  8. import java.text.NumberFormat;
  9. import java.util.ArrayList;
  10. import java.util.Arrays;
  11. import java.util.Queue;
  12. import java.util.Calendar;
  13. import java.util.Collection;
  14. import java.util.Collections;
  15. import java.util.GregorianCalendar;
  16. import java.util.LinkedList;
  17. import java.util.Objects;
  18. import java.util.regex.Matcher;
  19. import java.util.regex.Pattern;
  20. import java.util.zip.GZIPOutputStream;
  21. import java.lang.reflect.Method;
  22.  
  23. import javax.swing.JOptionPane;
  24.  
  25. import com.ospvp.cache.definition.EntityDef;
  26. import com.ospvp.cache.definition.ItemDef;
  27. import com.ospvp.cache.definition.ObjectDef;
  28. import com.ospvp.configuration.Configuration;
  29. import com.ospvp.entity.Entity;
  30. import com.ospvp.entity.Item;
  31. import com.ospvp.entity.NPC;
  32. import com.ospvp.entity.Player;
  33. import com.ospvp.sign.signlink;
  34.  
  35. public class client extends RSApplet {
  36. public enum ScreenMode {
  37. FIXED, RESIZABLE, FULLSCREEN;
  38. }
  39. private static final long serialVersionUID = 1L;
  40. private Sprite[] inputSprites = new Sprite[7];
  41. private boolean revision474 = true;
  42. private boolean revision498 = false;
  43. private boolean revision508;
  44. private boolean OSOrbs = true;
  45. private boolean OSCounter = true;
  46. private static String broadcast = "";
  47. private int modifiableXValue;
  48. private int achievementCutoff = 100;
  49. private Sprite[] minimapIcons = new Sprite[2];
  50. private Sprite[] expDrops = new Sprite[25];
  51. public int port = Configuration.getPort();
  52. private String macAddress;
  53.  
  54. public static void dumpModels() {
  55. int id = 6610;
  56. EntityDef npc = EntityDef.forID(id);
  57. System.out.println(npc.name);
  58. if (npc.anIntArray94 != null) {
  59. for (int modelid = 0; modelid < npc.anIntArray94.length; modelid++) {
  60. System.out.println(npc.anIntArray94[modelid]);
  61. }
  62. }
  63. }
  64.  
  65. private static String intToKOrMilLongName(int i) {
  66. String s = String.valueOf(i);
  67. for (int k = s.length() - 3; k > 0; k -= 3)
  68. s = s.substring(0, k) + "," + s.substring(k);
  69. if (s.length() > 8)
  70. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  71. + s + ")";
  72. else if (s.length() > 4)
  73. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  74. return " " + s;
  75. }
  76.  
  77. private static String intToKOrMil(int j) {
  78. if (j < 0x186a0)
  79. return String.valueOf(j);
  80. if (j < 0x989680)
  81. return j / 1000 + "K";
  82. else
  83. return j / 0xf4240 + "M";
  84. }
  85.  
  86. public void stopMidi() {
  87. signlink.midifade = 0;
  88. signlink.midi = "stop";
  89. }
  90.  
  91. public Sprite[] chatImages = new Sprite[2];
  92. public static int spellID = 0;
  93. public int MapX, MapY;
  94.  
  95. public static void setTab(int id) {
  96. needDrawTabArea = true;
  97. tabID = id;
  98. tabAreaAltered = true;
  99. }
  100.  
  101. public void setSidebarInterface(int sidebarID, int interfaceID) {
  102. tabInterfaceIDs[sidebarID] = interfaceID;
  103. tabID = sidebarID;
  104. needDrawTabArea = true;
  105. tabAreaAltered = true;
  106. }
  107.  
  108. private boolean menuHasAddFriend(int j) {
  109. if (j < 0)
  110. return false;
  111. int k = menuActionID[j];
  112. if (k >= 2000)
  113. k -= 2000;
  114. return k == 337;
  115. }
  116.  
  117. public void drawChannelButtons() {
  118. String text[] = { "On", "Friends", "Off", "Hide" };
  119. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  120. switch (cButtonCPos) {
  121. case 0:
  122. chatButtons[1].drawSprite(5, 142);
  123. break;
  124. case 1:
  125. chatButtons[1].drawSprite(71, 142);
  126. break;
  127. case 2:
  128. chatButtons[1].drawSprite(137, 142);
  129. break;
  130. case 3:
  131. chatButtons[1].drawSprite(203, 142);
  132. break;
  133. case 4:
  134. chatButtons[1].drawSprite(269, 142);
  135. break;
  136. case 5:
  137. chatButtons[1].drawSprite(335, 142);
  138. break;
  139. }
  140. if (cButtonHPos == cButtonCPos) {
  141. switch (cButtonHPos) {
  142. case 0:
  143. chatButtons[2].drawSprite(5, 142);
  144. break;
  145. case 1:
  146. chatButtons[2].drawSprite(71, 142);
  147. break;
  148. case 2:
  149. chatButtons[2].drawSprite(137, 142);
  150. break;
  151. case 3:
  152. chatButtons[2].drawSprite(203, 142);
  153. break;
  154. case 4:
  155. chatButtons[2].drawSprite(269, 142);
  156. break;
  157. case 5:
  158. chatButtons[2].drawSprite(335, 142);
  159. break;
  160. case 6:
  161. chatButtons[3].drawSprite(404, 142);
  162. break;
  163. }
  164. } else {
  165. switch (cButtonHPos) {
  166. case 0:
  167. chatButtons[0].drawSprite(5, 142);
  168. break;
  169. case 1:
  170. chatButtons[0].drawSprite(71, 142);
  171. break;
  172. case 2:
  173. chatButtons[0].drawSprite(137, 142);
  174. break;
  175. case 3:
  176. chatButtons[0].drawSprite(203, 142);
  177. break;
  178. case 4:
  179. chatButtons[0].drawSprite(269, 142);
  180. break;
  181. case 5:
  182. chatButtons[0].drawSprite(335, 142);
  183. break;
  184. case 6:
  185. chatButtons[3].drawSprite(404, 142);
  186. break;
  187. }
  188. }
  189. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  190. smallText.method389(true, 26, 0xffffff, "All", 157);
  191. smallText.method389(true, 86, 0xffffff, "Game", 157);
  192. smallText.method389(true, 150, 0xffffff, "Public", 152);
  193. smallText.method389(true, 212, 0xffffff, "Private", 152);
  194. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  195. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  196. smallText.method382(textColor[publicChatMode], 164,
  197. text[publicChatMode], 163, true);
  198. smallText.method382(textColor[privateChatMode], 230,
  199. text[privateChatMode], 163, true);
  200. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode],
  201. 163, true);
  202. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163,
  203. true);
  204. }
  205.  
  206. private void drawChatArea() {
  207. aRSImageProducer_1166.initDrawingArea();
  208. Texture.anIntArray1472 = anIntArray1180;
  209. chatArea.drawSprite(0, 0);
  210. drawChannelButtons();
  211. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  212. if (super.saveClickX >= 0 && super.saveClickX <= 522
  213. && super.saveClickY >= 343 && super.saveClickY <= 484) {
  214. if (this.isFieldInFocus()) {
  215. this.inputString = "";
  216. this.resetInputFieldFocus();
  217. }
  218. }
  219. if (this.isFieldInFocus())
  220. this.inputString = "[Click chat box to enable]";
  221. if (messagePromptRaised) {
  222. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  223. newBoldFont.drawCenteredString(promptInput + "*", 259, 80, 128, -1);
  224. } else if (inputDialogState == 1) {
  225. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  226. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  227. 128, -1);
  228. } else if (inputDialogState == 2) {
  229. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  230. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  231. 128, -1);
  232. } else if (aString844 != null) {
  233. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  234. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128,
  235. -1);
  236. } else if (backDialogID != -1) {
  237. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  238. } else if (dialogID != -1) {
  239. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  240. } else {
  241. int j77 = -3;
  242. int j = 0;
  243. DrawingArea.setDrawingArea(122, 8, 497, 7);
  244. for (int k = 0; k < 500; k++)
  245. if (chatMessages[k] != null) {
  246. int chatType = chatTypes[k];
  247. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  248. String s1 = chatNames[k];
  249. byte byte0 = 0;
  250. if (s1 != null && s1.startsWith("@cr1@")) {
  251. s1 = s1.substring(5);
  252. byte0 = 1;
  253. } else if (s1 != null && s1.startsWith("@cr2@")) {
  254. s1 = s1.substring(5);
  255. byte0 = 2;
  256. } else if (s1 != null && s1.startsWith("@cr3@")) {
  257. s1 = s1.substring(5);
  258. byte0 = 3;
  259. } else if (s1 != null && s1.startsWith("@cr4@")) {
  260. s1 = s1.substring(5);
  261. byte0 = 4;
  262. } else if (s1 != null && s1.startsWith("@cr5@")) {
  263. s1 = s1.substring(5);
  264. byte0 = 5;
  265. } else if (s1 != null && s1.startsWith("@cr6@")) {
  266. s1 = s1.substring(5);
  267. byte0 = 6;
  268. } else if (s1 != null && s1.startsWith("@cr7@")) {
  269. s1 = s1.substring(5);
  270. byte0 = 7;
  271. } else if (s1 != null && s1.startsWith("@cr8@")) {
  272. s1 = s1.substring(5);
  273. byte0 = 8;
  274. } else if (s1 != null && s1.startsWith("@cr9@")) {
  275. s1 = s1.substring(5);
  276. byte0 = 9;
  277. } else if (s1 != null && s1.startsWith("@cr10@")) {
  278. s1 = s1.substring(6);
  279. byte0 = 10;
  280. } else if (s1 != null && s1.startsWith("@cr11@")) {
  281. s1 = s1.substring(6);
  282. byte0 = 11;
  283. }
  284. if (chatType == 0) {
  285. if (chatTypeView == 5 || chatTypeView == 0) {
  286. if (yPos > 0 && yPos < 210) {
  287. newRegularFont.drawBasicString(chatMessages[k],
  288. 11, yPos, 0, -1);
  289. }
  290. j++;
  291. j77++;
  292. }
  293. }
  294. if ((chatType == 1 || chatType == 2)
  295. && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1
  296. && isFriendOrSelf(s1))) {
  297. if (chatTypeView == 1 || chatTypeView == 0) {
  298. if (yPos > 0 && yPos < 210) {
  299. int xPos = 11;
  300. if (byte0 == 1) {
  301. modIcons[0].drawSprite(xPos + 1, yPos - 11);
  302. xPos += 14;
  303. } else if (byte0 == 2) {
  304. modIcons[2].drawSprite(xPos, yPos - 11);
  305. xPos += 14;
  306. } else if (byte0 == 3) {
  307. modIcons[1].drawSprite(xPos + 1, yPos - 11);
  308. xPos += 14;
  309. } else if (byte0 == 4) {
  310. modIcons[3].drawSprite(xPos + 1, yPos - 10);
  311. xPos += 14;
  312. } else if (byte0 == 5) {
  313. modIcons[4].drawSprite(xPos + 1, yPos - 10);
  314. xPos += 14;
  315. } else if (byte0 == 6) {
  316. modIcons[5].drawSprite(xPos + 1, yPos - 10);
  317. xPos += 14;
  318. } else if (byte0 == 7) {
  319. modIcons[6].drawSprite(xPos + 1, yPos - 10);
  320. xPos += 14;
  321. } else if (byte0 == 8) {
  322. modIcons[7].drawSprite(xPos + 1, yPos - 10);
  323. xPos += 14;
  324. } else if (byte0 == 9) {
  325. modIcons[8].drawSprite(xPos + 1, yPos - 10);
  326. xPos += 14;
  327. } else if (byte0 == 10) {
  328. modIcons[9].drawSprite(xPos + 1, yPos - 10);
  329. xPos += 14;
  330. } else if (byte0 == 11) {
  331. modIcons[10]
  332. .drawSprite(xPos + 1, yPos - 10);
  333. xPos += 14;
  334. }
  335. newRegularFont.drawBasicString(s1 + ":", xPos,
  336. yPos, 0, -1);
  337. xPos += newRegularFont.getTextWidth(s1) + 8;
  338. newRegularFont.drawBasicString(chatMessages[k],
  339. xPos, yPos, 255, -1);
  340. }
  341. j++;
  342. j77++;
  343. }
  344. }
  345. if ((chatType == 3 || chatType == 7)
  346. && (splitPrivateChat == 0 || chatTypeView == 2)
  347. && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1
  348. && isFriendOrSelf(s1))) {
  349. if (chatTypeView == 2 || chatTypeView == 0) {
  350. if (yPos > 0 && yPos < 210) {
  351. int k1 = 11;
  352. newRegularFont.drawBasicString("From", k1,
  353. yPos, 0, -1);
  354. if (byte0 == 3 || byte0 == 2 || byte0 == 1
  355. || byte0 == 0) {
  356. k1 += textDrawingArea.getTextWidth("From ");
  357. } else if (byte0 == 9 || byte0 == 10
  358. || byte0 == 11 || byte0 == 7
  359. || byte0 == 8 || byte0 == 6
  360. || byte0 == 5 || byte0 == 4) {
  361. k1 += textDrawingArea.getTextWidth("From");
  362. }
  363. if (byte0 == 1) {
  364. modIcons[0].drawSprite(k1 - 1, yPos - 11);
  365. k1 += 12;
  366. } else if (byte0 == 2) {
  367. modIcons[2].drawSprite(k1 - 2, yPos - 13);
  368. k1 += 12;
  369. } else if (byte0 == 3) {
  370. modIcons[1].drawSprite(k1 - 1, yPos - 11);
  371. k1 += 12;
  372. } else if (byte0 == 4) {
  373. modIcons[3].drawSprite(k1, yPos - 10);
  374. k1 += 12;
  375. } else if (byte0 == 5) {
  376. modIcons[4].drawSprite(k1, yPos - 10);
  377. k1 += 12;
  378. } else if (byte0 == 6) {
  379. modIcons[5].drawSprite(k1, yPos - 10);
  380. k1 += 12;
  381. } else if (byte0 == 7) {
  382. modIcons[6].drawSprite(k1, yPos - 10);
  383. k1 += 12;
  384. } else if (byte0 == 8) {
  385. modIcons[7].drawSprite(k1, yPos - 10);
  386. k1 += 12;
  387. } else if (byte0 == 9) {
  388. modIcons[8].drawSprite(k1, yPos - 10);
  389. k1 += 12;
  390. } else if (byte0 == 10) {
  391. modIcons[9].drawSprite(k1, yPos - 10);
  392. k1 += 12;
  393. } else if (byte0 == 11) {
  394. modIcons[10].drawSprite(k1, yPos - 10);
  395. k1 += 12;
  396. }
  397. newRegularFont.drawBasicString(s1 + ":", k1,
  398. yPos, 0, -1);
  399. k1 += newRegularFont.getTextWidth(s1) + 8;
  400. newRegularFont.drawBasicString(chatMessages[k],
  401. k1, yPos, 0x800000, -1);
  402. }
  403. j++;
  404. j77++;
  405. }
  406. }
  407. if (chatType == 4
  408. && (tradeMode == 0 || tradeMode == 1
  409. && isFriendOrSelf(s1))) {
  410. if (chatTypeView == 3 || chatTypeView == 0) {
  411. if (yPos > 0 && yPos < 210)
  412. newRegularFont.drawBasicString(s1 + " "
  413. + chatMessages[k], 11, yPos, 0x800080,
  414. -1);
  415. j++;
  416. j77++;
  417. }
  418. }
  419. if (chatType == 5 && splitPrivateChat == 0
  420. && privateChatMode < 2) {
  421. if (chatTypeView == 2 || chatTypeView == 0) {
  422. if (yPos > 0 && yPos < 210)
  423. newRegularFont.drawBasicString(chatMessages[k],
  424. 11, yPos, 0x800000, -1);
  425. j++;
  426. j77++;
  427. }
  428. }
  429. if (chatType == 6
  430. && (splitPrivateChat == 0 || chatTypeView == 2)
  431. && privateChatMode < 2) {
  432. if (chatTypeView == 2 || chatTypeView == 0) {
  433. if (yPos > 0 && yPos < 210) {
  434. newRegularFont.drawBasicString(
  435. "To " + s1 + ":", 11, yPos, 0, -1);
  436. newRegularFont.drawBasicString(
  437. chatMessages[k],
  438. 15 + newRegularFont.getTextWidth("To :"
  439. + s1), yPos, 0x800000, -1);
  440. }
  441. j++;
  442. j77++;
  443. }
  444. }
  445. if (chatType == 11 && (clanChatMode == 0)) {
  446. if (chatTypeView == 11 || chatTypeView == 0) {
  447. if (yPos > 0 && yPos < 210)
  448. newRegularFont.drawBasicString(s1 + " "
  449. + chatMessages[k], 8, yPos, 0x7e3200,
  450. -1);
  451. j++;
  452. j77++;
  453. }
  454. }
  455. if (chatType == 13 && chatTypeView == 12) {
  456. if (yPos > 0 && yPos < 210)
  457. newRegularFont.drawBasicString(s1 + " "
  458. + chatMessages[k], 8, yPos, 0x7e3200, -1);
  459. j++;
  460. j77++;
  461. }
  462. if (chatType == 8
  463. && (tradeMode == 0 || tradeMode == 1
  464. && isFriendOrSelf(s1))) {
  465. if (chatTypeView == 3 || chatTypeView == 0) {
  466. if (yPos > 0 && yPos < 210)
  467. newRegularFont.drawBasicString(s1 + " "
  468. + chatMessages[k], 11, yPos, 0x7e3200,
  469. -1);
  470. j++;
  471. j77++;
  472. }
  473. if (chatType == 11 && (clanChatMode == 0)) {
  474. if (chatTypeView == 11) {
  475. if (yPos > 0 && yPos < 110)
  476. newRegularFont.drawBasicString(s1 + " "
  477. + chatMessages[k], 19, yPos,
  478. 0x7e3200, -1);
  479. j++;
  480. j77++;
  481. }
  482. }
  483. if (chatType == 12) {
  484. if (chatTypeView == 11 || chatTypeView == 0) {
  485. if (yPos > 3 && yPos < 130) {
  486. String title = "<col=0000FF>"
  487. + clanTitles[k] + "</col>";
  488. String username = (chatRights[k] > 0 ? "<img="
  489. + (chatRights[k] - 1) + ">"
  490. : "")
  491. + TextClass.fixName(chatNames[k]);
  492. String message = "<col=800000>"
  493. + chatMessages[k] + "</col>";
  494. newRegularFont.drawBasicString("[" + title
  495. + "] " + username + ": " + message,
  496. 11, yPos, 0, -1);
  497. }
  498. j++;
  499. j77++;
  500. }
  501. }
  502. }
  503. if (chatType == 16) {
  504. int j2 = 40 + 11;
  505. String clanname = clanList[k];
  506. int clanNameWidth = textDrawingArea
  507. .getTextWidth(clanname);
  508. if (chatTypeView == 11 || chatTypeView == 0) {
  509. if (yPos > 0 && yPos < 110)
  510. switch (chatRights[k]) {
  511. case 1:
  512. j2 += clanNameWidth;
  513. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  514. j2 += 15;
  515. break;
  516. case 2:
  517. j2 += clanNameWidth;
  518. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  519. j2 += 15;
  520. break;
  521. case 3:
  522. j2 += clanNameWidth;
  523. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  524. j2 += 15;
  525. break;
  526. case 4:
  527. j2 += clanNameWidth;
  528. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  529. j2 += 15;
  530. break;
  531. default:
  532. j2 += clanNameWidth;
  533. break;
  534. }
  535. newRegularFont
  536. .drawBasicString("[", 19, yPos, 0, -1);
  537. newRegularFont.drawBasicString("]",
  538. clanNameWidth + 16 + 11, yPos, 0, -1);
  539. newRegularFont.drawBasicString(""
  540. + capitalize(clanname) + "", 25, yPos, 255,
  541. -1);
  542. newRegularFont.drawBasicString(
  543. capitalize(chatNames[k]) + ":", j2 - 17,
  544. yPos);
  545. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  546. newRegularFont.drawBasicString(
  547. capitalize(chatMessages[k]), j2 - 16, yPos,
  548. 0x800000, -1);
  549.  
  550. j++;
  551. j77++;
  552. }
  553. }
  554. }
  555. DrawingArea.defaultDrawingAreaSize();
  556. anInt1211 = j * 14 + 7 + 5;
  557. if (anInt1211 < 111)
  558. anInt1211 = 111;
  559. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  560. String fixedString;
  561. if (myPlayer != null && myPlayer.name != null) {
  562. if (myPlayer.title.length() > 0) {
  563. fixedString = "<col="+myPlayer.titleColor+">" + myPlayer.title + "</col>" + " " + myPlayer.name;
  564. } else {
  565. fixedString = myPlayer.name;
  566. }
  567. } else {
  568. fixedString = TextClass.fixName(capitalize(myUsername));
  569. }
  570. String s;
  571. if (myPlayer != null && myPlayer.name != null)
  572. s = myPlayer.title + " " + myPlayer.name;
  573. else
  574. s = TextClass.fixName(capitalize(myUsername));
  575. int xPos = 0;
  576. int yPos = 0;
  577. if (myPrivilege == 0) { // Player
  578. newRegularFont
  579. .drawBasicString(fixedString + "", 11, 133, 0, -1);
  580. textDrawingArea.method385(0, ": ", 133, (8) + textDrawingArea.getTextWidth(s));
  581. newRegularFont.drawBasicString(inputString + ("*"),
  582. 9 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
  583. DrawingArea.method339(121, 0x807660, 506, 7);
  584. } else if (myPrivilege == 1) { // Moderator
  585. modIcons[0].drawSprite(10 + xPos, 122 + yPos);
  586. xPos += 14;
  587. newRegularFont
  588. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  589. textDrawingArea.method385(0, ": ", 133,
  590. (20 + textDrawingArea.getTextWidth(s)));
  591. newRegularFont.drawBasicString(inputString
  592. + ("*"),
  593. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  594. -1);
  595. DrawingArea.method339(121, 0x807660, 506, 7);
  596. } else if (myPrivilege == 2) { // Administrator
  597. modIcons[1].drawSprite(10 + xPos, 122 + yPos);
  598. xPos += 14;
  599. newRegularFont
  600. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  601. textDrawingArea.method385(0, ": ", 133,
  602. (20 + textDrawingArea.getTextWidth(s)));
  603. newRegularFont.drawBasicString(inputString
  604. + ("*"),
  605. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  606. -1);
  607. DrawingArea.method339(121, 0x807660, 506, 7);
  608. } else if (myPrivilege == 3) { // Developer
  609. modIcons[2].drawSprite(10 + xPos, 121 + yPos);
  610. xPos += 14;
  611. newRegularFont
  612. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  613. textDrawingArea.method385(0, ": ", 133,
  614. (20 + textDrawingArea.getTextWidth(s)));
  615. newRegularFont.drawBasicString(inputString
  616. + ("*"),
  617. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  618. -1);
  619. DrawingArea.method339(121, 0x807660, 506, 7);
  620. } else if (myPrivilege == 4) { // Donator
  621. modIcons[3].drawSprite(10 + xPos, 122 + yPos);
  622. xPos += 14;
  623. newRegularFont
  624. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  625. textDrawingArea.method385(0, ": ", 133,
  626. (20 + textDrawingArea.getTextWidth(s)));
  627. newRegularFont.drawBasicString(inputString
  628. + ("*"),
  629. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  630. -1);
  631. DrawingArea.method339(121, 0x807660, 506, 7);
  632. } else if (myPrivilege == 5) { // Super Donator
  633. modIcons[4].drawSprite(10 + xPos, 122 + yPos);
  634. xPos += 14;
  635. newRegularFont
  636. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  637. textDrawingArea.method385(0, ": ", 133,
  638. (20 + textDrawingArea.getTextWidth(s)));
  639. newRegularFont.drawBasicString(inputString
  640. + ("*"),
  641. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  642. -1);
  643. DrawingArea.method339(121, 0x807660, 506, 7);
  644. } else if (myPrivilege == 6) { // Extreme Donator
  645. modIcons[5].drawSprite(10 + xPos, 122 + yPos);
  646. xPos += 14;
  647. newRegularFont
  648. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  649. textDrawingArea.method385(0, ": ", 133,
  650. (20 + textDrawingArea.getTextWidth(s)));
  651. newRegularFont.drawBasicString(inputString
  652. + ("*"),
  653. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  654. -1);
  655. DrawingArea.method339(121, 0x807660, 506, 7);
  656. } else if (myPrivilege == 7) { // Extreme Donator
  657. modIcons[6].drawSprite(10 + xPos, 122 + yPos);
  658. xPos += 14;
  659. newRegularFont
  660. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  661. textDrawingArea.method385(0, ": ", 133,
  662. (20 + textDrawingArea.getTextWidth(s)));
  663. newRegularFont.drawBasicString(inputString
  664. + ("*"),
  665. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  666. -1);
  667. DrawingArea.method339(121, 0x807660, 506, 7);
  668. } else if (myPrivilege == 8) { // Respected Member
  669. modIcons[7].drawSprite(10 + xPos, 122 + yPos);
  670. xPos += 14;
  671. newRegularFont
  672. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  673. textDrawingArea.method385(0, ": ", 133,
  674. (20 + textDrawingArea.getTextWidth(s)));
  675. newRegularFont.drawBasicString(inputString
  676. + ("*"),
  677. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  678. -1);
  679. DrawingArea.method339(121, 0x807660, 506, 7);
  680. } else if (myPrivilege == 9) { // Veteran
  681. modIcons[8].drawSprite(10 + xPos, 122 + yPos);
  682. xPos += 14;
  683. newRegularFont
  684. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  685. textDrawingArea.method385(0, ": ", 133,
  686. (20 + textDrawingArea.getTextWidth(s)));
  687. newRegularFont.drawBasicString(inputString
  688. + ("*"),
  689. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  690. -1);
  691. DrawingArea.method339(121, 0x807660, 506, 7);
  692. } else if (myPrivilege == 10) { // Veteran
  693. modIcons[9].drawSprite(10 + xPos, 122 + yPos);
  694. xPos += 14;
  695. newRegularFont
  696. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  697. textDrawingArea.method385(0, ": ", 133,
  698. (20 + textDrawingArea.getTextWidth(s)));
  699. newRegularFont.drawBasicString(inputString
  700. + ("*"),
  701. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  702. -1);
  703. DrawingArea.method339(121, 0x807660, 506, 7);
  704. } else if (myPrivilege == 11) { // Veteran
  705. modIcons[10].drawSprite(10 + xPos, 122 + yPos);
  706. xPos += 14;
  707. newRegularFont
  708. .drawBasicString(fixedString + "", 23, 133, 0, -1);
  709. textDrawingArea.method385(0, ": ", 133,
  710. (20 + textDrawingArea.getTextWidth(s)));
  711. newRegularFont.drawBasicString(inputString
  712. + ("*"),
  713. 20 + textDrawingArea.getTextWidth(s + ": "), 133, 255,
  714. -1);
  715. DrawingArea.method339(121, 0x807660, 506, 7);
  716. }
  717. }
  718. if (menuOpen && menuScreenArea == 2) {
  719. drawMenu();
  720. }
  721. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  722. aRSImageProducer_1165.initDrawingArea();
  723. Texture.anIntArray1472 = anIntArray1182;
  724. }
  725.  
  726. private String clanUsername;
  727. private String clanMessage;
  728. private String clanTitle;
  729. private final String[] clanTitles;
  730. private int channelRights;
  731.  
  732. @Override
  733. public void init() {
  734. try {
  735. nodeID = 1;
  736. portOff = 0;
  737. setHighMem();
  738. isMembers = true;
  739. signlink.storeid = 32;
  740. signlink.startpriv(InetAddress.getLocalHost());
  741. initClientFrame(503, 765);
  742. instance = this;
  743. } catch (Exception exception) {
  744. return;
  745. }
  746. try {
  747. readSettings();
  748. } catch (IOException e) {
  749. }
  750. }
  751.  
  752. @Override
  753. public void startRunnable(Runnable runnable, int i) {
  754. if (i > 10)
  755. i = 10;
  756. if (signlink.mainapp != null) {
  757. signlink.startthread(runnable, i);
  758. } else {
  759. super.startRunnable(runnable, i);
  760. }
  761. }
  762.  
  763. public Socket openSocket(int port) throws IOException {
  764. return new Socket(InetAddress.getByName(server), port);
  765. }
  766.  
  767. public boolean processMenuClick() {
  768. if (activeInterfaceType != 0)
  769. return false;
  770. int j = super.clickMode3;
  771. if (spellSelected == 1 && super.saveClickX >= 516
  772. && super.saveClickY >= 160 && super.saveClickX <= 765
  773. && super.saveClickY <= 205)
  774. j = 0;
  775. if (menuOpen) {
  776. if (j != 1) {
  777. int k = super.mouseX;
  778. int j1 = super.mouseY;
  779. if (menuScreenArea == 0) {
  780. k -= 4;
  781. j1 -= 4;
  782. }
  783. if (menuScreenArea == 1) {
  784. k -= 519;
  785. j1 -= 168;
  786. }
  787. if (menuScreenArea == 2) {
  788. k -= 17;
  789. j1 -= 338;
  790. }
  791. if (menuScreenArea == 3) {
  792. k -= 519;
  793. j1 -= 0;
  794. }
  795. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  796. || j1 < menuOffsetY - 10
  797. || j1 > menuOffsetY + menuHeight + 10) {
  798. menuOpen = false;
  799. if (menuScreenArea == 1)
  800. needDrawTabArea = true;
  801. if (menuScreenArea == 2)
  802. inputTaken = true;
  803. }
  804. }
  805. if (j == 1) {
  806. int l = menuOffsetX;
  807. int k1 = menuOffsetY;
  808. int i2 = menuWidth;
  809. int k2 = super.saveClickX;
  810. int l2 = super.saveClickY;
  811. if (menuScreenArea == 0) {
  812. k2 -= 4;
  813. l2 -= 4;
  814. }
  815. if (menuScreenArea == 1) {
  816. k2 -= 519;
  817. l2 -= 168;
  818. }
  819. if (menuScreenArea == 2) {
  820. k2 -= 17;
  821. l2 -= 338;
  822. }
  823. if (menuScreenArea == 3) {
  824. k2 -= 519;
  825. l2 -= 0;
  826. }
  827. int i3 = -1;
  828. for (int j3 = 0; j3 < menuActionRow; j3++) {
  829. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  830. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  831. i3 = j3;
  832. }
  833. if (i3 != -1)
  834. doAction(i3);
  835. menuOpen = false;
  836. if (menuScreenArea == 1)
  837. needDrawTabArea = true;
  838. if (menuScreenArea == 2) {
  839. inputTaken = true;
  840. }
  841. }
  842. return true;
  843. } else {
  844. if (j == 1 && menuActionRow > 0) {
  845. int i1 = menuActionID[menuActionRow - 1];
  846. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  847. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  848. || i1 == 847 || i1 == 447 || i1 == 1125) {
  849. int l1 = menuActionCmd2[menuActionRow - 1];
  850. int j2 = menuActionCmd3[menuActionRow - 1];
  851. RSInterface class9 = RSInterface.interfaceCache[j2];
  852. if (class9.aBoolean259 || class9.aBoolean235) {
  853. aBoolean1242 = false;
  854. anInt989 = 0;
  855. anInt1084 = j2;
  856. anInt1085 = l1;
  857. activeInterfaceType = 2;
  858. anInt1087 = super.saveClickX;
  859. anInt1088 = super.saveClickY;
  860. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  861. activeInterfaceType = 1;
  862. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  863. activeInterfaceType = 3;
  864. return true;
  865. }
  866. }
  867. }
  868. if (j == 1
  869. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  870. && menuActionRow > 2)
  871. j = 2;
  872. if (j == 1 && menuActionRow > 0)
  873. doAction(menuActionRow - 1);
  874. if (j == 2 && menuActionRow > 0)
  875. determineMenuSize();
  876. return false;
  877. }
  878. }
  879.  
  880. public static int totalRead = 0;
  881.  
  882. public static String getFileNameWithoutExtension(String fileName) {
  883. File tmpFile = new File(fileName);
  884. tmpFile.getName();
  885. int whereDot = tmpFile.getName().lastIndexOf('.');
  886. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  887. return tmpFile.getName().substring(0, whereDot);
  888. }
  889. return "";
  890. }
  891.  
  892. public String indexLocation(int cacheIndex, int index) {
  893. return signlink.findcachedir() + "index" + cacheIndex + "/"
  894. + (index != -1 ? index + ".gz" : "");
  895. }
  896.  
  897. public void repackCacheIndex(int cacheIndex) {
  898. System.out.println("Started repacking index " + cacheIndex + ".");
  899. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  900. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  901. try {
  902. for (int index = 0; index < indexLength; index++) {
  903. String name = getFileNameWithoutExtension(file[index]
  904. .toString());
  905. if (name.isEmpty()) {
  906. continue;
  907. }
  908. int fileIndex = Integer.parseInt(name);
  909. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  910. if (data != null && data.length > 0) {
  911. decompressors[cacheIndex].method234(data.length, data,
  912. fileIndex);
  913. System.out.println("Repacked " + fileIndex + ".");
  914. } else {
  915. System.out.println("Unable to locate index " + fileIndex
  916. + ".");
  917. }
  918. }
  919. } catch (Exception e) {
  920. System.out.println("Error packing cache index " + cacheIndex + ".");
  921. e.printStackTrace();
  922. }
  923. System.out.println("Finished repacking " + cacheIndex + ".");
  924. }
  925.  
  926. public byte[] fileToByteArray(int cacheIndex, int index) {
  927. try {
  928. if (indexLocation(cacheIndex, index).length() <= 0
  929. || indexLocation(cacheIndex, index) == null) {
  930. return null;
  931. }
  932. File file = new File(indexLocation(cacheIndex, index));
  933. byte[] fileData = new byte[(int) file.length()];
  934. FileInputStream fis = new FileInputStream(file);
  935. fis.read(fileData);
  936. fis.close();
  937. return fileData;
  938. } catch (Exception e) {
  939. return null;
  940. }
  941. }
  942.  
  943. public void preloadModels() {
  944. File models = new File(signlink.findcachedir() + "/Raw/");
  945. File[] modelList = models.listFiles();
  946. for (int model = 0; model < modelList.length; model++) {
  947. String modelID = modelList[model].getName();
  948. byte[] modelData = ReadFile(signlink.findcachedir() + "/Raw/"
  949. + modelID);
  950. Model.method460(modelData,
  951. Integer.parseInt(getFileNameWithoutExtension(modelID)));
  952. }
  953. }
  954.  
  955. public static final byte[] ReadFile(String s) {
  956. try {
  957. byte abyte0[];
  958. File file = new File(s);
  959. int i = (int) file.length();
  960. abyte0 = new byte[i];
  961. DataInputStream datainputstream = new DataInputStream(
  962. new BufferedInputStream(new FileInputStream(s)));
  963. datainputstream.readFully(abyte0, 0, i);
  964. datainputstream.close();
  965. totalRead++;
  966. return abyte0;
  967. } catch (Exception e) {
  968. System.out.println((new StringBuilder()).append("Read Error: ")
  969. .append(s).toString());
  970. return null;
  971. }
  972. }
  973.  
  974. public void addModels() {
  975. for (int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  976. byte[] abyte0 = getModel(ModelIndex);
  977. if (abyte0 != null && abyte0.length > 0) {
  978. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  979. }
  980. }
  981. }
  982.  
  983. public byte[] getModel(int Index) {
  984. try {
  985. File Model = new File(signlink.findcachedir() + "./pModels/"
  986. + Index + ".gz");
  987. byte[] aByte = new byte[(int) Model.length()];
  988. FileInputStream fis = new FileInputStream(Model);
  989. fis.read(aByte);
  990. System.out.println("" + Index + " aByte = [" + aByte + "]!");
  991. fis.close();
  992. return aByte;
  993. } catch (Exception e) {
  994. return null;
  995. }
  996. }
  997.  
  998. public void addMaps() {
  999. for (int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  1000. byte[] abyte0 = getMaps(MapIndex);
  1001. if (abyte0 != null && abyte0.length > 0) {
  1002. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  1003. System.out.println("Maps Added");
  1004. }
  1005. }
  1006. }
  1007.  
  1008. public byte[] getMaps(int Index) {
  1009. try {
  1010. File Map = new File(signlink.findcachedir() + "./pMaps/" + Index
  1011. + ".gz");
  1012. byte[] aByte = new byte[(int) Map.length()];
  1013. FileInputStream fis = new FileInputStream(Map);
  1014. fis.read(aByte);
  1015. pushMessage("aByte = [" + aByte + "]!", 0, "");
  1016. fis.close();
  1017. return aByte;
  1018. } catch (Exception e) {
  1019. return null;
  1020. }
  1021. }
  1022.  
  1023. public void saveMidi(boolean flag, byte abyte0[]) {
  1024. signlink.midifade = flag ? 1 : 0;
  1025. signlink.midisave(abyte0, abyte0.length);
  1026. }
  1027.  
  1028. public int positions[] = new int[2000];
  1029. public int landScapes[] = new int[2000];
  1030. public int objects[] = new int[2000];
  1031.  
  1032. public final void method22() {
  1033. try {
  1034. anInt985 = -1;
  1035. aClass19_1056.removeAll();
  1036. aClass19_1013.removeAll();
  1037. Texture.method366();
  1038. unlinkMRUNodes();
  1039. loadNewObjects();
  1040. worldController.initToNull();
  1041.  
  1042. System.gc();
  1043. for (int i = 0; i < 4; i++)
  1044. aClass11Array1230[i].method210();
  1045.  
  1046. for (int l = 0; l < 4; l++) {
  1047. for (int k1 = 0; k1 < 104; k1++) {
  1048. for (int j2 = 0; j2 < 104; j2++)
  1049. byteGroundArray[l][k1][j2] = 0;
  1050.  
  1051. }
  1052.  
  1053. }
  1054.  
  1055. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  1056. intGroundArray);
  1057.  
  1058. int k2 = aByteArrayArray1183.length;
  1059.  
  1060. int k18 = 62;
  1061. for (int A = 0; A < k2; A++)
  1062. for (int B = 0; B < 2000; B++)
  1063. if (anIntArray1234[A] == positions[B]) {
  1064. anIntArray1235[A] = landScapes[B];
  1065. anIntArray1236[A] = objects[B];
  1066. }
  1067.  
  1068. stream.createFrame(0);
  1069.  
  1070. if (!aBoolean1159) {
  1071. for (int i3 = 0; i3 < k2; i3++) {
  1072. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1073. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1074.  
  1075. byte abyte0[] = aByteArrayArray1183[i3];
  1076. if (FileOperations
  1077. .FileExists("./.ss_474/Null.map/mapsFloor/"
  1078. + anIntArray1235[i3] + ".dat"))
  1079. abyte0 = FileOperations
  1080. .ReadFile("./.ss_474/Null.map/mapsFloor/"
  1081. + anIntArray1235[i3] + ".dat");
  1082.  
  1083. if (abyte0 != null)
  1084. // objectManager.method180(abyte0, k5, i4, (anInt1069 -
  1085. // 6) * 8, (anInt1070 - 6) * 8, (byte)4,
  1086. // aClass11Array1230);
  1087. objectManager.method180(abyte0, k5, i4,
  1088. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  1089. aClass11Array1230);
  1090. }
  1091.  
  1092. for (int j4 = 0; j4 < k2; j4++) {
  1093. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1094. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1095. byte abyte2[] = aByteArrayArray1183[j4];
  1096. if (abyte2 == null && anInt1070 < 800)
  1097. // ObjectManager.method174(k7, 64, 0, 64, l5);
  1098. objectManager.method174(k7, 64, 64, l5);
  1099. }
  1100.  
  1101. anInt1097++;
  1102. if (anInt1097 > 160) {
  1103. anInt1097 = 0;
  1104. stream.createFrame(238);
  1105. stream.writeWordBigEndian(96);
  1106.  
  1107. }
  1108. stream.createFrame(0);
  1109.  
  1110. for (int i6 = 0; i6 < k2; i6++) {
  1111. byte abyte1[] = aByteArrayArray1247[i6];
  1112. if (FileOperations
  1113. .FileExists("./.ss_474/Null.map/spawnObject/"
  1114. + anIntArray1236[i6] + ".dat"))
  1115. abyte1 = FileOperations
  1116. .ReadFile("./.ss_474/Null.map/spawnObject/"
  1117. + anIntArray1236[i6] + ".dat");
  1118. if (abyte1 != null) {
  1119. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1120. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1121. // ObjectManager.method190(l8, aClass11Array1230, k9, 7,
  1122. // aClass25_946, abyte1);
  1123. objectManager.method190(l8, aClass11Array1230, k9,
  1124. worldController, abyte1);
  1125. }
  1126. }
  1127.  
  1128. }
  1129. if (aBoolean1159) {
  1130. for (int j3 = 0; j3 < 4; j3++) {
  1131. for (int k4 = 0; k4 < 13; k4++) {
  1132. for (int j6 = 0; j6 < 13; j6++) {
  1133. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1134. if (l7 != -1) {
  1135. int i9 = l7 >> 24 & 3;
  1136. int l9 = l7 >> 1 & 3;
  1137. int j10 = l7 >> 14 & 0x3ff;
  1138. int l10 = l7 >> 3 & 0x7ff;
  1139. int j11 = (j10 / 8 << 8) + l10 / 8;
  1140. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1141. if (anIntArray1234[l11] != j11
  1142. || aByteArrayArray1183[l11] == null)
  1143. continue;
  1144. // ObjectManager.method179(i9, l9,
  1145. // aClass11Array1230, 9, k4 * 8, (j10 & 7) *
  1146. // 8, aByteArrayArray1183[l11], (l10 & 7) *
  1147. // 8, j3, j6 * 8);
  1148. objectManager.method179(i9, l9,
  1149. aClass11Array1230, k4 * 8,
  1150. (j10 & 7) * 8,
  1151. aByteArrayArray1183[l11],
  1152. (l10 & 7) * 8, j3, j6 * 8);
  1153. break;
  1154. }
  1155.  
  1156. }
  1157. }
  1158.  
  1159. }
  1160.  
  1161. }
  1162.  
  1163. for (int l4 = 0; l4 < 13; l4++) {
  1164. for (int k6 = 0; k6 < 13; k6++) {
  1165. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1166. if (i8 == -1)
  1167. // ObjectManager.method174(k6 * 8, 8, 0, 8, l4 * 8);
  1168. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1169. }
  1170.  
  1171. }
  1172.  
  1173. stream.createFrame(0);
  1174.  
  1175. for (int l6 = 0; l6 < 4; l6++) {
  1176. for (int j8 = 0; j8 < 13; j8++) {
  1177. for (int j9 = 0; j9 < 13; j9++) {
  1178. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1179. if (i10 != -1) {
  1180. int k10 = i10 >> 24 & 3;
  1181. int i11 = i10 >> 1 & 3;
  1182. int k11 = i10 >> 14 & 0x3ff;
  1183. int i12 = i10 >> 3 & 0x7ff;
  1184. int j12 = (k11 / 8 << 8) + i12 / 8;
  1185. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1186. if (anIntArray1234[k12] != j12
  1187. || aByteArrayArray1247[k12] == null)
  1188. continue;
  1189. if (FileOperations
  1190. .FileExists("./Cache/FloorMaps/"
  1191. + anIntArray1235[k12]
  1192. + ".dat"))
  1193. FileOperations.ReadFile(signlink
  1194. .findcachedir()
  1195. + "FloorMaps/"
  1196. + anIntArray1235[k12] + ".dat");
  1197. // ObjectManager.method183(aClass11Array1230,
  1198. // aClass25_946, k10, j8 * 8, (i12 & 7) * 8,
  1199. // true, l6, abyte0, (k11 & 7) * 8, i11, j9
  1200. // * 8);
  1201. objectManager.method183(aClass11Array1230,
  1202. worldController, k10, j8 * 8,
  1203. (i12 & 7) * 8, l6,
  1204. aByteArrayArray1247[k12],
  1205. (k11 & 7) * 8, i11, j9 * 8);
  1206. break;
  1207. }
  1208.  
  1209. }
  1210. }
  1211.  
  1212. }
  1213.  
  1214. }
  1215.  
  1216. }
  1217. stream.createFrame(0);
  1218. objectManager.method171(aClass11Array1230, worldController);
  1219. aRSImageProducer_1165.initDrawingArea();
  1220. stream.createFrame(0);
  1221.  
  1222. int k3 = ObjectManager.anInt145;
  1223. if (k3 > plane)
  1224. k3 = plane;
  1225.  
  1226. if (k3 < plane - 1)
  1227. k3 = plane - 1;
  1228. if (lowMem)
  1229.  
  1230. worldController.method275(ObjectManager.anInt145);
  1231. else
  1232. worldController.method275(0);
  1233. for (int i5 = 0; i5 < 104; i5++) {
  1234. for (int i7 = 0; i7 < 104; i7++)
  1235. spawnGroundItem(i5, i7);
  1236.  
  1237. }
  1238.  
  1239. anInt1051++;
  1240. if (anInt1051 > 98) {
  1241. anInt1051 = 0;
  1242. stream.createFrame(150);
  1243.  
  1244. }
  1245. method63();
  1246. } catch (Exception e) {
  1247. e.printStackTrace();
  1248. }
  1249. ObjectDef.mruNodes1.unlinkAll();
  1250.  
  1251. if (super.gameFrame != null) {
  1252. stream.createFrame(210);
  1253.  
  1254. stream.writeDWord(0x3f008edd);
  1255. }
  1256. System.gc();
  1257. Texture.method367();
  1258. onDemandFetcher.method566();
  1259.  
  1260. int k = (anInt1069 - 6) / 8 - 1;
  1261. int j1 = (anInt1069 + 6) / 8 + 1;
  1262. int i2 = (anInt1070 - 6) / 8 - 1;
  1263. int l2 = (anInt1070 + 6) / 8 + 1;
  1264. if (aBoolean1141) {
  1265. k = 49;
  1266. j1 = 50;
  1267. i2 = 49;
  1268. l2 = 50;
  1269. }
  1270. for (int l3 = k; l3 <= j1; l3++) {
  1271. for (int j5 = i2; j5 <= l2; j5++)
  1272. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1273. int j7 = onDemandFetcher.method562(0, j5, l3);
  1274. if (j7 != -1)
  1275. onDemandFetcher.method560(j7, 3);
  1276. int k8 = onDemandFetcher.method562(1, j5, l3);
  1277. if (k8 != -1)
  1278. onDemandFetcher.method560(k8, 3);
  1279. }
  1280.  
  1281. }
  1282.  
  1283. }
  1284.  
  1285. public void unlinkMRUNodes() {
  1286. ObjectDef.mruNodes1.unlinkAll();
  1287. ObjectDef.mruNodes2.unlinkAll();
  1288. EntityDef.mruNodes.unlinkAll();
  1289. ItemDef.mruNodes2.unlinkAll();
  1290. ItemDef.mruNodes1.unlinkAll();
  1291. Player.mruNodes.unlinkAll();
  1292. SpotAnim.aMRUNodes_415.unlinkAll();
  1293. }
  1294.  
  1295. public void method24(int i) {
  1296. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1297. int j = ai.length;
  1298. for (int k = 0; k < j; k++)
  1299. ai[k] = 0;
  1300.  
  1301. for (int l = 1; l < 103; l++) {
  1302. int i1 = 24628 + (103 - l) * 512 * 4;
  1303. for (int k1 = 1; k1 < 103; k1++) {
  1304. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1305. worldController.method309(ai, i1, i, k1, l);
  1306. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1307. worldController.method309(ai, i1, i + 1, k1, l);
  1308. i1 += 4;
  1309. }
  1310.  
  1311. }
  1312.  
  1313. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16)
  1314. + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  1315. + ((238 + (int) (Math.random() * 20D)) - 10);
  1316. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  1317. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1318. for (int i2 = 1; i2 < 103; i2++) {
  1319. for (int j2 = 1; j2 < 103; j2++) {
  1320. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1321. method50(i2, j1, j2, l1, i);
  1322. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1323. method50(i2, j1, j2, l1, i + 1);
  1324. }
  1325.  
  1326. }
  1327.  
  1328. aRSImageProducer_1165.initDrawingArea();
  1329. anInt1071 = 0;
  1330. for (int k2 = 0; k2 < 104; k2++) {
  1331. for (int l2 = 0; l2 < 104; l2++) {
  1332. int i3 = worldController.method303(plane, k2, l2);
  1333. if (i3 != 0) {
  1334. i3 = i3 >> 14 & 0x7fff;
  1335. int j3 = ObjectDef.forID(i3).anInt746;
  1336. if (j3 >= 0) {
  1337. int k3 = k2;
  1338. int l3 = l2;
  1339. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36
  1340. && j3 != 46 && j3 != 47 && j3 != 48) {
  1341. byte byte0 = 104;
  1342. byte byte1 = 104;
  1343. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1344. for (int i4 = 0; i4 < 10; i4++) {
  1345. int j4 = (int) (Math.random() * 4D);
  1346. if (j4 == 0 && k3 > 0 && k3 > k2 - 3
  1347. && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1348. k3--;
  1349. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3
  1350. && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1351. k3++;
  1352. if (j4 == 2 && l3 > 0 && l3 > l2 - 3
  1353. && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1354. l3--;
  1355. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3
  1356. && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1357. l3++;
  1358. }
  1359.  
  1360. }
  1361. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1362. anIntArray1072[anInt1071] = k3;
  1363. anIntArray1073[anInt1071] = l3;
  1364. anInt1071++;
  1365. }
  1366. }
  1367. }
  1368.  
  1369. }
  1370.  
  1371. }
  1372.  
  1373. public void spawnGroundItem(int i, int j) {
  1374. NodeList class19 = groundArray[plane][i][j];
  1375. if (class19 == null) {
  1376. worldController.method295(plane, i, j);
  1377. return;
  1378. }
  1379. int k = 0xfa0a1f01;
  1380. Object obj = null;
  1381. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1382. .reverseGetNext()) {
  1383. ItemDef itemDef = ItemDef.forID(item.ID);
  1384. int l = itemDef.value;
  1385. if (itemDef.stackable)
  1386. l *= item.anInt1559 + 1;
  1387. // notifyItemSpawn(item, i + baseX, j + baseY);
  1388.  
  1389. if (l > k) {
  1390. k = l;
  1391. obj = item;
  1392. }
  1393. }
  1394.  
  1395. class19.insertTail(((Node) (obj)));
  1396. Object obj1 = null;
  1397. Object obj2 = null;
  1398. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1399. .reverseGetNext()) {
  1400. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1401. && obj1 == null)
  1402. obj1 = class30_sub2_sub4_sub2_1;
  1403. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1404. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1405. && obj2 == null)
  1406. obj2 = class30_sub2_sub4_sub2_1;
  1407. }
  1408.  
  1409. int i1 = i + (j << 7) + 0x60000000;
  1410. worldController.method281(i, i1, ((Animable) (obj1)),
  1411. method42(plane, j * 128 + 64, i * 128 + 64),
  1412. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1413. }
  1414.  
  1415. public void method26(boolean flag) {
  1416. for (int j = 0; j < npcCount; j++) {
  1417. NPC npc = npcArray[npcIndices[j]];
  1418. int k = 0x20000000 + (npcIndices[j] << 14);
  1419. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1420. continue;
  1421. int l = npc.x >> 7;
  1422. int i1 = npc.y >> 7;
  1423. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1424. continue;
  1425. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1426. && (npc.y & 0x7f) == 64) {
  1427. if (anIntArrayArray929[l][i1] == anInt1265)
  1428. continue;
  1429. anIntArrayArray929[l][i1] = anInt1265;
  1430. }
  1431. if (!npc.desc.aBoolean84)
  1432. k += 0x80000000;
  1433. worldController
  1434. .method285(plane, npc.anInt1552,
  1435. method42(plane, npc.y, npc.x), k, npc.y,
  1436. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1437. npc.aBoolean1541);
  1438. }
  1439. }
  1440.  
  1441. private boolean replayWave() {
  1442. return signlink.wavereplay();
  1443. }
  1444.  
  1445. public void loadError() {
  1446. String s = "ondemand";// was a constant parameter
  1447. System.out.println(s);
  1448. try {
  1449. getAppletContext().showDocument(
  1450. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1451. } catch (Exception exception) {
  1452. exception.printStackTrace();
  1453. }
  1454. do
  1455. try {
  1456. Thread.sleep(1000L);
  1457. } catch (Exception _ex) {
  1458. }
  1459. while (true);
  1460. }
  1461.  
  1462. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
  1463. int i1, int j1) {
  1464. if (class9 == null) {
  1465. return;
  1466. }
  1467. if (class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1468. return;
  1469. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1470. return;
  1471. int k1 = class9.children.length;
  1472. for (int l1 = 0; l1 < k1; l1++) {
  1473. int i2 = class9.childX[l1] + i;
  1474. int j2 = (class9.childY[l1] + l) - j1;
  1475. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1476. if (class9_1 == null) {
  1477. break;
  1478. }
  1479. i2 += class9_1.anInt263;
  1480. j2 += class9_1.anInt265;
  1481. if ((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0)
  1482. && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1483. && i1 < j2 + class9_1.height) {
  1484. if (class9_1.mOverInterToTrigger >= 0)
  1485. anInt886 = class9_1.mOverInterToTrigger;
  1486. else
  1487. anInt886 = class9_1.id;
  1488. }
  1489. if (class9_1.type == 8 && k >= i2 && i1 >= j2
  1490. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1491. anInt1315 = class9_1.id;
  1492. }
  1493. if (class9_1.type == 9 && k >= i2 && i1 >= j2
  1494. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1495. anInt1315 = class9_1.id;
  1496. }
  1497. if (class9_1.type == 5 && k >= i2 && i1 >= j2
  1498. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1499. hoverId = class9_1.id;
  1500. } else {
  1501. hoverId = -1;
  1502. }
  1503. if (class9_1.type == 0) {
  1504. buildInterfaceMenu(i2, class9_1, k, j2, i1,
  1505. class9_1.scrollPosition);
  1506. if (class9_1.scrollMax > class9_1.height)
  1507. if (scrollbarVisible(class9_1))
  1508. method65(i2 + class9_1.width, class9_1.height, k, i1,
  1509. class9_1, j2, true, class9_1.scrollMax);
  1510. } else {
  1511. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
  1512. && k < i2 + class9_1.width && i1 < j2 + class9_1.height + 10) {
  1513. boolean flag = false;
  1514. if (class9_1.contentType != 0)
  1515. flag = buildFriendsListMenu(class9_1);
  1516. if (!flag) {
  1517. menuActionName[menuActionRow] = class9_1.tooltip;
  1518. menuActionID[menuActionRow] = 315;
  1519. menuActionCmd3[menuActionRow] = class9_1.id;
  1520. menuActionRow++;
  1521. }
  1522. }
  1523. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
  1524. && i1 >= j2 && k < i2 + class9_1.width
  1525. && i1 < j2 + class9_1.height) {
  1526. String s = class9_1.selectedActionName;
  1527. if (s.indexOf(" ") != -1)
  1528. s = s.substring(0, s.indexOf(" "));
  1529. menuActionName[menuActionRow] = "Autocast" + "@gre@ "
  1530. + class9_1.spellName;
  1531. menuActionID[menuActionRow] = 104;// autocast
  1532. menuActionCmd3[menuActionRow] = class9_1.id;
  1533. menuActionRow++;
  1534. menuActionName[menuActionRow] = s + " @gre@"
  1535. + class9_1.spellName;
  1536. menuActionID[menuActionRow] = 626;
  1537. menuActionCmd3[menuActionRow] = class9_1.id;
  1538. menuActionRow++;
  1539. }
  1540. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
  1541. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1542. menuActionName[menuActionRow] = "Close";
  1543. menuActionID[menuActionRow] = 200;
  1544. menuActionCmd3[menuActionRow] = class9_1.id;
  1545. menuActionRow++;
  1546. }
  1547. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
  1548. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1549. menuActionName[menuActionRow] = class9_1.tooltip;
  1550. menuActionID[menuActionRow] = 169;
  1551. menuActionCmd3[menuActionRow] = class9_1.id;
  1552. menuActionRow++;
  1553. }
  1554. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
  1555. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1556. menuActionName[menuActionRow] = class9_1.tooltip;
  1557. menuActionID[menuActionRow] = 646;
  1558. menuActionCmd3[menuActionRow] = class9_1.id;
  1559. menuActionRow++;
  1560. }
  1561. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
  1562. && i1 >= j2 && k < i2 + class9_1.width
  1563. && i1 < j2 + class9_1.height) {
  1564. menuActionName[menuActionRow] = class9_1.tooltip;
  1565. menuActionID[menuActionRow] = 679;
  1566. menuActionCmd3[menuActionRow] = class9_1.id;
  1567. menuActionRow++;
  1568. }
  1569. if (class9_1.atActionType == 8 && !aBoolean1149 && k >= i2
  1570. && i1 >= j2 && k < i2 + class9_1.width
  1571. && i1 < j2 + class9_1.height) {
  1572. for (int s1 = 0; s1 < class9_1.tooltips.length; s1++) {
  1573. if (!RSInterface.interfaceCache[32007].isMouseoverTriggered) {
  1574. if (class9_1.id > 32016) {
  1575. continue;
  1576. }
  1577. }
  1578. menuActionName[menuActionRow] = class9_1.tooltips[s1];
  1579. menuActionID[menuActionRow] = 1700 + s1;
  1580. menuActionCmd3[menuActionRow] = class9_1.id;
  1581. menuActionRow++;
  1582. }
  1583. }
  1584. if (class9_1.atActionType == 9 && !aBoolean1149 && k >= i2
  1585. && i1 >= j2 && k < i2 + class9_1.width
  1586. && i1 < j2 + class9_1.height) {
  1587. menuActionName[menuActionRow] = class9_1.tooltip;
  1588. menuActionID[menuActionRow] = 1100;
  1589. menuActionCmd3[menuActionRow] = class9_1.id;
  1590. menuActionRow++;
  1591. }
  1592. if (class9_1.atActionType == 10 && !aBoolean1149 && k >= i2
  1593. && i1 >= j2 && k < i2 + class9_1.width
  1594. && i1 < j2 + class9_1.height) {
  1595. menuActionName[menuActionRow] = class9_1.getMenuItem().getText();
  1596. menuActionID[menuActionRow] = 1200;
  1597. menuActionCmd3[menuActionRow] = class9_1.id;
  1598. menuActionRow++;
  1599. }
  1600. if (k >= i2 && i1 >= j2
  1601. && k < i2 + (class9_1.type == 4 ? 100 : class9_1.width)
  1602. && i1 < j2 + class9_1.height) {
  1603. if (class9_1.actions != null) {
  1604. if ((class9_1.type == 4 && class9_1.message.length() > 0)
  1605. || class9_1.type == 5) {
  1606. for (int action = class9_1.actions.length - 1; action >= 0; action--) {
  1607. if (class9_1.actions[action] != null) {
  1608. menuActionName[menuActionRow] = class9_1.actions[action]
  1609. + (class9_1.type == 4 ? " "
  1610. + class9_1.message : "");
  1611. menuActionID[menuActionRow] = 647;
  1612. menuActionCmd2[menuActionRow] = action;
  1613. menuActionCmd3[menuActionRow] = class9_1.id;
  1614. menuActionRow++;
  1615. }
  1616. }
  1617. }
  1618. }
  1619. }
  1620. if (class9_1.type == 2) {
  1621. int k2 = 0;
  1622. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1623. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1624. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1625. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1626. if (k2 < 20) {
  1627. j3 += class9_1.spritesX[k2];
  1628. k3 += class9_1.spritesY[k2];
  1629. }
  1630. if (k >= j3 && i1 >= k3 && k < j3 + 32
  1631. && i1 < k3 + 32) {
  1632. mouseInvInterfaceIndex = k2;
  1633. lastActiveInvInterface = class9_1.id;
  1634. if (class9_1.inv[k2] > 0) {
  1635. ItemDef itemDef = ItemDef
  1636. .forID(class9_1.inv[k2] - 1);
  1637. if (itemSelected == 1
  1638. && class9_1.isInventoryInterface) {
  1639. if (class9_1.id != anInt1284
  1640. || k2 != anInt1283) {
  1641. menuActionName[menuActionRow] = "Use "
  1642. + selectedItemName
  1643. + " with @lre@"
  1644. + itemDef.name;
  1645. menuActionID[menuActionRow] = 870;
  1646. menuActionCmd1[menuActionRow] = itemDef.id;
  1647. menuActionCmd2[menuActionRow] = k2;
  1648. menuActionCmd3[menuActionRow] = class9_1.id;
  1649. menuActionRow++;
  1650. }
  1651. } else if (spellSelected == 1
  1652. && class9_1.isInventoryInterface) {
  1653. if ((spellUsableOn & 0x10) == 16) {
  1654. menuActionName[menuActionRow] = spellTooltip
  1655. + " @lre@" + itemDef.name;
  1656. menuActionID[menuActionRow] = 543;
  1657. menuActionCmd1[menuActionRow] = itemDef.id;
  1658. menuActionCmd2[menuActionRow] = k2;
  1659. menuActionCmd3[menuActionRow] = class9_1.id;
  1660. menuActionRow++;
  1661. }
  1662. } else {
  1663. if (class9_1.isInventoryInterface) {
  1664. for (int l3 = 4; l3 >= 3; l3--)
  1665. if (itemDef.options != null
  1666. && itemDef.options[l3] != null) {
  1667. menuActionName[menuActionRow] = itemDef.options[l3]
  1668. + " @lre@"
  1669. + itemDef.name;
  1670. if (l3 == 3)
  1671. menuActionID[menuActionRow] = 493;
  1672. if (l3 == 4)
  1673. menuActionID[menuActionRow] = 847;
  1674. menuActionCmd1[menuActionRow] = itemDef.id;
  1675. menuActionCmd2[menuActionRow] = k2;
  1676. menuActionCmd3[menuActionRow] = class9_1.id;
  1677. menuActionRow++;
  1678. } else if (l3 == 4) {
  1679. menuActionName[menuActionRow] = "Drop @lre@"
  1680. + itemDef.name;
  1681. menuActionID[menuActionRow] = 847;
  1682. menuActionCmd1[menuActionRow] = itemDef.id;
  1683. menuActionCmd2[menuActionRow] = k2;
  1684. menuActionCmd3[menuActionRow] = class9_1.id;
  1685. menuActionRow++;
  1686. }
  1687.  
  1688. }
  1689. if (class9_1.usableItemInterface) {
  1690. menuActionName[menuActionRow] = "Use @lre@"
  1691. + itemDef.name;
  1692. menuActionID[menuActionRow] = 447;
  1693. menuActionCmd1[menuActionRow] = itemDef.id;
  1694. // k2 = inventory spot
  1695. // System.out.println(k2);
  1696. menuActionCmd2[menuActionRow] = k2;
  1697. menuActionCmd3[menuActionRow] = class9_1.id;
  1698. menuActionRow++;
  1699. }
  1700. if (class9_1.isInventoryInterface
  1701. && itemDef.options != null) {
  1702. for (int i4 = 2; i4 >= 0; i4--)
  1703. if (itemDef.options[i4] != null) {
  1704. menuActionName[menuActionRow] = itemDef.options[i4]
  1705. + " @lre@"
  1706. + itemDef.name;
  1707. if (i4 == 0)
  1708. menuActionID[menuActionRow] = 74;
  1709. if (i4 == 1)
  1710. menuActionID[menuActionRow] = 454;
  1711. if (i4 == 2)
  1712. menuActionID[menuActionRow] = 539;
  1713. menuActionCmd1[menuActionRow] = itemDef.id;
  1714. menuActionCmd2[menuActionRow] = k2;
  1715. menuActionCmd3[menuActionRow] = class9_1.id;
  1716. menuActionRow++;
  1717. }
  1718.  
  1719. }
  1720. if (class9_1.actions != null) {
  1721. for (int j4 = 6; j4 >= 0; j4--) {
  1722. if (j4 > class9_1.actions.length - 1)
  1723. continue;
  1724. if (class9_1.actions[j4] != null) {
  1725. if (class9_1.parentID == 5292) {
  1726. if (modifiableXValue > 0) {
  1727. if (class9_1.actions.length < 7) {
  1728. class9_1.actions = new String[] {
  1729. "Withdraw 1",
  1730. "Withdraw 5",
  1731. "Withdraw 10",
  1732. "Withdraw All",
  1733. "Withdraw X",
  1734. "Withdraw "
  1735. + modifiableXValue,
  1736. "Withdraw All but one" };
  1737. }
  1738. class9_1.actions[5] = "Withdraw "
  1739. + modifiableXValue;
  1740. }
  1741. }
  1742. menuActionName[menuActionRow] = class9_1.actions[j4]
  1743. + " @lre@"
  1744. + itemDef.name;
  1745. if (j4 == 0)
  1746. menuActionID[menuActionRow] = 632;
  1747. if (j4 == 1)
  1748. menuActionID[menuActionRow] = 78;
  1749. if (j4 == 2)
  1750. menuActionID[menuActionRow] = 867;
  1751. if (j4 == 3)
  1752. menuActionID[menuActionRow] = 431;
  1753. if (j4 == 4)
  1754. menuActionID[menuActionRow] = 53;
  1755. if (class9_1.parentID == 5292) {
  1756. if (class9_1.actions.length < 7) {
  1757. if (j4 == 5)
  1758. menuActionID[menuActionRow] = 291;
  1759. } else {
  1760. if (j4 == 5)
  1761. menuActionID[menuActionRow] = 300;
  1762. if (j4 == 6)
  1763. menuActionID[menuActionRow] = 291;
  1764. }
  1765. }
  1766. menuActionCmd1[menuActionRow] = itemDef.id;
  1767. menuActionCmd2[menuActionRow] = k2;
  1768. menuActionCmd3[menuActionRow] = class9_1.id;
  1769. menuActionRow++;
  1770. }
  1771. }
  1772. }
  1773. if (class9_1.parentID >= 58040
  1774. && class9_1.parentID <= 58048
  1775. || class9_1.parentID >= 32100
  1776. && class9_1.parentID <= 32156
  1777. || class9_1.parentID >= 32200
  1778. && class9_1.parentID <= 32222) {
  1779. return;
  1780. }
  1781. if (class9_1.isItemSearchComponent) {
  1782. menuActionName[menuActionRow] = "Select @lre@"
  1783. + itemDef.name;
  1784. menuActionID[menuActionRow] = 1130;
  1785. menuActionCmd1[menuActionRow] = itemDef.id;
  1786. menuActionCmd2[menuActionRow] = k2;
  1787. menuActionCmd3[menuActionRow] = class9_1.id;
  1788. menuActionRow++;
  1789. } else {
  1790. if (!RSInterface.interfaceCache[32007].isMouseoverTriggered) {
  1791. if (class9_1.id > 32016) {
  1792. continue;
  1793. }
  1794. }
  1795. menuActionName[menuActionRow] = "Examine @lre@"
  1796. + itemDef.name;
  1797. menuActionID[menuActionRow] = 1125;
  1798. menuActionCmd1[menuActionRow] = itemDef.id;
  1799. menuActionCmd2[menuActionRow] = k2;
  1800. menuActionCmd3[menuActionRow] = class9_1.id;
  1801. menuActionRow++;
  1802. }
  1803. }
  1804. }
  1805. }
  1806. k2++;
  1807. }
  1808.  
  1809. }
  1810.  
  1811. }
  1812. }
  1813. }
  1814. }
  1815.  
  1816. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1817. scrollBar1.drawSprite(i1, l);
  1818. scrollBar2.drawSprite(i1, (l + j) - 16);
  1819. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1820. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1821. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1822. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1823. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1824. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1825. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1826. int k1 = ((j - 32) * j) / j1;
  1827. if (k1 < 8)
  1828. k1 = 8;
  1829. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1830. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1831. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1832. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1833. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1834. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1835. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1836. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1837. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1838. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1839. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1840. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1841. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1842. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1843. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1844. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1845. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1846. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1847. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1848. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1849. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1850. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1851. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1852. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1853. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1854. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1855. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1856. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1857. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1858. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1859. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1860. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1861. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1862. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1863. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1864. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1865. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1866. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1867. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1868. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1869. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1870. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1871. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1872. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1873. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1874. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1875. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1876. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1877. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1878. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1879. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1880. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1881. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1882. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1883. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1884. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1885. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1886. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1887. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1888. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1889. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1890. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1891. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1892. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1893. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1894. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1895. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1896. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1897. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1898. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1899. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1900. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1901. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1902. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1903. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1904. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1905. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1906. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1907. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1908. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1909. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1910. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1911. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1912. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1913. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1914. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1915. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1916. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1917. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1918. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1919. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1920. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1921. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1922. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1923. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1924. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1925. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1926. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1927. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1928. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1929. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1930. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1931. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1932. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1933. }
  1934.  
  1935. public void updateNPCs(Stream stream, int i) {
  1936. anInt839 = 0;
  1937. anInt893 = 0;
  1938. method139(stream);
  1939. method46(i, stream);
  1940. method86(stream);
  1941. for (int k = 0; k < anInt839; k++) {
  1942. int l = anIntArray840[k];
  1943. if (npcArray[l].anInt1537 != loopCycle) {
  1944. npcArray[l].desc = null;
  1945. npcArray[l] = null;
  1946. }
  1947. }
  1948.  
  1949. if (stream.currentOffset != i) {
  1950. signlink.reporterror(myUsername
  1951. + " size mismatch in getnpcpos - pos:"
  1952. + stream.currentOffset + " psize:" + i);
  1953. throw new RuntimeException("eek");
  1954. }
  1955. for (int i1 = 0; i1 < npcCount; i1++)
  1956. if (npcArray[npcIndices[i1]] == null) {
  1957. signlink.reporterror(myUsername
  1958. + " null entry in npc list - pos:" + i1 + " size:"
  1959. + npcCount);
  1960. throw new RuntimeException("eek");
  1961. }
  1962.  
  1963. }
  1964.  
  1965. private int cButtonHPos;
  1966. private int cButtonCPos;
  1967.  
  1968. public void processChatModeClick() {
  1969. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482
  1970. && super.mouseY <= 503) {
  1971. cButtonHPos = 0;
  1972. aBoolean1233 = true;
  1973. inputTaken = true;
  1974. } else if (super.mouseX >= 71 && super.mouseX <= 127
  1975. && super.mouseY >= 482 && super.mouseY <= 503) {
  1976. cButtonHPos = 1;
  1977. aBoolean1233 = true;
  1978. inputTaken = true;
  1979. } else if (super.mouseX >= 137 && super.mouseX <= 193
  1980. && super.mouseY >= 482 && super.mouseY <= 503) {
  1981. cButtonHPos = 2;
  1982. aBoolean1233 = true;
  1983. inputTaken = true;
  1984. } else if (super.mouseX >= 203 && super.mouseX <= 259
  1985. && super.mouseY >= 482 && super.mouseY <= 503) {
  1986. cButtonHPos = 3;
  1987. aBoolean1233 = true;
  1988. inputTaken = true;
  1989. } else if (super.mouseX >= 269 && super.mouseX <= 325
  1990. && super.mouseY >= 482 && super.mouseY <= 503) {
  1991. cButtonHPos = 4;
  1992. aBoolean1233 = true;
  1993. inputTaken = true;
  1994. } else if (super.mouseX >= 335 && super.mouseX <= 391
  1995. && super.mouseY >= 482 && super.mouseY <= 503) {
  1996. cButtonHPos = 5;
  1997. aBoolean1233 = true;
  1998. inputTaken = true;
  1999. } else if (super.mouseX >= 404 && super.mouseX <= 515
  2000. && super.mouseY >= 482 && super.mouseY <= 503) {
  2001. cButtonHPos = 6;
  2002. aBoolean1233 = true;
  2003. inputTaken = true;
  2004. } else {
  2005. cButtonHPos = -1;
  2006. aBoolean1233 = true;
  2007. inputTaken = true;
  2008. }
  2009. if (super.clickMode3 == 1) {
  2010. if (super.saveClickX >= 5 && super.saveClickX <= 61
  2011. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2012. cButtonCPos = 0;
  2013. chatTypeView = 0;
  2014. inputTaken = true;
  2015. } else if (super.saveClickX >= 71 && super.saveClickX <= 127
  2016. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2017. cButtonCPos = 1;
  2018. chatTypeView = 5;
  2019. inputTaken = true;
  2020. } else if (super.saveClickX >= 137 && super.saveClickX <= 193
  2021. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2022. cButtonCPos = 2;
  2023. chatTypeView = 1;
  2024. inputTaken = true;
  2025. } else if (super.saveClickX >= 203 && super.saveClickX <= 259
  2026. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2027. cButtonCPos = 3;
  2028. chatTypeView = 2;
  2029. inputTaken = true;
  2030. } else if (super.saveClickX >= 269 && super.saveClickX <= 325
  2031. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2032. cButtonCPos = 4;
  2033. chatTypeView = 11;
  2034. inputTaken = true;
  2035. } else if (super.saveClickX >= 335 && super.saveClickX <= 391
  2036. && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2037. cButtonCPos = 5;
  2038. chatTypeView = 3;
  2039. inputTaken = true;
  2040. }
  2041. }
  2042. }
  2043.  
  2044. public void parseVariousSettings(int i) {
  2045. if (Varp.cache[i] == null)
  2046. return;
  2047. int j = Varp.cache[i].anInt709;
  2048. if (j == 0)
  2049. return;
  2050. int k = variousSettings[i];
  2051. if (j == 1) {
  2052. if (k == 1)
  2053. Texture.method372(0.90000000000000002D);
  2054. if (k == 2)
  2055. Texture.method372(0.80000000000000004D);
  2056. if (k == 3)
  2057. Texture.method372(0.69999999999999996D);
  2058. if (k == 4)
  2059. Texture.method372(0.59999999999999998D);
  2060. ItemDef.mruNodes1.unlinkAll();
  2061. welcomeScreenRaised = true;
  2062. }
  2063. if (j == 3) {
  2064. boolean flag1 = musicEnabled;
  2065. if (k == 0) {
  2066. adjustVolume(musicEnabled, 0);
  2067. musicEnabled = true;
  2068. }
  2069. if (k == 1) {
  2070. adjustVolume(musicEnabled, -400);
  2071. musicEnabled = true;
  2072. }
  2073. if (k == 2) {
  2074. adjustVolume(musicEnabled, -800);
  2075. musicEnabled = true;
  2076. }
  2077. if (k == 3) {
  2078. adjustVolume(musicEnabled, -1200);
  2079. musicEnabled = true;
  2080. }
  2081. if (k == 4)
  2082. musicEnabled = false;
  2083. if (musicEnabled != flag1 && !lowMem) {
  2084. if (musicEnabled) {
  2085. nextSong = currentSong;
  2086. songChanging = true;
  2087. onDemandFetcher.method558(2, nextSong);
  2088. } else {
  2089. stopMidi();
  2090. }
  2091. prevSong = 0;
  2092. }
  2093. }
  2094. if (j == 4) {
  2095. if (k == 0) {
  2096. aBoolean848 = true;
  2097. setWaveVolume(0);
  2098. }
  2099. if (k == 1) {
  2100. aBoolean848 = true;
  2101. setWaveVolume(-400);
  2102. }
  2103. if (k == 2) {
  2104. aBoolean848 = true;
  2105. setWaveVolume(-800);
  2106. }
  2107. if (k == 3) {
  2108. aBoolean848 = true;
  2109. setWaveVolume(-1200);
  2110. }
  2111. if (k == 4)
  2112. aBoolean848 = false;
  2113. }
  2114. if (j == 5)
  2115. anInt1253 = k;
  2116. if (j == 6)
  2117. anInt1249 = k;
  2118. if (j == 8) {
  2119. splitPrivateChat = k;
  2120. inputTaken = true;
  2121. }
  2122. if (j == 9)
  2123. anInt913 = k;
  2124. }
  2125.  
  2126. public void updateEntities() {
  2127. try {
  2128. int anInt974 = 0;
  2129. for (int j = -1; j < playerCount + npcCount; j++) {
  2130. Object obj;
  2131. if (j == -1)
  2132. obj = myPlayer;
  2133. else if (j < playerCount)
  2134. obj = playerArray[playerIndices[j]];
  2135. else
  2136. obj = npcArray[npcIndices[j - playerCount]];
  2137. if (obj == null || !((Entity) (obj)).isVisible())
  2138. continue;
  2139. if (obj instanceof NPC) {
  2140. EntityDef entityDef = ((NPC) obj).desc;
  2141. if (entityDef.childrenIDs != null)
  2142. entityDef = entityDef.method161();
  2143. if (entityDef == null)
  2144. continue;
  2145. }
  2146. if (j < playerCount) {
  2147. int l = 30;
  2148. Player player = (Player) obj;
  2149. if (player.headIcon >= 0) {
  2150. npcScreenPos(((Entity) (obj)),
  2151. ((Entity) (obj)).height + 15);
  2152. if (spriteDrawX > -1) {
  2153. if (player.skullIcon < 2) {
  2154. skullIcons[player.skullIcon].drawSprite(
  2155. spriteDrawX - 12, spriteDrawY - l);
  2156. l += 25;
  2157. }
  2158. if (player.headIcon < 7) {
  2159. headIcons[player.headIcon].drawSprite(
  2160. spriteDrawX - 12, spriteDrawY - l);
  2161. l += 18;
  2162. }
  2163. }
  2164. }
  2165. if (j >= 0 && anInt855 == 10
  2166. && anInt933 == playerIndices[j]) {
  2167. npcScreenPos(((Entity) (obj)),
  2168. ((Entity) (obj)).height + 15);
  2169. if (spriteDrawX > -1)
  2170. headIconsHint[player.hintIcon].drawSprite(
  2171. spriteDrawX - 12, spriteDrawY - l);
  2172. }
  2173. } else {
  2174. EntityDef entityDef_1 = ((NPC) obj).desc;
  2175. if (entityDef_1.anInt75 >= 0
  2176. && entityDef_1.anInt75 < headIcons.length) {
  2177. npcScreenPos(((Entity) (obj)),
  2178. ((Entity) (obj)).height + 15);
  2179. if (spriteDrawX > -1)
  2180. headIcons[entityDef_1.anInt75].drawSprite(
  2181. spriteDrawX - 12, spriteDrawY - 30);
  2182. }
  2183. if (anInt855 == 1
  2184. && anInt1222 == npcIndices[j - playerCount]
  2185. && loopCycle % 20 < 10) {
  2186. npcScreenPos(((Entity) (obj)),
  2187. ((Entity) (obj)).height + 15);
  2188. if (spriteDrawX > -1)
  2189. headIconsHint[0].drawSprite(spriteDrawX - 12,
  2190. spriteDrawY - 28);
  2191. }
  2192. }
  2193. if (((Entity) (obj)).textSpoken != null
  2194. && (j >= playerCount || publicChatMode == 0
  2195. || publicChatMode == 3 || publicChatMode == 1
  2196. && isFriendOrSelf(((Player) obj).name))) {
  2197. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2198. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2199. anIntArray979[anInt974] = chatTextDrawingArea
  2200. .method384(((Entity) (obj)).textSpoken) / 2;
  2201. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2202. anIntArray976[anInt974] = spriteDrawX;
  2203. anIntArray977[anInt974] = spriteDrawY;
  2204. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2205. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2206. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2207. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2208. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  2209. && ((Entity) (obj)).anInt1531 <= 3) {
  2210. anIntArray978[anInt974] += 10;
  2211. anIntArray977[anInt974] += 5;
  2212. }
  2213. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2214. anIntArray979[anInt974] = 60;
  2215. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2216. anIntArray978[anInt974] += 5;
  2217. }
  2218. }
  2219. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2220. try {
  2221. npcScreenPos(((Entity) (obj)),
  2222. ((Entity) (obj)).height + 15);
  2223. if (spriteDrawX > -1) {
  2224. int i1 = (((Entity) (obj)).currentHealth * 30)
  2225. / ((Entity) (obj)).maxHealth;
  2226. if (i1 > 30)
  2227. i1 = 30;
  2228. DrawingArea.drawPixels(5, spriteDrawY - 3,
  2229. spriteDrawX - 15, 65280, i1);
  2230. DrawingArea.drawPixels(5, spriteDrawY - 3,
  2231. (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2232. }
  2233. } catch (Exception e) {
  2234. }
  2235. }
  2236. for (int j1 = 0; j1 < 4; j1++)
  2237. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2238. npcScreenPos(((Entity) (obj)),
  2239. ((Entity) (obj)).height / 2);
  2240. if (spriteDrawX > -1) {
  2241. if (j1 == 1)
  2242. spriteDrawY -= 20;
  2243. if (j1 == 2) {
  2244. spriteDrawX -= 15;
  2245. spriteDrawY -= 10;
  2246. }
  2247. if (j1 == 3) {
  2248. spriteDrawX += 15;
  2249. spriteDrawY -= 10;
  2250. }
  2251. hitMarks[((Entity) (obj)).hitMarkTypes[j1]]
  2252. .drawSprite(spriteDrawX - 12,
  2253. spriteDrawY - 12);
  2254. smallText.drawText(0, String
  2255. .valueOf(((Entity) (obj)).hitArray[j1]),
  2256. spriteDrawY + 4, spriteDrawX);
  2257. smallText.drawText(0xffffff, String
  2258. .valueOf(((Entity) (obj)).hitArray[j1]),
  2259. spriteDrawY + 3, spriteDrawX - 1);
  2260. }
  2261. }
  2262. }
  2263. for (int k = 0; k < anInt974; k++) {
  2264. int k1 = anIntArray976[k];
  2265. int l1 = anIntArray977[k];
  2266. int j2 = anIntArray979[k];
  2267. int k2 = anIntArray978[k];
  2268. boolean flag = true;
  2269. while (flag) {
  2270. flag = false;
  2271. for (int l2 = 0; l2 < k; l2++)
  2272. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2]
  2273. && l1 - k2 < anIntArray977[l2] + 2
  2274. && k1 - j2 < anIntArray976[l2]
  2275. + anIntArray979[l2]
  2276. && k1 + j2 > anIntArray976[l2]
  2277. - anIntArray979[l2]
  2278. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  2279. l1 = anIntArray977[l2] - anIntArray978[l2];
  2280. flag = true;
  2281. }
  2282.  
  2283. }
  2284. spriteDrawX = anIntArray976[k];
  2285. spriteDrawY = anIntArray977[k] = l1;
  2286. String s = aStringArray983[k];
  2287. if (anInt1249 == 0) {
  2288. int i3 = 0xffff00;
  2289. if (anIntArray980[k] < 6)
  2290. i3 = anIntArray965[anIntArray980[k]];
  2291. if (anIntArray980[k] == 6)
  2292. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2293. if (anIntArray980[k] == 7)
  2294. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2295. if (anIntArray980[k] == 8)
  2296. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2297. if (anIntArray980[k] == 9) {
  2298. int j3 = 150 - anIntArray982[k];
  2299. if (j3 < 50)
  2300. i3 = 0xff0000 + 1280 * j3;
  2301. else if (j3 < 100)
  2302. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2303. else if (j3 < 150)
  2304. i3 = 65280 + 5 * (j3 - 100);
  2305. }
  2306. if (anIntArray980[k] == 10) {
  2307. int k3 = 150 - anIntArray982[k];
  2308. if (k3 < 50)
  2309. i3 = 0xff0000 + 5 * k3;
  2310. else if (k3 < 100)
  2311. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2312. else if (k3 < 150)
  2313. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2314. }
  2315. if (anIntArray980[k] == 11) {
  2316. int l3 = 150 - anIntArray982[k];
  2317. if (l3 < 50)
  2318. i3 = 0xffffff - 0x50005 * l3;
  2319. else if (l3 < 100)
  2320. i3 = 65280 + 0x50005 * (l3 - 50);
  2321. else if (l3 < 150)
  2322. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2323. }
  2324. if (anIntArray981[k] == 0) {
  2325. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2326. spriteDrawX);
  2327. chatTextDrawingArea.drawText(i3, s, spriteDrawY,
  2328. spriteDrawX);
  2329. }
  2330. if (anIntArray981[k] == 1) {
  2331. chatTextDrawingArea.method386(0, s, spriteDrawX,
  2332. anInt1265, spriteDrawY + 1);
  2333. chatTextDrawingArea.method386(i3, s, spriteDrawX,
  2334. anInt1265, spriteDrawY);
  2335. }
  2336. if (anIntArray981[k] == 2) {
  2337. chatTextDrawingArea.method387(spriteDrawX, s,
  2338. anInt1265, spriteDrawY + 1, 0);
  2339. chatTextDrawingArea.method387(spriteDrawX, s,
  2340. anInt1265, spriteDrawY, i3);
  2341. }
  2342. if (anIntArray981[k] == 3) {
  2343. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2344. s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2345. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2346. s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2347. }
  2348. if (anIntArray981[k] == 4) {
  2349. int i4 = chatTextDrawingArea.method384(s);
  2350. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2351. DrawingArea.setDrawingArea(334, spriteDrawX - 50,
  2352. spriteDrawX + 50, 0);
  2353. chatTextDrawingArea.method385(0, s, spriteDrawY + 1,
  2354. (spriteDrawX + 50) - k4);
  2355. chatTextDrawingArea.method385(i3, s, spriteDrawY,
  2356. (spriteDrawX + 50) - k4);
  2357. DrawingArea.defaultDrawingAreaSize();
  2358. }
  2359. if (anIntArray981[k] == 5) {
  2360. int j4 = 150 - anIntArray982[k];
  2361. int l4 = 0;
  2362. if (j4 < 25)
  2363. l4 = j4 - 25;
  2364. else if (j4 > 125)
  2365. l4 = j4 - 125;
  2366. DrawingArea
  2367. .setDrawingArea(spriteDrawY + 5, 0, 512,
  2368. spriteDrawY
  2369. - chatTextDrawingArea.anInt1497
  2370. - 1);
  2371. chatTextDrawingArea.drawText(0, s,
  2372. spriteDrawY + 1 + l4, spriteDrawX);
  2373. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4,
  2374. spriteDrawX);
  2375. DrawingArea.defaultDrawingAreaSize();
  2376. }
  2377. } else {
  2378. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2379. spriteDrawX);
  2380. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY,
  2381. spriteDrawX);
  2382. }
  2383. }
  2384. } catch (Exception e) {
  2385. }
  2386. }
  2387.  
  2388. private void delFriend(long l) {
  2389. try {
  2390. if (l == 0L)
  2391. return;
  2392. for (int i = 0; i < friendsCount; i++) {
  2393. if (friendsListAsLongs[i] != l)
  2394. continue;
  2395. friendsCount--;
  2396. needDrawTabArea = true;
  2397. for (int j = i; j < friendsCount; j++) {
  2398. friendsList[j] = friendsList[j + 1];
  2399. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2400. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2401. }
  2402.  
  2403. stream.createFrame(215);
  2404. stream.writeQWord(l);
  2405. break;
  2406. }
  2407. } catch (RuntimeException runtimeexception) {
  2408. signlink.reporterror("18622, " + false + ", " + l + ", "
  2409. + runtimeexception.toString());
  2410. throw new RuntimeException();
  2411. }
  2412. }
  2413.  
  2414. public void drawSideIcons() {
  2415. /* Top sideIcons */
  2416.  
  2417. if (tabInterfaceIDs[0] != -1)// attack
  2418. sideIcons[0].drawSprite(10, 4);
  2419. if (tabInterfaceIDs[1] != -1)// stat
  2420. sideIcons[1].drawSprite(43, 4);
  2421. if (tabInterfaceIDs[2] != -1)// quest
  2422. sideIcons[2].drawSprite(76, 3);
  2423. if (tabInterfaceIDs[3] != -1)// inventory
  2424. sideIcons[3].drawSprite(111, 5);
  2425. if (tabInterfaceIDs[4] != -1)// equipment
  2426. sideIcons[4].drawSprite(140, 1);
  2427. if (tabInterfaceIDs[5] != -1)// prayer
  2428. sideIcons[5].drawSprite(174, 1);
  2429. if (tabInterfaceIDs[6] != -1)// magic
  2430. sideIcons[6].drawSprite(208, 4);
  2431. /* Bottom sideIcons */
  2432. /*
  2433. * if(tabInterfaceIDs[7] != -1)//summoning sIcons483[7].drawSprite(11+3,
  2434. * 303);
  2435. */
  2436. if (tabInterfaceIDs[7] != -1)
  2437. sideIcons[7].drawSprite(11, 303);
  2438. if (tabInterfaceIDs[8] != -1)// friends
  2439. sideIcons[8].drawSprite(46, 306);
  2440. if (tabInterfaceIDs[9] != -1)// ignore
  2441. sideIcons[9].drawSprite(79, 306);
  2442. if (tabInterfaceIDs[10] != -1)// logout
  2443. sideIcons[10].drawSprite(113, 302);
  2444. if (tabInterfaceIDs[11] != -1)// options
  2445. sideIcons[11].drawSprite(145, 304);
  2446. if (tabInterfaceIDs[12] != -1)// emotes
  2447. sideIcons[12].drawSprite(181, 302);
  2448. }
  2449.  
  2450. public void drawRedStones() {
  2451. if (tabInterfaceIDs[tabID] != -1) {
  2452. switch (tabID) {
  2453. case 0:
  2454. redStones[0].drawSprite(3, 0);
  2455. break;
  2456. case 1:
  2457. redStones[4].drawSprite(41, 0);
  2458. break;
  2459. case 2:
  2460. redStones[4].drawSprite(74, 0);
  2461. break;
  2462. case 3:
  2463. redStones[4].drawSprite(107, 0);
  2464. break;
  2465. case 4:
  2466. redStones[4].drawSprite(140, 0);
  2467. break;
  2468. case 5:
  2469. redStones[4].drawSprite(173, 0);
  2470. break;
  2471. case 6:
  2472. redStones[1].drawSprite(206, 0);
  2473. break;
  2474. case 7:
  2475. redStones[2].drawSprite(3, 298);
  2476. break;
  2477. case 8:
  2478. redStones[4].drawSprite(41, 298);
  2479. break;
  2480. case 9:
  2481. redStones[4].drawSprite(74, 298);
  2482. break;
  2483. case 10:
  2484. redStones[4].drawSprite(107, 298);
  2485. break;
  2486. case 11:
  2487. redStones[4].drawSprite(140, 298);
  2488. break;
  2489. case 12:
  2490. redStones[4].drawSprite(173, 298);
  2491. break;
  2492. case 13:
  2493. redStones[3].drawSprite(206, 298);
  2494. break;
  2495. }
  2496. }
  2497. }
  2498.  
  2499. private void drawTabArea() {
  2500. if (revision508 == true) {
  2501. aRSImageProducer_1163.initDrawingArea();
  2502. Texture.anIntArray1472 = anIntArray1181;
  2503. tabArea508.drawSprite(0, 0);
  2504. if (invOverlayInterfaceID == -1) {
  2505. drawRedStones();
  2506. drawSideIcons();
  2507. }
  2508. if (invOverlayInterfaceID != -1)
  2509. drawInterface(0, 30,
  2510. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2511. else if (tabInterfaceIDs[tabID] != -1)
  2512. drawInterface(0, 30,
  2513. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2514. if (menuOpen && menuScreenArea == 1)
  2515. drawMenu();
  2516. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2517. aRSImageProducer_1165.initDrawingArea();
  2518. Texture.anIntArray1472 = anIntArray1182;
  2519. }
  2520. if (revision474 == true) {
  2521. aRSImageProducer_1163.initDrawingArea();
  2522. Texture.anIntArray1472 = anIntArray1181;
  2523. tabArea474.drawSprite(0, 0);
  2524. if (invOverlayInterfaceID == -1) {
  2525. drawRedStones();
  2526. drawSideIcons();
  2527. }
  2528. if (invOverlayInterfaceID != -1)
  2529. drawInterface(0, 30,
  2530. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2531. else if (tabInterfaceIDs[tabID] != -1)
  2532. drawInterface(0, 30,
  2533. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2534. if (menuOpen && menuScreenArea == 1)
  2535. drawMenu();
  2536. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2537. aRSImageProducer_1165.initDrawingArea();
  2538. Texture.anIntArray1472 = anIntArray1182;
  2539. }
  2540. if (revision498 == true) {
  2541. aRSImageProducer_1163.initDrawingArea();
  2542. Texture.anIntArray1472 = anIntArray1181;
  2543. tabArea.drawSprite(0, 0);
  2544. if (invOverlayInterfaceID == -1) {
  2545. drawRedStones();
  2546. drawSideIcons();
  2547. }
  2548. if (invOverlayInterfaceID != -1)
  2549. drawInterface(0, 28,
  2550. RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2551. else if (tabInterfaceIDs[tabID] != -1)
  2552. drawInterface(0, 28,
  2553. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2554. if (menuOpen && menuScreenArea == 1)
  2555. drawMenu();
  2556. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2557. aRSImageProducer_1165.initDrawingArea();
  2558. Texture.anIntArray1472 = anIntArray1182;
  2559. }
  2560. }
  2561.  
  2562. public void method37(int j) {
  2563. if (!lowMem) {
  2564. if (Texture.anIntArray1480[17] >= j) {
  2565. Background background = Texture.aBackgroundArray1474s[17];
  2566. int k = background.anInt1452 * background.anInt1453 - 1;
  2567. int j1 = background.anInt1452 * anInt945 * 2;
  2568. byte abyte0[] = background.aByteArray1450;
  2569. byte abyte3[] = aByteArray912;
  2570. for (int i2 = 0; i2 <= k; i2++)
  2571. abyte3[i2] = abyte0[i2 - j1 & k];
  2572.  
  2573. background.aByteArray1450 = abyte3;
  2574. aByteArray912 = abyte0;
  2575. Texture.method370(17);
  2576. anInt854++;
  2577. if (anInt854 > 1235) {
  2578. anInt854 = 0;
  2579. stream.createFrame(226);
  2580. stream.writeWordBigEndian(0);
  2581. int l2 = stream.currentOffset;
  2582. stream.writeWord(58722);
  2583. stream.writeWordBigEndian(240);
  2584. stream.writeWord((int) (Math.random() * 65536D));
  2585. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2586. if ((int) (Math.random() * 2D) == 0)
  2587. stream.writeWord(51825);
  2588. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2589. stream.writeWord((int) (Math.random() * 65536D));
  2590. stream.writeWord(7130);
  2591. stream.writeWord((int) (Math.random() * 65536D));
  2592. stream.writeWord(61657);
  2593. stream.writeBytes(stream.currentOffset - l2);
  2594. }
  2595. }
  2596. if (Texture.anIntArray1480[24] >= j) {
  2597. Background background_1 = Texture.aBackgroundArray1474s[24];
  2598. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2599. int k1 = background_1.anInt1452 * anInt945 * 2;
  2600. byte abyte1[] = background_1.aByteArray1450;
  2601. byte abyte4[] = aByteArray912;
  2602. for (int j2 = 0; j2 <= l; j2++)
  2603. abyte4[j2] = abyte1[j2 - k1 & l];
  2604.  
  2605. background_1.aByteArray1450 = abyte4;
  2606. aByteArray912 = abyte1;
  2607. Texture.method370(24);
  2608. }
  2609. if (Texture.anIntArray1480[34] >= j) {
  2610. Background background_2 = Texture.aBackgroundArray1474s[34];
  2611. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2612. int l1 = background_2.anInt1452 * anInt945 * 2;
  2613. byte abyte2[] = background_2.aByteArray1450;
  2614. byte abyte5[] = aByteArray912;
  2615. for (int k2 = 0; k2 <= i1; k2++)
  2616. abyte5[k2] = abyte2[k2 - l1 & i1];
  2617.  
  2618. background_2.aByteArray1450 = abyte5;
  2619. aByteArray912 = abyte2;
  2620. Texture.method370(34);
  2621. }
  2622. if (Texture.anIntArray1480[40] >= j) {
  2623. Background background_2 = Texture.aBackgroundArray1474s[40];
  2624. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2625. int l1 = background_2.anInt1452 * anInt945 * 2;
  2626. byte abyte2[] = background_2.aByteArray1450;
  2627. byte abyte5[] = aByteArray912;
  2628. for (int k2 = 0; k2 <= i1; k2++)
  2629. abyte5[k2] = abyte2[k2 - l1 & i1];
  2630. background_2.aByteArray1450 = abyte5;
  2631. aByteArray912 = abyte2;
  2632. Texture.method370(40);
  2633. }
  2634. }
  2635. }
  2636.  
  2637. public void method38() {
  2638. for (int i = -1; i < playerCount; i++) {
  2639. int j;
  2640. if (i == -1)
  2641. j = myPlayerIndex;
  2642. else
  2643. j = playerIndices[i];
  2644. Player player = playerArray[j];
  2645. if (player != null && player.textCycle > 0) {
  2646. player.textCycle--;
  2647. if (player.textCycle == 0)
  2648. player.textSpoken = null;
  2649. }
  2650. }
  2651. for (int k = 0; k < npcCount; k++) {
  2652. int l = npcIndices[k];
  2653. NPC npc = npcArray[l];
  2654. if (npc != null && npc.textCycle > 0) {
  2655. npc.textCycle--;
  2656. if (npc.textCycle == 0)
  2657. npc.textSpoken = null;
  2658. }
  2659. }
  2660. }
  2661.  
  2662. public void calcCameraPos() {
  2663. int i = anInt1098 * 128 + 64;
  2664. int j = anInt1099 * 128 + 64;
  2665. int k = method42(plane, j, i) - anInt1100;
  2666. if (xCameraPos < i) {
  2667. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2668. if (xCameraPos > i)
  2669. xCameraPos = i;
  2670. }
  2671. if (xCameraPos > i) {
  2672. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2673. if (xCameraPos < i)
  2674. xCameraPos = i;
  2675. }
  2676. if (zCameraPos < k) {
  2677. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2678. if (zCameraPos > k)
  2679. zCameraPos = k;
  2680. }
  2681. if (zCameraPos > k) {
  2682. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2683. if (zCameraPos < k)
  2684. zCameraPos = k;
  2685. }
  2686. if (yCameraPos < j) {
  2687. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2688. if (yCameraPos > j)
  2689. yCameraPos = j;
  2690. }
  2691. if (yCameraPos > j) {
  2692. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2693. if (yCameraPos < j)
  2694. yCameraPos = j;
  2695. }
  2696. i = anInt995 * 128 + 64;
  2697. j = anInt996 * 128 + 64;
  2698. k = method42(plane, j, i) - anInt997;
  2699. int l = i - xCameraPos;
  2700. int i1 = k - zCameraPos;
  2701. int j1 = j - yCameraPos;
  2702. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2703. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2704. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2705. if (l1 < 128)
  2706. l1 = 128;
  2707. if (l1 > 383)
  2708. l1 = 383;
  2709. if (yCameraCurve < l1) {
  2710. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2711. if (yCameraCurve > l1)
  2712. yCameraCurve = l1;
  2713. }
  2714. if (yCameraCurve > l1) {
  2715. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2716. if (yCameraCurve < l1)
  2717. yCameraCurve = l1;
  2718. }
  2719. int j2 = i2 - xCameraCurve;
  2720. if (j2 > 1024)
  2721. j2 -= 2048;
  2722. if (j2 < -1024)
  2723. j2 += 2048;
  2724. if (j2 > 0) {
  2725. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2726. xCameraCurve &= 0x7ff;
  2727. }
  2728. if (j2 < 0) {
  2729. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2730. xCameraCurve &= 0x7ff;
  2731. }
  2732. int k2 = i2 - xCameraCurve;
  2733. if (k2 > 1024)
  2734. k2 -= 2048;
  2735. if (k2 < -1024)
  2736. k2 += 2048;
  2737. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2738. xCameraCurve = i2;
  2739. }
  2740.  
  2741. public void drawMenu() {
  2742. int i = menuOffsetX;
  2743. int j = menuOffsetY;
  2744. int k = menuWidth;
  2745. int l = menuHeight + 1;
  2746. int i1 = 0x5d5447;
  2747. DrawingArea.drawPixels(l, j, i, i1, k);
  2748. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2749. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2750. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2751. int j1 = super.mouseX;
  2752. int k1 = super.mouseY;
  2753. if (menuScreenArea == 0) {
  2754. j1 -= 4;
  2755. k1 -= 4;
  2756. }
  2757. if (menuScreenArea == 1) {
  2758. j1 -= 519;
  2759. k1 -= 168;
  2760. }
  2761. if (menuScreenArea == 2) {
  2762. j1 -= 17;
  2763. k1 -= 338;
  2764. }
  2765. if (menuScreenArea == 3) {
  2766. j1 -= 519;
  2767. k1 -= 0;
  2768. }
  2769. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2770. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2771. int j2 = 0xffffff;
  2772. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2773. j2 = 0xffff00;
  2774. newBoldFont.drawBasicString(menuActionName[l1], i + 3, i2, j2, 0);
  2775. }
  2776. }
  2777.  
  2778. private void addFriend(long l) {
  2779. try {
  2780. if (l == 0L)
  2781. return;
  2782. if (friendsCount >= 100 && anInt1046 != 1) {
  2783. pushMessage(
  2784. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2785. 0, "");
  2786. return;
  2787. }
  2788. if (friendsCount >= 200) {
  2789. pushMessage(
  2790. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2791. 0, "");
  2792. return;
  2793. }
  2794. String s = TextClass.fixName(TextClass.nameForLong(l));
  2795. for (int i = 0; i < friendsCount; i++)
  2796. if (friendsListAsLongs[i] == l) {
  2797. pushMessage(s + " is already on your friend list", 0, "");
  2798. return;
  2799. }
  2800. for (int j = 0; j < ignoreCount; j++)
  2801. if (ignoreListAsLongs[j] == l) {
  2802. pushMessage("Please remove " + s
  2803. + " from your ignore list first", 0, "");
  2804. return;
  2805. }
  2806.  
  2807. if (s.equals(myPlayer.name)) {
  2808. return;
  2809. } else {
  2810. friendsList[friendsCount] = s;
  2811. friendsListAsLongs[friendsCount] = l;
  2812. friendsNodeIDs[friendsCount] = 0;
  2813. friendsCount++;
  2814. needDrawTabArea = true;
  2815. stream.createFrame(188);
  2816. stream.writeQWord(l);
  2817. return;
  2818. }
  2819. } catch (RuntimeException runtimeexception) {
  2820. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  2821. + runtimeexception.toString());
  2822. }
  2823. throw new RuntimeException();
  2824. }
  2825.  
  2826. private int method42(int i, int j, int k) {
  2827. int l = k >> 7;
  2828. int i1 = j >> 7;
  2829. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2830. return 0;
  2831. int j1 = i;
  2832. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2833. j1++;
  2834. int k1 = k & 0x7f;
  2835. int l1 = j & 0x7f;
  2836. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  2837. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2838. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  2839. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2840. return i2 * (128 - l1) + j2 * l1 >> 7;
  2841. }
  2842.  
  2843. public void resetLogout() {
  2844. try {
  2845. if (socketStream != null)
  2846. socketStream.close();
  2847. } catch (Exception _ex) {
  2848. }
  2849. socketStream = null;
  2850. loggedIn = false;
  2851. loginScreenState = 0;
  2852. // myUsername = "";
  2853. // myPassword = "";
  2854. unlinkMRUNodes();
  2855. worldController.initToNull();
  2856. for (int i = 0; i < 4; i++)
  2857. aClass11Array1230[i].method210();
  2858. System.gc();
  2859. stopMidi();
  2860. currentSong = -1;
  2861. nextSong = -1;
  2862. prevSong = 0;
  2863. try {
  2864. writeSettings();
  2865. } catch (IOException e) {
  2866. e.printStackTrace();
  2867. }
  2868. }
  2869.  
  2870. public void method45() {
  2871. aBoolean1031 = true;
  2872. for (int j = 0; j < 7; j++) {
  2873. anIntArray1065[j] = -1;
  2874. for (int k = 0; k < IDK.length; k++) {
  2875. if (IDK.cache[k].aBoolean662
  2876. || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2877. continue;
  2878. anIntArray1065[j] = k;
  2879. break;
  2880. }
  2881. }
  2882. }
  2883.  
  2884. private void method46(int i, Stream stream) {
  2885. while (stream.bitPosition + 21 < i * 8) {
  2886. int k = stream.readBits(14);
  2887. if (k == 16383)
  2888. break;
  2889. if (npcArray[k] == null)
  2890. npcArray[k] = new NPC();
  2891. NPC npc = npcArray[k];
  2892. npcIndices[npcCount++] = k;
  2893. npc.anInt1537 = loopCycle;
  2894. int l = stream.readBits(5);
  2895. if (l > 15)
  2896. l -= 32;
  2897. int i1 = stream.readBits(5);
  2898. if (i1 > 15)
  2899. i1 -= 32;
  2900. int j1 = stream.readBits(1);
  2901. npc.desc = EntityDef.forID(stream.readBits(14));
  2902. int k1 = stream.readBits(1);
  2903. if (k1 == 1)
  2904. anIntArray894[anInt893++] = k;
  2905. npc.anInt1540 = npc.desc.aByte68;
  2906. npc.anInt1504 = npc.desc.anInt79;
  2907. npc.anInt1554 = npc.desc.walkAnim;
  2908. npc.anInt1555 = npc.desc.anInt58;
  2909. npc.anInt1556 = npc.desc.anInt83;
  2910. npc.anInt1557 = npc.desc.anInt55;
  2911. npc.anInt1511 = npc.desc.standAnim;
  2912. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2913. }
  2914. stream.finishBitAccess();
  2915. }
  2916.  
  2917.  
  2918. @Override
  2919. public void processGameLoop() {
  2920. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2921. return;
  2922. loopCycle++;
  2923. if (!loggedIn)
  2924. processLoginScreenInput();
  2925. else
  2926. mainGameProcessor();
  2927. processOnDemandQueue();
  2928. }
  2929.  
  2930. public void method47(boolean flag) {
  2931. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2932. destX = 0;
  2933. int j = playerCount;
  2934. if (flag)
  2935. j = 1;
  2936. for (int l = 0; l < j; l++) {
  2937. Player player;
  2938. int i1;
  2939. if (flag) {
  2940. player = myPlayer;
  2941. i1 = myPlayerIndex << 14;
  2942. } else {
  2943. player = playerArray[playerIndices[l]];
  2944. i1 = playerIndices[l] << 14;
  2945. }
  2946. if (player == null || !player.isVisible())
  2947. continue;
  2948. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  2949. && !flag && player.anInt1517 == player.anInt1511;
  2950. int j1 = player.x >> 7;
  2951. int k1 = player.y >> 7;
  2952. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2953. continue;
  2954. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  2955. && loopCycle < player.anInt1708) {
  2956. player.aBoolean1699 = false;
  2957. player.anInt1709 = method42(plane, player.y, player.x);
  2958. worldController.method286(plane, player.y, player,
  2959. player.anInt1552, player.anInt1722, player.x,
  2960. player.anInt1709, player.anInt1719, player.anInt1721,
  2961. i1, player.anInt1720);
  2962. continue;
  2963. }
  2964. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2965. if (anIntArrayArray929[j1][k1] == anInt1265)
  2966. continue;
  2967. anIntArrayArray929[j1][k1] = anInt1265;
  2968. }
  2969. player.anInt1709 = method42(plane, player.y, player.x);
  2970. worldController.method285(plane, player.anInt1552,
  2971. player.anInt1709, i1, player.y, 60, player.x, player,
  2972. player.aBoolean1541);
  2973. }
  2974. }
  2975.  
  2976. private boolean promptUserForInput(RSInterface class9) {
  2977. int j = class9.contentType;
  2978. if (anInt900 == 2) {
  2979. if (j == 201) {
  2980. inputTaken = true;
  2981. inputDialogState = 0;
  2982. messagePromptRaised = true;
  2983. promptInput = "";
  2984. friendsListAction = 1;
  2985. aString1121 = "Enter name of friend to add to list";
  2986. }
  2987. if (j == 202) {
  2988. inputTaken = true;
  2989. inputDialogState = 0;
  2990. messagePromptRaised = true;
  2991. promptInput = "";
  2992. friendsListAction = 2;
  2993. aString1121 = "Enter name of friend to delete from list";
  2994. }
  2995. }
  2996. if (j == 205) {
  2997. anInt1011 = 250;
  2998. return true;
  2999. }
  3000. if (j == 501) {
  3001. inputTaken = true;
  3002. inputDialogState = 0;
  3003. messagePromptRaised = true;
  3004. promptInput = "";
  3005. friendsListAction = 4;
  3006. aString1121 = "Enter name of player to add to list";
  3007. }
  3008. if (j == 502) {
  3009. inputTaken = true;
  3010. inputDialogState = 0;
  3011. messagePromptRaised = true;
  3012. promptInput = "";
  3013. friendsListAction = 5;
  3014. aString1121 = "Enter name of player to delete from list";
  3015. }
  3016. if (j == 550) {
  3017. inputTaken = true;
  3018. inputDialogState = 0;
  3019. messagePromptRaised = true;
  3020. promptInput = "";
  3021. friendsListAction = 6;
  3022. aString1121 = "Enter the name of the chat you wish to join";
  3023. }
  3024. if (j >= 300 && j <= 313) {
  3025. int k = (j - 300) / 2;
  3026. int j1 = j & 1;
  3027. int i2 = anIntArray1065[k];
  3028. if (i2 != -1) {
  3029. do {
  3030. if (j1 == 0 && --i2 < 0)
  3031. i2 = IDK.length - 1;
  3032. if (j1 == 1 && ++i2 >= IDK.length)
  3033. i2 = 0;
  3034. } while (IDK.cache[i2].aBoolean662
  3035. || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3036. anIntArray1065[k] = i2;
  3037. aBoolean1031 = true;
  3038. }
  3039. }
  3040. if (j >= 314 && j <= 323) {
  3041. int l = (j - 314) / 2;
  3042. int k1 = j & 1;
  3043. int j2 = anIntArray990[l];
  3044. if (k1 == 0 && --j2 < 0)
  3045. j2 = anIntArrayArray1003[l].length - 1;
  3046. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3047. j2 = 0;
  3048. anIntArray990[l] = j2;
  3049. aBoolean1031 = true;
  3050. }
  3051. if (j == 324 && !aBoolean1047) {
  3052. aBoolean1047 = true;
  3053. method45();
  3054. }
  3055. if (j == 325 && aBoolean1047) {
  3056. aBoolean1047 = false;
  3057. method45();
  3058. }
  3059. if (j == 326) {
  3060. stream.createFrame(101);
  3061. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3062. for (int i1 = 0; i1 < 7; i1++)
  3063. stream.writeWordBigEndian(anIntArray1065[i1]);
  3064.  
  3065. for (int l1 = 0; l1 < 5; l1++)
  3066. stream.writeWordBigEndian(anIntArray990[l1]);
  3067.  
  3068. return true;
  3069. }
  3070. if (j == 613)
  3071. canMute = !canMute;
  3072. if (j >= 601 && j <= 612) {
  3073. clearTopInterfaces();
  3074. if (reportAbuseInput.length() > 0) {
  3075. stream.createFrame(218);
  3076. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3077. stream.writeWordBigEndian(j - 601);
  3078. stream.writeWordBigEndian(canMute ? 1 : 0);
  3079. }
  3080. }
  3081. return false;
  3082. }
  3083.  
  3084. public void method49(Stream stream) {
  3085. for (int j = 0; j < anInt893; j++) {
  3086. int k = anIntArray894[j];
  3087. Player player = playerArray[k];
  3088. int l = stream.readUnsignedByte();
  3089. if ((l & 0x40) != 0)
  3090. l += stream.readUnsignedByte() << 8;
  3091. method107(l, k, stream, player);
  3092. }
  3093. }
  3094.  
  3095. public void method50(int i, int k, int l, int i1, int j1) {
  3096. int k1 = worldController.method300(j1, l, i);
  3097. if (k1 != 0) {
  3098. int l1 = worldController.method304(j1, l, i, k1);
  3099. int k2 = l1 >> 6 & 3;
  3100. int i3 = l1 & 0x1f;
  3101. int k3 = k;
  3102. if (k1 > 0)
  3103. k3 = i1;
  3104. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3105. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3106. int i5 = k1 >> 14 & 0x7fff;
  3107. ObjectDef class46_2 = ObjectDef.forID(i5);
  3108. if (class46_2.anInt758 != -1) {
  3109. Background background_2 = mapScenes[class46_2.anInt758];
  3110. if (background_2 != null) {
  3111. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3112. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3113. background_2.drawBackground(48 + l * 4 + i6, 48
  3114. + (104 - i - class46_2.anInt761) * 4 + j6);
  3115. }
  3116. } else {
  3117. if (i3 == 0 || i3 == 2)
  3118. if (k2 == 0) {
  3119. ai[k4] = k3;
  3120. ai[k4 + 512] = k3;
  3121. ai[k4 + 1024] = k3;
  3122. ai[k4 + 1536] = k3;
  3123. } else if (k2 == 1) {
  3124. ai[k4] = k3;
  3125. ai[k4 + 1] = k3;
  3126. ai[k4 + 2] = k3;
  3127. ai[k4 + 3] = k3;
  3128. } else if (k2 == 2) {
  3129. ai[k4 + 3] = k3;
  3130. ai[k4 + 3 + 512] = k3;
  3131. ai[k4 + 3 + 1024] = k3;
  3132. ai[k4 + 3 + 1536] = k3;
  3133. } else if (k2 == 3) {
  3134. ai[k4 + 1536] = k3;
  3135. ai[k4 + 1536 + 1] = k3;
  3136. ai[k4 + 1536 + 2] = k3;
  3137. ai[k4 + 1536 + 3] = k3;
  3138. }
  3139. if (i3 == 3)
  3140. if (k2 == 0)
  3141. ai[k4] = k3;
  3142. else if (k2 == 1)
  3143. ai[k4 + 3] = k3;
  3144. else if (k2 == 2)
  3145. ai[k4 + 3 + 1536] = k3;
  3146. else if (k2 == 3)
  3147. ai[k4 + 1536] = k3;
  3148. if (i3 == 2)
  3149. if (k2 == 3) {
  3150. ai[k4] = k3;
  3151. ai[k4 + 512] = k3;
  3152. ai[k4 + 1024] = k3;
  3153. ai[k4 + 1536] = k3;
  3154. } else if (k2 == 0) {
  3155. ai[k4] = k3;
  3156. ai[k4 + 1] = k3;
  3157. ai[k4 + 2] = k3;
  3158. ai[k4 + 3] = k3;
  3159. } else if (k2 == 1) {
  3160. ai[k4 + 3] = k3;
  3161. ai[k4 + 3 + 512] = k3;
  3162. ai[k4 + 3 + 1024] = k3;
  3163. ai[k4 + 3 + 1536] = k3;
  3164. } else if (k2 == 2) {
  3165. ai[k4 + 1536] = k3;
  3166. ai[k4 + 1536 + 1] = k3;
  3167. ai[k4 + 1536 + 2] = k3;
  3168. ai[k4 + 1536 + 3] = k3;
  3169. }
  3170. }
  3171. }
  3172. k1 = worldController.method302(j1, l, i);
  3173. if (k1 != 0) {
  3174. int i2 = worldController.method304(j1, l, i, k1);
  3175. int l2 = i2 >> 6 & 3;
  3176. int j3 = i2 & 0x1f;
  3177. int l3 = k1 >> 14 & 0x7fff;
  3178. ObjectDef class46_1 = ObjectDef.forID(l3);
  3179. if (class46_1.anInt758 != -1) {
  3180. Background background_1 = mapScenes[class46_1.anInt758];
  3181. if (background_1 != null) {
  3182. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3183. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3184. background_1.drawBackground(48 + l * 4 + j5, 48
  3185. + (104 - i - class46_1.anInt761) * 4 + k5);
  3186. }
  3187. } else if (j3 == 9) {
  3188. int l4 = 0xeeeeee;
  3189. if (k1 > 0)
  3190. l4 = 0xee0000;
  3191. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3192. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3193. if (l2 == 0 || l2 == 2) {
  3194. ai1[l5 + 1536] = l4;
  3195. ai1[l5 + 1024 + 1] = l4;
  3196. ai1[l5 + 512 + 2] = l4;
  3197. ai1[l5 + 3] = l4;
  3198. } else {
  3199. ai1[l5] = l4;
  3200. ai1[l5 + 512 + 1] = l4;
  3201. ai1[l5 + 1024 + 2] = l4;
  3202. ai1[l5 + 1536 + 3] = l4;
  3203. }
  3204. }
  3205. }
  3206. k1 = worldController.method303(j1, l, i);
  3207. if (k1 != 0) {
  3208. int j2 = k1 >> 14 & 0x7fff;
  3209. ObjectDef class46 = ObjectDef.forID(j2);
  3210. if (class46.anInt758 != -1) {
  3211. Background background = mapScenes[class46.anInt758];
  3212. if (background != null) {
  3213. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3214. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3215. background.drawBackground(48 + l * 4 + i4, 48
  3216. + (104 - i - class46.anInt761) * 4 + j4);
  3217. }
  3218. }
  3219. }
  3220. }
  3221.  
  3222. private Sprite aSprite_1201;
  3223. private Sprite aSprite_1202;
  3224.  
  3225. private void loadTitleScreen() {
  3226. titleBox = new Background(titleStreamLoader, "titlebox", 0);
  3227. boxHover = new Sprite(titleStreamLoader, "titlebox", 1);
  3228. titleButton = new Background(titleStreamLoader, "titlebutton", 0);
  3229. loginHover = new Sprite(titleStreamLoader, "titlebutton", 1);
  3230. aBackgroundArray1152s = new Background[12];
  3231. int j = 0;
  3232. try {
  3233. j = Integer.parseInt(getParameter("fl_icon"));
  3234. } catch (Exception _ex) {
  3235. }
  3236. if (j == 0) {
  3237. for (int k = 0; k < 12; k++)
  3238. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3239. "runes", k);
  3240.  
  3241. } else {
  3242. for (int l = 0; l < 12; l++)
  3243. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3244. "runes", 12 + (l & 3));
  3245.  
  3246. }
  3247. aSprite_1201 = new Sprite(128, 265);
  3248. aSprite_1202 = new Sprite(128, 265);
  3249. // aSprite_1201 = new Sprite(0, 266);
  3250. // aSprite_1202 = new Sprite(0, 266);
  3251. System.arraycopy(leftSideFlame.anIntArray315, 0, aSprite_1201.myPixels,
  3252. 0, 33920);
  3253.  
  3254. System.arraycopy(rightSideFlame.anIntArray315, 0,
  3255. aSprite_1202.myPixels, 0, 33920);
  3256.  
  3257. anIntArray851 = new int[256];
  3258. for (int k1 = 0; k1 < 64; k1++)
  3259. anIntArray851[k1] = k1 * 0x40000;
  3260.  
  3261. for (int l1 = 0; l1 < 64; l1++)
  3262. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3263.  
  3264. for (int i2 = 0; i2 < 64; i2++)
  3265. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3266.  
  3267. for (int j2 = 0; j2 < 64; j2++)
  3268. anIntArray851[j2 + 192] = 0xffffff;
  3269.  
  3270. anIntArray852 = new int[256];
  3271. for (int k2 = 0; k2 < 64; k2++)
  3272. anIntArray852[k2] = k2 * 1024;
  3273.  
  3274. for (int l2 = 0; l2 < 64; l2++)
  3275. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3276.  
  3277. for (int i3 = 0; i3 < 64; i3++)
  3278. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3279.  
  3280. for (int j3 = 0; j3 < 64; j3++)
  3281. anIntArray852[j3 + 192] = 0xffffff;
  3282.  
  3283. anIntArray853 = new int[256];
  3284. for (int k3 = 0; k3 < 64; k3++)
  3285. anIntArray853[k3] = k3 * 4;
  3286.  
  3287. for (int l3 = 0; l3 < 64; l3++)
  3288. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3289.  
  3290. for (int i4 = 0; i4 < 64; i4++)
  3291. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3292.  
  3293. for (int j4 = 0; j4 < 64; j4++)
  3294. anIntArray853[j4 + 192] = 0xffffff;
  3295.  
  3296. anIntArray850 = new int[256];
  3297. anIntArray1190 = new int[32768];
  3298. anIntArray1191 = new int[32768];
  3299. randomizeBackground(null);
  3300. anIntArray828 = new int[32768];
  3301. anIntArray829 = new int[32768];
  3302. if (!aBoolean831) {
  3303. drawFlames = true;
  3304. aBoolean831 = true;
  3305. startRunnable(this, 2);
  3306. }
  3307. }
  3308.  
  3309. private static void setHighMem() {
  3310. WorldController.lowMem = false;
  3311. Texture.lowMem = false;
  3312. lowMem = false;
  3313. ObjectManager.lowMem = false;
  3314. ObjectDef.lowMem = false;
  3315. }
  3316.  
  3317. public static void main(String args[]) {
  3318. try {
  3319. nodeID = 1;
  3320. portOff = 0;
  3321. setHighMem();
  3322. isMembers = true;
  3323. signlink.storeid = 32;
  3324. signlink.startpriv(InetAddress.getLocalHost());
  3325. instance = new Jframe(args);
  3326. } catch (Exception exception) {
  3327. }
  3328. }
  3329.  
  3330. public static client instance;
  3331.  
  3332. public void loadingStages() {
  3333. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3334. aRSImageProducer_1165.initDrawingArea();
  3335. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151,
  3336. 257);
  3337. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.",
  3338. 150, 256);
  3339. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3340. loadingStage = 1;
  3341. aLong824 = System.currentTimeMillis();
  3342. }
  3343. if (loadingStage == 1) {
  3344. int j = method54();
  3345. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3346. signlink.reporterror(myUsername + " glcfb " + aLong1215 + ","
  3347. + j + "," + lowMem + "," + decompressors[0] + ","
  3348. + onDemandFetcher.getNodeCount() + "," + plane + ","
  3349. + anInt1069 + "," + anInt1070);
  3350. aLong824 = System.currentTimeMillis();
  3351. }
  3352. }
  3353. if (loadingStage == 2 && plane != anInt985) {
  3354. anInt985 = plane;
  3355. method24(plane);
  3356. }
  3357. }
  3358.  
  3359. private int method54() {
  3360. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3361. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3362. return -1;
  3363. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3364. return -2;
  3365. }
  3366. boolean flag = true;
  3367. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3368. byte abyte0[] = aByteArrayArray1247[j];
  3369. if (abyte0 != null) {
  3370. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3371. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3372. if (aBoolean1159) {
  3373. k = 10;
  3374. l = 10;
  3375. }
  3376. flag &= ObjectManager.method189(k, abyte0, l);
  3377. }
  3378. }
  3379. if (!flag)
  3380. return -3;// couldn't parse all landscapes
  3381. if (aBoolean1080) {
  3382. return -4;
  3383. } else {
  3384. loadingStage = 2;
  3385. ObjectManager.anInt131 = plane;
  3386. method22();
  3387. stream.createFrame(121);
  3388. return 0;
  3389. }
  3390. }
  3391.  
  3392. public void method55() {
  3393. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3394. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3395. .reverseGetNext())
  3396. if (class30_sub2_sub4_sub4.anInt1597 != plane
  3397. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3398. class30_sub2_sub4_sub4.unlink();
  3399. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3400. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3401. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3402. if (npc != null && npc.x >= 0 && npc.x < 13312
  3403. && npc.y >= 0 && npc.y < 13312)
  3404. class30_sub2_sub4_sub4.method455(
  3405. loopCycle,
  3406. npc.y,
  3407. method42(class30_sub2_sub4_sub4.anInt1597,
  3408. npc.y, npc.x)
  3409. - class30_sub2_sub4_sub4.anInt1583,
  3410. npc.x);
  3411. }
  3412. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3413. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3414. Player player;
  3415. if (j == unknownInt10)
  3416. player = myPlayer;
  3417. else
  3418. player = playerArray[j];
  3419. if (player != null && player.x >= 0 && player.x < 13312
  3420. && player.y >= 0 && player.y < 13312)
  3421. class30_sub2_sub4_sub4.method455(
  3422. loopCycle,
  3423. player.y,
  3424. method42(class30_sub2_sub4_sub4.anInt1597,
  3425. player.y, player.x)
  3426. - class30_sub2_sub4_sub4.anInt1583,
  3427. player.x);
  3428. }
  3429. class30_sub2_sub4_sub4.method456(anInt945);
  3430. worldController.method285(plane,
  3431. class30_sub2_sub4_sub4.anInt1595,
  3432. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  3433. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  3434. (int) class30_sub2_sub4_sub4.aDouble1585,
  3435. class30_sub2_sub4_sub4, false);
  3436. }
  3437.  
  3438. }
  3439.  
  3440. @Override
  3441. public AppletContext getAppletContext() {
  3442. if (signlink.mainapp != null)
  3443. return signlink.mainapp.getAppletContext();
  3444. else
  3445. return super.getAppletContext();
  3446. }
  3447.  
  3448. public static String capitalize(String s) {
  3449. for (int i = 0; i < s.length(); i++) {
  3450. if (i == 0) {
  3451. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)),
  3452. s.substring(1));
  3453. }
  3454. if (!Character.isLetterOrDigit(s.charAt(i))) {
  3455. if (i + 1 < s.length()) {
  3456. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  3457. Character.toUpperCase(s.charAt(i + 1)),
  3458. s.substring(i + 2));
  3459. }
  3460. }
  3461. }
  3462. return s;
  3463. }
  3464.  
  3465. private void drawLogo() {
  3466. /*
  3467. * byte abyte0[] = titleStreamLoader.getDataForName("title.dat"); Sprite
  3468. * sprite = new Sprite(abyte0, this); leftSideFlame.initDrawingArea();
  3469. * sprite.method346(0, 0); rightSideFlame.initDrawingArea();
  3470. * sprite.method346(-637, 0); aRSImageProducer_1107.initDrawingArea();
  3471. * sprite.method346(-128, 0); aRSImageProducer_1108.initDrawingArea();
  3472. * sprite.method346(-202, -371); loginScreenArea.initDrawingArea();
  3473. * sprite.method346(-202, -171); gameLogo.initDrawingArea();
  3474. * sprite.method346(0, -265); aRSImageProducer_1113.initDrawingArea();
  3475. * sprite.method346(-562, -265);
  3476. * aRSImageProducer_1114.initDrawingArea(); sprite.method346(-128,
  3477. * -171); aRSImageProducer_1115.initDrawingArea();
  3478. * sprite.method346(-562, -171); int ai[] = new int[sprite.myWidth]; for
  3479. * (int j = 0; j < sprite.myHeight; j++) { for (int k = 0; k <
  3480. * sprite.myWidth; k++) ai[k] = sprite.myPixels[(sprite.myWidth - k - 1)
  3481. * + sprite.myWidth * j];
  3482. *
  3483. * System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j,
  3484. * sprite.myWidth); } leftSideFlame.initDrawingArea();
  3485. * sprite.method346(382, 0); rightSideFlame.initDrawingArea();
  3486. * sprite.method346(-255, 0); aRSImageProducer_1107.initDrawingArea();
  3487. * sprite.method346(254, 0); aRSImageProducer_1108.initDrawingArea();
  3488. * sprite.method346(180, -371); loginScreenArea.initDrawingArea();
  3489. * sprite.method346(180, -171); gameLogo.initDrawingArea();
  3490. * sprite.method346(382, -265); aRSImageProducer_1113.initDrawingArea();
  3491. * sprite.method346(-180, -265);
  3492. * aRSImageProducer_1114.initDrawingArea(); sprite.method346(254, -171);
  3493. * aRSImageProducer_1115.initDrawingArea(); sprite.method346(-180,
  3494. * -171); sprite = new Sprite(titleStreamLoader, "logo", 0);
  3495. * aRSImageProducer_1107.initDrawingArea(); sprite.drawSprite(382 -
  3496. * sprite.myWidth / 2 - 128, 18); sprite = null; System.gc();
  3497. */
  3498. }
  3499.  
  3500. @SuppressWarnings("unused")
  3501. private static void writeFile(byte[] fileData, String fileName) throws IOException{
  3502. OutputStream out = new FileOutputStream(fileName);
  3503. out.write(fileData);
  3504. out.close();
  3505. }
  3506.  
  3507. private void processOnDemandQueue() {
  3508. do {
  3509. OnDemandData onDemandData;
  3510. do {
  3511. onDemandData = onDemandFetcher.getNextNode();
  3512. if (onDemandData == null)
  3513. return;
  3514. if (onDemandData.dataType == 0) {
  3515. Model.method460(onDemandData.buffer, onDemandData.ID);
  3516.  
  3517. /*try {
  3518. writeFile(onDemandData.buffer, "./dumpedModel/" + onDemandData.ID + ".dat") ;
  3519. }catch(Exception e) {
  3520. e.printStackTrace();
  3521. }*/
  3522.  
  3523. needDrawTabArea = true;
  3524. if (backDialogID != -1)
  3525. inputTaken = true;
  3526. }
  3527. if (onDemandData.dataType == 1 && onDemandData.buffer != null)
  3528. Class36.load(onDemandData.ID, onDemandData.buffer);
  3529. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong
  3530. && onDemandData.buffer != null)
  3531. saveMidi(songChanging, onDemandData.buffer);
  3532. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3533. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3534. if (anIntArray1235[i] == onDemandData.ID) {
  3535. System.out.println("Floor Map Loaded: "
  3536. + anIntArray1235[i]);
  3537. // aByteArrayArray1183[i] =
  3538. // FileOperations.readFile("maps/floors/" +
  3539. // anIntArray1235[i]);
  3540. if (aByteArrayArray1183[i] == null)
  3541. aByteArrayArray1183[i] = onDemandData.buffer;
  3542. if (onDemandData.buffer == null)
  3543. anIntArray1235[i] = -1;
  3544. break;
  3545. }
  3546. if (anIntArray1236[i] != onDemandData.ID)
  3547. continue;
  3548. System.out.println("Object Map Loaded: "
  3549. + anIntArray1236[i]);
  3550. // aByteArrayArray1247[i] =
  3551. // FileOperations.readFile("maps/objects/" +
  3552. // anIntArray1236[i]);
  3553. if (aByteArrayArray1247[i] == null)
  3554. aByteArrayArray1247[i] = onDemandData.buffer;
  3555. if (onDemandData.buffer == null)
  3556. anIntArray1236[i] = -1;
  3557. break;
  3558. }
  3559.  
  3560. }
  3561. } while (onDemandData.dataType != 93
  3562. || !onDemandFetcher.method564(onDemandData.ID));
  3563. ObjectManager.method173(new Stream(onDemandData.buffer),
  3564. onDemandFetcher);
  3565. } while (true);
  3566. }
  3567.  
  3568. public void calcFlamesPosition() {
  3569. char c = '\u0100';
  3570. for (int j = 10; j < 117; j++) {
  3571. int k = (int) (Math.random() * 100D);
  3572. if (k < 50)
  3573. anIntArray828[j + (c - 2 << 7)] = 255;
  3574. }
  3575. for (int l = 0; l < 100; l++) {
  3576. int i1 = (int) (Math.random() * 124D) + 2;
  3577. int k1 = (int) (Math.random() * 128D) + 128;
  3578. int k2 = i1 + (k1 << 7);
  3579. anIntArray828[k2] = 192;
  3580. }
  3581.  
  3582. for (int j1 = 1; j1 < c - 1; j1++) {
  3583. for (int l1 = 1; l1 < 127; l1++) {
  3584. int l2 = l1 + (j1 << 7);
  3585. anIntArray829[l2] = (anIntArray828[l2 - 1]
  3586. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3587. }
  3588.  
  3589. }
  3590.  
  3591. anInt1275 += 128;
  3592. if (anInt1275 > anIntArray1190.length) {
  3593. anInt1275 -= anIntArray1190.length;
  3594. int i2 = (int) (Math.random() * 12D);
  3595. randomizeBackground(aBackgroundArray1152s[i2]);
  3596. }
  3597. for (int j2 = 1; j2 < c - 1; j2++) {
  3598. for (int i3 = 1; i3 < 127; i3++) {
  3599. int k3 = i3 + (j2 << 7);
  3600. int i4 = anIntArray829[k3 + 128]
  3601. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  3602. - 1] / 5;
  3603. if (i4 < 0)
  3604. i4 = 0;
  3605. anIntArray828[k3] = i4;
  3606. }
  3607.  
  3608. }
  3609.  
  3610. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3611.  
  3612. anIntArray969[c - 1] = (int) (Math.sin(loopCycle / 14D) * 16D
  3613. + Math.sin(loopCycle / 15D) * 14D + Math.sin(loopCycle / 16D) * 12D);
  3614. if (anInt1040 > 0)
  3615. anInt1040 -= 4;
  3616. if (anInt1041 > 0)
  3617. anInt1041 -= 4;
  3618. if (anInt1040 == 0 && anInt1041 == 0) {
  3619. int l3 = (int) (Math.random() * 2000D);
  3620. if (l3 == 0)
  3621. anInt1040 = 1024;
  3622. if (l3 == 1)
  3623. anInt1041 = 1024;
  3624. }
  3625. }
  3626.  
  3627. private boolean saveWave(byte abyte0[], int i) {
  3628. return abyte0 == null || signlink.wavesave(abyte0, i);
  3629. }
  3630.  
  3631. public void method60(int i) {
  3632. RSInterface class9 = RSInterface.interfaceCache[i];
  3633. for (int j = 0; j < class9.children.length; j++) {
  3634. if (class9.children[j] == -1)
  3635. break;
  3636. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3637. if (class9_1.type == 1)
  3638. method60(class9_1.id);
  3639. class9_1.anInt246 = 0;
  3640. class9_1.anInt208 = 0;
  3641. }
  3642. }
  3643.  
  3644. public void drawHeadIcon() {
  3645. if (anInt855 != 2)
  3646. return;
  3647. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2,
  3648. (anInt935 - baseY << 7) + anInt938);
  3649. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  3650. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3651. }
  3652.  
  3653. private void mainGameProcessor() {
  3654. if (anInt1104 > 1)
  3655. anInt1104--;
  3656. if (anInt1011 > 0)
  3657. anInt1011--;
  3658. for (int j = 0; j < 5; j++)
  3659. if (!parsePacket())
  3660. break;
  3661.  
  3662. if (!this.loggedIn)
  3663. return;
  3664. synchronized (mouseDetection.syncObject) {
  3665. if (flagged) {
  3666. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3667. stream.createFrame(45);
  3668. stream.writeWordBigEndian(0);
  3669. int j2 = stream.currentOffset;
  3670. int j3 = 0;
  3671. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3672. if (j2 - stream.currentOffset >= 240)
  3673. break;
  3674. j3++;
  3675. int l4 = mouseDetection.coordsY[j4];
  3676. if (l4 < 0)
  3677. l4 = 0;
  3678. else if (l4 > 502)
  3679. l4 = 502;
  3680. int k5 = mouseDetection.coordsX[j4];
  3681. if (k5 < 0)
  3682. k5 = 0;
  3683. else if (k5 > 764)
  3684. k5 = 764;
  3685. int i6 = l4 * 765 + k5;
  3686. if (mouseDetection.coordsY[j4] == -1
  3687. && mouseDetection.coordsX[j4] == -1) {
  3688. k5 = -1;
  3689. l4 = -1;
  3690. i6 = 0x7ffff;
  3691. }
  3692. if (k5 == anInt1237 && l4 == anInt1238) {
  3693. if (anInt1022 < 2047)
  3694. anInt1022++;
  3695. } else {
  3696. int j6 = k5 - anInt1237;
  3697. anInt1237 = k5;
  3698. int k6 = l4 - anInt1238;
  3699. anInt1238 = l4;
  3700. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31
  3701. && k6 >= -32 && k6 <= 31) {
  3702. j6 += 32;
  3703. k6 += 32;
  3704. stream.writeWord((anInt1022 << 12) + (j6 << 6)
  3705. + k6);
  3706. anInt1022 = 0;
  3707. } else if (anInt1022 < 8) {
  3708. stream.writeDWordBigEndian(0x800000
  3709. + (anInt1022 << 19) + i6);
  3710. anInt1022 = 0;
  3711. } else {
  3712. stream.writeDWord(0xc0000000
  3713. + (anInt1022 << 19) + i6);
  3714. anInt1022 = 0;
  3715. }
  3716. }
  3717. }
  3718.  
  3719. stream.writeBytes(stream.currentOffset - j2);
  3720. if (j3 >= mouseDetection.coordsIndex) {
  3721. mouseDetection.coordsIndex = 0;
  3722. } else {
  3723. mouseDetection.coordsIndex -= j3;
  3724. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3725. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5
  3726. + j3];
  3727. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5
  3728. + j3];
  3729. }
  3730.  
  3731. }
  3732. }
  3733. } else {
  3734. mouseDetection.coordsIndex = 0;
  3735. }
  3736. }
  3737. if (super.clickMode3 != 0) {
  3738. long l = (super.aLong29 - aLong1220) / 50L;
  3739. if (l > 4095L)
  3740. l = 4095L;
  3741. aLong1220 = super.aLong29;
  3742. int k2 = super.saveClickY;
  3743. if (k2 < 0)
  3744. k2 = 0;
  3745. else if (k2 > 502)
  3746. k2 = 502;
  3747. int k3 = super.saveClickX;
  3748. if (k3 < 0)
  3749. k3 = 0;
  3750. else if (k3 > 764)
  3751. k3 = 764;
  3752. int k4 = k2 * 765 + k3;
  3753. int j5 = 0;
  3754. if (super.clickMode3 == 2)
  3755. j5 = 1;
  3756. int l5 = (int) l;
  3757. stream.createFrame(241);
  3758. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3759. }
  3760. if (anInt1016 > 0)
  3761. anInt1016--;
  3762. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  3763. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3764. aBoolean1017 = true;
  3765. if (aBoolean1017 && anInt1016 <= 0) {
  3766. anInt1016 = 20;
  3767. aBoolean1017 = false;
  3768. stream.createFrame(86);
  3769. stream.writeWord(anInt1184);
  3770. stream.method432(viewRotation);
  3771. }
  3772. if (super.awtFocus && !aBoolean954) {
  3773. aBoolean954 = true;
  3774. stream.createFrame(3);
  3775. stream.writeWordBigEndian(1);
  3776. }
  3777. if (!super.awtFocus && aBoolean954) {
  3778. aBoolean954 = false;
  3779. stream.createFrame(3);
  3780. stream.writeWordBigEndian(0);
  3781. }
  3782. loadingStages();
  3783. method115();
  3784. method90();
  3785. anInt1009++;
  3786. if (anInt1009 > 750)
  3787. dropClient();
  3788. method114();
  3789. method95();
  3790. method38();
  3791. anInt945++;
  3792. if (crossType != 0) {
  3793. crossIndex += 20;
  3794. if (crossIndex >= 400)
  3795. crossType = 0;
  3796. }
  3797. if (atInventoryInterfaceType != 0) {
  3798. atInventoryLoopCycle++;
  3799. if (atInventoryLoopCycle >= 15) {
  3800. if (atInventoryInterfaceType == 2)
  3801. needDrawTabArea = true;
  3802. if (atInventoryInterfaceType == 3)
  3803. inputTaken = true;
  3804. atInventoryInterfaceType = 0;
  3805. }
  3806. }
  3807. if (activeInterfaceType != 0) {
  3808. anInt989++;
  3809. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  3810. || super.mouseY > anInt1088 + 5
  3811. || super.mouseY < anInt1088 - 5)
  3812. aBoolean1242 = true;
  3813. if (super.clickMode2 == 0) {
  3814. if (activeInterfaceType == 2)
  3815. needDrawTabArea = true;
  3816. if (activeInterfaceType == 3)
  3817. inputTaken = true;
  3818. activeInterfaceType = 0;
  3819. if (aBoolean1242 && anInt989 >= 5) {
  3820. lastActiveInvInterface = -1;
  3821. processRightClick();
  3822. if (anInt1084 == 5382) {
  3823. Point southWest, northEast;
  3824. southWest = new Point(68, 75);
  3825. northEast = new Point(457, 41);
  3826. int[] slots = new int[9];
  3827. for (int i = 0; i < slots.length; i++)
  3828. slots[i] = i == 0 ? (int) southWest.getX()
  3829. : (41 * i) + (int) southWest.getX();
  3830. for (int i = 0; i < slots.length; i++) {
  3831. if (super.mouseX >= slots[i]
  3832. && super.mouseX <= slots[i] + 42
  3833. && super.mouseY >= northEast.getY()
  3834. && super.mouseY <= southWest.getY()) {
  3835. RSInterface rsi = RSInterface.interfaceCache[58050 + i];
  3836. if (rsi.isMouseoverTriggered) {
  3837. continue;
  3838. }
  3839. stream.createFrame(214);
  3840. stream.method433(anInt1084);
  3841. stream.method424(0);
  3842. stream.method433(anInt1085);
  3843. stream.method431(1000 + i);
  3844. return;
  3845. }
  3846. }
  3847. }
  3848. if (lastActiveInvInterface == anInt1084
  3849. && mouseInvInterfaceIndex != anInt1085) {
  3850. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3851. int j1 = 0;
  3852. if (anInt913 == 1 && class9.contentType == 206)
  3853. j1 = 1;
  3854. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3855. j1 = 0;
  3856. if (class9.aBoolean235) {
  3857. int l2 = anInt1085;
  3858. int l3 = mouseInvInterfaceIndex;
  3859. class9.inv[l3] = class9.inv[l2];
  3860. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3861. class9.inv[l2] = -1;
  3862. class9.invStackSizes[l2] = 0;
  3863. } else if (j1 == 1) {
  3864. int i3 = anInt1085;
  3865. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3866. if (i3 > i4) {
  3867. class9.swapInventoryItems(i3, i3 - 1);
  3868. i3--;
  3869. } else if (i3 < i4) {
  3870. class9.swapInventoryItems(i3, i3 + 1);
  3871. i3++;
  3872. }
  3873.  
  3874. } else {
  3875. class9.swapInventoryItems(anInt1085,
  3876. mouseInvInterfaceIndex);
  3877. }
  3878. stream.createFrame(214);
  3879. stream.method433(anInt1084);
  3880. stream.method424(j1);
  3881. stream.method433(anInt1085);
  3882. stream.method431(mouseInvInterfaceIndex);
  3883. }
  3884. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  3885. && menuActionRow > 2)
  3886. determineMenuSize();
  3887. else if (menuActionRow > 0)
  3888. doAction(menuActionRow - 1);
  3889. atInventoryLoopCycle = 10;
  3890. super.clickMode3 = 0;
  3891. }
  3892. }
  3893. if (WorldController.anInt470 != -1) {
  3894. int k = WorldController.anInt470;
  3895. int k1 = WorldController.anInt471;
  3896. if (myPrivilege == 2 && ctrlPressed) {
  3897. teleport(baseX + k, baseY + k1);
  3898. } else {
  3899. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  3900. myPlayer.smallX[0], true, k);
  3901. WorldController.anInt470 = -1;
  3902. if (flag) {
  3903. crossX = super.saveClickX;
  3904. crossY = super.saveClickY;
  3905. crossType = 1;
  3906. crossIndex = 0;
  3907. }
  3908. }
  3909. }
  3910. if (super.clickMode3 == 1 && aString844 != null) {
  3911. aString844 = null;
  3912. inputTaken = true;
  3913. super.clickMode3 = 0;
  3914. }
  3915. if (!processMenuClick()) {
  3916. processMainScreenClick();
  3917. processTabClick();
  3918. processTabClick2();
  3919. processChatModeClick();
  3920. }
  3921. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3922. anInt1213++;
  3923. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3924. if (anInt1501 < 50 && !menuOpen) {
  3925. anInt1501++;
  3926. if (anInt1501 == 50) {
  3927. if (anInt1500 != 0) {
  3928. inputTaken = true;
  3929. }
  3930. if (anInt1044 != 0) {
  3931. needDrawTabArea = true;
  3932. }
  3933. }
  3934. }
  3935. } else if (anInt1501 > 0) {
  3936. anInt1501--;
  3937. }
  3938. if (loadingStage == 2)
  3939. method108();
  3940. if (loadingStage == 2 && aBoolean1160)
  3941. calcCameraPos();
  3942. for (int i1 = 0; i1 < 5; i1++)
  3943. anIntArray1030[i1]++;
  3944. method73();
  3945. super.idleTime++;
  3946. if (super.idleTime > 4500) {
  3947. anInt1011 = 250;
  3948. super.idleTime -= 500;
  3949. stream.createFrame(202);
  3950. }
  3951. anInt1010++;
  3952. if (anInt1010 > 50)
  3953. stream.createFrame(0);
  3954. try {
  3955. if (socketStream != null && stream.currentOffset > 0) {
  3956. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3957. stream.currentOffset = 0;
  3958. anInt1010 = 0;
  3959. }
  3960. } catch (IOException _ex) {
  3961. dropClient();
  3962. } catch (Exception exception) {
  3963. resetLogout();
  3964. }
  3965. }
  3966.  
  3967. public void method63() {
  3968. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  3969. .reverseGetFirst();
  3970. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  3971. .reverseGetNext())
  3972. if (class30_sub1.anInt1294 == -1) {
  3973. class30_sub1.anInt1302 = 0;
  3974. method89(class30_sub1);
  3975. } else {
  3976. class30_sub1.unlink();
  3977. }
  3978.  
  3979. }
  3980.  
  3981. private void resetImageProducers() {
  3982. if (aRSImageProducer_1107 != null)
  3983. return;
  3984. super.fullGameScreen = null;
  3985. aRSImageProducer_1166 = null;
  3986. aRSImageProducer_1164 = null;
  3987. aRSImageProducer_1163 = null;
  3988. aRSImageProducer_1165 = null;
  3989. aRSImageProducer_1125 = null;
  3990. leftSideFlame = new RSImageProducer(128, 265, getGameComponent());
  3991. DrawingArea.setAllPixelsToZero();
  3992. rightSideFlame = new RSImageProducer(128, 265, getGameComponent());
  3993. DrawingArea.setAllPixelsToZero();
  3994. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  3995. getGameComponent());
  3996. DrawingArea.setAllPixelsToZero();
  3997. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  3998. getGameComponent());
  3999. DrawingArea.setAllPixelsToZero();
  4000. loginScreenArea = new RSImageProducer(765, 503, getGameComponent());
  4001. DrawingArea.setAllPixelsToZero();
  4002. gameLogo = new RSImageProducer(202, 238, getGameComponent());
  4003. DrawingArea.setAllPixelsToZero();
  4004. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  4005. getGameComponent());
  4006. DrawingArea.setAllPixelsToZero();
  4007. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4008. DrawingArea.setAllPixelsToZero();
  4009. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4010. DrawingArea.setAllPixelsToZero();
  4011. if (titleStreamLoader != null) {
  4012. drawLogo();
  4013. loadTitleScreen();
  4014. }
  4015. welcomeScreenRaised = true;
  4016. }
  4017.  
  4018. public int rememberMe = 0;
  4019. public int loginButtonint;
  4020. public int rememberMehover;
  4021. public int textbox;
  4022. public int textbox1;
  4023.  
  4024. @Override
  4025. void drawLoadingText(int i, String s) {
  4026. anInt1079 = i;
  4027. aString1049 = s;
  4028. resetImageProducers();
  4029. if (titleStreamLoader == null) {
  4030. super.drawLoadingText(i, s);
  4031. return;
  4032. }
  4033. loginScreenArea.initDrawingArea();
  4034. Sprite background = new Sprite("loginscreen/general/background");
  4035. background.drawAdvancedSprite(0, 0);
  4036. int x = 765 / 2 - 543 / 2;
  4037. int y = 503 / 2 - 20 + 8;
  4038. int width = 540;
  4039. int height = 32;
  4040. double offset = 5.43;
  4041. new Sprite("loginscreen/general/emptybar").drawAdvancedSprite(765 / 2 - width / 2, 503 / 2 - height / 2);
  4042. new Sprite("loginscreen/general/fullbar").drawAdvancedSprite(765 / 2 - width / 2, 503 / 2 - height / 2);
  4043. new DrawingArea().drawAlphaGradient(
  4044. x + ((int) Math.round(i * offset) / 2), y,
  4045. width - ((int) Math.round(i * offset) / 2), height, 0x000000, 0x000000, 200);
  4046. if (i >= 198) {
  4047. newBoldFont.drawCenteredString("Finished loading OS PvP", (765 / 2), 503 / 2 + 5, 0xffffff, 1);
  4048. } else {
  4049. newBoldFont.drawCenteredString("Loading OS PvP - Please wait - " + (i / 2) + "%", (765 / 2), 503 / 2 + 5, 0xffffff, 1);
  4050. }
  4051. loginScreenArea.drawGraphics(0, super.graphics, 0);
  4052. }
  4053.  
  4054. public void method65(int i, int j, int k, int l, RSInterface class9,
  4055. int i1, boolean flag, int j1) {
  4056. int anInt992;
  4057. if (aBoolean972)
  4058. anInt992 = 32;
  4059. else
  4060. anInt992 = 0;
  4061. aBoolean972 = false;
  4062. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  4063. class9.scrollPosition -= anInt1213 * 4;
  4064. if (flag) {
  4065. needDrawTabArea = true;
  4066. }
  4067. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  4068. class9.scrollPosition += anInt1213 * 4;
  4069. if (flag) {
  4070. needDrawTabArea = true;
  4071. }
  4072. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  4073. && l < (i1 + j) - 16 && anInt1213 > 0) {
  4074. int l1 = ((j - 32) * j) / j1;
  4075. if (l1 < 8)
  4076. l1 = 8;
  4077. int i2 = l - i1 - 16 - l1 / 2;
  4078. int j2 = j - 32 - l1;
  4079. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4080. if (flag)
  4081. needDrawTabArea = true;
  4082. aBoolean972 = true;
  4083. }
  4084. }
  4085.  
  4086. private boolean method66(int i, int j, int k) {
  4087. int i1 = i >> 14 & 0x7fff;
  4088. int j1 = worldController.method304(plane, k, j, i);
  4089. if (j1 == -1)
  4090. return false;
  4091. int k1 = j1 & 0x1f;
  4092. int l1 = j1 >> 6 & 3;
  4093. if (k1 == 10 || k1 == 11 || k1 == 22) {
  4094. ObjectDef class46 = ObjectDef.forID(i1);
  4095. int i2;
  4096. int j2;
  4097. if (l1 == 0 || l1 == 2) {
  4098. i2 = class46.anInt744;
  4099. j2 = class46.anInt761;
  4100. } else {
  4101. i2 = class46.anInt761;
  4102. j2 = class46.anInt744;
  4103. }
  4104. int k2 = class46.anInt768;
  4105. if (l1 != 0)
  4106. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4107. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j,
  4108. myPlayer.smallX[0], false, k);
  4109. } else {
  4110. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j,
  4111. myPlayer.smallX[0], false, k);
  4112. }
  4113. crossX = super.saveClickX;
  4114. crossY = super.saveClickY;
  4115. crossType = 2;
  4116. crossIndex = 0;
  4117. return true;
  4118. }
  4119.  
  4120. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  4121. int k) {
  4122. byte abyte0[] = null;
  4123. int l = 5;
  4124. try {
  4125. if (decompressors[0] != null)
  4126. abyte0 = decompressors[0].decompress(i);
  4127. } catch (Exception _ex) {
  4128. }
  4129. if (abyte0 != null) {
  4130. // aCRC32_930.reset();
  4131. // aCRC32_930.update(abyte0);
  4132. // int i1 = (int)aCRC32_930.getValue();
  4133. // if(i1 != j)
  4134. }
  4135. if (abyte0 != null) {
  4136. StreamLoader streamLoader = new StreamLoader(abyte0, s);
  4137. return streamLoader;
  4138. }
  4139. int j1 = 0;
  4140. while (abyte0 == null) {
  4141. String s2 = "Unknown error";
  4142. drawLoadingText(k, "Requesting " + s);
  4143. try {
  4144. int k1 = 0;
  4145. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  4146. byte abyte1[] = new byte[6];
  4147. datainputstream.readFully(abyte1, 0, 6);
  4148. Stream stream = new Stream(abyte1);
  4149. stream.currentOffset = 3;
  4150. int i2 = stream.read3Bytes() + 6;
  4151. int j2 = 6;
  4152. abyte0 = new byte[i2];
  4153. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  4154.  
  4155. while (j2 < i2) {
  4156. int l2 = i2 - j2;
  4157. if (l2 > 1000)
  4158. l2 = 1000;
  4159. int j3 = datainputstream.read(abyte0, j2, l2);
  4160. if (j3 < 0) {
  4161. s2 = "Length error: " + j2 + "/" + i2;
  4162. throw new IOException("EOF");
  4163. }
  4164. j2 += j3;
  4165. int k3 = (j2 * 100) / i2;
  4166. if (k3 != k1)
  4167. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  4168. k1 = k3;
  4169. }
  4170. datainputstream.close();
  4171. try {
  4172. if (decompressors[0] != null)
  4173. decompressors[0].method234(abyte0.length, abyte0, i);
  4174. } catch (Exception _ex) {
  4175. decompressors[0] = null;
  4176. }
  4177. /*
  4178. * if(abyte0 != null) { aCRC32_930.reset();
  4179. * aCRC32_930.update(abyte0); int i3 =
  4180. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  4181. * j1++; s2 = "Checksum error: " + i3; } }
  4182. */
  4183. } catch (IOException ioexception) {
  4184. if (s2.equals("Unknown error"))
  4185. s2 = "Connection error";
  4186. abyte0 = null;
  4187. } catch (NullPointerException _ex) {
  4188. s2 = "Null error";
  4189. abyte0 = null;
  4190. if (!signlink.reporterror)
  4191. return null;
  4192. } catch (ArrayIndexOutOfBoundsException _ex) {
  4193. s2 = "Bounds error";
  4194. abyte0 = null;
  4195. if (!signlink.reporterror)
  4196. return null;
  4197. } catch (Exception _ex) {
  4198. s2 = "Unexpected error";
  4199. abyte0 = null;
  4200. if (!signlink.reporterror)
  4201. return null;
  4202. }
  4203. if (abyte0 == null) {
  4204. for (int l1 = l; l1 > 0; l1--) {
  4205. if (j1 >= 3) {
  4206. drawLoadingText(k, "Game updated - please reload page");
  4207. l1 = 10;
  4208. } else {
  4209. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4210. }
  4211. try {
  4212. Thread.sleep(1000L);
  4213. } catch (Exception _ex) {
  4214. }
  4215. }
  4216.  
  4217. l *= 2;
  4218. if (l > 60)
  4219. l = 60;
  4220. aBoolean872 = !aBoolean872;
  4221. }
  4222.  
  4223. }
  4224.  
  4225. StreamLoader streamLoader_1 = new StreamLoader(abyte0, s);
  4226. return streamLoader_1;
  4227. }
  4228.  
  4229. public void sendStringAsLong(String string) {
  4230. stream.createFrame(60);
  4231. stream.writeQWord(TextClass.longForName(string));
  4232. }
  4233.  
  4234. public void sendString(int identifier, String text) {
  4235. text = identifier + "," + text;
  4236. stream.createFrame(127);
  4237. stream.writeWordBigEndian(text.length() + 1);
  4238. stream.writeString(text);
  4239. }
  4240.  
  4241. public void dropClient() {
  4242. if (anInt1011 > 0) {
  4243. resetLogout();
  4244. return;
  4245. }
  4246. aRSImageProducer_1165.initDrawingArea();
  4247. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2);
  4248. DrawingArea.drawPixels(37, 3, 3, 0, 227);
  4249. aTextDrawingArea_1271.drawText(0, "Connection Lost", 19, 120);
  4250. aTextDrawingArea_1271.drawText(0xffffff, "Connection Lost", 18, 119);
  4251. aTextDrawingArea_1271
  4252. .drawText(0, "Please Wait - Reconnecting", 34, 117);
  4253. aTextDrawingArea_1271.drawText(0xffffff, "Please Wait - Reconnecting",
  4254. 34, 116);
  4255. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4256. anInt1021 = 0;
  4257. destX = 0;
  4258. RSSocket rsSocket = socketStream;
  4259. loggedIn = false;
  4260. loginFailures = 0;
  4261. login(myUsername, myPassword, true);
  4262. if (!loggedIn)
  4263. resetLogout();
  4264. try {
  4265. rsSocket.close();
  4266. } catch (Exception _ex) {
  4267. }
  4268. }
  4269.  
  4270. public void readSettings() throws IOException {
  4271. DataInputStream in = new DataInputStream(new BufferedInputStream(
  4272. new FileInputStream(signlink.findcachedir() + "settings.dat")));
  4273. OSOrbs = in.readInt() == 1 ? true : false;
  4274. revision474 = in.readInt() == 1 ? true : false;
  4275. revision498 = in.readInt() == 1 ? true : false;
  4276. OSCounter = in.readInt() == 1 ? true : false;
  4277. RSApplet.hotKeyToggle = in.readInt() == 1 ? true : false;
  4278. in.close();
  4279. }
  4280.  
  4281. public void writeSettings() throws IOException {
  4282. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(
  4283. new FileOutputStream(signlink.findcachedir() + "settings.dat")));
  4284. // out.writeInt(gameFrame554 ? 1 : 0);
  4285. // out.writeInt(gameFrame474 ? 1 : 0);
  4286. // out.writeInt(gameFrame525 ? 1 : 0);
  4287. out.writeInt(OSOrbs ? 1 : 0);
  4288. out.writeInt(revision474 ? 1 : 0);
  4289. out.writeInt(revision498 ? 1 : 0);
  4290. out.writeInt(OSCounter ? 1 : 0);
  4291. out.writeInt(RSApplet.hotKeyToggle ? 1 : 0);
  4292. out.close();
  4293. }
  4294.  
  4295. private void doAction(int i) {
  4296. if (i < 0)
  4297. return;
  4298. if (inputDialogState != 0) {
  4299. inputDialogState = 0;
  4300. inputTaken = true;
  4301. }
  4302. int j = menuActionCmd2[i];
  4303. int k = menuActionCmd3[i];
  4304. int l = menuActionID[i];
  4305. int i1 = menuActionCmd1[i];
  4306.  
  4307. if (l >= 2000)
  4308. l -= 2000;
  4309. if (l == 1100) {
  4310. RSInterface button = RSInterface.interfaceCache[k];
  4311. button.setMenuVisible(button.isMenuVisible() ? false : true);
  4312. }
  4313. if (l == 1200) {
  4314. stream.createFrame(185);
  4315. stream.writeWord(k);
  4316. RSInterface item = RSInterface.interfaceCache[k];
  4317. RSInterface menu = RSInterface.interfaceCache[item.mOverInterToTrigger];
  4318. menu.setMenuItem(item.getMenuItem());
  4319. menu.setMenuVisible(false);
  4320. }
  4321. if (l >= 1700 && l <= 1710) {
  4322. stream.createFrame(185);
  4323. int offset = 0;
  4324. offset = k + (k - 58030) * 10 + (l - 1700);
  4325. stream.writeWord(offset);
  4326. }
  4327. if (l == 300) {
  4328. stream.createFrame(141);
  4329. stream.method432(j);
  4330. stream.writeWord(k);
  4331. stream.method432(i1);
  4332. stream.writeDWord(modifiableXValue);
  4333. }
  4334. if (l == 291) {
  4335. stream.createFrame(140);
  4336. stream.method433(k);
  4337. stream.method433(i1);
  4338. stream.method431(j);
  4339. atInventoryLoopCycle = 0;
  4340. atInventoryInterface = k;
  4341. atInventoryIndex = j;
  4342. atInventoryInterfaceType = 2;
  4343. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4344. atInventoryInterfaceType = 1;
  4345. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4346. atInventoryInterfaceType = 3;
  4347. }
  4348. if (l == 582) {
  4349. NPC npc = npcArray[i1];
  4350. if (npc != null) {
  4351. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  4352. myPlayer.smallX[0], false, npc.smallX[0]);
  4353. crossX = super.saveClickX;
  4354. crossY = super.saveClickY;
  4355. crossType = 2;
  4356. crossIndex = 0;
  4357. stream.createFrame(57);
  4358. stream.method432(anInt1285);
  4359. stream.method432(i1);
  4360. stream.method431(anInt1283);
  4361. stream.method432(anInt1284);
  4362. }
  4363. }
  4364. if (l == 234) {
  4365. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4366. myPlayer.smallX[0], false, j);
  4367. if (!flag1)
  4368. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4369. myPlayer.smallX[0], false, j);
  4370. crossX = super.saveClickX;
  4371. crossY = super.saveClickY;
  4372. crossType = 2;
  4373. crossIndex = 0;
  4374. stream.createFrame(236);
  4375. stream.method431(k + baseY);
  4376. stream.writeWord(i1);
  4377. stream.method431(j + baseX);
  4378. }
  4379. if (l == 62 && method66(i1, k, j)) {
  4380. stream.createFrame(192);
  4381. stream.writeWord(anInt1284);
  4382. stream.method431(i1 >> 14 & 0x7fff);
  4383. stream.method433(k + baseY);
  4384. stream.method431(anInt1283);
  4385. stream.method433(j + baseX);
  4386. stream.writeWord(anInt1285);
  4387. }
  4388. if (l == 474) {
  4389. counterOn = !counterOn;
  4390. }
  4391. if (l == 475) {
  4392. xpCounter = 0;
  4393. }
  4394. if (l == 511) {
  4395. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4396. myPlayer.smallX[0], false, j);
  4397. if (!flag2)
  4398. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4399. myPlayer.smallX[0], false, j);
  4400. crossX = super.saveClickX;
  4401. crossY = super.saveClickY;
  4402. crossType = 2;
  4403. crossIndex = 0;
  4404. stream.createFrame(25);
  4405. stream.method431(anInt1284);
  4406. stream.method432(anInt1285);
  4407. stream.writeWord(i1);
  4408. stream.method432(k + baseY);
  4409. stream.method433(anInt1283);
  4410. stream.writeWord(j + baseX);
  4411. }
  4412. if (l == 74) {
  4413. stream.createFrame(122);
  4414. stream.method433(k);
  4415. stream.method432(j);
  4416. stream.method431(i1);
  4417. atInventoryLoopCycle = 0;
  4418. atInventoryInterface = k;
  4419. atInventoryIndex = j;
  4420. atInventoryInterfaceType = 2;
  4421. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4422. atInventoryInterfaceType = 1;
  4423. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4424. atInventoryInterfaceType = 3;
  4425. }
  4426. if (l == 315) {
  4427. RSInterface class9 = RSInterface.interfaceCache[k];
  4428. boolean flag8 = true;
  4429. if (class9.contentType > 0)
  4430. flag8 = promptUserForInput(class9);
  4431. if (flag8) {
  4432. System.out.println("Config ButtonId: " + k); //remove when done
  4433. switch (k) {
  4434. case 31011:
  4435. tabInterfaceIDs[11] = 31080;
  4436. tabAreaAltered = true;
  4437. break;
  4438. case 31041:
  4439. tabInterfaceIDs[11] = 904;
  4440. tabAreaAltered = true;
  4441. break;
  4442. case 31022:
  4443. launchURL(Configuration.FORUM_DOCUMENT_BASE);
  4444. break;
  4445. case 31023:
  4446. launchURL(Configuration.STORE_DOCUMENT_BASE);
  4447. break;
  4448. case 31108:
  4449. pushMessage("This feature is not yet available!", 0, "");
  4450. break;
  4451. case 32013:
  4452. if (RSInterface.selectedItemInterfaceId <= 0) {
  4453. return;
  4454. }
  4455. RSInterface input = RSInterface.interfaceCache[RSInterface.selectedItemInterfaceId + 1];
  4456. RSInterface itemContainer = RSInterface.interfaceCache[RSInterface.selectedItemInterfaceId];
  4457. if (input != null && itemContainer != null) {
  4458. int amount = -1;
  4459. try {
  4460. amount = Integer.parseInt(input.message);
  4461. } catch (NumberFormatException nfe) {
  4462. pushMessage(
  4463. "The amount must be a non-negative numerical value.",
  4464. 0, "");
  4465. break;
  4466. }
  4467. if (itemContainer.itemSearchSelectedId < 0) {
  4468. itemContainer.itemSearchSelectedId = 0;
  4469. }
  4470. if (itemContainer.itemSearchSelectedSlot < 0) {
  4471. itemContainer.itemSearchSelectedSlot = 0;
  4472. }
  4473. stream.createFrame(124);
  4474. stream.writeDWord(RSInterface.selectedItemInterfaceId);
  4475. stream.writeDWord(itemContainer.itemSearchSelectedSlot);
  4476. stream.writeDWord(itemContainer.itemSearchSelectedId - 1);
  4477. stream.writeDWord(amount);
  4478. }
  4479. break;
  4480. case 19144:
  4481. sendFrame248(15106, 3213);
  4482. method60(15106);
  4483. inputTaken = true;
  4484. break;
  4485. default:
  4486. stream.createFrame(185);
  4487. stream.writeWord(k);
  4488. break;
  4489.  
  4490. }
  4491. }
  4492. }
  4493. if (l == 561) {
  4494. Player player = playerArray[i1];
  4495. if (player != null) {
  4496. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4497. player.smallY[0], myPlayer.smallX[0], false,
  4498. player.smallX[0]);
  4499. crossX = super.saveClickX;
  4500. crossY = super.saveClickY;
  4501. crossType = 2;
  4502. crossIndex = 0;
  4503. anInt1188 += i1;
  4504. if (anInt1188 >= 90) {
  4505. stream.createFrame(136);
  4506. anInt1188 = 0;
  4507. }
  4508. stream.createFrame(128);
  4509. stream.writeWord(i1);
  4510. }
  4511. }
  4512. if (l == 745) {
  4513. stream.createFrame(8);
  4514. stream.writeDWord(i1);
  4515. }
  4516. if (l == 20) {
  4517. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4518. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4519. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4520. class30_sub2_sub4_sub1_sub1_1.smallY[0],
  4521. myPlayer.smallX[0], false,
  4522. class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  4523. crossX = super.saveClickX;
  4524. crossY = super.saveClickY;
  4525. crossType = 2;
  4526. crossIndex = 0;
  4527. stream.createFrame(155);
  4528. stream.method431(i1);
  4529. }
  4530. }
  4531. if (l == 779) {
  4532. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4533. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4534. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4535. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  4536. myPlayer.smallX[0], false,
  4537. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  4538. crossX = super.saveClickX;
  4539. crossY = super.saveClickY;
  4540. crossType = 2;
  4541. crossIndex = 0;
  4542. stream.createFrame(153);
  4543. stream.method431(i1);
  4544. }
  4545. }
  4546. if (l == 516)
  4547. if (!menuOpen)
  4548. worldController.method312(super.saveClickY - 4,
  4549. super.saveClickX - 4);
  4550. else
  4551. worldController.method312(k - 4, j - 4);
  4552. if (l == 1062) {
  4553. anInt924 += baseX;
  4554. if (anInt924 >= 113) {
  4555. stream.createFrame(183);
  4556. stream.writeDWordBigEndian(0xe63271);
  4557. anInt924 = 0;
  4558. }
  4559. method66(i1, k, j);
  4560. stream.createFrame(228);
  4561. stream.method432(i1 >> 14 & 0x7fff);
  4562. stream.method432(k + baseY);
  4563. stream.writeWord(j + baseX);
  4564. }
  4565. if (l == 679 && !aBoolean1149) {
  4566. stream.createFrame(40);
  4567. stream.writeWord(k);
  4568. aBoolean1149 = true;
  4569. }
  4570. if (l == 431) {
  4571. stream.createFrame(129);
  4572. stream.method432(j);
  4573. stream.writeWord(k);
  4574. stream.method432(i1);
  4575. atInventoryLoopCycle = 0;
  4576. atInventoryInterface = k;
  4577. atInventoryIndex = j;
  4578. atInventoryInterfaceType = 2;
  4579. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4580. atInventoryInterfaceType = 1;
  4581. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4582. atInventoryInterfaceType = 3;
  4583. }
  4584. if (l == 337 || l == 42 || l == 792 || l == 322) {
  4585. String s = menuActionName[i];
  4586. int k1 = s.indexOf("@whi@");
  4587. if (k1 != -1) {
  4588. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4589. if (l == 337)
  4590. addFriend(l3);
  4591. if (l == 42)
  4592. addIgnore(l3);
  4593. if (l == 792)
  4594. delFriend(l3);
  4595. if (l == 322)
  4596. delIgnore(l3);
  4597. }
  4598. }
  4599. if (l == 53) {
  4600. stream.createFrame(135);
  4601. stream.method431(j);
  4602. stream.method432(k);
  4603. stream.method431(i1);
  4604. atInventoryLoopCycle = 0;
  4605. atInventoryInterface = k;
  4606. atInventoryIndex = j;
  4607. atInventoryInterfaceType = 2;
  4608. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4609. atInventoryInterfaceType = 1;
  4610. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4611. atInventoryInterfaceType = 3;
  4612. }
  4613. if (l == 539) {
  4614. stream.createFrame(16);
  4615. stream.method432(i1);
  4616. stream.method433(j);
  4617. stream.method433(k);
  4618. atInventoryLoopCycle = 0;
  4619. atInventoryInterface = k;
  4620. atInventoryIndex = j;
  4621. atInventoryInterfaceType = 2;
  4622. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4623. atInventoryInterfaceType = 1;
  4624. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4625. atInventoryInterfaceType = 3;
  4626. }
  4627. if (l == 484 || l == 6) {
  4628. String s1 = menuActionName[i];
  4629. int l1 = s1.indexOf("@whi@");
  4630. if (l1 != -1) {
  4631. s1 = s1.substring(l1 + 5).trim();
  4632. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass
  4633. .longForName(s1)));
  4634. boolean flag9 = false;
  4635. for (int j3 = 0; j3 < playerCount; j3++) {
  4636. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4637. if (class30_sub2_sub4_sub1_sub2_7 == null
  4638. || class30_sub2_sub4_sub1_sub2_7.name == null
  4639. || !class30_sub2_sub4_sub1_sub2_7.name
  4640. .equalsIgnoreCase(s7))
  4641. continue;
  4642. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4643. class30_sub2_sub4_sub1_sub2_7.smallY[0],
  4644. myPlayer.smallX[0], false,
  4645. class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  4646. if (l == 484) {
  4647. stream.createFrame(39);
  4648. stream.method431(playerIndices[j3]);
  4649. }
  4650. if (l == 6) {
  4651. anInt1188 += i1;
  4652. if (anInt1188 >= 90) {
  4653. stream.createFrame(136);
  4654. anInt1188 = 0;
  4655. }
  4656. stream.createFrame(128);
  4657. stream.writeWord(playerIndices[j3]);
  4658. }
  4659. flag9 = true;
  4660. break;
  4661. }
  4662.  
  4663. if (!flag9)
  4664. pushMessage("Unable to find " + s7, 0, "");
  4665. }
  4666. }
  4667. if (l == 870) {
  4668. stream.createFrame(53);
  4669. stream.writeWord(j);
  4670. stream.method432(anInt1283);
  4671. stream.method433(i1);
  4672. stream.writeWord(anInt1284);
  4673. stream.method431(anInt1285);
  4674. stream.writeWord(k);
  4675. atInventoryLoopCycle = 0;
  4676. atInventoryInterface = k;
  4677. atInventoryIndex = j;
  4678. atInventoryInterfaceType = 2;
  4679. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4680. atInventoryInterfaceType = 1;
  4681. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4682. atInventoryInterfaceType = 3;
  4683. }
  4684. if (l == 847) {
  4685. stream.createFrame(87);
  4686. stream.method432(i1);
  4687. stream.writeWord(k);
  4688. stream.method432(j);
  4689. atInventoryLoopCycle = 0;
  4690. atInventoryInterface = k;
  4691. atInventoryIndex = j;
  4692. atInventoryInterfaceType = 2;
  4693. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4694. atInventoryInterfaceType = 1;
  4695. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4696. atInventoryInterfaceType = 3;
  4697. }
  4698. if (l == 626) {
  4699. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4700. spellSelected = 1;
  4701. spellID = class9_1.id;
  4702. anInt1137 = k;
  4703. spellUsableOn = class9_1.spellUsableOn;
  4704. itemSelected = 0;
  4705. needDrawTabArea = true;
  4706. spellID = class9_1.id;
  4707. String s4 = class9_1.selectedActionName;
  4708. if (s4.indexOf(" ") != -1)
  4709. s4 = s4.substring(0, s4.indexOf(" "));
  4710. String s8 = class9_1.selectedActionName;
  4711. if (s8.indexOf(" ") != -1)
  4712. s8 = s8.substring(s8.indexOf(" ") + 1);
  4713. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4714. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4715. // 0xffffff);
  4716. // class9_1.sprite1.drawSprite(200,200);
  4717. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4718. if (spellUsableOn == 16) {
  4719. needDrawTabArea = true;
  4720. tabID = 3;
  4721. tabAreaAltered = true;
  4722. }
  4723. return;
  4724. }
  4725. if (l == 104) {
  4726. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4727. spellID = class9_1.id;
  4728. if (!Autocast) {
  4729. Autocast = true;
  4730. pushMessage("Autocast spell selected.", 0, "");
  4731. autocastId = class9_1.id;
  4732. stream.createFrame(185);
  4733. stream.writeWord(class9_1.id);
  4734. } else if (autocastId == class9_1.id) {
  4735. Autocast = false;
  4736. autocastId = 0;
  4737. pushMessage("Autocast spell cleared.", 0, "");
  4738. stream.createFrame(185);
  4739. stream.writeWord(6666); // reset server side
  4740. } else if (autocastId != class9_1.id) {
  4741. Autocast = true;
  4742. pushMessage("Autocast spell selected.", 0, "");
  4743. autocastId = class9_1.id;
  4744. stream.createFrame(185);
  4745. stream.writeWord(class9_1.id);
  4746. }
  4747. }
  4748. if (l == 78) {
  4749. stream.createFrame(117);
  4750. stream.method433(k);
  4751. stream.method433(i1);
  4752. stream.method431(j);
  4753. atInventoryLoopCycle = 0;
  4754. atInventoryInterface = k;
  4755. atInventoryIndex = j;
  4756. atInventoryInterfaceType = 2;
  4757. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4758. atInventoryInterfaceType = 1;
  4759. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4760. atInventoryInterfaceType = 3;
  4761. }
  4762. if (l == 27) {
  4763. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4764. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4765. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4766. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  4767. myPlayer.smallX[0], false,
  4768. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4769. crossX = super.saveClickX;
  4770. crossY = super.saveClickY;
  4771. crossType = 2;
  4772. crossIndex = 0;
  4773. anInt986 += i1;
  4774. if (anInt986 >= 54) {
  4775. stream.createFrame(189);
  4776. stream.writeWordBigEndian(234);
  4777. anInt986 = 0;
  4778. }
  4779. stream.createFrame(73);
  4780. stream.method431(i1);
  4781. }
  4782. }
  4783. if (l == 213) {
  4784. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4785. myPlayer.smallX[0], false, j);
  4786. if (!flag3)
  4787. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4788. myPlayer.smallX[0], false, j);
  4789. crossX = super.saveClickX;
  4790. crossY = super.saveClickY;
  4791. crossType = 2;
  4792. crossIndex = 0;
  4793. stream.createFrame(79);
  4794. stream.method431(k + baseY);
  4795. stream.writeWord(i1);
  4796. stream.method432(j + baseX);
  4797. }
  4798. if (l == 632) {
  4799. stream.createFrame(145);
  4800. stream.method432(k);
  4801. stream.method432(j);
  4802. stream.method432(i1);
  4803. atInventoryLoopCycle = 0;
  4804. atInventoryInterface = k;
  4805. atInventoryIndex = j;
  4806. atInventoryInterfaceType = 2;
  4807. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4808. atInventoryInterfaceType = 1;
  4809. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4810. atInventoryInterfaceType = 3;
  4811. }
  4812. if (l == 1050) {
  4813. if (!runClicked1) {
  4814. runClicked1 = true;
  4815. stream.createFrame(185);
  4816. stream.writeWord(152);
  4817. } else {
  4818. runClicked1 = false;
  4819. stream.createFrame(185);
  4820. stream.writeWord(152);
  4821. }
  4822. }
  4823. if (l == 1004) {
  4824. if (tabInterfaceIDs[10] != -1) {
  4825. needDrawTabArea = true;
  4826. setSidebarInterface(10, 2449);
  4827. tabID = 10;
  4828. tabAreaAltered = true;
  4829. }
  4830. }
  4831. if (l == 1003) {
  4832. clanChatMode = 2;
  4833. aBoolean1233 = true;
  4834. inputTaken = true;
  4835. }
  4836. if (l == 1002) {
  4837. clanChatMode = 1;
  4838. aBoolean1233 = true;
  4839. inputTaken = true;
  4840. }
  4841. if (l == 1001) {
  4842. clanChatMode = 0;
  4843. aBoolean1233 = true;
  4844. inputTaken = true;
  4845. }
  4846. if (l == 1000) {
  4847. cButtonCPos = 4;
  4848. chatTypeView = 11;
  4849. aBoolean1233 = true;
  4850. inputTaken = true;
  4851. }
  4852. if (l == 999) {
  4853. cButtonCPos = 0;
  4854. chatTypeView = 0;
  4855. aBoolean1233 = true;
  4856. inputTaken = true;
  4857. }
  4858. if (l == 998) {
  4859. cButtonCPos = 1;
  4860. chatTypeView = 5;
  4861. aBoolean1233 = true;
  4862. inputTaken = true;
  4863. }
  4864. if (l == 1005) {
  4865. cButtonCPos = 1;
  4866. chatTypeView = 12;
  4867. aBoolean1233 = true;
  4868. inputTaken = true;
  4869. }
  4870. if (l == 997) {
  4871. publicChatMode = 3;
  4872. stream.createFrame(95);
  4873. stream.writeWordBigEndian(publicChatMode);
  4874. stream.writeWordBigEndian(privateChatMode);
  4875. stream.writeWordBigEndian(tradeMode);
  4876. inputTaken = true;
  4877. }
  4878. if (l == 996) {
  4879. publicChatMode = 2;
  4880. stream.createFrame(95);
  4881. stream.writeWordBigEndian(publicChatMode);
  4882. stream.writeWordBigEndian(privateChatMode);
  4883. stream.writeWordBigEndian(tradeMode);
  4884. inputTaken = true;
  4885. }
  4886. if (l == 995) {
  4887. publicChatMode = 1;
  4888. stream.createFrame(95);
  4889. stream.writeWordBigEndian(publicChatMode);
  4890. stream.writeWordBigEndian(privateChatMode);
  4891. stream.writeWordBigEndian(tradeMode);
  4892. inputTaken = true;
  4893. }
  4894. if (l == 994) {
  4895. publicChatMode = 0;
  4896. inputTaken = true;
  4897. }
  4898. if (l == 993) {
  4899. cButtonCPos = 2;
  4900. chatTypeView = 1;
  4901. inputTaken = true;
  4902. }
  4903. if (l == 992) {
  4904. privateChatMode = 2;
  4905. stream.createFrame(95);
  4906. stream.writeWordBigEndian(publicChatMode);
  4907. stream.writeWordBigEndian(privateChatMode);
  4908. stream.writeWordBigEndian(tradeMode);
  4909. inputTaken = true;
  4910. }
  4911. if (l == 991) {
  4912. privateChatMode = 1;
  4913. stream.createFrame(95);
  4914. stream.writeWordBigEndian(publicChatMode);
  4915. stream.writeWordBigEndian(privateChatMode);
  4916. stream.writeWordBigEndian(tradeMode);
  4917. inputTaken = true;
  4918. }
  4919. if (l == 990) {
  4920. privateChatMode = 0;
  4921. stream.createFrame(95);
  4922. stream.writeWordBigEndian(publicChatMode);
  4923. stream.writeWordBigEndian(privateChatMode);
  4924. stream.writeWordBigEndian(tradeMode);
  4925. aBoolean1233 = true;
  4926. inputTaken = true;
  4927. }
  4928. if (l == 989) {
  4929. cButtonCPos = 3;
  4930. chatTypeView = 2;
  4931. inputTaken = true;
  4932. }
  4933. if (l == 987) {
  4934. tradeMode = 2;
  4935. stream.createFrame(95);
  4936. stream.writeWordBigEndian(publicChatMode);
  4937. stream.writeWordBigEndian(privateChatMode);
  4938. stream.writeWordBigEndian(tradeMode);
  4939. aBoolean1233 = true;
  4940. inputTaken = true;
  4941. }
  4942. if (l == 986) {
  4943. tradeMode = 1;
  4944. stream.createFrame(95);
  4945. stream.writeWordBigEndian(publicChatMode);
  4946. stream.writeWordBigEndian(privateChatMode);
  4947. stream.writeWordBigEndian(tradeMode);
  4948. aBoolean1233 = true;
  4949. inputTaken = true;
  4950. }
  4951. if (l == 985) {
  4952. tradeMode = 0;
  4953. stream.createFrame(95);
  4954. stream.writeWordBigEndian(publicChatMode);
  4955. stream.writeWordBigEndian(privateChatMode);
  4956. stream.writeWordBigEndian(tradeMode);
  4957. aBoolean1233 = true;
  4958. inputTaken = true;
  4959. }
  4960. if (l == 984) {
  4961. cButtonCPos = 5;
  4962. chatTypeView = 3;
  4963. inputTaken = true;
  4964. }
  4965. if (l == 983) {
  4966. duelMode = 2;
  4967. inputTaken = true;
  4968. }
  4969. if (l == 982) {
  4970. duelMode = 1;
  4971. inputTaken = true;
  4972. }
  4973. if (l == 981) {
  4974. duelMode = 0;
  4975. inputTaken = true;
  4976. }
  4977. if (l == 980) {
  4978. cButtonCPos = 6;
  4979. chatTypeView = 4;
  4980. inputTaken = true;
  4981. }
  4982. if (l == 493) {
  4983. stream.createFrame(75);
  4984. stream.method433(k);
  4985. stream.method431(j);
  4986. stream.method432(i1);
  4987. atInventoryLoopCycle = 0;
  4988. atInventoryInterface = k;
  4989. atInventoryIndex = j;
  4990. atInventoryInterfaceType = 2;
  4991. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4992. atInventoryInterfaceType = 1;
  4993. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4994. atInventoryInterfaceType = 3;
  4995. }
  4996. if (l == 652) {
  4997. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4998. myPlayer.smallX[0], false, j);
  4999. if (!flag4)
  5000. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5001. myPlayer.smallX[0], false, j);
  5002. crossX = super.saveClickX;
  5003. crossY = super.saveClickY;
  5004. crossType = 2;
  5005. crossIndex = 0;
  5006. stream.createFrame(156);
  5007. stream.method432(j + baseX);
  5008. stream.method431(k + baseY);
  5009. stream.method433(i1);
  5010. }
  5011. if (l == 94) {
  5012. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5013. myPlayer.smallX[0], false, j);
  5014. if (!flag5)
  5015. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5016. myPlayer.smallX[0], false, j);
  5017. crossX = super.saveClickX;
  5018. crossY = super.saveClickY;
  5019. crossType = 2;
  5020. crossIndex = 0;
  5021. stream.createFrame(181);
  5022. stream.method431(k + baseY);
  5023. stream.writeWord(i1);
  5024. stream.method431(j + baseX);
  5025. stream.method432(anInt1137);
  5026. }
  5027. // clan chat
  5028. if (l == 647) {
  5029. stream.createFrame(213);
  5030. stream.writeWord(k);
  5031. stream.writeWord(j);
  5032. switch (k) {
  5033. case 18304:
  5034. if (j == 0) {
  5035. inputTaken = true;
  5036. inputDialogState = 0;
  5037. messagePromptRaised = true;
  5038. promptInput = "";
  5039. friendsListAction = 8;
  5040. aString1121 = "Enter your clan chat title";
  5041. }
  5042. break;
  5043. }
  5044. }
  5045. if (l == 646) {
  5046. stream.createFrame(185);
  5047. stream.writeWord(k);
  5048. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5049. if (class9_2.valueIndexArray != null
  5050. && class9_2.valueIndexArray[0][0] == 5) {
  5051. int i2 = class9_2.valueIndexArray[0][1];
  5052. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  5053. variousSettings[i2] = class9_2.anIntArray212[0];
  5054. parseVariousSettings(i2);
  5055. needDrawTabArea = true;
  5056. }
  5057. System.out.println(class9_2.id + ", " + i2 + ", "
  5058. + variousSettings[i2] + ", "
  5059. + class9_2.anIntArray212[0]);
  5060. switch (i2) {
  5061. case 810:
  5062. break;
  5063. }
  5064. }
  5065. switch (k) {
  5066. // clan chat
  5067. case 18129:
  5068. if (RSInterface.interfaceCache[18135].message.toLowerCase()
  5069. .contains("join")) {
  5070. inputTaken = true;
  5071. inputDialogState = 0;
  5072. messagePromptRaised = true;
  5073. promptInput = "";
  5074. friendsListAction = 6;
  5075. aString1121 = "Enter the name of the chat you wish to join";
  5076. } else {
  5077. sendString(0, "");
  5078. }
  5079. break;
  5080. case 18132:
  5081. openInterfaceID = 18300;
  5082. break;
  5083. case 18526:
  5084. inputTaken = true;
  5085. inputDialogState = 0;
  5086. messagePromptRaised = true;
  5087. promptInput = "";
  5088. friendsListAction = 9;
  5089. aString1121 = "Enter a name to add";
  5090. break;
  5091. case 18527:
  5092. inputTaken = true;
  5093. inputDialogState = 0;
  5094. messagePromptRaised = true;
  5095. promptInput = "";
  5096. friendsListAction = 10;
  5097. aString1121 = "Enter a name to add";
  5098. break;
  5099. }
  5100. }
  5101. if (l == 225) {
  5102. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5103. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  5104. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5105. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  5106. myPlayer.smallX[0], false,
  5107. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  5108. crossX = super.saveClickX;
  5109. crossY = super.saveClickY;
  5110. crossType = 2;
  5111. crossIndex = 0;
  5112. anInt1226 += i1;
  5113. if (anInt1226 >= 85) {
  5114. stream.createFrame(230);
  5115. stream.writeWordBigEndian(239);
  5116. anInt1226 = 0;
  5117. }
  5118. stream.createFrame(17);
  5119. stream.method433(i1);
  5120. }
  5121. }
  5122. if (l == 965) {
  5123. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5124. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  5125. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5126. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  5127. myPlayer.smallX[0], false,
  5128. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  5129. crossX = super.saveClickX;
  5130. crossY = super.saveClickY;
  5131. crossType = 2;
  5132. crossIndex = 0;
  5133. anInt1134++;
  5134. if (anInt1134 >= 96) {
  5135. stream.createFrame(152);
  5136. stream.writeWordBigEndian(88);
  5137. anInt1134 = 0;
  5138. }
  5139. stream.createFrame(21);
  5140. stream.writeWord(i1);
  5141. }
  5142. }
  5143. if (l == 413) {
  5144. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5145. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  5146. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5147. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  5148. myPlayer.smallX[0], false,
  5149. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  5150. crossX = super.saveClickX;
  5151. crossY = super.saveClickY;
  5152. crossType = 2;
  5153. crossIndex = 0;
  5154. stream.createFrame(131);
  5155. stream.method433(i1);
  5156. stream.method432(anInt1137);
  5157. }
  5158. }
  5159. if (l == 200)
  5160. clearTopInterfaces();
  5161. if (l == 1025) {
  5162. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5163. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  5164. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5165. if (entityDef.childrenIDs != null)
  5166. entityDef = entityDef.method161();
  5167. if (entityDef != null) {
  5168. String s9;
  5169. if (entityDef.description != null)
  5170. s9 = new String(entityDef.description);
  5171. else
  5172. s9 = "It's a " + entityDef.name + ".";
  5173. pushMessage(s9, 0, "");
  5174. }
  5175. }
  5176. }
  5177. if (l == 900) {
  5178. method66(i1, k, j);
  5179. stream.createFrame(252);
  5180. stream.method433(i1 >> 14 & 0x7fff);
  5181. stream.method431(k + baseY);
  5182. stream.method432(j + baseX);
  5183. }
  5184. if (l == 412) {
  5185. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5186. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  5187. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5188. class30_sub2_sub4_sub1_sub1_6.smallY[0],
  5189. myPlayer.smallX[0], false,
  5190. class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  5191. crossX = super.saveClickX;
  5192. crossY = super.saveClickY;
  5193. crossType = 2;
  5194. crossIndex = 0;
  5195. stream.createFrame(72);
  5196. stream.method432(i1);
  5197. }
  5198. }
  5199. if (l == 365) {
  5200. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5201. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  5202. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5203. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  5204. myPlayer.smallX[0], false,
  5205. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  5206. crossX = super.saveClickX;
  5207. crossY = super.saveClickY;
  5208. crossType = 2;
  5209. crossIndex = 0;
  5210. stream.createFrame(249);
  5211. stream.method432(i1);
  5212. stream.method431(anInt1137);
  5213. }
  5214. }
  5215. if (l == 729) {
  5216. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5217. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  5218. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5219. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  5220. myPlayer.smallX[0], false,
  5221. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  5222. crossX = super.saveClickX;
  5223. crossY = super.saveClickY;
  5224. crossType = 2;
  5225. crossIndex = 0;
  5226. stream.createFrame(39);
  5227. stream.method431(i1);
  5228. }
  5229. }
  5230. if (l == 577) {
  5231. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5232. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  5233. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5234. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  5235. myPlayer.smallX[0], false,
  5236. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  5237. crossX = super.saveClickX;
  5238. crossY = super.saveClickY;
  5239. crossType = 2;
  5240. crossIndex = 0;
  5241. stream.createFrame(139);
  5242. stream.method431(i1);
  5243. }
  5244. }
  5245. if (l == 956 && method66(i1, k, j)) {
  5246. stream.createFrame(35);
  5247. stream.method431(j + baseX);
  5248. stream.method432(anInt1137);
  5249. stream.method432(k + baseY);
  5250. stream.method431(i1 >> 14 & 0x7fff);
  5251. }
  5252. if (l == 567) {
  5253. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5254. myPlayer.smallX[0], false, j);
  5255. if (!flag6)
  5256. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5257. myPlayer.smallX[0], false, j);
  5258. crossX = super.saveClickX;
  5259. crossY = super.saveClickY;
  5260. crossType = 2;
  5261. crossIndex = 0;
  5262. stream.createFrame(23);
  5263. stream.method431(k + baseY);
  5264. stream.method431(i1);
  5265. stream.method431(j + baseX);
  5266. }
  5267. if (l == 867) {
  5268. if ((i1 & 3) == 0)
  5269. anInt1175++;
  5270. if (anInt1175 >= 59) {
  5271. stream.createFrame(200);
  5272. stream.createFrame(201);
  5273. stream.writeWord(25501);
  5274. anInt1175 = 0;
  5275. }
  5276. stream.createFrame(43);
  5277. stream.method431(k);
  5278. stream.method432(i1);
  5279. stream.method432(j);
  5280. atInventoryLoopCycle = 0;
  5281. atInventoryInterface = k;
  5282. atInventoryIndex = j;
  5283. atInventoryInterfaceType = 2;
  5284. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5285. atInventoryInterfaceType = 1;
  5286. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5287. atInventoryInterfaceType = 3;
  5288. }
  5289. if (l == 543) {
  5290. stream.createFrame(237);
  5291. stream.writeWord(j);
  5292. stream.method432(i1);
  5293. stream.writeWord(k);
  5294. stream.method432(anInt1137);
  5295. atInventoryLoopCycle = 0;
  5296. atInventoryInterface = k;
  5297. atInventoryIndex = j;
  5298. atInventoryInterfaceType = 2;
  5299. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5300. atInventoryInterfaceType = 1;
  5301. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5302. atInventoryInterfaceType = 3;
  5303. }
  5304. if (l == 606) {
  5305. String s2 = menuActionName[i];
  5306. int j2 = s2.indexOf("@whi@");
  5307. if (j2 != -1)
  5308. if (openInterfaceID == -1) {
  5309. clearTopInterfaces();
  5310. reportAbuseInput = s2.substring(j2 + 5).trim();
  5311. canMute = false;
  5312. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  5313. if (RSInterface.interfaceCache[i3] == null
  5314. || RSInterface.interfaceCache[i3].contentType != 600)
  5315. continue;
  5316. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5317. break;
  5318. }
  5319.  
  5320. } else {
  5321. pushMessage(
  5322. "Please close the interface you have open before using 'report abuse'",
  5323. 0, "");
  5324. }
  5325. }
  5326. if (l == 491) {
  5327. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5328. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  5329. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5330. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  5331. myPlayer.smallX[0], false,
  5332. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  5333. crossX = super.saveClickX;
  5334. crossY = super.saveClickY;
  5335. crossType = 2;
  5336. crossIndex = 0;
  5337. stream.createFrame(14);
  5338. stream.method432(anInt1284);
  5339. stream.writeWord(i1);
  5340. stream.writeWord(anInt1285);
  5341. stream.method431(anInt1283);
  5342. }
  5343. }
  5344. if (l == 639) {
  5345. String s3 = menuActionName[i];
  5346. int k2 = s3.indexOf("@whi@");
  5347. if (k2 != -1) {
  5348. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5349. int k3 = -1;
  5350. for (int i4 = 0; i4 < friendsCount; i4++) {
  5351. if (friendsListAsLongs[i4] != l4)
  5352. continue;
  5353. k3 = i4;
  5354. break;
  5355. }
  5356.  
  5357. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  5358. inputTaken = true;
  5359. inputDialogState = 0;
  5360. messagePromptRaised = true;
  5361. promptInput = "";
  5362. friendsListAction = 3;
  5363. aLong953 = friendsListAsLongs[k3];
  5364. aString1121 = "Enter message to send to " + friendsList[k3];
  5365. }
  5366. }
  5367. }
  5368. if (l == 1052) {
  5369. stream.createFrame(185);
  5370. stream.writeWord(154);
  5371. }
  5372.  
  5373. if (l == 1004) {
  5374. if (tabInterfaceIDs[14] != -1) {
  5375. needDrawTabArea = true;
  5376. tabID = 14;
  5377. tabAreaAltered = true;
  5378. }
  5379. }
  5380.  
  5381. if (l == 454) {
  5382. stream.createFrame(41);
  5383. stream.writeWord(i1);
  5384. stream.method432(j);
  5385. stream.method432(k);
  5386. atInventoryLoopCycle = 0;
  5387. atInventoryInterface = k;
  5388. atInventoryIndex = j;
  5389. atInventoryInterfaceType = 2;
  5390. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5391. atInventoryInterfaceType = 1;
  5392. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5393. atInventoryInterfaceType = 3;
  5394. }
  5395. if (l == 696) {
  5396. viewRotation = 0;
  5397. anInt1184 = 120;
  5398.  
  5399. }
  5400. if (l == 478) {
  5401. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5402. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  5403. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5404. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  5405. myPlayer.smallX[0], false,
  5406. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  5407. crossX = super.saveClickX;
  5408. crossY = super.saveClickY;
  5409. crossType = 2;
  5410. crossIndex = 0;
  5411. if ((i1 & 3) == 0)
  5412. anInt1155++;
  5413. if (anInt1155 >= 53) {
  5414. stream.createFrame(85);
  5415. stream.writeWordBigEndian(66);
  5416. anInt1155 = 0;
  5417. }
  5418. stream.createFrame(18);
  5419. stream.method431(i1);
  5420. }
  5421. }
  5422. if (l == 113) {
  5423. method66(i1, k, j);
  5424. stream.createFrame(70);
  5425. stream.method431(j + baseX);
  5426. stream.writeWord(k + baseY);
  5427. stream.method433(i1 >> 14 & 0x7fff);
  5428. }
  5429. if (l == 872) {
  5430. method66(i1, k, j);
  5431. stream.createFrame(234);
  5432. stream.method433(j + baseX);
  5433. stream.method432(i1 >> 14 & 0x7fff);
  5434. stream.method433(k + baseY);
  5435. }
  5436. if (l == 502) {
  5437. method66(i1, k, j);
  5438. stream.createFrame(132);
  5439. stream.method433(j + baseX);
  5440. stream.writeWord(i1 >> 14 & 0x7fff);
  5441. stream.method432(k + baseY);
  5442. }
  5443. if (l == 1125) {
  5444. ItemDef itemDef = ItemDef.forID(i1);
  5445. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5446. String s5;
  5447. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5448. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5449. else if (itemDef.description != null)
  5450. s5 = new String(itemDef.description);
  5451. else
  5452. s5 = "It's a " + itemDef.name + ".";
  5453. pushMessage(s5, 0, "");
  5454. }
  5455. if (l == 1130) {
  5456. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5457. if (class9_4 != null) {
  5458. class9_4.itemSearchSelectedId = class9_4.inv[j];
  5459. class9_4.itemSearchSelectedSlot = j;
  5460. RSInterface.selectedItemInterfaceId = class9_4.id;
  5461. }
  5462. }
  5463. if (l == 169) {
  5464. stream.createFrame(185);
  5465. stream.writeWord(k);
  5466. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5467. if (class9_3.valueIndexArray != null
  5468. && class9_3.valueIndexArray[0][0] == 5) {
  5469. int l2 = class9_3.valueIndexArray[0][1];
  5470. variousSettings[l2] = 1 - variousSettings[l2];
  5471. parseVariousSettings(l2);
  5472. needDrawTabArea = true;
  5473. }
  5474. }
  5475. if (l == 447) {
  5476. itemSelected = 1;
  5477. anInt1283 = j;
  5478. anInt1284 = k;
  5479. anInt1285 = i1;
  5480. selectedItemName = ItemDef.forID(i1).name;
  5481. spellSelected = 0;
  5482. needDrawTabArea = true;
  5483. return;
  5484. }
  5485. if (l == 1226) {
  5486. int j1 = i1 >> 14 & 0x7fff;
  5487. ObjectDef class46 = ObjectDef.forID(j1);
  5488. String s10;
  5489. if (class46.description != null)
  5490. s10 = new String(class46.description);
  5491. else
  5492. s10 = "It's a " + class46.name + ".";
  5493. pushMessage(s10, 0, "");
  5494. }
  5495. if (l == 244) {
  5496. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5497. myPlayer.smallX[0], false, j);
  5498. if (!flag7)
  5499. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5500. myPlayer.smallX[0], false, j);
  5501. crossX = super.saveClickX;
  5502. crossY = super.saveClickY;
  5503. crossType = 2;
  5504. crossIndex = 0;
  5505. stream.createFrame(253);
  5506. stream.method431(j + baseX);
  5507. stream.method433(k + baseY);
  5508. stream.method432(i1);
  5509. }
  5510. if (l == 1448) {
  5511. ItemDef itemDef_1 = ItemDef.forID(i1);
  5512. String s6;
  5513. if (itemDef_1.description != null)
  5514. s6 = new String(itemDef_1.description);
  5515. else
  5516. s6 = "It's a " + itemDef_1.name + ".";
  5517. pushMessage(s6, 0, "");
  5518. }
  5519. itemSelected = 0;
  5520. spellSelected = 0;
  5521. needDrawTabArea = true;
  5522.  
  5523. }
  5524.  
  5525. public void method70() {
  5526. anInt1251 = 0;
  5527. int j = (myPlayer.x >> 7) + baseX;
  5528. int k = (myPlayer.y >> 7) + baseY;
  5529. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5530. anInt1251 = 1;
  5531. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5532. anInt1251 = 1;
  5533. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5534. anInt1251 = 0;
  5535. }
  5536.  
  5537. @Override
  5538. public void run() {
  5539. if (drawFlames) {
  5540. drawFlames();
  5541. } else {
  5542. super.run();
  5543. }
  5544. }
  5545.  
  5546. private void build3dScreenMenu() {
  5547. if (itemSelected == 0 && spellSelected == 0) {
  5548. menuActionName[menuActionRow] = "Walk here";
  5549. menuActionID[menuActionRow] = 516;
  5550. menuActionCmd2[menuActionRow] = super.mouseX;
  5551. menuActionCmd3[menuActionRow] = super.mouseY;
  5552. menuActionRow++;
  5553. }
  5554. int j = -1;
  5555. for (int k = 0; k < Model.anInt1687; k++) {
  5556. int l = Model.anIntArray1688[k];
  5557. int i1 = l & 0x7f;
  5558. int j1 = l >> 7 & 0x7f;
  5559. int k1 = l >> 29 & 3;
  5560. int l1 = l >> 14 & 0x7fff;
  5561. if (l == j)
  5562. continue;
  5563. j = l;
  5564. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5565. ObjectDef class46 = ObjectDef.forID(l1);
  5566. if (class46.childrenIDs != null)
  5567. class46 = class46.method580();
  5568. if (class46 == null)
  5569. continue;
  5570. if (itemSelected == 1) {
  5571. menuActionName[menuActionRow] = "Use " + selectedItemName
  5572. + " with @cya@" + class46.name;
  5573. menuActionID[menuActionRow] = 62;
  5574. menuActionCmd1[menuActionRow] = l;
  5575. menuActionCmd2[menuActionRow] = i1;
  5576. menuActionCmd3[menuActionRow] = j1;
  5577. menuActionRow++;
  5578. } else if (spellSelected == 1) {
  5579. if ((spellUsableOn & 4) == 4) {
  5580. menuActionName[menuActionRow] = spellTooltip + " @cya@"
  5581. + class46.name;
  5582. menuActionID[menuActionRow] = 956;
  5583. menuActionCmd1[menuActionRow] = l;
  5584. menuActionCmd2[menuActionRow] = i1;
  5585. menuActionCmd3[menuActionRow] = j1;
  5586. menuActionRow++;
  5587. }
  5588. } else {
  5589. if (class46.actions != null) {
  5590. for (int i2 = 4; i2 >= 0; i2--)
  5591. if (class46.actions[i2] != null) {
  5592. menuActionName[menuActionRow] = class46.actions[i2]
  5593. + " @cya@" + class46.name;
  5594. if (i2 == 0)
  5595. menuActionID[menuActionRow] = 502;
  5596. if (i2 == 1)
  5597. menuActionID[menuActionRow] = 900;
  5598. if (i2 == 2)
  5599. menuActionID[menuActionRow] = 113;
  5600. if (i2 == 3)
  5601. menuActionID[menuActionRow] = 872;
  5602. if (i2 == 4)
  5603. menuActionID[menuActionRow] = 1062;
  5604. menuActionCmd1[menuActionRow] = l;
  5605. menuActionCmd2[menuActionRow] = i1;
  5606. menuActionCmd3[menuActionRow] = j1;
  5607. menuActionRow++;
  5608. }
  5609.  
  5610. }
  5611. menuActionName[menuActionRow] = "Examine @cya@"
  5612. + class46.name;
  5613. menuActionID[menuActionRow] = 1226;
  5614. menuActionCmd1[menuActionRow] = class46.type << 14;
  5615. menuActionCmd2[menuActionRow] = i1;
  5616. menuActionCmd3[menuActionRow] = j1;
  5617. menuActionRow++;
  5618. }
  5619. }
  5620. if (k1 == 1) {
  5621. NPC npc = npcArray[l1];
  5622. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64
  5623. && (npc.y & 0x7f) == 64) {
  5624. for (int j2 = 0; j2 < npcCount; j2++) {
  5625. NPC npc2 = npcArray[npcIndices[j2]];
  5626. if (npc2 != null && npc2 != npc
  5627. && npc2.desc.aByte68 == 1 && npc2.x == npc.x
  5628. && npc2.y == npc.y)
  5629. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5630. }
  5631.  
  5632. for (int l2 = 0; l2 < playerCount; l2++) {
  5633. Player player = playerArray[playerIndices[l2]];
  5634. if (player != null && player.x == npc.x
  5635. && player.y == npc.y)
  5636. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5637. }
  5638.  
  5639. }
  5640. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5641. }
  5642. if (k1 == 0) {
  5643. Player player = playerArray[l1];
  5644. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  5645. for (int k2 = 0; k2 < npcCount; k2++) {
  5646. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5647. if (class30_sub2_sub4_sub1_sub1_2 != null
  5648. && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1
  5649. && class30_sub2_sub4_sub1_sub1_2.x == player.x
  5650. && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  5651. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc,
  5652. npcIndices[k2], j1, i1);
  5653. }
  5654.  
  5655. for (int i3 = 0; i3 < playerCount; i3++) {
  5656. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5657. if (class30_sub2_sub4_sub1_sub2_2 != null
  5658. && class30_sub2_sub4_sub1_sub2_2 != player
  5659. && class30_sub2_sub4_sub1_sub2_2.x == player.x
  5660. && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  5661. buildAtPlayerMenu(i1, playerIndices[i3],
  5662. class30_sub2_sub4_sub1_sub2_2, j1);
  5663. }
  5664.  
  5665. }
  5666. buildAtPlayerMenu(i1, l1, player, j1);
  5667. }
  5668. if (k1 == 3) {
  5669. NodeList class19 = groundArray[plane][i1][j1];
  5670. if (class19 != null) {
  5671. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19
  5672. .getNext()) {
  5673. ItemDef itemDef = ItemDef.forID(item.ID);
  5674. if (itemSelected == 1) {
  5675. menuActionName[menuActionRow] = "Use "
  5676. + selectedItemName + " with @lre@"
  5677. + itemDef.name;
  5678. menuActionID[menuActionRow] = 511;
  5679. menuActionCmd1[menuActionRow] = item.ID;
  5680. menuActionCmd2[menuActionRow] = i1;
  5681. menuActionCmd3[menuActionRow] = j1;
  5682. menuActionRow++;
  5683. } else if (spellSelected == 1) {
  5684. if ((spellUsableOn & 1) == 1) {
  5685. menuActionName[menuActionRow] = spellTooltip
  5686. + " @lre@" + itemDef.name;
  5687. menuActionID[menuActionRow] = 94;
  5688. menuActionCmd1[menuActionRow] = item.ID;
  5689. menuActionCmd2[menuActionRow] = i1;
  5690. menuActionCmd3[menuActionRow] = j1;
  5691. menuActionRow++;
  5692. }
  5693. } else {
  5694. for (int j3 = 4; j3 >= 0; j3--)
  5695. if (itemDef.groundOptions != null
  5696. && itemDef.groundOptions[j3] != null) {
  5697. menuActionName[menuActionRow] = itemDef.groundOptions[j3]
  5698. + " @lre@" + itemDef.name;
  5699. if (j3 == 0)
  5700. menuActionID[menuActionRow] = 652;
  5701. if (j3 == 1)
  5702. menuActionID[menuActionRow] = 567;
  5703. if (j3 == 2)
  5704. menuActionID[menuActionRow] = 234;
  5705. if (j3 == 3)
  5706. menuActionID[menuActionRow] = 244;
  5707. if (j3 == 4)
  5708. menuActionID[menuActionRow] = 213;
  5709. menuActionCmd1[menuActionRow] = item.ID;
  5710. menuActionCmd2[menuActionRow] = i1;
  5711. menuActionCmd3[menuActionRow] = j1;
  5712. menuActionRow++;
  5713. } else if (j3 == 2) {
  5714. menuActionName[menuActionRow] = "Take @lre@"
  5715. + itemDef.name;
  5716. menuActionID[menuActionRow] = 234;
  5717. menuActionCmd1[menuActionRow] = item.ID;
  5718. menuActionCmd2[menuActionRow] = i1;
  5719. menuActionCmd3[menuActionRow] = j1;
  5720. menuActionRow++;
  5721. }
  5722.  
  5723. // menuActionName[menuActionRow] = "Examine @lre@" +
  5724. // itemDef.name + " @gre@(@whi@" + item.ID +
  5725. // "@gre@)";
  5726. menuActionName[menuActionRow] = "Examine @lre@"
  5727. + itemDef.name;
  5728. menuActionID[menuActionRow] = 1448;
  5729. menuActionCmd1[menuActionRow] = item.ID;
  5730. menuActionCmd2[menuActionRow] = i1;
  5731. menuActionCmd3[menuActionRow] = j1;
  5732. menuActionRow++;
  5733. }
  5734. }
  5735. }
  5736. }
  5737. }
  5738. }
  5739.  
  5740. @Override
  5741. public void cleanUpForQuit() {
  5742. signlink.reporterror = false;
  5743. try {
  5744. if (socketStream != null)
  5745. socketStream.close();
  5746. } catch (Exception _ex) {
  5747. }
  5748. socketStream = null;
  5749. stopMidi();
  5750. if (mouseDetection != null)
  5751. mouseDetection.running = false;
  5752. mouseDetection = null;
  5753. onDemandFetcher.disable();
  5754. onDemandFetcher = null;
  5755. aStream_834 = null;
  5756. stream = null;
  5757. aStream_847 = null;
  5758. inStream = null;
  5759. anIntArray1234 = null;
  5760. aByteArrayArray1183 = null;
  5761. aByteArrayArray1247 = null;
  5762. anIntArray1235 = null;
  5763. anIntArray1236 = null;
  5764. intGroundArray = null;
  5765. byteGroundArray = null;
  5766. worldController = null;
  5767. aClass11Array1230 = null;
  5768. anIntArrayArray901 = null;
  5769. anIntArrayArray825 = null;
  5770. bigX = null;
  5771. bigY = null;
  5772. aByteArray912 = null;
  5773. aRSImageProducer_1163 = null;
  5774. mapEdgeIP = null;
  5775. leftFrame = null;
  5776. topFrame = null;
  5777. rightFrame = null;
  5778. aRSImageProducer_1164 = null;
  5779. aRSImageProducer_1165 = null;
  5780. aRSImageProducer_1166 = null;
  5781. aRSImageProducer_1125 = null;
  5782. /* Null pointers for custom sprites */
  5783. multiOverlay = null;
  5784. chatArea = null;
  5785. chatButtons = null;
  5786. ORBS = null;
  5787. logIconH = null;
  5788. logIconC = null;
  5789. logIcon = null;
  5790. tabArea = null;
  5791. tabArea474 = null;
  5792. tabArea508 = null;
  5793. mapArea508 = null;
  5794. mapArea474 = null;
  5795. mapArea = null;
  5796. /**/
  5797. globe = null;
  5798. loginScreenArea = null;
  5799. magicAuto = null;
  5800. mapBack = null;
  5801. sideIcons = null;
  5802. redStones = null;
  5803. compass = null;
  5804. hitMarks = null;
  5805. headIcons = null;
  5806. skullIcons = null;
  5807. headIconsHint = null;
  5808. crosses = null;
  5809. mapDotItem = null;
  5810. mapDotNPC = null;
  5811. mapDotPlayer = null;
  5812. mapDotFriend = null;
  5813. mapScenes = null;
  5814. mapFunctions = null;
  5815. anIntArrayArray929 = null;
  5816. playerArray = null;
  5817. playerIndices = null;
  5818. anIntArray894 = null;
  5819. aStreamArray895s = null;
  5820. anIntArray840 = null;
  5821. npcArray = null;
  5822. npcIndices = null;
  5823. groundArray = null;
  5824. aClass19_1179 = null;
  5825. aClass19_1013 = null;
  5826. aClass19_1056 = null;
  5827. menuActionCmd2 = null;
  5828. menuActionCmd3 = null;
  5829. menuActionID = null;
  5830. menuActionCmd1 = null;
  5831. menuActionName = null;
  5832. variousSettings = null;
  5833. anIntArray1072 = null;
  5834. anIntArray1073 = null;
  5835. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5836. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5837. friendsList = null;
  5838. friendsListAsLongs = null;
  5839. friendsNodeIDs = null;
  5840. aRSImageProducer_1110 = null;
  5841. aRSImageProducer_1111 = null;
  5842. aRSImageProducer_1107 = null;
  5843. aRSImageProducer_1108 = null;
  5844. aRSImageProducer_1109 = null;
  5845. aRSImageProducer_1112 = null;
  5846. aRSImageProducer_1113 = null;
  5847. aRSImageProducer_1114 = null;
  5848. aRSImageProducer_1115 = null;
  5849. nullLoader();
  5850. ObjectDef.nullLoader();
  5851. EntityDef.nullLoader();
  5852. ItemDef.nullLoader();
  5853. Flo.cache = null;
  5854. IDK.cache = null;
  5855. RSInterface.interfaceCache = null;
  5856. DummyClass.cache = null;
  5857. Animation.anims = null;
  5858. SpotAnim.cache = null;
  5859. SpotAnim.aMRUNodes_415 = null;
  5860. Varp.cache = null;
  5861. super.fullGameScreen = null;
  5862. Player.mruNodes = null;
  5863. Texture.nullLoader();
  5864. WorldController.nullLoader();
  5865. Model.nullLoader();
  5866. Class36.nullLoader();
  5867. System.gc();
  5868. }
  5869.  
  5870. public void printDebug() {
  5871. System.out.println("============");
  5872. System.out.println("flame-cycle:" + anInt1208);
  5873. if (onDemandFetcher != null)
  5874. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5875. System.out.println("loop-cycle:" + loopCycle);
  5876. System.out.println("draw-cycle:" + anInt1061);
  5877. System.out.println("ptype:" + pktType);
  5878. System.out.println("psize:" + pktSize);
  5879. if (socketStream != null)
  5880. socketStream.printDebug();
  5881. super.shouldDebug = true;
  5882. }
  5883.  
  5884. @Override
  5885. Component getGameComponent() {
  5886. if (signlink.mainapp != null)
  5887. return signlink.mainapp;
  5888. if (super.gameFrame != null)
  5889. return super.gameFrame;
  5890. else
  5891. return this;
  5892. }
  5893.  
  5894. public void pmTabToReply() {
  5895. String name = null;
  5896. for (int k = 0; k < 100; k++) {
  5897. if (chatMessages[k] == null) {
  5898. continue;
  5899. }
  5900. int l = chatTypes[k];
  5901. if (l == 3 || l == 7) {
  5902. name = chatNames[k];
  5903. break;
  5904. }
  5905. }
  5906.  
  5907. if (name == null) {
  5908. pushMessage(
  5909. "You haven't received any messages to which you can reply.",
  5910. 0, "");
  5911. return;
  5912. }
  5913.  
  5914. if (name.startsWith("@cr")) {
  5915. name = name.substring(5);
  5916. }
  5917.  
  5918. long nameAsLong = TextClass.longForName(name.trim());
  5919. int k3 = -1;
  5920. for (int i4 = 0; i4 < friendsCount; i4++) {
  5921. if (friendsListAsLongs[i4] != nameAsLong)
  5922. continue;
  5923. k3 = i4;
  5924. break;
  5925. }
  5926.  
  5927. if (k3 != -1) {
  5928. if (friendsNodeIDs[k3] > 0) {
  5929. inputTaken = true;
  5930. inputDialogState = 0;
  5931. messagePromptRaised = true;
  5932. promptInput = "";
  5933. friendsListAction = 3;
  5934. aLong953 = friendsListAsLongs[k3];
  5935. aString1121 = "Enter message to send to " + friendsList[k3];
  5936. } else {
  5937. pushMessage("That player is currently offline.", 0, "");
  5938. }
  5939. }
  5940. }
  5941.  
  5942. private void method73() {
  5943. do {
  5944. int j = readChar(-796);
  5945. if (j == -1)
  5946. break;
  5947. if (openInterfaceID != -1
  5948. && openInterfaceID == reportAbuseInterfaceID) {
  5949. if (j == 8 && reportAbuseInput.length() > 0)
  5950. reportAbuseInput = reportAbuseInput.substring(0,
  5951. reportAbuseInput.length() - 1);
  5952. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48
  5953. && j <= 57 || j == 32)
  5954. && reportAbuseInput.length() < 12)
  5955. reportAbuseInput += (char) j;
  5956. } else if (messagePromptRaised) {
  5957. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  5958. promptInput += (char) j;
  5959. inputTaken = true;
  5960. }
  5961. if (j == 8 && promptInput.length() > 0) {
  5962. promptInput = promptInput.substring(0,
  5963. promptInput.length() - 1);
  5964. inputTaken = true;
  5965. }
  5966. if (j == 13 || j == 10) {
  5967. messagePromptRaised = false;
  5968. inputTaken = true;
  5969. if (friendsListAction == 1) {
  5970. long l = TextClass.longForName(promptInput);
  5971. addFriend(l);
  5972. }
  5973. if (friendsListAction == 2 && friendsCount > 0) {
  5974. long l1 = TextClass.longForName(promptInput);
  5975. delFriend(l1);
  5976. }
  5977. if (friendsListAction == 3 && promptInput.length() > 0) {
  5978. stream.createFrame(126);
  5979. stream.writeWordBigEndian(0);
  5980. int k = stream.currentOffset;
  5981. stream.writeQWord(aLong953);
  5982. TextInput.method526(promptInput, stream);
  5983. stream.writeBytes(stream.currentOffset - k);
  5984. promptInput = TextInput.processText(promptInput);
  5985. // promptInput = Censor.doCensor(promptInput);
  5986. pushMessage(promptInput, 6, TextClass.fixName(TextClass
  5987. .nameForLong(aLong953)));
  5988. if (privateChatMode == 2) {
  5989. privateChatMode = 1;
  5990. stream.createFrame(95);
  5991. stream.writeWordBigEndian(publicChatMode);
  5992. stream.writeWordBigEndian(privateChatMode);
  5993. stream.writeWordBigEndian(tradeMode);
  5994. }
  5995. }
  5996. if (friendsListAction == 4 && ignoreCount < 100) {
  5997. long l2 = TextClass.longForName(promptInput);
  5998. addIgnore(l2);
  5999. }
  6000. if (friendsListAction == 5 && ignoreCount > 0) {
  6001. long l3 = TextClass.longForName(promptInput);
  6002. delIgnore(l3);
  6003. }
  6004. // clan chat
  6005. if (friendsListAction == 6) {
  6006. sendStringAsLong(promptInput);
  6007. } else if (friendsListAction == 8) {
  6008. sendString(1, promptInput);
  6009. } else if (friendsListAction == 9) {
  6010. sendString(2, promptInput);
  6011. } else if (friendsListAction == 10) {
  6012. sendString(3, promptInput);
  6013. }
  6014. }
  6015. } else if (inputDialogState == 1) {
  6016. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6017. amountOrNameInput += (char) j;
  6018. inputTaken = true;
  6019. }
  6020. if ((!amountOrNameInput.toLowerCase().contains("k")
  6021. && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput
  6022. .toLowerCase().contains("b"))
  6023. && (j == 107 || j == 109)
  6024. || j == 98) {
  6025. amountOrNameInput += (char) j;
  6026. inputTaken = true;
  6027. }
  6028. if (j == 8 && amountOrNameInput.length() > 0) {
  6029. amountOrNameInput = amountOrNameInput.substring(0,
  6030. amountOrNameInput.length() - 1);
  6031. inputTaken = true;
  6032. }
  6033. if (j == 13 || j == 10) {
  6034. if (amountOrNameInput.length() > 0) {
  6035. if (amountOrNameInput.toLowerCase().contains("k")) {
  6036. amountOrNameInput = amountOrNameInput.replaceAll(
  6037. "k", "000");
  6038. } else if (amountOrNameInput.toLowerCase()
  6039. .contains("m")) {
  6040. amountOrNameInput = amountOrNameInput.replaceAll(
  6041. "m", "000000");
  6042. } else if (amountOrNameInput.toLowerCase()
  6043. .contains("b")) {
  6044. amountOrNameInput = amountOrNameInput.replaceAll(
  6045. "b", "000000000");
  6046. }
  6047. int i1 = 0;
  6048. try {
  6049. i1 = Integer.parseInt(amountOrNameInput);
  6050. } catch (Exception _ex) {
  6051. }
  6052. stream.createFrame(208);
  6053. stream.writeDWord(i1);
  6054. modifiableXValue = i1;
  6055. }
  6056. inputDialogState = 0;
  6057. inputTaken = true;
  6058. }
  6059. } else if (inputDialogState == 2) {
  6060. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6061. amountOrNameInput += (char) j;
  6062. inputTaken = true;
  6063. }
  6064. if (j == 8 && amountOrNameInput.length() > 0) {
  6065. amountOrNameInput = amountOrNameInput.substring(0,
  6066. amountOrNameInput.length() - 1);
  6067. inputTaken = true;
  6068. }
  6069. if (j == 13 || j == 10) {
  6070. if (amountOrNameInput.length() > 0) {
  6071. stream.createFrame(60);
  6072. stream.writeQWord(TextClass
  6073. .longForName(amountOrNameInput));
  6074. }
  6075. inputDialogState = 0;
  6076. inputTaken = true;
  6077. }
  6078. } else if (backDialogID == -1) {
  6079. if (this.isFieldInFocus()) {
  6080. RSInterface rsi = this.getInputFieldFocusOwner();
  6081. if (rsi == null) {
  6082. return;
  6083. }
  6084. if (j >= 32 && j <= 122
  6085. && rsi.message.length() < rsi.characterLimit) {
  6086. if (rsi.inputRegex.length() > 0) {
  6087. Pattern regex = Pattern.compile(rsi.inputRegex);
  6088. Matcher match = regex.matcher(Character
  6089. .toString(((char) j)));
  6090. if (match.matches()) {
  6091. rsi.message += (char) j;
  6092. inputTaken = true;
  6093. }
  6094. } else {
  6095. rsi.message += (char) j;
  6096. inputTaken = true;
  6097. }
  6098. }
  6099. if (j == 8 && rsi.message.length() > 0) {
  6100. rsi.message = rsi.message.substring(0,
  6101. rsi.message.length() - 1);
  6102. inputTaken = true;
  6103. }
  6104. if (rsi.isItemSearchComponent && rsi.message.length() > 2
  6105. && rsi.defaultInputFieldText.equals("Name")) {
  6106. RSInterface subcomponent = RSInterface.interfaceCache[rsi.id + 2];
  6107. RSInterface scroll = RSInterface.interfaceCache[rsi.id + 4];
  6108. RSInterface toggle = RSInterface.interfaceCache[rsi.id + 9];
  6109. scroll.itemSearchSelectedId = 0;
  6110. scroll.itemSearchSelectedSlot = -1;
  6111. RSInterface.selectedItemInterfaceId = 0;
  6112. rsi.itemSearchSelectedSlot = -1;
  6113. rsi.itemSearchSelectedId = 0;
  6114.  
  6115. if (subcomponent != null && scroll != null
  6116. && toggle != null
  6117. && toggle.valueIndexArray != null) {
  6118. int[] results = ItemDef
  6119. .getResults(
  6120. rsi.message.toLowerCase(),
  6121. 60,
  6122. variousSettings[toggle.valueIndexArray[0][1]] == toggle.anIntArray212[0] ? true
  6123. : false);
  6124. if (subcomponent != null) {
  6125. int position = 0;
  6126. int length = subcomponent.inv.length;
  6127. subcomponent.inv = new int[length];
  6128. subcomponent.invStackSizes = new int[subcomponent.inv.length];
  6129. for (int result : results) {
  6130. if (result > 0) {
  6131. subcomponent.inv[position] = result + 1;
  6132. subcomponent.invStackSizes[position] = 1;
  6133. position++;
  6134. }
  6135. }
  6136. }
  6137. }
  6138. } else if (rsi.updatesEveryInput && rsi.message.length() > 0 && j != 10 && j != 13) {
  6139. stream.createFrame(142);
  6140. stream.writeWordBigEndian(4 + rsi.message.length() + 1);
  6141. stream.writeDWord(rsi.id);
  6142. stream.writeString(rsi.message);
  6143. inputString = "";
  6144. promptInput = "";
  6145. break;
  6146. } else if ((j == 10 || j == 13) && rsi.message.length() > 0 && !rsi.updatesEveryInput) {
  6147. stream.createFrame(142);
  6148. stream.writeWordBigEndian(4 + rsi.message.length() + 1);
  6149. stream.writeDWord(rsi.id);
  6150. stream.writeString(rsi.message);
  6151. inputString = "";
  6152. promptInput = "";
  6153. break;
  6154. }
  6155. } else {
  6156. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  6157. inputString += (char) j;
  6158. inputTaken = true;
  6159. }
  6160. if (j == 8 && inputString.length() > 0) {
  6161. inputString = inputString.substring(0,
  6162. inputString.length() - 1);
  6163. inputTaken = true;
  6164. }
  6165. if (j == 9)
  6166. pmTabToReply();
  6167. if (inputString.equals("::packrsi") && (j == 13 || j == 10)) {
  6168. Interfaces.loadInterfaces();
  6169. this.pushMessage("Reloaded interface configurations.",
  6170. 0, "");
  6171. }
  6172. if (inputString.startsWith("::nullrsi")
  6173. && (j == 13 || j == 10)) {
  6174. int id = 0;
  6175. int offset = 0;
  6176. String[] data = null;
  6177. try {
  6178. data = inputString.split(" ");
  6179. id = Integer.parseInt(data[1]);
  6180. offset = Integer.parseInt(data[2]);
  6181. if (id <= 0 || offset <= 0) {
  6182. pushMessage(
  6183. "Identification value and or offset is negative.",
  6184. 0, "");
  6185. } else if (id + offset > RSInterface.interfaceCache.length - 1) {
  6186. pushMessage(
  6187. "The total sum of the id and offset are greater than the size of the cache.",
  6188. 0, "");
  6189. } else {
  6190. Collection<Integer> nullList = new ArrayList<>(
  6191. offset);
  6192. for (int interfaceId = id; interfaceId < id
  6193. + offset; interfaceId++) {
  6194. RSInterface rsi = RSInterface.interfaceCache[interfaceId];
  6195. if (rsi == null) {
  6196. nullList.add(interfaceId);
  6197. }
  6198. }
  6199. pushMessage(
  6200. "There are a total of "
  6201. + nullList.size() + "/"
  6202. + offset
  6203. + " null interfaces from " + id
  6204. + " to " + (id + offset) + ".",
  6205. 0, "");
  6206. }
  6207. } catch (ArrayIndexOutOfBoundsException
  6208. | NumberFormatException exception) {
  6209.  
  6210. }
  6211. }
  6212. if ((j == 13 || j == 10) && inputString.length() > 0) {
  6213. if (myPrivilege >= 2 && myPrivilege <= 5) {
  6214. if (inputString.startsWith("//setspecto")) {
  6215. int amt = Integer.parseInt(inputString
  6216. .substring(12));
  6217. anIntArray1045[300] = amt;
  6218. if (variousSettings[300] != amt) {
  6219. variousSettings[300] = amt;
  6220. parseVariousSettings(300);
  6221. needDrawTabArea = true;
  6222. if (dialogID != -1)
  6223. inputTaken = true;
  6224. }
  6225. }
  6226. if (inputString.equals("clientdrop"))
  6227. dropClient();
  6228. if (inputString.startsWith("full")) {
  6229. try {
  6230. String[] args = inputString.split(" ");
  6231. int id1 = Integer.parseInt(args[1]);
  6232. int id2 = Integer.parseInt(args[2]);
  6233. fullscreenInterfaceID = id1;
  6234. openInterfaceID = id2;
  6235. pushMessage("Opened Interface", 0, "");
  6236. } catch (Exception e) {
  6237. pushMessage("Interface Failed to load", 0,
  6238. "");
  6239. }
  6240. }
  6241. if (inputString.equals("::lag"))
  6242. printDebug();
  6243. if (inputString.equals("::prefetchmusic")) {
  6244. for (int j1 = 0; j1 < onDemandFetcher
  6245. .getVersionCount(2); j1++)
  6246. onDemandFetcher.method563((byte) 1, 2, j1);
  6247.  
  6248. }
  6249. /*
  6250. * if (inputString.equals("::maps")) addMaps(); if
  6251. * (inputString.equals("::models")) addModels();
  6252. */
  6253. /*
  6254. * if (inputString.equals("::noclip")) { for (int k1
  6255. * = 0; k1 < 4; k1++) { for (int i2 = 1; i2 < 103;
  6256. * i2++) { for (int k2 = 1; k2 < 103; k2++)
  6257. * aClass11Array1230[k1].anIntArrayArray294[i2][k2]
  6258. * = 0;
  6259. *
  6260. * } } }
  6261. */
  6262. }
  6263.  
  6264.  
  6265. /* if (inputString.equals("add model")) { try { int
  6266. ModelIndex = Integer.parseInt(JOptionPane
  6267. .showInputDialog(this, "Enter model ID", "Model",
  6268. 3)); byte[] abyte0 = getModel(ModelIndex); if (abyte0
  6269. != null && abyte0.length > 0) {
  6270. decompressors[1].method234(abyte0.length, abyte0,
  6271. ModelIndex); pushMessage("Model: [" + ModelIndex +
  6272. "] added successfully!", 0, ""); } else {
  6273. pushMessage("Unable to find the model. " +
  6274. ModelIndex, 0, ""); } } catch (Exception e) {
  6275. pushMessage("Syntax - ::add model <path>", 0, ""); }
  6276. }*/
  6277.  
  6278. if (inputString.equals("::orbs")) {
  6279. OSOrbs = !OSOrbs;
  6280. pushMessage("You haved toggled Orbs", 0, "");
  6281. needDrawTabArea = true;
  6282. try {
  6283. writeSettings();
  6284. } catch (IOException e) {
  6285. e.printStackTrace();
  6286. }
  6287. }
  6288. if (inputString.equals("::fpson"))
  6289. fpsOn = true;
  6290. if (inputString.equals("::fpsoff"))
  6291. fpsOn = false;
  6292. if (inputString.equals("::dataon"))
  6293. clientData = true;
  6294. if (inputString.equals("::dataoff"))
  6295. clientData = false;
  6296. if (inputString.equals("::counter")) {
  6297. OSCounter = !OSCounter;
  6298. pushMessage("You haved toggled the counter", 0, "");
  6299. needDrawTabArea = true;
  6300. try {
  6301. writeSettings();
  6302. } catch (IOException e) {
  6303. e.printStackTrace();
  6304. }
  6305. }
  6306. if (inputString.equals("::hotkeys")) {
  6307. RSApplet.hotKeyToggle = !RSApplet.hotKeyToggle;
  6308. pushMessage("You haved toggled your hotkeys", 0, "");
  6309. needDrawTabArea = true;
  6310. try {
  6311. writeSettings();
  6312. } catch (IOException e) {
  6313. e.printStackTrace();
  6314. }
  6315. }
  6316. /*
  6317. * if (inputString.equals("::474")) { revision474 =
  6318. * true; revision498 = false; revision508 = false;
  6319. * pushMessage("You have toggled the 474 Gameframe", 0,
  6320. * ""); needDrawTabArea = true; } if
  6321. * (inputString.equals("::498")) { revision474 = false;
  6322. * revision498 = true; revision508 = false;
  6323. * pushMessage("You have toggled the 498 Gameframe", 0,
  6324. * ""); needDrawTabArea = true; }
  6325. */
  6326. if (inputString.startsWith("::testb")) {
  6327. pushMessage("broadcast flag: " + broadcastUpdate, 0, "");
  6328. pushMessage("message: [" + broadcast + "]", 0, "");
  6329. pushMessage("anInt1104: " + anInt1104, 0, "");
  6330. }
  6331. if (inputString.startsWith("::chath")) {
  6332. pushMessage("keyInput: " + keyInput, 0, "");
  6333. pushMessage("lastChat: [" + chatHistory.size() + "]", 0, "");
  6334. }
  6335. if (inputString.startsWith("::modelsitem"))
  6336. pushMessage(ItemDef.itemModels(Integer
  6337. .parseInt(inputString.substring(13))), 0,
  6338. "");
  6339. if (inputString.equals("::hd")) {
  6340. setHighMem();
  6341. method22();
  6342. }
  6343. if (inputString.equals("::ld")) {
  6344. setLowMem();
  6345. method22();
  6346. }
  6347. /*
  6348. * if (inputString.equals("::gameframe")) { if
  6349. * (revision474 == true) { revision474 = false;
  6350. * revision498 = true;
  6351. * pushMessage("You have toggled on the 525 Gameframe",
  6352. * 0, ""); needDrawTabArea = true; try {
  6353. * writeSettings(); } catch (IOException e) {
  6354. * e.printStackTrace(); } } else { revision474 = true;
  6355. * revision498 = false;
  6356. * pushMessage("You have toggled on the 474 Gameframe",
  6357. * 0, ""); needDrawTabArea = true; try {
  6358. * writeSettings(); } catch (IOException e) {
  6359. * e.printStackTrace(); } } }
  6360. */
  6361. if (inputString.startsWith("::")) {
  6362. stream.createFrame(103);
  6363. stream.writeWordBigEndian(inputString.length() - 1);
  6364. stream.writeString(inputString.substring(2));
  6365. } else if (inputString.startsWith("/")) {
  6366. stream.createFrame(103);
  6367. stream.writeWordBigEndian(inputString.length() + 1);
  6368. stream.writeString(inputString);
  6369. } else {
  6370. String s = inputString.toLowerCase();
  6371. int j2 = 0;
  6372. if (s.startsWith("yellow:")) {
  6373. j2 = 0;
  6374. inputString = inputString.substring(7);
  6375. } else if (s.startsWith("red:")) {
  6376. j2 = 1;
  6377. inputString = inputString.substring(4);
  6378. } else if (s.startsWith("green:")) {
  6379. j2 = 2;
  6380. inputString = inputString.substring(6);
  6381. } else if (s.startsWith("cyan:")) {
  6382. j2 = 3;
  6383. inputString = inputString.substring(5);
  6384. } else if (s.startsWith("purple:")) {
  6385. j2 = 4;
  6386. inputString = inputString.substring(7);
  6387. } else if (s.startsWith("white:")) {
  6388. j2 = 5;
  6389. inputString = inputString.substring(6);
  6390. } else if (s.startsWith("flash1:")) {
  6391. j2 = 6;
  6392. inputString = inputString.substring(7);
  6393. } else if (s.startsWith("flash2:")) {
  6394. j2 = 7;
  6395. inputString = inputString.substring(7);
  6396. } else if (s.startsWith("flash3:")) {
  6397. j2 = 8;
  6398. inputString = inputString.substring(7);
  6399. } else if (s.startsWith("glow1:")) {
  6400. j2 = 9;
  6401. inputString = inputString.substring(6);
  6402. } else if (s.startsWith("glow2:")) {
  6403. j2 = 10;
  6404. inputString = inputString.substring(6);
  6405. } else if (s.startsWith("glow3:")) {
  6406. j2 = 11;
  6407. inputString = inputString.substring(6);
  6408. }
  6409. s = inputString.toLowerCase();
  6410. int i3 = 0;
  6411. if (s.startsWith("wave:")) {
  6412. i3 = 1;
  6413. inputString = inputString.substring(5);
  6414. } else if (s.startsWith("wave2:")) {
  6415. i3 = 2;
  6416. inputString = inputString.substring(6);
  6417. } else if (s.startsWith("shake:")) {
  6418. i3 = 3;
  6419. inputString = inputString.substring(6);
  6420. } else if (s.startsWith("scroll:")) {
  6421. i3 = 4;
  6422. inputString = inputString.substring(7);
  6423. } else if (s.startsWith("slide:")) {
  6424. i3 = 5;
  6425. inputString = inputString.substring(6);
  6426. }
  6427. stream.createFrame(4);
  6428. stream.writeWordBigEndian(0);
  6429. int j3 = stream.currentOffset;
  6430. stream.method425(i3);
  6431. stream.method425(j2);
  6432. aStream_834.currentOffset = 0;
  6433. TextInput.method526(inputString, aStream_834);
  6434. stream.method441(0, aStream_834.buffer,
  6435. aStream_834.currentOffset);
  6436. stream.writeBytes(stream.currentOffset - j3);
  6437. inputString = TextInput.processText(inputString);
  6438. // inputString = Censor.doCensor(inputString);
  6439. myPlayer.textSpoken = inputString;
  6440. myPlayer.anInt1513 = j2;
  6441. myPlayer.anInt1531 = i3;
  6442. myPlayer.textCycle = 150;
  6443. String cr = "";
  6444. if (myPrivilege == 11)
  6445. cr = "@cr11@";
  6446. if (myPrivilege == 10)
  6447. cr = "@cr10@";
  6448. if (myPrivilege == 9)
  6449. cr = "@cr9@";
  6450. if (myPrivilege == 8)
  6451. cr = "@cr8@";
  6452. if (myPrivilege == 7)
  6453. cr = "@cr7@";
  6454. if (myPrivilege == 6)
  6455. cr = "@cr6@";
  6456. if (myPrivilege == 5)
  6457. cr = "@cr5@";
  6458. if (myPrivilege == 4)
  6459. cr = "@cr4@";
  6460. if (myPrivilege == 3)
  6461. cr = "@cr3@";
  6462. if (myPrivilege == 2)
  6463. cr = "@cr2@";
  6464. if (myPrivilege == 1)
  6465. cr = "@cr1@";
  6466. if (myPlayer.title.length() > 0) {
  6467. pushMessage(myPlayer.textSpoken, 2, cr + "<col="+ myPlayer.titleColor + "> "+ myPlayer.title + "</col> " + myPlayer.name);
  6468. } else {
  6469. pushMessage(myPlayer.textSpoken, 2, cr + myPlayer.name);
  6470. }
  6471. if (publicChatMode == 2) {
  6472. publicChatMode = 3;
  6473. stream.createFrame(95);
  6474. stream.writeWordBigEndian(publicChatMode);
  6475. stream.writeWordBigEndian(privateChatMode);
  6476. stream.writeWordBigEndian(tradeMode);
  6477. }
  6478. }
  6479. incrementChatHistory(inputString);
  6480. inputString = "";
  6481. inputTaken = true;
  6482. }
  6483. }
  6484. }
  6485. } while (true);
  6486. }
  6487.  
  6488. /*
  6489. * An arraylist containing chat history elements.
  6490. */
  6491. public static ArrayList<String> chatHistory = new ArrayList<String>();
  6492.  
  6493. /**
  6494. * Increments the user's chat history with the specified string.
  6495. * @param input
  6496. */
  6497. private void incrementChatHistory(String input) {
  6498. if (myPrivilege == 3 || myPrivilege == 2) {
  6499. if (chatHistory.size() > 26) {
  6500. chatHistory.remove(0);
  6501. chatHistory.set(chatHistory.size() - 2, chatHistory.get(chatHistory.size() - 2));
  6502. }
  6503. chatHistory.add(input);
  6504. keyInput = chatHistory.size();
  6505. }
  6506. }
  6507.  
  6508. private void buildPublicChat(int j) {
  6509. int l = 0;
  6510. for (int i1 = 0; i1 < 500; i1++) {
  6511. if (chatMessages[i1] == null)
  6512. continue;
  6513. if (chatTypeView != 1)
  6514. continue;
  6515. int j1 = chatTypes[i1];
  6516. String s = chatNames[i1];
  6517. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6518. if (k1 < -23)
  6519. break;
  6520. if (s != null && s.startsWith("@cr"))
  6521. s = s.substring(5);
  6522. if (s != null && s.startsWith("<col=")) {
  6523. s = s.substring(s.indexOf("</col>") + 6);
  6524. }
  6525. if (s != null && s.startsWith("@cr1@"))
  6526. s = s.substring(5);
  6527. if (s != null && s.startsWith("@cr2@"))
  6528. s = s.substring(5);
  6529. if (s != null && s.startsWith("@cr3@"))
  6530. s = s.substring(5);
  6531. if (s != null && s.startsWith("@cr4@"))
  6532. s = s.substring(5);
  6533. if (s != null && s.startsWith("@cr5@"))
  6534. s = s.substring(5);
  6535. if (s != null && s.startsWith("@cr6@"))
  6536. s = s.substring(5);
  6537. if (s != null && s.startsWith("@cr7@"))
  6538. s = s.substring(5);
  6539. if (s != null && s.startsWith("@cr8@"))
  6540. s = s.substring(5);
  6541. if (s != null && s.startsWith("@cr9@"))
  6542. s = s.substring(5);
  6543. if (s != null && s.startsWith("@cr10@"))
  6544. s = s.substring(6);
  6545. if (s != null && s.startsWith("@cr11@"))
  6546. s = s.substring(6);
  6547. if ((j1 == 1 || j1 == 2)
  6548. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6549. && isFriendOrSelf(s))) {
  6550. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6551. if (myPrivilege >= 1) {
  6552. menuActionName[menuActionRow] = "Report abuse @whi@"
  6553. + s;
  6554. menuActionID[menuActionRow] = 606;
  6555. menuActionRow++;
  6556. }
  6557. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6558. menuActionID[menuActionRow] = 42;
  6559. menuActionRow++;
  6560. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6561. menuActionID[menuActionRow] = 337;
  6562. menuActionRow++;
  6563. }
  6564. l++;
  6565. }
  6566. }
  6567. }
  6568.  
  6569. private void buildFriendChat(int j) {
  6570. int l = 0;
  6571. for (int i1 = 0; i1 < 500; i1++) {
  6572. if (chatMessages[i1] == null)
  6573. continue;
  6574. if (chatTypeView != 2)
  6575. continue;
  6576. int j1 = chatTypes[i1];
  6577. String s = chatNames[i1];
  6578. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6579. if (k1 < -23)
  6580. break;
  6581. if (s != null && s.startsWith("@cr1@"))
  6582. s = s.substring(5);
  6583. if (s != null && s.startsWith("@cr2@"))
  6584. s = s.substring(5);
  6585. if (s != null && s.startsWith("@cr3@"))
  6586. s = s.substring(5);
  6587. if (s != null && s.startsWith("@cr4@"))
  6588. s = s.substring(5);
  6589. if (s != null && s.startsWith("@cr5@"))
  6590. s = s.substring(5);
  6591. if (s != null && s.startsWith("@cr6@"))
  6592. s = s.substring(5);
  6593. if (s != null && s.startsWith("@cr7@"))
  6594. s = s.substring(5);
  6595. if (s != null && s.startsWith("@cr8@"))
  6596. s = s.substring(5);
  6597. if (s != null && s.startsWith("@cr9@"))
  6598. s = s.substring(5);
  6599. if (s != null && s.startsWith("@cr10@"))
  6600. s = s.substring(6);
  6601. if (s != null && s.startsWith("@cr11@"))
  6602. s = s.substring(6);
  6603. if ((j1 == 5 || j1 == 6)
  6604. && (splitPrivateChat == 0 || chatTypeView == 2)
  6605. && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1
  6606. && isFriendOrSelf(s)))
  6607. l++;
  6608. if ((j1 == 3 || j1 == 7)
  6609. && (splitPrivateChat == 0 || chatTypeView == 2)
  6610. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6611. && isFriendOrSelf(s))) {
  6612. if (j > k1 - 14 && j <= k1) {
  6613. if (myPrivilege >= 1) {
  6614. menuActionName[menuActionRow] = "Report abuse @whi@"
  6615. + s;
  6616. menuActionID[menuActionRow] = 606;
  6617. menuActionRow++;
  6618. }
  6619. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6620. menuActionID[menuActionRow] = 42;
  6621. menuActionRow++;
  6622. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6623. menuActionID[menuActionRow] = 337;
  6624. menuActionRow++;
  6625. }
  6626. l++;
  6627. }
  6628. }
  6629. }
  6630.  
  6631. private void buildDuelorTrade(int j) {
  6632. int l = 0;
  6633. for (int i1 = 0; i1 < 500; i1++) {
  6634. if (chatMessages[i1] == null)
  6635. continue;
  6636. if (chatTypeView != 3 && chatTypeView != 4)
  6637. continue;
  6638. int j1 = chatTypes[i1];
  6639. String s = chatNames[i1];
  6640. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6641. if (k1 < -23)
  6642. break;
  6643. if (s != null && s.startsWith("@cr1@"))
  6644. s = s.substring(5);
  6645. if (s != null && s.startsWith("@cr2@"))
  6646. s = s.substring(5);
  6647. if (s != null && s.startsWith("@cr3@"))
  6648. s = s.substring(5);
  6649. if (s != null && s.startsWith("@cr4@"))
  6650. s = s.substring(5);
  6651. if (s != null && s.startsWith("@cr5@"))
  6652. s = s.substring(5);
  6653. if (s != null && s.startsWith("@cr6@"))
  6654. s = s.substring(5);
  6655. if (s != null && s.startsWith("@cr7@"))
  6656. s = s.substring(5);
  6657. if (s != null && s.startsWith("@cr8@"))
  6658. s = s.substring(5);
  6659. if (s != null && s.startsWith("@cr9@"))
  6660. s = s.substring(5);
  6661. if (s != null && s.startsWith("@cr10@"))
  6662. s = s.substring(6);
  6663. if (s != null && s.startsWith("@cr11@"))
  6664. s = s.substring(6);
  6665. if (chatTypeView == 3 && j1 == 4
  6666. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6667. if (j > k1 - 14 && j <= k1) {
  6668. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6669. menuActionID[menuActionRow] = 484;
  6670. menuActionRow++;
  6671. }
  6672. l++;
  6673. }
  6674. if (chatTypeView == 4 && j1 == 8
  6675. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6676. if (j > k1 - 14 && j <= k1) {
  6677. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6678. + s;
  6679. menuActionID[menuActionRow] = 6;
  6680. menuActionRow++;
  6681. }
  6682. l++;
  6683. }
  6684. if (j1 == 12) {
  6685. if (j > k1 - 14 && j <= k1) {
  6686. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6687. menuActionID[menuActionRow] = 915;
  6688. menuActionRow++;
  6689. }
  6690. l++;
  6691. }
  6692. }
  6693. }
  6694.  
  6695. private void buildChatAreaMenu(int j) {
  6696. int l = 0;
  6697. for (int i1 = 0; i1 < 500; i1++) {
  6698. if (chatMessages[i1] == null)
  6699. continue;
  6700. int j1 = chatTypes[i1];
  6701. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6702. if (k1 < -23)
  6703. break;
  6704. String s = chatNames[i1];
  6705. if (chatTypeView == 1) {
  6706. buildPublicChat(j);
  6707. break;
  6708. }
  6709. if (chatTypeView == 2) {
  6710. buildFriendChat(j);
  6711. break;
  6712. }
  6713. if (chatTypeView == 3 || chatTypeView == 4) {
  6714. buildDuelorTrade(j);
  6715. break;
  6716. }
  6717. if (chatTypeView == 5) {
  6718. break;
  6719. }
  6720. if (s != null && s.startsWith("@cr1@")) {
  6721. s = s.substring(5);
  6722. }
  6723. if (s != null && s.startsWith("@cr2@")) {
  6724. s = s.substring(5);
  6725. }
  6726. if (s != null && s.startsWith("@cr3@")) {
  6727. s = s.substring(5);
  6728. }
  6729. if (s != null && s.startsWith("@cr4@")) {
  6730. s = s.substring(5);
  6731. }
  6732. if (s != null && s.startsWith("@cr5@")) {
  6733. s = s.substring(5);
  6734. }
  6735. if (s != null && s.startsWith("@cr6@")) {
  6736. s = s.substring(5);
  6737. }
  6738. if (s != null && s.startsWith("@cr7@")) {
  6739. s = s.substring(5);
  6740. }
  6741. if (s != null && s.startsWith("@cr8@")) {
  6742. s = s.substring(5);
  6743. }
  6744. if (s != null && s.startsWith("@cr9@")) {
  6745. s = s.substring(5);
  6746. }
  6747. if (s != null && s.startsWith("@cr10@")) {
  6748. s = s.substring(6);
  6749. }
  6750. if (s != null && s.startsWith("@cr11@")) {
  6751. s = s.substring(6);
  6752. }
  6753. if (s != null && s.startsWith("<col=")) {
  6754. s = s.substring(s.indexOf("</col>") + 6);
  6755. }
  6756. if (j1 == 0)
  6757. l++;
  6758. if ((j1 == 1 || j1 == 2)
  6759. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6760. && isFriendOrSelf(s))) {
  6761. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6762. if (myPrivilege >= 1) {
  6763. menuActionName[menuActionRow] = "Report abuse @whi@"
  6764. + s;
  6765. menuActionID[menuActionRow] = 606;
  6766. menuActionRow++;
  6767. }
  6768. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6769. menuActionID[menuActionRow] = 42;
  6770. menuActionRow++;
  6771. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6772. menuActionID[menuActionRow] = 337;
  6773. menuActionRow++;
  6774. }
  6775. l++;
  6776. }
  6777. if ((j1 == 3 || j1 == 7)
  6778. && splitPrivateChat == 0
  6779. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  6780. && isFriendOrSelf(s))) {
  6781. if (j > k1 - 14 && j <= k1) {
  6782. if (myPrivilege >= 1) {
  6783. menuActionName[menuActionRow] = "Report abuse @whi@"
  6784. + s;
  6785. menuActionID[menuActionRow] = 606;
  6786. menuActionRow++;
  6787. }
  6788. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6789. menuActionID[menuActionRow] = 42;
  6790. menuActionRow++;
  6791. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6792. menuActionID[menuActionRow] = 337;
  6793. menuActionRow++;
  6794. }
  6795. l++;
  6796. }
  6797. if (j1 == 4
  6798. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6799. if (j > k1 - 14 && j <= k1) {
  6800. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6801. menuActionID[menuActionRow] = 484;
  6802. menuActionRow++;
  6803. }
  6804. l++;
  6805. }
  6806. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0
  6807. && privateChatMode < 2)
  6808. l++;
  6809. if (j1 == 8
  6810. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6811. if (j > k1 - 14 && j <= k1) {
  6812. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6813. + s;
  6814. menuActionID[menuActionRow] = 6;
  6815. menuActionRow++;
  6816. }
  6817. l++;
  6818. }
  6819. }
  6820. }
  6821.  
  6822. public void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6823. int j = class9.contentType;
  6824. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6825. if (j == 1 && anInt900 == 0) {
  6826. class9.message = "Loading friend list";
  6827. class9.atActionType = 0;
  6828. return;
  6829. }
  6830. if (j == 1 && anInt900 == 1) {
  6831. class9.message = "Connecting to friendserver";
  6832. class9.atActionType = 0;
  6833. return;
  6834. }
  6835. if (j == 2 && anInt900 != 2) {
  6836. class9.message = "Please wait...";
  6837. class9.atActionType = 0;
  6838. return;
  6839. }
  6840. int k = friendsCount;
  6841. if (anInt900 != 2)
  6842. k = 0;
  6843. if (j > 700)
  6844. j -= 601;
  6845. else
  6846. j--;
  6847. if (j >= k) {
  6848. class9.message = "";
  6849. class9.atActionType = 0;
  6850. return;
  6851. } else {
  6852. class9.message = friendsList[j];
  6853. class9.atActionType = 1;
  6854. return;
  6855. }
  6856. }
  6857. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6858. int l = friendsCount;
  6859. if (anInt900 != 2)
  6860. l = 0;
  6861. if (j > 800)
  6862. j -= 701;
  6863. else
  6864. j -= 101;
  6865. if (j >= l) {
  6866. class9.message = "";
  6867. class9.atActionType = 0;
  6868. return;
  6869. }
  6870. if (friendsNodeIDs[j] == 0)
  6871. class9.message = "@red@Offline";
  6872. else if (friendsNodeIDs[j] == nodeID)
  6873. class9.message = "@gre@World 1"/* + (friendsNodeIDs[j] - 9) */;
  6874. else
  6875. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  6876. class9.atActionType = 1;
  6877. return;
  6878. }
  6879. if (j == 203) {
  6880. int i1 = friendsCount;
  6881. if (anInt900 != 2)
  6882. i1 = 0;
  6883. class9.scrollMax = i1 * 15 + 20;
  6884. if (class9.scrollMax <= class9.height)
  6885. class9.scrollMax = class9.height + 1;
  6886. return;
  6887. }
  6888. if (j >= 401 && j <= 500) {
  6889. if ((j -= 401) == 0 && anInt900 == 0) {
  6890. class9.message = "Loading ignore list";
  6891. class9.atActionType = 0;
  6892. return;
  6893. }
  6894. if (j == 1 && anInt900 == 0) {
  6895. class9.message = "Please wait...";
  6896. class9.atActionType = 0;
  6897. return;
  6898. }
  6899. int j1 = ignoreCount;
  6900. if (anInt900 == 0)
  6901. j1 = 0;
  6902. if (j >= j1) {
  6903. class9.message = "";
  6904. class9.atActionType = 0;
  6905. return;
  6906. } else {
  6907. class9.message = TextClass.fixName(TextClass
  6908. .nameForLong(ignoreListAsLongs[j]));
  6909. class9.atActionType = 1;
  6910. return;
  6911. }
  6912. }
  6913. if (j == 503) {
  6914. class9.scrollMax = ignoreCount * 15 + 20;
  6915. if (class9.scrollMax <= class9.height)
  6916. class9.scrollMax = class9.height + 1;
  6917. return;
  6918. }
  6919. if (j == 327) {
  6920. class9.modelRotation1 = 150;
  6921. class9.modelRotation2 = (int) (Math.sin(loopCycle / 40D) * 256D) & 0x7ff;
  6922. if (aBoolean1031) {
  6923. for (int k1 = 0; k1 < 7; k1++) {
  6924. int l1 = anIntArray1065[k1];
  6925. if (l1 >= 0 && !IDK.cache[l1].method537())
  6926. return;
  6927. }
  6928.  
  6929. aBoolean1031 = false;
  6930. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6931. int i2 = 0;
  6932. for (int j2 = 0; j2 < 7; j2++) {
  6933. int k2 = anIntArray1065[j2];
  6934. if (k2 >= 0)
  6935. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  6936. .method538();
  6937. }
  6938.  
  6939. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6940. for (int l2 = 0; l2 < 5; l2++)
  6941. if (anIntArray990[l2] != 0) {
  6942. model.method476(anIntArrayArray1003[l2][0],
  6943. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6944. if (l2 == 1)
  6945. model.method476(anIntArray1204[0],
  6946. anIntArray1204[anIntArray990[l2]]);
  6947. // if(l2 == 1)
  6948. // model.method476(Legs2[0], Legs2[anIntArray990[l2]]);
  6949. }
  6950.  
  6951. model.method469();
  6952. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6953. model.method479(64, 1300, 0, -570, 0, true);
  6954. class9.anInt233 = 5;
  6955. class9.mediaID = 0;
  6956. RSInterface.method208(aBoolean994, model);
  6957. }
  6958. return;
  6959. }
  6960. if (j == 328) {
  6961. RSInterface rsInterface = class9;
  6962. int verticleTilt = 150;
  6963. int animationSpeed = (int) (Math.sin(loopCycle / 40D) * 256D) & 0x7ff;
  6964. rsInterface.modelRotation1 = verticleTilt;
  6965. rsInterface.modelRotation2 = animationSpeed;
  6966. if (aBoolean1031) {
  6967. Model characterDisplay = myPlayer.method452();
  6968. for (int l2 = 0; l2 < 5; l2++)
  6969. if (anIntArray990[l2] != 0) {
  6970. characterDisplay.method476(anIntArrayArray1003[l2][0],
  6971. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6972. if (l2 == 1)
  6973. characterDisplay.method476(anIntArray1204[0],
  6974. anIntArray1204[anIntArray990[l2]]);
  6975. }
  6976. int staticFrame = myPlayer.anInt1511;
  6977. characterDisplay.method469();
  6978. characterDisplay
  6979. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  6980. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6981. rsInterface.anInt233 = 5;
  6982. rsInterface.mediaID = 0;
  6983. RSInterface.method208(aBoolean994, characterDisplay);
  6984. }
  6985. return;
  6986. }
  6987. if (j == 324) {
  6988. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6989. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6990. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6991. }
  6992. if (aBoolean1047) {
  6993. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6994. return;
  6995. } else {
  6996. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6997. return;
  6998. }
  6999. }
  7000. if (j == 325) {
  7001. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  7002. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  7003. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  7004. }
  7005. if (aBoolean1047) {
  7006. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  7007. return;
  7008. } else {
  7009. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  7010. return;
  7011. }
  7012. }
  7013. if (j == 600) {
  7014. class9.message = reportAbuseInput;
  7015. if (loopCycle % 20 < 10) {
  7016. class9.message += "|";
  7017. return;
  7018. } else {
  7019. class9.message += " ";
  7020. return;
  7021. }
  7022. }
  7023. if (j == 613)
  7024. if (myPrivilege >= 1) {
  7025. if (canMute) {
  7026. class9.textColor = 0xff0000;
  7027. // class9.message =
  7028. // "Moderator option: Mute player for 48 hours: <ON>";
  7029. } else {
  7030. class9.textColor = 0xffffff;
  7031. // class9.message =
  7032. // "Moderator option: Mute player for 48 hours: <OFF>";
  7033. }
  7034. } else {
  7035. class9.message = "";
  7036. }
  7037. if (j == 650 || j == 655)
  7038. if (anInt1193 != 0) {
  7039. String s;
  7040. if (daysSinceLastLogin == 0)
  7041. s = "earlier today";
  7042. else if (daysSinceLastLogin == 1)
  7043. s = "yesterday";
  7044. else
  7045. s = daysSinceLastLogin + " days ago";
  7046. class9.message = "You last logged in " + s + " from: "
  7047. + signlink.dns;
  7048. } else {
  7049. class9.message = "";
  7050. }
  7051. if (j == 651) {
  7052. if (unreadMessages == 0) {
  7053. class9.message = "0 unread messages";
  7054. class9.textColor = 0xffff00;
  7055. }
  7056. if (unreadMessages == 1) {
  7057. class9.message = "1 unread message";
  7058. class9.textColor = 65280;
  7059. }
  7060. if (unreadMessages > 1) {
  7061. class9.message = unreadMessages + " unread messages";
  7062. class9.textColor = 65280;
  7063. }
  7064. }
  7065. if (j == 652)
  7066. if (daysSinceRecovChange == 201) {
  7067. if (membersInt == 1)
  7068. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  7069. else
  7070. class9.message = "";
  7071. } else if (daysSinceRecovChange == 200) {
  7072. class9.message = "You have not yet set any password recovery questions.";
  7073. } else {
  7074. String s1;
  7075. if (daysSinceRecovChange == 0)
  7076. s1 = "Earlier today";
  7077. else if (daysSinceRecovChange == 1)
  7078. s1 = "Yesterday";
  7079. else
  7080. s1 = daysSinceRecovChange + " days ago";
  7081. class9.message = s1 + " you changed your recovery questions";
  7082. }
  7083. if (j == 653)
  7084. if (daysSinceRecovChange == 201) {
  7085. if (membersInt == 1)
  7086. class9.message = "@whi@recommend you use a members world instead. You may use";
  7087. else
  7088. class9.message = "";
  7089. } else if (daysSinceRecovChange == 200)
  7090. class9.message = "We strongly recommend you do so now to secure your account.";
  7091. else
  7092. class9.message = "If you do not remember making this change then cancel it immediately";
  7093. if (j == 654) {
  7094. if (daysSinceRecovChange == 201)
  7095. if (membersInt == 1) {
  7096. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  7097. return;
  7098. } else {
  7099. class9.message = "";
  7100. return;
  7101. }
  7102. if (daysSinceRecovChange == 200) {
  7103. class9.message = "Do this from the 'account management' area on our front webpage";
  7104. return;
  7105. }
  7106. class9.message = "Do this from the 'account management' area on our front webpage";
  7107. }
  7108. }
  7109.  
  7110. private void drawSplitPrivateChat() {
  7111. if (splitPrivateChat == 0)
  7112. return;
  7113. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  7114. int i = 0;
  7115. if (anInt1104 != 0)
  7116. i = 1;
  7117. for (int j = 0; j < 100; j++)
  7118. if (chatMessages[j] != null) {
  7119. int k = chatTypes[j];
  7120. String s = chatNames[j];
  7121. byte byte1 = 0;
  7122. if (s != null && s.startsWith("@cr1@")) {
  7123. s = s.substring(5);
  7124. byte1 = 1;
  7125. }
  7126. if (s != null && s.startsWith("@cr2@")) {
  7127. s = s.substring(5);
  7128. byte1 = 2;
  7129. }
  7130. if (s != null && s.startsWith("@cr3@")) {
  7131. s = s.substring(5);
  7132. byte1 = 3;
  7133. }
  7134. if (s != null && s.startsWith("@cr4@")) {
  7135. s = s.substring(5);
  7136. byte1 = 4;
  7137. }
  7138. if (s != null && s.startsWith("@cr5@")) {
  7139. s = s.substring(5);
  7140. byte1 = 5;
  7141. }
  7142. if (s != null && s.startsWith("@cr6@")) {
  7143. s = s.substring(5);
  7144. byte1 = 6;
  7145. }
  7146. if (s != null && s.startsWith("@cr7@")) {
  7147. s = s.substring(5);
  7148. byte1 = 7;
  7149. }
  7150. if (s != null && s.startsWith("@cr8@")) {
  7151. s = s.substring(5);
  7152. byte1 = 8;
  7153. }
  7154. if (s != null && s.startsWith("@cr9@")) {
  7155. s = s.substring(5);
  7156. byte1 = 9;
  7157. }
  7158. if (s != null && s.startsWith("@cr10@")) {
  7159. s = s.substring(6);
  7160. byte1 = 10;
  7161. }
  7162. if (s != null && s.startsWith("@cr11@")) {
  7163. s = s.substring(6);
  7164. byte1 = 11;
  7165. }
  7166. if ((k == 3 || k == 7)
  7167. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  7168. && isFriendOrSelf(s))) {
  7169. int l = 329 - i * 13;
  7170. int k1 = 4;
  7171. textDrawingArea.method385(0, "From", l, k1);
  7172. textDrawingArea.method385(65535, "From", l - 1, k1);
  7173. if (byte1 == 3 || byte1 == 2 || byte1 == 1 || byte1 == 0) {
  7174. k1 += textDrawingArea.getTextWidth("From ");
  7175. } else if (byte1 == 9 || byte1 == 10 || byte1 == 11
  7176. || byte1 == 7 || byte1 == 8 || byte1 == 6
  7177. || byte1 == 5 || byte1 == 4) {
  7178. k1 += textDrawingArea.getTextWidth("From");
  7179. }
  7180. if (byte1 == 1) {
  7181. modIcons[0].drawSprite(k1 - 2, l - 12);
  7182. k1 += 12;
  7183. }
  7184. if (byte1 == 2) {
  7185. modIcons[2].drawSprite(k1 - 2, l - 13);
  7186. k1 += 12;
  7187. }
  7188. if (byte1 == 3) {
  7189. modIcons[1].drawSprite(k1 - 2, l - 12);
  7190. k1 += 12;
  7191. }
  7192. if (byte1 == 4) {
  7193. modIcons[3].drawSprite(k1, l - 11);
  7194. k1 += 12;
  7195. }
  7196. if (byte1 == 5) {
  7197. modIcons[4].drawSprite(k1, l - 11);
  7198. k1 += 12;
  7199. }
  7200. if (byte1 == 6) {
  7201. modIcons[5].drawSprite(k1, l - 11);
  7202. k1 += 12;
  7203. }
  7204. if (byte1 == 7) {
  7205. modIcons[6].drawSprite(k1, l - 11);
  7206. k1 += 12;
  7207. }
  7208. if (byte1 == 8) {
  7209. modIcons[7].drawSprite(k1, l - 11);
  7210. k1 += 12;
  7211. }
  7212. if (byte1 == 9) {
  7213. modIcons[8].drawSprite(k1, l - 11);
  7214. k1 += 12;
  7215. }
  7216. if (byte1 == 10) {
  7217. modIcons[9].drawSprite(k1, l - 11);
  7218. k1 += 12;
  7219. }
  7220. if (byte1 == 11) {
  7221. modIcons[10].drawSprite(k1, l - 11);
  7222. k1 += 12;
  7223. }
  7224. textDrawingArea.method385(0, s + ": " + chatMessages[j], l,
  7225. k1);
  7226. textDrawingArea.method385(65535,
  7227. s + ": " + chatMessages[j], l - 1, k1);
  7228. if (++i >= 5)
  7229. return;
  7230. }
  7231. if (k == 5 && privateChatMode < 2) {
  7232. int i1 = 329 - i * 13;
  7233. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  7234. textDrawingArea
  7235. .method385(65535, chatMessages[j], i1 - 1, 4);
  7236. if (++i >= 5)
  7237. return;
  7238. }
  7239. if (k == 6 && privateChatMode < 2) {
  7240. int j1 = 329 - i * 13;
  7241. textDrawingArea.method385(0, "To " + s + ": "
  7242. + chatMessages[j], j1, 4);
  7243. textDrawingArea.method385(65535, "To " + s + ": "
  7244. + chatMessages[j], j1 - 1, 4);
  7245. if (++i >= 5)
  7246. return;
  7247. }
  7248. }
  7249.  
  7250. }
  7251.  
  7252. public void pushMessage(String s, int i, String s1) {
  7253. if (i == 0 && dialogID != -1) {
  7254. aString844 = s;
  7255. super.clickMode3 = 0;
  7256. }
  7257. if (backDialogID == -1)
  7258. inputTaken = true;
  7259. for (int j = 499; j > 0; j--) {
  7260. chatTypes[j] = chatTypes[j - 1];
  7261. chatNames[j] = chatNames[j - 1];
  7262. chatMessages[j] = chatMessages[j - 1];
  7263. chatRights[j] = chatRights[j - 1];
  7264. clanTitles[j] = clanTitles[j - 1];
  7265. }
  7266. chatTypes[0] = i;
  7267. chatNames[0] = s1;
  7268. chatMessages[0] = s;
  7269. chatRights[0] = channelRights;
  7270. clanTitles[0] = clanTitle;
  7271. }
  7272.  
  7273. public void setNorth() {
  7274. cameraOffsetX = 0;
  7275. cameraOffsetY = 0;
  7276. viewRotationOffset = 0;
  7277. viewRotation = 0;
  7278. minimapRotation = 0;
  7279. minimapZoom = 0;
  7280. }
  7281. public static ScreenMode frameMode = ScreenMode.FIXED;
  7282. public static int frameWidth = 765;
  7283. public static int frameHeight = 503;
  7284. public static int screenAreaWidth = 512;
  7285. public static int screenAreaHeight = 334;
  7286. public static int cameraZoom = 600;
  7287. public static boolean showChatComponents = true;
  7288. public static boolean showTabComponents = true;
  7289. public static int viewDistance = 9;
  7290. public static boolean changeTabArea = frameMode == ScreenMode.FIXED ? false
  7291. : true;
  7292. public static boolean changeChatArea = frameMode == ScreenMode.FIXED ? false
  7293. : true;
  7294. public static boolean transparentTabArea = false;
  7295.  
  7296. public static void frameMode(ScreenMode screenMode) {
  7297. if (frameMode != screenMode) {
  7298. frameMode = screenMode;
  7299. if (screenMode == ScreenMode.FIXED) {
  7300. frameWidth = 765;
  7301. frameHeight = 503;
  7302. cameraZoom = 600;
  7303. changeChatArea = false;
  7304. changeTabArea = false;
  7305. } else if (screenMode == ScreenMode.RESIZABLE) {
  7306. frameWidth = 766;
  7307. frameHeight = 529;
  7308. cameraZoom = 850;
  7309. } else if (screenMode == ScreenMode.FULLSCREEN) {
  7310. cameraZoom = 600;
  7311. frameWidth = (int) Toolkit.getDefaultToolkit().getScreenSize()
  7312. .getWidth();
  7313. frameHeight = (int) Toolkit.getDefaultToolkit().getScreenSize()
  7314. .getHeight();
  7315. }
  7316. rebuildFrameSize(screenMode, frameWidth, frameHeight);
  7317. System.out.println("ScreenMode: " + screenMode.toString());
  7318. }
  7319. showChatComponents = screenMode == ScreenMode.FIXED ? true
  7320. : showChatComponents;
  7321. showTabComponents = screenMode == ScreenMode.FIXED ? true
  7322. : showTabComponents;
  7323. }
  7324.  
  7325. public static void rebuildFrameSize(ScreenMode screenMode, int screenWidth,
  7326. int screenHeight) {
  7327. try {
  7328. screenAreaWidth = (screenMode == ScreenMode.FIXED) ? 512
  7329. : screenWidth;
  7330. screenAreaHeight = (screenMode == ScreenMode.FIXED) ? 334
  7331. : screenHeight;
  7332. frameWidth = screenWidth;
  7333. frameHeight = screenHeight;
  7334. } catch (Exception e) {
  7335. e.printStackTrace();
  7336. }
  7337. }
  7338. public boolean isApplet;
  7339. public boolean appletClient() {
  7340. return gameFrame == null && isApplet == true;
  7341. }
  7342.  
  7343. public int getFrameWidth() {
  7344. Insets insets = this.getInsets();
  7345. return getWidth() - (insets.left + insets.right);
  7346. }
  7347.  
  7348. public int getFrameHeight() {
  7349. Insets insets = this.getInsets();
  7350. return getHeight() - (insets.top + insets.bottom);
  7351. }
  7352.  
  7353. public boolean getMousePositions() {
  7354. if (mouseInRegion(frameWidth - (frameWidth <= 1000 ? 240 : 420),
  7355. frameHeight - (frameWidth <= 1000 ? 90 : 37), frameWidth,
  7356. frameHeight)) {
  7357. return false;
  7358. }
  7359. if (showChatComponents) {
  7360. if (changeChatArea) {
  7361. if (super.mouseX > 0 && super.mouseX < 494
  7362. && super.mouseY > frameHeight - 175
  7363. && super.mouseY < frameHeight) {
  7364. return true;
  7365. } else {
  7366. if (super.mouseX > 494 && super.mouseX < 515
  7367. && super.mouseY > frameHeight - 175
  7368. && super.mouseY < frameHeight) {
  7369. return false;
  7370. }
  7371. }
  7372. } else if (!changeChatArea) {
  7373. if (super.mouseX > 0 && super.mouseX < 519
  7374. && super.mouseY > frameHeight - 175
  7375. && super.mouseY < frameHeight) {
  7376. return false;
  7377. }
  7378. }
  7379. }
  7380. if (mouseInRegion(frameWidth - 216, 0, frameWidth, 172)) {
  7381. return false;
  7382. }
  7383. if (!changeTabArea) {
  7384. if (super.mouseX > 0 && super.mouseY > 0
  7385. && super.mouseY < frameWidth && super.mouseY < frameHeight) {
  7386. if (super.mouseX >= frameWidth - 242
  7387. && super.mouseY >= frameHeight - 335) {
  7388. return false;
  7389. }
  7390. return true;
  7391. }
  7392. return false;
  7393. }
  7394. if (showTabComponents) {
  7395. if (frameWidth > 1000) {
  7396. if (super.mouseX >= frameWidth - 420
  7397. && super.mouseX <= frameWidth
  7398. && super.mouseY >= frameHeight - 37
  7399. && super.mouseY <= frameHeight
  7400. || super.mouseX > frameWidth - 225
  7401. && super.mouseX < frameWidth
  7402. && super.mouseY > frameHeight - 37 - 274
  7403. && super.mouseY < frameHeight) {
  7404. return false;
  7405. }
  7406. } else {
  7407. if (super.mouseX >= frameWidth - 210
  7408. && super.mouseX <= frameWidth
  7409. && super.mouseY >= frameHeight - 74
  7410. && super.mouseY <= frameHeight
  7411. || super.mouseX > frameWidth - 225
  7412. && super.mouseX < frameWidth
  7413. && super.mouseY > frameHeight - 74 - 274
  7414. && super.mouseY < frameHeight) {
  7415. return false;
  7416. }
  7417. }
  7418. }
  7419. return true;
  7420. }
  7421.  
  7422. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  7423. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1
  7424. && super.mouseY <= y2) {
  7425. return true;
  7426. }
  7427. return false;
  7428. }
  7429.  
  7430. public boolean mouseMapPosition() {
  7431. if (super.mouseX >= frameWidth - 21 && super.mouseX <= frameWidth
  7432. && super.mouseY >= 0 && super.mouseY <= 21) {
  7433. return false;
  7434. }
  7435. return true;
  7436. }
  7437.  
  7438. public boolean runEnergy = false;
  7439. public boolean isPoisoned, clickedQuickPrayers;
  7440. public static Sprite[] cacheSprite = new Sprite[62];
  7441. public final int[]
  7442. orbX = { 0, 0, 25 },
  7443. orbY = { 41, 85, 121 },
  7444. orbTextX = { 15, 15, 40 },
  7445. orbTextY = { 67, 111, 147 },
  7446. coloredOrbX = { 27, 27, 52 },
  7447. coloredOrbY = { 45, 89, 125 },
  7448. currentInterface = { 4016, 4012, 149 },
  7449. maximumInterface = { 4017, 4013, 149 },
  7450. orbIconX = { 33, 30, 58 },
  7451. orbIconY = { 52, 93, 129 };
  7452.  
  7453. private void loadAllOrbs(int xOffset) {
  7454. expDrops[counterHover ? 24 : 23].drawSprite(0, 20);
  7455. int[] spriteID = { isPoisoned && hpHover ? 8 : 7, prayHover ? 8 : 7,
  7456. runHover ? 8 : 7, sumActive && sumHover ? 8 : 7 }, coloredOrbSprite = {
  7457. myPlayer.getHealthState() != 0 ? (myPlayer.getHealthState() == 1 ? 6 : 5) : 0, clickedQuickPrayers ? 2 : 1, runClicked1 ? 4 : 3,
  7458. sumActive ? 6 : 5 }, orbSprite = { 9, 10,
  7459. (runClicked1 ? 12 : 11), 13 };
  7460. String cEnergy = RSInterface.interfaceCache[149].message.replaceAll(
  7461. "%", "");
  7462. String hp = RSInterface.interfaceCache[4016].message
  7463. .replaceAll("%", "");
  7464. int currentHP = Integer.parseInt(hp), currentEnergy = Integer
  7465. .parseInt(cEnergy);
  7466. for (int i = 0; i < 3; i++) {
  7467. String currentStats = RSInterface.interfaceCache[currentInterface[i]].message
  7468. .replaceAll("%", ""), maxStats = RSInterface.interfaceCache[maximumInterface[i]].message
  7469. .replaceAll("%", "");
  7470. int currentLevel = Integer.parseInt(currentStats), maxLevel = Integer
  7471. .parseInt(maxStats), level = (int) (((double) currentLevel / (double) maxLevel) * 100D);
  7472. cacheSprite[spriteID[i]].drawSprite(orbX[i] + xOffset, orbY[i]);
  7473. cacheSprite[coloredOrbSprite[i]].drawSprite(coloredOrbX[i]
  7474. + xOffset, coloredOrbY[i]);
  7475. double percent = (i == 2 ? runEnergy ? currentEnergy / 100D : 100
  7476. : level / 100D), fillHp = 26 * percent, fillPrayer = 26 * percent, fillRun = 26 * percent;
  7477. double[] fill = { fillHp, fillPrayer, fillRun };
  7478. int depleteFill = 26 - (int) fill[i];
  7479. cacheSprite[14].myHeight = depleteFill;
  7480. try {
  7481. cacheSprite[14].drawSprite(coloredOrbX[i] + xOffset,
  7482. coloredOrbY[i]);
  7483. } catch (Exception e) {
  7484. }
  7485. cacheSprite[orbSprite[i]].drawSprite(orbIconX[i] + xOffset,
  7486. orbIconY[i]);
  7487. smallText
  7488. .method382(
  7489. getOrbTextColor(i == 2 ? runEnergy ? currentEnergy
  7490. : 100 : level),
  7491. orbTextX[i] + xOffset,
  7492. ""
  7493. + (i == 2 ? runEnergy ? cEnergy : 100
  7494. : i == 0 && newDamage ? currentHP * 10
  7495. : RSInterface.interfaceCache[currentInterface[i]].message
  7496. .replaceAll("%", "")),
  7497. orbTextY[i], true);
  7498. }
  7499. }
  7500.  
  7501. private boolean runHover1, prayHover1, hpHover, prayClicked1, sumHover,
  7502. sumActive, runClicked1 = true;
  7503.  
  7504. public int getOrbTextColor(int statusInt) {
  7505. if (statusInt >= 75 && statusInt <= Integer.MAX_VALUE)
  7506. return 0x00FF00;
  7507. else if (statusInt >= 50 && statusInt <= 74)
  7508. return 0xFFFF00;
  7509. else if (statusInt >= 25 && statusInt <= 49)
  7510. return 0xFF981F;
  7511. else
  7512. return 0xFF0000;
  7513. }
  7514.  
  7515. public int getOrbFill(int statusInt) {
  7516. if (statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  7517. return 0;
  7518. else if (statusInt <= 96 && statusInt >= 93)
  7519. return 1;
  7520. else if (statusInt <= 92 && statusInt >= 89)
  7521. return 2;
  7522. else if (statusInt <= 88 && statusInt >= 85)
  7523. return 3;
  7524. else if (statusInt <= 84 && statusInt >= 81)
  7525. return 4;
  7526. else if (statusInt <= 80 && statusInt >= 77)
  7527. return 5;
  7528. else if (statusInt <= 76 && statusInt >= 73)
  7529. return 6;
  7530. else if (statusInt <= 72 && statusInt >= 69)
  7531. return 7;
  7532. else if (statusInt <= 68 && statusInt >= 65)
  7533. return 8;
  7534. else if (statusInt <= 64 && statusInt >= 61)
  7535. return 9;
  7536. else if (statusInt <= 60 && statusInt >= 57)
  7537. return 10;
  7538. else if (statusInt <= 56 && statusInt >= 53)
  7539. return 11;
  7540. else if (statusInt <= 52 && statusInt >= 49)
  7541. return 12;
  7542. else if (statusInt <= 48 && statusInt >= 45)
  7543. return 13;
  7544. else if (statusInt <= 44 && statusInt >= 41)
  7545. return 14;
  7546. else if (statusInt <= 40 && statusInt >= 37)
  7547. return 15;
  7548. else if (statusInt <= 36 && statusInt >= 33)
  7549. return 16;
  7550. else if (statusInt <= 32 && statusInt >= 29)
  7551. return 17;
  7552. else if (statusInt <= 28 && statusInt >= 25)
  7553. return 18;
  7554. else if (statusInt <= 24 && statusInt >= 21)
  7555. return 19;
  7556. else if (statusInt <= 20 && statusInt >= 17)
  7557. return 20;
  7558. else if (statusInt <= 16 && statusInt >= 13)
  7559. return 21;
  7560. else if (statusInt <= 12 && statusInt >= 9)
  7561. return 22;
  7562. else if (statusInt <= 8 && statusInt >= 7)
  7563. return 23;
  7564. else if (statusInt <= 6 && statusInt >= 5)
  7565. return 24;
  7566. else if (statusInt <= 4 && statusInt >= 3)
  7567. return 25;
  7568. else if (statusInt <= 2 && statusInt >= 1)
  7569. return 26;
  7570. else if (statusInt <= 0)
  7571. return 27;
  7572. return 0;
  7573. }
  7574.  
  7575. private void processTabClick2() {
  7576. if (super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95
  7577. && super.mouseY < 128) {
  7578. runHover1 = true;
  7579. } else {
  7580. runHover1 = false;
  7581. }
  7582. if (super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52
  7583. && super.mouseY < 87) {
  7584. prayHover1 = true;
  7585. } else {
  7586. prayHover1 = false;
  7587. }
  7588. }
  7589.  
  7590. public void processTabClick() {
  7591. minimapHovers();
  7592. if (super.clickMode3 == 1) {
  7593. if (super.saveClickX >= 524 && super.saveClickX <= 561
  7594. && super.saveClickY >= 169 && super.saveClickY < 205
  7595. && tabInterfaceIDs[0] != -1) {
  7596. needDrawTabArea = true;
  7597. tabID = 0;
  7598. tabAreaAltered = true;
  7599. }
  7600. if (super.saveClickX >= 562 && super.saveClickX <= 594
  7601. && super.saveClickY >= 168 && super.saveClickY < 205
  7602. && tabInterfaceIDs[1] != -1) {
  7603. needDrawTabArea = true;
  7604. tabID = 1;
  7605. tabAreaAltered = true;
  7606. }
  7607. if (super.saveClickX >= 595 && super.saveClickX <= 626
  7608. && super.saveClickY >= 168 && super.saveClickY < 205
  7609. && tabInterfaceIDs[2] != -1) {
  7610. needDrawTabArea = true;
  7611. tabID = 2;
  7612. tabAreaAltered = true;
  7613. }
  7614. if (super.saveClickX >= 627 && super.saveClickX <= 660
  7615. && super.saveClickY >= 168 && super.saveClickY < 203
  7616. && tabInterfaceIDs[3] != -1) {
  7617. needDrawTabArea = true;
  7618. tabID = 3;
  7619. tabAreaAltered = true;
  7620. }
  7621. if (super.saveClickX >= 661 && super.saveClickX <= 693
  7622. && super.saveClickY >= 168 && super.saveClickY < 205
  7623. && tabInterfaceIDs[4] != -1) {
  7624. needDrawTabArea = true;
  7625. tabID = 4;
  7626. tabAreaAltered = true;
  7627. }
  7628. if (super.saveClickX >= 694 && super.saveClickX <= 725
  7629. && super.saveClickY >= 168 && super.saveClickY < 205
  7630. && tabInterfaceIDs[5] != -1) {
  7631. needDrawTabArea = true;
  7632. tabID = 5;
  7633. tabAreaAltered = true;
  7634. }
  7635. if (super.saveClickX >= 726 && super.saveClickX <= 765
  7636. && super.saveClickY >= 169 && super.saveClickY < 205
  7637. && tabInterfaceIDs[6] != -1) {
  7638. needDrawTabArea = true;
  7639. tabID = 6;
  7640. tabAreaAltered = true;
  7641. }
  7642. if (super.saveClickX >= 524 && super.saveClickX <= 561
  7643. && super.saveClickY >= 466 && super.saveClickY < 503
  7644. && tabInterfaceIDs[7] != -1) {
  7645. needDrawTabArea = true;
  7646. tabID = 7;
  7647. tabAreaAltered = true;
  7648. }
  7649. if (super.saveClickX >= 562 && super.saveClickX <= 594
  7650. && super.saveClickY >= 466 && super.saveClickY < 503
  7651. && tabInterfaceIDs[8] != -1) {
  7652. needDrawTabArea = true;
  7653. tabID = 8;
  7654. tabAreaAltered = true;
  7655. }
  7656. if (super.saveClickX >= 595 && super.saveClickX <= 627
  7657. && super.saveClickY >= 466 && super.saveClickY < 503
  7658. && tabInterfaceIDs[9] != -1) {
  7659. needDrawTabArea = true;
  7660. tabID = 9;
  7661. tabAreaAltered = true;
  7662. }
  7663. if (super.saveClickX >= 627 && super.saveClickX <= 664
  7664. && super.saveClickY >= 466 && super.saveClickY < 503
  7665. && tabInterfaceIDs[10] != -1) {
  7666. needDrawTabArea = true;
  7667. tabID = 10;
  7668. tabAreaAltered = true;
  7669. }
  7670. if (super.saveClickX >= 661 && super.saveClickX <= 694
  7671. && super.saveClickY >= 466 && super.saveClickY < 503
  7672. && tabInterfaceIDs[11] != -1) {
  7673. needDrawTabArea = true;
  7674. tabID = 11;
  7675. tabAreaAltered = true;
  7676. }
  7677. if (super.saveClickX >= 695 && super.saveClickX <= 725
  7678. && super.saveClickY >= 466 && super.saveClickY < 503
  7679. && tabInterfaceIDs[12] != -1) {
  7680. needDrawTabArea = true;
  7681. tabID = 12;
  7682. tabAreaAltered = true;
  7683. }
  7684. if (super.saveClickX >= 726 && super.saveClickX <= 765
  7685. && super.saveClickY >= 466 && super.saveClickY < 502
  7686. && tabInterfaceIDs[13] != -1) {
  7687. needDrawTabArea = true;
  7688. tabID = 13;
  7689. tabAreaAltered = true;
  7690. }
  7691. }
  7692. }
  7693.  
  7694. private void resetImageProducers2() {
  7695. if (aRSImageProducer_1166 != null)
  7696. return;
  7697. nullLoader();
  7698. super.fullGameScreen = null;
  7699. aRSImageProducer_1107 = null;
  7700. aRSImageProducer_1108 = null;
  7701. loginScreenArea = null;
  7702. leftSideFlame = null;
  7703. rightSideFlame = null;
  7704. gameLogo = null;
  7705. aRSImageProducer_1113 = null;
  7706. aRSImageProducer_1114 = null;
  7707. aRSImageProducer_1115 = null;
  7708. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  7709. getGameComponent());
  7710. aRSImageProducer_1164 = new RSImageProducer(246, 168,
  7711. getGameComponent());
  7712. DrawingArea.setAllPixelsToZero();
  7713. if (revision508 == true) {
  7714. mapArea508.drawSprite(0, 0);
  7715. }
  7716. if (revision474 == true) {
  7717. mapArea474.drawSprite(0, 0);
  7718. }
  7719. if (revision498 == true) {
  7720. mapArea.drawSprite(0, 0);
  7721. }
  7722. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  7723. getGameComponent());
  7724. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  7725. getGameComponent());
  7726. DrawingArea.setAllPixelsToZero();
  7727. new RSImageProducer(496, 50, getGameComponent());
  7728. new RSImageProducer(269, 37, getGameComponent());
  7729. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7730. welcomeScreenRaised = true;
  7731. }
  7732.  
  7733. public String getDocumentBaseHost() {
  7734. if (signlink.mainapp != null) {
  7735. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7736. }
  7737. if (super.gameFrame != null) {
  7738. return "";
  7739. } else {
  7740. return "";
  7741. }
  7742. }
  7743.  
  7744. private void method81(Sprite sprite, int j, int k) {
  7745. int l = k * k + j * j;
  7746. if (l > 4225 && l < 0x15f90) {
  7747. int i1 = viewRotation + minimapRotation & 0x7ff;
  7748. int j1 = Model.modelIntArray1[i1];
  7749. int k1 = Model.modelIntArray2[i1];
  7750. j1 = (j1 * 256) / (minimapZoom + 256);
  7751. k1 = (k1 * 256) / (minimapZoom + 256);
  7752. int l1 = j * j1 + k * k1 >> 16;
  7753. int i2 = j * k1 - k * j1 >> 16;
  7754. double d = Math.atan2(l1, i2);
  7755. int j2 = (int) (Math.sin(d) * 63D);
  7756. int k2 = (int) (Math.cos(d) * 57D);
  7757. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7758. } else {
  7759. markMinimap(sprite, k, j);
  7760. }
  7761. }
  7762. public void rightClickChatButtons() {
  7763. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482
  7764. && super.mouseY <= 503) {
  7765. menuActionName[1] = "View All";
  7766. menuActionID[1] = 999;
  7767. menuActionRow = 2;
  7768. } else if (super.mouseX >= 71 && super.mouseX <= 127
  7769. && super.mouseY >= 482 && super.mouseY <= 503) {
  7770. menuActionName[1] = "View Game";
  7771. menuActionID[1] = 998;
  7772. menuActionName[2] = "View Market";
  7773. menuActionID[2] = 1005;
  7774. menuActionRow = 3;
  7775. } else if (super.mouseX >= 137 && super.mouseX <= 193
  7776. && super.mouseY >= 482 && super.mouseY <= 503) {
  7777. menuActionName[1] = "Hide public";
  7778. menuActionID[1] = 997;
  7779. menuActionName[2] = "Off public";
  7780. menuActionID[2] = 996;
  7781. menuActionName[3] = "Friends public";
  7782. menuActionID[3] = 995;
  7783. menuActionName[4] = "On public";
  7784. menuActionID[4] = 994;
  7785. menuActionName[5] = "View public";
  7786. menuActionID[5] = 993;
  7787. menuActionRow = 6;
  7788. } else if (super.mouseX >= 203 && super.mouseX <= 259
  7789. && super.mouseY >= 482 && super.mouseY <= 503) {
  7790. menuActionName[1] = "Off private";
  7791. menuActionID[1] = 992;
  7792. menuActionName[2] = "Friends private";
  7793. menuActionID[2] = 991;
  7794. menuActionName[3] = "On private";
  7795. menuActionID[3] = 990;
  7796. menuActionName[4] = "View private";
  7797. menuActionID[4] = 989;
  7798. menuActionRow = 5;
  7799. } else if (super.mouseX >= 269 && super.mouseX <= 325
  7800. && super.mouseY >= 482 && super.mouseY <= 503) {
  7801. menuActionName[1] = "Off clan chat";
  7802. menuActionID[1] = 1003;
  7803. menuActionName[2] = "Friends clan chat";
  7804. menuActionID[2] = 1002;
  7805. menuActionName[3] = "On clan chat";
  7806. menuActionID[3] = 1001;
  7807. menuActionName[4] = "View clan chat";
  7808. menuActionID[4] = 1000;
  7809. menuActionRow = 5;
  7810. } else if (super.mouseX >= 335 && super.mouseX <= 391
  7811. && super.mouseY >= 482 && super.mouseY <= 503) {
  7812. menuActionName[1] = "Off trade";
  7813. menuActionID[1] = 987;
  7814. menuActionName[2] = "Friends trade";
  7815. menuActionID[2] = 986;
  7816. menuActionName[3] = "On trade";
  7817. menuActionID[3] = 985;
  7818. menuActionName[4] = "View trade";
  7819. menuActionID[4] = 984;
  7820. menuActionRow = 5;
  7821. }
  7822. }
  7823.  
  7824. public void processRightClick() {
  7825. if (activeInterfaceType != 0) {
  7826. return;
  7827. }
  7828. menuActionName[0] = "Cancel";
  7829. menuActionID[0] = 1107;
  7830. menuActionRow = 1;
  7831. if (fullscreenInterfaceID != -1) {
  7832. anInt886 = 0;
  7833. anInt1315 = 0;
  7834. buildInterfaceMenu(8,
  7835. RSInterface.interfaceCache[fullscreenInterfaceID],
  7836. super.mouseX, 8, super.mouseY, 0);
  7837. if (anInt886 != anInt1026) {
  7838. anInt1026 = anInt886;
  7839. }
  7840. if (anInt1315 != anInt1129) {
  7841. anInt1129 = anInt1315;
  7842. }
  7843. return;
  7844. }
  7845. buildSplitPrivateChatMenu();
  7846. anInt886 = 0;
  7847. anInt1315 = 0;
  7848. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516
  7849. && super.mouseY < 338) {
  7850. if (openInterfaceID != -1) {
  7851. buildInterfaceMenu(4,
  7852. RSInterface.interfaceCache[openInterfaceID],
  7853. super.mouseX, 4, super.mouseY, 0);
  7854. } else {
  7855. build3dScreenMenu();
  7856. }
  7857. }
  7858. if (anInt886 != anInt1026) {
  7859. anInt1026 = anInt886;
  7860. }
  7861. if (anInt1315 != anInt1129) {
  7862. anInt1129 = anInt1315;
  7863. }
  7864. anInt886 = 0;
  7865. anInt1315 = 0;
  7866. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740
  7867. && super.mouseY < 468) {
  7868. if (invOverlayInterfaceID != -1) {
  7869. buildInterfaceMenu(548,
  7870. RSInterface.interfaceCache[invOverlayInterfaceID],
  7871. super.mouseX, 207, super.mouseY, 0);
  7872. } else if (tabInterfaceIDs[tabID] != -1) {
  7873. buildInterfaceMenu(548,
  7874. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  7875. super.mouseX, 207, super.mouseY, 0);
  7876. }
  7877. }
  7878. if (anInt886 != anInt1048) {
  7879. needDrawTabArea = true;
  7880. tabAreaAltered = true;
  7881. anInt1048 = anInt886;
  7882. }
  7883. if (anInt1315 != anInt1044) {
  7884. needDrawTabArea = true;
  7885. tabAreaAltered = true;
  7886. anInt1044 = anInt1315;
  7887. }
  7888. anInt886 = 0;
  7889. anInt1315 = 0;
  7890. if (super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490
  7891. && super.mouseY < 463) {
  7892. if (backDialogID != -1) {
  7893. buildInterfaceMenu(20,
  7894. RSInterface.interfaceCache[backDialogID], super.mouseX,
  7895. 358, super.mouseY, 0);
  7896. } else if (super.mouseY < 463 && super.mouseX < 490) {
  7897. buildChatAreaMenu(super.mouseY - 338);
  7898. }
  7899. }
  7900. if (backDialogID != -1 && anInt886 != anInt1039) {
  7901. inputTaken = true;
  7902. anInt1039 = anInt886;
  7903. }
  7904. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7905. inputTaken = true;
  7906. anInt1500 = anInt1315;
  7907. }
  7908. /* Enable custom right click areas */
  7909. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516
  7910. && super.mouseY < 503)
  7911. rightClickChatButtons();
  7912. processMinimapActions();
  7913. boolean flag = false;
  7914. while (!flag) {
  7915. flag = true;
  7916. for (int j = 0; j < menuActionRow - 1; j++) {
  7917. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7918. String s = menuActionName[j];
  7919. menuActionName[j] = menuActionName[j + 1];
  7920. menuActionName[j + 1] = s;
  7921. int k = menuActionID[j];
  7922. menuActionID[j] = menuActionID[j + 1];
  7923. menuActionID[j + 1] = k;
  7924. k = menuActionCmd2[j];
  7925. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7926. menuActionCmd2[j + 1] = k;
  7927. k = menuActionCmd3[j];
  7928. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7929. menuActionCmd3[j + 1] = k;
  7930. k = menuActionCmd1[j];
  7931. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7932. menuActionCmd1[j + 1] = k;
  7933. flag = false;
  7934. }
  7935. }
  7936. }
  7937. }
  7938.  
  7939. private int method83(int i, int j, int k) {
  7940. int l = 256 - k;
  7941. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  7942. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7943. }
  7944.  
  7945. public void login(String s, String s1, boolean flag) {
  7946. signlink.errorname = s;
  7947. try {
  7948. if (!flag) {
  7949. loginMessage1 = "";
  7950. loginMessage2 = "";
  7951. drawLoginScreen(true);
  7952. }
  7953. socketStream = new RSSocket(this, openSocket(port + portOff));
  7954. long l = TextClass.longForName(s);
  7955. int i = (int) (l >> 16 & 31L);
  7956. stream.currentOffset = 0;
  7957. stream.writeWordBigEndian(14);
  7958. stream.writeWordBigEndian(i);
  7959. socketStream.queueBytes(2, stream.buffer);
  7960. for (int j = 0; j < 8; j++)
  7961. socketStream.read();
  7962.  
  7963. int k = socketStream.read();
  7964. int i1 = k;
  7965. if (k == 0) {
  7966. socketStream.flushInputStream(inStream.buffer, 8);
  7967. inStream.currentOffset = 0;
  7968. aLong1215 = inStream.readQWord();
  7969. int ai[] = new int[4];
  7970. ai[0] = (int) (Math.random() * 99999999D);
  7971. ai[1] = (int) (Math.random() * 99999999D);
  7972. ai[2] = (int) (aLong1215 >> 32);
  7973. ai[3] = (int) aLong1215;
  7974. stream.currentOffset = 0;
  7975. stream.writeWordBigEndian(10);
  7976. stream.writeDWord(ai[0]);
  7977. stream.writeDWord(ai[1]);
  7978. stream.writeDWord(ai[2]);
  7979. stream.writeDWord(ai[3]);
  7980. stream.writeDWord(signlink.uid);
  7981. stream.writeString(s);
  7982. stream.writeString(s1);
  7983. stream.writeString(macAddress);
  7984. stream.doKeys();
  7985. aStream_847.currentOffset = 0;
  7986. if (flag)
  7987. aStream_847.writeWordBigEndian(18);
  7988. else
  7989. aStream_847.writeWordBigEndian(16);
  7990. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  7991. + 1 + 2);
  7992. aStream_847.writeWordBigEndian(255);
  7993. aStream_847.writeWord(317);
  7994. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7995. for (int l1 = 0; l1 < 9; l1++)
  7996. aStream_847.writeDWord(expectedCRCs[l1]);
  7997.  
  7998. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7999. stream.encryption = new ISAACRandomGen(ai);
  8000. for (int j2 = 0; j2 < 4; j2++)
  8001. ai[j2] += 50;
  8002.  
  8003. encryption = new ISAACRandomGen(ai);
  8004. socketStream.queueBytes(aStream_847.currentOffset,
  8005. aStream_847.buffer);
  8006. k = socketStream.read();
  8007. }
  8008. if (k == 1) {
  8009. try {
  8010. Thread.sleep(2000L);
  8011. } catch (Exception _ex) {
  8012. }
  8013. login(s, s1, flag);
  8014. return;
  8015. }
  8016. counterOn = false;
  8017. if (k == 2) {
  8018. myPrivilege = socketStream.read();
  8019. flagged = socketStream.read() == 1;
  8020. aLong1220 = 0L;
  8021. anInt1022 = 0;
  8022. mouseDetection.coordsIndex = 0;
  8023. super.awtFocus = true;
  8024. aBoolean954 = true;
  8025. loggedIn = true;
  8026. stream.currentOffset = 0;
  8027. inStream.currentOffset = 0;
  8028. pktType = -1;
  8029. anInt841 = -1;
  8030. anInt842 = -1;
  8031. anInt843 = -1;
  8032. pktSize = 0;
  8033. anInt1009 = 0;
  8034. anInt1104 = 0;
  8035. anInt1011 = 0;
  8036. anInt855 = 0;
  8037. menuActionRow = 0;
  8038. menuOpen = false;
  8039. super.idleTime = 0;
  8040. for (int j1 = 0; j1 < 500; j1++)
  8041. chatMessages[j1] = null;
  8042.  
  8043. itemSelected = 0;
  8044. spellSelected = 0;
  8045. loadingStage = 0;
  8046. anInt1062 = 0;
  8047. setNorth();
  8048. anInt1021 = 0;
  8049. anInt985 = -1;
  8050. destX = 0;
  8051. destY = 0;
  8052. playerCount = 0;
  8053. npcCount = 0;
  8054. for (int i2 = 0; i2 < maxPlayers; i2++) {
  8055. playerArray[i2] = null;
  8056. aStreamArray895s[i2] = null;
  8057. }
  8058.  
  8059. for (int k2 = 0; k2 < 16384; k2++)
  8060. npcArray[k2] = null;
  8061.  
  8062. myPlayer = playerArray[myPlayerIndex] = new Player();
  8063. aClass19_1013.removeAll();
  8064. aClass19_1056.removeAll();
  8065. for (int l2 = 0; l2 < 4; l2++) {
  8066. for (int i3 = 0; i3 < 104; i3++) {
  8067. for (int k3 = 0; k3 < 104; k3++)
  8068. groundArray[l2][i3][k3] = null;
  8069.  
  8070. }
  8071.  
  8072. }
  8073.  
  8074. aClass19_1179 = new NodeList();
  8075. fullscreenInterfaceID = -1;
  8076. anInt900 = 0;
  8077. friendsCount = 0;
  8078. dialogID = -1;
  8079. backDialogID = -1;
  8080. openInterfaceID = -1;
  8081. invOverlayInterfaceID = -1;
  8082. anInt1018 = -1;
  8083. aBoolean1149 = false;
  8084. tabID = 3;
  8085. inputDialogState = 0;
  8086. menuOpen = false;
  8087. messagePromptRaised = false;
  8088. aString844 = null;
  8089. anInt1055 = 0;
  8090. anInt1054 = -1;
  8091. aBoolean1047 = true;
  8092. method45();
  8093. for (int j3 = 0; j3 < 5; j3++)
  8094. anIntArray990[j3] = 0;
  8095.  
  8096. for (int l3 = 0; l3 < 6; l3++) {
  8097. atPlayerActions[l3] = null;
  8098. atPlayerArray[l3] = false;
  8099. }
  8100.  
  8101. anInt1175 = 0;
  8102. anInt1134 = 0;
  8103. anInt986 = 0;
  8104. anInt1288 = 0;
  8105. anInt924 = 0;
  8106. anInt1188 = 0;
  8107. anInt1155 = 0;
  8108. anInt1226 = 0;
  8109. resetImageProducers2();
  8110. return;
  8111. }
  8112. if (k == 3) {
  8113. loginMessage1 = "";
  8114. loginMessage2 = "Invalid username or password.";
  8115. return;
  8116. }
  8117. if (k == 4) {
  8118. loginMessage1 = "Your account has been disabled.";
  8119. loginMessage2 = "Please check your message-center for details.";
  8120. return;
  8121. }
  8122. if (k == 5) {
  8123. loginMessage1 = "Your account is already logged in.";
  8124. loginMessage2 = "Try again in 60 secs...";
  8125. return;
  8126. }
  8127. if (k == 6) {
  8128. loginMessage1 = "RuneScape has been updated!";
  8129. loginMessage2 = "Please reload this page.";
  8130. return;
  8131. }
  8132. if (k == 7) {
  8133. loginMessage1 = "This world is full.";
  8134. loginMessage2 = "Please use a different world.";
  8135. return;
  8136. }
  8137. if (k == 8) {
  8138. loginMessage1 = "Unable to connect.";
  8139. loginMessage2 = "Login server offline.";
  8140. return;
  8141. }
  8142. if (k == 9) {
  8143. loginMessage1 = "Login limit exceeded.";
  8144. loginMessage2 = "Too many connections from your address.";
  8145. return;
  8146. }
  8147. if (k == 10) {
  8148. loginMessage1 = "Unable to connect.";
  8149. loginMessage2 = "Bad session id.";
  8150. return;
  8151. }
  8152. if (k == 11) {
  8153. loginMessage2 = "Login server rejected session.";
  8154. loginMessage2 = "Please try again.";
  8155. return;
  8156. }
  8157. if (k == 12) {
  8158. loginMessage1 = "You need a members account to login to this world.";
  8159. loginMessage2 = "Please subscribe, or use a different world.";
  8160. return;
  8161. }
  8162. if (k == 13) {
  8163. loginMessage1 = "Could not complete login.";
  8164. loginMessage2 = "Please try using a different world.";
  8165. return;
  8166. }
  8167. if (k == 14) {
  8168. loginMessage1 = "The server is being updated.";
  8169. loginMessage2 = "Please wait 1 minute and try again.";
  8170. return;
  8171. }
  8172. if (k == 15) {
  8173. loggedIn = true;
  8174. stream.currentOffset = 0;
  8175. inStream.currentOffset = 0;
  8176. pktType = -1;
  8177. anInt841 = -1;
  8178. anInt842 = -1;
  8179. anInt843 = -1;
  8180. pktSize = 0;
  8181. anInt1009 = 0;
  8182. anInt1104 = 0;
  8183. menuActionRow = 0;
  8184. menuOpen = false;
  8185. aLong824 = System.currentTimeMillis();
  8186. return;
  8187. }
  8188. if (k == 16) {
  8189. loginMessage1 = "Login attempts exceeded.";
  8190. loginMessage2 = "Please wait 1 minute and try again.";
  8191. return;
  8192. }
  8193. if (k == 17) {
  8194. loginMessage1 = "You are standing in a members-only area.";
  8195. loginMessage2 = "To play on this world move to a free area first";
  8196. return;
  8197. }
  8198. if (k == 20) {
  8199. loginMessage1 = "Invalid loginserver requested";
  8200. loginMessage2 = "Please try using a different world.";
  8201. return;
  8202. }
  8203. if (k == 21) {
  8204. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  8205. loginMessage1 = "You have only just left another world";
  8206. loginMessage2 = "Your profile will be transferred in: "
  8207. + k1 + " seconds";
  8208. drawLoginScreen(true);
  8209. try {
  8210. Thread.sleep(1000L);
  8211. } catch (Exception _ex) {
  8212. }
  8213. }
  8214.  
  8215. login(s, s1, flag);
  8216. return;
  8217. }
  8218. if (k == 22) {
  8219. loginMessage1 = "Your computer has been UUID banned.";
  8220. loginMessage2 = "Please appeal on the forums.";
  8221. return;
  8222. }
  8223. if (k == 23) {
  8224. loginState = LoginScreenState.DOWNLOADING_CLIENT;
  8225. new UpdateClient().start();
  8226. return;
  8227. }
  8228. if (k == 24) {
  8229. loginMessage1 = "This world is running a closed Beta.";
  8230. loginMessage2 = "Sorry invited players only.";
  8231. return;
  8232. }
  8233. if (k == 25) {
  8234. loginMessage1 = "Account locked as we suspect it has been stolen.";
  8235. loginMessage2 = "Please visit os-pvp.org for details.";
  8236. return;
  8237. }
  8238. if (k == -1) {
  8239. if (i1 == 0) {
  8240. if (loginFailures < 2) {
  8241. try {
  8242. Thread.sleep(2000L);
  8243. } catch (Exception _ex) {
  8244. }
  8245. loginFailures++;
  8246. login(s, s1, flag);
  8247. return;
  8248. }
  8249. } else {
  8250. loginState = LoginScreenState.DOWNLOADING_CLIENT;
  8251. new UpdateClient().start();
  8252. return;
  8253. }
  8254. } else {
  8255. loginState = LoginScreenState.DOWNLOADING_CLIENT;
  8256. new UpdateClient().start();
  8257. return;
  8258. }
  8259. } catch (IOException _ex) {
  8260. loginMessage1 = "";
  8261. } catch (Exception e) {
  8262. System.out.println("Error while generating uid. Skipping step.");
  8263. e.printStackTrace();
  8264. }
  8265. loginMessage1 = "Error connecting to server.";
  8266. loginMessage2 = "Go to http://os-pvp.org/ for info.";
  8267. }
  8268.  
  8269. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  8270. int l1, int i2, int j2, boolean flag, int k2) {
  8271. byte byte0 = 104;
  8272. byte byte1 = 104;
  8273. for (int l2 = 0; l2 < byte0; l2++) {
  8274. for (int i3 = 0; i3 < byte1; i3++) {
  8275. anIntArrayArray901[l2][i3] = 0;
  8276. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  8277. }
  8278. }
  8279. int j3 = j2;
  8280. int k3 = j1;
  8281. anIntArrayArray901[j2][j1] = 99;
  8282. anIntArrayArray825[j2][j1] = 0;
  8283. int l3 = 0;
  8284. int i4 = 0;
  8285. bigX[l3] = j2;
  8286. bigY[l3++] = j1;
  8287. boolean flag1 = false;
  8288. int j4 = bigX.length;
  8289. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  8290. while (i4 != l3) {
  8291. j3 = bigX[i4];
  8292. k3 = bigY[i4];
  8293. i4 = (i4 + 1) % j4;
  8294. if (j3 == k2 && k3 == i2) {
  8295. flag1 = true;
  8296. break;
  8297. }
  8298. if (i1 != 0) {
  8299. if ((i1 < 5 || i1 == 10)
  8300. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  8301. i1 - 1, i2)) {
  8302. flag1 = true;
  8303. break;
  8304. }
  8305. if (i1 < 10
  8306. && aClass11Array1230[plane].method220(k2, i2, k3,
  8307. i1 - 1, j, j3)) {
  8308. flag1 = true;
  8309. break;
  8310. }
  8311. }
  8312. if (k1 != 0
  8313. && k != 0
  8314. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  8315. k1, k3)) {
  8316. flag1 = true;
  8317. break;
  8318. }
  8319. int l4 = anIntArrayArray825[j3][k3] + 1;
  8320. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  8321. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  8322. bigX[l3] = j3 - 1;
  8323. bigY[l3] = k3;
  8324. l3 = (l3 + 1) % j4;
  8325. anIntArrayArray901[j3 - 1][k3] = 2;
  8326. anIntArrayArray825[j3 - 1][k3] = l4;
  8327. }
  8328. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  8329. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  8330. bigX[l3] = j3 + 1;
  8331. bigY[l3] = k3;
  8332. l3 = (l3 + 1) % j4;
  8333. anIntArrayArray901[j3 + 1][k3] = 8;
  8334. anIntArrayArray825[j3 + 1][k3] = l4;
  8335. }
  8336. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  8337. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8338. bigX[l3] = j3;
  8339. bigY[l3] = k3 - 1;
  8340. l3 = (l3 + 1) % j4;
  8341. anIntArrayArray901[j3][k3 - 1] = 1;
  8342. anIntArrayArray825[j3][k3 - 1] = l4;
  8343. }
  8344. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  8345. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8346. bigX[l3] = j3;
  8347. bigY[l3] = k3 + 1;
  8348. l3 = (l3 + 1) % j4;
  8349. anIntArrayArray901[j3][k3 + 1] = 4;
  8350. anIntArrayArray825[j3][k3 + 1] = l4;
  8351. }
  8352. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  8353. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  8354. && (ai[j3 - 1][k3] & 0x1280108) == 0
  8355. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8356. bigX[l3] = j3 - 1;
  8357. bigY[l3] = k3 - 1;
  8358. l3 = (l3 + 1) % j4;
  8359. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  8360. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  8361. }
  8362. if (j3 < byte0 - 1 && k3 > 0
  8363. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  8364. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  8365. && (ai[j3 + 1][k3] & 0x1280180) == 0
  8366. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8367. bigX[l3] = j3 + 1;
  8368. bigY[l3] = k3 - 1;
  8369. l3 = (l3 + 1) % j4;
  8370. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  8371. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  8372. }
  8373. if (j3 > 0 && k3 < byte1 - 1
  8374. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  8375. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  8376. && (ai[j3 - 1][k3] & 0x1280108) == 0
  8377. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8378. bigX[l3] = j3 - 1;
  8379. bigY[l3] = k3 + 1;
  8380. l3 = (l3 + 1) % j4;
  8381. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  8382. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  8383. }
  8384. if (j3 < byte0 - 1 && k3 < byte1 - 1
  8385. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  8386. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  8387. && (ai[j3 + 1][k3] & 0x1280180) == 0
  8388. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8389. bigX[l3] = j3 + 1;
  8390. bigY[l3] = k3 + 1;
  8391. l3 = (l3 + 1) % j4;
  8392. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  8393. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  8394. }
  8395. }
  8396. anInt1264 = 0;
  8397. if (!flag1) {
  8398. if (flag) {
  8399. int i5 = 100;
  8400. for (int k5 = 1; k5 < 2; k5++) {
  8401. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  8402. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  8403. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  8404. && anIntArrayArray825[i6][l6] < i5) {
  8405. i5 = anIntArrayArray825[i6][l6];
  8406. j3 = i6;
  8407. k3 = l6;
  8408. anInt1264 = 1;
  8409. flag1 = true;
  8410. }
  8411.  
  8412. }
  8413.  
  8414. if (flag1)
  8415. break;
  8416. }
  8417.  
  8418. }
  8419. if (!flag1)
  8420. return false;
  8421. }
  8422. i4 = 0;
  8423. bigX[i4] = j3;
  8424. bigY[i4++] = k3;
  8425. int l5;
  8426. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  8427. if (j5 != l5) {
  8428. l5 = j5;
  8429. bigX[i4] = j3;
  8430. bigY[i4++] = k3;
  8431. }
  8432. if ((j5 & 2) != 0)
  8433. j3++;
  8434. else if ((j5 & 8) != 0)
  8435. j3--;
  8436. if ((j5 & 1) != 0)
  8437. k3++;
  8438. else if ((j5 & 4) != 0)
  8439. k3--;
  8440. }
  8441. // if(cancelWalk) { return i4 > 0; }
  8442.  
  8443. if (i4 > 0) {
  8444. int k4 = i4;
  8445. if (k4 > 25)
  8446. k4 = 25;
  8447. i4--;
  8448. int k6 = bigX[i4];
  8449. int i7 = bigY[i4];
  8450. anInt1288 += k4;
  8451. if (anInt1288 >= 92) {
  8452. stream.createFrame(36);
  8453. stream.writeDWord(0);
  8454. anInt1288 = 0;
  8455. }
  8456. if (i == 0) {
  8457. stream.createFrame(164);
  8458. stream.writeWordBigEndian(k4 + k4 + 3);
  8459. }
  8460. if (i == 1) {
  8461. stream.createFrame(248);
  8462. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8463. }
  8464. if (i == 2) {
  8465. stream.createFrame(98);
  8466. stream.writeWordBigEndian(k4 + k4 + 3);
  8467. }
  8468. stream.method433(k6 + baseX);
  8469. destX = bigX[0];
  8470. destY = bigY[0];
  8471. for (int j7 = 1; j7 < k4; j7++) {
  8472. i4--;
  8473. stream.writeWordBigEndian(bigX[i4] - k6);
  8474. stream.writeWordBigEndian(bigY[i4] - i7);
  8475. }
  8476.  
  8477. stream.method431(i7 + baseY);
  8478. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8479. return true;
  8480. }
  8481. return i != 1;
  8482. }
  8483.  
  8484. public void method86(Stream stream) {
  8485. for (int j = 0; j < anInt893; j++) {
  8486. int k = anIntArray894[j];
  8487. NPC npc = npcArray[k];
  8488. int l = stream.readUnsignedByte();
  8489. if ((l & 0x10) != 0) {
  8490. int i1 = stream.method434();
  8491. if (i1 == 65535)
  8492. i1 = -1;
  8493. int i2 = stream.readUnsignedByte();
  8494. if (i1 == npc.anim && i1 != -1) {
  8495. int l2 = Animation.anims[i1].anInt365;
  8496. if (l2 == 1) {
  8497. npc.anInt1527 = 0;
  8498. npc.anInt1528 = 0;
  8499. npc.anInt1529 = i2;
  8500. npc.anInt1530 = 0;
  8501. }
  8502. if (l2 == 2)
  8503. npc.anInt1530 = 0;
  8504. } else if (i1 == -1
  8505. || npc.anim == -1
  8506. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  8507. npc.anim = i1;
  8508. npc.anInt1527 = 0;
  8509. npc.anInt1528 = 0;
  8510. npc.anInt1529 = i2;
  8511. npc.anInt1530 = 0;
  8512. npc.anInt1542 = npc.smallXYIndex;
  8513. }
  8514. }
  8515. if ((l & 8) != 0) {
  8516. int j1 = stream.method426();
  8517. int j2 = stream.method427();
  8518. npc.updateHitData(j2, j1, loopCycle);
  8519. npc.loopCycleStatus = loopCycle + 300;
  8520. npc.currentHealth = stream.method426();
  8521. npc.maxHealth = stream.readUnsignedByte();
  8522. }
  8523. if ((l & 0x80) != 0) {
  8524. npc.anInt1520 = stream.readUnsignedWord();
  8525. int k1 = stream.readDWord();
  8526. npc.anInt1524 = k1 >> 16;
  8527. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8528. npc.anInt1521 = 0;
  8529. npc.anInt1522 = 0;
  8530. if (npc.anInt1523 > loopCycle)
  8531. npc.anInt1521 = -1;
  8532. if (npc.anInt1520 == 65535)
  8533. npc.anInt1520 = -1;
  8534. }
  8535. if ((l & 0x20) != 0) {
  8536. npc.interactingEntity = stream.readUnsignedWord();
  8537. if (npc.interactingEntity == 65535)
  8538. npc.interactingEntity = -1;
  8539. }
  8540. if ((l & 1) != 0) {
  8541. npc.textSpoken = stream.readString();
  8542. npc.textCycle = 100;
  8543. }
  8544. if ((l & 0x40) != 0) {
  8545. int l1 = stream.method427();
  8546. int k2 = stream.method428();
  8547. npc.updateHitData(k2, l1, loopCycle);
  8548. npc.loopCycleStatus = loopCycle + 300;
  8549. npc.currentHealth = stream.method428();
  8550. npc.maxHealth = stream.method427();
  8551. }
  8552. if ((l & 2) != 0) {
  8553. npc.desc = EntityDef.forID(stream.method436());
  8554. npc.anInt1540 = npc.desc.aByte68;
  8555. npc.anInt1504 = npc.desc.anInt79;
  8556. npc.anInt1554 = npc.desc.walkAnim;
  8557. npc.anInt1555 = npc.desc.anInt58;
  8558. npc.anInt1556 = npc.desc.anInt83;
  8559. npc.anInt1557 = npc.desc.anInt55;
  8560. npc.anInt1511 = npc.desc.standAnim;
  8561. }
  8562. if ((l & 4) != 0) {
  8563. npc.anInt1538 = stream.method434();
  8564. npc.anInt1539 = stream.method434();
  8565. }
  8566. }
  8567. }
  8568.  
  8569. public void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  8570. if (menuActionRow >= 400)
  8571. return;
  8572. if (entityDef.childrenIDs != null)
  8573. entityDef = entityDef.method161();
  8574. if (entityDef == null)
  8575. return;
  8576. if (!entityDef.aBoolean84)
  8577. return;
  8578. String s = entityDef.name;
  8579. if (entityDef.combatLevel != 0)
  8580. s = s
  8581. + combatDiffColor(myPlayer.combatLevel,
  8582. entityDef.combatLevel) + " (level-"
  8583. + entityDef.combatLevel + ")";
  8584. if (itemSelected == 1) {
  8585. menuActionName[menuActionRow] = "Use " + selectedItemName
  8586. + " with @yel@" + s;
  8587. menuActionID[menuActionRow] = 582;
  8588. menuActionCmd1[menuActionRow] = i;
  8589. menuActionCmd2[menuActionRow] = k;
  8590. menuActionCmd3[menuActionRow] = j;
  8591. menuActionRow++;
  8592. return;
  8593. }
  8594. if (spellSelected == 1) {
  8595. if ((spellUsableOn & 2) == 2) {
  8596. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8597. menuActionID[menuActionRow] = 413;
  8598. menuActionCmd1[menuActionRow] = i;
  8599. menuActionCmd2[menuActionRow] = k;
  8600. menuActionCmd3[menuActionRow] = j;
  8601. menuActionRow++;
  8602. }
  8603. } else {
  8604. if (entityDef.actions != null) {
  8605. for (int l = 4; l >= 0; l--)
  8606. if (entityDef.actions[l] != null
  8607. && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  8608. menuActionName[menuActionRow] = entityDef.actions[l]
  8609. + " @yel@" + s;
  8610. if (l == 0)
  8611. menuActionID[menuActionRow] = 20;
  8612. if (l == 1)
  8613. menuActionID[menuActionRow] = 412;
  8614. if (l == 2)
  8615. menuActionID[menuActionRow] = 225;
  8616. if (l == 3)
  8617. menuActionID[menuActionRow] = 965;
  8618. if (l == 4)
  8619. menuActionID[menuActionRow] = 478;
  8620. menuActionCmd1[menuActionRow] = i;
  8621. menuActionCmd2[menuActionRow] = k;
  8622. menuActionCmd3[menuActionRow] = j;
  8623. menuActionRow++;
  8624. }
  8625.  
  8626. }
  8627. if (entityDef.actions != null) {
  8628. for (int i1 = 4; i1 >= 0; i1--)
  8629. if (entityDef.actions[i1] != null
  8630. && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  8631. char c = '\0';
  8632. if (variousSettings[315] != 0) {
  8633. c = '\u07D0';
  8634. }
  8635. menuActionName[menuActionRow] = entityDef.actions[i1]
  8636. + " @yel@" + s;
  8637. if (i1 == 0)
  8638. menuActionID[menuActionRow] = 20 + c;
  8639. if (i1 == 1)
  8640. menuActionID[menuActionRow] = 412 + c;
  8641. if (i1 == 2)
  8642. menuActionID[menuActionRow] = 225 + c;
  8643. if (i1 == 3)
  8644. menuActionID[menuActionRow] = 965 + c;
  8645. if (i1 == 4)
  8646. menuActionID[menuActionRow] = 478 + c;
  8647. menuActionCmd1[menuActionRow] = i;
  8648. menuActionCmd2[menuActionRow] = k;
  8649. menuActionCmd3[menuActionRow] = j;
  8650. menuActionRow++;
  8651. }
  8652.  
  8653. }
  8654. // menuActionName[menuActionRow] = "Examine @yel@" + s +
  8655. // " @gre@(@whi@" + entityDef.type + "@gre@)";
  8656. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8657. menuActionID[menuActionRow] = 1025;
  8658. menuActionCmd1[menuActionRow] = i;
  8659. menuActionCmd2[menuActionRow] = k;
  8660. menuActionCmd3[menuActionRow] = j;
  8661. menuActionRow++;
  8662. }
  8663. }
  8664.  
  8665. public void buildAtPlayerMenu(int i, int j, Player player, int k) {
  8666. if (player == myPlayer)
  8667. return;
  8668. if (!player.visible)
  8669. return;
  8670. if (menuActionRow >= 400)
  8671. return;
  8672. String s;
  8673. if (player.title.length() < 0)
  8674. s = player.name
  8675. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8676. + " (level: " + player.combatLevel + ")";
  8677. else if (player.title.length() != 0)
  8678. s = "@or1@" + player.title + "@whi@ " + player.name
  8679. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8680. + " (level: " + player.combatLevel + ")";
  8681. else
  8682. s = player.name
  8683. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8684. + " (level: " + player.combatLevel + ")";
  8685. if (itemSelected == 1) {
  8686. menuActionName[menuActionRow] = "Use " + selectedItemName
  8687. + " with @whi@" + s;
  8688. menuActionID[menuActionRow] = 491;
  8689. menuActionCmd1[menuActionRow] = j;
  8690. menuActionCmd2[menuActionRow] = i;
  8691. menuActionCmd3[menuActionRow] = k;
  8692. menuActionRow++;
  8693. } else if (spellSelected == 1) {
  8694. if ((spellUsableOn & 8) == 8) {
  8695. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8696. menuActionID[menuActionRow] = 365;
  8697. menuActionCmd1[menuActionRow] = j;
  8698. menuActionCmd2[menuActionRow] = i;
  8699. menuActionCmd3[menuActionRow] = k;
  8700. menuActionRow++;
  8701. }
  8702. } else {
  8703. for (int l = 5; l >= 0; l--)
  8704. if (atPlayerActions[l] != null) {
  8705. menuActionName[menuActionRow] = atPlayerActions[l]
  8706. + " @whi@" + s;
  8707. char c = '\0';
  8708. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  8709. if (variousSettings[315] != 0) {
  8710. c = '\u07D0';
  8711. }
  8712. if (myPlayer.team != 0 && player.team != 0)
  8713. if (myPlayer.team == player.team)
  8714. c = '\u07D0';
  8715. else
  8716. c = '\0';
  8717. } else if (atPlayerArray[l])
  8718. c = '\u07D0';
  8719. if (l == 0)
  8720. menuActionID[menuActionRow] = 561 + c;
  8721. if (l == 1)
  8722. menuActionID[menuActionRow] = 779 + c;
  8723. if (l == 2)
  8724. menuActionID[menuActionRow] = 27 + c;
  8725. if (l == 3)
  8726. menuActionID[menuActionRow] = 577 + c;
  8727. if (l == 4)
  8728. menuActionID[menuActionRow] = 729 + c;
  8729. if (l == 5) {
  8730. if (myPlayer.getRights() > 0 && myPlayer.getRights() < 4) {
  8731. menuActionID[menuActionRow] = 745 + c;
  8732. } else {
  8733. continue;
  8734. }
  8735. }
  8736. menuActionCmd1[menuActionRow] = j;
  8737. menuActionCmd2[menuActionRow] = i;
  8738. menuActionCmd3[menuActionRow] = k;
  8739. menuActionRow++;
  8740. }
  8741.  
  8742. }
  8743. for (int i1 = 0; i1 < menuActionRow; i1++)
  8744. if (menuActionID[i1] == 516) {
  8745. menuActionName[i1] = "Walk here @whi@" + s;
  8746. return;
  8747. }
  8748.  
  8749. }
  8750.  
  8751. public void method89(Class30_Sub1 class30_sub1) {
  8752. int i = 0;
  8753. int j = -1;
  8754. int k = 0;
  8755. int l = 0;
  8756. if (class30_sub1.anInt1296 == 0)
  8757. i = worldController.method300(class30_sub1.anInt1295,
  8758. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8759. if (class30_sub1.anInt1296 == 1)
  8760. i = worldController.method301(class30_sub1.anInt1295,
  8761. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8762. if (class30_sub1.anInt1296 == 2)
  8763. i = worldController.method302(class30_sub1.anInt1295,
  8764. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8765. if (class30_sub1.anInt1296 == 3)
  8766. i = worldController.method303(class30_sub1.anInt1295,
  8767. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8768. if (i != 0) {
  8769. int i1 = worldController.method304(class30_sub1.anInt1295,
  8770. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8771. j = i >> 14 & 0x7fff;
  8772. k = i1 & 0x1f;
  8773. l = i1 >> 6;
  8774. }
  8775. class30_sub1.anInt1299 = j;
  8776. class30_sub1.anInt1301 = k;
  8777. class30_sub1.anInt1300 = l;
  8778. }
  8779.  
  8780. public void method90() {
  8781. for (int i = 0; i < anInt1062; i++)
  8782. if (anIntArray1250[i] <= 0) {
  8783. boolean flag1 = false;
  8784. try {
  8785. if (anIntArray1207[i] == anInt874
  8786. && anIntArray1241[i] == anInt1289) {
  8787. if (!replayWave())
  8788. flag1 = true;
  8789. } else {
  8790. Stream stream = Sounds.method241(anIntArray1241[i],
  8791. anIntArray1207[i]);
  8792. if (System.currentTimeMillis() + stream.currentOffset
  8793. / 22 > aLong1172 + anInt1257 / 22) {
  8794. anInt1257 = stream.currentOffset;
  8795. aLong1172 = System.currentTimeMillis();
  8796. if (saveWave(stream.buffer, stream.currentOffset)) {
  8797. anInt874 = anIntArray1207[i];
  8798. anInt1289 = anIntArray1241[i];
  8799. } else {
  8800. flag1 = true;
  8801. }
  8802. }
  8803. }
  8804. } catch (Exception exception) {
  8805. }
  8806. if (!flag1 || anIntArray1250[i] == -5) {
  8807. anInt1062--;
  8808. for (int j = i; j < anInt1062; j++) {
  8809. anIntArray1207[j] = anIntArray1207[j + 1];
  8810. anIntArray1241[j] = anIntArray1241[j + 1];
  8811. anIntArray1250[j] = anIntArray1250[j + 1];
  8812. }
  8813.  
  8814. i--;
  8815. } else {
  8816. anIntArray1250[i] = -5;
  8817. }
  8818. } else {
  8819. anIntArray1250[i]--;
  8820. }
  8821.  
  8822. if (prevSong > 0) {
  8823. prevSong -= 20;
  8824. if (prevSong < 0)
  8825. prevSong = 0;
  8826. if (prevSong == 0 && musicEnabled && !lowMem) {
  8827. nextSong = currentSong;
  8828. songChanging = true;
  8829. onDemandFetcher.method558(2, nextSong);
  8830. }
  8831. }
  8832. }
  8833.  
  8834. public void objectFill(final int objectId, final int x1, final int y1,
  8835. final int x2, final int y2, final int type, final int face,
  8836. final int height) {
  8837. // if(height == height) // dunno your height variable but refactor
  8838. // yourself
  8839. for (int x = x1; x <= x2; x++) {
  8840. for (int y = y1; y <= y2; y++) {
  8841. addObject(objectId, x, y, face, type, height);
  8842. }
  8843. }
  8844. }
  8845.  
  8846. public void addObject(int objectId, int x, int y, int face, int type,
  8847. int height) {
  8848. int mX = MapX - 6;
  8849. int mY = MapY - 6;
  8850. int x2 = x - (mX * 8);
  8851. int y2 = y - (mY * 8);
  8852. int i15 = 40 >> 2;
  8853. int l17 = anIntArray1177[i15];
  8854. if (y2 > 0 && y2 < 103 && x2 > 0 && x2 < 103) {
  8855. method130(-1, objectId, face, l17, y2, type, height, x2, 0);
  8856. }
  8857. }
  8858.  
  8859. public void loadNewObjects() {
  8860. /*
  8861. * Lumbridge
  8862. */
  8863. objectFill(-1, 3205, 3209, 3214, 3228, 10, 0, 0); // Lumb
  8864. objectFill(3045, 3207, 3219, 3210, 3219, 10, 0, 0); // Bank
  8865. addObject(1000, 3206, 3218, 0, 2, 0); // Rope
  8866. addObject(1000, 3211, 3218, 1, 2, 0); // Rope
  8867. addObject(2734, 3209, 3224, 1, 22, 0); // Shop Icon
  8868. addObject(2738, 3209, 3220, 1, 22, 0); // Bank Icon
  8869. addObject(-1, 3221, 3210, 1, 10, 0); // Remove
  8870. addObject(-1, 3221, 3226, 1, 10, 0); // Remove
  8871. addObject(2752, 3222, 3211, 1, 22, 0); // Prayer Icon
  8872. addObject(2752, 3222, 3226, 1, 22, 0); // Prayer Icon
  8873. addObject(409, 3221, 3210, 0, 10, 0); // Prayer
  8874. addObject(412, 3221, 3227, 0, 10, 0); // Special
  8875. addObject(6552, 3212, 3223, 1, 10, 0); // Ancient
  8876. }
  8877.  
  8878. public void cachePackAnimations() {
  8879. for (int AnimIndex = 0; AnimIndex <= 5000; AnimIndex++) {
  8880. byte[] abyte0 = getAnimsToPack(AnimIndex);
  8881. if (abyte0 != null && abyte0.length > 0) {
  8882. decompressors[2].method234(abyte0.length, abyte0, AnimIndex);
  8883. System.out.println("Animation File ID: " + AnimIndex
  8884. + " has been added to the cache");
  8885. }
  8886. }
  8887. }
  8888.  
  8889. public byte[] getAnimsToPack(int index) {
  8890. try {
  8891. File model = new File("Animfiles/" + index + ".gz");
  8892. byte[] aByte = new byte[(int) model.length()];
  8893. FileInputStream Fis = new FileInputStream(model);
  8894. Fis.read(aByte);
  8895. Fis.close();
  8896. return aByte;
  8897. } catch (Exception e) {
  8898. return null;
  8899. }
  8900. }
  8901.  
  8902. @Override
  8903. void startUp() {
  8904. drawSmoothLoading(16, "Starting up - This can take a few minutes");
  8905. new CacheDownloader(this).downloadCache();
  8906. if (signlink.sunjava)
  8907. super.minDelay = 5;
  8908. if (aBoolean993) {
  8909. // rsAlreadyLoaded = true;
  8910. // return;
  8911. }
  8912. aBoolean993 = true;
  8913. getDocumentBaseHost();
  8914. if (signlink.cache_dat != null) {
  8915. for (int i = 0; i < 5; i++)
  8916. decompressors[i] = new Decompressor(signlink.cache_dat,
  8917. signlink.cache_idx[i], i + 1);
  8918. }
  8919. try {
  8920. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  8921. expectedCRCs[1], 25);
  8922. smallText = new TextDrawingArea(false, "p11_full",
  8923. titleStreamLoader);
  8924. XPFONT = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8925. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full",
  8926. titleStreamLoader);
  8927. chatTextDrawingArea = new TextDrawingArea(false, "b12_full",
  8928. titleStreamLoader);
  8929. aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full",
  8930. titleStreamLoader);
  8931. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  8932. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  8933. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  8934. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  8935. drawLogo();
  8936. loadTitleScreen();
  8937. StreamLoader streamLoader = streamLoaderForName(2, "config",
  8938. "config", expectedCRCs[2], 30);
  8939. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  8940. "interface", expectedCRCs[3], 35);
  8941. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  8942. "media", expectedCRCs[4], 40);
  8943. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  8944. "textures", expectedCRCs[6], 45);
  8945. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  8946. "wordenc", expectedCRCs[7], 50);
  8947. StreamLoader streamLoader_5 = streamLoaderForName(8,
  8948. "sound effects", "sounds", expectedCRCs[8], 55);
  8949. byteGroundArray = new byte[4][104][104];
  8950. intGroundArray = new int[4][105][105];
  8951. worldController = new WorldController(intGroundArray);
  8952. for (int j = 0; j < 4; j++)
  8953. aClass11Array1230[j] = new Class11();
  8954.  
  8955. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  8956. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  8957. "versionlist", expectedCRCs[5], 60);
  8958. drawSmoothLoading(48, "Connecting to update server");
  8959. onDemandFetcher = new OnDemandFetcher();
  8960. onDemandFetcher.start(streamLoader_6, this);// hold ur thumbs i was
  8961. // gonna say lol oops
  8962.  
  8963. Class36.method528();
  8964.  
  8965. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8966. // preloadModels();
  8967. drawSmoothLoading(112, "Unpacking media");
  8968. Sprite[] clanIcons = new Sprite[9];
  8969. for (int index = 0; index < clanIcons.length; index++) {
  8970. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);
  8971. }
  8972. mapArea = new Sprite("maparea");
  8973. for (int i = 1; i <= ORBS.length - 1; i++) {
  8974. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS " + i + "");
  8975. }
  8976. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8977. chatArea = new Sprite("Gameframe/chatarea");
  8978. tabArea = new Sprite("Gameframe/tabarea");
  8979. globe = new Sprite("globe");
  8980. magicAuto = new Sprite("magicAuto");
  8981. backgroundFix = new Sprite("loginscreen/background");
  8982. logIconH = new Sprite("logiconh");
  8983. logIconC = new Sprite("logiconc");
  8984. logIcon = new Sprite("logicon");
  8985. xpSprite = new Sprite("medal");
  8986. for (int i = 0; i < inputSprites.length; i++)
  8987. inputSprites[i] = new Sprite("Interfaces/Inputfield/SPRITE "
  8988. + (i + 1));
  8989. //repackCacheIndex(1);
  8990. //repackCacheIndex(2);
  8991. //repackCacheIndex(4);
  8992. // cachePackAnimations();
  8993. for (int i = 0; i < 4; i++) {
  8994. counter[i] = new Sprite("Gameframe/XP " + i);
  8995. }
  8996. for (int i = 0; i < 60; i ++) {
  8997. cacheSprite[i] = new Sprite("Sprites/" + i);
  8998. }
  8999. tabArea474 = new Sprite("tabarea474");
  9000. mapArea474 = new Sprite("maparea474");
  9001. mapArea508 = new Sprite("maparea508");
  9002. tabArea508 = new Sprite("tabarea508");
  9003. mapBack = new Background(streamLoader_2, "mapback", 0);
  9004. for (int c1 = 0; c1 <= 3; c1++)
  9005. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  9006. for (int j3 = 0; j3 <= 14; j3++)
  9007. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  9008. for (int r1 = 0; r1 < 5; r1++)
  9009. redStones[r1] = new Sprite("Gameframe/redstones " + r1);
  9010. RSFont.unpackImages(modIcons, clanIcons);
  9011. compass = new Sprite(streamLoader_2, "compass", 0);
  9012. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  9013. mapEdge.method345();
  9014. try {
  9015. for (int k3 = 0; k3 < 100; k3++)
  9016. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  9017. k3);
  9018. } catch (Exception _ex) {
  9019. }
  9020. try {
  9021. for (int l3 = 0; l3 < 100; l3++)
  9022. mapFunctions[l3] = new Sprite(streamLoader_2,
  9023. "mapfunction", l3);
  9024. } catch (Exception _ex) {
  9025. }
  9026. try {
  9027. for (int i4 = 0; i4 < 20; i4++) {
  9028. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  9029. }
  9030. } catch (Exception _ex) {
  9031. }
  9032. try {
  9033. for (int h1 = 0; h1 < 6; h1++)
  9034. headIconsHint[h1] = new Sprite(streamLoader_2,
  9035. "headicons_hint", h1);
  9036. } catch (Exception _ex) {
  9037. }
  9038. try {
  9039. for (int j4 = 0; j4 < 8; j4++)
  9040. headIcons[j4] = new Sprite(streamLoader_2,
  9041. "headicons_prayer", j4);
  9042. for (int j45 = 0; j45 < 3; j45++)
  9043. skullIcons[j45] = new Sprite(streamLoader_2,
  9044. "headicons_pk", j45);
  9045. } catch (Exception _ex) {
  9046. }
  9047. for (int i = 0; i < minimapIcons.length; i++) {
  9048. minimapIcons[i] = new Sprite("Mapicons/ICON " + i);
  9049. }
  9050. for (int i = 0; i < expDrops.length; i++) {
  9051. expDrops[i] = new Sprite("expcounter/" + i);
  9052. }
  9053. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  9054. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  9055. for (int k4 = 0; k4 < 8; k4++)
  9056. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  9057.  
  9058. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  9059. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  9060. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  9061. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  9062. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  9063. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  9064. new Sprite(streamLoader_2, "mapdots", 4);
  9065. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  9066. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  9067. for (int i = 0; i <= 14; i++) {
  9068. modIcons[i] = new Sprite("Player/MODICONS " + i + "");
  9069. }
  9070.  
  9071. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  9072. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9073. getGameComponent());
  9074. sprite.method346(0, 0);
  9075. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  9076. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9077. getGameComponent());
  9078. sprite.method346(0, 0);
  9079. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  9080. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9081. getGameComponent());
  9082. sprite.method346(0, 0);
  9083. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  9084. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9085. getGameComponent());
  9086. sprite.method346(0, 0);
  9087. int i5 = (int) (Math.random() * 21D) - 10;
  9088. int j5 = (int) (Math.random() * 21D) - 10;
  9089. int k5 = (int) (Math.random() * 21D) - 10;
  9090. int l5 = (int) (Math.random() * 41D) - 20;
  9091. for (int i6 = 0; i6 < 100; i6++) {
  9092. if (mapFunctions[i6] != null)
  9093. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  9094. if (mapScenes[i6] != null)
  9095. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  9096. }
  9097.  
  9098. drawSmoothLoading(140, "Unpacking textures");
  9099. Texture.method368(streamLoader_3);
  9100. Texture.method372(0.80000000000000004D);
  9101. Texture.method367();
  9102. drawSmoothLoading(150, "Unpacking config");
  9103. Animation.unpackConfig(streamLoader);
  9104. ObjectDef.unpackConfig(streamLoader);
  9105. Flo.unpackConfig(streamLoader);
  9106. OverlayFlo.unpackConfig(streamLoader);
  9107. ItemDef.unpackConfig(streamLoader);
  9108. EntityDef.unpackConfig(streamLoader);
  9109. IDK.unpackConfig(streamLoader);
  9110. SpotAnim.unpackConfig(streamLoader);
  9111. Varp.unpackConfig(streamLoader);
  9112. VarBit.unpackConfig(streamLoader);
  9113. //dumpModels();
  9114. ItemDef.isMembers = isMembers;
  9115. //EntityDef.dumpSizes();
  9116. /*
  9117. * if (!lowMem) { drawSmoothLoading(150, "Unpacking sounds"); byte
  9118. * abyte0[] = streamLoader_5.getDataForName("sounds.dat"); Stream
  9119. * stream = new Stream(abyte0); Sounds.unpack(stream); }
  9120. */
  9121. drawSmoothLoading(180, "Unpacking interfaces");
  9122. TextDrawingArea allFonts[] = { smallText, aTextDrawingArea_1271,
  9123. chatTextDrawingArea, aTextDrawingArea_1273 };
  9124. RSInterface.unpack(streamLoader_1, allFonts, streamLoader_2);
  9125. drawSmoothLoading(203, "Preparing game engine");
  9126. for (int j6 = 0; j6 < 33; j6++) {
  9127. int k6 = 999;
  9128. int i7 = 0;
  9129. for (int k7 = 0; k7 < 34; k7++) {
  9130. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  9131. if (k6 == 999)
  9132. k6 = k7;
  9133. continue;
  9134. }
  9135. if (k6 == 999)
  9136. continue;
  9137. i7 = k7;
  9138. break;
  9139. }
  9140.  
  9141. anIntArray968[j6] = k6;
  9142. anIntArray1057[j6] = i7 - k6;
  9143. }
  9144.  
  9145. for (int l6 = 5; l6 < 156; l6++) {
  9146. int j7 = 999;
  9147. int l7 = 0;
  9148. for (int j8 = 25; j8 < 172; j8++) {
  9149. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0
  9150. && (j8 > 34 || l6 > 34)) {
  9151. if (j7 == 999)
  9152. j7 = j8;
  9153. continue;
  9154. }
  9155. if (j7 == 999)
  9156. continue;
  9157. l7 = j8;
  9158. break;
  9159. }
  9160.  
  9161. anIntArray1052[l6 - 5] = j7 - 25;
  9162. anIntArray1229[l6 - 5] = l7 - j7;
  9163. }
  9164.  
  9165. Texture.method365(765, 503);
  9166. fullScreenTextureArray = Texture.anIntArray1472;
  9167. Texture.method365(519, 165);
  9168. anIntArray1180 = Texture.anIntArray1472;
  9169. Texture.method365(246, 335);
  9170. anIntArray1181 = Texture.anIntArray1472;
  9171. Texture.method365(512, 334);
  9172. anIntArray1182 = Texture.anIntArray1472;
  9173. int ai[] = new int[9];
  9174. for (int i8 = 0; i8 < 9; i8++) {
  9175. int k8 = 128 + i8 * 32 + 15;
  9176. int l8 = 600 + k8 * 3;
  9177. int i9 = Texture.anIntArray1470[k8];
  9178. ai[i8] = l8 * i9 >> 16;
  9179. }
  9180. try {
  9181. macAddress = new MacAddress(InetAddress.getLocalHost())
  9182. .toString();
  9183. } catch (Exception e) {
  9184. e.printStackTrace();
  9185. }
  9186. WorldController.method310(500, 800, 512, 334, ai);
  9187. Censor.loadConfig(streamLoader_4);
  9188. // dumpModels();
  9189. mouseDetection = new MouseDetection(this);
  9190. startRunnable(mouseDetection, 10);
  9191. Animable_Sub5.clientInstance = this;
  9192. ObjectDef.clientInstance = this;
  9193. EntityDef.clientInstance = this;
  9194. Class36.clientInstance = this;
  9195. return;
  9196. } catch (Exception exception) {
  9197. exception.printStackTrace();
  9198. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  9199. }
  9200. loadingError = true;
  9201. }
  9202.  
  9203. public void method91(Stream stream, int i) {
  9204. while (stream.bitPosition + 10 < i * 8) {
  9205. int j = stream.readBits(11);
  9206. if (j == 2047)
  9207. break;
  9208. if (playerArray[j] == null) {
  9209. playerArray[j] = new Player();
  9210. if (aStreamArray895s[j] != null)
  9211. playerArray[j].updatePlayer(aStreamArray895s[j]);
  9212. }
  9213. playerIndices[playerCount++] = j;
  9214. Player player = playerArray[j];
  9215. player.anInt1537 = loopCycle;
  9216. int k = stream.readBits(1);
  9217. if (k == 1)
  9218. anIntArray894[anInt893++] = j;
  9219. int l = stream.readBits(1);
  9220. int i1 = stream.readBits(5);
  9221. if (i1 > 15)
  9222. i1 -= 32;
  9223. int j1 = stream.readBits(5);
  9224. if (j1 > 15)
  9225. j1 -= 32;
  9226. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  9227. l == 1);
  9228. }
  9229. stream.finishBitAccess();
  9230. }
  9231. public boolean inCircle(int circleX, int circleY, int clickX, int clickY, int radius) {
  9232. return java.lang.Math.pow((circleX + radius - clickX), 2) + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math.pow(radius, 2);
  9233. }
  9234.  
  9235. private void teleport(int x, int z) {
  9236. String text = "::tele " + x + " " + z;
  9237. stream.createFrame(103);
  9238. stream.writeWordBigEndian(text.length() - 1);
  9239. stream.writeString(text.substring(2));
  9240. }
  9241.  
  9242. private void processMainScreenClick() {
  9243. if (revision474 == true) {
  9244. if (anInt1021 != 0)
  9245. return;
  9246. if (super.clickMode3 == 1) {
  9247. int i = super.saveClickX - 25 - 547;
  9248. int j = super.saveClickY - 5 - 3;
  9249. if (inCircle(0, 0, i, j, 72) && !runHover) {
  9250. i -= 73;
  9251. j -= 75;
  9252. int k = viewRotation + minimapRotation & 0x7ff;
  9253. int i1 = Texture.anIntArray1470[k];
  9254. int j1 = Texture.anIntArray1471[k];
  9255. i1 = i1 * (minimapZoom + 256) >> 8;
  9256. j1 = j1 * (minimapZoom + 256) >> 8;
  9257. int k1 = j * i1 + i * j1 >> 11;
  9258. int l1 = j * j1 - i * i1 >> 11;
  9259. int i2 = myPlayer.x + k1 >> 7;
  9260. int j2 = myPlayer.y - l1 >> 7;
  9261. if (myPrivilege == 2 && ctrlPressed) {
  9262. teleport(baseX + i2, baseY + j2);
  9263. } else {
  9264. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0,
  9265. 0, j2, myPlayer.smallX[0], true, i2);
  9266. if (flag1) {
  9267. stream.writeWordBigEndian(i);
  9268. stream.writeWordBigEndian(j);
  9269. stream.writeWord(viewRotation);
  9270. stream.writeWordBigEndian(57);
  9271. stream.writeWordBigEndian(minimapRotation);
  9272. stream.writeWordBigEndian(minimapZoom);
  9273. stream.writeWordBigEndian(89);
  9274. stream.writeWord(myPlayer.x);
  9275. stream.writeWord(myPlayer.y);
  9276. stream.writeWordBigEndian(anInt1264);
  9277. stream.writeWordBigEndian(63);
  9278. }
  9279. }
  9280. }
  9281. anInt1117++;
  9282. if (anInt1117 > 1151) {
  9283. anInt1117 = 0;
  9284. stream.createFrame(246);
  9285. stream.writeWordBigEndian(0);
  9286. int l = stream.currentOffset;
  9287. if ((int) (Math.random() * 2D) == 0)
  9288. stream.writeWordBigEndian(101);
  9289. stream.writeWordBigEndian(197);
  9290. stream.writeWord((int) (Math.random() * 65536D));
  9291. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9292. stream.writeWordBigEndian(67);
  9293. stream.writeWord(14214);
  9294. if ((int) (Math.random() * 2D) == 0)
  9295. stream.writeWord(29487);
  9296. stream.writeWord((int) (Math.random() * 65536D));
  9297. if ((int) (Math.random() * 2D) == 0)
  9298. stream.writeWordBigEndian(220);
  9299. stream.writeWordBigEndian(180);
  9300. stream.writeBytes(stream.currentOffset - l);
  9301. }
  9302. }
  9303. } else if (revision498 == true || revision508 == true) {
  9304. if (anInt1021 != 0)
  9305. return;
  9306. if (super.clickMode3 == 1) {
  9307. if (super.clickMode3 == 1) {
  9308. int i = super.saveClickX - 20 - 545;
  9309. int j = super.saveClickY - 4 - 4;
  9310. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  9311. i -= 73;
  9312. j -= 75;
  9313. int k = viewRotation + minimapRotation & 0x7ff;
  9314. int i1 = Texture.anIntArray1470[k];
  9315. int j1 = Texture.anIntArray1471[k];
  9316. i1 = i1 * (minimapZoom + 256) >> 8;
  9317. j1 = j1 * (minimapZoom + 256) >> 8;
  9318. int k1 = j * i1 + i * j1 >> 11;
  9319. int l1 = j * j1 - i * i1 >> 11;
  9320. int i2 = myPlayer.x + k1 >> 7;
  9321. int j2 = myPlayer.y - l1 >> 7;
  9322. boolean flag1 = doWalkTo(1, 0, 0, 0,
  9323. myPlayer.smallY[0], 0, 0, j2,
  9324. myPlayer.smallX[0], true, i2);
  9325. if (flag1) {
  9326. stream.writeWordBigEndian(i);
  9327. stream.writeWordBigEndian(j);
  9328. stream.writeWord(viewRotation);
  9329. stream.writeWordBigEndian(57);
  9330. stream.writeWordBigEndian(minimapRotation);
  9331. stream.writeWordBigEndian(minimapZoom);
  9332. stream.writeWordBigEndian(89);
  9333. stream.writeWord(myPlayer.x);
  9334. stream.writeWord(myPlayer.y);
  9335. stream.writeWordBigEndian(anInt1264);
  9336. stream.writeWordBigEndian(63);
  9337. }
  9338. }
  9339. }
  9340. anInt1117++;
  9341. if (anInt1117 > 1151) {
  9342. anInt1117 = 0;
  9343. stream.createFrame(246);
  9344. stream.writeWordBigEndian(0);
  9345. int l = stream.currentOffset;
  9346. if ((int) (Math.random() * 2D) == 0)
  9347. stream.writeWordBigEndian(101);
  9348. stream.writeWordBigEndian(197);
  9349. stream.writeWord((int) (Math.random() * 65536D));
  9350. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9351. stream.writeWordBigEndian(67);
  9352. stream.writeWord(14214);
  9353. if ((int) (Math.random() * 2D) == 0)
  9354. stream.writeWord(29487);
  9355. stream.writeWord((int) (Math.random() * 65536D));
  9356. if ((int) (Math.random() * 2D) == 0)
  9357. stream.writeWordBigEndian(220);
  9358. stream.writeWordBigEndian(180);
  9359. stream.writeBytes(stream.currentOffset - l);
  9360. }
  9361. }
  9362. }
  9363. }
  9364.  
  9365. private String interfaceIntToString(int j) {
  9366. if (j < 0x3b9ac9ff)
  9367. return String.valueOf(j);
  9368. else
  9369. return "*";
  9370. }
  9371.  
  9372. public void showErrorScreen() {
  9373. Graphics g = getGameComponent().getGraphics();
  9374. g.setColor(Color.black);
  9375. g.fillRect(0, 0, 765, 503);
  9376. method4(1);
  9377. if (loadingError) {
  9378. aBoolean831 = false;
  9379. g.setFont(new Font("Helvetica", 1, 16));
  9380. g.setColor(Color.yellow);
  9381. int k = 35;
  9382. g.drawString(
  9383. "Sorry, an error has occured whilst loading RuneScape", 30,
  9384. k);
  9385. k += 50;
  9386. g.setColor(Color.white);
  9387. g.drawString("To fix this try the following (in order):", 30, k);
  9388. k += 50;
  9389. g.setColor(Color.white);
  9390. g.setFont(new Font("Helvetica", 1, 12));
  9391. g.drawString(
  9392. "1: Try closing ALL open web-browser windows, and reloading",
  9393. 30, k);
  9394. k += 30;
  9395. g.drawString(
  9396. "2: Try clearing your web-browsers cache from tools->internet options",
  9397. 30, k);
  9398. k += 30;
  9399. g.drawString("3: Try using a different game-world", 30, k);
  9400. k += 30;
  9401. g.drawString("4: Try rebooting your computer", 30, k);
  9402. k += 30;
  9403. g.drawString(
  9404. "5: Try selecting a different version of Java from the play-game menu",
  9405. 30, k);
  9406. }
  9407. if (genericLoadingError) {
  9408. aBoolean831 = false;
  9409. g.setFont(new Font("Helvetica", 1, 20));
  9410. g.setColor(Color.white);
  9411. g.drawString("Error - unable to load game!", 50, 50);
  9412. g.drawString("To play RuneScape make sure you play from", 50, 100);
  9413. g.drawString("http://www.RuneScape.com", 50, 150);
  9414. }
  9415. if (rsAlreadyLoaded) {
  9416. aBoolean831 = false;
  9417. g.setColor(Color.yellow);
  9418. int l = 35;
  9419. g.drawString(
  9420. "Error a copy of RuneScape already appears to be loaded",
  9421. 30, l);
  9422. l += 50;
  9423. g.setColor(Color.white);
  9424. g.drawString("To fix this try the following (in order):", 30, l);
  9425. l += 50;
  9426. g.setColor(Color.white);
  9427. g.setFont(new Font("Helvetica", 1, 12));
  9428. g.drawString(
  9429. "1: Try closing ALL open web-browser windows, and reloading",
  9430. 30, l);
  9431. l += 30;
  9432. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  9433. l += 30;
  9434. }
  9435. }
  9436.  
  9437. @Override
  9438. public URL getCodeBase() {
  9439. try {
  9440. return new URL(server + ":" + (80 + portOff));
  9441. } catch (Exception _ex) {
  9442. }
  9443. return null;
  9444. }
  9445.  
  9446. public void method95() {
  9447. for (int j = 0; j < npcCount; j++) {
  9448. int k = npcIndices[j];
  9449. NPC npc = npcArray[k];
  9450. if (npc != null)
  9451. method96(npc);
  9452. }
  9453. }
  9454.  
  9455. public void method96(Entity entity) {
  9456. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  9457. || entity.y >= 13184) {
  9458. entity.anim = -1;
  9459. entity.anInt1520 = -1;
  9460. entity.anInt1547 = 0;
  9461. entity.anInt1548 = 0;
  9462. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9463. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9464. entity.method446();
  9465. }
  9466. if (entity == myPlayer
  9467. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  9468. entity.anim = -1;
  9469. entity.anInt1520 = -1;
  9470. entity.anInt1547 = 0;
  9471. entity.anInt1548 = 0;
  9472. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9473. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9474. entity.method446();
  9475. }
  9476. if (entity.anInt1547 > loopCycle)
  9477. method97(entity);
  9478. else if (entity.anInt1548 >= loopCycle)
  9479. method98(entity);
  9480. else
  9481. method99(entity);
  9482. method100(entity);
  9483. method101(entity);
  9484. }
  9485.  
  9486. public void method97(Entity entity) {
  9487. int i = entity.anInt1547 - loopCycle;
  9488. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9489. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9490. entity.x += (j - entity.x) / i;
  9491. entity.y += (k - entity.y) / i;
  9492. entity.anInt1503 = 0;
  9493. if (entity.anInt1549 == 0)
  9494. entity.turnDirection = 1024;
  9495. if (entity.anInt1549 == 1)
  9496. entity.turnDirection = 1536;
  9497. if (entity.anInt1549 == 2)
  9498. entity.turnDirection = 0;
  9499. if (entity.anInt1549 == 3)
  9500. entity.turnDirection = 512;
  9501. }
  9502.  
  9503. public void method98(Entity entity) {
  9504. if (entity.anInt1548 == loopCycle
  9505. || entity.anim == -1
  9506. || entity.anInt1529 != 0
  9507. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  9508. .method258(entity.anInt1527)) {
  9509. int i = entity.anInt1548 - entity.anInt1547;
  9510. int j = loopCycle - entity.anInt1547;
  9511. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9512. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9513. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9514. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9515. entity.x = (k * (i - j) + i1 * j) / i;
  9516. entity.y = (l * (i - j) + j1 * j) / i;
  9517. }
  9518. entity.anInt1503 = 0;
  9519. if (entity.anInt1549 == 0)
  9520. entity.turnDirection = 1024;
  9521. if (entity.anInt1549 == 1)
  9522. entity.turnDirection = 1536;
  9523. if (entity.anInt1549 == 2)
  9524. entity.turnDirection = 0;
  9525. if (entity.anInt1549 == 3)
  9526. entity.turnDirection = 512;
  9527. entity.anInt1552 = entity.turnDirection;
  9528. }
  9529.  
  9530. public void method99(Entity entity) {
  9531. entity.anInt1517 = entity.anInt1511;
  9532. if (entity.smallXYIndex == 0) {
  9533. entity.anInt1503 = 0;
  9534. return;
  9535. }
  9536. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9537. Animation animation = Animation.anims[entity.anim];
  9538. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  9539. entity.anInt1503++;
  9540. return;
  9541. }
  9542. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  9543. entity.anInt1503++;
  9544. return;
  9545. }
  9546. }
  9547. int i = entity.x;
  9548. int j = entity.y;
  9549. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9550. * 64;
  9551. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9552. * 64;
  9553. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  9554. entity.x = k;
  9555. entity.y = l;
  9556. return;
  9557. }
  9558. if (i < k) {
  9559. if (j < l)
  9560. entity.turnDirection = 1280;
  9561. else if (j > l)
  9562. entity.turnDirection = 1792;
  9563. else
  9564. entity.turnDirection = 1536;
  9565. } else if (i > k) {
  9566. if (j < l)
  9567. entity.turnDirection = 768;
  9568. else if (j > l)
  9569. entity.turnDirection = 256;
  9570. else
  9571. entity.turnDirection = 512;
  9572. } else if (j < l)
  9573. entity.turnDirection = 1024;
  9574. else
  9575. entity.turnDirection = 0;
  9576. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9577. if (i1 > 1024)
  9578. i1 -= 2048;
  9579. int j1 = entity.anInt1555;
  9580. if (i1 >= -256 && i1 <= 256)
  9581. j1 = entity.anInt1554;
  9582. else if (i1 >= 256 && i1 < 768)
  9583. j1 = entity.anInt1557;
  9584. else if (i1 >= -768 && i1 <= -256)
  9585. j1 = entity.anInt1556;
  9586. if (j1 == -1)
  9587. j1 = entity.anInt1554;
  9588. entity.anInt1517 = j1;
  9589. int k1 = 4;
  9590. if (entity.anInt1552 != entity.turnDirection
  9591. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9592. k1 = 2;
  9593. if (entity.smallXYIndex > 2)
  9594. k1 = 6;
  9595. if (entity.smallXYIndex > 3)
  9596. k1 = 8;
  9597. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  9598. k1 = 8;
  9599. entity.anInt1503--;
  9600. }
  9601. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9602. k1 <<= 1;
  9603. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  9604. && entity.anInt1505 != -1)
  9605. entity.anInt1517 = entity.anInt1505;
  9606. if (i < k) {
  9607. entity.x += k1;
  9608. if (entity.x > k)
  9609. entity.x = k;
  9610. } else if (i > k) {
  9611. entity.x -= k1;
  9612. if (entity.x < k)
  9613. entity.x = k;
  9614. }
  9615. if (j < l) {
  9616. entity.y += k1;
  9617. if (entity.y > l)
  9618. entity.y = l;
  9619. } else if (j > l) {
  9620. entity.y -= k1;
  9621. if (entity.y < l)
  9622. entity.y = l;
  9623. }
  9624. if (entity.x == k && entity.y == l) {
  9625. entity.smallXYIndex--;
  9626. if (entity.anInt1542 > 0)
  9627. entity.anInt1542--;
  9628. }
  9629. }
  9630.  
  9631. public void method100(Entity entity) {
  9632. if (entity.anInt1504 == 0)
  9633. return;
  9634. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  9635. NPC npc = npcArray[entity.interactingEntity];
  9636. if (npc != null) {
  9637. int i1 = entity.x - npc.x;
  9638. int k1 = entity.y - npc.y;
  9639. if (i1 != 0 || k1 != 0)
  9640. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9641. }
  9642. }
  9643. if (entity.interactingEntity >= 32768) {
  9644. int j = entity.interactingEntity - 32768;
  9645. if (j == unknownInt10)
  9646. j = myPlayerIndex;
  9647. Player player = playerArray[j];
  9648. if (player != null) {
  9649. int l1 = entity.x - player.x;
  9650. int i2 = entity.y - player.y;
  9651. if (l1 != 0 || i2 != 0)
  9652. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9653. }
  9654. }
  9655. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  9656. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  9657. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9658. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9659. if (k != 0 || j1 != 0)
  9660. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9661. entity.anInt1538 = 0;
  9662. entity.anInt1539 = 0;
  9663. }
  9664. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9665. if (l != 0) {
  9666. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9667. entity.anInt1552 = entity.turnDirection;
  9668. else if (l > 1024)
  9669. entity.anInt1552 -= entity.anInt1504;
  9670. else
  9671. entity.anInt1552 += entity.anInt1504;
  9672. entity.anInt1552 &= 0x7ff;
  9673. if (entity.anInt1517 == entity.anInt1511
  9674. && entity.anInt1552 != entity.turnDirection) {
  9675. if (entity.anInt1512 != -1) {
  9676. entity.anInt1517 = entity.anInt1512;
  9677. return;
  9678. }
  9679. entity.anInt1517 = entity.anInt1554;
  9680. }
  9681. }
  9682. }
  9683.  
  9684. public void method101(Entity entity) {
  9685. entity.aBoolean1541 = false;
  9686. if (entity.anInt1517 >= 65535)
  9687. entity.anInt1517 = -1;
  9688. if (entity.anInt1517 != -1) {
  9689. Animation animation = Animation.anims[entity.anInt1517];
  9690. entity.anInt1519++;
  9691. if (entity.anInt1518 < animation.anInt352
  9692. && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  9693. entity.anInt1519 = 1;
  9694. entity.anInt1518++;
  9695. }
  9696. if (entity.anInt1518 >= animation.anInt352) {
  9697. entity.anInt1519 = 1;
  9698. entity.anInt1518 = 0;
  9699. }
  9700. }
  9701. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  9702. if (entity.anInt1521 < 0)
  9703. entity.anInt1521 = 0;
  9704. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9705. if (animation_1 == null) {
  9706. return;
  9707. }
  9708. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  9709. && entity.anInt1522 > animation_1
  9710. .method258(entity.anInt1521); entity.anInt1521++)
  9711. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9712.  
  9713. if (entity.anInt1521 >= animation_1.anInt352
  9714. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9715. entity.anInt1520 = -1;
  9716. }
  9717. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  9718. Animation animation_2 = Animation.anims[entity.anim];
  9719. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  9720. && entity.anInt1547 <= loopCycle
  9721. && entity.anInt1548 < loopCycle) {
  9722. entity.anInt1529 = 1;
  9723. return;
  9724. }
  9725. }
  9726. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9727. Animation animation_3 = Animation.anims[entity.anim];
  9728. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  9729. && entity.anInt1528 > animation_3
  9730. .method258(entity.anInt1527); entity.anInt1527++)
  9731. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9732.  
  9733. if (entity.anInt1527 >= animation_3.anInt352) {
  9734. entity.anInt1527 -= animation_3.anInt356;
  9735. entity.anInt1530++;
  9736. if (entity.anInt1530 >= animation_3.anInt362)
  9737. entity.anim = -1;
  9738. if (entity.anInt1527 < 0
  9739. || entity.anInt1527 >= animation_3.anInt352)
  9740. entity.anim = -1;
  9741. }
  9742. entity.aBoolean1541 = animation_3.aBoolean358;
  9743. }
  9744. if (entity.anInt1529 > 0)
  9745. entity.anInt1529--;
  9746. }
  9747.  
  9748. private void drawGameScreen() {
  9749. if (fullscreenInterfaceID != -1
  9750. && (loadingStage == 2 || super.fullGameScreen != null)) {
  9751. if (loadingStage == 2) {
  9752. method119(anInt945, fullscreenInterfaceID);
  9753. if (openInterfaceID != -1) {
  9754. method119(anInt945, openInterfaceID);
  9755. }
  9756. anInt945 = 0;
  9757. resetAllImageProducers();
  9758. super.fullGameScreen.initDrawingArea();
  9759. Texture.anIntArray1472 = fullScreenTextureArray;
  9760. DrawingArea.setAllPixelsToZero();
  9761. welcomeScreenRaised = true;
  9762. if (openInterfaceID != -1) {
  9763. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  9764. if (rsInterface_1.width == 512
  9765. && rsInterface_1.height == 334
  9766. && rsInterface_1.type == 0) {
  9767. rsInterface_1.width = 765;
  9768. rsInterface_1.height = 503;
  9769. }
  9770. drawInterface(0, 0, rsInterface_1, 8);
  9771. }
  9772. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9773. if (rsInterface.width == 512 && rsInterface.height == 334
  9774. && rsInterface.type == 0) {
  9775. rsInterface.width = 765;
  9776. rsInterface.height = 503;
  9777. }
  9778. drawInterface(0, 0, rsInterface, 8);
  9779. if (!menuOpen) {
  9780. processRightClick();
  9781. drawTooltip();
  9782. } else {
  9783. drawMenu();
  9784. }
  9785. }
  9786. drawCount++;
  9787. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9788. return;
  9789. } else {
  9790. if (drawCount != 0) {
  9791. resetImageProducers2();
  9792. }
  9793. }
  9794. if (welcomeScreenRaised) {
  9795. welcomeScreenRaised = false;
  9796. topFrame.drawGraphics(0, super.graphics, 0);
  9797. leftFrame.drawGraphics(4, super.graphics, 0);
  9798. rightFrame.drawGraphics(4, super.graphics, 516);
  9799. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  9800. needDrawTabArea = true;
  9801. inputTaken = true;
  9802. tabAreaAltered = true;
  9803. if (loadingStage != 2) {
  9804. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  9805. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  9806. }
  9807. }
  9808. if (menuOpen && menuScreenArea == 1)
  9809. needDrawTabArea = true;
  9810. if (invOverlayInterfaceID != -1) {
  9811. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9812. if (flag1)
  9813. needDrawTabArea = true;
  9814. }
  9815. if (atInventoryInterfaceType == 2)
  9816. needDrawTabArea = true;
  9817. if (activeInterfaceType == 2)
  9818. needDrawTabArea = true;
  9819. if (needDrawTabArea) {
  9820. drawTabArea();
  9821. needDrawTabArea = false;
  9822. }
  9823. if (backDialogID == -1) {
  9824. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  9825. if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  9826. method65(494, 110, super.mouseX - 0, super.mouseY - 348,
  9827. aClass9_1059, 0, false, anInt1211);
  9828. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  9829. if (i < 0)
  9830. i = 0;
  9831. if (i > anInt1211 - 110)
  9832. i = anInt1211 - 110;
  9833. if (anInt1089 != i) {
  9834. anInt1089 = i;
  9835. inputTaken = true;
  9836. }
  9837. }
  9838. if (backDialogID != -1) {
  9839. boolean flag2 = method119(anInt945, backDialogID);
  9840. if (flag2)
  9841. inputTaken = true;
  9842. }
  9843. if (atInventoryInterfaceType == 3)
  9844. inputTaken = true;
  9845. if (activeInterfaceType == 3)
  9846. inputTaken = true;
  9847. if (aString844 != null)
  9848. inputTaken = true;
  9849. if (menuOpen && menuScreenArea == 2)
  9850. inputTaken = true;
  9851. if (inputTaken) {
  9852. drawChatArea();
  9853. inputTaken = false;
  9854. }
  9855. if (loadingStage == 2)
  9856. method146();
  9857. if (loadingStage == 2) {
  9858. drawMinimap();
  9859. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  9860. }
  9861. if (anInt1054 != -1)
  9862. tabAreaAltered = true;
  9863. if (tabAreaAltered) {
  9864. if (anInt1054 != -1 && anInt1054 == tabID) {
  9865. anInt1054 = -1;
  9866. stream.createFrame(120);
  9867. stream.writeWordBigEndian(tabID);
  9868. }
  9869. tabAreaAltered = false;
  9870. aRSImageProducer_1125.initDrawingArea();
  9871. aRSImageProducer_1165.initDrawingArea();
  9872. }
  9873. anInt945 = 0;
  9874. }
  9875.  
  9876. private boolean buildFriendsListMenu(RSInterface class9) {
  9877. int i = class9.contentType;
  9878. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  9879. if (i >= 801)
  9880. i -= 701;
  9881. else if (i >= 701)
  9882. i -= 601;
  9883. else if (i >= 101)
  9884. i -= 101;
  9885. else
  9886. i--;
  9887. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9888. menuActionID[menuActionRow] = 792;
  9889. menuActionRow++;
  9890. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9891. menuActionID[menuActionRow] = 639;
  9892. menuActionRow++;
  9893. return true;
  9894. }
  9895. if (i >= 401 && i <= 500) {
  9896. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  9897. menuActionID[menuActionRow] = 322;
  9898. menuActionRow++;
  9899. return true;
  9900. } else {
  9901. return false;
  9902. }
  9903. }
  9904.  
  9905. public void method104() {
  9906. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  9907. .reverseGetFirst();
  9908. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  9909. .reverseGetNext())
  9910. if (class30_sub2_sub4_sub3.anInt1560 != plane
  9911. || class30_sub2_sub4_sub3.aBoolean1567)
  9912. class30_sub2_sub4_sub3.unlink();
  9913. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  9914. class30_sub2_sub4_sub3.method454(anInt945);
  9915. if (class30_sub2_sub4_sub3.aBoolean1567)
  9916. class30_sub2_sub4_sub3.unlink();
  9917. else
  9918. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  9919. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  9920. class30_sub2_sub4_sub3.anInt1562, 60,
  9921. class30_sub2_sub4_sub3.anInt1561,
  9922. class30_sub2_sub4_sub3, false);
  9923. }
  9924.  
  9925. }
  9926.  
  9927. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9928. if (class9.type != 0 || class9.children == null)
  9929. return;
  9930. if (class9.isMouseoverTriggered && anInt1026 != class9.id
  9931. && anInt1048 != class9.id && anInt1039 != class9.id)
  9932. return;
  9933. int i1 = DrawingArea.topX;
  9934. int j1 = DrawingArea.topY;
  9935. int k1 = DrawingArea.bottomX;
  9936. int l1 = DrawingArea.bottomY;
  9937. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9938. if (class9.id >= 59570 && class9.id <= 59670) {
  9939. DrawingArea.setDrawingArea(200, 110, 450, 30);
  9940. }
  9941. int i2 = class9.children.length;
  9942. for (int j2 = 0; j2 < i2; j2++) {
  9943. int k2 = class9.childX[j2] + k;
  9944. int l2 = (class9.childY[j2] + l) - j;
  9945. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9946. k2 += class9_1.anInt263;
  9947. l2 += class9_1.anInt265;
  9948. if (class9_1.contentType > 0)
  9949. drawFriendsListOrWelcomeScreen(class9_1);
  9950. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  9951. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  9952. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  9953. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  9954. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  9955. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  9956. 12436, 12446, 12456, 6004, 18471,
  9957. /* Ancients */
  9958. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  9959. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  9960. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  9961. if (class9_1.id != 28060 && class9_1.id != 28061) {
  9962. for (int m5 = 0; m5 < IDs.length; m5++) {
  9963. if (class9_1.id == IDs[m5] + 1) {
  9964. if (m5 > 61) {
  9965. drawBlackBox(k2 + 1, l2);
  9966. } else {
  9967. drawBlackBox(k2, l2 + 1);
  9968. }
  9969. }
  9970. }
  9971. }
  9972. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  9973. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  9974. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  9975. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  9976. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  9977. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  9978. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  9979. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  9980. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  9981. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  9982. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  9983. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  9984. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  9985. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  9986. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  9987. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  9988. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  9989. for (int r = 0; r < runeChildren.length; r++)
  9990. if (class9_1.id == runeChildren[r])
  9991. class9_1.modelZoom = 775;
  9992. if (class9_1.type == 0) {
  9993. if (class9_1.scrollPosition > class9_1.scrollMax
  9994. - class9_1.height)
  9995. class9_1.scrollPosition = class9_1.scrollMax
  9996. - class9_1.height;
  9997. if (class9_1.scrollPosition < 0)
  9998. class9_1.scrollPosition = 0;
  9999. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  10000. if (class9_1.scrollMax > class9_1.height) {
  10001. // clan chat
  10002. if (class9_1.id == 18143) {
  10003. int clanMates = 0;
  10004. for (int i = 18155; i < 18244; i++) {
  10005. RSInterface line = RSInterface.interfaceCache[i];
  10006. if (line.message.length() > 0) {
  10007. clanMates++;
  10008. }
  10009. }
  10010. class9_1.scrollMax = (clanMates * 14) + class9_1.height
  10011. + 1;
  10012. }
  10013. if (class9_1.id == 18322 || class9_1.id == 18423) {
  10014. int members = 0;
  10015. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  10016. RSInterface line = RSInterface.interfaceCache[i];
  10017. if (line != null && line.message != null) {
  10018. if (line.message.length() > 0) {
  10019. members++;
  10020. }
  10021. }
  10022. }
  10023. class9_1.scrollMax = (members * 14) + 1;
  10024. }
  10025. if (class9.parentID == 49000 || class9.parentID == 49100
  10026. || class9.parentID == 51100
  10027. || class9.parentID == 53100) {
  10028. int scrollMax = class9_1.scrollMax;
  10029. if (achievementCutoff > 1)
  10030. scrollMax = achievementCutoff * 65;
  10031. else
  10032. achievementCutoff = 282;
  10033. class9_1.scrollMax = scrollMax;
  10034. }
  10035. if (scrollbarVisible(class9_1)) {
  10036. drawScrollbar(class9_1.height, class9_1.scrollPosition,
  10037. l2, k2 + class9_1.width, class9_1.scrollMax);
  10038. }
  10039. }
  10040. } else if (class9_1.type != 1)
  10041. if (class9_1.type == 2) {
  10042. int i3 = 0;
  10043. for (int l3 = 0; l3 < class9_1.height; l3++) {
  10044. for (int l4 = 0; l4 < class9_1.width; l4++) {
  10045. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  10046. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  10047. if (i3 < 20) {
  10048. k5 += class9_1.spritesX[i3];
  10049. j6 += class9_1.spritesY[i3];
  10050. }
  10051. if (class9_1.inv[i3] > 0) {
  10052. int k6 = 0;
  10053. int j7 = 0;
  10054. int j9 = class9_1.inv[i3] - 1;
  10055. if (k5 > DrawingArea.topX - 32
  10056. && k5 < DrawingArea.bottomX
  10057. && j6 > DrawingArea.topY - 32
  10058. && j6 < DrawingArea.bottomY
  10059. || activeInterfaceType != 0
  10060. && anInt1085 == i3) {
  10061. int l9 = 0;
  10062. if (itemSelected == 1 && anInt1283 == i3
  10063. && anInt1284 == class9_1.id)
  10064. l9 = 0xffffff;
  10065. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  10066. .getSprite(j9,
  10067. class9_1.invStackSizes[i3],
  10068. l9);
  10069. if (class9_1.id >= 32212
  10070. && class9_1.id <= 32212 + 11) {
  10071. if (class9_1.inv[i3] > 0) {
  10072. if (class9_1.sprite2 != null) {
  10073. class9_1.sprite2.drawSprite(k5
  10074. + k6 - 2, j6 + j7 - 2);
  10075. }
  10076. }
  10077. }
  10078. if (class30_sub2_sub1_sub1_2 != null) {
  10079. if (activeInterfaceType != 0
  10080. && anInt1085 == i3
  10081. && anInt1084 == class9_1.id) {
  10082. k6 = super.mouseX - anInt1087;
  10083. j7 = super.mouseY - anInt1088;
  10084. if (k6 < 5 && k6 > -5)
  10085. k6 = 0;
  10086. if (j7 < 5 && j7 > -5)
  10087. j7 = 0;
  10088. if (anInt989 < 5) {
  10089. k6 = 0;
  10090. j7 = 0;
  10091. }
  10092. class30_sub2_sub1_sub1_2
  10093. .drawSprite1(k5 + k6, j6
  10094. + j7);
  10095. if (j6 + j7 < DrawingArea.topY
  10096. && class9.scrollPosition > 0) {
  10097. int i10 = (anInt945 * (DrawingArea.topY
  10098. - j6 - j7)) / 3;
  10099. if (i10 > anInt945 * 10)
  10100. i10 = anInt945 * 10;
  10101. if (i10 > class9.scrollPosition)
  10102. i10 = class9.scrollPosition;
  10103. class9.scrollPosition -= i10;
  10104. anInt1088 += i10;
  10105. }
  10106. if (j6 + j7 + 32 > DrawingArea.bottomY
  10107. && class9.scrollPosition < class9.scrollMax
  10108. - class9.height) {
  10109. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  10110. if (j10 > anInt945 * 10)
  10111. j10 = anInt945 * 10;
  10112. if (j10 > class9.scrollMax
  10113. - class9.height
  10114. - class9.scrollPosition)
  10115. j10 = class9.scrollMax
  10116. - class9.height
  10117. - class9.scrollPosition;
  10118. class9.scrollPosition += j10;
  10119. anInt1088 -= j10;
  10120. }
  10121. } else if (atInventoryInterfaceType != 0
  10122. && atInventoryIndex == i3
  10123. && atInventoryInterface == class9_1.id)
  10124. class30_sub2_sub1_sub1_2
  10125. .drawSprite1(k5, j6);
  10126. else
  10127. class30_sub2_sub1_sub1_2
  10128. .drawSprite(k5, j6);
  10129. if (class9_1.id == RSInterface.selectedItemInterfaceId
  10130. && class9_1.itemSearchSelectedSlot > -1
  10131. && class9_1.itemSearchSelectedSlot == i3) {
  10132. for (int i = 32; i > 0; i--) {
  10133. DrawingArea.method338(j6 + j7,
  10134. i,
  10135. 256 - Byte.MAX_VALUE,
  10136. 0x395D84, i, k5 + k6);
  10137. }
  10138. DrawingArea.method338(j6 + j7, 32,
  10139. 256, 0x395D84, 32, k5 + k6);
  10140. }
  10141. if (class9_1.parentID < 58040
  10142. || class9_1.parentID > 58048) {
  10143. if (class30_sub2_sub1_sub1_2.maxWidth == 33
  10144. || class9_1.invStackSizes[i3] != 1) {
  10145. int k10 = class9_1.invStackSizes[i3];
  10146. if (k10 >= 1)
  10147. smallText.method385(
  10148. 0xFFFF00,
  10149. intToKOrMil(k10),
  10150. j6 + 9 + j7, k5
  10151. + k6);
  10152. smallText.method385(0,
  10153. intToKOrMil(k10), j6
  10154. + 10 + j7, k5
  10155. + 1 + k6);
  10156. if (k10 > 99999
  10157. && k10 < 10000000) {
  10158. smallText.method385(
  10159. 0xFFFFFF,
  10160. intToKOrMil(k10),
  10161. j6 + 9 + j7, k5
  10162. + k6);
  10163. } else if (k10 > 9999999) {
  10164. smallText.method385(
  10165. 0x00ff80,
  10166. intToKOrMil(k10),
  10167. j6 + 9 + j7, k5
  10168. + k6);
  10169. } else {
  10170. smallText.method385(
  10171. 0xFFFF00,
  10172. intToKOrMil(k10),
  10173. j6 + 9 + j7, k5
  10174. + k6);
  10175. }
  10176.  
  10177. /*
  10178. * smallText.method385(0,
  10179. * intToKOrMil(k10), j6 + 10 +
  10180. * j7, k5 + 1 + k6);
  10181. * smallText.method385(0xffff00,
  10182. * intToKOrMil(k10), j6 + 9 +
  10183. * j7, k5 + k6);
  10184. */
  10185. }
  10186. }
  10187. }
  10188. }
  10189. } else if (class9_1.sprites != null && i3 < 20) {
  10190. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  10191. if (class30_sub2_sub1_sub1_1 != null)
  10192. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  10193. }
  10194. i3++;
  10195. }
  10196. }
  10197. } else if (class9_1.type == 3) {
  10198. boolean flag = false;
  10199. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  10200. || anInt1026 == class9_1.id)
  10201. flag = true;
  10202. int j3;
  10203. if (interfaceIsSelected(class9_1)) {
  10204. j3 = class9_1.anInt219;
  10205. if (flag && class9_1.anInt239 != 0)
  10206. j3 = class9_1.anInt239;
  10207. } else {
  10208. j3 = class9_1.textColor;
  10209. if (flag && class9_1.anInt216 != 0)
  10210. j3 = class9_1.anInt216;
  10211. }
  10212. if (class9_1.aByte254 == 0) {
  10213. if (class9_1.aBoolean227)
  10214. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  10215. class9_1.width);
  10216. else
  10217. DrawingArea.fillPixels(k2, class9_1.width,
  10218. class9_1.height, j3, l2);
  10219. } else if (class9_1.aBoolean227)
  10220. DrawingArea.method335(j3, l2, class9_1.width,
  10221. class9_1.height,
  10222. 256 - (class9_1.aByte254 & 0xff), k2);
  10223. else
  10224. DrawingArea.method338(l2, class9_1.height,
  10225. 256 - (class9_1.aByte254 & 0xff), j3,
  10226. class9_1.width, k2);
  10227. } else if (class9_1.type == 4) {
  10228. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  10229. String s = class9_1.message;
  10230. boolean flag1 = false;
  10231. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  10232. || anInt1026 == class9_1.id)
  10233. flag1 = true;
  10234. int i4;
  10235. if (interfaceIsSelected(class9_1)) {
  10236. i4 = class9_1.anInt219;
  10237. if (flag1 && class9_1.anInt239 != 0)
  10238. i4 = class9_1.anInt239;
  10239. if (class9_1.aString228.length() > 0)
  10240. s = class9_1.aString228;
  10241. } else {
  10242. i4 = class9_1.textColor;
  10243. if (flag1 && class9_1.anInt216 != 0)
  10244. i4 = class9_1.anInt216;
  10245. }
  10246. if (class9_1.atActionType == 6 && aBoolean1149) {
  10247. s = "Please wait...";
  10248. i4 = class9_1.textColor;
  10249. }
  10250. if (DrawingArea.width == 519) {
  10251. if (i4 == 0xffff00)
  10252. i4 = 255;
  10253. if (i4 == 49152)
  10254. i4 = 0xffffff;
  10255. }
  10256. if ((class9_1.parentID == 1151)
  10257. || (class9_1.parentID == 12855)) {
  10258. switch (i4) {
  10259. case 16773120:
  10260. i4 = 0xFE981F;
  10261. break;
  10262. case 7040819:
  10263. i4 = 0xAF6A1A;
  10264. break;
  10265. }
  10266. }
  10267. if (class9_1.hoverText != null && !class9_1.hoverText.isEmpty()) {
  10268. if (super.mouseX > k2 && super.mouseX < k2 + class9_1.textDrawingAreas.getTextWidth(class9_1.message)
  10269. && super.mouseY > l2 + 10 && super.mouseY < l2 + 25) {
  10270. s = class9_1.hoverText;
  10271. i4 = class9_1.hoverTextColor;
  10272. }
  10273. }
  10274. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  10275. if (s.indexOf("%") != -1) {
  10276. do {
  10277. int k7 = s.indexOf("%1");
  10278. if (k7 == -1)
  10279. break;
  10280. if (class9_1.id < 4000 || class9_1.id > 5000
  10281. && class9_1.id != 13921
  10282. && class9_1.id != 13922
  10283. && class9_1.id != 12171
  10284. && class9_1.id != 12172)
  10285. s = s.substring(0, k7)
  10286. + methodR(extractInterfaceValues(
  10287. class9_1, 0))
  10288. + s.substring(k7 + 2);
  10289. else
  10290. s = s.substring(0, k7)
  10291. + interfaceIntToString(extractInterfaceValues(
  10292. class9_1, 0))
  10293. + s.substring(k7 + 2);
  10294. } while (true);
  10295. do {
  10296. int l7 = s.indexOf("%2");
  10297. if (l7 == -1)
  10298. break;
  10299. s = s.substring(0, l7)
  10300. + interfaceIntToString(extractInterfaceValues(
  10301. class9_1, 1))
  10302. + s.substring(l7 + 2);
  10303. } while (true);
  10304. do {
  10305. int i8 = s.indexOf("%3");
  10306. if (i8 == -1)
  10307. break;
  10308. s = s.substring(0, i8)
  10309. + interfaceIntToString(extractInterfaceValues(
  10310. class9_1, 2))
  10311. + s.substring(i8 + 2);
  10312. } while (true);
  10313. do {
  10314. int j8 = s.indexOf("%4");
  10315. if (j8 == -1)
  10316. break;
  10317. s = s.substring(0, j8)
  10318. + interfaceIntToString(extractInterfaceValues(
  10319. class9_1, 3))
  10320. + s.substring(j8 + 2);
  10321. } while (true);
  10322. do {
  10323. int k8 = s.indexOf("%5");
  10324. if (k8 == -1)
  10325. break;
  10326. s = s.substring(0, k8)
  10327. + interfaceIntToString(extractInterfaceValues(
  10328. class9_1, 4))
  10329. + s.substring(k8 + 2);
  10330. } while (true);
  10331. }
  10332. int l8 = s.indexOf("\\n");
  10333. String s1;
  10334. if (l8 != -1) {
  10335. s1 = s.substring(0, l8);
  10336. s = s.substring(l8 + 2);
  10337. } else {
  10338. s1 = s;
  10339. s = "";
  10340. }
  10341. RSFont font = null;
  10342. if (textDrawingArea == smallText) {
  10343. font = newSmallFont;
  10344. } else if (textDrawingArea == aTextDrawingArea_1271) {
  10345. font = newRegularFont;
  10346. } else if (textDrawingArea == chatTextDrawingArea) {
  10347. font = newBoldFont;
  10348. } else if (textDrawingArea == aTextDrawingArea_1273) {
  10349. font = newFancyFont;
  10350. }
  10351. if (class9.parentID == 49100
  10352. || class9.parentID == 51100
  10353. || class9.parentID == 53100) {
  10354. int parent = class9.parentID == 49100 ? 49100
  10355. : class9.parentID == 51100 ? 51100 : 53100;
  10356. int subId = (class9_1.id - parent) % 100;
  10357. if (subId > achievementCutoff) {
  10358. continue;
  10359. }
  10360. }
  10361. if (class9_1.centerText) {
  10362. font.drawCenteredString(s1,
  10363. k2 + class9_1.width / 2, l6, i4,
  10364. class9_1.textShadow ? 0 : -1);
  10365. } else {
  10366. font.drawBasicString(s1, k2, l6, i4,
  10367. class9_1.textShadow ? 0 : -1);
  10368. }
  10369. }
  10370. } else if (class9_1.type == 5) {
  10371. Sprite sprite;
  10372. Sprite sprite2 = null;
  10373. if (interfaceIsSelected(class9_1)) {
  10374. sprite = class9_1.sprite2;
  10375. } else {
  10376. sprite = class9_1.sprite1;
  10377. }
  10378. if (class9_1.id >= 58032 && class9_1.id <= 58040) {
  10379. int tabId = 0;
  10380. try {
  10381. tabId = Integer
  10382. .parseInt(RSInterface.interfaceCache[5292].message);
  10383. } catch (NumberFormatException nfe) {
  10384. }
  10385. if (RSInterface.interfaceCache[class9.id + 1] != null
  10386. && !RSInterface.interfaceCache[class9.id + 1].isMouseoverTriggered
  10387. || class9_1.id == 58039
  10388. && interfaceContainsItem(58048))
  10389. sprite = new Sprite("BankTab/TAB 3");
  10390. if (tabId > 0) {
  10391. if (tabId + 58031 == class9_1.id) {
  10392. sprite = new Sprite("BankTab/TAB 2");
  10393. }
  10394. }
  10395. }
  10396. if (class9.parentID == 49100 || class9.parentID == 51100
  10397. || class9.parentID == 53100) {
  10398. int parent = class9.parentID == 49100 ? 49100
  10399. : class9.parentID == 51100 ? 51100 : 53100;
  10400. int subId = (class9_1.id - parent) % 100;
  10401. if (subId > achievementCutoff) {
  10402. continue;
  10403. }
  10404. if (class9_1.id - parent > 600
  10405. && class9_1.id - parent < 700) {
  10406. String message = RSInterface.interfaceCache[class9_1.id + 100].message;
  10407. if (message != null) {
  10408. if (message.split("/").length == 2) {
  10409. int currentValue = Integer.parseInt(message
  10410. .split("/")[0]);
  10411. if (currentValue <= 0) {
  10412. sprite = new Sprite(
  10413. "Interfaces/Achievements/IMAGE 6");
  10414. } else {
  10415. int maxValue = Integer.parseInt(message
  10416. .split("/")[1]);
  10417. double modifier = 2.07;
  10418. double percentage = (((double) currentValue / (double) maxValue) * 100D);
  10419. int width = (int) (percentage * modifier) + 1;
  10420. if (percentage <= 0.0)
  10421. sprite = new Sprite(
  10422. signlink.findcachedir()
  10423. + "Sprites/Interfaces/Achievements/IMAGE 6.png",
  10424. width, 16);
  10425. else if (percentage <= 50.0)
  10426. sprite = new Sprite(
  10427. signlink.findcachedir()
  10428. + "Sprites/Interfaces/Achievements/IMAGE 8.png",
  10429. width, 16);
  10430. else if (percentage <= 75.0)
  10431. sprite = new Sprite(
  10432. signlink.findcachedir()
  10433. + "Sprites/Interfaces/Achievements/IMAGE 9.png",
  10434. width, 16);
  10435. else
  10436. sprite = new Sprite(
  10437. signlink.findcachedir()
  10438. + "Sprites/Interfaces/Achievements/IMAGE 7.png",
  10439. width, 16);
  10440. sprite2 = new Sprite(
  10441. "Interfaces/Achievements/IMAGE 6");
  10442. }
  10443. }
  10444. }
  10445. }
  10446. }
  10447. if (sprite2 != null) {
  10448. sprite2.drawSprite(k2, l2);
  10449. }
  10450. if (spellSelected == 1 && class9_1.id == spellID
  10451. && spellID != 0 && sprite != null) {
  10452. sprite.drawSprite(k2, l2, 0xffffff);
  10453. } else {
  10454. if (sprite != null)
  10455. sprite.drawSprite(k2, l2);
  10456. }
  10457. if (Autocast && class9_1.id == spellID
  10458. && class9_1.id == autocastId) {
  10459. magicAuto.drawSprite(k2 - 3, l2 - 3);
  10460. }
  10461. } else if (class9_1.type == 6) {
  10462. int k3 = Texture.textureInt1;
  10463. int j4 = Texture.textureInt2;
  10464. Texture.textureInt1 = k2 + class9_1.width / 2;
  10465. Texture.textureInt2 = l2 + class9_1.height / 2;
  10466. int i5 = Texture.anIntArray1470[class9_1.modelRotation1]
  10467. * class9_1.modelZoom >> 16;
  10468. int l5 = Texture.anIntArray1471[class9_1.modelRotation1]
  10469. * class9_1.modelZoom >> 16;
  10470. boolean flag2 = interfaceIsSelected(class9_1);
  10471. int i7;
  10472. if (flag2)
  10473. i7 = class9_1.anInt258;
  10474. else
  10475. i7 = class9_1.anInt257;
  10476. Model model;
  10477. if (i7 == -1) {
  10478. model = class9_1.method209(-1, -1, flag2);
  10479. } else {
  10480. Animation animation = Animation.anims[i7];
  10481. model = class9_1.method209(
  10482. animation.anIntArray354[class9_1.anInt246],
  10483. animation.anIntArray353[class9_1.anInt246],
  10484. flag2);
  10485. }
  10486. if (model != null)
  10487. model.method482(class9_1.modelRotation2, 0,
  10488. class9_1.modelRotation1, 0, i5, l5);
  10489. Texture.textureInt1 = k3;
  10490. Texture.textureInt2 = j4;
  10491. } else if (class9_1.type == 7) {
  10492. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  10493. int k4 = 0;
  10494. for (int j5 = 0; j5 < class9_1.height; j5++) {
  10495. for (int i6 = 0; i6 < class9_1.width; i6++) {
  10496. if (class9_1.inv[k4] > 0) {
  10497. ItemDef itemDef = ItemDef
  10498. .forID(class9_1.inv[k4] - 1);
  10499. String s2 = itemDef.name;
  10500. if (itemDef.stackable
  10501. || class9_1.invStackSizes[k4] != 1)
  10502. s2 = s2
  10503. + " x"
  10504. + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  10505. int i9 = k2 + i6
  10506. * (115 + class9_1.invSpritePadX);
  10507. int k9 = l2 + j5
  10508. * (12 + class9_1.invSpritePadY);
  10509. if (class9_1.centerText)
  10510. textDrawingArea_1.method382(
  10511. class9_1.textColor, i9
  10512. + class9_1.width / 2, s2,
  10513. k9, class9_1.textShadow);
  10514. else
  10515. textDrawingArea_1.method389(
  10516. class9_1.textShadow, i9,
  10517. class9_1.textColor, s2, k9);
  10518. }
  10519. k4++;
  10520. }
  10521. }
  10522. }
  10523. if (class9_1.type == 8
  10524. && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id)
  10525. && anInt1501 == 100) {
  10526. int boxWidth = 0;
  10527. int boxHeight = 0;
  10528. TextDrawingArea textDrawingArea_2 = class9_1.textDrawingAreas;
  10529. for (String s1 = class9_1.message; s1.length() > 0;) {
  10530. int l7 = s1.indexOf("\\n");
  10531. String s4;
  10532. if (l7 != -1) {
  10533. s4 = s1.substring(0, l7);
  10534. s1 = s1.substring(l7 + 2);
  10535. } else {
  10536. s4 = s1;
  10537. s1 = "";
  10538. }
  10539. int j10 = textDrawingArea_2.getTextWidth(s4);
  10540. if (j10 > boxWidth) {
  10541. boxWidth = j10;
  10542. }
  10543. boxHeight += textDrawingArea_2.anInt1497 + 1;
  10544. }
  10545. boxWidth += 6;
  10546. boxHeight += 7;
  10547. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  10548. int yPos = l2 + class9_1.height + 5;
  10549. if (xPos < k2 + 5) {
  10550. xPos = k2 + 5;
  10551. }
  10552. if (xPos + boxWidth > k + class9.width) {
  10553. xPos = (k + class9.width) - boxWidth;
  10554. }
  10555. if (yPos + boxHeight > l + class9.height) {
  10556. yPos = (l + class9.height) - boxHeight;
  10557. }
  10558. switch (class9_1.id) {
  10559. case 9217:
  10560. case 9220:
  10561. case 9223:
  10562. case 9226:
  10563. case 9229:
  10564. case 9232:
  10565. case 9235:
  10566. case 9238:
  10567. xPos -= 80;
  10568. break;
  10569. case 9239:
  10570. yPos -= 100;
  10571. break;
  10572. }
  10573. DrawingArea
  10574. .method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  10575. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  10576. String s2 = class9_1.message;
  10577. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2
  10578. .length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {// anInt1497
  10579. int l11 = s2.indexOf("\\n");
  10580. String s5;
  10581. if (l11 != -1) {
  10582. s5 = s2.substring(0, l11);
  10583. s2 = s2.substring(l11 + 2);
  10584. } else {
  10585. s5 = s2;
  10586. s2 = "";
  10587. }
  10588. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  10589. }
  10590. // }
  10591. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10592. } else if (class9_1.type == 12) {
  10593. Sprite sprite;
  10594. if (interfaceIsSelected(class9_1))
  10595. sprite = class9_1.sprite2;
  10596. else
  10597. sprite = class9_1.sprite1;
  10598. if (sprite != null)
  10599. sprite.drawAdvancedSprite(k2, l2);
  10600. } else if (class9_1.type == 9) {
  10601. drawHoverBox(k2, l2, class9_1.message);
  10602. } else if (class9_1.type == 10) {
  10603. Sprite sprite;
  10604. if (interfaceIsSelected(class9_1)) {
  10605. sprite = class9_1.sprite2;
  10606. } else {
  10607. sprite = class9_1.sprite1;
  10608. }
  10609. if (sprite != null) {
  10610. sprite.drawSpriteWithOpacity(k2, l2, class9_1.opacity);
  10611. }
  10612. } else if (class9_1.type == 12 || class9_1.type == 13) {
  10613. Sprite interfaceSprite = null;
  10614. if (interfaceIsSelected(class9_1) || anInt886 == class9_1.id)
  10615. interfaceSprite = class9_1.sprite2;
  10616. else
  10617. interfaceSprite = class9_1.sprite1;
  10618. if (interfaceSprite != null)
  10619. interfaceSprite.drawAdvancedSprite(k2, l2);
  10620. } else if (class9_1.type == 16) {
  10621. drawInputField(class9_1, k, l, k2, l2, class9_1.width,
  10622. class9_1.height);
  10623. } else if(class9_1.type == 17) {
  10624. if (class9.id != 37010) {
  10625. DrawingArea.setDrawingArea(334, 0, 512, 0);
  10626. }
  10627. DrawingArea.drawAlphaBox(k2, l2, class9_1.width, class9_1.height, class9_1.fillColor, class9_1.opacity);
  10628. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  10629. } else if(class9_1.type == 18) {
  10630. DrawingArea.drawRoundedRectangle(k2, l2, class9_1.width, class9_1.height, class9_1.fillColor,
  10631. class9_1.opacity, class9_1.filled, class9_1.textShadow);
  10632. } else if(class9_1.type == 19) {
  10633. if (class9_1.backgroundSprites.length > 1) {
  10634. if (class9_1.sprite1 != null) {
  10635. class9_1.sprite1.drawAdvancedSprite(k2, l2);
  10636. }
  10637. }
  10638. } else if (class9_1.type == 20) {
  10639. DrawingArea.drawAlphaBox(k2, l2, class9_1.width, class9_1.height, 0x403B2B, class9_1.opacity);
  10640. DrawingArea.drawAlphaBox(k2 + 1, l2 + 1, class9_1.width - 2, class9_1.height - 2, 0xABAE83, class9_1.opacity);
  10641. if (class9_1.getMenuItem() != null) {
  10642. Sprite sprite = class9_1.getMenuItem().getSprite();
  10643. int x = 0;
  10644. if (sprite != null) {
  10645. sprite.drawAdvancedSprite(k2 + 4, l2 + sprite.myHeight / 2);
  10646. x = sprite.myWidth;
  10647. }
  10648. class9_1.textDrawingAreas.drawText(0x000000, class9_1.getMenuItem().getText(), l2 + 14, k2 + 23 + x);
  10649. }
  10650. } else if (class9_1.type == 21) {
  10651. RSInterface menu = RSInterface.interfaceCache[class9_1.mOverInterToTrigger];
  10652. if (menu != null && menu.isMenuVisible()) {
  10653. RSMenuItem item = class9_1.getMenuItem();
  10654. if (item != null) {
  10655. DrawingArea.drawAlphaBox(k2, l2, class9_1.width, class9_1.height, 0x403B2B, class9_1.opacity);
  10656. DrawingArea.drawAlphaBox(k2 + 1, l2 + 1, class9_1.width - 2, class9_1.height - 2, 0xABAE83, class9_1.opacity);
  10657. Sprite sprite = class9_1.getMenuItem().getSprite();
  10658. int x = 0;
  10659. if (sprite != null) {
  10660. sprite.drawAdvancedSprite(k2 + 4, l2 + sprite.myHeight / 2);
  10661. x = sprite.myWidth;
  10662. }
  10663. class9_1.textDrawingAreas.drawText(0x000000, class9_1.getMenuItem().getText(), l2 + 14, k2 + 23 + x);
  10664. }
  10665. }
  10666. }
  10667. }
  10668. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10669. }
  10670.  
  10671. public final String methodR(int j) {
  10672. if (j >= 0 && j < 10000)
  10673. return String.valueOf(j);
  10674. if (j >= 10000 && j < 10000000)
  10675. return j / 1000 + "K";
  10676. if (j >= 10000000 && j < 999999999)
  10677. return j / 1000000 + "M";
  10678. if (j >= 999999999)
  10679. return "*";
  10680. else
  10681. return "?";
  10682. }
  10683.  
  10684. public void drawHoverBox(int xPos, int yPos, String text) {
  10685. String[] results = text.split("\n");
  10686. int height = (results.length * 16) + 3;
  10687. int width;
  10688. width = aTextDrawingArea_1271.getTextWidth(results[0]) + 6;
  10689. for (int i = 1; i < results.length; i++)
  10690. if (width <= aTextDrawingArea_1271.getTextWidth(results[i]) + 6)
  10691. width = aTextDrawingArea_1271.getTextWidth(results[i]) + 6;
  10692. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  10693. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  10694. yPos += 14;
  10695. for (int i = 0; i < results.length; i++) {
  10696. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i],
  10697. yPos);
  10698. yPos += 16;
  10699. }
  10700. }
  10701.  
  10702. public void drawBlackBox(int xPos, int yPos) {
  10703. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  10704. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  10705. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  10706. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  10707. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  10708. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  10709. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  10710. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  10711. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  10712. }
  10713.  
  10714. public void randomizeBackground(Background background) {
  10715. int j = 256;
  10716. for (int k = 0; k < anIntArray1190.length; k++)
  10717. anIntArray1190[k] = 0;
  10718.  
  10719. for (int l = 0; l < 5000; l++) {
  10720. int i1 = (int) (Math.random() * 128D * j);
  10721. anIntArray1190[i1] = (int) (Math.random() * 256D);
  10722. }
  10723. for (int j1 = 0; j1 < 20; j1++) {
  10724. for (int k1 = 1; k1 < j - 1; k1++) {
  10725. for (int i2 = 1; i2 < 127; i2++) {
  10726. int k2 = i2 + (k1 << 7);
  10727. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  10728. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10729. }
  10730.  
  10731. }
  10732. int ai[] = anIntArray1190;
  10733. anIntArray1190 = anIntArray1191;
  10734. anIntArray1191 = ai;
  10735. }
  10736. if (background != null) {
  10737. int l1 = 0;
  10738. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  10739. for (int l2 = 0; l2 < background.anInt1452; l2++)
  10740. if (background.aByteArray1450[l1++] != 0) {
  10741. int i3 = l2 + 16 + background.anInt1454;
  10742. int j3 = j2 + 16 + background.anInt1455;
  10743. int k3 = i3 + (j3 << 7);
  10744. anIntArray1190[k3] = 0;
  10745. }
  10746. }
  10747. }
  10748. }
  10749.  
  10750. private void method107(int i, int j, Stream stream, Player player) {
  10751. if ((i & 0x400) != 0) {
  10752. player.anInt1543 = stream.method428();
  10753. player.anInt1545 = stream.method428();
  10754. player.anInt1544 = stream.method428();
  10755. player.anInt1546 = stream.method428();
  10756. player.anInt1547 = stream.method436() + loopCycle;
  10757. player.anInt1548 = stream.method435() + loopCycle;
  10758. player.anInt1549 = stream.method428();
  10759. player.method446();
  10760. }
  10761. if ((i & 0x100) != 0) {
  10762. player.anInt1520 = stream.method434();
  10763. int k = stream.readDWord();
  10764. player.anInt1524 = k >> 16;
  10765. player.anInt1523 = loopCycle + (k & 0xffff);
  10766. player.anInt1521 = 0;
  10767. player.anInt1522 = 0;
  10768. if (player.anInt1523 > loopCycle)
  10769. player.anInt1521 = -1;
  10770. if (player.anInt1520 == 65535)
  10771. player.anInt1520 = -1;
  10772. }
  10773. if ((i & 8) != 0) {
  10774. int l = stream.method434();
  10775. if (l == 65535)
  10776. l = -1;
  10777. int i2 = stream.method427();
  10778. if (l == player.anim && l != -1) {
  10779. int i3 = Animation.anims[l].anInt365;
  10780. if (i3 == 1) {
  10781. player.anInt1527 = 0;
  10782. player.anInt1528 = 0;
  10783. player.anInt1529 = i2;
  10784. player.anInt1530 = 0;
  10785. }
  10786. if (i3 == 2)
  10787. player.anInt1530 = 0;
  10788. } else if (l == -1
  10789. || player.anim == -1
  10790. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  10791. player.anim = l;
  10792. player.anInt1527 = 0;
  10793. player.anInt1528 = 0;
  10794. player.anInt1529 = i2;
  10795. player.anInt1530 = 0;
  10796. player.anInt1542 = player.smallXYIndex;
  10797. }
  10798. }
  10799. if ((i & 4) != 0) {
  10800. player.textSpoken = stream.readString();
  10801. if (player.textSpoken.charAt(0) == '~') {
  10802. player.textSpoken = player.textSpoken.substring(1);
  10803. pushMessage(player.textSpoken, 2, player.name);
  10804. } else if (player == myPlayer)
  10805. pushMessage(player.textSpoken, 2, player.name);
  10806. player.anInt1513 = 0;
  10807. player.anInt1531 = 0;
  10808. player.textCycle = 150;
  10809. }
  10810. if ((i & 0x80) != 0) {
  10811. int i1 = stream.method434();
  10812. int j2 = stream.readUnsignedByte();
  10813. int j3 = stream.method427();
  10814. int k3 = stream.currentOffset;
  10815. if (player.name != null && player.visible) {
  10816. long l3 = TextClass.longForName(player.name);
  10817. boolean flag = false;
  10818. if (j2 <= 1) {
  10819. for (int i4 = 0; i4 < ignoreCount; i4++) {
  10820. if (ignoreListAsLongs[i4] != l3)
  10821. continue;
  10822. flag = true;
  10823. break;
  10824. }
  10825.  
  10826. }
  10827. if (!flag && anInt1251 == 0)
  10828. try {
  10829. aStream_834.currentOffset = 0;
  10830. stream.method442(j3, 0, aStream_834.buffer);
  10831. aStream_834.currentOffset = 0;
  10832. String s = TextInput.method525(j3, aStream_834);
  10833. player.textSpoken = s;
  10834. player.anInt1513 = i1 >> 8;
  10835. player.privilege = j2;
  10836. player.anInt1531 = i1 & 0xff;
  10837. player.textCycle = 150;
  10838. String cr = "";
  10839. if (j2 == 11)
  10840. cr = "@cr11@";
  10841. if (j2 == 10)
  10842. cr = "@cr10@";
  10843. if (j2 == 9)
  10844. cr = "@cr9@";
  10845. if (j2 == 8)
  10846. cr = "@cr8@";
  10847. if (j2 == 7)
  10848. cr = "@cr7@";
  10849. if (j2 == 6)
  10850. cr = "@cr6@";
  10851. if (j2 == 5)
  10852. cr = "@cr5@";
  10853. if (j2 == 4)
  10854. cr = "@cr4@";
  10855. if (j2 == 3)
  10856. cr = "@cr3@";
  10857. if (j2 == 2)
  10858. cr = "@cr2@";
  10859. if (j2 == 1)
  10860. cr = "@cr1@";
  10861. pushMessage(s, 2,
  10862. cr + "<col=" + player.titleColor
  10863. + ">" + player.title + "</col> "
  10864. + player.name);
  10865. } catch (Exception exception) {
  10866. signlink.reporterror("cde2");
  10867. }
  10868. }
  10869. stream.currentOffset = k3 + j3;
  10870. }
  10871. if ((i & 1) != 0) {
  10872. player.interactingEntity = stream.method434();
  10873. if (player.interactingEntity == 65535)
  10874. player.interactingEntity = -1;
  10875. }
  10876. if ((i & 0x10) != 0) {
  10877. int j1 = stream.method427();
  10878. byte abyte0[] = new byte[j1];
  10879. Stream stream_1 = new Stream(abyte0);
  10880. stream.readBytes(j1, 0, abyte0);
  10881. aStreamArray895s[j] = stream_1;
  10882. player.updatePlayer(stream_1);
  10883. }
  10884. if ((i & 2) != 0) {
  10885. player.anInt1538 = stream.method436();
  10886. player.anInt1539 = stream.method434();
  10887. }
  10888. if ((i & 0x20) != 0) {
  10889. int k1 = stream.readUnsignedByte();
  10890. int k2 = stream.method426();
  10891. player.updateHitData(k2, k1, loopCycle);
  10892. player.loopCycleStatus = loopCycle + 300;
  10893. player.currentHealth = stream.method427();
  10894. player.maxHealth = stream.readUnsignedByte();
  10895. }
  10896. if ((i & 0x200) != 0) {
  10897. int l1 = stream.readUnsignedByte();
  10898. int l2 = stream.method428();
  10899. player.updateHitData(l2, l1, loopCycle);
  10900. player.loopCycleStatus = loopCycle + 300;
  10901. player.currentHealth = stream.readUnsignedByte();
  10902. player.maxHealth = stream.method427();
  10903. }
  10904. }
  10905.  
  10906. public void method108() {
  10907. try {
  10908. int j = myPlayer.x + cameraOffsetX;
  10909. int k = myPlayer.y + cameraOffsetY;
  10910. if (anInt1014 - j < -500 || anInt1014 - j > 500
  10911. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  10912. anInt1014 = j;
  10913. anInt1015 = k;
  10914. }
  10915. if (anInt1014 != j)
  10916. anInt1014 += (j - anInt1014) / 16;
  10917. if (anInt1015 != k)
  10918. anInt1015 += (k - anInt1015) / 16;
  10919. if (super.keyArray[1] == 1)
  10920. anInt1186 += (-24 - anInt1186) / 2;
  10921. else if (super.keyArray[2] == 1)
  10922. anInt1186 += (24 - anInt1186) / 2;
  10923. else
  10924. anInt1186 /= 2;
  10925. if (super.keyArray[3] == 1)
  10926. anInt1187 += (12 - anInt1187) / 2;
  10927. else if (super.keyArray[4] == 1)
  10928. anInt1187 += (-12 - anInt1187) / 2;
  10929. else
  10930. anInt1187 /= 2;
  10931. viewRotation = viewRotation + anInt1186 / 2 & 0x7ff;
  10932. anInt1184 += anInt1187 / 2;
  10933. if (anInt1184 < 128)
  10934. anInt1184 = 128;
  10935. if (anInt1184 > 383)
  10936. anInt1184 = 383;
  10937. int l = anInt1014 >> 7;
  10938. int i1 = anInt1015 >> 7;
  10939. int j1 = method42(plane, anInt1015, anInt1014);
  10940. int k1 = 0;
  10941. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  10942. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  10943. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  10944. int l2 = plane;
  10945. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10946. l2++;
  10947. int i3 = j1 - intGroundArray[l2][l1][k2];
  10948. if (i3 > k1)
  10949. k1 = i3;
  10950. }
  10951.  
  10952. }
  10953.  
  10954. }
  10955. anInt1005++;
  10956. if (anInt1005 > 1512) {
  10957. anInt1005 = 0;
  10958. stream.createFrame(77);
  10959. stream.writeWordBigEndian(0);
  10960. int i2 = stream.currentOffset;
  10961. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10962. stream.writeWordBigEndian(101);
  10963. stream.writeWordBigEndian(233);
  10964. stream.writeWord(45092);
  10965. if ((int) (Math.random() * 2D) == 0)
  10966. stream.writeWord(35784);
  10967. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10968. stream.writeWordBigEndian(64);
  10969. stream.writeWordBigEndian(38);
  10970. stream.writeWord((int) (Math.random() * 65536D));
  10971. stream.writeWord((int) (Math.random() * 65536D));
  10972. stream.writeBytes(stream.currentOffset - i2);
  10973. }
  10974. int j2 = k1 * 192;
  10975. if (j2 > 0x17f00)
  10976. j2 = 0x17f00;
  10977. if (j2 < 32768)
  10978. j2 = 32768;
  10979. if (j2 > anInt984) {
  10980. anInt984 += (j2 - anInt984) / 24;
  10981. return;
  10982. }
  10983. if (j2 < anInt984) {
  10984. anInt984 += (j2 - anInt984) / 80;
  10985. }
  10986. } catch (Exception _ex) {
  10987. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  10988. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  10989. + anInt1070 + "," + baseX + "," + baseY);
  10990. throw new RuntimeException("eek");
  10991. }
  10992. }
  10993.  
  10994. @Override
  10995. public void processDrawing() {
  10996. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  10997. showErrorScreen();
  10998. return;
  10999. }
  11000. anInt1061++;
  11001. if (!loggedIn)
  11002. drawLoginScreen(false);
  11003. else
  11004. drawGameScreen();
  11005. anInt1213 = 0;
  11006. }
  11007.  
  11008. private boolean isFriendOrSelf(String s) {
  11009. if (s == null)
  11010. return false;
  11011. for (int i = 0; i < friendsCount; i++)
  11012. if (s.equalsIgnoreCase(friendsList[i]))
  11013. return true;
  11014. return s.equalsIgnoreCase(myPlayer.name);
  11015. }
  11016.  
  11017. private static String combatDiffColor(int i, int j) {
  11018. int k = i - j;
  11019. if (k < -9)
  11020. return "@red@";
  11021. if (k < -6)
  11022. return "@or3@";
  11023. if (k < -3)
  11024. return "@or2@";
  11025. if (k < 0)
  11026. return "@or1@";
  11027. if (k > 9)
  11028. return "@gre@";
  11029. if (k > 6)
  11030. return "@gr3@";
  11031. if (k > 3)
  11032. return "@gr2@";
  11033. if (k > 0)
  11034. return "@gr1@";
  11035. else
  11036. return "@yel@";
  11037. }
  11038.  
  11039. public void setWaveVolume(int i) {
  11040. signlink.wavevol = i;
  11041. }
  11042.  
  11043. private void draw3dScreen() {
  11044. if (counterOn)
  11045. drawCounterOnScreen();
  11046. drawSplitPrivateChat();
  11047. if (crossType == 1) {
  11048. crosses[crossIndex / 100]
  11049. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  11050. anInt1142++;
  11051. if (anInt1142 > 67) {
  11052. anInt1142 = 0;
  11053. stream.createFrame(78);
  11054. }
  11055. }
  11056. if (crossType == 2)
  11057. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  11058. crossY - 8 - 4);
  11059. if (anInt1018 != -1) {
  11060. method119(anInt945, anInt1018);
  11061. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  11062. }
  11063. if (openInterfaceID != -1) {
  11064. method119(anInt945, openInterfaceID);
  11065. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  11066. }
  11067. method70();
  11068.  
  11069. fadingScreen.draw();
  11070.  
  11071. if (!menuOpen) {
  11072. processRightClick();
  11073. drawTooltip();
  11074. } else if (menuScreenArea == 0)
  11075. drawMenu();
  11076. if (anInt1055 == 1)
  11077. multiOverlay.drawSprite(472, 296);
  11078. if (fpsOn) {
  11079. char c = '\u01FB';
  11080. int k = 20;
  11081. int i1 = 0xffff00;
  11082. if (super.fps < 15)
  11083. i1 = 0xff0000;
  11084. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  11085. k += 15;
  11086. Runtime runtime = Runtime.getRuntime();
  11087. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11088. i1 = 0xffff00;
  11089. if (j1 > 0x2000000 && lowMem)
  11090. i1 = 0xff0000;
  11091. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  11092. k += 15;
  11093. }
  11094. int x = baseX + (myPlayer.x - 6 >> 7);
  11095. int y = baseY + (myPlayer.y - 6 >> 7);
  11096. if (clientData) {
  11097. if (super.fps < 15) {
  11098. }
  11099. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285,
  11100. 5);
  11101. Runtime runtime = Runtime.getRuntime();
  11102. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11103. if (j1 > 0x2000000 && lowMem) {
  11104. }
  11105. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299,
  11106. 5);
  11107. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: "
  11108. + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  11109. aTextDrawingArea_1271.method385(0xffff00,
  11110. "Coords: " + x + ", " + y, 329, 5);
  11111. }
  11112. if (broadcastUpdate && anInt1104 != 0) {
  11113. int j = anInt1104 / 100;
  11114. j %= 60;
  11115. if (j > 0) {
  11116. aTextDrawingArea_1271.method385(0xffff00, broadcast, 329, 4);
  11117. } else {
  11118. anInt1104 = 0;
  11119. broadcast = "";
  11120. broadcastUpdate = false;
  11121. }
  11122. }
  11123. if (anInt1104 != 0 && !broadcastUpdate) {
  11124. int j = anInt1104 / 50;
  11125. int l = j / 60;
  11126. j %= 60;
  11127. if (j < 10)
  11128. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  11129. + l + ":0" + j, 329, 4);
  11130. else
  11131. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  11132. + l + ":" + j, 329, 4);
  11133. anInt849++;
  11134. if (anInt849 > 75) {
  11135. anInt849 = 0;
  11136. stream.createFrame(148);
  11137. }
  11138. }
  11139. }
  11140.  
  11141. private void addIgnore(long l) {
  11142. try {
  11143. if (l == 0L)
  11144. return;
  11145. if (ignoreCount >= 100) {
  11146. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  11147. return;
  11148. }
  11149. String s = TextClass.fixName(TextClass.nameForLong(l));
  11150. for (int j = 0; j < ignoreCount; j++)
  11151. if (ignoreListAsLongs[j] == l) {
  11152. pushMessage(s + " is already on your ignore list", 0, "");
  11153. return;
  11154. }
  11155. for (int k = 0; k < friendsCount; k++)
  11156. if (friendsListAsLongs[k] == l) {
  11157. pushMessage("Please remove " + s
  11158. + " from your friend list first", 0, "");
  11159. return;
  11160. }
  11161.  
  11162. ignoreListAsLongs[ignoreCount++] = l;
  11163. needDrawTabArea = true;
  11164. stream.createFrame(133);
  11165. stream.writeQWord(l);
  11166. return;
  11167. } catch (RuntimeException runtimeexception) {
  11168. signlink.reporterror("45688, " + l + ", " + 4 + ", "
  11169. + runtimeexception.toString());
  11170. }
  11171. throw new RuntimeException();
  11172. }
  11173.  
  11174. public void method114() {
  11175. for (int i = -1; i < playerCount; i++) {
  11176. int j;
  11177. if (i == -1)
  11178. j = myPlayerIndex;
  11179. else
  11180. j = playerIndices[i];
  11181. Player player = playerArray[j];
  11182. if (player != null)
  11183. method96(player);
  11184. }
  11185.  
  11186. }
  11187.  
  11188. public void method115() {
  11189. if (loadingStage == 2) {
  11190. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  11191. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  11192. .reverseGetNext()) {
  11193. if (class30_sub1.anInt1294 > 0)
  11194. class30_sub1.anInt1294--;
  11195. if (class30_sub1.anInt1294 == 0) {
  11196. if (class30_sub1.anInt1299 < 0
  11197. || ObjectManager.method178(class30_sub1.anInt1299,
  11198. class30_sub1.anInt1301)) {
  11199. method142(class30_sub1.anInt1298,
  11200. class30_sub1.anInt1295, class30_sub1.anInt1300,
  11201. class30_sub1.anInt1301, class30_sub1.anInt1297,
  11202. class30_sub1.anInt1296, class30_sub1.anInt1299);
  11203. class30_sub1.unlink();
  11204. }
  11205. } else {
  11206. if (class30_sub1.anInt1302 > 0)
  11207. class30_sub1.anInt1302--;
  11208. if (class30_sub1.anInt1302 == 0
  11209. && class30_sub1.anInt1297 >= 1
  11210. && class30_sub1.anInt1298 >= 1
  11211. && class30_sub1.anInt1297 <= 102
  11212. && class30_sub1.anInt1298 <= 102
  11213. && (class30_sub1.anInt1291 < 0 || ObjectManager
  11214. .method178(class30_sub1.anInt1291,
  11215. class30_sub1.anInt1293))) {
  11216. method142(class30_sub1.anInt1298,
  11217. class30_sub1.anInt1295, class30_sub1.anInt1292,
  11218. class30_sub1.anInt1293, class30_sub1.anInt1297,
  11219. class30_sub1.anInt1296, class30_sub1.anInt1291);
  11220. class30_sub1.anInt1302 = -1;
  11221. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  11222. && class30_sub1.anInt1299 == -1)
  11223. class30_sub1.unlink();
  11224. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  11225. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  11226. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  11227. class30_sub1.unlink();
  11228. }
  11229. }
  11230. }
  11231.  
  11232. }
  11233. }
  11234.  
  11235. public void determineMenuSize() {
  11236. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  11237. for (int j = 0; j < menuActionRow; j++) {
  11238. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  11239. if (k > i)
  11240. i = k;
  11241. }
  11242.  
  11243. i += 8;
  11244. int l = 15 * menuActionRow + 21;
  11245. if (super.saveClickX > 4 && super.saveClickY > 4
  11246. && super.saveClickX < 516 && super.saveClickY < 338) {
  11247. int i1 = super.saveClickX - 4 - i / 2;
  11248. if (i1 + i > 512)
  11249. i1 = 512 - i;
  11250. if (i1 < 0)
  11251. i1 = 0;
  11252. int l1 = super.saveClickY - 4;
  11253. if (l1 + l > 334)
  11254. l1 = 334 - l;
  11255. if (l1 < 0)
  11256. l1 = 0;
  11257. menuOpen = true;
  11258. menuScreenArea = 0;
  11259. menuOffsetX = i1;
  11260. menuOffsetY = l1;
  11261. menuWidth = i;
  11262. menuHeight = 15 * menuActionRow + 22;
  11263. }
  11264. if (super.saveClickX > 519 && super.saveClickY > 168
  11265. && super.saveClickX < 765 && super.saveClickY < 503) {
  11266. int j1 = super.saveClickX - 519 - i / 2;
  11267. if (j1 < 0)
  11268. j1 = 0;
  11269. else if (j1 + i > 245)
  11270. j1 = 245 - i;
  11271. int i2 = super.saveClickY - 168;
  11272. if (i2 < 0)
  11273. i2 = 0;
  11274. else if (i2 + l > 333)
  11275. i2 = 333 - l;
  11276. menuOpen = true;
  11277. menuScreenArea = 1;
  11278. menuOffsetX = j1;
  11279. menuOffsetY = i2;
  11280. menuWidth = i;
  11281. menuHeight = 15 * menuActionRow + 22;
  11282. }
  11283. if (super.saveClickX > 0 && super.saveClickY > 338
  11284. && super.saveClickX < 516 && super.saveClickY < 503) {
  11285. int k1 = super.saveClickX - 0 - i / 2;
  11286. if (k1 < 0)
  11287. k1 = 0;
  11288. else if (k1 + i > 516)
  11289. k1 = 516 - i;
  11290. int j2 = super.saveClickY - 338;
  11291. if (j2 < 0)
  11292. j2 = 0;
  11293. else if (j2 + l > 165)
  11294. j2 = 165 - l;
  11295. menuOpen = true;
  11296. menuScreenArea = 2;
  11297. menuOffsetX = k1;
  11298. menuOffsetY = j2;
  11299. menuWidth = i;
  11300. menuHeight = 15 * menuActionRow + 22;
  11301. }
  11302. }
  11303.  
  11304. public void method117(Stream stream) {
  11305. stream.initBitAccess();
  11306. int j = stream.readBits(1);
  11307. if (j == 0)
  11308. return;
  11309. int k = stream.readBits(2);
  11310. if (k == 0) {
  11311. anIntArray894[anInt893++] = myPlayerIndex;
  11312. return;
  11313. }
  11314. if (k == 1) {
  11315. int l = stream.readBits(3);
  11316. myPlayer.moveInDir(false, l);
  11317. int k1 = stream.readBits(1);
  11318. if (k1 == 1)
  11319. anIntArray894[anInt893++] = myPlayerIndex;
  11320. return;
  11321. }
  11322. if (k == 2) {
  11323. int i1 = stream.readBits(3);
  11324. myPlayer.moveInDir(true, i1);
  11325. int l1 = stream.readBits(3);
  11326. myPlayer.moveInDir(true, l1);
  11327. int j2 = stream.readBits(1);
  11328. if (j2 == 1)
  11329. anIntArray894[anInt893++] = myPlayerIndex;
  11330. return;
  11331. }
  11332. if (k == 3) {
  11333. plane = stream.readBits(2);
  11334. int j1 = stream.readBits(1);
  11335. int i2 = stream.readBits(1);
  11336. if (i2 == 1)
  11337. anIntArray894[anInt893++] = myPlayerIndex;
  11338. int k2 = stream.readBits(7);
  11339. int l2 = stream.readBits(7);
  11340. myPlayer.setPos(l2, k2, j1 == 1);
  11341. }
  11342. }
  11343.  
  11344. public void nullLoader() {
  11345. aBoolean831 = false;
  11346. while (drawingFlames) {
  11347. aBoolean831 = false;
  11348. try {
  11349. Thread.sleep(50L);
  11350. } catch (Exception _ex) {
  11351. }
  11352. }
  11353. aBackground_966 = null;
  11354. aBackground_967 = null;
  11355. aBackgroundArray1152s = null;
  11356. anIntArray850 = null;
  11357. anIntArray851 = null;
  11358. anIntArray852 = null;
  11359. anIntArray853 = null;
  11360. anIntArray1190 = null;
  11361. anIntArray1191 = null;
  11362. anIntArray828 = null;
  11363. anIntArray829 = null;
  11364. aClass30_Sub2_Sub1_Sub1_1201 = null;
  11365. aClass30_Sub2_Sub1_Sub1_1202 = null;
  11366. }
  11367.  
  11368. private boolean method119(int i, int j) {
  11369. boolean flag1 = false;
  11370. RSInterface class9 = RSInterface.interfaceCache[j];
  11371. for (int k = 0; k < class9.children.length; k++) {
  11372. if (class9.children[k] == -1)
  11373. break;
  11374. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  11375. if (class9_1.type == 1)
  11376. flag1 |= method119(i, class9_1.id);
  11377. if (class9_1.type == 6
  11378. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  11379. boolean flag2 = interfaceIsSelected(class9_1);
  11380. int l;
  11381. if (flag2)
  11382. l = class9_1.anInt258;
  11383. else
  11384. l = class9_1.anInt257;
  11385. if (l != -1) {
  11386. Animation animation = Animation.anims[l];
  11387. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  11388. .method258(class9_1.anInt246);) {
  11389. class9_1.anInt208 -= animation
  11390. .method258(class9_1.anInt246) + 1;
  11391. class9_1.anInt246++;
  11392. if (class9_1.anInt246 >= animation.anInt352) {
  11393. class9_1.anInt246 -= animation.anInt356;
  11394. if (class9_1.anInt246 < 0
  11395. || class9_1.anInt246 >= animation.anInt352)
  11396. class9_1.anInt246 = 0;
  11397. }
  11398. flag1 = true;
  11399. }
  11400.  
  11401. }
  11402. }
  11403. }
  11404.  
  11405. return flag1;
  11406. }
  11407.  
  11408. private int method120() {
  11409. if (variousSettings[307] == 1) {
  11410. return plane;
  11411. }
  11412. int j = 3;
  11413. if (yCameraCurve < 310) {
  11414. int k = xCameraPos >> 7;
  11415. int l = yCameraPos >> 7;
  11416. int i1 = myPlayer.x >> 7;
  11417. int j1 = myPlayer.y >> 7;
  11418. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11419. j = plane;
  11420. int k1;
  11421. if (i1 > k)
  11422. k1 = i1 - k;
  11423. else
  11424. k1 = k - i1;
  11425. int l1;
  11426. if (j1 > l)
  11427. l1 = j1 - l;
  11428. else
  11429. l1 = l - j1;
  11430. if (k1 > l1) {
  11431. int i2 = (l1 * 0x10000) / k1;
  11432. int k2 = 32768;
  11433. while (k != i1) {
  11434. if (k < i1)
  11435. k++;
  11436. else if (k > i1)
  11437. k--;
  11438. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11439. j = plane;
  11440. k2 += i2;
  11441. if (k2 >= 0x10000) {
  11442. k2 -= 0x10000;
  11443. if (l < j1)
  11444. l++;
  11445. else if (l > j1)
  11446. l--;
  11447. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11448. j = plane;
  11449. }
  11450. }
  11451. } else {
  11452. int j2 = (k1 * 0x10000) / l1;
  11453. int l2 = 32768;
  11454. while (l != j1) {
  11455. if (l < j1)
  11456. l++;
  11457. else if (l > j1)
  11458. l--;
  11459. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11460. j = plane;
  11461. l2 += j2;
  11462. if (l2 >= 0x10000) {
  11463. l2 -= 0x10000;
  11464. if (k < i1)
  11465. k++;
  11466. else if (k > i1)
  11467. k--;
  11468. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11469. j = plane;
  11470. }
  11471. }
  11472. }
  11473. }
  11474. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  11475. j = plane;
  11476. return j;
  11477. }
  11478.  
  11479. private int method121() {
  11480. if (variousSettings[307] == 1) {
  11481. return plane;
  11482. }
  11483. int j = method42(plane, yCameraPos, xCameraPos);
  11484. if (j - zCameraPos < 800
  11485. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  11486. return plane;
  11487. else
  11488. return 3;
  11489. }
  11490.  
  11491. private void delIgnore(long l) {
  11492. try {
  11493. if (l == 0L)
  11494. return;
  11495. for (int j = 0; j < ignoreCount; j++)
  11496. if (ignoreListAsLongs[j] == l) {
  11497. ignoreCount--;
  11498. needDrawTabArea = true;
  11499. System.arraycopy(ignoreListAsLongs, j + 1,
  11500. ignoreListAsLongs, j, ignoreCount - j);
  11501.  
  11502. stream.createFrame(74);
  11503. stream.writeQWord(l);
  11504. return;
  11505. }
  11506.  
  11507. return;
  11508. } catch (RuntimeException runtimeexception) {
  11509. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  11510. + runtimeexception.toString());
  11511. }
  11512. throw new RuntimeException();
  11513. }
  11514.  
  11515. @SuppressWarnings("unused")
  11516. private void chatJoin(long l) {
  11517. try {
  11518. if (l == 0L)
  11519. return;
  11520. stream.createFrame(60);
  11521. stream.writeQWord(l);
  11522. return;
  11523. } catch (RuntimeException runtimeexception) {
  11524. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  11525. + runtimeexception.toString());
  11526. }
  11527. throw new RuntimeException();
  11528.  
  11529. }
  11530.  
  11531. @Override
  11532. public String getParameter(String s) {
  11533. if (signlink.mainapp != null)
  11534. return signlink.mainapp.getParameter(s);
  11535. else
  11536. return super.getParameter(s);
  11537. }
  11538.  
  11539. public void adjustVolume(boolean flag, int i) {
  11540. signlink.midivol = i;
  11541. if (flag)
  11542. signlink.midi = "voladjust";
  11543. }
  11544.  
  11545. private int extractInterfaceValues(RSInterface class9, int j) {
  11546. if (class9.valueIndexArray == null
  11547. || j >= class9.valueIndexArray.length)
  11548. return -2;
  11549. try {
  11550. int ai[] = class9.valueIndexArray[j];
  11551. int k = 0;
  11552. int l = 0;
  11553. int i1 = 0;
  11554. do {
  11555. int j1 = ai[l++];
  11556. int k1 = 0;
  11557. byte byte0 = 0;
  11558. if (j1 == 0)
  11559. return k;
  11560. if (j1 == 1)
  11561. k1 = currentStats[ai[l++]];
  11562. if (j1 == 2)
  11563. k1 = maxStats[ai[l++]];
  11564. if (j1 == 3)
  11565. k1 = currentExp[ai[l++]];
  11566. if (j1 == 4) {
  11567. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  11568. int k2 = ai[l++];
  11569. if (k2 >= 0 && k2 < ItemDef.totalItems
  11570. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  11571. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  11572. if (class9_1.inv[j3] == k2 + 1)
  11573. k1 += class9_1.invStackSizes[j3];
  11574.  
  11575. }
  11576. }
  11577. if (j1 == 5)
  11578. k1 = variousSettings[ai[l++]];
  11579. if (j1 == 6)
  11580. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  11581. if (j1 == 7)
  11582. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11583. if (j1 == 8)
  11584. k1 = myPlayer.combatLevel;
  11585. if (j1 == 9) {
  11586. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  11587. if (Skills.skillEnabled[l1])
  11588. k1 += maxStats[l1];
  11589.  
  11590. }
  11591. if (j1 == 10) {
  11592. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11593. int l2 = ai[l++] + 1;
  11594. if (l2 >= 0 && l2 < ItemDef.totalItems
  11595. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  11596. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  11597. if (class9_2.inv[k3] != l2)
  11598. continue;
  11599. k1 = 0x3b9ac9ff;
  11600. break;
  11601. }
  11602.  
  11603. }
  11604. }
  11605. if (j1 == 11)
  11606. k1 = energy;
  11607. if (j1 == 12)
  11608. k1 = weight;
  11609. if (j1 == 13) {
  11610. int i2 = variousSettings[ai[l++]];
  11611. int i3 = ai[l++];
  11612. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11613. }
  11614. if (j1 == 14) {
  11615. int j2 = ai[l++];
  11616. VarBit varBit = VarBit.cache[j2];
  11617. int l3 = varBit.anInt648;
  11618. int i4 = varBit.anInt649;
  11619. int j4 = varBit.anInt650;
  11620. int k4 = anIntArray1232[j4 - i4];
  11621. k1 = variousSettings[l3] >> i4 & k4;
  11622. }
  11623. if (j1 == 15)
  11624. byte0 = 1;
  11625. if (j1 == 16)
  11626. byte0 = 2;
  11627. if (j1 == 17)
  11628. byte0 = 3;
  11629. if (j1 == 18)
  11630. k1 = (myPlayer.x >> 7) + baseX;
  11631. if (j1 == 19)
  11632. k1 = (myPlayer.y >> 7) + baseY;
  11633. if (j1 == 20)
  11634. k1 = ai[l++];
  11635. if (byte0 == 0) {
  11636. if (i1 == 0)
  11637. k += k1;
  11638. if (i1 == 1)
  11639. k -= k1;
  11640. if (i1 == 2 && k1 != 0)
  11641. k /= k1;
  11642. if (i1 == 3)
  11643. k *= k1;
  11644. i1 = 0;
  11645. } else {
  11646. i1 = byte0;
  11647. }
  11648. } while (true);
  11649. } catch (Exception _ex) {
  11650. return -1;
  11651. }
  11652. }
  11653.  
  11654. public void drawTooltip() {
  11655. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11656. return;
  11657. String s;
  11658. if (itemSelected == 1 && menuActionRow < 2)
  11659. s = "Use " + selectedItemName + " with...";
  11660. else if (spellSelected == 1 && menuActionRow < 2)
  11661. s = spellTooltip + "...";
  11662. else
  11663. s = menuActionName[menuActionRow - 1];
  11664. if (menuActionRow > 2)
  11665. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11666. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11667. }
  11668.  
  11669. private void drawMinimap() {
  11670. if (revision474 == true) {
  11671. aRSImageProducer_1164.initDrawingArea();
  11672. if (anInt1021 == 2) {
  11673. byte abyte0[] = mapBack.aByteArray1450;
  11674. int ai[] = DrawingArea.pixels;
  11675. int k2 = abyte0.length;
  11676. for (int i5 = 0; i5 < k2; i5++)
  11677. if (abyte0[i5] == 0)
  11678. ai[i5] = 0;
  11679. compass.method352(33, viewRotation, anIntArray1057, 256,
  11680. anIntArray968, 25, 0, 0, 33, 25);
  11681. aRSImageProducer_1165.initDrawingArea();
  11682. return;
  11683. }
  11684. int i = viewRotation + minimapRotation & 0x7ff;
  11685. int j = 48 + myPlayer.x / 32;
  11686. int l2 = 464 - myPlayer.y / 32;
  11687. for (int x = 0; x < anIntArray1229.length; x++) {
  11688. anIntArray1229[x] = 170;
  11689. anIntArray1052[x] = -23;
  11690. }
  11691. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  11692. 256 + minimapZoom, anIntArray1052, l2, 9, 54, 146, j);
  11693. compass.method352(33, viewRotation, anIntArray1057, 256,
  11694. anIntArray968, 25, 4, 26, 33, 25);
  11695. for (int j5 = 0; j5 < anInt1071; j5++) {
  11696. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11697. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11698. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  11699. }
  11700. for (int k5 = 0; k5 < 104; k5++) {
  11701. for (int l5 = 0; l5 < 104; l5++) {
  11702. NodeList class19 = groundArray[plane][k5][l5];
  11703. if (class19 != null) {
  11704. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11705. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11706. markMinimap(mapDotItem, l, j3);
  11707. }
  11708. }
  11709. }
  11710.  
  11711. for (int i6 = 0; i6 < npcCount; i6++) {
  11712. NPC npc = npcArray[npcIndices[i6]];
  11713. if (npc != null && npc.isVisible()) {
  11714. EntityDef entityDef = npc.desc;
  11715. if (entityDef.childrenIDs != null)
  11716. entityDef = entityDef.method161();
  11717. if (entityDef != null && entityDef.aBoolean87
  11718. && entityDef.aBoolean84) {
  11719. int i1 = npc.x / 32 - myPlayer.x / 32;
  11720. int k3 = npc.y / 32 - myPlayer.y / 32;
  11721. markMinimap(mapDotNPC, i1, k3);
  11722. }
  11723. }
  11724. }
  11725. for (int j6 = 0; j6 < playerCount; j6++) {
  11726. Player player = playerArray[playerIndices[j6]];
  11727. if (player != null && player.isVisible()) {
  11728. int j1 = player.x / 32 - myPlayer.x / 32;
  11729. int l3 = player.y / 32 - myPlayer.y / 32;
  11730. boolean flag1 = false;
  11731. boolean flag3 = false;
  11732. String clanname;
  11733. for (int j3 = 0; j3 < clanList.length; j3++) {
  11734. if (clanList[j3] == null)
  11735. continue;
  11736. clanname = clanList[j3];
  11737. if (clanname.startsWith("<clan"))
  11738. clanname = clanname.substring(
  11739. clanname.indexOf(">") + 1,
  11740. clanname.length());
  11741. if (!clanname.equalsIgnoreCase(player.name))
  11742. continue;
  11743. flag3 = true;
  11744. break;
  11745. }
  11746. long l6 = TextClass.longForName(player.name);
  11747. for (int k6 = 0; k6 < friendsCount; k6++) {
  11748. if (l6 != friendsListAsLongs[k6]
  11749. || friendsNodeIDs[k6] == 0)
  11750. continue;
  11751. flag1 = true;
  11752. break;
  11753. }
  11754. boolean flag2 = false;
  11755. if (myPlayer.team != 0 && player.team != 0
  11756. && myPlayer.team == player.team)
  11757. flag2 = true;
  11758. if (flag1)
  11759. markMinimap(mapDotFriend, j1, l3);
  11760. else if (flag3)
  11761. markMinimap(mapDotClan, j1, l3);
  11762. else if (flag2)
  11763. markMinimap(mapDotTeam, j1, l3);
  11764. else
  11765. markMinimap(mapDotPlayer, j1, l3);
  11766. }
  11767. }
  11768. if (anInt855 != 0 && loopCycle % 20 < 10) {
  11769. if (anInt855 == 1 && anInt1222 >= 0
  11770. && anInt1222 < npcArray.length) {
  11771. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11772. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  11773. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32
  11774. - myPlayer.x / 32;
  11775. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32
  11776. - myPlayer.y / 32;
  11777. method81(mapMarker, i4, k1);
  11778. }
  11779. }
  11780. if (anInt855 == 2) {
  11781. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11782. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11783. method81(mapMarker, j4, l1);
  11784. }
  11785. if (anInt855 == 10 && anInt933 >= 0
  11786. && anInt933 < playerArray.length) {
  11787. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11788. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  11789. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32
  11790. - myPlayer.x / 32;
  11791. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32
  11792. - myPlayer.y / 32;
  11793. method81(mapMarker, k4, i2);
  11794. }
  11795. }
  11796. }
  11797. if (destX != 0) {
  11798. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11799. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11800. markMinimap(mapFlag, j2, l4);
  11801. }
  11802. if (Configuration.isEvent()) {
  11803. markMinimap(mapFunctions[72], ((Configuration.eventX - baseX) * 4 + 2) - myPlayer.x
  11804. / 32, ((Configuration.eventY - baseY) * 4 + 2) - myPlayer.y / 32);
  11805. }
  11806. DrawingArea.drawPixels(3, 78 + 5, 97 + 30, 0xffffff, 3);
  11807. mapArea474.drawSprite(0, 0);
  11808. if (revision474 == true) {
  11809. if (variousSettings[306] == 0) {
  11810. loadAllOrbs(0);
  11811. }
  11812. if (OSCounter == true) {
  11813. rightClickMapArea();
  11814. }
  11815. }
  11816. if (menuOpen && menuScreenArea == 3) {
  11817. drawMenu();
  11818. }
  11819. aRSImageProducer_1165.initDrawingArea();
  11820. } else if (revision498 == true) {
  11821. aRSImageProducer_1164.initDrawingArea();
  11822. if (anInt1021 == 2) {
  11823. byte abyte0[] = mapBack.aByteArray1450;
  11824. int ai[] = DrawingArea.pixels;
  11825. int k2 = abyte0.length;
  11826. for (int i5 = 0; i5 < k2; i5++)
  11827. if (abyte0[i5] == 0)
  11828. ai[i5] = 0;
  11829. compass.method352(33, viewRotation, anIntArray1057, 256,
  11830. anIntArray968, 25, 8, 10, 33, 25);
  11831. aRSImageProducer_1165.initDrawingArea();
  11832. return;
  11833. }
  11834. int i = viewRotation + minimapRotation & 0x7ff;
  11835. int j = 48 + myPlayer.x / 32;
  11836. int l2 = 464 - myPlayer.y / 32;
  11837. for (int x = 0; x < anIntArray1229.length; x++) {
  11838. anIntArray1229[x] = 170;
  11839. anIntArray1052[x] = -23;
  11840. }
  11841. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  11842. 256 + minimapZoom, anIntArray1052, l2, 10, 45, 146, j);
  11843. compass.method352(33, viewRotation, anIntArray1057, 256,
  11844. anIntArray968, 25, 8, 8, 33, 25);
  11845. for (int j5 = 0; j5 < anInt1071; j5++) {
  11846. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11847. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11848. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  11849. }
  11850. markMinimap(minimapIcons[1], ((3095 - baseX) * 4 + 2) - myPlayer.x
  11851. / 32, ((3504 - baseY) * 4 + 2) - myPlayer.y / 32);
  11852. for (int k5 = 0; k5 < 104; k5++) {
  11853. for (int l5 = 0; l5 < 104; l5++) {
  11854. NodeList class19 = groundArray[plane][k5][l5];
  11855. if (class19 != null) {
  11856. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11857. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11858. markMinimap(mapDotItem, l, j3);
  11859. }
  11860. }
  11861. }
  11862.  
  11863. for (int i6 = 0; i6 < npcCount; i6++) {
  11864. NPC npc = npcArray[npcIndices[i6]];
  11865. if (npc != null && npc.isVisible()) {
  11866. EntityDef entityDef = npc.desc;
  11867. if (entityDef.childrenIDs != null)
  11868. entityDef = entityDef.method161();
  11869. if (entityDef != null && entityDef.aBoolean87
  11870. && entityDef.aBoolean84) {
  11871. int i1 = npc.x / 32 - myPlayer.x / 32;
  11872. int k3 = npc.y / 32 - myPlayer.y / 32;
  11873. markMinimap(mapDotNPC, i1, k3);
  11874. }
  11875. }
  11876. }
  11877. for (int j6 = 0; j6 < playerCount; j6++) {
  11878. Player player = playerArray[playerIndices[j6]];
  11879. if (player != null && player.isVisible()) {
  11880. int j1 = player.x / 32 - myPlayer.x / 32;
  11881. int l3 = player.y / 32 - myPlayer.y / 32;
  11882. boolean flag1 = false;
  11883. boolean clanMember = false;
  11884. long l6 = TextClass.longForName(player.name);
  11885. for (int k6 = 0; k6 < friendsCount; k6++) {
  11886. if (l6 != friendsListAsLongs[k6]
  11887. || friendsNodeIDs[k6] == 0)
  11888. continue;
  11889. flag1 = true;
  11890. break;
  11891. }
  11892. String clanname;
  11893. for (int j3 = 0; j3 < clanList.length; j3++) {
  11894. if (clanList[j3] == null)
  11895. continue;
  11896. clanname = clanList[j3];
  11897. if (clanname.startsWith("<clan"))
  11898. clanname = clanname.substring(
  11899. clanname.indexOf(">") + 1,
  11900. clanname.length());
  11901. if (!clanname.equalsIgnoreCase(player.name))
  11902. continue;
  11903. clanMember = true;
  11904. break;
  11905. }
  11906. if (flag1)
  11907. markMinimap(mapDotFriend, j1, l3);
  11908. else if (clanMember)
  11909. markMinimap(mapDotClan, j1, l3);
  11910. else
  11911. markMinimap(mapDotPlayer, j1, l3);
  11912. }
  11913. }
  11914. if (anInt855 != 0 && loopCycle % 20 < 10) {
  11915. if (anInt855 == 1 && anInt1222 >= 0
  11916. && anInt1222 < npcArray.length) {
  11917. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11918. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  11919. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32
  11920. - myPlayer.x / 32;
  11921. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32
  11922. - myPlayer.y / 32;
  11923. method81(mapMarker, i4, k1);
  11924. }
  11925. }
  11926. if (anInt855 == 2) {
  11927. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11928. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11929. method81(mapMarker, j4, l1);
  11930. }
  11931. if (anInt855 == 10 && anInt933 >= 0
  11932. && anInt933 < playerArray.length) {
  11933. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11934. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  11935. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32
  11936. - myPlayer.x / 32;
  11937. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32
  11938. - myPlayer.y / 32;
  11939. method81(mapMarker, k4, i2);
  11940. }
  11941. }
  11942. }
  11943. if (destX != 0) {
  11944. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11945. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11946. markMinimap(mapFlag, j2, l4);
  11947. }
  11948. DrawingArea.drawPixels(3, 78 + 5, 97 + 20, 0xffffff, 3);
  11949. mapArea.drawSprite(0, 0);
  11950. rightClickMapArea();
  11951. globe.drawSprite(8, 124);
  11952. aRSImageProducer_1165.initDrawingArea();
  11953. }
  11954. }
  11955.  
  11956. public boolean runClicked = false;
  11957. public boolean Resting = false;
  11958. public boolean runHover;
  11959. public boolean prayClicked = false;
  11960. public boolean is480 = false;
  11961. public boolean prayHover = false;
  11962.  
  11963. public void drawLogoutButton() {
  11964. if (tabInterfaceIDs[10] != -1 && anInt1054 == 9)
  11965. if (loopCycle % 20 >= 10)
  11966. ;
  11967. sideIcons[10].drawSprite(223, 1);
  11968. if (tabID == 10)
  11969. logIconC.drawSprite(223, 1);
  11970. }
  11971.  
  11972. public Sprite globe;
  11973. public Sprite magicAuto;
  11974.  
  11975. public void loadExtraSprites() {
  11976. for (int k = 1; k <= 15; k++)
  11977. ORBS[k] = new Sprite((new StringBuilder()).append("Frame/ORBS ")
  11978. .append(k).append("").toString());
  11979. }
  11980.  
  11981. public Sprite[] xpOrb = new Sprite[2];
  11982. public Sprite xpSprite;
  11983. Sprite[] counter;
  11984.  
  11985. public int digits = 0;
  11986.  
  11987. private void drawCounterOnScreen() {
  11988. int x = frameMode == ScreenMode.FIXED ? 500 : frameWidth - 200;
  11989. int y = frameMode == ScreenMode.FIXED ? 46 : 50;
  11990. digits = xpCounter == 0 ? 1 : 1 + (int) Math.floor(Math
  11991. .log10(xpCounter));
  11992. int lengthToRemove = Integer.toString(xpCounter).length();
  11993. int i = smallText.getTextWidth(Integer.toString(xpCounter))
  11994. - smallText.getTextWidth(Integer
  11995. .toString(xpCounter)) / 2;
  11996. int a = lengthToRemove == 1 ? 5 : ((lengthToRemove - 1) * 5);
  11997. String formattedCounter = NumberFormat.getIntegerInstance().format(xpCounter);
  11998. final boolean xpHover = super.mouseX >= 395 && super.mouseX <= 515 && super.mouseY >= 7 && super.mouseY <= 33;
  11999. if (xpHover) {
  12000. final boolean mostRecent = variousSettings[308] == 1;
  12001. String experience = NumberFormat.getIntegerInstance().format((Integer) currentExp[expSkill]);
  12002. int formatCounterWidth = aTextDrawingArea_1271.getTextWidth(formattedCounter);
  12003. int totalXPWidth = aTextDrawingArea_1271.getTextWidth(Skills.skillNames[expSkill] + " XP: " + experience);
  12004. int b = (mostRecent ? (formatCounterWidth > totalXPWidth ? formatCounterWidth : totalXPWidth) : formatCounterWidth);
  12005. int xOffset = 404 - b + (mostRecent ? 97 : 50);
  12006. drawHoverBox(xOffset, 40, "Total XP: " + formattedCounter +
  12007. (mostRecent ? ("\n@blu@" + capitalize(Skills.skillNames[expSkill]) + " XP: " + experience) : ""));
  12008. }
  12009. expDrops[22].drawAdvancedSprite(390, 2);
  12010. expDrops[variousSettings[308] == 1 ? expSkill : 21].drawSprite(393, 6);
  12011. if (xpCounter >= 0) {
  12012. smallText.method382(0xFFFFFD, x + 1 - i, NumberFormat.getIntegerInstance().format(xpCounter),
  12013. y - 24, true);
  12014. }
  12015. @SuppressWarnings("unchecked")
  12016. /**
  12017. * A queue of hits to avoid concurrent modification.
  12018. */
  12019. ArrayList<ExperienceCounterHit> displayHits = (ArrayList<ExperienceCounterHit>) hitsQueue
  12020. .clone();
  12021. /**
  12022. * Checks the hits
  12023. */
  12024. for (ExperienceCounterHit hit : displayHits) {
  12025. /**
  12026. * Checks the experience added
  12027. */
  12028. if (hit.getExpAdded() > 0) {
  12029. /**
  12030. * The text string
  12031. */
  12032. a = smallText.getTextWidth(""
  12033. + NumberFormat.getIntegerInstance().format(
  12034. hit.getExpAdded()) + "x");
  12035. /**
  12036. * Sends the text
  12037. */
  12038. smallText.method389(
  12039. true,
  12040. x - a + 12,
  12041. 0xFFFFFD, NumberFormat.getIntegerInstance().format(hit.getExpAdded()),
  12042. y + 120 - hit.getXpAddedPos());
  12043.  
  12044. /**
  12045. * Draws the corresponding skill icon
  12046. */
  12047. expDrops[hit.getSkill()].drawSprite(x - a - 5, y + 105 - hit.getXpAddedPos());
  12048. /**
  12049. * Increases position
  12050. */
  12051. hit.increaseXpAddedPos();
  12052. /**
  12053. * Removes the hit
  12054. */
  12055. if (hit.getXpAddedPos() >= 120) {
  12056. hitsQueue.remove(hit);
  12057. }
  12058. }
  12059. }
  12060. }
  12061.  
  12062. public int xpCounter;
  12063.  
  12064. /**
  12065. * Represents a queue of counter hits.
  12066. */
  12067. private ArrayList<ExperienceCounterHit> hitsQueue = new ArrayList<ExperienceCounterHit>();
  12068.  
  12069. /**
  12070. * Represents an experience counter hit
  12071. */
  12072. private static class ExperienceCounterHit {
  12073.  
  12074. /**
  12075. * The experience position
  12076. */
  12077. private int xpAddedPos;
  12078.  
  12079. /**
  12080. * The experience added
  12081. */
  12082. private int expAdded;
  12083.  
  12084. /**
  12085. * The skill the experience has been added to.
  12086. */
  12087. private int skill;
  12088.  
  12089. /**
  12090. * Creates a new <code>ExperienceCounterHit</code> object.
  12091. * @param expAdded
  12092. * @param skill
  12093. */
  12094. public ExperienceCounterHit(int expAdded, int skill) {
  12095. this.expAdded = expAdded;
  12096. this.xpAddedPos = 0;
  12097. this.skill = skill;
  12098. }
  12099.  
  12100. public int getSkill() {
  12101. return skill;
  12102. }
  12103.  
  12104. public int getXpAddedPos() {
  12105. return xpAddedPos;
  12106. }
  12107.  
  12108. public void increaseXpAddedPos() {
  12109. this.xpAddedPos++;
  12110. }
  12111.  
  12112. public int getExpAdded() {
  12113. return expAdded;
  12114. }
  12115. }
  12116.  
  12117. private boolean counterHover;
  12118.  
  12119.  
  12120. private void processMinimapActions() {
  12121. if (super.mouseX >= 542 && super.mouseX <= 579 && super.mouseY >= 2 && super.mouseY <= 38) {
  12122. menuActionName[1] = "Look North";
  12123. menuActionID[1] = 696;
  12124. menuActionRow = 2;
  12125. }
  12126. if (variousSettings[306] == 0) {
  12127. if (counterHover) {
  12128. menuActionName[2] = counterOn ? "Hide @or2@XP drops" : "Show @or2@XP drops";
  12129. menuActionID[2] = 474;
  12130. menuActionName[1] = "Reset @or2@XP drops";
  12131. menuActionID[1] = 475;
  12132. menuActionRow = 3;
  12133. }
  12134. if (runHover) {
  12135. menuActionName[1] = !runClicked ? "Turn run mode on" : "Turn run mode off";
  12136. menuActionID[1] = 1050;
  12137. menuActionRow = 2;
  12138. }
  12139. }
  12140. }
  12141. private boolean counterOn = false;
  12142.  
  12143. private final void minimapHovers() {
  12144. final boolean fixed = frameMode == ScreenMode.FIXED;
  12145. hpHover = fixed ? super.mouseX >= 518 && super.mouseX <= 571 && super.mouseY >= 49 && super.mouseY < 70 : super.mouseX >= frameWidth - 216 && super.mouseX <= 159 && super.mouseY >= 49 && super.mouseY < 71;
  12146. prayHover = fixed ? super.mouseX >= 519 && super.mouseX <= 571 && super.mouseY >= 89 && super.mouseY < 111 : super.mouseX >= frameWidth - 207 && super.mouseX <= frameWidth - 151 && super.mouseY >= 92 && super.mouseY < 115;
  12147. runHover = fixed ? super.mouseX >= 542 && super.mouseX <= 595 && super.mouseY >= 127 && super.mouseY < 152 : super.mouseX >= frameWidth - 174 && super.mouseX <= frameWidth - 120 && super.mouseY >= 130 && super.mouseY < 152;
  12148. counterHover = fixed ? super.mouseX >= 519 && super.mouseX <= 545 && super.mouseY >= 18 && super.mouseY < 46 : super.mouseX >= frameWidth - 174 && super.mouseX <= frameWidth - 120 && super.mouseY >= 130 && super.mouseY < 152;
  12149. }
  12150.  
  12151. private void rightClickMapArea() {
  12152. if (revision498 == true) {
  12153. int x = super.mouseX;
  12154. int y = super.mouseY;
  12155. if (x >= 531 && x <= 557 && y >= 7 && y <= 40) {
  12156. menuActionName[1] = "Face North";
  12157. menuActionID[1] = 696;
  12158. menuActionRow = 2;
  12159. }
  12160. }
  12161. }
  12162.  
  12163. public void npcScreenPos(Entity entity, int i) {
  12164. calcEntityScreenPos(entity.x, i, entity.y);
  12165. }
  12166.  
  12167. public void calcEntityScreenPos(int i, int j, int l) {
  12168. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  12169. spriteDrawX = -1;
  12170. spriteDrawY = -1;
  12171. return;
  12172. }
  12173. int i1 = method42(plane, l, i) - j;
  12174. i -= xCameraPos;
  12175. i1 -= zCameraPos;
  12176. l -= yCameraPos;
  12177. int j1 = Model.modelIntArray1[yCameraCurve];
  12178. int k1 = Model.modelIntArray2[yCameraCurve];
  12179. int l1 = Model.modelIntArray1[xCameraCurve];
  12180. int i2 = Model.modelIntArray2[xCameraCurve];
  12181. int j2 = l * l1 + i * i2 >> 16;
  12182. l = l * i2 - i * l1 >> 16;
  12183. i = j2;
  12184. j2 = i1 * k1 - l * j1 >> 16;
  12185. l = i1 * j1 + l * k1 >> 16;
  12186. i1 = j2;
  12187. if (l >= 50) {
  12188. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  12189. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  12190. } else {
  12191. spriteDrawX = -1;
  12192. spriteDrawY = -1;
  12193. }
  12194. }
  12195.  
  12196. private void buildSplitPrivateChatMenu() {
  12197. if (splitPrivateChat == 0)
  12198. return;
  12199. int i = 0;
  12200. if (anInt1104 != 0)
  12201. i = 1;
  12202. for (int j = 0; j < 100; j++)
  12203. if (chatMessages[j] != null) {
  12204. int k = chatTypes[j];
  12205. String s = chatNames[j];
  12206. if (s != null && s.startsWith("@cr1@")) {
  12207. s = s.substring(5);
  12208. }
  12209. if (s != null && s.startsWith("@cr2@")) {
  12210. s = s.substring(5);
  12211. }
  12212. if (s != null && s.startsWith("@cr3@")) {
  12213. s = s.substring(5);
  12214. }
  12215. if (s != null && s.startsWith("@cr4@")) {
  12216. s = s.substring(5);
  12217. }
  12218. if (s != null && s.startsWith("@cr5@")) {
  12219. s = s.substring(5);
  12220. }
  12221. if (s != null && s.startsWith("@cr6@")) {
  12222. s = s.substring(5);
  12223. }
  12224. if (s != null && s.startsWith("@cr7@")) {
  12225. s = s.substring(5);
  12226. }
  12227. if (s != null && s.startsWith("@cr8@")) {
  12228. s = s.substring(5);
  12229. }
  12230. if (s != null && s.startsWith("@cr9@")) {
  12231. s = s.substring(5);
  12232. }
  12233. if (s != null && s.startsWith("@cr10@")) {
  12234. s = s.substring(6);
  12235. }
  12236. if (s != null && s.startsWith("@cr11@")) {
  12237. s = s.substring(6);
  12238. }
  12239. if ((k == 3 || k == 7)
  12240. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  12241. && isFriendOrSelf(s))) {
  12242. int l = 329 - i * 13;
  12243. if (super.mouseX > 4 && super.mouseY - 4 > l - 10
  12244. && super.mouseY - 4 <= l + 3) {
  12245. int i1 = aTextDrawingArea_1271.getTextWidth("From: "
  12246. + s + chatMessages[j]) + 25;
  12247. if (i1 > 450)
  12248. i1 = 450;
  12249. if (super.mouseX < 4 + i1) {
  12250. if (myPrivilege >= 1) {
  12251. menuActionName[menuActionRow] = "Report abuse @whi@"
  12252. + s;
  12253. menuActionID[menuActionRow] = 2606;
  12254. menuActionRow++;
  12255. }
  12256. menuActionName[menuActionRow] = "Add ignore @whi@"
  12257. + s;
  12258. menuActionID[menuActionRow] = 2042;
  12259. menuActionRow++;
  12260. menuActionName[menuActionRow] = "Add friend @whi@"
  12261. + s;
  12262. menuActionID[menuActionRow] = 2337;
  12263. menuActionRow++;
  12264. }
  12265. }
  12266. if (++i >= 5)
  12267. return;
  12268. }
  12269. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  12270. return;
  12271. }
  12272.  
  12273. }
  12274.  
  12275. public void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  12276. int i2, int j2) {
  12277. Class30_Sub1 class30_sub1 = null;
  12278. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12279. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12280. .reverseGetNext()) {
  12281. if (class30_sub1_1.anInt1295 != l1
  12282. || class30_sub1_1.anInt1297 != i2
  12283. || class30_sub1_1.anInt1298 != j1
  12284. || class30_sub1_1.anInt1296 != i1)
  12285. continue;
  12286. class30_sub1 = class30_sub1_1;
  12287. break;
  12288. }
  12289.  
  12290. if (class30_sub1 == null) {
  12291. class30_sub1 = new Class30_Sub1();
  12292. class30_sub1.anInt1295 = l1;
  12293. class30_sub1.anInt1296 = i1;
  12294. class30_sub1.anInt1297 = i2;
  12295. class30_sub1.anInt1298 = j1;
  12296. method89(class30_sub1);
  12297. aClass19_1179.insertHead(class30_sub1);
  12298. }
  12299. class30_sub1.anInt1291 = k;
  12300. class30_sub1.anInt1293 = k1;
  12301. class30_sub1.anInt1292 = l;
  12302. class30_sub1.anInt1302 = j2;
  12303. class30_sub1.anInt1294 = j;
  12304. }
  12305.  
  12306. private boolean interfaceIsSelected(RSInterface class9) {
  12307. if (class9.anIntArray245 == null)
  12308. return false;
  12309. for (int i = 0; i < class9.anIntArray245.length; i++) {
  12310. int j = extractInterfaceValues(class9, i);
  12311. int k = class9.anIntArray212[i];
  12312. if (class9.anIntArray245[i] == 2) {
  12313. if (j >= k)
  12314. return false;
  12315. } else if (class9.anIntArray245[i] == 3) {
  12316. if (j <= k)
  12317. return false;
  12318. } else if (class9.anIntArray245[i] == 4) {
  12319. if (j == k)
  12320. return false;
  12321. } else if (j != k)
  12322. return false;
  12323. }
  12324.  
  12325. return true;
  12326. }
  12327.  
  12328. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  12329. // if(!aBoolean872)
  12330. // if(signlink.mainapp != null)
  12331. // return signlink.openurl(s);
  12332. // else
  12333. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  12334. if (aSocket832 != null) {
  12335. try {
  12336. aSocket832.close();
  12337. } catch (Exception _ex) {
  12338. }
  12339. aSocket832 = null;
  12340. }
  12341. aSocket832 = openSocket(port);
  12342. aSocket832.setSoTimeout(10000);
  12343. java.io.InputStream inputstream = aSocket832.getInputStream();
  12344. OutputStream outputstream = aSocket832.getOutputStream();
  12345. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  12346. return new DataInputStream(inputstream);
  12347. }
  12348.  
  12349. public void doFlamesDrawing() {
  12350. char c = '\u0100';
  12351. if (anInt1040 > 0) {
  12352. for (int i = 0; i < 256; i++)
  12353. if (anInt1040 > 768)
  12354. anIntArray850[i] = method83(anIntArray851[i],
  12355. anIntArray852[i], 1024 - anInt1040);
  12356. else if (anInt1040 > 256)
  12357. anIntArray850[i] = anIntArray852[i];
  12358. else
  12359. anIntArray850[i] = method83(anIntArray852[i],
  12360. anIntArray851[i], 256 - anInt1040);
  12361.  
  12362. } else if (anInt1041 > 0) {
  12363. for (int j = 0; j < 256; j++)
  12364. if (anInt1041 > 768)
  12365. anIntArray850[j] = method83(anIntArray851[j],
  12366. anIntArray853[j], 1024 - anInt1041);
  12367. else if (anInt1041 > 256)
  12368. anIntArray850[j] = anIntArray853[j];
  12369. else
  12370. anIntArray850[j] = method83(anIntArray853[j],
  12371. anIntArray851[j], 256 - anInt1041);
  12372.  
  12373. } else {
  12374. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  12375.  
  12376. }
  12377. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  12378. aRSImageProducer_1110.anIntArray315, 0, 33920);
  12379.  
  12380. int i1 = 0;
  12381. int j1 = 1152;
  12382. for (int k1 = 1; k1 < c - 1; k1++) {
  12383. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  12384. int j2 = 22 + l1;
  12385. if (j2 < 0)
  12386. j2 = 0;
  12387. i1 += j2;
  12388. for (int l2 = j2; l2 < 128; l2++) {
  12389. int j3 = anIntArray828[i1++];
  12390. if (j3 != 0) {
  12391. int l3 = j3;
  12392. int j4 = 256 - j3;
  12393. j3 = anIntArray850[j3];
  12394. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  12395. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  12396. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  12397. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  12398. } else {
  12399. j1++;
  12400. }
  12401. }
  12402.  
  12403. j1 += j2;
  12404. }
  12405.  
  12406. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  12407. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  12408. aRSImageProducer_1111.anIntArray315, 0, 33920);
  12409.  
  12410. i1 = 0;
  12411. j1 = 1176;
  12412. for (int k2 = 1; k2 < c - 1; k2++) {
  12413. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  12414. int k3 = 103 - i3;
  12415. j1 += i3;
  12416. for (int i4 = 0; i4 < k3; i4++) {
  12417. int k4 = anIntArray828[i1++];
  12418. if (k4 != 0) {
  12419. int i5 = k4;
  12420. int j5 = 256 - k4;
  12421. k4 = anIntArray850[k4];
  12422. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  12423. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  12424. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  12425. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  12426. } else {
  12427. j1++;
  12428. }
  12429. }
  12430.  
  12431. i1 += 128 - k3;
  12432. j1 += 128 - k3 - i3;
  12433. }
  12434.  
  12435. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  12436. }
  12437.  
  12438. public void method134(Stream stream) {
  12439. int j = stream.readBits(8);
  12440. if (j < playerCount) {
  12441. for (int k = j; k < playerCount; k++)
  12442. anIntArray840[anInt839++] = playerIndices[k];
  12443.  
  12444. }
  12445. if (j > playerCount) {
  12446. signlink.reporterror(myUsername + " Too many players");
  12447. throw new RuntimeException("eek");
  12448. }
  12449. playerCount = 0;
  12450. for (int l = 0; l < j; l++) {
  12451. int i1 = playerIndices[l];
  12452. Player player = playerArray[i1];
  12453. int j1 = stream.readBits(1);
  12454. if (j1 == 0) {
  12455. playerIndices[playerCount++] = i1;
  12456. player.anInt1537 = loopCycle;
  12457. } else {
  12458. int k1 = stream.readBits(2);
  12459. if (k1 == 0) {
  12460. playerIndices[playerCount++] = i1;
  12461. player.anInt1537 = loopCycle;
  12462. anIntArray894[anInt893++] = i1;
  12463. } else if (k1 == 1) {
  12464. playerIndices[playerCount++] = i1;
  12465. player.anInt1537 = loopCycle;
  12466. int l1 = stream.readBits(3);
  12467. player.moveInDir(false, l1);
  12468. int j2 = stream.readBits(1);
  12469. if (j2 == 1)
  12470. anIntArray894[anInt893++] = i1;
  12471. } else if (k1 == 2) {
  12472. playerIndices[playerCount++] = i1;
  12473. player.anInt1537 = loopCycle;
  12474. int i2 = stream.readBits(3);
  12475. player.moveInDir(true, i2);
  12476. int k2 = stream.readBits(3);
  12477. player.moveInDir(true, k2);
  12478. int l2 = stream.readBits(1);
  12479. if (l2 == 1)
  12480. anIntArray894[anInt893++] = i1;
  12481. } else if (k1 == 3)
  12482. anIntArray840[anInt839++] = i1;
  12483. }
  12484. }
  12485. }
  12486.  
  12487. private enum LoginScreenState {
  12488. LOGIN, DOWNLOADING_CLIENT;
  12489. }
  12490.  
  12491. private LoginScreenState loginState = LoginScreenState.LOGIN;
  12492.  
  12493. public void drawLoginScreen(boolean flag) {
  12494. if (this.loggedIn)
  12495. return;
  12496. resetAllImageProducers();
  12497. resetImageProducers();
  12498. loginScreenArea.initDrawingArea();
  12499.  
  12500. DrawingArea.drawPixels(0, 0, 765, 503, 0x000000);
  12501. if (loginState == LoginScreenState.DOWNLOADING_CLIENT) {
  12502. aTextDrawingArea_1271.drawText(0xCC9900, "Client is out of date.",
  12503. 225, 375);
  12504. aTextDrawingArea_1271.drawText(0xCC9900,
  12505. "Downloading client, Please wait...", 240, 375);
  12506. loginScreenArea.drawGraphics(0, super.graphics, 0);
  12507. return;
  12508. }
  12509. if (backgroundFix == null)
  12510. backgroundFix = new Sprite("loginscreen/general/background");
  12511. backgroundFix.drawSprite(0, 0);
  12512. new Sprite("loginscreen/general/login_box").drawAdvancedSprite(765 / 2 - 364 / 2, 503 / 2 - 360 / 2 + 50);
  12513. new Sprite("loginscreen/general/logo").drawAdvancedSprite(765 / 2 - 118 / 2, 20);
  12514. //new Sprite("loginscreen/general/stacked_logo").drawAdvancedSprite(765 / 2 - 358 / 2, 10);
  12515.  
  12516. newRegularFont.drawBasicString("Username:", 224, 198, 0xFF981F, 0x000000);
  12517. newRegularFont.drawBasicString("Password:", 224, 254, 0xFF981F, 0x000000);
  12518. char c = '\u0168';
  12519. if (loginScreenState == 0 || loginScreenState == 2) {
  12520. /**
  12521. * Input hover
  12522. */
  12523. if (super.mouseX >= 239 && super.mouseX <= 529 && super.mouseY > 202 && super.mouseY < 237) {
  12524. new Sprite("loginscreen/general/input_hover").drawAdvancedSprite(234, 202);
  12525. } else {
  12526. new Sprite("loginscreen/general/input").drawAdvancedSprite(234, 202);
  12527. }
  12528. /**
  12529. * Password input
  12530. */
  12531. if (super.mouseX >= 239 && super.mouseX <= 529 && super.mouseY > 258 && super.mouseY < 293) {
  12532. new Sprite("loginscreen/general/input_hover").drawAdvancedSprite(234, 258);
  12533. } else {
  12534. new Sprite("loginscreen/general/input").drawAdvancedSprite(234, 258);
  12535. }
  12536. /**
  12537. * Login button
  12538. */
  12539. if (super.mouseX >= 318 && super.mouseX <= 449 && super.mouseY > 320 && super.mouseY < 347) {
  12540. new Sprite("loginscreen/general/login_hover").drawAdvancedSprite((765 / 2) - (142 / 2), 310);
  12541. } else {
  12542. new Sprite("loginscreen/general/login").drawAdvancedSprite((765 / 2) - (142 / 2), 310);
  12543. }
  12544. new Sprite("loginscreen/general/message_background").drawAdvancedSprite(765 / 2 - 286 / 2, 350);
  12545. int i = 100;
  12546. aTextDrawingArea_1271.method382(0x75a9a9, c / 190,
  12547. onDemandFetcher.statusString, i, true);
  12548. this.smallText.method382(0xFF981F, 765 / 2, this.loginMessage1,
  12549. 380, true);
  12550. this.smallText.method382(0xFF981F, 765 / 2, this.loginMessage2,
  12551. 400, true);
  12552. this.aTextDrawingArea_1271
  12553. .method389(
  12554. false,
  12555. 245,
  12556. 0xFF981F,
  12557. new StringBuilder()
  12558. .append("")
  12559. .append(capitalize(myUsername))
  12560. .append(((this.loginScreenCursorPos == 0 ? 1
  12561. : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|"
  12562. : "").toString(),
  12563. 224);
  12564. this.aTextDrawingArea_1271
  12565. .method389(
  12566. true,
  12567. 245,
  12568. 0xFF981F,
  12569. new StringBuilder()
  12570. .append("")
  12571. .append(TextClass
  12572. .passwordAsterisks(myPassword))
  12573. .append(((this.loginScreenCursorPos == 1 ? 1
  12574. : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|"
  12575. : "").toString(),
  12576. 281);
  12577. }
  12578. boolean debug = false;
  12579. if (debug) {
  12580. this.newRegularFont.drawBasicString("Mouse X: " + super.mouseX, 25,
  12581. 50);
  12582. this.newRegularFont.drawBasicString("Mouse Y: " + super.mouseY, 25,
  12583. 65);
  12584. this.newRegularFont.drawBasicString("Click X: " + super.saveClickX,
  12585. 25, 80);
  12586. this.newRegularFont.drawBasicString("Click Y: " + super.saveClickY,
  12587. 25, 95);
  12588. }
  12589. loginScreenArea.drawGraphics(0, super.graphics, 0);
  12590. }
  12591.  
  12592. public void drawSmoothLoading(int i, String s) {
  12593. for (float f = LP; f < (float) i; f = (float) ((double) f + 1.49999999999999999D))
  12594. drawLoadingText((int) f, s);
  12595.  
  12596. LP = i;
  12597. }
  12598.  
  12599. private void drawFlames() {
  12600. try {
  12601. long l = System.currentTimeMillis();
  12602. int i = 0;
  12603. int j = 20;
  12604. while (aBoolean831) {
  12605. anInt1208++;
  12606. if (showFlames) {
  12607. // calcFlamesPosition();
  12608. // calcFlamesPosition();
  12609. }
  12610. // doFlamesDrawing();
  12611. if (++i > 10) {
  12612. long l1 = System.currentTimeMillis();
  12613. int k = (int) (l1 - l) / 10 - j;
  12614. j = 40 - k;
  12615. if (j < 5)
  12616. j = 5;
  12617. i = 0;
  12618. l = l1;
  12619. }
  12620. try {
  12621. Thread.sleep(j);
  12622. } catch (Exception _ex) {
  12623. }
  12624. }
  12625. } catch (Exception _ex) {
  12626. drawingFlames = false;
  12627. }
  12628. }
  12629.  
  12630. @Override
  12631. public void raiseWelcomeScreen() {
  12632. welcomeScreenRaised = true;
  12633. }
  12634.  
  12635. public void method137(Stream stream, int j) {
  12636. if (j == 84) {
  12637. int k = stream.readUnsignedByte();
  12638. int j3 = anInt1268 + (k >> 4 & 7);
  12639. int i6 = anInt1269 + (k & 7);
  12640. int l8 = stream.readUnsignedWord();
  12641. int k11 = stream.readUnsignedWord();
  12642. int l13 = stream.readUnsignedWord();
  12643. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  12644. NodeList class19_1 = groundArray[plane][j3][i6];
  12645. if (class19_1 != null) {
  12646. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  12647. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  12648. .reverseGetNext()) {
  12649. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  12650. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  12651. continue;
  12652. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  12653. break;
  12654. }
  12655.  
  12656. spawnGroundItem(j3, i6);
  12657. }
  12658. }
  12659. return;
  12660. }
  12661. if (j == 105) {
  12662. int l = stream.readUnsignedByte();
  12663. int k3 = anInt1268 + (l >> 4 & 7);
  12664. int j6 = anInt1269 + (l & 7);
  12665. int i9 = stream.readUnsignedWord();
  12666. int l11 = stream.readUnsignedByte();
  12667. int i14 = l11 >> 4 & 0xf;
  12668. int i16 = l11 & 7;
  12669. if (myPlayer.smallX[0] >= k3 - i14
  12670. && myPlayer.smallX[0] <= k3 + i14
  12671. && myPlayer.smallY[0] >= j6 - i14
  12672. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  12673. && anInt1062 < 50) {
  12674. anIntArray1207[anInt1062] = i9;
  12675. anIntArray1241[anInt1062] = i16;
  12676. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  12677. anInt1062++;
  12678. }
  12679. }
  12680. if (j == 215) {
  12681. int i1 = stream.method435();
  12682. int l3 = stream.method428();
  12683. int k6 = anInt1268 + (l3 >> 4 & 7);
  12684. int j9 = anInt1269 + (l3 & 7);
  12685. int i12 = stream.method435();
  12686. int j14 = stream.readUnsignedWord();
  12687. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  12688. && i12 != unknownInt10) {
  12689. Item class30_sub2_sub4_sub2_2 = new Item();
  12690. class30_sub2_sub4_sub2_2.ID = i1;
  12691. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  12692. if (groundArray[plane][k6][j9] == null)
  12693. groundArray[plane][k6][j9] = new NodeList();
  12694. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  12695. spawnGroundItem(k6, j9);
  12696. }
  12697. return;
  12698. }
  12699. if (j == 156) {
  12700. int j1 = stream.method426();
  12701. int i4 = anInt1268 + (j1 >> 4 & 7);
  12702. int l6 = anInt1269 + (j1 & 7);
  12703. int k9 = stream.readUnsignedWord();
  12704. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  12705. NodeList class19 = groundArray[plane][i4][l6];
  12706. if (class19 != null) {
  12707. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  12708. .reverseGetNext()) {
  12709. if (item.ID != (k9 & 0x7fff))
  12710. continue;
  12711. item.unlink();
  12712. break;
  12713. }
  12714.  
  12715. if (class19.reverseGetFirst() == null)
  12716. groundArray[plane][i4][l6] = null;
  12717. spawnGroundItem(i4, l6);
  12718. }
  12719. }
  12720. return;
  12721. }
  12722. if (j == 160) {
  12723. int k1 = stream.method428();
  12724. int j4 = anInt1268 + (k1 >> 4 & 7);
  12725. int i7 = anInt1269 + (k1 & 7);
  12726. int l9 = stream.method428();
  12727. int j12 = l9 >> 2;
  12728. int k14 = l9 & 3;
  12729. int j16 = anIntArray1177[j12];
  12730. int j17 = stream.method435();
  12731. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  12732. int j18 = intGroundArray[plane][j4][i7];
  12733. int i19 = intGroundArray[plane][j4 + 1][i7];
  12734. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  12735. int k20 = intGroundArray[plane][j4][i7 + 1];
  12736. if (j16 == 0) {
  12737. Object1 class10 = worldController.method296(plane, j4, i7);
  12738. if (class10 != null) {
  12739. int k21 = class10.uid >> 14 & 0x7fff;
  12740. if (j12 == 2) {
  12741. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  12742. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  12743. false);
  12744. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  12745. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  12746. j17, false);
  12747. } else {
  12748. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  12749. k21, k14, j12, i19, l19, j18, k20, j17,
  12750. false);
  12751. }
  12752. }
  12753. }
  12754. if (j16 == 1) {
  12755. Object2 class26 = worldController.method297(j4, i7, plane);
  12756. if (class26 != null)
  12757. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  12758. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  12759. j18, k20, j17, false);
  12760. }
  12761. if (j16 == 2) {
  12762. Object5 class28 = worldController.method298(j4, i7, plane);
  12763. if (j12 == 11)
  12764. j12 = 10;
  12765. if (class28 != null)
  12766. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  12767. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  12768. j18, k20, j17, false);
  12769. }
  12770. if (j16 == 3) {
  12771. Object3 class49 = worldController.method299(i7, j4, plane);
  12772. if (class49 != null)
  12773. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  12774. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  12775. j18, k20, j17, false);
  12776. }
  12777. }
  12778. return;
  12779. }
  12780. if (j == 147) {
  12781. int l1 = stream.method428();
  12782. int k4 = anInt1268 + (l1 >> 4 & 7);
  12783. int j7 = anInt1269 + (l1 & 7);
  12784. int i10 = stream.readUnsignedWord();
  12785. byte byte0 = stream.method430();
  12786. int l14 = stream.method434();
  12787. byte byte1 = stream.method429();
  12788. int k17 = stream.readUnsignedWord();
  12789. int k18 = stream.method428();
  12790. int j19 = k18 >> 2;
  12791. int i20 = k18 & 3;
  12792. int l20 = anIntArray1177[j19];
  12793. byte byte2 = stream.readSignedByte();
  12794. int l21 = stream.readUnsignedWord();
  12795. byte byte3 = stream.method429();
  12796. Player player;
  12797. if (i10 == unknownInt10)
  12798. player = myPlayer;
  12799. else
  12800. player = playerArray[i10];
  12801. if (player != null) {
  12802. ObjectDef class46 = ObjectDef.forID(l21);
  12803. int i22 = intGroundArray[plane][k4][j7];
  12804. int j22 = intGroundArray[plane][k4 + 1][j7];
  12805. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  12806. int l22 = intGroundArray[plane][k4][j7 + 1];
  12807. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  12808. -1);
  12809. if (model != null) {
  12810. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  12811. player.anInt1707 = l14 + loopCycle;
  12812. player.anInt1708 = k17 + loopCycle;
  12813. player.aModel_1714 = model;
  12814. int i23 = class46.anInt744;
  12815. int j23 = class46.anInt761;
  12816. if (i20 == 1 || i20 == 3) {
  12817. i23 = class46.anInt761;
  12818. j23 = class46.anInt744;
  12819. }
  12820. player.anInt1711 = k4 * 128 + i23 * 64;
  12821. player.anInt1713 = j7 * 128 + j23 * 64;
  12822. player.anInt1712 = method42(plane, player.anInt1713,
  12823. player.anInt1711);
  12824. if (byte2 > byte0) {
  12825. byte byte4 = byte2;
  12826. byte2 = byte0;
  12827. byte0 = byte4;
  12828. }
  12829. if (byte3 > byte1) {
  12830. byte byte5 = byte3;
  12831. byte3 = byte1;
  12832. byte1 = byte5;
  12833. }
  12834. player.anInt1719 = k4 + byte2;
  12835. player.anInt1721 = k4 + byte0;
  12836. player.anInt1720 = j7 + byte3;
  12837. player.anInt1722 = j7 + byte1;
  12838. }
  12839. }
  12840. }
  12841. if (j == 151) {
  12842. int i2 = stream.method426();
  12843. int l4 = anInt1268 + (i2 >> 4 & 7);
  12844. int k7 = anInt1269 + (i2 & 7);
  12845. int j10 = stream.method434();
  12846. int k12 = stream.method428();
  12847. int i15 = k12 >> 2;
  12848. int k16 = k12 & 3;
  12849. int l17 = anIntArray1177[i15];
  12850. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  12851. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  12852. return;
  12853. }
  12854. if (j == 4) {
  12855. int j2 = stream.readUnsignedByte();
  12856. int i5 = anInt1268 + (j2 >> 4 & 7);
  12857. int l7 = anInt1269 + (j2 & 7);
  12858. int k10 = stream.readUnsignedWord();
  12859. int l12 = stream.readUnsignedByte();
  12860. int j15 = stream.readUnsignedWord();
  12861. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  12862. i5 = i5 * 128 + 64;
  12863. l7 = l7 * 128 + 64;
  12864. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  12865. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  12866. i5);
  12867. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  12868. }
  12869. return;
  12870. }
  12871. if (j == 44) {
  12872. int k2 = stream.method436();
  12873. int j5 = stream.readUnsignedWord();
  12874. int i8 = stream.readUnsignedByte();
  12875. int l10 = anInt1268 + (i8 >> 4 & 7);
  12876. int i13 = anInt1269 + (i8 & 7);
  12877. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  12878. Item class30_sub2_sub4_sub2_1 = new Item();
  12879. class30_sub2_sub4_sub2_1.ID = k2;
  12880. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  12881. if (groundArray[plane][l10][i13] == null)
  12882. groundArray[plane][l10][i13] = new NodeList();
  12883. groundArray[plane][l10][i13]
  12884. .insertHead(class30_sub2_sub4_sub2_1);
  12885. spawnGroundItem(l10, i13);
  12886. }
  12887. return;
  12888. }
  12889. if (j == 101) {
  12890. int l2 = stream.method427();
  12891. int k5 = l2 >> 2;
  12892. int j8 = l2 & 3;
  12893. int i11 = anIntArray1177[k5];
  12894. int j13 = stream.readUnsignedByte();
  12895. int k15 = anInt1268 + (j13 >> 4 & 7);
  12896. int l16 = anInt1269 + (j13 & 7);
  12897. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  12898. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  12899. return;
  12900. }
  12901. if (j == 117) {
  12902. int i3 = stream.readUnsignedByte();
  12903. int l5 = anInt1268 + (i3 >> 4 & 7);
  12904. int k8 = anInt1269 + (i3 & 7);
  12905. int j11 = l5 + stream.readSignedByte();
  12906. int k13 = k8 + stream.readSignedByte();
  12907. int l15 = stream.readSignedWord();
  12908. int i17 = stream.readUnsignedWord();
  12909. int i18 = stream.readUnsignedByte() * 4;
  12910. int l18 = stream.readUnsignedByte() * 4;
  12911. int k19 = stream.readUnsignedWord();
  12912. int j20 = stream.readUnsignedWord();
  12913. int i21 = stream.readUnsignedByte();
  12914. int j21 = stream.readUnsignedByte();
  12915. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  12916. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  12917. l5 = l5 * 128 + 64;
  12918. k8 = k8 * 128 + 64;
  12919. j11 = j11 * 128 + 64;
  12920. k13 = k13 * 128 + 64;
  12921. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  12922. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  12923. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  12924. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  12925. method42(plane, k13, j11) - l18, j11);
  12926. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  12927. }
  12928. }
  12929. }
  12930.  
  12931. @SuppressWarnings("unused")
  12932. private static void setLowMem() {
  12933. WorldController.lowMem = true;
  12934. Texture.lowMem = true;
  12935. lowMem = true;
  12936. ObjectManager.lowMem = true;
  12937. ObjectDef.lowMem = true;
  12938. }
  12939.  
  12940. public void method139(Stream stream) {
  12941. stream.initBitAccess();
  12942. int k = stream.readBits(8);
  12943. if (k < npcCount) {
  12944. for (int l = k; l < npcCount; l++)
  12945. anIntArray840[anInt839++] = npcIndices[l];
  12946.  
  12947. }
  12948. if (k > npcCount) {
  12949. signlink.reporterror(myUsername + " Too many npcs");
  12950. throw new RuntimeException("eek");
  12951. }
  12952. npcCount = 0;
  12953. for (int i1 = 0; i1 < k; i1++) {
  12954. int j1 = npcIndices[i1];
  12955. NPC npc = npcArray[j1];
  12956. int k1 = stream.readBits(1);
  12957. if (k1 == 0) {
  12958. npcIndices[npcCount++] = j1;
  12959. npc.anInt1537 = loopCycle;
  12960. } else {
  12961. int l1 = stream.readBits(2);
  12962. if (l1 == 0) {
  12963. npcIndices[npcCount++] = j1;
  12964. npc.anInt1537 = loopCycle;
  12965. anIntArray894[anInt893++] = j1;
  12966. } else if (l1 == 1) {
  12967. npcIndices[npcCount++] = j1;
  12968. npc.anInt1537 = loopCycle;
  12969. int i2 = stream.readBits(3);
  12970. npc.moveInDir(false, i2);
  12971. int k2 = stream.readBits(1);
  12972. if (k2 == 1)
  12973. anIntArray894[anInt893++] = j1;
  12974. } else if (l1 == 2) {
  12975. npcIndices[npcCount++] = j1;
  12976. npc.anInt1537 = loopCycle;
  12977. int j2 = stream.readBits(3);
  12978. npc.moveInDir(true, j2);
  12979. int l2 = stream.readBits(3);
  12980. npc.moveInDir(true, l2);
  12981. int i3 = stream.readBits(1);
  12982. if (i3 == 1)
  12983. anIntArray894[anInt893++] = j1;
  12984. } else if (l1 == 3)
  12985. anIntArray840[anInt839++] = j1;
  12986. }
  12987. }
  12988.  
  12989. }
  12990.  
  12991. private void processLoginScreenInput() {
  12992. if (this.loginScreenState == 0 || this.loginScreenState == 2) {
  12993. resetImage();
  12994. if (super.clickMode3 == 1) {
  12995. if (super.mouseX >= 239 && super.mouseX <= 529 && super.mouseY > 202 && super.mouseY < 237) {
  12996. loginScreenCursorPos = 0;
  12997. }
  12998. if (super.mouseX >= 239 && super.mouseX <= 529 && super.mouseY > 258 && super.mouseY < 293) {
  12999. loginScreenCursorPos = 1;
  13000. }
  13001. if (super.mouseX >= 318 && super.mouseX <= 449 && super.mouseY > 320 && super.mouseY < 347) {
  13002. loginFailures = 0;
  13003. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  13004. login(myUsername, myPassword, false);
  13005. } else {
  13006. this.loginScreenCursorPos = 0;
  13007. this.loginMessage1 = "Username & Password";
  13008. this.loginMessage2 = "Must be more than 1 character";
  13009. }
  13010. try {
  13011. writeSettings();
  13012. } catch (IOException e) {
  13013. e.printStackTrace();
  13014. }
  13015. if (loggedIn)
  13016. return;
  13017. }
  13018. }
  13019. do {
  13020. int l1 = readChar(-796);
  13021. if (l1 == -1)
  13022. break;
  13023. boolean flag1 = false;
  13024. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  13025. if (l1 != validUserPassChars.charAt(i2))
  13026. continue;
  13027. flag1 = true;
  13028. break;
  13029. }
  13030.  
  13031. if (loginScreenCursorPos == 0) {
  13032. if (l1 == 8 && myUsername.length() > 0)
  13033. myUsername = myUsername.substring(0,
  13034. myUsername.length() - 1);
  13035. if (l1 == 9 || l1 == 10 || l1 == 13)
  13036. loginScreenCursorPos = 1;
  13037. if (flag1)
  13038. myUsername += (char) l1;
  13039. if (myUsername.length() > 12)
  13040. myUsername = myUsername.substring(0, 12);
  13041. } else if (loginScreenCursorPos == 1) {
  13042. if (l1 == 8 && myPassword.length() > 0)
  13043. myPassword = myPassword.substring(0,
  13044. myPassword.length() - 1);
  13045. if (l1 == 9 || l1 == 10 || l1 == 13)
  13046. login(myUsername, myPassword, false);
  13047. if (flag1)
  13048. myPassword += (char) l1;
  13049. if (myPassword.length() > 20)
  13050. myPassword = myPassword.substring(0, 20);
  13051. }
  13052. } while (true);
  13053. return;
  13054. }
  13055. if (loginScreenState == 3) {
  13056. int k = super.myWidth / 2;
  13057. int j1 = super.myHeight / 2 + 50;
  13058. j1 += 20;
  13059. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  13060. && super.saveClickX <= k + 75
  13061. && super.saveClickY >= j1 - 20
  13062. && super.saveClickY <= j1 + 20)
  13063. loginScreenState = 0;
  13064. }
  13065. }
  13066.  
  13067. private void resetImage() {
  13068. DrawingArea.setAllPixelsToZero();
  13069. }
  13070.  
  13071. private void markMinimap(Sprite sprite, int i, int j) {
  13072. if (revision474 == true) {
  13073. int k = viewRotation + minimapRotation & 0x7ff;
  13074. int l = i * i + j * j;
  13075. if (l > 6400)
  13076. return;
  13077. int i1 = Model.modelIntArray1[k];
  13078. int j1 = Model.modelIntArray2[k];
  13079. i1 = (i1 * 256) / (minimapZoom + 256);
  13080. j1 = (j1 * 256) / (minimapZoom + 256);
  13081. int k1 = j * i1 + i * j1 >> 16;
  13082. int l1 = j * j1 - i * i1 >> 16;
  13083. if (l > 2500) {
  13084. try {
  13085. sprite.drawSprite(
  13086. ((94 + k1) - sprite.maxWidth / 2) + 4 + 30, 83 - l1
  13087. - sprite.maxHeight / 2 - 4 + 5);
  13088. } catch (Exception e) {
  13089. }
  13090. } else {
  13091. try {
  13092. sprite.drawSprite(
  13093. ((94 + k1) - sprite.maxWidth / 2) + 4 + 30, 83 - l1
  13094. - sprite.maxHeight / 2 - 4 + 5);
  13095. } catch (Exception e) {
  13096. }
  13097. }
  13098. } else {
  13099. int k = viewRotation + minimapRotation & 0x7ff;
  13100. int l = i * i + j * j;
  13101. if (l > 6400)
  13102. return;
  13103. int i1 = Model.modelIntArray1[k];
  13104. int j1 = Model.modelIntArray2[k];
  13105. i1 = (i1 * 256) / (minimapZoom + 256);
  13106. j1 = (j1 * 256) / (minimapZoom + 256);
  13107. int k1 = j * i1 + i * j1 >> 16;
  13108. int l1 = j * j1 - i * i1 >> 16;
  13109. try {
  13110. if (sprite != null)
  13111. sprite.drawSprite(
  13112. ((94 + k1) - sprite.maxWidth / 2) + 4 + 20, 83 - l1
  13113. - sprite.maxHeight / 2 - 4 + 5);
  13114. } catch (Exception e) {
  13115. e.printStackTrace();
  13116. return;
  13117. }
  13118. }
  13119. }
  13120.  
  13121. public void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  13122. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  13123. if (lowMem && j != plane)
  13124. return;
  13125. int i2 = 0;
  13126. if (j1 == 0)
  13127. i2 = worldController.method300(j, i1, i);
  13128. if (j1 == 1)
  13129. i2 = worldController.method301(j, i1, i);
  13130. if (j1 == 2)
  13131. i2 = worldController.method302(j, i1, i);
  13132. if (j1 == 3)
  13133. i2 = worldController.method303(j, i1, i);
  13134. if (i2 != 0) {
  13135. int i3 = worldController.method304(j, i1, i, i2);
  13136. int j2 = i2 >> 14 & 0x7fff;
  13137. int k2 = i3 & 0x1f;
  13138. int l2 = i3 >> 6;
  13139. if (j1 == 0) {
  13140. worldController.method291(i1, j, i, (byte) -119);
  13141. ObjectDef class46 = ObjectDef.forID(j2);
  13142. if (class46.aBoolean767)
  13143. aClass11Array1230[j].method215(l2, k2,
  13144. class46.aBoolean757, i1, i);
  13145. }
  13146. if (j1 == 1)
  13147. worldController.method292(i, j, i1);
  13148. if (j1 == 2) {
  13149. worldController.method293(j, i1, i);
  13150. ObjectDef class46_1 = ObjectDef.forID(j2);
  13151. if (i1 + class46_1.anInt744 > 103
  13152. || i + class46_1.anInt744 > 103
  13153. || i1 + class46_1.anInt761 > 103
  13154. || i + class46_1.anInt761 > 103)
  13155. return;
  13156. if (class46_1.aBoolean767)
  13157. aClass11Array1230[j].method216(l2, class46_1.anInt744,
  13158. i1, i, class46_1.anInt761,
  13159. class46_1.aBoolean757);
  13160. }
  13161. if (j1 == 3) {
  13162. worldController.method294(j, i, i1);
  13163. ObjectDef class46_2 = ObjectDef.forID(j2);
  13164. if (class46_2.aBoolean767 && class46_2.hasActions)
  13165. aClass11Array1230[j].method218(i, i1);
  13166. }
  13167. }
  13168. if (k1 >= 0) {
  13169. int j3 = j;
  13170. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  13171. j3++;
  13172. ObjectManager.method188(worldController, k, i, l, j3,
  13173. aClass11Array1230[j], intGroundArray, i1, k1, j);
  13174. }
  13175. }
  13176. }
  13177.  
  13178. public void updatePlayers(int i, Stream stream) {
  13179. anInt839 = 0;
  13180. anInt893 = 0;
  13181. method117(stream);
  13182. method134(stream);
  13183. method91(stream, i);
  13184. method49(stream);
  13185. for (int k = 0; k < anInt839; k++) {
  13186. int l = anIntArray840[k];
  13187. if (playerArray[l].anInt1537 != loopCycle)
  13188. playerArray[l] = null;
  13189. }
  13190.  
  13191. if (stream.currentOffset != i) {
  13192. signlink.reporterror("Error packet size mismatch in getplayer pos:"
  13193. + stream.currentOffset + " psize:" + i);
  13194. throw new RuntimeException("eek");
  13195. }
  13196. for (int i1 = 0; i1 < playerCount; i1++)
  13197. if (playerArray[playerIndices[i1]] == null) {
  13198. signlink.reporterror(myUsername
  13199. + " null entry in pl list - pos:" + i1 + " size:"
  13200. + playerCount);
  13201. throw new RuntimeException("eek");
  13202. }
  13203.  
  13204. }
  13205.  
  13206. public void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  13207. int l1 = 2048 - k & 0x7ff;
  13208. int i2 = 2048 - j1 & 0x7ff;
  13209. int j2 = 0;
  13210. int k2 = 0;
  13211. int l2 = j;
  13212. if (l1 != 0) {
  13213. int i3 = Model.modelIntArray1[l1];
  13214. int k3 = Model.modelIntArray2[l1];
  13215. int i4 = k2 * k3 - l2 * i3 >> 16;
  13216. l2 = k2 * i3 + l2 * k3 >> 16;
  13217. k2 = i4;
  13218. }
  13219. if (i2 != 0) {
  13220. /*
  13221. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  13222. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  13223. * l2 = fwdbwd; }
  13224. */
  13225. int j3 = Model.modelIntArray1[i2];
  13226. int l3 = Model.modelIntArray2[i2];
  13227. int j4 = l2 * j3 + j2 * l3 >> 16;
  13228. l2 = l2 * l3 - j2 * j3 >> 16;
  13229. j2 = j4;
  13230. }
  13231. xCameraPos = l - j2;
  13232. zCameraPos = i1 - k2;
  13233. yCameraPos = k1 - l2;
  13234. yCameraCurve = k;
  13235. xCameraCurve = j1;
  13236. }
  13237.  
  13238. public void updateStrings(String str, int i) {
  13239. switch (i) {
  13240. case 49020:
  13241. achievementCutoff = Integer.parseInt(str);
  13242. break;
  13243. case 1675:
  13244. sendFrame126(str, 17508);
  13245. break;// Stab
  13246. case 1676:
  13247. sendFrame126(str, 17509);
  13248. break;// Slash
  13249. case 1678:
  13250. sendFrame126(str, 17511);
  13251. break;// Magic
  13252. case 1679:
  13253. sendFrame126(str, 17512);
  13254. break;// Range
  13255. case 1680:
  13256. sendFrame126(str, 17513);
  13257. break;// Stab
  13258. case 1681:
  13259. sendFrame126(str, 17514);
  13260. break;// Slash
  13261. case 1682:
  13262. sendFrame126(str, 17515);
  13263. break;// Crush
  13264. case 1683:
  13265. sendFrame126(str, 17516);
  13266. break;// Magic
  13267. case 1684:
  13268. sendFrame126(str, 17517);
  13269. break;// Range
  13270. case 1686:
  13271. sendFrame126(str, 17518);
  13272. break;// Strength
  13273. case 1687:
  13274. sendFrame126(str, 17519);
  13275. break;// Prayer
  13276. }
  13277. }
  13278.  
  13279. private boolean broadcastUpdate = false;
  13280.  
  13281. /**
  13282. * Updates a string on an interface component.
  13283. * @param str
  13284. * @param i
  13285. */
  13286. public void sendFrame126(String str, int i) {
  13287. RSInterface.interfaceCache[i].message = str;
  13288. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  13289. needDrawTabArea = true;
  13290. if (i == 3755) {
  13291. broadcast = str;
  13292. broadcastUpdate = true;
  13293. pushMessage("<col=006600>Broadcast:</col> " + str, 0, "");
  13294. anInt1104 = 3000;
  13295. }
  13296. }
  13297.  
  13298. public void sendPacket185(int button, int toggle, int type) {
  13299. switch (type) {
  13300. case 135:
  13301. RSInterface class9 = RSInterface.interfaceCache[button];
  13302. boolean flag8 = true;
  13303. if (class9.contentType > 0)
  13304. flag8 = promptUserForInput(class9);
  13305. if (flag8) {
  13306. stream.createFrame(185);
  13307. stream.writeWord(button);
  13308. }
  13309. break;
  13310. case 646:
  13311. stream.createFrame(185);
  13312. stream.writeWord(button);
  13313. RSInterface class9_2 = RSInterface.interfaceCache[button];
  13314. if (class9_2.valueIndexArray != null
  13315. && class9_2.valueIndexArray[0][0] == 5) {
  13316. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  13317. variousSettings[toggle] = class9_2.anIntArray212[0];
  13318. parseVariousSettings(toggle);
  13319. needDrawTabArea = true;
  13320. }
  13321. }
  13322. break;
  13323. case 169:
  13324. stream.createFrame(185);
  13325. stream.writeWord(button);
  13326. RSInterface class9_3 = RSInterface.interfaceCache[button];
  13327. if (class9_3.valueIndexArray != null
  13328. && class9_3.valueIndexArray[0][0] == 5) {
  13329. variousSettings[toggle] = 1 - variousSettings[toggle];
  13330. parseVariousSettings(toggle);
  13331. needDrawTabArea = true;
  13332. }
  13333. switch (button) {
  13334. case 19136:
  13335. System.out.println("toggle = " + toggle);
  13336. if (toggle == 0)
  13337. sendFrame36(173, toggle);
  13338. if (toggle == 1)
  13339. sendPacket185(153, 173, 646);
  13340. break;
  13341. }
  13342. break;
  13343. }
  13344. }
  13345.  
  13346. public void sendFrame36(int id, int state) {
  13347. anIntArray1045[id] = state;
  13348. if (variousSettings[id] != state) {
  13349. variousSettings[id] = state;
  13350. parseVariousSettings(id);
  13351. needDrawTabArea = true;
  13352. if (dialogID != -1)
  13353. inputTaken = true;
  13354. }
  13355. }
  13356.  
  13357. public void sendFrame219() {
  13358. if (invOverlayInterfaceID != -1) {
  13359. invOverlayInterfaceID = -1;
  13360. needDrawTabArea = true;
  13361. tabAreaAltered = true;
  13362. }
  13363. if (backDialogID != -1) {
  13364. backDialogID = -1;
  13365. inputTaken = true;
  13366. }
  13367. if (inputDialogState != 0) {
  13368. inputDialogState = 0;
  13369. inputTaken = true;
  13370. }
  13371. openInterfaceID = -1;
  13372. aBoolean1149 = false;
  13373. }
  13374.  
  13375. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  13376. if (backDialogID != -1) {
  13377. backDialogID = -1;
  13378. inputTaken = true;
  13379. }
  13380. if (inputDialogState != 0) {
  13381. inputDialogState = 0;
  13382. inputTaken = true;
  13383. }
  13384. openInterfaceID = interfaceID;
  13385. invOverlayInterfaceID = sideInterfaceID;
  13386. needDrawTabArea = true;
  13387. tabAreaAltered = true;
  13388. aBoolean1149 = false;
  13389. }
  13390.  
  13391. private boolean parsePacket() {
  13392. if (socketStream == null)
  13393. return false;
  13394. try {
  13395. int i = socketStream.available();
  13396. if (i == 0)
  13397. return false;
  13398. if (pktType == -1) {
  13399. socketStream.flushInputStream(inStream.buffer, 1);
  13400. pktType = inStream.buffer[0] & 0xff;
  13401. if (encryption != null)
  13402. pktType = pktType - encryption.getNextKey() & 0xff;
  13403. pktSize = SizeConstants.packetSizes[pktType];
  13404. i--;
  13405. }
  13406. if (pktSize == -1)
  13407. if (i > 0) {
  13408. socketStream.flushInputStream(inStream.buffer, 1);
  13409. pktSize = inStream.buffer[0] & 0xff;
  13410. i--;
  13411. } else {
  13412. return false;
  13413. }
  13414. if (pktSize == -2)
  13415. if (i > 1) {
  13416. socketStream.flushInputStream(inStream.buffer, 2);
  13417. inStream.currentOffset = 0;
  13418. pktSize = inStream.readUnsignedWord();
  13419. i -= 2;
  13420. } else {
  13421. return false;
  13422. }
  13423. if (i < pktSize)
  13424. return false;
  13425. inStream.currentOffset = 0;
  13426. socketStream.flushInputStream(inStream.buffer, pktSize);
  13427. anInt1009 = 0;
  13428. anInt843 = anInt842;
  13429. anInt842 = anInt841;
  13430. anInt841 = pktType;
  13431. switch (pktType) {
  13432. case 81:
  13433. updatePlayers(pktSize, inStream);
  13434. aBoolean1080 = false;
  13435. pktType = -1;
  13436. return true;
  13437.  
  13438. case 176:
  13439. daysSinceRecovChange = inStream.method427();
  13440. unreadMessages = inStream.method435();
  13441. membersInt = inStream.readUnsignedByte();
  13442. anInt1193 = inStream.method440();
  13443. daysSinceLastLogin = inStream.readUnsignedWord();
  13444. if (anInt1193 != 0 && openInterfaceID == -1) {
  13445. signlink.dnslookup(TextClass.method586(anInt1193));
  13446. clearTopInterfaces();
  13447. char c = '\u028A';
  13448. if (daysSinceRecovChange != 201 || membersInt == 1)
  13449. c = '\u028F';
  13450. reportAbuseInput = "";
  13451. canMute = false;
  13452. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13453. if (RSInterface.interfaceCache[k9] == null
  13454. || RSInterface.interfaceCache[k9].contentType != c)
  13455. continue;
  13456. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13457.  
  13458. }
  13459. }
  13460. pktType = -1;
  13461. return true;
  13462.  
  13463. case 64:
  13464. anInt1268 = inStream.method427();
  13465. anInt1269 = inStream.method428();
  13466. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  13467. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  13468. if (groundArray[plane][j][l9] != null) {
  13469. groundArray[plane][j][l9] = null;
  13470. spawnGroundItem(j, l9);
  13471. }
  13472. }
  13473. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  13474. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  13475. .reverseGetNext())
  13476. if (class30_sub1.anInt1297 >= anInt1268
  13477. && class30_sub1.anInt1297 < anInt1268 + 8
  13478. && class30_sub1.anInt1298 >= anInt1269
  13479. && class30_sub1.anInt1298 < anInt1269 + 8
  13480. && class30_sub1.anInt1295 == plane)
  13481. class30_sub1.anInt1294 = 0;
  13482. pktType = -1;
  13483. return true;
  13484.  
  13485. case 9:
  13486. String text = inStream.readString();
  13487. byte state = inStream.readSignedByte();
  13488. byte seconds = inStream.readSignedByte();
  13489. fadingScreen = new FadingScreen(text, state, seconds);
  13490. pktType = -1;
  13491. return true;
  13492.  
  13493. case 185:
  13494. int k = inStream.method436();
  13495. RSInterface.interfaceCache[k].anInt233 = 3;
  13496. if (myPlayer.desc == null)
  13497. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  13498. + (myPlayer.anIntArray1700[4] << 20)
  13499. + (myPlayer.equipment[0] << 15)
  13500. + (myPlayer.equipment[8] << 10)
  13501. + (myPlayer.equipment[11] << 5)
  13502. + myPlayer.equipment[1];
  13503. else
  13504. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  13505. pktType = -1;
  13506. return true;
  13507.  
  13508. /* Clan message packet */
  13509. case 217:
  13510. try {
  13511. clanUsername = inStream.readString();
  13512. clanMessage = TextInput.processText(inStream.readString());
  13513. clanTitle = inStream.readString();
  13514. channelRights = inStream.readUnsignedWord();
  13515. pushMessage(clanMessage, 12, clanUsername);
  13516. } catch (Exception e) {
  13517. e.printStackTrace();
  13518. }
  13519. pktType = -1;
  13520. return true;
  13521.  
  13522. case 107:
  13523. aBoolean1160 = false;
  13524. for (int l = 0; l < 5; l++)
  13525. aBooleanArray876[l] = false;
  13526. xpCounter = 0;
  13527. pktType = -1;
  13528. return true;
  13529. case 72:
  13530. int i1 = inStream.method434();
  13531. RSInterface class9 = RSInterface.interfaceCache[i1];
  13532. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  13533. class9.inv[k15] = -1;
  13534. class9.inv[k15] = 0;
  13535. }
  13536. pktType = -1;
  13537. return true;
  13538.  
  13539. case 214:
  13540. ignoreCount = pktSize / 8;
  13541. for (int j1 = 0; j1 < ignoreCount; j1++)
  13542. ignoreListAsLongs[j1] = inStream.readQWord();
  13543. pktType = -1;
  13544. return true;
  13545.  
  13546. case 166:
  13547. aBoolean1160 = true;
  13548. anInt1098 = inStream.readUnsignedByte();
  13549. anInt1099 = inStream.readUnsignedByte();
  13550. anInt1100 = inStream.readUnsignedWord();
  13551. anInt1101 = inStream.readUnsignedByte();
  13552. anInt1102 = inStream.readUnsignedByte();
  13553. if (anInt1102 >= 100) {
  13554. xCameraPos = anInt1098 * 128 + 64;
  13555. yCameraPos = anInt1099 * 128 + 64;
  13556. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  13557. - anInt1100;
  13558. }
  13559. pktType = -1;
  13560. return true;
  13561.  
  13562. case 134:
  13563. needDrawTabArea = true;
  13564. int k1 = inStream.readUnsignedByte();
  13565. int i10 = inStream.method439();
  13566. int l15 = inStream.readUnsignedByte();
  13567. int xp = currentExp[k1];
  13568. currentExp[k1] = i10;
  13569. currentStats[k1] = l15;
  13570. maxStats[k1] = 1;
  13571. int exp = currentExp[k1] - xp;
  13572. xpCounter += currentExp[k1] - xp;
  13573. expSkill = k1;
  13574. if (exp > 0 && k1 != 3) {
  13575. hitsQueue.add(new ExperienceCounterHit(exp, expSkill));
  13576. }
  13577. for (int k20 = 0; k20 < 98; k20++)
  13578. if (i10 >= anIntArray1019[k20])
  13579. maxStats[k1] = k20 + 2;
  13580. pktType = -1;
  13581. return true;
  13582.  
  13583. case 71:
  13584. int l1 = inStream.readUnsignedWord();
  13585. int j10 = inStream.method426();
  13586. if (l1 == 65535)
  13587. l1 = -1;
  13588. tabInterfaceIDs[j10] = l1;
  13589. needDrawTabArea = true;
  13590. tabAreaAltered = true;
  13591. pktType = -1;
  13592. return true;
  13593.  
  13594. case 74:
  13595. int i2 = inStream.method434();
  13596. if (i2 == 65535)
  13597. i2 = -1;
  13598. if (i2 != currentSong && musicEnabled && !lowMem
  13599. && prevSong == 0) {
  13600. nextSong = i2;
  13601. songChanging = true;
  13602. onDemandFetcher.method558(2, nextSong);
  13603. }
  13604. currentSong = i2;
  13605. pktType = -1;
  13606. return true;
  13607.  
  13608. case 121:
  13609. int j2 = inStream.method436();
  13610. int k10 = inStream.method435();
  13611. if (musicEnabled && !lowMem) {
  13612. nextSong = j2;
  13613. songChanging = false;
  13614. onDemandFetcher.method558(2, nextSong);
  13615. prevSong = k10;
  13616. }
  13617. pktType = -1;
  13618. return true;
  13619.  
  13620. case 7:
  13621. int componentId = inStream.readDWord();
  13622. byte spriteIndex = inStream.readSignedByte();
  13623. RSInterface component = RSInterface.interfaceCache[componentId];
  13624. if (component != null) {
  13625. if (component.backgroundSprites != null && spriteIndex <= component.backgroundSprites.length - 1) {
  13626. Sprite sprite = component.backgroundSprites[spriteIndex];
  13627. if (sprite != null) {
  13628. component.sprite1 = component.backgroundSprites[spriteIndex];
  13629. }
  13630. }
  13631. }
  13632. pktType = -1;
  13633. return true;
  13634.  
  13635. case 109:
  13636. resetLogout();
  13637. pktType = -1;
  13638. return false;
  13639.  
  13640. case 70:
  13641. int k2 = inStream.readSignedWord();
  13642. int l10 = inStream.method437();
  13643. int i16 = inStream.method434();
  13644. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  13645. class9_5.anInt263 = k2;
  13646. class9_5.anInt265 = l10;
  13647. pktType = -1;
  13648. return true;
  13649.  
  13650. case 73:
  13651. case 241:
  13652. int l2 = anInt1069;
  13653. int i11 = anInt1070;
  13654. if (pktType == 73) {
  13655. l2 = inStream.method435();
  13656. i11 = inStream.readUnsignedWord();
  13657. aBoolean1159 = false;
  13658. }
  13659. if (pktType == 241) {
  13660. i11 = inStream.method435();
  13661. inStream.initBitAccess();
  13662. for (int j16 = 0; j16 < 4; j16++) {
  13663. for (int l20 = 0; l20 < 13; l20++) {
  13664. for (int j23 = 0; j23 < 13; j23++) {
  13665. int i26 = inStream.readBits(1);
  13666. if (i26 == 1)
  13667. anIntArrayArrayArray1129[j16][l20][j23] = inStream
  13668. .readBits(26);
  13669. else
  13670. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  13671. }
  13672. }
  13673. }
  13674. inStream.finishBitAccess();
  13675. l2 = inStream.readUnsignedWord();
  13676. aBoolean1159 = true;
  13677. }
  13678. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  13679. pktType = -1;
  13680. return true;
  13681. }
  13682. anInt1069 = l2;
  13683. anInt1070 = i11;
  13684. baseX = (anInt1069 - 6) * 8;
  13685. baseY = (anInt1070 - 6) * 8;
  13686. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49)
  13687. && anInt1070 / 8 == 48;
  13688. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  13689. aBoolean1141 = true;
  13690. loadingStage = 1;
  13691. aLong824 = System.currentTimeMillis();
  13692. aRSImageProducer_1165.initDrawingArea();
  13693. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2);
  13694. DrawingArea.drawPixels(20, 3, 3, 0, 128);
  13695. aTextDrawingArea_1271.drawText(0, "Loading - Please Wait", 18,
  13696. 68);
  13697. aTextDrawingArea_1271.drawText(0xffffff,
  13698. "Loading - Please Wait", 17, 67);
  13699. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  13700. if (pktType == 73) {
  13701. int k16 = 0;
  13702. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  13703. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  13704. k16++;
  13705. }
  13706. aByteArrayArray1183 = new byte[k16][];
  13707. aByteArrayArray1247 = new byte[k16][];
  13708. anIntArray1234 = new int[k16];
  13709. anIntArray1235 = new int[k16];
  13710. anIntArray1236 = new int[k16];
  13711. k16 = 0;
  13712. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  13713. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  13714. anIntArray1234[k16] = (l23 << 8) + j26;
  13715. if (aBoolean1141
  13716. && (j26 == 49 || j26 == 149 || j26 == 147
  13717. || l23 == 50 || l23 == 49
  13718. && j26 == 47)) {
  13719. anIntArray1235[k16] = -1;
  13720. anIntArray1236[k16] = -1;
  13721. k16++;
  13722. } else {
  13723. int k28 = anIntArray1235[k16] = onDemandFetcher
  13724. .method562(0, j26, l23);
  13725. if (k28 != -1)
  13726. onDemandFetcher.method558(3, k28);
  13727. int j30 = anIntArray1236[k16] = onDemandFetcher
  13728. .method562(1, j26, l23);
  13729. if (j30 != -1)
  13730. onDemandFetcher.method558(3, j30);
  13731. k16++;
  13732. }
  13733. }
  13734. }
  13735. }
  13736. if (pktType == 241) {
  13737. int l16 = 0;
  13738. int ai[] = new int[676];
  13739. for (int i24 = 0; i24 < 4; i24++) {
  13740. for (int k26 = 0; k26 < 13; k26++) {
  13741. for (int l28 = 0; l28 < 13; l28++) {
  13742. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  13743. if (k30 != -1) {
  13744. int k31 = k30 >> 14 & 0x3ff;
  13745. int i32 = k30 >> 3 & 0x7ff;
  13746. int k32 = (k31 / 8 << 8) + i32 / 8;
  13747. for (int j33 = 0; j33 < l16; j33++) {
  13748. if (ai[j33] != k32)
  13749. continue;
  13750. k32 = -1;
  13751.  
  13752. }
  13753. if (k32 != -1)
  13754. ai[l16++] = k32;
  13755. }
  13756. }
  13757. }
  13758. }
  13759. aByteArrayArray1183 = new byte[l16][];
  13760. aByteArrayArray1247 = new byte[l16][];
  13761. anIntArray1234 = new int[l16];
  13762. anIntArray1235 = new int[l16];
  13763. anIntArray1236 = new int[l16];
  13764. for (int l26 = 0; l26 < l16; l26++) {
  13765. int i29 = anIntArray1234[l26] = ai[l26];
  13766. int l30 = i29 >> 8 & 0xff;
  13767. int l31 = i29 & 0xff;
  13768. int j32 = anIntArray1235[l26] = onDemandFetcher
  13769. .method562(0, l31, l30);
  13770. if (j32 != -1)
  13771. onDemandFetcher.method558(3, j32);
  13772. int i33 = anIntArray1236[l26] = onDemandFetcher
  13773. .method562(1, l31, l30);
  13774. if (i33 != -1)
  13775. onDemandFetcher.method558(3, i33);
  13776. }
  13777. }
  13778. int i17 = baseX - anInt1036;
  13779. int j21 = baseY - anInt1037;
  13780. anInt1036 = baseX;
  13781. anInt1037 = baseY;
  13782. for (int j24 = 0; j24 < 16384; j24++) {
  13783. NPC npc = npcArray[j24];
  13784. if (npc != null) {
  13785. for (int j29 = 0; j29 < 10; j29++) {
  13786. npc.smallX[j29] -= i17;
  13787. npc.smallY[j29] -= j21;
  13788. }
  13789. npc.x -= i17 * 128;
  13790. npc.y -= j21 * 128;
  13791. }
  13792. }
  13793. for (int i27 = 0; i27 < maxPlayers; i27++) {
  13794. Player player = playerArray[i27];
  13795. if (player != null) {
  13796. for (int i31 = 0; i31 < 10; i31++) {
  13797. player.smallX[i31] -= i17;
  13798. player.smallY[i31] -= j21;
  13799. }
  13800. player.x -= i17 * 128;
  13801. player.y -= j21 * 128;
  13802. }
  13803. }
  13804. aBoolean1080 = true;
  13805. byte byte1 = 0;
  13806. byte byte2 = 104;
  13807. byte byte3 = 1;
  13808. if (i17 < 0) {
  13809. byte1 = 103;
  13810. byte2 = -1;
  13811. byte3 = -1;
  13812. }
  13813. byte byte4 = 0;
  13814. byte byte5 = 104;
  13815. byte byte6 = 1;
  13816. if (j21 < 0) {
  13817. byte4 = 103;
  13818. byte5 = -1;
  13819. byte6 = -1;
  13820. }
  13821. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  13822. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  13823. int i34 = k33 + i17;
  13824. int j34 = l33 + j21;
  13825. for (int k34 = 0; k34 < 4; k34++)
  13826. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  13827. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  13828. else
  13829. groundArray[k34][k33][l33] = null;
  13830. }
  13831. }
  13832. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  13833. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  13834. .reverseGetNext()) {
  13835. class30_sub1_1.anInt1297 -= i17;
  13836. class30_sub1_1.anInt1298 -= j21;
  13837. if (class30_sub1_1.anInt1297 < 0
  13838. || class30_sub1_1.anInt1298 < 0
  13839. || class30_sub1_1.anInt1297 >= 104
  13840. || class30_sub1_1.anInt1298 >= 104)
  13841. class30_sub1_1.unlink();
  13842. }
  13843. if (destX != 0) {
  13844. destX -= i17;
  13845. destY -= j21;
  13846. }
  13847. aBoolean1160 = false;
  13848. pktType = -1;
  13849. return true;
  13850.  
  13851. case 208:
  13852. int i3 = inStream.method437();
  13853. if (i3 >= 0)
  13854. method60(i3);
  13855. anInt1018 = i3;
  13856. pktType = -1;
  13857. return true;
  13858.  
  13859. case 99:
  13860. /*
  13861. * Black map, mape state 2, causes blackness
  13862. */
  13863. anInt1021 = inStream.readUnsignedByte();
  13864. pktType = -1;
  13865. return true;
  13866.  
  13867. case 75:
  13868. int j3 = inStream.method436();
  13869. int j11 = inStream.method436();
  13870. RSInterface.interfaceCache[j11].anInt233 = 2;
  13871. RSInterface.interfaceCache[j11].mediaID = j3;
  13872. pktType = -1;
  13873. return true;
  13874.  
  13875. case 114:
  13876. anInt1104 = inStream.method434() * 30;
  13877. pktType = -1;
  13878. return true;
  13879.  
  13880. case 60:
  13881. anInt1269 = inStream.readUnsignedByte();
  13882. anInt1268 = inStream.method427();
  13883. while (inStream.currentOffset < pktSize) {
  13884. int k3 = inStream.readUnsignedByte();
  13885. method137(inStream, k3);
  13886. }
  13887. pktType = -1;
  13888. return true;
  13889.  
  13890. case 35:
  13891. int l3 = inStream.readUnsignedByte();
  13892. int k11 = inStream.readUnsignedByte();
  13893. int j17 = inStream.readUnsignedByte();
  13894. int k21 = inStream.readUnsignedByte();
  13895. aBooleanArray876[l3] = true;
  13896. anIntArray873[l3] = k11;
  13897. anIntArray1203[l3] = j17;
  13898. anIntArray928[l3] = k21;
  13899. anIntArray1030[l3] = 0;
  13900. pktType = -1;
  13901. return true;
  13902.  
  13903. case 174:
  13904. int i4 = inStream.readUnsignedWord();
  13905. int l11 = inStream.readUnsignedByte();
  13906. int k17 = inStream.readUnsignedWord();
  13907. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  13908. anIntArray1207[anInt1062] = i4;
  13909. anIntArray1241[anInt1062] = l11;
  13910. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  13911. anInt1062++;
  13912. }
  13913. pktType = -1;
  13914. return true;
  13915.  
  13916. case 104:
  13917. int j4 = inStream.method427();
  13918. int i12 = inStream.method426();
  13919. String s6 = inStream.readString();
  13920. if (j4 >= 1 && j4 <= atPlayerActions.length) {
  13921. if (s6.equalsIgnoreCase("null"))
  13922. s6 = null;
  13923. atPlayerActions[j4 - 1] = s6;
  13924. atPlayerArray[j4 - 1] = i12 == 0;
  13925. }
  13926. pktType = -1;
  13927. return true;
  13928.  
  13929. case 78:
  13930. destX = 0;
  13931. pktType = -1;
  13932. return true;
  13933.  
  13934. case 253:
  13935. String s = inStream.readString();
  13936. if (s.endsWith(":tradereq:")) {
  13937. String s3 = s.substring(0, s.indexOf(":"));
  13938. long l17 = TextClass.longForName(s3);
  13939. boolean flag2 = false;
  13940. for (int j27 = 0; j27 < ignoreCount; j27++) {
  13941. if (ignoreListAsLongs[j27] != l17)
  13942. continue;
  13943. flag2 = true;
  13944. }
  13945. if (!flag2 && anInt1251 == 0)
  13946. pushMessage("wishes to trade with you.", 4, s3);
  13947. } else if (s.startsWith("//")) {
  13948. s = s.replaceAll("//", "");
  13949. pushMessage(s, 13, "");
  13950. } else if (s.startsWith("/")) {
  13951. s = s.replaceAll("/", "");
  13952. pushMessage(s, 11, "");
  13953. } else if (s.endsWith("#url#")) {
  13954. String link = s.substring(0, s.indexOf("#"));
  13955. pushMessage("Join us at: ", 9, link);
  13956. } else if (s.endsWith(":duelreq:")) {
  13957. String s4 = s.substring(0, s.indexOf(":"));
  13958. long l18 = TextClass.longForName(s4);
  13959. boolean flag3 = false;
  13960. for (int k27 = 0; k27 < ignoreCount; k27++) {
  13961. if (ignoreListAsLongs[k27] != l18)
  13962. continue;
  13963. flag3 = true;
  13964.  
  13965. }
  13966. if (!flag3 && anInt1251 == 0)
  13967. pushMessage("wishes to duel with you.", 8, s4);
  13968. } else if (s.endsWith(":chalreq:")) {
  13969. String s5 = s.substring(0, s.indexOf(":"));
  13970. long l19 = TextClass.longForName(s5);
  13971. boolean flag4 = false;
  13972. for (int l27 = 0; l27 < ignoreCount; l27++) {
  13973. if (ignoreListAsLongs[l27] != l19)
  13974. continue;
  13975. flag4 = true;
  13976.  
  13977. }
  13978. if (!flag4 && anInt1251 == 0) {
  13979. String s8 = s.substring(s.indexOf(":") + 1,
  13980. s.length() - 9);
  13981. pushMessage(s8, 8, s5);
  13982. }
  13983. } else {
  13984. pushMessage(s, 0, "");
  13985. }
  13986. pktType = -1;
  13987. return true;
  13988.  
  13989. case 1:
  13990. for (int k4 = 0; k4 < playerArray.length; k4++)
  13991. if (playerArray[k4] != null)
  13992. playerArray[k4].anim = -1;
  13993. for (int j12 = 0; j12 < npcArray.length; j12++)
  13994. if (npcArray[j12] != null)
  13995. npcArray[j12].anim = -1;
  13996. pktType = -1;
  13997. return true;
  13998.  
  13999. case 50:
  14000. long l4 = inStream.readQWord();
  14001. int i18 = inStream.readUnsignedByte();
  14002. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  14003. for (int k24 = 0; k24 < friendsCount; k24++) {
  14004. if (l4 != friendsListAsLongs[k24])
  14005. continue;
  14006. if (friendsNodeIDs[k24] != i18) {
  14007. friendsNodeIDs[k24] = i18;
  14008. needDrawTabArea = true;
  14009. if (i18 > 0)
  14010. pushMessage(s7 + " has logged in.", 5, "");
  14011. if (i18 == 0)
  14012. pushMessage(s7 + " has logged out.", 5, "");
  14013. }
  14014. s7 = null;
  14015. break;
  14016. }
  14017. if (s7 != null && friendsCount < 200) {
  14018. friendsListAsLongs[friendsCount] = l4;
  14019. friendsList[friendsCount] = s7;
  14020. friendsNodeIDs[friendsCount] = i18;
  14021. friendsCount++;
  14022. needDrawTabArea = true;
  14023. }
  14024. for (boolean flag6 = false; !flag6;) {
  14025. flag6 = true;
  14026. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  14027. if (friendsNodeIDs[k29] != nodeID
  14028. && friendsNodeIDs[k29 + 1] == nodeID
  14029. || friendsNodeIDs[k29] == 0
  14030. && friendsNodeIDs[k29 + 1] != 0) {
  14031. int j31 = friendsNodeIDs[k29];
  14032. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  14033. friendsNodeIDs[k29 + 1] = j31;
  14034. String s10 = friendsList[k29];
  14035. friendsList[k29] = friendsList[k29 + 1];
  14036. friendsList[k29 + 1] = s10;
  14037. long l32 = friendsListAsLongs[k29];
  14038. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  14039. friendsListAsLongs[k29 + 1] = l32;
  14040. needDrawTabArea = true;
  14041. flag6 = false;
  14042. }
  14043. }
  14044. pktType = -1;
  14045. return true;
  14046.  
  14047. case 110:
  14048. if (tabID == 12)
  14049. needDrawTabArea = true;
  14050. energy = inStream.readUnsignedByte();
  14051. pktType = -1;
  14052. return true;
  14053.  
  14054. case 254:
  14055. anInt855 = inStream.readUnsignedByte();
  14056. if (anInt855 == 1)
  14057. anInt1222 = inStream.readUnsignedWord();
  14058. if (anInt855 >= 2 && anInt855 <= 6) {
  14059. if (anInt855 == 2) {
  14060. anInt937 = 64;
  14061. anInt938 = 64;
  14062. }
  14063. if (anInt855 == 3) {
  14064. anInt937 = 0;
  14065. anInt938 = 64;
  14066. }
  14067. if (anInt855 == 4) {
  14068. anInt937 = 128;
  14069. anInt938 = 64;
  14070. }
  14071. if (anInt855 == 5) {
  14072. anInt937 = 64;
  14073. anInt938 = 0;
  14074. }
  14075. if (anInt855 == 6) {
  14076. anInt937 = 64;
  14077. anInt938 = 128;
  14078. }
  14079. anInt855 = 2;
  14080. anInt934 = inStream.readUnsignedWord();
  14081. anInt935 = inStream.readUnsignedWord();
  14082. anInt936 = inStream.readUnsignedByte();
  14083. }
  14084. if (anInt855 == 10)
  14085. anInt933 = inStream.readUnsignedWord();
  14086. pktType = -1;
  14087. return true;
  14088.  
  14089. case 248:
  14090. int i5 = inStream.method435();
  14091. int k12 = inStream.readUnsignedWord();
  14092. if (backDialogID != -1) {
  14093. backDialogID = -1;
  14094. inputTaken = true;
  14095. }
  14096. if (inputDialogState != 0) {
  14097. inputDialogState = 0;
  14098. inputTaken = true;
  14099. }
  14100. if (i5 == 55000) {
  14101. RSInterface.interfaceCache[55010].scrollPosition = 0;
  14102. RSInterface.interfaceCache[55050].scrollPosition = 0;
  14103. }
  14104. openInterfaceID = i5;
  14105. invOverlayInterfaceID = k12;
  14106. needDrawTabArea = true;
  14107. tabAreaAltered = true;
  14108. aBoolean1149 = false;
  14109. pktType = -1;
  14110. return true;
  14111.  
  14112. case 79:
  14113. int j5 = inStream.method434();
  14114. int l12 = inStream.method435();
  14115. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  14116. if (class9_3 != null && class9_3.type == 0) {
  14117. if (l12 < 0)
  14118. l12 = 0;
  14119. if (l12 > class9_3.scrollMax - class9_3.height)
  14120. l12 = class9_3.scrollMax - class9_3.height;
  14121. class9_3.scrollPosition = l12;
  14122. }
  14123. pktType = -1;
  14124. return true;
  14125.  
  14126. case 68:
  14127. for (int k5 = 0; k5 < variousSettings.length; k5++)
  14128. if (variousSettings[k5] != anIntArray1045[k5]) {
  14129. variousSettings[k5] = anIntArray1045[k5];
  14130. parseVariousSettings(k5);
  14131. needDrawTabArea = true;
  14132. }
  14133. pktType = -1;
  14134. return true;
  14135.  
  14136. case 196:
  14137. long l5 = inStream.readQWord();
  14138. inStream.readDWord();
  14139. int l21 = inStream.readUnsignedByte();
  14140. boolean flag5 = false;
  14141. if (l21 <= 1) {
  14142. for (int l29 = 0; l29 < ignoreCount; l29++) {
  14143. if (ignoreListAsLongs[l29] != l5)
  14144. continue;
  14145. flag5 = true;
  14146.  
  14147. }
  14148. }
  14149. if (!flag5 && anInt1251 == 0)
  14150. try {
  14151. String s9 = TextInput.method525(pktSize - 13, inStream);
  14152. switch (l21) {
  14153. case 1:
  14154. pushMessage(
  14155. s9,
  14156. 7,
  14157. "@cr1@"
  14158. + TextClass.fixName(TextClass
  14159. .nameForLong(l5)));
  14160. break;
  14161. case 2:
  14162. pushMessage(
  14163. s9,
  14164. 7,
  14165. "@cr2@"
  14166. + TextClass.fixName(TextClass
  14167. .nameForLong(l5)));
  14168. break;
  14169. case 3:
  14170. pushMessage(
  14171. s9,
  14172. 7,
  14173. "@cr3@"
  14174. + TextClass.fixName(TextClass
  14175. .nameForLong(l5)));
  14176. break;
  14177. case 4:
  14178. pushMessage(
  14179. s9,
  14180. 7,
  14181. "@cr4@"
  14182. + TextClass.fixName(TextClass
  14183. .nameForLong(l5)));
  14184. break;
  14185. case 5:
  14186. pushMessage(
  14187. s9,
  14188. 7,
  14189. "@cr5@"
  14190. + TextClass.fixName(TextClass
  14191. .nameForLong(l5)));
  14192. break;
  14193. case 6:
  14194. pushMessage(
  14195. s9,
  14196. 7,
  14197. "@cr6@"
  14198. + TextClass.fixName(TextClass
  14199. .nameForLong(l5)));
  14200. break;
  14201. case 7:
  14202. pushMessage(
  14203. s9,
  14204. 7,
  14205. "@cr7@"
  14206. + TextClass.fixName(TextClass
  14207. .nameForLong(l5)));
  14208. break;
  14209. case 8:
  14210. pushMessage(
  14211. s9,
  14212. 7,
  14213. "@cr8@"
  14214. + TextClass.fixName(TextClass
  14215. .nameForLong(l5)));
  14216. break;
  14217. case 9:
  14218. pushMessage(
  14219. s9,
  14220. 7,
  14221. "@cr9@"
  14222. + TextClass.fixName(TextClass
  14223. .nameForLong(l5)));
  14224. break;
  14225. case 10:
  14226. pushMessage(
  14227. s9,
  14228. 7,
  14229. "@cr10@"
  14230. + TextClass.fixName(TextClass
  14231. .nameForLong(l5)));
  14232. break;
  14233. case 11:
  14234. pushMessage(
  14235. s9,
  14236. 7,
  14237. "@cr11@"
  14238. + TextClass.fixName(TextClass
  14239. .nameForLong(l5)));
  14240. break;
  14241. default:
  14242. pushMessage(s9, 3, TextClass.fixName(TextClass
  14243. .nameForLong(l5)));
  14244. }
  14245. } catch (Exception exception1) {
  14246. signlink.reporterror("cde1");
  14247. }
  14248. pktType = -1;
  14249. return true;
  14250.  
  14251. case 85:
  14252. anInt1269 = inStream.method427();
  14253. anInt1268 = inStream.method427();
  14254. pktType = -1;
  14255. return true;
  14256.  
  14257. case 24:
  14258. anInt1054 = inStream.method428();
  14259. if (anInt1054 == tabID) {
  14260. if (anInt1054 == 3)
  14261. tabID = 1;
  14262. else
  14263. tabID = 3;
  14264. needDrawTabArea = true;
  14265. }
  14266. pktType = -1;
  14267. return true;
  14268.  
  14269. case 246:
  14270. int i6 = inStream.method434();
  14271. int i13 = inStream.readUnsignedWord();
  14272. int k18 = inStream.readUnsignedWord();
  14273. if (k18 == 65535) {
  14274. RSInterface.interfaceCache[i6].anInt233 = 0;
  14275. pktType = -1;
  14276. return true;
  14277. } else {
  14278. ItemDef itemDef = ItemDef.forID(k18);
  14279. RSInterface.interfaceCache[i6].anInt233 = 4;
  14280. RSInterface.interfaceCache[i6].mediaID = k18;
  14281. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.rotationX;
  14282. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.rotationY;
  14283. RSInterface.interfaceCache[i6].modelZoom = (itemDef.zoom * 100)
  14284. / i13;
  14285. pktType = -1;
  14286. return true;
  14287. }
  14288.  
  14289. case 171:
  14290. boolean flag1 = inStream.readUnsignedByte() == 1;
  14291. int j13 = inStream.readUnsignedWord();
  14292. if (RSInterface.interfaceCache[j13] != null)
  14293. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  14294. pktType = -1;
  14295. return true;
  14296.  
  14297. case 142:
  14298. int j6 = inStream.method434();
  14299. method60(j6);
  14300. if (backDialogID != -1) {
  14301. backDialogID = -1;
  14302. inputTaken = true;
  14303. }
  14304. if (inputDialogState != 0) {
  14305. inputDialogState = 0;
  14306. inputTaken = true;
  14307. }
  14308. invOverlayInterfaceID = j6;
  14309. needDrawTabArea = true;
  14310. tabAreaAltered = true;
  14311. openInterfaceID = -1;
  14312. aBoolean1149 = false;
  14313. pktType = -1;
  14314. return true;
  14315.  
  14316. case 126:
  14317. try {
  14318. text = inStream.readString();
  14319. int frame = inStream.method435();
  14320. if (text.startsWith("www.")) {
  14321. launchURL(text);
  14322. pktType = -1;
  14323. return true;
  14324. }
  14325. updateStrings(text, frame);
  14326. sendFrame126(text, frame);
  14327. if (frame >= 18144 && frame <= 18244) {
  14328. clanList[frame - 18144] = text;
  14329. }
  14330. } catch (Exception e) {
  14331. e.printStackTrace();
  14332. }
  14333. pktType = -1;
  14334. return true;
  14335.  
  14336. case 206:
  14337. publicChatMode = inStream.readUnsignedByte();
  14338. privateChatMode = inStream.readUnsignedByte();
  14339. tradeMode = inStream.readUnsignedByte();
  14340. aBoolean1233 = true;
  14341. inputTaken = true;
  14342. pktType = -1;
  14343. return true;
  14344.  
  14345. case 240:
  14346. if (tabID == 12)
  14347. needDrawTabArea = true;
  14348. weight = inStream.readSignedWord();
  14349. pktType = -1;
  14350. return true;
  14351.  
  14352. case 8:
  14353. int k6 = inStream.method436();
  14354. int l13 = inStream.readUnsignedWord();
  14355. RSInterface.interfaceCache[k6].anInt233 = 1;
  14356. RSInterface.interfaceCache[k6].mediaID = l13;
  14357. pktType = -1;
  14358. return true;
  14359.  
  14360. case 122:
  14361. int l6 = inStream.method436();
  14362. int i14 = inStream.method436();
  14363. int i19 = i14 >> 10 & 0x1f;
  14364. int i22 = i14 >> 5 & 0x1f;
  14365. int l24 = i14 & 0x1f;
  14366. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  14367. + (i22 << 11) + (l24 << 3);
  14368. pktType = -1;
  14369. return true;
  14370.  
  14371. case 53:
  14372. needDrawTabArea = true;
  14373. int i7 = inStream.readUnsignedWord();
  14374. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  14375. int j19 = inStream.readUnsignedWord();
  14376. for (int j22 = 0; j22 < j19; j22++) {
  14377. int i25 = inStream.readUnsignedByte();
  14378. if (i25 == 255)
  14379. i25 = inStream.method440();
  14380. class9_1.inv[j22] = inStream.method436();
  14381. class9_1.invStackSizes[j22] = i25;
  14382. }
  14383. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  14384. class9_1.inv[j25] = 0;
  14385. class9_1.invStackSizes[j25] = 0;
  14386. }
  14387. pktType = -1;
  14388. return true;
  14389.  
  14390. case 230:
  14391. int j7 = inStream.method435();
  14392. int j14 = inStream.readUnsignedWord();
  14393. int k19 = inStream.readUnsignedWord();
  14394. int k22 = inStream.method436();
  14395. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  14396. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  14397. RSInterface.interfaceCache[j14].modelZoom = j7;
  14398. pktType = -1;
  14399. return true;
  14400.  
  14401. case 221:
  14402. anInt900 = inStream.readUnsignedByte();
  14403. needDrawTabArea = true;
  14404. pktType = -1;
  14405. return true;
  14406.  
  14407. case 177:
  14408. //setNorth();
  14409. aBoolean1160 = true;
  14410. anInt995 = inStream.readUnsignedByte();
  14411. anInt996 = inStream.readUnsignedByte();
  14412. anInt997 = inStream.readUnsignedWord();
  14413. anInt998 = inStream.readUnsignedByte();
  14414. anInt999 = inStream.readUnsignedByte();
  14415. if (anInt999 >= 100) {
  14416. int k7 = anInt995 * 128 + 64;
  14417. int k14 = anInt996 * 128 + 64;
  14418. int i20 = method42(plane, k14, k7) - anInt997;
  14419. int l22 = k7 - xCameraPos;
  14420. int k25 = i20 - zCameraPos;
  14421. int j28 = k14 - yCameraPos;
  14422. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  14423. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14424. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14425. if (yCameraCurve < 128)
  14426. yCameraCurve = 128;
  14427. if (yCameraCurve > 383)
  14428. yCameraCurve = 383;
  14429. }
  14430. pktType = -1;
  14431. return true;
  14432.  
  14433. case 249:
  14434. anInt1046 = inStream.method426();
  14435. unknownInt10 = inStream.method436();
  14436. pktType = -1;
  14437. return true;
  14438.  
  14439. case 65:
  14440. updateNPCs(inStream, pktSize);
  14441. pktType = -1;
  14442. return true;
  14443.  
  14444. case 27:
  14445. messagePromptRaised = false;
  14446. inputDialogState = 1;
  14447. amountOrNameInput = "";
  14448. inputTaken = true;
  14449. pktType = -1;
  14450. return true;
  14451.  
  14452. case 187:
  14453. messagePromptRaised = false;
  14454. inputDialogState = 2;
  14455. amountOrNameInput = "";
  14456. inputTaken = true;
  14457. pktType = -1;
  14458. return true;
  14459.  
  14460. case 97:
  14461. int l7 = inStream.readUnsignedWord();
  14462. method60(l7);
  14463. if (invOverlayInterfaceID != -1) {
  14464. invOverlayInterfaceID = -1;
  14465. needDrawTabArea = true;
  14466. tabAreaAltered = true;
  14467. }
  14468. if (backDialogID != -1) {
  14469. backDialogID = -1;
  14470. inputTaken = true;
  14471. }
  14472. if (inputDialogState != 0) {
  14473. inputDialogState = 0;
  14474. inputTaken = true;
  14475. }
  14476. // 17511 = Question Type
  14477. // 15819 = Christmas Type
  14478. // 15812 = Security Type
  14479. // 15801 = Item Scam Type
  14480. // 15791 = Password Safety ?
  14481. // 15774 = Good/Bad Password
  14482. // 15767 = Drama Type ????
  14483. if (l7 == 15244) {
  14484. openInterfaceID = 15767;
  14485. fullscreenInterfaceID = 15244;
  14486. } else {
  14487. openInterfaceID = l7;
  14488. }
  14489. aBoolean1149 = false;
  14490. pktType = -1;
  14491. return true;
  14492.  
  14493. case 218:
  14494. int i8 = inStream.method438();
  14495. dialogID = i8;
  14496. inputTaken = true;
  14497. pktType = -1;
  14498. return true;
  14499.  
  14500. case 87:
  14501. int j8 = inStream.method434();
  14502. int l14 = inStream.method439();
  14503. anIntArray1045[j8] = l14;
  14504. if (variousSettings[j8] != l14) {
  14505. variousSettings[j8] = l14;
  14506. parseVariousSettings(j8);
  14507. needDrawTabArea = true;
  14508. if (dialogID != -1)
  14509. inputTaken = true;
  14510. }
  14511. pktType = -1;
  14512. return true;
  14513.  
  14514. case 36:
  14515. int k8 = inStream.method434();
  14516. byte byte0 = inStream.readSignedByte();
  14517. anIntArray1045[k8] = byte0;
  14518. if (variousSettings[k8] != byte0) {
  14519. variousSettings[k8] = byte0;
  14520. parseVariousSettings(k8);
  14521. needDrawTabArea = true;
  14522. if (dialogID != -1)
  14523. inputTaken = true;
  14524. }
  14525. pktType = -1;
  14526. return true;
  14527.  
  14528. case 61:
  14529. anInt1055 = inStream.readUnsignedByte();
  14530. pktType = -1;
  14531. return true;
  14532.  
  14533. case 200:
  14534. int l8 = inStream.readUnsignedWord();
  14535. int i15 = inStream.readSignedWord();
  14536. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14537. class9_4.anInt257 = i15;
  14538. if (i15 == 591 || i15 == 588) {
  14539. class9_4.modelZoom = 900; // anInt269
  14540. }
  14541. if (i15 == -1) {
  14542. class9_4.anInt246 = 0;
  14543. class9_4.anInt208 = 0;
  14544. }
  14545. pktType = -1;
  14546. return true;
  14547.  
  14548. case 219:
  14549. if (invOverlayInterfaceID != -1) {
  14550. invOverlayInterfaceID = -1;
  14551. needDrawTabArea = true;
  14552. tabAreaAltered = true;
  14553. }
  14554. if (backDialogID != -1) {
  14555. backDialogID = -1;
  14556. inputTaken = true;
  14557. }
  14558. if (inputDialogState != 0) {
  14559. inputDialogState = 0;
  14560. inputTaken = true;
  14561. }
  14562. if (this.isFieldInFocus()) {
  14563. this.resetInputFieldFocus();
  14564. this.inputString = "";
  14565. }
  14566. openInterfaceID = -1;
  14567. aBoolean1149 = false;
  14568. pktType = -1;
  14569. return true;
  14570.  
  14571. case 34:
  14572. needDrawTabArea = true;
  14573. int i9 = inStream.readUnsignedWord();
  14574. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14575. while (inStream.currentOffset < pktSize) {
  14576. int j20 = inStream.method422();
  14577. int i23 = inStream.readUnsignedWord();
  14578. int l25 = inStream.readUnsignedByte();
  14579. if (l25 == 255)
  14580. l25 = inStream.readDWord();
  14581. if (j20 >= 0 && j20 < class9_2.inv.length) {
  14582. class9_2.inv[j20] = i23;
  14583. class9_2.invStackSizes[j20] = l25;
  14584. }
  14585. }
  14586. pktType = -1;
  14587. return true;
  14588.  
  14589. case 4:
  14590. case 44:
  14591. case 84:
  14592. case 101:
  14593. case 105:
  14594. case 117:
  14595. case 147:
  14596. case 151:
  14597. case 156:
  14598. case 160:
  14599. case 215:
  14600. method137(inStream, pktType);
  14601. pktType = -1;
  14602. return true;
  14603.  
  14604. case 106:
  14605. tabID = inStream.method427();
  14606. needDrawTabArea = true;
  14607. tabAreaAltered = true;
  14608. pktType = -1;
  14609. return true;
  14610.  
  14611. case 164:
  14612. int j9 = inStream.method434();
  14613. method60(j9);
  14614. if (invOverlayInterfaceID != -1) {
  14615. invOverlayInterfaceID = -1;
  14616. needDrawTabArea = true;
  14617. tabAreaAltered = true;
  14618. }
  14619. backDialogID = j9;
  14620. inputTaken = true;
  14621. openInterfaceID = -1;
  14622. aBoolean1149 = false;
  14623. pktType = -1;
  14624. return true;
  14625.  
  14626. }
  14627. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  14628. + anInt842 + "," + anInt843);
  14629. resetLogout();
  14630. } catch (IOException _ex) {
  14631. dropClient();
  14632. } catch (Exception exception) {
  14633. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  14634. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  14635. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  14636. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  14637. s2 = s2 + inStream.buffer[j15] + ",";
  14638. exception.printStackTrace();
  14639. signlink.reporterror(s2);
  14640. resetLogout();
  14641. }
  14642. return true;
  14643. }
  14644.  
  14645. public void method146() {
  14646. anInt1265++;
  14647. method47(true);
  14648. method26(true);
  14649. method47(false);
  14650. method26(false);
  14651. method55();
  14652. method104();
  14653. if (!aBoolean1160) {
  14654. int i = anInt1184;
  14655. if (anInt984 / 256 > i)
  14656. i = anInt984 / 256;
  14657. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  14658. i = anIntArray1203[4] + 128;
  14659. int k = viewRotation + viewRotationOffset & 0x7ff;
  14660. setCameraPos(600 + i * 3, i, anInt1014,
  14661. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  14662. }
  14663. int j;
  14664. if (!aBoolean1160)
  14665. j = method120();
  14666. else
  14667. j = method121();
  14668. int l = xCameraPos;
  14669. int i1 = zCameraPos;
  14670. int j1 = yCameraPos;
  14671. int k1 = yCameraCurve;
  14672. int l1 = xCameraCurve;
  14673. for (int i2 = 0; i2 < 5; i2++)
  14674. if (aBooleanArray876[i2]) {
  14675. int j2 = (int) ((Math.random() * (anIntArray873[i2] * 2 + 1) - anIntArray873[i2]) + Math
  14676. .sin(anIntArray1030[i2] * (anIntArray928[i2] / 100D))
  14677. * anIntArray1203[i2]);
  14678. if (i2 == 0)
  14679. xCameraPos += j2;
  14680. if (i2 == 1)
  14681. zCameraPos += j2;
  14682. if (i2 == 2)
  14683. yCameraPos += j2;
  14684. if (i2 == 3)
  14685. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  14686. if (i2 == 4) {
  14687. yCameraCurve += j2;
  14688. if (yCameraCurve < 128)
  14689. yCameraCurve = 128;
  14690. if (yCameraCurve > 383)
  14691. yCameraCurve = 383;
  14692. }
  14693. }
  14694. int k2 = Texture.anInt1481;
  14695. Model.aBoolean1684 = true;
  14696. Model.anInt1687 = 0;
  14697. Model.anInt1685 = super.mouseX - 4;
  14698. Model.anInt1686 = super.mouseY - 4;
  14699. DrawingArea.setAllPixelsToZero();
  14700. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  14701. zCameraPos, j, yCameraCurve);
  14702. worldController.clearObj5Cache();
  14703. updateEntities();
  14704. drawHeadIcon();
  14705. method37(k2);
  14706. draw3dScreen();
  14707. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  14708. xCameraPos = l;
  14709. zCameraPos = i1;
  14710. yCameraPos = j1;
  14711. yCameraCurve = k1;
  14712. xCameraCurve = l1;
  14713. }
  14714.  
  14715. public void clearTopInterfaces() {
  14716. stream.createFrame(130);
  14717. if (invOverlayInterfaceID != -1) {
  14718. invOverlayInterfaceID = -1;
  14719. needDrawTabArea = true;
  14720. aBoolean1149 = false;
  14721. tabAreaAltered = true;
  14722. }
  14723. if (backDialogID != -1) {
  14724. backDialogID = -1;
  14725. inputTaken = true;
  14726. aBoolean1149 = false;
  14727. }
  14728. openInterfaceID = -1;
  14729. fullscreenInterfaceID = -1;
  14730. }
  14731.  
  14732. public static boolean newDamage = false, normalLogin = true,
  14733. showFlames = false, showLogo = false, normalLogin2 = true;// KEEP
  14734. // TRUE!
  14735. private Sprite logIconH;
  14736. private Sprite logIconC;
  14737. private Sprite logIcon;
  14738. private Sprite[] chatButtons;
  14739.  
  14740. private Sprite[] ORBS = new Sprite[57];
  14741. private DecimalFormat format;
  14742. public float LP;
  14743.  
  14744. client() {
  14745. try {
  14746. readSettings();
  14747. } catch (IOException e) {
  14748. }
  14749. if (revision474 == true) {
  14750. revision498 = false;
  14751. }
  14752. if (revision498 = true) {
  14753. revision498 = false;
  14754. revision474 = true;
  14755. }
  14756. xpAddedPos = expAdded = 0;
  14757. xpLock = false;
  14758. xpCounter = 0;
  14759. counter = new Sprite[4];
  14760. setFormat(new DecimalFormat());
  14761. chatRights = new int[500];
  14762. fullscreenInterfaceID = -1;
  14763. chatTypeView = 0;
  14764. clanTitles = new String[500];
  14765. clanChatMode = 0;
  14766. cButtonHPos = -1;
  14767. cButtonCPos = 0;
  14768. server = Configuration.getAddress();
  14769. anIntArrayArray825 = new int[104][104];
  14770. friendsNodeIDs = new int[200];
  14771. groundArray = new NodeList[4][104][104];
  14772. aBoolean831 = false;
  14773. aStream_834 = new Stream(new byte[5000]);
  14774. npcArray = new NPC[16384];
  14775. npcIndices = new int[16384];
  14776. anIntArray840 = new int[1000];
  14777. aStream_847 = Stream.create();
  14778. aBoolean848 = true;
  14779. openInterfaceID = -1;
  14780. currentExp = new int[Skills.skillsCount];
  14781. aBoolean872 = false;
  14782. anIntArray873 = new int[5];
  14783. anInt874 = -1;
  14784. aBooleanArray876 = new boolean[5];
  14785. drawFlames = false;
  14786. reportAbuseInput = "";
  14787. unknownInt10 = -1;
  14788. menuOpen = false;
  14789. inputString = "";
  14790. maxPlayers = 2048;
  14791. myPlayerIndex = 2047;
  14792. playerArray = new Player[maxPlayers];
  14793. playerIndices = new int[maxPlayers];
  14794. anIntArray894 = new int[maxPlayers];
  14795. aStreamArray895s = new Stream[maxPlayers];
  14796. anIntArrayArray901 = new int[104][104];
  14797. aByteArray912 = new byte[16384];
  14798. currentStats = new int[Skills.skillsCount];
  14799. ignoreListAsLongs = new long[100];
  14800. loadingError = false;
  14801. anIntArray928 = new int[5];
  14802. anIntArrayArray929 = new int[104][104];
  14803. chatTypes = new int[500];
  14804. chatNames = new String[500];
  14805. chatMessages = new String[500];
  14806. chatButtons = new Sprite[4];
  14807. sideIcons = new Sprite[15];
  14808. redStones = new Sprite[5];
  14809. aBoolean954 = true;
  14810. friendsListAsLongs = new long[200];
  14811. currentSong = -1;
  14812. drawingFlames = false;
  14813. spriteDrawX = -1;
  14814. spriteDrawY = -1;
  14815. anIntArray968 = new int[33];
  14816. anIntArray969 = new int[256];
  14817. decompressors = new Decompressor[5];
  14818. variousSettings = new int[2000];
  14819. aBoolean972 = false;
  14820. anInt975 = 50;
  14821. anIntArray976 = new int[anInt975];
  14822. anIntArray977 = new int[anInt975];
  14823. anIntArray978 = new int[anInt975];
  14824. anIntArray979 = new int[anInt975];
  14825. anIntArray980 = new int[anInt975];
  14826. anIntArray981 = new int[anInt975];
  14827. anIntArray982 = new int[anInt975];
  14828. aStringArray983 = new String[anInt975];
  14829. anInt985 = -1;
  14830. hitMarks = new Sprite[20];
  14831. anIntArray990 = new int[5];
  14832. aBoolean994 = false;
  14833. amountOrNameInput = "";
  14834. aClass19_1013 = new NodeList();
  14835. aBoolean1017 = false;
  14836. anInt1018 = -1;
  14837. anIntArray1030 = new int[5];
  14838. aBoolean1031 = false;
  14839. mapFunctions = new Sprite[100];
  14840. dialogID = -1;
  14841. maxStats = new int[Skills.skillsCount];
  14842. anIntArray1045 = new int[2000];
  14843. aBoolean1047 = true;
  14844. anIntArray1052 = new int[151];
  14845. anInt1054 = -1;
  14846. aClass19_1056 = new NodeList();
  14847. anIntArray1057 = new int[33];
  14848. aClass9_1059 = new RSInterface();
  14849. mapScenes = new Background[100];
  14850. barFillColor = 0x4d4233;
  14851. anIntArray1065 = new int[7];
  14852. anIntArray1072 = new int[1000];
  14853. anIntArray1073 = new int[1000];
  14854. aBoolean1080 = false;
  14855. friendsList = new String[200];
  14856. inStream = Stream.create();
  14857. expectedCRCs = new int[9];
  14858. menuActionCmd2 = new int[500];
  14859. menuActionCmd3 = new int[500];
  14860. menuActionID = new int[500];
  14861. menuActionCmd1 = new int[500];
  14862. headIcons = new Sprite[20];
  14863. skullIcons = new Sprite[20];
  14864. headIconsHint = new Sprite[20];
  14865. tabAreaAltered = false;
  14866. aString1121 = "";
  14867. atPlayerActions = new String[6];
  14868. atPlayerArray = new boolean[6];
  14869. anIntArrayArrayArray1129 = new int[4][13][13];
  14870. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  14871. aBoolean1141 = false;
  14872. aBoolean1149 = false;
  14873. crosses = new Sprite[8];
  14874. musicEnabled = true;
  14875. needDrawTabArea = false;
  14876. loggedIn = false;
  14877. canMute = false;
  14878. aBoolean1159 = false;
  14879. aBoolean1160 = false;
  14880. myUsername = "";
  14881. myPassword = "";
  14882. genericLoadingError = false;
  14883. reportAbuseInterfaceID = -1;
  14884. aClass19_1179 = new NodeList();
  14885. anInt1184 = 128;
  14886. invOverlayInterfaceID = -1;
  14887. stream = Stream.create();
  14888. menuActionName = new String[500];
  14889. anIntArray1203 = new int[5];
  14890. anIntArray1207 = new int[50];
  14891. anInt1211 = 78;
  14892. promptInput = "";
  14893. modIcons = new Sprite[15];
  14894. tabID = 3;
  14895. inputTaken = false;
  14896. songChanging = true;
  14897. anIntArray1229 = new int[151];
  14898. aClass11Array1230 = new Class11[4];
  14899. anIntArray1241 = new int[50];
  14900. aBoolean1242 = false;
  14901. anIntArray1250 = new int[50];
  14902. rsAlreadyLoaded = false;
  14903. welcomeScreenRaised = false;
  14904. messagePromptRaised = false;
  14905. loginMessage1 = "Welcome to OS-PvP";
  14906. loginMessage2 = "Enter your credentials to login";
  14907. backDialogID = -1;
  14908. bigX = new int[4000];
  14909. bigY = new int[4000];
  14910. anInt1289 = -1;
  14911. }
  14912.  
  14913. private final int[] chatRights;
  14914. private int hoverId;
  14915. public int expAdded;
  14916. public int expSkill;
  14917. public int xpAddedPos;
  14918. public boolean xpLock;
  14919.  
  14920. private Sprite tabArea;
  14921. private Sprite tabArea474;
  14922. private Sprite tabArea508;
  14923. private Sprite mapArea;
  14924. private Sprite mapArea474;
  14925. private Sprite mapArea508;
  14926.  
  14927. public String name;
  14928. public String message;
  14929. public int chatTypeView;
  14930. public int clanChatMode;
  14931. public int duelMode;
  14932. public int autocastId = 0;
  14933. public boolean Autocast = false;
  14934. private Sprite chatArea;
  14935. private Background mapBack;
  14936.  
  14937. private Background titleBox;
  14938. private Sprite loginHover;
  14939. private Sprite boxHover;
  14940. public Sprite[] hoverLogin = new Sprite[3];
  14941. private Background titleButton;
  14942. private RSImageProducer leftFrame;
  14943. private RSImageProducer topFrame;
  14944. private RSImageProducer rightFrame;
  14945. private int ignoreCount;
  14946. private long aLong824;
  14947. private int[][] anIntArrayArray825;
  14948. private int[] friendsNodeIDs;
  14949. private NodeList[][][] groundArray;
  14950. private int[] anIntArray828;
  14951. private int[] anIntArray829;
  14952. private volatile boolean aBoolean831;
  14953. private Socket aSocket832;
  14954. private int loginScreenState;
  14955. private Stream aStream_834;
  14956. private NPC[] npcArray;
  14957. private int npcCount;
  14958. private int[] npcIndices;
  14959. private int anInt839;
  14960. private int[] anIntArray840;
  14961. private int anInt841;
  14962. private int anInt842;
  14963. private int anInt843;
  14964. private String aString844;
  14965. private int privateChatMode;
  14966. private Stream aStream_847;
  14967. private boolean aBoolean848;
  14968. private boolean aBoolean1233;
  14969. private static int anInt849;
  14970. private int[] anIntArray850;
  14971. private int[] anIntArray851;
  14972. private int[] anIntArray852;
  14973. private int[] anIntArray853;
  14974. private static int anInt854;
  14975. private int anInt855;
  14976. public static int openInterfaceID;
  14977. private int xCameraPos;
  14978. private int zCameraPos;
  14979. private int yCameraPos;
  14980. private int yCameraCurve;
  14981. private int xCameraCurve;
  14982. private int myPrivilege;
  14983. private final int[] currentExp;
  14984. private Sprite[] redStones;
  14985. private Sprite mapFlag;
  14986. private Sprite mapMarker;
  14987. private boolean aBoolean872;
  14988. private final int[] anIntArray873;
  14989. private int anInt874;
  14990. private final boolean[] aBooleanArray876;
  14991. private int weight;
  14992. private MouseDetection mouseDetection;
  14993. private volatile boolean drawFlames;
  14994. private String reportAbuseInput;
  14995. private int unknownInt10;
  14996. private boolean menuOpen;
  14997. private int anInt886;
  14998. public String inputString;
  14999. private final int maxPlayers;
  15000. private final int myPlayerIndex;
  15001. private Player[] playerArray;
  15002. private int playerCount;
  15003. private int[] playerIndices;
  15004. private int anInt893;
  15005. private int[] anIntArray894;
  15006. private Stream[] aStreamArray895s;
  15007. private int viewRotationOffset;
  15008. private int friendsCount;
  15009. private int anInt900;
  15010. private int[][] anIntArrayArray901;
  15011. private byte[] aByteArray912;
  15012. private int anInt913;
  15013. private int crossX;
  15014. private int crossY;
  15015. private int crossIndex;
  15016. private int crossType;
  15017. private int plane;
  15018. private final int[] currentStats;
  15019. private static int anInt924;
  15020. private final long[] ignoreListAsLongs;
  15021. private boolean loadingError;
  15022. private final int[] anIntArray928;
  15023. private int[][] anIntArrayArray929;
  15024. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  15025. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  15026. private int anInt933;
  15027. private int anInt934;
  15028. private int anInt935;
  15029. private int anInt936;
  15030. private int anInt937;
  15031. private int anInt938;
  15032. private final int[] chatTypes;
  15033. private final String[] chatNames;
  15034. private final String[] chatMessages;
  15035. private int anInt945;
  15036. private WorldController worldController;
  15037. private Sprite[] sideIcons;
  15038. private int menuScreenArea;
  15039. private int menuOffsetX;
  15040. private int menuOffsetY;
  15041. private int menuWidth;
  15042. private int menuHeight;
  15043. private long aLong953;
  15044. private boolean aBoolean954;
  15045. private long[] friendsListAsLongs;
  15046. private int currentSong;
  15047. private static int nodeID = 1;
  15048. static int portOff;
  15049. static boolean clientData;
  15050. private static boolean isMembers = true;
  15051. private static boolean lowMem;
  15052. private volatile boolean drawingFlames;
  15053. private int spriteDrawX;
  15054. private int spriteDrawY;
  15055. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  15056. 0xff00ff, 0xffffff };
  15057. private Background aBackground_966;
  15058. private Background aBackground_967;
  15059. private final int[] anIntArray968;
  15060. private final int[] anIntArray969;
  15061. final Decompressor[] decompressors;
  15062. public int variousSettings[];
  15063. private boolean aBoolean972;
  15064. private final int anInt975;
  15065. private final int[] anIntArray976;
  15066. private final int[] anIntArray977;
  15067. private final int[] anIntArray978;
  15068. private final int[] anIntArray979;
  15069. private final int[] anIntArray980;
  15070. private final int[] anIntArray981;
  15071. private final int[] anIntArray982;
  15072. private final String[] aStringArray983;
  15073. private int anInt984;
  15074. private int anInt985;
  15075. private static int anInt986;
  15076. private Sprite[] hitMarks;
  15077. private int anInt989;
  15078. private final int[] anIntArray990;
  15079. private static boolean aBoolean993;
  15080. private final boolean aBoolean994;
  15081. private int anInt995;
  15082. private int anInt996;
  15083. private int anInt997;
  15084. private int anInt998;
  15085. private int anInt999;
  15086. private ISAACRandomGen encryption;
  15087. private Sprite mapEdge;
  15088. public static int[][] anIntArrayArray1003 = {
  15089. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, -31839, 22433,
  15090. 2983, -11343, 8, 5281, 10438, 3650, -27322, -21845, 200,
  15091. 571, 908, 21830, 28946, -15701, -14010 },
  15092. { 8741, 12, -1506, -22374, 7735, 8404, 1701, -27106, 24094, 10153,
  15093. -8915, 4783, 1341, 16578, -30533, 25239, 8, 5281, 10438,
  15094. 3650, -27322, -21845, 200, 571, 908, 21830, 28946, -15701,
  15095. -14010 },
  15096. { 25238, 8742, 12, -1506, -22374, 7735, 8404, 1701, -27106, 24094,
  15097. 10153, -8915, 4783, 1341, 16578, -30533, 8, 5281, 10438,
  15098. 3650, -27322, -21845, 200, 571, 908, 21830, 28946, -15701,
  15099. -14010 }, { 4626, 11146, 6439, 12, 4758, 10270 },
  15100. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  15101.  
  15102. private Sprite multiOverlay;
  15103. private String amountOrNameInput;
  15104. private static int anInt1005;
  15105. private int daysSinceLastLogin;
  15106. private int pktSize;
  15107. private int pktType;
  15108. private int anInt1009;
  15109. private int anInt1010;
  15110. private int anInt1011;
  15111. private NodeList aClass19_1013;
  15112. private int anInt1014;
  15113. private int anInt1015;
  15114. private int anInt1016;
  15115. private boolean aBoolean1017;
  15116. public static int anInt1018;
  15117. private static final int[] anIntArray1019;
  15118. private int anInt1021;
  15119. private int anInt1022;
  15120. private int loadingStage;
  15121. private Sprite scrollBar1;
  15122. private Sprite scrollBar2;
  15123. private int anInt1026;
  15124. private final int[] anIntArray1030;
  15125. private boolean aBoolean1031;
  15126. private static Sprite[] mapFunctions;
  15127. private static int baseX;
  15128. private static int baseY;
  15129. private int anInt1036;
  15130. private int anInt1037;
  15131. private int loginFailures;
  15132. private int anInt1039;
  15133. private int anInt1040;
  15134. private int anInt1041;
  15135. private int dialogID;
  15136. private final int[] maxStats;
  15137. private final int[] anIntArray1045;
  15138. private int anInt1046;
  15139. private boolean aBoolean1047;
  15140. public TextDrawingArea smallText;
  15141. public TextDrawingArea XPFONT;
  15142. public TextDrawingArea aTextDrawingArea_1271;
  15143. public TextDrawingArea chatTextDrawingArea;
  15144. public TextDrawingArea aTextDrawingArea_1273;
  15145. public RSFont newSmallFont;
  15146. public RSFont newRegularFont;
  15147. public RSFont newBoldFont;
  15148. public RSFont newFancyFont;
  15149. private int anInt1048;
  15150. private String aString1049;
  15151. private static int anInt1051;
  15152. private final int[] anIntArray1052;
  15153. private StreamLoader titleStreamLoader;
  15154. private int anInt1054;
  15155. private int anInt1055;
  15156. private NodeList aClass19_1056;
  15157. private final int[] anIntArray1057;
  15158. public final RSInterface aClass9_1059;
  15159. private Background[] mapScenes;
  15160. private static int anInt1061;
  15161. private int anInt1062;
  15162. private final int barFillColor;
  15163. private int friendsListAction;
  15164. private final int[] anIntArray1065;
  15165. private int mouseInvInterfaceIndex;
  15166. private int lastActiveInvInterface;
  15167. public OnDemandFetcher onDemandFetcher;
  15168. private int anInt1069;
  15169. private int anInt1070;
  15170. private int anInt1071;
  15171. private int[] anIntArray1072;
  15172. private int[] anIntArray1073;
  15173. private Sprite mapDotItem;
  15174. private Sprite mapDotNPC;
  15175. private Sprite mapDotPlayer;
  15176. private Sprite mapDotFriend;
  15177. private Sprite mapDotTeam;
  15178. private Sprite mapDotClan;
  15179. private int anInt1079;
  15180. private boolean aBoolean1080;
  15181. private String[] friendsList;
  15182. private Stream inStream;
  15183. private int anInt1084;
  15184. private int anInt1085;
  15185. private int activeInterfaceType;
  15186. private int anInt1087;
  15187. private int anInt1088;
  15188. public static int anInt1089;
  15189. private final int[] expectedCRCs;
  15190. private int[] menuActionCmd2;
  15191. private int[] menuActionCmd3;
  15192. private int[] menuActionID;
  15193. private int[] menuActionCmd1;
  15194. private Sprite[] headIcons;
  15195. private Sprite[] skullIcons;
  15196. private Sprite[] headIconsHint;
  15197. private static int anInt1097;
  15198. private int anInt1098;
  15199. private int anInt1099;
  15200. private int anInt1100;
  15201. private int anInt1101;
  15202. private int anInt1102;
  15203. public static boolean tabAreaAltered;
  15204. private RSImageProducer aRSImageProducer_1107;
  15205. private RSImageProducer aRSImageProducer_1108;
  15206. private RSImageProducer loginScreenArea;
  15207. private RSImageProducer leftSideFlame;
  15208. private RSImageProducer rightSideFlame;
  15209. private RSImageProducer gameLogo;
  15210. private RSImageProducer aRSImageProducer_1113;
  15211. private RSImageProducer aRSImageProducer_1114;
  15212. private RSImageProducer aRSImageProducer_1115;
  15213. private int anInt1104;
  15214. private RSImageProducer aRSImageProducer_1109;
  15215. private RSImageProducer aRSImageProducer_1110;
  15216. private RSImageProducer aRSImageProducer_1111;
  15217. private RSImageProducer aRSImageProducer_1112;
  15218. private static int anInt1117;
  15219. private int membersInt;
  15220. private String aString1121;
  15221. private Sprite compass;
  15222. private RSImageProducer aRSImageProducer_1125;
  15223. public static Player myPlayer;
  15224. private final String[] atPlayerActions;
  15225. private final boolean[] atPlayerArray;
  15226. private final int[][][] anIntArrayArrayArray1129;
  15227. final static int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
  15228. -1, -1, -1, -1, -1, -1, -1, -1 };
  15229. private int cameraOffsetY;
  15230. private int menuActionRow;
  15231. private static int anInt1134;
  15232. private int spellSelected;
  15233. private int anInt1137;
  15234. private int spellUsableOn;
  15235. private String spellTooltip;
  15236. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  15237. private boolean aBoolean1141;
  15238. private static int anInt1142;
  15239. private int energy;
  15240. private boolean aBoolean1149;
  15241. private Sprite[] crosses;
  15242. private boolean musicEnabled;
  15243. private Background[] aBackgroundArray1152s;
  15244. public static boolean needDrawTabArea;
  15245. private int unreadMessages;
  15246. private static int anInt1155;
  15247. private static boolean fpsOn;
  15248. public static boolean loggedIn;
  15249. private boolean canMute;
  15250. private boolean aBoolean1159;
  15251. private boolean aBoolean1160;
  15252. public static int loopCycle;
  15253. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  15254. private RSImageProducer aRSImageProducer_1166;
  15255. private static RSImageProducer aRSImageProducer_1163;
  15256. private RSImageProducer mapEdgeIP;
  15257. private RSImageProducer aRSImageProducer_1164;
  15258. private static RSImageProducer aRSImageProducer_1165;
  15259. private int daysSinceRecovChange;
  15260. private RSSocket socketStream;
  15261. private static int minimapZoom;
  15262. private long aLong1172;
  15263. private String myUsername;
  15264. private String myPassword;
  15265. private static int anInt1175;
  15266. private boolean genericLoadingError;
  15267. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  15268. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  15269. private int reportAbuseInterfaceID;
  15270. private NodeList aClass19_1179;
  15271. private static int[] anIntArray1180;
  15272. private static int[] anIntArray1181;
  15273. private static int[] anIntArray1182;
  15274. private byte[][] aByteArrayArray1183;
  15275. private int anInt1184;
  15276. private static int viewRotation;
  15277. private int anInt1186;
  15278. private int anInt1187;
  15279. private static int anInt1188;
  15280. private int invOverlayInterfaceID;
  15281. private int[] anIntArray1190;
  15282. private int[] anIntArray1191;
  15283. private Stream stream;
  15284. private int anInt1193;
  15285. private int splitPrivateChat;
  15286. private String[] clanList = new String[100];
  15287. private String[] menuActionName;
  15288. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  15289. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  15290. private final int[] anIntArray1203;
  15291. public static int anIntArray1204[] = { 9104, 10275, 7595, 3610, 7975, 8526,
  15292. 918, -26734, 24466, 10145, -6882, 5027, 1457, 16565, -30545, 25486,
  15293. 24, 5392, 10429, 3673, -27335, -21957, 192, 687, 412, 21821, 28835,
  15294. -15460, -14019 };
  15295. private static boolean flagged;
  15296. private final int[] anIntArray1207;
  15297. private int anInt1208;
  15298. private static int minimapRotation;
  15299. public static int anInt1211;
  15300. private String promptInput;
  15301. private int anInt1213;
  15302. private int[][][] intGroundArray;
  15303. private long aLong1215;
  15304. private int loginScreenCursorPos;
  15305. private final Sprite[] modIcons;
  15306. private long aLong1220;
  15307. public static int tabID;
  15308. private int anInt1222;
  15309. public static boolean inputTaken;
  15310. private int inputDialogState;
  15311. private static int anInt1226;
  15312. private int nextSong;
  15313. private boolean songChanging;
  15314. private final int[] anIntArray1229;
  15315. private Class11[] aClass11Array1230;
  15316. public static int anIntArray1232[];
  15317. private int[] anIntArray1234;
  15318. private int[] anIntArray1235;
  15319. private int[] anIntArray1236;
  15320. private int anInt1237;
  15321. private int anInt1238;
  15322. public final int anInt1239 = 100;
  15323. private final int[] anIntArray1241;
  15324. private boolean aBoolean1242;
  15325. private int atInventoryLoopCycle;
  15326. private int atInventoryInterface;
  15327. private int atInventoryIndex;
  15328. private int atInventoryInterfaceType;
  15329. private byte[][] aByteArrayArray1247;
  15330. private int tradeMode;
  15331. private int anInt1249;
  15332. private final int[] anIntArray1250;
  15333. private int anInt1251;
  15334. private final boolean rsAlreadyLoaded;
  15335. private int anInt1253;
  15336. private boolean welcomeScreenRaised;
  15337. private boolean messagePromptRaised;
  15338. private int anInt1257;
  15339. private byte[][][] byteGroundArray;
  15340. private int prevSong;
  15341. private int destX;
  15342. private int destY;
  15343. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  15344. public Sprite backgroundFix;
  15345. private int anInt1264;
  15346. private int anInt1265;
  15347. private String loginMessage1 = "Welcome to OS-PvP";
  15348. private String loginMessage2 = "Enter your credentials to login";
  15349. private int anInt1268;
  15350. private int anInt1269;
  15351. private int anInt1275;
  15352. private int backDialogID;
  15353. private int cameraOffsetX;
  15354. private int[] bigX;
  15355. private int[] bigY;
  15356. private int itemSelected;
  15357. private int anInt1283;
  15358. private int anInt1284;
  15359. private int anInt1285;
  15360. private String selectedItemName;
  15361. private int publicChatMode;
  15362. private static int anInt1288;
  15363. private int anInt1289;
  15364. public static int anInt1290;
  15365. public static String server = "104.197.84.246";
  15366. public int drawCount;
  15367. public int fullscreenInterfaceID;
  15368. public int anInt1044;// 377
  15369. public int anInt1129;// 377
  15370. public int anInt1315;// 377
  15371. public int anInt1500;// 377
  15372. public int anInt1501;// 377
  15373. public static int[] fullScreenTextureArray;
  15374.  
  15375. public void resetAllImageProducers() {
  15376. if (super.fullGameScreen != null) {
  15377. return;
  15378. }
  15379. aRSImageProducer_1166 = null;
  15380. aRSImageProducer_1164 = null;
  15381. aRSImageProducer_1163 = null;
  15382. aRSImageProducer_1165 = null;
  15383. aRSImageProducer_1125 = null;
  15384. aRSImageProducer_1107 = null;
  15385. aRSImageProducer_1108 = null;
  15386. loginScreenArea = null;
  15387. backgroundFix = null;
  15388. leftSideFlame = null;
  15389. rightSideFlame = null;
  15390. gameLogo = null;
  15391. aRSImageProducer_1113 = null;
  15392. aRSImageProducer_1114 = null;
  15393. aRSImageProducer_1115 = null;
  15394. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  15395. welcomeScreenRaised = true;
  15396. }
  15397.  
  15398. public void launchURL(String url) {
  15399. String osName = System.getProperty("os.name");
  15400. try {
  15401. if (osName.startsWith("Mac OS")) {
  15402. @SuppressWarnings("rawtypes")
  15403. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  15404. @SuppressWarnings("unchecked")
  15405. Method openURL = fileMgr.getDeclaredMethod("openURL",
  15406. new Class[] { String.class });
  15407. openURL.invoke(null, new Object[] { url });
  15408. } else if (osName.startsWith("Windows"))
  15409. Runtime.getRuntime().exec(
  15410. "rundll32 url.dll,FileProtocolHandler " + url);
  15411. else { // assume Unix or Linux
  15412. String[] browsers = { "firefox", "opera", "konqueror",
  15413. "epiphany", "mozilla", "netscape", "safari" };
  15414. String browser = null;
  15415. for (int count = 0; count < browsers.length && browser == null; count++)
  15416. if (Runtime.getRuntime()
  15417. .exec(new String[] { "which", browsers[count] })
  15418. .waitFor() == 0)
  15419. browser = browsers[count];
  15420. if (browser == null) {
  15421. throw new Exception("Could not find web browser");
  15422. } else
  15423. Runtime.getRuntime().exec(new String[] { browser, url });
  15424. }
  15425. } catch (Exception e) {
  15426. pushMessage("Failed to open URL.", 0, "");
  15427. }
  15428. }
  15429.  
  15430. public DecimalFormat getFormat() {
  15431. return format;
  15432. }
  15433.  
  15434. public void setFormat(DecimalFormat format) {
  15435. this.format = format;
  15436. }
  15437.  
  15438. private void drawInputField(RSInterface child, int interfaceX,
  15439. int interfaceY, int x, int y, int width, int height) {
  15440. int clickX = super.saveClickX, clickY = super.saveClickY;
  15441. // if(clientSize == 0) {
  15442. if (clickX >= 512 && clickY >= 169) {
  15443. clickX -= 512;
  15444. clickY -= 169;
  15445. }
  15446. Sprite[] inputSprites = this.inputSprites;
  15447. int xOffset = width % 12;
  15448. int yOffset = height % 12;
  15449. int xModification = 0, yModification = 0;
  15450. for (int row = 0; row < width; row += 12) {
  15451. if (row + 12 > width)
  15452. row -= 12 - (width - row);
  15453. inputSprites[6].drawSprite(xModification <= 0 ? x + row : x
  15454. + xModification, y);
  15455. for (int collumn = 0; collumn < height; collumn += 12) {
  15456. if (collumn + 12 > height)
  15457. collumn -= 12 - (height - collumn);
  15458. inputSprites[6].drawSprite(x + row, yModification <= 0 ? y
  15459. + collumn : y + yModification);
  15460. }
  15461. }
  15462. inputSprites[1].drawSprite(x, y);
  15463. inputSprites[0].drawSprite(x, y + height - 8);
  15464. inputSprites[2].drawSprite(x + width - 4, y);
  15465. inputSprites[3].drawSprite(x + width - 4, y + height - 8);
  15466. xOffset = width % 8;
  15467. yOffset = height % 8;
  15468. xModification = 0;
  15469. yModification = 0;
  15470. for (int top = 0; top < width; top += 8) {
  15471. if (top + 8 > width)
  15472. top -= 8 - (width - top);
  15473. inputSprites[5].drawSprite(x + top, y);
  15474. inputSprites[5].drawSprite(x + top, y + height - 1);
  15475. }
  15476. for (int bottom = 0; bottom < height; bottom += 8) {
  15477. if (bottom + 8 > height)
  15478. bottom -= 8 - (height - bottom);
  15479. inputSprites[4].drawSprite(x, y + bottom);
  15480. inputSprites[4].drawSprite(x + width - 1, y + bottom);
  15481. }
  15482. String message = child.message;
  15483. if (aTextDrawingArea_1271.getTextWidth(message) > child.width - 10)
  15484. message = message.substring(message.length() - (child.width / 10)
  15485. - 1, message.length());
  15486. if (child.displayAsterisks)
  15487. this.aTextDrawingArea_1271
  15488. .method389(
  15489. false,
  15490. (x + 4),
  15491. child.textColor,
  15492. new StringBuilder()
  15493. .append("")
  15494. .append(TextClass
  15495. .passwordAsterisks(message))
  15496. .append(((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1
  15497. : 0)) != 0 ? "|" : "").toString(),
  15498. (y + (height / 2) + 6));
  15499. else
  15500. this.aTextDrawingArea_1271
  15501. .method389(
  15502. false,
  15503. (x + 4),
  15504. child.textColor,
  15505. new StringBuilder()
  15506. .append("")
  15507. .append(message)
  15508. .append(((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1
  15509. : 0)) != 0 ? "|" : "").toString(),
  15510. (y + (height / 2) + 6));
  15511. if (clickX >= x && clickX <= x + child.width && clickY >= y
  15512. && clickY <= y + child.height) {
  15513. if (!child.isInFocus && getInputFieldFocusOwner() != child) {
  15514. if ((super.clickMode2 == 1 && !menuOpen)) {
  15515. RSInterface.currentInputFieldId = child.id;
  15516. setInputFieldFocusOwner(child);
  15517. if (child.message != null
  15518. && child.message
  15519. .equals(child.defaultInputFieldText))
  15520. child.message = "";
  15521. if (child.message == null)
  15522. child.message = "";
  15523. }
  15524. }
  15525. }
  15526. }
  15527.  
  15528. public void setInputFieldFocusOwner(RSInterface owner) {
  15529. for (RSInterface rsi : RSInterface.interfaceCache)
  15530. if (rsi != null)
  15531. if (rsi == owner)
  15532. rsi.isInFocus = true;
  15533. else
  15534. rsi.isInFocus = false;
  15535. }
  15536.  
  15537. public RSInterface getInputFieldFocusOwner() {
  15538. for (RSInterface rsi : RSInterface.interfaceCache)
  15539. if (rsi != null)
  15540. if (rsi.isInFocus)
  15541. return rsi;
  15542. return null;
  15543. }
  15544.  
  15545. public void resetInputFieldFocus() {
  15546. for (RSInterface rsi : RSInterface.interfaceCache)
  15547. if (rsi != null)
  15548. rsi.isInFocus = false;
  15549. RSInterface.currentInputFieldId = -1;
  15550. }
  15551.  
  15552. public boolean isFieldInFocus() {
  15553. for (RSInterface rsi : RSInterface.interfaceCache)
  15554. if (rsi != null)
  15555. if (rsi.type == 16 && rsi.isInFocus)
  15556. return true;
  15557. return false;
  15558. }
  15559.  
  15560. private boolean interfaceContainsItem(int interfaceId) {
  15561. RSInterface rsi = RSInterface.interfaceCache[interfaceId];
  15562. if (rsi == null)
  15563. return false;
  15564. if (rsi.inv == null) {
  15565. return false;
  15566. }
  15567. int count = 0;
  15568. for (int i = 0; i < rsi.inv.length; i++) {
  15569. if (rsi.inv[i] > 0) {
  15570. count++;
  15571. }
  15572. }
  15573. return count > 0;
  15574. }
  15575.  
  15576. public static boolean scrollbarVisible(RSInterface widget) {
  15577. if (widget.id == 55010) {
  15578. if (RSInterface.interfaceCache[55024].message.length() <= 0) {
  15579. return false;
  15580. }
  15581. } else if (widget.id == 55050) {
  15582. if (RSInterface.interfaceCache[55064].message.length() <= 0) {
  15583. return false;
  15584. }
  15585. }
  15586. return true;
  15587. }
  15588.  
  15589. void mouseWheelDragged(int i, int j) {
  15590. if (!mouseWheelDown)
  15591. return;
  15592. this.anInt1186 += i * 3;
  15593. this.anInt1187 += (j << 1);
  15594. }
  15595.  
  15596. static {
  15597. anIntArray1019 = new int[99];
  15598. int i = 0;
  15599. for (int j = 0; j < 99; j++) {
  15600. int l = j + 1;
  15601. int i1 = (int) (l + 300D * Math.pow(2D, l / 7D));
  15602. i += i1;
  15603. anIntArray1019[j] = i / 4;
  15604. }
  15605. anIntArray1232 = new int[32];
  15606. i = 2;
  15607. for (int k = 0; k < 32; k++) {
  15608. anIntArray1232[k] = i - 1;
  15609. i += i;
  15610. }
  15611. }
  15612.  
  15613. private FadingScreen fadingScreen = new FadingScreen();
  15614.  
  15615. private class FadingScreen {
  15616. /**
  15617. * The state of the fade on the screen
  15618. */
  15619. private byte state;
  15620.  
  15621. /**
  15622. * How many seconds the fade exists for
  15623. */
  15624. private byte seconds;
  15625.  
  15626. /**
  15627. * The string of text that will be displayed on the screen
  15628. */
  15629. private String text;
  15630.  
  15631. /**
  15632. * Controls how long it's been since the screen started its last fade
  15633. */
  15634. private StopWatch watch;
  15635.  
  15636. /**
  15637. * Acts as a means to instance the local {@link FadingScreen} object.
  15638. * Since the value of state by default is 0, nothing will be drawn on
  15639. * the screen.
  15640. */
  15641. private FadingScreen() { }
  15642.  
  15643. /**
  15644. * Creates a new fading screen
  15645. * @param state the state of the fade
  15646. * @param seconds the duration of the fade
  15647. */
  15648. private FadingScreen(String text, byte state, byte seconds) {
  15649. this.text = text;
  15650. this.state = state;
  15651. this.seconds = seconds;
  15652. this.watch = new StopWatch();
  15653. this.watch.start();
  15654. }
  15655.  
  15656. /**
  15657. * Draws the animation on the screen. If the state of the
  15658. * screen is currenly 0 the animation will not be drawn.
  15659. */
  15660. private void draw() {
  15661. if(state == 0) {
  15662. return;
  15663. }
  15664. long end = watch.getStartTime() + (1000L * seconds);
  15665. long increment = ((end - watch.getStartTime()) / 100);
  15666. if (increment > 0) {
  15667. long percentile = watch.getTime() / increment;
  15668. int opacity = (int) ((percentile * (Byte.MAX_VALUE / 100)) * 2);
  15669. if (state < 0) {
  15670. opacity = 255 - opacity;
  15671. }
  15672. if (percentile > -1 && percentile <= 100) {
  15673. DrawingArea.setDrawingArea(334, 0, 512, 0);
  15674. DrawingArea.drawAlphaBox(0, 0, 512, 334, 0x000000, opacity);
  15675. if (percentile > 85 && state == 1 || percentile < 50 && state == -1) {
  15676. newRegularFont.drawCenteredString(text, 512 / 2, 334 / 2, 0xFFFFFF, 0);
  15677. } else if (percentile == 100) {
  15678. watch.stop();
  15679. state = 0;
  15680. }
  15681. }
  15682. }
  15683. }
  15684. }
  15685. }
Add Comment
Please, Sign In to add comment