Advertisement
Guest User

albo123

a guest
Apr 3rd, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 448.66 KB | None | 0 0
  1. package com;
  2.  
  3. import java.applet.AppletContext;
  4. import java.awt.Color;
  5. import java.awt.Component;
  6. import java.awt.Font;
  7. import java.awt.Graphics;
  8. import java.io.BufferedInputStream;
  9. import java.io.BufferedOutputStream;
  10. import java.io.ByteArrayInputStream;
  11. import java.io.DataInputStream;
  12. import java.io.DataOutputStream;
  13. import java.io.File;
  14. import java.io.FileInputStream;
  15. import java.io.FileOutputStream;
  16. import java.io.IOException;
  17. import java.io.InputStream;
  18. import java.io.OutputStream;
  19. import java.lang.reflect.Method;
  20. import java.net.InetAddress;
  21. import java.net.Socket;
  22. import java.net.URL;
  23. import java.text.NumberFormat;
  24. import java.util.regex.Matcher;
  25. import java.util.regex.Pattern;
  26.  
  27. import com.cache.Update;
  28. import com.entity.Entity;
  29. import com.entity.EntityDef;
  30. import com.impl.Animable;
  31. import com.impl.Animable_Sub3;
  32. import com.impl.Animable_Sub4;
  33. import com.impl.Animable_Sub5;
  34. import com.impl.Animation;
  35. import com.impl.Background;
  36. import com.impl.Censor;
  37. import com.impl.Class30_Sub1;
  38. import com.impl.Class36;
  39. import com.impl.Decompressor;
  40. import com.impl.DrawingArea;
  41. import com.impl.FileOperations;
  42. import com.impl.Flo;
  43. import com.impl.FloorOverlay;
  44. import com.impl.IDK;
  45. import com.impl.ISAACRandomGen;
  46. import com.impl.Jframe;
  47. import com.impl.Model;
  48. import com.impl.MouseDetection;
  49. import com.impl.NPC;
  50. import com.impl.Node;
  51. import com.impl.NodeList;
  52. import com.impl.OnDemandData;
  53. import com.impl.OnDemandFetcher;
  54. import com.impl.Player;
  55. import com.impl.RSFont;
  56. import com.impl.RSImageProducer;
  57. import com.impl.RSSocket;
  58. import com.impl.Rasterizer;
  59. import com.impl.SizeConstants;
  60. import com.impl.Skills;
  61. import com.impl.Sound;
  62. import com.impl.SoundPlayer;
  63. import com.impl.SpotAnim;
  64. import com.impl.Sprite;
  65. import com.impl.Stream;
  66. import com.impl.StreamLoader;
  67. import com.impl.TextClass;
  68. import com.impl.TextDrawingArea;
  69. import com.impl.TextInput;
  70. import com.impl.Texture;
  71. import com.impl.TextureAnimating;
  72. import com.impl.TextureDef;
  73. import com.impl.TileSettings;
  74. import com.impl.VarBit;
  75. import com.impl.Varp;
  76. import com.impl.WorldController;
  77. import com.interfaces.RSInterface;
  78. import com.items.Item;
  79. import com.items.ItemDef;
  80. import com.objects.Object1;
  81. import com.objects.Object2;
  82. import com.objects.Object3;
  83. import com.objects.Object5;
  84. import com.objects.ObjectDef;
  85. import com.objects.ObjectManager;
  86. import com.sign.SignLink;
  87.  
  88. public class Client extends RSApplet {
  89. public int[] menuActionCmd4;
  90.  
  91. public static final long serialVersionUID = 1L;
  92.  
  93. private Update update = new Update(this);
  94. public boolean HPBarToggle = true;
  95. public Sprite[] chatImages = new Sprite[2];
  96. public static int spellID = 0;
  97. public int MapX, MapY;
  98. private int ping = 0;
  99. private long pingStart = 0;
  100. Pattern pattern = Pattern.compile("@cr([0-9]{1,2})@");
  101.  
  102. public static String intToKOrMilLongName(int i) {
  103. String s = String.valueOf(i);
  104. for (int k = s.length() - 3; k > 0; k -= 3)
  105. s = s.substring(0, k) + "," + s.substring(k);
  106. if (s.length() > 8)
  107. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  108. else if (s.length() > 4)
  109. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  110. return " " + s;
  111. }
  112.  
  113. public static String intToKOrMil(int j) {
  114. if (j < 0x186a0)
  115. return String.valueOf(j);
  116. if (j < 0x989680)
  117. return j / 1000 + "K";
  118. else
  119. return j / 0xf4240 + "M";
  120. }
  121.  
  122. public void stopMidi() {
  123. SignLink.midifade = 0;
  124. SignLink.midi = "stop";
  125. //SignLink.midii.fadeOut();
  126. }
  127.  
  128. private void processXPCounterClick() {
  129. int x = super.mouseX;
  130. int y = super.mouseY;
  131. if (x >= 520 && x <= 554 && y >= 47 && y <= 81) {
  132. menuActionName[3] = counterOn ? "Off" : "On";
  133. menuActionIds[3] = 474;
  134. menuActionName[2] = "Reset";
  135. menuActionIds[2] = 475;
  136. menuActionName[1] = xpLock ? "Unlock XP" : "Lock XP";
  137. menuActionIds[1] = 476;
  138. menuActionRow = 4;
  139. }
  140. }
  141.  
  142. public void hitmarkDraw(int hitLength, int type, int icon, int damage, int move, int opacity) {
  143. if (damage > 0) {
  144. Sprite end1 = null, middle = null, end2 = null;
  145. int x = 0;
  146. switch (hitLength) {
  147. case 1: x = 8; break;
  148. case 2: x = 4; break;
  149. case 3: x = 1; break;
  150. }
  151. switch (type) {
  152. case 0:
  153. end1 = hitMark[0];
  154. middle = hitMark[1];
  155. end2 = hitMark[2];
  156. break;
  157. case 1:
  158. end1 = hitMark[3];
  159. middle = hitMark[4];
  160. end2 = hitMark[5];
  161. break;
  162. case 2:
  163. end1 = hitMark[6];
  164. middle = hitMark[7];
  165. end2 = hitMark[8];
  166. break;
  167. }
  168. if (type <= 1 || icon != -1)
  169. hitIcon[icon].drawTransparentSprite(spriteDrawX - 34 + x, spriteDrawY - 14 + move, opacity);
  170. end1.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  171. x += 4;
  172. for (int i = 0; i < hitLength * 2; i++) {
  173. middle.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  174. x += 4;
  175. }
  176. end2.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  177. if (opacity > 100)
  178. (type == 1 ? bigHit : smallHit).drawText(0xffffff, String.valueOf(damage), spriteDrawY + (type == 1 ? 2 : 32) + move, spriteDrawX + 4);
  179. } else {
  180. Sprite block = new Sprite("hits/block");
  181. block.drawTransparentSprite(spriteDrawX - 12, spriteDrawY - 14 + move, opacity);
  182. }
  183. }
  184.  
  185.  
  186. private int xpAddedPos;
  187. private int expAdded = 0;
  188. private boolean xpLock = false;
  189. private int xpCounter = 0;
  190. private boolean counterOn = false;
  191.  
  192. private void drawCounterOnScreen() {
  193. int x = 520;
  194. int y = 37;
  195. counter[2].drawSprite(x - 100, y + 12);
  196. int i = aTextDrawingArea_1271.getTextWidth(Integer.toString(xpCounter));
  197. aTextDrawingArea_1271.drawText(0xffffff, "XP:", y + 25, x - 88);
  198. aTextDrawingArea_1271.drawText(0xffffff, Integer.toString(xpCounter),y + 25, x + 11 - i);
  199. if (expAdded != 0) {
  200. i = smallText.getTextWidth(Integer.toString(expAdded) + "xp");
  201. smallText.drawText(0xff9933, Integer.toString(expAdded) + "xp", y + 14 + 7 + xpAddedPos, x - 12 - i);
  202. xpAddedPos += 2;
  203. if (xpAddedPos >= 50) {
  204. xpAddedPos = 0;
  205. expAdded = 0;
  206. }
  207. }
  208. }
  209.  
  210. Sprite[] counter;
  211.  
  212. private void drawXPCounter() {
  213. int x = 0 - 2;
  214. int y = 45;
  215. int x1 = super.mouseX;
  216. int y1 = super.mouseY;
  217. counter[(counterOn || (x1 >= 520 && x1 <= 554 && y1 >= 47 && y1 <= 81) ? 1: 0)].drawSprite(x, y);
  218. }
  219.  
  220. public boolean menuHasAddFriend(int j) {
  221. if (j < 0)
  222. return false;
  223. int k = menuActionIds[j];
  224. if (k >= 2000)
  225. k -= 2000;
  226. return k == 337;
  227. }
  228.  
  229. public void drawChannelButtons() {
  230. String text[] = {
  231. "On", "Friends", "Off", "Hide"
  232. };
  233. int disabledColor[] = {
  234. 65280, 0xffff00, 0xff0000, 65535
  235. };
  236. switch (cButtonCPos) {
  237. case 0:
  238. chatButtons[1].drawSprite(5, 144);
  239. break;
  240. case 1:
  241. chatButtons[1].drawSprite(62, 144);
  242. break;
  243. case 2:
  244. chatButtons[1].drawSprite(119, 144);
  245. break;
  246. case 3:
  247. chatButtons[1].drawSprite(176, 144);
  248. break;
  249. case 4:
  250. chatButtons[1].drawSprite(233, 144);
  251. break;
  252. case 5:
  253. chatButtons[1].drawSprite(290, 144);
  254. break;
  255. case 6:
  256. chatButtons[1].drawSprite(347, 144);
  257. break;
  258. }
  259. if (cButtonHPos == cButtonCPos) {
  260. switch (cButtonHPos) {
  261. case 0:
  262. chatButtons[2].drawSprite(5, 144);
  263. break;
  264. case 1:
  265. chatButtons[2].drawSprite(62, 144);
  266. break;
  267. case 2:
  268. chatButtons[2].drawSprite(119, 144);
  269. break;
  270. case 3:
  271. chatButtons[2].drawSprite(176, 144);
  272. break;
  273. case 4:
  274. chatButtons[2].drawSprite(233, 144);
  275. break;
  276. case 5:
  277. chatButtons[2].drawSprite(290, 144);
  278. break;
  279. case 7:
  280. chatButtons[2].drawSprite(347, 144);
  281. break;
  282. case 6:
  283. chatButtons[3].drawSprite(404, 144);
  284. break;
  285. }
  286. } else {
  287. switch (cButtonHPos) {
  288. case 0:
  289. chatButtons[2].drawSprite(5, 144);
  290. break;
  291. case 1:
  292. chatButtons[2].drawSprite(62, 144);
  293. break;
  294. case 2:
  295. chatButtons[2].drawSprite(119, 144);
  296. break;
  297. case 3:
  298. chatButtons[2].drawSprite(176, 144);
  299. break;
  300. case 4:
  301. chatButtons[2].drawSprite(233, 144);
  302. break;
  303. case 5:
  304. chatButtons[2].drawSprite(290, 144);
  305. break;
  306. case 7:
  307. chatButtons[2].drawSprite(347, 144);
  308. break;
  309. case 6:
  310. chatButtons[3].drawSprite(404, 144);
  311. break;
  312. }
  313. }
  314. smallText.method389(true, 425, 0xffffff, "Report Abuse", 158);
  315. smallText.method389(true, 26, 0xffffff, "All", 158);
  316. smallText.method389(true, 76, 0xffffff, "Game", 158);
  317. smallText.method389(true, 131, 0xffffff, "Public", 154);
  318. smallText.method389(true, 184, 0xffffff, "Private", 154);
  319. smallText.method389(true, 249, 0xffffff, "Clan", 154);
  320. smallText.method389(true, 304, 0xffffff, "Trade", 154);
  321. smallText.method389(true, 359, 0xffffff, " Duel", 154);
  322. smallText.method382(disabledColor[publicChatMode], 147, text[publicChatMode], 165, true);
  323. smallText.method382(disabledColor[privateChatMode], 203, text[privateChatMode], 165, true);
  324. smallText.method382(disabledColor[clanChatMode], 261, text[clanChatMode], 165, true);
  325. smallText.method382(disabledColor[tradeMode], 318, text[tradeMode], 165, true);
  326. smallText.method382(65280, 374, "On", 165, true);
  327. }
  328.  
  329. private int privateChatMode;
  330.  
  331. public void drawChatArea() {
  332. aRSImageProducer_1166.initDrawingArea();
  333. Rasterizer.lineOffsets = anIntArray1180;
  334. chatArea.drawSprite(0, 0);
  335. drawChannelButtons();
  336. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  337. if (messagePromptRaised) {
  338. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  339. newBoldFont.drawCenteredString(promptInput + "*", 259, 80, 128, -1);
  340. } else if (inputDialogState == 1) {
  341. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  342. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  343. 128, -1);
  344. } else if (inputDialogState == 2) {
  345. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  346. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  347. 128, -1);
  348. } else if (aString844 != null) {
  349. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  350. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128,
  351. -1);
  352. } else if (backDialogID != -1) {
  353. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  354. } else if (dialogID != -1) {
  355. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  356. } else {
  357. int line = -3;
  358. int j = 0;
  359. Matcher matcher;
  360. DrawingArea.setDrawingArea(122, 8, 497, 7);
  361. for (int k = 0; k < 500; k++)
  362. if (chatMessages[k] != null) {
  363. int chatType = chatTypes[k];
  364. int yPos = (70 - line * 14) + anInt1089 + 5;
  365. String username = chatNames[k];
  366. byte byte0 = 0;
  367.  
  368. matcher = pattern.matcher(username);
  369. if (matcher.find()) {
  370. try {
  371. username = username.replace(matcher.group(0), "");
  372. byte0 = Byte.parseByte(matcher.group(1));
  373. } catch (NumberFormatException e) {
  374. byte0 = 0;
  375. }
  376. }
  377. if (chatType == 0) {
  378. if (chatTypeView == 5 || chatTypeView == 0) {
  379. if (yPos > 0 && yPos < 210) {
  380. newRegularFont.drawBasicString(chatMessages[k]/*.replaceAll("<(col|shad)=([a-zA-Z0-9]+)>", "<col=255>").replaceAll("@[^@]*@", "")*/, 11, yPos, 0, -1);
  381. // textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  382. }
  383. j++;
  384. line++;
  385. }
  386. }
  387. if ((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(username))) {
  388. if (chatTypeView == 1 || chatTypeView == 0) {
  389. if (yPos > 0 && yPos < 210) {
  390. int xPos = 13;
  391. Sprite crown = modIcons[byte0];
  392.  
  393. if (crown != null) {
  394. xPos = 11;
  395. }
  396.  
  397. String[] message = TextClass.splitString(newRegularFont, username + ": ", chatMessages[k], 470, crown);
  398. if (message.length > 1 && message[0] != null && message[1] != null) {
  399. if (crown != null && byte0 <= modIcons.length) {
  400. crown.drawSprite(xPos, yPos - 25 - (crown.myHeight / 6));
  401. xPos += crown.maxWidth;
  402. }
  403. newRegularFont.drawBasicString(username + ":", xPos, yPos - 14, 0, -1);
  404. xPos += newRegularFont.getTextWidth(username) + 6;
  405. newRegularFont.drawBasicString(message[0], xPos, yPos - 14, 255, -1);
  406. newRegularFont.drawBasicString(message[1], (crown == null ? 11 : 13), yPos, 255, -1);
  407. j++;
  408. line++;
  409. } else {
  410. if (crown != null && byte0 <= modIcons.length) {
  411. crown.drawSprite(xPos, yPos - 11 - (crown.myHeight / 6));
  412. xPos += crown.maxWidth;
  413. }
  414. newRegularFont.drawBasicString(username + ":", xPos, yPos, 0, -1);
  415. xPos += newRegularFont.getTextWidth(username) + 6;
  416. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  417. }
  418. }
  419. j++;
  420. line++;
  421. }
  422. }
  423. if ((chatType == 3 || chatType == 7) && (splitpublicChat == 0 || chatTypeView == 2) && (chatType == 7 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(username))) {
  424. if (chatTypeView == 2 || chatTypeView == 0) {
  425. if (yPos > 0 && yPos < 210) {
  426. int k1 = 11;
  427.  
  428. Sprite crown = byte0 == 0 ? null : modIcons[byte0];
  429. String[] message = TextClass.splitString(newRegularFont, "", chatMessages[k], 470, crown);
  430. if (message.length > 1 && message[0] != null && message[1] != null) {
  431. textDrawingArea.method385(0, "From ", yPos - 13, k1);
  432. k1 += textDrawingArea.getTextWidth("From ") - 2;
  433. if (crown != null && byte0 <= modIcons.length) {
  434. crown.drawSprite(k1, yPos - 24 - (crown.myHeight / 6));
  435. k1 += crown.maxWidth;
  436. }
  437. newRegularFont.drawBasicString(username + ":", k1, yPos - 13, 0, -1);
  438. k1 += newRegularFont.getTextWidth(username + ":") + 2;
  439. newRegularFont.drawBasicString(message[0], k1, yPos - 13, 0x800000, -1);
  440. newRegularFont.drawBasicString(message[1], 11, yPos, 0x800000, -1);
  441. j++;
  442. line++;
  443. } else {
  444. textDrawingArea.method385(0, "From ", yPos, k1);
  445. k1 += textDrawingArea.getTextWidth("From ") - 2;
  446. if (crown != null && byte0 <= modIcons.length) {
  447. crown.drawSprite(k1, yPos - 11 - (crown.myHeight / 6));
  448. k1 += crown.maxWidth;
  449. }
  450. newRegularFont.drawBasicString(username + ":", k1, yPos, 0, -1);
  451. k1 += newRegularFont.getTextWidth(username + ":") + 2;
  452. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  453. }
  454. }
  455. j++;
  456. line++;
  457. }
  458. }
  459. if (chatType == 4
  460. && (tradeMode == 0 || tradeMode == 1
  461. && isFriendOrSelf(username))) {
  462. if (chatTypeView == 3 || chatTypeView == 0) {
  463. if (yPos > 0 && yPos < 210)
  464. // textDrawingArea.method385(0x800080, s1 + " "
  465. // + chatMessages[k], yPos, 11);
  466. newRegularFont.drawBasicString(username + " "
  467. + chatMessages[k], 11, yPos, 0x800080,
  468. -1);
  469. j++;
  470. line++;
  471. }
  472. }
  473. if (chatType == 5 && splitpublicChat == 0
  474. && publicChatMode < 2) {
  475. if (chatTypeView == 2 || chatTypeView == 0) {
  476. if (yPos > 0 && yPos < 210)
  477. // textDrawingArea.method385(0x800000,
  478. // chatMessages[k], yPos, 11);
  479. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  480. j++;
  481. line++;
  482. }
  483. }
  484. if (chatType == 6 && (splitpublicChat == 0 || chatTypeView == 2) && publicChatMode < 2) {
  485. if (chatTypeView == 2 || chatTypeView == 0) {
  486. if (yPos > 0 && yPos < 210) {
  487. // textDrawingArea.method385(0, "To " + s1 +
  488. // ":", yPos, 11);
  489. // textDrawingArea.method385(0x800000,
  490. // chatMessages[k], yPos, 15 +
  491. // textDrawingArea.getTextWidth("To :" + s1));
  492.  
  493. newRegularFont.drawBasicString("To " + username + ":", 11, yPos, 0, -1);
  494. newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + username), yPos, 0x800000, -1);
  495. }
  496. j++;
  497. line++;
  498. }
  499. }
  500. if (chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(username))) {
  501. if (chatTypeView == 3 || chatTypeView == 0) {
  502. if (yPos > 0 && yPos < 210)
  503. newRegularFont.drawBasicString(username + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  504. j++;
  505. line++;
  506. }
  507. if(chatType == 11 && (clanChatMode == 0)) {
  508. if (chatTypeView == 11) {
  509. if(yPos > 0 && yPos < 110)
  510. newRegularFont.drawBasicString(username + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  511. j++;
  512. line++;
  513. }
  514. }
  515. }
  516. if(chatType == 15 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(username))) {
  517. if (chatTypeView == 3 || chatTypeView == 0) {
  518. if(yPos > 0 && yPos < 210)
  519. textDrawingArea.method385(0x7e3200, username + " " + chatMessages[k], yPos, 11);
  520. j++;
  521. line++;
  522. }
  523. }
  524. if(chatType == 16) {
  525. int j2 = 40+11;
  526. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  527. if(chatTypeView == 11 || chatTypeView == 0) {
  528. if(yPos > 0 && yPos < 110)
  529. switch(chatRights[k]) {
  530. case 1:
  531. j2 += clanNameWidth;
  532. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  533. j2 += 14;
  534. break;
  535.  
  536. case 2:
  537. j2 += clanNameWidth;
  538. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  539. j2 += 14;
  540. break;
  541.  
  542. case 3:
  543. j2 += clanNameWidth;
  544. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  545. j2 += 14;
  546. break;
  547.  
  548. case 4:
  549. j2 += clanNameWidth;
  550. modIcons[4].drawSprite(j2 - 18, yPos - 12);
  551. j2 += 14;
  552. break;
  553. case 5:
  554. j2 += clanNameWidth;
  555. modIcons[5].drawAdvancedSprite(j2 - 19, yPos - 14);
  556. j2 += 14;
  557. break;
  558. case 6:
  559. j2 += clanNameWidth;
  560. modIcons[6].drawSprite(j2 - 18, yPos - 12);
  561. j2 += 14;
  562. break;
  563. case 7:
  564. j2 += clanNameWidth;
  565. modIcons[7].drawAdvancedSprite(j2 - 18, yPos - 13);
  566. j2 += 14;
  567. break;
  568. case 8:
  569. j2 += clanNameWidth;
  570. modIcons[8].drawAdvancedSprite(j2 - 18, yPos - 13);
  571. j2 += 14;
  572. break;
  573.  
  574. case 9:
  575. j2 += clanNameWidth;
  576. modIcons[9].drawAdvancedSprite(j2 - 18, yPos - 12);
  577. j2 += 14;
  578. break;
  579.  
  580. case 10:
  581. j2 += clanNameWidth;
  582. modIcons[10].drawAdvancedSprite(j2 - 18, yPos - 11);
  583. j2 += 14;
  584. break;
  585.  
  586. case 11:
  587. j2 += clanNameWidth;
  588. modIcons[11].drawSprite(j2 - 15, yPos - 10);
  589. j2 += 14;
  590. break;
  591. case 12:
  592. j2 += clanNameWidth;
  593. modIcons[12].drawAdvancedSprite(j2 - 20, yPos - 15);
  594. j2 += 14;
  595. break;
  596. case 13:
  597. j2 += clanNameWidth;
  598. modIcons[13].drawSprite(j2 - 15, yPos - 10);
  599. j2 += 14;
  600. break;
  601. case 14:
  602. j2 += clanNameWidth;
  603. modIcons[14].drawAdvancedSprite(j2 - 18, yPos - 11);
  604. j2 += 14;
  605. break;
  606. case 15:
  607. j2 += clanNameWidth;
  608. modIcons[15].drawAdvancedSprite(j2 - 18, yPos - 11);
  609. j2 += 14;
  610. break;
  611.  
  612. case 16:
  613. j2 += clanNameWidth;
  614. modIcons[16].drawAdvancedSprite(j2 - 18, yPos - 11);
  615. j2 += 14;
  616. break;
  617.  
  618. case 17:
  619. j2 += clanNameWidth;
  620. modIcons[17].drawAdvancedSprite(j2 - 18, yPos - 11);
  621. j2 += 14;
  622. break;
  623.  
  624. case 18:
  625. j2 += clanNameWidth;
  626. modIcons[18].drawSprite(j2 - 15, yPos - 10);
  627. j2 += 14;
  628. break;
  629. case 19:
  630. j2 += clanNameWidth;
  631. modIcons[19].drawAdvancedSprite(j2 - 20, yPos - 15);
  632. j2 += 14;
  633. break;
  634. case 20:
  635. j2 += clanNameWidth;
  636. modIcons[20].drawSprite(j2 - 15, yPos - 10);
  637. j2 += 14;
  638. break;
  639. default:
  640. j2 += clanNameWidth;
  641. break;
  642. }
  643. newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
  644. newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
  645. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
  646. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  647. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  648. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  649.  
  650. j++;
  651. line++;
  652. }
  653. }
  654. }
  655. DrawingArea.defaultDrawingAreaSize();
  656. anInt1211 = j * 14 + 7 + 5;
  657. if (anInt1211 < 111)
  658. anInt1211 = 111;
  659. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  660. String s;
  661. if (myPlayer != null && myPlayer.name != null)
  662. s = myPlayer.name;
  663. else
  664. s = TextClass.fixName(myUsername);
  665.  
  666. int xPos = 0;
  667. Sprite crown = modIcons[myPrivilege];
  668.  
  669. if (crown != null) {
  670. crown.drawAdvancedSprite(11, 122 - (crown.myHeight / 6));
  671. xPos += crown.maxWidth;
  672. }
  673.  
  674. textDrawingArea.method385(0, s + ":", 133, 11 + xPos);
  675. textDrawingArea.drawChatInput(255, 11 + xPos + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  676. DrawingArea.method339(121, 0x807660, 506, 7);
  677. }
  678. if (menuOpen && menuScreenArea == 2) {
  679. drawMenu();
  680. }
  681. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  682. aRSImageProducer_1165.initDrawingArea();
  683. Rasterizer.lineOffsets = anIntArray1182;
  684. }
  685.  
  686. private int partyCount;
  687.  
  688. public int getLevelForXP(int exp, int max) {
  689. int points = 0;
  690. int output = 0;
  691. exp++;
  692. if (exp > getXPForLevel(max))
  693. return max;
  694. for (int lvl = 1; lvl <= max; lvl++) {
  695. points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0));
  696. output = (int) Math.floor(points / 4);
  697. if (output >= exp) {
  698. return lvl;
  699. }
  700. }
  701. return 0;
  702. }
  703.  
  704. public int getLevelForXP(int exp) {
  705. return getLevelForXP(exp, 99);
  706. }
  707.  
  708. public int getXPForLevel(int level) {
  709. int points = 0;
  710. int output = 0;
  711. for (int lvl = 1; lvl <= level; lvl++) {
  712. points += Math.floor(lvl + 300.0 * Math.pow(2.0, lvl / 7.0));
  713. if (lvl >= level) {
  714. return output;
  715. }
  716. output = (int)Math.floor(points / 4);
  717. }
  718. return 0;
  719. }
  720.  
  721. public String[] skillNames = { "Attack", "Hitpoints", "Mining", "Strength", "Agility",
  722. "Smithing", "Defence", "Herblore", "Fishing", "Range", "Thieving",
  723. "Cooking", "Prayer", "Crafting", "Firemaking", "Magic", "Fletching", "Woodcutting",
  724. "Runecrafting", "Slayer", "Farming", "Construction", "Hunter", "Summoning",
  725. "Dungeoneering" };
  726.  
  727. public String setMessage(int level) {
  728. String[] messages = new String[4];
  729. String message = "";
  730. int maxLevel = level == 24 ? 120 : 99;
  731.  
  732. if (maxStats[level] > maxLevel) {
  733. maxStats[level] = maxLevel;
  734. }
  735.  
  736. int[] stuff = { 0, 3, 14, 2, 16, 13, 1, 15, 10, 4, 17, 7, 5, 12, 11, 6, 9, 8, 20, 18, 19, 22, 21, 23, 24 };
  737.  
  738. if (level == 24) {
  739. maxStats[stuff[level]] = currentStats[stuff[level]];
  740. }
  741.  
  742. messages[0] = skillNames[level] + ": " + currentStats[stuff[level]] + "/" + maxStats[stuff[level]] + "\\n";
  743. messages[1] = "Current XP: " + NumberFormat.getInstance().format(currentExp[stuff[level]]) + "\\n";
  744. if ((maxStats[stuff[level]] == 99 && level != 24) || (level == 24 && maxStats[stuff[level]] == 120)) {
  745. messages[2] = messages[3] = "";
  746. } else {
  747. messages[2] = "Remainder: " + NumberFormat.getInstance().format(getXPForLevel(maxStats[stuff[level]] + 1) - currentExp[stuff[level]]) + "\\n";
  748. messages[3] = "Next level: " + NumberFormat.getInstance().format(getXPForLevel(maxStats[stuff[level]] + 1));
  749. }
  750. message = messages[0] + messages[1] + messages[2] + messages[3];
  751. return message;
  752. }
  753.  
  754. public void init() {
  755. try {
  756. nodeID = 10;
  757. portOff = 0;
  758. setHighMem();
  759. isMembers = true;
  760. SignLink.storeid = 32;
  761. SignLink.startpriv(InetAddress.getLocalHost());
  762. initClientFrame(503, 765);
  763. if(saveAccountInfo){
  764. readSettings();
  765. }
  766. instance = this;
  767. } catch (Exception exception) {
  768. return;
  769. }
  770. }
  771.  
  772. public void startRunnable(Runnable runnable, int i) {
  773. if (i > 10)
  774. i = 10;
  775. if (SignLink.mainapp != null) {
  776. SignLink.startthread(runnable, i);
  777. } else {
  778. super.startRunnable(runnable, i);
  779. }
  780. }
  781.  
  782. public Socket openSocket(int port) throws IOException {
  783. return new Socket(InetAddress.getByName(server), port);
  784. }
  785.  
  786. public void processMenuClick() {
  787. if (activeInterfaceType != 0)
  788. return;
  789. int j = super.clickMode3;
  790. if (spellSelected == 1 && super.saveClickX >= 516
  791. && super.saveClickY >= 160 && super.saveClickX <= 765
  792. && super.saveClickY <= 205)
  793. j = 0;
  794. if (menuOpen) {
  795. if (j != 1) {
  796. int k = super.mouseX;
  797. int j1 = super.mouseY;
  798. if (menuScreenArea == 0) {
  799. k -= 4;
  800. j1 -= 4;
  801. }
  802. if (menuScreenArea == 1) {
  803. k -= 519;
  804. j1 -= 168;
  805. }
  806. if (menuScreenArea == 2) {
  807. k -= 17;
  808. j1 -= 338;
  809. }
  810. if (menuScreenArea == 3) {
  811. k -= 519;
  812. j1 -= 0;
  813. }
  814. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  815. || j1 < menuOffsetY - 10
  816. || j1 > menuOffsetY + menuHeight + 10) {
  817. menuOpen = false;
  818. if (menuScreenArea == 1)
  819. needDrawTabArea = true;
  820. if (menuScreenArea == 2)
  821. inputTaken = true;
  822. }
  823. }
  824. if (j == 1) {
  825. int l = menuOffsetX;
  826. int k1 = menuOffsetY;
  827. int i2 = menuWidth;
  828. int k2 = super.saveClickX;
  829. int l2 = super.saveClickY;
  830. if (menuScreenArea == 0) {
  831. k2 -= 4;
  832. l2 -= 4;
  833. }
  834. if (menuScreenArea == 1) {
  835. k2 -= 519;
  836. l2 -= 168;
  837. }
  838. if (menuScreenArea == 2) {
  839. k2 -= 17;
  840. l2 -= 338;
  841. }
  842. if (menuScreenArea == 3) {
  843. k2 -= 519;
  844. l2 -= 0;
  845. }
  846. int i3 = -1;
  847. for (int j3 = 0; j3 < menuActionRow; j3++) {
  848. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  849. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  850. i3 = j3;
  851. }
  852. if (i3 != -1)
  853. doAction(i3);
  854. menuOpen = false;
  855. if (menuScreenArea == 1)
  856. needDrawTabArea = true;
  857. if (menuScreenArea == 2) {
  858. inputTaken = true;
  859. }
  860. }
  861. } else {
  862. if (j == 1 && menuActionRow > 0) {
  863. int i1 = menuActionIds[menuActionRow - 1];
  864. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  865. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  866. || i1 == 847 || i1 == 447 || i1 == 1125) {
  867. int l1 = menuActionCmd2[menuActionRow - 1];
  868. int j2 = menuActionCmd3[menuActionRow - 1];
  869. RSInterface class9 = RSInterface.interfaceCache[j2];
  870. if (class9.aBoolean259 || class9.aBoolean235) {
  871. aBoolean1242 = false;
  872. anInt989 = 0;
  873. anInt1084 = j2;
  874. anInt1085 = l1;
  875. activeInterfaceType = 2;
  876. anInt1087 = super.saveClickX;
  877. anInt1088 = super.saveClickY;
  878. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  879. activeInterfaceType = 1;
  880. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  881. activeInterfaceType = 3;
  882. return;
  883. }
  884. }
  885. }
  886. if (j == 1
  887. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  888. && menuActionRow > 2)
  889. j = 2;
  890. if (j == 1 && menuActionRow > 0)
  891. doAction(menuActionRow - 1);
  892. if (j == 2 && menuActionRow > 0)
  893. determineMenuSize();
  894. }
  895. }
  896.  
  897. public static int totalRead = 0;
  898.  
  899. public static String getFileNameWithoutExtension(String fileName) {
  900. File tmpFile = new File(fileName);
  901. tmpFile.getName();
  902. int whereDot = tmpFile.getName().lastIndexOf('.');
  903. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  904. return tmpFile.getName().substring(0, whereDot);
  905. }
  906. return "";
  907. }
  908.  
  909. public void preloadModels() {
  910. File file = new File(SignLink.findcachedir()+"./Raw/");
  911. File[] fileArray = file.listFiles();
  912. for (int y = 0; y < fileArray.length; y++) {
  913. String s = fileArray[y].getName();
  914. byte[] buffer = ReadFile(SignLink.findcachedir()+"./Raw/" + s);
  915. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  916. }
  917. }
  918.  
  919. public static final byte[] ReadFile(String s) {
  920. try {
  921. byte abyte0[];
  922. File file = new File(s);
  923. int i = (int) file.length();
  924. abyte0 = new byte[i];
  925. DataInputStream datainputstream = new DataInputStream(
  926. new BufferedInputStream(new FileInputStream(s)));
  927. datainputstream.readFully(abyte0, 0, i);
  928. datainputstream.close();
  929. totalRead++;
  930. return abyte0;
  931. } catch (Exception e) {
  932. System.out.println((new StringBuilder()).append("Read Error: ")
  933. .append(s).toString());
  934. return null;
  935. }
  936. }
  937.  
  938. public void addModels() {
  939. for (int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  940. byte[] abyte0 = getModel(ModelIndex);
  941. if (abyte0 != null && abyte0.length > 0) {
  942. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  943. }
  944. }
  945. }
  946.  
  947. public byte[] getModel(int Index) {
  948. try {
  949. File Model = new File(SignLink.findcachedir() + "./pModels/"
  950. + Index + ".gz");
  951. byte[] aByte = new byte[(int) Model.length()];
  952. FileInputStream fis = new FileInputStream(Model);
  953. fis.read(aByte);
  954. System.out.println("" + Index + " aByte = [" + aByte + "]!");
  955. fis.close();
  956. return aByte;
  957. } catch (Exception e) {
  958. return null;
  959. }
  960. }
  961.  
  962. public void addMaps() {
  963. for (int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  964. byte[] abyte0 = getMaps(MapIndex);
  965. if (abyte0 != null && abyte0.length > 0) {
  966. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  967. System.out.println("Maps Added");
  968. }
  969. }
  970. }
  971.  
  972. public byte[] getMaps(int Index) {
  973. try {
  974. File Map = new File(SignLink.findcachedir() + "./pMaps/" + Index
  975. + ".gz");
  976. byte[] aByte = new byte[(int) Map.length()];
  977. FileInputStream fis = new FileInputStream(Map);
  978. fis.read(aByte);
  979. pushMessage("aByte = [" + aByte + "]!", 0, "");
  980. fis.close();
  981. return aByte;
  982. } catch (Exception e) {
  983. return null;
  984. }
  985. }
  986.  
  987. public void saveMidi(boolean flag, byte abyte0[]) {
  988. SignLink.midifade = flag ? 1 : 0;
  989. SignLink.midisave(abyte0, abyte0.length);
  990. }
  991.  
  992. public int positions[] = new int[2000];
  993. public int landScapes[] = new int[2000];
  994. public int objects[] = new int[2000];
  995.  
  996. public final void method22() {
  997. try {
  998. anInt985 = -1;
  999. aClass19_1056.removeAll();
  1000. aClass19_1013.removeAll();
  1001. // Rasterizer.method366();
  1002. unlinkMRUNodes();
  1003. worldController.initToNull();
  1004.  
  1005. System.gc();
  1006. for (int i = 0; i < 4; i++)
  1007. aClass11Array1230[i].method210();
  1008.  
  1009. for (int l = 0; l < 4; l++) {
  1010. for (int k1 = 0; k1 < 104; k1++) {
  1011. for (int j2 = 0; j2 < 104; j2++)
  1012. byteGroundArray[l][k1][j2] = 0;
  1013.  
  1014. }
  1015.  
  1016. }
  1017.  
  1018. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  1019. intGroundArray);
  1020.  
  1021. int k2 = aByteArrayArray1183.length;
  1022.  
  1023. int k18 = 62;
  1024. for (int A = 0; A < k2; A++)
  1025. for (int B = 0; B < 2000; B++)
  1026. if (anIntArray1234[A] == positions[B]) {
  1027. anIntArray1235[A] = landScapes[B];
  1028. anIntArray1236[A] = objects[B];
  1029. }
  1030.  
  1031. stream.createFrame(0);
  1032.  
  1033. if (!aBoolean1159) {
  1034. for (int i3 = 0; i3 < k2; i3++) {
  1035. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1036. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1037.  
  1038. byte abyte0[] = aByteArrayArray1183[i3];
  1039. if (FileOperations
  1040. .FileExists("./.ss_474/Null.map/mapsFloor/"
  1041. + anIntArray1235[i3] + ".dat"))
  1042. abyte0 = FileOperations
  1043. .ReadFile("./.ss_474/Null.map/mapsFloor/"
  1044. + anIntArray1235[i3] + ".dat");
  1045.  
  1046. if (abyte0 != null)
  1047. // objectManager.method180(abyte0, k5, i4, (anInt1069 -
  1048. // 6) * 8, (anInt1070 - 6) * 8, (byte)4,
  1049. // aClass11Array1230);
  1050. objectManager.method180(abyte0, k5, i4,
  1051. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  1052. aClass11Array1230);
  1053. }
  1054.  
  1055. for (int j4 = 0; j4 < k2; j4++) {
  1056. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1057. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1058. byte abyte2[] = aByteArrayArray1183[j4];
  1059. if (abyte2 == null && anInt1070 < 800)
  1060. // ObjectManager.method174(k7, 64, 0, 64, l5);
  1061. objectManager.method174(k7, 64, 64, l5);
  1062. }
  1063.  
  1064. anInt1097++;
  1065. if (anInt1097 > 160) {
  1066. anInt1097 = 0;
  1067. stream.createFrame(238);
  1068. stream.writeWordBigEndian(96);
  1069.  
  1070. }
  1071. stream.createFrame(0);
  1072.  
  1073. for (int i6 = 0; i6 < k2; i6++) {
  1074. byte abyte1[] = aByteArrayArray1247[i6];
  1075. if (FileOperations
  1076. .FileExists("./.ss_474/Null.map/spawnObject/"
  1077. + anIntArray1236[i6] + ".dat"))
  1078. abyte1 = FileOperations
  1079. .ReadFile("./.ss_474/Null.map/spawnObject/"
  1080. + anIntArray1236[i6] + ".dat");
  1081. if (abyte1 != null) {
  1082. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1083. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1084. // ObjectManager.method190(l8, aClass11Array1230, k9, 7,
  1085. // aClass25_946, abyte1);
  1086. objectManager.method190(l8, aClass11Array1230, k9,
  1087. worldController, abyte1);
  1088. }
  1089. }
  1090.  
  1091. }
  1092. if (aBoolean1159) {
  1093. for (int j3 = 0; j3 < 4; j3++) {
  1094. for (int k4 = 0; k4 < 13; k4++) {
  1095. for (int j6 = 0; j6 < 13; j6++) {
  1096. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1097. if (l7 != -1) {
  1098. int i9 = l7 >> 24 & 3;
  1099. int l9 = l7 >> 1 & 3;
  1100. int j10 = l7 >> 14 & 0x3ff;
  1101. int l10 = l7 >> 3 & 0x7ff;
  1102. int j11 = (j10 / 8 << 8) + l10 / 8;
  1103. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1104. if (anIntArray1234[l11] != j11
  1105. || aByteArrayArray1183[l11] == null)
  1106. continue;
  1107. // ObjectManager.method179(i9, l9,
  1108. // aClass11Array1230, 9, k4 * 8, (j10 & 7) *
  1109. // 8, aByteArrayArray1183[l11], (l10 & 7) *
  1110. // 8, j3, j6 * 8);
  1111. objectManager.method179(i9, l9,
  1112. aClass11Array1230, k4 * 8,
  1113. (j10 & 7) * 8,
  1114. aByteArrayArray1183[l11],
  1115. (l10 & 7) * 8, j3, j6 * 8);
  1116. break;
  1117. }
  1118.  
  1119. }
  1120. }
  1121.  
  1122. }
  1123.  
  1124. }
  1125.  
  1126. for (int l4 = 0; l4 < 13; l4++) {
  1127. for (int k6 = 0; k6 < 13; k6++) {
  1128. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1129. if (i8 == -1)
  1130. // ObjectManager.method174(k6 * 8, 8, 0, 8, l4 * 8);
  1131. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1132. }
  1133.  
  1134. }
  1135.  
  1136. stream.createFrame(0);
  1137.  
  1138. for (int l6 = 0; l6 < 4; l6++) {
  1139. for (int j8 = 0; j8 < 13; j8++) {
  1140. for (int j9 = 0; j9 < 13; j9++) {
  1141. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1142. if (i10 != -1) {
  1143. int k10 = i10 >> 24 & 3;
  1144. int i11 = i10 >> 1 & 3;
  1145. int k11 = i10 >> 14 & 0x3ff;
  1146. int i12 = i10 >> 3 & 0x7ff;
  1147. int j12 = (k11 / 8 << 8) + i12 / 8;
  1148. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1149. if (anIntArray1234[k12] != j12
  1150. || aByteArrayArray1247[k12] == null)
  1151. continue;
  1152. @SuppressWarnings("unused")
  1153. byte abyte0[] = aByteArrayArray1247[k12];
  1154. if (FileOperations
  1155. .FileExists("./Cache/FloorMaps/"
  1156. + anIntArray1235[k12]
  1157. + ".dat"))
  1158. abyte0 = FileOperations
  1159. .ReadFile(SignLink
  1160. .findcachedir()
  1161. + "FloorMaps/"
  1162. + anIntArray1235[k12]
  1163. + ".dat");
  1164. // ObjectManager.method183(aClass11Array1230,
  1165. // aClass25_946, k10, j8 * 8, (i12 & 7) * 8,
  1166. // true, l6, abyte0, (k11 & 7) * 8, i11, j9
  1167. // * 8);
  1168. objectManager.method183(aClass11Array1230,
  1169. worldController, k10, j8 * 8,
  1170. (i12 & 7) * 8, l6,
  1171. aByteArrayArray1247[k12],
  1172. (k11 & 7) * 8, i11, j9 * 8);
  1173. break;
  1174. }
  1175.  
  1176. }
  1177. }
  1178.  
  1179. }
  1180.  
  1181. }
  1182.  
  1183. }
  1184. stream.createFrame(0);
  1185. objectManager.method171(aClass11Array1230, worldController);
  1186. aRSImageProducer_1165.initDrawingArea();
  1187. stream.createFrame(0);
  1188.  
  1189. int k3 = ObjectManager.anInt145;
  1190. if (k3 > plane)
  1191. k3 = plane;
  1192.  
  1193. if (k3 < plane - 1)
  1194. k3 = plane - 1;
  1195. if (lowMem)
  1196.  
  1197. worldController.method275(ObjectManager.anInt145);
  1198. else
  1199. worldController.method275(0);
  1200. for (int i5 = 0; i5 < 104; i5++) {
  1201. for (int i7 = 0; i7 < 104; i7++)
  1202. spawnGroundItem(i5, i7);
  1203.  
  1204. }
  1205.  
  1206. anInt1051++;
  1207. if (anInt1051 > 98) {
  1208. anInt1051 = 0;
  1209. stream.createFrame(150);
  1210.  
  1211. }
  1212. method63();
  1213. } catch (Exception e) {
  1214. e.printStackTrace();
  1215. }
  1216. ObjectDef.mruNodes1.unlinkAll();
  1217.  
  1218. if (super.gameFrame != null) {
  1219. stream.createFrame(210);
  1220.  
  1221. stream.writeDWord(0x3f008edd);
  1222. }
  1223. System.gc();
  1224. //Rasterizer.method367();
  1225. onDemandFetcher.method566();
  1226.  
  1227. int k = (anInt1069 - 6) / 8 - 1;
  1228. int j1 = (anInt1069 + 6) / 8 + 1;
  1229. int i2 = (anInt1070 - 6) / 8 - 1;
  1230. int l2 = (anInt1070 + 6) / 8 + 1;
  1231. if (aBoolean1141) {
  1232. k = 49;
  1233. j1 = 50;
  1234. i2 = 49;
  1235. l2 = 50;
  1236. }
  1237. for (int l3 = k; l3 <= j1; l3++) {
  1238. for (int j5 = i2; j5 <= l2; j5++)
  1239. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1240. int j7 = onDemandFetcher.method562(0, j5, l3);
  1241. if (j7 != -1)
  1242. onDemandFetcher.method560(j7, 3);
  1243. int k8 = onDemandFetcher.method562(1, j5, l3);
  1244. if (k8 != -1)
  1245. onDemandFetcher.method560(k8, 3);
  1246. }
  1247.  
  1248. }
  1249.  
  1250. }
  1251.  
  1252. public void unlinkMRUNodes() {
  1253. ObjectDef.mruNodes1.unlinkAll();
  1254. ObjectDef.mruNodes2.unlinkAll();
  1255. EntityDef.mruNodes.unlinkAll();
  1256. ItemDef.mruNodes2.unlinkAll();
  1257. ItemDef.mruNodes1.unlinkAll();
  1258. Player.mruNodes.unlinkAll();
  1259. SpotAnim.aMRUNodes_415.unlinkAll();
  1260. }
  1261.  
  1262. private void method24(int i)
  1263. {
  1264. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1265. int j = ai.length;
  1266. for(int k = 0; k < j; k++)
  1267. ai[k] = 0;
  1268.  
  1269. for(int l = 1; l < 103; l++)
  1270. {
  1271. int i1 = 24628 + (103 - l) * 512 * 4;
  1272. for(int k1 = 1; k1 < 103; k1++)
  1273. {
  1274. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1275. worldController.method309(ai, i1, i, k1, l);
  1276. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1277. worldController.method309(ai, i1, i + 1, k1, l);
  1278. i1 += 4;
  1279. }
  1280.  
  1281. }
  1282.  
  1283. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1284. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1285. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1286. for(int i2 = 1; i2 < 103; i2++)
  1287. {
  1288. for(int j2 = 1; j2 < 103; j2++)
  1289. {
  1290. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1291. method50(i2, j1, j2, l1, i);
  1292. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1293. method50(i2, j1, j2, l1, i + 1);
  1294. }
  1295.  
  1296. }
  1297.  
  1298. aRSImageProducer_1165.initDrawingArea();
  1299. anInt1071 = 0;
  1300. for(int k2 = 0; k2 < 104; k2++)
  1301. {
  1302. for(int l2 = 0; l2 < 104; l2++)
  1303. {
  1304. int i3 = worldController.fetchGroundDecorationNewUID(plane, k2, l2);
  1305. if(i3 >= 0) {
  1306. int j3 = ObjectDef.forID(i3).anInt746;
  1307.  
  1308. j3 = j3 - 556;
  1309. if (j3 == 5)
  1310. j3 = -1;
  1311. if (j3 == 55)
  1312. j3 = 53;
  1313. if (j3 == 1 || j3 == 7 || j3 == 2 || j3 == 10 || j3 == 9 || j3 == 41 || j3 == 4 || j3 == 8 || j3 == 54 || j3 == 73 || j3 == 11 || j3 == 69 || j3 == 57)
  1314. j3++;
  1315. if(j3 >= 0) {
  1316. int k3 = k2;
  1317. int l3 = l2;
  1318. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1319. {
  1320. byte byte0 = 104;
  1321. byte byte1 = 104;
  1322. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1323. for(int i4 = 0; i4 < 10; i4++)
  1324. {
  1325. int j4 = (int)(Math.random() * 4D);
  1326. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1327. k3--;
  1328. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1329. k3++;
  1330. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1331. l3--;
  1332. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1333. l3++;
  1334. }
  1335.  
  1336. }
  1337. if (j3 >= 0 && j3 < 100) {
  1338. //System.out.println("Mapfunction trying to load: "+j3);
  1339. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1340. anIntArray1072[anInt1071] = k3;
  1341. anIntArray1073[anInt1071] = l3;
  1342. anInt1071++;
  1343. }
  1344. }
  1345. }
  1346. }
  1347.  
  1348. }
  1349.  
  1350. }
  1351.  
  1352.  
  1353. public void spawnGroundItem(int i, int j) {
  1354. NodeList class19 = groundArray[plane][i][j];
  1355. if (class19 == null) {
  1356. worldController.method295(plane, i, j);
  1357. return;
  1358. }
  1359. int k = 0xfa0a1f01;
  1360. Object obj = null;
  1361. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1362. .reverseGetNext()) {
  1363. ItemDef itemDef = ItemDef.forID(item.ID);
  1364. int l = itemDef.value;
  1365. if (itemDef.stackable)
  1366. l *= item.anInt1559 + 1;
  1367. // notifyItemSpawn(item, i + baseX, j + baseY);
  1368.  
  1369. if (l > k) {
  1370. k = l;
  1371. obj = item;
  1372. }
  1373. }
  1374.  
  1375. class19.insertTail(((Node) (obj)));
  1376. Object obj1 = null;
  1377. Object obj2 = null;
  1378. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1379. .reverseGetNext()) {
  1380. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1381. && obj1 == null)
  1382. obj1 = class30_sub2_sub4_sub2_1;
  1383. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1384. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1385. && obj2 == null)
  1386. obj2 = class30_sub2_sub4_sub2_1;
  1387. }
  1388.  
  1389. int i1 = i + (j << 7) + 0x60000000;
  1390. worldController.method281(i, i1, ((Animable) (obj1)),
  1391. method42(plane, j * 128 + 64, i * 128 + 64),
  1392. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1393. }
  1394.  
  1395. public void method26(boolean flag) {
  1396. for (int j = 0; j < npcCount; j++) {
  1397. NPC npc = npcArray[npcIndices[j]];
  1398. int k = 0x20000000 + (npcIndices[j] << 14);
  1399. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1400. continue;
  1401. int l = npc.x >> 7;
  1402. int i1 = npc.y >> 7;
  1403. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1404. continue;
  1405. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1406. && (npc.y & 0x7f) == 64) {
  1407. if (anIntArrayArray929[l][i1] == anInt1265)
  1408. continue;
  1409. anIntArrayArray929[l][i1] = anInt1265;
  1410. }
  1411. if (!npc.desc.aBoolean84)
  1412. k += 0x80000000;
  1413. worldController
  1414. .method285(plane, npc.anInt1552,
  1415. method42(plane, npc.y, npc.x), k, npc.y,
  1416. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1417. npc.aBoolean1541);
  1418. }
  1419. }
  1420.  
  1421. public boolean replayWave() {
  1422. return SignLink.wavereplay();
  1423. }
  1424.  
  1425. public void loadError() {
  1426. String s = "ondemand";// was a constant parameter
  1427. System.out.println(s);
  1428. try {
  1429. getAppletContext().showDocument(
  1430. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1431. } catch (Exception exception) {
  1432. exception.printStackTrace();
  1433. }
  1434. do
  1435. try {
  1436. Thread.sleep(1000L);
  1437. } catch (Exception _ex) {
  1438. }
  1439. while (true);
  1440. }
  1441.  
  1442. public void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1443. {
  1444. if(class9 == null){
  1445. return;
  1446. }
  1447. if(class9.type != 0 || class9.children == null || class9.interfaceShown)
  1448. return;
  1449. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1450. return;
  1451. int k1 = class9.children.length;
  1452. for(int l1 = 0; l1 < k1; l1++)
  1453. {
  1454. int i2 = class9.childX[l1] + i;
  1455. int j2 = (class9.childY[l1] + l) - j1;
  1456. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1457. if (class9_1 == null) {
  1458. break;
  1459. }
  1460.  
  1461. /*if(class9_1.id >= 205 && class9_1.id <= 205+25)
  1462. class9_1.type = 9;*/
  1463.  
  1464. i2 += class9_1.anInt263;
  1465. j2 += class9_1.anInt265;
  1466. if((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1467. if(class9_1.hoverType >= 0)
  1468. anInt886 = class9_1.hoverType;
  1469. else
  1470. anInt886 = class9_1.id;
  1471.  
  1472. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1473. anInt1315 = class9_1.id;
  1474. }
  1475.  
  1476. if (class9_1.type == 9 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1477. anInt1315 = class9_1.id;
  1478. }
  1479. if (class9_1.type == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1480. hoverId = class9_1.id;
  1481. }
  1482. if(class9_1.type == 0)
  1483. {
  1484. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1485. if(class9_1.scrollMax > class9_1.height)
  1486. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1487. } else
  1488. {
  1489. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1490. {
  1491. boolean flag = false;
  1492. if(class9_1.contentType != 0)
  1493. flag = buildFriendsListMenu(class9_1);
  1494. if(!flag)
  1495. {
  1496. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1497. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1498. menuActionName[menuActionRow] = class9_1.tooltip + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1499. } else {
  1500. menuActionName[menuActionRow] = class9_1.tooltip;
  1501. }
  1502. menuActionIds[menuActionRow] = 315;
  1503. menuActionCmd3[menuActionRow] = class9_1.id;
  1504. menuActionRow++;
  1505. }
  1506. }
  1507. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1508. {
  1509. String s = class9_1.selectedActionName;
  1510. if(s.indexOf(" ") != -1)
  1511. s = s.substring(0, s.indexOf(" "));
  1512. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1513. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1514. } else {
  1515. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1516. }
  1517. menuActionIds[menuActionRow] = 626;
  1518. menuActionCmd3[menuActionRow] = class9_1.id;
  1519. menuActionRow++;
  1520. }
  1521. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1522. {
  1523. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1524. menuActionName[menuActionRow] = "Close @gre@(@whi@" + class9_1.id + "@gre@)";
  1525. } else {
  1526. menuActionName[menuActionRow] = "Close";
  1527. }
  1528. menuActionIds[menuActionRow] = 200;
  1529. menuActionCmd3[menuActionRow] = class9_1.id;
  1530. menuActionRow++;
  1531. }
  1532. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1533. {
  1534. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1535. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1536. menuActionName[menuActionRow] = class9_1.tooltip + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1537. } else {
  1538. menuActionName[menuActionRow] = class9_1.tooltip;
  1539. }
  1540. menuActionIds[menuActionRow] = 169;
  1541. menuActionCmd3[menuActionRow] = class9_1.id;
  1542. menuActionRow++;
  1543. if (class9_1.hoverText != null) {
  1544. // drawHoverBox(k, l, class9_1.hoverText);
  1545. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1546. }
  1547. }
  1548. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1549. {
  1550. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1551. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1552. menuActionName[menuActionRow] = class9_1.tooltip + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1553. } else {
  1554. menuActionName[menuActionRow] = class9_1.tooltip;
  1555. }
  1556. menuActionIds[menuActionRow] = 646;
  1557. menuActionCmd3[menuActionRow] = class9_1.id;
  1558. menuActionRow++;
  1559. }
  1560. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1561. {
  1562. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1563. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1564. menuActionName[menuActionRow] = class9_1.tooltip + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1565. } else {
  1566. menuActionName[menuActionRow] = class9_1.tooltip;
  1567. }
  1568. menuActionIds[menuActionRow] = 679;
  1569. menuActionCmd3[menuActionRow] = class9_1.id;
  1570. menuActionRow++;
  1571. }
  1572. if(class9_1.type == 2)
  1573. {
  1574. int k2 = 0;
  1575. for(int l2 = 0; l2 < class9_1.height; l2++)
  1576. {
  1577. for(int i3 = 0; i3 < class9_1.width; i3++)
  1578. {
  1579. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1580. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1581. if(k2 < 20)
  1582. {
  1583. j3 += class9_1.spritesX[k2];
  1584. k3 += class9_1.spritesY[k2];
  1585. }
  1586. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1587. {
  1588. mouseInvInterfaceIndex = k2;
  1589. lastActiveInvInterface = class9_1.id;
  1590. if(class9_1.inv[k2] > 0)
  1591. {
  1592. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1593. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1594. {
  1595. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1596. {
  1597.  
  1598. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1599. menuActionIds[menuActionRow] = 870;
  1600. menuActionCmd1[menuActionRow] = itemDef.id;
  1601. menuActionCmd2[menuActionRow] = k2;
  1602. menuActionCmd3[menuActionRow] = class9_1.id;
  1603. menuActionRow++;
  1604. }
  1605. } else
  1606. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1607. {
  1608. if((spellUsableOn & 0x10) == 16)
  1609. {
  1610. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1611. menuActionIds[menuActionRow] = 543;
  1612. menuActionCmd1[menuActionRow] = itemDef.id;
  1613. menuActionCmd2[menuActionRow] = k2;
  1614. menuActionCmd3[menuActionRow] = class9_1.id;
  1615. menuActionRow++;
  1616. }
  1617. } else
  1618. {
  1619. if(class9_1.isInventoryInterface)
  1620. {
  1621. for(int l3 = 4; l3 >= 3; l3--)
  1622. if(itemDef.itemActions != null && itemDef.itemActions[l3] != null)
  1623. {
  1624. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1625. if(l3 == 3)
  1626. menuActionIds[menuActionRow] = 493;
  1627. if(l3 == 4)
  1628. menuActionIds[menuActionRow] = 847;
  1629. menuActionCmd1[menuActionRow] = itemDef.id;
  1630. menuActionCmd2[menuActionRow] = k2;
  1631. menuActionCmd3[menuActionRow] = class9_1.id;
  1632. menuActionRow++;
  1633. } else
  1634. if(l3 == 4)
  1635. {
  1636. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1637. menuActionIds[menuActionRow] = 847;
  1638. menuActionCmd1[menuActionRow] = itemDef.id;
  1639. menuActionCmd2[menuActionRow] = k2;
  1640. menuActionCmd3[menuActionRow] = class9_1.id;
  1641. menuActionRow++;
  1642. }
  1643.  
  1644. }
  1645. if(class9_1.usableItemInterface)
  1646. {
  1647. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1648. menuActionIds[menuActionRow] = 447;
  1649. menuActionCmd1[menuActionRow] = itemDef.id;
  1650. //k2 = inventory spot
  1651. //System.out.println(k2);
  1652. menuActionCmd2[menuActionRow] = k2;
  1653. menuActionCmd3[menuActionRow] = class9_1.id;
  1654. menuActionRow++;
  1655. }
  1656. if(class9_1.isInventoryInterface && itemDef.itemActions != null)
  1657. {
  1658. for(int i4 = 2; i4 >= 0; i4--)
  1659. if(itemDef.itemActions[i4] != null)
  1660. {
  1661. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1662. if(i4 == 0)
  1663. menuActionIds[menuActionRow] = 74;
  1664. if(i4 == 1)
  1665. menuActionIds[menuActionRow] = 454;
  1666. if(i4 == 2)
  1667. menuActionIds[menuActionRow] = 539;
  1668. menuActionCmd1[menuActionRow] = itemDef.id;
  1669. menuActionCmd2[menuActionRow] = k2;
  1670. menuActionCmd3[menuActionRow] = class9_1.id;
  1671. menuActionRow++;
  1672. }
  1673.  
  1674. }
  1675. if (class9_1.actions != null) {
  1676. for (int j4 = 5; j4 >= 0; j4--)
  1677. if (class9_1.actions[j4] != null) {
  1678. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1679. if (j4 == 0)
  1680. menuActionIds[menuActionRow] = 632;
  1681. if (j4 == 1)
  1682. menuActionIds[menuActionRow] = 78;
  1683. if (j4 == 2)
  1684. menuActionIds[menuActionRow] = 867;
  1685. if (j4 == 3)
  1686. menuActionIds[menuActionRow] = 431;
  1687. if (j4 == 4)
  1688. menuActionIds[menuActionRow] = 53;
  1689. if (j4 == 5)
  1690. menuActionIds[menuActionRow] = 54;
  1691. menuActionCmd1[menuActionRow] = itemDef.id;
  1692. menuActionCmd2[menuActionRow] = k2;
  1693. menuActionCmd3[menuActionRow] = class9_1.id;
  1694. menuActionRow++;
  1695. }
  1696.  
  1697. }
  1698. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1699. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1700. } else {
  1701. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1702. }
  1703. menuActionIds[menuActionRow] = 1125;
  1704. menuActionCmd1[menuActionRow] = itemDef.id;
  1705. menuActionCmd2[menuActionRow] = k2;
  1706. menuActionCmd3[menuActionRow] = class9_1.id;
  1707. menuActionRow++;
  1708. }
  1709. }
  1710. }
  1711. k2++;
  1712. }
  1713.  
  1714. }
  1715.  
  1716. }
  1717. }
  1718. }
  1719. }
  1720.  
  1721. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1722. scrollBar1.drawSprite(i1, l);
  1723. scrollBar2.drawSprite(i1, (l + j) - 16);
  1724. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1725. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1726. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1727. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1728. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1729. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1730. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1731. int k1 = ((j - 32) * j) / j1;
  1732. if (k1 < 8)
  1733. k1 = 8;
  1734. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1735. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1736. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1737. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1738. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1739. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1740. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1741. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1742. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1743. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1744. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1745. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1746. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1747. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1748. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1749. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1750. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1751. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1752. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1753. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1754. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1755. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1756. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1757. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1758. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1759. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1760. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1761. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1762. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1763. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1764. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1765. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1766. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1767. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1768. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1769. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1770. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1771. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1772. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1773. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1774. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1775. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1776. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1777. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1778. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1779. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1780. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1781. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1782. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1783. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1784. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1785. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1786. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1787. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1788. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1789. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1790. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1791. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1792. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1793. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1794. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1795. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1796. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1797. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1798. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1799. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1800. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1801. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1802. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1803. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1804. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1805. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1806. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1807. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1808. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1809. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1810. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1811. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1812. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1813. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1814. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1815. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1816. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1817. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1818. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1819. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1820. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1821. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1822. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1823. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1824. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1825. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1826. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1827. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1828. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1829. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1830. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1831. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1832. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1833. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1834. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1835. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1836. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1837. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1838. }
  1839.  
  1840. public void updateNPCs(Stream stream, int i) {
  1841. anInt839 = 0;
  1842. anInt893 = 0;
  1843. method139(stream);
  1844. method46(i, stream);
  1845. method86(stream);
  1846. for (int k = 0; k < anInt839; k++) {
  1847. int l = anIntArray840[k];
  1848. if (npcArray[l].anInt1537 != loopCycle) {
  1849. npcArray[l].desc = null;
  1850. npcArray[l] = null;
  1851. }
  1852. }
  1853.  
  1854. if (stream.currentOffset != i) {
  1855. SignLink.reporterror(myUsername
  1856. + " size mismatch in getnpcpos - pos:"
  1857. + stream.currentOffset + " psize:" + i);
  1858. throw new RuntimeException("eek");
  1859. }
  1860. for (int i1 = 0; i1 < npcCount; i1++)
  1861. if (npcArray[npcIndices[i1]] == null) {
  1862. SignLink.reporterror(myUsername
  1863. + " null entry in npc list - pos:" + i1 + " size:"
  1864. + npcCount);
  1865. throw new RuntimeException("eek");
  1866. }
  1867.  
  1868. }
  1869.  
  1870. public int cButtonHPos;
  1871. public int cButtonHCPos;
  1872. public int cButtonCPos;
  1873. public int previousSong;
  1874.  
  1875. private void processChatModeClick() {
  1876. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1877. cButtonHPos = 0;
  1878. aBoolean1233 = true;
  1879. inputTaken = true;
  1880. } else if (super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  1881. cButtonHPos = 1;
  1882. aBoolean1233 = true;
  1883. inputTaken = true;
  1884. } else if (super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  1885. cButtonHPos = 2;
  1886. aBoolean1233 = true;
  1887. inputTaken = true;
  1888. } else if (super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  1889. cButtonHPos = 3;
  1890. aBoolean1233 = true;
  1891. inputTaken = true;
  1892. } else if (super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  1893. cButtonHPos = 4;
  1894. aBoolean1233 = true;
  1895. inputTaken = true;
  1896. } else if (super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  1897. cButtonHPos = 5;
  1898. aBoolean1233 = true;
  1899. inputTaken = true;
  1900. } else if (super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  1901. cButtonHPos = 7;
  1902. aBoolean1233 = true;
  1903. inputTaken = true;
  1904. } else if (super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  1905. cButtonHPos = 6;
  1906. aBoolean1233 = true;
  1907. inputTaken = true;
  1908. } else {
  1909. cButtonHPos = -1;
  1910. aBoolean1233 = true;
  1911. inputTaken = true;
  1912. }
  1913. if (super.clickMode3 == 1) {
  1914. if (super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1915. cButtonCPos = 0;
  1916. chatTypeView = 0;
  1917. aBoolean1233 = true;
  1918. inputTaken = true;
  1919. } else if (super.saveClickX >= 62 && super.saveClickX <= 117 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1920. cButtonCPos = 1;
  1921. chatTypeView = 5;
  1922. aBoolean1233 = true;
  1923. inputTaken = true;
  1924. } else if (super.saveClickX >= 119 && super.saveClickX <= 174 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1925. cButtonCPos = 2;
  1926. chatTypeView = 1;
  1927. aBoolean1233 = true;
  1928. inputTaken = true;
  1929. } else if (super.saveClickX >= 176 && super.saveClickX <= 231 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1930. cButtonCPos = 3;
  1931. chatTypeView = 2;
  1932. aBoolean1233 = true;
  1933. inputTaken = true;
  1934. } else if (super.saveClickX >= 233 && super.saveClickX <= 288 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1935. cButtonCPos = 4;
  1936. chatTypeView = 11;
  1937. aBoolean1233 = true;
  1938. inputTaken = true;
  1939. } else if (super.saveClickX >= 290 && super.saveClickX <= 345 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1940. cButtonCPos = 5;
  1941. chatTypeView = 3;
  1942. aBoolean1233 = true;
  1943. inputTaken = true;
  1944. } else if (super.saveClickX >= 347 && super.saveClickX <= 402 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1945. cButtonCPos = 6;
  1946. aBoolean1233 = true;
  1947. inputTaken = true;
  1948. } else if (super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1949. if (openInterfaceID == -1) {
  1950. clearTopInterfaces();
  1951. reportAbuseInput = "";
  1952. canMute = false;
  1953. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1954. if (RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600) continue;
  1955. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1956. break;
  1957. }
  1958. } else {
  1959. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1960. }
  1961. }
  1962. }
  1963. }
  1964.  
  1965. public void method33(int i) {
  1966. int j = Varp.cache[i].anInt709;
  1967. if (j == 0)
  1968. return;
  1969. int k = variousSettings[i];
  1970. if (j == 1) {
  1971. if(k == 1)
  1972. Rasterizer.calculatePalette(0.9F);
  1973. if (k == 2)
  1974. Rasterizer.calculatePalette(0.8F);
  1975. if (k == 3)
  1976. Rasterizer.calculatePalette(0.7F);
  1977. if (k == 4)
  1978. Rasterizer.calculatePalette(0.6F);
  1979. ItemDef.mruNodes1.unlinkAll();
  1980. welcomeScreenRaised = true;
  1981. }
  1982. if (j == 3) {
  1983. boolean music = musicEnabled;
  1984. if (k == 0) {
  1985. adjustVolume(musicEnabled, 500);
  1986. musicEnabled = true;
  1987. }
  1988. if (k == 1) {
  1989. adjustVolume(musicEnabled, 300);
  1990. musicEnabled = true;
  1991. }
  1992. if (k == 2) {
  1993. adjustVolume(musicEnabled, 100);
  1994. musicEnabled = true;
  1995. }
  1996. if (k == 3) {
  1997. adjustVolume(musicEnabled, 0);
  1998. musicEnabled = true;
  1999. }
  2000. if (k == 4) {
  2001. musicEnabled = false;
  2002. }
  2003. if (musicEnabled != music) {
  2004. if (musicEnabled) {
  2005. nextSong = currentSong;
  2006. songChanging = true;
  2007. onDemandFetcher.method558(2, nextSong);
  2008. } else {
  2009. stopMidi();
  2010. }
  2011. previousSong = 0;
  2012. }
  2013. }
  2014. if (j == 4) {
  2015. SoundPlayer.setVolume(k);
  2016. if (k == 0) {
  2017. aBoolean848 = true;
  2018. setWaveVolume(0);
  2019. }
  2020. if (k == 1) {
  2021. aBoolean848 = true;
  2022. setWaveVolume(-400);
  2023. }
  2024. if (k == 2) {
  2025. aBoolean848 = true;
  2026. setWaveVolume(-800);
  2027. }
  2028. if (k == 3) {
  2029. aBoolean848 = true;
  2030. setWaveVolume(-1200);
  2031. }
  2032. if (k == 4) {
  2033. aBoolean848 = false;
  2034. }
  2035. }
  2036. if (j == 5)
  2037. anInt1253 = k;
  2038. if (j == 6)
  2039. anInt1249 = k;
  2040. if (j == 8) {
  2041. splitpublicChat = k;
  2042. inputTaken = true;
  2043. }
  2044. if (j == 9)
  2045. anInt913 = k;
  2046. }
  2047.  
  2048. public void updateEntities() {
  2049. try {
  2050. int anInt974 = 0;
  2051. for (int j = -1; j < playerCount + npcCount; j++) {
  2052. Object obj;
  2053. if (j == -1)
  2054. obj = myPlayer;
  2055. else if (j < playerCount)
  2056. obj = playerArray[playerIndices[j]];
  2057. else
  2058. obj = npcArray[npcIndices[j - playerCount]];
  2059. if (obj == null || !((Entity) (obj)).isVisible())
  2060. continue;
  2061. if (obj instanceof NPC) {
  2062. EntityDef entityDef = ((NPC) obj).desc;
  2063. if (entityDef.childrenIDs != null)
  2064. entityDef = entityDef.method161();
  2065. if (entityDef == null)
  2066. continue;
  2067. }
  2068. if (j < playerCount) {
  2069. int l = 30;
  2070. Player player = (Player) obj;
  2071. if (player.headIcon >= 0) {
  2072. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2073. if (spriteDrawX > -1) {
  2074. if (player.skullIcon < 2) {
  2075. skullIcons[player.skullIcon].drawSprite( spriteDrawX - 12, spriteDrawY - l);
  2076. l += 25;
  2077. }
  2078. if (player.headIcon < 18) {
  2079. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2080. l += 18;
  2081. }
  2082. }
  2083. }
  2084. if (j >= 0 && anInt855 == 10
  2085. && anInt933 == playerIndices[j]) {
  2086. npcScreenPos(((Entity) (obj)),
  2087. ((Entity) (obj)).height + 15);
  2088. if (spriteDrawX > -1)
  2089. headIconsHint[player.hintIcon].drawSprite(
  2090. spriteDrawX - 12, spriteDrawY - l);
  2091. }
  2092. } else {
  2093. EntityDef entityDef_1 = ((NPC) obj).desc;
  2094. if (entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2095. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2096. if (spriteDrawX > -1)
  2097. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2098. }
  2099. if (anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2100. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2101. if (spriteDrawX > -1)
  2102. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2103. }
  2104. }
  2105. if (((Entity) (obj)).textSpoken != null
  2106. && (j >= playerCount || publicChatMode == 0
  2107. || publicChatMode == 3 || publicChatMode == 1
  2108. && isFriendOrSelf(((Player) obj).name))) {
  2109. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2110. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2111. anIntArray979[anInt974] = chatTextDrawingArea
  2112. .method384(((Entity) (obj)).textSpoken) / 2;
  2113. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2114. anIntArray976[anInt974] = spriteDrawX;
  2115. anIntArray977[anInt974] = spriteDrawY;
  2116. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2117. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2118. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2119. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2120. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  2121. && ((Entity) (obj)).anInt1531 <= 3) {
  2122. anIntArray978[anInt974] += 10;
  2123. anIntArray977[anInt974] += 5;
  2124. }
  2125. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2126. anIntArray979[anInt974] = 60;
  2127. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2128. anIntArray978[anInt974] += 5;
  2129. }
  2130. }
  2131. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  2132. {
  2133. try{
  2134. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2135. if(spriteDrawX > -1)
  2136. {
  2137. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2138. if(i1 > 30)
  2139. i1 = 30;
  2140. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  2141. if (HpPercent > 56)
  2142. HpPercent = 56;
  2143. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  2144. HPBarFull = new Sprite(SignLink.findcachedir() + "Sprites/Player/HP 0.png", HpPercent, 7);
  2145. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  2146. }
  2147. }catch(Exception e){ }
  2148. }
  2149. for(int j1 = 0; j1 < 4; j1++)
  2150. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  2151. {
  2152. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2153. if(spriteDrawX > -1)
  2154. {
  2155. switch (j1) {
  2156. case 1:
  2157. spriteDrawY += 20;
  2158. break;
  2159. case 2:
  2160. spriteDrawY += 40;
  2161. break;
  2162. case 3:
  2163. spriteDrawY += 60;
  2164. break;
  2165. case 4:
  2166. spriteDrawY += 80;
  2167. break;
  2168. case 5:
  2169. spriteDrawY += 100;
  2170. break;
  2171. case 6:
  2172. spriteDrawY += 120;
  2173. break;
  2174. }
  2175. Entity e = ((Entity) (obj));
  2176. if (e.hitmarkMove[j1] > -30)
  2177. e.hitmarkMove[j1]--;
  2178. if (e.hitmarkMove[j1] < -26)
  2179. e.hitmarkTrans[j1] -= 5;
  2180. hitmarkDraw(String.valueOf(e.hitArray[j1]).length(), e.hitMarkTypes[j1], e.hitIcon[j1], e.hitArray[j1], e.hitmarkMove[j1], e.hitmarkTrans[j1]);
  2181. }
  2182. }
  2183. }
  2184. for (int k = 0; k < anInt974; k++) {
  2185. int k1 = anIntArray976[k];
  2186. int l1 = anIntArray977[k];
  2187. int j2 = anIntArray979[k];
  2188. int k2 = anIntArray978[k];
  2189. boolean flag = true;
  2190. while (flag) {
  2191. flag = false;
  2192. for (int l2 = 0; l2 < k; l2++)
  2193. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2]
  2194. && l1 - k2 < anIntArray977[l2] + 2
  2195. && k1 - j2 < anIntArray976[l2]
  2196. + anIntArray979[l2]
  2197. && k1 + j2 > anIntArray976[l2]
  2198. - anIntArray979[l2]
  2199. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  2200. l1 = anIntArray977[l2] - anIntArray978[l2];
  2201. flag = true;
  2202. }
  2203.  
  2204. }
  2205. spriteDrawX = anIntArray976[k];
  2206. spriteDrawY = anIntArray977[k] = l1;
  2207. String s = aStringArray983[k];
  2208. if (anInt1249 == 0) {
  2209. int i3 = 0xffff00;
  2210. if (anIntArray980[k] < 6)
  2211. i3 = anIntArray965[anIntArray980[k]];
  2212. if (anIntArray980[k] == 6)
  2213. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2214. if (anIntArray980[k] == 7)
  2215. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2216. if (anIntArray980[k] == 8)
  2217. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2218. if (anIntArray980[k] == 9) {
  2219. int j3 = 150 - anIntArray982[k];
  2220. if (j3 < 50)
  2221. i3 = 0xff0000 + 1280 * j3;
  2222. else if (j3 < 100)
  2223. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2224. else if (j3 < 150)
  2225. i3 = 65280 + 5 * (j3 - 100);
  2226. }
  2227. if (anIntArray980[k] == 10) {
  2228. int k3 = 150 - anIntArray982[k];
  2229. if (k3 < 50)
  2230. i3 = 0xff0000 + 5 * k3;
  2231. else if (k3 < 100)
  2232. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2233. else if (k3 < 150)
  2234. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2235. }
  2236. if (anIntArray980[k] == 11) {
  2237. int l3 = 150 - anIntArray982[k];
  2238. if (l3 < 50)
  2239. i3 = 0xffffff - 0x50005 * l3;
  2240. else if (l3 < 100)
  2241. i3 = 65280 + 0x50005 * (l3 - 50);
  2242. else if (l3 < 150)
  2243. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2244. }
  2245. if (anIntArray981[k] == 0) {
  2246. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2247. spriteDrawX);
  2248. chatTextDrawingArea.drawText(i3, s, spriteDrawY,
  2249. spriteDrawX);
  2250. }
  2251. if (anIntArray981[k] == 1) {
  2252. chatTextDrawingArea.method386(0, s, spriteDrawX,
  2253. anInt1265, spriteDrawY + 1);
  2254. chatTextDrawingArea.method386(i3, s, spriteDrawX,
  2255. anInt1265, spriteDrawY);
  2256. }
  2257. if (anIntArray981[k] == 2) {
  2258. chatTextDrawingArea.method387(spriteDrawX, s,
  2259. anInt1265, spriteDrawY + 1, 0);
  2260. chatTextDrawingArea.method387(spriteDrawX, s,
  2261. anInt1265, spriteDrawY, i3);
  2262. }
  2263. if (anIntArray981[k] == 3) {
  2264. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2265. s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2266. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2267. s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2268. }
  2269. if (anIntArray981[k] == 4) {
  2270. int i4 = chatTextDrawingArea.method384(s);
  2271. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2272. DrawingArea.setDrawingArea(334, spriteDrawX - 50,
  2273. spriteDrawX + 50, 0);
  2274. chatTextDrawingArea.method385(0, s, spriteDrawY + 1,
  2275. (spriteDrawX + 50) - k4);
  2276. chatTextDrawingArea.method385(i3, s, spriteDrawY,
  2277. (spriteDrawX + 50) - k4);
  2278. DrawingArea.defaultDrawingAreaSize();
  2279. }
  2280. if (anIntArray981[k] == 5) {
  2281. int j4 = 150 - anIntArray982[k];
  2282. int l4 = 0;
  2283. if (j4 < 25)
  2284. l4 = j4 - 25;
  2285. else if (j4 > 125)
  2286. l4 = j4 - 125;
  2287. DrawingArea
  2288. .setDrawingArea(spriteDrawY + 5, 0, 512,
  2289. spriteDrawY
  2290. - chatTextDrawingArea.anInt1497
  2291. - 1);
  2292. chatTextDrawingArea.drawText(0, s,
  2293. spriteDrawY + 1 + l4, spriteDrawX);
  2294. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4,
  2295. spriteDrawX);
  2296. DrawingArea.defaultDrawingAreaSize();
  2297. }
  2298. } else {
  2299. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2300. spriteDrawX);
  2301. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY,
  2302. spriteDrawX);
  2303. }
  2304. }
  2305. } catch (Exception e) {
  2306. }
  2307. }
  2308.  
  2309. public void delFriend(long l) {
  2310. try {
  2311. if (l == 0L)
  2312. return;
  2313. for (int i = 0; i < friendsCount; i++) {
  2314. if (friendsListAsLongs[i] != l)
  2315. continue;
  2316. friendsCount--;
  2317. needDrawTabArea = true;
  2318. for (int j = i; j < friendsCount; j++) {
  2319. friendsList[j] = friendsList[j + 1];
  2320. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2321. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2322. }
  2323.  
  2324. stream.createFrame(215);
  2325. stream.writeQWord(l);
  2326. break;
  2327. }
  2328. } catch (RuntimeException runtimeexception) {
  2329. SignLink.reporterror("18622, " + false + ", " + l + ", "
  2330. + runtimeexception.toString());
  2331. throw new RuntimeException();
  2332. }
  2333. }
  2334.  
  2335. public void drawSideIcons(){
  2336. /* Top sideIcons */
  2337. if(tabInterfaceIDs[0] != -1)//attack
  2338. sideIcons[0].drawSprite(10, 4);
  2339. if(tabInterfaceIDs[1] != -1)//stat
  2340. sideIcons[1].drawSprite(43, 4);
  2341. if(tabInterfaceIDs[2] != -1)//quest
  2342. //sideIcons[2].drawSprite(76, 3);
  2343. customSideIcons[2].drawSprite(82, 8);
  2344. if(tabInterfaceIDs[3] != -1)//inventory
  2345. sideIcons[3].drawSprite(111, 5);
  2346. if(tabInterfaceIDs[4] != -1)//equipment
  2347. sideIcons[4].drawSprite(140, 1);
  2348. if(tabInterfaceIDs[5] != -1)//prayer
  2349. sideIcons[5].drawSprite(174, 1);
  2350. if(tabInterfaceIDs[6] != -1)//magic
  2351. sideIcons[6].drawSprite(208, 4);
  2352. /* Bottom sideIcons */
  2353. if(tabInterfaceIDs[7] != -1)//clan
  2354. sideIcons[7].drawSprite(113, 302);
  2355. if(tabInterfaceIDs[8] != -1)//friends
  2356. sideIcons[8].drawSprite(46, 306);
  2357. if(tabInterfaceIDs[9] != -1)//ignore
  2358. sideIcons[9].drawSprite(79, 306);
  2359. if(tabInterfaceIDs[10] != -1)//logout
  2360. sideIcons[7].drawSprite(113, 302);
  2361. if(tabInterfaceIDs[11] != -1)//options
  2362. sideIcons[11].drawSprite(145, 304);
  2363. if(tabInterfaceIDs[12] != -1)//emotes
  2364. sideIcons[12].drawSprite(181, 302);
  2365. if(tabInterfaceIDs[13] != -1)//music
  2366. customSideIcons[1].drawAdvancedSprite(212, 302);
  2367. if(tabInterfaceIDs[14] != -1)//party tab
  2368. customSideIcons[0].drawAdvancedSprite(10, 306);
  2369. }
  2370.  
  2371. public void drawRedStones() {
  2372. if (tabInterfaceIDs[tabID] != -1) {
  2373. switch (tabID) {
  2374. case 0:
  2375. redStones[0].drawSprite(3, 0);
  2376. break;
  2377. case 1:
  2378. redStones[4].drawSprite(41, 0);
  2379. break;
  2380. case 2:
  2381. redStones[4].drawSprite(74, 0);
  2382. break;
  2383. case 3:
  2384. redStones[4].drawSprite(107, 0);
  2385. break;
  2386. case 4:
  2387. redStones[4].drawSprite(140, 0);
  2388. break;
  2389. case 5:
  2390. redStones[4].drawSprite(173, 0);
  2391. break;
  2392. case 6:
  2393. redStones[1].drawSprite(206, 0);
  2394. break;
  2395. case 7:
  2396. redStones[4].drawSprite(107, 298);
  2397. break;
  2398. case 8:
  2399. redStones[4].drawSprite(41, 298);
  2400. break;
  2401. case 9:
  2402. redStones[4].drawSprite(74, 298);
  2403. break;
  2404. case 11:
  2405. redStones[4].drawSprite(140, 298);
  2406. break;
  2407. case 12:
  2408. redStones[4].drawSprite(173, 298);
  2409. break;
  2410. case 13:
  2411. redStones[3].drawSprite(206, 298);
  2412. break;
  2413. case 14:
  2414. redStones[2].drawSprite(3, 298);
  2415. break;
  2416. }
  2417. }
  2418. }
  2419.  
  2420. public void drawTabArea() {
  2421. aRSImageProducer_1163.initDrawingArea();
  2422. Rasterizer.lineOffsets = anIntArray1181;
  2423. tabArea.drawSprite(0, 0);
  2424. if (invOverlayInterfaceID == -1) {
  2425. drawRedStones();
  2426. drawSideIcons();
  2427. }
  2428. if (invOverlayInterfaceID != -1)
  2429. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2430. else if (tabInterfaceIDs[tabID] != -1)
  2431. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2432. if (menuOpen && menuScreenArea == 1)
  2433. drawMenu();
  2434. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2435. aRSImageProducer_1165.initDrawingArea();
  2436. Rasterizer.lineOffsets = anIntArray1182;
  2437. }
  2438.  
  2439. public void method38() {
  2440. for (int i = -1; i < playerCount; i++) {
  2441. int j;
  2442. if (i == -1)
  2443. j = myPlayerIndex;
  2444. else
  2445. j = playerIndices[i];
  2446. Player player = playerArray[j];
  2447. if (player != null && player.textCycle > 0) {
  2448. player.textCycle--;
  2449. if (player.textCycle == 0)
  2450. player.textSpoken = null;
  2451. }
  2452. }
  2453. for (int k = 0; k < npcCount; k++) {
  2454. int l = npcIndices[k];
  2455. NPC npc = npcArray[l];
  2456. if (npc != null && npc.textCycle > 0) {
  2457. npc.textCycle--;
  2458. if (npc.textCycle == 0)
  2459. npc.textSpoken = null;
  2460. }
  2461. }
  2462. }
  2463.  
  2464. public void calcCameraPos() {
  2465. int i = anInt1098 * 128 + 64;
  2466. int j = anInt1099 * 128 + 64;
  2467. int k = method42(plane, j, i) - anInt1100;
  2468. if (xCameraPos < i) {
  2469. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2470. if (xCameraPos > i)
  2471. xCameraPos = i;
  2472. }
  2473. if (xCameraPos > i) {
  2474. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2475. if (xCameraPos < i)
  2476. xCameraPos = i;
  2477. }
  2478. if (zCameraPos < k) {
  2479. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2480. if (zCameraPos > k)
  2481. zCameraPos = k;
  2482. }
  2483. if (zCameraPos > k) {
  2484. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2485. if (zCameraPos < k)
  2486. zCameraPos = k;
  2487. }
  2488. if (yCameraPos < j) {
  2489. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2490. if (yCameraPos > j)
  2491. yCameraPos = j;
  2492. }
  2493. if (yCameraPos > j) {
  2494. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2495. if (yCameraPos < j)
  2496. yCameraPos = j;
  2497. }
  2498. i = anInt995 * 128 + 64;
  2499. j = anInt996 * 128 + 64;
  2500. k = method42(plane, j, i) - anInt997;
  2501. int l = i - xCameraPos;
  2502. int i1 = k - zCameraPos;
  2503. int j1 = j - yCameraPos;
  2504. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2505. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2506. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2507. if (l1 < 128)
  2508. l1 = 128;
  2509. if (l1 > 383)
  2510. l1 = 383;
  2511. if (yCameraCurve < l1) {
  2512. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2513. if (yCameraCurve > l1)
  2514. yCameraCurve = l1;
  2515. }
  2516. if (yCameraCurve > l1) {
  2517. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2518. if (yCameraCurve < l1)
  2519. yCameraCurve = l1;
  2520. }
  2521. int j2 = i2 - xCameraCurve;
  2522. if (j2 > 1024)
  2523. j2 -= 2048;
  2524. if (j2 < -1024)
  2525. j2 += 2048;
  2526. if (j2 > 0) {
  2527. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2528. xCameraCurve &= 0x7ff;
  2529. }
  2530. if (j2 < 0) {
  2531. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2532. xCameraCurve &= 0x7ff;
  2533. }
  2534. int k2 = i2 - xCameraCurve;
  2535. if (k2 > 1024)
  2536. k2 -= 2048;
  2537. if (k2 < -1024)
  2538. k2 += 2048;
  2539. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2540. xCameraCurve = i2;
  2541. }
  2542.  
  2543. public void drawMenu() {
  2544. int i = menuOffsetX;
  2545. int j = menuOffsetY;
  2546. int k = (int) (menuWidth - (menuWidth * 0.14));
  2547. int l = menuHeight + 1;
  2548. int i1 = 0x112329;
  2549. DrawingArea.method338(j + 2, l - 4, 256, 0x706a5e, k, i);
  2550. DrawingArea.method338(j + 1, l - 2, 256, 0x706a5e, k - 2, i + 1);
  2551. DrawingArea.method338(j, l, 200, 0x706a5e, k - 4, i + 2);
  2552. // Outer Border
  2553. DrawingArea.method338(j + 1, l - 2, 256, 0xffffff, k - 6, i + 3);// 0x2d2822
  2554. DrawingArea.method338(j + 2, l - 4, 256, 0xffffff, k - 4, i + 2);// 0x2d2822
  2555. DrawingArea.method338(j + 3, l - 6, 256, 0xffffff, k - 2, i + 1);// 0x2d2822
  2556. // Menu Fill Side Border
  2557. DrawingArea.method338(j + 19, l - 22, 256, 0x524a3d, k - 4, i + 2);
  2558. DrawingArea.method338(j + 20, l - 22, 256, 0x524a3d, k - 6, i + 3);
  2559. // Menu Fill
  2560. DrawingArea.method335(i1, j + 20, k - 6, l - 23, 240, i + 3);
  2561. // Menu Header
  2562. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x2a291b, j + 2);
  2563. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a261b, j + 3);
  2564. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x252116, j + 4);
  2565. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x211e15, j + 5);
  2566. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1e1b12, j + 6);
  2567. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1a170e, j + 7);
  2568. DrawingArea.fillPixels(i + 2, k - 4, 2, 0x15120b, j + 8);
  2569. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x100d08, j + 10);
  2570. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 11);
  2571. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x080703, j + 12);
  2572. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 13);
  2573. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 14);
  2574. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 15);
  2575. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 16);
  2576. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 17);
  2577. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a291b, j + 18);
  2578. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x564943, j + 19);
  2579. aTextDrawingArea_1271.method385(0xc6b895, "Choose Option", j + 14, i + 3);
  2580. int j1 = super.mouseX;
  2581. int k1 = super.mouseY;
  2582.  
  2583. if (menuScreenArea == 0) {
  2584. j1 -= 4;
  2585. k1 -= 4;
  2586. }
  2587. if (menuScreenArea == 1) {
  2588. j1 -= 519;
  2589. k1 -= 168;
  2590. }
  2591. if (menuScreenArea == 2) {
  2592. j1 -= 17;
  2593. k1 -= 338;
  2594. }
  2595. if (menuScreenArea == 3) {
  2596. j1 -= 515;
  2597. k1 -= 0;
  2598. }
  2599. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2600. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2601. int textY = j + 31 + (menuActionRow - 1 - l1) * 15;
  2602. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2603. DrawingArea.drawRect(15, textY - 11, i + 3, 0x26566C, k - 6);
  2604. aTextDrawingArea_1271.method389(true, i + 3, 0xA79E83, menuActionName[l1], textY);
  2605. }
  2606. }
  2607.  
  2608. public void addFriend(long l) {
  2609. try {
  2610. if (l == 0L)
  2611. return;
  2612. if (friendsCount >= 100 && anInt1046 != 1) {
  2613. pushMessage(
  2614. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2615. 0, "");
  2616. return;
  2617. }
  2618. if (friendsCount >= 200) {
  2619. pushMessage(
  2620. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2621. 0, "");
  2622. return;
  2623. }
  2624. String s = TextClass.fixName(TextClass.nameForLong(l));
  2625. for (int i = 0; i < friendsCount; i++)
  2626. if (friendsListAsLongs[i] == l) {
  2627. pushMessage(s + " is already on your friend list", 0, "");
  2628. return;
  2629. }
  2630. for (int j = 0; j < ignoreCount; j++)
  2631. if (ignoreListAsLongs[j] == l) {
  2632. pushMessage("Please remove " + s
  2633. + " from your ignore list first", 0, "");
  2634. return;
  2635. }
  2636.  
  2637. if (s.equals(myPlayer.name)) {
  2638. return;
  2639. } else {
  2640. friendsList[friendsCount] = s;
  2641. friendsListAsLongs[friendsCount] = l;
  2642. friendsNodeIDs[friendsCount] = 0;
  2643. friendsCount++;
  2644. needDrawTabArea = true;
  2645. stream.createFrame(188);
  2646. stream.writeQWord(l);
  2647. return;
  2648. }
  2649. } catch (RuntimeException runtimeexception) {
  2650. SignLink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  2651. + runtimeexception.toString());
  2652. }
  2653. throw new RuntimeException();
  2654. }
  2655.  
  2656. public int method42(int i, int j, int k) {
  2657. int l = k >> 7;
  2658. int i1 = j >> 7;
  2659. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2660. return 0;
  2661. int j1 = i;
  2662. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2663. j1++;
  2664. int k1 = k & 0x7f;
  2665. int l1 = j & 0x7f;
  2666. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  2667. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2668. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  2669. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2670. return i2 * (128 - l1) + j2 * l1 >> 7;
  2671. }
  2672.  
  2673. public void resetLogout() {
  2674. try {
  2675. if (socketStream != null)
  2676. socketStream.close();
  2677. } catch (Exception _ex) {
  2678. }
  2679. socketStream = null;
  2680. loggedIn = false;
  2681. loginScreenState = 0;
  2682. // myUsername = "";
  2683. // myPassword = "";
  2684. unlinkMRUNodes();
  2685. worldController.initToNull();
  2686. for (int i = 0; i < 4; i++)
  2687. aClass11Array1230[i].method210();
  2688. System.gc();
  2689. stopMidi();
  2690. currentSong = -1;
  2691. nextSong = -1;
  2692. prevSong = 0;
  2693. }
  2694.  
  2695. public void method45() {
  2696. aBoolean1031 = true;
  2697. for (int j = 0; j < 7; j++) {
  2698. anIntArray1065[j] = -1;
  2699. for (int k = 0; k < IDK.length; k++) {
  2700. if (IDK.cache[k].aBoolean662
  2701. || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2702. continue;
  2703. anIntArray1065[j] = k;
  2704. break;
  2705. }
  2706. }
  2707. }
  2708.  
  2709. public void method46(int i, Stream stream) {
  2710. while (stream.bitPosition + 21 < i * 8) {
  2711. int k = stream.readBits(14);
  2712. if (k == 16383)
  2713. break;
  2714. if (npcArray[k] == null)
  2715. npcArray[k] = new NPC();
  2716. NPC npc = npcArray[k];
  2717. npcIndices[npcCount++] = k;
  2718. npc.anInt1537 = loopCycle;
  2719. int l = stream.readBits(5);
  2720. if (l > 15)
  2721. l -= 32;
  2722. int i1 = stream.readBits(5);
  2723. if (i1 > 15)
  2724. i1 -= 32;
  2725. int j1 = stream.readBits(1);
  2726. npc.desc = EntityDef.forID(stream.readBits(16));
  2727. int k1 = stream.readBits(1);
  2728. if (k1 == 1)
  2729. anIntArray894[anInt893++] = k;
  2730. npc.anInt1540 = npc.desc.aByte68;
  2731. npc.anInt1504 = npc.desc.anInt79;
  2732. npc.anInt1554 = npc.desc.walkAnim;
  2733. npc.anInt1555 = npc.desc.anInt58;
  2734. npc.anInt1556 = npc.desc.anInt83;
  2735. npc.anInt1557 = npc.desc.anInt55;
  2736. npc.anInt1511 = npc.desc.standAnim;
  2737. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2738. }
  2739. stream.finishBitAccess();
  2740. }
  2741.  
  2742. public void processGameLoop() {
  2743. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2744. return;
  2745. loopCycle++;
  2746. if (!loggedIn)
  2747. processLoginScreenInput();
  2748. else
  2749. mainGameProcessor();
  2750. processOnDemandQueue();
  2751. }
  2752.  
  2753. public void method47(boolean flag) {
  2754. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2755. destX = 0;
  2756. int j = playerCount;
  2757. if (flag)
  2758. j = 1;
  2759. for (int l = 0; l < j; l++) {
  2760. Player player;
  2761. int i1;
  2762. if (flag) {
  2763. player = myPlayer;
  2764. i1 = myPlayerIndex << 14;
  2765. } else {
  2766. player = playerArray[playerIndices[l]];
  2767. i1 = playerIndices[l] << 14;
  2768. }
  2769. if (player == null || !player.isVisible())
  2770. continue;
  2771. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  2772. && !flag && player.anInt1517 == player.anInt1511;
  2773. int j1 = player.x >> 7;
  2774. int k1 = player.y >> 7;
  2775. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2776. continue;
  2777. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  2778. && loopCycle < player.anInt1708) {
  2779. player.aBoolean1699 = false;
  2780. player.anInt1709 = method42(plane, player.y, player.x);
  2781. worldController.method286(plane, player.y, player,
  2782. player.anInt1552, player.anInt1722, player.x,
  2783. player.anInt1709, player.anInt1719, player.anInt1721,
  2784. i1, player.anInt1720);
  2785. continue;
  2786. }
  2787. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2788. if (anIntArrayArray929[j1][k1] == anInt1265)
  2789. continue;
  2790. anIntArrayArray929[j1][k1] = anInt1265;
  2791. }
  2792. player.anInt1709 = method42(plane, player.y, player.x);
  2793. worldController.method285(plane, player.anInt1552,
  2794. player.anInt1709, i1, player.y, 60, player.x, player,
  2795. player.aBoolean1541);
  2796. }
  2797. }
  2798.  
  2799. public boolean promptUserForInput(RSInterface class9) {
  2800. int j = class9.contentType;
  2801. if (anInt900 == 2) {
  2802. if (j == 201) {
  2803. inputTaken = true;
  2804. inputDialogState = 0;
  2805. messagePromptRaised = true;
  2806. promptInput = "";
  2807. friendsListAction = 1;
  2808. aString1121 = "Enter name of friend to add to list";
  2809. }
  2810. if (j == 202) {
  2811. inputTaken = true;
  2812. inputDialogState = 0;
  2813. messagePromptRaised = true;
  2814. promptInput = "";
  2815. friendsListAction = 2;
  2816. aString1121 = "Enter name of friend to delete from list";
  2817. }
  2818. }
  2819. if (j == 205) {
  2820. anInt1011 = 250;
  2821. return true;
  2822. }
  2823. if (j == 501) {
  2824. inputTaken = true;
  2825. inputDialogState = 0;
  2826. messagePromptRaised = true;
  2827. promptInput = "";
  2828. friendsListAction = 4;
  2829. aString1121 = "Enter name of player to add to list";
  2830. }
  2831. if (j == 502) {
  2832. inputTaken = true;
  2833. inputDialogState = 0;
  2834. messagePromptRaised = true;
  2835. promptInput = "";
  2836. friendsListAction = 5;
  2837. aString1121 = "Enter name of player to delete from list";
  2838. }
  2839. if (j == 550) {
  2840. inputTaken = true;
  2841. inputDialogState = 0;
  2842. messagePromptRaised = true;
  2843. promptInput = "";
  2844. friendsListAction = 6;
  2845. aString1121 = "Enter the name of the chat you wish to join";
  2846. }
  2847. if (j >= 300 && j <= 313) {
  2848. int k = (j - 300) / 2;
  2849. int j1 = j & 1;
  2850. int i2 = anIntArray1065[k];
  2851. if (i2 != -1) {
  2852. do {
  2853. if (j1 == 0 && --i2 < 0)
  2854. i2 = IDK.length - 1;
  2855. if (j1 == 1 && ++i2 >= IDK.length)
  2856. i2 = 0;
  2857. } while (IDK.cache[i2].aBoolean662
  2858. || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2859. anIntArray1065[k] = i2;
  2860. aBoolean1031 = true;
  2861. }
  2862. }
  2863. if (j >= 314 && j <= 323) {
  2864. int l = (j - 314) / 2;
  2865. int k1 = j & 1;
  2866. int j2 = anIntArray990[l];
  2867. if (k1 == 0 && --j2 < 0)
  2868. j2 = anIntArrayArray1003[l].length - 1;
  2869. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2870. j2 = 0;
  2871. anIntArray990[l] = j2;
  2872. aBoolean1031 = true;
  2873. }
  2874. if (j == 324 && !aBoolean1047) {
  2875. aBoolean1047 = true;
  2876. method45();
  2877. }
  2878. if (j == 325 && aBoolean1047) {
  2879. aBoolean1047 = false;
  2880. method45();
  2881. }
  2882. if (j == 326) {
  2883. stream.createFrame(101);
  2884. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2885. for (int i1 = 0; i1 < 7; i1++)
  2886. stream.writeWordBigEndian(anIntArray1065[i1]);
  2887.  
  2888. for (int l1 = 0; l1 < 5; l1++)
  2889. stream.writeWordBigEndian(anIntArray990[l1]);
  2890.  
  2891. return true;
  2892. }
  2893. if (j == 613)
  2894. canMute = !canMute;
  2895. if (j >= 601 && j <= 612) {
  2896. clearTopInterfaces();
  2897. if (reportAbuseInput.length() > 0) {
  2898. stream.createFrame(218);
  2899. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2900. stream.writeWordBigEndian(j - 601);
  2901. stream.writeWordBigEndian(canMute ? 1 : 0);
  2902. }
  2903. }
  2904. return false;
  2905. }
  2906.  
  2907. public void method49(Stream stream) {
  2908. for (int j = 0; j < anInt893; j++) {
  2909. int k = anIntArray894[j];
  2910. Player player = playerArray[k];
  2911. int l = stream.readUnsignedByte();
  2912. if ((l & 0x40) != 0)
  2913. l += stream.readUnsignedByte() << 8;
  2914. method107(l, k, stream, player);
  2915. }
  2916. }
  2917.  
  2918. public void method50(int i, int k, int l, int i1, int j1) {
  2919. int k1 = worldController.method300(j1, l, i);
  2920. if (k1 != 0) {
  2921. int l1 = worldController.method304(j1, l, i, k1);
  2922. int k2 = l1 >> 6 & 3;
  2923. int i3 = l1 & 0x1f;
  2924. int k3 = k;
  2925. if (k1 > 0)
  2926. k3 = i1;
  2927. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2928. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2929. int i5 = k1 >> 14 & 0x7fff;
  2930. ObjectDef class46_2 = ObjectDef.forID(i5);
  2931. if (class46_2.anInt758 != -1) {
  2932. Background background_2 = mapScenes[class46_2.anInt758];
  2933. if (background_2 != null) {
  2934. int i6 = (class46_2.sizeX * 4 - background_2.anInt1452) / 2;
  2935. int j6 = (class46_2.sizeY * 4 - background_2.anInt1453) / 2;
  2936. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.sizeY) * 4 + j6);
  2937. }
  2938. } else {
  2939. if (i3 == 0 || i3 == 2)
  2940. if (k2 == 0) {
  2941. ai[k4] = k3;
  2942. ai[k4 + 512] = k3;
  2943. ai[k4 + 1024] = k3;
  2944. ai[k4 + 1536] = k3;
  2945. } else if (k2 == 1) {
  2946. ai[k4] = k3;
  2947. ai[k4 + 1] = k3;
  2948. ai[k4 + 2] = k3;
  2949. ai[k4 + 3] = k3;
  2950. } else if (k2 == 2) {
  2951. ai[k4 + 3] = k3;
  2952. ai[k4 + 3 + 512] = k3;
  2953. ai[k4 + 3 + 1024] = k3;
  2954. ai[k4 + 3 + 1536] = k3;
  2955. } else if (k2 == 3) {
  2956. ai[k4 + 1536] = k3;
  2957. ai[k4 + 1536 + 1] = k3;
  2958. ai[k4 + 1536 + 2] = k3;
  2959. ai[k4 + 1536 + 3] = k3;
  2960. }
  2961. if (i3 == 3)
  2962. if (k2 == 0)
  2963. ai[k4] = k3;
  2964. else if (k2 == 1)
  2965. ai[k4 + 3] = k3;
  2966. else if (k2 == 2)
  2967. ai[k4 + 3 + 1536] = k3;
  2968. else if (k2 == 3)
  2969. ai[k4 + 1536] = k3;
  2970. if (i3 == 2)
  2971. if (k2 == 3) {
  2972. ai[k4] = k3;
  2973. ai[k4 + 512] = k3;
  2974. ai[k4 + 1024] = k3;
  2975. ai[k4 + 1536] = k3;
  2976. } else if (k2 == 0) {
  2977. ai[k4] = k3;
  2978. ai[k4 + 1] = k3;
  2979. ai[k4 + 2] = k3;
  2980. ai[k4 + 3] = k3;
  2981. } else if (k2 == 1) {
  2982. ai[k4 + 3] = k3;
  2983. ai[k4 + 3 + 512] = k3;
  2984. ai[k4 + 3 + 1024] = k3;
  2985. ai[k4 + 3 + 1536] = k3;
  2986. } else if (k2 == 2) {
  2987. ai[k4 + 1536] = k3;
  2988. ai[k4 + 1536 + 1] = k3;
  2989. ai[k4 + 1536 + 2] = k3;
  2990. ai[k4 + 1536 + 3] = k3;
  2991. }
  2992. }
  2993. }
  2994. k1 = worldController.method302(j1, l, i);
  2995. if (k1 != 0) {
  2996. int i2 = worldController.method304(j1, l, i, k1);
  2997. int l2 = i2 >> 6 & 3;
  2998. int j3 = i2 & 0x1f;
  2999. int l3 = k1 >> 14 & 0x7fff;
  3000. ObjectDef class46_1 = ObjectDef.forID(l3);
  3001. if (class46_1.anInt758 != -1) {
  3002. Background background_1 = mapScenes[class46_1.anInt758];
  3003. if (background_1 != null) {
  3004. int j5 = (class46_1.sizeX * 4 - background_1.anInt1452) / 2;
  3005. int k5 = (class46_1.sizeY * 4 - background_1.anInt1453) / 2;
  3006. background_1.drawBackground(48 + l * 4 + j5, 48
  3007. + (104 - i - class46_1.sizeY) * 4 + k5);
  3008. }
  3009. } else if (j3 == 9) {
  3010. int l4 = 0xeeeeee;
  3011. if (k1 > 0)
  3012. l4 = 0xee0000;
  3013. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3014. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3015. if (l2 == 0 || l2 == 2) {
  3016. ai1[l5 + 1536] = l4;
  3017. ai1[l5 + 1024 + 1] = l4;
  3018. ai1[l5 + 512 + 2] = l4;
  3019. ai1[l5 + 3] = l4;
  3020. } else {
  3021. ai1[l5] = l4;
  3022. ai1[l5 + 512 + 1] = l4;
  3023. ai1[l5 + 1024 + 2] = l4;
  3024. ai1[l5 + 1536 + 3] = l4;
  3025. }
  3026. }
  3027. }
  3028. k1 = worldController.method303(j1, l, i);
  3029. if (k1 != 0) {
  3030. int j2 = k1 >> 14 & 0x7fff;
  3031. ObjectDef class46 = ObjectDef.forID(j2);
  3032. if (class46.anInt758 != -1) {
  3033. Background background = mapScenes[class46.anInt758];
  3034. if (background != null) {
  3035. int i4 = (class46.sizeX * 4 - background.anInt1452) / 2;
  3036. int j4 = (class46.sizeY * 4 - background.anInt1453) / 2;
  3037. background.drawBackground(48 + l * 4 + i4, 48
  3038. + (104 - i - class46.sizeY) * 4 + j4);
  3039. }
  3040. }
  3041. }
  3042. }
  3043.  
  3044. public void loadTitleScreen() {
  3045.  
  3046. aBackgroundArray1152s = new Background[12];
  3047. int j = 0;
  3048. try {
  3049. j = Integer.parseInt(getParameter("fl_icon"));
  3050. } catch (Exception _ex) {
  3051. }
  3052. if (j == 0) {
  3053. for (int k = 0; k < 12; k++)
  3054. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3055. "runes", k);
  3056.  
  3057. } else {
  3058. for (int l = 0; l < 12; l++)
  3059. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3060. "runes", 12 + (l & 3));
  3061.  
  3062. }
  3063. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3064. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3065. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0,
  3066. aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3067.  
  3068. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0,
  3069. aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3070.  
  3071. anIntArray851 = new int[256];
  3072. for (int k1 = 0; k1 < 64; k1++)
  3073. anIntArray851[k1] = k1 * 0x40000;
  3074.  
  3075. for (int l1 = 0; l1 < 64; l1++)
  3076. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3077.  
  3078. for (int i2 = 0; i2 < 64; i2++)
  3079. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3080.  
  3081. for (int j2 = 0; j2 < 64; j2++)
  3082. anIntArray851[j2 + 192] = 0xffffff;
  3083.  
  3084. anIntArray852 = new int[256];
  3085. for (int k2 = 0; k2 < 64; k2++)
  3086. anIntArray852[k2] = k2 * 1024;
  3087.  
  3088. for (int l2 = 0; l2 < 64; l2++)
  3089. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3090.  
  3091. for (int i3 = 0; i3 < 64; i3++)
  3092. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3093.  
  3094. for (int j3 = 0; j3 < 64; j3++)
  3095. anIntArray852[j3 + 192] = 0xffffff;
  3096.  
  3097. anIntArray853 = new int[256];
  3098. for (int k3 = 0; k3 < 64; k3++)
  3099. anIntArray853[k3] = k3 * 4;
  3100.  
  3101. for (int l3 = 0; l3 < 64; l3++)
  3102. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3103.  
  3104. for (int i4 = 0; i4 < 64; i4++)
  3105. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3106.  
  3107. for (int j4 = 0; j4 < 64; j4++)
  3108. anIntArray853[j4 + 192] = 0xffffff;
  3109.  
  3110. anIntArray850 = new int[256];
  3111. anIntArray1190 = new int[32768];
  3112. anIntArray1191 = new int[32768];
  3113. randomizeBackground(null);
  3114. anIntArray828 = new int[32768];
  3115. anIntArray829 = new int[32768];
  3116. drawNewLoadingText(75, "Connecting to fileserver");
  3117. if (!aBoolean831) {
  3118. drawFlames = true;
  3119. aBoolean831 = true;
  3120. startRunnable(this, 2);
  3121. }
  3122. }
  3123.  
  3124. public static void setHighMem() {
  3125. WorldController.lowMem = false;
  3126. Rasterizer.lowMem = false;
  3127. lowMem = false;
  3128. ObjectManager.lowMem = false;
  3129. ObjectDef.lowMem = false;
  3130. }
  3131.  
  3132. public static void main(String args[]) {
  3133. try {
  3134. nodeID = 10;
  3135. portOff = 0;
  3136. setHighMem();
  3137. isMembers = true;
  3138. SignLink.storeid = 32;
  3139. SignLink.startpriv(InetAddress.getLocalHost());
  3140. instance = new Jframe(args);
  3141. } catch (Exception exception) {
  3142. }
  3143. }
  3144.  
  3145. public static Client instance;
  3146.  
  3147. public void loadingStages() {
  3148. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3149. aRSImageProducer_1165.initDrawingArea();
  3150. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  3151. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  3152. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3153. loadingStage = 1;
  3154. aLong824 = System.currentTimeMillis();
  3155. }
  3156. if (loadingStage == 1) {
  3157. int j = method54();
  3158. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3159. SignLink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3160. aLong824 = System.currentTimeMillis();
  3161. }
  3162. }
  3163. if (loadingStage == 2 && plane != anInt985) {
  3164. anInt985 = plane;
  3165. method24(plane);
  3166. }
  3167. }
  3168.  
  3169. public int method54() {
  3170. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3171. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1) {
  3172. if (anIntArray1235[i] == 1510)// just a test
  3173. anIntArray1235[i] = -1;
  3174. return -1;// null map files
  3175. }
  3176. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1) {
  3177. if (anIntArray1236[i] == 1511)// just a test
  3178. anIntArray1236[i] = -1;
  3179. return -2;
  3180. }
  3181. }
  3182. boolean flag = true;
  3183. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3184. byte abyte0[] = aByteArrayArray1247[j];
  3185. if (abyte0 != null) {
  3186. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3187. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3188. if (aBoolean1159) {
  3189. k = 10;
  3190. l = 10;
  3191. }
  3192. flag &= ObjectManager.method189(k, abyte0, l);
  3193. }
  3194. }
  3195. if (!flag)
  3196. return -3;// couldn't parse all landscapes
  3197. if (aBoolean1080) {
  3198. return -4;
  3199. } else {
  3200. loadingStage = 2;
  3201. ObjectManager.anInt131 = plane;
  3202. method22();
  3203. stream.createFrame(121);
  3204. return 0;
  3205. }
  3206. }
  3207.  
  3208. public void method55() {
  3209. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3210. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3211. .reverseGetNext())
  3212. if (class30_sub2_sub4_sub4.anInt1597 != plane
  3213. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3214. class30_sub2_sub4_sub4.unlink();
  3215. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3216. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3217. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3218. if (npc != null && npc.x >= 0 && npc.x < 13312
  3219. && npc.y >= 0 && npc.y < 13312)
  3220. class30_sub2_sub4_sub4.method455(
  3221. loopCycle,
  3222. npc.y,
  3223. method42(class30_sub2_sub4_sub4.anInt1597,
  3224. npc.y, npc.x)
  3225. - class30_sub2_sub4_sub4.anInt1583,
  3226. npc.x);
  3227. }
  3228. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3229. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3230. Player player;
  3231. if (j == unknownInt10)
  3232. player = myPlayer;
  3233. else
  3234. player = playerArray[j];
  3235. if (player != null && player.x >= 0 && player.x < 13312
  3236. && player.y >= 0 && player.y < 13312)
  3237. class30_sub2_sub4_sub4.method455(
  3238. loopCycle,
  3239. player.y,
  3240. method42(class30_sub2_sub4_sub4.anInt1597,
  3241. player.y, player.x)
  3242. - class30_sub2_sub4_sub4.anInt1583,
  3243. player.x);
  3244. }
  3245. class30_sub2_sub4_sub4.method456(anInt945);
  3246. worldController.method285(plane,
  3247. class30_sub2_sub4_sub4.anInt1595,
  3248. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  3249. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  3250. (int) class30_sub2_sub4_sub4.aDouble1585,
  3251. class30_sub2_sub4_sub4, false);
  3252. }
  3253.  
  3254. }
  3255.  
  3256. public AppletContext getAppletContext() {
  3257. if (SignLink.mainapp != null)
  3258. return SignLink.mainapp.getAppletContext();
  3259. else
  3260. return super.getAppletContext();
  3261. }
  3262.  
  3263. public static String capitalize(String s) {
  3264. for (int i = 0; i < s.length(); i++) {
  3265. if (i == 0) {
  3266. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)),
  3267. s.substring(1));
  3268. }
  3269. if (!Character.isLetterOrDigit(s.charAt(i))) {
  3270. if (i + 1 < s.length()) {
  3271. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  3272. Character.toUpperCase(s.charAt(i + 1)),
  3273. s.substring(i + 2));
  3274. }
  3275. }
  3276. }
  3277. return s;
  3278. }
  3279.  
  3280. @SuppressWarnings("unused")
  3281. public void drawLogo() {
  3282. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3283. Sprite sprite = new Sprite(abyte0, this);
  3284. aRSImageProducer_1110.initDrawingArea();
  3285. sprite.method346(0, 0);
  3286. aRSImageProducer_1111.initDrawingArea();
  3287. sprite.method346(-637, 0);
  3288. aRSImageProducer_1107.initDrawingArea();
  3289. sprite.method346(-128, 0);
  3290. aRSImageProducer_1108.initDrawingArea();
  3291. sprite.method346(-202, -371);
  3292. aRSImageProducer_1109.initDrawingArea();
  3293. sprite.method346(0, 0);
  3294. aRSImageProducer_1112.initDrawingArea();
  3295. sprite.method346(0, -265);
  3296. aRSImageProducer_1113.initDrawingArea();
  3297. sprite.method346(-562, -265);
  3298. aRSImageProducer_1114.initDrawingArea();
  3299. sprite.method346(-128, -171);
  3300. aRSImageProducer_1115.initDrawingArea();
  3301. sprite.method346(-562, -171);
  3302. int ai[] = new int[sprite.myWidth];
  3303. for (int j = 0; j < sprite.myHeight; j++) {
  3304. for (int k = 0; k < sprite.myWidth; k++)
  3305. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3306. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3307. }
  3308. sprite = null;
  3309. Object obj = null;
  3310. Object obj1 = null;
  3311. System.gc();
  3312. }
  3313.  
  3314.  
  3315.  
  3316. public void processOnDemandQueue() {
  3317. do {
  3318. OnDemandData onDemandData;
  3319. do {
  3320. onDemandData = onDemandFetcher.getNextNode();
  3321. if (onDemandData == null)
  3322. return;
  3323. if (onDemandData.dataType == 0)
  3324. Model.method460(onDemandData.buffer, onDemandData.ID);
  3325. if (onDemandData.dataType == 1)
  3326. Class36.load(onDemandData.ID, onDemandData.buffer);
  3327. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong
  3328. && onDemandData.buffer != null)
  3329. saveMidi(songChanging, onDemandData.buffer);
  3330. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3331. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3332. if (anIntArray1235[i] == onDemandData.ID) {
  3333. aByteArrayArray1183[i] = onDemandData.buffer;
  3334. if (onDemandData.buffer == null)
  3335. anIntArray1235[i] = -1;
  3336. break;
  3337. }
  3338. if (anIntArray1236[i] != onDemandData.ID)
  3339. continue;
  3340. aByteArrayArray1247[i] = onDemandData.buffer;
  3341. if (onDemandData.buffer == null)
  3342. anIntArray1236[i] = -1;
  3343. break;
  3344. }
  3345.  
  3346. }
  3347. if (onDemandData.dataType == 4)
  3348. Texture.load(onDemandData.ID, onDemandData.buffer);
  3349. } while (onDemandData.dataType != 93
  3350. || !onDemandFetcher.method564(onDemandData.ID));
  3351. ObjectManager.method173(new Stream(onDemandData.buffer),
  3352. onDemandFetcher);
  3353. } while (true);
  3354. }
  3355.  
  3356.  
  3357. public void calcFlamesPosition() {
  3358. char c = '\u0100';
  3359. for (int j = 10; j < 117; j++) {
  3360. int k = (int) (Math.random() * 100D);
  3361. if (k < 50)
  3362. anIntArray828[j + (c - 2 << 7)] = 255;
  3363. }
  3364. for (int l = 0; l < 100; l++) {
  3365. int i1 = (int) (Math.random() * 124D) + 2;
  3366. int k1 = (int) (Math.random() * 128D) + 128;
  3367. int k2 = i1 + (k1 << 7);
  3368. anIntArray828[k2] = 192;
  3369. }
  3370.  
  3371. for (int j1 = 1; j1 < c - 1; j1++) {
  3372. for (int l1 = 1; l1 < 127; l1++) {
  3373. int l2 = l1 + (j1 << 7);
  3374. anIntArray829[l2] = (anIntArray828[l2 - 1]
  3375. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3376. }
  3377.  
  3378. }
  3379.  
  3380. anInt1275 += 128;
  3381. if (anInt1275 > anIntArray1190.length) {
  3382. anInt1275 -= anIntArray1190.length;
  3383. int i2 = (int) (Math.random() * 12D);
  3384. randomizeBackground(aBackgroundArray1152s[i2]);
  3385. }
  3386. for (int j2 = 1; j2 < c - 1; j2++) {
  3387. for (int i3 = 1; i3 < 127; i3++) {
  3388. int k3 = i3 + (j2 << 7);
  3389. int i4 = anIntArray829[k3 + 128]
  3390. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  3391. - 1] / 5;
  3392. if (i4 < 0)
  3393. i4 = 0;
  3394. anIntArray828[k3] = i4;
  3395. }
  3396.  
  3397. }
  3398.  
  3399. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3400.  
  3401. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D
  3402. + Math.sin((double) loopCycle / 15D) * 14D + Math
  3403. .sin((double) loopCycle / 16D) * 12D);
  3404. if (anInt1040 > 0)
  3405. anInt1040 -= 4;
  3406. if (anInt1041 > 0)
  3407. anInt1041 -= 4;
  3408. if (anInt1040 == 0 && anInt1041 == 0) {
  3409. int l3 = (int) (Math.random() * 2000D);
  3410. if (l3 == 0)
  3411. anInt1040 = 1024;
  3412. if (l3 == 1)
  3413. anInt1041 = 1024;
  3414. }
  3415. }
  3416.  
  3417. public boolean saveWave(byte abyte0[], int i) {
  3418. return abyte0 == null || SignLink.wavesave(abyte0, i);
  3419. }
  3420.  
  3421. public void method60(int i) {
  3422. RSInterface class9 = RSInterface.interfaceCache[i];
  3423. for (int j = 0; j < class9.children.length; j++) {
  3424. if (class9.children[j] == -1)
  3425. break;
  3426. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3427. if (class9_1.type == 1)
  3428. method60(class9_1.id);
  3429. class9_1.anInt246 = 0;
  3430. class9_1.anInt208 = 0;
  3431. }
  3432. }
  3433.  
  3434. public void drawHeadIcon() {
  3435. if (anInt855 != 2)
  3436. return;
  3437. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3438. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  3439. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3440. }
  3441.  
  3442. public void mainGameProcessor() {
  3443. if (anInt1104 > 1)
  3444. anInt1104--;
  3445. if (anInt1011 > 0)
  3446. anInt1011--;
  3447. for (int j = 0; j < 5; j++)
  3448. if (!parsePacket())
  3449. break;
  3450.  
  3451. if (!loggedIn)
  3452. return;
  3453. synchronized (mouseDetection.syncObject) {
  3454. if (flagged) {
  3455. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3456. stream.createFrame(45);
  3457. stream.writeWordBigEndian(0);
  3458. int j2 = stream.currentOffset;
  3459. int j3 = 0;
  3460. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3461. if (j2 - stream.currentOffset >= 240)
  3462. break;
  3463. j3++;
  3464. int l4 = mouseDetection.coordsY[j4];
  3465. if (l4 < 0)
  3466. l4 = 0;
  3467. else if (l4 > 502)
  3468. l4 = 502;
  3469. int k5 = mouseDetection.coordsX[j4];
  3470. if (k5 < 0)
  3471. k5 = 0;
  3472. else if (k5 > 764)
  3473. k5 = 764;
  3474. int i6 = l4 * 765 + k5;
  3475. if (mouseDetection.coordsY[j4] == -1
  3476. && mouseDetection.coordsX[j4] == -1) {
  3477. k5 = -1;
  3478. l4 = -1;
  3479. i6 = 0x7ffff;
  3480. }
  3481. if (k5 == anInt1237 && l4 == anInt1238) {
  3482. if (anInt1022 < 2047)
  3483. anInt1022++;
  3484. } else {
  3485. int j6 = k5 - anInt1237;
  3486. anInt1237 = k5;
  3487. int k6 = l4 - anInt1238;
  3488. anInt1238 = l4;
  3489. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31
  3490. && k6 >= -32 && k6 <= 31) {
  3491. j6 += 32;
  3492. k6 += 32;
  3493. stream.writeWord((anInt1022 << 12) + (j6 << 6)
  3494. + k6);
  3495. anInt1022 = 0;
  3496. } else if (anInt1022 < 8) {
  3497. stream.writeDWordBigEndian(0x800000
  3498. + (anInt1022 << 19) + i6);
  3499. anInt1022 = 0;
  3500. } else {
  3501. stream.writeDWord(0xc0000000
  3502. + (anInt1022 << 19) + i6);
  3503. anInt1022 = 0;
  3504. }
  3505. }
  3506. }
  3507.  
  3508. stream.writeBytes(stream.currentOffset - j2);
  3509. if (j3 >= mouseDetection.coordsIndex) {
  3510. mouseDetection.coordsIndex = 0;
  3511. } else {
  3512. mouseDetection.coordsIndex -= j3;
  3513. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3514. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5
  3515. + j3];
  3516. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5
  3517. + j3];
  3518. }
  3519.  
  3520. }
  3521. }
  3522. } else {
  3523. mouseDetection.coordsIndex = 0;
  3524. }
  3525. }
  3526. if (super.clickMode3 != 0) {
  3527. long l = (super.aLong29 - aLong1220) / 50L;
  3528. if (l > 4095L)
  3529. l = 4095L;
  3530. aLong1220 = super.aLong29;
  3531. int k2 = super.saveClickY;
  3532. if (k2 < 0)
  3533. k2 = 0;
  3534. else if (k2 > 502)
  3535. k2 = 502;
  3536. int k3 = super.saveClickX;
  3537. if (k3 < 0)
  3538. k3 = 0;
  3539. else if (k3 > 764)
  3540. k3 = 764;
  3541. int k4 = k2 * 765 + k3;
  3542. int j5 = 0;
  3543. if (super.clickMode3 == 2)
  3544. j5 = 1;
  3545. int l5 = (int) l;
  3546. stream.createFrame(241);
  3547. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3548. }
  3549. if (anInt1016 > 0)
  3550. anInt1016--;
  3551. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  3552. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3553. aBoolean1017 = true;
  3554. if (aBoolean1017 && anInt1016 <= 0) {
  3555. anInt1016 = 20;
  3556. aBoolean1017 = false;
  3557. stream.createFrame(86);
  3558. stream.writeWord(anInt1184);
  3559. stream.method432(viewRotation);
  3560. }
  3561. if (super.awtFocus && !aBoolean954) {
  3562. aBoolean954 = true;
  3563. stream.createFrame(3);
  3564. stream.writeWordBigEndian(1);
  3565. }
  3566. if (!super.awtFocus && aBoolean954) {
  3567. aBoolean954 = false;
  3568. stream.createFrame(3);
  3569. stream.writeWordBigEndian(0);
  3570. }
  3571. loadingStages();
  3572. method115();
  3573. method90();
  3574. anInt1009++;
  3575. if (anInt1009 > 750)
  3576. dropClient();
  3577. method114();
  3578. method95();
  3579. method38();
  3580. anInt945++;
  3581. if (crossType != 0) {
  3582. crossIndex += 20;
  3583. if (crossIndex >= 400)
  3584. crossType = 0;
  3585. }
  3586. if (atInventoryInterfaceType != 0) {
  3587. atInventoryLoopCycle++;
  3588. if (atInventoryLoopCycle >= 15) {
  3589. if (atInventoryInterfaceType == 2)
  3590. needDrawTabArea = true;
  3591. if (atInventoryInterfaceType == 3)
  3592. inputTaken = true;
  3593. atInventoryInterfaceType = 0;
  3594. }
  3595. }
  3596. if (activeInterfaceType != 0) {
  3597. anInt989++;
  3598. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  3599. || super.mouseY > anInt1088 + 5
  3600. || super.mouseY < anInt1088 - 5)
  3601. aBoolean1242 = true;
  3602. if (super.clickMode2 == 0) {
  3603. if (activeInterfaceType == 2)
  3604. needDrawTabArea = true;
  3605. if (activeInterfaceType == 3)
  3606. inputTaken = true;
  3607. activeInterfaceType = 0;
  3608. if (aBoolean1242 && anInt989 >= 5) {
  3609. lastActiveInvInterface = -1;
  3610. processRightClick();
  3611. if (lastActiveInvInterface == anInt1084
  3612. && mouseInvInterfaceIndex != anInt1085) {
  3613. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3614. int j1 = 0;
  3615. if (anInt913 == 1 && class9.contentType == 206)
  3616. j1 = 1;
  3617. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3618. j1 = 0;
  3619. if (class9.aBoolean235) {
  3620. int l2 = anInt1085;
  3621. int l3 = mouseInvInterfaceIndex;
  3622. class9.inv[l3] = class9.inv[l2];
  3623. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3624. class9.inv[l2] = -1;
  3625. class9.invStackSizes[l2] = 0;
  3626. } else if (j1 == 1) {
  3627. int i3 = anInt1085;
  3628. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3629. if (i3 > i4) {
  3630. class9.swapInventoryItems(i3, i3 - 1);
  3631. i3--;
  3632. } else if (i3 < i4) {
  3633. class9.swapInventoryItems(i3, i3 + 1);
  3634. i3++;
  3635. }
  3636.  
  3637. } else {
  3638. class9.swapInventoryItems(anInt1085,
  3639. mouseInvInterfaceIndex);
  3640. }
  3641. stream.createFrame(214);
  3642. stream.method433(anInt1084);
  3643. stream.method424(j1);
  3644. stream.method433(anInt1085);
  3645. stream.method431(mouseInvInterfaceIndex);
  3646. }
  3647. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  3648. && menuActionRow > 2)
  3649. determineMenuSize();
  3650. else if (menuActionRow > 0)
  3651. doAction(menuActionRow - 1);
  3652. atInventoryLoopCycle = 10;
  3653. super.clickMode3 = 0;
  3654. }
  3655. }
  3656. if (WorldController.anInt470 != -1) {
  3657. int k = WorldController.anInt470;
  3658. int k1 = WorldController.anInt471;
  3659. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  3660. myPlayer.smallX[0], true, k);
  3661. WorldController.anInt470 = -1;
  3662. if (flag) {
  3663. crossX = super.saveClickX;
  3664. crossY = super.saveClickY;
  3665. crossType = 1;
  3666. crossIndex = 0;
  3667. }
  3668. }
  3669. if (super.clickMode3 == 1 && aString844 != null) {
  3670. aString844 = null;
  3671. inputTaken = true;
  3672. super.clickMode3 = 0;
  3673. }
  3674. processTabClick();
  3675. processMenuClick();
  3676. processMainScreenClick();
  3677. processChatModeClick();
  3678. processMapAreaClick();
  3679. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3680. anInt1213++;
  3681. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3682. if (anInt1501 < 0 && !menuOpen) {
  3683. anInt1501++;
  3684. if (anInt1501 == 0) {
  3685. if (anInt1500 != 0) {
  3686. inputTaken = true;
  3687. }
  3688. if (anInt1044 != 0) {
  3689. }
  3690. }
  3691. }
  3692. } else if (anInt1501 > 0) {
  3693. anInt1501--;
  3694. }
  3695. if (loadingStage == 2)
  3696. method108();
  3697. if (loadingStage == 2 && aBoolean1160)
  3698. calcCameraPos();
  3699. for (int i1 = 0; i1 < 5; i1++)
  3700. anIntArray1030[i1]++;
  3701.  
  3702. method73();
  3703. super.idleTime++;
  3704. if (super.idleTime > 4500)
  3705. // if(super.idleTime > 3000)
  3706. {
  3707. anInt1011 = 250;
  3708. super.idleTime -= 500;
  3709. stream.createFrame(202);
  3710. }
  3711. /*
  3712. * anInt988++; if(anInt988 > 500) { anInt988 = 0; int l1 =
  3713. * (int)(Math.random() * 8D); if((l1 & 1) == 1) anInt1278 += anInt1279;
  3714. * if((l1 & 2) == 2) anInt1131 += anInt1132; if((l1 & 4) == 4) anInt896
  3715. * += anInt897; } if(anInt1278 < -50) anInt1279 = 2; if(anInt1278 > 50)
  3716. * anInt1279 = -2; if(anInt1131 < -55) anInt1132 = 2; if(anInt1131 > 55)
  3717. * anInt1132 = -2; if(anInt896 < -40) anInt897 = 1; if(anInt896 > 40)
  3718. * anInt897 = -1; anInt1254++; if(anInt1254 > 500) { anInt1254 = 0; int
  3719. * i2 = (int)(Math.random() * 8D); if((i2 & 1) == 1) minimapInt2 +=
  3720. * anInt1210; if((i2 & 2) == 2) minimapInt3 += anInt1171; }
  3721. * if(minimapInt2 < -60) anInt1210 = 2; if(minimapInt2 > 60) anInt1210 =
  3722. * -2; if(minimapInt3 < -20) anInt1171 = 1; if(minimapInt3 > 10)
  3723. * anInt1171 = -1;
  3724. */
  3725. anInt1010++;
  3726. if (anInt1010 > 50)
  3727. stream.createFrame(0);
  3728. try {
  3729. if (socketStream != null && stream.currentOffset > 0) {
  3730. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3731. stream.currentOffset = 0;
  3732. anInt1010 = 0;
  3733. }
  3734. } catch (IOException _ex) {
  3735. dropClient();
  3736. } catch (Exception exception) {
  3737. resetLogout();
  3738. }
  3739. }
  3740.  
  3741. public void method63() {
  3742. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  3743. .reverseGetFirst();
  3744. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  3745. .reverseGetNext())
  3746. if (class30_sub1.anInt1294 == -1) {
  3747. class30_sub1.anInt1302 = 0;
  3748. method89(class30_sub1);
  3749. } else {
  3750. class30_sub1.unlink();
  3751. }
  3752.  
  3753. }
  3754.  
  3755. public void resetImageProducers() {
  3756. if (aRSImageProducer_1107 != null)
  3757. return;
  3758. super.fullGameScreen = null;
  3759. aRSImageProducer_1166 = null;
  3760. aRSImageProducer_1164 = null;
  3761. aRSImageProducer_1163 = null;
  3762. aRSImageProducer_1165 = null;
  3763. aRSImageProducer_1123 = null;
  3764. aRSImageProducer_1124 = null;
  3765. aRSImageProducer_1125 = null;
  3766. aRSImageProducer_1110 = new RSImageProducer(128, 265,
  3767. getGameComponent());
  3768. DrawingArea.setAllPixelsToZero();
  3769. aRSImageProducer_1111 = new RSImageProducer(128, 265,
  3770. getGameComponent());
  3771. DrawingArea.setAllPixelsToZero();
  3772. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  3773. getGameComponent());
  3774. DrawingArea.setAllPixelsToZero();
  3775. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  3776. getGameComponent());
  3777. DrawingArea.setAllPixelsToZero();
  3778. aRSImageProducer_1109 = new RSImageProducer(765, 503,
  3779. getGameComponent());
  3780. DrawingArea.setAllPixelsToZero();
  3781. aRSImageProducer_1112 = new RSImageProducer(202, 238,
  3782. getGameComponent());
  3783. DrawingArea.setAllPixelsToZero();
  3784. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  3785. getGameComponent());
  3786. DrawingArea.setAllPixelsToZero();
  3787. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3788. DrawingArea.setAllPixelsToZero();
  3789. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3790. DrawingArea.setAllPixelsToZero();
  3791. if (titleStreamLoader != null) {
  3792. drawLogo();
  3793. loadTitleScreen();
  3794. }
  3795. welcomeScreenRaised = true;
  3796. }
  3797.  
  3798. void drawNewLoadingText(int i, String s)
  3799. {
  3800. anInt1079 = i;
  3801. aString1049 = s;
  3802. resetImageProducers();
  3803. if(titleStreamLoader == null) {
  3804. super.drawLoadingText(i, s);
  3805. return;
  3806. }
  3807. aRSImageProducer_1109.initDrawingArea();
  3808. loadingBarEmpty = new Sprite("/Login/empty");
  3809. loadingBarFull = new Sprite("/Login/full");
  3810. loadingBarEmpty.drawTransparentSprite(0, 453, 50);
  3811. loadingBarFull.drawSprite(8, 463);
  3812. DrawingArea.drawPixels(30, 463, (8 + i), 0x302e2c, (750 - i));
  3813. if (i == 750) {
  3814. smallText.drawText(0xffffff, s + " - 100%", 483, 370);
  3815. } else {
  3816. smallText.drawText(0xffffff, s + " - " + (i/7.5) + "%", 483, 370);
  3817. }
  3818. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  3819. if(welcomeScreenRaised) {
  3820. welcomeScreenRaised = false;
  3821. if(!aBoolean831) {
  3822. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3823. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3824. }
  3825. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3826. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3827. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3828. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3829. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3830. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3831. }
  3832. }
  3833.  
  3834. public Sprite loadingBarEmpty;
  3835. public Sprite loadingBarFull;
  3836.  
  3837. public void drawLoadingText(int i, String s) {
  3838. anInt1079 = i;
  3839. aString1049 = s;
  3840. resetImageProducers();
  3841. if (titleStreamLoader == null) {
  3842. super.drawLoadingText(i, s);
  3843. return;
  3844. }
  3845. aRSImageProducer_1109.initDrawingArea();
  3846. char c = '\u0168';
  3847. char c1 = '\310';
  3848. byte byte1 = 20;
  3849. chatTextDrawingArea.drawText(0xffffff,
  3850. "RuneScape is loading - please wait...",
  3851. c1 / 2 - 26 - byte1, c / 2);
  3852. int j = c1 / 2 - 18 - byte1;
  3853. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3854. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3855. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3856. DrawingArea
  3857. .drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3858. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3859. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3860. if (welcomeScreenRaised) {
  3861. welcomeScreenRaised = false;
  3862. if (!aBoolean831) {
  3863. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3864. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3865. }
  3866. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3867. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3868. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3869. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3870. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3871. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3872. }
  3873. }
  3874.  
  3875. public void method65(int i, int j, int k, int l, RSInterface class9,
  3876. int i1, boolean flag, int j1) {
  3877. int anInt992;
  3878. if (aBoolean972)
  3879. anInt992 = 32;
  3880. else
  3881. anInt992 = 0;
  3882. aBoolean972 = false;
  3883. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3884. class9.scrollPosition -= anInt1213 * 4;
  3885. if (flag) {
  3886. needDrawTabArea = true;
  3887. }
  3888. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3889. class9.scrollPosition += anInt1213 * 4;
  3890. if (flag) {
  3891. needDrawTabArea = true;
  3892. }
  3893. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  3894. && l < (i1 + j) - 16 && anInt1213 > 0) {
  3895. int l1 = ((j - 32) * j) / j1;
  3896. if (l1 < 8)
  3897. l1 = 8;
  3898. int i2 = l - i1 - 16 - l1 / 2;
  3899. int j2 = j - 32 - l1;
  3900. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3901. if (flag)
  3902. needDrawTabArea = true;
  3903. aBoolean972 = true;
  3904. }
  3905. }
  3906.  
  3907. private boolean method66(int i, int j, int k, int id) {
  3908. int j1 = worldController.method304(plane, k, j, i);
  3909. if(i == -1)
  3910. return false;
  3911. int k1 = j1 & 0x1f;
  3912. int l1 = j1 >> 6 & 3;
  3913. if(k1 == 10 || k1 == 11 || k1 == 22) {
  3914. ObjectDef class46 = ObjectDef.forID(id);
  3915. int i2;
  3916. int j2;
  3917. if(l1 == 0 || l1 == 2) {
  3918. i2 = class46.sizeX;
  3919. j2 = class46.sizeY;
  3920. } else {
  3921. i2 = class46.sizeY;
  3922. j2 = class46.sizeX;
  3923. }
  3924. int k2 = class46.anInt768;
  3925. if(l1 != 0)
  3926. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3927. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3928. } else {
  3929. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3930. }
  3931. crossX = super.saveClickX;
  3932. crossY = super.saveClickY;
  3933. crossType = 2;
  3934. crossIndex = 0;
  3935. return true;
  3936. }
  3937.  
  3938. @SuppressWarnings("unused")
  3939. public StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  3940. int k) {
  3941. byte abyte0[] = null;
  3942. int l = 5;
  3943. try {
  3944. if (decompressors[0] != null)
  3945. abyte0 = decompressors[0].decompress(i);
  3946. } catch (Exception _ex) {
  3947. }
  3948. if (abyte0 != null) {
  3949. // aCRC32_930.reset();
  3950. // aCRC32_930.update(abyte0);
  3951. // int i1 = (int)aCRC32_930.getValue();
  3952. // if(i1 != j)
  3953. }
  3954. if (abyte0 != null) {
  3955. StreamLoader streamLoader = new StreamLoader(abyte0, s);
  3956. return streamLoader;
  3957. }
  3958. int j1 = 0;
  3959. while (abyte0 == null) {
  3960. String s2 = "Unknown error";
  3961. drawLoadingText(k, "Requesting " + s);
  3962. Object obj = null;
  3963. try {
  3964. int k1 = 0;
  3965. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3966. byte abyte1[] = new byte[6];
  3967. datainputstream.readFully(abyte1, 0, 6);
  3968. Stream stream = new Stream(abyte1);
  3969. stream.currentOffset = 3;
  3970. int i2 = stream.read3Bytes() + 6;
  3971. int j2 = 6;
  3972. abyte0 = new byte[i2];
  3973. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3974.  
  3975. while (j2 < i2) {
  3976. int l2 = i2 - j2;
  3977. if (l2 > 1000)
  3978. l2 = 1000;
  3979. int j3 = datainputstream.read(abyte0, j2, l2);
  3980. if (j3 < 0) {
  3981. s2 = "Length error: " + j2 + "/" + i2;
  3982. throw new IOException("EOF");
  3983. }
  3984. j2 += j3;
  3985. int k3 = (j2 * 100) / i2;
  3986. if (k3 != k1)
  3987. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3988. k1 = k3;
  3989. }
  3990. datainputstream.close();
  3991. try {
  3992. if (decompressors[0] != null)
  3993. decompressors[0].method234(abyte0.length, abyte0, i);
  3994. } catch (Exception _ex) {
  3995. decompressors[0] = null;
  3996. }
  3997. /*
  3998. * if(abyte0 != null) { aCRC32_930.reset();
  3999. * aCRC32_930.update(abyte0); int i3 =
  4000. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  4001. * j1++; s2 = "Checksum error: " + i3; } }
  4002. */
  4003. } catch (IOException ioexception) {
  4004. if (s2.equals("Unknown error"))
  4005. s2 = "Connection error";
  4006. abyte0 = null;
  4007. } catch (NullPointerException _ex) {
  4008. s2 = "Null error";
  4009. abyte0 = null;
  4010. if (!SignLink.reporterror)
  4011. return null;
  4012. } catch (ArrayIndexOutOfBoundsException _ex) {
  4013. s2 = "Bounds error";
  4014. abyte0 = null;
  4015. if (!SignLink.reporterror)
  4016. return null;
  4017. } catch (Exception _ex) {
  4018. s2 = "Unexpected error";
  4019. abyte0 = null;
  4020. if (!SignLink.reporterror)
  4021. return null;
  4022. }
  4023. if (abyte0 == null) {
  4024. for (int l1 = l; l1 > 0; l1--) {
  4025. if (j1 >= 3) {
  4026. drawLoadingText(k, "Game updated - please reload page");
  4027. l1 = 10;
  4028. } else {
  4029. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4030. }
  4031. try {
  4032. Thread.sleep(1000L);
  4033. } catch (Exception _ex) {
  4034. }
  4035. }
  4036.  
  4037. l *= 2;
  4038. if (l > 60)
  4039. l = 60;
  4040. aBoolean872 = !aBoolean872;
  4041. }
  4042.  
  4043. }
  4044.  
  4045. StreamLoader streamLoader_1 = new StreamLoader(abyte0, s);
  4046. return streamLoader_1;
  4047. }
  4048.  
  4049. public void dropClient() {
  4050. if (anInt1011 > 0) {
  4051. resetLogout();
  4052. return;
  4053. }
  4054. aRSImageProducer_1165.initDrawingArea();
  4055. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2);
  4056. DrawingArea.drawPixels(37, 3, 3, 0, 227);
  4057. aTextDrawingArea_1271.drawText(0, "Connection Lost", 19, 120);
  4058. aTextDrawingArea_1271.drawText(0xffffff, "Connection Lost", 18, 119);
  4059. aTextDrawingArea_1271
  4060. .drawText(0, "Please Wait - Reconnecting", 34, 117);
  4061. aTextDrawingArea_1271.drawText(0xffffff, "Please Wait - Reconnecting",
  4062. 34, 116);
  4063. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4064. anInt1021 = 0;
  4065. destX = 0;
  4066. RSSocket rsSocket = socketStream;
  4067. loggedIn = false;
  4068. loginFailures = 0;
  4069. login(myUsername, myPassword, true);
  4070. if (!loggedIn)
  4071. resetLogout();
  4072. try {
  4073. rsSocket.close();
  4074. } catch (Exception _ex) {
  4075. }
  4076. }
  4077.  
  4078. public void doAction(int i) {
  4079. if (i < 0)
  4080. return;
  4081. if (inputDialogState != 0) {
  4082. inputDialogState = 0;
  4083. inputTaken = true;
  4084. }
  4085. int i1 = menuActionCmd1[i];
  4086. int j = menuActionCmd2[i];
  4087. int k = menuActionCmd3[i];
  4088. int cmd4 = menuActionCmd4[i];
  4089. int actionId = menuActionIds[i];
  4090. int id = (i1 > 32767 ? cmd4 : i1 >> 14 & 0x7fff);
  4091. if (actionId >= 2000)
  4092. actionId -= 2000;
  4093. if (actionId == 582) {
  4094. NPC npc = npcArray[i1];
  4095. if (npc != null) {
  4096. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  4097. myPlayer.smallX[0], false, npc.smallX[0]);
  4098. crossX = super.saveClickX;
  4099. crossY = super.saveClickY;
  4100. crossType = 2;
  4101. crossIndex = 0;
  4102. stream.createFrame(57);
  4103. stream.method432(anInt1285);
  4104. stream.method432(i1);
  4105. stream.method431(anInt1283);
  4106. stream.method432(anInt1284);
  4107. }
  4108. }
  4109. if (actionId == 234) {
  4110. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4111. myPlayer.smallX[0], false, j);
  4112. if (!flag1)
  4113. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4114. myPlayer.smallX[0], false, j);
  4115. crossX = super.saveClickX;
  4116. crossY = super.saveClickY;
  4117. crossType = 2;
  4118. crossIndex = 0;
  4119. stream.createFrame(236);
  4120. stream.method431(k + baseY);
  4121. stream.writeWord(i1);
  4122. stream.method431(j + baseX);
  4123. }
  4124. if (actionId == 474) {
  4125. counterOn = !counterOn;
  4126. }
  4127. if (actionId == 475) {
  4128. xpCounter = 0;
  4129. }
  4130. if (actionId == 62 && method66(i1, k, j, id)) {
  4131. stream.createFrame(192);
  4132. stream.writeWord(anInt1284);
  4133. stream.method431(i1 >> 14 & 0x7fff);
  4134. stream.method433(k + baseY);
  4135. stream.method431(anInt1283);
  4136. stream.method433(j + baseX);
  4137. stream.writeWord(anInt1285);
  4138. }
  4139.  
  4140. if (actionId == 511) {
  4141. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4142. myPlayer.smallX[0], false, j);
  4143. if (!flag2)
  4144. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4145. myPlayer.smallX[0], false, j);
  4146. crossX = super.saveClickX;
  4147. crossY = super.saveClickY;
  4148. crossType = 2;
  4149. crossIndex = 0;
  4150. stream.createFrame(25);
  4151. stream.method431(anInt1284);
  4152. stream.method432(anInt1285);
  4153. stream.writeWord(i1);
  4154. stream.method432(k + baseY);
  4155. stream.method433(anInt1283);
  4156. stream.writeWord(j + baseX);
  4157. }
  4158. if (actionId == 74) {
  4159. stream.createFrame(122);
  4160. stream.method433(k);
  4161. stream.method432(j);
  4162. stream.method431(i1);
  4163. atInventoryLoopCycle = 0;
  4164. atInventoryInterface = k;
  4165. atInventoryIndex = j;
  4166. atInventoryInterfaceType = 2;
  4167. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4168. atInventoryInterfaceType = 1;
  4169. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4170. atInventoryInterfaceType = 3;
  4171. }
  4172. if (actionId == 315) {
  4173. RSInterface class9 = RSInterface.interfaceCache[k];
  4174. boolean flag8 = true;
  4175. if (class9.contentType > 0)
  4176. flag8 = promptUserForInput(class9);
  4177. if (flag8) {
  4178. switch (k) {
  4179. case 19144:
  4180. sendFrame248(15106, 3213);
  4181. method60(15106);
  4182. inputTaken = true;
  4183. break;
  4184. case 2661:
  4185. tabInterfaceIDs[2] = 638;
  4186. break;
  4187. default:
  4188. stream.createFrame(185);
  4189. stream.writeWord(k);
  4190. break;
  4191.  
  4192. }
  4193. }
  4194. }
  4195. if (actionId == 561) {
  4196. Player player = playerArray[i1];
  4197. if (player != null) {
  4198. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4199. player.smallY[0], myPlayer.smallX[0], false,
  4200. player.smallX[0]);
  4201. crossX = super.saveClickX;
  4202. crossY = super.saveClickY;
  4203. crossType = 2;
  4204. crossIndex = 0;
  4205. anInt1188 += i1;
  4206. if (anInt1188 >= 90) {
  4207. stream.createFrame(136);
  4208. anInt1188 = 0;
  4209. }
  4210. stream.createFrame(128);
  4211. stream.writeWord(i1);
  4212. }
  4213. }
  4214. if (actionId == 20) {
  4215. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4216. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4217. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  4218. crossX = super.saveClickX;
  4219. crossY = super.saveClickY;
  4220. crossType = 2;
  4221. crossIndex = 0;
  4222. stream.createFrame(155);
  4223. stream.method431(i1);
  4224. }
  4225. }
  4226. if (actionId == 779) {
  4227. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4228. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4229. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4230. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  4231. myPlayer.smallX[0], false,
  4232. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  4233. crossX = super.saveClickX;
  4234. crossY = super.saveClickY;
  4235. crossType = 2;
  4236. crossIndex = 0;
  4237. stream.createFrame(153);
  4238. stream.method431(i1);
  4239. }
  4240. }
  4241. if (actionId == 516)
  4242. if (!menuOpen)
  4243. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4244. else
  4245. worldController.method312(k - 4, j - 4);
  4246. if (actionId == 1062) {
  4247. anInt924 += baseX;
  4248. if (anInt924 >= 113) {
  4249. stream.createFrame(183);
  4250. stream.writeDWordBigEndian(0xe63271);
  4251. anInt924 = 0;
  4252. }
  4253. method66(i1, k, j, id);
  4254. stream.createFrame(228);
  4255. stream.method432(i1 >> 14 & 0x7fff);
  4256. stream.method432(k + baseY);
  4257. stream.writeWord(j + baseX);
  4258. }
  4259. if (actionId == 679 && !aBoolean1149) {
  4260. stream.createFrame(40);
  4261. stream.writeWord(k);
  4262. aBoolean1149 = true;
  4263. }
  4264. if (actionId == 431) {
  4265. stream.createFrame(129);
  4266. stream.method432(j);
  4267. stream.writeWord(k);
  4268. stream.method432(i1);
  4269. atInventoryLoopCycle = 0;
  4270. atInventoryInterface = k;
  4271. atInventoryIndex = j;
  4272. atInventoryInterfaceType = 2;
  4273. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4274. atInventoryInterfaceType = 1;
  4275. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4276. atInventoryInterfaceType = 3;
  4277. }
  4278. if (actionId == 337 || actionId == 42 || actionId == 792 || actionId == 322) {
  4279. String s = menuActionName[i];
  4280. int k1 = s.indexOf("@whi@");
  4281. if (k1 != -1) {
  4282. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4283. if (actionId == 337)
  4284. addFriend(l3);
  4285. if (actionId == 42)
  4286. addIgnore(l3);
  4287. if (actionId == 792)
  4288. delFriend(l3);
  4289. if (actionId == 322)
  4290. delIgnore(l3);
  4291. }
  4292. }
  4293. if (actionId == 53) {
  4294. stream.createFrame(135);
  4295. stream.method431(j);
  4296. stream.method432(k);
  4297. stream.method431(i1);
  4298. atInventoryLoopCycle = 0;
  4299. atInventoryInterface = k;
  4300. atInventoryIndex = j;
  4301. atInventoryInterfaceType = 2;
  4302. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4303. atInventoryInterfaceType = 1;
  4304. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4305. atInventoryInterfaceType = 3;
  4306. }
  4307. if (actionId == 54) {
  4308. stream.createFrame(137);
  4309. stream.method431(j);
  4310. stream.method432(k);
  4311. stream.method431(i1);
  4312. atInventoryLoopCycle = 0;
  4313. atInventoryInterface = k;
  4314. atInventoryIndex = j;
  4315. atInventoryInterfaceType = 2;
  4316. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4317. atInventoryInterfaceType = 1;
  4318. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4319. atInventoryInterfaceType = 3;
  4320. }
  4321. if(actionId == 1505){
  4322. // set your summoning interface here or something
  4323. }
  4324. if (actionId == 539) {
  4325. stream.createFrame(16);
  4326. stream.method432(i1);
  4327. stream.method433(j);
  4328. stream.method433(k);
  4329. atInventoryLoopCycle = 0;
  4330. atInventoryInterface = k;
  4331. atInventoryIndex = j;
  4332. atInventoryInterfaceType = 2;
  4333. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4334. atInventoryInterfaceType = 1;
  4335. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4336. atInventoryInterfaceType = 3;
  4337. }
  4338. if(actionId == 484 || actionId == 6 || actionId == 424)
  4339. {
  4340. String s1 = menuActionName[i];
  4341. int l1 = s1.indexOf("@whi@");
  4342. if(l1 != -1)
  4343. {
  4344. s1 = s1.substring(l1 + 5).trim();
  4345. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4346. boolean flag9 = false;
  4347. for(int j3 = 0; j3 < playerCount; j3++)
  4348. {
  4349. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4350. if(class30_sub2_sub4_sub1_sub2_7 == null || class30_sub2_sub4_sub1_sub2_7.name == null || !class30_sub2_sub4_sub1_sub2_7.name.equalsIgnoreCase(s7))
  4351. continue;
  4352. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  4353. if(actionId == 484)
  4354. {
  4355. stream.createFrame(139);
  4356. stream.method431(playerIndices[j3]);
  4357. }
  4358. if(actionId == 6)
  4359. {
  4360. anInt1188 += i1;
  4361. if(anInt1188 >= 90)
  4362. {
  4363. stream.createFrame(136);
  4364. anInt1188 = 0;
  4365. }
  4366. stream.createFrame(128);
  4367. stream.writeWord(playerIndices[j3]);
  4368. }
  4369. if (actionId == 424) {
  4370. stream.createFrame(146);
  4371. stream.writeWord(playerIndices[j3]);
  4372. }
  4373. flag9 = true;
  4374. break;
  4375. }
  4376.  
  4377. if(!flag9)
  4378. pushMessage("Unable to find " + s7, 0, "");
  4379. }
  4380. }
  4381. if (actionId == 870) {
  4382. stream.createFrame(53);
  4383. stream.writeWord(j);
  4384. stream.method432(anInt1283);
  4385. stream.method433(i1);
  4386. stream.writeWord(anInt1284);
  4387. stream.method431(anInt1285);
  4388. stream.writeWord(k);
  4389. atInventoryLoopCycle = 0;
  4390. atInventoryInterface = k;
  4391. atInventoryIndex = j;
  4392. atInventoryInterfaceType = 2;
  4393. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4394. atInventoryInterfaceType = 1;
  4395. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4396. atInventoryInterfaceType = 3;
  4397. }
  4398. if (actionId == 847) {
  4399. stream.createFrame(87);
  4400. stream.method432(i1);
  4401. stream.writeWord(k);
  4402. stream.method432(j);
  4403. atInventoryLoopCycle = 0;
  4404. atInventoryInterface = k;
  4405. atInventoryIndex = j;
  4406. atInventoryInterfaceType = 2;
  4407. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4408. atInventoryInterfaceType = 1;
  4409. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4410. atInventoryInterfaceType = 3;
  4411. }
  4412. if (actionId == 626) {
  4413. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4414. spellSelected = 1;
  4415. spellID = class9_1.id;
  4416. anInt1137 = k;
  4417. spellUsableOn = class9_1.spellUsableOn;
  4418. itemSelected = 0;
  4419. needDrawTabArea = true;
  4420. spellID = class9_1.id;
  4421. String s4 = class9_1.selectedActionName;
  4422. if (s4.indexOf(" ") != -1)
  4423. s4 = s4.substring(0, s4.indexOf(" "));
  4424. String s8 = class9_1.selectedActionName;
  4425. if (s8.indexOf(" ") != -1)
  4426. s8 = s8.substring(s8.indexOf(" ") + 1);
  4427. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4428. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4429. // 0xffffff);
  4430. // class9_1.sprite1.drawSprite(200,200);
  4431. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4432. if (spellUsableOn == 16) {
  4433. needDrawTabArea = true;
  4434. tabID = 3;
  4435. tabAreaAltered = true;
  4436. }
  4437. return;
  4438. }
  4439. if (actionId == 78) {
  4440. stream.createFrame(117);
  4441. stream.method433(k);
  4442. stream.method433(i1);
  4443. stream.method431(j);
  4444. atInventoryLoopCycle = 0;
  4445. atInventoryInterface = k;
  4446. atInventoryIndex = j;
  4447. atInventoryInterfaceType = 2;
  4448. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4449. atInventoryInterfaceType = 1;
  4450. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4451. atInventoryInterfaceType = 3;
  4452. }
  4453. if (actionId == 27) {
  4454. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4455. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4456. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4457. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  4458. myPlayer.smallX[0], false,
  4459. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4460. crossX = super.saveClickX;
  4461. crossY = super.saveClickY;
  4462. crossType = 2;
  4463. crossIndex = 0;
  4464. anInt986 += i1;
  4465. if (anInt986 >= 54) {
  4466. stream.createFrame(189);
  4467. stream.writeWordBigEndian(234);
  4468. anInt986 = 0;
  4469. }
  4470. stream.createFrame(73);
  4471. stream.method431(i1);
  4472. }
  4473. }
  4474. if (actionId == 213) {
  4475. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4476. myPlayer.smallX[0], false, j);
  4477. if (!flag3)
  4478. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4479. myPlayer.smallX[0], false, j);
  4480. crossX = super.saveClickX;
  4481. crossY = super.saveClickY;
  4482. crossType = 2;
  4483. crossIndex = 0;
  4484. stream.createFrame(79);
  4485. stream.method431(k + baseY);
  4486. stream.writeWord(i1);
  4487. stream.method432(j + baseX);
  4488. }
  4489. if (actionId == 632) {
  4490. stream.createFrame(145);
  4491. stream.method432(k);
  4492. stream.method432(j);
  4493. stream.method432(i1);
  4494. atInventoryLoopCycle = 0;
  4495. atInventoryInterface = k;
  4496. atInventoryIndex = j;
  4497. atInventoryInterfaceType = 2;
  4498. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4499. atInventoryInterfaceType = 1;
  4500. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4501. atInventoryInterfaceType = 3;
  4502. }
  4503. if (actionId == 1004) {
  4504. if (tabInterfaceIDs[10] != -1) {
  4505. needDrawTabArea = true;
  4506. tabID = 10;
  4507. tabAreaAltered = true;
  4508. }
  4509. }
  4510. if (actionId == 1003) {
  4511. clanChatMode = 2;
  4512. inputTaken = true;
  4513. }
  4514. if (actionId == 1002) {
  4515. clanChatMode = 1;
  4516. inputTaken = true;
  4517. }
  4518. if (actionId == 1001) {
  4519. clanChatMode = 0;
  4520. inputTaken = true;
  4521. }
  4522. if (actionId == 1000) {
  4523. cButtonCPos = 4;
  4524. chatTypeView = 11;
  4525. inputTaken = true;
  4526. }
  4527. if (actionId == 999) {
  4528. cButtonCPos = 0;
  4529. chatTypeView = 0;
  4530. inputTaken = true;
  4531. }
  4532. if (actionId == 975) {
  4533. chatTypes = new int[500];
  4534. chatNames = new String[500];
  4535. chatMessages = new String[500];
  4536. chatRights = new int[500];
  4537. pushMessage("Your chat has been cleared.", 0, "");
  4538. }
  4539. if (actionId == 998) {
  4540. cButtonCPos = 1;
  4541. chatTypeView = 5;
  4542. inputTaken = true;
  4543. }
  4544. if (actionId == 997) {
  4545. publicChatMode = 3;
  4546. inputTaken = true;
  4547. }
  4548. if (actionId == 996) {
  4549. publicChatMode = 2;
  4550. inputTaken = true;
  4551. }
  4552. if (actionId == 995) {
  4553. publicChatMode = 1;
  4554. inputTaken = true;
  4555. }
  4556. if (actionId == 994) {
  4557. publicChatMode = 0;
  4558. inputTaken = true;
  4559. }
  4560. if (actionId == 993) {
  4561. cButtonCPos = 2;
  4562. chatTypeView = 1;
  4563. inputTaken = true;
  4564. }
  4565. if (actionId == 992) {
  4566. publicChatMode = 2;
  4567. inputTaken = true;
  4568. }
  4569. if (actionId == 991) {
  4570. publicChatMode = 1;
  4571. inputTaken = true;
  4572. }
  4573. if (actionId == 990) {
  4574. publicChatMode = 0;
  4575. inputTaken = true;
  4576. }
  4577. if (actionId == 989) {
  4578. cButtonCPos = 3;
  4579. chatTypeView = 2;
  4580. inputTaken = true;
  4581. }
  4582. if (actionId == 987) {
  4583. tradeMode = 2;
  4584. inputTaken = true;
  4585. }
  4586. if (actionId == 986) {
  4587. tradeMode = 1;
  4588. inputTaken = true;
  4589. }
  4590. if (actionId == 985) {
  4591. tradeMode = 0;
  4592. inputTaken = true;
  4593. }
  4594. if (actionId == 984) {
  4595. cButtonCPos = 5;
  4596. chatTypeView = 3;
  4597. inputTaken = true;
  4598. }
  4599. if (actionId == 983) {
  4600. duelMode = 2;
  4601. inputTaken = true;
  4602. }
  4603. if (actionId == 982) {
  4604. duelMode = 1;
  4605. inputTaken = true;
  4606. }
  4607. if (actionId == 981) {
  4608. duelMode = 0;
  4609. inputTaken = true;
  4610. }
  4611. if (actionId == 980) {
  4612. cButtonCPos = 6;
  4613. chatTypeView = 4;
  4614. inputTaken = true;
  4615. }
  4616. if (actionId == 493) {
  4617. stream.createFrame(75);
  4618. stream.method433(k);
  4619. stream.method431(j);
  4620. stream.method432(i1);
  4621. atInventoryLoopCycle = 0;
  4622. atInventoryInterface = k;
  4623. atInventoryIndex = j;
  4624. atInventoryInterfaceType = 2;
  4625. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4626. atInventoryInterfaceType = 1;
  4627. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4628. atInventoryInterfaceType = 3;
  4629. }
  4630. if (actionId == 652) {
  4631. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4632. myPlayer.smallX[0], false, j);
  4633. if (!flag4)
  4634. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4635. myPlayer.smallX[0], false, j);
  4636. crossX = super.saveClickX;
  4637. crossY = super.saveClickY;
  4638. crossType = 2;
  4639. crossIndex = 0;
  4640. stream.createFrame(156);
  4641. stream.method432(j + baseX);
  4642. stream.method431(k + baseY);
  4643. stream.method433(i1);
  4644. }
  4645. if (actionId == 94) {
  4646. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4647. myPlayer.smallX[0], false, j);
  4648. if (!flag5)
  4649. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4650. myPlayer.smallX[0], false, j);
  4651. crossX = super.saveClickX;
  4652. crossY = super.saveClickY;
  4653. crossType = 2;
  4654. crossIndex = 0;
  4655. stream.createFrame(181);
  4656. stream.method431(k + baseY);
  4657. stream.writeWord(i1);
  4658. stream.method431(j + baseX);
  4659. stream.method432(anInt1137);
  4660. }
  4661. if (actionId == 646) {
  4662. stream.createFrame(185);
  4663. stream.writeWord(k);
  4664. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4665. if (class9_2.valueIndexArray != null
  4666. && class9_2.valueIndexArray[0][0] == 5) {
  4667. int i2 = class9_2.valueIndexArray[0][1];
  4668. if (variousSettings[i2] != class9_2.requiredValues[0]) {
  4669. variousSettings[i2] = class9_2.requiredValues[0];
  4670. method33(i2);
  4671. needDrawTabArea = true;
  4672. }
  4673. }
  4674. }
  4675. if (actionId == 225) {
  4676. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4677. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4678. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4679. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  4680. myPlayer.smallX[0], false,
  4681. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4682. crossX = super.saveClickX;
  4683. crossY = super.saveClickY;
  4684. crossType = 2;
  4685. crossIndex = 0;
  4686. anInt1226 += i1;
  4687. if (anInt1226 >= 85) {
  4688. stream.createFrame(230);
  4689. stream.writeWordBigEndian(239);
  4690. anInt1226 = 0;
  4691. }
  4692. stream.createFrame(17);
  4693. stream.method433(i1);
  4694. }
  4695. }
  4696. if (actionId == 965) {
  4697. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4698. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4699. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4700. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  4701. myPlayer.smallX[0], false,
  4702. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4703. crossX = super.saveClickX;
  4704. crossY = super.saveClickY;
  4705. crossType = 2;
  4706. crossIndex = 0;
  4707. anInt1134++;
  4708. if (anInt1134 >= 96) {
  4709. stream.createFrame(152);
  4710. stream.writeWordBigEndian(88);
  4711. anInt1134 = 0;
  4712. }
  4713. stream.createFrame(21);
  4714. stream.writeWord(i1);
  4715. }
  4716. }
  4717. if (actionId == 413) {
  4718. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4719. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4720. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4721. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  4722. myPlayer.smallX[0], false,
  4723. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4724. crossX = super.saveClickX;
  4725. crossY = super.saveClickY;
  4726. crossType = 2;
  4727. crossIndex = 0;
  4728. stream.createFrame(131);
  4729. stream.method433(i1);
  4730. stream.method432(anInt1137);
  4731. }
  4732. }
  4733. if (actionId == 200)
  4734. clearTopInterfaces();
  4735. if (actionId == 1025) {
  4736. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4737. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4738. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4739. if (entityDef.childrenIDs != null)
  4740. entityDef = entityDef.method161();
  4741. if (entityDef != null) {
  4742. String s9;
  4743. if (entityDef.description != null)
  4744. s9 = new String(entityDef.description);
  4745. else
  4746. s9 = "It's a " + entityDef.name + ".";
  4747. pushMessage(s9, 0, "");
  4748. }
  4749. }
  4750. }
  4751. if (actionId == 900) {
  4752. method66(i1, k, j, id);
  4753. stream.createFrame(252);
  4754. stream.method433(i1 >> 14 & 0x7fff);
  4755. stream.method431(k + baseY);
  4756. stream.method432(j + baseX);
  4757. }
  4758. if (actionId == 412) {
  4759. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4760. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4761. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  4762. crossX = super.saveClickX;
  4763. crossY = super.saveClickY;
  4764. crossType = 2;
  4765. crossIndex = 0;
  4766. stream.createFrame(72);
  4767. stream.method432(i1);
  4768. }
  4769. }
  4770. if (actionId == 365) {
  4771. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4772. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4773. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4774. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  4775. myPlayer.smallX[0], false,
  4776. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4777. crossX = super.saveClickX;
  4778. crossY = super.saveClickY;
  4779. crossType = 2;
  4780. crossIndex = 0;
  4781. stream.createFrame(249);
  4782. stream.method432(i1);
  4783. stream.method431(anInt1137);
  4784. }
  4785. }
  4786. if (actionId == 729) {
  4787. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4788. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4789. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4790. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  4791. myPlayer.smallX[0], false,
  4792. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4793. crossX = super.saveClickX;
  4794. crossY = super.saveClickY;
  4795. crossType = 2;
  4796. crossIndex = 0;
  4797. stream.createFrame(39);
  4798. stream.method431(i1);
  4799. }
  4800. }
  4801. if (actionId == 577) {
  4802. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4803. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4804. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4805. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  4806. myPlayer.smallX[0], false,
  4807. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4808. crossX = super.saveClickX;
  4809. crossY = super.saveClickY;
  4810. crossType = 2;
  4811. crossIndex = 0;
  4812. stream.createFrame(139);
  4813. stream.method431(i1);
  4814. }
  4815. }
  4816. if (actionId == 956 && method66(i1, k, j, id)) {
  4817. stream.createFrame(35);
  4818. stream.method431(j + baseX);
  4819. stream.method432(anInt1137);
  4820. stream.method432(k + baseY);
  4821. stream.method431(i1 >> 14 & 0x7fff);
  4822. }
  4823. if (actionId == 567) {
  4824. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4825. myPlayer.smallX[0], false, j);
  4826. if (!flag6)
  4827. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4828. myPlayer.smallX[0], false, j);
  4829. crossX = super.saveClickX;
  4830. crossY = super.saveClickY;
  4831. crossType = 2;
  4832. crossIndex = 0;
  4833. stream.createFrame(23);
  4834. stream.method431(k + baseY);
  4835. stream.method431(i1);
  4836. stream.method431(j + baseX);
  4837. }
  4838. if (actionId == 867) {
  4839. if ((i1 & 3) == 0)
  4840. anInt1175++;
  4841. if (anInt1175 >= 59) {
  4842. stream.createFrame(200);
  4843. stream.createFrame(201);
  4844. stream.writeWord(25501);
  4845. anInt1175 = 0;
  4846. }
  4847. stream.createFrame(43);
  4848. stream.method431(k);
  4849. stream.method432(i1);
  4850. stream.method432(j);
  4851. atInventoryLoopCycle = 0;
  4852. atInventoryInterface = k;
  4853. atInventoryIndex = j;
  4854. atInventoryInterfaceType = 2;
  4855. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4856. atInventoryInterfaceType = 1;
  4857. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4858. atInventoryInterfaceType = 3;
  4859. }
  4860. if (actionId == 543) {
  4861. stream.createFrame(237);
  4862. stream.writeWord(j);
  4863. stream.method432(i1);
  4864. stream.writeWord(k);
  4865. stream.method432(anInt1137);
  4866. atInventoryLoopCycle = 0;
  4867. atInventoryInterface = k;
  4868. atInventoryIndex = j;
  4869. atInventoryInterfaceType = 2;
  4870. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4871. atInventoryInterfaceType = 1;
  4872. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4873. atInventoryInterfaceType = 3;
  4874. }
  4875. if (actionId == 606) {
  4876. String s2 = menuActionName[i];
  4877. int j2 = s2.indexOf("@whi@");
  4878. if (j2 != -1)
  4879. if (openInterfaceID == -1) {
  4880. clearTopInterfaces();
  4881. reportAbuseInput = s2.substring(j2 + 5).trim();
  4882. canMute = false;
  4883. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  4884. if (RSInterface.interfaceCache[i3] == null
  4885. || RSInterface.interfaceCache[i3].contentType != 600)
  4886. continue;
  4887. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4888. break;
  4889. }
  4890.  
  4891. } else {
  4892. pushMessage(
  4893. "Please close the interface you have open before using 'report abuse'",
  4894. 0, "");
  4895. }
  4896. }
  4897. if (actionId == 491) {
  4898. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4899. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  4900. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4901. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  4902. myPlayer.smallX[0], false,
  4903. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  4904. crossX = super.saveClickX;
  4905. crossY = super.saveClickY;
  4906. crossType = 2;
  4907. crossIndex = 0;
  4908. stream.createFrame(14);
  4909. stream.method432(anInt1284);
  4910. stream.writeWord(i1);
  4911. stream.writeWord(anInt1285);
  4912. stream.method431(anInt1283);
  4913. }
  4914. }
  4915. if (actionId == 639) {
  4916. String s3 = menuActionName[i];
  4917. int k2 = s3.indexOf("@whi@");
  4918. if (k2 != -1) {
  4919. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4920. int k3 = -1;
  4921. for (int i4 = 0; i4 < friendsCount; i4++) {
  4922. if (friendsListAsLongs[i4] != l4)
  4923. continue;
  4924. k3 = i4;
  4925. break;
  4926. }
  4927.  
  4928. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  4929. inputTaken = true;
  4930. inputDialogState = 0;
  4931. messagePromptRaised = true;
  4932. promptInput = "";
  4933. friendsListAction = 3;
  4934. aLong953 = friendsListAsLongs[k3];
  4935. aString1121 = "Enter message to send to " + friendsList[k3];
  4936. }
  4937. }
  4938. }
  4939. if (actionId == 1052) {
  4940. stream.createFrame(185);
  4941. stream.writeWord(154);
  4942. }
  4943.  
  4944. if (actionId == 454) {
  4945. stream.createFrame(41);
  4946. stream.writeWord(i1);
  4947. stream.method432(j);
  4948. stream.method432(k);
  4949. atInventoryLoopCycle = 0;
  4950. atInventoryInterface = k;
  4951. atInventoryIndex = j;
  4952. atInventoryInterfaceType = 2;
  4953. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4954. atInventoryInterfaceType = 1;
  4955. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4956. atInventoryInterfaceType = 3;
  4957. }
  4958. if (actionId == 478) {
  4959. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4960. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  4961. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4962. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  4963. myPlayer.smallX[0], false,
  4964. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  4965. crossX = super.saveClickX;
  4966. crossY = super.saveClickY;
  4967. crossType = 2;
  4968. crossIndex = 0;
  4969. if ((i1 & 3) == 0)
  4970. anInt1155++;
  4971. if (anInt1155 >= 53) {
  4972. stream.createFrame(85);
  4973. stream.writeWordBigEndian(66);
  4974. anInt1155 = 0;
  4975. }
  4976. stream.createFrame(18);
  4977. stream.method431(i1);
  4978. }
  4979. }
  4980. if (actionId == 113) {
  4981. method66(i1, k, j, id);
  4982. stream.createFrame(70);
  4983. stream.method431(j + baseX);
  4984. stream.writeWord(k + baseY);
  4985. stream.method433(i1 >> 14 & 0x7fff);
  4986. }
  4987. if (actionId == 872) {
  4988. method66(i1, k, j, id);
  4989. stream.createFrame(234);
  4990. stream.method433(j + baseX);
  4991. stream.method432(i1 >> 14 & 0x7fff);
  4992. stream.method433(k + baseY);
  4993. }
  4994. if (actionId == 502) {
  4995. method66(i1, k, j, id);
  4996. stream.createFrame(132);
  4997. stream.method433(j + baseX);
  4998. stream.writeWord(i1 >> 14 & 0x7fff);
  4999. stream.method432(k + baseY);
  5000. }
  5001. if (actionId == 1125) {
  5002. ItemDef itemDef = ItemDef.forID(i1);
  5003. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5004. String s5;
  5005. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5006. s5 = NumberFormat.getInstance().format(class9_4.invStackSizes[j]) + " x " + itemDef.name;
  5007. else if (itemDef.description != null)
  5008. s5 = new String(itemDef.description);
  5009. else
  5010. s5 = "It's a " + itemDef.name + ".";
  5011. pushMessage(s5, 0, "");
  5012. }
  5013. if (actionId == 169) {
  5014. switch (k) {
  5015. case 29157:
  5016. tabInterfaceIDs[2] = 2648;
  5017. break;
  5018. case 2649:
  5019. launchURL("http://www.exodus317.com/vote");
  5020. break;
  5021. case 2652:
  5022. launchURL("http://www.exodus317.com/hiscores");
  5023. break;
  5024. case 2655:
  5025. launchURL("http://www.exodus317.com/donate");
  5026. break;
  5027. case 2658:
  5028. launchURL("http://www.exodus317.com");
  5029. break;
  5030. default:
  5031. stream.createFrame(185);
  5032. stream.writeWord(k);
  5033. break;
  5034. }
  5035. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5036. if (class9_3.valueIndexArray != null
  5037. && class9_3.valueIndexArray[0][0] == 5) {
  5038. int l2 = class9_3.valueIndexArray[0][1];
  5039. variousSettings[l2] = 1 - variousSettings[l2];
  5040. method33(l2);
  5041. needDrawTabArea = true;
  5042. }
  5043. }
  5044. if (actionId == 447) {
  5045. itemSelected = 1;
  5046. anInt1283 = j;
  5047. anInt1284 = k;
  5048. anInt1285 = i1;
  5049. selectedItemName = ItemDef.forID(i1).name;
  5050. spellSelected = 0;
  5051. needDrawTabArea = true;
  5052. return;
  5053. }
  5054. if (actionId == 1226) {
  5055. int j1 = i1 >> 14 & 0x7fff;
  5056. ObjectDef class46 = ObjectDef.forID(j1);
  5057. String s10;
  5058. if (class46.description != null)
  5059. s10 = new String(class46.description);
  5060. else
  5061. s10 = "It's a " + class46.name + ".";
  5062. pushMessage(s10, 0, "");
  5063. }
  5064. if (actionId == 244) {
  5065. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5066. myPlayer.smallX[0], false, j);
  5067. if (!flag7)
  5068. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5069. myPlayer.smallX[0], false, j);
  5070. crossX = super.saveClickX;
  5071. crossY = super.saveClickY;
  5072. crossType = 2;
  5073. crossIndex = 0;
  5074. stream.createFrame(253);
  5075. stream.method431(j + baseX);
  5076. stream.method433(k + baseY);
  5077. stream.method432(i1);
  5078. }
  5079. if (actionId == 1448) {
  5080. ItemDef itemDef_1 = ItemDef.forID(i1);
  5081. String s6;
  5082. if (itemDef_1.description != null)
  5083. s6 = new String(itemDef_1.description);
  5084. else
  5085. s6 = "It's a " + itemDef_1.name + ".";
  5086. pushMessage(s6, 0, "");
  5087. }
  5088. itemSelected = 0;
  5089. spellSelected = 0;
  5090. needDrawTabArea = true;
  5091.  
  5092. }
  5093.  
  5094. public void method70() {
  5095. anInt1251 = 0;
  5096. int j = (myPlayer.x >> 7) + baseX;
  5097. int k = (myPlayer.y >> 7) + baseY;
  5098. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5099. anInt1251 = 1;
  5100. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5101. anInt1251 = 1;
  5102. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5103. anInt1251 = 0;
  5104. }
  5105.  
  5106. public void run() {
  5107. if (drawFlames) {
  5108. drawFlames();
  5109. } else {
  5110. super.run();
  5111. }
  5112. }
  5113.  
  5114. private void build3dScreenMenu()
  5115. {
  5116. if(itemSelected == 0 && spellSelected == 0)
  5117. {
  5118. menuActionName[menuActionRow] = "Walk here";
  5119. menuActionIds[menuActionRow] = 516;
  5120. menuActionCmd2[menuActionRow] = super.mouseX;
  5121. menuActionCmd3[menuActionRow] = super.mouseY;
  5122. menuActionRow++;
  5123. }
  5124. int j = -1;
  5125. for(int k = 0; k < Model.objectsRendered; k++) {
  5126. int l = Model.objectsInCurrentRegion[k];
  5127. int i1 = l & 0x7f;
  5128. int j1 = l >> 7 & 0x7f;
  5129. int k1 = l >> 29 & 3;
  5130. int l1 = l >> 14 & 0x7fff;
  5131. if(l == j)
  5132. continue;
  5133. j = l;
  5134. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5135. l1 = Model.renderedObjectId[k];
  5136. ObjectDef class46 = ObjectDef.forID(l1);
  5137. if(class46.childrenIDs != null)
  5138. class46 = class46.method580();
  5139. if(class46 == null || class46.name == null || class46.name.equals("null"))
  5140. continue;
  5141. if(itemSelected == 1) {
  5142. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  5143. menuActionIds[menuActionRow] = 62;
  5144. menuActionCmd1[menuActionRow] = l;
  5145. menuActionCmd2[menuActionRow] = i1;
  5146. menuActionCmd3[menuActionRow] = j1;
  5147. menuActionCmd4[menuActionRow] = l1;
  5148. menuActionRow++;
  5149. } else if(spellSelected == 1) {
  5150. if((spellUsableOn & 4) == 4) {
  5151. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5152. menuActionIds[menuActionRow] = 956;
  5153. menuActionCmd1[menuActionRow] = l;
  5154. menuActionCmd2[menuActionRow] = i1;
  5155. menuActionCmd3[menuActionRow] = j1;
  5156. menuActionCmd4[menuActionRow] = l1;
  5157. menuActionRow++;
  5158. }
  5159. } else {
  5160. if(class46.actions != null) {
  5161. for(int i2 = 4; i2 >= 0; i2--)
  5162. if(class46.actions[i2] != null) {
  5163. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5164. if(i2 == 0)
  5165. menuActionIds[menuActionRow] = 502;
  5166. if(i2 == 1)
  5167. menuActionIds[menuActionRow] = 900;
  5168. if(i2 == 2)
  5169. menuActionIds[menuActionRow] = 113;
  5170. if(i2 == 3)
  5171. menuActionIds[menuActionRow] = 872;
  5172. if(i2 == 4)
  5173. menuActionIds[menuActionRow] = 1062;
  5174. menuActionCmd1[menuActionRow] = l;
  5175. menuActionCmd2[menuActionRow] = i1;
  5176. menuActionCmd3[menuActionRow] = j1;
  5177. menuActionCmd4[menuActionRow] = l1;
  5178. menuActionRow++;
  5179. }
  5180. }
  5181. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " (Anim: "+class46.anInt781+") (ID: "+ l1 + " / Models: " + class46.anIntArray773[0] +") ";
  5182. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  5183. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@) @gre@(@whi@" + (i1 + baseX) % 8 + "," + (j1 + baseY) % 8 + "@gre@)";
  5184. } else {
  5185. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5186. }
  5187. menuActionIds[menuActionRow] = 1226;
  5188. menuActionCmd1[menuActionRow] = class46.type << 14;
  5189. menuActionCmd2[menuActionRow] = i1;
  5190. menuActionCmd3[menuActionRow] = j1;
  5191. menuActionCmd4[menuActionRow] = l1;
  5192. menuActionRow++;
  5193. }
  5194. }
  5195. if(k1 == 1)
  5196. {
  5197. NPC npc = npcArray[l1];
  5198. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  5199. {
  5200. for(int j2 = 0; j2 < npcCount; j2++)
  5201. {
  5202. NPC npc2 = npcArray[npcIndices[j2]];
  5203. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5204. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5205. }
  5206.  
  5207. for(int l2 = 0; l2 < playerCount; l2++)
  5208. {
  5209. Player player = playerArray[playerIndices[l2]];
  5210. if(player != null && player.x == npc.x && player.y == npc.y)
  5211. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5212. }
  5213.  
  5214. }
  5215. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5216. }
  5217. if(k1 == 0)
  5218. {
  5219. Player player = playerArray[l1];
  5220. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  5221. {
  5222. for(int k2 = 0; k2 < npcCount; k2++)
  5223. {
  5224. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5225. if(class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1 && class30_sub2_sub4_sub1_sub1_2.x == player.x && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  5226. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5227. }
  5228.  
  5229. for(int i3 = 0; i3 < playerCount; i3++)
  5230. {
  5231. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5232. if(class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player && class30_sub2_sub4_sub1_sub2_2.x == player.x && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  5233. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5234. }
  5235.  
  5236. }
  5237. buildAtPlayerMenu(i1, l1, player, j1);
  5238. }
  5239. if(k1 == 3)
  5240. {
  5241. NodeList class19 = groundArray[plane][i1][j1];
  5242. if(class19 != null)
  5243. {
  5244. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5245. {
  5246. ItemDef itemDef = ItemDef.forID(item.ID);
  5247. if(itemSelected == 1)
  5248. {
  5249. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5250. menuActionIds[menuActionRow] = 511;
  5251. menuActionCmd1[menuActionRow] = item.ID;
  5252. menuActionCmd2[menuActionRow] = i1;
  5253. menuActionCmd3[menuActionRow] = j1;
  5254. menuActionRow++;
  5255. } else
  5256. if(spellSelected == 1)
  5257. {
  5258. if((spellUsableOn & 1) == 1)
  5259. {
  5260. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5261. menuActionIds[menuActionRow] = 94;
  5262. menuActionCmd1[menuActionRow] = item.ID;
  5263. menuActionCmd2[menuActionRow] = i1;
  5264. menuActionCmd3[menuActionRow] = j1;
  5265. menuActionRow++;
  5266. }
  5267. } else
  5268. {
  5269. for(int j3 = 4; j3 >= 0; j3--)
  5270. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5271. {
  5272. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5273. if(j3 == 0)
  5274. menuActionIds[menuActionRow] = 652;
  5275. if(j3 == 1)
  5276. menuActionIds[menuActionRow] = 567;
  5277. if(j3 == 2)
  5278. menuActionIds[menuActionRow] = 234;
  5279. if(j3 == 3)
  5280. menuActionIds[menuActionRow] = 244;
  5281. if(j3 == 4)
  5282. menuActionIds[menuActionRow] = 213;
  5283. menuActionCmd1[menuActionRow] = item.ID;
  5284. menuActionCmd2[menuActionRow] = i1;
  5285. menuActionCmd3[menuActionRow] = j1;
  5286. menuActionRow++;
  5287. } else
  5288. if(j3 == 2)
  5289. {
  5290. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5291. menuActionIds[menuActionRow] = 234;
  5292. menuActionCmd1[menuActionRow] = item.ID;
  5293. menuActionCmd2[menuActionRow] = i1;
  5294. menuActionCmd3[menuActionRow] = j1;
  5295. menuActionRow++;
  5296. }
  5297. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  5298. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5299. } else {
  5300. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5301. }
  5302. menuActionIds[menuActionRow] = 1448;
  5303. menuActionCmd1[menuActionRow] = item.ID;
  5304. menuActionCmd2[menuActionRow] = i1;
  5305. menuActionCmd3[menuActionRow] = j1;
  5306. menuActionRow++;
  5307. }
  5308. }
  5309.  
  5310. }
  5311. }
  5312. }
  5313. }
  5314.  
  5315. public void cleanUpForQuit() {
  5316. SignLink.reporterror = false;
  5317. try {
  5318. if (socketStream != null)
  5319. socketStream.close();
  5320. } catch (Exception _ex) {
  5321. }
  5322. HPBarFull = null;
  5323. HPBarEmpty = null;
  5324. socketStream = null;
  5325. stopMidi();
  5326. if (mouseDetection != null)
  5327. mouseDetection.running = false;
  5328. mapIcon = null;
  5329. mouseDetection = null;
  5330. onDemandFetcher.disable();
  5331. onDemandFetcher = null;
  5332. aStream_834 = null;
  5333. stream = null;
  5334. aStream_847 = null;
  5335. inStream = null;
  5336. anIntArray1234 = null;
  5337. aByteArrayArray1183 = null;
  5338. aByteArrayArray1247 = null;
  5339. anIntArray1235 = null;
  5340. anIntArray1236 = null;
  5341. intGroundArray = null;
  5342. byteGroundArray = null;
  5343. worldController = null;
  5344. aClass11Array1230 = null;
  5345. anIntArrayArray901 = null;
  5346. anIntArrayArray825 = null;
  5347.  
  5348. chatArea = null;
  5349. chatButtons = null;
  5350. tabArea = null;
  5351. mapArea = null;
  5352. ORBS = null;
  5353. worldMapIcon = null;
  5354. logIconH = null;
  5355. logIconC = null;
  5356.  
  5357. bigX = null;
  5358. bigY = null;
  5359. aByteArray912 = null;
  5360. aRSImageProducer_1163 = null;
  5361. mapEdgeIP = null;
  5362. leftFrame = null;
  5363. topFrame = null;
  5364. rightFrame = null;
  5365. aRSImageProducer_1164 = null;
  5366. aRSImageProducer_1165 = null;
  5367. aRSImageProducer_1166 = null;
  5368. aRSImageProducer_1123 = null;
  5369. aRSImageProducer_1124 = null;
  5370. aRSImageProducer_1125 = null;
  5371. /* Null pointers for custom sprites */
  5372. multiOverlay = null;
  5373. chatArea = null;
  5374. chatButtons = null;
  5375. tabArea = null;
  5376. /**/
  5377. sideIcons = null;
  5378. redStones = null;
  5379. compass = null;
  5380. hitMarks = null;
  5381. headIcons = null;
  5382. skullIcons = null;
  5383. headIconsHint = null;
  5384. crosses = null;
  5385. mapDotItem = null;
  5386. mapDotNPC = null;
  5387. mapDotPlayer = null;
  5388. mapDotFriend = null;
  5389. mapDotTeam = null;
  5390. mapScenes = null;
  5391. mapFunctions = null;
  5392. anIntArrayArray929 = null;
  5393. playerArray = null;
  5394. playerIndices = null;
  5395. anIntArray894 = null;
  5396. aStreamArray895s = null;
  5397. anIntArray840 = null;
  5398. npcArray = null;
  5399. npcIndices = null;
  5400. groundArray = null;
  5401. aClass19_1179 = null;
  5402. aClass19_1013 = null;
  5403. aClass19_1056 = null;
  5404. menuActionCmd2 = null;
  5405. menuActionCmd3 = null;
  5406. menuActionCmd4 = null;
  5407. menuActionIds = null;
  5408. menuActionCmd1 = null;
  5409. menuActionName = null;
  5410. variousSettings = null;
  5411. anIntArray1072 = null;
  5412. anIntArray1073 = null;
  5413. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5414. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5415. friendsList = null;
  5416. friendsListAsLongs = null;
  5417. friendsNodeIDs = null;
  5418. aRSImageProducer_1110 = null;
  5419. aRSImageProducer_1111 = null;
  5420. aRSImageProducer_1107 = null;
  5421. aRSImageProducer_1108 = null;
  5422. aRSImageProducer_1109 = null;
  5423. aRSImageProducer_1112 = null;
  5424. aRSImageProducer_1113 = null;
  5425. aRSImageProducer_1114 = null;
  5426. aRSImageProducer_1115 = null;
  5427. nullLoader();
  5428. ObjectDef.nullLoader();
  5429. EntityDef.nullLoader();
  5430. ItemDef.nullLoader();
  5431. Flo.cache = null;
  5432. IDK.cache = null;
  5433. RSInterface.interfaceCache = null;
  5434. Animation.anims = null;
  5435. SpotAnim.cache = null;
  5436. SpotAnim.aMRUNodes_415 = null;
  5437. Varp.cache = null;
  5438. super.fullGameScreen = null;
  5439. Player.mruNodes = null;
  5440. Rasterizer.nullLoader();
  5441. WorldController.nullLoader();
  5442. Model.nullLoader();
  5443. Class36.nullLoader();
  5444. System.gc();
  5445. }
  5446.  
  5447. public void printDebug() {
  5448. System.out.println("============");
  5449. System.out.println("flame-cycle:" + anInt1208);
  5450. if (onDemandFetcher != null)
  5451. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5452. System.out.println("loop-cycle:" + loopCycle);
  5453. System.out.println("draw-cycle:" + anInt1061);
  5454. System.out.println("ptype:" + pktType);
  5455. System.out.println("psize:" + pktSize);
  5456. if (socketStream != null)
  5457. socketStream.printDebug();
  5458. super.shouldDebug = true;
  5459. }
  5460.  
  5461. Component getGameComponent() {
  5462. if (SignLink.mainapp != null)
  5463. return SignLink.mainapp;
  5464. if (super.gameFrame != null)
  5465. return super.gameFrame;
  5466. else
  5467. return this;
  5468. }
  5469.  
  5470. public void pmTabToReply() {
  5471. String name = null;
  5472. for (int k = 0; k < 100; k++) {
  5473. if (chatMessages[k] == null) {
  5474. continue;
  5475. }
  5476. int l = chatTypes[k];
  5477. if (l == 3 || l == 7) {
  5478. name = chatNames[k];
  5479. break;
  5480. }
  5481. }
  5482.  
  5483. if (name == null) {
  5484. pushMessage("You haven't received any messages to which you can reply.", 0, "");
  5485. return;
  5486. }
  5487.  
  5488. if (name.startsWith("@cr")) {
  5489. name = name.substring(5);
  5490. }
  5491.  
  5492. long nameAsLong = TextClass.longForName(name.trim());
  5493. int k3 = -1;
  5494. for (int i4 = 0; i4 < friendsCount; i4++) {
  5495. if (friendsListAsLongs[i4] != nameAsLong)
  5496. continue;
  5497. k3 = i4;
  5498. break;
  5499. }
  5500.  
  5501. if (k3 != -1) {
  5502. if (friendsNodeIDs[k3] > 0) {
  5503. inputTaken = true;
  5504. inputDialogState = 0;
  5505. messagePromptRaised = true;
  5506. promptInput = "";
  5507. friendsListAction = 3;
  5508. aLong953 = friendsListAsLongs[k3];
  5509. aString1121 = "Enter message to send to " + friendsList[k3];
  5510. } else {
  5511. pushMessage("That player is currently offline.", 0, "");
  5512. }
  5513. }
  5514. }
  5515.  
  5516. public class ObjectSizes {
  5517. int objectId, sizeX, sizeY;
  5518.  
  5519. public ObjectSizes() {
  5520. }
  5521.  
  5522. public ObjectSizes(int objectId, int sizeX, int sizeY) {
  5523. this.objectId = objectId;
  5524. this.sizeX = sizeX;
  5525. this.sizeY = sizeY;
  5526. }
  5527.  
  5528. public int getObjectId() {
  5529. return objectId;
  5530. }
  5531.  
  5532. public void setObjectId(int objectId) {
  5533. this.objectId = objectId;
  5534. }
  5535.  
  5536. public int getSizeX() {
  5537. return sizeX;
  5538. }
  5539.  
  5540. public void setSizeX(int sizeX) {
  5541. this.sizeX = sizeX;
  5542. }
  5543.  
  5544. public int getSizeY() {
  5545. return sizeY;
  5546. }
  5547.  
  5548. public void setSizeY(int sizeY) {
  5549. this.sizeY = sizeY;
  5550. }
  5551. }
  5552.  
  5553. public void method73() {
  5554. do {
  5555. int j = readChar(-796);
  5556. if(j == -1)
  5557. break;
  5558. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5559. if(j == 8 && reportAbuseInput.length() > 0)
  5560. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5561. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5562. reportAbuseInput += (char)j;
  5563. } else if(messagePromptRaised) {
  5564. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5565. promptInput += (char)j;
  5566. inputTaken = true;
  5567. }
  5568. if(j == 8 && promptInput.length() > 0) {
  5569. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5570. inputTaken = true;
  5571. }
  5572. if(j == 13 || j == 10) {
  5573. messagePromptRaised = false;
  5574. inputTaken = true;
  5575. if(friendsListAction == 1) {
  5576. long l = TextClass.longForName(promptInput);
  5577. addFriend(l);
  5578. }
  5579. if(friendsListAction == 2 && friendsCount > 0) {
  5580. long l1 = TextClass.longForName(promptInput);
  5581. delFriend(l1);
  5582. }
  5583. if(friendsListAction == 3 && promptInput.length() > 0) {
  5584. stream.createFrame(126);
  5585. stream.writeWordBigEndian(0);
  5586. int k = stream.currentOffset;
  5587. stream.writeQWord(aLong953);
  5588. TextInput.method526(promptInput, stream);
  5589. stream.writeBytes(stream.currentOffset - k);
  5590. promptInput = TextInput.processText(promptInput);
  5591. //promptInput = Censor.doCensor(promptInput);
  5592. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5593. if(publicChatMode == 2) {
  5594. publicChatMode = 1;
  5595. stream.createFrame(95);
  5596. stream.writeWordBigEndian(publicChatMode);
  5597. stream.writeWordBigEndian(publicChatMode);
  5598. stream.writeWordBigEndian(tradeMode);
  5599. }
  5600. }
  5601. if(friendsListAction == 4 && ignoreCount < 100) {
  5602. long l2 = TextClass.longForName(promptInput);
  5603. addIgnore(l2);
  5604. }
  5605. if(friendsListAction == 5 && ignoreCount > 0) {
  5606. long l3 = TextClass.longForName(promptInput);
  5607. delIgnore(l3);
  5608. }
  5609. if(friendsListAction == 6) {
  5610. long l3 = TextClass.longForName(promptInput);
  5611. chatJoin(l3);
  5612. }
  5613. }
  5614. } else if (inputDialogState == 1) {
  5615. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5616. amountOrNameInput += (char) j;
  5617. inputTaken = true;
  5618. }
  5619. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  5620. amountOrNameInput += (char) j;
  5621. inputTaken = true;
  5622. }
  5623. if (j == 8 && amountOrNameInput.length() > 0) {
  5624. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5625. inputTaken = true;
  5626. }
  5627. if (j == 13 || j == 10) {
  5628. if (amountOrNameInput.length() > 0) {
  5629. if (amountOrNameInput.toLowerCase().contains("k")) {
  5630. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  5631. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  5632. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  5633. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  5634. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  5635. }
  5636.  
  5637. long amount = Long.parseLong(amountOrNameInput);
  5638.  
  5639. if (amount > Integer.MAX_VALUE) {
  5640. amount = Integer.MAX_VALUE;
  5641. }
  5642.  
  5643. stream.createFrame(208);
  5644. stream.writeDWord((int) amount);
  5645. }
  5646. inputDialogState = 0;
  5647. inputTaken = true;
  5648. }
  5649. } else if(inputDialogState == 2) {
  5650. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5651. amountOrNameInput += (char)j;
  5652. inputTaken = true;
  5653. }
  5654. if(j == 8 && amountOrNameInput.length() > 0) {
  5655. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5656. inputTaken = true;
  5657. }
  5658. if(j == 13 || j == 10) {
  5659. if(amountOrNameInput.length() > 0) {
  5660. stream.createFrame(60);
  5661. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5662. }
  5663. inputDialogState = 0;
  5664. inputTaken = true;
  5665. }
  5666. } else if(backDialogID == -1) {
  5667. if(j >= 32 && j <= 122 && inputString.length() < 100) {
  5668. inputString += (char) j;
  5669. inputString = inputString.replaceAll("<[^>]*>", "").replaceAll("@[^@]*@", "").replaceAll(":tradereq:", "").replaceAll(":duelreq:", "");
  5670. inputTaken = true;
  5671. }
  5672. if(j == 8 && inputString.length() > 0) {
  5673. inputString = inputString.substring(0, inputString.length() - 1);
  5674. inputTaken = true;
  5675. }
  5676. if (j == 9)
  5677. pmTabToReply();
  5678. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5679. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  5680. if (inputString.startsWith("//setspecto")) {
  5681. int amt = Integer.parseInt(inputString
  5682. .substring(12));
  5683. anIntArray1045[300] = amt;
  5684. if (variousSettings[300] != amt) {
  5685. variousSettings[300] = amt;
  5686. method33(300);
  5687. needDrawTabArea = true;
  5688. if (dialogID != -1)
  5689. inputTaken = true;
  5690. }
  5691. }
  5692. if (inputString.equals("::clientdrop"))
  5693. dropClient();
  5694. /*if (inputString.startsWith("full")) {
  5695. try {
  5696. String[] args = inputString.split(" ");
  5697. int id1 = Integer.parseInt(args[1]);
  5698. int id2 = Integer.parseInt(args[2]);
  5699. fullscreenInterfaceID = id1;
  5700. openInterfaceID = id2;
  5701. pushMessage("Opened Interface", 0, "");
  5702. } catch (Exception e) {
  5703. pushMessage("Interface Failed to load", 0, "");
  5704. }
  5705. }*/
  5706. if (inputString.equals("::lag"))
  5707. printDebug();
  5708. /*if (inputString.equals("::prefetchmusic")) {
  5709. for (int j1 = 0; j1 < onDemandFetcher
  5710. .getVersionCount(2); j1++)
  5711. onDemandFetcher.method563((byte) 1, 2, j1);
  5712.  
  5713. }
  5714. if (inputString.equals("::maps"))
  5715. addMaps();
  5716. if (inputString.equals("::models"))
  5717. addModels();*/
  5718. if (inputString.equals("::fpson"))
  5719. fpsOn = true;
  5720. if (inputString.equals("::fpsoff"))
  5721. fpsOn = false;
  5722. if (inputString.equals("::dataon"))
  5723. clientData = true;
  5724. if (inputString.equals("::dataoff"))
  5725. clientData = false;
  5726. if (inputString.equals("::noclip")) {
  5727. for (int k1 = 0; k1 < 4; k1++) {
  5728. for (int i2 = 1; i2 < 103; i2++) {
  5729. for (int k2 = 1; k2 < 103; k2++)
  5730. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5731. }
  5732. }
  5733. }
  5734. /*if (inputString.equals("dump")) {
  5735. List<ObjectDef> list = new ArrayList<ObjectDef>();
  5736. for (int i = 0; i < ObjectDef.totalObjects; i++) {
  5737. ObjectDef object = ObjectDef.forID(i);
  5738. System.out.println(new Gson().toJson(object));
  5739. list.add(object.type, object);
  5740. }
  5741.  
  5742. // System.out.println(new Gson().toJson(list));
  5743.  
  5744. PrintWriter writer;
  5745. try {
  5746. writer = new PrintWriter("./objects.json", "UTF-8");
  5747. writer.println(new Gson().toJson(list));
  5748. writer.close();
  5749. } catch (Exception e) {
  5750. e.printStackTrace();
  5751. }
  5752. }*/
  5753. if (inputString.equals("::sprites")) {
  5754. if (Sprite.sprites.size() == 0) {
  5755. Sprite.walk(SignLink.findcachedir() + "Sprites");
  5756. }
  5757.  
  5758. for (String sprite : Sprite.spritesInUse) {
  5759. if (!Sprite.sprites.contains(sprite)) {
  5760. /*File file = new File(sprite);
  5761. file.delete();*/
  5762. System.out.println(sprite);
  5763. }
  5764. }
  5765.  
  5766. System.out.println(Sprite.sprites.size() + "-" + Sprite.spritesInUse.size());
  5767. }
  5768. if (inputString.equals("::rsint")) {
  5769. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  5770. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  5771. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  5772. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  5773. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  5774. };
  5775. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  5776. }
  5777. }
  5778.  
  5779. /*if (inputString.equals("add model")) {
  5780. try {
  5781. int ModelIndex = Integer.parseInt(JOptionPane
  5782. .showInputDialog(this, "Enter model ID",
  5783. "Model", 3));
  5784. byte[] abyte0 = getModel(ModelIndex);
  5785. if (abyte0 != null && abyte0.length > 0) {
  5786. decompressors[1].method234(abyte0.length,
  5787. abyte0, ModelIndex);
  5788. pushMessage("Model: [" + ModelIndex
  5789. + "] added successfully!", 0, "");
  5790. } else {
  5791. pushMessage("Unable to find the model. "
  5792. + ModelIndex, 0, "");
  5793. }
  5794. } catch (Exception e) {
  5795. pushMessage("Syntax - ::add model <path>", 0, "");
  5796. }
  5797. }
  5798. if (inputString.equalsIgnoreCase("hd")) {
  5799. disableUnderlayTexture = !disableUnderlayTexture;
  5800. disableOverlayTexture = !disableOverlayTexture;
  5801. }*/
  5802. if(inputString.startsWith("/"))
  5803. inputString = "::" + inputString;
  5804. if (inputString.startsWith("::")) {
  5805. stream.createFrame(103);
  5806. stream.writeWordBigEndian(inputString.length() - 1);
  5807. stream.writeString(inputString.substring(2));
  5808. } else {
  5809. String s = inputString.toLowerCase();
  5810. int j2 = 0;
  5811. if (s.startsWith("yellow:")) {
  5812. j2 = 0;
  5813. inputString = inputString.substring(7);
  5814. } else if (s.startsWith("red:")) {
  5815. j2 = 1;
  5816. inputString = inputString.substring(4);
  5817. } else if (s.startsWith("green:")) {
  5818. j2 = 2;
  5819. inputString = inputString.substring(6);
  5820. } else if (s.startsWith("cyan:")) {
  5821. j2 = 3;
  5822. inputString = inputString.substring(5);
  5823. } else if (s.startsWith("purple:")) {
  5824. j2 = 4;
  5825. inputString = inputString.substring(7);
  5826. } else if (s.startsWith("white:")) {
  5827. j2 = 5;
  5828. inputString = inputString.substring(6);
  5829. } else if (s.startsWith("flash1:")) {
  5830. j2 = 6;
  5831. inputString = inputString.substring(7);
  5832. } else if (s.startsWith("flash2:")) {
  5833. j2 = 7;
  5834. inputString = inputString.substring(7);
  5835. } else if (s.startsWith("flash3:")) {
  5836. j2 = 8;
  5837. inputString = inputString.substring(7);
  5838. } else if (s.startsWith("glow1:")) {
  5839. j2 = 9;
  5840. inputString = inputString.substring(6);
  5841. } else if (s.startsWith("glow2:")) {
  5842. j2 = 10;
  5843. inputString = inputString.substring(6);
  5844. } else if (s.startsWith("glow3:")) {
  5845. j2 = 11;
  5846. inputString = inputString.substring(6);
  5847. }
  5848. s = inputString.toLowerCase();
  5849. int i3 = 0;
  5850. if (s.startsWith("wave:")) {
  5851. i3 = 1;
  5852. inputString = inputString.substring(5);
  5853. } else if (s.startsWith("wave2:")) {
  5854. i3 = 2;
  5855. inputString = inputString.substring(6);
  5856. } else if (s.startsWith("shake:")) {
  5857. i3 = 3;
  5858. inputString = inputString.substring(6);
  5859. } else if (s.startsWith("scroll:")) {
  5860. i3 = 4;
  5861. inputString = inputString.substring(7);
  5862. } else if (s.startsWith("slide:")) {
  5863. i3 = 5;
  5864. inputString = inputString.substring(6);
  5865. }
  5866. stream.createFrame(4);
  5867. stream.writeWordBigEndian(0);
  5868. int j3 = stream.currentOffset;
  5869. stream.method425(i3);
  5870. stream.method425(j2);
  5871. aStream_834.currentOffset = 0;
  5872. TextInput.method526(inputString, aStream_834);
  5873. stream.method441(0, aStream_834.buffer,
  5874. aStream_834.currentOffset);
  5875. stream.writeBytes(stream.currentOffset - j3);
  5876. inputString = TextInput.processText(inputString);
  5877. // inputString = Censor.doCensor(inputString);
  5878. myPlayer.textSpoken = inputString;
  5879. myPlayer.anInt1513 = j2;
  5880. myPlayer.anInt1531 = i3;
  5881. myPlayer.textCycle = 150;
  5882. if (myPrivilege == 1)
  5883. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5884. else if (myPrivilege == 2)
  5885. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5886. else if (myPrivilege == 3)
  5887. pushMessage(myPlayer.textSpoken, 2, "@cr3@" + myPlayer.name);
  5888. else if (myPrivilege == 4)
  5889. pushMessage(myPlayer.textSpoken, 2, "@cr4@" + myPlayer.name);
  5890. else if (myPrivilege == 5)
  5891. pushMessage(myPlayer.textSpoken, 2, "@cr5@" + myPlayer.name);
  5892. else if (myPrivilege == 6)
  5893. pushMessage(myPlayer.textSpoken, 2, "@cr6@" + myPlayer.name);
  5894. else if (myPrivilege == 7)
  5895. pushMessage(myPlayer.textSpoken, 2, "@cr7@" + myPlayer.name);
  5896. else if (myPrivilege == 8)
  5897. pushMessage(myPlayer.textSpoken, 2, "@cr8@" + myPlayer.name);
  5898. else if (myPrivilege == 9)
  5899. pushMessage(myPlayer.textSpoken, 2, "@cr9@" + myPlayer.name);
  5900. else if (myPrivilege == 10)
  5901. pushMessage(myPlayer.textSpoken, 2, "@cr10@" + myPlayer.name);
  5902. else if (myPrivilege == 11)
  5903. pushMessage(myPlayer.textSpoken, 2, "@cr11@" + myPlayer.name);
  5904. else if (myPrivilege == 12)
  5905. pushMessage(myPlayer.textSpoken, 2, "@cr12@" + myPlayer.name);
  5906. else if (myPrivilege == 13)
  5907. pushMessage(myPlayer.textSpoken, 2, "@cr13@" + myPlayer.name);
  5908. else if (myPrivilege == 14)
  5909. pushMessage(myPlayer.textSpoken, 2, "@cr14@" + myPlayer.name);
  5910. else if (myPrivilege == 15)
  5911. pushMessage(myPlayer.textSpoken, 2, "@cr15@" + myPlayer.name);
  5912. else if (myPrivilege == 16)
  5913. pushMessage(myPlayer.textSpoken, 2, "@cr16@" + myPlayer.name);
  5914. else if (myPrivilege == 17)
  5915. pushMessage(myPlayer.textSpoken, 2, "@cr17@" + myPlayer.name);
  5916. else if (myPrivilege == 18)
  5917. pushMessage(myPlayer.textSpoken, 2, "@cr18@" + myPlayer.name);
  5918. else if (myPrivilege == 19)
  5919. pushMessage(myPlayer.textSpoken, 2, "@cr19@" + myPlayer.name);
  5920. else if (myPrivilege == 20)
  5921. pushMessage(myPlayer.textSpoken, 2, "@cr20@" + myPlayer.name);
  5922. else
  5923. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5924. if (publicChatMode == 2) {
  5925. publicChatMode = 3;
  5926. aBoolean1233 = true;
  5927. stream.createFrame(95);
  5928. stream.writeWordBigEndian(publicChatMode);
  5929. stream.writeWordBigEndian(publicChatMode);
  5930. stream.writeWordBigEndian(tradeMode);
  5931. }
  5932. }
  5933. inputString = "";
  5934. inputTaken = true;
  5935. }
  5936. }
  5937. } while (true);
  5938. }
  5939.  
  5940. @SuppressWarnings("unused")
  5941. public void buildPublicChat(int j) {
  5942. int l = 0;
  5943. for (int i1 = 0; i1 < 500; i1++) {
  5944. if (chatMessages[i1] == null)
  5945. continue;
  5946. if (chatTypeView != 1)
  5947. continue;
  5948. int j1 = chatTypes[i1];
  5949. String s = chatNames[i1];
  5950. String ct = chatMessages[i1];
  5951. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5952. if (k1 < -23)
  5953. break;
  5954. if(s != null && s.startsWith("@cr1@"))
  5955. s = s.substring(5);
  5956. if(s != null && s.startsWith("@cr2@"))
  5957. s = s.substring(5);
  5958. if(s != null && s.startsWith("@cr3@"))
  5959. s = s.substring(5);
  5960. if(s != null && s.startsWith("@cr4@"))
  5961. s = s.substring(5);
  5962. if(s != null && s.startsWith("@cr5@"))
  5963. s = s.substring(5);
  5964. if(s != null && s.startsWith("@cr6@"))
  5965. s = s.substring(5);
  5966. if(s != null && s.startsWith("@cr7@"))
  5967. s = s.substring(5);
  5968. if(s != null && s.startsWith("@cr8@"))
  5969. s = s.substring(5);
  5970. if(s != null && s.startsWith("@cr9@"))
  5971. s = s.substring(5);
  5972. if(s != null && s.startsWith("@cr10@"))
  5973. s = s.substring(6);
  5974. if(s != null && s.startsWith("@cr11@"))
  5975. s = s.substring(6);
  5976. if(s != null && s.startsWith("@cr12@"))
  5977. s = s.substring(6);
  5978. if(s != null && s.startsWith("@cr13@"))
  5979. s = s.substring(6);
  5980. if(s != null && s.startsWith("@cr14@"))
  5981. s = s.substring(6);
  5982. if(s != null && s.startsWith("@cr15@"))
  5983. s = s.substring(6);
  5984. if(s != null && s.startsWith("@cr16@"))
  5985. s = s.substring(6);
  5986. if(s != null && s.startsWith("@cr17@"))
  5987. s = s.substring(6);
  5988. if(s != null && s.startsWith("@cr18@"))
  5989. s = s.substring(6);
  5990. if(s != null && s.startsWith("@cr19@"))
  5991. s = s.substring(6);
  5992. if(s != null && s.startsWith("@cr20@"))
  5993. s = s.substring(6);
  5994. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5995. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5996. if (myPrivilege >= 1) {
  5997. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5998. menuActionIds[menuActionRow] = 606;
  5999. menuActionRow++;
  6000. }
  6001. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6002. menuActionIds[menuActionRow] = 42;
  6003. menuActionRow++;
  6004. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6005. menuActionIds[menuActionRow] = 337;
  6006. menuActionRow++;
  6007. }
  6008. l++;
  6009. }
  6010. }
  6011. }
  6012.  
  6013. @SuppressWarnings("unused")
  6014. public void buildFriendChat(int j) {
  6015. int l = 0;
  6016. for (int i1 = 0; i1 < 500; i1++) {
  6017. if (chatMessages[i1] == null)
  6018. continue;
  6019. if (chatTypeView != 2)
  6020. continue;
  6021. int j1 = chatTypes[i1];
  6022. String s = chatNames[i1];
  6023. String ct = chatMessages[i1];
  6024. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6025. if (k1 < -23)
  6026. break;
  6027. if(s != null && s.startsWith("@cr1@"))
  6028. s = s.substring(5);
  6029. if(s != null && s.startsWith("@cr2@"))
  6030. s = s.substring(5);
  6031. if(s != null && s.startsWith("@cr3@"))
  6032. s = s.substring(5);
  6033. if(s != null && s.startsWith("@cr4@"))
  6034. s = s.substring(5);
  6035. if(s != null && s.startsWith("@cr5@"))
  6036. s = s.substring(5);
  6037. if(s != null && s.startsWith("@cr6@"))
  6038. s = s.substring(5);
  6039. if(s != null && s.startsWith("@cr7@"))
  6040. s = s.substring(5);
  6041. if(s != null && s.startsWith("@cr8@"))
  6042. s = s.substring(5);
  6043. if(s != null && s.startsWith("@cr9@"))
  6044. s = s.substring(5);
  6045. if(s != null && s.startsWith("@cr10@"))
  6046. s = s.substring(6);
  6047. if(s != null && s.startsWith("@cr11@"))
  6048. s = s.substring(6);
  6049. if(s != null && s.startsWith("@cr12@"))
  6050. s = s.substring(6);
  6051. if(s != null && s.startsWith("@cr13@"))
  6052. s = s.substring(6);
  6053. if(s != null && s.startsWith("@cr14@"))
  6054. s = s.substring(6);
  6055. if(s != null && s.startsWith("@cr15@"))
  6056. s = s.substring(6);
  6057. if(s != null && s.startsWith("@cr16@"))
  6058. s = s.substring(6);
  6059. if(s != null && s.startsWith("@cr17@"))
  6060. s = s.substring(6);
  6061. if(s != null && s.startsWith("@cr18@"))
  6062. s = s.substring(6);
  6063. if(s != null && s.startsWith("@cr19@"))
  6064. s = s.substring(6);
  6065. if(s != null && s.startsWith("@cr20@"))
  6066. s = s.substring(6);
  6067. if ((j1 == 5 || j1 == 6)
  6068. && (splitpublicChat == 0 || chatTypeView == 2)
  6069. && (j1 == 6 || publicChatMode == 0 || publicChatMode == 1
  6070. && isFriendOrSelf(s)))
  6071. l++;
  6072. if ((j1 == 3 || j1 == 7)
  6073. && (splitpublicChat == 0 || chatTypeView == 2)
  6074. && (j1 == 7 || publicChatMode == 0 || publicChatMode == 1
  6075. && isFriendOrSelf(s))) {
  6076. if (j > k1 - 14 && j <= k1) {
  6077. if (myPrivilege >= 1) {
  6078. menuActionName[menuActionRow] = "Report abuse @whi@"
  6079. + s;
  6080. menuActionIds[menuActionRow] = 606;
  6081. menuActionRow++;
  6082. }
  6083. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6084. menuActionIds[menuActionRow] = 42;
  6085. menuActionRow++;
  6086. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6087. menuActionIds[menuActionRow] = 337;
  6088. menuActionRow++;
  6089. }
  6090. l++;
  6091. }
  6092. }
  6093. }
  6094.  
  6095. public void buildDuelorTrade(int j) {
  6096. int l = 0;
  6097. for (int i1 = 0; i1 < 500; i1++) {
  6098. if (chatMessages[i1] == null)
  6099. continue;
  6100. if (chatTypeView != 3 && chatTypeView != 4)
  6101. continue;
  6102. int j1 = chatTypes[i1];
  6103. String s = chatNames[i1];
  6104. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6105. if (k1 < -23)
  6106. break;
  6107. if(s != null && s.startsWith("@cr1@"))
  6108. s = s.substring(5);
  6109. if(s != null && s.startsWith("@cr2@"))
  6110. s = s.substring(5);
  6111. if(s != null && s.startsWith("@cr3@"))
  6112. s = s.substring(5);
  6113. if(s != null && s.startsWith("@cr4@"))
  6114. s = s.substring(5);
  6115. if(s != null && s.startsWith("@cr5@"))
  6116. s = s.substring(5);
  6117. if(s != null && s.startsWith("@cr6@"))
  6118. s = s.substring(5);
  6119. if(s != null && s.startsWith("@cr7@"))
  6120. s = s.substring(5);
  6121. if(s != null && s.startsWith("@cr8@"))
  6122. s = s.substring(5);
  6123. if(s != null && s.startsWith("@cr9@"))
  6124. s = s.substring(5);
  6125. if(s != null && s.startsWith("@cr10@"))
  6126. s = s.substring(6);
  6127. if(s != null && s.startsWith("@cr11@"))
  6128. s = s.substring(6);
  6129. if(s != null && s.startsWith("@cr12@"))
  6130. s = s.substring(6);
  6131. if(s != null && s.startsWith("@cr13@"))
  6132. s = s.substring(6);
  6133. if(s != null && s.startsWith("@cr14@"))
  6134. s = s.substring(6);
  6135. if(s != null && s.startsWith("@cr15@"))
  6136. s = s.substring(6);
  6137. if(s != null && s.startsWith("@cr16@"))
  6138. s = s.substring(6);
  6139. if(s != null && s.startsWith("@cr17@"))
  6140. s = s.substring(6);
  6141. if(s != null && s.startsWith("@cr18@"))
  6142. s = s.substring(6);
  6143. if(s != null && s.startsWith("@cr19@"))
  6144. s = s.substring(6);
  6145. if(s != null && s.startsWith("@cr20@"))
  6146. s = s.substring(6);
  6147. if (chatTypeView == 3 && j1 == 4
  6148. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6149. if (j > k1 - 14 && j <= k1) {
  6150. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6151. menuActionIds[menuActionRow] = 484;
  6152. menuActionRow++;
  6153. }
  6154. l++;
  6155. }
  6156. if (chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6157. if (j > k1 - 14 && j <= k1) {
  6158. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6159. + s;
  6160. menuActionIds[menuActionRow] = 6;
  6161. menuActionRow++;
  6162. }
  6163. l++;
  6164. }
  6165. if(chatTypeView == 4 && j1 == 15 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6166. if(j > k1 - 14 && j <= k1) {
  6167. menuActionName[menuActionRow] = "Accept party invite @whi@" + s;
  6168. menuActionIds[menuActionRow] = 424;
  6169. menuActionRow++;
  6170. }
  6171. l++;
  6172. }
  6173. if (j1 == 12) {
  6174. if (j > k1 - 14 && j <= k1) {
  6175. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6176. menuActionIds[menuActionRow] = 915;
  6177. menuActionRow++;
  6178. }
  6179. l++;
  6180. }
  6181. }
  6182. }
  6183.  
  6184. @SuppressWarnings("unused")
  6185. public void buildChatAreaMenu(int j) {
  6186. int l = 0;
  6187. int test = 0;
  6188. for (int i1 = 0; i1 < 500; i1++) {
  6189. if (chatMessages[i1] == null)
  6190. continue;
  6191. int j1 = chatTypes[i1];
  6192. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6193. if (k1 < -23)
  6194. break;
  6195. String s = chatNames[i1];
  6196. String ct = chatMessages[i1];
  6197. boolean flag = false;
  6198. if (chatTypeView == 1) {
  6199. buildPublicChat(j);
  6200. break;
  6201. }
  6202. if (chatTypeView == 2) {
  6203. buildFriendChat(j);
  6204. break;
  6205. }
  6206. if (chatTypeView == 3 || chatTypeView == 4) {
  6207. buildDuelorTrade(j);
  6208. break;
  6209. }
  6210. if (chatTypeView == 5) {
  6211. break;
  6212. }
  6213. if(s != null && s.startsWith("@cr1@")) {
  6214. s = s.substring(5);
  6215. }
  6216. if(s != null && s.startsWith("@cr2@")) {
  6217. s = s.substring(5);
  6218. }
  6219. if(s != null && s.startsWith("@cr3@")) {
  6220. s = s.substring(5);
  6221. }
  6222. if(s != null && s.startsWith("@cr4@")) {
  6223. s = s.substring(5);
  6224. }
  6225. if(s != null && s.startsWith("@cr5@")) {
  6226. s = s.substring(5);
  6227. }
  6228. if(s != null && s.startsWith("@cr6@")) {
  6229. s = s.substring(5);
  6230. }
  6231. if(s != null && s.startsWith("@cr7@")) {
  6232. s = s.substring(5);
  6233. }
  6234. if(s != null && s.startsWith("@cr8@")) {
  6235. s = s.substring(5);
  6236. }
  6237. if(s != null && s.startsWith("@cr9@")) {
  6238. s = s.substring(5);
  6239. }
  6240. if(s != null && s.startsWith("@cr10@")) {
  6241. s = s.substring(6);
  6242. }
  6243. if(s != null && s.startsWith("@cr11@")) {
  6244. s = s.substring(6);
  6245. }
  6246. if(s != null && s.startsWith("@cr12@")) {
  6247. s = s.substring(6);
  6248. }
  6249. if(s != null && s.startsWith("@cr13@")) {
  6250. s = s.substring(6);
  6251. }
  6252. if(s != null && s.startsWith("@cr14@")) {
  6253. s = s.substring(6);
  6254. }
  6255. if(s != null && s.startsWith("@cr15@")) {
  6256. s = s.substring(6);
  6257. }
  6258. if(s != null && s.startsWith("@cr16@")) {
  6259. s = s.substring(6);
  6260. }
  6261. if(s != null && s.startsWith("@cr17@")) {
  6262. s = s.substring(6);
  6263. }
  6264. if(s != null && s.startsWith("@cr18@")) {
  6265. s = s.substring(6);
  6266. }
  6267. if(s != null && s.startsWith("@cr19@")) {
  6268. s = s.substring(6);
  6269. }
  6270. if(s != null && s.startsWith("@cr20@")) {
  6271. s = s.substring(6);
  6272. }
  6273. if (j1 == 0)
  6274. l++;
  6275. if ((j1 == 1 || j1 == 2)
  6276. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6277. && isFriendOrSelf(s))) {
  6278. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6279. if (myPrivilege >= 1) {
  6280. menuActionName[menuActionRow] = "Report abuse @whi@"
  6281. + s;
  6282. menuActionIds[menuActionRow] = 606;
  6283. menuActionRow++;
  6284. }
  6285. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6286. menuActionIds[menuActionRow] = 42;
  6287. menuActionRow++;
  6288. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6289. menuActionIds[menuActionRow] = 337;
  6290. menuActionRow++;
  6291. }
  6292. l++;
  6293. }
  6294. if ((j1 == 3 || j1 == 7)
  6295. && splitpublicChat == 0
  6296. && (j1 == 7 || publicChatMode == 0 || publicChatMode == 1
  6297. && isFriendOrSelf(s))) {
  6298. if (j > k1 - 14 && j <= k1) {
  6299. if (myPrivilege >= 1) {
  6300. menuActionName[menuActionRow] = "Report abuse @whi@"
  6301. + s;
  6302. menuActionIds[menuActionRow] = 606;
  6303. menuActionRow++;
  6304. }
  6305. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6306. menuActionIds[menuActionRow] = 42;
  6307. menuActionRow++;
  6308. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6309. menuActionIds[menuActionRow] = 337;
  6310. menuActionRow++;
  6311. }
  6312. l++;
  6313. }
  6314. if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6315. if (j > k1 - 14 && j <= k1) {
  6316. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6317. menuActionIds[menuActionRow] = 484;
  6318. menuActionRow++;
  6319. }
  6320. l++;
  6321. }
  6322. if ((j1 == 5 || j1 == 6) && splitpublicChat == 0
  6323. && publicChatMode < 2)
  6324. l++;
  6325. if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6326. if (j > k1 - 14 && j <= k1) {
  6327. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6328. + s;
  6329. menuActionIds[menuActionRow] = 6;
  6330. menuActionRow++;
  6331. }
  6332. l++;
  6333. }
  6334. if(j1 == 15 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6335. if(j > k1 - 14 && j <= k1) {
  6336. menuActionName[menuActionRow] = "Accept party invite @whi@" + s;
  6337. menuActionIds[menuActionRow] = 424;
  6338. menuActionRow++;
  6339. }
  6340. l++;
  6341. }
  6342. }
  6343. }
  6344.  
  6345. public void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6346. int j = class9.contentType;
  6347. if(j >= 205 && j <= 205+25){
  6348. j -= 205;
  6349. class9.message = setMessage(j);
  6350. return;
  6351. }
  6352. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6353. if (j == 1 && anInt900 == 0) {
  6354. class9.message = "Loading friend list";
  6355. class9.atActionType = 0;
  6356. return;
  6357. }
  6358. if (j == 1 && anInt900 == 1) {
  6359. class9.message = "Connecting to friendserver";
  6360. class9.atActionType = 0;
  6361. return;
  6362. }
  6363. if (j == 2 && anInt900 != 2) {
  6364. class9.message = "Please wait...";
  6365. class9.atActionType = 0;
  6366. return;
  6367. }
  6368. int k = friendsCount;
  6369. if (anInt900 != 2)
  6370. k = 0;
  6371. if (j > 700)
  6372. j -= 601;
  6373. else
  6374. j--;
  6375. if (j >= k) {
  6376. class9.message = "";
  6377. class9.atActionType = 0;
  6378. return;
  6379. } else {
  6380. class9.message = friendsList[j];
  6381. class9.atActionType = 1;
  6382. return;
  6383. }
  6384. }
  6385. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6386. int l = friendsCount;
  6387. if (anInt900 != 2)
  6388. l = 0;
  6389. if (j > 800)
  6390. j -= 701;
  6391. else
  6392. j -= 101;
  6393. if (j >= l) {
  6394. class9.message = "";
  6395. class9.atActionType = 0;
  6396. return;
  6397. }
  6398. if (friendsNodeIDs[j] == 0)
  6399. class9.message = "@red@Offline";
  6400. else if (friendsNodeIDs[j] == nodeID)
  6401. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
  6402. else
  6403. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  6404. class9.atActionType = 1;
  6405. return;
  6406. }
  6407. if (j == 203) {
  6408. int i1 = friendsCount;
  6409. if (anInt900 != 2)
  6410. i1 = 0;
  6411. class9.scrollMax = i1 * 15 + 20;
  6412. if (class9.scrollMax <= class9.height)
  6413. class9.scrollMax = class9.height + 1;
  6414. return;
  6415. }
  6416. if (j == 424) {
  6417. class9.scrollMax = partyCount * 14;
  6418. if(class9.scrollMax <= class9.height)
  6419. class9.scrollMax = class9.height + 1;
  6420. return;
  6421. }
  6422. if (j >= 401 && j <= 500) {
  6423. if ((j -= 401) == 0 && anInt900 == 0) {
  6424. class9.message = "Loading ignore list";
  6425. class9.atActionType = 0;
  6426. return;
  6427. }
  6428. if (j == 1 && anInt900 == 0) {
  6429. class9.message = "Please wait...";
  6430. class9.atActionType = 0;
  6431. return;
  6432. }
  6433. int j1 = ignoreCount;
  6434. if (anInt900 == 0)
  6435. j1 = 0;
  6436. if (j >= j1) {
  6437. class9.message = "";
  6438. class9.atActionType = 0;
  6439. return;
  6440. } else {
  6441. class9.message = TextClass.fixName(TextClass
  6442. .nameForLong(ignoreListAsLongs[j]));
  6443. class9.atActionType = 1;
  6444. return;
  6445. }
  6446. }
  6447. if (j == 503) {
  6448. class9.scrollMax = ignoreCount * 15 + 20;
  6449. if (class9.scrollMax <= class9.height)
  6450. class9.scrollMax = class9.height + 1;
  6451. return;
  6452. }
  6453. if (j == 327) {
  6454. class9.modelRotation1 = 150;
  6455. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6456. if (aBoolean1031) {
  6457. for (int k1 = 0; k1 < 7; k1++) {
  6458. int l1 = anIntArray1065[k1];
  6459. if (l1 >= 0 && !IDK.cache[l1].method537())
  6460. return;
  6461. }
  6462.  
  6463. aBoolean1031 = false;
  6464. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6465. int i2 = 0;
  6466. for (int j2 = 0; j2 < 7; j2++) {
  6467. int k2 = anIntArray1065[j2];
  6468. if (k2 >= 0)
  6469. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  6470. .method538();
  6471. }
  6472.  
  6473. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6474. for (int l2 = 0; l2 < 5; l2++)
  6475. if (anIntArray990[l2] != 0) {
  6476. model.method476(anIntArrayArray1003[l2][0],
  6477. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6478. if (l2 == 1)
  6479. model.method476(anIntArray1204[0],
  6480. anIntArray1204[anIntArray990[l2]]);
  6481. // if(l2 == 1)
  6482. // model.method476(Legs2[0], Legs2[anIntArray990[l2]]);
  6483. }
  6484.  
  6485. model.method469();
  6486. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6487. model.method479(64, 1300, 0, -570, 0, true);
  6488. class9.anInt233 = 5;
  6489. class9.mediaID = 0;
  6490. RSInterface.method208(aBoolean994, model);
  6491. }
  6492. return;
  6493. }
  6494. if (j == 328) {
  6495. RSInterface rsInterface = class9;
  6496. int verticleTilt = 150;
  6497. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6498. rsInterface.modelRotation1 = verticleTilt;
  6499. rsInterface.modelRotation2 = animationSpeed;
  6500. if (aBoolean1031) {
  6501. Model characterDisplay = myPlayer.method452();
  6502. for (int l2 = 0; l2 < 5; l2++)
  6503. if (anIntArray990[l2] != 0) {
  6504. characterDisplay.method476(anIntArrayArray1003[l2][0],
  6505. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6506. if (l2 == 1)
  6507. characterDisplay.method476(anIntArray1204[0],
  6508. anIntArray1204[anIntArray990[l2]]);
  6509. }
  6510. int staticFrame = myPlayer.anInt1511;
  6511. characterDisplay.method469();
  6512. characterDisplay
  6513. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  6514. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6515. rsInterface.anInt233 = 5;
  6516. rsInterface.mediaID = 0;
  6517. RSInterface.method208(aBoolean994, characterDisplay);
  6518. }
  6519. return;
  6520. }
  6521. if (j == 324) {
  6522. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6523. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6524. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6525. }
  6526. if (aBoolean1047) {
  6527. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6528. return;
  6529. } else {
  6530. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6531. return;
  6532. }
  6533. }
  6534. if (j == 325) {
  6535. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6536. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6537. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6538. }
  6539. if (aBoolean1047) {
  6540. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6541. return;
  6542. } else {
  6543. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6544. return;
  6545. }
  6546. }
  6547. if (j == 600) {
  6548. class9.message = reportAbuseInput;
  6549. if (loopCycle % 20 < 10) {
  6550. class9.message += "|";
  6551. return;
  6552. } else {
  6553. class9.message += " ";
  6554. return;
  6555. }
  6556. }
  6557. if (j == 613)
  6558. if (myPrivilege >= 1) {
  6559. if (canMute) {
  6560. class9.textColor = 0xff0000;
  6561. // class9.message =
  6562. // "Moderator option: Mute player for 48 hours: <ON>";
  6563. } else {
  6564. class9.textColor = 0xffffff;
  6565. // class9.message =
  6566. // "Moderator option: Mute player for 48 hours: <OFF>";
  6567. }
  6568. } else {
  6569. class9.message = "";
  6570. }
  6571. if (j == 650 || j == 655)
  6572. if (anInt1193 != 0) {
  6573. String s;
  6574. if (daysSinceLastLogin == 0)
  6575. s = "earlier today";
  6576. else if (daysSinceLastLogin == 1)
  6577. s = "yesterday";
  6578. else
  6579. s = daysSinceLastLogin + " days ago";
  6580. class9.message = "You last logged in " + s + " from: " + SignLink.dns;
  6581. } else {
  6582. class9.message = "";
  6583. }
  6584. if (j == 651) {
  6585. if (unreadMessages == 0) {
  6586. class9.message = "0 unread messages";
  6587. class9.textColor = 0xffff00;
  6588. }
  6589. if (unreadMessages == 1) {
  6590. class9.message = "1 unread message";
  6591. class9.textColor = 65280;
  6592. }
  6593. if (unreadMessages > 1) {
  6594. class9.message = unreadMessages + " unread messages";
  6595. class9.textColor = 65280;
  6596. }
  6597. }
  6598. if (j == 652)
  6599. if (daysSinceRecovChange == 201) {
  6600. if (membersInt == 1)
  6601. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6602. else
  6603. class9.message = "";
  6604. } else if (daysSinceRecovChange == 200) {
  6605. class9.message = "You have not yet set any password recovery questions.";
  6606. } else {
  6607. String s1;
  6608. if (daysSinceRecovChange == 0)
  6609. s1 = "Earlier today";
  6610. else if (daysSinceRecovChange == 1)
  6611. s1 = "Yesterday";
  6612. else
  6613. s1 = daysSinceRecovChange + " days ago";
  6614. class9.message = s1 + " you changed your recovery questions";
  6615. }
  6616. if (j == 653)
  6617. if (daysSinceRecovChange == 201) {
  6618. if (membersInt == 1)
  6619. class9.message = "@whi@recommend you use a members world instead. You may use";
  6620. else
  6621. class9.message = "";
  6622. } else if (daysSinceRecovChange == 200)
  6623. class9.message = "We strongly recommend you do so now to secure your account.";
  6624. else
  6625. class9.message = "If you do not remember making this change then cancel it immediately";
  6626. if (j == 654) {
  6627. if (daysSinceRecovChange == 201)
  6628. if (membersInt == 1) {
  6629. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6630. return;
  6631. } else {
  6632. class9.message = "";
  6633. return;
  6634. }
  6635. if (daysSinceRecovChange == 200) {
  6636. class9.message = "Do this from the 'account management' area on our front webpage";
  6637. return;
  6638. }
  6639. class9.message = "Do this from the 'account management' area on our front webpage";
  6640. }
  6641. }
  6642.  
  6643. public void drawSplitpublicChat() {
  6644. if (splitpublicChat == 0)
  6645. return;
  6646. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6647. int i = 0;
  6648. if(anInt1104 != 0)
  6649. i = 1;
  6650. for(int j = 0; j < 100; j++)
  6651. if(chatMessages[j] != null)
  6652. {
  6653. int k = chatTypes[j];
  6654. String s = chatNames[j];
  6655. byte byte1 = 0;
  6656. Matcher matcher = pattern.matcher(s);
  6657. if (matcher.find()) {
  6658. try {
  6659. s = s.replace(matcher.group(0), "");
  6660. byte1 = Byte.parseByte(matcher.group(1));
  6661. } catch (NumberFormatException e) {
  6662. byte1 = 0;
  6663. }
  6664. }
  6665.  
  6666. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6667. int yPos = 329 - i * 13;
  6668. int xPos = 4;
  6669. Sprite crown = byte1 == 0 ? null : modIcons[byte1];
  6670. String[] message = TextClass.splitString(newRegularFont, "", chatMessages[j], 470, crown);
  6671. if (message.length > 1 && message[0] != null && message[1] != null) {
  6672. textDrawingArea.method385(0, "From ", yPos - 13, xPos);
  6673. textDrawingArea.method385(65535, "From ", yPos - 14, xPos);
  6674. xPos += newRegularFont.getTextWidth("From ");
  6675. if (crown != null && byte1 <= modIcons.length) {
  6676. crown.drawSprite(xPos, yPos - 25 - (crown.myHeight / 6));
  6677. xPos += crown.maxWidth;
  6678. }
  6679. textDrawingArea.method385(0, s + ": " + message[0], yPos - 13, xPos);
  6680. textDrawingArea.method385(65535, s + ": " + message[0], yPos - 14, xPos);
  6681. textDrawingArea.method385(0, message[1], yPos, 4);
  6682. textDrawingArea.method385(65535, message[1], yPos - 1, 4);
  6683. ++i;
  6684. } else {
  6685. textDrawingArea.method385(0, "From ", yPos, xPos);
  6686. textDrawingArea.method385(65535, "From ", yPos, xPos);
  6687. xPos += newRegularFont.getTextWidth("From ");
  6688. if (crown != null && byte1 <= modIcons.length) {
  6689. crown.drawSprite(xPos, yPos - 11 - (crown.myHeight / 6));
  6690. xPos += crown.maxWidth;
  6691. }
  6692. textDrawingArea.method385(0, s + ": " + chatMessages[j], yPos, xPos);
  6693. textDrawingArea.method385(65535, s + ": " + chatMessages[j], yPos - 1, xPos);
  6694. }
  6695. if (++i >= 5)
  6696. return;
  6697. }
  6698. if (k == 5 && privateChatMode < 2) {
  6699. int i1 = 329 - i * 13;
  6700. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6701. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  6702. if (++i >= 5)
  6703. return;
  6704. }
  6705. if (k == 6 && privateChatMode < 2) {
  6706. int j1 = 329 - i * 13;
  6707. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6708. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6709. if (++i >= 5)
  6710. return;
  6711. }
  6712. }
  6713. }
  6714.  
  6715. public void pushMessage(String s, int i, String s1) {
  6716. if(i == 0 && dialogID != -1) {
  6717. aString844 = s;
  6718. super.clickMode3 = 0;
  6719. }
  6720. if(backDialogID == -1)
  6721. inputTaken = true;
  6722. for(int j = 499; j > 0; j--) {
  6723. chatTypes[j] = chatTypes[j - 1];
  6724. chatNames[j] = chatNames[j - 1];
  6725. chatMessages[j] = chatMessages[j - 1];
  6726. chatRights[j] = chatRights[j - 1];
  6727. }
  6728. chatTypes[0] = i;
  6729. chatNames[0] = s1;
  6730. chatMessages[0] = s;
  6731. chatRights[0] = rights;
  6732. }
  6733.  
  6734. public void setNorth() {
  6735. cameraOffsetX = 0;
  6736. cameraOffsetY = 0;
  6737. viewRotationOffset = 0;
  6738. viewRotation = 0;
  6739. minimapRotation = 0;
  6740. minimapZoom = 0;
  6741. }
  6742.  
  6743. public static void setTab(int id) {
  6744. needDrawTabArea = true;
  6745. tabID = id;
  6746. tabAreaAltered = true;
  6747. }
  6748.  
  6749. public void processTabClick() {
  6750. if (menuOpen) {
  6751. return;
  6752. }
  6753.  
  6754. runHover = super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128;
  6755. if(super.clickMode3 == 1) {
  6756. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6757. {
  6758. needDrawTabArea = true;
  6759. tabID = 0;
  6760. tabAreaAltered = true;
  6761. }
  6762. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6763. {
  6764. needDrawTabArea = true;
  6765. tabID = 1;
  6766. tabAreaAltered = true;
  6767. }
  6768. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6769. {
  6770. needDrawTabArea = true;
  6771. tabID = 2;
  6772. tabAreaAltered = true;
  6773. }
  6774. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6775. {
  6776. needDrawTabArea = true;
  6777. tabID = 3;
  6778. tabAreaAltered = true;
  6779. }
  6780. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6781. {
  6782. needDrawTabArea = true;
  6783. tabID = 4;
  6784. tabAreaAltered = true;
  6785. }
  6786. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6787. {
  6788. needDrawTabArea = true;
  6789. tabID = 5;
  6790. tabAreaAltered = true;
  6791. }
  6792. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6793. {
  6794. needDrawTabArea = true;
  6795. tabID = 6;
  6796. tabAreaAltered = true;
  6797. }
  6798. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6799. {
  6800. needDrawTabArea = true;
  6801. tabID = 8;
  6802. tabAreaAltered = true;
  6803. }
  6804. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6805. {
  6806. needDrawTabArea = true;
  6807. tabID = 9;
  6808. tabAreaAltered = true;
  6809. }
  6810. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6811. {
  6812. needDrawTabArea = true;
  6813. tabID = 7;
  6814. tabAreaAltered = true;
  6815. }
  6816. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6817. {
  6818. needDrawTabArea = true;
  6819. tabID = 11;
  6820. tabAreaAltered = true;
  6821. }
  6822. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6823. {
  6824. needDrawTabArea = true;
  6825. tabID = 12;
  6826. tabAreaAltered = true;
  6827. }
  6828. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6829. {
  6830. needDrawTabArea = true;
  6831. tabID = 13;
  6832. tabAreaAltered = true;
  6833. }
  6834. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[14] != -1)
  6835. {
  6836. needDrawTabArea = true;
  6837. tabID = 14;
  6838. tabAreaAltered = true;
  6839. }
  6840. }
  6841. }
  6842.  
  6843. public void resetImageProducers2() {
  6844. if (aRSImageProducer_1166 != null)
  6845. return;
  6846. nullLoader();
  6847. super.fullGameScreen = null;
  6848. aRSImageProducer_1107 = null;
  6849. aRSImageProducer_1108 = null;
  6850. aRSImageProducer_1109 = null;
  6851. aRSImageProducer_1110 = null;
  6852. aRSImageProducer_1111 = null;
  6853. aRSImageProducer_1112 = null;
  6854. aRSImageProducer_1113 = null;
  6855. aRSImageProducer_1114 = null;
  6856. aRSImageProducer_1115 = null;
  6857. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  6858. getGameComponent());
  6859. aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
  6860. DrawingArea.setAllPixelsToZero();
  6861. mapArea.drawSprite(0, 0);
  6862. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  6863. getGameComponent());
  6864. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  6865. getGameComponent());
  6866. DrawingArea.setAllPixelsToZero();
  6867. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6868. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6869. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6870. welcomeScreenRaised = true;
  6871. }
  6872.  
  6873. public String getDocumentBaseHost() {
  6874. if (SignLink.mainapp != null) {
  6875. return SignLink.mainapp.getDocumentBase().getHost().toLowerCase();
  6876. }
  6877. if (super.gameFrame != null) {
  6878. return ""; // runescape.com <- removed for Jframe to work
  6879. } else {
  6880. return ""; // super.getDocumentBase().getHost().toLowerCase() <-
  6881. // removed for Jframe to work
  6882. }
  6883. }
  6884.  
  6885. private void method81(Sprite sprite, int j, int k)
  6886. {
  6887. int l = k * k + j * j;
  6888. if(l > 4225 && l < 0x15f90)
  6889. {
  6890. int i1 = viewRotation + minimapRotation & 0x7ff;
  6891. int j1 = Model.SINE[i1];
  6892. int k1 = Model.COSINE[i1];
  6893. j1 = (j1 * 256) / (minimapZoom + 256);
  6894. k1 = (k1 * 256) / (minimapZoom + 256);
  6895. int l1 = j * j1 + k * k1 >> 16;
  6896. int i2 = j * k1 - k * j1 >> 16;
  6897. double d = Math.atan2(l1, i2);
  6898. int j2 = (int)(Math.sin(d) * 63D);
  6899. int k2 = (int)(Math.cos(d) * 57D);
  6900. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6901. } else
  6902. {
  6903. markMinimap(sprite, k, j);
  6904. }
  6905. }
  6906.  
  6907. private void rightClickChatButtons() {
  6908. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6909. menuActionName[1] = "Clear Chat";
  6910. menuActionIds[1] = 975;
  6911. menuActionName[2] = "View All";
  6912. menuActionIds[2] = 999;
  6913. menuActionRow = 3;
  6914. } else if (super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  6915. menuActionName[1] = "View Game";
  6916. menuActionIds[1] = 998;
  6917. menuActionRow = 2;
  6918. } else if (super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  6919. menuActionName[1] = "Hide public";
  6920. menuActionIds[1] = 997;
  6921. menuActionName[2] = "Off public";
  6922. menuActionIds[2] = 996;
  6923. menuActionName[3] = "Friends public";
  6924. menuActionIds[3] = 995;
  6925. menuActionName[4] = "On public";
  6926. menuActionIds[4] = 994;
  6927. menuActionName[5] = "View public";
  6928. menuActionIds[5] = 993;
  6929. menuActionRow = 6;
  6930. } else if (super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  6931. menuActionName[1] = "Off private";
  6932. menuActionIds[1] = 992;
  6933. menuActionName[2] = "Friends private";
  6934. menuActionIds[2] = 991;
  6935. menuActionName[3] = "On private";
  6936. menuActionIds[3] = 990;
  6937. menuActionName[4] = "View private";
  6938. menuActionIds[4] = 989;
  6939. menuActionRow = 5;
  6940. } else if (super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  6941. menuActionName[1] = "Off clan chat";
  6942. menuActionIds[1] = 1003;
  6943. menuActionName[2] = "Friends clan chat";
  6944. menuActionIds[2] = 1002;
  6945. menuActionName[3] = "On clan chat";
  6946. menuActionIds[3] = 1001;
  6947. menuActionName[4] = "View clan chat";
  6948. menuActionIds[4] = 1000;
  6949. menuActionRow = 5;
  6950. } else if (super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  6951. menuActionName[1] = "Off trade";
  6952. menuActionIds[1] = 987;
  6953. menuActionName[2] = "Friends trade";
  6954. menuActionIds[2] = 986;
  6955. menuActionName[3] = "On trade";
  6956. menuActionIds[3] = 985;
  6957. menuActionName[4] = "View trade";
  6958. menuActionIds[4] = 984;
  6959. menuActionRow = 5;
  6960. } else if (super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  6961. menuActionName[1] = "Off duel";
  6962. menuActionIds[1] = -1;
  6963. menuActionName[2] = "Friends duel";
  6964. menuActionIds[2] = -1;
  6965. menuActionName[3] = "On duel";
  6966. menuActionIds[3] = -1;
  6967. menuActionName[4] = "View duel";
  6968. menuActionIds[4] = -1;
  6969. menuActionRow = 5;
  6970. } else if (super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  6971. menuActionName[1] = "Report Abuse";
  6972. menuActionIds[1] = 606;
  6973. menuActionRow = 2;
  6974. }
  6975. }
  6976.  
  6977. public void processRightClick() {
  6978. if (activeInterfaceType != 0) {
  6979. return;
  6980. }
  6981. menuActionName[0] = "Cancel";
  6982. menuActionIds[0] = 1107;
  6983. menuActionRow = 1;
  6984. if (fullscreenInterfaceID != -1) {
  6985. anInt886 = 0;
  6986. anInt1315 = 0;
  6987. buildInterfaceMenu(8,
  6988. RSInterface.interfaceCache[fullscreenInterfaceID],
  6989. super.mouseX, 8, super.mouseY, 0);
  6990. if (anInt886 != anInt1026) {
  6991. anInt1026 = anInt886;
  6992. }
  6993. if (anInt1315 != anInt1129) {
  6994. anInt1129 = anInt1315;
  6995. }
  6996. return;
  6997. }
  6998. buildSplitpublicChatMenu();
  6999. anInt886 = 0;
  7000. anInt1315 = 0;
  7001.  
  7002. if (super.mouseX >= 515 && super.mouseY >= 0 && super.mouseX <= 765 && super.mouseY <= 167)
  7003. if (openInterfaceID != -1)
  7004. buildInterfaceMenu(0, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 0, super.mouseY, 0);
  7005. if (anInt886 != anInt1026)
  7006. anInt1026 = anInt886;
  7007. anInt886 = 0;
  7008.  
  7009. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  7010. if (openInterfaceID != -1) {
  7011. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7012. } else {
  7013. build3dScreenMenu();
  7014. }
  7015. }
  7016. if (anInt886 != anInt1026) {
  7017. anInt1026 = anInt886;
  7018. }
  7019. if (anInt1315 != anInt1129) {
  7020. anInt1129 = anInt1315;
  7021. }
  7022. anInt886 = 0;
  7023. anInt1315 = 0;
  7024. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  7025. if (invOverlayInterfaceID != -1) {
  7026. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  7027. } else if (tabInterfaceIDs[tabID] != -1) {
  7028. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  7029. }
  7030. }
  7031. if (anInt886 != anInt1048) {
  7032. needDrawTabArea = true;
  7033. tabAreaAltered = true;
  7034. anInt1048 = anInt886;
  7035. }
  7036. if (anInt1315 != anInt1044) {
  7037. needDrawTabArea = true;
  7038. tabAreaAltered = true;
  7039. anInt1044 = anInt1315;
  7040. }
  7041. anInt886 = 0;
  7042. anInt1315 = 0;
  7043. if (super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  7044. if (backDialogID != -1) {
  7045. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  7046. } else if (super.mouseY < 463 && super.mouseX < 490) {
  7047. buildChatAreaMenu(super.mouseY - 338);
  7048. }
  7049. }
  7050. if (backDialogID != -1 && anInt886 != anInt1039) {
  7051. inputTaken = true;
  7052. anInt1039 = anInt886;
  7053. }
  7054. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7055. inputTaken = true;
  7056. anInt1500 = anInt1315;
  7057. }
  7058. /* Enable custom right click areas */
  7059. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  7060. rightClickChatButtons();
  7061. processXPCounterClick();
  7062. if(super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168) {
  7063. rightClickMapArea();
  7064. processMinimapActions();
  7065. }
  7066. /**/
  7067.  
  7068. boolean flag = false;
  7069. while (!flag) {
  7070. flag = true;
  7071. for (int j = 0; j < menuActionRow - 1; j++) {
  7072. if (menuActionIds[j] < 1000 && menuActionIds[j + 1] > 1000) {
  7073. String s = menuActionName[j];
  7074. menuActionName[j] = menuActionName[j + 1];
  7075. menuActionName[j + 1] = s;
  7076. int k = menuActionIds[j];
  7077. menuActionIds[j] = menuActionIds[j + 1];
  7078. menuActionIds[j + 1] = k;
  7079. k = menuActionCmd2[j];
  7080. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7081. menuActionCmd2[j + 1] = k;
  7082. k = menuActionCmd3[j];
  7083. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7084. menuActionCmd3[j + 1] = k;
  7085. k = menuActionCmd1[j];
  7086. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7087. menuActionCmd1[j + 1] = k;
  7088. flag = false;
  7089. }
  7090. }
  7091. }
  7092. }
  7093.  
  7094. public int method83(int i, int j, int k) {
  7095. int l = 256 - k;
  7096. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  7097. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7098. }
  7099.  
  7100. public boolean saveAccountInfo = true;
  7101.  
  7102. @SuppressWarnings("unused")
  7103. public void login(String s, String s1, boolean flag) {
  7104. SignLink.errorname = s;
  7105. try {
  7106. if(saveAccountInfo) {
  7107. writeSettings();
  7108. }
  7109. if (!flag) {
  7110. loginMessage1 = "";
  7111. loginMessage2 = "Connecting to server...";
  7112. drawLoginScreen();
  7113. }
  7114. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7115. long l = TextClass.longForName(s);
  7116. int i = (int) (l >> 16 & 31L);
  7117. stream.currentOffset = 0;
  7118. stream.writeWordBigEndian(14);
  7119. stream.writeWordBigEndian(i);
  7120. socketStream.queueBytes(2, stream.buffer);
  7121. for (int j = 0; j < 8; j++)
  7122. socketStream.read();
  7123.  
  7124. int k = socketStream.read();
  7125. int i1 = k;
  7126. if (k == 0) {
  7127. socketStream.flushInputStream(inStream.buffer, 8);
  7128. inStream.currentOffset = 0;
  7129. aLong1215 = inStream.readQWord();
  7130. int ai[] = new int[4];
  7131. ai[0] = (int) (Math.random() * 99999999D);
  7132. ai[1] = (int) (Math.random() * 99999999D);
  7133. ai[2] = (int) (aLong1215 >> 32);
  7134. ai[3] = (int) aLong1215;
  7135. stream.currentOffset = 0;
  7136. stream.writeWordBigEndian(10);
  7137. stream.writeDWord(ai[0]);
  7138. stream.writeDWord(ai[1]);
  7139. stream.writeDWord(ai[2]);
  7140. stream.writeDWord(ai[3]);
  7141. stream.writeDWord(2300); // (int) (Double.parseDouble(update.getVersions().getProperty("client")) * 1000)
  7142. stream.writeString(s);
  7143. stream.writeString(s1);
  7144. stream.doKeys();
  7145. aStream_847.currentOffset = 0;
  7146. if (flag)
  7147. aStream_847.writeWordBigEndian(18);
  7148. else
  7149. aStream_847.writeWordBigEndian(16);
  7150. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7151. aStream_847.writeWordBigEndian(255);
  7152. aStream_847.writeWord(317);
  7153. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7154. for (int l1 = 0; l1 < 9; l1++)
  7155. aStream_847.writeDWord(expectedCRCs[l1]);
  7156.  
  7157. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7158. stream.encryption = new ISAACRandomGen(ai);
  7159. for (int j2 = 0; j2 < 4; j2++)
  7160. ai[j2] += 50;
  7161.  
  7162. encryption = new ISAACRandomGen(ai);
  7163. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7164. k = socketStream.read();
  7165. }
  7166. if (k == 1) {
  7167. try {
  7168. Thread.sleep(2000L);
  7169. } catch (Exception _ex) {
  7170. }
  7171. login(s, s1, flag);
  7172. return;
  7173. }
  7174. if (k == 2) {
  7175. myPrivilege = socketStream.read();
  7176. flagged = socketStream.read() == 1;
  7177. aLong1220 = 0L;
  7178. anInt1022 = 0;
  7179. mouseDetection.coordsIndex = 0;
  7180. super.awtFocus = true;
  7181. aBoolean954 = true;
  7182. loggedIn = true;
  7183. stream.currentOffset = 0;
  7184. inStream.currentOffset = 0;
  7185. pktType = -1;
  7186. anInt841 = -1;
  7187. anInt842 = -1;
  7188. anInt843 = -1;
  7189. pktSize = 0;
  7190. anInt1009 = 0;
  7191. anInt1104 = 0;
  7192. anInt1011 = 0;
  7193. anInt855 = 0;
  7194. menuActionRow = 0;
  7195. menuOpen = false;
  7196. super.idleTime = 0;
  7197. for (int j1 = 0; j1 < 500; j1++)
  7198. chatMessages[j1] = null;
  7199.  
  7200. itemSelected = 0;
  7201. spellSelected = 0;
  7202. loadingStage = 0;
  7203. currentSound = 0;
  7204. setNorth();
  7205. anInt1021 = 0;
  7206. anInt985 = -1;
  7207. destX = 0;
  7208. destY = 0;
  7209. playerCount = 0;
  7210. npcCount = 0;
  7211. for (int i2 = 0; i2 < maxPlayers; i2++) {
  7212. playerArray[i2] = null;
  7213. aStreamArray895s[i2] = null;
  7214. }
  7215.  
  7216. for (int k2 = 0; k2 < 16384; k2++)
  7217. npcArray[k2] = null;
  7218.  
  7219. myPlayer = playerArray[myPlayerIndex] = new Player();
  7220. aClass19_1013.removeAll();
  7221. aClass19_1056.removeAll();
  7222. for (int l2 = 0; l2 < 4; l2++) {
  7223. for (int i3 = 0; i3 < 104; i3++) {
  7224. for (int k3 = 0; k3 < 104; k3++)
  7225. groundArray[l2][i3][k3] = null;
  7226.  
  7227. }
  7228.  
  7229. }
  7230.  
  7231. aClass19_1179 = new NodeList();
  7232. fullscreenInterfaceID = -1;
  7233. anInt900 = 0;
  7234. friendsCount = 0;
  7235. dialogID = -1;
  7236. backDialogID = -1;
  7237. openInterfaceID = -1;
  7238. invOverlayInterfaceID = -1;
  7239. anInt1018 = -1;
  7240. aBoolean1149 = false;
  7241. tabID = 3;
  7242. inputDialogState = 0;
  7243. menuOpen = false;
  7244. messagePromptRaised = false;
  7245. aString844 = null;
  7246. anInt1055 = 0;
  7247. anInt1054 = -1;
  7248. aBoolean1047 = true;
  7249. method45();
  7250. for (int j3 = 0; j3 < 5; j3++)
  7251. anIntArray990[j3] = 0;
  7252.  
  7253. for (int l3 = 0; l3 < 5; l3++) {
  7254. atPlayerActions[l3] = null;
  7255. atPlayerArray[l3] = false;
  7256. }
  7257.  
  7258. anInt1175 = 0;
  7259. anInt1134 = 0;
  7260. anInt986 = 0;
  7261. anInt1288 = 0;
  7262. anInt924 = 0;
  7263. anInt1188 = 0;
  7264. anInt1155 = 0;
  7265. anInt1226 = 0;
  7266. int anInt941 = 0;
  7267. int anInt1260 = 0;
  7268. resetImageProducers2();
  7269. loginMessage1 = "";
  7270. loginMessage2 = "";
  7271. if (clientData)
  7272. ping();
  7273. return;
  7274. }
  7275. if (k == 3) {
  7276. loginMessage1 = "";
  7277. loginMessage2 = "Invalid username or password.";
  7278. return;
  7279. }
  7280. if (k == 4) {
  7281. loginMessage1 = "Your account has been disabled.";
  7282. loginMessage2 = "Please check your message-center for details.";
  7283. return;
  7284. }
  7285. if (k == 5) {
  7286. loginMessage1 = "Your account is already logged in.";
  7287. loginMessage2 = "Try again in 60 secs...";
  7288. return;
  7289. }
  7290. if (k == 6) {
  7291. loginMessage1 = "Exodus has been updated!";
  7292. loginMessage2 = "Please reload this page.";
  7293. return;
  7294. }
  7295. if (k == 7) {
  7296. loginMessage1 = "This world is full.";
  7297. loginMessage2 = "Please use a different world.";
  7298. return;
  7299. }
  7300. if (k == 8) {
  7301. loginMessage1 = "Unable to connect.";
  7302. loginMessage2 = "Login server offline.";
  7303. return;
  7304. }
  7305. if (k == 9) {
  7306. loginMessage1 = "Login limit exceeded.";
  7307. loginMessage2 = "Too many connections from your address.";
  7308. return;
  7309. }
  7310. if (k == 10) {
  7311. loginMessage1 = "Unable to connect.";
  7312. loginMessage2 = "Bad session id.";
  7313. return;
  7314. }
  7315. if (k == 11) {
  7316. loginMessage2 = "Login server rejected session.";
  7317. loginMessage2 = "Please try again.";
  7318. return;
  7319. }
  7320. if (k == 12) {
  7321. loginMessage1 = "You need a members account to login to this world.";
  7322. loginMessage2 = "Please subscribe, or use a different world.";
  7323. return;
  7324. }
  7325. if (k == 13) {
  7326. loginMessage1 = "Could not complete login.";
  7327. loginMessage2 = "Please try using a different world.";
  7328. return;
  7329. }
  7330. if (k == 14) {
  7331. loginMessage1 = "The server is being updated.";
  7332. loginMessage2 = "Please wait 1 minute and try again.";
  7333. return;
  7334. }
  7335. if (k == 15) {
  7336. loggedIn = true;
  7337. stream.currentOffset = 0;
  7338. inStream.currentOffset = 0;
  7339. pktType = -1;
  7340. anInt841 = -1;
  7341. anInt842 = -1;
  7342. anInt843 = -1;
  7343. pktSize = 0;
  7344. anInt1009 = 0;
  7345. anInt1104 = 0;
  7346. menuActionRow = 0;
  7347. menuOpen = false;
  7348. aLong824 = System.currentTimeMillis();
  7349. return;
  7350. }
  7351. if (k == 16) {
  7352. loginMessage1 = "Login attempts exceeded.";
  7353. loginMessage2 = "Please wait 1 minute and try again.";
  7354. return;
  7355. }
  7356. if (k == 17) {
  7357. loginMessage1 = "You are standing in a members-only area.";
  7358. loginMessage2 = "To play on this world move to a free area first";
  7359. return;
  7360. }
  7361. if (k == 20) {
  7362. loginMessage1 = "Invalid loginserver requested";
  7363. loginMessage2 = "Please try using a different world.";
  7364. return;
  7365. }
  7366. if (k == 21) {
  7367. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  7368. loginMessage1 = "You have only just left another world";
  7369. loginMessage2 = "Your profile will be transferred in: "
  7370. + k1 + " seconds";
  7371. drawLoginScreen();
  7372. try {
  7373. Thread.sleep(1000L);
  7374. } catch (Exception _ex) {
  7375. }
  7376. }
  7377.  
  7378. login(s, s1, flag);
  7379. return;
  7380. }
  7381. if (k == -1) {
  7382. if (loginFailures < 5) {
  7383. try {
  7384. Thread.sleep(2000L);
  7385. } catch (Exception _ex) {
  7386. }
  7387. loginFailures++;
  7388. login(s, s1, flag);
  7389. return;
  7390. } else {
  7391. loginMessage1 = "No response from loginserver";
  7392. loginMessage2 = "Please wait 1 minute and try again.";
  7393. return;
  7394. }
  7395. } else {
  7396. System.out.println("response:" + k);
  7397. loginMessage1 = "Unexpected server response";
  7398. loginMessage2 = "Please try using a different world.";
  7399. return;
  7400. }
  7401. } catch (IOException _ex) {
  7402. loginMessage1 = "";
  7403. }
  7404. loginMessage2 = "Error connecting to server.";
  7405. }
  7406.  
  7407. public boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  7408. int l1, int i2, int j2, boolean flag, int k2) {
  7409. byte byte0 = 104;
  7410. byte byte1 = 104;
  7411. for (int l2 = 0; l2 < byte0; l2++) {
  7412. for (int i3 = 0; i3 < byte1; i3++) {
  7413. anIntArrayArray901[l2][i3] = 0;
  7414. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7415. }
  7416. }
  7417. int j3 = j2;
  7418. int k3 = j1;
  7419. anIntArrayArray901[j2][j1] = 99;
  7420. anIntArrayArray825[j2][j1] = 0;
  7421. int l3 = 0;
  7422. int i4 = 0;
  7423. bigX[l3] = j2;
  7424. bigY[l3++] = j1;
  7425. boolean flag1 = false;
  7426. int j4 = bigX.length;
  7427. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7428. while (i4 != l3) {
  7429. j3 = bigX[i4];
  7430. k3 = bigY[i4];
  7431. i4 = (i4 + 1) % j4;
  7432. if (j3 == k2 && k3 == i2) {
  7433. flag1 = true;
  7434. break;
  7435. }
  7436. if (i1 != 0) {
  7437. if ((i1 < 5 || i1 == 10)
  7438. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  7439. i1 - 1, i2)) {
  7440. flag1 = true;
  7441. break;
  7442. }
  7443. if (i1 < 10
  7444. && aClass11Array1230[plane].method220(k2, i2, k3,
  7445. i1 - 1, j, j3)) {
  7446. flag1 = true;
  7447. break;
  7448. }
  7449. }
  7450. if (k1 != 0
  7451. && k != 0
  7452. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  7453. k1, k3)) {
  7454. flag1 = true;
  7455. break;
  7456. }
  7457. int l4 = anIntArrayArray825[j3][k3] + 1;
  7458. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  7459. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  7460. bigX[l3] = j3 - 1;
  7461. bigY[l3] = k3;
  7462. l3 = (l3 + 1) % j4;
  7463. anIntArrayArray901[j3 - 1][k3] = 2;
  7464. anIntArrayArray825[j3 - 1][k3] = l4;
  7465. }
  7466. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  7467. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  7468. bigX[l3] = j3 + 1;
  7469. bigY[l3] = k3;
  7470. l3 = (l3 + 1) % j4;
  7471. anIntArrayArray901[j3 + 1][k3] = 8;
  7472. anIntArrayArray825[j3 + 1][k3] = l4;
  7473. }
  7474. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  7475. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7476. bigX[l3] = j3;
  7477. bigY[l3] = k3 - 1;
  7478. l3 = (l3 + 1) % j4;
  7479. anIntArrayArray901[j3][k3 - 1] = 1;
  7480. anIntArrayArray825[j3][k3 - 1] = l4;
  7481. }
  7482. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  7483. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7484. bigX[l3] = j3;
  7485. bigY[l3] = k3 + 1;
  7486. l3 = (l3 + 1) % j4;
  7487. anIntArrayArray901[j3][k3 + 1] = 4;
  7488. anIntArrayArray825[j3][k3 + 1] = l4;
  7489. }
  7490. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  7491. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  7492. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7493. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7494. bigX[l3] = j3 - 1;
  7495. bigY[l3] = k3 - 1;
  7496. l3 = (l3 + 1) % j4;
  7497. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7498. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7499. }
  7500. if (j3 < byte0 - 1 && k3 > 0
  7501. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  7502. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  7503. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7504. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7505. bigX[l3] = j3 + 1;
  7506. bigY[l3] = k3 - 1;
  7507. l3 = (l3 + 1) % j4;
  7508. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7509. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7510. }
  7511. if (j3 > 0 && k3 < byte1 - 1
  7512. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  7513. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  7514. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7515. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7516. bigX[l3] = j3 - 1;
  7517. bigY[l3] = k3 + 1;
  7518. l3 = (l3 + 1) % j4;
  7519. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7520. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7521. }
  7522. if (j3 < byte0 - 1 && k3 < byte1 - 1
  7523. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  7524. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  7525. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7526. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7527. bigX[l3] = j3 + 1;
  7528. bigY[l3] = k3 + 1;
  7529. l3 = (l3 + 1) % j4;
  7530. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7531. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7532. }
  7533. }
  7534. anInt1264 = 0;
  7535.  
  7536. if (!flag1) {
  7537. if (flag) {
  7538. int i5 = 100;
  7539. for (int k5 = 1; k5 < 2; k5++) {
  7540. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  7541. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7542. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  7543. && anIntArrayArray825[i6][l6] < i5) {
  7544. i5 = anIntArrayArray825[i6][l6];
  7545. j3 = i6;
  7546. k3 = l6;
  7547. anInt1264 = 1;
  7548. flag1 = true;
  7549. }
  7550.  
  7551. }
  7552.  
  7553. if (flag1)
  7554. break;
  7555. }
  7556.  
  7557. }
  7558. if (!flag1)
  7559. return false;
  7560. }
  7561. i4 = 0;
  7562. bigX[i4] = j3;
  7563. bigY[i4++] = k3;
  7564. int l5;
  7565. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  7566. if (j5 != l5) {
  7567. l5 = j5;
  7568. bigX[i4] = j3;
  7569. bigY[i4++] = k3;
  7570. }
  7571. if ((j5 & 2) != 0)
  7572. j3++;
  7573. else if ((j5 & 8) != 0)
  7574. j3--;
  7575. if ((j5 & 1) != 0)
  7576. k3++;
  7577. else if ((j5 & 4) != 0)
  7578. k3--;
  7579. }
  7580.  
  7581. /*if (keyArray[5] == 1) {
  7582. stream.createFrame(103);
  7583. stream.writeWordBigEndian(("tele2 " + bigX[0] + " " + bigY[0]).length() + 1);
  7584. stream.writeString("tele2 " + bigX[0] + " " + bigY[0]);
  7585. return false;
  7586. }*/
  7587.  
  7588. // if(cancelWalk) { return i4 > 0; }
  7589.  
  7590. if (i4 > 0) {
  7591.  
  7592. int k4 = i4;
  7593. if (k4 > 25)
  7594. k4 = 25;
  7595. i4--;
  7596. int k6 = bigX[i4];
  7597. int i7 = bigY[i4];
  7598. anInt1288 += k4;
  7599. if (anInt1288 >= 92) {
  7600. stream.createFrame(36);
  7601. stream.writeDWord(0);
  7602. anInt1288 = 0;
  7603. }
  7604. if (i == 0) {
  7605. stream.createFrame(164);
  7606. stream.writeWordBigEndian(k4 + k4 + 3);
  7607. }
  7608. if (i == 1) {
  7609. stream.createFrame(248);
  7610. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7611. }
  7612. if (i == 2) {
  7613. stream.createFrame(98);
  7614. stream.writeWordBigEndian(k4 + k4 + 3);
  7615. }
  7616. stream.method433(k6 + baseX);
  7617. destX = bigX[0];
  7618. destY = bigY[0];
  7619. for (int j7 = 1; j7 < k4; j7++) {
  7620. i4--;
  7621. stream.writeWordBigEndian(bigX[i4] - k6);
  7622. stream.writeWordBigEndian(bigY[i4] - i7);
  7623. }
  7624.  
  7625. stream.method431(i7 + baseY);
  7626. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7627. return true;
  7628. }
  7629. return i != 1;
  7630. }
  7631.  
  7632. public void playSong(int id) {
  7633. if (currentSong != id) {
  7634. nextSong = id;
  7635. songChanging = true;
  7636. onDemandFetcher.method558(2, nextSong);
  7637. currentSong = id;
  7638. }
  7639. }
  7640.  
  7641. public void method86(Stream stream) {
  7642. for (int j = 0; j < anInt893; j++) {
  7643. int k = anIntArray894[j];
  7644. NPC npc = npcArray[k];
  7645. int l = stream.readUnsignedByte();
  7646. if ((l & 0x10) != 0) {
  7647. int i1 = stream.method434();
  7648. if (i1 == 65535)
  7649. i1 = -1;
  7650. int i2 = stream.readUnsignedByte();
  7651. if (i1 == npc.anim && i1 != -1) {
  7652. int l2 = Animation.anims[i1].anInt365;
  7653. if (l2 == 1) {
  7654. npc.anInt1527 = 0;
  7655. npc.anInt1528 = 0;
  7656. npc.anInt1529 = i2;
  7657. npc.anInt1530 = 0;
  7658. }
  7659. if (l2 == 2)
  7660. npc.anInt1530 = 0;
  7661. } else if (i1 == -1
  7662. || npc.anim == -1
  7663. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  7664. npc.anim = i1;
  7665. npc.anInt1527 = 0;
  7666. npc.anInt1528 = 0;
  7667. npc.anInt1529 = i2;
  7668. npc.anInt1530 = 0;
  7669. npc.anInt1542 = npc.smallXYIndex;
  7670. }
  7671. }
  7672. if((l & 8) != 0)
  7673. {
  7674. int j1 = stream.method426();
  7675. int j2 = stream.method427();
  7676. int icon = stream.readUnsignedByte();
  7677. npc.updateHitData(j2, j1, loopCycle, icon);
  7678. npc.loopCycleStatus = loopCycle + 300;
  7679. npc.currentHealth = stream.method426();
  7680. npc.maxHealth = stream.readUnsignedByte();
  7681. }
  7682. if ((l & 0x80) != 0) {
  7683. npc.anInt1520 = stream.readUnsignedWord();
  7684. int k1 = stream.readDWord();
  7685. npc.anInt1524 = k1 >> 16;
  7686. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7687. npc.anInt1521 = 0;
  7688. npc.anInt1522 = 0;
  7689. if (npc.anInt1523 > loopCycle)
  7690. npc.anInt1521 = -1;
  7691. if (npc.anInt1520 == 65535)
  7692. npc.anInt1520 = -1;
  7693. }
  7694. if ((l & 0x20) != 0) {
  7695. npc.interactingEntity = stream.readUnsignedWord();
  7696. if (npc.interactingEntity == 65535)
  7697. npc.interactingEntity = -1;
  7698. }
  7699. if ((l & 1) != 0) {
  7700. npc.textSpoken = stream.readString();
  7701. npc.textCycle = 100;
  7702. // entityMessage(npc);
  7703.  
  7704. }
  7705. if((l & 0x40) != 0)
  7706. {
  7707. int l1 = stream.method427();
  7708. int k2 = stream.method428();
  7709. int icon = stream.readUnsignedByte();
  7710. npc.updateHitData(k2, l1, loopCycle, icon);
  7711. npc.loopCycleStatus = loopCycle + 300;
  7712. npc.currentHealth = stream.method428();
  7713. npc.maxHealth = stream.method427();
  7714. }
  7715. if ((l & 2) != 0) {
  7716. npc.desc = EntityDef.forID(stream.method436());
  7717. npc.anInt1540 = npc.desc.aByte68;
  7718. npc.anInt1504 = npc.desc.anInt79;
  7719. npc.anInt1554 = npc.desc.walkAnim;
  7720. npc.anInt1555 = npc.desc.anInt58;
  7721. npc.anInt1556 = npc.desc.anInt83;
  7722. npc.anInt1557 = npc.desc.anInt55;
  7723. npc.anInt1511 = npc.desc.standAnim;
  7724. }
  7725. if ((l & 4) != 0) {
  7726. npc.anInt1538 = stream.method434();
  7727. npc.anInt1539 = stream.method434();
  7728. }
  7729. }
  7730. }
  7731.  
  7732. public void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  7733. if (menuActionRow >= 400)
  7734. return;
  7735. if (entityDef.childrenIDs != null)
  7736. entityDef = entityDef.method161();
  7737. if (entityDef == null)
  7738. return;
  7739. if (!entityDef.aBoolean84)
  7740. return;
  7741. String s = entityDef.name;
  7742. if (entityDef.combatLevel != 0)
  7743. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7744. if (itemSelected == 1) {
  7745. menuActionName[menuActionRow] = "Use " + selectedItemName
  7746. + " with @yel@" + s;
  7747. menuActionIds[menuActionRow] = 582;
  7748. menuActionCmd1[menuActionRow] = i;
  7749. menuActionCmd2[menuActionRow] = k;
  7750. menuActionCmd3[menuActionRow] = j;
  7751. menuActionRow++;
  7752. return;
  7753. }
  7754. if (spellSelected == 1) {
  7755. if ((spellUsableOn & 2) == 2) {
  7756. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7757. menuActionIds[menuActionRow] = 413;
  7758. menuActionCmd1[menuActionRow] = i;
  7759. menuActionCmd2[menuActionRow] = k;
  7760. menuActionCmd3[menuActionRow] = j;
  7761. menuActionRow++;
  7762. }
  7763. } else {
  7764. if (entityDef.actions != null) {
  7765. for (int l = 4; l >= 0; l--)
  7766. if (entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  7767. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7768. if (l == 0)
  7769. menuActionIds[menuActionRow] = 20;
  7770. if (l == 1)
  7771. menuActionIds[menuActionRow] = 412;
  7772. if (l == 2)
  7773. menuActionIds[menuActionRow] = 225;
  7774. if (l == 3)
  7775. menuActionIds[menuActionRow] = 965;
  7776. if (l == 4)
  7777. menuActionIds[menuActionRow] = 478;
  7778. menuActionCmd1[menuActionRow] = i;
  7779. menuActionCmd2[menuActionRow] = k;
  7780. menuActionCmd3[menuActionRow] = j;
  7781. menuActionRow++;
  7782. }
  7783.  
  7784. }
  7785. if (entityDef.actions != null) {
  7786. for (int i1 = 4; i1 >= 0; i1--)
  7787. if (entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  7788. char c = '\0';
  7789. if (entityDef.combatLevel > myPlayer.combatLevel)
  7790. c = '\u07D0';
  7791.  
  7792. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7793. if (i1 == 0)
  7794. menuActionIds[menuActionRow] = 20 + c;
  7795. if (i1 == 1)
  7796. menuActionIds[menuActionRow] = 412 + c;
  7797. if (i1 == 2)
  7798. menuActionIds[menuActionRow] = 225 + c;
  7799. if (i1 == 3)
  7800. menuActionIds[menuActionRow] = 965 + c;
  7801. if (i1 == 4)
  7802. menuActionIds[menuActionRow] = 478 + c;
  7803. menuActionCmd1[menuActionRow] = i;
  7804. menuActionCmd2[menuActionRow] = k;
  7805. menuActionCmd3[menuActionRow] = j;
  7806. menuActionRow++;
  7807. }
  7808.  
  7809. }
  7810. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  7811. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.id + "@gre@)";
  7812. } else {
  7813. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7814. }
  7815. menuActionIds[menuActionRow] = 1025;
  7816. menuActionCmd1[menuActionRow] = i;
  7817. menuActionCmd2[menuActionRow] = k;
  7818. menuActionCmd3[menuActionRow] = j;
  7819. menuActionRow++;
  7820. }
  7821. }
  7822.  
  7823. public void buildAtPlayerMenu(int i, int j, Player player, int k) {
  7824. if (player == myPlayer)
  7825. return;
  7826. if (menuActionRow >= 400)
  7827. return;
  7828. String s;
  7829. if (player.skill == 0)
  7830. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7831. else
  7832. s = player.name + " (skill-" + player.skill + ")";
  7833. if (itemSelected == 1) {
  7834. menuActionName[menuActionRow] = "Use " + selectedItemName
  7835. + " with @whi@" + s;
  7836. menuActionIds[menuActionRow] = 491;
  7837. menuActionCmd1[menuActionRow] = j;
  7838. menuActionCmd2[menuActionRow] = i;
  7839. menuActionCmd3[menuActionRow] = k;
  7840. menuActionRow++;
  7841. } else if (spellSelected == 1) {
  7842. if ((spellUsableOn & 8) == 8) {
  7843. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7844. menuActionIds[menuActionRow] = 365;
  7845. menuActionCmd1[menuActionRow] = j;
  7846. menuActionCmd2[menuActionRow] = i;
  7847. menuActionCmd3[menuActionRow] = k;
  7848. menuActionRow++;
  7849. }
  7850. } else {
  7851. for (int l = 4; l >= 0; l--)
  7852. if (atPlayerActions[l] != null) {
  7853. menuActionName[menuActionRow] = atPlayerActions[l]
  7854. + " @whi@" + s;
  7855. char c = '\0';
  7856. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  7857. if (player.combatLevel > myPlayer.combatLevel)
  7858. c = '\u07D0';
  7859. if (myPlayer.team != 0 && player.team != 0)
  7860. if (myPlayer.team == player.team)
  7861. c = '\u07D0';
  7862. else
  7863. c = '\0';
  7864. } else if (atPlayerArray[l])
  7865. c = '\u07D0';
  7866. if (l == 0)
  7867. menuActionIds[menuActionRow] = 561 + c;
  7868. if (l == 1)
  7869. menuActionIds[menuActionRow] = 779 + c;
  7870. if (l == 2)
  7871. menuActionIds[menuActionRow] = 27 + c;
  7872. if (l == 3)
  7873. menuActionIds[menuActionRow] = 577 + c;
  7874. if (l == 4)
  7875. menuActionIds[menuActionRow] = 729 + c;
  7876. menuActionCmd1[menuActionRow] = j;
  7877. menuActionCmd2[menuActionRow] = i;
  7878. menuActionCmd3[menuActionRow] = k;
  7879. menuActionRow++;
  7880. }
  7881.  
  7882. }
  7883. for (int i1 = 0; i1 < menuActionRow; i1++)
  7884. if (menuActionIds[i1] == 516) {
  7885. menuActionName[i1] = "Walk here @whi@" + s;
  7886. return;
  7887. }
  7888.  
  7889. }
  7890.  
  7891. public void method89(Class30_Sub1 class30_sub1) {
  7892. int i = 0;
  7893. int j = -1;
  7894. int k = 0;
  7895. int l = 0;
  7896. if (class30_sub1.anInt1296 == 0)
  7897. i = worldController.method300(class30_sub1.anInt1295,
  7898. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7899. if (class30_sub1.anInt1296 == 1)
  7900. i = worldController.method301(class30_sub1.anInt1295,
  7901. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7902. if (class30_sub1.anInt1296 == 2)
  7903. i = worldController.method302(class30_sub1.anInt1295,
  7904. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7905. if (class30_sub1.anInt1296 == 3)
  7906. i = worldController.method303(class30_sub1.anInt1295,
  7907. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7908. if (i != 0) {
  7909. int i1 = worldController.method304(class30_sub1.anInt1295,
  7910. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7911. j = i >> 14 & 0x7fff;
  7912. k = i1 & 0x1f;
  7913. l = i1 >> 6;
  7914. }
  7915. class30_sub1.anInt1299 = j;
  7916. class30_sub1.anInt1301 = k;
  7917. class30_sub1.anInt1300 = l;
  7918. }
  7919.  
  7920. /*public void method90() {
  7921. for (int i = 0; i < currentSound; i++)
  7922. if (soundDelay[i] <= 0) {
  7923. boolean flag1 = false;
  7924. try {
  7925. if (sound[i] == anInt874
  7926. && soundType[i] == anInt1289) {
  7927. if (!replayWave())
  7928. flag1 = true;
  7929. } else {
  7930. Stream stream = Sounds.method241(soundType[i],
  7931. sound[i]);
  7932. if (System.currentTimeMillis()
  7933. + (long) (stream.currentOffset / 22) > aLong1172
  7934. + (long) (anInt1257 / 22)) {
  7935. anInt1257 = stream.currentOffset;
  7936. aLong1172 = System.currentTimeMillis();
  7937. if (saveWave(stream.buffer, stream.currentOffset)) {
  7938. anInt874 = sound[i];
  7939. anInt1289 = soundType[i];
  7940. } else {
  7941. flag1 = true;
  7942. }
  7943. }
  7944. }
  7945. } catch (Exception exception) {
  7946. }
  7947. if (!flag1 || soundDelay[i] == -5) {
  7948. currentSound--;
  7949. for (int j = i; j < currentSound; j++) {
  7950. sound[j] = sound[j + 1];
  7951. soundType[j] = soundType[j + 1];
  7952. soundDelay[j] = soundDelay[j + 1];
  7953. }
  7954.  
  7955. i--;
  7956. } else {
  7957. soundDelay[i] = -5;
  7958. }
  7959. } else {
  7960. soundDelay[i]--;
  7961. }
  7962.  
  7963. if (prevSong > 0) {
  7964. prevSong -= 20;
  7965. if (prevSong < 0)
  7966. prevSong = 0;
  7967. if (prevSong == 0 && musicEnabled && !lowMem) {
  7968. nextSong = currentSong;
  7969. songChanging = true;
  7970. onDemandFetcher.method558(2, nextSong);
  7971. }
  7972. }
  7973. }*/
  7974.  
  7975. public void playSound(int id, int type, int delay, int volume) {
  7976. sound[currentSound] = id;
  7977. soundType[currentSound] = type;
  7978. soundDelay[currentSound] = delay + Sound.anIntArray326[id];
  7979. soundVolume[currentSound] = volume;
  7980. currentSound++;
  7981. }
  7982.  
  7983. public final void method90() {
  7984. for (int index = 0; index < currentSound; index++) {
  7985. //if (soundDelay[index] <= 0) {
  7986. boolean flag1 = false;
  7987. try {
  7988. Stream stream = Sound.method241(soundType[index], sound[index]);
  7989. new SoundPlayer((InputStream) new ByteArrayInputStream(stream.buffer, 0, stream.currentOffset), soundVolume[index], soundDelay[index]);
  7990. if (System.currentTimeMillis() + (long) (stream.currentOffset / 22) > aLong1172 + (long) (anInt1257 / 22)) {
  7991. anInt1257 = stream.currentOffset;
  7992. aLong1172 = System.currentTimeMillis();
  7993. }
  7994. } catch (Exception exception) {
  7995. exception.printStackTrace();
  7996. }
  7997. if (!flag1 || soundDelay[index] == -5) {
  7998. currentSound--;
  7999. for (int j = index; j < currentSound; j++) {
  8000. sound[j] = sound[j + 1];
  8001. soundType[j] = soundType[j + 1];
  8002. soundDelay[j] = soundDelay[j + 1];
  8003. soundVolume[j] = soundVolume[j + 1];
  8004. }
  8005. index--;
  8006. } else {
  8007. soundDelay[index] = -5;
  8008. }
  8009. /*} else {
  8010. soundDelay[index]--;
  8011. }*/
  8012. }
  8013.  
  8014. if (previousSong > 0) {
  8015. previousSong -= 20;
  8016. if (previousSong < 0)
  8017. previousSong = 0;
  8018. if (previousSong == 0 && musicEnabled) {
  8019. nextSong = currentSong;
  8020. songChanging = true;
  8021. onDemandFetcher.method558(2, nextSong);
  8022. }
  8023. }
  8024. }
  8025.  
  8026. public String indexLocation(int cacheIndex, int index) {
  8027. return SignLink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  8028. }
  8029.  
  8030. public void repackCacheIndex(int cacheIndex) {
  8031. System.out.println("Started repacking index " + cacheIndex + ".");
  8032. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  8033. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  8034. try {
  8035. for (int index = 0; index < indexLength; index++) {
  8036. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  8037. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  8038. if(data != null && data.length > 0) {
  8039. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  8040. System.out.println("Repacked " + fileIndex + ".");
  8041. } else {
  8042. System.out.println("Unable to locate index " + fileIndex + ".");
  8043. }
  8044. }
  8045. } catch(Exception e) {
  8046. System.out.println("Error packing cache index " + cacheIndex + ".");
  8047. }
  8048. System.out.println("Finished repacking " + cacheIndex + ".");
  8049. }
  8050.  
  8051. public byte[] fileToByteArray(int cacheIndex, int index) {
  8052. try {
  8053. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  8054. return null;
  8055. }
  8056. File file = new File(indexLocation(cacheIndex, index));
  8057. byte[] fileData = new byte[(int)file.length()];
  8058. FileInputStream fis = new FileInputStream(file);
  8059. fis.read(fileData);
  8060. fis.close();
  8061. return fileData;
  8062. } catch(Exception e) {
  8063. return null;
  8064. }
  8065. }
  8066. @SuppressWarnings("unused")
  8067. void startUp() {
  8068. drawNewLoadingText(150, "Starting up");
  8069. update.run();
  8070. if (SignLink.sunjava)
  8071. super.minDelay = 5;
  8072. if (aBoolean993) {
  8073. // rsAlreadyLoaded = true;
  8074. // return;
  8075. }
  8076. aBoolean993 = true;
  8077. boolean flag = true;
  8078. String s = getDocumentBaseHost();
  8079. if (SignLink.cache_dat != null) {
  8080. for (int i = 0; i < 6; i++)
  8081. decompressors[i] = new Decompressor(SignLink.cache_dat, SignLink.cache_idx[i], i + 1);
  8082. }
  8083.  
  8084.  
  8085. try {
  8086. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  8087. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8088. smallHit = new TextDrawingArea(false, "hit_full", titleStreamLoader);
  8089. bigHit = new TextDrawingArea(true, "critical_full", titleStreamLoader);
  8090. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8091. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8092. aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8093. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  8094. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  8095. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  8096. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  8097. LoginBox = new Sprite("Login/loginBox");
  8098. LoginButton = new Sprite("Login/loginButton");
  8099. LoginButtonHover = new Sprite("Login/loginButtonHover");
  8100. TypeIn = new Sprite("Login/typeIn");
  8101. TypeInHover = new Sprite("Login/typeInHover");
  8102. RememberNo = new Sprite("Login/rememberNo");
  8103. RememberYes = new Sprite("Login/rememberYes");
  8104. Logo = new Sprite("Login/logo");
  8105. BackgroundFix = new Sprite("/BG/mainBg");
  8106. drawLogo();
  8107. loadTitleScreen();
  8108. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8109. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8110. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8111. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8112. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8113. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8114. byteGroundArray = new byte[4][104][104];
  8115. intGroundArray = new int[4][105][105];
  8116. worldController = new WorldController(intGroundArray);
  8117. for (int j = 0; j < 4; j++)
  8118. aClass11Array1230[j] = new TileSettings();
  8119.  
  8120. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  8121. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  8122. "versionlist", expectedCRCs[5], 60);
  8123. drawNewLoadingText(225, "Connecting to update server");
  8124. onDemandFetcher = new OnDemandFetcher();
  8125. onDemandFetcher.start(streamLoader_6, this);
  8126. Model.method459(65535, onDemandFetcher);
  8127. Texture.init(1420, onDemandFetcher);
  8128. Class36.method528(65535);
  8129. //preloadModels();
  8130. // models();
  8131. // repackCacheIndex(1);
  8132. drawNewLoadingText(300, "Unpacking media");
  8133. /* Custom sprite unpacking */
  8134. HPBarFull = new Sprite("player/hp 0");
  8135. HPBarEmpty = new Sprite("player/hp 1");
  8136. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8137. // mapIcon = new Sprite(streamLoader_2, "mapfunction", 70);
  8138. chatArea = new Sprite("chatarea");
  8139. tabArea = new Sprite("Gameframe/tabarea");
  8140. worldMapIcon = new Sprite("mapicon");
  8141. logIconH = new Sprite("logiconh");
  8142. logIconC = new Sprite("logiconc");
  8143. mapArea = new Sprite("maparea");
  8144. for(int i = 1; i < 19; i++) {
  8145. if (i == 12 || i == 13)
  8146. continue;
  8147.  
  8148. ORBS[i] = new Sprite("sprites/gameframe/orbs/orbs " + i);
  8149. if (i == 16 || i == 18)
  8150. ORBS[i].setTransparency(255, 0, 255);
  8151. }
  8152. /**/
  8153. mapBack = new Background(streamLoader_2, "mapback", 0);
  8154. customSideIcons[1].setTransparency(255, 0, 255);
  8155. customSideIcons[2].setTransparency(255, 0, 255);
  8156.  
  8157. for(int i = 0; i < 3; i++) {
  8158. counter[i] = new Sprite("/XP/XP "+i);
  8159. counter[i].setTransparency(255, 0, 255);
  8160. }
  8161. for (int c1 = 0; c1 <= 3; c1++)
  8162. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  8163. for (int j3 = 0; j3 <= 14; j3++)
  8164. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  8165. for (int r1 = 0; r1 < 5; r1++)
  8166. redStones[r1] = new Sprite("Gameframe/redstones " + r1);
  8167.  
  8168. for (int i4 = 0; i4 < 9; i4++) {
  8169. hitMark[i4] = new Sprite("/Hits/hit " + i4);
  8170. hitMark[i4].setTransparency(255, 0, 255);
  8171. }
  8172.  
  8173. for(int i4 = 0; i4 < 5; i4++) {
  8174. hitIcon[i4] = new Sprite("/Hits/icon " + i4);
  8175. }
  8176.  
  8177. Sprite[] clanIcons = new Sprite[9];
  8178. for (int index = 0; index < clanIcons.length; index++) {
  8179. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);
  8180. }
  8181. RSFont.unpackImages(modIcons, clanIcons);
  8182. compass = new Sprite(streamLoader_2, "compass", 0);
  8183. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  8184. mapEdge.method345();
  8185. try {
  8186. for (int k3 = 0; k3 < 100; k3++)
  8187. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  8188. } catch (Exception _ex) {
  8189. }
  8190. try {
  8191. for (int l3 = 0; l3 < 100; l3++)
  8192. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  8193. } catch (Exception _ex) {
  8194. }
  8195. try {
  8196. for (int i4 = 0; i4 < 20; i4++)
  8197. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8198. } catch (Exception _ex) {
  8199. }
  8200. try {
  8201. for (int h1 = 0; h1 < 6; h1++)
  8202. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  8203. } catch (Exception _ex) {
  8204. }
  8205. try {
  8206. for (int j4 = 0; j4 < 18; j4++)
  8207. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  8208. for (int j45 = 0; j45 < 3; j45++)
  8209. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45);
  8210. } catch (Exception _ex) {
  8211. }
  8212. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8213. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8214. for (int k4 = 0; k4 < 8; k4++)
  8215. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8216.  
  8217. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8218. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8219. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8220. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8221. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8222. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8223. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8224.  
  8225. for (int l4 = 1; l4 < 11; l4++) {
  8226. modIcons[l4] = new Sprite("Crowns/" + l4);
  8227. modIcons[l4].setTransparency(255, 0, 255);
  8228. }
  8229.  
  8230. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8231. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8232. sprite.method346(0, 0);
  8233. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8234. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8235. sprite.method346(0, 0);
  8236. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  8237. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8238. sprite.method346(0, 0);
  8239. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  8240. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8241. sprite.method346(0, 0);
  8242. int i5 = (int) (Math.random() * 21D) - 10;
  8243. int j5 = (int) (Math.random() * 21D) - 10;
  8244. int k5 = (int) (Math.random() * 21D) - 10;
  8245. int l5 = (int) (Math.random() * 41D) - 20;
  8246. for (int i6 = 0; i6 < 100; i6++) {
  8247. if (mapFunctions[i6] != null)
  8248. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8249. if (mapScenes[i6] != null)
  8250. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8251. }
  8252.  
  8253. drawNewLoadingText(375, "Unpacking textures");
  8254. Rasterizer.calculatePalette(0.8F);
  8255. Rasterizer.resetTextures();
  8256. drawNewLoadingText(450, "Unpacking config");
  8257. Animation.unpackConfig(streamLoader);
  8258. ObjectDef.unpackConfig(streamLoader);
  8259. Flo.unpackConfig(streamLoader);
  8260. TextureDef.unpackConfig(streamLoader.getDataForName("textures.dat"));
  8261. FloorOverlay.unpackConfig(streamLoader);
  8262. ItemDef.unpackConfig(streamLoader);
  8263. EntityDef.unpackConfig(streamLoader);
  8264. IDK.unpackConfig(streamLoader);
  8265. SpotAnim.unpackConfig(streamLoader);
  8266. Varp.unpackConfig(streamLoader);
  8267. VarBit.unpackConfig(streamLoader);
  8268. ItemDef.isMembers = isMembers;
  8269. if (!lowMem) {
  8270. drawNewLoadingText(525, "Unpacking sounds");
  8271. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  8272. Stream stream = new Stream(abyte0);
  8273. Sound.unpack(stream);
  8274. }
  8275. drawNewLoadingText(600, "Unpacking interfaces");
  8276. TextDrawingArea allFonts[] = { smallText, aTextDrawingArea_1271,
  8277. chatTextDrawingArea, aTextDrawingArea_1273 };
  8278. RSInterface.unpack(streamLoader_1, allFonts, streamLoader_2);
  8279. drawNewLoadingText(750, "Preparing game engine");
  8280. for (int j6 = 0; j6 < 33; j6++) {
  8281. int k6 = 999;
  8282. int i7 = 0;
  8283. for (int k7 = 0; k7 < 34; k7++) {
  8284. if (mapBack.aByteArray1450[k7 + j6
  8285. * mapBack.anInt1452] == 0) {
  8286. if (k6 == 999)
  8287. k6 = k7;
  8288. continue;
  8289. }
  8290. if (k6 == 999)
  8291. continue;
  8292. i7 = k7;
  8293. break;
  8294. }
  8295.  
  8296. anIntArray968[j6] = k6;
  8297. anIntArray1057[j6] = i7 - k6;
  8298. }
  8299.  
  8300. for (int l6 = 5; l6 < 156; l6++) {
  8301. int j7 = 999;
  8302. int l7 = 0;
  8303. for (int j8 = 25; j8 < 172; j8++) {
  8304. if (mapBack.aByteArray1450[j8 + l6
  8305. * mapBack.anInt1452] == 0
  8306. && (j8 > 34 || l6 > 34)) {
  8307. if (j7 == 999)
  8308. j7 = j8;
  8309. continue;
  8310. }
  8311. if (j7 == 999)
  8312. continue;
  8313. l7 = j8;
  8314. break;
  8315. }
  8316.  
  8317. anIntArray1052[l6 - 5] = j7 - 25;
  8318. anIntArray1229[l6 - 5] = l7 - j7;
  8319. }
  8320.  
  8321. Rasterizer.setBounds(765, 503);
  8322. fullScreenTextureArray = Rasterizer.lineOffsets;
  8323. Rasterizer.setBounds(519, 165);
  8324. anIntArray1180 = Rasterizer.lineOffsets;
  8325. Rasterizer.setBounds(246, 335);
  8326. anIntArray1181 = Rasterizer.lineOffsets;
  8327. Rasterizer.setBounds(512, 334);
  8328. anIntArray1182 = Rasterizer.lineOffsets;
  8329. int ai[] = new int[9];
  8330. for (int i8 = 0; i8 < 9; i8++) {
  8331. int k8 = 128 + i8 * 32 + 15;
  8332. int l8 = 600 + k8 * 3;
  8333. int i9 = Rasterizer.SINE[k8];
  8334. ai[i8] = l8 * i9 >> 16;
  8335. }
  8336.  
  8337. WorldController.method310(500, 800, 512, 334, ai);
  8338. Censor.loadConfig(streamLoader_4);
  8339. mouseDetection = new MouseDetection(this);
  8340. startRunnable(mouseDetection, 10);
  8341. Animable_Sub5.ClientInstance = this;
  8342. ObjectDef.clientInstance = this;
  8343. EntityDef.ClientInstance = this;
  8344. return;
  8345. } catch (Exception exception) {
  8346. exception.printStackTrace();
  8347. SignLink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8348. }
  8349. loadingError = true;
  8350. }
  8351.  
  8352. public void method91(Stream stream, int i) {
  8353. while (stream.bitPosition + 10 < i * 8) {
  8354. int j = stream.readBits(11);
  8355. if (j == 2047)
  8356. break;
  8357. if (playerArray[j] == null) {
  8358. playerArray[j] = new Player();
  8359. if (aStreamArray895s[j] != null)
  8360. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8361. }
  8362. playerIndices[playerCount++] = j;
  8363. Player player = playerArray[j];
  8364. player.anInt1537 = loopCycle;
  8365. int k = stream.readBits(1);
  8366. if (k == 1)
  8367. anIntArray894[anInt893++] = j;
  8368. int l = stream.readBits(1);
  8369. int i1 = stream.readBits(5);
  8370. if (i1 > 15)
  8371. i1 -= 32;
  8372. int j1 = stream.readBits(5);
  8373. if (j1 > 15)
  8374. j1 -= 32;
  8375. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  8376. l == 1);
  8377. }
  8378. stream.finishBitAccess();
  8379. }
  8380.  
  8381. public void processMainScreenClick() {
  8382. if (anInt1021 != 0)
  8383. return;
  8384. if (super.clickMode3 == 1) {
  8385. int i = super.saveClickX - 25 - 545;
  8386. int j = super.saveClickY - 5 - 4;
  8387. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  8388. i -= 73;
  8389. j -= 75;
  8390. int k = viewRotation + minimapRotation & 0x7ff;
  8391. int i1 = Rasterizer.SINE[k];
  8392. int j1 = Rasterizer.COSINE[k];
  8393. i1 = i1 * (minimapZoom + 256) >> 8;
  8394. j1 = j1 * (minimapZoom + 256) >> 8;
  8395. int k1 = j * i1 + i * j1 >> 11;
  8396. int l1 = j * j1 - i * i1 >> 11;
  8397. int i2 = myPlayer.x + k1 >> 7;
  8398. int j2 = myPlayer.y - l1 >> 7;
  8399. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  8400. j2, myPlayer.smallX[0], true, i2);
  8401. if (flag1) {
  8402. stream.writeWordBigEndian(i);
  8403. stream.writeWordBigEndian(j);
  8404. stream.writeWord(viewRotation);
  8405. stream.writeWordBigEndian(57);
  8406. stream.writeWordBigEndian(minimapRotation);
  8407. stream.writeWordBigEndian(minimapZoom);
  8408. stream.writeWordBigEndian(89);
  8409. stream.writeWord(myPlayer.x);
  8410. stream.writeWord(myPlayer.y);
  8411. stream.writeWordBigEndian(anInt1264);
  8412. stream.writeWordBigEndian(63);
  8413. }
  8414. }
  8415. anInt1117++;
  8416. if (anInt1117 > 1151) {
  8417. anInt1117 = 0;
  8418. stream.createFrame(246);
  8419. stream.writeWordBigEndian(0);
  8420. int l = stream.currentOffset;
  8421. if ((int) (Math.random() * 2D) == 0)
  8422. stream.writeWordBigEndian(101);
  8423. stream.writeWordBigEndian(197);
  8424. stream.writeWord((int) (Math.random() * 65536D));
  8425. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8426. stream.writeWordBigEndian(67);
  8427. stream.writeWord(14214);
  8428. if ((int) (Math.random() * 2D) == 0)
  8429. stream.writeWord(29487);
  8430. stream.writeWord((int) (Math.random() * 65536D));
  8431. if ((int) (Math.random() * 2D) == 0)
  8432. stream.writeWordBigEndian(220);
  8433. stream.writeWordBigEndian(180);
  8434. stream.writeBytes(stream.currentOffset - l);
  8435. }
  8436. }
  8437. }
  8438.  
  8439. public String interfaceIntToString(int j) {
  8440. if (j < 0x3b9ac9ff)
  8441. return String.valueOf(j);
  8442. else
  8443. return "*";
  8444. }
  8445.  
  8446. public void showErrorScreen() {
  8447. Graphics g = getGameComponent().getGraphics();
  8448. g.setColor(Color.black);
  8449. g.fillRect(0, 0, 765, 503);
  8450. method4(1);
  8451. if (loadingError) {
  8452. aBoolean831 = false;
  8453. g.setFont(new Font("Helvetica", 1, 16));
  8454. g.setColor(Color.yellow);
  8455. int k = 35;
  8456. g.drawString(
  8457. "Sorry, an error has occured whilst loading RuneScape",
  8458. 30, k);
  8459. k += 50;
  8460. g.setColor(Color.white);
  8461. g.drawString("To fix this try the following (in order):", 30, k);
  8462. k += 50;
  8463. g.setColor(Color.white);
  8464. g.setFont(new Font("Helvetica", 1, 12));
  8465. g.drawString(
  8466. "1: Try closing ALL open web-browser windows, and reloading",
  8467. 30, k);
  8468. k += 30;
  8469. g.drawString(
  8470. "2: Try clearing your web-browsers cache from tools->internet options",
  8471. 30, k);
  8472. k += 30;
  8473. g.drawString("3: Try using a different game-world", 30, k);
  8474. k += 30;
  8475. g.drawString("4: Try rebooting your computer", 30, k);
  8476. k += 30;
  8477. g.drawString(
  8478. "5: Try selecting a different version of Java from the play-game menu",
  8479. 30, k);
  8480. }
  8481. if (genericLoadingError) {
  8482. aBoolean831 = false;
  8483. g.setFont(new Font("Helvetica", 1, 20));
  8484. g.setColor(Color.white);
  8485. g.drawString("Error - unable to load game!", 50, 50);
  8486. g.drawString("To play RuneScape make sure you play from", 50,
  8487. 100);
  8488. g.drawString("http://www.RuneScape.com", 50, 150);
  8489. }
  8490. if (rsAlreadyLoaded) {
  8491. aBoolean831 = false;
  8492. g.setColor(Color.yellow);
  8493. int l = 35;
  8494. g.drawString(
  8495. "Error a copy of RuneScape already appears to be loaded",
  8496. 30, l);
  8497. l += 50;
  8498. g.setColor(Color.white);
  8499. g.drawString("To fix this try the following (in order):", 30, l);
  8500. l += 50;
  8501. g.setColor(Color.white);
  8502. g.setFont(new Font("Helvetica", 1, 12));
  8503. g.drawString(
  8504. "1: Try closing ALL open web-browser windows, and reloading",
  8505. 30, l);
  8506. l += 30;
  8507. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8508. l += 30;
  8509. }
  8510. }
  8511.  
  8512. public URL getCodeBase() {
  8513. try {
  8514. return new URL(server + ":" + (80 + portOff));
  8515. } catch (Exception _ex) {
  8516. }
  8517. return null;
  8518. }
  8519.  
  8520. public void method95() {
  8521. for (int j = 0; j < npcCount; j++) {
  8522. int k = npcIndices[j];
  8523. NPC npc = npcArray[k];
  8524. if (npc != null)
  8525. method96(npc);
  8526. }
  8527. }
  8528.  
  8529. public void method96(Entity entity) {
  8530. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  8531. || entity.y >= 13184) {
  8532. entity.anim = -1;
  8533. entity.anInt1520 = -1;
  8534. entity.anInt1547 = 0;
  8535. entity.anInt1548 = 0;
  8536. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8537. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8538. entity.method446();
  8539. }
  8540. if (entity == myPlayer
  8541. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  8542. entity.anim = -1;
  8543. entity.anInt1520 = -1;
  8544. entity.anInt1547 = 0;
  8545. entity.anInt1548 = 0;
  8546. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8547. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8548. entity.method446();
  8549. }
  8550. if (entity.anInt1547 > loopCycle)
  8551. method97(entity);
  8552. else if (entity.anInt1548 >= loopCycle)
  8553. method98(entity);
  8554. else
  8555. method99(entity);
  8556. method100(entity);
  8557. method101(entity);
  8558. }
  8559.  
  8560. public void method97(Entity entity) {
  8561. int i = entity.anInt1547 - loopCycle;
  8562. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8563. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8564. entity.x += (j - entity.x) / i;
  8565. entity.y += (k - entity.y) / i;
  8566. entity.anInt1503 = 0;
  8567. if (entity.anInt1549 == 0)
  8568. entity.turnDirection = 1024;
  8569. if (entity.anInt1549 == 1)
  8570. entity.turnDirection = 1536;
  8571. if (entity.anInt1549 == 2)
  8572. entity.turnDirection = 0;
  8573. if (entity.anInt1549 == 3)
  8574. entity.turnDirection = 512;
  8575. }
  8576.  
  8577. public void method98(Entity entity) {
  8578. if (entity.anInt1548 == loopCycle
  8579. || entity.anim == -1
  8580. || entity.anInt1529 != 0
  8581. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  8582. .method258(entity.anInt1527)) {
  8583. int i = entity.anInt1548 - entity.anInt1547;
  8584. int j = loopCycle - entity.anInt1547;
  8585. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8586. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8587. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8588. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8589. entity.x = (k * (i - j) + i1 * j) / i;
  8590. entity.y = (l * (i - j) + j1 * j) / i;
  8591. }
  8592. entity.anInt1503 = 0;
  8593. if (entity.anInt1549 == 0)
  8594. entity.turnDirection = 1024;
  8595. if (entity.anInt1549 == 1)
  8596. entity.turnDirection = 1536;
  8597. if (entity.anInt1549 == 2)
  8598. entity.turnDirection = 0;
  8599. if (entity.anInt1549 == 3)
  8600. entity.turnDirection = 512;
  8601. entity.anInt1552 = entity.turnDirection;
  8602. }
  8603.  
  8604. public void method99(Entity entity) {
  8605. entity.anInt1517 = entity.anInt1511;
  8606. if (entity.smallXYIndex == 0) {
  8607. entity.anInt1503 = 0;
  8608. return;
  8609. }
  8610. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8611. Animation animation = Animation.anims[entity.anim];
  8612. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  8613. entity.anInt1503++;
  8614. return;
  8615. }
  8616. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  8617. entity.anInt1503++;
  8618. return;
  8619. }
  8620. }
  8621. int i = entity.x;
  8622. int j = entity.y;
  8623. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8624. * 64;
  8625. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8626. * 64;
  8627. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  8628. entity.x = k;
  8629. entity.y = l;
  8630. return;
  8631. }
  8632. if (i < k) {
  8633. if (j < l)
  8634. entity.turnDirection = 1280;
  8635. else if (j > l)
  8636. entity.turnDirection = 1792;
  8637. else
  8638. entity.turnDirection = 1536;
  8639. } else if (i > k) {
  8640. if (j < l)
  8641. entity.turnDirection = 768;
  8642. else if (j > l)
  8643. entity.turnDirection = 256;
  8644. else
  8645. entity.turnDirection = 512;
  8646. } else if (j < l)
  8647. entity.turnDirection = 1024;
  8648. else
  8649. entity.turnDirection = 0;
  8650. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8651. if (i1 > 1024)
  8652. i1 -= 2048;
  8653. int j1 = entity.anInt1555;
  8654. if (i1 >= -256 && i1 <= 256)
  8655. j1 = entity.anInt1554;
  8656. else if (i1 >= 256 && i1 < 768)
  8657. j1 = entity.anInt1557;
  8658. else if (i1 >= -768 && i1 <= -256)
  8659. j1 = entity.anInt1556;
  8660. if (j1 == -1)
  8661. j1 = entity.anInt1554;
  8662. entity.anInt1517 = j1;
  8663. int k1 = 4;
  8664. if (entity.anInt1552 != entity.turnDirection
  8665. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8666. k1 = 2;
  8667. if (entity.smallXYIndex > 2)
  8668. k1 = 6;
  8669. if (entity.smallXYIndex > 3)
  8670. k1 = 8;
  8671. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  8672. k1 = 8;
  8673. entity.anInt1503--;
  8674. }
  8675. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8676. k1 <<= 1;
  8677. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  8678. && entity.anInt1505 != -1)
  8679. entity.anInt1517 = entity.anInt1505;
  8680. if (i < k) {
  8681. entity.x += k1;
  8682. if (entity.x > k)
  8683. entity.x = k;
  8684. } else if (i > k) {
  8685. entity.x -= k1;
  8686. if (entity.x < k)
  8687. entity.x = k;
  8688. }
  8689. if (j < l) {
  8690. entity.y += k1;
  8691. if (entity.y > l)
  8692. entity.y = l;
  8693. } else if (j > l) {
  8694. entity.y -= k1;
  8695. if (entity.y < l)
  8696. entity.y = l;
  8697. }
  8698. if (entity.x == k && entity.y == l) {
  8699. entity.smallXYIndex--;
  8700. if (entity.anInt1542 > 0)
  8701. entity.anInt1542--;
  8702. }
  8703. }
  8704.  
  8705. public void method100(Entity entity) {
  8706. if (entity.anInt1504 == 0)
  8707. return;
  8708. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  8709. NPC npc = npcArray[entity.interactingEntity];
  8710. if (npc != null) {
  8711. int i1 = entity.x - npc.x;
  8712. int k1 = entity.y - npc.y;
  8713. if (i1 != 0 || k1 != 0)
  8714. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8715. }
  8716. }
  8717. if (entity.interactingEntity >= 32768) {
  8718. int j = entity.interactingEntity - 32768;
  8719. if (j == unknownInt10)
  8720. j = myPlayerIndex;
  8721. Player player = playerArray[j];
  8722. if (player != null) {
  8723. int l1 = entity.x - player.x;
  8724. int i2 = entity.y - player.y;
  8725. if (l1 != 0 || i2 != 0)
  8726. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8727. }
  8728. }
  8729. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  8730. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  8731. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8732. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8733. if (k != 0 || j1 != 0)
  8734. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8735. entity.anInt1538 = 0;
  8736. entity.anInt1539 = 0;
  8737. }
  8738. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8739. if (l != 0) {
  8740. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8741. entity.anInt1552 = entity.turnDirection;
  8742. else if (l > 1024)
  8743. entity.anInt1552 -= entity.anInt1504;
  8744. else
  8745. entity.anInt1552 += entity.anInt1504;
  8746. entity.anInt1552 &= 0x7ff;
  8747. if (entity.anInt1517 == entity.anInt1511
  8748. && entity.anInt1552 != entity.turnDirection) {
  8749. if (entity.anInt1512 != -1) {
  8750. entity.anInt1517 = entity.anInt1512;
  8751. return;
  8752. }
  8753. entity.anInt1517 = entity.anInt1554;
  8754. }
  8755. }
  8756. }
  8757.  
  8758. public void method101(Entity entity) {
  8759. entity.aBoolean1541 = false;
  8760. if (entity.anInt1517 != -1) {
  8761. Animation animation = Animation.anims[entity.anInt1517];
  8762. entity.anInt1519++;
  8763. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  8764. entity.anInt1519 = 1;//this is the frame delay. 0 is what it's normally at. higher number = faster animations.
  8765. entity.anInt1518++;
  8766. }
  8767. if (entity.anInt1518 >= animation.anInt352) {
  8768. entity.anInt1519 = 1;
  8769. entity.anInt1518 = 0;
  8770. }
  8771. }
  8772. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  8773. if (entity.anInt1521 < 0)
  8774. entity.anInt1521 = 0;
  8775. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8776. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  8777. && entity.anInt1522 > animation_1
  8778. .method258(entity.anInt1521); entity.anInt1521++)
  8779. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8780.  
  8781. if (entity.anInt1521 >= animation_1.anInt352
  8782. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8783. entity.anInt1520 = -1;
  8784. }
  8785. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  8786. Animation animation_2 = Animation.anims[entity.anim];
  8787. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  8788. && entity.anInt1547 <= loopCycle
  8789. && entity.anInt1548 < loopCycle) {
  8790. entity.anInt1529 = 1;
  8791. return;
  8792. }
  8793. }
  8794. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8795. Animation animation_3 = Animation.anims[entity.anim];
  8796. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  8797. && entity.anInt1528 > animation_3
  8798. .method258(entity.anInt1527); entity.anInt1527++)
  8799. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8800.  
  8801. if (entity.anInt1527 >= animation_3.anInt352) {
  8802. entity.anInt1527 -= animation_3.anInt356;
  8803. entity.anInt1530++;
  8804. if (entity.anInt1530 >= animation_3.anInt362)
  8805. entity.anim = -1;
  8806. if (entity.anInt1527 < 0
  8807. || entity.anInt1527 >= animation_3.anInt352)
  8808. entity.anim = -1;
  8809. }
  8810. entity.aBoolean1541 = animation_3.aBoolean358;
  8811. }
  8812. if (entity.anInt1529 > 0)
  8813. entity.anInt1529--;
  8814. }
  8815.  
  8816. public void drawGameScreen() {
  8817. if (fullscreenInterfaceID != -1
  8818. && (loadingStage == 2 || super.fullGameScreen != null)) {
  8819. if (loadingStage == 2) {
  8820. method119(anInt945, fullscreenInterfaceID);
  8821. if (openInterfaceID != -1) {
  8822. method119(anInt945, openInterfaceID);
  8823. }
  8824. anInt945 = 0;
  8825. resetAllImageProducers();
  8826. super.fullGameScreen.initDrawingArea();
  8827. Rasterizer.lineOffsets = fullScreenTextureArray;
  8828. DrawingArea.setAllPixelsToZero();
  8829. welcomeScreenRaised = true;
  8830. if (openInterfaceID != -1) {
  8831. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8832. if (rsInterface_1.width == 512
  8833. && rsInterface_1.height == 334
  8834. && rsInterface_1.type == 0) {
  8835. rsInterface_1.width = 765;
  8836. rsInterface_1.height = 503;
  8837. }
  8838. drawInterface(0, 0, rsInterface_1, 8);
  8839. }
  8840. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8841. if (rsInterface.width == 512 && rsInterface.height == 334
  8842. && rsInterface.type == 0) {
  8843. rsInterface.width = 765;
  8844. rsInterface.height = 503;
  8845. }
  8846. drawInterface(0, 0, rsInterface, 8);
  8847.  
  8848. if (!menuOpen) {
  8849. processRightClick();
  8850. drawTooltip();
  8851. } else {
  8852. drawMenu();
  8853. }
  8854. }
  8855. drawCount++;
  8856. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8857. return;
  8858. } else {
  8859. if (drawCount != 0) {
  8860. resetImageProducers2();
  8861. }
  8862. }
  8863. if (welcomeScreenRaised) {
  8864. welcomeScreenRaised = false;
  8865. topFrame.drawGraphics(0, super.graphics, 0);
  8866. leftFrame.drawGraphics(4, super.graphics, 0);
  8867. rightFrame.drawGraphics(4, super.graphics, 516);
  8868. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8869. needDrawTabArea = true;
  8870. inputTaken = true;
  8871. tabAreaAltered = true;
  8872. aBoolean1233 = true;
  8873. if (loadingStage != 2) {
  8874. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8875. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8876. }
  8877. }
  8878. if (menuOpen && menuScreenArea == 1)
  8879. needDrawTabArea = true;
  8880. if (invOverlayInterfaceID != -1) {
  8881. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8882. if (flag1)
  8883. needDrawTabArea = true;
  8884. }
  8885. if (atInventoryInterfaceType == 2)
  8886. needDrawTabArea = true;
  8887. if (activeInterfaceType == 2)
  8888. needDrawTabArea = true;
  8889. if (needDrawTabArea) {
  8890. drawTabArea();
  8891. needDrawTabArea = false;
  8892. }
  8893. if (backDialogID == -1) {
  8894. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8895. if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8896. method65(494, 110, super.mouseX - 0, super.mouseY - 348,
  8897. aClass9_1059, 0, false, anInt1211);
  8898. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8899. if (i < 0)
  8900. i = 0;
  8901. if (i > anInt1211 - 110)
  8902. i = anInt1211 - 110;
  8903. if (anInt1089 != i) {
  8904. anInt1089 = i;
  8905. inputTaken = true;
  8906. }
  8907. }
  8908. if (backDialogID != -1) {
  8909. boolean flag2 = method119(anInt945, backDialogID);
  8910. if (flag2)
  8911. inputTaken = true;
  8912. }
  8913. if (atInventoryInterfaceType == 3)
  8914. inputTaken = true;
  8915. if (activeInterfaceType == 3)
  8916. inputTaken = true;
  8917. if (aString844 != null)
  8918. inputTaken = true;
  8919. if (menuOpen && menuScreenArea == 2)
  8920. inputTaken = true;
  8921. if (inputTaken) {
  8922. drawChatArea();
  8923. inputTaken = false;
  8924. }
  8925. if (loadingStage == 2)
  8926. method146();
  8927. if (loadingStage == 2) {
  8928. drawMinimap();
  8929. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8930. }
  8931. if (anInt1054 != -1)
  8932. tabAreaAltered = true;
  8933. if (tabAreaAltered) {
  8934. if (anInt1054 != -1 && anInt1054 == tabID) {
  8935. anInt1054 = -1;
  8936. stream.createFrame(120);
  8937. stream.writeWordBigEndian(tabID);
  8938. }
  8939. tabAreaAltered = false;
  8940. aRSImageProducer_1125.initDrawingArea();
  8941. aRSImageProducer_1165.initDrawingArea();
  8942. }
  8943. anInt945 = 0;
  8944. }
  8945.  
  8946. public boolean buildFriendsListMenu(RSInterface class9) {
  8947. int i = class9.contentType;
  8948. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  8949. if (i >= 801)
  8950. i -= 701;
  8951. else if (i >= 701)
  8952. i -= 601;
  8953. else if (i >= 101)
  8954. i -= 101;
  8955. else
  8956. i--;
  8957. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8958. menuActionIds[menuActionRow] = 792;
  8959. menuActionRow++;
  8960. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8961. menuActionIds[menuActionRow] = 639;
  8962. menuActionRow++;
  8963. return true;
  8964. }
  8965. if (i >= 401 && i <= 500) {
  8966. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8967. menuActionIds[menuActionRow] = 322;
  8968. menuActionRow++;
  8969. return true;
  8970. } else {
  8971. return false;
  8972. }
  8973. }
  8974.  
  8975. public void method104() {
  8976. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8977. .reverseGetFirst();
  8978. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8979. .reverseGetNext())
  8980. if (class30_sub2_sub4_sub3.anInt1560 != plane
  8981. || class30_sub2_sub4_sub3.aBoolean1567)
  8982. class30_sub2_sub4_sub3.unlink();
  8983. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  8984. class30_sub2_sub4_sub3.method454(anInt945);
  8985. if (class30_sub2_sub4_sub3.aBoolean1567)
  8986. class30_sub2_sub4_sub3.unlink();
  8987. else
  8988. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  8989. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  8990. class30_sub2_sub4_sub3.anInt1562, 60,
  8991. class30_sub2_sub4_sub3.anInt1561,
  8992. class30_sub2_sub4_sub3, false);
  8993. }
  8994.  
  8995. }
  8996.  
  8997. public void drawInterface(int j, int k, RSInterface class9, int l) {
  8998. if (class9.type != 0 || class9.children == null)
  8999. return;
  9000. if (class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  9001. return;
  9002. int i1 = DrawingArea.topX;
  9003. int j1 = DrawingArea.topY;
  9004. int k1 = DrawingArea.bottomX;
  9005. int l1 = DrawingArea.bottomY;
  9006. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9007. int i2 = class9.children.length;
  9008. for (int j2 = 0; j2 < i2; j2++) {
  9009. int k2 = class9.childX[j2] + k;
  9010. int l2 = (class9.childY[j2] + l) - j;
  9011. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9012.  
  9013. k2 += class9_1.anInt263;
  9014. l2 += class9_1.anInt265;
  9015. if (class9_1.id == 22001) {
  9016. class9_1.contentType = 424;
  9017. }
  9018. if (class9_1.contentType > 0)
  9019. drawFriendsListOrWelcomeScreen(class9_1);
  9020. // here
  9021.  
  9022. int[] IDs = {
  9023. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  9024. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  9025. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  9026. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  9027. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  9028. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  9029. 12436, 12446, 12456, 6004, 18471,
  9030. /* Ancients */
  9031. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  9032. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  9033. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9034. };
  9035. for (int m5 = 0; m5 < IDs.length; m5++) {
  9036. if (class9_1.id == IDs[m5] + 1) {
  9037. if (m5 > 61)
  9038. drawBlackBox(k2 + 1, l2);
  9039. else
  9040. drawBlackBox(k2, l2 + 1);
  9041. }
  9042. }
  9043. int[] runeChildren = {
  9044. 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  9045. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  9046. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  9047. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  9048. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  9049. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  9050. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  9051. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  9052. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  9053. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  9054. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  9055. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  9056. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  9057. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  9058. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  9059. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  9060. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478
  9061. };
  9062. for (int r = 0; r < runeChildren.length; r++)
  9063. if (class9_1.id == runeChildren[r])
  9064. class9_1.modelZoom = 775;
  9065. if (class9_1.type == 0) {
  9066. if (class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  9067. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  9068. if (class9_1.scrollPosition < 0)
  9069. class9_1.scrollPosition = 0;
  9070. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9071. if (class9_1.scrollMax > class9_1.height) {
  9072. // clan chat
  9073. if (class9_1.id == 18143) {
  9074. int clanMates = 0;
  9075. for (int i = 18155; i < 18244; i++) {
  9076. RSInterface line = RSInterface.interfaceCache[i];
  9077. if (line.message.length() > 0) {
  9078. clanMates++;
  9079. }
  9080. }
  9081. class9_1.scrollMax = (clanMates * 14) + class9_1.height + 1;
  9082. }
  9083. if (class9_1.id == 24322 || class9_1.id == 24423) {
  9084. int members = 0;
  9085. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  9086. RSInterface line = RSInterface.interfaceCache[i];
  9087. if (line != null && line.message != null) {
  9088. if (line.message.length() > 0) {
  9089. members++;
  9090. }
  9091. }
  9092. }
  9093. class9_1.scrollMax = (members * 14) + 1;
  9094. }
  9095. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2,
  9096. k2 + class9_1.width, class9_1.scrollMax);
  9097. }
  9098. } else if (class9_1.type != 1)
  9099. if (class9_1.type == 2) {
  9100. int i3 = 0;
  9101. for (int l3 = 0; l3 < class9_1.height; l3++) {
  9102. for (int l4 = 0; l4 < class9_1.width; l4++) {
  9103. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9104. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9105. if (i3 < 20) {
  9106. k5 += class9_1.spritesX[i3];
  9107. j6 += class9_1.spritesY[i3];
  9108. }
  9109. if (class9_1.inv[i3] > 0) {
  9110. int k6 = 0;
  9111. int j7 = 0;
  9112. int j9 = class9_1.inv[i3] - 1;
  9113. if (k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  9114. int l9 = 0;
  9115. if (itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  9116. l9 = 0xffffff;
  9117. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  9118. if (class30_sub2_sub1_sub1_2 != null) {
  9119. if (activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  9120. k6 = super.mouseX - anInt1087;
  9121. j7 = super.mouseY - anInt1088;
  9122. if (k6 < 5 && k6 > -5)
  9123. k6 = 0;
  9124. if (j7 < 5 && j7 > -5)
  9125. j7 = 0;
  9126. if (anInt989 < 10) {
  9127. k6 = 0;
  9128. j7 = 0;
  9129. }
  9130. class30_sub2_sub1_sub1_2
  9131. .drawSprite1(k5 + k6, j6 + j7);
  9132. if (j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  9133. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9134. if (i10 > anInt945 * 10)
  9135. i10 = anInt945 * 10;
  9136. if (i10 > class9.scrollPosition)
  9137. i10 = class9.scrollPosition;
  9138. class9.scrollPosition -= i10;
  9139. anInt1088 += i10;
  9140. }
  9141. if (j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9142. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9143. if (j10 > anInt945 * 10)
  9144. j10 = anInt945 * 10;
  9145. if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9146. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9147. class9.scrollPosition += j10;
  9148. anInt1088 -= j10;
  9149. }
  9150. } else if (atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9151. class30_sub2_sub1_sub1_2
  9152. .drawSprite1(k5, j6);
  9153. else
  9154. class30_sub2_sub1_sub1_2
  9155. .drawSprite(k5, j6);
  9156. if (class30_sub2_sub1_sub1_2.maxWidth == 33 || class9_1.invStackSizes[i3] != 1) {
  9157. int k10 = class9_1.invStackSizes[i3];
  9158. if (k10 >= 1)
  9159. smallText.method385(0xFFFF00,
  9160. intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9161. if (k10 >= 100000)
  9162. smallText.method385(0xFFFFFF,
  9163. intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9164. if (k10 >= 10000000)
  9165. smallText.method385(0x0FF80,
  9166. intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9167.  
  9168. /*
  9169. * smallText.method385(0,
  9170. * intToKOrMil(k10), j6 + 10 + j7,
  9171. * k5 + 1 + k6);
  9172. * smallText.method385(0xffff00,
  9173. * intToKOrMil(k10), j6 + 9 + j7, k5
  9174. * + k6);
  9175. */
  9176. }
  9177. }
  9178. }
  9179. } else if (class9_1.sprites != null && i3 < 20) {
  9180. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9181. if (class30_sub2_sub1_sub1_1 != null)
  9182. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9183. }
  9184. i3++;
  9185. }
  9186. }
  9187. } else if (class9_1.type == 3) {
  9188. boolean flag = false;
  9189. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9190. flag = true;
  9191. int j3;
  9192. if (interfaceIsSelected(class9_1)) {
  9193. j3 = class9_1.anInt219;
  9194. if (flag && class9_1.anInt239 != 0)
  9195. j3 = class9_1.anInt239;
  9196. } else {
  9197. j3 = class9_1.textColor;
  9198. if (flag && class9_1.anInt216 != 0)
  9199. j3 = class9_1.anInt216;
  9200. }
  9201. if (class9_1.opacity == 0) {
  9202. if (class9_1.aBoolean227)
  9203. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  9204. class9_1.width);
  9205. else
  9206. DrawingArea.fillPixels(k2, class9_1.width,
  9207. class9_1.height, j3, l2);
  9208. } else if (class9_1.aBoolean227)
  9209. DrawingArea.method335(j3, l2, class9_1.width,
  9210. class9_1.height,
  9211. 256 - (class9_1.opacity & 0xff), k2);
  9212. else
  9213. DrawingArea.method338(l2, class9_1.height,
  9214. 256 - (class9_1.opacity & 0xff), j3,
  9215. class9_1.width, k2);
  9216. } else if (class9_1.type == 4) {
  9217. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9218. String s = class9_1.message;
  9219. boolean flag1 = false;
  9220. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9221. flag1 = true;
  9222. int i4;
  9223. if (interfaceIsSelected(class9_1)) {
  9224. i4 = class9_1.anInt219;
  9225. if (flag1 && class9_1.anInt239 != 0)
  9226. i4 = class9_1.anInt239;
  9227. if (class9_1.aString228 != null && class9_1.aString228.length() > 0)
  9228. s = class9_1.aString228;
  9229. } else {
  9230. i4 = class9_1.textColor;
  9231. if (flag1 && class9_1.anInt216 != 0)
  9232. i4 = class9_1.anInt216;
  9233. }
  9234. if (class9_1.atActionType == 6 && aBoolean1149) {
  9235. s = "Please wait...";
  9236. i4 = class9_1.textColor;
  9237. }
  9238. if (DrawingArea.width == 519) {
  9239. if (i4 == 0xffff00)
  9240. i4 = 255;
  9241. if (i4 == 49152)
  9242. i4 = 0xffffff;
  9243. }
  9244. if ((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9245. switch (i4) {
  9246. case 16773120:
  9247. i4 = 0xFE981F;
  9248. break;
  9249. case 7040819:
  9250. i4 = 0xAF6A1A;
  9251. break;
  9252. }
  9253. }
  9254.  
  9255. /*int id = 4004;
  9256. int id2 = 4005;
  9257. if (class9_1.parentID == 3917 && class9_1.id != id && class9_1.id != id + 2 && class9_1.id != id + 4 && class9_1.id != id + 6 && class9_1.id != id + 8 && class9_1.id != id + 10 && class9_1.id != id + 12 && class9_1.id != id + 14 && class9_1.id != id + 16 && class9_1.id != id + 18 && class9_1.id != id + 20 && class9_1.id != id + 23 && class9_1.id != id + 24 && class9_1.id != id + 26 && class9_1.id != id + 28 && class9_1.id != id + 30 && class9_1.id != id + 32 && class9_1.id != id + 34 && class9_1.id != 13926 && class9_1.id != 4152 && class9_1.id != 12166 && class9_1.id != id2 && class9_1.id != id2 + 2 && class9_1.id != id2 + 4 && class9_1.id != id2 + 6 && class9_1.id != id2 + 8 && class9_1.id != id2 + 10 && class9_1.id != id2 + 12 && class9_1.id != id2 + 14 && class9_1.id != id2 + 16 && class9_1.id != id2 + 18 && class9_1.id != id2 + 20 && class9_1.id != id2 + 23 && class9_1.id != id2 + 24 && class9_1.id != id2 + 26 && class9_1.id != id2 + 28 && class9_1.id != id2 + 30 && class9_1.id != id2 + 32 && class9_1.id != id2 + 34 && class9_1.id != 13927 && class9_1.id != 4153 && class9_1.id != 12167 && class9_1.id != 4026) {
  9258. if (i4 == 16776960)
  9259. i4 = 0x0000;
  9260. class9_1.textShadow = false;
  9261. }*/
  9262.  
  9263. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  9264. if (s.indexOf("%") != -1) {
  9265. do {
  9266. int k7 = s.indexOf("%1");
  9267. if (k7 == -1)
  9268. break;
  9269. if (class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id != 13921 && class9_1.id != 13922 && class9_1.id != 12171 && class9_1.id != 12172)
  9270. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9271. else
  9272. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9273. } while (true);
  9274. do {
  9275. int l7 = s.indexOf("%2");
  9276. if (l7 == -1)
  9277. break;
  9278. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  9279. } while (true);
  9280. do {
  9281. int i8 = s.indexOf("%3");
  9282. if (i8 == -1)
  9283. break;
  9284. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  9285. } while (true);
  9286. do {
  9287. int j8 = s.indexOf("%4");
  9288. if (j8 == -1)
  9289. break;
  9290. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  9291. } while (true);
  9292. do {
  9293. int k8 = s.indexOf("%5");
  9294. if (k8 == -1)
  9295. break;
  9296. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  9297. } while (true);
  9298. }
  9299. int l8 = s.indexOf("\\n");
  9300. String s1;
  9301. if (l8 != -1) {
  9302. s1 = s.substring(0, l8);
  9303. s = s.substring(l8 + 2);
  9304. } else {
  9305. s1 = s;
  9306. s = "";
  9307. }
  9308. RSFont font = null;
  9309. if (textDrawingArea == smallText) {
  9310. font = newSmallFont;
  9311. } else if (textDrawingArea == aTextDrawingArea_1271) {
  9312. font = newRegularFont;
  9313. } else if (textDrawingArea == chatTextDrawingArea) {
  9314. font = newBoldFont;
  9315. } else if (textDrawingArea == aTextDrawingArea_1273) {
  9316. font = newFancyFont;
  9317. } else {
  9318. font = newRegularFont;
  9319. }
  9320.  
  9321. if (class9_1.centerText) {
  9322. font.drawCenteredString(s1, k2 + class9_1.width / 2, l6, i4, class9_1.textShadow ? 0 : -1);
  9323. } else {
  9324. font.drawBasicString(s1, k2, l6, i4, class9_1.textShadow ? 0 : -1);
  9325. }
  9326. }
  9327. } else if (class9_1.type == 5) {
  9328. Sprite image;
  9329. Sprite hover;
  9330. if (interfaceIsSelected(class9_1)) {
  9331. image = class9_1.sprite2;
  9332. hover = class9_1.enabledHover;
  9333. } else {
  9334. image = class9_1.sprite1;
  9335. hover = class9_1.disabledHover;
  9336. }
  9337. if (image != null) {
  9338. if (spellSelected == 1 && class9_1.id == spellID && spellID != 0) {
  9339. image.drawSprite(k2, l2, 0xffffff);
  9340. } else {
  9341. image.drawSprite(k2, l2);
  9342. }
  9343. if (hover != null) {
  9344. if (hoverId == class9_1.id) {
  9345. hover.drawSprite(k2, l2);
  9346. }
  9347. }
  9348. }
  9349. } else if (class9_1.type == 6) {
  9350. int k3 = Rasterizer.centerX;
  9351. int j4 = Rasterizer.centerY;
  9352. Rasterizer.centerX = k2 + class9_1.width / 2;
  9353. Rasterizer.centerY = l2 + class9_1.height / 2;
  9354. int i5 = Rasterizer.SINE[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9355. int l5 = Rasterizer.COSINE[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9356. boolean flag2 = interfaceIsSelected(class9_1);
  9357. int i7;
  9358. if (flag2)
  9359. i7 = class9_1.anInt258;
  9360. else
  9361. i7 = class9_1.anInt257;
  9362. Model model;
  9363. if (i7 == -1) {
  9364. model = class9_1.method209(-1, -1, flag2);
  9365. } else {
  9366. Animation animation = Animation.anims[i7];
  9367. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  9368. }
  9369. if (model != null)
  9370. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  9371. Rasterizer.centerX = k3;
  9372. Rasterizer.centerY = j4;
  9373. } else if (class9_1.type == 7) {
  9374. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9375. int k4 = 0;
  9376. for (int j5 = 0; j5 < class9_1.height; j5++) {
  9377. for (int i6 = 0; i6 < class9_1.width; i6++) {
  9378. if (class9_1.inv[k4] > 0) {
  9379. ItemDef itemDef = ItemDef
  9380. .forID(class9_1.inv[k4] - 1);
  9381. String s2 = itemDef.name;
  9382. if (itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  9383. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9384. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  9385. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  9386. if (class9_1.centerText)
  9387. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  9388. else
  9389. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  9390. }
  9391. k4++;
  9392. }
  9393. }
  9394. } else if (class9_1.type == 9) {
  9395. drawHoverBox(k2, l2, class9_1.message);
  9396. }
  9397. if (class9_1.type == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 0 && !menuOpen) {
  9398. int boxWidth = 0;
  9399. int boxHeight = 0;
  9400. TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
  9401. for (String s1 = class9_1.message; s1.length() > 0;) {
  9402. if (s1.indexOf("%") != -1) {
  9403. do {
  9404. int k7 = s1.indexOf("%1");
  9405. if (k7 == -1)
  9406. break;
  9407. s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s1.substring(k7 + 2);
  9408. } while (true);
  9409. do {
  9410. int l7 = s1.indexOf("%2");
  9411. if (l7 == -1)
  9412. break;
  9413. s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s1.substring(l7 + 2);
  9414. } while (true);
  9415. do {
  9416. int i8 = s1.indexOf("%3");
  9417. if (i8 == -1)
  9418. break;
  9419. s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s1.substring(i8 + 2);
  9420. } while (true);
  9421. do {
  9422. int j8 = s1.indexOf("%4");
  9423. if (j8 == -1)
  9424. break;
  9425. s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s1.substring(j8 + 2);
  9426. } while (true);
  9427. do {
  9428. int k8 = s1.indexOf("%5");
  9429. if (k8 == -1)
  9430. break;
  9431. s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s1.substring(k8 + 2);
  9432. } while (true);
  9433. }
  9434. int l7 = s1.indexOf("\\n");
  9435. String s4;
  9436. if (l7 != -1) {
  9437. s4 = s1.substring(0, l7);
  9438. s1 = s1.substring(l7 + 2);
  9439. } else {
  9440. s4 = s1;
  9441. s1 = "";
  9442. }
  9443. int j10 = textDrawingArea_2.getTextWidth(s4);
  9444. if (j10 > boxWidth) {
  9445. boxWidth = j10;
  9446. }
  9447. boxHeight += textDrawingArea_2.anInt1497 + 1;
  9448. }
  9449. boxWidth += 6;
  9450. boxHeight += 7;
  9451. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  9452. int yPos = l2 + class9_1.height + 5;
  9453. if (xPos < k2 + 5) {
  9454. xPos = k2 + 5;
  9455. }
  9456. if (xPos + boxWidth > k + class9.width) {
  9457. xPos = (k + class9.width) - boxWidth;
  9458. }
  9459. if (yPos + boxHeight > l + class9.height) {
  9460. yPos = (l2 - boxHeight);
  9461. }
  9462. if (class9_1.inventoryhover) {
  9463. if (xPos + boxWidth + k > 249) {
  9464. xPos = 251 - boxWidth - k;
  9465. }
  9466. if (class9_1.id == 3985) {
  9467. yPos = yPos - boxHeight - 17;
  9468. } else if (yPos + boxHeight + l >= 366) {
  9469. yPos = 245 - boxHeight - 10;
  9470. } else if (yPos + boxHeight + l > 320) {
  9471. yPos = 245 - boxHeight - l;
  9472. }
  9473. }
  9474. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  9475. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  9476. String s2 = class9_1.message;
  9477. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) { // anInt1497
  9478. if (s2.indexOf("%") != -1) {
  9479. do {
  9480. int k7 = s2.indexOf("%1");
  9481. if (k7 == -1)
  9482. break;
  9483. s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s2.substring(k7 + 2);
  9484. } while (true);
  9485. do {
  9486. int l7 = s2.indexOf("%2");
  9487. if (l7 == -1)
  9488. break;
  9489. s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s2.substring(l7 + 2);
  9490. } while (true);
  9491. do {
  9492. int i8 = s2.indexOf("%3");
  9493. if (i8 == -1)
  9494. break;
  9495. s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s2.substring(i8 + 2);
  9496. } while (true);
  9497. do {
  9498. int j8 = s2.indexOf("%4");
  9499. if (j8 == -1)
  9500. break;
  9501. s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s2.substring(j8 + 2);
  9502. } while (true);
  9503. do {
  9504. int k8 = s2.indexOf("%5");
  9505. if (k8 == -1)
  9506. break;
  9507. s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s2.substring(k8 + 2);
  9508. } while (true);
  9509. }
  9510. int l11 = s2.indexOf("\\n");
  9511. String s5;
  9512. if (l11 != -1) {
  9513. s5 = s2.substring(0, l11);
  9514. s2 = s2.substring(l11 + 2);
  9515. } else {
  9516. s5 = s2;
  9517. s2 = "";
  9518. }
  9519. if (class9_1.centerText) {
  9520. textDrawingArea_2.method382(yPos, xPos + class9_1.width / 2, s5, j11, false);
  9521. } else {
  9522. if (s5.contains("\\r")) {
  9523. String text = s5.substring(0, s5.indexOf("\\r"));
  9524. String text2 = s5.substring(s5.indexOf("\\r") + 2);
  9525. textDrawingArea_2.method389(false, xPos + 3, 0, text, j11);
  9526. int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
  9527. textDrawingArea_2.method389(false, rightX, 0, text2, j11);
  9528. System.out.println("Box: " + boxWidth + "");
  9529. } else
  9530. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  9531. }
  9532. }
  9533. }
  9534. }
  9535. /*if (class9_1.type == 12) {
  9536. Sprite sprite;
  9537. if (interfaceIsSelected(class9_1))
  9538. sprite = class9_1.sprite2;
  9539. else
  9540. sprite = class9_1.sprite1;
  9541. if (sprite != null)
  9542. sprite.drawAdvancedSprite(k2, l2);
  9543. } else if (class9_1.type == 9) {
  9544. System.out.println("here");
  9545. drawHoverBox(k2, l2, class9_1.message);
  9546. }*/
  9547. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9548. }
  9549.  
  9550. public final String methodR(int j) {
  9551. if (j >= 0 && j < 10000)
  9552. return String.valueOf(j);
  9553. if (j >= 10000 && j < 10000000)
  9554. return j / 1000 + "K";
  9555. if (j >= 10000000 && j < 999999999)
  9556. return j / 1000000 + "M";
  9557. if (j >= 999999999)
  9558. return "*";
  9559. else
  9560. return "?";
  9561. }
  9562.  
  9563. public void drawHoverBox(int xPos, int yPos, String text) {
  9564. String[] results = text.split("\n");
  9565. int height = (results.length * 16) + 6;
  9566. int width;
  9567. width = chatTextDrawingArea.getTextWidth(results[0]) + 6;
  9568. for (int i = 1; i < results.length; i++)
  9569. if (width <= chatTextDrawingArea.getTextWidth(results[i]) + 6)
  9570. width = chatTextDrawingArea.getTextWidth(results[i]) + 6;
  9571. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  9572. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  9573. yPos += 14;
  9574. for (int i = 0; i < results.length; i++) {
  9575. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i],
  9576. yPos);
  9577. yPos += 16;
  9578. }
  9579. }
  9580.  
  9581. public void drawBlackBox(int xPos, int yPos) {
  9582. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  9583. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  9584. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  9585. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  9586. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  9587. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  9588. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  9589. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  9590. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  9591. }
  9592.  
  9593. public void randomizeBackground(Background background) {
  9594. int j = 256;
  9595. for (int k = 0; k < anIntArray1190.length; k++)
  9596. anIntArray1190[k] = 0;
  9597.  
  9598. for (int l = 0; l < 5000; l++) {
  9599. int i1 = (int) (Math.random() * 128D * (double) j);
  9600. anIntArray1190[i1] = (int) (Math.random() * 256D);
  9601. }
  9602. for (int j1 = 0; j1 < 20; j1++) {
  9603. for (int k1 = 1; k1 < j - 1; k1++) {
  9604. for (int i2 = 1; i2 < 127; i2++) {
  9605. int k2 = i2 + (k1 << 7);
  9606. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  9607. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9608. }
  9609.  
  9610. }
  9611. int ai[] = anIntArray1190;
  9612. anIntArray1190 = anIntArray1191;
  9613. anIntArray1191 = ai;
  9614. }
  9615. if (background != null) {
  9616. int l1 = 0;
  9617. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  9618. for (int l2 = 0; l2 < background.anInt1452; l2++)
  9619. if (background.aByteArray1450[l1++] != 0) {
  9620. int i3 = l2 + 16 + background.anInt1454;
  9621. int j3 = j2 + 16 + background.anInt1455;
  9622. int k3 = i3 + (j3 << 7);
  9623. anIntArray1190[k3] = 0;
  9624. }
  9625. }
  9626. }
  9627. }
  9628.  
  9629. public void method107(int i, int j, Stream stream, Player player) {
  9630. if ((i & 0x400) != 0) {
  9631. player.anInt1543 = stream.method428();
  9632. player.anInt1545 = stream.method428();
  9633. player.anInt1544 = stream.method428();
  9634. player.anInt1546 = stream.method428();
  9635. player.anInt1547 = stream.method436() + loopCycle;
  9636. player.anInt1548 = stream.method435() + loopCycle;
  9637. player.anInt1549 = stream.method428();
  9638. player.method446();
  9639. }
  9640. if ((i & 0x100) != 0) {
  9641. player.anInt1520 = stream.method434();
  9642. int k = stream.readDWord();
  9643. player.anInt1524 = k >> 16;
  9644. player.anInt1523 = loopCycle + (k & 0xffff);
  9645. player.anInt1521 = 0;
  9646. player.anInt1522 = 0;
  9647. if (player.anInt1523 > loopCycle)
  9648. player.anInt1521 = -1;
  9649. if (player.anInt1520 == 65535)
  9650. player.anInt1520 = -1;
  9651. }
  9652. if ((i & 8) != 0) {
  9653. int l = stream.method434();
  9654. if (l == 65535)
  9655. l = -1;
  9656. int i2 = stream.method427();
  9657. if (l == player.anim && l != -1) {
  9658. int i3 = Animation.anims[l].anInt365;
  9659. if (i3 == 1) {
  9660. player.anInt1527 = 0;
  9661. player.anInt1528 = 0;
  9662. player.anInt1529 = i2;
  9663. player.anInt1530 = 0;
  9664. }
  9665. if (i3 == 2)
  9666. player.anInt1530 = 0;
  9667. } else if (l == -1
  9668. || player.anim == -1
  9669. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  9670. player.anim = l;
  9671. player.anInt1527 = 0;
  9672. player.anInt1528 = 0;
  9673. player.anInt1529 = i2;
  9674. player.anInt1530 = 0;
  9675. player.anInt1542 = player.smallXYIndex;
  9676. }
  9677. }
  9678. if ((i & 4) != 0) {
  9679. player.textSpoken = stream.readString();
  9680. if (player.textSpoken.charAt(0) == '~') {
  9681. player.textSpoken = player.textSpoken.substring(1);
  9682. pushMessage(player.textSpoken, 2, player.name);
  9683. } else if (player == myPlayer)
  9684. pushMessage(player.textSpoken, 2, player.name);
  9685. player.anInt1513 = 0;
  9686. player.anInt1531 = 0;
  9687. player.textCycle = 150;
  9688. }
  9689. if ((i & 0x80) != 0) {
  9690. int i1 = stream.method434();
  9691. int j2 = stream.readUnsignedByte();
  9692. int j3 = stream.method427();
  9693. int k3 = stream.currentOffset;
  9694. if (player.name != null && player.visible) {
  9695. long l3 = TextClass.longForName(player.name);
  9696. boolean flag = false;
  9697. if (j2 <= 1) {
  9698. for (int i4 = 0; i4 < ignoreCount; i4++) {
  9699. if (ignoreListAsLongs[i4] != l3)
  9700. continue;
  9701. flag = true;
  9702. break;
  9703. }
  9704.  
  9705. }
  9706. if (!flag && anInt1251 == 0)
  9707. try {
  9708. aStream_834.currentOffset = 0;
  9709. stream.method442(j3, 0, aStream_834.buffer);
  9710. aStream_834.currentOffset = 0;
  9711. String s = TextInput.method525(j3, aStream_834);
  9712. player.textSpoken = s;
  9713. player.anInt1513 = i1 >> 8;
  9714. player.privelage = j2;
  9715. player.anInt1531 = i1 & 0xff;
  9716. player.textCycle = 150;
  9717. if(j2 == 1)
  9718. pushMessage(s, 1, "@cr1@" + player.name);
  9719. else if(j2 == 2)
  9720. pushMessage(s, 1, "@cr2@" + player.name);
  9721. else if(j2 == 3)
  9722. pushMessage(s, 1, "@cr3@" + player.name);
  9723. else if(j2 == 4)
  9724. pushMessage(s, 1, "@cr4@" + player.name);
  9725. else if(j2 == 5)
  9726. pushMessage(s, 1, "@cr5@" + player.name);
  9727. else if(j2 == 6)
  9728. pushMessage(s, 1, "@cr6@" + player.name);
  9729. else if(j2 == 7)
  9730. pushMessage(s, 1, "@cr7@" + player.name);
  9731. else if(j2 == 8)
  9732. pushMessage(s, 1, "@cr8@" + player.name);
  9733. else if(j2 == 9)
  9734. pushMessage(s, 1, "@cr9@" + player.name);
  9735. else if(j2 == 10)
  9736. pushMessage(s, 1, "@cr10@" + player.name);
  9737. else if(j2 == 11)
  9738. pushMessage(s, 1, "@cr11@" + player.name);
  9739. else if(j2 == 12)
  9740. pushMessage(s, 1, "@cr12@" + player.name);
  9741. else if(j2 == 13)
  9742. pushMessage(s, 1, "@cr13@" + player.name);
  9743. else if(j2 == 14)
  9744. pushMessage(s, 1, "@cr14@" + player.name);
  9745. else if(j2 == 15)
  9746. pushMessage(s, 1, "@cr15@" + player.name);
  9747. else if(j2 == 16)
  9748. pushMessage(s, 1, "@cr16@" + player.name);
  9749. else if(j2 == 17)
  9750. pushMessage(s, 1, "@cr17@" + player.name);
  9751. else if(j2 == 18)
  9752. pushMessage(s, 1, "@cr18@" + player.name);
  9753. else if(j2 == 19)
  9754. pushMessage(s, 1, "@cr19@" + player.name);
  9755. else if(j2 == 20)
  9756. pushMessage(s, 1, "@cr20@" + player.name);
  9757. else
  9758. pushMessage(s, 2, player.name);
  9759. } catch (Exception exception) {
  9760. SignLink.reporterror("cde2");
  9761. }
  9762. }
  9763. stream.currentOffset = k3 + j3;
  9764. }
  9765. if ((i & 1) != 0) {
  9766. player.interactingEntity = stream.method434();
  9767. if (player.interactingEntity == 65535)
  9768. player.interactingEntity = -1;
  9769. }
  9770. if ((i & 0x10) != 0) {
  9771. int j1 = stream.method427();
  9772. byte abyte0[] = new byte[j1];
  9773. Stream stream_1 = new Stream(abyte0);
  9774. stream.readBytes(j1, 0, abyte0);
  9775. aStreamArray895s[j] = stream_1;
  9776. player.updatePlayer(stream_1);
  9777. }
  9778. if ((i & 2) != 0) {
  9779. player.anInt1538 = stream.method436();
  9780. player.anInt1539 = stream.method434();
  9781. }
  9782. if((i & 0x20) != 0)
  9783. {
  9784. int k1 = stream.readUnsignedByte();
  9785. int k2 = stream.method426();
  9786. int icon = stream.readUnsignedByte();
  9787. player.updateHitData(k2, k1, loopCycle, icon == 255 ? -1 : icon);
  9788. player.loopCycleStatus = loopCycle + 300;
  9789. player.currentHealth = stream.method427();
  9790. player.maxHealth = stream.readUnsignedByte();
  9791. }
  9792. if((i & 0x200) != 0)
  9793. {
  9794. int l1 = stream.readUnsignedByte();
  9795. int l2 = stream.method428();
  9796. int icon = stream.readUnsignedByte();
  9797. player.updateHitData(l2, l1, loopCycle, icon);
  9798. player.loopCycleStatus = loopCycle + 300;
  9799. player.currentHealth = stream.readUnsignedByte();
  9800. player.maxHealth = stream.method427();
  9801. }
  9802. }
  9803.  
  9804. public void method108() {
  9805. try {
  9806. int j = myPlayer.x + cameraOffsetX;
  9807. int k = myPlayer.y + cameraOffsetY;
  9808. if (anInt1014 - j < -500 || anInt1014 - j > 500
  9809. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  9810. anInt1014 = j;
  9811. anInt1015 = k;
  9812. }
  9813. if (anInt1014 != j)
  9814. anInt1014 += (j - anInt1014) / 16;
  9815. if (anInt1015 != k)
  9816. anInt1015 += (k - anInt1015) / 16;
  9817. if (super.keyArray[1] == 1)
  9818. anInt1186 += (-24 - anInt1186) / 2;
  9819. else if (super.keyArray[2] == 1)
  9820. anInt1186 += (24 - anInt1186) / 2;
  9821. else
  9822. anInt1186 /= 2;
  9823. if (super.keyArray[3] == 1)
  9824. anInt1187 += (12 - anInt1187) / 2;
  9825. else if (super.keyArray[4] == 1)
  9826. anInt1187 += (-12 - anInt1187) / 2;
  9827. else
  9828. anInt1187 /= 2;
  9829. viewRotation = viewRotation + anInt1186 / 2 & 0x7ff;
  9830. anInt1184 += anInt1187 / 2;
  9831. if (anInt1184 < 128)
  9832. anInt1184 = 128;
  9833. if (anInt1184 > 383)
  9834. anInt1184 = 383;
  9835. int l = anInt1014 >> 7;
  9836. int i1 = anInt1015 >> 7;
  9837. int j1 = method42(plane, anInt1015, anInt1014);
  9838. int k1 = 0;
  9839. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  9840. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  9841. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  9842. int l2 = plane;
  9843. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9844. l2++;
  9845. int i3 = j1 - intGroundArray[l2][l1][k2];
  9846. if (i3 > k1)
  9847. k1 = i3;
  9848. }
  9849.  
  9850. }
  9851.  
  9852. }
  9853. anInt1005++;
  9854. if (anInt1005 > 1512) {
  9855. anInt1005 = 0;
  9856. stream.createFrame(77);
  9857. stream.writeWordBigEndian(0);
  9858. int i2 = stream.currentOffset;
  9859. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9860. stream.writeWordBigEndian(101);
  9861. stream.writeWordBigEndian(233);
  9862. stream.writeWord(45092);
  9863. if ((int) (Math.random() * 2D) == 0)
  9864. stream.writeWord(35784);
  9865. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9866. stream.writeWordBigEndian(64);
  9867. stream.writeWordBigEndian(38);
  9868. stream.writeWord((int) (Math.random() * 65536D));
  9869. stream.writeWord((int) (Math.random() * 65536D));
  9870. stream.writeBytes(stream.currentOffset - i2);
  9871. }
  9872. int j2 = k1 * 192;
  9873. if (j2 > 0x17f00)
  9874. j2 = 0x17f00;
  9875. if (j2 < 32768)
  9876. j2 = 32768;
  9877. if (j2 > anInt984) {
  9878. anInt984 += (j2 - anInt984) / 24;
  9879. return;
  9880. }
  9881. if (j2 < anInt984) {
  9882. anInt984 += (j2 - anInt984) / 80;
  9883. }
  9884. } catch (Exception _ex) {
  9885. SignLink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  9886. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  9887. + anInt1070 + "," + baseX + "," + baseY);
  9888. throw new RuntimeException("eek");
  9889. }
  9890. }
  9891.  
  9892. public void processDrawing() {
  9893. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  9894. showErrorScreen();
  9895. return;
  9896. }
  9897. anInt1061++;
  9898. if (!loggedIn)
  9899. drawLoginScreen();
  9900. else
  9901. drawGameScreen();
  9902. anInt1213 = 0;
  9903. }
  9904.  
  9905. public boolean isFriendOrSelf(String s) {
  9906. if (s == null)
  9907. return false;
  9908. for (int i = 0; i < friendsCount; i++)
  9909. if (s.equalsIgnoreCase(friendsList[i]))
  9910. return true;
  9911. return s.equalsIgnoreCase(myPlayer.name);
  9912. }
  9913.  
  9914. public static String combatDiffColor(int i, int j) {
  9915. int k = i - j;
  9916. if (k < -9)
  9917. return "@red@";
  9918. if (k < -6)
  9919. return "@or3@";
  9920. if (k < -3)
  9921. return "@or2@";
  9922. if (k < 0)
  9923. return "@or1@";
  9924. if (k > 9)
  9925. return "@gre@";
  9926. if (k > 6)
  9927. return "@gr3@";
  9928. if (k > 3)
  9929. return "@gr2@";
  9930. if (k > 0)
  9931. return "@gr1@";
  9932. else
  9933. return "@yel@";
  9934. }
  9935.  
  9936. public void setWaveVolume(int i) {
  9937. SignLink.wavevol = i;
  9938. }
  9939.  
  9940. @SuppressWarnings("unused")
  9941. public void draw3dScreen() {
  9942. drawSplitpublicChat();
  9943. if (counterOn)
  9944. drawCounterOnScreen();
  9945. if (crossType == 1) {
  9946. crosses[crossIndex / 100]
  9947. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9948. anInt1142++;
  9949. if (anInt1142 > 67) {
  9950. anInt1142 = 0;
  9951. stream.createFrame(78);
  9952. }
  9953. }
  9954. if (crossType == 2)
  9955. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  9956. crossY - 8 - 4);
  9957. if (anInt1018 != -1) {
  9958. method119(anInt945, anInt1018);
  9959. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9960. }
  9961. if (openInterfaceID != -1) {
  9962. method119(anInt945, openInterfaceID);
  9963. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9964. }
  9965. method70();
  9966. if (!menuOpen) {
  9967. processRightClick();
  9968. drawTooltip();
  9969. } else if (menuScreenArea == 0)
  9970. drawMenu();
  9971. if (anInt1055 == 1)
  9972. multiOverlay.drawSprite(472, 296);
  9973. if (fpsOn) {
  9974. char c = '\u01FB';
  9975. int k = 20;
  9976. int i1 = 0xffff00;
  9977. if (super.fps < 15)
  9978. i1 = 0xff0000;
  9979. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9980. k += 15;
  9981. Runtime runtime = Runtime.getRuntime();
  9982. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9983. i1 = 0xffff00;
  9984. if (j1 > 0x2000000 && lowMem)
  9985. i1 = 0xff0000;
  9986. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9987. k += 15;
  9988. }
  9989. int i1 = 0xffff00;
  9990. int x = baseX + (myPlayer.x - 6 >> 7);
  9991. int y = baseY + (myPlayer.y - 6 >> 7);
  9992. if (clientData) {
  9993. char c = '\u01FB';
  9994. int k = 20;
  9995. if (super.fps < 15)
  9996. i1 = 0xff0000;
  9997. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 270 - 15, 5);
  9998. aTextDrawingArea_1271.method385(0xffff00, "Ping: " + ping + "ms", 270, 5);
  9999. Runtime runtime = Runtime.getRuntime();
  10000. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10001. i1 = 0xffff00;
  10002. if (j1 > 0x2000000 && lowMem)
  10003. i1 = 0xff0000;
  10004. k += 15;
  10005. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 284, 5);
  10006. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 299, 5);
  10007. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 314, 5);
  10008. aTextDrawingArea_1271.method385(0xffff00, "Client/Cache: " + update.getVersions().getProperty("client") + "/" + update.getVersions().getProperty("cache"), 329, 5);
  10009. }
  10010. if (anInt1104 != 0) {
  10011. int j = anInt1104 / 50;
  10012. int l = j / 60;
  10013. j %= 60;
  10014. if (j < 10)
  10015. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  10016. + l + ":0" + j, 329, 4);
  10017. else
  10018. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  10019. + l + ":" + j, 329, 4);
  10020. anInt849++;
  10021. if (anInt849 > 75) {
  10022. anInt849 = 0;
  10023. stream.createFrame(148);
  10024. }
  10025. }
  10026. }
  10027.  
  10028. public void addIgnore(long l) {
  10029. try {
  10030. if (l == 0L)
  10031. return;
  10032. if (ignoreCount >= 100) {
  10033. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10034. return;
  10035. }
  10036. String s = TextClass.fixName(TextClass.nameForLong(l));
  10037. for (int j = 0; j < ignoreCount; j++)
  10038. if (ignoreListAsLongs[j] == l) {
  10039. pushMessage(s + " is already on your ignore list", 0, "");
  10040. return;
  10041. }
  10042. for (int k = 0; k < friendsCount; k++)
  10043. if (friendsListAsLongs[k] == l) {
  10044. pushMessage("Please remove " + s
  10045. + " from your friend list first", 0, "");
  10046. return;
  10047. }
  10048.  
  10049. ignoreListAsLongs[ignoreCount++] = l;
  10050. needDrawTabArea = true;
  10051. stream.createFrame(133);
  10052. stream.writeQWord(l);
  10053. return;
  10054. } catch (RuntimeException runtimeexception) {
  10055. SignLink.reporterror("45688, " + l + ", " + 4 + ", "
  10056. + runtimeexception.toString());
  10057. }
  10058. throw new RuntimeException();
  10059. }
  10060.  
  10061. public void method114() {
  10062. for (int i = -1; i < playerCount; i++) {
  10063. int j;
  10064. if (i == -1)
  10065. j = myPlayerIndex;
  10066. else
  10067. j = playerIndices[i];
  10068. Player player = playerArray[j];
  10069. if (player != null)
  10070. method96(player);
  10071. }
  10072.  
  10073. }
  10074.  
  10075. public void method115() {
  10076. if (loadingStage == 2) {
  10077. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  10078. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  10079. .reverseGetNext()) {
  10080. if (class30_sub1.anInt1294 > 0)
  10081. class30_sub1.anInt1294--;
  10082. if (class30_sub1.anInt1294 == 0) {
  10083. if (class30_sub1.anInt1299 < 0
  10084. || ObjectManager.method178(class30_sub1.anInt1299,
  10085. class30_sub1.anInt1301)) {
  10086. method142(class30_sub1.anInt1298,
  10087. class30_sub1.anInt1295, class30_sub1.anInt1300,
  10088. class30_sub1.anInt1301, class30_sub1.anInt1297,
  10089. class30_sub1.anInt1296, class30_sub1.anInt1299);
  10090. class30_sub1.unlink();
  10091. }
  10092. } else {
  10093. if (class30_sub1.anInt1302 > 0)
  10094. class30_sub1.anInt1302--;
  10095. if (class30_sub1.anInt1302 == 0
  10096. && class30_sub1.anInt1297 >= 1
  10097. && class30_sub1.anInt1298 >= 1
  10098. && class30_sub1.anInt1297 <= 102
  10099. && class30_sub1.anInt1298 <= 102
  10100. && (class30_sub1.anInt1291 < 0 || ObjectManager
  10101. .method178(class30_sub1.anInt1291,
  10102. class30_sub1.anInt1293))) {
  10103. method142(class30_sub1.anInt1298,
  10104. class30_sub1.anInt1295, class30_sub1.anInt1292,
  10105. class30_sub1.anInt1293, class30_sub1.anInt1297,
  10106. class30_sub1.anInt1296, class30_sub1.anInt1291);
  10107. class30_sub1.anInt1302 = -1;
  10108. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10109. && class30_sub1.anInt1299 == -1)
  10110. class30_sub1.unlink();
  10111. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10112. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  10113. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10114. class30_sub1.unlink();
  10115. }
  10116. }
  10117. }
  10118.  
  10119. }
  10120. }
  10121.  
  10122. public void determineMenuSize() {
  10123. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10124. for (int j = 0; j < menuActionRow; j++) {
  10125. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10126. if (k > i)
  10127. i = k;
  10128. }
  10129.  
  10130. i += 8;
  10131. int l = 15 * menuActionRow + 21;
  10132. if (super.saveClickX > 4 && super.saveClickY > 4
  10133. && super.saveClickX < 516 && super.saveClickY < 338) {
  10134. int i1 = super.saveClickX - 4 - i / 2;
  10135. if (i1 + i > 512)
  10136. i1 = 512 - i;
  10137. if (i1 < 0)
  10138. i1 = 0;
  10139. int l1 = super.saveClickY - 4;
  10140. if (l1 + l > 334)
  10141. l1 = 334 - l;
  10142. if (l1 < 0)
  10143. l1 = 0;
  10144. menuOpen = true;
  10145. menuScreenArea = 0;
  10146. menuOffsetX = i1;
  10147. menuOffsetY = l1;
  10148. menuWidth = i;
  10149. menuHeight = 15 * menuActionRow + 22;
  10150. }
  10151. if (super.saveClickX > 519 && super.saveClickY > 168
  10152. && super.saveClickX < 765 && super.saveClickY < 503) {
  10153. int j1 = super.saveClickX - 519 - i / 2;
  10154. if (j1 < 0)
  10155. j1 = 0;
  10156. else if (j1 + i > 245)
  10157. j1 = 245 - i;
  10158. int i2 = super.saveClickY - 168;
  10159. if (i2 < 0)
  10160. i2 = 0;
  10161. else if (i2 + l > 333)
  10162. i2 = 333 - l;
  10163. menuOpen = true;
  10164. menuScreenArea = 1;
  10165. menuOffsetX = j1;
  10166. menuOffsetY = i2;
  10167. menuWidth = i;
  10168. menuHeight = 15 * menuActionRow + 22;
  10169. }
  10170. if (super.saveClickX > 0 && super.saveClickY > 338
  10171. && super.saveClickX < 516 && super.saveClickY < 503) {
  10172. int k1 = super.saveClickX - 0 - i / 2;
  10173. if (k1 < 0)
  10174. k1 = 0;
  10175. else if (k1 + i > 516)
  10176. k1 = 516 - i;
  10177. int j2 = super.saveClickY - 338;
  10178. if (j2 < 0)
  10179. j2 = 0;
  10180. else if (j2 + l > 165)
  10181. j2 = 165 - l;
  10182. menuOpen = true;
  10183. menuScreenArea = 2;
  10184. menuOffsetX = k1;
  10185. menuOffsetY = j2;
  10186. menuWidth = i;
  10187. menuHeight = 15 * menuActionRow + 22;
  10188. }
  10189. if (super.saveClickX >= 515 && super.saveClickY >= 0 && super.saveClickX <= 765 && super.saveClickY <= 169) {
  10190. int k1 = super.saveClickX -515- i / 2;
  10191. if (k1 < 0)
  10192. k1 = 0;
  10193. else if (k1 + i > 249)
  10194. k1 =249-i;
  10195. int j2 = super.saveClickY;
  10196. if (j2 < 0)
  10197. j2 = 0;
  10198. else if (j2 + l > 168)
  10199. j2 = 168 - l;
  10200. menuOpen = true;
  10201. menuScreenArea = 3;
  10202. menuOffsetX = k1;
  10203. menuOffsetY = j2;
  10204. menuWidth = i;
  10205. menuHeight = 15 * menuActionRow + 22;
  10206. }
  10207. }
  10208.  
  10209. public void method117(Stream stream) {
  10210. stream.initBitAccess();
  10211. int j = stream.readBits(1);
  10212. if (j == 0)
  10213. return;
  10214. int k = stream.readBits(2);
  10215. if (k == 0) {
  10216. anIntArray894[anInt893++] = myPlayerIndex;
  10217. return;
  10218. }
  10219. if (k == 1) {
  10220. int l = stream.readBits(3);
  10221. myPlayer.moveInDir(false, l);
  10222. int k1 = stream.readBits(1);
  10223. if (k1 == 1)
  10224. anIntArray894[anInt893++] = myPlayerIndex;
  10225. return;
  10226. }
  10227. if (k == 2) {
  10228. int i1 = stream.readBits(3);
  10229. myPlayer.moveInDir(true, i1);
  10230. int l1 = stream.readBits(3);
  10231. myPlayer.moveInDir(true, l1);
  10232. int j2 = stream.readBits(1);
  10233. if (j2 == 1)
  10234. anIntArray894[anInt893++] = myPlayerIndex;
  10235. return;
  10236. }
  10237. if (k == 3) {
  10238. plane = stream.readBits(2);
  10239. int j1 = stream.readBits(1);
  10240. int i2 = stream.readBits(1);
  10241. if (i2 == 1)
  10242. anIntArray894[anInt893++] = myPlayerIndex;
  10243. int k2 = stream.readBits(7);
  10244. int l2 = stream.readBits(7);
  10245. myPlayer.setPos(l2, k2, j1 == 1);
  10246. }
  10247. }
  10248.  
  10249. public void nullLoader() {
  10250. aBoolean831 = false;
  10251. while (drawingFlames) {
  10252. aBoolean831 = false;
  10253. try {
  10254. Thread.sleep(50L);
  10255. } catch (Exception _ex) {
  10256. }
  10257. }
  10258. aBackgroundArray1152s = null;
  10259. anIntArray850 = null;
  10260. anIntArray851 = null;
  10261. anIntArray852 = null;
  10262. anIntArray853 = null;
  10263. anIntArray1190 = null;
  10264. anIntArray1191 = null;
  10265. anIntArray828 = null;
  10266. anIntArray829 = null;
  10267. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10268. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10269. }
  10270.  
  10271. public boolean method119(int i, int j) {
  10272. boolean flag1 = false;
  10273. RSInterface class9 = RSInterface.interfaceCache[j];
  10274. for (int k = 0; k < class9.children.length; k++) {
  10275. if (class9.children[k] == -1)
  10276. break;
  10277. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10278. if (class9_1.type == 1)
  10279. flag1 |= method119(i, class9_1.id);
  10280. if (class9_1.type == 6
  10281. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  10282. boolean flag2 = interfaceIsSelected(class9_1);
  10283. int l;
  10284. if (flag2)
  10285. l = class9_1.anInt258;
  10286. else
  10287. l = class9_1.anInt257;
  10288. if (l != -1) {
  10289. Animation animation = Animation.anims[l];
  10290. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  10291. .method258(class9_1.anInt246);) {
  10292. class9_1.anInt208 -= animation
  10293. .method258(class9_1.anInt246) + 1;
  10294. class9_1.anInt246++;
  10295. if (class9_1.anInt246 >= animation.anInt352) {
  10296. class9_1.anInt246 -= animation.anInt356;
  10297. if (class9_1.anInt246 < 0
  10298. || class9_1.anInt246 >= animation.anInt352)
  10299. class9_1.anInt246 = 0;
  10300. }
  10301. flag1 = true;
  10302. }
  10303.  
  10304. }
  10305. }
  10306. }
  10307.  
  10308. return flag1;
  10309. }
  10310.  
  10311. public int method120() {
  10312. int j = 3;
  10313. if (yCameraCurve < 310) {
  10314. int k = xCameraPos >> 7;
  10315. int l = yCameraPos >> 7;
  10316. int i1 = myPlayer.x >> 7;
  10317. int j1 = myPlayer.y >> 7;
  10318. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10319. j = plane;
  10320. int k1;
  10321. if (i1 > k)
  10322. k1 = i1 - k;
  10323. else
  10324. k1 = k - i1;
  10325. int l1;
  10326. if (j1 > l)
  10327. l1 = j1 - l;
  10328. else
  10329. l1 = l - j1;
  10330. if (k1 > l1) {
  10331. int i2 = (l1 * 0x10000) / k1;
  10332. int k2 = 32768;
  10333. while (k != i1) {
  10334. if (k < i1)
  10335. k++;
  10336. else if (k > i1)
  10337. k--;
  10338. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10339. j = plane;
  10340. k2 += i2;
  10341. if (k2 >= 0x10000) {
  10342. k2 -= 0x10000;
  10343. if (l < j1)
  10344. l++;
  10345. else if (l > j1)
  10346. l--;
  10347. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10348. j = plane;
  10349. }
  10350. }
  10351. } else {
  10352. int j2 = (k1 * 0x10000) / l1;
  10353. int l2 = 32768;
  10354. while (l != j1) {
  10355. if (l < j1)
  10356. l++;
  10357. else if (l > j1)
  10358. l--;
  10359. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10360. j = plane;
  10361. l2 += j2;
  10362. if (l2 >= 0x10000) {
  10363. l2 -= 0x10000;
  10364. if (k < i1)
  10365. k++;
  10366. else if (k > i1)
  10367. k--;
  10368. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10369. j = plane;
  10370. }
  10371. }
  10372. }
  10373. }
  10374. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10375. j = plane;
  10376. return j;
  10377. }
  10378.  
  10379. public int method121() {
  10380. int j = method42(plane, yCameraPos, xCameraPos);
  10381. if (j - zCameraPos < 800
  10382. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10383. return plane;
  10384. else
  10385. return 3;
  10386. }
  10387.  
  10388. public void delIgnore(long l) {
  10389. try {
  10390. if (l == 0L)
  10391. return;
  10392. for (int j = 0; j < ignoreCount; j++)
  10393. if (ignoreListAsLongs[j] == l) {
  10394. ignoreCount--;
  10395. needDrawTabArea = true;
  10396. System.arraycopy(ignoreListAsLongs, j + 1,
  10397. ignoreListAsLongs, j, ignoreCount - j);
  10398.  
  10399. stream.createFrame(74);
  10400. stream.writeQWord(l);
  10401. return;
  10402. }
  10403.  
  10404. return;
  10405. } catch (RuntimeException runtimeexception) {
  10406. SignLink.reporterror("47229, " + 3 + ", " + l + ", "
  10407. + runtimeexception.toString());
  10408. }
  10409. throw new RuntimeException();
  10410. }
  10411.  
  10412. public void chatJoin(long l) {
  10413. try {
  10414. if (l == 0L)
  10415. return;
  10416. stream.createFrame(60);
  10417. stream.writeQWord(l);
  10418. return;
  10419. } catch (RuntimeException runtimeexception) {
  10420. SignLink.reporterror("47229, " + 3 + ", " + l + ", "
  10421. + runtimeexception.toString());
  10422. }
  10423. throw new RuntimeException();
  10424.  
  10425. }
  10426.  
  10427. public String getParameter(String s) {
  10428. if (SignLink.mainapp != null)
  10429. return SignLink.mainapp.getParameter(s);
  10430. else
  10431. return super.getParameter(s);
  10432. }
  10433.  
  10434. public void adjustVolume(boolean flag, int i) {
  10435. SignLink.midivol = i;
  10436. if (flag)
  10437. SignLink.midi = "voladjust";
  10438. }
  10439.  
  10440. public int extractInterfaceValues(RSInterface class9, int j) {
  10441. if (class9.valueIndexArray == null
  10442. || j >= class9.valueIndexArray.length)
  10443. return -2;
  10444. try {
  10445. int ai[] = class9.valueIndexArray[j];
  10446. int k = 0;
  10447. int l = 0;
  10448. int i1 = 0;
  10449. do {
  10450. int j1 = ai[l++];
  10451. int k1 = 0;
  10452. byte byte0 = 0;
  10453. if (j1 == 0)
  10454. return k;
  10455. if (j1 == 1)
  10456. k1 = currentStats[ai[l++]];
  10457. if (j1 == 2)
  10458. k1 = maxStats[ai[l++]];
  10459. if (j1 == 3)
  10460. k1 = currentExp[ai[l++]];
  10461. if (j1 == 4) {
  10462. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10463. int k2 = ai[l++];
  10464. if (k2 >= 0 && k2 < ItemDef.totalItems
  10465. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  10466. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  10467. if (class9_1.inv[j3] == k2 + 1)
  10468. k1 += class9_1.invStackSizes[j3];
  10469.  
  10470. }
  10471. }
  10472. if (j1 == 5)
  10473. k1 = variousSettings[ai[l++]];
  10474. if (j1 == 6)
  10475. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10476. if (j1 == 7)
  10477. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10478. if (j1 == 8)
  10479. k1 = myPlayer.combatLevel;
  10480. if (j1 == 9) {
  10481. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  10482. if (Skills.skillEnabled[l1])
  10483. k1 += maxStats[l1];
  10484.  
  10485. }
  10486. if (j1 == 10) {
  10487. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10488. int l2 = ai[l++] + 1;
  10489. if (l2 >= 0 && l2 < ItemDef.totalItems
  10490. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  10491. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  10492. if (class9_2.inv[k3] != l2)
  10493. continue;
  10494. k1 = 0x3b9ac9ff;
  10495. break;
  10496. }
  10497.  
  10498. }
  10499. }
  10500. if (j1 == 11)
  10501. k1 = energy;
  10502. if (j1 == 12)
  10503. k1 = weight;
  10504. if (j1 == 13) {
  10505. int i2 = variousSettings[ai[l++]];
  10506. int i3 = ai[l++];
  10507. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10508. }
  10509. if (j1 == 14) {
  10510. int j2 = ai[l++];
  10511. VarBit varBit = VarBit.cache[j2];
  10512. int l3 = varBit.anInt648;
  10513. int i4 = varBit.anInt649;
  10514. int j4 = varBit.anInt650;
  10515. int k4 = anIntArray1232[j4 - i4];
  10516. k1 = variousSettings[l3] >> i4 & k4;
  10517. }
  10518. if (j1 == 15)
  10519. byte0 = 1;
  10520. if (j1 == 16)
  10521. byte0 = 2;
  10522. if (j1 == 17)
  10523. byte0 = 3;
  10524. if (j1 == 18)
  10525. k1 = (myPlayer.x >> 7) + baseX;
  10526. if (j1 == 19)
  10527. k1 = (myPlayer.y >> 7) + baseY;
  10528. if (j1 == 20)
  10529. k1 = ai[l++];
  10530. if (byte0 == 0) {
  10531. if (i1 == 0)
  10532. k += k1;
  10533. if (i1 == 1)
  10534. k -= k1;
  10535. if (i1 == 2 && k1 != 0)
  10536. k /= k1;
  10537. if (i1 == 3)
  10538. k *= k1;
  10539. i1 = 0;
  10540. } else {
  10541. i1 = byte0;
  10542. }
  10543. } while (true);
  10544. } catch (Exception _ex) {
  10545. return -1;
  10546. }
  10547. }
  10548.  
  10549. public void drawTooltip() {
  10550. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10551. return;
  10552. String s;
  10553. if (itemSelected == 1 && menuActionRow < 2)
  10554. s = "Use " + selectedItemName + " with...";
  10555. else if (spellSelected == 1 && menuActionRow < 2)
  10556. s = spellTooltip + "...";
  10557. else
  10558. s = menuActionName[menuActionRow - 1];
  10559. if (menuActionRow > 2)
  10560. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10561. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10562. }
  10563.  
  10564. public boolean runClicked = false;
  10565. public boolean Resting = false;
  10566. public boolean runHover;
  10567.  
  10568. public void loadExtraSprites() {
  10569. for(int k = 1; k <= 15; k++)
  10570. ORBS[k] = new Sprite((new StringBuilder()).append("Frame/ORBS ").append(k).append("").toString());
  10571. }
  10572. public void drawWorldMapButton() {
  10573. worldMapIcon.drawSprite(8, 124);
  10574. }
  10575.  
  10576. public int logIconHPos = 0;
  10577.  
  10578. public void processMapAreaClick() {
  10579. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
  10580. logIconHPos = 1;
  10581. } else {
  10582. logIconHPos = 0;
  10583. }
  10584. }
  10585.  
  10586. private void processMinimapActions() {
  10587. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128) {
  10588. menuActionName[1] = !runClicked ? "Toggle Run-Mode On" : "Toggle Run-Mode On";
  10589. menuActionIds[1] = 1050;
  10590. menuActionRow = 2;
  10591. }
  10592. if (super.mouseX >= 695 && super.mouseX <= 751 && super.mouseY >= 134 && super.mouseY < 165) {
  10593. menuActionName[1] = "Familar Information";
  10594. menuActionIds[1] = 1505;
  10595. menuActionRow = 2;
  10596. }
  10597. }
  10598.  
  10599. public void drawLogoutButton() {
  10600. if (tabInterfaceIDs[10] != -1 && anInt1054 == 9)
  10601. if (loopCycle % 20 >= 10)
  10602. ;
  10603. // sideIcons[7].drawSprite(223, 1);
  10604. if (logIconHPos == 0) {
  10605. logIconH.drawSprite(223, 1);
  10606. } else {
  10607. logIconC.drawSprite(223, 1);
  10608. }
  10609. if (tabID == 10)
  10610. logIconC.drawSprite(223, 1);
  10611. }
  10612.  
  10613. private void rightClickMapArea() {
  10614. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
  10615. menuActionName[1] = "Logout";
  10616. menuActionIds[1] = 1004;
  10617. menuActionRow = 2;
  10618. } else if (super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118) {
  10619. menuActionName[1] = "Run";
  10620. menuActionIds[1] = 1051;
  10621. menuActionRow = 2;
  10622. }
  10623. }
  10624.  
  10625. public void drawRunOrb(){
  10626. ORBS[0] = new Sprite(SignLink.findcachedir() + "/Sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(100));
  10627. if(energy != 100){
  10628. ORBS[0].drawSprite(193, 95);
  10629. }
  10630. runClicked = anIntArray1045[173] == 1;
  10631. Resting = anIntArray1045[174] == 1;
  10632. ORBS[runHover ? 7 : 1].drawSprite(190, 92);
  10633. ORBS[runClicked ? 11 : 10].drawSprite(193, 95);
  10634. if(!Resting)
  10635. ORBS[runClicked ? 9 : 8].drawSprite(200, 100);
  10636. else
  10637. ORBS[Resting ? 12 : 8].drawSprite(200, 100);
  10638. String currentEnergy = RSInterface.interfaceCache[149].message;
  10639. currentEnergy = currentEnergy.replaceAll("%","");
  10640. smallText.method382(getOrbTextColor(100), 232, currentEnergy, 118, true);
  10641. }
  10642.  
  10643. public void drawPrayer()
  10644. {
  10645. String s1 = RSInterface.interfaceCache[4012].message;
  10646. String s2 = RSInterface.interfaceCache[4013].message;
  10647. s1 = s1.replace("%1", "1");
  10648. s2 = s2.replace("%1", "1");
  10649. int i = Integer.parseInt(s1);
  10650. int j = Integer.parseInt(s2);
  10651. int k = (int)(((double)i / (double)j) * 100D);
  10652. ORBS[0] = new Sprite(SignLink.findcachedir() + "/Sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(k));
  10653. ORBS[1].drawSprite(190, 53);
  10654. ORBS[4].drawSprite(193, 56);
  10655. ORBS[0].drawSprite(194, 56);
  10656. ORBS[6].drawSprite(197, 60);
  10657. smallText.method382(getOrbTextColor(k), 234, (new StringBuilder()).append("").append(i).toString(), 79, true);
  10658. }
  10659.  
  10660. public void drawHP() {
  10661. int health;
  10662. String cHP = RSInterface.interfaceCache[4016].message;
  10663. cHP = cHP.replaceAll("%", "");
  10664. int currentHP = Integer.parseInt(cHP);
  10665. String mHP = RSInterface.interfaceCache[4017].message;
  10666. mHP = mHP.replaceAll("%", "");
  10667. int maxHP2 = Integer.parseInt(mHP);
  10668. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  10669. ORBS[0] = new Sprite(SignLink.findcachedir() + "/Sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(health));
  10670. ORBS[1].drawSprite(174, 14);
  10671. ORBS[2].drawSprite(177, 17);
  10672. ORBS[0].drawSprite(177, 17);
  10673. if (health <= 20) {
  10674. if (loopCycle % 20 < 10) {
  10675. ORBS[3].drawSprite(183, 25);
  10676. }
  10677. } else {
  10678. ORBS[3].drawSprite(183, 25);
  10679. }
  10680. int Y = 40;
  10681. smallText.method382(getOrbTextColor(health), 218, currentHP + "", Y, true);
  10682. }
  10683.  
  10684. public void drawSumm() {
  10685. if (RSInterface.interfaceCache[18167].message.isEmpty() || RSInterface.interfaceCache[18171].message.isEmpty())
  10686. return;
  10687.  
  10688. int currentPR = Integer.parseInt(RSInterface.interfaceCache[18167].message);
  10689. int maxPR2 = Integer.parseInt(RSInterface.interfaceCache[18171].message);
  10690. int summ = (int) (((double) currentPR / (double) maxPR2) * 100D);
  10691.  
  10692. Sprite background = new Sprite(SignLink.findcachedir() + "/Sprites/sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(summ));
  10693.  
  10694. if (summHover) {
  10695. ORBS[7].drawSprite(174, 130);
  10696. } else if (!summHover) {
  10697. ORBS[1].drawSprite(174, 130);
  10698. }
  10699.  
  10700. ORBS[16].drawSprite(177, 133);
  10701. background.drawSprite(177, 133);
  10702.  
  10703. if (summ <= 25) {
  10704. if (loopCycle % 20 < 10) {
  10705. ORBS[18].drawSprite(182, 139);
  10706. }
  10707. } else {
  10708. ORBS[18].drawSprite(182, 139);
  10709. }
  10710. smallText.method382(getOrbTextColor(summ), 218, currentPR + "", 157, true);
  10711. }
  10712.  
  10713. public int getOrbTextColor(int i)
  10714. {
  10715. if(i >= 75 && i <= 0x7fffffff)
  10716. return 65280;
  10717. if(i >= 50 && i <= 74)
  10718. return 0xffff00;
  10719. return i < 25 || i > 49 ? 0xff0000 : 0xff981f;
  10720. }
  10721.  
  10722. public int getOrbFill(int i)
  10723. {
  10724. if(i <= 0x7fffffff && i >= 97)
  10725. return 0;
  10726. if(i <= 96 && i >= 93)
  10727. return 1;
  10728. if(i <= 92 && i >= 89)
  10729. return 2;
  10730. if(i <= 88 && i >= 85)
  10731. return 3;
  10732. if(i <= 84 && i >= 81)
  10733. return 4;
  10734. if(i <= 80 && i >= 77)
  10735. return 5;
  10736. if(i <= 76 && i >= 73)
  10737. return 6;
  10738. if(i <= 72 && i >= 69)
  10739. return 7;
  10740. if(i <= 68 && i >= 65)
  10741. return 8;
  10742. if(i <= 64 && i >= 61)
  10743. return 9;
  10744. if(i <= 60 && i >= 57)
  10745. return 10;
  10746. if(i <= 56 && i >= 53)
  10747. return 11;
  10748. if(i <= 52 && i >= 49)
  10749. return 12;
  10750. if(i <= 48 && i >= 45)
  10751. return 13;
  10752. if(i <= 44 && i >= 41)
  10753. return 14;
  10754. if(i <= 40 && i >= 37)
  10755. return 15;
  10756. if(i <= 36 && i >= 33)
  10757. return 16;
  10758. if(i <= 32 && i >= 29)
  10759. return 17;
  10760. if(i <= 28 && i >= 25)
  10761. return 18;
  10762. if(i <= 24 && i >= 21)
  10763. return 19;
  10764. if(i <= 20 && i >= 17)
  10765. return 20;
  10766. if(i <= 16 && i >= 13)
  10767. return 21;
  10768. if(i <= 12 && i >= 9)
  10769. return 22;
  10770. if(i <= 8 && i >= 7)
  10771. return 23;
  10772. if(i <= 6 && i >= 5)
  10773. return 24;
  10774. if(i <= 4 && i >= 3)
  10775. return 25;
  10776. if(i <= 2 && i >= 1)
  10777. return 26;
  10778. return i > 0 ? 0 : 27;
  10779. }
  10780.  
  10781. private void drawMinimap() {
  10782. aRSImageProducer_1164.initDrawingArea();
  10783. if(anInt1021 == 2) {
  10784. byte abyte0[] = mapBack.aByteArray1450;
  10785. int ai[] = DrawingArea.pixels;
  10786. int k2 = abyte0.length;
  10787. for(int i5 = 0; i5 < k2; i5++)
  10788. if(abyte0[i5] == 0)
  10789. ai[i5] = 0;
  10790. compass.method352(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10791. aRSImageProducer_1165.initDrawingArea();
  10792. return;
  10793. }
  10794. int i = viewRotation + minimapRotation & 0x7ff;
  10795. int j = 48 + myPlayer.x / 32;
  10796. int l2 = 464 - myPlayer.y / 32;
  10797. for (int x = 0; x < anIntArray1229.length; x++){
  10798. anIntArray1229[x] = 170;
  10799. anIntArray1052[x] = -23;
  10800. }
  10801. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapZoom, anIntArray1052, l2, 10, 45, 146, j);
  10802. compass.method352(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10803. for(int j5 = 0; j5 < anInt1071; j5++) {
  10804. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10805. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10806. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10807. }
  10808.  
  10809. for(int k5 = 0; k5 < 104; k5++) {
  10810. for(int l5 = 0; l5 < 104; l5++) {
  10811. NodeList class19 = groundArray[plane][k5][l5];
  10812. if(class19 != null) {
  10813. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10814. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10815. markMinimap(mapDotItem, l, j3);
  10816. }
  10817. }
  10818. }
  10819.  
  10820. for(int i6 = 0; i6 < npcCount; i6++) {
  10821. NPC npc = npcArray[npcIndices[i6]];
  10822. if(npc != null && npc.isVisible()) {
  10823. EntityDef entityDef = npc.desc;
  10824. if(entityDef.childrenIDs != null)
  10825. entityDef = entityDef.method161();
  10826. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10827. int i1 = npc.x / 32 - myPlayer.x / 32;
  10828. int k3 = npc.y / 32 - myPlayer.y / 32;
  10829. markMinimap(mapDotNPC, i1, k3);
  10830. }
  10831. }
  10832. }
  10833.  
  10834. for(int j6 = 0; j6 < playerCount; j6++) {
  10835. Player player = playerArray[playerIndices[j6]];
  10836. if(player != null && player.isVisible()) {
  10837. int j1 = player.x / 32 - myPlayer.x / 32;
  10838. int l3 = player.y / 32 - myPlayer.y / 32;
  10839. boolean flag1 = false;
  10840. long l6 = TextClass.longForName(player.name);
  10841. for(int k6 = 0; k6 < friendsCount; k6++) {
  10842. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10843. continue;
  10844. flag1 = true;
  10845. break;
  10846. }
  10847. @SuppressWarnings("unused")
  10848. boolean flag2 = false;
  10849. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10850. flag2 = true;
  10851. if(flag1)
  10852. markMinimap(mapDotFriend, j1, l3);
  10853. else
  10854. markMinimap(mapDotPlayer, j1, l3);
  10855. }
  10856. }
  10857.  
  10858. if(anInt855 != 0 && loopCycle % 20 < 10) {
  10859. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10860. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10861. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  10862. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10863. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10864. method81(mapMarker, i4, k1);
  10865. }
  10866. }
  10867. if(anInt855 == 2) {
  10868. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10869. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10870. method81(mapMarker, j4, l1);
  10871. }
  10872. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  10873. {
  10874. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10875. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  10876. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10877. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10878. method81(mapMarker, k4, i2);
  10879. }
  10880. }
  10881. }
  10882. if(destX != 0) {
  10883. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10884. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10885. markMinimap(mapFlag, j2, l4);
  10886. }
  10887. DrawingArea.drawPixels(3, 78+5, 97+20, 0xffffff, 3);
  10888. mapArea.drawSprite(0, 0);
  10889. drawWorldMapButton();
  10890. drawLogoutButton();
  10891. drawHP();
  10892. drawPrayer();
  10893. drawSumm();
  10894. drawRunOrb();
  10895. drawXPCounter();
  10896. if(menuOpen && menuScreenArea == 3) {
  10897. drawMenu();
  10898. }
  10899. aRSImageProducer_1165.initDrawingArea();
  10900. }
  10901.  
  10902. public void npcScreenPos(Entity entity, int i) {
  10903. calcEntityScreenPos(entity.x, i, entity.y);
  10904. }
  10905.  
  10906. public void calcEntityScreenPos(int i, int j, int l) {
  10907. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  10908. spriteDrawX = -1;
  10909. spriteDrawY = -1;
  10910. return;
  10911. }
  10912. int i1 = method42(plane, l, i) - j;
  10913. i -= xCameraPos;
  10914. i1 -= zCameraPos;
  10915. l -= yCameraPos;
  10916. int j1 = Model.SINE[yCameraCurve];
  10917. int k1 = Model.COSINE[yCameraCurve];
  10918. int l1 = Model.SINE[xCameraCurve];
  10919. int i2 = Model.COSINE[xCameraCurve];
  10920. int j2 = l * l1 + i * i2 >> 16;
  10921. l = l * i2 - i * l1 >> 16;
  10922. i = j2;
  10923. j2 = i1 * k1 - l * j1 >> 16;
  10924. l = i1 * j1 + l * k1 >> 16;
  10925. i1 = j2;
  10926. if (l >= 50) {
  10927. spriteDrawX = Rasterizer.centerX + (i << 9) / l;
  10928. spriteDrawY = Rasterizer.centerY + (i1 << 9) / l;
  10929. } else {
  10930. spriteDrawX = -1;
  10931. spriteDrawY = -1;
  10932. }
  10933. }
  10934.  
  10935. @SuppressWarnings("unused")
  10936. public void buildSplitpublicChatMenu() {
  10937. if (splitpublicChat == 0)
  10938. return;
  10939. int i = 0;
  10940. if (anInt1104 != 0)
  10941. i = 1;
  10942. for (int j = 0; j < 100; j++)
  10943. if (chatMessages[j] != null) {
  10944. int k = chatTypes[j];
  10945. String s = chatNames[j];
  10946. boolean flag1 = false;
  10947. if(s != null && s.startsWith("@cr1@"))
  10948. {
  10949. s = s.substring(5);
  10950. }
  10951. if(s != null && s.startsWith("@cr2@"))
  10952. {
  10953. s = s.substring(5);
  10954. }
  10955. if(s != null && s.startsWith("@cr4@"))
  10956. {
  10957. s = s.substring(5);
  10958. }
  10959. if(s != null && s.startsWith("@cr5@"))
  10960. {
  10961. s = s.substring(5);
  10962. }
  10963. if(s != null && s.startsWith("@cr6@"))
  10964. {
  10965. s = s.substring(5);
  10966. }
  10967. if(s != null && s.startsWith("@cr7@"))
  10968. {
  10969. s = s.substring(5);
  10970. }
  10971. if(s != null && s.startsWith("@cr8@"))
  10972. {
  10973. s = s.substring(5);
  10974. }
  10975. if(s != null && s.startsWith("@cr9@"))
  10976. {
  10977. s = s.substring(5);
  10978. }
  10979. if(s != null && s.startsWith("@cr10@"))
  10980. {
  10981. s = s.substring(6);
  10982. }
  10983. if(s != null && s.startsWith("@cr11@"))
  10984. {
  10985. s = s.substring(6);
  10986. }
  10987. if(s != null && s.startsWith("@cr12@"))
  10988. {
  10989. s = s.substring(6);
  10990. }
  10991. if(s != null && s.startsWith("@cr13@"))
  10992. {
  10993. s = s.substring(6);
  10994. }
  10995. if(s != null && s.startsWith("@cr14@"))
  10996. {
  10997. s = s.substring(6);
  10998. }
  10999. if(s != null && s.startsWith("@cr15@"))
  11000. {
  11001. s = s.substring(6);
  11002. }
  11003. if(s != null && s.startsWith("@cr16@"))
  11004. {
  11005. s = s.substring(6);
  11006. }
  11007. if(s != null && s.startsWith("@cr17@"))
  11008. {
  11009. s = s.substring(6);
  11010. }
  11011. if(s != null && s.startsWith("@cr18@"))
  11012. {
  11013. s = s.substring(6);
  11014. }
  11015. if(s != null && s.startsWith("@cr19@"))
  11016. {
  11017. s = s.substring(6);
  11018. }
  11019. if(s != null && s.startsWith("@cr20@"))
  11020. {
  11021. s = s.substring(6);
  11022. }
  11023. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  11024. {
  11025. int l = 329 - i * 13;
  11026. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11027. {
  11028. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11029. if(i1 > 450)
  11030. i1 = 450;
  11031. if(super.mouseX < 4 + i1)
  11032. {
  11033. if(myPrivilege >= 1)
  11034. {
  11035. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11036. menuActionIds[menuActionRow] = 2606;
  11037. menuActionRow++;
  11038. }
  11039. menuActionName[menuActionRow] = "Add ignore @whi@"
  11040. + s;
  11041. menuActionIds[menuActionRow] = 2042;
  11042. menuActionRow++;
  11043. menuActionName[menuActionRow] = "Add friend @whi@"
  11044. + s;
  11045. menuActionIds[menuActionRow] = 2337;
  11046. menuActionRow++;
  11047. }
  11048. }
  11049. if (++i >= 5)
  11050. return;
  11051. }
  11052. if ((k == 5 || k == 6) && publicChatMode < 2 && ++i >= 5)
  11053. return;
  11054. }
  11055.  
  11056. }
  11057.  
  11058. public void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  11059. int i2, int j2) {
  11060. Class30_Sub1 class30_sub1 = null;
  11061. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11062. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11063. .reverseGetNext()) {
  11064. if (class30_sub1_1.anInt1295 != l1
  11065. || class30_sub1_1.anInt1297 != i2
  11066. || class30_sub1_1.anInt1298 != j1
  11067. || class30_sub1_1.anInt1296 != i1)
  11068. continue;
  11069. class30_sub1 = class30_sub1_1;
  11070. break;
  11071. }
  11072.  
  11073. if (class30_sub1 == null) {
  11074. class30_sub1 = new Class30_Sub1();
  11075. class30_sub1.anInt1295 = l1;
  11076. class30_sub1.anInt1296 = i1;
  11077. class30_sub1.anInt1297 = i2;
  11078. class30_sub1.anInt1298 = j1;
  11079. method89(class30_sub1);
  11080. aClass19_1179.insertHead(class30_sub1);
  11081. }
  11082. class30_sub1.anInt1291 = k;
  11083. class30_sub1.anInt1293 = k1;
  11084. class30_sub1.anInt1292 = l;
  11085. class30_sub1.anInt1302 = j2;
  11086. class30_sub1.anInt1294 = j;
  11087. }
  11088.  
  11089. public boolean interfaceIsSelected(RSInterface class9) {
  11090. if (class9.valueCompareType == null)
  11091. return false;
  11092. for (int i = 0; i < class9.valueCompareType.length; i++) {
  11093. int j = extractInterfaceValues(class9, i);
  11094. int k = class9.requiredValues[i];
  11095. if (class9.valueCompareType[i] == 2) {
  11096. if (j >= k)
  11097. return false;
  11098. } else if (class9.valueCompareType[i] == 3) {
  11099. if (j <= k)
  11100. return false;
  11101. } else if (class9.valueCompareType[i] == 4) {
  11102. if (j == k)
  11103. return false;
  11104. } else if (j != k)
  11105. return false;
  11106. }
  11107.  
  11108. return true;
  11109. }
  11110.  
  11111. public DataInputStream openJagGrabInputStream(String s) throws IOException {
  11112. // if(!aBoolean872)
  11113. // if(SignLink.mainapp != null)
  11114. // return SignLink.openurl(s);
  11115. // else
  11116. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11117. if (aSocket832 != null) {
  11118. try {
  11119. aSocket832.close();
  11120. } catch (Exception _ex) {
  11121. }
  11122. aSocket832 = null;
  11123. }
  11124. aSocket832 = openSocket(43595);
  11125. aSocket832.setSoTimeout(10000);
  11126. java.io.InputStream inputstream = aSocket832.getInputStream();
  11127. OutputStream outputstream = aSocket832.getOutputStream();
  11128. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11129. return new DataInputStream(inputstream);
  11130. }
  11131.  
  11132. public void doFlamesDrawing() {
  11133. char c = '\u0100';
  11134. if (anInt1040 > 0) {
  11135. for (int i = 0; i < 256; i++)
  11136. if (anInt1040 > 768)
  11137. anIntArray850[i] = method83(anIntArray851[i],
  11138. anIntArray852[i], 1024 - anInt1040);
  11139. else if (anInt1040 > 256)
  11140. anIntArray850[i] = anIntArray852[i];
  11141. else
  11142. anIntArray850[i] = method83(anIntArray852[i],
  11143. anIntArray851[i], 256 - anInt1040);
  11144.  
  11145. } else if (anInt1041 > 0) {
  11146. for (int j = 0; j < 256; j++)
  11147. if (anInt1041 > 768)
  11148. anIntArray850[j] = method83(anIntArray851[j],
  11149. anIntArray853[j], 1024 - anInt1041);
  11150. else if (anInt1041 > 256)
  11151. anIntArray850[j] = anIntArray853[j];
  11152. else
  11153. anIntArray850[j] = method83(anIntArray853[j],
  11154. anIntArray851[j], 256 - anInt1041);
  11155.  
  11156. } else {
  11157. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11158.  
  11159. }
  11160. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  11161. aRSImageProducer_1110.anIntArray315, 0, 33920);
  11162.  
  11163. int i1 = 0;
  11164. int j1 = 1152;
  11165. for (int k1 = 1; k1 < c - 1; k1++) {
  11166. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11167. int j2 = 22 + l1;
  11168. if (j2 < 0)
  11169. j2 = 0;
  11170. i1 += j2;
  11171. for (int l2 = j2; l2 < 128; l2++) {
  11172. int j3 = anIntArray828[i1++];
  11173. if (j3 != 0) {
  11174. int l3 = j3;
  11175. int j4 = 256 - j3;
  11176. j3 = anIntArray850[j3];
  11177. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  11178. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  11179. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  11180. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11181. } else {
  11182. j1++;
  11183. }
  11184. }
  11185.  
  11186. j1 += j2;
  11187. }
  11188.  
  11189. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  11190. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  11191. aRSImageProducer_1111.anIntArray315, 0, 33920);
  11192.  
  11193. i1 = 0;
  11194. j1 = 1176;
  11195. for (int k2 = 1; k2 < c - 1; k2++) {
  11196. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11197. int k3 = 103 - i3;
  11198. j1 += i3;
  11199. for (int i4 = 0; i4 < k3; i4++) {
  11200. int k4 = anIntArray828[i1++];
  11201. if (k4 != 0) {
  11202. int i5 = k4;
  11203. int j5 = 256 - k4;
  11204. k4 = anIntArray850[k4];
  11205. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  11206. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  11207. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  11208. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11209. } else {
  11210. j1++;
  11211. }
  11212. }
  11213.  
  11214. i1 += 128 - k3;
  11215. j1 += 128 - k3 - i3;
  11216. }
  11217.  
  11218. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11219. }
  11220.  
  11221. public void method134(Stream stream) {
  11222. int j = stream.readBits(8);
  11223. if (j < playerCount) {
  11224. for (int k = j; k < playerCount; k++)
  11225. anIntArray840[anInt839++] = playerIndices[k];
  11226.  
  11227. }
  11228. if (j > playerCount) {
  11229. SignLink.reporterror(myUsername + " Too many players");
  11230. throw new RuntimeException("eek");
  11231. }
  11232. playerCount = 0;
  11233. for (int l = 0; l < j; l++) {
  11234. int i1 = playerIndices[l];
  11235. Player player = playerArray[i1];
  11236. int j1 = stream.readBits(1);
  11237. if (j1 == 0) {
  11238. playerIndices[playerCount++] = i1;
  11239. player.anInt1537 = loopCycle;
  11240. } else {
  11241. int k1 = stream.readBits(2);
  11242. if (k1 == 0) {
  11243. playerIndices[playerCount++] = i1;
  11244. player.anInt1537 = loopCycle;
  11245. anIntArray894[anInt893++] = i1;
  11246. } else if (k1 == 1) {
  11247. playerIndices[playerCount++] = i1;
  11248. player.anInt1537 = loopCycle;
  11249. int l1 = stream.readBits(3);
  11250. player.moveInDir(false, l1);
  11251. int j2 = stream.readBits(1);
  11252. if (j2 == 1)
  11253. anIntArray894[anInt893++] = i1;
  11254. } else if (k1 == 2) {
  11255. playerIndices[playerCount++] = i1;
  11256. player.anInt1537 = loopCycle;
  11257. int i2 = stream.readBits(3);
  11258. player.moveInDir(true, i2);
  11259. int k2 = stream.readBits(3);
  11260. player.moveInDir(true, k2);
  11261. int l2 = stream.readBits(1);
  11262. if (l2 == 1)
  11263. anIntArray894[anInt893++] = i1;
  11264. } else if (k1 == 3)
  11265. anIntArray840[anInt839++] = i1;
  11266. }
  11267. }
  11268. }
  11269.  
  11270. public void drawLoginScreen() {
  11271. CheckBackgrounds();
  11272. resetImageProducers();
  11273. aRSImageProducer_1109.initDrawingArea();
  11274. this.LoginBox.drawTransparentSprite(257, 127, 200);
  11275. aRSImageProducer_1109.initDrawingArea();
  11276. this.Logo.drawAdvancedSprite(150, 45);
  11277. BackgroundSwitcher();
  11278. HandleLoginButton();
  11279. HandleTypeInBoxes();
  11280. RememberAccountInfo();
  11281. this.smallText.method382(16777215, 390, this.loginMessage1, 300, true);
  11282. this.smallText.method382(16777215, 391, this.loginMessage2, 310, true);
  11283. this.aTextDrawingArea_1271.method389(false, 277, 16777215, new StringBuilder().append(capitalize(myUsername)).append(((this.loginScreenCursorPos == 0 ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), 190);
  11284. this.aTextDrawingArea_1271.method389(true, 277, 16777215, new StringBuilder().append(TextClass.passwordAsterisks(myPassword)).append(((this.loginScreenCursorPos == 1 ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), 244);
  11285. int i1 = 0xffff00;
  11286. if (clientData) {
  11287. if (super.fps < 15)
  11288. i1 = 0xff0000;
  11289. aTextDrawingArea_1271.method385(i1, "Fps: " + super.fps, 12, 0);
  11290. Runtime runtime = Runtime.getRuntime();
  11291. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11292. i1 = 0xffff00;
  11293. if (j1 > 0x2000000 && lowMem)
  11294. i1 = 0xff0000;
  11295. aTextDrawingArea_1271.method385(i1, "Mem: " + j1 + "k", 27, 0);
  11296. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 42, 0);
  11297. aTextDrawingArea_1271.method385(0xffff00, "Client/Cache: " + update.getVersions().getProperty("client") + "/" + update.getVersions().getProperty("cache"), 57, 0);
  11298. }
  11299. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  11300. }
  11301.  
  11302. public void CheckBackgrounds() {
  11303. if(FadingBackgrounds)
  11304. fadingTimer();
  11305. else
  11306. BackgroundFix.drawAdvancedSprite(0, 0);
  11307. }
  11308.  
  11309. public void HandleLoginButton() {
  11310. if (this.mouseX >= 269 && this.mouseX <= 496 && this.mouseY >= 312 && this.mouseY <= 354)
  11311. this.LoginButtonHover.drawTransparentSprite(269, 312, 200);
  11312. else
  11313. this.LoginButton.drawTransparentSprite(269, 312, 200);
  11314. }
  11315.  
  11316. public void HandleTypeInBoxes() {
  11317. if (this.mouseX >= 270 && this.mouseX <= 495 && this.mouseY >= 170 && this.mouseY <= 195)
  11318. this.TypeInHover.drawTransparentSprite(270, 170, 50);
  11319. else
  11320. this.TypeIn.drawTransparentSprite(270, 170, 50);
  11321.  
  11322. if (this.mouseX >= 270 && this.mouseX <= 495 && this.mouseY >= 224 && this.mouseY <= 249)
  11323. this.TypeInHover.drawTransparentSprite(270, 224, 50);
  11324. else
  11325. this.TypeIn.drawTransparentSprite(270, 224, 50);
  11326. }
  11327.  
  11328. public void RememberAccountInfo() {
  11329. if(saveAccountInfo)
  11330. this.RememberYes.drawTransparentSprite(311, 272, 200);
  11331. else
  11332. this.RememberNo.drawTransparentSprite(311, 272, 200);
  11333. }
  11334.  
  11335. public void BackgroundSwitcher() {
  11336. if(this.mouseX >= 0 && this.mouseX <= 57 && this.mouseY >= 468 && this.mouseY <= 503) {
  11337. if(FadingBackgrounds) {
  11338. Bg = new Sprite("/Login/anim4");
  11339. this.Bg.drawAdvancedSprite(0, 468);
  11340. } else {
  11341. Bg = new Sprite("/Login/anim2");
  11342. this.Bg.drawAdvancedSprite(0, 468);
  11343. }
  11344. } else if(FadingBackgrounds) {
  11345. Bg = new Sprite("/Login/anim3");
  11346. this.Bg.drawAdvancedSprite(0, 468);
  11347. } else {
  11348. Bg = new Sprite("/Login/anim");
  11349. this.Bg.drawAdvancedSprite(0, 468);
  11350. }
  11351. }
  11352.  
  11353. public void worldSwitcher() {
  11354. }
  11355.  
  11356. public void processLoginScreenInput() {
  11357. resetImage();
  11358. if (super.clickMode3 == 1 && super.saveClickX >= 0
  11359. && super.saveClickX <= 57 && super.saveClickY >= 468
  11360. && super.saveClickY <= 503)
  11361. if(FadingBackgrounds)
  11362. FadingBackgrounds = false;
  11363. else
  11364. FadingBackgrounds = true;
  11365.  
  11366. if (super.clickMode3 == 1 && super.saveClickX >= 270
  11367. && super.saveClickX <= 495 && super.saveClickY >= 170
  11368. && super.saveClickY <= 195) {
  11369. loginScreenCursorPos = 0;
  11370. } else if (super.clickMode3 == 1 && super.mouseX >= 270
  11371. && super.mouseX <= 495 && super.mouseY >= 224
  11372. && super.mouseY <= 249) {
  11373. loginScreenCursorPos = 1;
  11374. }
  11375. if (super.clickMode3 == 1 && super.saveClickX >= 311 && super.saveClickX <= 329
  11376. && super.saveClickY >= 272 && super.saveClickY <= 290) {
  11377. if(saveAccountInfo) {
  11378. saveAccountInfo = false;
  11379. } else {
  11380. saveAccountInfo = true;
  11381. }
  11382. }
  11383. if (super.clickMode3 == 1 && super.saveClickX >= 269
  11384. && super.saveClickX <= 496 && super.saveClickY >= 312
  11385. && super.saveClickY <= 354) {
  11386. loginFailures = 0;
  11387. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  11388. login(myUsername, myPassword, false);
  11389. } else {
  11390. this.loginScreenCursorPos = 0;
  11391. this.loginMessage1 = "Username & Password";
  11392. this.loginMessage2 = "Must be more than 1 character";
  11393. }
  11394. if (this.loggedIn)
  11395. return;
  11396. }
  11397. do {
  11398. int l1 = readChar(-796);
  11399. if (l1 == -1)
  11400. break;
  11401. boolean flag1 = false;
  11402. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  11403. if (l1 != validUserPassChars.charAt(i2))
  11404. continue;
  11405. flag1 = true;
  11406. break;
  11407. }
  11408.  
  11409.  
  11410. if (loginScreenCursorPos == 0) {
  11411. if (l1 == 8 && myUsername.length() > 0)
  11412. myUsername = myUsername.substring(0,
  11413. myUsername.length() - 1);
  11414. if (l1 == 9 || l1 == 10 || l1 == 13)
  11415. loginScreenCursorPos = 1;
  11416. if (flag1)
  11417. myUsername += (char) l1;
  11418. if (myUsername.length() > 12)
  11419. myUsername = myUsername.substring(0, 12);
  11420. } else if (loginScreenCursorPos == 1) {
  11421. if (l1 == 8 && myPassword.length() > 0)
  11422. myPassword = myPassword.substring(0,
  11423. myPassword.length() - 1);
  11424. if (l1 == 9 || l1 == 10 || l1 == 13)
  11425. loginScreenCursorPos = 0;
  11426. if (flag1)
  11427. myPassword += (char) l1;
  11428. if (myPassword.length() > 20)
  11429. myPassword = myPassword.substring(0, 20);
  11430. }
  11431. } while (true);
  11432. return;
  11433. }
  11434.  
  11435.  
  11436.  
  11437. /**
  11438. * Handle the Fading Timer.
  11439. * @author Unknown
  11440. */
  11441.  
  11442. public void fadingTimer() {
  11443. if (bgId > 2) {
  11444. bgId = 0;
  11445. }
  11446. if (bgFinal <= 0) {
  11447. bgId++;
  11448. bgBoolean = false;
  11449. }
  11450. if (bgFinal >= 250) {
  11451. bgBoolean = true;
  11452. }
  11453. waitTicker += 5;
  11454.  
  11455. if (bgBoolean) {
  11456. waitTicker += 1;
  11457. if (waitTicker >= 750) {
  11458. waitTicker = 0;
  11459. }
  11460. if (waitTicker >= 500) {
  11461. Sprite sprite = new Sprite("BG/" + bgId);
  11462. bgFinal -= 10;
  11463. sprite.drawBackground(0, 0, bgFinal);
  11464. } else {
  11465. Sprite sprite = new Sprite("BG/" + bgId);
  11466. sprite.drawBackground(0, 0, 250);
  11467. }
  11468. } else {
  11469. bgFinal += 10;
  11470. Sprite sprite = new Sprite("BG/" + bgId);
  11471. sprite.drawBackground(0, 0, bgFinal);
  11472. }
  11473. }
  11474.  
  11475. public static void writeSettings() throws IOException {
  11476. try {
  11477. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(SignLink.findcachedir() + "settings.dat")));
  11478. out.writeUTF(myUsername);
  11479. out.writeUTF(myPassword);
  11480. out.close();
  11481. } catch(Exception e) { }
  11482. }
  11483.  
  11484. public static void writeLoginSettings() throws IOException {
  11485. try {
  11486. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(SignLink.findcachedir() + "lsettings.dat")));
  11487. out.writeUTF(myUsername);
  11488. out.writeUTF(myPassword);
  11489. out.close();
  11490. } catch(Exception e) { }
  11491. }
  11492.  
  11493. public static void readSettings() throws IOException {
  11494. try {
  11495. DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(SignLink.findcachedir() + "settings.dat")));
  11496. myUsername = in.readUTF();
  11497. myPassword = in.readUTF();
  11498. in.close();
  11499. } catch(Exception e) { }
  11500. }
  11501.  
  11502. public void drawFlames() {
  11503. /*drawingFlames = true;
  11504. try {
  11505. long l = System.currentTimeMillis();
  11506. int i = 0;
  11507. int j = 20;
  11508. while (aBoolean831) {
  11509. anInt1208++;
  11510. calcFlamesPosition();
  11511. calcFlamesPosition();
  11512. doFlamesDrawing();
  11513. if (++i > 10) {
  11514. long l1 = System.currentTimeMillis();
  11515. int k = (int) (l1 - l) / 10 - j;
  11516. j = 40 - k;
  11517. if (j < 5)
  11518. j = 5;
  11519. i = 0;
  11520. l = l1;
  11521. }
  11522. try {
  11523. Thread.sleep(j);
  11524. } catch (Exception _ex) {
  11525. }
  11526. }
  11527. } catch (Exception _ex) {
  11528. }
  11529. drawingFlames = false;*/
  11530. }
  11531.  
  11532. public void raiseWelcomeScreen() {
  11533. welcomeScreenRaised = true;
  11534. }
  11535.  
  11536. public void method137(Stream stream, int j) {
  11537. if (j == 84) {
  11538. int k = stream.readUnsignedByte();
  11539. int j3 = anInt1268 + (k >> 4 & 7);
  11540. int i6 = anInt1269 + (k & 7);
  11541. int l8 = stream.readUnsignedWord();
  11542. int k11 = stream.readUnsignedWord();
  11543. int l13 = stream.readUnsignedWord();
  11544. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  11545. NodeList class19_1 = groundArray[plane][j3][i6];
  11546. if (class19_1 != null) {
  11547. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  11548. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  11549. .reverseGetNext()) {
  11550. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  11551. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11552. continue;
  11553. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11554. break;
  11555. }
  11556.  
  11557. spawnGroundItem(j3, i6);
  11558. }
  11559. }
  11560. return;
  11561. }
  11562. if (j == 105) {
  11563. int l = stream.readUnsignedByte();
  11564. int k3 = anInt1268 + (l >> 4 & 7);
  11565. int j6 = anInt1269 + (l & 7);
  11566. int i9 = stream.readUnsignedWord();
  11567. int l11 = stream.readUnsignedByte();
  11568. int i14 = l11 >> 4 & 0xf;
  11569. int i16 = l11 & 7;
  11570. if (myPlayer.smallX[0] >= k3 - i14
  11571. && myPlayer.smallX[0] <= k3 + i14
  11572. && myPlayer.smallY[0] >= j6 - i14
  11573. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  11574. && currentSound < 50) {
  11575. sound[currentSound] = i9;
  11576. soundType[currentSound] = i16;
  11577. soundDelay[currentSound] = Sound.anIntArray326[i9];
  11578. currentSound++;
  11579. }
  11580. }
  11581. if (j == 215) {
  11582. int i1 = stream.method435();
  11583. int l3 = stream.method428();
  11584. int k6 = anInt1268 + (l3 >> 4 & 7);
  11585. int j9 = anInt1269 + (l3 & 7);
  11586. int i12 = stream.method435();
  11587. int j14 = stream.readUnsignedWord();
  11588. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  11589. && i12 != unknownInt10) {
  11590. Item class30_sub2_sub4_sub2_2 = new Item();
  11591. class30_sub2_sub4_sub2_2.ID = i1;
  11592. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11593. if (groundArray[plane][k6][j9] == null)
  11594. groundArray[plane][k6][j9] = new NodeList();
  11595. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11596. spawnGroundItem(k6, j9);
  11597. }
  11598. return;
  11599. }
  11600. if (j == 156) {
  11601. int j1 = stream.method426();
  11602. int i4 = anInt1268 + (j1 >> 4 & 7);
  11603. int l6 = anInt1269 + (j1 & 7);
  11604. int k9 = stream.readUnsignedWord();
  11605. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  11606. NodeList class19 = groundArray[plane][i4][l6];
  11607. if (class19 != null) {
  11608. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  11609. .reverseGetNext()) {
  11610. if (item.ID != (k9 & 0x7fff))
  11611. continue;
  11612. item.unlink();
  11613. break;
  11614. }
  11615.  
  11616. if (class19.reverseGetFirst() == null)
  11617. groundArray[plane][i4][l6] = null;
  11618. spawnGroundItem(i4, l6);
  11619. }
  11620. }
  11621. return;
  11622. }
  11623. if (j == 160) {
  11624. int k1 = stream.method428();
  11625. int j4 = anInt1268 + (k1 >> 4 & 7);
  11626. int i7 = anInt1269 + (k1 & 7);
  11627. int l9 = stream.method428();
  11628. int j12 = l9 >> 2;
  11629. int k14 = l9 & 3;
  11630. int j16 = anIntArray1177[j12];
  11631. int j17 = stream.method435();
  11632. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  11633. int j18 = intGroundArray[plane][j4][i7];
  11634. int i19 = intGroundArray[plane][j4 + 1][i7];
  11635. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11636. int k20 = intGroundArray[plane][j4][i7 + 1];
  11637. if (j16 == 0) {
  11638. Object1 class10 = worldController.method296(plane, j4, i7);
  11639. if (class10 != null) {
  11640. int k21 = class10.uid >> 14 & 0x7fff;
  11641. if (j12 == 2) {
  11642. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11643. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  11644. false);
  11645. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  11646. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  11647. j17, false);
  11648. } else {
  11649. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11650. k21, k14, j12, i19, l19, j18, k20, j17,
  11651. false);
  11652. }
  11653. }
  11654. }
  11655. if (j16 == 1) {
  11656. Object2 class26 = worldController.method297(j4, i7, plane);
  11657. if (class26 != null)
  11658. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  11659. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  11660. j18, k20, j17, false);
  11661. }
  11662. if (j16 == 2) {
  11663. Object5 class28 = worldController.method298(j4, i7, plane);
  11664. if (j12 == 11)
  11665. j12 = 10;
  11666. if (class28 != null)
  11667. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  11668. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  11669. j18, k20, j17, false);
  11670. }
  11671. if (j16 == 3) {
  11672. Object3 class49 = worldController.method299(i7, j4, plane);
  11673. if (class49 != null)
  11674. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  11675. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  11676. j18, k20, j17, false);
  11677. }
  11678. }
  11679. return;
  11680. }
  11681. if (j == 147) {
  11682. int l1 = stream.method428();
  11683. int k4 = anInt1268 + (l1 >> 4 & 7);
  11684. int j7 = anInt1269 + (l1 & 7);
  11685. int i10 = stream.readUnsignedWord();
  11686. byte byte0 = stream.method430();
  11687. int l14 = stream.method434();
  11688. byte byte1 = stream.method429();
  11689. int k17 = stream.readUnsignedWord();
  11690. int k18 = stream.method428();
  11691. int j19 = k18 >> 2;
  11692. int i20 = k18 & 3;
  11693. int l20 = anIntArray1177[j19];
  11694. byte byte2 = stream.readSignedByte();
  11695. int l21 = stream.readUnsignedWord();
  11696. byte byte3 = stream.method429();
  11697. Player player;
  11698. if (i10 == unknownInt10)
  11699. player = myPlayer;
  11700. else
  11701. player = playerArray[i10];
  11702. if (player != null) {
  11703. ObjectDef class46 = ObjectDef.forID(l21);
  11704. int i22 = intGroundArray[plane][k4][j7];
  11705. int j22 = intGroundArray[plane][k4 + 1][j7];
  11706. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11707. int l22 = intGroundArray[plane][k4][j7 + 1];
  11708. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  11709. -1);
  11710. if (model != null) {
  11711. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11712. player.anInt1707 = l14 + loopCycle;
  11713. player.anInt1708 = k17 + loopCycle;
  11714. player.aModel_1714 = model;
  11715. int i23 = class46.sizeX;
  11716. int j23 = class46.sizeY;
  11717. if (i20 == 1 || i20 == 3) {
  11718. i23 = class46.sizeY;
  11719. j23 = class46.sizeX;
  11720. }
  11721. player.anInt1711 = k4 * 128 + i23 * 64;
  11722. player.anInt1713 = j7 * 128 + j23 * 64;
  11723. player.anInt1712 = method42(plane, player.anInt1713,
  11724. player.anInt1711);
  11725. if (byte2 > byte0) {
  11726. byte byte4 = byte2;
  11727. byte2 = byte0;
  11728. byte0 = byte4;
  11729. }
  11730. if (byte3 > byte1) {
  11731. byte byte5 = byte3;
  11732. byte3 = byte1;
  11733. byte1 = byte5;
  11734. }
  11735. player.anInt1719 = k4 + byte2;
  11736. player.anInt1721 = k4 + byte0;
  11737. player.anInt1720 = j7 + byte3;
  11738. player.anInt1722 = j7 + byte1;
  11739. }
  11740. }
  11741. }
  11742. if (j == 151) {
  11743. int i2 = stream.method426();
  11744. int l4 = anInt1268 + (i2 >> 4 & 7);
  11745. int k7 = anInt1269 + (i2 & 7);
  11746. int j10 = stream.method434();
  11747. int k12 = stream.method428();
  11748. int i15 = k12 >> 2;
  11749. int k16 = k12 & 3;
  11750. int l17 = anIntArray1177[i15];
  11751. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11752. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11753. return;
  11754. }
  11755. if (j == 4) {
  11756. int j2 = stream.readUnsignedByte();
  11757. int i5 = anInt1268 + (j2 >> 4 & 7);
  11758. int l7 = anInt1269 + (j2 & 7);
  11759. int k10 = stream.readUnsignedWord();
  11760. int l12 = stream.readUnsignedByte();
  11761. int j15 = stream.readUnsignedWord();
  11762. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  11763. i5 = i5 * 128 + 64;
  11764. l7 = l7 * 128 + 64;
  11765. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  11766. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  11767. i5);
  11768. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11769. }
  11770. return;
  11771. }
  11772. if (j == 44) {
  11773. int itemId = stream.method436();
  11774. int itemAmount = stream.readUnsignedWord();
  11775. int i8 = stream.readUnsignedByte();
  11776. int l10 = anInt1268 + (i8 >> 4 & 7);
  11777. int i13 = anInt1269 + (i8 & 7);
  11778. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  11779. Item item = new Item();
  11780. item.ID = itemId;
  11781. item.anInt1559 = itemAmount;
  11782. if (groundArray[plane][l10][i13] == null)
  11783. groundArray[plane][l10][i13] = new NodeList();
  11784. groundArray[plane][l10][i13].insertHead(item);
  11785. spawnGroundItem(l10, i13);
  11786. }
  11787. return;
  11788. }
  11789. if (j == 101) {
  11790. int l2 = stream.method427();
  11791. int k5 = l2 >> 2;
  11792. int j8 = l2 & 3;
  11793. int i11 = anIntArray1177[k5];
  11794. int j13 = stream.readUnsignedByte();
  11795. int k15 = anInt1268 + (j13 >> 4 & 7);
  11796. int l16 = anInt1269 + (j13 & 7);
  11797. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11798. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11799. return;
  11800. }
  11801. if (j == 117) {
  11802. int i3 = stream.readUnsignedByte();
  11803. int l5 = anInt1268 + (i3 >> 4 & 7);
  11804. int k8 = anInt1269 + (i3 & 7);
  11805. int j11 = l5 + stream.readSignedByte();
  11806. int k13 = k8 + stream.readSignedByte();
  11807. int l15 = stream.readSignedWord();
  11808. int i17 = stream.readUnsignedWord();
  11809. int i18 = stream.readUnsignedByte() * 4;
  11810. int l18 = stream.readUnsignedByte() * 4;
  11811. int k19 = stream.readUnsignedWord();
  11812. int j20 = stream.readUnsignedWord();
  11813. int i21 = stream.readUnsignedByte();
  11814. int j21 = stream.readUnsignedByte();
  11815. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  11816. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  11817. l5 = l5 * 128 + 64;
  11818. k8 = k8 * 128 + 64;
  11819. j11 = j11 * 128 + 64;
  11820. k13 = k13 * 128 + 64;
  11821. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  11822. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  11823. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  11824. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  11825. method42(plane, k13, j11) - l18, j11);
  11826. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11827. }
  11828. }
  11829. }
  11830. public static void setLowMem() {
  11831. WorldController.lowMem = true;
  11832. Rasterizer.lowMem = true;
  11833. lowMem = true;
  11834. ObjectManager.lowMem = true;
  11835. ObjectDef.lowMem = true;
  11836. }
  11837.  
  11838. public void method139(Stream stream) {
  11839. stream.initBitAccess();
  11840. int k = stream.readBits(8);
  11841. if (k < npcCount) {
  11842. for (int l = k; l < npcCount; l++)
  11843. anIntArray840[anInt839++] = npcIndices[l];
  11844.  
  11845. }
  11846. if (k > npcCount) {
  11847. SignLink.reporterror(myUsername + " Too many npcs");
  11848. throw new RuntimeException("eek");
  11849. }
  11850. npcCount = 0;
  11851. for (int i1 = 0; i1 < k; i1++) {
  11852. int j1 = npcIndices[i1];
  11853. NPC npc = npcArray[j1];
  11854. int k1 = stream.readBits(1);
  11855. if (k1 == 0) {
  11856. npcIndices[npcCount++] = j1;
  11857. npc.anInt1537 = loopCycle;
  11858. } else {
  11859. int l1 = stream.readBits(2);
  11860. if (l1 == 0) {
  11861. npcIndices[npcCount++] = j1;
  11862. npc.anInt1537 = loopCycle;
  11863. anIntArray894[anInt893++] = j1;
  11864. } else if (l1 == 1) {
  11865. npcIndices[npcCount++] = j1;
  11866. npc.anInt1537 = loopCycle;
  11867. int i2 = stream.readBits(3);
  11868. npc.moveInDir(false, i2);
  11869. int k2 = stream.readBits(1);
  11870. if (k2 == 1)
  11871. anIntArray894[anInt893++] = j1;
  11872. } else if (l1 == 2) {
  11873. npcIndices[npcCount++] = j1;
  11874. npc.anInt1537 = loopCycle;
  11875. int j2 = stream.readBits(3);
  11876. npc.moveInDir(true, j2);
  11877. int l2 = stream.readBits(3);
  11878. npc.moveInDir(true, l2);
  11879. int i3 = stream.readBits(1);
  11880. if (i3 == 1)
  11881. anIntArray894[anInt893++] = j1;
  11882. } else if (l1 == 3)
  11883. anIntArray840[anInt839++] = j1;
  11884. }
  11885. }
  11886.  
  11887. }
  11888.  
  11889. public void resetImage() {
  11890. DrawingArea.setAllPixelsToZero();
  11891. }
  11892.  
  11893. private void markMinimap(Sprite sprite, int i, int j) {
  11894. int k = viewRotation + minimapRotation & 0x7ff;
  11895. int l = i * i + j * j;
  11896. if(l > 6400)
  11897. return;
  11898. int i1 = Model.SINE[k];
  11899. int j1 = Model.COSINE[k];
  11900. i1 = (i1 * 256) / (minimapZoom + 256);
  11901. j1 = (j1 * 256) / (minimapZoom + 256);
  11902. int k1 = j * i1 + i * j1 >> 16;
  11903. int l1 = j * j1 - i * i1 >> 16;
  11904. if(l > 2500) {
  11905. if (sprite == null)
  11906. return;
  11907. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4 + 20, 83 - l1 - sprite.maxHeight / 2 - 4 + 5);
  11908. } else {
  11909. if (sprite == null)
  11910. return;
  11911. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4 + 20, 83 - l1 - sprite.maxHeight / 2 - 4 + 5);
  11912. }
  11913. }
  11914.  
  11915. public void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  11916. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  11917. if (lowMem && j != plane)
  11918. return;
  11919. int i2 = 0;
  11920. if (j1 == 0)
  11921. i2 = worldController.method300(j, i1, i);
  11922. if (j1 == 1)
  11923. i2 = worldController.method301(j, i1, i);
  11924. if (j1 == 2)
  11925. i2 = worldController.method302(j, i1, i);
  11926. if (j1 == 3)
  11927. i2 = worldController.method303(j, i1, i);
  11928. if (i2 != 0) {
  11929. int i3 = worldController.method304(j, i1, i, i2);
  11930. int j2 = i2 >> 14 & 0x7fff;
  11931. int k2 = i3 & 0x1f;
  11932. int l2 = i3 >> 6;
  11933. if (j1 == 0) {
  11934. worldController.method291(i1, j, i, (byte) -119);
  11935. ObjectDef class46 = ObjectDef.forID(j2);
  11936. if (class46.aBoolean767)
  11937. aClass11Array1230[j].method215(l2, k2,
  11938. class46.aBoolean757, i1, i);
  11939. }
  11940. if (j1 == 1)
  11941. worldController.method292(i, j, i1);
  11942. if (j1 == 2) {
  11943. worldController.method293(j, i1, i);
  11944. ObjectDef class46_1 = ObjectDef.forID(j2);
  11945. if (i1 + class46_1.sizeX > 103
  11946. || i + class46_1.sizeX > 103
  11947. || i1 + class46_1.sizeY > 103
  11948. || i + class46_1.sizeY > 103)
  11949. return;
  11950. if (class46_1.aBoolean767)
  11951. aClass11Array1230[j].method216(l2, class46_1.sizeX,
  11952. i1, i, class46_1.sizeY,
  11953. class46_1.aBoolean757);
  11954. }
  11955. if (j1 == 3) {
  11956. worldController.method294(j, i, i1);
  11957. ObjectDef class46_2 = ObjectDef.forID(j2);
  11958. if (class46_2.aBoolean767 && class46_2.hasActions)
  11959. aClass11Array1230[j].method218(i, i1);
  11960. }
  11961. }
  11962. if (k1 >= 0) {
  11963. int j3 = j;
  11964. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11965. j3++;
  11966. ObjectManager.method188(worldController, k, i, l, j3,
  11967. aClass11Array1230[j], intGroundArray, i1, k1, j);
  11968. }
  11969. }
  11970. }
  11971.  
  11972. public void updatePlayers(int i, Stream stream) {
  11973. anInt839 = 0;
  11974. anInt893 = 0;
  11975. method117(stream);
  11976. method134(stream);
  11977. method91(stream, i);
  11978. method49(stream);
  11979. for (int k = 0; k < anInt839; k++) {
  11980. int l = anIntArray840[k];
  11981. if (playerArray[l].anInt1537 != loopCycle)
  11982. playerArray[l] = null;
  11983. }
  11984.  
  11985. if (stream.currentOffset != i) {
  11986. SignLink.reporterror("Error packet size mismatch in getplayer pos:"
  11987. + stream.currentOffset + " psize:" + i);
  11988. throw new RuntimeException("eek");
  11989. }
  11990. for (int i1 = 0; i1 < playerCount; i1++)
  11991. if (playerArray[playerIndices[i1]] == null) {
  11992. SignLink.reporterror(myUsername
  11993. + " null entry in pl list - pos:" + i1 + " size:"
  11994. + playerCount);
  11995. throw new RuntimeException("eek");
  11996. }
  11997.  
  11998. }
  11999.  
  12000. public void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  12001. int l1 = 2048 - k & 0x7ff;
  12002. int i2 = 2048 - j1 & 0x7ff;
  12003. int j2 = 0;
  12004. int k2 = 0;
  12005. int l2 = j;
  12006. if (l1 != 0) {
  12007. int i3 = Model.SINE[l1];
  12008. int k3 = Model.COSINE[l1];
  12009. int i4 = k2 * k3 - l2 * i3 >> 16;
  12010. l2 = k2 * i3 + l2 * k3 >> 16;
  12011. k2 = i4;
  12012. }
  12013. if (i2 != 0) {
  12014. /*
  12015. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  12016. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  12017. * l2 = fwdbwd; }
  12018. */
  12019. int j3 = Model.SINE[i2];
  12020. int l3 = Model.COSINE[i2];
  12021. int j4 = l2 * j3 + j2 * l3 >> 16;
  12022. l2 = l2 * l3 - j2 * j3 >> 16;
  12023. j2 = j4;
  12024. }
  12025. xCameraPos = l - j2;
  12026. zCameraPos = i1 - k2;
  12027. yCameraPos = k1 - l2;
  12028. yCameraCurve = k;
  12029. xCameraCurve = j1;
  12030. }
  12031.  
  12032. public void updateStrings(String str, int i) {
  12033. switch (i) {
  12034. case 1675:
  12035. sendFrame126(str, 17508);
  12036. break;// Stab
  12037. case 1676:
  12038. sendFrame126(str, 17509);
  12039. break;// Slash
  12040. case 1678:
  12041. sendFrame126(str, 17511);
  12042. break;// Magic
  12043. case 1679:
  12044. sendFrame126(str, 17512);
  12045. break;// Range
  12046. case 1680:
  12047. sendFrame126(str, 17513);
  12048. break;// Stab
  12049. case 1681:
  12050. sendFrame126(str, 17514);
  12051. break;// Slash
  12052. case 1682:
  12053. sendFrame126(str, 17515);
  12054. break;// Crush
  12055. case 1683:
  12056. sendFrame126(str, 17516);
  12057. break;// Magic
  12058. case 1684:
  12059. sendFrame126(str, 17517);
  12060. break;// Range
  12061. case 1686:
  12062. sendFrame126(str, 17518);
  12063. break;// Strength
  12064. case 1687:
  12065. sendFrame126(str, 17519);
  12066. break;// Prayer
  12067. }
  12068. }
  12069.  
  12070. public void sendFrame126(String str, int i) {
  12071. RSInterface.interfaceCache[i].message = str;
  12072. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  12073. needDrawTabArea = true;
  12074. }
  12075.  
  12076. public void sendPacket185(int button, int toggle, int type) {
  12077. switch (type) {
  12078. case 135:
  12079. RSInterface class9 = RSInterface.interfaceCache[button];
  12080. boolean flag8 = true;
  12081. if (class9.contentType > 0)
  12082. flag8 = promptUserForInput(class9);
  12083. if (flag8) {
  12084. stream.createFrame(185);
  12085. stream.writeWord(button);
  12086. }
  12087. break;
  12088. case 646:
  12089. stream.createFrame(185);
  12090. stream.writeWord(button);
  12091. RSInterface class9_2 = RSInterface.interfaceCache[button];
  12092. if (class9_2.valueIndexArray != null
  12093. && class9_2.valueIndexArray[0][0] == 5) {
  12094. if (variousSettings[toggle] != class9_2.requiredValues[0]) {
  12095. variousSettings[toggle] = class9_2.requiredValues[0];
  12096. method33(toggle);
  12097. needDrawTabArea = true;
  12098. }
  12099. }
  12100. break;
  12101. case 169:
  12102. stream.createFrame(185);
  12103. stream.writeWord(button);
  12104. RSInterface class9_3 = RSInterface.interfaceCache[button];
  12105. if (class9_3.valueIndexArray != null
  12106. && class9_3.valueIndexArray[0][0] == 5) {
  12107. variousSettings[toggle] = 1 - variousSettings[toggle];
  12108. method33(toggle);
  12109. needDrawTabArea = true;
  12110. }
  12111. switch (button) {
  12112. case 19136:
  12113. if (toggle == 0)
  12114. sendFrame36(173, toggle);
  12115. if (toggle == 1)
  12116. sendPacket185(153, 173, 646);
  12117. break;
  12118. }
  12119. break;
  12120. }
  12121. }
  12122.  
  12123. public void sendFrame36(int id, int state) {
  12124. anIntArray1045[id] = state;
  12125. if (variousSettings[id] != state) {
  12126. variousSettings[id] = state;
  12127. method33(id);
  12128. needDrawTabArea = true;
  12129. if (dialogID != -1)
  12130. inputTaken = true;
  12131. }
  12132. }
  12133.  
  12134. public void sendFrame219() {
  12135. if (invOverlayInterfaceID != -1) {
  12136. invOverlayInterfaceID = -1;
  12137. needDrawTabArea = true;
  12138. tabAreaAltered = true;
  12139. }
  12140. if (backDialogID != -1) {
  12141. backDialogID = -1;
  12142. inputTaken = true;
  12143. }
  12144. if (inputDialogState != 0) {
  12145. inputDialogState = 0;
  12146. inputTaken = true;
  12147. }
  12148. openInterfaceID = -1;
  12149. aBoolean1149 = false;
  12150. }
  12151.  
  12152. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  12153. if (backDialogID != -1) {
  12154. backDialogID = -1;
  12155. inputTaken = true;
  12156. }
  12157. if (inputDialogState != 0) {
  12158. inputDialogState = 0;
  12159. inputTaken = true;
  12160. }
  12161. openInterfaceID = interfaceID;
  12162. invOverlayInterfaceID = sideInterfaceID;
  12163. needDrawTabArea = true;
  12164. tabAreaAltered = true;
  12165. aBoolean1149 = false;
  12166. }
  12167.  
  12168. private void ping() {
  12169. pingStart = System.currentTimeMillis();
  12170. stream.createFrame(90);
  12171. }
  12172.  
  12173. @SuppressWarnings("unused")
  12174. public boolean parsePacket() {
  12175. if (socketStream == null)
  12176. return false;
  12177. try {
  12178. int i = socketStream.available();
  12179. if (i == 0)
  12180. return false;
  12181. if (pktType == -1) {
  12182. socketStream.flushInputStream(inStream.buffer, 1);
  12183. pktType = inStream.buffer[0] & 0xff;
  12184. if (encryption != null)
  12185. pktType = pktType - encryption.getNextKey() & 0xff;
  12186. pktSize = SizeConstants.packetSizes[pktType];
  12187. i--;
  12188. }
  12189. if (pktSize == -1)
  12190. if (i > 0) {
  12191. socketStream.flushInputStream(inStream.buffer, 1);
  12192. pktSize = inStream.buffer[0] & 0xff;
  12193. i--;
  12194. } else {
  12195. return false;
  12196. }
  12197. if (pktSize == -2)
  12198. if (i > 1) {
  12199. socketStream.flushInputStream(inStream.buffer, 2);
  12200. inStream.currentOffset = 0;
  12201. pktSize = inStream.readUnsignedWord();
  12202. i -= 2;
  12203. } else {
  12204. return false;
  12205. }
  12206. if (i < pktSize)
  12207. return false;
  12208. inStream.currentOffset = 0;
  12209. socketStream.flushInputStream(inStream.buffer, pktSize);
  12210. anInt1009 = 0;
  12211. anInt843 = anInt842;
  12212. anInt842 = anInt841;
  12213. anInt841 = pktType;
  12214. switch (pktType) {
  12215. case 81:
  12216. updatePlayers(pktSize, inStream);
  12217. aBoolean1080 = false;
  12218. pktType = -1;
  12219. return true;
  12220.  
  12221. case 176:
  12222. daysSinceRecovChange = inStream.method427();
  12223. unreadMessages = inStream.method435();
  12224. membersInt = inStream.readUnsignedByte();
  12225. anInt1193 = inStream.method440();
  12226. daysSinceLastLogin = inStream.readUnsignedWord();
  12227. if (anInt1193 != 0 && openInterfaceID == -1) {
  12228. SignLink.dnslookup(TextClass.method586(anInt1193));
  12229. clearTopInterfaces();
  12230. char c = '\u028A';
  12231. if (daysSinceRecovChange != 201 || membersInt == 1)
  12232. c = '\u028F';
  12233. reportAbuseInput = "";
  12234. canMute = false;
  12235. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  12236. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  12237. continue;
  12238. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  12239.  
  12240. }
  12241. }
  12242. pktType = -1;
  12243. return true;
  12244.  
  12245. case 64:
  12246. anInt1268 = inStream.method427();
  12247. anInt1269 = inStream.method428();
  12248. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  12249. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  12250. if (groundArray[plane][j][l9] != null) {
  12251. groundArray[plane][j][l9] = null;
  12252. spawnGroundItem(j, l9);
  12253. }
  12254. }
  12255. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  12256. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  12257. .reverseGetNext())
  12258. if (class30_sub1.anInt1297 >= anInt1268
  12259. && class30_sub1.anInt1297 < anInt1268 + 8
  12260. && class30_sub1.anInt1298 >= anInt1269
  12261. && class30_sub1.anInt1298 < anInt1269 + 8
  12262. && class30_sub1.anInt1295 == plane)
  12263. class30_sub1.anInt1294 = 0;
  12264. pktType = -1;
  12265. return true;
  12266.  
  12267. case 185:
  12268. int k = inStream.method436();
  12269. RSInterface.interfaceCache[k].anInt233 = 3;
  12270. if (myPlayer.desc == null)
  12271. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  12272. + (myPlayer.anIntArray1700[4] << 20)
  12273. + (myPlayer.equipment[0] << 15)
  12274. + (myPlayer.equipment[8] << 10)
  12275. + (myPlayer.equipment[11] << 5)
  12276. + myPlayer.equipment[1];
  12277. else
  12278. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.id);
  12279. pktType = -1;
  12280. return true;
  12281.  
  12282. /* Clan message packet */
  12283. case 217:
  12284. try {
  12285. name = inStream.readString();
  12286. message = inStream.readString();
  12287. clanname = inStream.readString();
  12288. rights = inStream.readUnsignedWord();
  12289. pushMessage(message, 16, name);
  12290. } catch(Exception e) {
  12291. e.printStackTrace();
  12292. }
  12293. pktType = -1;
  12294. return true;
  12295.  
  12296. case 107:
  12297. aBoolean1160 = false;
  12298. for(int l = 0; l < 5; l++)
  12299. aBooleanArray876[l] = false;
  12300. xpCounter = 0;
  12301. pktType = -1;
  12302. return true;
  12303.  
  12304. case 72:
  12305. int i1 = inStream.method434();
  12306. RSInterface class9 = RSInterface.interfaceCache[i1];
  12307. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  12308. class9.inv[k15] = -1;
  12309. class9.inv[k15] = 0;
  12310. }
  12311. pktType = -1;
  12312. return true;
  12313.  
  12314. case 214:
  12315. ignoreCount = pktSize / 8;
  12316. for (int j1 = 0; j1 < ignoreCount; j1++)
  12317. ignoreListAsLongs[j1] = inStream.readQWord();
  12318. pktType = -1;
  12319. return true;
  12320.  
  12321. case 166:
  12322. aBoolean1160 = true;
  12323. anInt1098 = inStream.readUnsignedByte();
  12324. anInt1099 = inStream.readUnsignedByte();
  12325. anInt1100 = inStream.readUnsignedWord();
  12326. anInt1101 = inStream.readUnsignedByte();
  12327. anInt1102 = inStream.readUnsignedByte();
  12328. if (anInt1102 >= 100) {
  12329. xCameraPos = anInt1098 * 128 + 64;
  12330. yCameraPos = anInt1099 * 128 + 64;
  12331. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  12332. - anInt1100;
  12333. }
  12334. pktType = -1;
  12335. return true;
  12336.  
  12337. case 134:
  12338. needDrawTabArea = true;
  12339. int k1 = inStream.readUnsignedByte();
  12340. int i10 = inStream.method439();
  12341. int l15 = inStream.readUnsignedByte();
  12342. int xp = currentExp[k1];
  12343. currentExp[k1] = i10;
  12344. currentStats[k1] = l15;
  12345. maxStats[k1] = 1;
  12346. xpCounter += currentExp[k1]-xp;
  12347. expAdded = currentExp[k1]-xp;
  12348. for(int k20 = 0; k20 < 98; k20++)
  12349. if(i10 >= anIntArray1019[k20])
  12350. maxStats[k1] = k20 + 2;
  12351.  
  12352. int totalLevel = 0;
  12353. long totalXP = 0;
  12354.  
  12355. for (int id = 0; id < Skills.skillsCount; id++) {
  12356. if (id == 24) {
  12357. totalLevel += getLevelForXP(currentExp[id], 120);
  12358. } else {
  12359. totalLevel += getLevelForXP(currentExp[id]);
  12360. }
  12361. totalXP += currentExp[id];
  12362. }
  12363.  
  12364. RSInterface.interfaceCache[3984].message = "Total level: " + NumberFormat.getInstance().format(totalLevel);
  12365. RSInterface.interfaceCache[3985].message = "Total Experience: " + NumberFormat.getInstance().format(totalXP);
  12366.  
  12367. pktType = -1;
  12368. return true;
  12369.  
  12370. case 71:
  12371. int l1 = inStream.readUnsignedWord();
  12372. int j10 = inStream.method426();
  12373. if (l1 == 65535)
  12374. l1 = -1;
  12375. tabInterfaceIDs[j10] = l1;
  12376. needDrawTabArea = true;
  12377. tabAreaAltered = true;
  12378. pktType = -1;
  12379. return true;
  12380.  
  12381. case 74:
  12382. int songID = inStream.method434();
  12383. if (songID == 65535) {
  12384. songID = -1;
  12385. }
  12386. if (songID != currentSong && previousSong == 0 && songID != -1) {
  12387. nextSong = songID;
  12388. songChanging = true;
  12389. onDemandFetcher.method558(2, nextSong);
  12390. }
  12391. currentSong = songID;
  12392. pktType = -1;
  12393. return true;
  12394.  
  12395. case 121:
  12396. int songId = inStream.method436();
  12397. int songDelay = inStream.method435();
  12398. if (musicEnabled && !lowMem) {
  12399. nextSong = songId;
  12400. songChanging = false;
  12401. onDemandFetcher.method558(2, nextSong);
  12402. previousSong = songDelay;
  12403. }
  12404. pktType = -1;
  12405. return true;
  12406.  
  12407. case 109:
  12408. resetLogout();
  12409. pktType = -1;
  12410. return false;
  12411.  
  12412. case 70:
  12413. int k2 = inStream.readSignedWord();
  12414. int l10 = inStream.method437();
  12415. int i16 = inStream.method434();
  12416. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  12417. class9_5.anInt263 = k2;
  12418. class9_5.anInt265 = l10;
  12419. pktType = -1;
  12420. return true;
  12421.  
  12422. case 73:
  12423. case 241:
  12424. int l2 = anInt1069;
  12425. int i11 = anInt1070;
  12426. if (pktType == 73) {
  12427. l2 = inStream.method435();
  12428. i11 = inStream.readUnsignedWord();
  12429. aBoolean1159 = false;
  12430. }
  12431. if (pktType == 241) {
  12432. i11 = inStream.method435();
  12433. inStream.initBitAccess();
  12434. for (int j16 = 0; j16 < 4; j16++) {
  12435. for (int l20 = 0; l20 < 13; l20++) {
  12436. for (int j23 = 0; j23 < 13; j23++) {
  12437. int i26 = inStream.readBits(1);
  12438. if (i26 == 1)
  12439. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  12440. else
  12441. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12442. }
  12443. }
  12444. }
  12445. inStream.finishBitAccess();
  12446. l2 = inStream.readUnsignedWord();
  12447. aBoolean1159 = true;
  12448. }
  12449. if (pktType != 241 && anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12450. pktType = -1;
  12451. return true;
  12452. }
  12453.  
  12454. /*if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12455. pktType = -1;
  12456. return true;
  12457. }*/
  12458. anInt1069 = l2;
  12459. anInt1070 = i11;
  12460. baseX = (anInt1069 - 6) * 8;
  12461. baseY = (anInt1070 - 6) * 8;
  12462. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  12463. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12464. aBoolean1141 = true;
  12465. loadingStage = 1;
  12466. aLong824 = System.currentTimeMillis();
  12467. aRSImageProducer_1165.initDrawingArea();
  12468. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2);
  12469. DrawingArea.drawPixels(20, 3, 3, 0, 128);
  12470. aTextDrawingArea_1271.drawText(0, "Loading - Please Wait", 18, 68);
  12471. aTextDrawingArea_1271.drawText(0xffffff, "Loading - Please Wait", 17, 67);
  12472. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12473. if (pktType == 73) {
  12474. int k16 = 0;
  12475. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12476. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12477. k16++;
  12478. }
  12479. aByteArrayArray1183 = new byte[k16][];
  12480. aByteArrayArray1247 = new byte[k16][];
  12481. anIntArray1234 = new int[k16];
  12482. anIntArray1235 = new int[k16];
  12483. anIntArray1236 = new int[k16];
  12484. k16 = 0;
  12485. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12486. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12487. anIntArray1234[k16] = (l23 << 8) + j26;
  12488. if (aBoolean1141
  12489. && (j26 == 49 || j26 == 149 || j26 == 147
  12490. || l23 == 50 || l23 == 49
  12491. && j26 == 47)) {
  12492. anIntArray1235[k16] = -1;
  12493. anIntArray1236[k16] = -1;
  12494. k16++;
  12495. } else {
  12496. int k28 = anIntArray1235[k16] = onDemandFetcher
  12497. .method562(0, j26, l23);
  12498. if (k28 != -1)
  12499. onDemandFetcher.method558(3, k28);
  12500. int j30 = anIntArray1236[k16] = onDemandFetcher
  12501. .method562(1, j26, l23);
  12502. if (j30 != -1)
  12503. onDemandFetcher.method558(3, j30);
  12504. k16++;
  12505. }
  12506. }
  12507. }
  12508. }
  12509. if (pktType == 241) {
  12510. int l16 = 0;
  12511. int ai[] = new int[676];
  12512. for (int i24 = 0; i24 < 4; i24++) {
  12513. for (int k26 = 0; k26 < 13; k26++) {
  12514. for (int l28 = 0; l28 < 13; l28++) {
  12515. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12516. if (k30 != -1) {
  12517. int k31 = k30 >> 14 & 0x3ff;
  12518. int i32 = k30 >> 3 & 0x7ff;
  12519. int k32 = (k31 / 8 << 8) + i32 / 8;
  12520. for (int j33 = 0; j33 < l16; j33++) {
  12521. if (ai[j33] != k32)
  12522. continue;
  12523. k32 = -1;
  12524.  
  12525. }
  12526. if (k32 != -1)
  12527. ai[l16++] = k32;
  12528. }
  12529. }
  12530. }
  12531. }
  12532. aByteArrayArray1183 = new byte[l16][];
  12533. aByteArrayArray1247 = new byte[l16][];
  12534. anIntArray1234 = new int[l16];
  12535. anIntArray1235 = new int[l16];
  12536. anIntArray1236 = new int[l16];
  12537. for (int l26 = 0; l26 < l16; l26++) {
  12538. int i29 = anIntArray1234[l26] = ai[l26];
  12539. int l30 = i29 >> 8 & 0xff;
  12540. int l31 = i29 & 0xff;
  12541. int j32 = anIntArray1235[l26] = onDemandFetcher
  12542. .method562(0, l31, l30);
  12543. if (j32 != -1)
  12544. onDemandFetcher.method558(3, j32);
  12545. int i33 = anIntArray1236[l26] = onDemandFetcher
  12546. .method562(1, l31, l30);
  12547. if (i33 != -1)
  12548. onDemandFetcher.method558(3, i33);
  12549. }
  12550. }
  12551. int i17 = baseX - anInt1036;
  12552. int j21 = baseY - anInt1037;
  12553. anInt1036 = baseX;
  12554. anInt1037 = baseY;
  12555. for (int j24 = 0; j24 < 16384; j24++) {
  12556. NPC npc = npcArray[j24];
  12557. if (npc != null) {
  12558. for (int j29 = 0; j29 < 10; j29++) {
  12559. npc.smallX[j29] -= i17;
  12560. npc.smallY[j29] -= j21;
  12561. }
  12562. npc.x -= i17 * 128;
  12563. npc.y -= j21 * 128;
  12564. }
  12565. }
  12566. for (int i27 = 0; i27 < maxPlayers; i27++) {
  12567. Player player = playerArray[i27];
  12568. if (player != null) {
  12569. for (int i31 = 0; i31 < 10; i31++) {
  12570. player.smallX[i31] -= i17;
  12571. player.smallY[i31] -= j21;
  12572. }
  12573. player.x -= i17 * 128;
  12574. player.y -= j21 * 128;
  12575. }
  12576. }
  12577. aBoolean1080 = true;
  12578. byte byte1 = 0;
  12579. byte byte2 = 104;
  12580. byte byte3 = 1;
  12581. if (i17 < 0) {
  12582. byte1 = 103;
  12583. byte2 = -1;
  12584. byte3 = -1;
  12585. }
  12586. byte byte4 = 0;
  12587. byte byte5 = 104;
  12588. byte byte6 = 1;
  12589. if (j21 < 0) {
  12590. byte4 = 103;
  12591. byte5 = -1;
  12592. byte6 = -1;
  12593. }
  12594. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  12595. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  12596. int i34 = k33 + i17;
  12597. int j34 = l33 + j21;
  12598. for (int k34 = 0; k34 < 4; k34++)
  12599. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12600. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12601. else
  12602. groundArray[k34][k33][l33] = null;
  12603. }
  12604. }
  12605. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12606. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12607. .reverseGetNext()) {
  12608. class30_sub1_1.anInt1297 -= i17;
  12609. class30_sub1_1.anInt1298 -= j21;
  12610. if (class30_sub1_1.anInt1297 < 0
  12611. || class30_sub1_1.anInt1298 < 0
  12612. || class30_sub1_1.anInt1297 >= 104
  12613. || class30_sub1_1.anInt1298 >= 104)
  12614. class30_sub1_1.unlink();
  12615. }
  12616. if (destX != 0) {
  12617. destX -= i17;
  12618. destY -= j21;
  12619. }
  12620. aBoolean1160 = false;
  12621. pktType = -1;
  12622. return true;
  12623.  
  12624. case 208:
  12625. int i3 = inStream.method437();
  12626. if (i3 >= 0)
  12627. method60(i3);
  12628. anInt1018 = i3;
  12629. pktType = -1;
  12630. return true;
  12631.  
  12632. case 99:
  12633. /*
  12634. * Black map, mape state 2, causes blackness
  12635. */
  12636. anInt1021 = inStream.readUnsignedByte();
  12637. pktType = -1;
  12638. return true;
  12639.  
  12640. case 75:
  12641. int j3 = inStream.method436();
  12642. int j11 = inStream.method436();
  12643. RSInterface.interfaceCache[j11].anInt233 = 2;
  12644. RSInterface.interfaceCache[j11].mediaID = j3;
  12645. pktType = -1;
  12646. return true;
  12647.  
  12648.  
  12649. case 114:
  12650. anInt1104 = inStream.method434() * 30;
  12651. pktType = -1;
  12652. return true;
  12653.  
  12654. case 60:
  12655. anInt1269 = inStream.readUnsignedByte();
  12656. anInt1268 = inStream.method427();
  12657. while (inStream.currentOffset < pktSize) {
  12658. int k3 = inStream.readUnsignedByte();
  12659. method137(inStream, k3);
  12660. }
  12661. pktType = -1;
  12662. return true;
  12663.  
  12664. case 35:
  12665. int l3 = inStream.readUnsignedByte();
  12666. int k11 = inStream.readUnsignedByte();
  12667. int j17 = inStream.readUnsignedByte();
  12668. int k21 = inStream.readUnsignedByte();
  12669. aBooleanArray876[l3] = true;
  12670. anIntArray873[l3] = k11;
  12671. anIntArray1203[l3] = j17;
  12672. anIntArray928[l3] = k21;
  12673. anIntArray1030[l3] = 0;
  12674. pktType = -1;
  12675. return true;
  12676.  
  12677. /*case 174:
  12678. int i4 = inStream.readUnsignedWord();
  12679. int l11 = inStream.readUnsignedByte();
  12680. int k17 = inStream.readUnsignedWord();
  12681. if (aBoolean848 && !lowMem && currentSound < 50) {
  12682. sound[currentSound] = i4;
  12683. soundType[currentSound] = l11;
  12684. soundDelay[currentSound] = k17 + Sound.anIntArray326[i4];
  12685. currentSound++;
  12686. }
  12687. pktType = -1;
  12688. return true;*/
  12689.  
  12690. /* 174:
  12691. int soundId = inStream.readUnsignedWord();
  12692. int type = inStream.readUnsignedByte();
  12693. int delay = inStream.readUnsignedWord();
  12694. int volume = inStream.readUnsignedWord();
  12695. sound[currentSound] = soundId;
  12696. soundType[currentSound] = type;
  12697. soundDelay[currentSound] = delay + Sound.anIntArray326[soundId];
  12698. soundVolume[currentSound] = volume;
  12699. currentSound++;
  12700. pktType = -1;
  12701. return true;*/
  12702.  
  12703. case 174:
  12704. int soundId = inStream.readUnsignedWord();
  12705. int type = inStream.readUnsignedByte();
  12706. int delay = inStream.readUnsignedWord();
  12707. int volume = inStream.readUnsignedWord();
  12708. sound[currentSound] = soundId;
  12709. soundType[currentSound] = type;
  12710. soundDelay[currentSound] = delay + Sound.anIntArray326[soundId];
  12711. soundVolume[currentSound] = volume;
  12712. currentSound++;
  12713. pktType = -1;
  12714. return true;
  12715.  
  12716. case 104:
  12717. int j4 = inStream.method427();
  12718. int i12 = inStream.method426();
  12719. String s6 = inStream.readString();
  12720. if (j4 >= 1 && j4 <= 5) {
  12721. if (s6.equalsIgnoreCase("null"))
  12722. s6 = null;
  12723. atPlayerActions[j4 - 1] = s6;
  12724. atPlayerArray[j4 - 1] = i12 == 0;
  12725. }
  12726. pktType = -1;
  12727. return true;
  12728.  
  12729. case 78:
  12730. destX = 0;
  12731. pktType = -1;
  12732. return true;
  12733.  
  12734. case 253:
  12735. String s = inStream.readString();
  12736. if(s.endsWith(":tradereq:")) {
  12737. String s3 = s.substring(0, s.indexOf(":"));
  12738. long l17 = TextClass.longForName(s3);
  12739. boolean flag2 = false;
  12740. for(int j27 = 0; j27 < ignoreCount; j27++) {
  12741. if(ignoreListAsLongs[j27] != l17)
  12742. continue;
  12743. flag2 = true;
  12744. }
  12745. if(!flag2 && anInt1251 == 0)
  12746. pushMessage("wishes to trade with you.", 4, s3);
  12747. } else if (s.endsWith(":clan:")) {
  12748. String s4 = s.substring(0, s.indexOf(":"));
  12749. TextClass.longForName(s4);
  12750. pushMessage("Clan: ", 8, s4);
  12751. } else if(s.endsWith("#url#")) {
  12752. String link = s.substring(0, s.indexOf("#"));
  12753. pushMessage("Join us at: ", 9, link);
  12754. } else if(s.endsWith(":duelreq:")) {
  12755. String s4 = s.substring(0, s.indexOf(":"));
  12756. long l18 = TextClass.longForName(s4);
  12757. boolean flag3 = false;
  12758. for(int k27 = 0; k27 < ignoreCount; k27++) {
  12759. if(ignoreListAsLongs[k27] != l18)
  12760. continue;
  12761. flag3 = true;
  12762.  
  12763. }
  12764. if(!flag3 && anInt1251 == 0)
  12765. pushMessage("wishes to duel with you.", 8, s4);
  12766. } else if(s.endsWith(":chalreq:")) {
  12767. String s5 = s.substring(0, s.indexOf(":"));
  12768. long l19 = TextClass.longForName(s5);
  12769. boolean flag4 = false;
  12770. for(int l27 = 0; l27 < ignoreCount; l27++) {
  12771. if(ignoreListAsLongs[l27] != l19)
  12772. continue;
  12773. flag4 = true;
  12774.  
  12775. }
  12776. if(!flag4 && anInt1251 == 0) {
  12777. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12778. pushMessage(s8, 8, s5);
  12779. }
  12780. } else if(s.endsWith("-partyinvite")) {
  12781. String[] data = s.split("-");
  12782. String username = data[0];
  12783. String partyType = "";
  12784.  
  12785. for (int k5 = 1; k5 < data.length - 1; k5++)
  12786. partyType += data[k5] + "-";
  12787. partyType = partyType.substring(0, partyType.length() - 1);
  12788.  
  12789. long usernameAsLong = TextClass.longForName(username);
  12790. boolean isIgnored = false;
  12791.  
  12792. for(int i5 = 0; i5 < ignoreCount; i5++) {
  12793. if(ignoreListAsLongs[i5] != usernameAsLong)
  12794. continue;
  12795. isIgnored = true;
  12796.  
  12797. }
  12798.  
  12799. if (!isIgnored && anInt1251 == 0) {
  12800. if (partyType.length() > 0)
  12801. partyType = " " + partyType;
  12802. pushMessage("wants you to join their" + partyType + " party.", 15, username);
  12803. }
  12804. } else {
  12805. pushMessage(s, 0, "");
  12806. }
  12807. pktType = -1;
  12808. return true;
  12809.  
  12810. case 1:
  12811. for (int k4 = 0; k4 < playerArray.length; k4++)
  12812. if (playerArray[k4] != null)
  12813. playerArray[k4].anim = -1;
  12814. for (int j12 = 0; j12 < npcArray.length; j12++)
  12815. if (npcArray[j12] != null)
  12816. npcArray[j12].anim = -1;
  12817. pktType = -1;
  12818. return true;
  12819.  
  12820. case 90:
  12821. ping = (int) (System.currentTimeMillis() - pingStart);
  12822. ping();
  12823. pktType = -1;
  12824. return true;
  12825.  
  12826. case 124:
  12827. String interfaceType = TextClass.nameForLong(inStream.readQWord());
  12828. int amount = inStream.readUnsignedByte();
  12829.  
  12830. if (interfaceType.equalsIgnoreCase("party")) {
  12831. partyCount = amount;
  12832. }
  12833.  
  12834. pktType = -1;
  12835. return true;
  12836.  
  12837. case 50:
  12838. long l4 = inStream.readQWord();
  12839. int i18 = inStream.readUnsignedByte();
  12840. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12841. for (int k24 = 0; k24 < friendsCount; k24++) {
  12842. if (l4 != friendsListAsLongs[k24])
  12843. continue;
  12844. if (friendsNodeIDs[k24] != i18) {
  12845. friendsNodeIDs[k24] = i18;
  12846. needDrawTabArea = true;
  12847. if (i18 >= 2) {
  12848. pushMessage(s7 + " has logged in.", 5, "");
  12849. }
  12850. if (i18 <= 1) {
  12851. pushMessage(s7 + " has logged out.", 5, "");
  12852. }
  12853. }
  12854. s7 = null;
  12855.  
  12856. }
  12857. if (s7 != null && friendsCount < 200) {
  12858. friendsListAsLongs[friendsCount] = l4;
  12859. friendsList[friendsCount] = s7;
  12860. friendsNodeIDs[friendsCount] = i18;
  12861. friendsCount++;
  12862. needDrawTabArea = true;
  12863. }
  12864. for (boolean flag6 = false; !flag6;) {
  12865. flag6 = true;
  12866. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  12867. if (friendsNodeIDs[k29] != nodeID
  12868. && friendsNodeIDs[k29 + 1] == nodeID
  12869. || friendsNodeIDs[k29] == 0
  12870. && friendsNodeIDs[k29 + 1] != 0) {
  12871. int j31 = friendsNodeIDs[k29];
  12872. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12873. friendsNodeIDs[k29 + 1] = j31;
  12874. String s10 = friendsList[k29];
  12875. friendsList[k29] = friendsList[k29 + 1];
  12876. friendsList[k29 + 1] = s10;
  12877. long l32 = friendsListAsLongs[k29];
  12878. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12879. friendsListAsLongs[k29 + 1] = l32;
  12880. needDrawTabArea = true;
  12881. flag6 = false;
  12882. }
  12883. }
  12884. pktType = -1;
  12885. return true;
  12886.  
  12887. case 110:
  12888. if (tabID == 12)
  12889. needDrawTabArea = true;
  12890. energy = inStream.readUnsignedByte();
  12891. pktType = -1;
  12892. return true;
  12893.  
  12894. case 254:
  12895. anInt855 = inStream.readUnsignedByte();
  12896. if (anInt855 == 1)
  12897. anInt1222 = inStream.readUnsignedWord();
  12898. if (anInt855 >= 2 && anInt855 <= 6) {
  12899. if (anInt855 == 2) {
  12900. anInt937 = 64;
  12901. anInt938 = 64;
  12902. }
  12903. if (anInt855 == 3) {
  12904. anInt937 = 0;
  12905. anInt938 = 64;
  12906. }
  12907. if (anInt855 == 4) {
  12908. anInt937 = 128;
  12909. anInt938 = 64;
  12910. }
  12911. if (anInt855 == 5) {
  12912. anInt937 = 64;
  12913. anInt938 = 0;
  12914. }
  12915. if (anInt855 == 6) {
  12916. anInt937 = 64;
  12917. anInt938 = 128;
  12918. }
  12919. anInt855 = 2;
  12920. anInt934 = inStream.readUnsignedWord();
  12921. anInt935 = inStream.readUnsignedWord();
  12922. anInt936 = inStream.readUnsignedByte();
  12923. }
  12924. if (anInt855 == 10)
  12925. anInt933 = inStream.readUnsignedWord();
  12926. pktType = -1;
  12927. return true;
  12928.  
  12929. case 248:
  12930. int i5 = inStream.method435();
  12931. int k12 = inStream.readUnsignedWord();
  12932. if (backDialogID != -1) {
  12933. backDialogID = -1;
  12934. inputTaken = true;
  12935. }
  12936. if (inputDialogState != 0) {
  12937. inputDialogState = 0;
  12938. inputTaken = true;
  12939. }
  12940. openInterfaceID = i5;
  12941. invOverlayInterfaceID = k12;
  12942. needDrawTabArea = true;
  12943. tabAreaAltered = true;
  12944. aBoolean1149 = false;
  12945. pktType = -1;
  12946. return true;
  12947.  
  12948. case 79:
  12949. int j5 = inStream.method434();
  12950. int l12 = inStream.method435();
  12951. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12952. if (class9_3 != null && class9_3.type == 0) {
  12953. if (l12 < 0)
  12954. l12 = 0;
  12955. if (l12 > class9_3.scrollMax - class9_3.height)
  12956. l12 = class9_3.scrollMax - class9_3.height;
  12957. class9_3.scrollPosition = l12;
  12958. }
  12959. pktType = -1;
  12960. return true;
  12961.  
  12962. case 68:
  12963. for (int k5 = 0; k5 < variousSettings.length; k5++)
  12964. if (variousSettings[k5] != anIntArray1045[k5]) {
  12965. variousSettings[k5] = anIntArray1045[k5];
  12966. method33(k5);
  12967. needDrawTabArea = true;
  12968. }
  12969. pktType = -1;
  12970. return true;
  12971.  
  12972. case 196:
  12973. long l5 = inStream.readQWord();
  12974. int j18 = inStream.readDWord();
  12975. int l21 = inStream.readUnsignedByte();
  12976. boolean flag5 = false;
  12977. if (l21 <= 1) {
  12978. for (int l29 = 0; l29 < ignoreCount; l29++) {
  12979. if (ignoreListAsLongs[l29] != l5)
  12980. continue;
  12981. flag5 = true;
  12982.  
  12983. }
  12984. }
  12985. if (!flag5 && anInt1251 == 0)
  12986. try {
  12987. String s9 = TextInput.method525(pktSize - 13, inStream);
  12988. if (l21 == 1)
  12989. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12990. else if (l21 == 2)
  12991. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12992. else if (l21 == 3)
  12993. pushMessage(s9, 7, "@cr3@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12994. else if (l21 == 4)
  12995. pushMessage(s9, 7, "@cr4@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12996. else if (l21 == 5)
  12997. pushMessage(s9, 7, "@cr5@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12998. else if (l21 == 6)
  12999. pushMessage(s9, 7, "@cr6@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13000. else if (l21 == 7)
  13001. pushMessage(s9, 7, "@cr7@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13002. else if (l21 == 8)
  13003. pushMessage(s9, 7, "@cr8@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13004. else if (l21 == 9)
  13005. pushMessage(s9, 7, "@cr9@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13006. else if (l21 == 10)
  13007. pushMessage(s9, 7, "@cr10@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13008. else if (l21 == 11)
  13009. pushMessage(s9, 7, "@cr11@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13010. else if (l21 == 12)
  13011. pushMessage(s9, 7, "@cr12@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13012. else if (l21 == 13)
  13013. pushMessage(s9, 7, "@cr13@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13014. else if (l21 == 14)
  13015. pushMessage(s9, 7, "@cr14@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13016. else if (l21 == 15)
  13017. pushMessage(s9, 7, "@cr15@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13018. else if (l21 == 16)
  13019. pushMessage(s9, 7, "@cr16@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13020. else if (l21 == 17)
  13021. pushMessage(s9, 7, "@cr17@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13022. else if (l21 == 18)
  13023. pushMessage(s9, 7, "@cr18@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13024. else if (l21 == 19)
  13025. pushMessage(s9, 7, "@cr19@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13026. else if (l21 == 20)
  13027. pushMessage(s9, 7, "@cr20@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13028. else
  13029. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  13030. } catch (Exception exception1) {
  13031. SignLink.reporterror("cde1");
  13032. }
  13033. pktType = -1;
  13034. return true;
  13035.  
  13036. case 85:
  13037. anInt1269 = inStream.method427();
  13038. anInt1268 = inStream.method427();
  13039. pktType = -1;
  13040. return true;
  13041.  
  13042. case 24:
  13043. anInt1054 = inStream.method428();
  13044. if (anInt1054 == tabID) {
  13045. if (anInt1054 == 3)
  13046. tabID = 1;
  13047. else
  13048. tabID = 3;
  13049. needDrawTabArea = true;
  13050. }
  13051. pktType = -1;
  13052. return true;
  13053.  
  13054. case 246:
  13055. int i6 = inStream.method434();
  13056. int i13 = inStream.readUnsignedWord();
  13057. int k18 = inStream.readUnsignedWord();
  13058. if (k18 == 65535) {
  13059. RSInterface.interfaceCache[i6].anInt233 = 0;
  13060. pktType = -1;
  13061. return true;
  13062. } else {
  13063. ItemDef itemDef = ItemDef.forID(k18);
  13064. RSInterface.interfaceCache[i6].anInt233 = 4;
  13065. RSInterface.interfaceCache[i6].mediaID = k18;
  13066. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  13067. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  13068. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100)
  13069. / i13;
  13070. pktType = -1;
  13071. return true;
  13072. }
  13073.  
  13074. case 171:
  13075. boolean flag1 = inStream.readUnsignedByte() == 1;
  13076. int j13 = inStream.readUnsignedWord();
  13077. RSInterface.interfaceCache[j13].interfaceShown = flag1;
  13078. pktType = -1;
  13079. return true;
  13080.  
  13081. case 142:
  13082. int j6 = inStream.method434();
  13083. method60(j6);
  13084. if (backDialogID != -1) {
  13085. backDialogID = -1;
  13086. inputTaken = true;
  13087. }
  13088. if (inputDialogState != 0) {
  13089. inputDialogState = 0;
  13090. inputTaken = true;
  13091. }
  13092. invOverlayInterfaceID = j6;
  13093. needDrawTabArea = true;
  13094. tabAreaAltered = true;
  13095. openInterfaceID = -1;
  13096. aBoolean1149 = false;
  13097. pktType = -1;
  13098. return true;
  13099.  
  13100. case 126:
  13101. try {
  13102. String text = inStream.readString();
  13103. int frame = inStream.method435();
  13104. if (text.startsWith("www.")) {
  13105. launchURL(text);
  13106. pktType = -1;
  13107. return true;
  13108. }
  13109. RSInterface.interfaceCache[frame].message = text;
  13110. if(RSInterface.interfaceCache[frame].parentID == tabInterfaceIDs[tabID] ||frame >= 7562 && frame <= 7586)
  13111. needDrawTabArea = true;
  13112. pktType = -1;
  13113. } catch (Exception e) {
  13114. }
  13115. pktType = -1;
  13116. return true;
  13117.  
  13118. case 206:
  13119. publicChatMode = inStream.readUnsignedByte();
  13120. publicChatMode = inStream.readUnsignedByte();
  13121. tradeMode = inStream.readUnsignedByte();
  13122. aBoolean1233 = true;
  13123. inputTaken = true;
  13124. pktType = -1;
  13125. return true;
  13126.  
  13127. case 240:
  13128. if (tabID == 12)
  13129. needDrawTabArea = true;
  13130. weight = inStream.readSignedWord();
  13131. pktType = -1;
  13132. return true;
  13133.  
  13134. case 8:
  13135. int k6 = inStream.method436();
  13136. int l13 = inStream.readUnsignedWord();
  13137. RSInterface.interfaceCache[k6].anInt233 = 1;
  13138. RSInterface.interfaceCache[k6].mediaID = l13;
  13139. pktType = -1;
  13140. return true;
  13141.  
  13142. case 122:
  13143. int l6 = inStream.method436();
  13144. int i14 = inStream.method436();
  13145. int i19 = i14 >> 10 & 0x1f;
  13146. int i22 = i14 >> 5 & 0x1f;
  13147. int l24 = i14 & 0x1f;
  13148. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  13149. + (i22 << 11) + (l24 << 3);
  13150. pktType = -1;
  13151. return true;
  13152.  
  13153. case 53:
  13154. needDrawTabArea = true;
  13155. int i7 = inStream.readUnsignedWord();
  13156. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  13157. int j19 = inStream.readUnsignedWord();
  13158. for (int j22 = 0; j22 < j19; j22++) {
  13159. int i25 = inStream.readUnsignedByte();
  13160. if (i25 == 255)
  13161. i25 = inStream.method440();
  13162. class9_1.inv[j22] = inStream.method436();
  13163. class9_1.invStackSizes[j22] = i25;
  13164. }
  13165. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  13166. class9_1.inv[j25] = 0;
  13167. class9_1.invStackSizes[j25] = 0;
  13168. }
  13169. pktType = -1;
  13170. return true;
  13171.  
  13172. case 230:
  13173. int j7 = inStream.method435();
  13174. int j14 = inStream.readUnsignedWord();
  13175. int k19 = inStream.readUnsignedWord();
  13176. int k22 = inStream.method436();
  13177. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  13178. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  13179. RSInterface.interfaceCache[j14].modelZoom = j7;
  13180. pktType = -1;
  13181. return true;
  13182.  
  13183. case 221:
  13184. anInt900 = inStream.readUnsignedByte();
  13185. needDrawTabArea = true;
  13186. pktType = -1;
  13187. return true;
  13188.  
  13189. case 177:
  13190. aBoolean1160 = true;
  13191. anInt995 = inStream.readUnsignedByte();
  13192. anInt996 = inStream.readUnsignedByte();
  13193. anInt997 = inStream.readUnsignedWord();
  13194. anInt998 = inStream.readUnsignedByte();
  13195. anInt999 = inStream.readUnsignedByte();
  13196. if (anInt999 >= 100) {
  13197. int k7 = anInt995 * 128 + 64;
  13198. int k14 = anInt996 * 128 + 64;
  13199. int i20 = method42(plane, k14, k7) - anInt997;
  13200. int l22 = k7 - xCameraPos;
  13201. int k25 = i20 - zCameraPos;
  13202. int j28 = k14 - yCameraPos;
  13203. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  13204. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  13205. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  13206. if (yCameraCurve < 128)
  13207. yCameraCurve = 128;
  13208. if (yCameraCurve > 383)
  13209. yCameraCurve = 383;
  13210. }
  13211. pktType = -1;
  13212. return true;
  13213.  
  13214. case 249:
  13215. anInt1046 = inStream.method426();
  13216. unknownInt10 = inStream.method436();
  13217. pktType = -1;
  13218. return true;
  13219.  
  13220. case 65:
  13221. updateNPCs(inStream, pktSize);
  13222. pktType = -1;
  13223. return true;
  13224.  
  13225. case 27:
  13226. messagePromptRaised = false;
  13227. inputDialogState = 1;
  13228. amountOrNameInput = "";
  13229. inputTaken = true;
  13230. pktType = -1;
  13231. return true;
  13232.  
  13233. case 187:
  13234. messagePromptRaised = false;
  13235. inputDialogState = 2;
  13236. amountOrNameInput = "";
  13237. inputTaken = true;
  13238. pktType = -1;
  13239. return true;
  13240.  
  13241. case 97:
  13242. int l7 = inStream.readUnsignedWord();
  13243. method60(l7);
  13244. if (invOverlayInterfaceID != -1) {
  13245. invOverlayInterfaceID = -1;
  13246. needDrawTabArea = true;
  13247. tabAreaAltered = true;
  13248. }
  13249. if (backDialogID != -1) {
  13250. backDialogID = -1;
  13251. inputTaken = true;
  13252. }
  13253. if (inputDialogState != 0) {
  13254. inputDialogState = 0;
  13255. inputTaken = true;
  13256. }
  13257. // 17511 = Question Type
  13258. // 15819 = Christmas Type
  13259. // 15812 = Security Type
  13260. // 15801 = Item Scam Type
  13261. // 15791 = Password Safety ?
  13262. // 15774 = Good/Bad Password
  13263. // 15767 = Drama Type ????
  13264. if (l7 == 15244) {
  13265. openInterfaceID = 15767;
  13266. fullscreenInterfaceID = 15244;
  13267. } else {
  13268. openInterfaceID = l7;
  13269. }
  13270. aBoolean1149 = false;
  13271. pktType = -1;
  13272. return true;
  13273.  
  13274. case 218:
  13275. int i8 = inStream.method438();
  13276. dialogID = i8;
  13277. inputTaken = true;
  13278. pktType = -1;
  13279. return true;
  13280.  
  13281. case 87:
  13282. int j8 = inStream.method434();
  13283. int l14 = inStream.method439();
  13284. anIntArray1045[j8] = l14;
  13285. if (variousSettings[j8] != l14) {
  13286. variousSettings[j8] = l14;
  13287. method33(j8);
  13288. needDrawTabArea = true;
  13289. if (dialogID != -1)
  13290. inputTaken = true;
  13291. }
  13292. pktType = -1;
  13293. return true;
  13294.  
  13295. case 36:
  13296. int k8 = inStream.method434();
  13297. byte byte0 = inStream.readSignedByte();
  13298. anIntArray1045[k8] = byte0;
  13299. if (variousSettings[k8] != byte0) {
  13300. variousSettings[k8] = byte0;
  13301. method33(k8);
  13302. needDrawTabArea = true;
  13303. if (dialogID != -1)
  13304. inputTaken = true;
  13305. }
  13306. pktType = -1;
  13307. return true;
  13308.  
  13309. case 61:
  13310. anInt1055 = inStream.readUnsignedByte();
  13311. pktType = -1;
  13312. return true;
  13313.  
  13314. case 200:
  13315. int l8 = inStream.readUnsignedWord();
  13316. int i15 = inStream.readSignedWord();
  13317. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  13318. class9_4.anInt257 = i15;
  13319. class9_4.modelZoom = 1600;
  13320. if (i15 == 591 || i15 == 588) {
  13321. class9_4.modelZoom = 900; // anInt269
  13322. }
  13323. if (i15 == -1) {
  13324. class9_4.anInt246 = 0;
  13325. class9_4.anInt208 = 0;
  13326. }
  13327. pktType = -1;
  13328. return true;
  13329.  
  13330.  
  13331. case 219:
  13332. if (invOverlayInterfaceID != -1) {
  13333. invOverlayInterfaceID = -1;
  13334. needDrawTabArea = true;
  13335. tabAreaAltered = true;
  13336. }
  13337. if (backDialogID != -1) {
  13338. backDialogID = -1;
  13339. inputTaken = true;
  13340. }
  13341. if (inputDialogState != 0) {
  13342. inputDialogState = 0;
  13343. inputTaken = true;
  13344. }
  13345. openInterfaceID = -1;
  13346. aBoolean1149 = false;
  13347. pktType = -1;
  13348. return true;
  13349.  
  13350. case 34:
  13351. needDrawTabArea = true;
  13352. int i9 = inStream.readUnsignedWord();
  13353. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  13354. while (inStream.currentOffset < pktSize) {
  13355. int j20 = inStream.method422();
  13356. int i23 = inStream.readUnsignedWord();
  13357. int l25 = inStream.readUnsignedByte();
  13358. if (l25 == 255)
  13359. l25 = inStream.readDWord();
  13360. if (j20 >= 0 && j20 < class9_2.inv.length) {
  13361. class9_2.inv[j20] = i23;
  13362. class9_2.invStackSizes[j20] = l25;
  13363. }
  13364. }
  13365. pktType = -1;
  13366. return true;
  13367.  
  13368. case 4:
  13369. case 44:
  13370. case 84:
  13371. case 101:
  13372. case 105:
  13373. case 117:
  13374. case 147:
  13375. case 151:
  13376. case 156:
  13377. case 160:
  13378. case 215:
  13379. method137(inStream, pktType);
  13380. pktType = -1;
  13381. return true;
  13382.  
  13383. case 106:
  13384. tabID = inStream.method427();
  13385. needDrawTabArea = true;
  13386. tabAreaAltered = true;
  13387. pktType = -1;
  13388. return true;
  13389.  
  13390. case 164:
  13391. int j9 = inStream.method434();
  13392. method60(j9);
  13393. if (invOverlayInterfaceID != -1) {
  13394. invOverlayInterfaceID = -1;
  13395. needDrawTabArea = true;
  13396. tabAreaAltered = true;
  13397. }
  13398. backDialogID = j9;
  13399. inputTaken = true;
  13400. openInterfaceID = -1;
  13401. aBoolean1149 = false;
  13402. pktType = -1;
  13403. return true;
  13404.  
  13405. }
  13406. SignLink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  13407. + anInt842 + "," + anInt843);
  13408. resetLogout();
  13409. } catch (IOException _ex) {
  13410. dropClient();
  13411. } catch (Exception exception) {
  13412. exception.printStackTrace();
  13413. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  13414. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  13415. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  13416. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  13417. s2 = s2 + inStream.buffer[j15] + ",";
  13418. SignLink.reporterror(s2);
  13419. resetLogout();
  13420. }
  13421. return true;
  13422. }
  13423.  
  13424. public void method146() {
  13425. anInt1265++;
  13426. method47(true);
  13427. method26(true);
  13428. method47(false);
  13429. method26(false);
  13430. method55();
  13431. method104();
  13432. if (!aBoolean1160) {
  13433. int i = anInt1184;
  13434. if (anInt984 / 256 > i)
  13435. i = anInt984 / 256;
  13436. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  13437. i = anIntArray1203[4] + 128;
  13438. int k = viewRotation + viewRotationOffset & 0x7ff;
  13439. setCameraPos(600 + i * 3, i, anInt1014,
  13440. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  13441. }
  13442. int j;
  13443. if (!aBoolean1160)
  13444. j = method120();
  13445. else
  13446. j = method121();
  13447. int l = xCameraPos;
  13448. int i1 = zCameraPos;
  13449. int j1 = yCameraPos;
  13450. int k1 = yCameraCurve;
  13451. int l1 = xCameraCurve;
  13452. for (int i2 = 0; i2 < 5; i2++)
  13453. if (aBooleanArray876[i2]) {
  13454. int j2 = (int) ((Math.random()
  13455. * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  13456. .sin((double) anIntArray1030[i2]
  13457. * ((double) anIntArray928[i2] / 100D))
  13458. * (double) anIntArray1203[i2]);
  13459. if (i2 == 0)
  13460. xCameraPos += j2;
  13461. if (i2 == 1)
  13462. zCameraPos += j2;
  13463. if (i2 == 2)
  13464. yCameraPos += j2;
  13465. if (i2 == 3)
  13466. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  13467. if (i2 == 4) {
  13468. yCameraCurve += j2;
  13469. if (yCameraCurve < 128)
  13470. yCameraCurve = 128;
  13471. if (yCameraCurve > 383)
  13472. yCameraCurve = 383;
  13473. }
  13474. }
  13475. // int k2 = Rasterizer.textureGetCount;
  13476. Model.objectExists = true;
  13477. Model.objectsRendered = 0;
  13478. Model.currentCursorX = super.mouseX - 4;
  13479. Model.currentCursorY = super.mouseY - 4;
  13480. DrawingArea.setAllPixelsToZero();
  13481. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  13482. zCameraPos, j, yCameraCurve);
  13483. worldController.clearObj5Cache();
  13484. updateEntities();
  13485. drawHeadIcon();
  13486. TextureAnimating.animateTexture();
  13487. draw3dScreen();
  13488. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  13489. xCameraPos = l;
  13490. zCameraPos = i1;
  13491. yCameraPos = j1;
  13492. yCameraCurve = k1;
  13493. xCameraCurve = l1;
  13494. }
  13495.  
  13496. public void clearTopInterfaces() {
  13497. stream.createFrame(130);
  13498. if (invOverlayInterfaceID != -1) {
  13499. invOverlayInterfaceID = -1;
  13500. needDrawTabArea = true;
  13501. aBoolean1149 = false;
  13502. tabAreaAltered = true;
  13503. }
  13504. if (backDialogID != -1) {
  13505. backDialogID = -1;
  13506. inputTaken = true;
  13507. aBoolean1149 = false;
  13508. }
  13509. openInterfaceID = -1;
  13510. fullscreenInterfaceID = -1;
  13511. }
  13512.  
  13513. public Client() {
  13514. xpAddedPos = expAdded = 0;
  13515. expAdded = 0;
  13516. xpLock = false;
  13517. xpCounter = 0;
  13518. counter = new Sprite[3];
  13519. chatRights = new int[500];
  13520. fullscreenInterfaceID = -1;
  13521. chatTypeView = 0;
  13522. clanChatMode = 0;
  13523. cButtonHPos = -1;
  13524. cButtonHCPos = -1;
  13525. cButtonCPos = 0;
  13526. server = "127.0.0.1";
  13527. anIntArrayArray825 = new int[104][104];
  13528. friendsNodeIDs = new int[200];
  13529. groundArray = new NodeList[4][104][104];
  13530. aBoolean831 = false;
  13531. aStream_834 = new Stream(new byte[5000]);
  13532. npcArray = new NPC[16384];
  13533. npcIndices = new int[16384];
  13534. anIntArray840 = new int[1000];
  13535. aStream_847 = Stream.create();
  13536. aBoolean848 = true;
  13537. openInterfaceID = -1;
  13538. currentExp = new int[Skills.skillsCount];
  13539. aBoolean872 = false;
  13540. anIntArray873 = new int[5];
  13541. anInt874 = -1;
  13542. aBooleanArray876 = new boolean[5];
  13543. drawFlames = false;
  13544. reportAbuseInput = "";
  13545. unknownInt10 = -1;
  13546. menuOpen = false;
  13547. inputString = "";
  13548. maxPlayers = 2048;
  13549. myPlayerIndex = 2047;
  13550. playerArray = new Player[maxPlayers];
  13551. playerIndices = new int[maxPlayers];
  13552. anIntArray894 = new int[maxPlayers];
  13553. aStreamArray895s = new Stream[maxPlayers];
  13554. anInt897 = 1;
  13555. anIntArrayArray901 = new int[104][104];
  13556. anInt902 = 0x766654;
  13557. aByteArray912 = new byte[16384];
  13558. currentStats = new int[Skills.skillsCount];
  13559. ignoreListAsLongs = new long[100];
  13560. loadingError = false;
  13561. anInt927 = 0x332d25;
  13562. anIntArray928 = new int[5];
  13563. anIntArrayArray929 = new int[104][104];
  13564. chatTypes = new int[500];
  13565. chatNames = new String[500];
  13566. chatMessages = new String[500];
  13567. chatButtons = new Sprite[4];
  13568. sideIcons = new Sprite[15];
  13569. redStones = new Sprite[5];
  13570. aBoolean954 = true;
  13571. friendsListAsLongs = new long[200];
  13572. currentSong = -1;
  13573. drawingFlames = false;
  13574. spriteDrawX = -1;
  13575. spriteDrawY = -1;
  13576. anIntArray968 = new int[33];
  13577. anIntArray969 = new int[256];
  13578. decompressors = new Decompressor[6];
  13579. variousSettings = new int[2000];
  13580. aBoolean972 = false;
  13581. anInt975 = 50;
  13582. anIntArray976 = new int[anInt975];
  13583. anIntArray977 = new int[anInt975];
  13584. anIntArray978 = new int[anInt975];
  13585. anIntArray979 = new int[anInt975];
  13586. anIntArray980 = new int[anInt975];
  13587. anIntArray981 = new int[anInt975];
  13588. anIntArray982 = new int[anInt975];
  13589. aStringArray983 = new String[anInt975];
  13590. anInt985 = -1;
  13591. hitMarks = new Sprite[20];
  13592. hitMark = new Sprite[20];
  13593. hitIcon = new Sprite[20];
  13594. anIntArray990 = new int[5];
  13595. aBoolean994 = false;
  13596. anInt1002 = 0x23201b;
  13597. amountOrNameInput = "";
  13598. aClass19_1013 = new NodeList();
  13599. aBoolean1017 = false;
  13600. anInt1018 = -1;
  13601. anIntArray1030 = new int[5];
  13602. aBoolean1031 = false;
  13603. mapFunctions = new Sprite[100];
  13604. dialogID = -1;
  13605. maxStats = new int[Skills.skillsCount];
  13606. anIntArray1045 = new int[2000];
  13607. aBoolean1047 = true;
  13608. anIntArray1052 = new int[151];
  13609. anInt1054 = -1;
  13610. aClass19_1056 = new NodeList();
  13611. anIntArray1057 = new int[33];
  13612. aClass9_1059 = new RSInterface();
  13613. mapScenes = new Background[100];
  13614. barFillColor = 0x4d4233;
  13615. anIntArray1065 = new int[7];
  13616. anIntArray1072 = new int[1000];
  13617. anIntArray1073 = new int[1000];
  13618. aBoolean1080 = false;
  13619. friendsList = new String[200];
  13620. inStream = Stream.create();
  13621. expectedCRCs = new int[9];
  13622. menuActionCmd2 = new int[500];
  13623. menuActionCmd3 = new int[500];
  13624. menuActionCmd4 = new int[500];
  13625. menuActionIds = new int[500];
  13626. menuActionCmd1 = new int[500];
  13627. headIcons = new Sprite[20];
  13628. skullIcons = new Sprite[20];
  13629. headIconsHint = new Sprite[20];
  13630. tabAreaAltered = false;
  13631. aString1121 = "";
  13632. atPlayerActions = new String[5];
  13633. atPlayerArray = new boolean[5];
  13634. anIntArrayArrayArray1129 = new int[4][13][13];
  13635. anInt1132 = 2;
  13636. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13637. aBoolean1141 = false;
  13638. aBoolean1149 = false;
  13639. crosses = new Sprite[8];
  13640. musicEnabled = true;
  13641. needDrawTabArea = false;
  13642. loggedIn = false;
  13643. canMute = false;
  13644. aBoolean1159 = false;
  13645. aBoolean1160 = false;
  13646. anInt1171 = 1;
  13647. myUsername = "";
  13648. myPassword = "";
  13649. genericLoadingError = false;
  13650. reportAbuseInterfaceID = -1;
  13651. aClass19_1179 = new NodeList();
  13652. anInt1184 = 128;
  13653. invOverlayInterfaceID = -1;
  13654. stream = Stream.create();
  13655. menuActionName = new String[500];
  13656. anIntArray1203 = new int[5];
  13657. sound = new int[50];
  13658. anInt1210 = 2;
  13659. anInt1211 = 78;
  13660. promptInput = "";
  13661. modIcons = new Sprite[12];
  13662. tabID = 3;
  13663. inputTaken = false;
  13664. songChanging = true;
  13665. anIntArray1229 = new int[151];
  13666. aClass11Array1230 = new TileSettings[4];
  13667. aBoolean1233 = false;
  13668. anIntArray1240 = new int[100];
  13669. soundType = new int[50];
  13670. aBoolean1242 = false;
  13671. soundDelay = new int[50];
  13672. soundVolume = new int[50];
  13673. rsAlreadyLoaded = false;
  13674. welcomeScreenRaised = false;
  13675. messagePromptRaised = false;
  13676. loginMessage1 = "";
  13677. loginMessage2 = "";
  13678. backDialogID = -1;
  13679. anInt1279 = 2;
  13680. bigX = new int[4000];
  13681. bigY = new int[4000];
  13682. anInt1289 = -1;
  13683. }
  13684. public String clanUsername;
  13685. public String clanMessage;
  13686. public int[] chatRights;
  13687. public int hoverId;
  13688. public boolean summHover = false;
  13689. public int rights;
  13690. public String name;
  13691. public String message;
  13692. public String clanname;
  13693. public int chatTypeView;
  13694. public int clanChatMode;
  13695. public int duelMode;
  13696.  
  13697. /* Declare custom sprites */
  13698. @SuppressWarnings("unused")
  13699. private static Sprite mapIcon;
  13700. private Sprite chatArea;
  13701. private Sprite[] chatButtons;
  13702. private Background mapBack;
  13703. private Sprite tabArea;
  13704. private Sprite worldMapIcon;
  13705. private Sprite logIconH;
  13706. private Sprite logIconC;
  13707. private Sprite mapArea;
  13708. private Sprite[] ORBS = new Sprite[19];
  13709. /**/
  13710.  
  13711. public RSImageProducer leftFrame;
  13712. public RSImageProducer topFrame;
  13713. public RSImageProducer rightFrame;
  13714. public int ignoreCount;
  13715. public long aLong824;
  13716. public int[][] anIntArrayArray825;
  13717. public int[] friendsNodeIDs;
  13718. public NodeList[][][] groundArray;
  13719. public int[] anIntArray828;
  13720. public int[] anIntArray829;
  13721. public volatile boolean aBoolean831;
  13722. public Socket aSocket832;
  13723. public int loginScreenState;
  13724. public Stream aStream_834;
  13725. public NPC[] npcArray;
  13726. public int npcCount;
  13727. public int[] npcIndices;
  13728. public int anInt839;
  13729. public int[] anIntArray840;
  13730. public int anInt841;
  13731. public int anInt842;
  13732. public int anInt843;
  13733. public String aString844;
  13734. public Stream aStream_847;
  13735. public boolean aBoolean848;
  13736. public static int anInt849;
  13737. public int[] anIntArray850;
  13738. public int[] anIntArray851;
  13739. public int[] anIntArray852;
  13740. public int[] anIntArray853;
  13741. public static int anInt854;
  13742. public int anInt855;
  13743. public static int openInterfaceID;
  13744. public int xCameraPos;
  13745. public int zCameraPos;
  13746. public int yCameraPos;
  13747. public int yCameraCurve;
  13748. public int xCameraCurve;
  13749. public int myPrivilege;
  13750. public final int[] currentExp;
  13751. public Sprite[] redStones;
  13752. public Sprite mapFlag;
  13753. public Sprite mapMarker;
  13754. public boolean aBoolean872;
  13755. public final int[] anIntArray873;
  13756. public int anInt874;
  13757. public final boolean[] aBooleanArray876;
  13758. public int weight;
  13759. public MouseDetection mouseDetection;
  13760. public volatile boolean drawFlames;
  13761. public String reportAbuseInput;
  13762. public int unknownInt10;
  13763. public boolean menuOpen;
  13764. public int anInt886;
  13765. public String inputString;
  13766. public final int maxPlayers;
  13767. public final int myPlayerIndex;
  13768. public Player[] playerArray;
  13769. public int playerCount;
  13770. public int[] playerIndices;
  13771. public int anInt893;
  13772. public int[] anIntArray894;
  13773. public Stream[] aStreamArray895s;
  13774. public int viewRotationOffset;
  13775. public int anInt897;
  13776. public int friendsCount;
  13777. public int anInt900;
  13778. public int[][] anIntArrayArray901;
  13779. public final int anInt902;
  13780. public byte[] aByteArray912;
  13781. public int anInt913;
  13782. public int crossX;
  13783. public int crossY;
  13784. public int crossIndex;
  13785. public int crossType;
  13786. public int plane;
  13787. public final int[] currentStats;
  13788. public static int anInt924;
  13789. public final long[] ignoreListAsLongs;
  13790. public boolean loadingError;
  13791. public final int anInt927;
  13792. public final int[] anIntArray928;
  13793. public int[][] anIntArrayArray929;
  13794. public Sprite aClass30_Sub2_Sub1_Sub1_931;
  13795. public Sprite aClass30_Sub2_Sub1_Sub1_932;
  13796. public int anInt933;
  13797. public int anInt934;
  13798. public int anInt935;
  13799. public int anInt936;
  13800. public int anInt937;
  13801. public int anInt938;
  13802. public static int anInt940;
  13803. public int[] chatTypes;
  13804. public String[] chatNames;
  13805. public String[] chatMessages;
  13806. public int anInt945;
  13807. public WorldController worldController;
  13808. public Sprite[] sideIcons;
  13809. public Sprite[] customSideIcons = new Sprite[] {new Sprite("SideIcon 1"), new Sprite("SideIcon 2"), new Sprite("SideIcon 3")};
  13810. public int menuScreenArea;
  13811. public int menuOffsetX;
  13812. public int menuOffsetY;
  13813. public int menuWidth;
  13814. public int menuHeight;
  13815. public long aLong953;
  13816. public boolean aBoolean954;
  13817.  
  13818. public String[] clanList = new String[100];
  13819. public long[] friendsListAsLongs;
  13820. public int currentSong;
  13821. public static int nodeID = 10;
  13822. public static int portOff;
  13823. static boolean clientData;
  13824. public static boolean isMembers = true;
  13825. public static boolean lowMem;
  13826. public volatile boolean drawingFlames;
  13827. public int spriteDrawX;
  13828. public int spriteDrawY;
  13829. public final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  13830. 0xff00ff, 0xffffff };
  13831. public Sprite LoginBox;
  13832. public Sprite LoginButton;
  13833. public Sprite LoginButtonHover;
  13834. public Sprite TypeIn;
  13835. public Sprite TypeInHover;
  13836. public Sprite RememberNo;
  13837. public Sprite RememberYes;
  13838. public Sprite Logo;
  13839. public Sprite Bg;
  13840. public boolean FadingBackgrounds = true;
  13841. public Sprite BackgroundFix;
  13842. public final int[] anIntArray968;
  13843. public final int[] anIntArray969;
  13844. public final Decompressor[] decompressors;
  13845. public int variousSettings[];
  13846. public boolean aBoolean972;
  13847. public final int anInt975;
  13848. public final int[] anIntArray976;
  13849. public final int[] anIntArray977;
  13850. public final int[] anIntArray978;
  13851. public final int[] anIntArray979;
  13852. public final int[] anIntArray980;
  13853. public final int[] anIntArray981;
  13854. public final int[] anIntArray982;
  13855. public final String[] aStringArray983;
  13856. public int anInt984;
  13857. public int anInt985;
  13858. public static int anInt986;
  13859. public Sprite[] hitMarks;
  13860. private Sprite[] hitMark;
  13861. private Sprite[] hitIcon;
  13862. private Sprite HPBarFull, HPBarEmpty;
  13863.  
  13864. public int anInt988;
  13865. public int anInt989;
  13866. public final int[] anIntArray990;
  13867. public static boolean aBoolean993;
  13868. public final boolean aBoolean994;
  13869. public int anInt995;
  13870. public int anInt996;
  13871. public int anInt997;
  13872. public int anInt998;
  13873. public int anInt999;
  13874. public ISAACRandomGen encryption;
  13875. public Sprite mapEdge;
  13876.  
  13877. public final int anInt1002;
  13878. public static final int[][] anIntArrayArray1003 = {
  13879. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  13880. 54193 },
  13881. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13882. 56621, 4783, 1341, 16578, 35003, 25239 },
  13883. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13884. 10153, 56621, 4783, 1341, 16578, 35003 },
  13885. { 4626, 11146, 6439, 12, 4758, 10270 },
  13886. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  13887.  
  13888. public Sprite multiOverlay;
  13889. public String amountOrNameInput;
  13890. public static int anInt1005;
  13891. public int daysSinceLastLogin;
  13892. public int pktSize;
  13893. public int pktType;
  13894. public int anInt1009;
  13895. public int anInt1010;
  13896. public int anInt1011;
  13897. public NodeList aClass19_1013;
  13898. public int anInt1014;
  13899. public int anInt1015;
  13900. public int anInt1016;
  13901. public int bgId = 0, waitTicker = 0, bgFinal = 0;
  13902. public boolean bgBoolean;
  13903. public boolean aBoolean1017;
  13904. public static int anInt1018;
  13905. public static final int[] anIntArray1019;
  13906. public int anInt1021;
  13907. public int anInt1022;
  13908. public int loadingStage;
  13909. public Sprite scrollBar1;
  13910. public Sprite scrollBar2;
  13911. public int anInt1026;
  13912.  
  13913. public Background backBase1;
  13914.  
  13915. public Background backBase2;
  13916.  
  13917. public Background backHmid1;
  13918. public final int[] anIntArray1030;
  13919. public boolean aBoolean1031;
  13920. public static Sprite[] mapFunctions;
  13921. public static int baseX;
  13922. public static int baseY;
  13923. public int anInt1036;
  13924. public int anInt1037;
  13925. public int loginFailures;
  13926. public int anInt1039;
  13927. public int anInt1040;
  13928. public int anInt1041;
  13929. public int dialogID;
  13930. public final int[] maxStats;
  13931. public final int[] anIntArray1045;
  13932. public int anInt1046;
  13933. public boolean aBoolean1047;
  13934. public TextDrawingArea smallText;
  13935. private TextDrawingArea smallHit;
  13936. private TextDrawingArea bigHit;
  13937. public TextDrawingArea aTextDrawingArea_1271;
  13938. public TextDrawingArea chatTextDrawingArea;
  13939. public TextDrawingArea aTextDrawingArea_1273;
  13940. public RSFont newSmallFont;
  13941. public RSFont newRegularFont;
  13942. public RSFont newBoldFont;
  13943. public RSFont newFancyFont;
  13944. public int anInt1048;
  13945. public String aString1049;
  13946. public static int anInt1051;
  13947. public final int[] anIntArray1052;
  13948. public StreamLoader titleStreamLoader;
  13949. public int anInt1054;
  13950. public int anInt1055;
  13951. public NodeList aClass19_1056;
  13952. public final int[] anIntArray1057;
  13953. public final RSInterface aClass9_1059;
  13954. public Background[] mapScenes;
  13955. public static int anInt1061;
  13956. public int currentSound;
  13957. public final int barFillColor;
  13958. public int friendsListAction;
  13959. public final int[] anIntArray1065;
  13960. public int mouseInvInterfaceIndex;
  13961. public int lastActiveInvInterface;
  13962. public OnDemandFetcher onDemandFetcher;
  13963. public int anInt1069;
  13964. public int anInt1070;
  13965. public int anInt1071;
  13966. public int[] anIntArray1072;
  13967. public int[] anIntArray1073;
  13968. public Sprite mapDotItem;
  13969. public Sprite mapDotNPC;
  13970. public Sprite mapDotPlayer;
  13971. public Sprite mapDotFriend;
  13972.  
  13973. public Sprite mapDotTeam;
  13974.  
  13975. public Sprite mapDotClan;
  13976. public int anInt1079;
  13977. public boolean aBoolean1080;
  13978. public String[] friendsList;
  13979. public Stream inStream;
  13980. public int anInt1084;
  13981. public int anInt1085;
  13982. public int activeInterfaceType;
  13983. public int anInt1087;
  13984. public int anInt1088;
  13985. public static int anInt1089;
  13986. public final int[] expectedCRCs;
  13987. public int[] menuActionCmd2;
  13988. public int[] menuActionCmd3;
  13989. public int[] menuActionIds;
  13990. public int[] menuActionCmd1;
  13991. public Sprite[] headIcons;
  13992. public Sprite[] skullIcons;
  13993. public Sprite[] headIconsHint;
  13994. public static int anInt1097;
  13995. public int anInt1098;
  13996. public int anInt1099;
  13997. public int anInt1100;
  13998. public int anInt1101;
  13999. public int anInt1102;
  14000. public static boolean tabAreaAltered;
  14001. public int anInt1104;
  14002. public RSImageProducer aRSImageProducer_1107;
  14003. public RSImageProducer aRSImageProducer_1108;
  14004. public RSImageProducer aRSImageProducer_1109;
  14005. public RSImageProducer aRSImageProducer_1110;
  14006. public RSImageProducer aRSImageProducer_1111;
  14007. public RSImageProducer aRSImageProducer_1112;
  14008. public RSImageProducer aRSImageProducer_1113;
  14009. public RSImageProducer aRSImageProducer_1114;
  14010. public RSImageProducer aRSImageProducer_1115;
  14011. public static int anInt1117;
  14012. public int membersInt;
  14013. public String aString1121;
  14014. public Sprite compass;
  14015.  
  14016. public RSImageProducer aRSImageProducer_1123;
  14017.  
  14018. public RSImageProducer aRSImageProducer_1124;
  14019. public RSImageProducer aRSImageProducer_1125;
  14020. public static Player myPlayer;
  14021. public final String[] atPlayerActions;
  14022. public final boolean[] atPlayerArray;
  14023. public final int[][][] anIntArrayArrayArray1129;
  14024. public static final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1,
  14025. -1, -1, -1, -1, -1, -1, -1, -1 };
  14026. public int cameraOffsetY;
  14027.  
  14028. public int anInt1132;
  14029. public int menuActionRow;
  14030. public static int anInt1134;
  14031. public int spellSelected;
  14032. public int anInt1137;
  14033. public int spellUsableOn;
  14034. public String spellTooltip;
  14035. public Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  14036. public boolean aBoolean1141;
  14037. public static int anInt1142;
  14038. public int energy;
  14039. public boolean aBoolean1149;
  14040. public Sprite[] crosses;
  14041. public boolean musicEnabled;
  14042. public Background[] aBackgroundArray1152s;
  14043. public static boolean needDrawTabArea;
  14044. public int unreadMessages;
  14045. public static int anInt1155;
  14046. public static boolean fpsOn;
  14047. public boolean loggedIn;
  14048. public boolean canMute;
  14049. public boolean aBoolean1159;
  14050. public boolean aBoolean1160;
  14051. public static int loopCycle;
  14052. public static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  14053. public RSImageProducer aRSImageProducer_1163;
  14054. public RSImageProducer mapEdgeIP;
  14055. public RSImageProducer aRSImageProducer_1164;
  14056. public RSImageProducer aRSImageProducer_1165;
  14057. public RSImageProducer aRSImageProducer_1166;
  14058. public int daysSinceRecovChange;
  14059. public RSSocket socketStream;
  14060.  
  14061. public int anInt1169;
  14062. public static int minimapZoom;
  14063.  
  14064. public int anInt1171;
  14065. public long aLong1172;
  14066. public static String myUsername;
  14067. public static String myPassword;
  14068. public static int anInt1175;
  14069. public boolean genericLoadingError;
  14070. public final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  14071. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  14072. public int reportAbuseInterfaceID;
  14073. public NodeList aClass19_1179;
  14074. public int[] anIntArray1180;
  14075. public int[] anIntArray1181;
  14076. public int[] anIntArray1182;
  14077. public byte[][] aByteArrayArray1183;
  14078. public int anInt1184;
  14079. public static int viewRotation;
  14080. public int anInt1186;
  14081. public int anInt1187;
  14082. public static int anInt1188;
  14083. public int invOverlayInterfaceID;
  14084. public int[] anIntArray1190;
  14085. public int[] anIntArray1191;
  14086. public Stream stream;
  14087. public int anInt1193;
  14088. public int splitpublicChat;
  14089.  
  14090. public String[] menuActionName;
  14091. public Sprite aClass30_Sub2_Sub1_Sub1_1201;
  14092. public Sprite aClass30_Sub2_Sub1_Sub1_1202;
  14093. public final int[] anIntArray1203;
  14094. public static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  14095. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  14096. public static boolean flagged;
  14097. public final int[] sound;
  14098. public int anInt1208;
  14099. public static int minimapRotation;
  14100. public int anInt1210;
  14101. public static int anInt1211;
  14102. public String promptInput;
  14103. public int anInt1213;
  14104. public int[][][] intGroundArray;
  14105. public long aLong1215;
  14106. public int loginScreenCursorPos;
  14107. public final Sprite[] modIcons;
  14108. public long aLong1220;
  14109. public static int tabID;
  14110. public int anInt1222;
  14111. public static boolean inputTaken;
  14112. public int inputDialogState;
  14113. public static int anInt1226;
  14114. public int nextSong;
  14115. public boolean songChanging;
  14116. public final int[] anIntArray1229;
  14117. public TileSettings[] aClass11Array1230;
  14118. public static int anIntArray1232[];
  14119. public boolean aBoolean1233;
  14120. public int[] anIntArray1234;
  14121. public int[] anIntArray1235;
  14122. public int[] anIntArray1236;
  14123. public int anInt1237;
  14124. public int anInt1238;
  14125. public final int anInt1239 = 100;
  14126.  
  14127. public final int[] anIntArray1240;
  14128. public final int[] soundType;
  14129. public boolean aBoolean1242;
  14130. public int atInventoryLoopCycle;
  14131. public int atInventoryInterface;
  14132. public int atInventoryIndex;
  14133. public int atInventoryInterfaceType;
  14134. public byte[][] aByteArrayArray1247;
  14135. public int tradeMode;
  14136. public int anInt1249;
  14137. public final int[] soundDelay;
  14138. public final int[] soundVolume;
  14139. public int anInt1251;
  14140. public final boolean rsAlreadyLoaded;
  14141. public int anInt1253;
  14142. public int anInt1254;
  14143. public boolean welcomeScreenRaised;
  14144. public boolean messagePromptRaised;
  14145. public int anInt1257;
  14146. public byte[][][] byteGroundArray;
  14147. public int prevSong;
  14148. public int destX;
  14149. public int destY;
  14150. public Sprite aClass30_Sub2_Sub1_Sub1_1263;
  14151. public int anInt1264;
  14152. public int anInt1265;
  14153. public String loginMessage1;
  14154. public String loginMessage2;
  14155. public int anInt1268;
  14156. public int anInt1269;
  14157. public int anInt1275;
  14158. public int backDialogID;
  14159. public int cameraOffsetX;
  14160. public int anInt1279;
  14161. public int[] bigX;
  14162. public int[] bigY;
  14163. public int itemSelected;
  14164. public int anInt1283;
  14165. public int anInt1284;
  14166. public int anInt1285;
  14167. public String selectedItemName;
  14168. public int publicChatMode;
  14169. public static int anInt1288;
  14170. public int anInt1289;
  14171. public static int anInt1290;
  14172. public static String server = "localhost";
  14173. public static int dataVersion = 602;
  14174. public static boolean disableUnderlayTexture = false;
  14175. public static boolean disableOverlayTexture = false;
  14176.  
  14177. public int drawCount;
  14178. public int fullscreenInterfaceID;
  14179. public int anInt1044;// 377
  14180. public int anInt1129;// 377
  14181. public int anInt1315;// 377
  14182. public int anInt1500;// 377
  14183. public int anInt1501;// 377
  14184. public int[] fullScreenTextureArray;
  14185.  
  14186. public void resetAllImageProducers() {
  14187. if (super.fullGameScreen != null) {
  14188. return;
  14189. }
  14190. aRSImageProducer_1166 = null;
  14191. aRSImageProducer_1164 = null;
  14192. aRSImageProducer_1163 = null;
  14193. aRSImageProducer_1165 = null;
  14194. aRSImageProducer_1123 = null;
  14195. aRSImageProducer_1124 = null;
  14196. aRSImageProducer_1125 = null;
  14197. aRSImageProducer_1107 = null;
  14198. aRSImageProducer_1108 = null;
  14199. aRSImageProducer_1109 = null;
  14200. aRSImageProducer_1110 = null;
  14201. aRSImageProducer_1111 = null;
  14202. aRSImageProducer_1112 = null;
  14203. aRSImageProducer_1113 = null;
  14204. aRSImageProducer_1114 = null;
  14205. aRSImageProducer_1115 = null;
  14206. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  14207. welcomeScreenRaised = true;
  14208. }
  14209.  
  14210. @SuppressWarnings({ "unchecked", "rawtypes" })
  14211. public void launchURL(String url) {
  14212. String osName = System.getProperty("os.name");
  14213. try {
  14214. if (osName.startsWith("Mac OS")) {
  14215. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  14216. Method openURL = fileMgr.getDeclaredMethod("openURL",
  14217. new Class[] { String.class });
  14218. openURL.invoke(null, new Object[] { url });
  14219. } else if (osName.startsWith("Windows"))
  14220. Runtime.getRuntime().exec(
  14221. "rundll32 url.dll,FileProtocolHandler " + url);
  14222. else { // assume Unix or Linux
  14223. String[] browsers = { "firefox", "opera", "konqueror",
  14224. "epiphany", "mozilla", "netscape", "safari" };
  14225. String browser = null;
  14226. for (int count = 0; count < browsers.length && browser == null; count++)
  14227. if (Runtime.getRuntime()
  14228. .exec(new String[] { "which", browsers[count] })
  14229. .waitFor() == 0)
  14230. browser = browsers[count];
  14231. if (browser == null) {
  14232. throw new Exception("Could not find web browser");
  14233. } else
  14234. Runtime.getRuntime().exec(new String[] { browser, url });
  14235. }
  14236. } catch (Exception e) {
  14237. pushMessage("Failed to open URL.", 0, "");
  14238. }
  14239. }
  14240.  
  14241. static {
  14242. anIntArray1019 = new int[120];
  14243. int i = 0;
  14244. for (int j = 0; j < 120; j++) {
  14245. int l = j + 1;
  14246. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  14247. i += i1;
  14248. anIntArray1019[j] = i / 4;
  14249. }
  14250. anIntArray1232 = new int[32];
  14251. i = 2;
  14252. for (int k = 0; k < 32; k++) {
  14253. anIntArray1232[k] = i - 1;
  14254. i += i;
  14255. }
  14256. }
  14257. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement