Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 448.37 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.  
  5019. default:
  5020. stream.createFrame(185);
  5021. stream.writeWord(k);
  5022. break;
  5023. }
  5024. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5025. if (class9_3.valueIndexArray != null
  5026. && class9_3.valueIndexArray[0][0] == 5) {
  5027. int l2 = class9_3.valueIndexArray[0][1];
  5028. variousSettings[l2] = 1 - variousSettings[l2];
  5029. method33(l2);
  5030. needDrawTabArea = true;
  5031. }
  5032. }
  5033. if (actionId == 447) {
  5034. itemSelected = 1;
  5035. anInt1283 = j;
  5036. anInt1284 = k;
  5037. anInt1285 = i1;
  5038. selectedItemName = ItemDef.forID(i1).name;
  5039. spellSelected = 0;
  5040. needDrawTabArea = true;
  5041. return;
  5042. }
  5043. if (actionId == 1226) {
  5044. int j1 = i1 >> 14 & 0x7fff;
  5045. ObjectDef class46 = ObjectDef.forID(j1);
  5046. String s10;
  5047. if (class46.description != null)
  5048. s10 = new String(class46.description);
  5049. else
  5050. s10 = "It's a " + class46.name + ".";
  5051. pushMessage(s10, 0, "");
  5052. }
  5053. if (actionId == 244) {
  5054. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5055. myPlayer.smallX[0], false, j);
  5056. if (!flag7)
  5057. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5058. myPlayer.smallX[0], false, j);
  5059. crossX = super.saveClickX;
  5060. crossY = super.saveClickY;
  5061. crossType = 2;
  5062. crossIndex = 0;
  5063. stream.createFrame(253);
  5064. stream.method431(j + baseX);
  5065. stream.method433(k + baseY);
  5066. stream.method432(i1);
  5067. }
  5068. if (actionId == 1448) {
  5069. ItemDef itemDef_1 = ItemDef.forID(i1);
  5070. String s6;
  5071. if (itemDef_1.description != null)
  5072. s6 = new String(itemDef_1.description);
  5073. else
  5074. s6 = "It's a " + itemDef_1.name + ".";
  5075. pushMessage(s6, 0, "");
  5076. }
  5077. itemSelected = 0;
  5078. spellSelected = 0;
  5079. needDrawTabArea = true;
  5080.  
  5081. }
  5082.  
  5083. public void method70() {
  5084. anInt1251 = 0;
  5085. int j = (myPlayer.x >> 7) + baseX;
  5086. int k = (myPlayer.y >> 7) + baseY;
  5087. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5088. anInt1251 = 1;
  5089. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5090. anInt1251 = 1;
  5091. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5092. anInt1251 = 0;
  5093. }
  5094.  
  5095. public void run() {
  5096. if (drawFlames) {
  5097. drawFlames();
  5098. } else {
  5099. super.run();
  5100. }
  5101. }
  5102.  
  5103. private void build3dScreenMenu()
  5104. {
  5105. if(itemSelected == 0 && spellSelected == 0)
  5106. {
  5107. menuActionName[menuActionRow] = "Walk here";
  5108. menuActionIds[menuActionRow] = 516;
  5109. menuActionCmd2[menuActionRow] = super.mouseX;
  5110. menuActionCmd3[menuActionRow] = super.mouseY;
  5111. menuActionRow++;
  5112. }
  5113. int j = -1;
  5114. for(int k = 0; k < Model.objectsRendered; k++) {
  5115. int l = Model.objectsInCurrentRegion[k];
  5116. int i1 = l & 0x7f;
  5117. int j1 = l >> 7 & 0x7f;
  5118. int k1 = l >> 29 & 3;
  5119. int l1 = l >> 14 & 0x7fff;
  5120. if(l == j)
  5121. continue;
  5122. j = l;
  5123. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5124. l1 = Model.renderedObjectId[k];
  5125. ObjectDef class46 = ObjectDef.forID(l1);
  5126. if(class46.childrenIDs != null)
  5127. class46 = class46.method580();
  5128. if(class46 == null || class46.name == null || class46.name.equals("null"))
  5129. continue;
  5130. if(itemSelected == 1) {
  5131. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  5132. menuActionIds[menuActionRow] = 62;
  5133. menuActionCmd1[menuActionRow] = l;
  5134. menuActionCmd2[menuActionRow] = i1;
  5135. menuActionCmd3[menuActionRow] = j1;
  5136. menuActionCmd4[menuActionRow] = l1;
  5137. menuActionRow++;
  5138. } else if(spellSelected == 1) {
  5139. if((spellUsableOn & 4) == 4) {
  5140. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5141. menuActionIds[menuActionRow] = 956;
  5142. menuActionCmd1[menuActionRow] = l;
  5143. menuActionCmd2[menuActionRow] = i1;
  5144. menuActionCmd3[menuActionRow] = j1;
  5145. menuActionCmd4[menuActionRow] = l1;
  5146. menuActionRow++;
  5147. }
  5148. } else {
  5149. if(class46.actions != null) {
  5150. for(int i2 = 4; i2 >= 0; i2--)
  5151. if(class46.actions[i2] != null) {
  5152. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5153. if(i2 == 0)
  5154. menuActionIds[menuActionRow] = 502;
  5155. if(i2 == 1)
  5156. menuActionIds[menuActionRow] = 900;
  5157. if(i2 == 2)
  5158. menuActionIds[menuActionRow] = 113;
  5159. if(i2 == 3)
  5160. menuActionIds[menuActionRow] = 872;
  5161. if(i2 == 4)
  5162. menuActionIds[menuActionRow] = 1062;
  5163. menuActionCmd1[menuActionRow] = l;
  5164. menuActionCmd2[menuActionRow] = i1;
  5165. menuActionCmd3[menuActionRow] = j1;
  5166. menuActionCmd4[menuActionRow] = l1;
  5167. menuActionRow++;
  5168. }
  5169. }
  5170. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " (Anim: "+class46.anInt781+") (ID: "+ l1 + " / Models: " + class46.anIntArray773[0] +") ";
  5171. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  5172. 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@)";
  5173. } else {
  5174. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5175. }
  5176. menuActionIds[menuActionRow] = 1226;
  5177. menuActionCmd1[menuActionRow] = class46.type << 14;
  5178. menuActionCmd2[menuActionRow] = i1;
  5179. menuActionCmd3[menuActionRow] = j1;
  5180. menuActionCmd4[menuActionRow] = l1;
  5181. menuActionRow++;
  5182. }
  5183. }
  5184. if(k1 == 1)
  5185. {
  5186. NPC npc = npcArray[l1];
  5187. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  5188. {
  5189. for(int j2 = 0; j2 < npcCount; j2++)
  5190. {
  5191. NPC npc2 = npcArray[npcIndices[j2]];
  5192. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5193. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5194. }
  5195.  
  5196. for(int l2 = 0; l2 < playerCount; l2++)
  5197. {
  5198. Player player = playerArray[playerIndices[l2]];
  5199. if(player != null && player.x == npc.x && player.y == npc.y)
  5200. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5201. }
  5202.  
  5203. }
  5204. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5205. }
  5206. if(k1 == 0)
  5207. {
  5208. Player player = playerArray[l1];
  5209. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  5210. {
  5211. for(int k2 = 0; k2 < npcCount; k2++)
  5212. {
  5213. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5214. 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)
  5215. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5216. }
  5217.  
  5218. for(int i3 = 0; i3 < playerCount; i3++)
  5219. {
  5220. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5221. 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)
  5222. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5223. }
  5224.  
  5225. }
  5226. buildAtPlayerMenu(i1, l1, player, j1);
  5227. }
  5228. if(k1 == 3)
  5229. {
  5230. NodeList class19 = groundArray[plane][i1][j1];
  5231. if(class19 != null)
  5232. {
  5233. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5234. {
  5235. ItemDef itemDef = ItemDef.forID(item.ID);
  5236. if(itemSelected == 1)
  5237. {
  5238. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5239. menuActionIds[menuActionRow] = 511;
  5240. menuActionCmd1[menuActionRow] = item.ID;
  5241. menuActionCmd2[menuActionRow] = i1;
  5242. menuActionCmd3[menuActionRow] = j1;
  5243. menuActionRow++;
  5244. } else
  5245. if(spellSelected == 1)
  5246. {
  5247. if((spellUsableOn & 1) == 1)
  5248. {
  5249. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5250. menuActionIds[menuActionRow] = 94;
  5251. menuActionCmd1[menuActionRow] = item.ID;
  5252. menuActionCmd2[menuActionRow] = i1;
  5253. menuActionCmd3[menuActionRow] = j1;
  5254. menuActionRow++;
  5255. }
  5256. } else
  5257. {
  5258. for(int j3 = 4; j3 >= 0; j3--)
  5259. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5260. {
  5261. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5262. if(j3 == 0)
  5263. menuActionIds[menuActionRow] = 652;
  5264. if(j3 == 1)
  5265. menuActionIds[menuActionRow] = 567;
  5266. if(j3 == 2)
  5267. menuActionIds[menuActionRow] = 234;
  5268. if(j3 == 3)
  5269. menuActionIds[menuActionRow] = 244;
  5270. if(j3 == 4)
  5271. menuActionIds[menuActionRow] = 213;
  5272. menuActionCmd1[menuActionRow] = item.ID;
  5273. menuActionCmd2[menuActionRow] = i1;
  5274. menuActionCmd3[menuActionRow] = j1;
  5275. menuActionRow++;
  5276. } else
  5277. if(j3 == 2)
  5278. {
  5279. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5280. menuActionIds[menuActionRow] = 234;
  5281. menuActionCmd1[menuActionRow] = item.ID;
  5282. menuActionCmd2[menuActionRow] = i1;
  5283. menuActionCmd3[menuActionRow] = j1;
  5284. menuActionRow++;
  5285. }
  5286. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  5287. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5288. } else {
  5289. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5290. }
  5291. menuActionIds[menuActionRow] = 1448;
  5292. menuActionCmd1[menuActionRow] = item.ID;
  5293. menuActionCmd2[menuActionRow] = i1;
  5294. menuActionCmd3[menuActionRow] = j1;
  5295. menuActionRow++;
  5296. }
  5297. }
  5298.  
  5299. }
  5300. }
  5301. }
  5302. }
  5303.  
  5304. public void cleanUpForQuit() {
  5305. SignLink.reporterror = false;
  5306. try {
  5307. if (socketStream != null)
  5308. socketStream.close();
  5309. } catch (Exception _ex) {
  5310. }
  5311. HPBarFull = null;
  5312. HPBarEmpty = null;
  5313. socketStream = null;
  5314. stopMidi();
  5315. if (mouseDetection != null)
  5316. mouseDetection.running = false;
  5317. mapIcon = null;
  5318. mouseDetection = null;
  5319. onDemandFetcher.disable();
  5320. onDemandFetcher = null;
  5321. aStream_834 = null;
  5322. stream = null;
  5323. aStream_847 = null;
  5324. inStream = null;
  5325. anIntArray1234 = null;
  5326. aByteArrayArray1183 = null;
  5327. aByteArrayArray1247 = null;
  5328. anIntArray1235 = null;
  5329. anIntArray1236 = null;
  5330. intGroundArray = null;
  5331. byteGroundArray = null;
  5332. worldController = null;
  5333. aClass11Array1230 = null;
  5334. anIntArrayArray901 = null;
  5335. anIntArrayArray825 = null;
  5336.  
  5337. chatArea = null;
  5338. chatButtons = null;
  5339. tabArea = null;
  5340. mapArea = null;
  5341. ORBS = null;
  5342. worldMapIcon = null;
  5343. logIconH = null;
  5344. logIconC = null;
  5345.  
  5346. bigX = null;
  5347. bigY = null;
  5348. aByteArray912 = null;
  5349. aRSImageProducer_1163 = null;
  5350. mapEdgeIP = null;
  5351. leftFrame = null;
  5352. topFrame = null;
  5353. rightFrame = null;
  5354. aRSImageProducer_1164 = null;
  5355. aRSImageProducer_1165 = null;
  5356. aRSImageProducer_1166 = null;
  5357. aRSImageProducer_1123 = null;
  5358. aRSImageProducer_1124 = null;
  5359. aRSImageProducer_1125 = null;
  5360. /* Null pointers for custom sprites */
  5361. multiOverlay = null;
  5362. chatArea = null;
  5363. chatButtons = null;
  5364. tabArea = null;
  5365. /**/
  5366. sideIcons = null;
  5367. redStones = null;
  5368. compass = null;
  5369. hitMarks = null;
  5370. headIcons = null;
  5371. skullIcons = null;
  5372. headIconsHint = null;
  5373. crosses = null;
  5374. mapDotItem = null;
  5375. mapDotNPC = null;
  5376. mapDotPlayer = null;
  5377. mapDotFriend = null;
  5378. mapDotTeam = null;
  5379. mapScenes = null;
  5380. mapFunctions = null;
  5381. anIntArrayArray929 = null;
  5382. playerArray = null;
  5383. playerIndices = null;
  5384. anIntArray894 = null;
  5385. aStreamArray895s = null;
  5386. anIntArray840 = null;
  5387. npcArray = null;
  5388. npcIndices = null;
  5389. groundArray = null;
  5390. aClass19_1179 = null;
  5391. aClass19_1013 = null;
  5392. aClass19_1056 = null;
  5393. menuActionCmd2 = null;
  5394. menuActionCmd3 = null;
  5395. menuActionCmd4 = null;
  5396. menuActionIds = null;
  5397. menuActionCmd1 = null;
  5398. menuActionName = null;
  5399. variousSettings = null;
  5400. anIntArray1072 = null;
  5401. anIntArray1073 = null;
  5402. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5403. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5404. friendsList = null;
  5405. friendsListAsLongs = null;
  5406. friendsNodeIDs = null;
  5407. aRSImageProducer_1110 = null;
  5408. aRSImageProducer_1111 = null;
  5409. aRSImageProducer_1107 = null;
  5410. aRSImageProducer_1108 = null;
  5411. aRSImageProducer_1109 = null;
  5412. aRSImageProducer_1112 = null;
  5413. aRSImageProducer_1113 = null;
  5414. aRSImageProducer_1114 = null;
  5415. aRSImageProducer_1115 = null;
  5416. nullLoader();
  5417. ObjectDef.nullLoader();
  5418. EntityDef.nullLoader();
  5419. ItemDef.nullLoader();
  5420. Flo.cache = null;
  5421. IDK.cache = null;
  5422. RSInterface.interfaceCache = null;
  5423. Animation.anims = null;
  5424. SpotAnim.cache = null;
  5425. SpotAnim.aMRUNodes_415 = null;
  5426. Varp.cache = null;
  5427. super.fullGameScreen = null;
  5428. Player.mruNodes = null;
  5429. Rasterizer.nullLoader();
  5430. WorldController.nullLoader();
  5431. Model.nullLoader();
  5432. Class36.nullLoader();
  5433. System.gc();
  5434. }
  5435.  
  5436. public void printDebug() {
  5437. System.out.println("============");
  5438. System.out.println("flame-cycle:" + anInt1208);
  5439. if (onDemandFetcher != null)
  5440. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5441. System.out.println("loop-cycle:" + loopCycle);
  5442. System.out.println("draw-cycle:" + anInt1061);
  5443. System.out.println("ptype:" + pktType);
  5444. System.out.println("psize:" + pktSize);
  5445. if (socketStream != null)
  5446. socketStream.printDebug();
  5447. super.shouldDebug = true;
  5448. }
  5449.  
  5450. Component getGameComponent() {
  5451. if (SignLink.mainapp != null)
  5452. return SignLink.mainapp;
  5453. if (super.gameFrame != null)
  5454. return super.gameFrame;
  5455. else
  5456. return this;
  5457. }
  5458.  
  5459. public void pmTabToReply() {
  5460. String name = null;
  5461. for (int k = 0; k < 100; k++) {
  5462. if (chatMessages[k] == null) {
  5463. continue;
  5464. }
  5465. int l = chatTypes[k];
  5466. if (l == 3 || l == 7) {
  5467. name = chatNames[k];
  5468. break;
  5469. }
  5470. }
  5471.  
  5472. if (name == null) {
  5473. pushMessage("You haven't received any messages to which you can reply.", 0, "");
  5474. return;
  5475. }
  5476.  
  5477. if (name.startsWith("@cr")) {
  5478. name = name.substring(5);
  5479. }
  5480.  
  5481. long nameAsLong = TextClass.longForName(name.trim());
  5482. int k3 = -1;
  5483. for (int i4 = 0; i4 < friendsCount; i4++) {
  5484. if (friendsListAsLongs[i4] != nameAsLong)
  5485. continue;
  5486. k3 = i4;
  5487. break;
  5488. }
  5489.  
  5490. if (k3 != -1) {
  5491. if (friendsNodeIDs[k3] > 0) {
  5492. inputTaken = true;
  5493. inputDialogState = 0;
  5494. messagePromptRaised = true;
  5495. promptInput = "";
  5496. friendsListAction = 3;
  5497. aLong953 = friendsListAsLongs[k3];
  5498. aString1121 = "Enter message to send to " + friendsList[k3];
  5499. } else {
  5500. pushMessage("That player is currently offline.", 0, "");
  5501. }
  5502. }
  5503. }
  5504.  
  5505. public class ObjectSizes {
  5506. int objectId, sizeX, sizeY;
  5507.  
  5508. public ObjectSizes() {
  5509. }
  5510.  
  5511. public ObjectSizes(int objectId, int sizeX, int sizeY) {
  5512. this.objectId = objectId;
  5513. this.sizeX = sizeX;
  5514. this.sizeY = sizeY;
  5515. }
  5516.  
  5517. public int getObjectId() {
  5518. return objectId;
  5519. }
  5520.  
  5521. public void setObjectId(int objectId) {
  5522. this.objectId = objectId;
  5523. }
  5524.  
  5525. public int getSizeX() {
  5526. return sizeX;
  5527. }
  5528.  
  5529. public void setSizeX(int sizeX) {
  5530. this.sizeX = sizeX;
  5531. }
  5532.  
  5533. public int getSizeY() {
  5534. return sizeY;
  5535. }
  5536.  
  5537. public void setSizeY(int sizeY) {
  5538. this.sizeY = sizeY;
  5539. }
  5540. }
  5541.  
  5542. public void method73() {
  5543. do {
  5544. int j = readChar(-796);
  5545. if(j == -1)
  5546. break;
  5547. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5548. if(j == 8 && reportAbuseInput.length() > 0)
  5549. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5550. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5551. reportAbuseInput += (char)j;
  5552. } else if(messagePromptRaised) {
  5553. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5554. promptInput += (char)j;
  5555. inputTaken = true;
  5556. }
  5557. if(j == 8 && promptInput.length() > 0) {
  5558. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5559. inputTaken = true;
  5560. }
  5561. if(j == 13 || j == 10) {
  5562. messagePromptRaised = false;
  5563. inputTaken = true;
  5564. if(friendsListAction == 1) {
  5565. long l = TextClass.longForName(promptInput);
  5566. addFriend(l);
  5567. }
  5568. if(friendsListAction == 2 && friendsCount > 0) {
  5569. long l1 = TextClass.longForName(promptInput);
  5570. delFriend(l1);
  5571. }
  5572. if(friendsListAction == 3 && promptInput.length() > 0) {
  5573. stream.createFrame(126);
  5574. stream.writeWordBigEndian(0);
  5575. int k = stream.currentOffset;
  5576. stream.writeQWord(aLong953);
  5577. TextInput.method526(promptInput, stream);
  5578. stream.writeBytes(stream.currentOffset - k);
  5579. promptInput = TextInput.processText(promptInput);
  5580. //promptInput = Censor.doCensor(promptInput);
  5581. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5582. if(publicChatMode == 2) {
  5583. publicChatMode = 1;
  5584. stream.createFrame(95);
  5585. stream.writeWordBigEndian(publicChatMode);
  5586. stream.writeWordBigEndian(publicChatMode);
  5587. stream.writeWordBigEndian(tradeMode);
  5588. }
  5589. }
  5590. if(friendsListAction == 4 && ignoreCount < 100) {
  5591. long l2 = TextClass.longForName(promptInput);
  5592. addIgnore(l2);
  5593. }
  5594. if(friendsListAction == 5 && ignoreCount > 0) {
  5595. long l3 = TextClass.longForName(promptInput);
  5596. delIgnore(l3);
  5597. }
  5598. if(friendsListAction == 6) {
  5599. long l3 = TextClass.longForName(promptInput);
  5600. chatJoin(l3);
  5601. }
  5602. }
  5603. } else if (inputDialogState == 1) {
  5604. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5605. amountOrNameInput += (char) j;
  5606. inputTaken = true;
  5607. }
  5608. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  5609. amountOrNameInput += (char) j;
  5610. inputTaken = true;
  5611. }
  5612. if (j == 8 && amountOrNameInput.length() > 0) {
  5613. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5614. inputTaken = true;
  5615. }
  5616. if (j == 13 || j == 10) {
  5617. if (amountOrNameInput.length() > 0) {
  5618. if (amountOrNameInput.toLowerCase().contains("k")) {
  5619. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  5620. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  5621. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  5622. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  5623. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  5624. }
  5625.  
  5626. long amount = Long.parseLong(amountOrNameInput);
  5627.  
  5628. if (amount > Integer.MAX_VALUE) {
  5629. amount = Integer.MAX_VALUE;
  5630. }
  5631.  
  5632. stream.createFrame(208);
  5633. stream.writeDWord((int) amount);
  5634. }
  5635. inputDialogState = 0;
  5636. inputTaken = true;
  5637. }
  5638. } else if(inputDialogState == 2) {
  5639. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5640. amountOrNameInput += (char)j;
  5641. inputTaken = true;
  5642. }
  5643. if(j == 8 && amountOrNameInput.length() > 0) {
  5644. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5645. inputTaken = true;
  5646. }
  5647. if(j == 13 || j == 10) {
  5648. if(amountOrNameInput.length() > 0) {
  5649. stream.createFrame(60);
  5650. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5651. }
  5652. inputDialogState = 0;
  5653. inputTaken = true;
  5654. }
  5655. } else if(backDialogID == -1) {
  5656. if(j >= 32 && j <= 122 && inputString.length() < 100) {
  5657. inputString += (char) j;
  5658. inputString = inputString.replaceAll("<[^>]*>", "").replaceAll("@[^@]*@", "").replaceAll(":tradereq:", "").replaceAll(":duelreq:", "");
  5659. inputTaken = true;
  5660. }
  5661. if(j == 8 && inputString.length() > 0) {
  5662. inputString = inputString.substring(0, inputString.length() - 1);
  5663. inputTaken = true;
  5664. }
  5665. if (j == 9)
  5666. pmTabToReply();
  5667. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5668. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  5669. if (inputString.startsWith("//setspecto")) {
  5670. int amt = Integer.parseInt(inputString
  5671. .substring(12));
  5672. anIntArray1045[300] = amt;
  5673. if (variousSettings[300] != amt) {
  5674. variousSettings[300] = amt;
  5675. method33(300);
  5676. needDrawTabArea = true;
  5677. if (dialogID != -1)
  5678. inputTaken = true;
  5679. }
  5680. }
  5681. if (inputString.equals("::clientdrop"))
  5682. dropClient();
  5683. /*if (inputString.startsWith("full")) {
  5684. try {
  5685. String[] args = inputString.split(" ");
  5686. int id1 = Integer.parseInt(args[1]);
  5687. int id2 = Integer.parseInt(args[2]);
  5688. fullscreenInterfaceID = id1;
  5689. openInterfaceID = id2;
  5690. pushMessage("Opened Interface", 0, "");
  5691. } catch (Exception e) {
  5692. pushMessage("Interface Failed to load", 0, "");
  5693. }
  5694. }*/
  5695. if (inputString.equals("::lag"))
  5696. printDebug();
  5697. /*if (inputString.equals("::prefetchmusic")) {
  5698. for (int j1 = 0; j1 < onDemandFetcher
  5699. .getVersionCount(2); j1++)
  5700. onDemandFetcher.method563((byte) 1, 2, j1);
  5701.  
  5702. }
  5703. if (inputString.equals("::maps"))
  5704. addMaps();
  5705. if (inputString.equals("::models"))
  5706. addModels();*/
  5707. if (inputString.equals("::fpson"))
  5708. fpsOn = true;
  5709. if (inputString.equals("::fpsoff"))
  5710. fpsOn = false;
  5711. if (inputString.equals("::dataon"))
  5712. clientData = true;
  5713. if (inputString.equals("::dataoff"))
  5714. clientData = false;
  5715. if (inputString.equals("::noclip")) {
  5716. for (int k1 = 0; k1 < 4; k1++) {
  5717. for (int i2 = 1; i2 < 103; i2++) {
  5718. for (int k2 = 1; k2 < 103; k2++)
  5719. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5720. }
  5721. }
  5722. }
  5723. /*if (inputString.equals("dump")) {
  5724. List<ObjectDef> list = new ArrayList<ObjectDef>();
  5725. for (int i = 0; i < ObjectDef.totalObjects; i++) {
  5726. ObjectDef object = ObjectDef.forID(i);
  5727. System.out.println(new Gson().toJson(object));
  5728. list.add(object.type, object);
  5729. }
  5730.  
  5731. // System.out.println(new Gson().toJson(list));
  5732.  
  5733. PrintWriter writer;
  5734. try {
  5735. writer = new PrintWriter("./objects.json", "UTF-8");
  5736. writer.println(new Gson().toJson(list));
  5737. writer.close();
  5738. } catch (Exception e) {
  5739. e.printStackTrace();
  5740. }
  5741. }*/
  5742. if (inputString.equals("::sprites")) {
  5743. if (Sprite.sprites.size() == 0) {
  5744. Sprite.walk(SignLink.findcachedir() + "Sprites");
  5745. }
  5746.  
  5747. for (String sprite : Sprite.spritesInUse) {
  5748. if (!Sprite.sprites.contains(sprite)) {
  5749. /*File file = new File(sprite);
  5750. file.delete();*/
  5751. System.out.println(sprite);
  5752. }
  5753. }
  5754.  
  5755. System.out.println(Sprite.sprites.size() + "-" + Sprite.spritesInUse.size());
  5756. }
  5757. if (inputString.equals("::rsint")) {
  5758. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  5759. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  5760. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  5761. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  5762. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  5763. };
  5764. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  5765. }
  5766. }
  5767.  
  5768. /*if (inputString.equals("add model")) {
  5769. try {
  5770. int ModelIndex = Integer.parseInt(JOptionPane
  5771. .showInputDialog(this, "Enter model ID",
  5772. "Model", 3));
  5773. byte[] abyte0 = getModel(ModelIndex);
  5774. if (abyte0 != null && abyte0.length > 0) {
  5775. decompressors[1].method234(abyte0.length,
  5776. abyte0, ModelIndex);
  5777. pushMessage("Model: [" + ModelIndex
  5778. + "] added successfully!", 0, "");
  5779. } else {
  5780. pushMessage("Unable to find the model. "
  5781. + ModelIndex, 0, "");
  5782. }
  5783. } catch (Exception e) {
  5784. pushMessage("Syntax - ::add model <path>", 0, "");
  5785. }
  5786. }
  5787. if (inputString.equalsIgnoreCase("hd")) {
  5788. disableUnderlayTexture = !disableUnderlayTexture;
  5789. disableOverlayTexture = !disableOverlayTexture;
  5790. }*/
  5791. if(inputString.startsWith("/"))
  5792. inputString = "::" + inputString;
  5793. if (inputString.startsWith("::")) {
  5794. stream.createFrame(103);
  5795. stream.writeWordBigEndian(inputString.length() - 1);
  5796. stream.writeString(inputString.substring(2));
  5797. } else {
  5798. String s = inputString.toLowerCase();
  5799. int j2 = 0;
  5800. if (s.startsWith("yellow:")) {
  5801. j2 = 0;
  5802. inputString = inputString.substring(7);
  5803. } else if (s.startsWith("red:")) {
  5804. j2 = 1;
  5805. inputString = inputString.substring(4);
  5806. } else if (s.startsWith("green:")) {
  5807. j2 = 2;
  5808. inputString = inputString.substring(6);
  5809. } else if (s.startsWith("cyan:")) {
  5810. j2 = 3;
  5811. inputString = inputString.substring(5);
  5812. } else if (s.startsWith("purple:")) {
  5813. j2 = 4;
  5814. inputString = inputString.substring(7);
  5815. } else if (s.startsWith("white:")) {
  5816. j2 = 5;
  5817. inputString = inputString.substring(6);
  5818. } else if (s.startsWith("flash1:")) {
  5819. j2 = 6;
  5820. inputString = inputString.substring(7);
  5821. } else if (s.startsWith("flash2:")) {
  5822. j2 = 7;
  5823. inputString = inputString.substring(7);
  5824. } else if (s.startsWith("flash3:")) {
  5825. j2 = 8;
  5826. inputString = inputString.substring(7);
  5827. } else if (s.startsWith("glow1:")) {
  5828. j2 = 9;
  5829. inputString = inputString.substring(6);
  5830. } else if (s.startsWith("glow2:")) {
  5831. j2 = 10;
  5832. inputString = inputString.substring(6);
  5833. } else if (s.startsWith("glow3:")) {
  5834. j2 = 11;
  5835. inputString = inputString.substring(6);
  5836. }
  5837. s = inputString.toLowerCase();
  5838. int i3 = 0;
  5839. if (s.startsWith("wave:")) {
  5840. i3 = 1;
  5841. inputString = inputString.substring(5);
  5842. } else if (s.startsWith("wave2:")) {
  5843. i3 = 2;
  5844. inputString = inputString.substring(6);
  5845. } else if (s.startsWith("shake:")) {
  5846. i3 = 3;
  5847. inputString = inputString.substring(6);
  5848. } else if (s.startsWith("scroll:")) {
  5849. i3 = 4;
  5850. inputString = inputString.substring(7);
  5851. } else if (s.startsWith("slide:")) {
  5852. i3 = 5;
  5853. inputString = inputString.substring(6);
  5854. }
  5855. stream.createFrame(4);
  5856. stream.writeWordBigEndian(0);
  5857. int j3 = stream.currentOffset;
  5858. stream.method425(i3);
  5859. stream.method425(j2);
  5860. aStream_834.currentOffset = 0;
  5861. TextInput.method526(inputString, aStream_834);
  5862. stream.method441(0, aStream_834.buffer,
  5863. aStream_834.currentOffset);
  5864. stream.writeBytes(stream.currentOffset - j3);
  5865. inputString = TextInput.processText(inputString);
  5866. // inputString = Censor.doCensor(inputString);
  5867. myPlayer.textSpoken = inputString;
  5868. myPlayer.anInt1513 = j2;
  5869. myPlayer.anInt1531 = i3;
  5870. myPlayer.textCycle = 150;
  5871. if (myPrivilege == 1)
  5872. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5873. else if (myPrivilege == 2)
  5874. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5875. else if (myPrivilege == 3)
  5876. pushMessage(myPlayer.textSpoken, 2, "@cr3@" + myPlayer.name);
  5877. else if (myPrivilege == 4)
  5878. pushMessage(myPlayer.textSpoken, 2, "@cr4@" + myPlayer.name);
  5879. else if (myPrivilege == 5)
  5880. pushMessage(myPlayer.textSpoken, 2, "@cr5@" + myPlayer.name);
  5881. else if (myPrivilege == 6)
  5882. pushMessage(myPlayer.textSpoken, 2, "@cr6@" + myPlayer.name);
  5883. else if (myPrivilege == 7)
  5884. pushMessage(myPlayer.textSpoken, 2, "@cr7@" + myPlayer.name);
  5885. else if (myPrivilege == 8)
  5886. pushMessage(myPlayer.textSpoken, 2, "@cr8@" + myPlayer.name);
  5887. else if (myPrivilege == 9)
  5888. pushMessage(myPlayer.textSpoken, 2, "@cr9@" + myPlayer.name);
  5889. else if (myPrivilege == 10)
  5890. pushMessage(myPlayer.textSpoken, 2, "@cr10@" + myPlayer.name);
  5891. else if (myPrivilege == 11)
  5892. pushMessage(myPlayer.textSpoken, 2, "@cr11@" + myPlayer.name);
  5893. else if (myPrivilege == 12)
  5894. pushMessage(myPlayer.textSpoken, 2, "@cr12@" + myPlayer.name);
  5895. else if (myPrivilege == 13)
  5896. pushMessage(myPlayer.textSpoken, 2, "@cr13@" + myPlayer.name);
  5897. else if (myPrivilege == 14)
  5898. pushMessage(myPlayer.textSpoken, 2, "@cr14@" + myPlayer.name);
  5899. else if (myPrivilege == 15)
  5900. pushMessage(myPlayer.textSpoken, 2, "@cr15@" + myPlayer.name);
  5901. else if (myPrivilege == 16)
  5902. pushMessage(myPlayer.textSpoken, 2, "@cr16@" + myPlayer.name);
  5903. else if (myPrivilege == 17)
  5904. pushMessage(myPlayer.textSpoken, 2, "@cr17@" + myPlayer.name);
  5905. else if (myPrivilege == 18)
  5906. pushMessage(myPlayer.textSpoken, 2, "@cr18@" + myPlayer.name);
  5907. else if (myPrivilege == 19)
  5908. pushMessage(myPlayer.textSpoken, 2, "@cr19@" + myPlayer.name);
  5909. else if (myPrivilege == 20)
  5910. pushMessage(myPlayer.textSpoken, 2, "@cr20@" + myPlayer.name);
  5911. else
  5912. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5913. if (publicChatMode == 2) {
  5914. publicChatMode = 3;
  5915. aBoolean1233 = true;
  5916. stream.createFrame(95);
  5917. stream.writeWordBigEndian(publicChatMode);
  5918. stream.writeWordBigEndian(publicChatMode);
  5919. stream.writeWordBigEndian(tradeMode);
  5920. }
  5921. }
  5922. inputString = "";
  5923. inputTaken = true;
  5924. }
  5925. }
  5926. } while (true);
  5927. }
  5928.  
  5929. @SuppressWarnings("unused")
  5930. public void buildPublicChat(int j) {
  5931. int l = 0;
  5932. for (int i1 = 0; i1 < 500; i1++) {
  5933. if (chatMessages[i1] == null)
  5934. continue;
  5935. if (chatTypeView != 1)
  5936. continue;
  5937. int j1 = chatTypes[i1];
  5938. String s = chatNames[i1];
  5939. String ct = chatMessages[i1];
  5940. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5941. if (k1 < -23)
  5942. break;
  5943. if(s != null && s.startsWith("@cr1@"))
  5944. s = s.substring(5);
  5945. if(s != null && s.startsWith("@cr2@"))
  5946. s = s.substring(5);
  5947. if(s != null && s.startsWith("@cr3@"))
  5948. s = s.substring(5);
  5949. if(s != null && s.startsWith("@cr4@"))
  5950. s = s.substring(5);
  5951. if(s != null && s.startsWith("@cr5@"))
  5952. s = s.substring(5);
  5953. if(s != null && s.startsWith("@cr6@"))
  5954. s = s.substring(5);
  5955. if(s != null && s.startsWith("@cr7@"))
  5956. s = s.substring(5);
  5957. if(s != null && s.startsWith("@cr8@"))
  5958. s = s.substring(5);
  5959. if(s != null && s.startsWith("@cr9@"))
  5960. s = s.substring(5);
  5961. if(s != null && s.startsWith("@cr10@"))
  5962. s = s.substring(6);
  5963. if(s != null && s.startsWith("@cr11@"))
  5964. s = s.substring(6);
  5965. if(s != null && s.startsWith("@cr12@"))
  5966. s = s.substring(6);
  5967. if(s != null && s.startsWith("@cr13@"))
  5968. s = s.substring(6);
  5969. if(s != null && s.startsWith("@cr14@"))
  5970. s = s.substring(6);
  5971. if(s != null && s.startsWith("@cr15@"))
  5972. s = s.substring(6);
  5973. if(s != null && s.startsWith("@cr16@"))
  5974. s = s.substring(6);
  5975. if(s != null && s.startsWith("@cr17@"))
  5976. s = s.substring(6);
  5977. if(s != null && s.startsWith("@cr18@"))
  5978. s = s.substring(6);
  5979. if(s != null && s.startsWith("@cr19@"))
  5980. s = s.substring(6);
  5981. if(s != null && s.startsWith("@cr20@"))
  5982. s = s.substring(6);
  5983. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5984. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5985. if (myPrivilege >= 1) {
  5986. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5987. menuActionIds[menuActionRow] = 606;
  5988. menuActionRow++;
  5989. }
  5990. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5991. menuActionIds[menuActionRow] = 42;
  5992. menuActionRow++;
  5993. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5994. menuActionIds[menuActionRow] = 337;
  5995. menuActionRow++;
  5996. }
  5997. l++;
  5998. }
  5999. }
  6000. }
  6001.  
  6002. @SuppressWarnings("unused")
  6003. public void buildFriendChat(int j) {
  6004. int l = 0;
  6005. for (int i1 = 0; i1 < 500; i1++) {
  6006. if (chatMessages[i1] == null)
  6007. continue;
  6008. if (chatTypeView != 2)
  6009. continue;
  6010. int j1 = chatTypes[i1];
  6011. String s = chatNames[i1];
  6012. String ct = chatMessages[i1];
  6013. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6014. if (k1 < -23)
  6015. break;
  6016. if(s != null && s.startsWith("@cr1@"))
  6017. s = s.substring(5);
  6018. if(s != null && s.startsWith("@cr2@"))
  6019. s = s.substring(5);
  6020. if(s != null && s.startsWith("@cr3@"))
  6021. s = s.substring(5);
  6022. if(s != null && s.startsWith("@cr4@"))
  6023. s = s.substring(5);
  6024. if(s != null && s.startsWith("@cr5@"))
  6025. s = s.substring(5);
  6026. if(s != null && s.startsWith("@cr6@"))
  6027. s = s.substring(5);
  6028. if(s != null && s.startsWith("@cr7@"))
  6029. s = s.substring(5);
  6030. if(s != null && s.startsWith("@cr8@"))
  6031. s = s.substring(5);
  6032. if(s != null && s.startsWith("@cr9@"))
  6033. s = s.substring(5);
  6034. if(s != null && s.startsWith("@cr10@"))
  6035. s = s.substring(6);
  6036. if(s != null && s.startsWith("@cr11@"))
  6037. s = s.substring(6);
  6038. if(s != null && s.startsWith("@cr12@"))
  6039. s = s.substring(6);
  6040. if(s != null && s.startsWith("@cr13@"))
  6041. s = s.substring(6);
  6042. if(s != null && s.startsWith("@cr14@"))
  6043. s = s.substring(6);
  6044. if(s != null && s.startsWith("@cr15@"))
  6045. s = s.substring(6);
  6046. if(s != null && s.startsWith("@cr16@"))
  6047. s = s.substring(6);
  6048. if(s != null && s.startsWith("@cr17@"))
  6049. s = s.substring(6);
  6050. if(s != null && s.startsWith("@cr18@"))
  6051. s = s.substring(6);
  6052. if(s != null && s.startsWith("@cr19@"))
  6053. s = s.substring(6);
  6054. if(s != null && s.startsWith("@cr20@"))
  6055. s = s.substring(6);
  6056. if ((j1 == 5 || j1 == 6)
  6057. && (splitpublicChat == 0 || chatTypeView == 2)
  6058. && (j1 == 6 || publicChatMode == 0 || publicChatMode == 1
  6059. && isFriendOrSelf(s)))
  6060. l++;
  6061. if ((j1 == 3 || j1 == 7)
  6062. && (splitpublicChat == 0 || chatTypeView == 2)
  6063. && (j1 == 7 || publicChatMode == 0 || publicChatMode == 1
  6064. && isFriendOrSelf(s))) {
  6065. if (j > k1 - 14 && j <= k1) {
  6066. if (myPrivilege >= 1) {
  6067. menuActionName[menuActionRow] = "Report abuse @whi@"
  6068. + s;
  6069. menuActionIds[menuActionRow] = 606;
  6070. menuActionRow++;
  6071. }
  6072. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6073. menuActionIds[menuActionRow] = 42;
  6074. menuActionRow++;
  6075. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6076. menuActionIds[menuActionRow] = 337;
  6077. menuActionRow++;
  6078. }
  6079. l++;
  6080. }
  6081. }
  6082. }
  6083.  
  6084. public void buildDuelorTrade(int j) {
  6085. int l = 0;
  6086. for (int i1 = 0; i1 < 500; i1++) {
  6087. if (chatMessages[i1] == null)
  6088. continue;
  6089. if (chatTypeView != 3 && chatTypeView != 4)
  6090. continue;
  6091. int j1 = chatTypes[i1];
  6092. String s = chatNames[i1];
  6093. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6094. if (k1 < -23)
  6095. break;
  6096. if(s != null && s.startsWith("@cr1@"))
  6097. s = s.substring(5);
  6098. if(s != null && s.startsWith("@cr2@"))
  6099. s = s.substring(5);
  6100. if(s != null && s.startsWith("@cr3@"))
  6101. s = s.substring(5);
  6102. if(s != null && s.startsWith("@cr4@"))
  6103. s = s.substring(5);
  6104. if(s != null && s.startsWith("@cr5@"))
  6105. s = s.substring(5);
  6106. if(s != null && s.startsWith("@cr6@"))
  6107. s = s.substring(5);
  6108. if(s != null && s.startsWith("@cr7@"))
  6109. s = s.substring(5);
  6110. if(s != null && s.startsWith("@cr8@"))
  6111. s = s.substring(5);
  6112. if(s != null && s.startsWith("@cr9@"))
  6113. s = s.substring(5);
  6114. if(s != null && s.startsWith("@cr10@"))
  6115. s = s.substring(6);
  6116. if(s != null && s.startsWith("@cr11@"))
  6117. s = s.substring(6);
  6118. if(s != null && s.startsWith("@cr12@"))
  6119. s = s.substring(6);
  6120. if(s != null && s.startsWith("@cr13@"))
  6121. s = s.substring(6);
  6122. if(s != null && s.startsWith("@cr14@"))
  6123. s = s.substring(6);
  6124. if(s != null && s.startsWith("@cr15@"))
  6125. s = s.substring(6);
  6126. if(s != null && s.startsWith("@cr16@"))
  6127. s = s.substring(6);
  6128. if(s != null && s.startsWith("@cr17@"))
  6129. s = s.substring(6);
  6130. if(s != null && s.startsWith("@cr18@"))
  6131. s = s.substring(6);
  6132. if(s != null && s.startsWith("@cr19@"))
  6133. s = s.substring(6);
  6134. if(s != null && s.startsWith("@cr20@"))
  6135. s = s.substring(6);
  6136. if (chatTypeView == 3 && j1 == 4
  6137. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6138. if (j > k1 - 14 && j <= k1) {
  6139. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6140. menuActionIds[menuActionRow] = 484;
  6141. menuActionRow++;
  6142. }
  6143. l++;
  6144. }
  6145. if (chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6146. if (j > k1 - 14 && j <= k1) {
  6147. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6148. + s;
  6149. menuActionIds[menuActionRow] = 6;
  6150. menuActionRow++;
  6151. }
  6152. l++;
  6153. }
  6154. if(chatTypeView == 4 && j1 == 15 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6155. if(j > k1 - 14 && j <= k1) {
  6156. menuActionName[menuActionRow] = "Accept party invite @whi@" + s;
  6157. menuActionIds[menuActionRow] = 424;
  6158. menuActionRow++;
  6159. }
  6160. l++;
  6161. }
  6162. if (j1 == 12) {
  6163. if (j > k1 - 14 && j <= k1) {
  6164. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6165. menuActionIds[menuActionRow] = 915;
  6166. menuActionRow++;
  6167. }
  6168. l++;
  6169. }
  6170. }
  6171. }
  6172.  
  6173. @SuppressWarnings("unused")
  6174. public void buildChatAreaMenu(int j) {
  6175. int l = 0;
  6176. int test = 0;
  6177. for (int i1 = 0; i1 < 500; i1++) {
  6178. if (chatMessages[i1] == null)
  6179. continue;
  6180. int j1 = chatTypes[i1];
  6181. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6182. if (k1 < -23)
  6183. break;
  6184. String s = chatNames[i1];
  6185. String ct = chatMessages[i1];
  6186. boolean flag = false;
  6187. if (chatTypeView == 1) {
  6188. buildPublicChat(j);
  6189. break;
  6190. }
  6191. if (chatTypeView == 2) {
  6192. buildFriendChat(j);
  6193. break;
  6194. }
  6195. if (chatTypeView == 3 || chatTypeView == 4) {
  6196. buildDuelorTrade(j);
  6197. break;
  6198. }
  6199. if (chatTypeView == 5) {
  6200. break;
  6201. }
  6202. if(s != null && s.startsWith("@cr1@")) {
  6203. s = s.substring(5);
  6204. }
  6205. if(s != null && s.startsWith("@cr2@")) {
  6206. s = s.substring(5);
  6207. }
  6208. if(s != null && s.startsWith("@cr3@")) {
  6209. s = s.substring(5);
  6210. }
  6211. if(s != null && s.startsWith("@cr4@")) {
  6212. s = s.substring(5);
  6213. }
  6214. if(s != null && s.startsWith("@cr5@")) {
  6215. s = s.substring(5);
  6216. }
  6217. if(s != null && s.startsWith("@cr6@")) {
  6218. s = s.substring(5);
  6219. }
  6220. if(s != null && s.startsWith("@cr7@")) {
  6221. s = s.substring(5);
  6222. }
  6223. if(s != null && s.startsWith("@cr8@")) {
  6224. s = s.substring(5);
  6225. }
  6226. if(s != null && s.startsWith("@cr9@")) {
  6227. s = s.substring(5);
  6228. }
  6229. if(s != null && s.startsWith("@cr10@")) {
  6230. s = s.substring(6);
  6231. }
  6232. if(s != null && s.startsWith("@cr11@")) {
  6233. s = s.substring(6);
  6234. }
  6235. if(s != null && s.startsWith("@cr12@")) {
  6236. s = s.substring(6);
  6237. }
  6238. if(s != null && s.startsWith("@cr13@")) {
  6239. s = s.substring(6);
  6240. }
  6241. if(s != null && s.startsWith("@cr14@")) {
  6242. s = s.substring(6);
  6243. }
  6244. if(s != null && s.startsWith("@cr15@")) {
  6245. s = s.substring(6);
  6246. }
  6247. if(s != null && s.startsWith("@cr16@")) {
  6248. s = s.substring(6);
  6249. }
  6250. if(s != null && s.startsWith("@cr17@")) {
  6251. s = s.substring(6);
  6252. }
  6253. if(s != null && s.startsWith("@cr18@")) {
  6254. s = s.substring(6);
  6255. }
  6256. if(s != null && s.startsWith("@cr19@")) {
  6257. s = s.substring(6);
  6258. }
  6259. if(s != null && s.startsWith("@cr20@")) {
  6260. s = s.substring(6);
  6261. }
  6262. if (j1 == 0)
  6263. l++;
  6264. if ((j1 == 1 || j1 == 2)
  6265. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6266. && isFriendOrSelf(s))) {
  6267. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6268. if (myPrivilege >= 1) {
  6269. menuActionName[menuActionRow] = "Report abuse @whi@"
  6270. + s;
  6271. menuActionIds[menuActionRow] = 606;
  6272. menuActionRow++;
  6273. }
  6274. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6275. menuActionIds[menuActionRow] = 42;
  6276. menuActionRow++;
  6277. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6278. menuActionIds[menuActionRow] = 337;
  6279. menuActionRow++;
  6280. }
  6281. l++;
  6282. }
  6283. if ((j1 == 3 || j1 == 7)
  6284. && splitpublicChat == 0
  6285. && (j1 == 7 || publicChatMode == 0 || publicChatMode == 1
  6286. && isFriendOrSelf(s))) {
  6287. if (j > k1 - 14 && j <= k1) {
  6288. if (myPrivilege >= 1) {
  6289. menuActionName[menuActionRow] = "Report abuse @whi@"
  6290. + s;
  6291. menuActionIds[menuActionRow] = 606;
  6292. menuActionRow++;
  6293. }
  6294. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6295. menuActionIds[menuActionRow] = 42;
  6296. menuActionRow++;
  6297. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6298. menuActionIds[menuActionRow] = 337;
  6299. menuActionRow++;
  6300. }
  6301. l++;
  6302. }
  6303. if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6304. if (j > k1 - 14 && j <= k1) {
  6305. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6306. menuActionIds[menuActionRow] = 484;
  6307. menuActionRow++;
  6308. }
  6309. l++;
  6310. }
  6311. if ((j1 == 5 || j1 == 6) && splitpublicChat == 0
  6312. && publicChatMode < 2)
  6313. l++;
  6314. if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6315. if (j > k1 - 14 && j <= k1) {
  6316. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6317. + s;
  6318. menuActionIds[menuActionRow] = 6;
  6319. menuActionRow++;
  6320. }
  6321. l++;
  6322. }
  6323. if(j1 == 15 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6324. if(j > k1 - 14 && j <= k1) {
  6325. menuActionName[menuActionRow] = "Accept party invite @whi@" + s;
  6326. menuActionIds[menuActionRow] = 424;
  6327. menuActionRow++;
  6328. }
  6329. l++;
  6330. }
  6331. }
  6332. }
  6333.  
  6334. public void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6335. int j = class9.contentType;
  6336. if(j >= 205 && j <= 205+25){
  6337. j -= 205;
  6338. class9.message = setMessage(j);
  6339. return;
  6340. }
  6341. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6342. if (j == 1 && anInt900 == 0) {
  6343. class9.message = "Loading friend list";
  6344. class9.atActionType = 0;
  6345. return;
  6346. }
  6347. if (j == 1 && anInt900 == 1) {
  6348. class9.message = "Connecting to friendserver";
  6349. class9.atActionType = 0;
  6350. return;
  6351. }
  6352. if (j == 2 && anInt900 != 2) {
  6353. class9.message = "Please wait...";
  6354. class9.atActionType = 0;
  6355. return;
  6356. }
  6357. int k = friendsCount;
  6358. if (anInt900 != 2)
  6359. k = 0;
  6360. if (j > 700)
  6361. j -= 601;
  6362. else
  6363. j--;
  6364. if (j >= k) {
  6365. class9.message = "";
  6366. class9.atActionType = 0;
  6367. return;
  6368. } else {
  6369. class9.message = friendsList[j];
  6370. class9.atActionType = 1;
  6371. return;
  6372. }
  6373. }
  6374. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6375. int l = friendsCount;
  6376. if (anInt900 != 2)
  6377. l = 0;
  6378. if (j > 800)
  6379. j -= 701;
  6380. else
  6381. j -= 101;
  6382. if (j >= l) {
  6383. class9.message = "";
  6384. class9.atActionType = 0;
  6385. return;
  6386. }
  6387. if (friendsNodeIDs[j] == 0)
  6388. class9.message = "@red@Offline";
  6389. else if (friendsNodeIDs[j] == nodeID)
  6390. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
  6391. else
  6392. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  6393. class9.atActionType = 1;
  6394. return;
  6395. }
  6396. if (j == 203) {
  6397. int i1 = friendsCount;
  6398. if (anInt900 != 2)
  6399. i1 = 0;
  6400. class9.scrollMax = i1 * 15 + 20;
  6401. if (class9.scrollMax <= class9.height)
  6402. class9.scrollMax = class9.height + 1;
  6403. return;
  6404. }
  6405. if (j == 424) {
  6406. class9.scrollMax = partyCount * 14;
  6407. if(class9.scrollMax <= class9.height)
  6408. class9.scrollMax = class9.height + 1;
  6409. return;
  6410. }
  6411. if (j >= 401 && j <= 500) {
  6412. if ((j -= 401) == 0 && anInt900 == 0) {
  6413. class9.message = "Loading ignore list";
  6414. class9.atActionType = 0;
  6415. return;
  6416. }
  6417. if (j == 1 && anInt900 == 0) {
  6418. class9.message = "Please wait...";
  6419. class9.atActionType = 0;
  6420. return;
  6421. }
  6422. int j1 = ignoreCount;
  6423. if (anInt900 == 0)
  6424. j1 = 0;
  6425. if (j >= j1) {
  6426. class9.message = "";
  6427. class9.atActionType = 0;
  6428. return;
  6429. } else {
  6430. class9.message = TextClass.fixName(TextClass
  6431. .nameForLong(ignoreListAsLongs[j]));
  6432. class9.atActionType = 1;
  6433. return;
  6434. }
  6435. }
  6436. if (j == 503) {
  6437. class9.scrollMax = ignoreCount * 15 + 20;
  6438. if (class9.scrollMax <= class9.height)
  6439. class9.scrollMax = class9.height + 1;
  6440. return;
  6441. }
  6442. if (j == 327) {
  6443. class9.modelRotation1 = 150;
  6444. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6445. if (aBoolean1031) {
  6446. for (int k1 = 0; k1 < 7; k1++) {
  6447. int l1 = anIntArray1065[k1];
  6448. if (l1 >= 0 && !IDK.cache[l1].method537())
  6449. return;
  6450. }
  6451.  
  6452. aBoolean1031 = false;
  6453. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6454. int i2 = 0;
  6455. for (int j2 = 0; j2 < 7; j2++) {
  6456. int k2 = anIntArray1065[j2];
  6457. if (k2 >= 0)
  6458. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  6459. .method538();
  6460. }
  6461.  
  6462. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6463. for (int l2 = 0; l2 < 5; l2++)
  6464. if (anIntArray990[l2] != 0) {
  6465. model.method476(anIntArrayArray1003[l2][0],
  6466. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6467. if (l2 == 1)
  6468. model.method476(anIntArray1204[0],
  6469. anIntArray1204[anIntArray990[l2]]);
  6470. // if(l2 == 1)
  6471. // model.method476(Legs2[0], Legs2[anIntArray990[l2]]);
  6472. }
  6473.  
  6474. model.method469();
  6475. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6476. model.method479(64, 1300, 0, -570, 0, true);
  6477. class9.anInt233 = 5;
  6478. class9.mediaID = 0;
  6479. RSInterface.method208(aBoolean994, model);
  6480. }
  6481. return;
  6482. }
  6483. if (j == 328) {
  6484. RSInterface rsInterface = class9;
  6485. int verticleTilt = 150;
  6486. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6487. rsInterface.modelRotation1 = verticleTilt;
  6488. rsInterface.modelRotation2 = animationSpeed;
  6489. if (aBoolean1031) {
  6490. Model characterDisplay = myPlayer.method452();
  6491. for (int l2 = 0; l2 < 5; l2++)
  6492. if (anIntArray990[l2] != 0) {
  6493. characterDisplay.method476(anIntArrayArray1003[l2][0],
  6494. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6495. if (l2 == 1)
  6496. characterDisplay.method476(anIntArray1204[0],
  6497. anIntArray1204[anIntArray990[l2]]);
  6498. }
  6499. int staticFrame = myPlayer.anInt1511;
  6500. characterDisplay.method469();
  6501. characterDisplay
  6502. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  6503. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6504. rsInterface.anInt233 = 5;
  6505. rsInterface.mediaID = 0;
  6506. RSInterface.method208(aBoolean994, characterDisplay);
  6507. }
  6508. return;
  6509. }
  6510. if (j == 324) {
  6511. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6512. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6513. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6514. }
  6515. if (aBoolean1047) {
  6516. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6517. return;
  6518. } else {
  6519. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6520. return;
  6521. }
  6522. }
  6523. if (j == 325) {
  6524. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6525. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6526. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6527. }
  6528. if (aBoolean1047) {
  6529. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6530. return;
  6531. } else {
  6532. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6533. return;
  6534. }
  6535. }
  6536. if (j == 600) {
  6537. class9.message = reportAbuseInput;
  6538. if (loopCycle % 20 < 10) {
  6539. class9.message += "|";
  6540. return;
  6541. } else {
  6542. class9.message += " ";
  6543. return;
  6544. }
  6545. }
  6546. if (j == 613)
  6547. if (myPrivilege >= 1) {
  6548. if (canMute) {
  6549. class9.textColor = 0xff0000;
  6550. // class9.message =
  6551. // "Moderator option: Mute player for 48 hours: <ON>";
  6552. } else {
  6553. class9.textColor = 0xffffff;
  6554. // class9.message =
  6555. // "Moderator option: Mute player for 48 hours: <OFF>";
  6556. }
  6557. } else {
  6558. class9.message = "";
  6559. }
  6560. if (j == 650 || j == 655)
  6561. if (anInt1193 != 0) {
  6562. String s;
  6563. if (daysSinceLastLogin == 0)
  6564. s = "earlier today";
  6565. else if (daysSinceLastLogin == 1)
  6566. s = "yesterday";
  6567. else
  6568. s = daysSinceLastLogin + " days ago";
  6569. class9.message = "You last logged in " + s + " from: " + SignLink.dns;
  6570. } else {
  6571. class9.message = "";
  6572. }
  6573. if (j == 651) {
  6574. if (unreadMessages == 0) {
  6575. class9.message = "0 unread messages";
  6576. class9.textColor = 0xffff00;
  6577. }
  6578. if (unreadMessages == 1) {
  6579. class9.message = "1 unread message";
  6580. class9.textColor = 65280;
  6581. }
  6582. if (unreadMessages > 1) {
  6583. class9.message = unreadMessages + " unread messages";
  6584. class9.textColor = 65280;
  6585. }
  6586. }
  6587. if (j == 652)
  6588. if (daysSinceRecovChange == 201) {
  6589. if (membersInt == 1)
  6590. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6591. else
  6592. class9.message = "";
  6593. } else if (daysSinceRecovChange == 200) {
  6594. class9.message = "You have not yet set any password recovery questions.";
  6595. } else {
  6596. String s1;
  6597. if (daysSinceRecovChange == 0)
  6598. s1 = "Earlier today";
  6599. else if (daysSinceRecovChange == 1)
  6600. s1 = "Yesterday";
  6601. else
  6602. s1 = daysSinceRecovChange + " days ago";
  6603. class9.message = s1 + " you changed your recovery questions";
  6604. }
  6605. if (j == 653)
  6606. if (daysSinceRecovChange == 201) {
  6607. if (membersInt == 1)
  6608. class9.message = "@whi@recommend you use a members world instead. You may use";
  6609. else
  6610. class9.message = "";
  6611. } else if (daysSinceRecovChange == 200)
  6612. class9.message = "We strongly recommend you do so now to secure your account.";
  6613. else
  6614. class9.message = "If you do not remember making this change then cancel it immediately";
  6615. if (j == 654) {
  6616. if (daysSinceRecovChange == 201)
  6617. if (membersInt == 1) {
  6618. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6619. return;
  6620. } else {
  6621. class9.message = "";
  6622. return;
  6623. }
  6624. if (daysSinceRecovChange == 200) {
  6625. class9.message = "Do this from the 'account management' area on our front webpage";
  6626. return;
  6627. }
  6628. class9.message = "Do this from the 'account management' area on our front webpage";
  6629. }
  6630. }
  6631.  
  6632. public void drawSplitpublicChat() {
  6633. if (splitpublicChat == 0)
  6634. return;
  6635. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6636. int i = 0;
  6637. if(anInt1104 != 0)
  6638. i = 1;
  6639. for(int j = 0; j < 100; j++)
  6640. if(chatMessages[j] != null)
  6641. {
  6642. int k = chatTypes[j];
  6643. String s = chatNames[j];
  6644. byte byte1 = 0;
  6645. Matcher matcher = pattern.matcher(s);
  6646. if (matcher.find()) {
  6647. try {
  6648. s = s.replace(matcher.group(0), "");
  6649. byte1 = Byte.parseByte(matcher.group(1));
  6650. } catch (NumberFormatException e) {
  6651. byte1 = 0;
  6652. }
  6653. }
  6654.  
  6655. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6656. int yPos = 329 - i * 13;
  6657. int xPos = 4;
  6658. Sprite crown = byte1 == 0 ? null : modIcons[byte1];
  6659. String[] message = TextClass.splitString(newRegularFont, "", chatMessages[j], 470, crown);
  6660. if (message.length > 1 && message[0] != null && message[1] != null) {
  6661. textDrawingArea.method385(0, "From ", yPos - 13, xPos);
  6662. textDrawingArea.method385(65535, "From ", yPos - 14, xPos);
  6663. xPos += newRegularFont.getTextWidth("From ");
  6664. if (crown != null && byte1 <= modIcons.length) {
  6665. crown.drawSprite(xPos, yPos - 25 - (crown.myHeight / 6));
  6666. xPos += crown.maxWidth;
  6667. }
  6668. textDrawingArea.method385(0, s + ": " + message[0], yPos - 13, xPos);
  6669. textDrawingArea.method385(65535, s + ": " + message[0], yPos - 14, xPos);
  6670. textDrawingArea.method385(0, message[1], yPos, 4);
  6671. textDrawingArea.method385(65535, message[1], yPos - 1, 4);
  6672. ++i;
  6673. } else {
  6674. textDrawingArea.method385(0, "From ", yPos, xPos);
  6675. textDrawingArea.method385(65535, "From ", yPos, xPos);
  6676. xPos += newRegularFont.getTextWidth("From ");
  6677. if (crown != null && byte1 <= modIcons.length) {
  6678. crown.drawSprite(xPos, yPos - 11 - (crown.myHeight / 6));
  6679. xPos += crown.maxWidth;
  6680. }
  6681. textDrawingArea.method385(0, s + ": " + chatMessages[j], yPos, xPos);
  6682. textDrawingArea.method385(65535, s + ": " + chatMessages[j], yPos - 1, xPos);
  6683. }
  6684. if (++i >= 5)
  6685. return;
  6686. }
  6687. if (k == 5 && privateChatMode < 2) {
  6688. int i1 = 329 - i * 13;
  6689. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6690. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  6691. if (++i >= 5)
  6692. return;
  6693. }
  6694. if (k == 6 && privateChatMode < 2) {
  6695. int j1 = 329 - i * 13;
  6696. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6697. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6698. if (++i >= 5)
  6699. return;
  6700. }
  6701. }
  6702. }
  6703.  
  6704. public void pushMessage(String s, int i, String s1) {
  6705. if(i == 0 && dialogID != -1) {
  6706. aString844 = s;
  6707. super.clickMode3 = 0;
  6708. }
  6709. if(backDialogID == -1)
  6710. inputTaken = true;
  6711. for(int j = 499; j > 0; j--) {
  6712. chatTypes[j] = chatTypes[j - 1];
  6713. chatNames[j] = chatNames[j - 1];
  6714. chatMessages[j] = chatMessages[j - 1];
  6715. chatRights[j] = chatRights[j - 1];
  6716. }
  6717. chatTypes[0] = i;
  6718. chatNames[0] = s1;
  6719. chatMessages[0] = s;
  6720. chatRights[0] = rights;
  6721. }
  6722.  
  6723. public void setNorth() {
  6724. cameraOffsetX = 0;
  6725. cameraOffsetY = 0;
  6726. viewRotationOffset = 0;
  6727. viewRotation = 0;
  6728. minimapRotation = 0;
  6729. minimapZoom = 0;
  6730. }
  6731.  
  6732. public static void setTab(int id) {
  6733. needDrawTabArea = true;
  6734. tabID = id;
  6735. tabAreaAltered = true;
  6736. }
  6737.  
  6738. public void processTabClick() {
  6739. if (menuOpen) {
  6740. return;
  6741. }
  6742.  
  6743. runHover = super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128;
  6744. if(super.clickMode3 == 1) {
  6745. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6746. {
  6747. needDrawTabArea = true;
  6748. tabID = 0;
  6749. tabAreaAltered = true;
  6750. }
  6751. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6752. {
  6753. needDrawTabArea = true;
  6754. tabID = 1;
  6755. tabAreaAltered = true;
  6756. }
  6757. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6758. {
  6759. needDrawTabArea = true;
  6760. tabID = 2;
  6761. tabAreaAltered = true;
  6762. }
  6763. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6764. {
  6765. needDrawTabArea = true;
  6766. tabID = 3;
  6767. tabAreaAltered = true;
  6768. }
  6769. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6770. {
  6771. needDrawTabArea = true;
  6772. tabID = 4;
  6773. tabAreaAltered = true;
  6774. }
  6775. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6776. {
  6777. needDrawTabArea = true;
  6778. tabID = 5;
  6779. tabAreaAltered = true;
  6780. }
  6781. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6782. {
  6783. needDrawTabArea = true;
  6784. tabID = 6;
  6785. tabAreaAltered = true;
  6786. }
  6787. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6788. {
  6789. needDrawTabArea = true;
  6790. tabID = 8;
  6791. tabAreaAltered = true;
  6792. }
  6793. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6794. {
  6795. needDrawTabArea = true;
  6796. tabID = 9;
  6797. tabAreaAltered = true;
  6798. }
  6799. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6800. {
  6801. needDrawTabArea = true;
  6802. tabID = 7;
  6803. tabAreaAltered = true;
  6804. }
  6805. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6806. {
  6807. needDrawTabArea = true;
  6808. tabID = 11;
  6809. tabAreaAltered = true;
  6810. }
  6811. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6812. {
  6813. needDrawTabArea = true;
  6814. tabID = 12;
  6815. tabAreaAltered = true;
  6816. }
  6817. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6818. {
  6819. needDrawTabArea = true;
  6820. tabID = 13;
  6821. tabAreaAltered = true;
  6822. }
  6823. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[14] != -1)
  6824. {
  6825. needDrawTabArea = true;
  6826. tabID = 14;
  6827. tabAreaAltered = true;
  6828. }
  6829. }
  6830. }
  6831.  
  6832. public void resetImageProducers2() {
  6833. if (aRSImageProducer_1166 != null)
  6834. return;
  6835. nullLoader();
  6836. super.fullGameScreen = null;
  6837. aRSImageProducer_1107 = null;
  6838. aRSImageProducer_1108 = null;
  6839. aRSImageProducer_1109 = null;
  6840. aRSImageProducer_1110 = null;
  6841. aRSImageProducer_1111 = null;
  6842. aRSImageProducer_1112 = null;
  6843. aRSImageProducer_1113 = null;
  6844. aRSImageProducer_1114 = null;
  6845. aRSImageProducer_1115 = null;
  6846. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  6847. getGameComponent());
  6848. aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
  6849. DrawingArea.setAllPixelsToZero();
  6850. mapArea.drawSprite(0, 0);
  6851. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  6852. getGameComponent());
  6853. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  6854. getGameComponent());
  6855. DrawingArea.setAllPixelsToZero();
  6856. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6857. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6858. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6859. welcomeScreenRaised = true;
  6860. }
  6861.  
  6862. public String getDocumentBaseHost() {
  6863. if (SignLink.mainapp != null) {
  6864. return SignLink.mainapp.getDocumentBase().getHost().toLowerCase();
  6865. }
  6866. if (super.gameFrame != null) {
  6867. return ""; // runescape.com <- removed for Jframe to work
  6868. } else {
  6869. return ""; // super.getDocumentBase().getHost().toLowerCase() <-
  6870. // removed for Jframe to work
  6871. }
  6872. }
  6873.  
  6874. private void method81(Sprite sprite, int j, int k)
  6875. {
  6876. int l = k * k + j * j;
  6877. if(l > 4225 && l < 0x15f90)
  6878. {
  6879. int i1 = viewRotation + minimapRotation & 0x7ff;
  6880. int j1 = Model.SINE[i1];
  6881. int k1 = Model.COSINE[i1];
  6882. j1 = (j1 * 256) / (minimapZoom + 256);
  6883. k1 = (k1 * 256) / (minimapZoom + 256);
  6884. int l1 = j * j1 + k * k1 >> 16;
  6885. int i2 = j * k1 - k * j1 >> 16;
  6886. double d = Math.atan2(l1, i2);
  6887. int j2 = (int)(Math.sin(d) * 63D);
  6888. int k2 = (int)(Math.cos(d) * 57D);
  6889. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6890. } else
  6891. {
  6892. markMinimap(sprite, k, j);
  6893. }
  6894. }
  6895.  
  6896. private void rightClickChatButtons() {
  6897. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6898. menuActionName[1] = "Clear Chat";
  6899. menuActionIds[1] = 975;
  6900. menuActionName[2] = "View All";
  6901. menuActionIds[2] = 999;
  6902. menuActionRow = 3;
  6903. } else if (super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  6904. menuActionName[1] = "View Game";
  6905. menuActionIds[1] = 998;
  6906. menuActionRow = 2;
  6907. } else if (super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  6908. menuActionName[1] = "Hide public";
  6909. menuActionIds[1] = 997;
  6910. menuActionName[2] = "Off public";
  6911. menuActionIds[2] = 996;
  6912. menuActionName[3] = "Friends public";
  6913. menuActionIds[3] = 995;
  6914. menuActionName[4] = "On public";
  6915. menuActionIds[4] = 994;
  6916. menuActionName[5] = "View public";
  6917. menuActionIds[5] = 993;
  6918. menuActionRow = 6;
  6919. } else if (super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  6920. menuActionName[1] = "Off private";
  6921. menuActionIds[1] = 992;
  6922. menuActionName[2] = "Friends private";
  6923. menuActionIds[2] = 991;
  6924. menuActionName[3] = "On private";
  6925. menuActionIds[3] = 990;
  6926. menuActionName[4] = "View private";
  6927. menuActionIds[4] = 989;
  6928. menuActionRow = 5;
  6929. } else if (super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  6930. menuActionName[1] = "Off clan chat";
  6931. menuActionIds[1] = 1003;
  6932. menuActionName[2] = "Friends clan chat";
  6933. menuActionIds[2] = 1002;
  6934. menuActionName[3] = "On clan chat";
  6935. menuActionIds[3] = 1001;
  6936. menuActionName[4] = "View clan chat";
  6937. menuActionIds[4] = 1000;
  6938. menuActionRow = 5;
  6939. } else if (super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  6940. menuActionName[1] = "Off trade";
  6941. menuActionIds[1] = 987;
  6942. menuActionName[2] = "Friends trade";
  6943. menuActionIds[2] = 986;
  6944. menuActionName[3] = "On trade";
  6945. menuActionIds[3] = 985;
  6946. menuActionName[4] = "View trade";
  6947. menuActionIds[4] = 984;
  6948. menuActionRow = 5;
  6949. } else if (super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  6950. menuActionName[1] = "Off duel";
  6951. menuActionIds[1] = -1;
  6952. menuActionName[2] = "Friends duel";
  6953. menuActionIds[2] = -1;
  6954. menuActionName[3] = "On duel";
  6955. menuActionIds[3] = -1;
  6956. menuActionName[4] = "View duel";
  6957. menuActionIds[4] = -1;
  6958. menuActionRow = 5;
  6959. } else if (super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  6960. menuActionName[1] = "Report Abuse";
  6961. menuActionIds[1] = 606;
  6962. menuActionRow = 2;
  6963. }
  6964. }
  6965.  
  6966. public void processRightClick() {
  6967. if (activeInterfaceType != 0) {
  6968. return;
  6969. }
  6970. menuActionName[0] = "Cancel";
  6971. menuActionIds[0] = 1107;
  6972. menuActionRow = 1;
  6973. if (fullscreenInterfaceID != -1) {
  6974. anInt886 = 0;
  6975. anInt1315 = 0;
  6976. buildInterfaceMenu(8,
  6977. RSInterface.interfaceCache[fullscreenInterfaceID],
  6978. super.mouseX, 8, super.mouseY, 0);
  6979. if (anInt886 != anInt1026) {
  6980. anInt1026 = anInt886;
  6981. }
  6982. if (anInt1315 != anInt1129) {
  6983. anInt1129 = anInt1315;
  6984. }
  6985. return;
  6986. }
  6987. buildSplitpublicChatMenu();
  6988. anInt886 = 0;
  6989. anInt1315 = 0;
  6990.  
  6991. if (super.mouseX >= 515 && super.mouseY >= 0 && super.mouseX <= 765 && super.mouseY <= 167)
  6992. if (openInterfaceID != -1)
  6993. buildInterfaceMenu(0, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 0, super.mouseY, 0);
  6994. if (anInt886 != anInt1026)
  6995. anInt1026 = anInt886;
  6996. anInt886 = 0;
  6997.  
  6998. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6999. if (openInterfaceID != -1) {
  7000. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7001. } else {
  7002. build3dScreenMenu();
  7003. }
  7004. }
  7005. if (anInt886 != anInt1026) {
  7006. anInt1026 = anInt886;
  7007. }
  7008. if (anInt1315 != anInt1129) {
  7009. anInt1129 = anInt1315;
  7010. }
  7011. anInt886 = 0;
  7012. anInt1315 = 0;
  7013. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  7014. if (invOverlayInterfaceID != -1) {
  7015. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  7016. } else if (tabInterfaceIDs[tabID] != -1) {
  7017. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  7018. }
  7019. }
  7020. if (anInt886 != anInt1048) {
  7021. needDrawTabArea = true;
  7022. tabAreaAltered = true;
  7023. anInt1048 = anInt886;
  7024. }
  7025. if (anInt1315 != anInt1044) {
  7026. needDrawTabArea = true;
  7027. tabAreaAltered = true;
  7028. anInt1044 = anInt1315;
  7029. }
  7030. anInt886 = 0;
  7031. anInt1315 = 0;
  7032. if (super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  7033. if (backDialogID != -1) {
  7034. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  7035. } else if (super.mouseY < 463 && super.mouseX < 490) {
  7036. buildChatAreaMenu(super.mouseY - 338);
  7037. }
  7038. }
  7039. if (backDialogID != -1 && anInt886 != anInt1039) {
  7040. inputTaken = true;
  7041. anInt1039 = anInt886;
  7042. }
  7043. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7044. inputTaken = true;
  7045. anInt1500 = anInt1315;
  7046. }
  7047. /* Enable custom right click areas */
  7048. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  7049. rightClickChatButtons();
  7050. processXPCounterClick();
  7051. if(super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168) {
  7052. rightClickMapArea();
  7053. processMinimapActions();
  7054. }
  7055. /**/
  7056.  
  7057. boolean flag = false;
  7058. while (!flag) {
  7059. flag = true;
  7060. for (int j = 0; j < menuActionRow - 1; j++) {
  7061. if (menuActionIds[j] < 1000 && menuActionIds[j + 1] > 1000) {
  7062. String s = menuActionName[j];
  7063. menuActionName[j] = menuActionName[j + 1];
  7064. menuActionName[j + 1] = s;
  7065. int k = menuActionIds[j];
  7066. menuActionIds[j] = menuActionIds[j + 1];
  7067. menuActionIds[j + 1] = k;
  7068. k = menuActionCmd2[j];
  7069. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7070. menuActionCmd2[j + 1] = k;
  7071. k = menuActionCmd3[j];
  7072. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7073. menuActionCmd3[j + 1] = k;
  7074. k = menuActionCmd1[j];
  7075. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7076. menuActionCmd1[j + 1] = k;
  7077. flag = false;
  7078. }
  7079. }
  7080. }
  7081. }
  7082.  
  7083. public int method83(int i, int j, int k) {
  7084. int l = 256 - k;
  7085. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  7086. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7087. }
  7088.  
  7089. public boolean saveAccountInfo = true;
  7090.  
  7091. @SuppressWarnings("unused")
  7092. public void login(String s, String s1, boolean flag) {
  7093. SignLink.errorname = s;
  7094. try {
  7095. if(saveAccountInfo) {
  7096. writeSettings();
  7097. }
  7098. if (!flag) {
  7099. loginMessage1 = "";
  7100. loginMessage2 = "Connecting to server...";
  7101. drawLoginScreen();
  7102. }
  7103. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7104. long l = TextClass.longForName(s);
  7105. int i = (int) (l >> 16 & 31L);
  7106. stream.currentOffset = 0;
  7107. stream.writeWordBigEndian(14);
  7108. stream.writeWordBigEndian(i);
  7109. socketStream.queueBytes(2, stream.buffer);
  7110. for (int j = 0; j < 8; j++)
  7111. socketStream.read();
  7112.  
  7113. int k = socketStream.read();
  7114. int i1 = k;
  7115. if (k == 0) {
  7116. socketStream.flushInputStream(inStream.buffer, 8);
  7117. inStream.currentOffset = 0;
  7118. aLong1215 = inStream.readQWord();
  7119. int ai[] = new int[4];
  7120. ai[0] = (int) (Math.random() * 99999999D);
  7121. ai[1] = (int) (Math.random() * 99999999D);
  7122. ai[2] = (int) (aLong1215 >> 32);
  7123. ai[3] = (int) aLong1215;
  7124. stream.currentOffset = 0;
  7125. stream.writeWordBigEndian(10);
  7126. stream.writeDWord(ai[0]);
  7127. stream.writeDWord(ai[1]);
  7128. stream.writeDWord(ai[2]);
  7129. stream.writeDWord(ai[3]);
  7130. stream.writeDWord(2300); // (int) (Double.parseDouble(update.getVersions().getProperty("client")) * 1000)
  7131. stream.writeString(s);
  7132. stream.writeString(s1);
  7133. stream.doKeys();
  7134. aStream_847.currentOffset = 0;
  7135. if (flag)
  7136. aStream_847.writeWordBigEndian(18);
  7137. else
  7138. aStream_847.writeWordBigEndian(16);
  7139. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7140. aStream_847.writeWordBigEndian(255);
  7141. aStream_847.writeWord(317);
  7142. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7143. for (int l1 = 0; l1 < 9; l1++)
  7144. aStream_847.writeDWord(expectedCRCs[l1]);
  7145.  
  7146. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7147. stream.encryption = new ISAACRandomGen(ai);
  7148. for (int j2 = 0; j2 < 4; j2++)
  7149. ai[j2] += 50;
  7150.  
  7151. encryption = new ISAACRandomGen(ai);
  7152. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7153. k = socketStream.read();
  7154. }
  7155. if (k == 1) {
  7156. try {
  7157. Thread.sleep(2000L);
  7158. } catch (Exception _ex) {
  7159. }
  7160. login(s, s1, flag);
  7161. return;
  7162. }
  7163. if (k == 2) {
  7164. myPrivilege = socketStream.read();
  7165. flagged = socketStream.read() == 1;
  7166. aLong1220 = 0L;
  7167. anInt1022 = 0;
  7168. mouseDetection.coordsIndex = 0;
  7169. super.awtFocus = true;
  7170. aBoolean954 = true;
  7171. loggedIn = true;
  7172. stream.currentOffset = 0;
  7173. inStream.currentOffset = 0;
  7174. pktType = -1;
  7175. anInt841 = -1;
  7176. anInt842 = -1;
  7177. anInt843 = -1;
  7178. pktSize = 0;
  7179. anInt1009 = 0;
  7180. anInt1104 = 0;
  7181. anInt1011 = 0;
  7182. anInt855 = 0;
  7183. menuActionRow = 0;
  7184. menuOpen = false;
  7185. super.idleTime = 0;
  7186. for (int j1 = 0; j1 < 500; j1++)
  7187. chatMessages[j1] = null;
  7188.  
  7189. itemSelected = 0;
  7190. spellSelected = 0;
  7191. loadingStage = 0;
  7192. currentSound = 0;
  7193. setNorth();
  7194. anInt1021 = 0;
  7195. anInt985 = -1;
  7196. destX = 0;
  7197. destY = 0;
  7198. playerCount = 0;
  7199. npcCount = 0;
  7200. for (int i2 = 0; i2 < maxPlayers; i2++) {
  7201. playerArray[i2] = null;
  7202. aStreamArray895s[i2] = null;
  7203. }
  7204.  
  7205. for (int k2 = 0; k2 < 16384; k2++)
  7206. npcArray[k2] = null;
  7207.  
  7208. myPlayer = playerArray[myPlayerIndex] = new Player();
  7209. aClass19_1013.removeAll();
  7210. aClass19_1056.removeAll();
  7211. for (int l2 = 0; l2 < 4; l2++) {
  7212. for (int i3 = 0; i3 < 104; i3++) {
  7213. for (int k3 = 0; k3 < 104; k3++)
  7214. groundArray[l2][i3][k3] = null;
  7215.  
  7216. }
  7217.  
  7218. }
  7219.  
  7220. aClass19_1179 = new NodeList();
  7221. fullscreenInterfaceID = -1;
  7222. anInt900 = 0;
  7223. friendsCount = 0;
  7224. dialogID = -1;
  7225. backDialogID = -1;
  7226. openInterfaceID = -1;
  7227. invOverlayInterfaceID = -1;
  7228. anInt1018 = -1;
  7229. aBoolean1149 = false;
  7230. tabID = 3;
  7231. inputDialogState = 0;
  7232. menuOpen = false;
  7233. messagePromptRaised = false;
  7234. aString844 = null;
  7235. anInt1055 = 0;
  7236. anInt1054 = -1;
  7237. aBoolean1047 = true;
  7238. method45();
  7239. for (int j3 = 0; j3 < 5; j3++)
  7240. anIntArray990[j3] = 0;
  7241.  
  7242. for (int l3 = 0; l3 < 5; l3++) {
  7243. atPlayerActions[l3] = null;
  7244. atPlayerArray[l3] = false;
  7245. }
  7246.  
  7247. anInt1175 = 0;
  7248. anInt1134 = 0;
  7249. anInt986 = 0;
  7250. anInt1288 = 0;
  7251. anInt924 = 0;
  7252. anInt1188 = 0;
  7253. anInt1155 = 0;
  7254. anInt1226 = 0;
  7255. int anInt941 = 0;
  7256. int anInt1260 = 0;
  7257. resetImageProducers2();
  7258. loginMessage1 = "";
  7259. loginMessage2 = "";
  7260. if (clientData)
  7261. ping();
  7262. return;
  7263. }
  7264. if (k == 3) {
  7265. loginMessage1 = "";
  7266. loginMessage2 = "Invalid username or password.";
  7267. return;
  7268. }
  7269. if (k == 4) {
  7270. loginMessage1 = "Your account has been disabled.";
  7271. loginMessage2 = "Please check your message-center for details.";
  7272. return;
  7273. }
  7274. if (k == 5) {
  7275. loginMessage1 = "Your account is already logged in.";
  7276. loginMessage2 = "Try again in 60 secs...";
  7277. return;
  7278. }
  7279. if (k == 6) {
  7280. loginMessage1 = "530 has been updated!";
  7281. loginMessage2 = "Please reload this page.";
  7282. return;
  7283. }
  7284. if (k == 7) {
  7285. loginMessage1 = "This world is full.";
  7286. loginMessage2 = "Please use a different world.";
  7287. return;
  7288. }
  7289. if (k == 8) {
  7290. loginMessage1 = "Unable to connect.";
  7291. loginMessage2 = "Login server offline.";
  7292. return;
  7293. }
  7294. if (k == 9) {
  7295. loginMessage1 = "Login limit exceeded.";
  7296. loginMessage2 = "Too many connections from your address.";
  7297. return;
  7298. }
  7299. if (k == 10) {
  7300. loginMessage1 = "Unable to connect.";
  7301. loginMessage2 = "Bad session id.";
  7302. return;
  7303. }
  7304. if (k == 11) {
  7305. loginMessage2 = "Login server rejected session.";
  7306. loginMessage2 = "Please try again.";
  7307. return;
  7308. }
  7309. if (k == 12) {
  7310. loginMessage1 = "You need a members account to login to this world.";
  7311. loginMessage2 = "Please subscribe, or use a different world.";
  7312. return;
  7313. }
  7314. if (k == 13) {
  7315. loginMessage1 = "Could not complete login.";
  7316. loginMessage2 = "Please try using a different world.";
  7317. return;
  7318. }
  7319. if (k == 14) {
  7320. loginMessage1 = "The server is being updated.";
  7321. loginMessage2 = "Please wait 1 minute and try again.";
  7322. return;
  7323. }
  7324. if (k == 15) {
  7325. loggedIn = true;
  7326. stream.currentOffset = 0;
  7327. inStream.currentOffset = 0;
  7328. pktType = -1;
  7329. anInt841 = -1;
  7330. anInt842 = -1;
  7331. anInt843 = -1;
  7332. pktSize = 0;
  7333. anInt1009 = 0;
  7334. anInt1104 = 0;
  7335. menuActionRow = 0;
  7336. menuOpen = false;
  7337. aLong824 = System.currentTimeMillis();
  7338. return;
  7339. }
  7340. if (k == 16) {
  7341. loginMessage1 = "Login attempts exceeded.";
  7342. loginMessage2 = "Please wait 1 minute and try again.";
  7343. return;
  7344. }
  7345. if (k == 17) {
  7346. loginMessage1 = "You are standing in a members-only area.";
  7347. loginMessage2 = "To play on this world move to a free area first";
  7348. return;
  7349. }
  7350. if (k == 20) {
  7351. loginMessage1 = "Invalid loginserver requested";
  7352. loginMessage2 = "Please try using a different world.";
  7353. return;
  7354. }
  7355. if (k == 21) {
  7356. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  7357. loginMessage1 = "You have only just left another world";
  7358. loginMessage2 = "Your profile will be transferred in: "
  7359. + k1 + " seconds";
  7360. drawLoginScreen();
  7361. try {
  7362. Thread.sleep(1000L);
  7363. } catch (Exception _ex) {
  7364. }
  7365. }
  7366.  
  7367. login(s, s1, flag);
  7368. return;
  7369. }
  7370. if (k == -1) {
  7371. if (loginFailures < 5) {
  7372. try {
  7373. Thread.sleep(2000L);
  7374. } catch (Exception _ex) {
  7375. }
  7376. loginFailures++;
  7377. login(s, s1, flag);
  7378. return;
  7379. } else {
  7380. loginMessage1 = "No response from loginserver";
  7381. loginMessage2 = "Please wait 1 minute and try again.";
  7382. return;
  7383. }
  7384. } else {
  7385. System.out.println("response:" + k);
  7386. loginMessage1 = "Unexpected server response";
  7387. loginMessage2 = "Please try using a different world.";
  7388. return;
  7389. }
  7390. } catch (IOException _ex) {
  7391. loginMessage1 = "";
  7392. }
  7393. loginMessage2 = "Error connecting to server.";
  7394. }
  7395.  
  7396. public boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  7397. int l1, int i2, int j2, boolean flag, int k2) {
  7398. byte byte0 = 104;
  7399. byte byte1 = 104;
  7400. for (int l2 = 0; l2 < byte0; l2++) {
  7401. for (int i3 = 0; i3 < byte1; i3++) {
  7402. anIntArrayArray901[l2][i3] = 0;
  7403. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7404. }
  7405. }
  7406. int j3 = j2;
  7407. int k3 = j1;
  7408. anIntArrayArray901[j2][j1] = 99;
  7409. anIntArrayArray825[j2][j1] = 0;
  7410. int l3 = 0;
  7411. int i4 = 0;
  7412. bigX[l3] = j2;
  7413. bigY[l3++] = j1;
  7414. boolean flag1 = false;
  7415. int j4 = bigX.length;
  7416. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7417. while (i4 != l3) {
  7418. j3 = bigX[i4];
  7419. k3 = bigY[i4];
  7420. i4 = (i4 + 1) % j4;
  7421. if (j3 == k2 && k3 == i2) {
  7422. flag1 = true;
  7423. break;
  7424. }
  7425. if (i1 != 0) {
  7426. if ((i1 < 5 || i1 == 10)
  7427. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  7428. i1 - 1, i2)) {
  7429. flag1 = true;
  7430. break;
  7431. }
  7432. if (i1 < 10
  7433. && aClass11Array1230[plane].method220(k2, i2, k3,
  7434. i1 - 1, j, j3)) {
  7435. flag1 = true;
  7436. break;
  7437. }
  7438. }
  7439. if (k1 != 0
  7440. && k != 0
  7441. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  7442. k1, k3)) {
  7443. flag1 = true;
  7444. break;
  7445. }
  7446. int l4 = anIntArrayArray825[j3][k3] + 1;
  7447. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  7448. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  7449. bigX[l3] = j3 - 1;
  7450. bigY[l3] = k3;
  7451. l3 = (l3 + 1) % j4;
  7452. anIntArrayArray901[j3 - 1][k3] = 2;
  7453. anIntArrayArray825[j3 - 1][k3] = l4;
  7454. }
  7455. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  7456. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  7457. bigX[l3] = j3 + 1;
  7458. bigY[l3] = k3;
  7459. l3 = (l3 + 1) % j4;
  7460. anIntArrayArray901[j3 + 1][k3] = 8;
  7461. anIntArrayArray825[j3 + 1][k3] = l4;
  7462. }
  7463. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  7464. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7465. bigX[l3] = j3;
  7466. bigY[l3] = k3 - 1;
  7467. l3 = (l3 + 1) % j4;
  7468. anIntArrayArray901[j3][k3 - 1] = 1;
  7469. anIntArrayArray825[j3][k3 - 1] = l4;
  7470. }
  7471. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  7472. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7473. bigX[l3] = j3;
  7474. bigY[l3] = k3 + 1;
  7475. l3 = (l3 + 1) % j4;
  7476. anIntArrayArray901[j3][k3 + 1] = 4;
  7477. anIntArrayArray825[j3][k3 + 1] = l4;
  7478. }
  7479. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  7480. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  7481. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7482. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7483. bigX[l3] = j3 - 1;
  7484. bigY[l3] = k3 - 1;
  7485. l3 = (l3 + 1) % j4;
  7486. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7487. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7488. }
  7489. if (j3 < byte0 - 1 && k3 > 0
  7490. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  7491. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  7492. && (ai[j3 + 1][k3] & 0x1280180) == 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] = 9;
  7498. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7499. }
  7500. if (j3 > 0 && k3 < byte1 - 1
  7501. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  7502. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  7503. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7504. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7505. bigX[l3] = j3 - 1;
  7506. bigY[l3] = k3 + 1;
  7507. l3 = (l3 + 1) % j4;
  7508. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7509. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7510. }
  7511. if (j3 < byte0 - 1 && k3 < byte1 - 1
  7512. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  7513. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  7514. && (ai[j3 + 1][k3] & 0x1280180) == 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] = 12;
  7520. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7521. }
  7522. }
  7523. anInt1264 = 0;
  7524.  
  7525. if (!flag1) {
  7526. if (flag) {
  7527. int i5 = 100;
  7528. for (int k5 = 1; k5 < 2; k5++) {
  7529. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  7530. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7531. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  7532. && anIntArrayArray825[i6][l6] < i5) {
  7533. i5 = anIntArrayArray825[i6][l6];
  7534. j3 = i6;
  7535. k3 = l6;
  7536. anInt1264 = 1;
  7537. flag1 = true;
  7538. }
  7539.  
  7540. }
  7541.  
  7542. if (flag1)
  7543. break;
  7544. }
  7545.  
  7546. }
  7547. if (!flag1)
  7548. return false;
  7549. }
  7550. i4 = 0;
  7551. bigX[i4] = j3;
  7552. bigY[i4++] = k3;
  7553. int l5;
  7554. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  7555. if (j5 != l5) {
  7556. l5 = j5;
  7557. bigX[i4] = j3;
  7558. bigY[i4++] = k3;
  7559. }
  7560. if ((j5 & 2) != 0)
  7561. j3++;
  7562. else if ((j5 & 8) != 0)
  7563. j3--;
  7564. if ((j5 & 1) != 0)
  7565. k3++;
  7566. else if ((j5 & 4) != 0)
  7567. k3--;
  7568. }
  7569.  
  7570. /*if (keyArray[5] == 1) {
  7571. stream.createFrame(103);
  7572. stream.writeWordBigEndian(("tele2 " + bigX[0] + " " + bigY[0]).length() + 1);
  7573. stream.writeString("tele2 " + bigX[0] + " " + bigY[0]);
  7574. return false;
  7575. }*/
  7576.  
  7577. // if(cancelWalk) { return i4 > 0; }
  7578.  
  7579. if (i4 > 0) {
  7580.  
  7581. int k4 = i4;
  7582. if (k4 > 25)
  7583. k4 = 25;
  7584. i4--;
  7585. int k6 = bigX[i4];
  7586. int i7 = bigY[i4];
  7587. anInt1288 += k4;
  7588. if (anInt1288 >= 92) {
  7589. stream.createFrame(36);
  7590. stream.writeDWord(0);
  7591. anInt1288 = 0;
  7592. }
  7593. if (i == 0) {
  7594. stream.createFrame(164);
  7595. stream.writeWordBigEndian(k4 + k4 + 3);
  7596. }
  7597. if (i == 1) {
  7598. stream.createFrame(248);
  7599. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7600. }
  7601. if (i == 2) {
  7602. stream.createFrame(98);
  7603. stream.writeWordBigEndian(k4 + k4 + 3);
  7604. }
  7605. stream.method433(k6 + baseX);
  7606. destX = bigX[0];
  7607. destY = bigY[0];
  7608. for (int j7 = 1; j7 < k4; j7++) {
  7609. i4--;
  7610. stream.writeWordBigEndian(bigX[i4] - k6);
  7611. stream.writeWordBigEndian(bigY[i4] - i7);
  7612. }
  7613.  
  7614. stream.method431(i7 + baseY);
  7615. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7616. return true;
  7617. }
  7618. return i != 1;
  7619. }
  7620.  
  7621. public void playSong(int id) {
  7622. if (currentSong != id) {
  7623. nextSong = id;
  7624. songChanging = true;
  7625. onDemandFetcher.method558(2, nextSong);
  7626. currentSong = id;
  7627. }
  7628. }
  7629.  
  7630. public void method86(Stream stream) {
  7631. for (int j = 0; j < anInt893; j++) {
  7632. int k = anIntArray894[j];
  7633. NPC npc = npcArray[k];
  7634. int l = stream.readUnsignedByte();
  7635. if ((l & 0x10) != 0) {
  7636. int i1 = stream.method434();
  7637. if (i1 == 65535)
  7638. i1 = -1;
  7639. int i2 = stream.readUnsignedByte();
  7640. if (i1 == npc.anim && i1 != -1) {
  7641. int l2 = Animation.anims[i1].anInt365;
  7642. if (l2 == 1) {
  7643. npc.anInt1527 = 0;
  7644. npc.anInt1528 = 0;
  7645. npc.anInt1529 = i2;
  7646. npc.anInt1530 = 0;
  7647. }
  7648. if (l2 == 2)
  7649. npc.anInt1530 = 0;
  7650. } else if (i1 == -1
  7651. || npc.anim == -1
  7652. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  7653. npc.anim = i1;
  7654. npc.anInt1527 = 0;
  7655. npc.anInt1528 = 0;
  7656. npc.anInt1529 = i2;
  7657. npc.anInt1530 = 0;
  7658. npc.anInt1542 = npc.smallXYIndex;
  7659. }
  7660. }
  7661. if((l & 8) != 0)
  7662. {
  7663. int j1 = stream.method426();
  7664. int j2 = stream.method427();
  7665. int icon = stream.readUnsignedByte();
  7666. npc.updateHitData(j2, j1, loopCycle, icon);
  7667. npc.loopCycleStatus = loopCycle + 300;
  7668. npc.currentHealth = stream.method426();
  7669. npc.maxHealth = stream.readUnsignedByte();
  7670. }
  7671. if ((l & 0x80) != 0) {
  7672. npc.anInt1520 = stream.readUnsignedWord();
  7673. int k1 = stream.readDWord();
  7674. npc.anInt1524 = k1 >> 16;
  7675. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7676. npc.anInt1521 = 0;
  7677. npc.anInt1522 = 0;
  7678. if (npc.anInt1523 > loopCycle)
  7679. npc.anInt1521 = -1;
  7680. if (npc.anInt1520 == 65535)
  7681. npc.anInt1520 = -1;
  7682. }
  7683. if ((l & 0x20) != 0) {
  7684. npc.interactingEntity = stream.readUnsignedWord();
  7685. if (npc.interactingEntity == 65535)
  7686. npc.interactingEntity = -1;
  7687. }
  7688. if ((l & 1) != 0) {
  7689. npc.textSpoken = stream.readString();
  7690. npc.textCycle = 100;
  7691. // entityMessage(npc);
  7692.  
  7693. }
  7694. if((l & 0x40) != 0)
  7695. {
  7696. int l1 = stream.method427();
  7697. int k2 = stream.method428();
  7698. int icon = stream.readUnsignedByte();
  7699. npc.updateHitData(k2, l1, loopCycle, icon);
  7700. npc.loopCycleStatus = loopCycle + 300;
  7701. npc.currentHealth = stream.method428();
  7702. npc.maxHealth = stream.method427();
  7703. }
  7704. if ((l & 2) != 0) {
  7705. npc.desc = EntityDef.forID(stream.method436());
  7706. npc.anInt1540 = npc.desc.aByte68;
  7707. npc.anInt1504 = npc.desc.anInt79;
  7708. npc.anInt1554 = npc.desc.walkAnim;
  7709. npc.anInt1555 = npc.desc.anInt58;
  7710. npc.anInt1556 = npc.desc.anInt83;
  7711. npc.anInt1557 = npc.desc.anInt55;
  7712. npc.anInt1511 = npc.desc.standAnim;
  7713. }
  7714. if ((l & 4) != 0) {
  7715. npc.anInt1538 = stream.method434();
  7716. npc.anInt1539 = stream.method434();
  7717. }
  7718. }
  7719. }
  7720.  
  7721. public void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  7722. if (menuActionRow >= 400)
  7723. return;
  7724. if (entityDef.childrenIDs != null)
  7725. entityDef = entityDef.method161();
  7726. if (entityDef == null)
  7727. return;
  7728. if (!entityDef.aBoolean84)
  7729. return;
  7730. String s = entityDef.name;
  7731. if (entityDef.combatLevel != 0)
  7732. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7733. if (itemSelected == 1) {
  7734. menuActionName[menuActionRow] = "Use " + selectedItemName
  7735. + " with @yel@" + s;
  7736. menuActionIds[menuActionRow] = 582;
  7737. menuActionCmd1[menuActionRow] = i;
  7738. menuActionCmd2[menuActionRow] = k;
  7739. menuActionCmd3[menuActionRow] = j;
  7740. menuActionRow++;
  7741. return;
  7742. }
  7743. if (spellSelected == 1) {
  7744. if ((spellUsableOn & 2) == 2) {
  7745. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7746. menuActionIds[menuActionRow] = 413;
  7747. menuActionCmd1[menuActionRow] = i;
  7748. menuActionCmd2[menuActionRow] = k;
  7749. menuActionCmd3[menuActionRow] = j;
  7750. menuActionRow++;
  7751. }
  7752. } else {
  7753. if (entityDef.actions != null) {
  7754. for (int l = 4; l >= 0; l--)
  7755. if (entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  7756. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7757. if (l == 0)
  7758. menuActionIds[menuActionRow] = 20;
  7759. if (l == 1)
  7760. menuActionIds[menuActionRow] = 412;
  7761. if (l == 2)
  7762. menuActionIds[menuActionRow] = 225;
  7763. if (l == 3)
  7764. menuActionIds[menuActionRow] = 965;
  7765. if (l == 4)
  7766. menuActionIds[menuActionRow] = 478;
  7767. menuActionCmd1[menuActionRow] = i;
  7768. menuActionCmd2[menuActionRow] = k;
  7769. menuActionCmd3[menuActionRow] = j;
  7770. menuActionRow++;
  7771. }
  7772.  
  7773. }
  7774. if (entityDef.actions != null) {
  7775. for (int i1 = 4; i1 >= 0; i1--)
  7776. if (entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  7777. char c = '\0';
  7778. if (entityDef.combatLevel > myPlayer.combatLevel)
  7779. c = '\u07D0';
  7780.  
  7781. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7782. if (i1 == 0)
  7783. menuActionIds[menuActionRow] = 20 + c;
  7784. if (i1 == 1)
  7785. menuActionIds[menuActionRow] = 412 + c;
  7786. if (i1 == 2)
  7787. menuActionIds[menuActionRow] = 225 + c;
  7788. if (i1 == 3)
  7789. menuActionIds[menuActionRow] = 965 + c;
  7790. if (i1 == 4)
  7791. menuActionIds[menuActionRow] = 478 + c;
  7792. menuActionCmd1[menuActionRow] = i;
  7793. menuActionCmd2[menuActionRow] = k;
  7794. menuActionCmd3[menuActionRow] = j;
  7795. menuActionRow++;
  7796. }
  7797.  
  7798. }
  7799. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  7800. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.id + "@gre@)";
  7801. } else {
  7802. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7803. }
  7804. menuActionIds[menuActionRow] = 1025;
  7805. menuActionCmd1[menuActionRow] = i;
  7806. menuActionCmd2[menuActionRow] = k;
  7807. menuActionCmd3[menuActionRow] = j;
  7808. menuActionRow++;
  7809. }
  7810. }
  7811.  
  7812. public void buildAtPlayerMenu(int i, int j, Player player, int k) {
  7813. if (player == myPlayer)
  7814. return;
  7815. if (menuActionRow >= 400)
  7816. return;
  7817. String s;
  7818. if (player.skill == 0)
  7819. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7820. else
  7821. s = player.name + " (skill-" + player.skill + ")";
  7822. if (itemSelected == 1) {
  7823. menuActionName[menuActionRow] = "Use " + selectedItemName
  7824. + " with @whi@" + s;
  7825. menuActionIds[menuActionRow] = 491;
  7826. menuActionCmd1[menuActionRow] = j;
  7827. menuActionCmd2[menuActionRow] = i;
  7828. menuActionCmd3[menuActionRow] = k;
  7829. menuActionRow++;
  7830. } else if (spellSelected == 1) {
  7831. if ((spellUsableOn & 8) == 8) {
  7832. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7833. menuActionIds[menuActionRow] = 365;
  7834. menuActionCmd1[menuActionRow] = j;
  7835. menuActionCmd2[menuActionRow] = i;
  7836. menuActionCmd3[menuActionRow] = k;
  7837. menuActionRow++;
  7838. }
  7839. } else {
  7840. for (int l = 4; l >= 0; l--)
  7841. if (atPlayerActions[l] != null) {
  7842. menuActionName[menuActionRow] = atPlayerActions[l]
  7843. + " @whi@" + s;
  7844. char c = '\0';
  7845. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  7846. if (player.combatLevel > myPlayer.combatLevel)
  7847. c = '\u07D0';
  7848. if (myPlayer.team != 0 && player.team != 0)
  7849. if (myPlayer.team == player.team)
  7850. c = '\u07D0';
  7851. else
  7852. c = '\0';
  7853. } else if (atPlayerArray[l])
  7854. c = '\u07D0';
  7855. if (l == 0)
  7856. menuActionIds[menuActionRow] = 561 + c;
  7857. if (l == 1)
  7858. menuActionIds[menuActionRow] = 779 + c;
  7859. if (l == 2)
  7860. menuActionIds[menuActionRow] = 27 + c;
  7861. if (l == 3)
  7862. menuActionIds[menuActionRow] = 577 + c;
  7863. if (l == 4)
  7864. menuActionIds[menuActionRow] = 729 + c;
  7865. menuActionCmd1[menuActionRow] = j;
  7866. menuActionCmd2[menuActionRow] = i;
  7867. menuActionCmd3[menuActionRow] = k;
  7868. menuActionRow++;
  7869. }
  7870.  
  7871. }
  7872. for (int i1 = 0; i1 < menuActionRow; i1++)
  7873. if (menuActionIds[i1] == 516) {
  7874. menuActionName[i1] = "Walk here @whi@" + s;
  7875. return;
  7876. }
  7877.  
  7878. }
  7879.  
  7880. public void method89(Class30_Sub1 class30_sub1) {
  7881. int i = 0;
  7882. int j = -1;
  7883. int k = 0;
  7884. int l = 0;
  7885. if (class30_sub1.anInt1296 == 0)
  7886. i = worldController.method300(class30_sub1.anInt1295,
  7887. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7888. if (class30_sub1.anInt1296 == 1)
  7889. i = worldController.method301(class30_sub1.anInt1295,
  7890. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7891. if (class30_sub1.anInt1296 == 2)
  7892. i = worldController.method302(class30_sub1.anInt1295,
  7893. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7894. if (class30_sub1.anInt1296 == 3)
  7895. i = worldController.method303(class30_sub1.anInt1295,
  7896. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7897. if (i != 0) {
  7898. int i1 = worldController.method304(class30_sub1.anInt1295,
  7899. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7900. j = i >> 14 & 0x7fff;
  7901. k = i1 & 0x1f;
  7902. l = i1 >> 6;
  7903. }
  7904. class30_sub1.anInt1299 = j;
  7905. class30_sub1.anInt1301 = k;
  7906. class30_sub1.anInt1300 = l;
  7907. }
  7908.  
  7909. /*public void method90() {
  7910. for (int i = 0; i < currentSound; i++)
  7911. if (soundDelay[i] <= 0) {
  7912. boolean flag1 = false;
  7913. try {
  7914. if (sound[i] == anInt874
  7915. && soundType[i] == anInt1289) {
  7916. if (!replayWave())
  7917. flag1 = true;
  7918. } else {
  7919. Stream stream = Sounds.method241(soundType[i],
  7920. sound[i]);
  7921. if (System.currentTimeMillis()
  7922. + (long) (stream.currentOffset / 22) > aLong1172
  7923. + (long) (anInt1257 / 22)) {
  7924. anInt1257 = stream.currentOffset;
  7925. aLong1172 = System.currentTimeMillis();
  7926. if (saveWave(stream.buffer, stream.currentOffset)) {
  7927. anInt874 = sound[i];
  7928. anInt1289 = soundType[i];
  7929. } else {
  7930. flag1 = true;
  7931. }
  7932. }
  7933. }
  7934. } catch (Exception exception) {
  7935. }
  7936. if (!flag1 || soundDelay[i] == -5) {
  7937. currentSound--;
  7938. for (int j = i; j < currentSound; j++) {
  7939. sound[j] = sound[j + 1];
  7940. soundType[j] = soundType[j + 1];
  7941. soundDelay[j] = soundDelay[j + 1];
  7942. }
  7943.  
  7944. i--;
  7945. } else {
  7946. soundDelay[i] = -5;
  7947. }
  7948. } else {
  7949. soundDelay[i]--;
  7950. }
  7951.  
  7952. if (prevSong > 0) {
  7953. prevSong -= 20;
  7954. if (prevSong < 0)
  7955. prevSong = 0;
  7956. if (prevSong == 0 && musicEnabled && !lowMem) {
  7957. nextSong = currentSong;
  7958. songChanging = true;
  7959. onDemandFetcher.method558(2, nextSong);
  7960. }
  7961. }
  7962. }*/
  7963.  
  7964. public void playSound(int id, int type, int delay, int volume) {
  7965. sound[currentSound] = id;
  7966. soundType[currentSound] = type;
  7967. soundDelay[currentSound] = delay + Sound.anIntArray326[id];
  7968. soundVolume[currentSound] = volume;
  7969. currentSound++;
  7970. }
  7971.  
  7972. public final void method90() {
  7973. for (int index = 0; index < currentSound; index++) {
  7974. //if (soundDelay[index] <= 0) {
  7975. boolean flag1 = false;
  7976. try {
  7977. Stream stream = Sound.method241(soundType[index], sound[index]);
  7978. new SoundPlayer((InputStream) new ByteArrayInputStream(stream.buffer, 0, stream.currentOffset), soundVolume[index], soundDelay[index]);
  7979. if (System.currentTimeMillis() + (long) (stream.currentOffset / 22) > aLong1172 + (long) (anInt1257 / 22)) {
  7980. anInt1257 = stream.currentOffset;
  7981. aLong1172 = System.currentTimeMillis();
  7982. }
  7983. } catch (Exception exception) {
  7984. exception.printStackTrace();
  7985. }
  7986. if (!flag1 || soundDelay[index] == -5) {
  7987. currentSound--;
  7988. for (int j = index; j < currentSound; j++) {
  7989. sound[j] = sound[j + 1];
  7990. soundType[j] = soundType[j + 1];
  7991. soundDelay[j] = soundDelay[j + 1];
  7992. soundVolume[j] = soundVolume[j + 1];
  7993. }
  7994. index--;
  7995. } else {
  7996. soundDelay[index] = -5;
  7997. }
  7998. /*} else {
  7999. soundDelay[index]--;
  8000. }*/
  8001. }
  8002.  
  8003. if (previousSong > 0) {
  8004. previousSong -= 20;
  8005. if (previousSong < 0)
  8006. previousSong = 0;
  8007. if (previousSong == 0 && musicEnabled) {
  8008. nextSong = currentSong;
  8009. songChanging = true;
  8010. onDemandFetcher.method558(2, nextSong);
  8011. }
  8012. }
  8013. }
  8014.  
  8015. public String indexLocation(int cacheIndex, int index) {
  8016. return SignLink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  8017. }
  8018.  
  8019. public void repackCacheIndex(int cacheIndex) {
  8020. System.out.println("Started repacking index " + cacheIndex + ".");
  8021. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  8022. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  8023. try {
  8024. for (int index = 0; index < indexLength; index++) {
  8025. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  8026. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  8027. if(data != null && data.length > 0) {
  8028. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  8029. System.out.println("Repacked " + fileIndex + ".");
  8030. } else {
  8031. System.out.println("Unable to locate index " + fileIndex + ".");
  8032. }
  8033. }
  8034. } catch(Exception e) {
  8035. System.out.println("Error packing cache index " + cacheIndex + ".");
  8036. }
  8037. System.out.println("Finished repacking " + cacheIndex + ".");
  8038. }
  8039.  
  8040. public byte[] fileToByteArray(int cacheIndex, int index) {
  8041. try {
  8042. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  8043. return null;
  8044. }
  8045. File file = new File(indexLocation(cacheIndex, index));
  8046. byte[] fileData = new byte[(int)file.length()];
  8047. FileInputStream fis = new FileInputStream(file);
  8048. fis.read(fileData);
  8049. fis.close();
  8050. return fileData;
  8051. } catch(Exception e) {
  8052. return null;
  8053. }
  8054. }
  8055. @SuppressWarnings("unused")
  8056. void startUp() {
  8057. drawNewLoadingText(150, "Starting up");
  8058. update.run();
  8059. if (SignLink.sunjava)
  8060. super.minDelay = 5;
  8061. if (aBoolean993) {
  8062. // rsAlreadyLoaded = true;
  8063. // return;
  8064. }
  8065. aBoolean993 = true;
  8066. boolean flag = true;
  8067. String s = getDocumentBaseHost();
  8068. if (SignLink.cache_dat != null) {
  8069. for (int i = 0; i < 6; i++)
  8070. decompressors[i] = new Decompressor(SignLink.cache_dat, SignLink.cache_idx[i], i + 1);
  8071. }
  8072.  
  8073.  
  8074. try {
  8075. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  8076. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8077. smallHit = new TextDrawingArea(false, "hit_full", titleStreamLoader);
  8078. bigHit = new TextDrawingArea(true, "critical_full", titleStreamLoader);
  8079. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8080. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8081. aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8082. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  8083. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  8084. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  8085. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  8086. LoginBox = new Sprite("Login/loginBox");
  8087. LoginButton = new Sprite("Login/loginButton");
  8088. LoginButtonHover = new Sprite("Login/loginButtonHover");
  8089. TypeIn = new Sprite("Login/typeIn");
  8090. TypeInHover = new Sprite("Login/typeInHover");
  8091. RememberNo = new Sprite("Login/rememberNo");
  8092. RememberYes = new Sprite("Login/rememberYes");
  8093. Logo = new Sprite("Login/logo");
  8094. BackgroundFix = new Sprite("/BG/mainBg");
  8095. drawLogo();
  8096. loadTitleScreen();
  8097. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8098. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8099. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8100. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8101. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8102. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8103. byteGroundArray = new byte[4][104][104];
  8104. intGroundArray = new int[4][105][105];
  8105. worldController = new WorldController(intGroundArray);
  8106. for (int j = 0; j < 4; j++)
  8107. aClass11Array1230[j] = new TileSettings();
  8108.  
  8109. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  8110. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  8111. "versionlist", expectedCRCs[5], 60);
  8112. drawNewLoadingText(225, "Connecting to update server");
  8113. onDemandFetcher = new OnDemandFetcher();
  8114. onDemandFetcher.start(streamLoader_6, this);
  8115. Model.method459(65535, onDemandFetcher);
  8116. Texture.init(1420, onDemandFetcher);
  8117. Class36.method528(65535);
  8118. //preloadModels();
  8119. // models();
  8120. // repackCacheIndex(1);
  8121. drawNewLoadingText(300, "Unpacking media");
  8122. /* Custom sprite unpacking */
  8123. HPBarFull = new Sprite("player/hp 0");
  8124. HPBarEmpty = new Sprite("player/hp 1");
  8125. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8126. // mapIcon = new Sprite(streamLoader_2, "mapfunction", 70);
  8127. chatArea = new Sprite("chatarea");
  8128. tabArea = new Sprite("Gameframe/tabarea");
  8129. worldMapIcon = new Sprite("mapicon");
  8130. logIconH = new Sprite("logiconh");
  8131. logIconC = new Sprite("logiconc");
  8132. mapArea = new Sprite("maparea");
  8133. for(int i = 1; i < 19; i++) {
  8134. if (i == 12 || i == 13)
  8135. continue;
  8136.  
  8137. ORBS[i] = new Sprite("sprites/gameframe/orbs/orbs " + i);
  8138. if (i == 16 || i == 18)
  8139. ORBS[i].setTransparency(255, 0, 255);
  8140. }
  8141. /**/
  8142. mapBack = new Background(streamLoader_2, "mapback", 0);
  8143. customSideIcons[1].setTransparency(255, 0, 255);
  8144. customSideIcons[2].setTransparency(255, 0, 255);
  8145.  
  8146. for(int i = 0; i < 3; i++) {
  8147. counter[i] = new Sprite("/XP/XP "+i);
  8148. counter[i].setTransparency(255, 0, 255);
  8149. }
  8150. for (int c1 = 0; c1 <= 3; c1++)
  8151. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  8152. for (int j3 = 0; j3 <= 14; j3++)
  8153. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  8154. for (int r1 = 0; r1 < 5; r1++)
  8155. redStones[r1] = new Sprite("Gameframe/redstones " + r1);
  8156.  
  8157. for (int i4 = 0; i4 < 9; i4++) {
  8158. hitMark[i4] = new Sprite("/Hits/hit " + i4);
  8159. hitMark[i4].setTransparency(255, 0, 255);
  8160. }
  8161.  
  8162. for(int i4 = 0; i4 < 5; i4++) {
  8163. hitIcon[i4] = new Sprite("/Hits/icon " + i4);
  8164. }
  8165.  
  8166. Sprite[] clanIcons = new Sprite[9];
  8167. for (int index = 0; index < clanIcons.length; index++) {
  8168. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);
  8169. }
  8170. RSFont.unpackImages(modIcons, clanIcons);
  8171. compass = new Sprite(streamLoader_2, "compass", 0);
  8172. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  8173. mapEdge.method345();
  8174. try {
  8175. for (int k3 = 0; k3 < 100; k3++)
  8176. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  8177. } catch (Exception _ex) {
  8178. }
  8179. try {
  8180. for (int l3 = 0; l3 < 100; l3++)
  8181. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  8182. } catch (Exception _ex) {
  8183. }
  8184. try {
  8185. for (int i4 = 0; i4 < 20; i4++)
  8186. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8187. } catch (Exception _ex) {
  8188. }
  8189. try {
  8190. for (int h1 = 0; h1 < 6; h1++)
  8191. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  8192. } catch (Exception _ex) {
  8193. }
  8194. try {
  8195. for (int j4 = 0; j4 < 18; j4++)
  8196. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  8197. for (int j45 = 0; j45 < 3; j45++)
  8198. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45);
  8199. } catch (Exception _ex) {
  8200. }
  8201. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8202. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8203. for (int k4 = 0; k4 < 8; k4++)
  8204. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8205.  
  8206. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8207. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8208. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8209. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8210. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8211. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8212. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8213.  
  8214. for (int l4 = 1; l4 < 11; l4++) {
  8215. modIcons[l4] = new Sprite("Crowns/" + l4);
  8216. modIcons[l4].setTransparency(255, 0, 255);
  8217. }
  8218.  
  8219. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8220. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8221. sprite.method346(0, 0);
  8222. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8223. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8224. sprite.method346(0, 0);
  8225. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  8226. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8227. sprite.method346(0, 0);
  8228. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  8229. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8230. sprite.method346(0, 0);
  8231. int i5 = (int) (Math.random() * 21D) - 10;
  8232. int j5 = (int) (Math.random() * 21D) - 10;
  8233. int k5 = (int) (Math.random() * 21D) - 10;
  8234. int l5 = (int) (Math.random() * 41D) - 20;
  8235. for (int i6 = 0; i6 < 100; i6++) {
  8236. if (mapFunctions[i6] != null)
  8237. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8238. if (mapScenes[i6] != null)
  8239. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8240. }
  8241.  
  8242. drawNewLoadingText(375, "Unpacking textures");
  8243. Rasterizer.calculatePalette(0.8F);
  8244. Rasterizer.resetTextures();
  8245. drawNewLoadingText(450, "Unpacking config");
  8246. Animation.unpackConfig(streamLoader);
  8247. ObjectDef.unpackConfig(streamLoader);
  8248. Flo.unpackConfig(streamLoader);
  8249. TextureDef.unpackConfig(streamLoader.getDataForName("textures.dat"));
  8250. FloorOverlay.unpackConfig(streamLoader);
  8251. ItemDef.unpackConfig(streamLoader);
  8252. EntityDef.unpackConfig(streamLoader);
  8253. IDK.unpackConfig(streamLoader);
  8254. SpotAnim.unpackConfig(streamLoader);
  8255. Varp.unpackConfig(streamLoader);
  8256. VarBit.unpackConfig(streamLoader);
  8257. ItemDef.isMembers = isMembers;
  8258. if (!lowMem) {
  8259. drawNewLoadingText(525, "Unpacking sounds");
  8260. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  8261. Stream stream = new Stream(abyte0);
  8262. Sound.unpack(stream);
  8263. }
  8264. drawNewLoadingText(600, "Unpacking interfaces");
  8265. TextDrawingArea allFonts[] = { smallText, aTextDrawingArea_1271,
  8266. chatTextDrawingArea, aTextDrawingArea_1273 };
  8267. RSInterface.unpack(streamLoader_1, allFonts, streamLoader_2);
  8268. drawNewLoadingText(750, "Preparing game engine");
  8269. for (int j6 = 0; j6 < 33; j6++) {
  8270. int k6 = 999;
  8271. int i7 = 0;
  8272. for (int k7 = 0; k7 < 34; k7++) {
  8273. if (mapBack.aByteArray1450[k7 + j6
  8274. * mapBack.anInt1452] == 0) {
  8275. if (k6 == 999)
  8276. k6 = k7;
  8277. continue;
  8278. }
  8279. if (k6 == 999)
  8280. continue;
  8281. i7 = k7;
  8282. break;
  8283. }
  8284.  
  8285. anIntArray968[j6] = k6;
  8286. anIntArray1057[j6] = i7 - k6;
  8287. }
  8288.  
  8289. for (int l6 = 5; l6 < 156; l6++) {
  8290. int j7 = 999;
  8291. int l7 = 0;
  8292. for (int j8 = 25; j8 < 172; j8++) {
  8293. if (mapBack.aByteArray1450[j8 + l6
  8294. * mapBack.anInt1452] == 0
  8295. && (j8 > 34 || l6 > 34)) {
  8296. if (j7 == 999)
  8297. j7 = j8;
  8298. continue;
  8299. }
  8300. if (j7 == 999)
  8301. continue;
  8302. l7 = j8;
  8303. break;
  8304. }
  8305.  
  8306. anIntArray1052[l6 - 5] = j7 - 25;
  8307. anIntArray1229[l6 - 5] = l7 - j7;
  8308. }
  8309.  
  8310. Rasterizer.setBounds(765, 503);
  8311. fullScreenTextureArray = Rasterizer.lineOffsets;
  8312. Rasterizer.setBounds(519, 165);
  8313. anIntArray1180 = Rasterizer.lineOffsets;
  8314. Rasterizer.setBounds(246, 335);
  8315. anIntArray1181 = Rasterizer.lineOffsets;
  8316. Rasterizer.setBounds(512, 334);
  8317. anIntArray1182 = Rasterizer.lineOffsets;
  8318. int ai[] = new int[9];
  8319. for (int i8 = 0; i8 < 9; i8++) {
  8320. int k8 = 128 + i8 * 32 + 15;
  8321. int l8 = 600 + k8 * 3;
  8322. int i9 = Rasterizer.SINE[k8];
  8323. ai[i8] = l8 * i9 >> 16;
  8324. }
  8325.  
  8326. WorldController.method310(500, 800, 512, 334, ai);
  8327. Censor.loadConfig(streamLoader_4);
  8328. mouseDetection = new MouseDetection(this);
  8329. startRunnable(mouseDetection, 10);
  8330. Animable_Sub5.ClientInstance = this;
  8331. ObjectDef.clientInstance = this;
  8332. EntityDef.ClientInstance = this;
  8333. return;
  8334. } catch (Exception exception) {
  8335. exception.printStackTrace();
  8336. SignLink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8337. }
  8338. loadingError = true;
  8339. }
  8340.  
  8341. public void method91(Stream stream, int i) {
  8342. while (stream.bitPosition + 10 < i * 8) {
  8343. int j = stream.readBits(11);
  8344. if (j == 2047)
  8345. break;
  8346. if (playerArray[j] == null) {
  8347. playerArray[j] = new Player();
  8348. if (aStreamArray895s[j] != null)
  8349. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8350. }
  8351. playerIndices[playerCount++] = j;
  8352. Player player = playerArray[j];
  8353. player.anInt1537 = loopCycle;
  8354. int k = stream.readBits(1);
  8355. if (k == 1)
  8356. anIntArray894[anInt893++] = j;
  8357. int l = stream.readBits(1);
  8358. int i1 = stream.readBits(5);
  8359. if (i1 > 15)
  8360. i1 -= 32;
  8361. int j1 = stream.readBits(5);
  8362. if (j1 > 15)
  8363. j1 -= 32;
  8364. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  8365. l == 1);
  8366. }
  8367. stream.finishBitAccess();
  8368. }
  8369.  
  8370. public void processMainScreenClick() {
  8371. if (anInt1021 != 0)
  8372. return;
  8373. if (super.clickMode3 == 1) {
  8374. int i = super.saveClickX - 25 - 545;
  8375. int j = super.saveClickY - 5 - 4;
  8376. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  8377. i -= 73;
  8378. j -= 75;
  8379. int k = viewRotation + minimapRotation & 0x7ff;
  8380. int i1 = Rasterizer.SINE[k];
  8381. int j1 = Rasterizer.COSINE[k];
  8382. i1 = i1 * (minimapZoom + 256) >> 8;
  8383. j1 = j1 * (minimapZoom + 256) >> 8;
  8384. int k1 = j * i1 + i * j1 >> 11;
  8385. int l1 = j * j1 - i * i1 >> 11;
  8386. int i2 = myPlayer.x + k1 >> 7;
  8387. int j2 = myPlayer.y - l1 >> 7;
  8388. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  8389. j2, myPlayer.smallX[0], true, i2);
  8390. if (flag1) {
  8391. stream.writeWordBigEndian(i);
  8392. stream.writeWordBigEndian(j);
  8393. stream.writeWord(viewRotation);
  8394. stream.writeWordBigEndian(57);
  8395. stream.writeWordBigEndian(minimapRotation);
  8396. stream.writeWordBigEndian(minimapZoom);
  8397. stream.writeWordBigEndian(89);
  8398. stream.writeWord(myPlayer.x);
  8399. stream.writeWord(myPlayer.y);
  8400. stream.writeWordBigEndian(anInt1264);
  8401. stream.writeWordBigEndian(63);
  8402. }
  8403. }
  8404. anInt1117++;
  8405. if (anInt1117 > 1151) {
  8406. anInt1117 = 0;
  8407. stream.createFrame(246);
  8408. stream.writeWordBigEndian(0);
  8409. int l = stream.currentOffset;
  8410. if ((int) (Math.random() * 2D) == 0)
  8411. stream.writeWordBigEndian(101);
  8412. stream.writeWordBigEndian(197);
  8413. stream.writeWord((int) (Math.random() * 65536D));
  8414. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8415. stream.writeWordBigEndian(67);
  8416. stream.writeWord(14214);
  8417. if ((int) (Math.random() * 2D) == 0)
  8418. stream.writeWord(29487);
  8419. stream.writeWord((int) (Math.random() * 65536D));
  8420. if ((int) (Math.random() * 2D) == 0)
  8421. stream.writeWordBigEndian(220);
  8422. stream.writeWordBigEndian(180);
  8423. stream.writeBytes(stream.currentOffset - l);
  8424. }
  8425. }
  8426. }
  8427.  
  8428. public String interfaceIntToString(int j) {
  8429. if (j < 0x3b9ac9ff)
  8430. return String.valueOf(j);
  8431. else
  8432. return "*";
  8433. }
  8434.  
  8435. public void showErrorScreen() {
  8436. Graphics g = getGameComponent().getGraphics();
  8437. g.setColor(Color.black);
  8438. g.fillRect(0, 0, 765, 503);
  8439. method4(1);
  8440. if (loadingError) {
  8441. aBoolean831 = false;
  8442. g.setFont(new Font("Helvetica", 1, 16));
  8443. g.setColor(Color.yellow);
  8444. int k = 35;
  8445. g.drawString(
  8446. "Sorry, an error has occured whilst loading RuneScape",
  8447. 30, k);
  8448. k += 50;
  8449. g.setColor(Color.white);
  8450. g.drawString("To fix this try the following (in order):", 30, k);
  8451. k += 50;
  8452. g.setColor(Color.white);
  8453. g.setFont(new Font("Helvetica", 1, 12));
  8454. g.drawString(
  8455. "1: Try closing ALL open web-browser windows, and reloading",
  8456. 30, k);
  8457. k += 30;
  8458. g.drawString(
  8459. "2: Try clearing your web-browsers cache from tools->internet options",
  8460. 30, k);
  8461. k += 30;
  8462. g.drawString("3: Try using a different game-world", 30, k);
  8463. k += 30;
  8464. g.drawString("4: Try rebooting your computer", 30, k);
  8465. k += 30;
  8466. g.drawString(
  8467. "5: Try selecting a different version of Java from the play-game menu",
  8468. 30, k);
  8469. }
  8470. if (genericLoadingError) {
  8471. aBoolean831 = false;
  8472. g.setFont(new Font("Helvetica", 1, 20));
  8473. g.setColor(Color.white);
  8474. g.drawString("Error - unable to load game!", 50, 50);
  8475. g.drawString("To play RuneScape make sure you play from", 50,
  8476. 100);
  8477. g.drawString("http://www.RuneScape.com", 50, 150);
  8478. }
  8479. if (rsAlreadyLoaded) {
  8480. aBoolean831 = false;
  8481. g.setColor(Color.yellow);
  8482. int l = 35;
  8483. g.drawString(
  8484. "Error a copy of RuneScape already appears to be loaded",
  8485. 30, l);
  8486. l += 50;
  8487. g.setColor(Color.white);
  8488. g.drawString("To fix this try the following (in order):", 30, l);
  8489. l += 50;
  8490. g.setColor(Color.white);
  8491. g.setFont(new Font("Helvetica", 1, 12));
  8492. g.drawString(
  8493. "1: Try closing ALL open web-browser windows, and reloading",
  8494. 30, l);
  8495. l += 30;
  8496. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8497. l += 30;
  8498. }
  8499. }
  8500.  
  8501. public URL getCodeBase() {
  8502. try {
  8503. return new URL(server + ":" + (80 + portOff));
  8504. } catch (Exception _ex) {
  8505. }
  8506. return null;
  8507. }
  8508.  
  8509. public void method95() {
  8510. for (int j = 0; j < npcCount; j++) {
  8511. int k = npcIndices[j];
  8512. NPC npc = npcArray[k];
  8513. if (npc != null)
  8514. method96(npc);
  8515. }
  8516. }
  8517.  
  8518. public void method96(Entity entity) {
  8519. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  8520. || entity.y >= 13184) {
  8521. entity.anim = -1;
  8522. entity.anInt1520 = -1;
  8523. entity.anInt1547 = 0;
  8524. entity.anInt1548 = 0;
  8525. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8526. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8527. entity.method446();
  8528. }
  8529. if (entity == myPlayer
  8530. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  8531. entity.anim = -1;
  8532. entity.anInt1520 = -1;
  8533. entity.anInt1547 = 0;
  8534. entity.anInt1548 = 0;
  8535. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8536. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8537. entity.method446();
  8538. }
  8539. if (entity.anInt1547 > loopCycle)
  8540. method97(entity);
  8541. else if (entity.anInt1548 >= loopCycle)
  8542. method98(entity);
  8543. else
  8544. method99(entity);
  8545. method100(entity);
  8546. method101(entity);
  8547. }
  8548.  
  8549. public void method97(Entity entity) {
  8550. int i = entity.anInt1547 - loopCycle;
  8551. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8552. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8553. entity.x += (j - entity.x) / i;
  8554. entity.y += (k - entity.y) / i;
  8555. entity.anInt1503 = 0;
  8556. if (entity.anInt1549 == 0)
  8557. entity.turnDirection = 1024;
  8558. if (entity.anInt1549 == 1)
  8559. entity.turnDirection = 1536;
  8560. if (entity.anInt1549 == 2)
  8561. entity.turnDirection = 0;
  8562. if (entity.anInt1549 == 3)
  8563. entity.turnDirection = 512;
  8564. }
  8565.  
  8566. public void method98(Entity entity) {
  8567. if (entity.anInt1548 == loopCycle
  8568. || entity.anim == -1
  8569. || entity.anInt1529 != 0
  8570. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  8571. .method258(entity.anInt1527)) {
  8572. int i = entity.anInt1548 - entity.anInt1547;
  8573. int j = loopCycle - entity.anInt1547;
  8574. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8575. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8576. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8577. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8578. entity.x = (k * (i - j) + i1 * j) / i;
  8579. entity.y = (l * (i - j) + j1 * j) / i;
  8580. }
  8581. entity.anInt1503 = 0;
  8582. if (entity.anInt1549 == 0)
  8583. entity.turnDirection = 1024;
  8584. if (entity.anInt1549 == 1)
  8585. entity.turnDirection = 1536;
  8586. if (entity.anInt1549 == 2)
  8587. entity.turnDirection = 0;
  8588. if (entity.anInt1549 == 3)
  8589. entity.turnDirection = 512;
  8590. entity.anInt1552 = entity.turnDirection;
  8591. }
  8592.  
  8593. public void method99(Entity entity) {
  8594. entity.anInt1517 = entity.anInt1511;
  8595. if (entity.smallXYIndex == 0) {
  8596. entity.anInt1503 = 0;
  8597. return;
  8598. }
  8599. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8600. Animation animation = Animation.anims[entity.anim];
  8601. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  8602. entity.anInt1503++;
  8603. return;
  8604. }
  8605. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  8606. entity.anInt1503++;
  8607. return;
  8608. }
  8609. }
  8610. int i = entity.x;
  8611. int j = entity.y;
  8612. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8613. * 64;
  8614. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8615. * 64;
  8616. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  8617. entity.x = k;
  8618. entity.y = l;
  8619. return;
  8620. }
  8621. if (i < k) {
  8622. if (j < l)
  8623. entity.turnDirection = 1280;
  8624. else if (j > l)
  8625. entity.turnDirection = 1792;
  8626. else
  8627. entity.turnDirection = 1536;
  8628. } else if (i > k) {
  8629. if (j < l)
  8630. entity.turnDirection = 768;
  8631. else if (j > l)
  8632. entity.turnDirection = 256;
  8633. else
  8634. entity.turnDirection = 512;
  8635. } else if (j < l)
  8636. entity.turnDirection = 1024;
  8637. else
  8638. entity.turnDirection = 0;
  8639. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8640. if (i1 > 1024)
  8641. i1 -= 2048;
  8642. int j1 = entity.anInt1555;
  8643. if (i1 >= -256 && i1 <= 256)
  8644. j1 = entity.anInt1554;
  8645. else if (i1 >= 256 && i1 < 768)
  8646. j1 = entity.anInt1557;
  8647. else if (i1 >= -768 && i1 <= -256)
  8648. j1 = entity.anInt1556;
  8649. if (j1 == -1)
  8650. j1 = entity.anInt1554;
  8651. entity.anInt1517 = j1;
  8652. int k1 = 4;
  8653. if (entity.anInt1552 != entity.turnDirection
  8654. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8655. k1 = 2;
  8656. if (entity.smallXYIndex > 2)
  8657. k1 = 6;
  8658. if (entity.smallXYIndex > 3)
  8659. k1 = 8;
  8660. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  8661. k1 = 8;
  8662. entity.anInt1503--;
  8663. }
  8664. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8665. k1 <<= 1;
  8666. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  8667. && entity.anInt1505 != -1)
  8668. entity.anInt1517 = entity.anInt1505;
  8669. if (i < k) {
  8670. entity.x += k1;
  8671. if (entity.x > k)
  8672. entity.x = k;
  8673. } else if (i > k) {
  8674. entity.x -= k1;
  8675. if (entity.x < k)
  8676. entity.x = k;
  8677. }
  8678. if (j < l) {
  8679. entity.y += k1;
  8680. if (entity.y > l)
  8681. entity.y = l;
  8682. } else if (j > l) {
  8683. entity.y -= k1;
  8684. if (entity.y < l)
  8685. entity.y = l;
  8686. }
  8687. if (entity.x == k && entity.y == l) {
  8688. entity.smallXYIndex--;
  8689. if (entity.anInt1542 > 0)
  8690. entity.anInt1542--;
  8691. }
  8692. }
  8693.  
  8694. public void method100(Entity entity) {
  8695. if (entity.anInt1504 == 0)
  8696. return;
  8697. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  8698. NPC npc = npcArray[entity.interactingEntity];
  8699. if (npc != null) {
  8700. int i1 = entity.x - npc.x;
  8701. int k1 = entity.y - npc.y;
  8702. if (i1 != 0 || k1 != 0)
  8703. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8704. }
  8705. }
  8706. if (entity.interactingEntity >= 32768) {
  8707. int j = entity.interactingEntity - 32768;
  8708. if (j == unknownInt10)
  8709. j = myPlayerIndex;
  8710. Player player = playerArray[j];
  8711. if (player != null) {
  8712. int l1 = entity.x - player.x;
  8713. int i2 = entity.y - player.y;
  8714. if (l1 != 0 || i2 != 0)
  8715. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8716. }
  8717. }
  8718. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  8719. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  8720. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8721. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8722. if (k != 0 || j1 != 0)
  8723. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8724. entity.anInt1538 = 0;
  8725. entity.anInt1539 = 0;
  8726. }
  8727. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8728. if (l != 0) {
  8729. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8730. entity.anInt1552 = entity.turnDirection;
  8731. else if (l > 1024)
  8732. entity.anInt1552 -= entity.anInt1504;
  8733. else
  8734. entity.anInt1552 += entity.anInt1504;
  8735. entity.anInt1552 &= 0x7ff;
  8736. if (entity.anInt1517 == entity.anInt1511
  8737. && entity.anInt1552 != entity.turnDirection) {
  8738. if (entity.anInt1512 != -1) {
  8739. entity.anInt1517 = entity.anInt1512;
  8740. return;
  8741. }
  8742. entity.anInt1517 = entity.anInt1554;
  8743. }
  8744. }
  8745. }
  8746.  
  8747. public void method101(Entity entity) {
  8748. entity.aBoolean1541 = false;
  8749. if (entity.anInt1517 != -1) {
  8750. Animation animation = Animation.anims[entity.anInt1517];
  8751. entity.anInt1519++;
  8752. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  8753. entity.anInt1519 = 1;//this is the frame delay. 0 is what it's normally at. higher number = faster animations.
  8754. entity.anInt1518++;
  8755. }
  8756. if (entity.anInt1518 >= animation.anInt352) {
  8757. entity.anInt1519 = 1;
  8758. entity.anInt1518 = 0;
  8759. }
  8760. }
  8761. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  8762. if (entity.anInt1521 < 0)
  8763. entity.anInt1521 = 0;
  8764. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8765. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  8766. && entity.anInt1522 > animation_1
  8767. .method258(entity.anInt1521); entity.anInt1521++)
  8768. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8769.  
  8770. if (entity.anInt1521 >= animation_1.anInt352
  8771. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8772. entity.anInt1520 = -1;
  8773. }
  8774. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  8775. Animation animation_2 = Animation.anims[entity.anim];
  8776. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  8777. && entity.anInt1547 <= loopCycle
  8778. && entity.anInt1548 < loopCycle) {
  8779. entity.anInt1529 = 1;
  8780. return;
  8781. }
  8782. }
  8783. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8784. Animation animation_3 = Animation.anims[entity.anim];
  8785. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  8786. && entity.anInt1528 > animation_3
  8787. .method258(entity.anInt1527); entity.anInt1527++)
  8788. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8789.  
  8790. if (entity.anInt1527 >= animation_3.anInt352) {
  8791. entity.anInt1527 -= animation_3.anInt356;
  8792. entity.anInt1530++;
  8793. if (entity.anInt1530 >= animation_3.anInt362)
  8794. entity.anim = -1;
  8795. if (entity.anInt1527 < 0
  8796. || entity.anInt1527 >= animation_3.anInt352)
  8797. entity.anim = -1;
  8798. }
  8799. entity.aBoolean1541 = animation_3.aBoolean358;
  8800. }
  8801. if (entity.anInt1529 > 0)
  8802. entity.anInt1529--;
  8803. }
  8804.  
  8805. public void drawGameScreen() {
  8806. if (fullscreenInterfaceID != -1
  8807. && (loadingStage == 2 || super.fullGameScreen != null)) {
  8808. if (loadingStage == 2) {
  8809. method119(anInt945, fullscreenInterfaceID);
  8810. if (openInterfaceID != -1) {
  8811. method119(anInt945, openInterfaceID);
  8812. }
  8813. anInt945 = 0;
  8814. resetAllImageProducers();
  8815. super.fullGameScreen.initDrawingArea();
  8816. Rasterizer.lineOffsets = fullScreenTextureArray;
  8817. DrawingArea.setAllPixelsToZero();
  8818. welcomeScreenRaised = true;
  8819. if (openInterfaceID != -1) {
  8820. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8821. if (rsInterface_1.width == 512
  8822. && rsInterface_1.height == 334
  8823. && rsInterface_1.type == 0) {
  8824. rsInterface_1.width = 765;
  8825. rsInterface_1.height = 503;
  8826. }
  8827. drawInterface(0, 0, rsInterface_1, 8);
  8828. }
  8829. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8830. if (rsInterface.width == 512 && rsInterface.height == 334
  8831. && rsInterface.type == 0) {
  8832. rsInterface.width = 765;
  8833. rsInterface.height = 503;
  8834. }
  8835. drawInterface(0, 0, rsInterface, 8);
  8836.  
  8837. if (!menuOpen) {
  8838. processRightClick();
  8839. drawTooltip();
  8840. } else {
  8841. drawMenu();
  8842. }
  8843. }
  8844. drawCount++;
  8845. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8846. return;
  8847. } else {
  8848. if (drawCount != 0) {
  8849. resetImageProducers2();
  8850. }
  8851. }
  8852. if (welcomeScreenRaised) {
  8853. welcomeScreenRaised = false;
  8854. topFrame.drawGraphics(0, super.graphics, 0);
  8855. leftFrame.drawGraphics(4, super.graphics, 0);
  8856. rightFrame.drawGraphics(4, super.graphics, 516);
  8857. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8858. needDrawTabArea = true;
  8859. inputTaken = true;
  8860. tabAreaAltered = true;
  8861. aBoolean1233 = true;
  8862. if (loadingStage != 2) {
  8863. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8864. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8865. }
  8866. }
  8867. if (menuOpen && menuScreenArea == 1)
  8868. needDrawTabArea = true;
  8869. if (invOverlayInterfaceID != -1) {
  8870. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8871. if (flag1)
  8872. needDrawTabArea = true;
  8873. }
  8874. if (atInventoryInterfaceType == 2)
  8875. needDrawTabArea = true;
  8876. if (activeInterfaceType == 2)
  8877. needDrawTabArea = true;
  8878. if (needDrawTabArea) {
  8879. drawTabArea();
  8880. needDrawTabArea = false;
  8881. }
  8882. if (backDialogID == -1) {
  8883. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8884. if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8885. method65(494, 110, super.mouseX - 0, super.mouseY - 348,
  8886. aClass9_1059, 0, false, anInt1211);
  8887. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8888. if (i < 0)
  8889. i = 0;
  8890. if (i > anInt1211 - 110)
  8891. i = anInt1211 - 110;
  8892. if (anInt1089 != i) {
  8893. anInt1089 = i;
  8894. inputTaken = true;
  8895. }
  8896. }
  8897. if (backDialogID != -1) {
  8898. boolean flag2 = method119(anInt945, backDialogID);
  8899. if (flag2)
  8900. inputTaken = true;
  8901. }
  8902. if (atInventoryInterfaceType == 3)
  8903. inputTaken = true;
  8904. if (activeInterfaceType == 3)
  8905. inputTaken = true;
  8906. if (aString844 != null)
  8907. inputTaken = true;
  8908. if (menuOpen && menuScreenArea == 2)
  8909. inputTaken = true;
  8910. if (inputTaken) {
  8911. drawChatArea();
  8912. inputTaken = false;
  8913. }
  8914. if (loadingStage == 2)
  8915. method146();
  8916. if (loadingStage == 2) {
  8917. drawMinimap();
  8918. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8919. }
  8920. if (anInt1054 != -1)
  8921. tabAreaAltered = true;
  8922. if (tabAreaAltered) {
  8923. if (anInt1054 != -1 && anInt1054 == tabID) {
  8924. anInt1054 = -1;
  8925. stream.createFrame(120);
  8926. stream.writeWordBigEndian(tabID);
  8927. }
  8928. tabAreaAltered = false;
  8929. aRSImageProducer_1125.initDrawingArea();
  8930. aRSImageProducer_1165.initDrawingArea();
  8931. }
  8932. anInt945 = 0;
  8933. }
  8934.  
  8935. public boolean buildFriendsListMenu(RSInterface class9) {
  8936. int i = class9.contentType;
  8937. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  8938. if (i >= 801)
  8939. i -= 701;
  8940. else if (i >= 701)
  8941. i -= 601;
  8942. else if (i >= 101)
  8943. i -= 101;
  8944. else
  8945. i--;
  8946. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8947. menuActionIds[menuActionRow] = 792;
  8948. menuActionRow++;
  8949. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8950. menuActionIds[menuActionRow] = 639;
  8951. menuActionRow++;
  8952. return true;
  8953. }
  8954. if (i >= 401 && i <= 500) {
  8955. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8956. menuActionIds[menuActionRow] = 322;
  8957. menuActionRow++;
  8958. return true;
  8959. } else {
  8960. return false;
  8961. }
  8962. }
  8963.  
  8964. public void method104() {
  8965. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8966. .reverseGetFirst();
  8967. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8968. .reverseGetNext())
  8969. if (class30_sub2_sub4_sub3.anInt1560 != plane
  8970. || class30_sub2_sub4_sub3.aBoolean1567)
  8971. class30_sub2_sub4_sub3.unlink();
  8972. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  8973. class30_sub2_sub4_sub3.method454(anInt945);
  8974. if (class30_sub2_sub4_sub3.aBoolean1567)
  8975. class30_sub2_sub4_sub3.unlink();
  8976. else
  8977. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  8978. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  8979. class30_sub2_sub4_sub3.anInt1562, 60,
  8980. class30_sub2_sub4_sub3.anInt1561,
  8981. class30_sub2_sub4_sub3, false);
  8982. }
  8983.  
  8984. }
  8985.  
  8986. public void drawInterface(int j, int k, RSInterface class9, int l) {
  8987. if (class9.type != 0 || class9.children == null)
  8988. return;
  8989. if (class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8990. return;
  8991. int i1 = DrawingArea.topX;
  8992. int j1 = DrawingArea.topY;
  8993. int k1 = DrawingArea.bottomX;
  8994. int l1 = DrawingArea.bottomY;
  8995. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8996. int i2 = class9.children.length;
  8997. for (int j2 = 0; j2 < i2; j2++) {
  8998. int k2 = class9.childX[j2] + k;
  8999. int l2 = (class9.childY[j2] + l) - j;
  9000. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9001.  
  9002. k2 += class9_1.anInt263;
  9003. l2 += class9_1.anInt265;
  9004. if (class9_1.id == 22001) {
  9005. class9_1.contentType = 424;
  9006. }
  9007. if (class9_1.contentType > 0)
  9008. drawFriendsListOrWelcomeScreen(class9_1);
  9009. // here
  9010.  
  9011. int[] IDs = {
  9012. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  9013. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  9014. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  9015. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  9016. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  9017. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  9018. 12436, 12446, 12456, 6004, 18471,
  9019. /* Ancients */
  9020. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  9021. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  9022. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9023. };
  9024. for (int m5 = 0; m5 < IDs.length; m5++) {
  9025. if (class9_1.id == IDs[m5] + 1) {
  9026. if (m5 > 61)
  9027. drawBlackBox(k2 + 1, l2);
  9028. else
  9029. drawBlackBox(k2, l2 + 1);
  9030. }
  9031. }
  9032. int[] runeChildren = {
  9033. 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  9034. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  9035. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  9036. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  9037. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  9038. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  9039. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  9040. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  9041. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  9042. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  9043. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  9044. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  9045. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  9046. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  9047. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  9048. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  9049. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478
  9050. };
  9051. for (int r = 0; r < runeChildren.length; r++)
  9052. if (class9_1.id == runeChildren[r])
  9053. class9_1.modelZoom = 775;
  9054. if (class9_1.type == 0) {
  9055. if (class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  9056. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  9057. if (class9_1.scrollPosition < 0)
  9058. class9_1.scrollPosition = 0;
  9059. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9060. if (class9_1.scrollMax > class9_1.height) {
  9061. // clan chat
  9062. if (class9_1.id == 18143) {
  9063. int clanMates = 0;
  9064. for (int i = 18155; i < 18244; i++) {
  9065. RSInterface line = RSInterface.interfaceCache[i];
  9066. if (line.message.length() > 0) {
  9067. clanMates++;
  9068. }
  9069. }
  9070. class9_1.scrollMax = (clanMates * 14) + class9_1.height + 1;
  9071. }
  9072. if (class9_1.id == 24322 || class9_1.id == 24423) {
  9073. int members = 0;
  9074. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  9075. RSInterface line = RSInterface.interfaceCache[i];
  9076. if (line != null && line.message != null) {
  9077. if (line.message.length() > 0) {
  9078. members++;
  9079. }
  9080. }
  9081. }
  9082. class9_1.scrollMax = (members * 14) + 1;
  9083. }
  9084. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2,
  9085. k2 + class9_1.width, class9_1.scrollMax);
  9086. }
  9087. } else if (class9_1.type != 1)
  9088. if (class9_1.type == 2) {
  9089. int i3 = 0;
  9090. for (int l3 = 0; l3 < class9_1.height; l3++) {
  9091. for (int l4 = 0; l4 < class9_1.width; l4++) {
  9092. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9093. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9094. if (i3 < 20) {
  9095. k5 += class9_1.spritesX[i3];
  9096. j6 += class9_1.spritesY[i3];
  9097. }
  9098. if (class9_1.inv[i3] > 0) {
  9099. int k6 = 0;
  9100. int j7 = 0;
  9101. int j9 = class9_1.inv[i3] - 1;
  9102. if (k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  9103. int l9 = 0;
  9104. if (itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  9105. l9 = 0xffffff;
  9106. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  9107. if (class30_sub2_sub1_sub1_2 != null) {
  9108. if (activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  9109. k6 = super.mouseX - anInt1087;
  9110. j7 = super.mouseY - anInt1088;
  9111. if (k6 < 5 && k6 > -5)
  9112. k6 = 0;
  9113. if (j7 < 5 && j7 > -5)
  9114. j7 = 0;
  9115. if (anInt989 < 10) {
  9116. k6 = 0;
  9117. j7 = 0;
  9118. }
  9119. class30_sub2_sub1_sub1_2
  9120. .drawSprite1(k5 + k6, j6 + j7);
  9121. if (j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  9122. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9123. if (i10 > anInt945 * 10)
  9124. i10 = anInt945 * 10;
  9125. if (i10 > class9.scrollPosition)
  9126. i10 = class9.scrollPosition;
  9127. class9.scrollPosition -= i10;
  9128. anInt1088 += i10;
  9129. }
  9130. if (j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9131. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9132. if (j10 > anInt945 * 10)
  9133. j10 = anInt945 * 10;
  9134. if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9135. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9136. class9.scrollPosition += j10;
  9137. anInt1088 -= j10;
  9138. }
  9139. } else if (atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9140. class30_sub2_sub1_sub1_2
  9141. .drawSprite1(k5, j6);
  9142. else
  9143. class30_sub2_sub1_sub1_2
  9144. .drawSprite(k5, j6);
  9145. if (class30_sub2_sub1_sub1_2.maxWidth == 33 || class9_1.invStackSizes[i3] != 1) {
  9146. int k10 = class9_1.invStackSizes[i3];
  9147. if (k10 >= 1)
  9148. smallText.method385(0xFFFF00,
  9149. intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9150. if (k10 >= 100000)
  9151. smallText.method385(0xFFFFFF,
  9152. intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9153. if (k10 >= 10000000)
  9154. smallText.method385(0x0FF80,
  9155. intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9156.  
  9157. /*
  9158. * smallText.method385(0,
  9159. * intToKOrMil(k10), j6 + 10 + j7,
  9160. * k5 + 1 + k6);
  9161. * smallText.method385(0xffff00,
  9162. * intToKOrMil(k10), j6 + 9 + j7, k5
  9163. * + k6);
  9164. */
  9165. }
  9166. }
  9167. }
  9168. } else if (class9_1.sprites != null && i3 < 20) {
  9169. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9170. if (class30_sub2_sub1_sub1_1 != null)
  9171. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9172. }
  9173. i3++;
  9174. }
  9175. }
  9176. } else if (class9_1.type == 3) {
  9177. boolean flag = false;
  9178. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9179. flag = true;
  9180. int j3;
  9181. if (interfaceIsSelected(class9_1)) {
  9182. j3 = class9_1.anInt219;
  9183. if (flag && class9_1.anInt239 != 0)
  9184. j3 = class9_1.anInt239;
  9185. } else {
  9186. j3 = class9_1.textColor;
  9187. if (flag && class9_1.anInt216 != 0)
  9188. j3 = class9_1.anInt216;
  9189. }
  9190. if (class9_1.opacity == 0) {
  9191. if (class9_1.aBoolean227)
  9192. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  9193. class9_1.width);
  9194. else
  9195. DrawingArea.fillPixels(k2, class9_1.width,
  9196. class9_1.height, j3, l2);
  9197. } else if (class9_1.aBoolean227)
  9198. DrawingArea.method335(j3, l2, class9_1.width,
  9199. class9_1.height,
  9200. 256 - (class9_1.opacity & 0xff), k2);
  9201. else
  9202. DrawingArea.method338(l2, class9_1.height,
  9203. 256 - (class9_1.opacity & 0xff), j3,
  9204. class9_1.width, k2);
  9205. } else if (class9_1.type == 4) {
  9206. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9207. String s = class9_1.message;
  9208. boolean flag1 = false;
  9209. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9210. flag1 = true;
  9211. int i4;
  9212. if (interfaceIsSelected(class9_1)) {
  9213. i4 = class9_1.anInt219;
  9214. if (flag1 && class9_1.anInt239 != 0)
  9215. i4 = class9_1.anInt239;
  9216. if (class9_1.aString228 != null && class9_1.aString228.length() > 0)
  9217. s = class9_1.aString228;
  9218. } else {
  9219. i4 = class9_1.textColor;
  9220. if (flag1 && class9_1.anInt216 != 0)
  9221. i4 = class9_1.anInt216;
  9222. }
  9223. if (class9_1.atActionType == 6 && aBoolean1149) {
  9224. s = "Please wait...";
  9225. i4 = class9_1.textColor;
  9226. }
  9227. if (DrawingArea.width == 519) {
  9228. if (i4 == 0xffff00)
  9229. i4 = 255;
  9230. if (i4 == 49152)
  9231. i4 = 0xffffff;
  9232. }
  9233. if ((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9234. switch (i4) {
  9235. case 16773120:
  9236. i4 = 0xFE981F;
  9237. break;
  9238. case 7040819:
  9239. i4 = 0xAF6A1A;
  9240. break;
  9241. }
  9242. }
  9243.  
  9244. /*int id = 4004;
  9245. int id2 = 4005;
  9246. 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) {
  9247. if (i4 == 16776960)
  9248. i4 = 0x0000;
  9249. class9_1.textShadow = false;
  9250. }*/
  9251.  
  9252. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  9253. if (s.indexOf("%") != -1) {
  9254. do {
  9255. int k7 = s.indexOf("%1");
  9256. if (k7 == -1)
  9257. break;
  9258. 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)
  9259. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9260. else
  9261. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9262. } while (true);
  9263. do {
  9264. int l7 = s.indexOf("%2");
  9265. if (l7 == -1)
  9266. break;
  9267. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  9268. } while (true);
  9269. do {
  9270. int i8 = s.indexOf("%3");
  9271. if (i8 == -1)
  9272. break;
  9273. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  9274. } while (true);
  9275. do {
  9276. int j8 = s.indexOf("%4");
  9277. if (j8 == -1)
  9278. break;
  9279. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  9280. } while (true);
  9281. do {
  9282. int k8 = s.indexOf("%5");
  9283. if (k8 == -1)
  9284. break;
  9285. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  9286. } while (true);
  9287. }
  9288. int l8 = s.indexOf("\\n");
  9289. String s1;
  9290. if (l8 != -1) {
  9291. s1 = s.substring(0, l8);
  9292. s = s.substring(l8 + 2);
  9293. } else {
  9294. s1 = s;
  9295. s = "";
  9296. }
  9297. RSFont font = null;
  9298. if (textDrawingArea == smallText) {
  9299. font = newSmallFont;
  9300. } else if (textDrawingArea == aTextDrawingArea_1271) {
  9301. font = newRegularFont;
  9302. } else if (textDrawingArea == chatTextDrawingArea) {
  9303. font = newBoldFont;
  9304. } else if (textDrawingArea == aTextDrawingArea_1273) {
  9305. font = newFancyFont;
  9306. } else {
  9307. font = newRegularFont;
  9308. }
  9309.  
  9310. if (class9_1.centerText) {
  9311. font.drawCenteredString(s1, k2 + class9_1.width / 2, l6, i4, class9_1.textShadow ? 0 : -1);
  9312. } else {
  9313. font.drawBasicString(s1, k2, l6, i4, class9_1.textShadow ? 0 : -1);
  9314. }
  9315. }
  9316. } else if (class9_1.type == 5) {
  9317. Sprite image;
  9318. Sprite hover;
  9319. if (interfaceIsSelected(class9_1)) {
  9320. image = class9_1.sprite2;
  9321. hover = class9_1.enabledHover;
  9322. } else {
  9323. image = class9_1.sprite1;
  9324. hover = class9_1.disabledHover;
  9325. }
  9326. if (image != null) {
  9327. if (spellSelected == 1 && class9_1.id == spellID && spellID != 0) {
  9328. image.drawSprite(k2, l2, 0xffffff);
  9329. } else {
  9330. image.drawSprite(k2, l2);
  9331. }
  9332. if (hover != null) {
  9333. if (hoverId == class9_1.id) {
  9334. hover.drawSprite(k2, l2);
  9335. }
  9336. }
  9337. }
  9338. } else if (class9_1.type == 6) {
  9339. int k3 = Rasterizer.centerX;
  9340. int j4 = Rasterizer.centerY;
  9341. Rasterizer.centerX = k2 + class9_1.width / 2;
  9342. Rasterizer.centerY = l2 + class9_1.height / 2;
  9343. int i5 = Rasterizer.SINE[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9344. int l5 = Rasterizer.COSINE[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9345. boolean flag2 = interfaceIsSelected(class9_1);
  9346. int i7;
  9347. if (flag2)
  9348. i7 = class9_1.anInt258;
  9349. else
  9350. i7 = class9_1.anInt257;
  9351. Model model;
  9352. if (i7 == -1) {
  9353. model = class9_1.method209(-1, -1, flag2);
  9354. } else {
  9355. Animation animation = Animation.anims[i7];
  9356. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  9357. }
  9358. if (model != null)
  9359. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  9360. Rasterizer.centerX = k3;
  9361. Rasterizer.centerY = j4;
  9362. } else if (class9_1.type == 7) {
  9363. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9364. int k4 = 0;
  9365. for (int j5 = 0; j5 < class9_1.height; j5++) {
  9366. for (int i6 = 0; i6 < class9_1.width; i6++) {
  9367. if (class9_1.inv[k4] > 0) {
  9368. ItemDef itemDef = ItemDef
  9369. .forID(class9_1.inv[k4] - 1);
  9370. String s2 = itemDef.name;
  9371. if (itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  9372. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9373. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  9374. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  9375. if (class9_1.centerText)
  9376. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  9377. else
  9378. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  9379. }
  9380. k4++;
  9381. }
  9382. }
  9383. } else if (class9_1.type == 9) {
  9384. drawHoverBox(k2, l2, class9_1.message);
  9385. }
  9386. if (class9_1.type == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 0 && !menuOpen) {
  9387. int boxWidth = 0;
  9388. int boxHeight = 0;
  9389. TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
  9390. for (String s1 = class9_1.message; s1.length() > 0;) {
  9391. if (s1.indexOf("%") != -1) {
  9392. do {
  9393. int k7 = s1.indexOf("%1");
  9394. if (k7 == -1)
  9395. break;
  9396. s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s1.substring(k7 + 2);
  9397. } while (true);
  9398. do {
  9399. int l7 = s1.indexOf("%2");
  9400. if (l7 == -1)
  9401. break;
  9402. s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s1.substring(l7 + 2);
  9403. } while (true);
  9404. do {
  9405. int i8 = s1.indexOf("%3");
  9406. if (i8 == -1)
  9407. break;
  9408. s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s1.substring(i8 + 2);
  9409. } while (true);
  9410. do {
  9411. int j8 = s1.indexOf("%4");
  9412. if (j8 == -1)
  9413. break;
  9414. s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s1.substring(j8 + 2);
  9415. } while (true);
  9416. do {
  9417. int k8 = s1.indexOf("%5");
  9418. if (k8 == -1)
  9419. break;
  9420. s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s1.substring(k8 + 2);
  9421. } while (true);
  9422. }
  9423. int l7 = s1.indexOf("\\n");
  9424. String s4;
  9425. if (l7 != -1) {
  9426. s4 = s1.substring(0, l7);
  9427. s1 = s1.substring(l7 + 2);
  9428. } else {
  9429. s4 = s1;
  9430. s1 = "";
  9431. }
  9432. int j10 = textDrawingArea_2.getTextWidth(s4);
  9433. if (j10 > boxWidth) {
  9434. boxWidth = j10;
  9435. }
  9436. boxHeight += textDrawingArea_2.anInt1497 + 1;
  9437. }
  9438. boxWidth += 6;
  9439. boxHeight += 7;
  9440. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  9441. int yPos = l2 + class9_1.height + 5;
  9442. if (xPos < k2 + 5) {
  9443. xPos = k2 + 5;
  9444. }
  9445. if (xPos + boxWidth > k + class9.width) {
  9446. xPos = (k + class9.width) - boxWidth;
  9447. }
  9448. if (yPos + boxHeight > l + class9.height) {
  9449. yPos = (l2 - boxHeight);
  9450. }
  9451. if (class9_1.inventoryhover) {
  9452. if (xPos + boxWidth + k > 249) {
  9453. xPos = 251 - boxWidth - k;
  9454. }
  9455. if (class9_1.id == 3985) {
  9456. yPos = yPos - boxHeight - 17;
  9457. } else if (yPos + boxHeight + l >= 366) {
  9458. yPos = 245 - boxHeight - 10;
  9459. } else if (yPos + boxHeight + l > 320) {
  9460. yPos = 245 - boxHeight - l;
  9461. }
  9462. }
  9463. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  9464. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  9465. String s2 = class9_1.message;
  9466. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) { // anInt1497
  9467. if (s2.indexOf("%") != -1) {
  9468. do {
  9469. int k7 = s2.indexOf("%1");
  9470. if (k7 == -1)
  9471. break;
  9472. s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s2.substring(k7 + 2);
  9473. } while (true);
  9474. do {
  9475. int l7 = s2.indexOf("%2");
  9476. if (l7 == -1)
  9477. break;
  9478. s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s2.substring(l7 + 2);
  9479. } while (true);
  9480. do {
  9481. int i8 = s2.indexOf("%3");
  9482. if (i8 == -1)
  9483. break;
  9484. s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s2.substring(i8 + 2);
  9485. } while (true);
  9486. do {
  9487. int j8 = s2.indexOf("%4");
  9488. if (j8 == -1)
  9489. break;
  9490. s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s2.substring(j8 + 2);
  9491. } while (true);
  9492. do {
  9493. int k8 = s2.indexOf("%5");
  9494. if (k8 == -1)
  9495. break;
  9496. s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s2.substring(k8 + 2);
  9497. } while (true);
  9498. }
  9499. int l11 = s2.indexOf("\\n");
  9500. String s5;
  9501. if (l11 != -1) {
  9502. s5 = s2.substring(0, l11);
  9503. s2 = s2.substring(l11 + 2);
  9504. } else {
  9505. s5 = s2;
  9506. s2 = "";
  9507. }
  9508. if (class9_1.centerText) {
  9509. textDrawingArea_2.method382(yPos, xPos + class9_1.width / 2, s5, j11, false);
  9510. } else {
  9511. if (s5.contains("\\r")) {
  9512. String text = s5.substring(0, s5.indexOf("\\r"));
  9513. String text2 = s5.substring(s5.indexOf("\\r") + 2);
  9514. textDrawingArea_2.method389(false, xPos + 3, 0, text, j11);
  9515. int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
  9516. textDrawingArea_2.method389(false, rightX, 0, text2, j11);
  9517. System.out.println("Box: " + boxWidth + "");
  9518. } else
  9519. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  9520. }
  9521. }
  9522. }
  9523. }
  9524. /*if (class9_1.type == 12) {
  9525. Sprite sprite;
  9526. if (interfaceIsSelected(class9_1))
  9527. sprite = class9_1.sprite2;
  9528. else
  9529. sprite = class9_1.sprite1;
  9530. if (sprite != null)
  9531. sprite.drawAdvancedSprite(k2, l2);
  9532. } else if (class9_1.type == 9) {
  9533. System.out.println("here");
  9534. drawHoverBox(k2, l2, class9_1.message);
  9535. }*/
  9536. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9537. }
  9538.  
  9539. public final String methodR(int j) {
  9540. if (j >= 0 && j < 10000)
  9541. return String.valueOf(j);
  9542. if (j >= 10000 && j < 10000000)
  9543. return j / 1000 + "K";
  9544. if (j >= 10000000 && j < 999999999)
  9545. return j / 1000000 + "M";
  9546. if (j >= 999999999)
  9547. return "*";
  9548. else
  9549. return "?";
  9550. }
  9551.  
  9552. public void drawHoverBox(int xPos, int yPos, String text) {
  9553. String[] results = text.split("\n");
  9554. int height = (results.length * 16) + 6;
  9555. int width;
  9556. width = chatTextDrawingArea.getTextWidth(results[0]) + 6;
  9557. for (int i = 1; i < results.length; i++)
  9558. if (width <= chatTextDrawingArea.getTextWidth(results[i]) + 6)
  9559. width = chatTextDrawingArea.getTextWidth(results[i]) + 6;
  9560. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  9561. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  9562. yPos += 14;
  9563. for (int i = 0; i < results.length; i++) {
  9564. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i],
  9565. yPos);
  9566. yPos += 16;
  9567. }
  9568. }
  9569.  
  9570. public void drawBlackBox(int xPos, int yPos) {
  9571. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  9572. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  9573. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  9574. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  9575. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  9576. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  9577. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  9578. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  9579. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  9580. }
  9581.  
  9582. public void randomizeBackground(Background background) {
  9583. int j = 256;
  9584. for (int k = 0; k < anIntArray1190.length; k++)
  9585. anIntArray1190[k] = 0;
  9586.  
  9587. for (int l = 0; l < 5000; l++) {
  9588. int i1 = (int) (Math.random() * 128D * (double) j);
  9589. anIntArray1190[i1] = (int) (Math.random() * 256D);
  9590. }
  9591. for (int j1 = 0; j1 < 20; j1++) {
  9592. for (int k1 = 1; k1 < j - 1; k1++) {
  9593. for (int i2 = 1; i2 < 127; i2++) {
  9594. int k2 = i2 + (k1 << 7);
  9595. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  9596. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9597. }
  9598.  
  9599. }
  9600. int ai[] = anIntArray1190;
  9601. anIntArray1190 = anIntArray1191;
  9602. anIntArray1191 = ai;
  9603. }
  9604. if (background != null) {
  9605. int l1 = 0;
  9606. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  9607. for (int l2 = 0; l2 < background.anInt1452; l2++)
  9608. if (background.aByteArray1450[l1++] != 0) {
  9609. int i3 = l2 + 16 + background.anInt1454;
  9610. int j3 = j2 + 16 + background.anInt1455;
  9611. int k3 = i3 + (j3 << 7);
  9612. anIntArray1190[k3] = 0;
  9613. }
  9614. }
  9615. }
  9616. }
  9617.  
  9618. public void method107(int i, int j, Stream stream, Player player) {
  9619. if ((i & 0x400) != 0) {
  9620. player.anInt1543 = stream.method428();
  9621. player.anInt1545 = stream.method428();
  9622. player.anInt1544 = stream.method428();
  9623. player.anInt1546 = stream.method428();
  9624. player.anInt1547 = stream.method436() + loopCycle;
  9625. player.anInt1548 = stream.method435() + loopCycle;
  9626. player.anInt1549 = stream.method428();
  9627. player.method446();
  9628. }
  9629. if ((i & 0x100) != 0) {
  9630. player.anInt1520 = stream.method434();
  9631. int k = stream.readDWord();
  9632. player.anInt1524 = k >> 16;
  9633. player.anInt1523 = loopCycle + (k & 0xffff);
  9634. player.anInt1521 = 0;
  9635. player.anInt1522 = 0;
  9636. if (player.anInt1523 > loopCycle)
  9637. player.anInt1521 = -1;
  9638. if (player.anInt1520 == 65535)
  9639. player.anInt1520 = -1;
  9640. }
  9641. if ((i & 8) != 0) {
  9642. int l = stream.method434();
  9643. if (l == 65535)
  9644. l = -1;
  9645. int i2 = stream.method427();
  9646. if (l == player.anim && l != -1) {
  9647. int i3 = Animation.anims[l].anInt365;
  9648. if (i3 == 1) {
  9649. player.anInt1527 = 0;
  9650. player.anInt1528 = 0;
  9651. player.anInt1529 = i2;
  9652. player.anInt1530 = 0;
  9653. }
  9654. if (i3 == 2)
  9655. player.anInt1530 = 0;
  9656. } else if (l == -1
  9657. || player.anim == -1
  9658. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  9659. player.anim = l;
  9660. player.anInt1527 = 0;
  9661. player.anInt1528 = 0;
  9662. player.anInt1529 = i2;
  9663. player.anInt1530 = 0;
  9664. player.anInt1542 = player.smallXYIndex;
  9665. }
  9666. }
  9667. if ((i & 4) != 0) {
  9668. player.textSpoken = stream.readString();
  9669. if (player.textSpoken.charAt(0) == '~') {
  9670. player.textSpoken = player.textSpoken.substring(1);
  9671. pushMessage(player.textSpoken, 2, player.name);
  9672. } else if (player == myPlayer)
  9673. pushMessage(player.textSpoken, 2, player.name);
  9674. player.anInt1513 = 0;
  9675. player.anInt1531 = 0;
  9676. player.textCycle = 150;
  9677. }
  9678. if ((i & 0x80) != 0) {
  9679. int i1 = stream.method434();
  9680. int j2 = stream.readUnsignedByte();
  9681. int j3 = stream.method427();
  9682. int k3 = stream.currentOffset;
  9683. if (player.name != null && player.visible) {
  9684. long l3 = TextClass.longForName(player.name);
  9685. boolean flag = false;
  9686. if (j2 <= 1) {
  9687. for (int i4 = 0; i4 < ignoreCount; i4++) {
  9688. if (ignoreListAsLongs[i4] != l3)
  9689. continue;
  9690. flag = true;
  9691. break;
  9692. }
  9693.  
  9694. }
  9695. if (!flag && anInt1251 == 0)
  9696. try {
  9697. aStream_834.currentOffset = 0;
  9698. stream.method442(j3, 0, aStream_834.buffer);
  9699. aStream_834.currentOffset = 0;
  9700. String s = TextInput.method525(j3, aStream_834);
  9701. player.textSpoken = s;
  9702. player.anInt1513 = i1 >> 8;
  9703. player.privelage = j2;
  9704. player.anInt1531 = i1 & 0xff;
  9705. player.textCycle = 150;
  9706. if(j2 == 1)
  9707. pushMessage(s, 1, "@cr1@" + player.name);
  9708. else if(j2 == 2)
  9709. pushMessage(s, 1, "@cr2@" + player.name);
  9710. else if(j2 == 3)
  9711. pushMessage(s, 1, "@cr3@" + player.name);
  9712. else if(j2 == 4)
  9713. pushMessage(s, 1, "@cr4@" + player.name);
  9714. else if(j2 == 5)
  9715. pushMessage(s, 1, "@cr5@" + player.name);
  9716. else if(j2 == 6)
  9717. pushMessage(s, 1, "@cr6@" + player.name);
  9718. else if(j2 == 7)
  9719. pushMessage(s, 1, "@cr7@" + player.name);
  9720. else if(j2 == 8)
  9721. pushMessage(s, 1, "@cr8@" + player.name);
  9722. else if(j2 == 9)
  9723. pushMessage(s, 1, "@cr9@" + player.name);
  9724. else if(j2 == 10)
  9725. pushMessage(s, 1, "@cr10@" + player.name);
  9726. else if(j2 == 11)
  9727. pushMessage(s, 1, "@cr11@" + player.name);
  9728. else if(j2 == 12)
  9729. pushMessage(s, 1, "@cr12@" + player.name);
  9730. else if(j2 == 13)
  9731. pushMessage(s, 1, "@cr13@" + player.name);
  9732. else if(j2 == 14)
  9733. pushMessage(s, 1, "@cr14@" + player.name);
  9734. else if(j2 == 15)
  9735. pushMessage(s, 1, "@cr15@" + player.name);
  9736. else if(j2 == 16)
  9737. pushMessage(s, 1, "@cr16@" + player.name);
  9738. else if(j2 == 17)
  9739. pushMessage(s, 1, "@cr17@" + player.name);
  9740. else if(j2 == 18)
  9741. pushMessage(s, 1, "@cr18@" + player.name);
  9742. else if(j2 == 19)
  9743. pushMessage(s, 1, "@cr19@" + player.name);
  9744. else if(j2 == 20)
  9745. pushMessage(s, 1, "@cr20@" + player.name);
  9746. else
  9747. pushMessage(s, 2, player.name);
  9748. } catch (Exception exception) {
  9749. SignLink.reporterror("cde2");
  9750. }
  9751. }
  9752. stream.currentOffset = k3 + j3;
  9753. }
  9754. if ((i & 1) != 0) {
  9755. player.interactingEntity = stream.method434();
  9756. if (player.interactingEntity == 65535)
  9757. player.interactingEntity = -1;
  9758. }
  9759. if ((i & 0x10) != 0) {
  9760. int j1 = stream.method427();
  9761. byte abyte0[] = new byte[j1];
  9762. Stream stream_1 = new Stream(abyte0);
  9763. stream.readBytes(j1, 0, abyte0);
  9764. aStreamArray895s[j] = stream_1;
  9765. player.updatePlayer(stream_1);
  9766. }
  9767. if ((i & 2) != 0) {
  9768. player.anInt1538 = stream.method436();
  9769. player.anInt1539 = stream.method434();
  9770. }
  9771. if((i & 0x20) != 0)
  9772. {
  9773. int k1 = stream.readUnsignedByte();
  9774. int k2 = stream.method426();
  9775. int icon = stream.readUnsignedByte();
  9776. player.updateHitData(k2, k1, loopCycle, icon == 255 ? -1 : icon);
  9777. player.loopCycleStatus = loopCycle + 300;
  9778. player.currentHealth = stream.method427();
  9779. player.maxHealth = stream.readUnsignedByte();
  9780. }
  9781. if((i & 0x200) != 0)
  9782. {
  9783. int l1 = stream.readUnsignedByte();
  9784. int l2 = stream.method428();
  9785. int icon = stream.readUnsignedByte();
  9786. player.updateHitData(l2, l1, loopCycle, icon);
  9787. player.loopCycleStatus = loopCycle + 300;
  9788. player.currentHealth = stream.readUnsignedByte();
  9789. player.maxHealth = stream.method427();
  9790. }
  9791. }
  9792.  
  9793. public void method108() {
  9794. try {
  9795. int j = myPlayer.x + cameraOffsetX;
  9796. int k = myPlayer.y + cameraOffsetY;
  9797. if (anInt1014 - j < -500 || anInt1014 - j > 500
  9798. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  9799. anInt1014 = j;
  9800. anInt1015 = k;
  9801. }
  9802. if (anInt1014 != j)
  9803. anInt1014 += (j - anInt1014) / 16;
  9804. if (anInt1015 != k)
  9805. anInt1015 += (k - anInt1015) / 16;
  9806. if (super.keyArray[1] == 1)
  9807. anInt1186 += (-24 - anInt1186) / 2;
  9808. else if (super.keyArray[2] == 1)
  9809. anInt1186 += (24 - anInt1186) / 2;
  9810. else
  9811. anInt1186 /= 2;
  9812. if (super.keyArray[3] == 1)
  9813. anInt1187 += (12 - anInt1187) / 2;
  9814. else if (super.keyArray[4] == 1)
  9815. anInt1187 += (-12 - anInt1187) / 2;
  9816. else
  9817. anInt1187 /= 2;
  9818. viewRotation = viewRotation + anInt1186 / 2 & 0x7ff;
  9819. anInt1184 += anInt1187 / 2;
  9820. if (anInt1184 < 128)
  9821. anInt1184 = 128;
  9822. if (anInt1184 > 383)
  9823. anInt1184 = 383;
  9824. int l = anInt1014 >> 7;
  9825. int i1 = anInt1015 >> 7;
  9826. int j1 = method42(plane, anInt1015, anInt1014);
  9827. int k1 = 0;
  9828. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  9829. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  9830. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  9831. int l2 = plane;
  9832. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9833. l2++;
  9834. int i3 = j1 - intGroundArray[l2][l1][k2];
  9835. if (i3 > k1)
  9836. k1 = i3;
  9837. }
  9838.  
  9839. }
  9840.  
  9841. }
  9842. anInt1005++;
  9843. if (anInt1005 > 1512) {
  9844. anInt1005 = 0;
  9845. stream.createFrame(77);
  9846. stream.writeWordBigEndian(0);
  9847. int i2 = stream.currentOffset;
  9848. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9849. stream.writeWordBigEndian(101);
  9850. stream.writeWordBigEndian(233);
  9851. stream.writeWord(45092);
  9852. if ((int) (Math.random() * 2D) == 0)
  9853. stream.writeWord(35784);
  9854. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9855. stream.writeWordBigEndian(64);
  9856. stream.writeWordBigEndian(38);
  9857. stream.writeWord((int) (Math.random() * 65536D));
  9858. stream.writeWord((int) (Math.random() * 65536D));
  9859. stream.writeBytes(stream.currentOffset - i2);
  9860. }
  9861. int j2 = k1 * 192;
  9862. if (j2 > 0x17f00)
  9863. j2 = 0x17f00;
  9864. if (j2 < 32768)
  9865. j2 = 32768;
  9866. if (j2 > anInt984) {
  9867. anInt984 += (j2 - anInt984) / 24;
  9868. return;
  9869. }
  9870. if (j2 < anInt984) {
  9871. anInt984 += (j2 - anInt984) / 80;
  9872. }
  9873. } catch (Exception _ex) {
  9874. SignLink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  9875. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  9876. + anInt1070 + "," + baseX + "," + baseY);
  9877. throw new RuntimeException("eek");
  9878. }
  9879. }
  9880.  
  9881. public void processDrawing() {
  9882. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  9883. showErrorScreen();
  9884. return;
  9885. }
  9886. anInt1061++;
  9887. if (!loggedIn)
  9888. drawLoginScreen();
  9889. else
  9890. drawGameScreen();
  9891. anInt1213 = 0;
  9892. }
  9893.  
  9894. public boolean isFriendOrSelf(String s) {
  9895. if (s == null)
  9896. return false;
  9897. for (int i = 0; i < friendsCount; i++)
  9898. if (s.equalsIgnoreCase(friendsList[i]))
  9899. return true;
  9900. return s.equalsIgnoreCase(myPlayer.name);
  9901. }
  9902.  
  9903. public static String combatDiffColor(int i, int j) {
  9904. int k = i - j;
  9905. if (k < -9)
  9906. return "@red@";
  9907. if (k < -6)
  9908. return "@or3@";
  9909. if (k < -3)
  9910. return "@or2@";
  9911. if (k < 0)
  9912. return "@or1@";
  9913. if (k > 9)
  9914. return "@gre@";
  9915. if (k > 6)
  9916. return "@gr3@";
  9917. if (k > 3)
  9918. return "@gr2@";
  9919. if (k > 0)
  9920. return "@gr1@";
  9921. else
  9922. return "@yel@";
  9923. }
  9924.  
  9925. public void setWaveVolume(int i) {
  9926. SignLink.wavevol = i;
  9927. }
  9928.  
  9929. @SuppressWarnings("unused")
  9930. public void draw3dScreen() {
  9931. drawSplitpublicChat();
  9932. if (counterOn)
  9933. drawCounterOnScreen();
  9934. if (crossType == 1) {
  9935. crosses[crossIndex / 100]
  9936. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9937. anInt1142++;
  9938. if (anInt1142 > 67) {
  9939. anInt1142 = 0;
  9940. stream.createFrame(78);
  9941. }
  9942. }
  9943. if (crossType == 2)
  9944. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  9945. crossY - 8 - 4);
  9946. if (anInt1018 != -1) {
  9947. method119(anInt945, anInt1018);
  9948. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9949. }
  9950. if (openInterfaceID != -1) {
  9951. method119(anInt945, openInterfaceID);
  9952. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9953. }
  9954. method70();
  9955. if (!menuOpen) {
  9956. processRightClick();
  9957. drawTooltip();
  9958. } else if (menuScreenArea == 0)
  9959. drawMenu();
  9960. if (anInt1055 == 1)
  9961. multiOverlay.drawSprite(472, 296);
  9962. if (fpsOn) {
  9963. char c = '\u01FB';
  9964. int k = 20;
  9965. int i1 = 0xffff00;
  9966. if (super.fps < 15)
  9967. i1 = 0xff0000;
  9968. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9969. k += 15;
  9970. Runtime runtime = Runtime.getRuntime();
  9971. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9972. i1 = 0xffff00;
  9973. if (j1 > 0x2000000 && lowMem)
  9974. i1 = 0xff0000;
  9975. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9976. k += 15;
  9977. }
  9978. int i1 = 0xffff00;
  9979. int x = baseX + (myPlayer.x - 6 >> 7);
  9980. int y = baseY + (myPlayer.y - 6 >> 7);
  9981. if (clientData) {
  9982. char c = '\u01FB';
  9983. int k = 20;
  9984. if (super.fps < 15)
  9985. i1 = 0xff0000;
  9986. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 270 - 15, 5);
  9987. aTextDrawingArea_1271.method385(0xffff00, "Ping: " + ping + "ms", 270, 5);
  9988. Runtime runtime = Runtime.getRuntime();
  9989. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9990. i1 = 0xffff00;
  9991. if (j1 > 0x2000000 && lowMem)
  9992. i1 = 0xff0000;
  9993. k += 15;
  9994. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 284, 5);
  9995. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 299, 5);
  9996. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 314, 5);
  9997. aTextDrawingArea_1271.method385(0xffff00, "Client/Cache: " + update.getVersions().getProperty("client") + "/" + update.getVersions().getProperty("cache"), 329, 5);
  9998. }
  9999. if (anInt1104 != 0) {
  10000. int j = anInt1104 / 50;
  10001. int l = j / 60;
  10002. j %= 60;
  10003. if (j < 10)
  10004. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  10005. + l + ":0" + j, 329, 4);
  10006. else
  10007. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  10008. + l + ":" + j, 329, 4);
  10009. anInt849++;
  10010. if (anInt849 > 75) {
  10011. anInt849 = 0;
  10012. stream.createFrame(148);
  10013. }
  10014. }
  10015. }
  10016.  
  10017. public void addIgnore(long l) {
  10018. try {
  10019. if (l == 0L)
  10020. return;
  10021. if (ignoreCount >= 100) {
  10022. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10023. return;
  10024. }
  10025. String s = TextClass.fixName(TextClass.nameForLong(l));
  10026. for (int j = 0; j < ignoreCount; j++)
  10027. if (ignoreListAsLongs[j] == l) {
  10028. pushMessage(s + " is already on your ignore list", 0, "");
  10029. return;
  10030. }
  10031. for (int k = 0; k < friendsCount; k++)
  10032. if (friendsListAsLongs[k] == l) {
  10033. pushMessage("Please remove " + s
  10034. + " from your friend list first", 0, "");
  10035. return;
  10036. }
  10037.  
  10038. ignoreListAsLongs[ignoreCount++] = l;
  10039. needDrawTabArea = true;
  10040. stream.createFrame(133);
  10041. stream.writeQWord(l);
  10042. return;
  10043. } catch (RuntimeException runtimeexception) {
  10044. SignLink.reporterror("45688, " + l + ", " + 4 + ", "
  10045. + runtimeexception.toString());
  10046. }
  10047. throw new RuntimeException();
  10048. }
  10049.  
  10050. public void method114() {
  10051. for (int i = -1; i < playerCount; i++) {
  10052. int j;
  10053. if (i == -1)
  10054. j = myPlayerIndex;
  10055. else
  10056. j = playerIndices[i];
  10057. Player player = playerArray[j];
  10058. if (player != null)
  10059. method96(player);
  10060. }
  10061.  
  10062. }
  10063.  
  10064. public void method115() {
  10065. if (loadingStage == 2) {
  10066. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  10067. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  10068. .reverseGetNext()) {
  10069. if (class30_sub1.anInt1294 > 0)
  10070. class30_sub1.anInt1294--;
  10071. if (class30_sub1.anInt1294 == 0) {
  10072. if (class30_sub1.anInt1299 < 0
  10073. || ObjectManager.method178(class30_sub1.anInt1299,
  10074. class30_sub1.anInt1301)) {
  10075. method142(class30_sub1.anInt1298,
  10076. class30_sub1.anInt1295, class30_sub1.anInt1300,
  10077. class30_sub1.anInt1301, class30_sub1.anInt1297,
  10078. class30_sub1.anInt1296, class30_sub1.anInt1299);
  10079. class30_sub1.unlink();
  10080. }
  10081. } else {
  10082. if (class30_sub1.anInt1302 > 0)
  10083. class30_sub1.anInt1302--;
  10084. if (class30_sub1.anInt1302 == 0
  10085. && class30_sub1.anInt1297 >= 1
  10086. && class30_sub1.anInt1298 >= 1
  10087. && class30_sub1.anInt1297 <= 102
  10088. && class30_sub1.anInt1298 <= 102
  10089. && (class30_sub1.anInt1291 < 0 || ObjectManager
  10090. .method178(class30_sub1.anInt1291,
  10091. class30_sub1.anInt1293))) {
  10092. method142(class30_sub1.anInt1298,
  10093. class30_sub1.anInt1295, class30_sub1.anInt1292,
  10094. class30_sub1.anInt1293, class30_sub1.anInt1297,
  10095. class30_sub1.anInt1296, class30_sub1.anInt1291);
  10096. class30_sub1.anInt1302 = -1;
  10097. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10098. && class30_sub1.anInt1299 == -1)
  10099. class30_sub1.unlink();
  10100. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10101. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  10102. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10103. class30_sub1.unlink();
  10104. }
  10105. }
  10106. }
  10107.  
  10108. }
  10109. }
  10110.  
  10111. public void determineMenuSize() {
  10112. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10113. for (int j = 0; j < menuActionRow; j++) {
  10114. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10115. if (k > i)
  10116. i = k;
  10117. }
  10118.  
  10119. i += 8;
  10120. int l = 15 * menuActionRow + 21;
  10121. if (super.saveClickX > 4 && super.saveClickY > 4
  10122. && super.saveClickX < 516 && super.saveClickY < 338) {
  10123. int i1 = super.saveClickX - 4 - i / 2;
  10124. if (i1 + i > 512)
  10125. i1 = 512 - i;
  10126. if (i1 < 0)
  10127. i1 = 0;
  10128. int l1 = super.saveClickY - 4;
  10129. if (l1 + l > 334)
  10130. l1 = 334 - l;
  10131. if (l1 < 0)
  10132. l1 = 0;
  10133. menuOpen = true;
  10134. menuScreenArea = 0;
  10135. menuOffsetX = i1;
  10136. menuOffsetY = l1;
  10137. menuWidth = i;
  10138. menuHeight = 15 * menuActionRow + 22;
  10139. }
  10140. if (super.saveClickX > 519 && super.saveClickY > 168
  10141. && super.saveClickX < 765 && super.saveClickY < 503) {
  10142. int j1 = super.saveClickX - 519 - i / 2;
  10143. if (j1 < 0)
  10144. j1 = 0;
  10145. else if (j1 + i > 245)
  10146. j1 = 245 - i;
  10147. int i2 = super.saveClickY - 168;
  10148. if (i2 < 0)
  10149. i2 = 0;
  10150. else if (i2 + l > 333)
  10151. i2 = 333 - l;
  10152. menuOpen = true;
  10153. menuScreenArea = 1;
  10154. menuOffsetX = j1;
  10155. menuOffsetY = i2;
  10156. menuWidth = i;
  10157. menuHeight = 15 * menuActionRow + 22;
  10158. }
  10159. if (super.saveClickX > 0 && super.saveClickY > 338
  10160. && super.saveClickX < 516 && super.saveClickY < 503) {
  10161. int k1 = super.saveClickX - 0 - i / 2;
  10162. if (k1 < 0)
  10163. k1 = 0;
  10164. else if (k1 + i > 516)
  10165. k1 = 516 - i;
  10166. int j2 = super.saveClickY - 338;
  10167. if (j2 < 0)
  10168. j2 = 0;
  10169. else if (j2 + l > 165)
  10170. j2 = 165 - l;
  10171. menuOpen = true;
  10172. menuScreenArea = 2;
  10173. menuOffsetX = k1;
  10174. menuOffsetY = j2;
  10175. menuWidth = i;
  10176. menuHeight = 15 * menuActionRow + 22;
  10177. }
  10178. if (super.saveClickX >= 515 && super.saveClickY >= 0 && super.saveClickX <= 765 && super.saveClickY <= 169) {
  10179. int k1 = super.saveClickX -515- i / 2;
  10180. if (k1 < 0)
  10181. k1 = 0;
  10182. else if (k1 + i > 249)
  10183. k1 =249-i;
  10184. int j2 = super.saveClickY;
  10185. if (j2 < 0)
  10186. j2 = 0;
  10187. else if (j2 + l > 168)
  10188. j2 = 168 - l;
  10189. menuOpen = true;
  10190. menuScreenArea = 3;
  10191. menuOffsetX = k1;
  10192. menuOffsetY = j2;
  10193. menuWidth = i;
  10194. menuHeight = 15 * menuActionRow + 22;
  10195. }
  10196. }
  10197.  
  10198. public void method117(Stream stream) {
  10199. stream.initBitAccess();
  10200. int j = stream.readBits(1);
  10201. if (j == 0)
  10202. return;
  10203. int k = stream.readBits(2);
  10204. if (k == 0) {
  10205. anIntArray894[anInt893++] = myPlayerIndex;
  10206. return;
  10207. }
  10208. if (k == 1) {
  10209. int l = stream.readBits(3);
  10210. myPlayer.moveInDir(false, l);
  10211. int k1 = stream.readBits(1);
  10212. if (k1 == 1)
  10213. anIntArray894[anInt893++] = myPlayerIndex;
  10214. return;
  10215. }
  10216. if (k == 2) {
  10217. int i1 = stream.readBits(3);
  10218. myPlayer.moveInDir(true, i1);
  10219. int l1 = stream.readBits(3);
  10220. myPlayer.moveInDir(true, l1);
  10221. int j2 = stream.readBits(1);
  10222. if (j2 == 1)
  10223. anIntArray894[anInt893++] = myPlayerIndex;
  10224. return;
  10225. }
  10226. if (k == 3) {
  10227. plane = stream.readBits(2);
  10228. int j1 = stream.readBits(1);
  10229. int i2 = stream.readBits(1);
  10230. if (i2 == 1)
  10231. anIntArray894[anInt893++] = myPlayerIndex;
  10232. int k2 = stream.readBits(7);
  10233. int l2 = stream.readBits(7);
  10234. myPlayer.setPos(l2, k2, j1 == 1);
  10235. }
  10236. }
  10237.  
  10238. public void nullLoader() {
  10239. aBoolean831 = false;
  10240. while (drawingFlames) {
  10241. aBoolean831 = false;
  10242. try {
  10243. Thread.sleep(50L);
  10244. } catch (Exception _ex) {
  10245. }
  10246. }
  10247. aBackgroundArray1152s = null;
  10248. anIntArray850 = null;
  10249. anIntArray851 = null;
  10250. anIntArray852 = null;
  10251. anIntArray853 = null;
  10252. anIntArray1190 = null;
  10253. anIntArray1191 = null;
  10254. anIntArray828 = null;
  10255. anIntArray829 = null;
  10256. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10257. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10258. }
  10259.  
  10260. public boolean method119(int i, int j) {
  10261. boolean flag1 = false;
  10262. RSInterface class9 = RSInterface.interfaceCache[j];
  10263. for (int k = 0; k < class9.children.length; k++) {
  10264. if (class9.children[k] == -1)
  10265. break;
  10266. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10267. if (class9_1.type == 1)
  10268. flag1 |= method119(i, class9_1.id);
  10269. if (class9_1.type == 6
  10270. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  10271. boolean flag2 = interfaceIsSelected(class9_1);
  10272. int l;
  10273. if (flag2)
  10274. l = class9_1.anInt258;
  10275. else
  10276. l = class9_1.anInt257;
  10277. if (l != -1) {
  10278. Animation animation = Animation.anims[l];
  10279. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  10280. .method258(class9_1.anInt246);) {
  10281. class9_1.anInt208 -= animation
  10282. .method258(class9_1.anInt246) + 1;
  10283. class9_1.anInt246++;
  10284. if (class9_1.anInt246 >= animation.anInt352) {
  10285. class9_1.anInt246 -= animation.anInt356;
  10286. if (class9_1.anInt246 < 0
  10287. || class9_1.anInt246 >= animation.anInt352)
  10288. class9_1.anInt246 = 0;
  10289. }
  10290. flag1 = true;
  10291. }
  10292.  
  10293. }
  10294. }
  10295. }
  10296.  
  10297. return flag1;
  10298. }
  10299.  
  10300. public int method120() {
  10301. int j = 3;
  10302. if (yCameraCurve < 310) {
  10303. int k = xCameraPos >> 7;
  10304. int l = yCameraPos >> 7;
  10305. int i1 = myPlayer.x >> 7;
  10306. int j1 = myPlayer.y >> 7;
  10307. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10308. j = plane;
  10309. int k1;
  10310. if (i1 > k)
  10311. k1 = i1 - k;
  10312. else
  10313. k1 = k - i1;
  10314. int l1;
  10315. if (j1 > l)
  10316. l1 = j1 - l;
  10317. else
  10318. l1 = l - j1;
  10319. if (k1 > l1) {
  10320. int i2 = (l1 * 0x10000) / k1;
  10321. int k2 = 32768;
  10322. while (k != i1) {
  10323. if (k < i1)
  10324. k++;
  10325. else if (k > i1)
  10326. k--;
  10327. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10328. j = plane;
  10329. k2 += i2;
  10330. if (k2 >= 0x10000) {
  10331. k2 -= 0x10000;
  10332. if (l < j1)
  10333. l++;
  10334. else if (l > j1)
  10335. l--;
  10336. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10337. j = plane;
  10338. }
  10339. }
  10340. } else {
  10341. int j2 = (k1 * 0x10000) / l1;
  10342. int l2 = 32768;
  10343. while (l != j1) {
  10344. if (l < j1)
  10345. l++;
  10346. else if (l > j1)
  10347. l--;
  10348. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10349. j = plane;
  10350. l2 += j2;
  10351. if (l2 >= 0x10000) {
  10352. l2 -= 0x10000;
  10353. if (k < i1)
  10354. k++;
  10355. else if (k > i1)
  10356. k--;
  10357. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10358. j = plane;
  10359. }
  10360. }
  10361. }
  10362. }
  10363. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10364. j = plane;
  10365. return j;
  10366. }
  10367.  
  10368. public int method121() {
  10369. int j = method42(plane, yCameraPos, xCameraPos);
  10370. if (j - zCameraPos < 800
  10371. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10372. return plane;
  10373. else
  10374. return 3;
  10375. }
  10376.  
  10377. public void delIgnore(long l) {
  10378. try {
  10379. if (l == 0L)
  10380. return;
  10381. for (int j = 0; j < ignoreCount; j++)
  10382. if (ignoreListAsLongs[j] == l) {
  10383. ignoreCount--;
  10384. needDrawTabArea = true;
  10385. System.arraycopy(ignoreListAsLongs, j + 1,
  10386. ignoreListAsLongs, j, ignoreCount - j);
  10387.  
  10388. stream.createFrame(74);
  10389. stream.writeQWord(l);
  10390. return;
  10391. }
  10392.  
  10393. return;
  10394. } catch (RuntimeException runtimeexception) {
  10395. SignLink.reporterror("47229, " + 3 + ", " + l + ", "
  10396. + runtimeexception.toString());
  10397. }
  10398. throw new RuntimeException();
  10399. }
  10400.  
  10401. public void chatJoin(long l) {
  10402. try {
  10403. if (l == 0L)
  10404. return;
  10405. stream.createFrame(60);
  10406. stream.writeQWord(l);
  10407. return;
  10408. } catch (RuntimeException runtimeexception) {
  10409. SignLink.reporterror("47229, " + 3 + ", " + l + ", "
  10410. + runtimeexception.toString());
  10411. }
  10412. throw new RuntimeException();
  10413.  
  10414. }
  10415.  
  10416. public String getParameter(String s) {
  10417. if (SignLink.mainapp != null)
  10418. return SignLink.mainapp.getParameter(s);
  10419. else
  10420. return super.getParameter(s);
  10421. }
  10422.  
  10423. public void adjustVolume(boolean flag, int i) {
  10424. SignLink.midivol = i;
  10425. if (flag)
  10426. SignLink.midi = "voladjust";
  10427. }
  10428.  
  10429. public int extractInterfaceValues(RSInterface class9, int j) {
  10430. if (class9.valueIndexArray == null
  10431. || j >= class9.valueIndexArray.length)
  10432. return -2;
  10433. try {
  10434. int ai[] = class9.valueIndexArray[j];
  10435. int k = 0;
  10436. int l = 0;
  10437. int i1 = 0;
  10438. do {
  10439. int j1 = ai[l++];
  10440. int k1 = 0;
  10441. byte byte0 = 0;
  10442. if (j1 == 0)
  10443. return k;
  10444. if (j1 == 1)
  10445. k1 = currentStats[ai[l++]];
  10446. if (j1 == 2)
  10447. k1 = maxStats[ai[l++]];
  10448. if (j1 == 3)
  10449. k1 = currentExp[ai[l++]];
  10450. if (j1 == 4) {
  10451. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10452. int k2 = ai[l++];
  10453. if (k2 >= 0 && k2 < ItemDef.totalItems
  10454. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  10455. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  10456. if (class9_1.inv[j3] == k2 + 1)
  10457. k1 += class9_1.invStackSizes[j3];
  10458.  
  10459. }
  10460. }
  10461. if (j1 == 5)
  10462. k1 = variousSettings[ai[l++]];
  10463. if (j1 == 6)
  10464. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10465. if (j1 == 7)
  10466. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10467. if (j1 == 8)
  10468. k1 = myPlayer.combatLevel;
  10469. if (j1 == 9) {
  10470. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  10471. if (Skills.skillEnabled[l1])
  10472. k1 += maxStats[l1];
  10473.  
  10474. }
  10475. if (j1 == 10) {
  10476. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10477. int l2 = ai[l++] + 1;
  10478. if (l2 >= 0 && l2 < ItemDef.totalItems
  10479. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  10480. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  10481. if (class9_2.inv[k3] != l2)
  10482. continue;
  10483. k1 = 0x3b9ac9ff;
  10484. break;
  10485. }
  10486.  
  10487. }
  10488. }
  10489. if (j1 == 11)
  10490. k1 = energy;
  10491. if (j1 == 12)
  10492. k1 = weight;
  10493. if (j1 == 13) {
  10494. int i2 = variousSettings[ai[l++]];
  10495. int i3 = ai[l++];
  10496. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10497. }
  10498. if (j1 == 14) {
  10499. int j2 = ai[l++];
  10500. VarBit varBit = VarBit.cache[j2];
  10501. int l3 = varBit.anInt648;
  10502. int i4 = varBit.anInt649;
  10503. int j4 = varBit.anInt650;
  10504. int k4 = anIntArray1232[j4 - i4];
  10505. k1 = variousSettings[l3] >> i4 & k4;
  10506. }
  10507. if (j1 == 15)
  10508. byte0 = 1;
  10509. if (j1 == 16)
  10510. byte0 = 2;
  10511. if (j1 == 17)
  10512. byte0 = 3;
  10513. if (j1 == 18)
  10514. k1 = (myPlayer.x >> 7) + baseX;
  10515. if (j1 == 19)
  10516. k1 = (myPlayer.y >> 7) + baseY;
  10517. if (j1 == 20)
  10518. k1 = ai[l++];
  10519. if (byte0 == 0) {
  10520. if (i1 == 0)
  10521. k += k1;
  10522. if (i1 == 1)
  10523. k -= k1;
  10524. if (i1 == 2 && k1 != 0)
  10525. k /= k1;
  10526. if (i1 == 3)
  10527. k *= k1;
  10528. i1 = 0;
  10529. } else {
  10530. i1 = byte0;
  10531. }
  10532. } while (true);
  10533. } catch (Exception _ex) {
  10534. return -1;
  10535. }
  10536. }
  10537.  
  10538. public void drawTooltip() {
  10539. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10540. return;
  10541. String s;
  10542. if (itemSelected == 1 && menuActionRow < 2)
  10543. s = "Use " + selectedItemName + " with...";
  10544. else if (spellSelected == 1 && menuActionRow < 2)
  10545. s = spellTooltip + "...";
  10546. else
  10547. s = menuActionName[menuActionRow - 1];
  10548. if (menuActionRow > 2)
  10549. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10550. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10551. }
  10552.  
  10553. public boolean runClicked = false;
  10554. public boolean Resting = false;
  10555. public boolean runHover;
  10556.  
  10557. public void loadExtraSprites() {
  10558. for(int k = 1; k <= 15; k++)
  10559. ORBS[k] = new Sprite((new StringBuilder()).append("Frame/ORBS ").append(k).append("").toString());
  10560. }
  10561. public void drawWorldMapButton() {
  10562. worldMapIcon.drawSprite(8, 124);
  10563. }
  10564.  
  10565. public int logIconHPos = 0;
  10566.  
  10567. public void processMapAreaClick() {
  10568. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
  10569. logIconHPos = 1;
  10570. } else {
  10571. logIconHPos = 0;
  10572. }
  10573. }
  10574.  
  10575. private void processMinimapActions() {
  10576. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128) {
  10577. menuActionName[1] = !runClicked ? "Toggle Run-Mode On" : "Toggle Run-Mode On";
  10578. menuActionIds[1] = 1050;
  10579. menuActionRow = 2;
  10580. }
  10581. if (super.mouseX >= 695 && super.mouseX <= 751 && super.mouseY >= 134 && super.mouseY < 165) {
  10582. menuActionName[1] = "Familar Information";
  10583. menuActionIds[1] = 1505;
  10584. menuActionRow = 2;
  10585. }
  10586. }
  10587.  
  10588. public void drawLogoutButton() {
  10589. if (tabInterfaceIDs[10] != -1 && anInt1054 == 9)
  10590. if (loopCycle % 20 >= 10)
  10591. ;
  10592. // sideIcons[7].drawSprite(223, 1);
  10593. if (logIconHPos == 0) {
  10594. logIconH.drawSprite(223, 1);
  10595. } else {
  10596. logIconC.drawSprite(223, 1);
  10597. }
  10598. if (tabID == 10)
  10599. logIconC.drawSprite(223, 1);
  10600. }
  10601.  
  10602. private void rightClickMapArea() {
  10603. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
  10604. menuActionName[1] = "Logout";
  10605. menuActionIds[1] = 1004;
  10606. menuActionRow = 2;
  10607. } else if (super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118) {
  10608. menuActionName[1] = "Run";
  10609. menuActionIds[1] = 1051;
  10610. menuActionRow = 2;
  10611. }
  10612. }
  10613.  
  10614. public void drawRunOrb(){
  10615. ORBS[0] = new Sprite(SignLink.findcachedir() + "/Sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(100));
  10616. if(energy != 100){
  10617. ORBS[0].drawSprite(193, 95);
  10618. }
  10619. runClicked = anIntArray1045[173] == 1;
  10620. Resting = anIntArray1045[174] == 1;
  10621. ORBS[runHover ? 7 : 1].drawSprite(190, 92);
  10622. ORBS[runClicked ? 11 : 10].drawSprite(193, 95);
  10623. if(!Resting)
  10624. ORBS[runClicked ? 9 : 8].drawSprite(200, 100);
  10625. else
  10626. ORBS[Resting ? 12 : 8].drawSprite(200, 100);
  10627. String currentEnergy = RSInterface.interfaceCache[149].message;
  10628. currentEnergy = currentEnergy.replaceAll("%","");
  10629. smallText.method382(getOrbTextColor(100), 232, currentEnergy, 118, true);
  10630. }
  10631.  
  10632. public void drawPrayer()
  10633. {
  10634. String s1 = RSInterface.interfaceCache[4012].message;
  10635. String s2 = RSInterface.interfaceCache[4013].message;
  10636. s1 = s1.replace("%1", "1");
  10637. s2 = s2.replace("%1", "1");
  10638. int i = Integer.parseInt(s1);
  10639. int j = Integer.parseInt(s2);
  10640. int k = (int)(((double)i / (double)j) * 100D);
  10641. ORBS[0] = new Sprite(SignLink.findcachedir() + "/Sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(k));
  10642. ORBS[1].drawSprite(190, 53);
  10643. ORBS[4].drawSprite(193, 56);
  10644. ORBS[0].drawSprite(194, 56);
  10645. ORBS[6].drawSprite(197, 60);
  10646. smallText.method382(getOrbTextColor(k), 234, (new StringBuilder()).append("").append(i).toString(), 79, true);
  10647. }
  10648.  
  10649. public void drawHP() {
  10650. int health;
  10651. String cHP = RSInterface.interfaceCache[4016].message;
  10652. cHP = cHP.replaceAll("%", "");
  10653. int currentHP = Integer.parseInt(cHP);
  10654. String mHP = RSInterface.interfaceCache[4017].message;
  10655. mHP = mHP.replaceAll("%", "");
  10656. int maxHP2 = Integer.parseInt(mHP);
  10657. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  10658. ORBS[0] = new Sprite(SignLink.findcachedir() + "/Sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(health));
  10659. ORBS[1].drawSprite(174, 14);
  10660. ORBS[2].drawSprite(177, 17);
  10661. ORBS[0].drawSprite(177, 17);
  10662. if (health <= 20) {
  10663. if (loopCycle % 20 < 10) {
  10664. ORBS[3].drawSprite(183, 25);
  10665. }
  10666. } else {
  10667. ORBS[3].drawSprite(183, 25);
  10668. }
  10669. int Y = 40;
  10670. smallText.method382(getOrbTextColor(health), 218, currentHP + "", Y, true);
  10671. }
  10672.  
  10673. public void drawSumm() {
  10674. if (RSInterface.interfaceCache[18167].message.isEmpty() || RSInterface.interfaceCache[18171].message.isEmpty())
  10675. return;
  10676.  
  10677. int currentPR = Integer.parseInt(RSInterface.interfaceCache[18167].message);
  10678. int maxPR2 = Integer.parseInt(RSInterface.interfaceCache[18171].message);
  10679. int summ = (int) (((double) currentPR / (double) maxPR2) * 100D);
  10680.  
  10681. Sprite background = new Sprite(SignLink.findcachedir() + "/Sprites/sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(summ));
  10682.  
  10683. if (summHover) {
  10684. ORBS[7].drawSprite(174, 130);
  10685. } else if (!summHover) {
  10686. ORBS[1].drawSprite(174, 130);
  10687. }
  10688.  
  10689. ORBS[16].drawSprite(177, 133);
  10690. background.drawSprite(177, 133);
  10691.  
  10692. if (summ <= 25) {
  10693. if (loopCycle % 20 < 10) {
  10694. ORBS[18].drawSprite(182, 139);
  10695. }
  10696. } else {
  10697. ORBS[18].drawSprite(182, 139);
  10698. }
  10699. smallText.method382(getOrbTextColor(summ), 218, currentPR + "", 157, true);
  10700. }
  10701.  
  10702. public int getOrbTextColor(int i)
  10703. {
  10704. if(i >= 75 && i <= 0x7fffffff)
  10705. return 65280;
  10706. if(i >= 50 && i <= 74)
  10707. return 0xffff00;
  10708. return i < 25 || i > 49 ? 0xff0000 : 0xff981f;
  10709. }
  10710.  
  10711. public int getOrbFill(int i)
  10712. {
  10713. if(i <= 0x7fffffff && i >= 97)
  10714. return 0;
  10715. if(i <= 96 && i >= 93)
  10716. return 1;
  10717. if(i <= 92 && i >= 89)
  10718. return 2;
  10719. if(i <= 88 && i >= 85)
  10720. return 3;
  10721. if(i <= 84 && i >= 81)
  10722. return 4;
  10723. if(i <= 80 && i >= 77)
  10724. return 5;
  10725. if(i <= 76 && i >= 73)
  10726. return 6;
  10727. if(i <= 72 && i >= 69)
  10728. return 7;
  10729. if(i <= 68 && i >= 65)
  10730. return 8;
  10731. if(i <= 64 && i >= 61)
  10732. return 9;
  10733. if(i <= 60 && i >= 57)
  10734. return 10;
  10735. if(i <= 56 && i >= 53)
  10736. return 11;
  10737. if(i <= 52 && i >= 49)
  10738. return 12;
  10739. if(i <= 48 && i >= 45)
  10740. return 13;
  10741. if(i <= 44 && i >= 41)
  10742. return 14;
  10743. if(i <= 40 && i >= 37)
  10744. return 15;
  10745. if(i <= 36 && i >= 33)
  10746. return 16;
  10747. if(i <= 32 && i >= 29)
  10748. return 17;
  10749. if(i <= 28 && i >= 25)
  10750. return 18;
  10751. if(i <= 24 && i >= 21)
  10752. return 19;
  10753. if(i <= 20 && i >= 17)
  10754. return 20;
  10755. if(i <= 16 && i >= 13)
  10756. return 21;
  10757. if(i <= 12 && i >= 9)
  10758. return 22;
  10759. if(i <= 8 && i >= 7)
  10760. return 23;
  10761. if(i <= 6 && i >= 5)
  10762. return 24;
  10763. if(i <= 4 && i >= 3)
  10764. return 25;
  10765. if(i <= 2 && i >= 1)
  10766. return 26;
  10767. return i > 0 ? 0 : 27;
  10768. }
  10769.  
  10770. private void drawMinimap() {
  10771. aRSImageProducer_1164.initDrawingArea();
  10772. if(anInt1021 == 2) {
  10773. byte abyte0[] = mapBack.aByteArray1450;
  10774. int ai[] = DrawingArea.pixels;
  10775. int k2 = abyte0.length;
  10776. for(int i5 = 0; i5 < k2; i5++)
  10777. if(abyte0[i5] == 0)
  10778. ai[i5] = 0;
  10779. compass.method352(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10780. aRSImageProducer_1165.initDrawingArea();
  10781. return;
  10782. }
  10783. int i = viewRotation + minimapRotation & 0x7ff;
  10784. int j = 48 + myPlayer.x / 32;
  10785. int l2 = 464 - myPlayer.y / 32;
  10786. for (int x = 0; x < anIntArray1229.length; x++){
  10787. anIntArray1229[x] = 170;
  10788. anIntArray1052[x] = -23;
  10789. }
  10790. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapZoom, anIntArray1052, l2, 10, 45, 146, j);
  10791. compass.method352(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10792. for(int j5 = 0; j5 < anInt1071; j5++) {
  10793. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10794. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10795. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10796. }
  10797.  
  10798. for(int k5 = 0; k5 < 104; k5++) {
  10799. for(int l5 = 0; l5 < 104; l5++) {
  10800. NodeList class19 = groundArray[plane][k5][l5];
  10801. if(class19 != null) {
  10802. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10803. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10804. markMinimap(mapDotItem, l, j3);
  10805. }
  10806. }
  10807. }
  10808.  
  10809. for(int i6 = 0; i6 < npcCount; i6++) {
  10810. NPC npc = npcArray[npcIndices[i6]];
  10811. if(npc != null && npc.isVisible()) {
  10812. EntityDef entityDef = npc.desc;
  10813. if(entityDef.childrenIDs != null)
  10814. entityDef = entityDef.method161();
  10815. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10816. int i1 = npc.x / 32 - myPlayer.x / 32;
  10817. int k3 = npc.y / 32 - myPlayer.y / 32;
  10818. markMinimap(mapDotNPC, i1, k3);
  10819. }
  10820. }
  10821. }
  10822.  
  10823. for(int j6 = 0; j6 < playerCount; j6++) {
  10824. Player player = playerArray[playerIndices[j6]];
  10825. if(player != null && player.isVisible()) {
  10826. int j1 = player.x / 32 - myPlayer.x / 32;
  10827. int l3 = player.y / 32 - myPlayer.y / 32;
  10828. boolean flag1 = false;
  10829. long l6 = TextClass.longForName(player.name);
  10830. for(int k6 = 0; k6 < friendsCount; k6++) {
  10831. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10832. continue;
  10833. flag1 = true;
  10834. break;
  10835. }
  10836. @SuppressWarnings("unused")
  10837. boolean flag2 = false;
  10838. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10839. flag2 = true;
  10840. if(flag1)
  10841. markMinimap(mapDotFriend, j1, l3);
  10842. else
  10843. markMinimap(mapDotPlayer, j1, l3);
  10844. }
  10845. }
  10846.  
  10847. if(anInt855 != 0 && loopCycle % 20 < 10) {
  10848. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10849. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10850. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  10851. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10852. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10853. method81(mapMarker, i4, k1);
  10854. }
  10855. }
  10856. if(anInt855 == 2) {
  10857. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10858. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10859. method81(mapMarker, j4, l1);
  10860. }
  10861. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  10862. {
  10863. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10864. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  10865. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10866. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10867. method81(mapMarker, k4, i2);
  10868. }
  10869. }
  10870. }
  10871. if(destX != 0) {
  10872. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10873. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10874. markMinimap(mapFlag, j2, l4);
  10875. }
  10876. DrawingArea.drawPixels(3, 78+5, 97+20, 0xffffff, 3);
  10877. mapArea.drawSprite(0, 0);
  10878. drawWorldMapButton();
  10879. drawLogoutButton();
  10880. drawHP();
  10881. drawPrayer();
  10882. drawSumm();
  10883. drawRunOrb();
  10884. drawXPCounter();
  10885. if(menuOpen && menuScreenArea == 3) {
  10886. drawMenu();
  10887. }
  10888. aRSImageProducer_1165.initDrawingArea();
  10889. }
  10890.  
  10891. public void npcScreenPos(Entity entity, int i) {
  10892. calcEntityScreenPos(entity.x, i, entity.y);
  10893. }
  10894.  
  10895. public void calcEntityScreenPos(int i, int j, int l) {
  10896. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  10897. spriteDrawX = -1;
  10898. spriteDrawY = -1;
  10899. return;
  10900. }
  10901. int i1 = method42(plane, l, i) - j;
  10902. i -= xCameraPos;
  10903. i1 -= zCameraPos;
  10904. l -= yCameraPos;
  10905. int j1 = Model.SINE[yCameraCurve];
  10906. int k1 = Model.COSINE[yCameraCurve];
  10907. int l1 = Model.SINE[xCameraCurve];
  10908. int i2 = Model.COSINE[xCameraCurve];
  10909. int j2 = l * l1 + i * i2 >> 16;
  10910. l = l * i2 - i * l1 >> 16;
  10911. i = j2;
  10912. j2 = i1 * k1 - l * j1 >> 16;
  10913. l = i1 * j1 + l * k1 >> 16;
  10914. i1 = j2;
  10915. if (l >= 50) {
  10916. spriteDrawX = Rasterizer.centerX + (i << 9) / l;
  10917. spriteDrawY = Rasterizer.centerY + (i1 << 9) / l;
  10918. } else {
  10919. spriteDrawX = -1;
  10920. spriteDrawY = -1;
  10921. }
  10922. }
  10923.  
  10924. @SuppressWarnings("unused")
  10925. public void buildSplitpublicChatMenu() {
  10926. if (splitpublicChat == 0)
  10927. return;
  10928. int i = 0;
  10929. if (anInt1104 != 0)
  10930. i = 1;
  10931. for (int j = 0; j < 100; j++)
  10932. if (chatMessages[j] != null) {
  10933. int k = chatTypes[j];
  10934. String s = chatNames[j];
  10935. boolean flag1 = false;
  10936. if(s != null && s.startsWith("@cr1@"))
  10937. {
  10938. s = s.substring(5);
  10939. }
  10940. if(s != null && s.startsWith("@cr2@"))
  10941. {
  10942. s = s.substring(5);
  10943. }
  10944. if(s != null && s.startsWith("@cr4@"))
  10945. {
  10946. s = s.substring(5);
  10947. }
  10948. if(s != null && s.startsWith("@cr5@"))
  10949. {
  10950. s = s.substring(5);
  10951. }
  10952. if(s != null && s.startsWith("@cr6@"))
  10953. {
  10954. s = s.substring(5);
  10955. }
  10956. if(s != null && s.startsWith("@cr7@"))
  10957. {
  10958. s = s.substring(5);
  10959. }
  10960. if(s != null && s.startsWith("@cr8@"))
  10961. {
  10962. s = s.substring(5);
  10963. }
  10964. if(s != null && s.startsWith("@cr9@"))
  10965. {
  10966. s = s.substring(5);
  10967. }
  10968. if(s != null && s.startsWith("@cr10@"))
  10969. {
  10970. s = s.substring(6);
  10971. }
  10972. if(s != null && s.startsWith("@cr11@"))
  10973. {
  10974. s = s.substring(6);
  10975. }
  10976. if(s != null && s.startsWith("@cr12@"))
  10977. {
  10978. s = s.substring(6);
  10979. }
  10980. if(s != null && s.startsWith("@cr13@"))
  10981. {
  10982. s = s.substring(6);
  10983. }
  10984. if(s != null && s.startsWith("@cr14@"))
  10985. {
  10986. s = s.substring(6);
  10987. }
  10988. if(s != null && s.startsWith("@cr15@"))
  10989. {
  10990. s = s.substring(6);
  10991. }
  10992. if(s != null && s.startsWith("@cr16@"))
  10993. {
  10994. s = s.substring(6);
  10995. }
  10996. if(s != null && s.startsWith("@cr17@"))
  10997. {
  10998. s = s.substring(6);
  10999. }
  11000. if(s != null && s.startsWith("@cr18@"))
  11001. {
  11002. s = s.substring(6);
  11003. }
  11004. if(s != null && s.startsWith("@cr19@"))
  11005. {
  11006. s = s.substring(6);
  11007. }
  11008. if(s != null && s.startsWith("@cr20@"))
  11009. {
  11010. s = s.substring(6);
  11011. }
  11012. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  11013. {
  11014. int l = 329 - i * 13;
  11015. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11016. {
  11017. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11018. if(i1 > 450)
  11019. i1 = 450;
  11020. if(super.mouseX < 4 + i1)
  11021. {
  11022. if(myPrivilege >= 1)
  11023. {
  11024. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11025. menuActionIds[menuActionRow] = 2606;
  11026. menuActionRow++;
  11027. }
  11028. menuActionName[menuActionRow] = "Add ignore @whi@"
  11029. + s;
  11030. menuActionIds[menuActionRow] = 2042;
  11031. menuActionRow++;
  11032. menuActionName[menuActionRow] = "Add friend @whi@"
  11033. + s;
  11034. menuActionIds[menuActionRow] = 2337;
  11035. menuActionRow++;
  11036. }
  11037. }
  11038. if (++i >= 5)
  11039. return;
  11040. }
  11041. if ((k == 5 || k == 6) && publicChatMode < 2 && ++i >= 5)
  11042. return;
  11043. }
  11044.  
  11045. }
  11046.  
  11047. public void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  11048. int i2, int j2) {
  11049. Class30_Sub1 class30_sub1 = null;
  11050. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11051. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11052. .reverseGetNext()) {
  11053. if (class30_sub1_1.anInt1295 != l1
  11054. || class30_sub1_1.anInt1297 != i2
  11055. || class30_sub1_1.anInt1298 != j1
  11056. || class30_sub1_1.anInt1296 != i1)
  11057. continue;
  11058. class30_sub1 = class30_sub1_1;
  11059. break;
  11060. }
  11061.  
  11062. if (class30_sub1 == null) {
  11063. class30_sub1 = new Class30_Sub1();
  11064. class30_sub1.anInt1295 = l1;
  11065. class30_sub1.anInt1296 = i1;
  11066. class30_sub1.anInt1297 = i2;
  11067. class30_sub1.anInt1298 = j1;
  11068. method89(class30_sub1);
  11069. aClass19_1179.insertHead(class30_sub1);
  11070. }
  11071. class30_sub1.anInt1291 = k;
  11072. class30_sub1.anInt1293 = k1;
  11073. class30_sub1.anInt1292 = l;
  11074. class30_sub1.anInt1302 = j2;
  11075. class30_sub1.anInt1294 = j;
  11076. }
  11077.  
  11078. public boolean interfaceIsSelected(RSInterface class9) {
  11079. if (class9.valueCompareType == null)
  11080. return false;
  11081. for (int i = 0; i < class9.valueCompareType.length; i++) {
  11082. int j = extractInterfaceValues(class9, i);
  11083. int k = class9.requiredValues[i];
  11084. if (class9.valueCompareType[i] == 2) {
  11085. if (j >= k)
  11086. return false;
  11087. } else if (class9.valueCompareType[i] == 3) {
  11088. if (j <= k)
  11089. return false;
  11090. } else if (class9.valueCompareType[i] == 4) {
  11091. if (j == k)
  11092. return false;
  11093. } else if (j != k)
  11094. return false;
  11095. }
  11096.  
  11097. return true;
  11098. }
  11099.  
  11100. public DataInputStream openJagGrabInputStream(String s) throws IOException {
  11101. // if(!aBoolean872)
  11102. // if(SignLink.mainapp != null)
  11103. // return SignLink.openurl(s);
  11104. // else
  11105. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11106. if (aSocket832 != null) {
  11107. try {
  11108. aSocket832.close();
  11109. } catch (Exception _ex) {
  11110. }
  11111. aSocket832 = null;
  11112. }
  11113. aSocket832 = openSocket(43595);
  11114. aSocket832.setSoTimeout(10000);
  11115. java.io.InputStream inputstream = aSocket832.getInputStream();
  11116. OutputStream outputstream = aSocket832.getOutputStream();
  11117. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11118. return new DataInputStream(inputstream);
  11119. }
  11120.  
  11121. public void doFlamesDrawing() {
  11122. char c = '\u0100';
  11123. if (anInt1040 > 0) {
  11124. for (int i = 0; i < 256; i++)
  11125. if (anInt1040 > 768)
  11126. anIntArray850[i] = method83(anIntArray851[i],
  11127. anIntArray852[i], 1024 - anInt1040);
  11128. else if (anInt1040 > 256)
  11129. anIntArray850[i] = anIntArray852[i];
  11130. else
  11131. anIntArray850[i] = method83(anIntArray852[i],
  11132. anIntArray851[i], 256 - anInt1040);
  11133.  
  11134. } else if (anInt1041 > 0) {
  11135. for (int j = 0; j < 256; j++)
  11136. if (anInt1041 > 768)
  11137. anIntArray850[j] = method83(anIntArray851[j],
  11138. anIntArray853[j], 1024 - anInt1041);
  11139. else if (anInt1041 > 256)
  11140. anIntArray850[j] = anIntArray853[j];
  11141. else
  11142. anIntArray850[j] = method83(anIntArray853[j],
  11143. anIntArray851[j], 256 - anInt1041);
  11144.  
  11145. } else {
  11146. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11147.  
  11148. }
  11149. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  11150. aRSImageProducer_1110.anIntArray315, 0, 33920);
  11151.  
  11152. int i1 = 0;
  11153. int j1 = 1152;
  11154. for (int k1 = 1; k1 < c - 1; k1++) {
  11155. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11156. int j2 = 22 + l1;
  11157. if (j2 < 0)
  11158. j2 = 0;
  11159. i1 += j2;
  11160. for (int l2 = j2; l2 < 128; l2++) {
  11161. int j3 = anIntArray828[i1++];
  11162. if (j3 != 0) {
  11163. int l3 = j3;
  11164. int j4 = 256 - j3;
  11165. j3 = anIntArray850[j3];
  11166. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  11167. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  11168. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  11169. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11170. } else {
  11171. j1++;
  11172. }
  11173. }
  11174.  
  11175. j1 += j2;
  11176. }
  11177.  
  11178. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  11179. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  11180. aRSImageProducer_1111.anIntArray315, 0, 33920);
  11181.  
  11182. i1 = 0;
  11183. j1 = 1176;
  11184. for (int k2 = 1; k2 < c - 1; k2++) {
  11185. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11186. int k3 = 103 - i3;
  11187. j1 += i3;
  11188. for (int i4 = 0; i4 < k3; i4++) {
  11189. int k4 = anIntArray828[i1++];
  11190. if (k4 != 0) {
  11191. int i5 = k4;
  11192. int j5 = 256 - k4;
  11193. k4 = anIntArray850[k4];
  11194. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  11195. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  11196. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  11197. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11198. } else {
  11199. j1++;
  11200. }
  11201. }
  11202.  
  11203. i1 += 128 - k3;
  11204. j1 += 128 - k3 - i3;
  11205. }
  11206.  
  11207. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11208. }
  11209.  
  11210. public void method134(Stream stream) {
  11211. int j = stream.readBits(8);
  11212. if (j < playerCount) {
  11213. for (int k = j; k < playerCount; k++)
  11214. anIntArray840[anInt839++] = playerIndices[k];
  11215.  
  11216. }
  11217. if (j > playerCount) {
  11218. SignLink.reporterror(myUsername + " Too many players");
  11219. throw new RuntimeException("eek");
  11220. }
  11221. playerCount = 0;
  11222. for (int l = 0; l < j; l++) {
  11223. int i1 = playerIndices[l];
  11224. Player player = playerArray[i1];
  11225. int j1 = stream.readBits(1);
  11226. if (j1 == 0) {
  11227. playerIndices[playerCount++] = i1;
  11228. player.anInt1537 = loopCycle;
  11229. } else {
  11230. int k1 = stream.readBits(2);
  11231. if (k1 == 0) {
  11232. playerIndices[playerCount++] = i1;
  11233. player.anInt1537 = loopCycle;
  11234. anIntArray894[anInt893++] = i1;
  11235. } else if (k1 == 1) {
  11236. playerIndices[playerCount++] = i1;
  11237. player.anInt1537 = loopCycle;
  11238. int l1 = stream.readBits(3);
  11239. player.moveInDir(false, l1);
  11240. int j2 = stream.readBits(1);
  11241. if (j2 == 1)
  11242. anIntArray894[anInt893++] = i1;
  11243. } else if (k1 == 2) {
  11244. playerIndices[playerCount++] = i1;
  11245. player.anInt1537 = loopCycle;
  11246. int i2 = stream.readBits(3);
  11247. player.moveInDir(true, i2);
  11248. int k2 = stream.readBits(3);
  11249. player.moveInDir(true, k2);
  11250. int l2 = stream.readBits(1);
  11251. if (l2 == 1)
  11252. anIntArray894[anInt893++] = i1;
  11253. } else if (k1 == 3)
  11254. anIntArray840[anInt839++] = i1;
  11255. }
  11256. }
  11257. }
  11258.  
  11259. public void drawLoginScreen() {
  11260. CheckBackgrounds();
  11261. resetImageProducers();
  11262. aRSImageProducer_1109.initDrawingArea();
  11263. this.LoginBox.drawTransparentSprite(257, 127, 200);
  11264. aRSImageProducer_1109.initDrawingArea();
  11265. this.Logo.drawAdvancedSprite(150, 45);
  11266. BackgroundSwitcher();
  11267. HandleLoginButton();
  11268. HandleTypeInBoxes();
  11269. RememberAccountInfo();
  11270. this.smallText.method382(16777215, 390, this.loginMessage1, 300, true);
  11271. this.smallText.method382(16777215, 391, this.loginMessage2, 310, true);
  11272. 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);
  11273. 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);
  11274. int i1 = 0xffff00;
  11275. if (clientData) {
  11276. if (super.fps < 15)
  11277. i1 = 0xff0000;
  11278. aTextDrawingArea_1271.method385(i1, "Fps: " + super.fps, 12, 0);
  11279. Runtime runtime = Runtime.getRuntime();
  11280. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11281. i1 = 0xffff00;
  11282. if (j1 > 0x2000000 && lowMem)
  11283. i1 = 0xff0000;
  11284. aTextDrawingArea_1271.method385(i1, "Mem: " + j1 + "k", 27, 0);
  11285. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 42, 0);
  11286. aTextDrawingArea_1271.method385(0xffff00, "Client/Cache: " + update.getVersions().getProperty("client") + "/" + update.getVersions().getProperty("cache"), 57, 0);
  11287. }
  11288. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  11289. }
  11290.  
  11291. public void CheckBackgrounds() {
  11292. if(FadingBackgrounds)
  11293. fadingTimer();
  11294. else
  11295. BackgroundFix.drawAdvancedSprite(0, 0);
  11296. }
  11297.  
  11298. public void HandleLoginButton() {
  11299. if (this.mouseX >= 269 && this.mouseX <= 496 && this.mouseY >= 312 && this.mouseY <= 354)
  11300. this.LoginButtonHover.drawTransparentSprite(269, 312, 200);
  11301. else
  11302. this.LoginButton.drawTransparentSprite(269, 312, 200);
  11303. }
  11304.  
  11305. public void HandleTypeInBoxes() {
  11306. if (this.mouseX >= 270 && this.mouseX <= 495 && this.mouseY >= 170 && this.mouseY <= 195)
  11307. this.TypeInHover.drawTransparentSprite(270, 170, 50);
  11308. else
  11309. this.TypeIn.drawTransparentSprite(270, 170, 50);
  11310.  
  11311. if (this.mouseX >= 270 && this.mouseX <= 495 && this.mouseY >= 224 && this.mouseY <= 249)
  11312. this.TypeInHover.drawTransparentSprite(270, 224, 50);
  11313. else
  11314. this.TypeIn.drawTransparentSprite(270, 224, 50);
  11315. }
  11316.  
  11317. public void RememberAccountInfo() {
  11318. if(saveAccountInfo)
  11319. this.RememberYes.drawTransparentSprite(311, 272, 200);
  11320. else
  11321. this.RememberNo.drawTransparentSprite(311, 272, 200);
  11322. }
  11323.  
  11324. public void BackgroundSwitcher() {
  11325. if(this.mouseX >= 0 && this.mouseX <= 57 && this.mouseY >= 468 && this.mouseY <= 503) {
  11326. if(FadingBackgrounds) {
  11327. Bg = new Sprite("/Login/anim4");
  11328. this.Bg.drawAdvancedSprite(0, 468);
  11329. } else {
  11330. Bg = new Sprite("/Login/anim2");
  11331. this.Bg.drawAdvancedSprite(0, 468);
  11332. }
  11333. } else if(FadingBackgrounds) {
  11334. Bg = new Sprite("/Login/anim3");
  11335. this.Bg.drawAdvancedSprite(0, 468);
  11336. } else {
  11337. Bg = new Sprite("/Login/anim");
  11338. this.Bg.drawAdvancedSprite(0, 468);
  11339. }
  11340. }
  11341.  
  11342. public void worldSwitcher() {
  11343. }
  11344.  
  11345. public void processLoginScreenInput() {
  11346. resetImage();
  11347. if (super.clickMode3 == 1 && super.saveClickX >= 0
  11348. && super.saveClickX <= 57 && super.saveClickY >= 468
  11349. && super.saveClickY <= 503)
  11350. if(FadingBackgrounds)
  11351. FadingBackgrounds = false;
  11352. else
  11353. FadingBackgrounds = true;
  11354.  
  11355. if (super.clickMode3 == 1 && super.saveClickX >= 270
  11356. && super.saveClickX <= 495 && super.saveClickY >= 170
  11357. && super.saveClickY <= 195) {
  11358. loginScreenCursorPos = 0;
  11359. } else if (super.clickMode3 == 1 && super.mouseX >= 270
  11360. && super.mouseX <= 495 && super.mouseY >= 224
  11361. && super.mouseY <= 249) {
  11362. loginScreenCursorPos = 1;
  11363. }
  11364. if (super.clickMode3 == 1 && super.saveClickX >= 311 && super.saveClickX <= 329
  11365. && super.saveClickY >= 272 && super.saveClickY <= 290) {
  11366. if(saveAccountInfo) {
  11367. saveAccountInfo = false;
  11368. } else {
  11369. saveAccountInfo = true;
  11370. }
  11371. }
  11372. if (super.clickMode3 == 1 && super.saveClickX >= 269
  11373. && super.saveClickX <= 496 && super.saveClickY >= 312
  11374. && super.saveClickY <= 354) {
  11375. loginFailures = 0;
  11376. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  11377. login(myUsername, myPassword, false);
  11378. } else {
  11379. this.loginScreenCursorPos = 0;
  11380. this.loginMessage1 = "Username & Password";
  11381. this.loginMessage2 = "Must be more than 1 character";
  11382. }
  11383. if (this.loggedIn)
  11384. return;
  11385. }
  11386. do {
  11387. int l1 = readChar(-796);
  11388. if (l1 == -1)
  11389. break;
  11390. boolean flag1 = false;
  11391. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  11392. if (l1 != validUserPassChars.charAt(i2))
  11393. continue;
  11394. flag1 = true;
  11395. break;
  11396. }
  11397.  
  11398.  
  11399. if (loginScreenCursorPos == 0) {
  11400. if (l1 == 8 && myUsername.length() > 0)
  11401. myUsername = myUsername.substring(0,
  11402. myUsername.length() - 1);
  11403. if (l1 == 9 || l1 == 10 || l1 == 13)
  11404. loginScreenCursorPos = 1;
  11405. if (flag1)
  11406. myUsername += (char) l1;
  11407. if (myUsername.length() > 12)
  11408. myUsername = myUsername.substring(0, 12);
  11409. } else if (loginScreenCursorPos == 1) {
  11410. if (l1 == 8 && myPassword.length() > 0)
  11411. myPassword = myPassword.substring(0,
  11412. myPassword.length() - 1);
  11413. if (l1 == 9 || l1 == 10 || l1 == 13)
  11414. loginScreenCursorPos = 0;
  11415. if (flag1)
  11416. myPassword += (char) l1;
  11417. if (myPassword.length() > 20)
  11418. myPassword = myPassword.substring(0, 20);
  11419. }
  11420. } while (true);
  11421. return;
  11422. }
  11423.  
  11424.  
  11425.  
  11426. /**
  11427. * Handle the Fading Timer.
  11428. * @author Unknown
  11429. */
  11430.  
  11431. public void fadingTimer() {
  11432. if (bgId > 2) {
  11433. bgId = 0;
  11434. }
  11435. if (bgFinal <= 0) {
  11436. bgId++;
  11437. bgBoolean = false;
  11438. }
  11439. if (bgFinal >= 250) {
  11440. bgBoolean = true;
  11441. }
  11442. waitTicker += 5;
  11443.  
  11444. if (bgBoolean) {
  11445. waitTicker += 1;
  11446. if (waitTicker >= 750) {
  11447. waitTicker = 0;
  11448. }
  11449. if (waitTicker >= 500) {
  11450. Sprite sprite = new Sprite("BG/" + bgId);
  11451. bgFinal -= 10;
  11452. sprite.drawBackground(0, 0, bgFinal);
  11453. } else {
  11454. Sprite sprite = new Sprite("BG/" + bgId);
  11455. sprite.drawBackground(0, 0, 250);
  11456. }
  11457. } else {
  11458. bgFinal += 10;
  11459. Sprite sprite = new Sprite("BG/" + bgId);
  11460. sprite.drawBackground(0, 0, bgFinal);
  11461. }
  11462. }
  11463.  
  11464. public static void writeSettings() throws IOException {
  11465. try {
  11466. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(SignLink.findcachedir() + "settings.dat")));
  11467. out.writeUTF(myUsername);
  11468. out.writeUTF(myPassword);
  11469. out.close();
  11470. } catch(Exception e) { }
  11471. }
  11472.  
  11473. public static void writeLoginSettings() throws IOException {
  11474. try {
  11475. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(SignLink.findcachedir() + "lsettings.dat")));
  11476. out.writeUTF(myUsername);
  11477. out.writeUTF(myPassword);
  11478. out.close();
  11479. } catch(Exception e) { }
  11480. }
  11481.  
  11482. public static void readSettings() throws IOException {
  11483. try {
  11484. DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(SignLink.findcachedir() + "settings.dat")));
  11485. myUsername = in.readUTF();
  11486. myPassword = in.readUTF();
  11487. in.close();
  11488. } catch(Exception e) { }
  11489. }
  11490.  
  11491. public void drawFlames() {
  11492. /*drawingFlames = true;
  11493. try {
  11494. long l = System.currentTimeMillis();
  11495. int i = 0;
  11496. int j = 20;
  11497. while (aBoolean831) {
  11498. anInt1208++;
  11499. calcFlamesPosition();
  11500. calcFlamesPosition();
  11501. doFlamesDrawing();
  11502. if (++i > 10) {
  11503. long l1 = System.currentTimeMillis();
  11504. int k = (int) (l1 - l) / 10 - j;
  11505. j = 40 - k;
  11506. if (j < 5)
  11507. j = 5;
  11508. i = 0;
  11509. l = l1;
  11510. }
  11511. try {
  11512. Thread.sleep(j);
  11513. } catch (Exception _ex) {
  11514. }
  11515. }
  11516. } catch (Exception _ex) {
  11517. }
  11518. drawingFlames = false;*/
  11519. }
  11520.  
  11521. public void raiseWelcomeScreen() {
  11522. welcomeScreenRaised = true;
  11523. }
  11524.  
  11525. public void method137(Stream stream, int j) {
  11526. if (j == 84) {
  11527. int k = stream.readUnsignedByte();
  11528. int j3 = anInt1268 + (k >> 4 & 7);
  11529. int i6 = anInt1269 + (k & 7);
  11530. int l8 = stream.readUnsignedWord();
  11531. int k11 = stream.readUnsignedWord();
  11532. int l13 = stream.readUnsignedWord();
  11533. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  11534. NodeList class19_1 = groundArray[plane][j3][i6];
  11535. if (class19_1 != null) {
  11536. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  11537. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  11538. .reverseGetNext()) {
  11539. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  11540. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11541. continue;
  11542. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11543. break;
  11544. }
  11545.  
  11546. spawnGroundItem(j3, i6);
  11547. }
  11548. }
  11549. return;
  11550. }
  11551. if (j == 105) {
  11552. int l = stream.readUnsignedByte();
  11553. int k3 = anInt1268 + (l >> 4 & 7);
  11554. int j6 = anInt1269 + (l & 7);
  11555. int i9 = stream.readUnsignedWord();
  11556. int l11 = stream.readUnsignedByte();
  11557. int i14 = l11 >> 4 & 0xf;
  11558. int i16 = l11 & 7;
  11559. if (myPlayer.smallX[0] >= k3 - i14
  11560. && myPlayer.smallX[0] <= k3 + i14
  11561. && myPlayer.smallY[0] >= j6 - i14
  11562. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  11563. && currentSound < 50) {
  11564. sound[currentSound] = i9;
  11565. soundType[currentSound] = i16;
  11566. soundDelay[currentSound] = Sound.anIntArray326[i9];
  11567. currentSound++;
  11568. }
  11569. }
  11570. if (j == 215) {
  11571. int i1 = stream.method435();
  11572. int l3 = stream.method428();
  11573. int k6 = anInt1268 + (l3 >> 4 & 7);
  11574. int j9 = anInt1269 + (l3 & 7);
  11575. int i12 = stream.method435();
  11576. int j14 = stream.readUnsignedWord();
  11577. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  11578. && i12 != unknownInt10) {
  11579. Item class30_sub2_sub4_sub2_2 = new Item();
  11580. class30_sub2_sub4_sub2_2.ID = i1;
  11581. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11582. if (groundArray[plane][k6][j9] == null)
  11583. groundArray[plane][k6][j9] = new NodeList();
  11584. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11585. spawnGroundItem(k6, j9);
  11586. }
  11587. return;
  11588. }
  11589. if (j == 156) {
  11590. int j1 = stream.method426();
  11591. int i4 = anInt1268 + (j1 >> 4 & 7);
  11592. int l6 = anInt1269 + (j1 & 7);
  11593. int k9 = stream.readUnsignedWord();
  11594. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  11595. NodeList class19 = groundArray[plane][i4][l6];
  11596. if (class19 != null) {
  11597. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  11598. .reverseGetNext()) {
  11599. if (item.ID != (k9 & 0x7fff))
  11600. continue;
  11601. item.unlink();
  11602. break;
  11603. }
  11604.  
  11605. if (class19.reverseGetFirst() == null)
  11606. groundArray[plane][i4][l6] = null;
  11607. spawnGroundItem(i4, l6);
  11608. }
  11609. }
  11610. return;
  11611. }
  11612. if (j == 160) {
  11613. int k1 = stream.method428();
  11614. int j4 = anInt1268 + (k1 >> 4 & 7);
  11615. int i7 = anInt1269 + (k1 & 7);
  11616. int l9 = stream.method428();
  11617. int j12 = l9 >> 2;
  11618. int k14 = l9 & 3;
  11619. int j16 = anIntArray1177[j12];
  11620. int j17 = stream.method435();
  11621. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  11622. int j18 = intGroundArray[plane][j4][i7];
  11623. int i19 = intGroundArray[plane][j4 + 1][i7];
  11624. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11625. int k20 = intGroundArray[plane][j4][i7 + 1];
  11626. if (j16 == 0) {
  11627. Object1 class10 = worldController.method296(plane, j4, i7);
  11628. if (class10 != null) {
  11629. int k21 = class10.uid >> 14 & 0x7fff;
  11630. if (j12 == 2) {
  11631. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11632. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  11633. false);
  11634. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  11635. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  11636. j17, false);
  11637. } else {
  11638. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11639. k21, k14, j12, i19, l19, j18, k20, j17,
  11640. false);
  11641. }
  11642. }
  11643. }
  11644. if (j16 == 1) {
  11645. Object2 class26 = worldController.method297(j4, i7, plane);
  11646. if (class26 != null)
  11647. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  11648. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  11649. j18, k20, j17, false);
  11650. }
  11651. if (j16 == 2) {
  11652. Object5 class28 = worldController.method298(j4, i7, plane);
  11653. if (j12 == 11)
  11654. j12 = 10;
  11655. if (class28 != null)
  11656. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  11657. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  11658. j18, k20, j17, false);
  11659. }
  11660. if (j16 == 3) {
  11661. Object3 class49 = worldController.method299(i7, j4, plane);
  11662. if (class49 != null)
  11663. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  11664. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  11665. j18, k20, j17, false);
  11666. }
  11667. }
  11668. return;
  11669. }
  11670. if (j == 147) {
  11671. int l1 = stream.method428();
  11672. int k4 = anInt1268 + (l1 >> 4 & 7);
  11673. int j7 = anInt1269 + (l1 & 7);
  11674. int i10 = stream.readUnsignedWord();
  11675. byte byte0 = stream.method430();
  11676. int l14 = stream.method434();
  11677. byte byte1 = stream.method429();
  11678. int k17 = stream.readUnsignedWord();
  11679. int k18 = stream.method428();
  11680. int j19 = k18 >> 2;
  11681. int i20 = k18 & 3;
  11682. int l20 = anIntArray1177[j19];
  11683. byte byte2 = stream.readSignedByte();
  11684. int l21 = stream.readUnsignedWord();
  11685. byte byte3 = stream.method429();
  11686. Player player;
  11687. if (i10 == unknownInt10)
  11688. player = myPlayer;
  11689. else
  11690. player = playerArray[i10];
  11691. if (player != null) {
  11692. ObjectDef class46 = ObjectDef.forID(l21);
  11693. int i22 = intGroundArray[plane][k4][j7];
  11694. int j22 = intGroundArray[plane][k4 + 1][j7];
  11695. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11696. int l22 = intGroundArray[plane][k4][j7 + 1];
  11697. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  11698. -1);
  11699. if (model != null) {
  11700. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11701. player.anInt1707 = l14 + loopCycle;
  11702. player.anInt1708 = k17 + loopCycle;
  11703. player.aModel_1714 = model;
  11704. int i23 = class46.sizeX;
  11705. int j23 = class46.sizeY;
  11706. if (i20 == 1 || i20 == 3) {
  11707. i23 = class46.sizeY;
  11708. j23 = class46.sizeX;
  11709. }
  11710. player.anInt1711 = k4 * 128 + i23 * 64;
  11711. player.anInt1713 = j7 * 128 + j23 * 64;
  11712. player.anInt1712 = method42(plane, player.anInt1713,
  11713. player.anInt1711);
  11714. if (byte2 > byte0) {
  11715. byte byte4 = byte2;
  11716. byte2 = byte0;
  11717. byte0 = byte4;
  11718. }
  11719. if (byte3 > byte1) {
  11720. byte byte5 = byte3;
  11721. byte3 = byte1;
  11722. byte1 = byte5;
  11723. }
  11724. player.anInt1719 = k4 + byte2;
  11725. player.anInt1721 = k4 + byte0;
  11726. player.anInt1720 = j7 + byte3;
  11727. player.anInt1722 = j7 + byte1;
  11728. }
  11729. }
  11730. }
  11731. if (j == 151) {
  11732. int i2 = stream.method426();
  11733. int l4 = anInt1268 + (i2 >> 4 & 7);
  11734. int k7 = anInt1269 + (i2 & 7);
  11735. int j10 = stream.method434();
  11736. int k12 = stream.method428();
  11737. int i15 = k12 >> 2;
  11738. int k16 = k12 & 3;
  11739. int l17 = anIntArray1177[i15];
  11740. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11741. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11742. return;
  11743. }
  11744. if (j == 4) {
  11745. int j2 = stream.readUnsignedByte();
  11746. int i5 = anInt1268 + (j2 >> 4 & 7);
  11747. int l7 = anInt1269 + (j2 & 7);
  11748. int k10 = stream.readUnsignedWord();
  11749. int l12 = stream.readUnsignedByte();
  11750. int j15 = stream.readUnsignedWord();
  11751. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  11752. i5 = i5 * 128 + 64;
  11753. l7 = l7 * 128 + 64;
  11754. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  11755. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  11756. i5);
  11757. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11758. }
  11759. return;
  11760. }
  11761. if (j == 44) {
  11762. int itemId = stream.method436();
  11763. int itemAmount = stream.readUnsignedWord();
  11764. int i8 = stream.readUnsignedByte();
  11765. int l10 = anInt1268 + (i8 >> 4 & 7);
  11766. int i13 = anInt1269 + (i8 & 7);
  11767. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  11768. Item item = new Item();
  11769. item.ID = itemId;
  11770. item.anInt1559 = itemAmount;
  11771. if (groundArray[plane][l10][i13] == null)
  11772. groundArray[plane][l10][i13] = new NodeList();
  11773. groundArray[plane][l10][i13].insertHead(item);
  11774. spawnGroundItem(l10, i13);
  11775. }
  11776. return;
  11777. }
  11778. if (j == 101) {
  11779. int l2 = stream.method427();
  11780. int k5 = l2 >> 2;
  11781. int j8 = l2 & 3;
  11782. int i11 = anIntArray1177[k5];
  11783. int j13 = stream.readUnsignedByte();
  11784. int k15 = anInt1268 + (j13 >> 4 & 7);
  11785. int l16 = anInt1269 + (j13 & 7);
  11786. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11787. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11788. return;
  11789. }
  11790. if (j == 117) {
  11791. int i3 = stream.readUnsignedByte();
  11792. int l5 = anInt1268 + (i3 >> 4 & 7);
  11793. int k8 = anInt1269 + (i3 & 7);
  11794. int j11 = l5 + stream.readSignedByte();
  11795. int k13 = k8 + stream.readSignedByte();
  11796. int l15 = stream.readSignedWord();
  11797. int i17 = stream.readUnsignedWord();
  11798. int i18 = stream.readUnsignedByte() * 4;
  11799. int l18 = stream.readUnsignedByte() * 4;
  11800. int k19 = stream.readUnsignedWord();
  11801. int j20 = stream.readUnsignedWord();
  11802. int i21 = stream.readUnsignedByte();
  11803. int j21 = stream.readUnsignedByte();
  11804. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  11805. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  11806. l5 = l5 * 128 + 64;
  11807. k8 = k8 * 128 + 64;
  11808. j11 = j11 * 128 + 64;
  11809. k13 = k13 * 128 + 64;
  11810. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  11811. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  11812. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  11813. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  11814. method42(plane, k13, j11) - l18, j11);
  11815. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11816. }
  11817. }
  11818. }
  11819. public static void setLowMem() {
  11820. WorldController.lowMem = true;
  11821. Rasterizer.lowMem = true;
  11822. lowMem = true;
  11823. ObjectManager.lowMem = true;
  11824. ObjectDef.lowMem = true;
  11825. }
  11826.  
  11827. public void method139(Stream stream) {
  11828. stream.initBitAccess();
  11829. int k = stream.readBits(8);
  11830. if (k < npcCount) {
  11831. for (int l = k; l < npcCount; l++)
  11832. anIntArray840[anInt839++] = npcIndices[l];
  11833.  
  11834. }
  11835. if (k > npcCount) {
  11836. SignLink.reporterror(myUsername + " Too many npcs");
  11837. throw new RuntimeException("eek");
  11838. }
  11839. npcCount = 0;
  11840. for (int i1 = 0; i1 < k; i1++) {
  11841. int j1 = npcIndices[i1];
  11842. NPC npc = npcArray[j1];
  11843. int k1 = stream.readBits(1);
  11844. if (k1 == 0) {
  11845. npcIndices[npcCount++] = j1;
  11846. npc.anInt1537 = loopCycle;
  11847. } else {
  11848. int l1 = stream.readBits(2);
  11849. if (l1 == 0) {
  11850. npcIndices[npcCount++] = j1;
  11851. npc.anInt1537 = loopCycle;
  11852. anIntArray894[anInt893++] = j1;
  11853. } else if (l1 == 1) {
  11854. npcIndices[npcCount++] = j1;
  11855. npc.anInt1537 = loopCycle;
  11856. int i2 = stream.readBits(3);
  11857. npc.moveInDir(false, i2);
  11858. int k2 = stream.readBits(1);
  11859. if (k2 == 1)
  11860. anIntArray894[anInt893++] = j1;
  11861. } else if (l1 == 2) {
  11862. npcIndices[npcCount++] = j1;
  11863. npc.anInt1537 = loopCycle;
  11864. int j2 = stream.readBits(3);
  11865. npc.moveInDir(true, j2);
  11866. int l2 = stream.readBits(3);
  11867. npc.moveInDir(true, l2);
  11868. int i3 = stream.readBits(1);
  11869. if (i3 == 1)
  11870. anIntArray894[anInt893++] = j1;
  11871. } else if (l1 == 3)
  11872. anIntArray840[anInt839++] = j1;
  11873. }
  11874. }
  11875.  
  11876. }
  11877.  
  11878. public void resetImage() {
  11879. DrawingArea.setAllPixelsToZero();
  11880. }
  11881.  
  11882. private void markMinimap(Sprite sprite, int i, int j) {
  11883. int k = viewRotation + minimapRotation & 0x7ff;
  11884. int l = i * i + j * j;
  11885. if(l > 6400)
  11886. return;
  11887. int i1 = Model.SINE[k];
  11888. int j1 = Model.COSINE[k];
  11889. i1 = (i1 * 256) / (minimapZoom + 256);
  11890. j1 = (j1 * 256) / (minimapZoom + 256);
  11891. int k1 = j * i1 + i * j1 >> 16;
  11892. int l1 = j * j1 - i * i1 >> 16;
  11893. if(l > 2500) {
  11894. if (sprite == null)
  11895. return;
  11896. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4 + 20, 83 - l1 - sprite.maxHeight / 2 - 4 + 5);
  11897. } else {
  11898. if (sprite == null)
  11899. return;
  11900. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4 + 20, 83 - l1 - sprite.maxHeight / 2 - 4 + 5);
  11901. }
  11902. }
  11903.  
  11904. public void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  11905. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  11906. if (lowMem && j != plane)
  11907. return;
  11908. int i2 = 0;
  11909. if (j1 == 0)
  11910. i2 = worldController.method300(j, i1, i);
  11911. if (j1 == 1)
  11912. i2 = worldController.method301(j, i1, i);
  11913. if (j1 == 2)
  11914. i2 = worldController.method302(j, i1, i);
  11915. if (j1 == 3)
  11916. i2 = worldController.method303(j, i1, i);
  11917. if (i2 != 0) {
  11918. int i3 = worldController.method304(j, i1, i, i2);
  11919. int j2 = i2 >> 14 & 0x7fff;
  11920. int k2 = i3 & 0x1f;
  11921. int l2 = i3 >> 6;
  11922. if (j1 == 0) {
  11923. worldController.method291(i1, j, i, (byte) -119);
  11924. ObjectDef class46 = ObjectDef.forID(j2);
  11925. if (class46.aBoolean767)
  11926. aClass11Array1230[j].method215(l2, k2,
  11927. class46.aBoolean757, i1, i);
  11928. }
  11929. if (j1 == 1)
  11930. worldController.method292(i, j, i1);
  11931. if (j1 == 2) {
  11932. worldController.method293(j, i1, i);
  11933. ObjectDef class46_1 = ObjectDef.forID(j2);
  11934. if (i1 + class46_1.sizeX > 103
  11935. || i + class46_1.sizeX > 103
  11936. || i1 + class46_1.sizeY > 103
  11937. || i + class46_1.sizeY > 103)
  11938. return;
  11939. if (class46_1.aBoolean767)
  11940. aClass11Array1230[j].method216(l2, class46_1.sizeX,
  11941. i1, i, class46_1.sizeY,
  11942. class46_1.aBoolean757);
  11943. }
  11944. if (j1 == 3) {
  11945. worldController.method294(j, i, i1);
  11946. ObjectDef class46_2 = ObjectDef.forID(j2);
  11947. if (class46_2.aBoolean767 && class46_2.hasActions)
  11948. aClass11Array1230[j].method218(i, i1);
  11949. }
  11950. }
  11951. if (k1 >= 0) {
  11952. int j3 = j;
  11953. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11954. j3++;
  11955. ObjectManager.method188(worldController, k, i, l, j3,
  11956. aClass11Array1230[j], intGroundArray, i1, k1, j);
  11957. }
  11958. }
  11959. }
  11960.  
  11961. public void updatePlayers(int i, Stream stream) {
  11962. anInt839 = 0;
  11963. anInt893 = 0;
  11964. method117(stream);
  11965. method134(stream);
  11966. method91(stream, i);
  11967. method49(stream);
  11968. for (int k = 0; k < anInt839; k++) {
  11969. int l = anIntArray840[k];
  11970. if (playerArray[l].anInt1537 != loopCycle)
  11971. playerArray[l] = null;
  11972. }
  11973.  
  11974. if (stream.currentOffset != i) {
  11975. SignLink.reporterror("Error packet size mismatch in getplayer pos:"
  11976. + stream.currentOffset + " psize:" + i);
  11977. throw new RuntimeException("eek");
  11978. }
  11979. for (int i1 = 0; i1 < playerCount; i1++)
  11980. if (playerArray[playerIndices[i1]] == null) {
  11981. SignLink.reporterror(myUsername
  11982. + " null entry in pl list - pos:" + i1 + " size:"
  11983. + playerCount);
  11984. throw new RuntimeException("eek");
  11985. }
  11986.  
  11987. }
  11988.  
  11989. public void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  11990. int l1 = 2048 - k & 0x7ff;
  11991. int i2 = 2048 - j1 & 0x7ff;
  11992. int j2 = 0;
  11993. int k2 = 0;
  11994. int l2 = j;
  11995. if (l1 != 0) {
  11996. int i3 = Model.SINE[l1];
  11997. int k3 = Model.COSINE[l1];
  11998. int i4 = k2 * k3 - l2 * i3 >> 16;
  11999. l2 = k2 * i3 + l2 * k3 >> 16;
  12000. k2 = i4;
  12001. }
  12002. if (i2 != 0) {
  12003. /*
  12004. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  12005. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  12006. * l2 = fwdbwd; }
  12007. */
  12008. int j3 = Model.SINE[i2];
  12009. int l3 = Model.COSINE[i2];
  12010. int j4 = l2 * j3 + j2 * l3 >> 16;
  12011. l2 = l2 * l3 - j2 * j3 >> 16;
  12012. j2 = j4;
  12013. }
  12014. xCameraPos = l - j2;
  12015. zCameraPos = i1 - k2;
  12016. yCameraPos = k1 - l2;
  12017. yCameraCurve = k;
  12018. xCameraCurve = j1;
  12019. }
  12020.  
  12021. public void updateStrings(String str, int i) {
  12022. switch (i) {
  12023. case 1675:
  12024. sendFrame126(str, 17508);
  12025. break;// Stab
  12026. case 1676:
  12027. sendFrame126(str, 17509);
  12028. break;// Slash
  12029. case 1678:
  12030. sendFrame126(str, 17511);
  12031. break;// Magic
  12032. case 1679:
  12033. sendFrame126(str, 17512);
  12034. break;// Range
  12035. case 1680:
  12036. sendFrame126(str, 17513);
  12037. break;// Stab
  12038. case 1681:
  12039. sendFrame126(str, 17514);
  12040. break;// Slash
  12041. case 1682:
  12042. sendFrame126(str, 17515);
  12043. break;// Crush
  12044. case 1683:
  12045. sendFrame126(str, 17516);
  12046. break;// Magic
  12047. case 1684:
  12048. sendFrame126(str, 17517);
  12049. break;// Range
  12050. case 1686:
  12051. sendFrame126(str, 17518);
  12052. break;// Strength
  12053. case 1687:
  12054. sendFrame126(str, 17519);
  12055. break;// Prayer
  12056. }
  12057. }
  12058.  
  12059. public void sendFrame126(String str, int i) {
  12060. RSInterface.interfaceCache[i].message = str;
  12061. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  12062. needDrawTabArea = true;
  12063. }
  12064.  
  12065. public void sendPacket185(int button, int toggle, int type) {
  12066. switch (type) {
  12067. case 135:
  12068. RSInterface class9 = RSInterface.interfaceCache[button];
  12069. boolean flag8 = true;
  12070. if (class9.contentType > 0)
  12071. flag8 = promptUserForInput(class9);
  12072. if (flag8) {
  12073. stream.createFrame(185);
  12074. stream.writeWord(button);
  12075. }
  12076. break;
  12077. case 646:
  12078. stream.createFrame(185);
  12079. stream.writeWord(button);
  12080. RSInterface class9_2 = RSInterface.interfaceCache[button];
  12081. if (class9_2.valueIndexArray != null
  12082. && class9_2.valueIndexArray[0][0] == 5) {
  12083. if (variousSettings[toggle] != class9_2.requiredValues[0]) {
  12084. variousSettings[toggle] = class9_2.requiredValues[0];
  12085. method33(toggle);
  12086. needDrawTabArea = true;
  12087. }
  12088. }
  12089. break;
  12090. case 169:
  12091. stream.createFrame(185);
  12092. stream.writeWord(button);
  12093. RSInterface class9_3 = RSInterface.interfaceCache[button];
  12094. if (class9_3.valueIndexArray != null
  12095. && class9_3.valueIndexArray[0][0] == 5) {
  12096. variousSettings[toggle] = 1 - variousSettings[toggle];
  12097. method33(toggle);
  12098. needDrawTabArea = true;
  12099. }
  12100. switch (button) {
  12101. case 19136:
  12102. if (toggle == 0)
  12103. sendFrame36(173, toggle);
  12104. if (toggle == 1)
  12105. sendPacket185(153, 173, 646);
  12106. break;
  12107. }
  12108. break;
  12109. }
  12110. }
  12111.  
  12112. public void sendFrame36(int id, int state) {
  12113. anIntArray1045[id] = state;
  12114. if (variousSettings[id] != state) {
  12115. variousSettings[id] = state;
  12116. method33(id);
  12117. needDrawTabArea = true;
  12118. if (dialogID != -1)
  12119. inputTaken = true;
  12120. }
  12121. }
  12122.  
  12123. public void sendFrame219() {
  12124. if (invOverlayInterfaceID != -1) {
  12125. invOverlayInterfaceID = -1;
  12126. needDrawTabArea = true;
  12127. tabAreaAltered = true;
  12128. }
  12129. if (backDialogID != -1) {
  12130. backDialogID = -1;
  12131. inputTaken = true;
  12132. }
  12133. if (inputDialogState != 0) {
  12134. inputDialogState = 0;
  12135. inputTaken = true;
  12136. }
  12137. openInterfaceID = -1;
  12138. aBoolean1149 = false;
  12139. }
  12140.  
  12141. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  12142. if (backDialogID != -1) {
  12143. backDialogID = -1;
  12144. inputTaken = true;
  12145. }
  12146. if (inputDialogState != 0) {
  12147. inputDialogState = 0;
  12148. inputTaken = true;
  12149. }
  12150. openInterfaceID = interfaceID;
  12151. invOverlayInterfaceID = sideInterfaceID;
  12152. needDrawTabArea = true;
  12153. tabAreaAltered = true;
  12154. aBoolean1149 = false;
  12155. }
  12156.  
  12157. private void ping() {
  12158. pingStart = System.currentTimeMillis();
  12159. stream.createFrame(90);
  12160. }
  12161.  
  12162. @SuppressWarnings("unused")
  12163. public boolean parsePacket() {
  12164. if (socketStream == null)
  12165. return false;
  12166. try {
  12167. int i = socketStream.available();
  12168. if (i == 0)
  12169. return false;
  12170. if (pktType == -1) {
  12171. socketStream.flushInputStream(inStream.buffer, 1);
  12172. pktType = inStream.buffer[0] & 0xff;
  12173. if (encryption != null)
  12174. pktType = pktType - encryption.getNextKey() & 0xff;
  12175. pktSize = SizeConstants.packetSizes[pktType];
  12176. i--;
  12177. }
  12178. if (pktSize == -1)
  12179. if (i > 0) {
  12180. socketStream.flushInputStream(inStream.buffer, 1);
  12181. pktSize = inStream.buffer[0] & 0xff;
  12182. i--;
  12183. } else {
  12184. return false;
  12185. }
  12186. if (pktSize == -2)
  12187. if (i > 1) {
  12188. socketStream.flushInputStream(inStream.buffer, 2);
  12189. inStream.currentOffset = 0;
  12190. pktSize = inStream.readUnsignedWord();
  12191. i -= 2;
  12192. } else {
  12193. return false;
  12194. }
  12195. if (i < pktSize)
  12196. return false;
  12197. inStream.currentOffset = 0;
  12198. socketStream.flushInputStream(inStream.buffer, pktSize);
  12199. anInt1009 = 0;
  12200. anInt843 = anInt842;
  12201. anInt842 = anInt841;
  12202. anInt841 = pktType;
  12203. switch (pktType) {
  12204. case 81:
  12205. updatePlayers(pktSize, inStream);
  12206. aBoolean1080 = false;
  12207. pktType = -1;
  12208. return true;
  12209.  
  12210. case 176:
  12211. daysSinceRecovChange = inStream.method427();
  12212. unreadMessages = inStream.method435();
  12213. membersInt = inStream.readUnsignedByte();
  12214. anInt1193 = inStream.method440();
  12215. daysSinceLastLogin = inStream.readUnsignedWord();
  12216. if (anInt1193 != 0 && openInterfaceID == -1) {
  12217. SignLink.dnslookup(TextClass.method586(anInt1193));
  12218. clearTopInterfaces();
  12219. char c = '\u028A';
  12220. if (daysSinceRecovChange != 201 || membersInt == 1)
  12221. c = '\u028F';
  12222. reportAbuseInput = "";
  12223. canMute = false;
  12224. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  12225. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  12226. continue;
  12227. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  12228.  
  12229. }
  12230. }
  12231. pktType = -1;
  12232. return true;
  12233.  
  12234. case 64:
  12235. anInt1268 = inStream.method427();
  12236. anInt1269 = inStream.method428();
  12237. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  12238. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  12239. if (groundArray[plane][j][l9] != null) {
  12240. groundArray[plane][j][l9] = null;
  12241. spawnGroundItem(j, l9);
  12242. }
  12243. }
  12244. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  12245. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  12246. .reverseGetNext())
  12247. if (class30_sub1.anInt1297 >= anInt1268
  12248. && class30_sub1.anInt1297 < anInt1268 + 8
  12249. && class30_sub1.anInt1298 >= anInt1269
  12250. && class30_sub1.anInt1298 < anInt1269 + 8
  12251. && class30_sub1.anInt1295 == plane)
  12252. class30_sub1.anInt1294 = 0;
  12253. pktType = -1;
  12254. return true;
  12255.  
  12256. case 185:
  12257. int k = inStream.method436();
  12258. RSInterface.interfaceCache[k].anInt233 = 3;
  12259. if (myPlayer.desc == null)
  12260. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  12261. + (myPlayer.anIntArray1700[4] << 20)
  12262. + (myPlayer.equipment[0] << 15)
  12263. + (myPlayer.equipment[8] << 10)
  12264. + (myPlayer.equipment[11] << 5)
  12265. + myPlayer.equipment[1];
  12266. else
  12267. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.id);
  12268. pktType = -1;
  12269. return true;
  12270.  
  12271. /* Clan message packet */
  12272. case 217:
  12273. try {
  12274. name = inStream.readString();
  12275. message = inStream.readString();
  12276. clanname = inStream.readString();
  12277. rights = inStream.readUnsignedWord();
  12278. pushMessage(message, 16, name);
  12279. } catch(Exception e) {
  12280. e.printStackTrace();
  12281. }
  12282. pktType = -1;
  12283. return true;
  12284.  
  12285. case 107:
  12286. aBoolean1160 = false;
  12287. for(int l = 0; l < 5; l++)
  12288. aBooleanArray876[l] = false;
  12289. xpCounter = 0;
  12290. pktType = -1;
  12291. return true;
  12292.  
  12293. case 72:
  12294. int i1 = inStream.method434();
  12295. RSInterface class9 = RSInterface.interfaceCache[i1];
  12296. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  12297. class9.inv[k15] = -1;
  12298. class9.inv[k15] = 0;
  12299. }
  12300. pktType = -1;
  12301. return true;
  12302.  
  12303. case 214:
  12304. ignoreCount = pktSize / 8;
  12305. for (int j1 = 0; j1 < ignoreCount; j1++)
  12306. ignoreListAsLongs[j1] = inStream.readQWord();
  12307. pktType = -1;
  12308. return true;
  12309.  
  12310. case 166:
  12311. aBoolean1160 = true;
  12312. anInt1098 = inStream.readUnsignedByte();
  12313. anInt1099 = inStream.readUnsignedByte();
  12314. anInt1100 = inStream.readUnsignedWord();
  12315. anInt1101 = inStream.readUnsignedByte();
  12316. anInt1102 = inStream.readUnsignedByte();
  12317. if (anInt1102 >= 100) {
  12318. xCameraPos = anInt1098 * 128 + 64;
  12319. yCameraPos = anInt1099 * 128 + 64;
  12320. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  12321. - anInt1100;
  12322. }
  12323. pktType = -1;
  12324. return true;
  12325.  
  12326. case 134:
  12327. needDrawTabArea = true;
  12328. int k1 = inStream.readUnsignedByte();
  12329. int i10 = inStream.method439();
  12330. int l15 = inStream.readUnsignedByte();
  12331. int xp = currentExp[k1];
  12332. currentExp[k1] = i10;
  12333. currentStats[k1] = l15;
  12334. maxStats[k1] = 1;
  12335. xpCounter += currentExp[k1]-xp;
  12336. expAdded = currentExp[k1]-xp;
  12337. for(int k20 = 0; k20 < 98; k20++)
  12338. if(i10 >= anIntArray1019[k20])
  12339. maxStats[k1] = k20 + 2;
  12340.  
  12341. int totalLevel = 0;
  12342. long totalXP = 0;
  12343.  
  12344. for (int id = 0; id < Skills.skillsCount; id++) {
  12345. if (id == 24) {
  12346. totalLevel += getLevelForXP(currentExp[id], 120);
  12347. } else {
  12348. totalLevel += getLevelForXP(currentExp[id]);
  12349. }
  12350. totalXP += currentExp[id];
  12351. }
  12352.  
  12353. RSInterface.interfaceCache[3984].message = "Total level: " + NumberFormat.getInstance().format(totalLevel);
  12354. RSInterface.interfaceCache[3985].message = "Total Experience: " + NumberFormat.getInstance().format(totalXP);
  12355.  
  12356. pktType = -1;
  12357. return true;
  12358.  
  12359. case 71:
  12360. int l1 = inStream.readUnsignedWord();
  12361. int j10 = inStream.method426();
  12362. if (l1 == 65535)
  12363. l1 = -1;
  12364. tabInterfaceIDs[j10] = l1;
  12365. needDrawTabArea = true;
  12366. tabAreaAltered = true;
  12367. pktType = -1;
  12368. return true;
  12369.  
  12370. case 74:
  12371. int songID = inStream.method434();
  12372. if (songID == 65535) {
  12373. songID = -1;
  12374. }
  12375. if (songID != currentSong && previousSong == 0 && songID != -1) {
  12376. nextSong = songID;
  12377. songChanging = true;
  12378. onDemandFetcher.method558(2, nextSong);
  12379. }
  12380. currentSong = songID;
  12381. pktType = -1;
  12382. return true;
  12383.  
  12384. case 121:
  12385. int songId = inStream.method436();
  12386. int songDelay = inStream.method435();
  12387. if (musicEnabled && !lowMem) {
  12388. nextSong = songId;
  12389. songChanging = false;
  12390. onDemandFetcher.method558(2, nextSong);
  12391. previousSong = songDelay;
  12392. }
  12393. pktType = -1;
  12394. return true;
  12395.  
  12396. case 109:
  12397. resetLogout();
  12398. pktType = -1;
  12399. return false;
  12400.  
  12401. case 70:
  12402. int k2 = inStream.readSignedWord();
  12403. int l10 = inStream.method437();
  12404. int i16 = inStream.method434();
  12405. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  12406. class9_5.anInt263 = k2;
  12407. class9_5.anInt265 = l10;
  12408. pktType = -1;
  12409. return true;
  12410.  
  12411. case 73:
  12412. case 241:
  12413. int l2 = anInt1069;
  12414. int i11 = anInt1070;
  12415. if (pktType == 73) {
  12416. l2 = inStream.method435();
  12417. i11 = inStream.readUnsignedWord();
  12418. aBoolean1159 = false;
  12419. }
  12420. if (pktType == 241) {
  12421. i11 = inStream.method435();
  12422. inStream.initBitAccess();
  12423. for (int j16 = 0; j16 < 4; j16++) {
  12424. for (int l20 = 0; l20 < 13; l20++) {
  12425. for (int j23 = 0; j23 < 13; j23++) {
  12426. int i26 = inStream.readBits(1);
  12427. if (i26 == 1)
  12428. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  12429. else
  12430. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12431. }
  12432. }
  12433. }
  12434. inStream.finishBitAccess();
  12435. l2 = inStream.readUnsignedWord();
  12436. aBoolean1159 = true;
  12437. }
  12438. if (pktType != 241 && anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12439. pktType = -1;
  12440. return true;
  12441. }
  12442.  
  12443. /*if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12444. pktType = -1;
  12445. return true;
  12446. }*/
  12447. anInt1069 = l2;
  12448. anInt1070 = i11;
  12449. baseX = (anInt1069 - 6) * 8;
  12450. baseY = (anInt1070 - 6) * 8;
  12451. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  12452. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12453. aBoolean1141 = true;
  12454. loadingStage = 1;
  12455. aLong824 = System.currentTimeMillis();
  12456. aRSImageProducer_1165.initDrawingArea();
  12457. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2);
  12458. DrawingArea.drawPixels(20, 3, 3, 0, 128);
  12459. aTextDrawingArea_1271.drawText(0, "Loading - Please Wait", 18, 68);
  12460. aTextDrawingArea_1271.drawText(0xffffff, "Loading - Please Wait", 17, 67);
  12461. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12462. if (pktType == 73) {
  12463. int k16 = 0;
  12464. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12465. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12466. k16++;
  12467. }
  12468. aByteArrayArray1183 = new byte[k16][];
  12469. aByteArrayArray1247 = new byte[k16][];
  12470. anIntArray1234 = new int[k16];
  12471. anIntArray1235 = new int[k16];
  12472. anIntArray1236 = new int[k16];
  12473. k16 = 0;
  12474. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12475. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12476. anIntArray1234[k16] = (l23 << 8) + j26;
  12477. if (aBoolean1141
  12478. && (j26 == 49 || j26 == 149 || j26 == 147
  12479. || l23 == 50 || l23 == 49
  12480. && j26 == 47)) {
  12481. anIntArray1235[k16] = -1;
  12482. anIntArray1236[k16] = -1;
  12483. k16++;
  12484. } else {
  12485. int k28 = anIntArray1235[k16] = onDemandFetcher
  12486. .method562(0, j26, l23);
  12487. if (k28 != -1)
  12488. onDemandFetcher.method558(3, k28);
  12489. int j30 = anIntArray1236[k16] = onDemandFetcher
  12490. .method562(1, j26, l23);
  12491. if (j30 != -1)
  12492. onDemandFetcher.method558(3, j30);
  12493. k16++;
  12494. }
  12495. }
  12496. }
  12497. }
  12498. if (pktType == 241) {
  12499. int l16 = 0;
  12500. int ai[] = new int[676];
  12501. for (int i24 = 0; i24 < 4; i24++) {
  12502. for (int k26 = 0; k26 < 13; k26++) {
  12503. for (int l28 = 0; l28 < 13; l28++) {
  12504. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12505. if (k30 != -1) {
  12506. int k31 = k30 >> 14 & 0x3ff;
  12507. int i32 = k30 >> 3 & 0x7ff;
  12508. int k32 = (k31 / 8 << 8) + i32 / 8;
  12509. for (int j33 = 0; j33 < l16; j33++) {
  12510. if (ai[j33] != k32)
  12511. continue;
  12512. k32 = -1;
  12513.  
  12514. }
  12515. if (k32 != -1)
  12516. ai[l16++] = k32;
  12517. }
  12518. }
  12519. }
  12520. }
  12521. aByteArrayArray1183 = new byte[l16][];
  12522. aByteArrayArray1247 = new byte[l16][];
  12523. anIntArray1234 = new int[l16];
  12524. anIntArray1235 = new int[l16];
  12525. anIntArray1236 = new int[l16];
  12526. for (int l26 = 0; l26 < l16; l26++) {
  12527. int i29 = anIntArray1234[l26] = ai[l26];
  12528. int l30 = i29 >> 8 & 0xff;
  12529. int l31 = i29 & 0xff;
  12530. int j32 = anIntArray1235[l26] = onDemandFetcher
  12531. .method562(0, l31, l30);
  12532. if (j32 != -1)
  12533. onDemandFetcher.method558(3, j32);
  12534. int i33 = anIntArray1236[l26] = onDemandFetcher
  12535. .method562(1, l31, l30);
  12536. if (i33 != -1)
  12537. onDemandFetcher.method558(3, i33);
  12538. }
  12539. }
  12540. int i17 = baseX - anInt1036;
  12541. int j21 = baseY - anInt1037;
  12542. anInt1036 = baseX;
  12543. anInt1037 = baseY;
  12544. for (int j24 = 0; j24 < 16384; j24++) {
  12545. NPC npc = npcArray[j24];
  12546. if (npc != null) {
  12547. for (int j29 = 0; j29 < 10; j29++) {
  12548. npc.smallX[j29] -= i17;
  12549. npc.smallY[j29] -= j21;
  12550. }
  12551. npc.x -= i17 * 128;
  12552. npc.y -= j21 * 128;
  12553. }
  12554. }
  12555. for (int i27 = 0; i27 < maxPlayers; i27++) {
  12556. Player player = playerArray[i27];
  12557. if (player != null) {
  12558. for (int i31 = 0; i31 < 10; i31++) {
  12559. player.smallX[i31] -= i17;
  12560. player.smallY[i31] -= j21;
  12561. }
  12562. player.x -= i17 * 128;
  12563. player.y -= j21 * 128;
  12564. }
  12565. }
  12566. aBoolean1080 = true;
  12567. byte byte1 = 0;
  12568. byte byte2 = 104;
  12569. byte byte3 = 1;
  12570. if (i17 < 0) {
  12571. byte1 = 103;
  12572. byte2 = -1;
  12573. byte3 = -1;
  12574. }
  12575. byte byte4 = 0;
  12576. byte byte5 = 104;
  12577. byte byte6 = 1;
  12578. if (j21 < 0) {
  12579. byte4 = 103;
  12580. byte5 = -1;
  12581. byte6 = -1;
  12582. }
  12583. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  12584. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  12585. int i34 = k33 + i17;
  12586. int j34 = l33 + j21;
  12587. for (int k34 = 0; k34 < 4; k34++)
  12588. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12589. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12590. else
  12591. groundArray[k34][k33][l33] = null;
  12592. }
  12593. }
  12594. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12595. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12596. .reverseGetNext()) {
  12597. class30_sub1_1.anInt1297 -= i17;
  12598. class30_sub1_1.anInt1298 -= j21;
  12599. if (class30_sub1_1.anInt1297 < 0
  12600. || class30_sub1_1.anInt1298 < 0
  12601. || class30_sub1_1.anInt1297 >= 104
  12602. || class30_sub1_1.anInt1298 >= 104)
  12603. class30_sub1_1.unlink();
  12604. }
  12605. if (destX != 0) {
  12606. destX -= i17;
  12607. destY -= j21;
  12608. }
  12609. aBoolean1160 = false;
  12610. pktType = -1;
  12611. return true;
  12612.  
  12613. case 208:
  12614. int i3 = inStream.method437();
  12615. if (i3 >= 0)
  12616. method60(i3);
  12617. anInt1018 = i3;
  12618. pktType = -1;
  12619. return true;
  12620.  
  12621. case 99:
  12622. /*
  12623. * Black map, mape state 2, causes blackness
  12624. */
  12625. anInt1021 = inStream.readUnsignedByte();
  12626. pktType = -1;
  12627. return true;
  12628.  
  12629. case 75:
  12630. int j3 = inStream.method436();
  12631. int j11 = inStream.method436();
  12632. RSInterface.interfaceCache[j11].anInt233 = 2;
  12633. RSInterface.interfaceCache[j11].mediaID = j3;
  12634. pktType = -1;
  12635. return true;
  12636.  
  12637.  
  12638. case 114:
  12639. anInt1104 = inStream.method434() * 30;
  12640. pktType = -1;
  12641. return true;
  12642.  
  12643. case 60:
  12644. anInt1269 = inStream.readUnsignedByte();
  12645. anInt1268 = inStream.method427();
  12646. while (inStream.currentOffset < pktSize) {
  12647. int k3 = inStream.readUnsignedByte();
  12648. method137(inStream, k3);
  12649. }
  12650. pktType = -1;
  12651. return true;
  12652.  
  12653. case 35:
  12654. int l3 = inStream.readUnsignedByte();
  12655. int k11 = inStream.readUnsignedByte();
  12656. int j17 = inStream.readUnsignedByte();
  12657. int k21 = inStream.readUnsignedByte();
  12658. aBooleanArray876[l3] = true;
  12659. anIntArray873[l3] = k11;
  12660. anIntArray1203[l3] = j17;
  12661. anIntArray928[l3] = k21;
  12662. anIntArray1030[l3] = 0;
  12663. pktType = -1;
  12664. return true;
  12665.  
  12666. /*case 174:
  12667. int i4 = inStream.readUnsignedWord();
  12668. int l11 = inStream.readUnsignedByte();
  12669. int k17 = inStream.readUnsignedWord();
  12670. if (aBoolean848 && !lowMem && currentSound < 50) {
  12671. sound[currentSound] = i4;
  12672. soundType[currentSound] = l11;
  12673. soundDelay[currentSound] = k17 + Sound.anIntArray326[i4];
  12674. currentSound++;
  12675. }
  12676. pktType = -1;
  12677. return true;*/
  12678.  
  12679. /* 174:
  12680. int soundId = inStream.readUnsignedWord();
  12681. int type = inStream.readUnsignedByte();
  12682. int delay = inStream.readUnsignedWord();
  12683. int volume = inStream.readUnsignedWord();
  12684. sound[currentSound] = soundId;
  12685. soundType[currentSound] = type;
  12686. soundDelay[currentSound] = delay + Sound.anIntArray326[soundId];
  12687. soundVolume[currentSound] = volume;
  12688. currentSound++;
  12689. pktType = -1;
  12690. return true;*/
  12691.  
  12692. case 174:
  12693. int soundId = inStream.readUnsignedWord();
  12694. int type = inStream.readUnsignedByte();
  12695. int delay = inStream.readUnsignedWord();
  12696. int volume = inStream.readUnsignedWord();
  12697. sound[currentSound] = soundId;
  12698. soundType[currentSound] = type;
  12699. soundDelay[currentSound] = delay + Sound.anIntArray326[soundId];
  12700. soundVolume[currentSound] = volume;
  12701. currentSound++;
  12702. pktType = -1;
  12703. return true;
  12704.  
  12705. case 104:
  12706. int j4 = inStream.method427();
  12707. int i12 = inStream.method426();
  12708. String s6 = inStream.readString();
  12709. if (j4 >= 1 && j4 <= 5) {
  12710. if (s6.equalsIgnoreCase("null"))
  12711. s6 = null;
  12712. atPlayerActions[j4 - 1] = s6;
  12713. atPlayerArray[j4 - 1] = i12 == 0;
  12714. }
  12715. pktType = -1;
  12716. return true;
  12717.  
  12718. case 78:
  12719. destX = 0;
  12720. pktType = -1;
  12721. return true;
  12722.  
  12723. case 253:
  12724. String s = inStream.readString();
  12725. if(s.endsWith(":tradereq:")) {
  12726. String s3 = s.substring(0, s.indexOf(":"));
  12727. long l17 = TextClass.longForName(s3);
  12728. boolean flag2 = false;
  12729. for(int j27 = 0; j27 < ignoreCount; j27++) {
  12730. if(ignoreListAsLongs[j27] != l17)
  12731. continue;
  12732. flag2 = true;
  12733. }
  12734. if(!flag2 && anInt1251 == 0)
  12735. pushMessage("wishes to trade with you.", 4, s3);
  12736. } else if (s.endsWith(":clan:")) {
  12737. String s4 = s.substring(0, s.indexOf(":"));
  12738. TextClass.longForName(s4);
  12739. pushMessage("Clan: ", 8, s4);
  12740. } else if(s.endsWith("#url#")) {
  12741. String link = s.substring(0, s.indexOf("#"));
  12742. pushMessage("Join us at: ", 9, link);
  12743. } else if(s.endsWith(":duelreq:")) {
  12744. String s4 = s.substring(0, s.indexOf(":"));
  12745. long l18 = TextClass.longForName(s4);
  12746. boolean flag3 = false;
  12747. for(int k27 = 0; k27 < ignoreCount; k27++) {
  12748. if(ignoreListAsLongs[k27] != l18)
  12749. continue;
  12750. flag3 = true;
  12751.  
  12752. }
  12753. if(!flag3 && anInt1251 == 0)
  12754. pushMessage("wishes to duel with you.", 8, s4);
  12755. } else if(s.endsWith(":chalreq:")) {
  12756. String s5 = s.substring(0, s.indexOf(":"));
  12757. long l19 = TextClass.longForName(s5);
  12758. boolean flag4 = false;
  12759. for(int l27 = 0; l27 < ignoreCount; l27++) {
  12760. if(ignoreListAsLongs[l27] != l19)
  12761. continue;
  12762. flag4 = true;
  12763.  
  12764. }
  12765. if(!flag4 && anInt1251 == 0) {
  12766. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12767. pushMessage(s8, 8, s5);
  12768. }
  12769. } else if(s.endsWith("-partyinvite")) {
  12770. String[] data = s.split("-");
  12771. String username = data[0];
  12772. String partyType = "";
  12773.  
  12774. for (int k5 = 1; k5 < data.length - 1; k5++)
  12775. partyType += data[k5] + "-";
  12776. partyType = partyType.substring(0, partyType.length() - 1);
  12777.  
  12778. long usernameAsLong = TextClass.longForName(username);
  12779. boolean isIgnored = false;
  12780.  
  12781. for(int i5 = 0; i5 < ignoreCount; i5++) {
  12782. if(ignoreListAsLongs[i5] != usernameAsLong)
  12783. continue;
  12784. isIgnored = true;
  12785.  
  12786. }
  12787.  
  12788. if (!isIgnored && anInt1251 == 0) {
  12789. if (partyType.length() > 0)
  12790. partyType = " " + partyType;
  12791. pushMessage("wants you to join their" + partyType + " party.", 15, username);
  12792. }
  12793. } else {
  12794. pushMessage(s, 0, "");
  12795. }
  12796. pktType = -1;
  12797. return true;
  12798.  
  12799. case 1:
  12800. for (int k4 = 0; k4 < playerArray.length; k4++)
  12801. if (playerArray[k4] != null)
  12802. playerArray[k4].anim = -1;
  12803. for (int j12 = 0; j12 < npcArray.length; j12++)
  12804. if (npcArray[j12] != null)
  12805. npcArray[j12].anim = -1;
  12806. pktType = -1;
  12807. return true;
  12808.  
  12809. case 90:
  12810. ping = (int) (System.currentTimeMillis() - pingStart);
  12811. ping();
  12812. pktType = -1;
  12813. return true;
  12814.  
  12815. case 124:
  12816. String interfaceType = TextClass.nameForLong(inStream.readQWord());
  12817. int amount = inStream.readUnsignedByte();
  12818.  
  12819. if (interfaceType.equalsIgnoreCase("party")) {
  12820. partyCount = amount;
  12821. }
  12822.  
  12823. pktType = -1;
  12824. return true;
  12825.  
  12826. case 50:
  12827. long l4 = inStream.readQWord();
  12828. int i18 = inStream.readUnsignedByte();
  12829. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12830. for (int k24 = 0; k24 < friendsCount; k24++) {
  12831. if (l4 != friendsListAsLongs[k24])
  12832. continue;
  12833. if (friendsNodeIDs[k24] != i18) {
  12834. friendsNodeIDs[k24] = i18;
  12835. needDrawTabArea = true;
  12836. if (i18 >= 2) {
  12837. pushMessage(s7 + " has logged in.", 5, "");
  12838. }
  12839. if (i18 <= 1) {
  12840. pushMessage(s7 + " has logged out.", 5, "");
  12841. }
  12842. }
  12843. s7 = null;
  12844.  
  12845. }
  12846. if (s7 != null && friendsCount < 200) {
  12847. friendsListAsLongs[friendsCount] = l4;
  12848. friendsList[friendsCount] = s7;
  12849. friendsNodeIDs[friendsCount] = i18;
  12850. friendsCount++;
  12851. needDrawTabArea = true;
  12852. }
  12853. for (boolean flag6 = false; !flag6;) {
  12854. flag6 = true;
  12855. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  12856. if (friendsNodeIDs[k29] != nodeID
  12857. && friendsNodeIDs[k29 + 1] == nodeID
  12858. || friendsNodeIDs[k29] == 0
  12859. && friendsNodeIDs[k29 + 1] != 0) {
  12860. int j31 = friendsNodeIDs[k29];
  12861. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12862. friendsNodeIDs[k29 + 1] = j31;
  12863. String s10 = friendsList[k29];
  12864. friendsList[k29] = friendsList[k29 + 1];
  12865. friendsList[k29 + 1] = s10;
  12866. long l32 = friendsListAsLongs[k29];
  12867. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12868. friendsListAsLongs[k29 + 1] = l32;
  12869. needDrawTabArea = true;
  12870. flag6 = false;
  12871. }
  12872. }
  12873. pktType = -1;
  12874. return true;
  12875.  
  12876. case 110:
  12877. if (tabID == 12)
  12878. needDrawTabArea = true;
  12879. energy = inStream.readUnsignedByte();
  12880. pktType = -1;
  12881. return true;
  12882.  
  12883. case 254:
  12884. anInt855 = inStream.readUnsignedByte();
  12885. if (anInt855 == 1)
  12886. anInt1222 = inStream.readUnsignedWord();
  12887. if (anInt855 >= 2 && anInt855 <= 6) {
  12888. if (anInt855 == 2) {
  12889. anInt937 = 64;
  12890. anInt938 = 64;
  12891. }
  12892. if (anInt855 == 3) {
  12893. anInt937 = 0;
  12894. anInt938 = 64;
  12895. }
  12896. if (anInt855 == 4) {
  12897. anInt937 = 128;
  12898. anInt938 = 64;
  12899. }
  12900. if (anInt855 == 5) {
  12901. anInt937 = 64;
  12902. anInt938 = 0;
  12903. }
  12904. if (anInt855 == 6) {
  12905. anInt937 = 64;
  12906. anInt938 = 128;
  12907. }
  12908. anInt855 = 2;
  12909. anInt934 = inStream.readUnsignedWord();
  12910. anInt935 = inStream.readUnsignedWord();
  12911. anInt936 = inStream.readUnsignedByte();
  12912. }
  12913. if (anInt855 == 10)
  12914. anInt933 = inStream.readUnsignedWord();
  12915. pktType = -1;
  12916. return true;
  12917.  
  12918. case 248:
  12919. int i5 = inStream.method435();
  12920. int k12 = inStream.readUnsignedWord();
  12921. if (backDialogID != -1) {
  12922. backDialogID = -1;
  12923. inputTaken = true;
  12924. }
  12925. if (inputDialogState != 0) {
  12926. inputDialogState = 0;
  12927. inputTaken = true;
  12928. }
  12929. openInterfaceID = i5;
  12930. invOverlayInterfaceID = k12;
  12931. needDrawTabArea = true;
  12932. tabAreaAltered = true;
  12933. aBoolean1149 = false;
  12934. pktType = -1;
  12935. return true;
  12936.  
  12937. case 79:
  12938. int j5 = inStream.method434();
  12939. int l12 = inStream.method435();
  12940. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12941. if (class9_3 != null && class9_3.type == 0) {
  12942. if (l12 < 0)
  12943. l12 = 0;
  12944. if (l12 > class9_3.scrollMax - class9_3.height)
  12945. l12 = class9_3.scrollMax - class9_3.height;
  12946. class9_3.scrollPosition = l12;
  12947. }
  12948. pktType = -1;
  12949. return true;
  12950.  
  12951. case 68:
  12952. for (int k5 = 0; k5 < variousSettings.length; k5++)
  12953. if (variousSettings[k5] != anIntArray1045[k5]) {
  12954. variousSettings[k5] = anIntArray1045[k5];
  12955. method33(k5);
  12956. needDrawTabArea = true;
  12957. }
  12958. pktType = -1;
  12959. return true;
  12960.  
  12961. case 196:
  12962. long l5 = inStream.readQWord();
  12963. int j18 = inStream.readDWord();
  12964. int l21 = inStream.readUnsignedByte();
  12965. boolean flag5 = false;
  12966. if (l21 <= 1) {
  12967. for (int l29 = 0; l29 < ignoreCount; l29++) {
  12968. if (ignoreListAsLongs[l29] != l5)
  12969. continue;
  12970. flag5 = true;
  12971.  
  12972. }
  12973. }
  12974. if (!flag5 && anInt1251 == 0)
  12975. try {
  12976. String s9 = TextInput.method525(pktSize - 13, inStream);
  12977. if (l21 == 1)
  12978. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12979. else if (l21 == 2)
  12980. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12981. else if (l21 == 3)
  12982. pushMessage(s9, 7, "@cr3@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12983. else if (l21 == 4)
  12984. pushMessage(s9, 7, "@cr4@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12985. else if (l21 == 5)
  12986. pushMessage(s9, 7, "@cr5@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12987. else if (l21 == 6)
  12988. pushMessage(s9, 7, "@cr6@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12989. else if (l21 == 7)
  12990. pushMessage(s9, 7, "@cr7@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12991. else if (l21 == 8)
  12992. pushMessage(s9, 7, "@cr8@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12993. else if (l21 == 9)
  12994. pushMessage(s9, 7, "@cr9@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12995. else if (l21 == 10)
  12996. pushMessage(s9, 7, "@cr10@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12997. else if (l21 == 11)
  12998. pushMessage(s9, 7, "@cr11@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12999. else if (l21 == 12)
  13000. pushMessage(s9, 7, "@cr12@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13001. else if (l21 == 13)
  13002. pushMessage(s9, 7, "@cr13@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13003. else if (l21 == 14)
  13004. pushMessage(s9, 7, "@cr14@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13005. else if (l21 == 15)
  13006. pushMessage(s9, 7, "@cr15@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13007. else if (l21 == 16)
  13008. pushMessage(s9, 7, "@cr16@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13009. else if (l21 == 17)
  13010. pushMessage(s9, 7, "@cr17@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13011. else if (l21 == 18)
  13012. pushMessage(s9, 7, "@cr18@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13013. else if (l21 == 19)
  13014. pushMessage(s9, 7, "@cr19@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13015. else if (l21 == 20)
  13016. pushMessage(s9, 7, "@cr20@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13017. else
  13018. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  13019. } catch (Exception exception1) {
  13020. SignLink.reporterror("cde1");
  13021. }
  13022. pktType = -1;
  13023. return true;
  13024.  
  13025. case 85:
  13026. anInt1269 = inStream.method427();
  13027. anInt1268 = inStream.method427();
  13028. pktType = -1;
  13029. return true;
  13030.  
  13031. case 24:
  13032. anInt1054 = inStream.method428();
  13033. if (anInt1054 == tabID) {
  13034. if (anInt1054 == 3)
  13035. tabID = 1;
  13036. else
  13037. tabID = 3;
  13038. needDrawTabArea = true;
  13039. }
  13040. pktType = -1;
  13041. return true;
  13042.  
  13043. case 246:
  13044. int i6 = inStream.method434();
  13045. int i13 = inStream.readUnsignedWord();
  13046. int k18 = inStream.readUnsignedWord();
  13047. if (k18 == 65535) {
  13048. RSInterface.interfaceCache[i6].anInt233 = 0;
  13049. pktType = -1;
  13050. return true;
  13051. } else {
  13052. ItemDef itemDef = ItemDef.forID(k18);
  13053. RSInterface.interfaceCache[i6].anInt233 = 4;
  13054. RSInterface.interfaceCache[i6].mediaID = k18;
  13055. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  13056. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  13057. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100)
  13058. / i13;
  13059. pktType = -1;
  13060. return true;
  13061. }
  13062.  
  13063. case 171:
  13064. boolean flag1 = inStream.readUnsignedByte() == 1;
  13065. int j13 = inStream.readUnsignedWord();
  13066. RSInterface.interfaceCache[j13].interfaceShown = flag1;
  13067. pktType = -1;
  13068. return true;
  13069.  
  13070. case 142:
  13071. int j6 = inStream.method434();
  13072. method60(j6);
  13073. if (backDialogID != -1) {
  13074. backDialogID = -1;
  13075. inputTaken = true;
  13076. }
  13077. if (inputDialogState != 0) {
  13078. inputDialogState = 0;
  13079. inputTaken = true;
  13080. }
  13081. invOverlayInterfaceID = j6;
  13082. needDrawTabArea = true;
  13083. tabAreaAltered = true;
  13084. openInterfaceID = -1;
  13085. aBoolean1149 = false;
  13086. pktType = -1;
  13087. return true;
  13088.  
  13089. case 126:
  13090. try {
  13091. String text = inStream.readString();
  13092. int frame = inStream.method435();
  13093. if (text.startsWith("www.")) {
  13094. launchURL(text);
  13095. pktType = -1;
  13096. return true;
  13097. }
  13098. RSInterface.interfaceCache[frame].message = text;
  13099. if(RSInterface.interfaceCache[frame].parentID == tabInterfaceIDs[tabID] ||frame >= 7562 && frame <= 7586)
  13100. needDrawTabArea = true;
  13101. pktType = -1;
  13102. } catch (Exception e) {
  13103. }
  13104. pktType = -1;
  13105. return true;
  13106.  
  13107. case 206:
  13108. publicChatMode = inStream.readUnsignedByte();
  13109. publicChatMode = inStream.readUnsignedByte();
  13110. tradeMode = inStream.readUnsignedByte();
  13111. aBoolean1233 = true;
  13112. inputTaken = true;
  13113. pktType = -1;
  13114. return true;
  13115.  
  13116. case 240:
  13117. if (tabID == 12)
  13118. needDrawTabArea = true;
  13119. weight = inStream.readSignedWord();
  13120. pktType = -1;
  13121. return true;
  13122.  
  13123. case 8:
  13124. int k6 = inStream.method436();
  13125. int l13 = inStream.readUnsignedWord();
  13126. RSInterface.interfaceCache[k6].anInt233 = 1;
  13127. RSInterface.interfaceCache[k6].mediaID = l13;
  13128. pktType = -1;
  13129. return true;
  13130.  
  13131. case 122:
  13132. int l6 = inStream.method436();
  13133. int i14 = inStream.method436();
  13134. int i19 = i14 >> 10 & 0x1f;
  13135. int i22 = i14 >> 5 & 0x1f;
  13136. int l24 = i14 & 0x1f;
  13137. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  13138. + (i22 << 11) + (l24 << 3);
  13139. pktType = -1;
  13140. return true;
  13141.  
  13142. case 53:
  13143. needDrawTabArea = true;
  13144. int i7 = inStream.readUnsignedWord();
  13145. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  13146. int j19 = inStream.readUnsignedWord();
  13147. for (int j22 = 0; j22 < j19; j22++) {
  13148. int i25 = inStream.readUnsignedByte();
  13149. if (i25 == 255)
  13150. i25 = inStream.method440();
  13151. class9_1.inv[j22] = inStream.method436();
  13152. class9_1.invStackSizes[j22] = i25;
  13153. }
  13154. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  13155. class9_1.inv[j25] = 0;
  13156. class9_1.invStackSizes[j25] = 0;
  13157. }
  13158. pktType = -1;
  13159. return true;
  13160.  
  13161. case 230:
  13162. int j7 = inStream.method435();
  13163. int j14 = inStream.readUnsignedWord();
  13164. int k19 = inStream.readUnsignedWord();
  13165. int k22 = inStream.method436();
  13166. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  13167. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  13168. RSInterface.interfaceCache[j14].modelZoom = j7;
  13169. pktType = -1;
  13170. return true;
  13171.  
  13172. case 221:
  13173. anInt900 = inStream.readUnsignedByte();
  13174. needDrawTabArea = true;
  13175. pktType = -1;
  13176. return true;
  13177.  
  13178. case 177:
  13179. aBoolean1160 = true;
  13180. anInt995 = inStream.readUnsignedByte();
  13181. anInt996 = inStream.readUnsignedByte();
  13182. anInt997 = inStream.readUnsignedWord();
  13183. anInt998 = inStream.readUnsignedByte();
  13184. anInt999 = inStream.readUnsignedByte();
  13185. if (anInt999 >= 100) {
  13186. int k7 = anInt995 * 128 + 64;
  13187. int k14 = anInt996 * 128 + 64;
  13188. int i20 = method42(plane, k14, k7) - anInt997;
  13189. int l22 = k7 - xCameraPos;
  13190. int k25 = i20 - zCameraPos;
  13191. int j28 = k14 - yCameraPos;
  13192. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  13193. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  13194. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  13195. if (yCameraCurve < 128)
  13196. yCameraCurve = 128;
  13197. if (yCameraCurve > 383)
  13198. yCameraCurve = 383;
  13199. }
  13200. pktType = -1;
  13201. return true;
  13202.  
  13203. case 249:
  13204. anInt1046 = inStream.method426();
  13205. unknownInt10 = inStream.method436();
  13206. pktType = -1;
  13207. return true;
  13208.  
  13209. case 65:
  13210. updateNPCs(inStream, pktSize);
  13211. pktType = -1;
  13212. return true;
  13213.  
  13214. case 27:
  13215. messagePromptRaised = false;
  13216. inputDialogState = 1;
  13217. amountOrNameInput = "";
  13218. inputTaken = true;
  13219. pktType = -1;
  13220. return true;
  13221.  
  13222. case 187:
  13223. messagePromptRaised = false;
  13224. inputDialogState = 2;
  13225. amountOrNameInput = "";
  13226. inputTaken = true;
  13227. pktType = -1;
  13228. return true;
  13229.  
  13230. case 97:
  13231. int l7 = inStream.readUnsignedWord();
  13232. method60(l7);
  13233. if (invOverlayInterfaceID != -1) {
  13234. invOverlayInterfaceID = -1;
  13235. needDrawTabArea = true;
  13236. tabAreaAltered = true;
  13237. }
  13238. if (backDialogID != -1) {
  13239. backDialogID = -1;
  13240. inputTaken = true;
  13241. }
  13242. if (inputDialogState != 0) {
  13243. inputDialogState = 0;
  13244. inputTaken = true;
  13245. }
  13246. // 17511 = Question Type
  13247. // 15819 = Christmas Type
  13248. // 15812 = Security Type
  13249. // 15801 = Item Scam Type
  13250. // 15791 = Password Safety ?
  13251. // 15774 = Good/Bad Password
  13252. // 15767 = Drama Type ????
  13253. if (l7 == 15244) {
  13254. openInterfaceID = 15767;
  13255. fullscreenInterfaceID = 15244;
  13256. } else {
  13257. openInterfaceID = l7;
  13258. }
  13259. aBoolean1149 = false;
  13260. pktType = -1;
  13261. return true;
  13262.  
  13263. case 218:
  13264. int i8 = inStream.method438();
  13265. dialogID = i8;
  13266. inputTaken = true;
  13267. pktType = -1;
  13268. return true;
  13269.  
  13270. case 87:
  13271. int j8 = inStream.method434();
  13272. int l14 = inStream.method439();
  13273. anIntArray1045[j8] = l14;
  13274. if (variousSettings[j8] != l14) {
  13275. variousSettings[j8] = l14;
  13276. method33(j8);
  13277. needDrawTabArea = true;
  13278. if (dialogID != -1)
  13279. inputTaken = true;
  13280. }
  13281. pktType = -1;
  13282. return true;
  13283.  
  13284. case 36:
  13285. int k8 = inStream.method434();
  13286. byte byte0 = inStream.readSignedByte();
  13287. anIntArray1045[k8] = byte0;
  13288. if (variousSettings[k8] != byte0) {
  13289. variousSettings[k8] = byte0;
  13290. method33(k8);
  13291. needDrawTabArea = true;
  13292. if (dialogID != -1)
  13293. inputTaken = true;
  13294. }
  13295. pktType = -1;
  13296. return true;
  13297.  
  13298. case 61:
  13299. anInt1055 = inStream.readUnsignedByte();
  13300. pktType = -1;
  13301. return true;
  13302.  
  13303. case 200:
  13304. int l8 = inStream.readUnsignedWord();
  13305. int i15 = inStream.readSignedWord();
  13306. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  13307. class9_4.anInt257 = i15;
  13308. class9_4.modelZoom = 1600;
  13309. if (i15 == 591 || i15 == 588) {
  13310. class9_4.modelZoom = 900; // anInt269
  13311. }
  13312. if (i15 == -1) {
  13313. class9_4.anInt246 = 0;
  13314. class9_4.anInt208 = 0;
  13315. }
  13316. pktType = -1;
  13317. return true;
  13318.  
  13319.  
  13320. case 219:
  13321. if (invOverlayInterfaceID != -1) {
  13322. invOverlayInterfaceID = -1;
  13323. needDrawTabArea = true;
  13324. tabAreaAltered = true;
  13325. }
  13326. if (backDialogID != -1) {
  13327. backDialogID = -1;
  13328. inputTaken = true;
  13329. }
  13330. if (inputDialogState != 0) {
  13331. inputDialogState = 0;
  13332. inputTaken = true;
  13333. }
  13334. openInterfaceID = -1;
  13335. aBoolean1149 = false;
  13336. pktType = -1;
  13337. return true;
  13338.  
  13339. case 34:
  13340. needDrawTabArea = true;
  13341. int i9 = inStream.readUnsignedWord();
  13342. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  13343. while (inStream.currentOffset < pktSize) {
  13344. int j20 = inStream.method422();
  13345. int i23 = inStream.readUnsignedWord();
  13346. int l25 = inStream.readUnsignedByte();
  13347. if (l25 == 255)
  13348. l25 = inStream.readDWord();
  13349. if (j20 >= 0 && j20 < class9_2.inv.length) {
  13350. class9_2.inv[j20] = i23;
  13351. class9_2.invStackSizes[j20] = l25;
  13352. }
  13353. }
  13354. pktType = -1;
  13355. return true;
  13356.  
  13357. case 4:
  13358. case 44:
  13359. case 84:
  13360. case 101:
  13361. case 105:
  13362. case 117:
  13363. case 147:
  13364. case 151:
  13365. case 156:
  13366. case 160:
  13367. case 215:
  13368. method137(inStream, pktType);
  13369. pktType = -1;
  13370. return true;
  13371.  
  13372. case 106:
  13373. tabID = inStream.method427();
  13374. needDrawTabArea = true;
  13375. tabAreaAltered = true;
  13376. pktType = -1;
  13377. return true;
  13378.  
  13379. case 164:
  13380. int j9 = inStream.method434();
  13381. method60(j9);
  13382. if (invOverlayInterfaceID != -1) {
  13383. invOverlayInterfaceID = -1;
  13384. needDrawTabArea = true;
  13385. tabAreaAltered = true;
  13386. }
  13387. backDialogID = j9;
  13388. inputTaken = true;
  13389. openInterfaceID = -1;
  13390. aBoolean1149 = false;
  13391. pktType = -1;
  13392. return true;
  13393.  
  13394. }
  13395. SignLink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  13396. + anInt842 + "," + anInt843);
  13397. resetLogout();
  13398. } catch (IOException _ex) {
  13399. dropClient();
  13400. } catch (Exception exception) {
  13401. exception.printStackTrace();
  13402. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  13403. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  13404. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  13405. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  13406. s2 = s2 + inStream.buffer[j15] + ",";
  13407. SignLink.reporterror(s2);
  13408. resetLogout();
  13409. }
  13410. return true;
  13411. }
  13412.  
  13413. public void method146() {
  13414. anInt1265++;
  13415. method47(true);
  13416. method26(true);
  13417. method47(false);
  13418. method26(false);
  13419. method55();
  13420. method104();
  13421. if (!aBoolean1160) {
  13422. int i = anInt1184;
  13423. if (anInt984 / 256 > i)
  13424. i = anInt984 / 256;
  13425. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  13426. i = anIntArray1203[4] + 128;
  13427. int k = viewRotation + viewRotationOffset & 0x7ff;
  13428. setCameraPos(600 + i * 3, i, anInt1014,
  13429. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  13430. }
  13431. int j;
  13432. if (!aBoolean1160)
  13433. j = method120();
  13434. else
  13435. j = method121();
  13436. int l = xCameraPos;
  13437. int i1 = zCameraPos;
  13438. int j1 = yCameraPos;
  13439. int k1 = yCameraCurve;
  13440. int l1 = xCameraCurve;
  13441. for (int i2 = 0; i2 < 5; i2++)
  13442. if (aBooleanArray876[i2]) {
  13443. int j2 = (int) ((Math.random()
  13444. * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  13445. .sin((double) anIntArray1030[i2]
  13446. * ((double) anIntArray928[i2] / 100D))
  13447. * (double) anIntArray1203[i2]);
  13448. if (i2 == 0)
  13449. xCameraPos += j2;
  13450. if (i2 == 1)
  13451. zCameraPos += j2;
  13452. if (i2 == 2)
  13453. yCameraPos += j2;
  13454. if (i2 == 3)
  13455. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  13456. if (i2 == 4) {
  13457. yCameraCurve += j2;
  13458. if (yCameraCurve < 128)
  13459. yCameraCurve = 128;
  13460. if (yCameraCurve > 383)
  13461. yCameraCurve = 383;
  13462. }
  13463. }
  13464. // int k2 = Rasterizer.textureGetCount;
  13465. Model.objectExists = true;
  13466. Model.objectsRendered = 0;
  13467. Model.currentCursorX = super.mouseX - 4;
  13468. Model.currentCursorY = super.mouseY - 4;
  13469. DrawingArea.setAllPixelsToZero();
  13470. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  13471. zCameraPos, j, yCameraCurve);
  13472. worldController.clearObj5Cache();
  13473. updateEntities();
  13474. drawHeadIcon();
  13475. TextureAnimating.animateTexture();
  13476. draw3dScreen();
  13477. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  13478. xCameraPos = l;
  13479. zCameraPos = i1;
  13480. yCameraPos = j1;
  13481. yCameraCurve = k1;
  13482. xCameraCurve = l1;
  13483. }
  13484.  
  13485. public void clearTopInterfaces() {
  13486. stream.createFrame(130);
  13487. if (invOverlayInterfaceID != -1) {
  13488. invOverlayInterfaceID = -1;
  13489. needDrawTabArea = true;
  13490. aBoolean1149 = false;
  13491. tabAreaAltered = true;
  13492. }
  13493. if (backDialogID != -1) {
  13494. backDialogID = -1;
  13495. inputTaken = true;
  13496. aBoolean1149 = false;
  13497. }
  13498. openInterfaceID = -1;
  13499. fullscreenInterfaceID = -1;
  13500. }
  13501.  
  13502. public Client() {
  13503. xpAddedPos = expAdded = 0;
  13504. expAdded = 0;
  13505. xpLock = false;
  13506. xpCounter = 0;
  13507. counter = new Sprite[3];
  13508. chatRights = new int[500];
  13509. fullscreenInterfaceID = -1;
  13510. chatTypeView = 0;
  13511. clanChatMode = 0;
  13512. cButtonHPos = -1;
  13513. cButtonHCPos = -1;
  13514. cButtonCPos = 0;
  13515. server = Address.SERVER_IP;
  13516. anIntArrayArray825 = new int[104][104];
  13517. friendsNodeIDs = new int[200];
  13518. groundArray = new NodeList[4][104][104];
  13519. aBoolean831 = false;
  13520. aStream_834 = new Stream(new byte[5000]);
  13521. npcArray = new NPC[16384];
  13522. npcIndices = new int[16384];
  13523. anIntArray840 = new int[1000];
  13524. aStream_847 = Stream.create();
  13525. aBoolean848 = true;
  13526. openInterfaceID = -1;
  13527. currentExp = new int[Skills.skillsCount];
  13528. aBoolean872 = false;
  13529. anIntArray873 = new int[5];
  13530. anInt874 = -1;
  13531. aBooleanArray876 = new boolean[5];
  13532. drawFlames = false;
  13533. reportAbuseInput = "";
  13534. unknownInt10 = -1;
  13535. menuOpen = false;
  13536. inputString = "";
  13537. maxPlayers = 2048;
  13538. myPlayerIndex = 2047;
  13539. playerArray = new Player[maxPlayers];
  13540. playerIndices = new int[maxPlayers];
  13541. anIntArray894 = new int[maxPlayers];
  13542. aStreamArray895s = new Stream[maxPlayers];
  13543. anInt897 = 1;
  13544. anIntArrayArray901 = new int[104][104];
  13545. anInt902 = 0x766654;
  13546. aByteArray912 = new byte[16384];
  13547. currentStats = new int[Skills.skillsCount];
  13548. ignoreListAsLongs = new long[100];
  13549. loadingError = false;
  13550. anInt927 = 0x332d25;
  13551. anIntArray928 = new int[5];
  13552. anIntArrayArray929 = new int[104][104];
  13553. chatTypes = new int[500];
  13554. chatNames = new String[500];
  13555. chatMessages = new String[500];
  13556. chatButtons = new Sprite[4];
  13557. sideIcons = new Sprite[15];
  13558. redStones = new Sprite[5];
  13559. aBoolean954 = true;
  13560. friendsListAsLongs = new long[200];
  13561. currentSong = -1;
  13562. drawingFlames = false;
  13563. spriteDrawX = -1;
  13564. spriteDrawY = -1;
  13565. anIntArray968 = new int[33];
  13566. anIntArray969 = new int[256];
  13567. decompressors = new Decompressor[6];
  13568. variousSettings = new int[2000];
  13569. aBoolean972 = false;
  13570. anInt975 = 50;
  13571. anIntArray976 = new int[anInt975];
  13572. anIntArray977 = new int[anInt975];
  13573. anIntArray978 = new int[anInt975];
  13574. anIntArray979 = new int[anInt975];
  13575. anIntArray980 = new int[anInt975];
  13576. anIntArray981 = new int[anInt975];
  13577. anIntArray982 = new int[anInt975];
  13578. aStringArray983 = new String[anInt975];
  13579. anInt985 = -1;
  13580. hitMarks = new Sprite[20];
  13581. hitMark = new Sprite[20];
  13582. hitIcon = new Sprite[20];
  13583. anIntArray990 = new int[5];
  13584. aBoolean994 = false;
  13585. anInt1002 = 0x23201b;
  13586. amountOrNameInput = "";
  13587. aClass19_1013 = new NodeList();
  13588. aBoolean1017 = false;
  13589. anInt1018 = -1;
  13590. anIntArray1030 = new int[5];
  13591. aBoolean1031 = false;
  13592. mapFunctions = new Sprite[100];
  13593. dialogID = -1;
  13594. maxStats = new int[Skills.skillsCount];
  13595. anIntArray1045 = new int[2000];
  13596. aBoolean1047 = true;
  13597. anIntArray1052 = new int[151];
  13598. anInt1054 = -1;
  13599. aClass19_1056 = new NodeList();
  13600. anIntArray1057 = new int[33];
  13601. aClass9_1059 = new RSInterface();
  13602. mapScenes = new Background[100];
  13603. barFillColor = 0x4d4233;
  13604. anIntArray1065 = new int[7];
  13605. anIntArray1072 = new int[1000];
  13606. anIntArray1073 = new int[1000];
  13607. aBoolean1080 = false;
  13608. friendsList = new String[200];
  13609. inStream = Stream.create();
  13610. expectedCRCs = new int[9];
  13611. menuActionCmd2 = new int[500];
  13612. menuActionCmd3 = new int[500];
  13613. menuActionCmd4 = new int[500];
  13614. menuActionIds = new int[500];
  13615. menuActionCmd1 = new int[500];
  13616. headIcons = new Sprite[20];
  13617. skullIcons = new Sprite[20];
  13618. headIconsHint = new Sprite[20];
  13619. tabAreaAltered = false;
  13620. aString1121 = "";
  13621. atPlayerActions = new String[5];
  13622. atPlayerArray = new boolean[5];
  13623. anIntArrayArrayArray1129 = new int[4][13][13];
  13624. anInt1132 = 2;
  13625. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13626. aBoolean1141 = false;
  13627. aBoolean1149 = false;
  13628. crosses = new Sprite[8];
  13629. musicEnabled = true;
  13630. needDrawTabArea = false;
  13631. loggedIn = false;
  13632. canMute = false;
  13633. aBoolean1159 = false;
  13634. aBoolean1160 = false;
  13635. anInt1171 = 1;
  13636. myUsername = "";
  13637. myPassword = "";
  13638. genericLoadingError = false;
  13639. reportAbuseInterfaceID = -1;
  13640. aClass19_1179 = new NodeList();
  13641. anInt1184 = 128;
  13642. invOverlayInterfaceID = -1;
  13643. stream = Stream.create();
  13644. menuActionName = new String[500];
  13645. anIntArray1203 = new int[5];
  13646. sound = new int[50];
  13647. anInt1210 = 2;
  13648. anInt1211 = 78;
  13649. promptInput = "";
  13650. modIcons = new Sprite[12];
  13651. tabID = 3;
  13652. inputTaken = false;
  13653. songChanging = true;
  13654. anIntArray1229 = new int[151];
  13655. aClass11Array1230 = new TileSettings[4];
  13656. aBoolean1233 = false;
  13657. anIntArray1240 = new int[100];
  13658. soundType = new int[50];
  13659. aBoolean1242 = false;
  13660. soundDelay = new int[50];
  13661. soundVolume = new int[50];
  13662. rsAlreadyLoaded = false;
  13663. welcomeScreenRaised = false;
  13664. messagePromptRaised = false;
  13665. loginMessage1 = "";
  13666. loginMessage2 = "";
  13667. backDialogID = -1;
  13668. anInt1279 = 2;
  13669. bigX = new int[4000];
  13670. bigY = new int[4000];
  13671. anInt1289 = -1;
  13672. }
  13673. public String clanUsername;
  13674. public String clanMessage;
  13675. public int[] chatRights;
  13676. public int hoverId;
  13677. public boolean summHover = false;
  13678. public int rights;
  13679. public String name;
  13680. public String message;
  13681. public String clanname;
  13682. public int chatTypeView;
  13683. public int clanChatMode;
  13684. public int duelMode;
  13685.  
  13686. /* Declare custom sprites */
  13687. @SuppressWarnings("unused")
  13688. private static Sprite mapIcon;
  13689. private Sprite chatArea;
  13690. private Sprite[] chatButtons;
  13691. private Background mapBack;
  13692. private Sprite tabArea;
  13693. private Sprite worldMapIcon;
  13694. private Sprite logIconH;
  13695. private Sprite logIconC;
  13696. private Sprite mapArea;
  13697. private Sprite[] ORBS = new Sprite[19];
  13698. /**/
  13699.  
  13700. public RSImageProducer leftFrame;
  13701. public RSImageProducer topFrame;
  13702. public RSImageProducer rightFrame;
  13703. public int ignoreCount;
  13704. public long aLong824;
  13705. public int[][] anIntArrayArray825;
  13706. public int[] friendsNodeIDs;
  13707. public NodeList[][][] groundArray;
  13708. public int[] anIntArray828;
  13709. public int[] anIntArray829;
  13710. public volatile boolean aBoolean831;
  13711. public Socket aSocket832;
  13712. public int loginScreenState;
  13713. public Stream aStream_834;
  13714. public NPC[] npcArray;
  13715. public int npcCount;
  13716. public int[] npcIndices;
  13717. public int anInt839;
  13718. public int[] anIntArray840;
  13719. public int anInt841;
  13720. public int anInt842;
  13721. public int anInt843;
  13722. public String aString844;
  13723. public Stream aStream_847;
  13724. public boolean aBoolean848;
  13725. public static int anInt849;
  13726. public int[] anIntArray850;
  13727. public int[] anIntArray851;
  13728. public int[] anIntArray852;
  13729. public int[] anIntArray853;
  13730. public static int anInt854;
  13731. public int anInt855;
  13732. public static int openInterfaceID;
  13733. public int xCameraPos;
  13734. public int zCameraPos;
  13735. public int yCameraPos;
  13736. public int yCameraCurve;
  13737. public int xCameraCurve;
  13738. public int myPrivilege;
  13739. public final int[] currentExp;
  13740. public Sprite[] redStones;
  13741. public Sprite mapFlag;
  13742. public Sprite mapMarker;
  13743. public boolean aBoolean872;
  13744. public final int[] anIntArray873;
  13745. public int anInt874;
  13746. public final boolean[] aBooleanArray876;
  13747. public int weight;
  13748. public MouseDetection mouseDetection;
  13749. public volatile boolean drawFlames;
  13750. public String reportAbuseInput;
  13751. public int unknownInt10;
  13752. public boolean menuOpen;
  13753. public int anInt886;
  13754. public String inputString;
  13755. public final int maxPlayers;
  13756. public final int myPlayerIndex;
  13757. public Player[] playerArray;
  13758. public int playerCount;
  13759. public int[] playerIndices;
  13760. public int anInt893;
  13761. public int[] anIntArray894;
  13762. public Stream[] aStreamArray895s;
  13763. public int viewRotationOffset;
  13764. public int anInt897;
  13765. public int friendsCount;
  13766. public int anInt900;
  13767. public int[][] anIntArrayArray901;
  13768. public final int anInt902;
  13769. public byte[] aByteArray912;
  13770. public int anInt913;
  13771. public int crossX;
  13772. public int crossY;
  13773. public int crossIndex;
  13774. public int crossType;
  13775. public int plane;
  13776. public final int[] currentStats;
  13777. public static int anInt924;
  13778. public final long[] ignoreListAsLongs;
  13779. public boolean loadingError;
  13780. public final int anInt927;
  13781. public final int[] anIntArray928;
  13782. public int[][] anIntArrayArray929;
  13783. public Sprite aClass30_Sub2_Sub1_Sub1_931;
  13784. public Sprite aClass30_Sub2_Sub1_Sub1_932;
  13785. public int anInt933;
  13786. public int anInt934;
  13787. public int anInt935;
  13788. public int anInt936;
  13789. public int anInt937;
  13790. public int anInt938;
  13791. public static int anInt940;
  13792. public int[] chatTypes;
  13793. public String[] chatNames;
  13794. public String[] chatMessages;
  13795. public int anInt945;
  13796. public WorldController worldController;
  13797. public Sprite[] sideIcons;
  13798. public Sprite[] customSideIcons = new Sprite[] {new Sprite("SideIcon 1"), new Sprite("SideIcon 2"), new Sprite("SideIcon 3")};
  13799. public int menuScreenArea;
  13800. public int menuOffsetX;
  13801. public int menuOffsetY;
  13802. public int menuWidth;
  13803. public int menuHeight;
  13804. public long aLong953;
  13805. public boolean aBoolean954;
  13806.  
  13807. public String[] clanList = new String[100];
  13808. public long[] friendsListAsLongs;
  13809. public int currentSong;
  13810. public static int nodeID = 10;
  13811. public static int portOff;
  13812. static boolean clientData;
  13813. public static boolean isMembers = true;
  13814. public static boolean lowMem;
  13815. public volatile boolean drawingFlames;
  13816. public int spriteDrawX;
  13817. public int spriteDrawY;
  13818. public final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  13819. 0xff00ff, 0xffffff };
  13820. public Sprite LoginBox;
  13821. public Sprite LoginButton;
  13822. public Sprite LoginButtonHover;
  13823. public Sprite TypeIn;
  13824. public Sprite TypeInHover;
  13825. public Sprite RememberNo;
  13826. public Sprite RememberYes;
  13827. public Sprite Logo;
  13828. public Sprite Bg;
  13829. public boolean FadingBackgrounds = true;
  13830. public Sprite BackgroundFix;
  13831. public final int[] anIntArray968;
  13832. public final int[] anIntArray969;
  13833. public final Decompressor[] decompressors;
  13834. public int variousSettings[];
  13835. public boolean aBoolean972;
  13836. public final int anInt975;
  13837. public final int[] anIntArray976;
  13838. public final int[] anIntArray977;
  13839. public final int[] anIntArray978;
  13840. public final int[] anIntArray979;
  13841. public final int[] anIntArray980;
  13842. public final int[] anIntArray981;
  13843. public final int[] anIntArray982;
  13844. public final String[] aStringArray983;
  13845. public int anInt984;
  13846. public int anInt985;
  13847. public static int anInt986;
  13848. public Sprite[] hitMarks;
  13849. private Sprite[] hitMark;
  13850. private Sprite[] hitIcon;
  13851. private Sprite HPBarFull, HPBarEmpty;
  13852.  
  13853. public int anInt988;
  13854. public int anInt989;
  13855. public final int[] anIntArray990;
  13856. public static boolean aBoolean993;
  13857. public final boolean aBoolean994;
  13858. public int anInt995;
  13859. public int anInt996;
  13860. public int anInt997;
  13861. public int anInt998;
  13862. public int anInt999;
  13863. public ISAACRandomGen encryption;
  13864. public Sprite mapEdge;
  13865.  
  13866. public final int anInt1002;
  13867. public static final int[][] anIntArrayArray1003 = {
  13868. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  13869. 54193 },
  13870. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13871. 56621, 4783, 1341, 16578, 35003, 25239 },
  13872. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13873. 10153, 56621, 4783, 1341, 16578, 35003 },
  13874. { 4626, 11146, 6439, 12, 4758, 10270 },
  13875. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  13876.  
  13877. public Sprite multiOverlay;
  13878. public String amountOrNameInput;
  13879. public static int anInt1005;
  13880. public int daysSinceLastLogin;
  13881. public int pktSize;
  13882. public int pktType;
  13883. public int anInt1009;
  13884. public int anInt1010;
  13885. public int anInt1011;
  13886. public NodeList aClass19_1013;
  13887. public int anInt1014;
  13888. public int anInt1015;
  13889. public int anInt1016;
  13890. public int bgId = 0, waitTicker = 0, bgFinal = 0;
  13891. public boolean bgBoolean;
  13892. public boolean aBoolean1017;
  13893. public static int anInt1018;
  13894. public static final int[] anIntArray1019;
  13895. public int anInt1021;
  13896. public int anInt1022;
  13897. public int loadingStage;
  13898. public Sprite scrollBar1;
  13899. public Sprite scrollBar2;
  13900. public int anInt1026;
  13901.  
  13902. public Background backBase1;
  13903.  
  13904. public Background backBase2;
  13905.  
  13906. public Background backHmid1;
  13907. public final int[] anIntArray1030;
  13908. public boolean aBoolean1031;
  13909. public static Sprite[] mapFunctions;
  13910. public static int baseX;
  13911. public static int baseY;
  13912. public int anInt1036;
  13913. public int anInt1037;
  13914. public int loginFailures;
  13915. public int anInt1039;
  13916. public int anInt1040;
  13917. public int anInt1041;
  13918. public int dialogID;
  13919. public final int[] maxStats;
  13920. public final int[] anIntArray1045;
  13921. public int anInt1046;
  13922. public boolean aBoolean1047;
  13923. public TextDrawingArea smallText;
  13924. private TextDrawingArea smallHit;
  13925. private TextDrawingArea bigHit;
  13926. public TextDrawingArea aTextDrawingArea_1271;
  13927. public TextDrawingArea chatTextDrawingArea;
  13928. public TextDrawingArea aTextDrawingArea_1273;
  13929. public RSFont newSmallFont;
  13930. public RSFont newRegularFont;
  13931. public RSFont newBoldFont;
  13932. public RSFont newFancyFont;
  13933. public int anInt1048;
  13934. public String aString1049;
  13935. public static int anInt1051;
  13936. public final int[] anIntArray1052;
  13937. public StreamLoader titleStreamLoader;
  13938. public int anInt1054;
  13939. public int anInt1055;
  13940. public NodeList aClass19_1056;
  13941. public final int[] anIntArray1057;
  13942. public final RSInterface aClass9_1059;
  13943. public Background[] mapScenes;
  13944. public static int anInt1061;
  13945. public int currentSound;
  13946. public final int barFillColor;
  13947. public int friendsListAction;
  13948. public final int[] anIntArray1065;
  13949. public int mouseInvInterfaceIndex;
  13950. public int lastActiveInvInterface;
  13951. public OnDemandFetcher onDemandFetcher;
  13952. public int anInt1069;
  13953. public int anInt1070;
  13954. public int anInt1071;
  13955. public int[] anIntArray1072;
  13956. public int[] anIntArray1073;
  13957. public Sprite mapDotItem;
  13958. public Sprite mapDotNPC;
  13959. public Sprite mapDotPlayer;
  13960. public Sprite mapDotFriend;
  13961.  
  13962. public Sprite mapDotTeam;
  13963.  
  13964. public Sprite mapDotClan;
  13965. public int anInt1079;
  13966. public boolean aBoolean1080;
  13967. public String[] friendsList;
  13968. public Stream inStream;
  13969. public int anInt1084;
  13970. public int anInt1085;
  13971. public int activeInterfaceType;
  13972. public int anInt1087;
  13973. public int anInt1088;
  13974. public static int anInt1089;
  13975. public final int[] expectedCRCs;
  13976. public int[] menuActionCmd2;
  13977. public int[] menuActionCmd3;
  13978. public int[] menuActionIds;
  13979. public int[] menuActionCmd1;
  13980. public Sprite[] headIcons;
  13981. public Sprite[] skullIcons;
  13982. public Sprite[] headIconsHint;
  13983. public static int anInt1097;
  13984. public int anInt1098;
  13985. public int anInt1099;
  13986. public int anInt1100;
  13987. public int anInt1101;
  13988. public int anInt1102;
  13989. public static boolean tabAreaAltered;
  13990. public int anInt1104;
  13991. public RSImageProducer aRSImageProducer_1107;
  13992. public RSImageProducer aRSImageProducer_1108;
  13993. public RSImageProducer aRSImageProducer_1109;
  13994. public RSImageProducer aRSImageProducer_1110;
  13995. public RSImageProducer aRSImageProducer_1111;
  13996. public RSImageProducer aRSImageProducer_1112;
  13997. public RSImageProducer aRSImageProducer_1113;
  13998. public RSImageProducer aRSImageProducer_1114;
  13999. public RSImageProducer aRSImageProducer_1115;
  14000. public static int anInt1117;
  14001. public int membersInt;
  14002. public String aString1121;
  14003. public Sprite compass;
  14004.  
  14005. public RSImageProducer aRSImageProducer_1123;
  14006.  
  14007. public RSImageProducer aRSImageProducer_1124;
  14008. public RSImageProducer aRSImageProducer_1125;
  14009. public static Player myPlayer;
  14010. public final String[] atPlayerActions;
  14011. public final boolean[] atPlayerArray;
  14012. public final int[][][] anIntArrayArrayArray1129;
  14013. public static final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1,
  14014. -1, -1, -1, -1, -1, -1, -1, -1 };
  14015. public int cameraOffsetY;
  14016.  
  14017. public int anInt1132;
  14018. public int menuActionRow;
  14019. public static int anInt1134;
  14020. public int spellSelected;
  14021. public int anInt1137;
  14022. public int spellUsableOn;
  14023. public String spellTooltip;
  14024. public Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  14025. public boolean aBoolean1141;
  14026. public static int anInt1142;
  14027. public int energy;
  14028. public boolean aBoolean1149;
  14029. public Sprite[] crosses;
  14030. public boolean musicEnabled;
  14031. public Background[] aBackgroundArray1152s;
  14032. public static boolean needDrawTabArea;
  14033. public int unreadMessages;
  14034. public static int anInt1155;
  14035. public static boolean fpsOn;
  14036. public boolean loggedIn;
  14037. public boolean canMute;
  14038. public boolean aBoolean1159;
  14039. public boolean aBoolean1160;
  14040. public static int loopCycle;
  14041. public static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  14042. public RSImageProducer aRSImageProducer_1163;
  14043. public RSImageProducer mapEdgeIP;
  14044. public RSImageProducer aRSImageProducer_1164;
  14045. public RSImageProducer aRSImageProducer_1165;
  14046. public RSImageProducer aRSImageProducer_1166;
  14047. public int daysSinceRecovChange;
  14048. public RSSocket socketStream;
  14049.  
  14050. public int anInt1169;
  14051. public static int minimapZoom;
  14052.  
  14053. public int anInt1171;
  14054. public long aLong1172;
  14055. public static String myUsername;
  14056. public static String myPassword;
  14057. public static int anInt1175;
  14058. public boolean genericLoadingError;
  14059. public final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  14060. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  14061. public int reportAbuseInterfaceID;
  14062. public NodeList aClass19_1179;
  14063. public int[] anIntArray1180;
  14064. public int[] anIntArray1181;
  14065. public int[] anIntArray1182;
  14066. public byte[][] aByteArrayArray1183;
  14067. public int anInt1184;
  14068. public static int viewRotation;
  14069. public int anInt1186;
  14070. public int anInt1187;
  14071. public static int anInt1188;
  14072. public int invOverlayInterfaceID;
  14073. public int[] anIntArray1190;
  14074. public int[] anIntArray1191;
  14075. public Stream stream;
  14076. public int anInt1193;
  14077. public int splitpublicChat;
  14078.  
  14079. public String[] menuActionName;
  14080. public Sprite aClass30_Sub2_Sub1_Sub1_1201;
  14081. public Sprite aClass30_Sub2_Sub1_Sub1_1202;
  14082. public final int[] anIntArray1203;
  14083. public static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  14084. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  14085. public static boolean flagged;
  14086. public final int[] sound;
  14087. public int anInt1208;
  14088. public static int minimapRotation;
  14089. public int anInt1210;
  14090. public static int anInt1211;
  14091. public String promptInput;
  14092. public int anInt1213;
  14093. public int[][][] intGroundArray;
  14094. public long aLong1215;
  14095. public int loginScreenCursorPos;
  14096. public final Sprite[] modIcons;
  14097. public long aLong1220;
  14098. public static int tabID;
  14099. public int anInt1222;
  14100. public static boolean inputTaken;
  14101. public int inputDialogState;
  14102. public static int anInt1226;
  14103. public int nextSong;
  14104. public boolean songChanging;
  14105. public final int[] anIntArray1229;
  14106. public TileSettings[] aClass11Array1230;
  14107. public static int anIntArray1232[];
  14108. public boolean aBoolean1233;
  14109. public int[] anIntArray1234;
  14110. public int[] anIntArray1235;
  14111. public int[] anIntArray1236;
  14112. public int anInt1237;
  14113. public int anInt1238;
  14114. public final int anInt1239 = 100;
  14115.  
  14116. public final int[] anIntArray1240;
  14117. public final int[] soundType;
  14118. public boolean aBoolean1242;
  14119. public int atInventoryLoopCycle;
  14120. public int atInventoryInterface;
  14121. public int atInventoryIndex;
  14122. public int atInventoryInterfaceType;
  14123. public byte[][] aByteArrayArray1247;
  14124. public int tradeMode;
  14125. public int anInt1249;
  14126. public final int[] soundDelay;
  14127. public final int[] soundVolume;
  14128. public int anInt1251;
  14129. public final boolean rsAlreadyLoaded;
  14130. public int anInt1253;
  14131. public int anInt1254;
  14132. public boolean welcomeScreenRaised;
  14133. public boolean messagePromptRaised;
  14134. public int anInt1257;
  14135. public byte[][][] byteGroundArray;
  14136. public int prevSong;
  14137. public int destX;
  14138. public int destY;
  14139. public Sprite aClass30_Sub2_Sub1_Sub1_1263;
  14140. public int anInt1264;
  14141. public int anInt1265;
  14142. public String loginMessage1;
  14143. public String loginMessage2;
  14144. public int anInt1268;
  14145. public int anInt1269;
  14146. public int anInt1275;
  14147. public int backDialogID;
  14148. public int cameraOffsetX;
  14149. public int anInt1279;
  14150. public int[] bigX;
  14151. public int[] bigY;
  14152. public int itemSelected;
  14153. public int anInt1283;
  14154. public int anInt1284;
  14155. public int anInt1285;
  14156. public String selectedItemName;
  14157. public int publicChatMode;
  14158. public static int anInt1288;
  14159. public int anInt1289;
  14160. public static int anInt1290;
  14161. public static String server = "localhost";
  14162. public static int dataVersion = 602;
  14163. public static boolean disableUnderlayTexture = false;
  14164. public static boolean disableOverlayTexture = false;
  14165.  
  14166. public int drawCount;
  14167. public int fullscreenInterfaceID;
  14168. public int anInt1044;// 377
  14169. public int anInt1129;// 377
  14170. public int anInt1315;// 377
  14171. public int anInt1500;// 377
  14172. public int anInt1501;// 377
  14173. public int[] fullScreenTextureArray;
  14174.  
  14175. public void resetAllImageProducers() {
  14176. if (super.fullGameScreen != null) {
  14177. return;
  14178. }
  14179. aRSImageProducer_1166 = null;
  14180. aRSImageProducer_1164 = null;
  14181. aRSImageProducer_1163 = null;
  14182. aRSImageProducer_1165 = null;
  14183. aRSImageProducer_1123 = null;
  14184. aRSImageProducer_1124 = null;
  14185. aRSImageProducer_1125 = null;
  14186. aRSImageProducer_1107 = null;
  14187. aRSImageProducer_1108 = null;
  14188. aRSImageProducer_1109 = null;
  14189. aRSImageProducer_1110 = null;
  14190. aRSImageProducer_1111 = null;
  14191. aRSImageProducer_1112 = null;
  14192. aRSImageProducer_1113 = null;
  14193. aRSImageProducer_1114 = null;
  14194. aRSImageProducer_1115 = null;
  14195. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  14196. welcomeScreenRaised = true;
  14197. }
  14198.  
  14199. @SuppressWarnings({ "unchecked", "rawtypes" })
  14200. public void launchURL(String url) {
  14201. String osName = System.getProperty("os.name");
  14202. try {
  14203. if (osName.startsWith("Mac OS")) {
  14204. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  14205. Method openURL = fileMgr.getDeclaredMethod("openURL",
  14206. new Class[] { String.class });
  14207. openURL.invoke(null, new Object[] { url });
  14208. } else if (osName.startsWith("Windows"))
  14209. Runtime.getRuntime().exec(
  14210. "rundll32 url.dll,FileProtocolHandler " + url);
  14211. else { // assume Unix or Linux
  14212. String[] browsers = { "firefox", "opera", "konqueror",
  14213. "epiphany", "mozilla", "netscape", "safari" };
  14214. String browser = null;
  14215. for (int count = 0; count < browsers.length && browser == null; count++)
  14216. if (Runtime.getRuntime()
  14217. .exec(new String[] { "which", browsers[count] })
  14218. .waitFor() == 0)
  14219. browser = browsers[count];
  14220. if (browser == null) {
  14221. throw new Exception("Could not find web browser");
  14222. } else
  14223. Runtime.getRuntime().exec(new String[] { browser, url });
  14224. }
  14225. } catch (Exception e) {
  14226. pushMessage("Failed to open URL.", 0, "");
  14227. }
  14228. }
  14229.  
  14230. static {
  14231. anIntArray1019 = new int[120];
  14232. int i = 0;
  14233. for (int j = 0; j < 120; j++) {
  14234. int l = j + 1;
  14235. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  14236. i += i1;
  14237. anIntArray1019[j] = i / 4;
  14238. }
  14239. anIntArray1232 = new int[32];
  14240. i = 2;
  14241. for (int k = 0; k < 32; k++) {
  14242. anIntArray1232[k] = i - 1;
  14243. i += i;
  14244. }
  14245. }
  14246. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement