Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 448.79 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. import com.particles.Particle;
  89. import com.particles.ParticleDefinition;
  90.  
  91. public class Client extends RSApplet {
  92. public int[] menuActionCmd4;
  93.  
  94. public static final long serialVersionUID = 1L;
  95.  
  96. private Update update = new Update(this);
  97. public boolean HPBarToggle = true;
  98. public Sprite[] chatImages = new Sprite[2];
  99. public static int spellID = 0;
  100. public int MapX, MapY;
  101. private int ping = 0;
  102. private long pingStart = 0;
  103. Pattern pattern = Pattern.compile("@cr([0-9]{1,2})@");
  104.  
  105. public static String intToKOrMilLongName(int i) {
  106. String s = String.valueOf(i);
  107. for (int k = s.length() - 3; k > 0; k -= 3)
  108. s = s.substring(0, k) + "," + s.substring(k);
  109. if (s.length() > 8)
  110. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  111. else if (s.length() > 4)
  112. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  113. return " " + s;
  114. }
  115.  
  116. public static String intToKOrMil(int j) {
  117. if (j < 0x186a0)
  118. return String.valueOf(j);
  119. if (j < 0x989680)
  120. return j / 1000 + "K";
  121. else
  122. return j / 0xf4240 + "M";
  123. }
  124.  
  125. public void stopMidi() {
  126. SignLink.midifade = 0;
  127. SignLink.midi = "stop";
  128. //SignLink.midii.fadeOut();
  129. }
  130.  
  131. private void processXPCounterClick() {
  132. int x = super.mouseX;
  133. int y = super.mouseY;
  134. if (x >= 520 && x <= 554 && y >= 47 && y <= 81) {
  135. menuActionName[3] = counterOn ? "Off" : "On";
  136. menuActionIds[3] = 474;
  137. menuActionName[2] = "Reset";
  138. menuActionIds[2] = 475;
  139. menuActionName[1] = xpLock ? "Unlock XP" : "Lock XP";
  140. menuActionIds[1] = 476;
  141. menuActionRow = 4;
  142. }
  143. }
  144.  
  145. public void hitmarkDraw(int hitLength, int type, int icon, int damage, int move, int opacity) {
  146. if (damage > 0) {
  147. Sprite end1 = null, middle = null, end2 = null;
  148. int x = 0;
  149. switch (hitLength) {
  150. case 1: x = 8; break;
  151. case 2: x = 4; break;
  152. case 3: x = 1; break;
  153. }
  154. switch (type) {
  155. case 0:
  156. end1 = hitMark[0];
  157. middle = hitMark[1];
  158. end2 = hitMark[2];
  159. break;
  160. case 1:
  161. end1 = hitMark[3];
  162. middle = hitMark[4];
  163. end2 = hitMark[5];
  164. break;
  165. case 2:
  166. end1 = hitMark[6];
  167. middle = hitMark[7];
  168. end2 = hitMark[8];
  169. break;
  170. }
  171. if (type <= 1 || icon != -1)
  172. hitIcon[icon].drawTransparentSprite(spriteDrawX - 34 + x, spriteDrawY - 14 + move, opacity);
  173. end1.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  174. x += 4;
  175. for (int i = 0; i < hitLength * 2; i++) {
  176. middle.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  177. x += 4;
  178. }
  179. end2.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  180. if (opacity > 100)
  181. (type == 1 ? bigHit : smallHit).drawText(0xffffff, String.valueOf(damage), spriteDrawY + (type == 1 ? 2 : 32) + move, spriteDrawX + 4);
  182. } else {
  183. Sprite block = new Sprite("hits/block");
  184. block.drawTransparentSprite(spriteDrawX - 12, spriteDrawY - 14 + move, opacity);
  185. }
  186. }
  187.  
  188.  
  189. private int xpAddedPos;
  190. private int expAdded = 0;
  191. private boolean xpLock = false;
  192. private int xpCounter = 0;
  193. private boolean counterOn = false;
  194.  
  195. private void drawCounterOnScreen() {
  196. int x = 520;
  197. int y = 37;
  198. counter[2].drawSprite(x - 100, y + 12);
  199. int i = aTextDrawingArea_1271.getTextWidth(Integer.toString(xpCounter));
  200. aTextDrawingArea_1271.drawText(0xffffff, "XP:", y + 25, x - 88);
  201. aTextDrawingArea_1271.drawText(0xffffff, Integer.toString(xpCounter),y + 25, x + 11 - i);
  202. if (expAdded != 0) {
  203. i = smallText.getTextWidth(Integer.toString(expAdded) + "xp");
  204. smallText.drawText(0xff9933, Integer.toString(expAdded) + "xp", y + 14 + 7 + xpAddedPos, x - 12 - i);
  205. xpAddedPos += 2;
  206. if (xpAddedPos >= 50) {
  207. xpAddedPos = 0;
  208. expAdded = 0;
  209. }
  210. }
  211. }
  212.  
  213. Sprite[] counter;
  214.  
  215. private void drawXPCounter() {
  216. int x = 0 - 2;
  217. int y = 45;
  218. int x1 = super.mouseX;
  219. int y1 = super.mouseY;
  220. counter[(counterOn || (x1 >= 520 && x1 <= 554 && y1 >= 47 && y1 <= 81) ? 1: 0)].drawSprite(x, y);
  221. }
  222.  
  223. public boolean menuHasAddFriend(int j) {
  224. if (j < 0)
  225. return false;
  226. int k = menuActionIds[j];
  227. if (k >= 2000)
  228. k -= 2000;
  229. return k == 337;
  230. }
  231.  
  232. public void drawChannelButtons() {
  233. String text[] = {
  234. "On", "Friends", "Off", "Hide"
  235. };
  236. int disabledColor[] = {
  237. 65280, 0xffff00, 0xff0000, 65535
  238. };
  239. switch (cButtonCPos) {
  240. case 0:
  241. chatButtons[1].drawSprite(5, 144);
  242. break;
  243. case 1:
  244. chatButtons[1].drawSprite(62, 144);
  245. break;
  246. case 2:
  247. chatButtons[1].drawSprite(119, 144);
  248. break;
  249. case 3:
  250. chatButtons[1].drawSprite(176, 144);
  251. break;
  252. case 4:
  253. chatButtons[1].drawSprite(233, 144);
  254. break;
  255. case 5:
  256. chatButtons[1].drawSprite(290, 144);
  257. break;
  258. case 6:
  259. chatButtons[1].drawSprite(347, 144);
  260. break;
  261. }
  262. if (cButtonHPos == cButtonCPos) {
  263. switch (cButtonHPos) {
  264. case 0:
  265. chatButtons[2].drawSprite(5, 144);
  266. break;
  267. case 1:
  268. chatButtons[2].drawSprite(62, 144);
  269. break;
  270. case 2:
  271. chatButtons[2].drawSprite(119, 144);
  272. break;
  273. case 3:
  274. chatButtons[2].drawSprite(176, 144);
  275. break;
  276. case 4:
  277. chatButtons[2].drawSprite(233, 144);
  278. break;
  279. case 5:
  280. chatButtons[2].drawSprite(290, 144);
  281. break;
  282. case 7:
  283. chatButtons[2].drawSprite(347, 144);
  284. break;
  285. case 6:
  286. chatButtons[3].drawSprite(404, 144);
  287. break;
  288. }
  289. } else {
  290. switch (cButtonHPos) {
  291. case 0:
  292. chatButtons[2].drawSprite(5, 144);
  293. break;
  294. case 1:
  295. chatButtons[2].drawSprite(62, 144);
  296. break;
  297. case 2:
  298. chatButtons[2].drawSprite(119, 144);
  299. break;
  300. case 3:
  301. chatButtons[2].drawSprite(176, 144);
  302. break;
  303. case 4:
  304. chatButtons[2].drawSprite(233, 144);
  305. break;
  306. case 5:
  307. chatButtons[2].drawSprite(290, 144);
  308. break;
  309. case 7:
  310. chatButtons[2].drawSprite(347, 144);
  311. break;
  312. case 6:
  313. chatButtons[3].drawSprite(404, 144);
  314. break;
  315. }
  316. }
  317. smallText.method389(true, 425, 0xffffff, "Report Abuse", 158);
  318. smallText.method389(true, 26, 0xffffff, "All", 158);
  319. smallText.method389(true, 76, 0xffffff, "Game", 158);
  320. smallText.method389(true, 131, 0xffffff, "Public", 154);
  321. smallText.method389(true, 184, 0xffffff, "Private", 154);
  322. smallText.method389(true, 249, 0xffffff, "Clan", 154);
  323. smallText.method389(true, 304, 0xffffff, "Trade", 154);
  324. smallText.method389(true, 359, 0xffffff, " Duel", 154);
  325. smallText.method382(disabledColor[publicChatMode], 147, text[publicChatMode], 165, true);
  326. smallText.method382(disabledColor[privateChatMode], 203, text[privateChatMode], 165, true);
  327. smallText.method382(disabledColor[clanChatMode], 261, text[clanChatMode], 165, true);
  328. smallText.method382(disabledColor[tradeMode], 318, text[tradeMode], 165, true);
  329. smallText.method382(65280, 374, "On", 165, true);
  330. }
  331.  
  332. private int privateChatMode;
  333.  
  334. public void drawChatArea() {
  335. aRSImageProducer_1166.initDrawingArea();
  336. Rasterizer.lineOffsets = anIntArray1180;
  337. chatArea.drawSprite(0, 0);
  338. drawChannelButtons();
  339. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  340. if (messagePromptRaised) {
  341. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  342. newBoldFont.drawCenteredString(promptInput + "*", 259, 80, 128, -1);
  343. } else if (inputDialogState == 1) {
  344. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  345. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  346. 128, -1);
  347. } else if (inputDialogState == 2) {
  348. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  349. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80,
  350. 128, -1);
  351. } else if (aString844 != null) {
  352. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  353. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128,
  354. -1);
  355. } else if (backDialogID != -1) {
  356. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  357. } else if (dialogID != -1) {
  358. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  359. } else {
  360. int line = -3;
  361. int j = 0;
  362. Matcher matcher;
  363. DrawingArea.setDrawingArea(122, 8, 497, 7);
  364. for (int k = 0; k < 500; k++)
  365. if (chatMessages[k] != null) {
  366. int chatType = chatTypes[k];
  367. int yPos = (70 - line * 14) + anInt1089 + 5;
  368. String username = chatNames[k];
  369. byte byte0 = 0;
  370.  
  371. matcher = pattern.matcher(username);
  372. if (matcher.find()) {
  373. try {
  374. username = username.replace(matcher.group(0), "");
  375. byte0 = Byte.parseByte(matcher.group(1));
  376. } catch (NumberFormatException e) {
  377. byte0 = 0;
  378. }
  379. }
  380. if (chatType == 0) {
  381. if (chatTypeView == 5 || chatTypeView == 0) {
  382. if (yPos > 0 && yPos < 210) {
  383. newRegularFont.drawBasicString(chatMessages[k]/*.replaceAll("<(col|shad)=([a-zA-Z0-9]+)>", "<col=255>").replaceAll("@[^@]*@", "")*/, 11, yPos, 0, -1);
  384. // textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  385. }
  386. j++;
  387. line++;
  388. }
  389. }
  390. if ((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(username))) {
  391. if (chatTypeView == 1 || chatTypeView == 0) {
  392. if (yPos > 0 && yPos < 210) {
  393. int xPos = 13;
  394. Sprite crown = modIcons[byte0];
  395.  
  396. if (crown != null) {
  397. xPos = 11;
  398. }
  399.  
  400. String[] message = TextClass.splitString(newRegularFont, username + ": ", chatMessages[k], 470, crown);
  401. if (message.length > 1 && message[0] != null && message[1] != null) {
  402. if (crown != null && byte0 <= modIcons.length) {
  403. crown.drawSprite(xPos, yPos - 25 - (crown.myHeight / 6));
  404. xPos += crown.maxWidth;
  405. }
  406. newRegularFont.drawBasicString(username + ":", xPos, yPos - 14, 0, -1);
  407. xPos += newRegularFont.getTextWidth(username) + 6;
  408. newRegularFont.drawBasicString(message[0], xPos, yPos - 14, 255, -1);
  409. newRegularFont.drawBasicString(message[1], (crown == null ? 11 : 13), yPos, 255, -1);
  410. j++;
  411. line++;
  412. } else {
  413. if (crown != null && byte0 <= modIcons.length) {
  414. crown.drawSprite(xPos, yPos - 11 - (crown.myHeight / 6));
  415. xPos += crown.maxWidth;
  416. }
  417. newRegularFont.drawBasicString(username + ":", xPos, yPos, 0, -1);
  418. xPos += newRegularFont.getTextWidth(username) + 6;
  419. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  420. }
  421. }
  422. j++;
  423. line++;
  424. }
  425. }
  426. if ((chatType == 3 || chatType == 7) && (splitpublicChat == 0 || chatTypeView == 2) && (chatType == 7 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(username))) {
  427. if (chatTypeView == 2 || chatTypeView == 0) {
  428. if (yPos > 0 && yPos < 210) {
  429. int k1 = 11;
  430.  
  431. Sprite crown = byte0 == 0 ? null : modIcons[byte0];
  432. String[] message = TextClass.splitString(newRegularFont, "", chatMessages[k], 470, crown);
  433. if (message.length > 1 && message[0] != null && message[1] != null) {
  434. textDrawingArea.method385(0, "From ", yPos - 13, k1);
  435. k1 += textDrawingArea.getTextWidth("From ") - 2;
  436. if (crown != null && byte0 <= modIcons.length) {
  437. crown.drawSprite(k1, yPos - 24 - (crown.myHeight / 6));
  438. k1 += crown.maxWidth;
  439. }
  440. newRegularFont.drawBasicString(username + ":", k1, yPos - 13, 0, -1);
  441. k1 += newRegularFont.getTextWidth(username + ":") + 2;
  442. newRegularFont.drawBasicString(message[0], k1, yPos - 13, 0x800000, -1);
  443. newRegularFont.drawBasicString(message[1], 11, yPos, 0x800000, -1);
  444. j++;
  445. line++;
  446. } else {
  447. textDrawingArea.method385(0, "From ", yPos, k1);
  448. k1 += textDrawingArea.getTextWidth("From ") - 2;
  449. if (crown != null && byte0 <= modIcons.length) {
  450. crown.drawSprite(k1, yPos - 11 - (crown.myHeight / 6));
  451. k1 += crown.maxWidth;
  452. }
  453. newRegularFont.drawBasicString(username + ":", k1, yPos, 0, -1);
  454. k1 += newRegularFont.getTextWidth(username + ":") + 2;
  455. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  456. }
  457. }
  458. j++;
  459. line++;
  460. }
  461. }
  462. if (chatType == 4
  463. && (tradeMode == 0 || tradeMode == 1
  464. && isFriendOrSelf(username))) {
  465. if (chatTypeView == 3 || chatTypeView == 0) {
  466. if (yPos > 0 && yPos < 210)
  467. // textDrawingArea.method385(0x800080, s1 + " "
  468. // + chatMessages[k], yPos, 11);
  469. newRegularFont.drawBasicString(username + " "
  470. + chatMessages[k], 11, yPos, 0x800080,
  471. -1);
  472. j++;
  473. line++;
  474. }
  475. }
  476. if (chatType == 5 && splitpublicChat == 0
  477. && publicChatMode < 2) {
  478. if (chatTypeView == 2 || chatTypeView == 0) {
  479. if (yPos > 0 && yPos < 210)
  480. // textDrawingArea.method385(0x800000,
  481. // chatMessages[k], yPos, 11);
  482. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  483. j++;
  484. line++;
  485. }
  486. }
  487. if (chatType == 6 && (splitpublicChat == 0 || chatTypeView == 2) && publicChatMode < 2) {
  488. if (chatTypeView == 2 || chatTypeView == 0) {
  489. if (yPos > 0 && yPos < 210) {
  490. // textDrawingArea.method385(0, "To " + s1 +
  491. // ":", yPos, 11);
  492. // textDrawingArea.method385(0x800000,
  493. // chatMessages[k], yPos, 15 +
  494. // textDrawingArea.getTextWidth("To :" + s1));
  495.  
  496. newRegularFont.drawBasicString("To " + username + ":", 11, yPos, 0, -1);
  497. newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + username), yPos, 0x800000, -1);
  498. }
  499. j++;
  500. line++;
  501. }
  502. }
  503. if (chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(username))) {
  504. if (chatTypeView == 3 || chatTypeView == 0) {
  505. if (yPos > 0 && yPos < 210)
  506. newRegularFont.drawBasicString(username + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  507. j++;
  508. line++;
  509. }
  510. if(chatType == 11 && (clanChatMode == 0)) {
  511. if (chatTypeView == 11) {
  512. if(yPos > 0 && yPos < 110)
  513. newRegularFont.drawBasicString(username + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  514. j++;
  515. line++;
  516. }
  517. }
  518. }
  519. if(chatType == 15 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(username))) {
  520. if (chatTypeView == 3 || chatTypeView == 0) {
  521. if(yPos > 0 && yPos < 210)
  522. textDrawingArea.method385(0x7e3200, username + " " + chatMessages[k], yPos, 11);
  523. j++;
  524. line++;
  525. }
  526. }
  527. if(chatType == 16) {
  528. int j2 = 40+11;
  529. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  530. if(chatTypeView == 11 || chatTypeView == 0) {
  531. if(yPos > 0 && yPos < 110)
  532. switch(chatRights[k]) {
  533. case 1:
  534. j2 += clanNameWidth;
  535. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  536. j2 += 14;
  537. break;
  538.  
  539. case 2:
  540. j2 += clanNameWidth;
  541. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  542. j2 += 14;
  543. break;
  544.  
  545. case 3:
  546. j2 += clanNameWidth;
  547. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  548. j2 += 14;
  549. break;
  550.  
  551. case 4:
  552. j2 += clanNameWidth;
  553. modIcons[4].drawSprite(j2 - 18, yPos - 12);
  554. j2 += 14;
  555. break;
  556. case 5:
  557. j2 += clanNameWidth;
  558. modIcons[5].drawAdvancedSprite(j2 - 19, yPos - 14);
  559. j2 += 14;
  560. break;
  561. case 6:
  562. j2 += clanNameWidth;
  563. modIcons[6].drawSprite(j2 - 18, yPos - 12);
  564. j2 += 14;
  565. break;
  566. case 7:
  567. j2 += clanNameWidth;
  568. modIcons[7].drawAdvancedSprite(j2 - 18, yPos - 13);
  569. j2 += 14;
  570. break;
  571. case 8:
  572. j2 += clanNameWidth;
  573. modIcons[8].drawAdvancedSprite(j2 - 18, yPos - 13);
  574. j2 += 14;
  575. break;
  576.  
  577. case 9:
  578. j2 += clanNameWidth;
  579. modIcons[9].drawAdvancedSprite(j2 - 18, yPos - 12);
  580. j2 += 14;
  581. break;
  582.  
  583. case 10:
  584. j2 += clanNameWidth;
  585. modIcons[10].drawAdvancedSprite(j2 - 18, yPos - 11);
  586. j2 += 14;
  587. break;
  588.  
  589. case 11:
  590. j2 += clanNameWidth;
  591. modIcons[11].drawSprite(j2 - 15, yPos - 10);
  592. j2 += 14;
  593. break;
  594. case 12:
  595. j2 += clanNameWidth;
  596. modIcons[12].drawAdvancedSprite(j2 - 20, yPos - 15);
  597. j2 += 14;
  598. break;
  599. case 13:
  600. j2 += clanNameWidth;
  601. modIcons[13].drawSprite(j2 - 15, yPos - 10);
  602. j2 += 14;
  603. break;
  604. case 14:
  605. j2 += clanNameWidth;
  606. modIcons[14].drawAdvancedSprite(j2 - 18, yPos - 11);
  607. j2 += 14;
  608. break;
  609. case 15:
  610. j2 += clanNameWidth;
  611. modIcons[15].drawAdvancedSprite(j2 - 18, yPos - 11);
  612. j2 += 14;
  613. break;
  614.  
  615. case 16:
  616. j2 += clanNameWidth;
  617. modIcons[16].drawAdvancedSprite(j2 - 18, yPos - 11);
  618. j2 += 14;
  619. break;
  620.  
  621. case 17:
  622. j2 += clanNameWidth;
  623. modIcons[17].drawAdvancedSprite(j2 - 18, yPos - 11);
  624. j2 += 14;
  625. break;
  626.  
  627. case 18:
  628. j2 += clanNameWidth;
  629. modIcons[18].drawSprite(j2 - 15, yPos - 10);
  630. j2 += 14;
  631. break;
  632. case 19:
  633. j2 += clanNameWidth;
  634. modIcons[19].drawAdvancedSprite(j2 - 20, yPos - 15);
  635. j2 += 14;
  636. break;
  637. case 20:
  638. j2 += clanNameWidth;
  639. modIcons[20].drawSprite(j2 - 15, yPos - 10);
  640. j2 += 14;
  641. break;
  642. default:
  643. j2 += clanNameWidth;
  644. break;
  645. }
  646. newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
  647. newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
  648. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
  649. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  650. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  651. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  652.  
  653. j++;
  654. line++;
  655. }
  656. }
  657. }
  658. DrawingArea.defaultDrawingAreaSize();
  659. anInt1211 = j * 14 + 7 + 5;
  660. if (anInt1211 < 111)
  661. anInt1211 = 111;
  662. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  663. String s;
  664. if (myPlayer != null && myPlayer.name != null)
  665. s = myPlayer.name;
  666. else
  667. s = TextClass.fixName(myUsername);
  668.  
  669. int xPos = 0;
  670. Sprite crown = modIcons[myPrivilege];
  671.  
  672. if (crown != null) {
  673. crown.drawAdvancedSprite(11, 122 - (crown.myHeight / 6));
  674. xPos += crown.maxWidth;
  675. }
  676.  
  677. textDrawingArea.method385(0, s + ":", 133, 11 + xPos);
  678. textDrawingArea.drawChatInput(255, 11 + xPos + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  679. DrawingArea.method339(121, 0x807660, 506, 7);
  680. }
  681. if (menuOpen && menuScreenArea == 2) {
  682. drawMenu();
  683. }
  684. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  685. aRSImageProducer_1165.initDrawingArea();
  686. Rasterizer.lineOffsets = anIntArray1182;
  687. }
  688.  
  689. private int partyCount;
  690.  
  691. public int getLevelForXP(int exp, int max) {
  692. int points = 0;
  693. int output = 0;
  694. exp++;
  695. if (exp > getXPForLevel(max))
  696. return max;
  697. for (int lvl = 1; lvl <= max; lvl++) {
  698. points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0));
  699. output = (int) Math.floor(points / 4);
  700. if (output >= exp) {
  701. return lvl;
  702. }
  703. }
  704. return 0;
  705. }
  706.  
  707. public int getLevelForXP(int exp) {
  708. return getLevelForXP(exp, 99);
  709. }
  710.  
  711. public int getXPForLevel(int level) {
  712. int points = 0;
  713. int output = 0;
  714. for (int lvl = 1; lvl <= level; lvl++) {
  715. points += Math.floor(lvl + 300.0 * Math.pow(2.0, lvl / 7.0));
  716. if (lvl >= level) {
  717. return output;
  718. }
  719. output = (int)Math.floor(points / 4);
  720. }
  721. return 0;
  722. }
  723.  
  724. public String[] skillNames = { "Attack", "Hitpoints", "Mining", "Strength", "Agility",
  725. "Smithing", "Defence", "Herblore", "Fishing", "Range", "Thieving",
  726. "Cooking", "Prayer", "Crafting", "Firemaking", "Magic", "Fletching", "Woodcutting",
  727. "Runecrafting", "Slayer", "Farming", "Construction", "Hunter", "Summoning",
  728. "Dungeoneering" };
  729.  
  730. public String setMessage(int level) {
  731. String[] messages = new String[4];
  732. String message = "";
  733. int maxLevel = level == 24 ? 120 : 99;
  734.  
  735. if (maxStats[level] > maxLevel) {
  736. maxStats[level] = maxLevel;
  737. }
  738.  
  739. 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 };
  740.  
  741. if (level == 24) {
  742. maxStats[stuff[level]] = currentStats[stuff[level]];
  743. }
  744.  
  745. messages[0] = skillNames[level] + ": " + currentStats[stuff[level]] + "/" + maxStats[stuff[level]] + "\\n";
  746. messages[1] = "Current XP: " + NumberFormat.getInstance().format(currentExp[stuff[level]]) + "\\n";
  747. if ((maxStats[stuff[level]] == 99 && level != 24) || (level == 24 && maxStats[stuff[level]] == 120)) {
  748. messages[2] = messages[3] = "";
  749. } else {
  750. messages[2] = "Remainder: " + NumberFormat.getInstance().format(getXPForLevel(maxStats[stuff[level]] + 1) - currentExp[stuff[level]]) + "\\n";
  751. messages[3] = "Next level: " + NumberFormat.getInstance().format(getXPForLevel(maxStats[stuff[level]] + 1));
  752. }
  753. message = messages[0] + messages[1] + messages[2] + messages[3];
  754. return message;
  755. }
  756.  
  757. public void init() {
  758. try {
  759. nodeID = 10;
  760. portOff = 0;
  761. setHighMem();
  762. isMembers = true;
  763. SignLink.storeid = 32;
  764. SignLink.startpriv(InetAddress.getLocalHost());
  765. initClientFrame(503, 765);
  766. if(saveAccountInfo){
  767. readSettings();
  768. }
  769. instance = this;
  770. } catch (Exception exception) {
  771. return;
  772. }
  773. }
  774.  
  775. public void startRunnable(Runnable runnable, int i) {
  776. if (i > 10)
  777. i = 10;
  778. if (SignLink.mainapp != null) {
  779. SignLink.startthread(runnable, i);
  780. } else {
  781. super.startRunnable(runnable, i);
  782. }
  783. }
  784.  
  785. public Socket openSocket(int port) throws IOException {
  786. return new Socket(InetAddress.getByName(server), port);
  787. }
  788.  
  789. public void processMenuClick() {
  790. if (activeInterfaceType != 0)
  791. return;
  792. int j = super.clickMode3;
  793. if (spellSelected == 1 && super.saveClickX >= 516
  794. && super.saveClickY >= 160 && super.saveClickX <= 765
  795. && super.saveClickY <= 205)
  796. j = 0;
  797. if (menuOpen) {
  798. if (j != 1) {
  799. int k = super.mouseX;
  800. int j1 = super.mouseY;
  801. if (menuScreenArea == 0) {
  802. k -= 4;
  803. j1 -= 4;
  804. }
  805. if (menuScreenArea == 1) {
  806. k -= 519;
  807. j1 -= 168;
  808. }
  809. if (menuScreenArea == 2) {
  810. k -= 17;
  811. j1 -= 338;
  812. }
  813. if (menuScreenArea == 3) {
  814. k -= 519;
  815. j1 -= 0;
  816. }
  817. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  818. || j1 < menuOffsetY - 10
  819. || j1 > menuOffsetY + menuHeight + 10) {
  820. menuOpen = false;
  821. if (menuScreenArea == 1)
  822. needDrawTabArea = true;
  823. if (menuScreenArea == 2)
  824. inputTaken = true;
  825. }
  826. }
  827. if (j == 1) {
  828. int l = menuOffsetX;
  829. int k1 = menuOffsetY;
  830. int i2 = menuWidth;
  831. int k2 = super.saveClickX;
  832. int l2 = super.saveClickY;
  833. if (menuScreenArea == 0) {
  834. k2 -= 4;
  835. l2 -= 4;
  836. }
  837. if (menuScreenArea == 1) {
  838. k2 -= 519;
  839. l2 -= 168;
  840. }
  841. if (menuScreenArea == 2) {
  842. k2 -= 17;
  843. l2 -= 338;
  844. }
  845. if (menuScreenArea == 3) {
  846. k2 -= 519;
  847. l2 -= 0;
  848. }
  849. int i3 = -1;
  850. for (int j3 = 0; j3 < menuActionRow; j3++) {
  851. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  852. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  853. i3 = j3;
  854. }
  855. if (i3 != -1)
  856. doAction(i3);
  857. menuOpen = false;
  858. if (menuScreenArea == 1)
  859. needDrawTabArea = true;
  860. if (menuScreenArea == 2) {
  861. inputTaken = true;
  862. }
  863. }
  864. } else {
  865. if (j == 1 && menuActionRow > 0) {
  866. int i1 = menuActionIds[menuActionRow - 1];
  867. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  868. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  869. || i1 == 847 || i1 == 447 || i1 == 1125) {
  870. int l1 = menuActionCmd2[menuActionRow - 1];
  871. int j2 = menuActionCmd3[menuActionRow - 1];
  872. RSInterface class9 = RSInterface.interfaceCache[j2];
  873. if (class9.aBoolean259 || class9.aBoolean235) {
  874. aBoolean1242 = false;
  875. anInt989 = 0;
  876. anInt1084 = j2;
  877. anInt1085 = l1;
  878. activeInterfaceType = 2;
  879. anInt1087 = super.saveClickX;
  880. anInt1088 = super.saveClickY;
  881. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  882. activeInterfaceType = 1;
  883. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  884. activeInterfaceType = 3;
  885. return;
  886. }
  887. }
  888. }
  889. if (j == 1
  890. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  891. && menuActionRow > 2)
  892. j = 2;
  893. if (j == 1 && menuActionRow > 0)
  894. doAction(menuActionRow - 1);
  895. if (j == 2 && menuActionRow > 0)
  896. determineMenuSize();
  897. }
  898. }
  899.  
  900. public static int totalRead = 0;
  901.  
  902. public static String getFileNameWithoutExtension(String fileName) {
  903. File tmpFile = new File(fileName);
  904. tmpFile.getName();
  905. int whereDot = tmpFile.getName().lastIndexOf('.');
  906. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  907. return tmpFile.getName().substring(0, whereDot);
  908. }
  909. return "";
  910. }
  911.  
  912. public void preloadModels() {
  913. File file = new File(SignLink.findcachedir()+"./Raw/");
  914. File[] fileArray = file.listFiles();
  915. for (int y = 0; y < fileArray.length; y++) {
  916. String s = fileArray[y].getName();
  917. byte[] buffer = ReadFile(SignLink.findcachedir()+"./Raw/" + s);
  918. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  919. }
  920. }
  921.  
  922. public static final byte[] ReadFile(String s) {
  923. try {
  924. byte abyte0[];
  925. File file = new File(s);
  926. int i = (int) file.length();
  927. abyte0 = new byte[i];
  928. DataInputStream datainputstream = new DataInputStream(
  929. new BufferedInputStream(new FileInputStream(s)));
  930. datainputstream.readFully(abyte0, 0, i);
  931. datainputstream.close();
  932. totalRead++;
  933. return abyte0;
  934. } catch (Exception e) {
  935. System.out.println((new StringBuilder()).append("Read Error: ")
  936. .append(s).toString());
  937. return null;
  938. }
  939. }
  940.  
  941. public void addModels() {
  942. for (int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  943. byte[] abyte0 = getModel(ModelIndex);
  944. if (abyte0 != null && abyte0.length > 0) {
  945. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  946. }
  947. }
  948. }
  949.  
  950. public byte[] getModel(int Index) {
  951. try {
  952. File Model = new File(SignLink.findcachedir() + "./pModels/"
  953. + Index + ".gz");
  954. byte[] aByte = new byte[(int) Model.length()];
  955. FileInputStream fis = new FileInputStream(Model);
  956. fis.read(aByte);
  957. System.out.println("" + Index + " aByte = [" + aByte + "]!");
  958. fis.close();
  959. return aByte;
  960. } catch (Exception e) {
  961. return null;
  962. }
  963. }
  964.  
  965. public void addMaps() {
  966. for (int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  967. byte[] abyte0 = getMaps(MapIndex);
  968. if (abyte0 != null && abyte0.length > 0) {
  969. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  970. System.out.println("Maps Added");
  971. }
  972. }
  973. }
  974.  
  975. public byte[] getMaps(int Index) {
  976. try {
  977. File Map = new File(SignLink.findcachedir() + "./pMaps/" + Index
  978. + ".gz");
  979. byte[] aByte = new byte[(int) Map.length()];
  980. FileInputStream fis = new FileInputStream(Map);
  981. fis.read(aByte);
  982. pushMessage("aByte = [" + aByte + "]!", 0, "");
  983. fis.close();
  984. return aByte;
  985. } catch (Exception e) {
  986. return null;
  987. }
  988. }
  989.  
  990. public void saveMidi(boolean flag, byte abyte0[]) {
  991. SignLink.midifade = flag ? 1 : 0;
  992. SignLink.midisave(abyte0, abyte0.length);
  993. }
  994.  
  995. public int positions[] = new int[2000];
  996. public int landScapes[] = new int[2000];
  997. public int objects[] = new int[2000];
  998.  
  999. public final void method22() {
  1000. try {
  1001. anInt985 = -1;
  1002. aClass19_1056.removeAll();
  1003. aClass19_1013.removeAll();
  1004. // Rasterizer.method366();
  1005. unlinkMRUNodes();
  1006. worldController.initToNull();
  1007.  
  1008. System.gc();
  1009. for (int i = 0; i < 4; i++)
  1010. aClass11Array1230[i].method210();
  1011.  
  1012. for (int l = 0; l < 4; l++) {
  1013. for (int k1 = 0; k1 < 104; k1++) {
  1014. for (int j2 = 0; j2 < 104; j2++)
  1015. byteGroundArray[l][k1][j2] = 0;
  1016.  
  1017. }
  1018.  
  1019. }
  1020.  
  1021. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  1022. intGroundArray);
  1023.  
  1024. int k2 = aByteArrayArray1183.length;
  1025.  
  1026. int k18 = 62;
  1027. for (int A = 0; A < k2; A++)
  1028. for (int B = 0; B < 2000; B++)
  1029. if (anIntArray1234[A] == positions[B]) {
  1030. anIntArray1235[A] = landScapes[B];
  1031. anIntArray1236[A] = objects[B];
  1032. }
  1033.  
  1034. stream.createFrame(0);
  1035.  
  1036. if (!aBoolean1159) {
  1037. for (int i3 = 0; i3 < k2; i3++) {
  1038. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1039. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1040.  
  1041. byte abyte0[] = aByteArrayArray1183[i3];
  1042. if (FileOperations
  1043. .FileExists("./.ss_474/Null.map/mapsFloor/"
  1044. + anIntArray1235[i3] + ".dat"))
  1045. abyte0 = FileOperations
  1046. .ReadFile("./.ss_474/Null.map/mapsFloor/"
  1047. + anIntArray1235[i3] + ".dat");
  1048.  
  1049. if (abyte0 != null)
  1050. // objectManager.method180(abyte0, k5, i4, (anInt1069 -
  1051. // 6) * 8, (anInt1070 - 6) * 8, (byte)4,
  1052. // aClass11Array1230);
  1053. objectManager.method180(abyte0, k5, i4,
  1054. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  1055. aClass11Array1230);
  1056. }
  1057.  
  1058. for (int j4 = 0; j4 < k2; j4++) {
  1059. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1060. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1061. byte abyte2[] = aByteArrayArray1183[j4];
  1062. if (abyte2 == null && anInt1070 < 800)
  1063. // ObjectManager.method174(k7, 64, 0, 64, l5);
  1064. objectManager.method174(k7, 64, 64, l5);
  1065. }
  1066.  
  1067. anInt1097++;
  1068. if (anInt1097 > 160) {
  1069. anInt1097 = 0;
  1070. stream.createFrame(238);
  1071. stream.writeWordBigEndian(96);
  1072.  
  1073. }
  1074. stream.createFrame(0);
  1075.  
  1076. for (int i6 = 0; i6 < k2; i6++) {
  1077. byte abyte1[] = aByteArrayArray1247[i6];
  1078. if (FileOperations
  1079. .FileExists("./.ss_474/Null.map/spawnObject/"
  1080. + anIntArray1236[i6] + ".dat"))
  1081. abyte1 = FileOperations
  1082. .ReadFile("./.ss_474/Null.map/spawnObject/"
  1083. + anIntArray1236[i6] + ".dat");
  1084. if (abyte1 != null) {
  1085. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1086. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1087. // ObjectManager.method190(l8, aClass11Array1230, k9, 7,
  1088. // aClass25_946, abyte1);
  1089. objectManager.method190(l8, aClass11Array1230, k9,
  1090. worldController, abyte1);
  1091. }
  1092. }
  1093.  
  1094. }
  1095. if (aBoolean1159) {
  1096. for (int j3 = 0; j3 < 4; j3++) {
  1097. for (int k4 = 0; k4 < 13; k4++) {
  1098. for (int j6 = 0; j6 < 13; j6++) {
  1099. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1100. if (l7 != -1) {
  1101. int i9 = l7 >> 24 & 3;
  1102. int l9 = l7 >> 1 & 3;
  1103. int j10 = l7 >> 14 & 0x3ff;
  1104. int l10 = l7 >> 3 & 0x7ff;
  1105. int j11 = (j10 / 8 << 8) + l10 / 8;
  1106. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1107. if (anIntArray1234[l11] != j11
  1108. || aByteArrayArray1183[l11] == null)
  1109. continue;
  1110. // ObjectManager.method179(i9, l9,
  1111. // aClass11Array1230, 9, k4 * 8, (j10 & 7) *
  1112. // 8, aByteArrayArray1183[l11], (l10 & 7) *
  1113. // 8, j3, j6 * 8);
  1114. objectManager.method179(i9, l9,
  1115. aClass11Array1230, k4 * 8,
  1116. (j10 & 7) * 8,
  1117. aByteArrayArray1183[l11],
  1118. (l10 & 7) * 8, j3, j6 * 8);
  1119. break;
  1120. }
  1121.  
  1122. }
  1123. }
  1124.  
  1125. }
  1126.  
  1127. }
  1128.  
  1129. for (int l4 = 0; l4 < 13; l4++) {
  1130. for (int k6 = 0; k6 < 13; k6++) {
  1131. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1132. if (i8 == -1)
  1133. // ObjectManager.method174(k6 * 8, 8, 0, 8, l4 * 8);
  1134. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1135. }
  1136.  
  1137. }
  1138.  
  1139. stream.createFrame(0);
  1140.  
  1141. for (int l6 = 0; l6 < 4; l6++) {
  1142. for (int j8 = 0; j8 < 13; j8++) {
  1143. for (int j9 = 0; j9 < 13; j9++) {
  1144. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1145. if (i10 != -1) {
  1146. int k10 = i10 >> 24 & 3;
  1147. int i11 = i10 >> 1 & 3;
  1148. int k11 = i10 >> 14 & 0x3ff;
  1149. int i12 = i10 >> 3 & 0x7ff;
  1150. int j12 = (k11 / 8 << 8) + i12 / 8;
  1151. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1152. if (anIntArray1234[k12] != j12
  1153. || aByteArrayArray1247[k12] == null)
  1154. continue;
  1155. @SuppressWarnings("unused")
  1156. byte abyte0[] = aByteArrayArray1247[k12];
  1157. if (FileOperations
  1158. .FileExists("./Cache/FloorMaps/"
  1159. + anIntArray1235[k12]
  1160. + ".dat"))
  1161. abyte0 = FileOperations
  1162. .ReadFile(SignLink
  1163. .findcachedir()
  1164. + "FloorMaps/"
  1165. + anIntArray1235[k12]
  1166. + ".dat");
  1167. // ObjectManager.method183(aClass11Array1230,
  1168. // aClass25_946, k10, j8 * 8, (i12 & 7) * 8,
  1169. // true, l6, abyte0, (k11 & 7) * 8, i11, j9
  1170. // * 8);
  1171. objectManager.method183(aClass11Array1230,
  1172. worldController, k10, j8 * 8,
  1173. (i12 & 7) * 8, l6,
  1174. aByteArrayArray1247[k12],
  1175. (k11 & 7) * 8, i11, j9 * 8);
  1176. break;
  1177. }
  1178.  
  1179. }
  1180. }
  1181.  
  1182. }
  1183.  
  1184. }
  1185.  
  1186. }
  1187. stream.createFrame(0);
  1188. objectManager.method171(aClass11Array1230, worldController);
  1189. aRSImageProducer_1165.initDrawingArea();
  1190. stream.createFrame(0);
  1191.  
  1192. int k3 = ObjectManager.anInt145;
  1193. if (k3 > plane)
  1194. k3 = plane;
  1195.  
  1196. if (k3 < plane - 1)
  1197. k3 = plane - 1;
  1198. if (lowMem)
  1199.  
  1200. worldController.method275(ObjectManager.anInt145);
  1201. else
  1202. worldController.method275(0);
  1203. for (int i5 = 0; i5 < 104; i5++) {
  1204. for (int i7 = 0; i7 < 104; i7++)
  1205. spawnGroundItem(i5, i7);
  1206.  
  1207. }
  1208.  
  1209. anInt1051++;
  1210. if (anInt1051 > 98) {
  1211. anInt1051 = 0;
  1212. stream.createFrame(150);
  1213.  
  1214. }
  1215. method63();
  1216. } catch (Exception e) {
  1217. e.printStackTrace();
  1218. }
  1219. ObjectDef.mruNodes1.unlinkAll();
  1220.  
  1221. if (super.gameFrame != null) {
  1222. stream.createFrame(210);
  1223.  
  1224. stream.writeDWord(0x3f008edd);
  1225. }
  1226. System.gc();
  1227. //Rasterizer.method367();
  1228. onDemandFetcher.method566();
  1229.  
  1230. int k = (anInt1069 - 6) / 8 - 1;
  1231. int j1 = (anInt1069 + 6) / 8 + 1;
  1232. int i2 = (anInt1070 - 6) / 8 - 1;
  1233. int l2 = (anInt1070 + 6) / 8 + 1;
  1234. if (aBoolean1141) {
  1235. k = 49;
  1236. j1 = 50;
  1237. i2 = 49;
  1238. l2 = 50;
  1239. }
  1240. for (int l3 = k; l3 <= j1; l3++) {
  1241. for (int j5 = i2; j5 <= l2; j5++)
  1242. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1243. int j7 = onDemandFetcher.method562(0, j5, l3);
  1244. if (j7 != -1)
  1245. onDemandFetcher.method560(j7, 3);
  1246. int k8 = onDemandFetcher.method562(1, j5, l3);
  1247. if (k8 != -1)
  1248. onDemandFetcher.method560(k8, 3);
  1249. }
  1250.  
  1251. }
  1252.  
  1253. }
  1254.  
  1255. public void unlinkMRUNodes() {
  1256. ObjectDef.mruNodes1.unlinkAll();
  1257. ObjectDef.mruNodes2.unlinkAll();
  1258. EntityDef.mruNodes.unlinkAll();
  1259. ItemDef.mruNodes2.unlinkAll();
  1260. ItemDef.mruNodes1.unlinkAll();
  1261. Player.mruNodes.unlinkAll();
  1262. SpotAnim.aMRUNodes_415.unlinkAll();
  1263. }
  1264.  
  1265. private void method24(int i)
  1266. {
  1267. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1268. int j = ai.length;
  1269. for(int k = 0; k < j; k++)
  1270. ai[k] = 0;
  1271.  
  1272. for(int l = 1; l < 103; l++)
  1273. {
  1274. int i1 = 24628 + (103 - l) * 512 * 4;
  1275. for(int k1 = 1; k1 < 103; k1++)
  1276. {
  1277. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1278. worldController.method309(ai, i1, i, k1, l);
  1279. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1280. worldController.method309(ai, i1, i + 1, k1, l);
  1281. i1 += 4;
  1282. }
  1283.  
  1284. }
  1285.  
  1286. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1287. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1288. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1289. for(int i2 = 1; i2 < 103; i2++)
  1290. {
  1291. for(int j2 = 1; j2 < 103; j2++)
  1292. {
  1293. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1294. method50(i2, j1, j2, l1, i);
  1295. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1296. method50(i2, j1, j2, l1, i + 1);
  1297. }
  1298.  
  1299. }
  1300.  
  1301. aRSImageProducer_1165.initDrawingArea();
  1302. anInt1071 = 0;
  1303. for(int k2 = 0; k2 < 104; k2++)
  1304. {
  1305. for(int l2 = 0; l2 < 104; l2++)
  1306. {
  1307. int i3 = worldController.fetchGroundDecorationNewUID(plane, k2, l2);
  1308. if(i3 >= 0) {
  1309. int j3 = ObjectDef.forID(i3).anInt746;
  1310.  
  1311. j3 = j3 - 556;
  1312. if (j3 == 5)
  1313. j3 = -1;
  1314. if (j3 == 55)
  1315. j3 = 53;
  1316. 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)
  1317. j3++;
  1318. if(j3 >= 0) {
  1319. int k3 = k2;
  1320. int l3 = l2;
  1321. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1322. {
  1323. byte byte0 = 104;
  1324. byte byte1 = 104;
  1325. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1326. for(int i4 = 0; i4 < 10; i4++)
  1327. {
  1328. int j4 = (int)(Math.random() * 4D);
  1329. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1330. k3--;
  1331. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1332. k3++;
  1333. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1334. l3--;
  1335. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1336. l3++;
  1337. }
  1338.  
  1339. }
  1340. if (j3 >= 0 && j3 < 100) {
  1341. //System.out.println("Mapfunction trying to load: "+j3);
  1342. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1343. anIntArray1072[anInt1071] = k3;
  1344. anIntArray1073[anInt1071] = l3;
  1345. anInt1071++;
  1346. }
  1347. }
  1348. }
  1349. }
  1350.  
  1351. }
  1352.  
  1353. }
  1354.  
  1355.  
  1356. public void spawnGroundItem(int i, int j) {
  1357. NodeList class19 = groundArray[plane][i][j];
  1358. if (class19 == null) {
  1359. worldController.method295(plane, i, j);
  1360. return;
  1361. }
  1362. int k = 0xfa0a1f01;
  1363. Object obj = null;
  1364. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1365. .reverseGetNext()) {
  1366. ItemDef itemDef = ItemDef.forID(item.ID);
  1367. int l = itemDef.value;
  1368. if (itemDef.stackable)
  1369. l *= item.anInt1559 + 1;
  1370. // notifyItemSpawn(item, i + baseX, j + baseY);
  1371.  
  1372. if (l > k) {
  1373. k = l;
  1374. obj = item;
  1375. }
  1376. }
  1377.  
  1378. class19.insertTail(((Node) (obj)));
  1379. Object obj1 = null;
  1380. Object obj2 = null;
  1381. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1382. .reverseGetNext()) {
  1383. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1384. && obj1 == null)
  1385. obj1 = class30_sub2_sub4_sub2_1;
  1386. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1387. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1388. && obj2 == null)
  1389. obj2 = class30_sub2_sub4_sub2_1;
  1390. }
  1391.  
  1392. int i1 = i + (j << 7) + 0x60000000;
  1393. worldController.method281(i, i1, ((Animable) (obj1)),
  1394. method42(plane, j * 128 + 64, i * 128 + 64),
  1395. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1396. }
  1397.  
  1398. public void method26(boolean flag) {
  1399. for (int j = 0; j < npcCount; j++) {
  1400. NPC npc = npcArray[npcIndices[j]];
  1401. int k = 0x20000000 + (npcIndices[j] << 14);
  1402. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1403. continue;
  1404. int l = npc.x >> 7;
  1405. int i1 = npc.y >> 7;
  1406. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1407. continue;
  1408. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1409. && (npc.y & 0x7f) == 64) {
  1410. if (anIntArrayArray929[l][i1] == anInt1265)
  1411. continue;
  1412. anIntArrayArray929[l][i1] = anInt1265;
  1413. }
  1414. if (!npc.desc.aBoolean84)
  1415. k += 0x80000000;
  1416. worldController
  1417. .method285(plane, npc.anInt1552,
  1418. method42(plane, npc.y, npc.x), k, npc.y,
  1419. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1420. npc.aBoolean1541);
  1421. }
  1422. }
  1423.  
  1424. public boolean replayWave() {
  1425. return SignLink.wavereplay();
  1426. }
  1427.  
  1428. public void loadError() {
  1429. String s = "ondemand";// was a constant parameter
  1430. System.out.println(s);
  1431. try {
  1432. getAppletContext().showDocument(
  1433. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1434. } catch (Exception exception) {
  1435. exception.printStackTrace();
  1436. }
  1437. do
  1438. try {
  1439. Thread.sleep(1000L);
  1440. } catch (Exception _ex) {
  1441. }
  1442. while (true);
  1443. }
  1444.  
  1445. public void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1446. {
  1447. if(class9 == null){
  1448. return;
  1449. }
  1450. if(class9.type != 0 || class9.children == null || class9.interfaceShown)
  1451. return;
  1452. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1453. return;
  1454. int k1 = class9.children.length;
  1455. for(int l1 = 0; l1 < k1; l1++)
  1456. {
  1457. int i2 = class9.childX[l1] + i;
  1458. int j2 = (class9.childY[l1] + l) - j1;
  1459. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1460. if (class9_1 == null) {
  1461. break;
  1462. }
  1463.  
  1464. /*if(class9_1.id >= 205 && class9_1.id <= 205+25)
  1465. class9_1.type = 9;*/
  1466.  
  1467. i2 += class9_1.anInt263;
  1468. j2 += class9_1.anInt265;
  1469. if((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1470. if(class9_1.hoverType >= 0)
  1471. anInt886 = class9_1.hoverType;
  1472. else
  1473. anInt886 = class9_1.id;
  1474.  
  1475. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1476. anInt1315 = class9_1.id;
  1477. }
  1478.  
  1479. if (class9_1.type == 9 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1480. anInt1315 = class9_1.id;
  1481. }
  1482. if (class9_1.type == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1483. hoverId = class9_1.id;
  1484. }
  1485. if(class9_1.type == 0)
  1486. {
  1487. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1488. if(class9_1.scrollMax > class9_1.height)
  1489. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1490. } else
  1491. {
  1492. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1493. {
  1494. boolean flag = false;
  1495. if(class9_1.contentType != 0)
  1496. flag = buildFriendsListMenu(class9_1);
  1497. if(!flag)
  1498. {
  1499. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1500. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1501. menuActionName[menuActionRow] = class9_1.tooltip + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1502. } else {
  1503. menuActionName[menuActionRow] = class9_1.tooltip;
  1504. }
  1505. menuActionIds[menuActionRow] = 315;
  1506. menuActionCmd3[menuActionRow] = class9_1.id;
  1507. menuActionRow++;
  1508. }
  1509. }
  1510. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1511. {
  1512. String s = class9_1.selectedActionName;
  1513. if(s.indexOf(" ") != -1)
  1514. s = s.substring(0, s.indexOf(" "));
  1515. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1516. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1517. } else {
  1518. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1519. }
  1520. menuActionIds[menuActionRow] = 626;
  1521. menuActionCmd3[menuActionRow] = class9_1.id;
  1522. menuActionRow++;
  1523. }
  1524. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1525. {
  1526. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1527. menuActionName[menuActionRow] = "Close @gre@(@whi@" + class9_1.id + "@gre@)";
  1528. } else {
  1529. menuActionName[menuActionRow] = "Close";
  1530. }
  1531. menuActionIds[menuActionRow] = 200;
  1532. menuActionCmd3[menuActionRow] = class9_1.id;
  1533. menuActionRow++;
  1534. }
  1535. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1536. {
  1537. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1538. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1539. menuActionName[menuActionRow] = class9_1.tooltip + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1540. } else {
  1541. menuActionName[menuActionRow] = class9_1.tooltip;
  1542. }
  1543. menuActionIds[menuActionRow] = 169;
  1544. menuActionCmd3[menuActionRow] = class9_1.id;
  1545. menuActionRow++;
  1546. if (class9_1.hoverText != null) {
  1547. // drawHoverBox(k, l, class9_1.hoverText);
  1548. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1549. }
  1550. }
  1551. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1552. {
  1553. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1554. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1555. menuActionName[menuActionRow] = class9_1.tooltip + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1556. } else {
  1557. menuActionName[menuActionRow] = class9_1.tooltip;
  1558. }
  1559. menuActionIds[menuActionRow] = 646;
  1560. menuActionCmd3[menuActionRow] = class9_1.id;
  1561. menuActionRow++;
  1562. }
  1563. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1564. {
  1565. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1566. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1567. menuActionName[menuActionRow] = class9_1.tooltip + " @gre@(@whi@" + class9_1.id + "@gre@)";
  1568. } else {
  1569. menuActionName[menuActionRow] = class9_1.tooltip;
  1570. }
  1571. menuActionIds[menuActionRow] = 679;
  1572. menuActionCmd3[menuActionRow] = class9_1.id;
  1573. menuActionRow++;
  1574. }
  1575. if(class9_1.type == 2)
  1576. {
  1577. int k2 = 0;
  1578. for(int l2 = 0; l2 < class9_1.height; l2++)
  1579. {
  1580. for(int i3 = 0; i3 < class9_1.width; i3++)
  1581. {
  1582. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1583. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1584. if(k2 < 20)
  1585. {
  1586. j3 += class9_1.spritesX[k2];
  1587. k3 += class9_1.spritesY[k2];
  1588. }
  1589. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1590. {
  1591. mouseInvInterfaceIndex = k2;
  1592. lastActiveInvInterface = class9_1.id;
  1593. if(class9_1.inv[k2] > 0)
  1594. {
  1595. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1596. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1597. {
  1598. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1599. {
  1600.  
  1601. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1602. menuActionIds[menuActionRow] = 870;
  1603. menuActionCmd1[menuActionRow] = itemDef.id;
  1604. menuActionCmd2[menuActionRow] = k2;
  1605. menuActionCmd3[menuActionRow] = class9_1.id;
  1606. menuActionRow++;
  1607. }
  1608. } else
  1609. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1610. {
  1611. if((spellUsableOn & 0x10) == 16)
  1612. {
  1613. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1614. menuActionIds[menuActionRow] = 543;
  1615. menuActionCmd1[menuActionRow] = itemDef.id;
  1616. menuActionCmd2[menuActionRow] = k2;
  1617. menuActionCmd3[menuActionRow] = class9_1.id;
  1618. menuActionRow++;
  1619. }
  1620. } else
  1621. {
  1622. if(class9_1.isInventoryInterface)
  1623. {
  1624. for(int l3 = 4; l3 >= 3; l3--)
  1625. if(itemDef.itemActions != null && itemDef.itemActions[l3] != null)
  1626. {
  1627. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1628. if(l3 == 3)
  1629. menuActionIds[menuActionRow] = 493;
  1630. if(l3 == 4)
  1631. menuActionIds[menuActionRow] = 847;
  1632. menuActionCmd1[menuActionRow] = itemDef.id;
  1633. menuActionCmd2[menuActionRow] = k2;
  1634. menuActionCmd3[menuActionRow] = class9_1.id;
  1635. menuActionRow++;
  1636. } else
  1637. if(l3 == 4)
  1638. {
  1639. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1640. menuActionIds[menuActionRow] = 847;
  1641. menuActionCmd1[menuActionRow] = itemDef.id;
  1642. menuActionCmd2[menuActionRow] = k2;
  1643. menuActionCmd3[menuActionRow] = class9_1.id;
  1644. menuActionRow++;
  1645. }
  1646.  
  1647. }
  1648. if(class9_1.usableItemInterface)
  1649. {
  1650. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1651. menuActionIds[menuActionRow] = 447;
  1652. menuActionCmd1[menuActionRow] = itemDef.id;
  1653. //k2 = inventory spot
  1654. //System.out.println(k2);
  1655. menuActionCmd2[menuActionRow] = k2;
  1656. menuActionCmd3[menuActionRow] = class9_1.id;
  1657. menuActionRow++;
  1658. }
  1659. if(class9_1.isInventoryInterface && itemDef.itemActions != null)
  1660. {
  1661. for(int i4 = 2; i4 >= 0; i4--)
  1662. if(itemDef.itemActions[i4] != null)
  1663. {
  1664. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1665. if(i4 == 0)
  1666. menuActionIds[menuActionRow] = 74;
  1667. if(i4 == 1)
  1668. menuActionIds[menuActionRow] = 454;
  1669. if(i4 == 2)
  1670. menuActionIds[menuActionRow] = 539;
  1671. menuActionCmd1[menuActionRow] = itemDef.id;
  1672. menuActionCmd2[menuActionRow] = k2;
  1673. menuActionCmd3[menuActionRow] = class9_1.id;
  1674. menuActionRow++;
  1675. }
  1676.  
  1677. }
  1678. if (class9_1.actions != null) {
  1679. for (int j4 = 5; j4 >= 0; j4--)
  1680. if (class9_1.actions[j4] != null) {
  1681. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1682. if (j4 == 0)
  1683. menuActionIds[menuActionRow] = 632;
  1684. if (j4 == 1)
  1685. menuActionIds[menuActionRow] = 78;
  1686. if (j4 == 2)
  1687. menuActionIds[menuActionRow] = 867;
  1688. if (j4 == 3)
  1689. menuActionIds[menuActionRow] = 431;
  1690. if (j4 == 4)
  1691. menuActionIds[menuActionRow] = 53;
  1692. if (j4 == 5)
  1693. menuActionIds[menuActionRow] = 54;
  1694. menuActionCmd1[menuActionRow] = itemDef.id;
  1695. menuActionCmd2[menuActionRow] = k2;
  1696. menuActionCmd3[menuActionRow] = class9_1.id;
  1697. menuActionRow++;
  1698. }
  1699.  
  1700. }
  1701. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  1702. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1703. } else {
  1704. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1705. }
  1706. menuActionIds[menuActionRow] = 1125;
  1707. menuActionCmd1[menuActionRow] = itemDef.id;
  1708. menuActionCmd2[menuActionRow] = k2;
  1709. menuActionCmd3[menuActionRow] = class9_1.id;
  1710. menuActionRow++;
  1711. }
  1712. }
  1713. }
  1714. k2++;
  1715. }
  1716.  
  1717. }
  1718.  
  1719. }
  1720. }
  1721. }
  1722. }
  1723.  
  1724. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1725. scrollBar1.drawSprite(i1, l);
  1726. scrollBar2.drawSprite(i1, (l + j) - 16);
  1727. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1728. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1729. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1730. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1731. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1732. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1733. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1734. int k1 = ((j - 32) * j) / j1;
  1735. if (k1 < 8)
  1736. k1 = 8;
  1737. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1738. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1739. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1740. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1741. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1742. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1743. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1744. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1745. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1746. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1747. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1748. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1749. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1750. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1751. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1752. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1753. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1754. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1755. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1756. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1757. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1758. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1759. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1760. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1761. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1762. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1763. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1764. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1765. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1766. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1767. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1768. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1769. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1770. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1771. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1772. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1773. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1774. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1775. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1776. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1777. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1778. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1779. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1780. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1781. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1782. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1783. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1784. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1785. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1786. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1787. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1788. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1789. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1790. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1791. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1792. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1793. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1794. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1795. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1796. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1797. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1798. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1799. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1800. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1801. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1802. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1803. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1804. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1805. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1806. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1807. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1808. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1809. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1810. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1811. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1812. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1813. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1814. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1815. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1816. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1817. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1818. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1819. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1820. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1821. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1822. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1823. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1824. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1825. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1826. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1827. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1828. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1829. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1830. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1831. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1832. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1833. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1834. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1835. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1836. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1837. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1838. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1839. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1840. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1841. }
  1842.  
  1843. public void updateNPCs(Stream stream, int i) {
  1844. anInt839 = 0;
  1845. anInt893 = 0;
  1846. method139(stream);
  1847. method46(i, stream);
  1848. method86(stream);
  1849. for (int k = 0; k < anInt839; k++) {
  1850. int l = anIntArray840[k];
  1851. if (npcArray[l].anInt1537 != loopCycle) {
  1852. npcArray[l].desc = null;
  1853. npcArray[l] = null;
  1854. }
  1855. }
  1856.  
  1857. if (stream.currentOffset != i) {
  1858. SignLink.reporterror(myUsername
  1859. + " size mismatch in getnpcpos - pos:"
  1860. + stream.currentOffset + " psize:" + i);
  1861. throw new RuntimeException("eek");
  1862. }
  1863. for (int i1 = 0; i1 < npcCount; i1++)
  1864. if (npcArray[npcIndices[i1]] == null) {
  1865. SignLink.reporterror(myUsername
  1866. + " null entry in npc list - pos:" + i1 + " size:"
  1867. + npcCount);
  1868. throw new RuntimeException("eek");
  1869. }
  1870.  
  1871. }
  1872.  
  1873. public int cButtonHPos;
  1874. public int cButtonHCPos;
  1875. public int cButtonCPos;
  1876. public int previousSong;
  1877.  
  1878. private void processChatModeClick() {
  1879. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1880. cButtonHPos = 0;
  1881. aBoolean1233 = true;
  1882. inputTaken = true;
  1883. } else if (super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  1884. cButtonHPos = 1;
  1885. aBoolean1233 = true;
  1886. inputTaken = true;
  1887. } else if (super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  1888. cButtonHPos = 2;
  1889. aBoolean1233 = true;
  1890. inputTaken = true;
  1891. } else if (super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  1892. cButtonHPos = 3;
  1893. aBoolean1233 = true;
  1894. inputTaken = true;
  1895. } else if (super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  1896. cButtonHPos = 4;
  1897. aBoolean1233 = true;
  1898. inputTaken = true;
  1899. } else if (super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  1900. cButtonHPos = 5;
  1901. aBoolean1233 = true;
  1902. inputTaken = true;
  1903. } else if (super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  1904. cButtonHPos = 7;
  1905. aBoolean1233 = true;
  1906. inputTaken = true;
  1907. } else if (super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  1908. cButtonHPos = 6;
  1909. aBoolean1233 = true;
  1910. inputTaken = true;
  1911. } else {
  1912. cButtonHPos = -1;
  1913. aBoolean1233 = true;
  1914. inputTaken = true;
  1915. }
  1916. if (super.clickMode3 == 1) {
  1917. if (super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1918. cButtonCPos = 0;
  1919. chatTypeView = 0;
  1920. aBoolean1233 = true;
  1921. inputTaken = true;
  1922. } else if (super.saveClickX >= 62 && super.saveClickX <= 117 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1923. cButtonCPos = 1;
  1924. chatTypeView = 5;
  1925. aBoolean1233 = true;
  1926. inputTaken = true;
  1927. } else if (super.saveClickX >= 119 && super.saveClickX <= 174 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1928. cButtonCPos = 2;
  1929. chatTypeView = 1;
  1930. aBoolean1233 = true;
  1931. inputTaken = true;
  1932. } else if (super.saveClickX >= 176 && super.saveClickX <= 231 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1933. cButtonCPos = 3;
  1934. chatTypeView = 2;
  1935. aBoolean1233 = true;
  1936. inputTaken = true;
  1937. } else if (super.saveClickX >= 233 && super.saveClickX <= 288 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1938. cButtonCPos = 4;
  1939. chatTypeView = 11;
  1940. aBoolean1233 = true;
  1941. inputTaken = true;
  1942. } else if (super.saveClickX >= 290 && super.saveClickX <= 345 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1943. cButtonCPos = 5;
  1944. chatTypeView = 3;
  1945. aBoolean1233 = true;
  1946. inputTaken = true;
  1947. } else if (super.saveClickX >= 347 && super.saveClickX <= 402 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1948. cButtonCPos = 6;
  1949. aBoolean1233 = true;
  1950. inputTaken = true;
  1951. } else if (super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1952. if (openInterfaceID == -1) {
  1953. clearTopInterfaces();
  1954. reportAbuseInput = "";
  1955. canMute = false;
  1956. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1957. if (RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600) continue;
  1958. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1959. break;
  1960. }
  1961. } else {
  1962. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1963. }
  1964. }
  1965. }
  1966. }
  1967.  
  1968. public void method33(int i) {
  1969. int j = Varp.cache[i].anInt709;
  1970. if (j == 0)
  1971. return;
  1972. int k = variousSettings[i];
  1973. if (j == 1) {
  1974. if(k == 1)
  1975. Rasterizer.calculatePalette(0.9F);
  1976. if (k == 2)
  1977. Rasterizer.calculatePalette(0.8F);
  1978. if (k == 3)
  1979. Rasterizer.calculatePalette(0.7F);
  1980. if (k == 4)
  1981. Rasterizer.calculatePalette(0.6F);
  1982. ItemDef.mruNodes1.unlinkAll();
  1983. welcomeScreenRaised = true;
  1984. }
  1985. if (j == 3) {
  1986. boolean music = musicEnabled;
  1987. if (k == 0) {
  1988. adjustVolume(musicEnabled, 500);
  1989. musicEnabled = true;
  1990. }
  1991. if (k == 1) {
  1992. adjustVolume(musicEnabled, 300);
  1993. musicEnabled = true;
  1994. }
  1995. if (k == 2) {
  1996. adjustVolume(musicEnabled, 100);
  1997. musicEnabled = true;
  1998. }
  1999. if (k == 3) {
  2000. adjustVolume(musicEnabled, 0);
  2001. musicEnabled = true;
  2002. }
  2003. if (k == 4) {
  2004. musicEnabled = false;
  2005. }
  2006. if (musicEnabled != music) {
  2007. if (musicEnabled) {
  2008. nextSong = currentSong;
  2009. songChanging = true;
  2010. onDemandFetcher.method558(2, nextSong);
  2011. } else {
  2012. stopMidi();
  2013. }
  2014. previousSong = 0;
  2015. }
  2016. }
  2017. if (j == 4) {
  2018. SoundPlayer.setVolume(k);
  2019. if (k == 0) {
  2020. aBoolean848 = true;
  2021. setWaveVolume(0);
  2022. }
  2023. if (k == 1) {
  2024. aBoolean848 = true;
  2025. setWaveVolume(-400);
  2026. }
  2027. if (k == 2) {
  2028. aBoolean848 = true;
  2029. setWaveVolume(-800);
  2030. }
  2031. if (k == 3) {
  2032. aBoolean848 = true;
  2033. setWaveVolume(-1200);
  2034. }
  2035. if (k == 4) {
  2036. aBoolean848 = false;
  2037. }
  2038. }
  2039. if (j == 5)
  2040. anInt1253 = k;
  2041. if (j == 6)
  2042. anInt1249 = k;
  2043. if (j == 8) {
  2044. splitpublicChat = k;
  2045. inputTaken = true;
  2046. }
  2047. if (j == 9)
  2048. anInt913 = k;
  2049. }
  2050.  
  2051. public void updateEntities() {
  2052. try {
  2053. int anInt974 = 0;
  2054. for (int j = -1; j < playerCount + npcCount; j++) {
  2055. Object obj;
  2056. if (j == -1)
  2057. obj = myPlayer;
  2058. else if (j < playerCount)
  2059. obj = playerArray[playerIndices[j]];
  2060. else
  2061. obj = npcArray[npcIndices[j - playerCount]];
  2062. if (obj == null || !((Entity) (obj)).isVisible())
  2063. continue;
  2064. if (obj instanceof NPC) {
  2065. EntityDef entityDef = ((NPC) obj).desc;
  2066. if (entityDef.childrenIDs != null)
  2067. entityDef = entityDef.method161();
  2068. if (entityDef == null)
  2069. continue;
  2070. }
  2071. if (j < playerCount) {
  2072. int l = 30;
  2073. Player player = (Player) obj;
  2074. if (player.headIcon >= 0) {
  2075. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2076. if (spriteDrawX > -1) {
  2077. if (player.skullIcon < 2) {
  2078. skullIcons[player.skullIcon].drawSprite( spriteDrawX - 12, spriteDrawY - l);
  2079. l += 25;
  2080. }
  2081. if (player.headIcon < 18) {
  2082. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2083. l += 18;
  2084. }
  2085. }
  2086. }
  2087. if (j >= 0 && anInt855 == 10
  2088. && anInt933 == playerIndices[j]) {
  2089. npcScreenPos(((Entity) (obj)),
  2090. ((Entity) (obj)).height + 15);
  2091. if (spriteDrawX > -1)
  2092. headIconsHint[player.hintIcon].drawSprite(
  2093. spriteDrawX - 12, spriteDrawY - l);
  2094. }
  2095. } else {
  2096. EntityDef entityDef_1 = ((NPC) obj).desc;
  2097. if (entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2098. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2099. if (spriteDrawX > -1)
  2100. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2101. }
  2102. if (anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2103. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2104. if (spriteDrawX > -1)
  2105. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2106. }
  2107. }
  2108. if (((Entity) (obj)).textSpoken != null
  2109. && (j >= playerCount || publicChatMode == 0
  2110. || publicChatMode == 3 || publicChatMode == 1
  2111. && isFriendOrSelf(((Player) obj).name))) {
  2112. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2113. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2114. anIntArray979[anInt974] = chatTextDrawingArea
  2115. .method384(((Entity) (obj)).textSpoken) / 2;
  2116. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2117. anIntArray976[anInt974] = spriteDrawX;
  2118. anIntArray977[anInt974] = spriteDrawY;
  2119. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2120. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2121. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2122. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2123. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  2124. && ((Entity) (obj)).anInt1531 <= 3) {
  2125. anIntArray978[anInt974] += 10;
  2126. anIntArray977[anInt974] += 5;
  2127. }
  2128. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2129. anIntArray979[anInt974] = 60;
  2130. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2131. anIntArray978[anInt974] += 5;
  2132. }
  2133. }
  2134. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  2135. {
  2136. try{
  2137. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2138. if(spriteDrawX > -1)
  2139. {
  2140. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2141. if(i1 > 30)
  2142. i1 = 30;
  2143. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  2144. if (HpPercent > 56)
  2145. HpPercent = 56;
  2146. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  2147. HPBarFull = new Sprite(SignLink.findcachedir() + "Sprites/Player/HP 0.png", HpPercent, 7);
  2148. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  2149. }
  2150. }catch(Exception e){ }
  2151. }
  2152. for(int j1 = 0; j1 < 4; j1++)
  2153. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  2154. {
  2155. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2156. if(spriteDrawX > -1)
  2157. {
  2158. switch (j1) {
  2159. case 1:
  2160. spriteDrawY += 20;
  2161. break;
  2162. case 2:
  2163. spriteDrawY += 40;
  2164. break;
  2165. case 3:
  2166. spriteDrawY += 60;
  2167. break;
  2168. case 4:
  2169. spriteDrawY += 80;
  2170. break;
  2171. case 5:
  2172. spriteDrawY += 100;
  2173. break;
  2174. case 6:
  2175. spriteDrawY += 120;
  2176. break;
  2177. }
  2178. Entity e = ((Entity) (obj));
  2179. if (e.hitmarkMove[j1] > -30)
  2180. e.hitmarkMove[j1]--;
  2181. if (e.hitmarkMove[j1] < -26)
  2182. e.hitmarkTrans[j1] -= 5;
  2183. hitmarkDraw(String.valueOf(e.hitArray[j1]).length(), e.hitMarkTypes[j1], e.hitIcon[j1], e.hitArray[j1], e.hitmarkMove[j1], e.hitmarkTrans[j1]);
  2184. }
  2185. }
  2186. }
  2187. for (int k = 0; k < anInt974; k++) {
  2188. int k1 = anIntArray976[k];
  2189. int l1 = anIntArray977[k];
  2190. int j2 = anIntArray979[k];
  2191. int k2 = anIntArray978[k];
  2192. boolean flag = true;
  2193. while (flag) {
  2194. flag = false;
  2195. for (int l2 = 0; l2 < k; l2++)
  2196. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2]
  2197. && l1 - k2 < anIntArray977[l2] + 2
  2198. && k1 - j2 < anIntArray976[l2]
  2199. + anIntArray979[l2]
  2200. && k1 + j2 > anIntArray976[l2]
  2201. - anIntArray979[l2]
  2202. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  2203. l1 = anIntArray977[l2] - anIntArray978[l2];
  2204. flag = true;
  2205. }
  2206.  
  2207. }
  2208. spriteDrawX = anIntArray976[k];
  2209. spriteDrawY = anIntArray977[k] = l1;
  2210. String s = aStringArray983[k];
  2211. if (anInt1249 == 0) {
  2212. int i3 = 0xffff00;
  2213. if (anIntArray980[k] < 6)
  2214. i3 = anIntArray965[anIntArray980[k]];
  2215. if (anIntArray980[k] == 6)
  2216. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2217. if (anIntArray980[k] == 7)
  2218. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2219. if (anIntArray980[k] == 8)
  2220. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2221. if (anIntArray980[k] == 9) {
  2222. int j3 = 150 - anIntArray982[k];
  2223. if (j3 < 50)
  2224. i3 = 0xff0000 + 1280 * j3;
  2225. else if (j3 < 100)
  2226. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2227. else if (j3 < 150)
  2228. i3 = 65280 + 5 * (j3 - 100);
  2229. }
  2230. if (anIntArray980[k] == 10) {
  2231. int k3 = 150 - anIntArray982[k];
  2232. if (k3 < 50)
  2233. i3 = 0xff0000 + 5 * k3;
  2234. else if (k3 < 100)
  2235. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2236. else if (k3 < 150)
  2237. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2238. }
  2239. if (anIntArray980[k] == 11) {
  2240. int l3 = 150 - anIntArray982[k];
  2241. if (l3 < 50)
  2242. i3 = 0xffffff - 0x50005 * l3;
  2243. else if (l3 < 100)
  2244. i3 = 65280 + 0x50005 * (l3 - 50);
  2245. else if (l3 < 150)
  2246. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2247. }
  2248. if (anIntArray981[k] == 0) {
  2249. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2250. spriteDrawX);
  2251. chatTextDrawingArea.drawText(i3, s, spriteDrawY,
  2252. spriteDrawX);
  2253. }
  2254. if (anIntArray981[k] == 1) {
  2255. chatTextDrawingArea.method386(0, s, spriteDrawX,
  2256. anInt1265, spriteDrawY + 1);
  2257. chatTextDrawingArea.method386(i3, s, spriteDrawX,
  2258. anInt1265, spriteDrawY);
  2259. }
  2260. if (anIntArray981[k] == 2) {
  2261. chatTextDrawingArea.method387(spriteDrawX, s,
  2262. anInt1265, spriteDrawY + 1, 0);
  2263. chatTextDrawingArea.method387(spriteDrawX, s,
  2264. anInt1265, spriteDrawY, i3);
  2265. }
  2266. if (anIntArray981[k] == 3) {
  2267. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2268. s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2269. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2270. s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2271. }
  2272. if (anIntArray981[k] == 4) {
  2273. int i4 = chatTextDrawingArea.method384(s);
  2274. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2275. DrawingArea.setDrawingArea(334, spriteDrawX - 50,
  2276. spriteDrawX + 50, 0);
  2277. chatTextDrawingArea.method385(0, s, spriteDrawY + 1,
  2278. (spriteDrawX + 50) - k4);
  2279. chatTextDrawingArea.method385(i3, s, spriteDrawY,
  2280. (spriteDrawX + 50) - k4);
  2281. DrawingArea.defaultDrawingAreaSize();
  2282. }
  2283. if (anIntArray981[k] == 5) {
  2284. int j4 = 150 - anIntArray982[k];
  2285. int l4 = 0;
  2286. if (j4 < 25)
  2287. l4 = j4 - 25;
  2288. else if (j4 > 125)
  2289. l4 = j4 - 125;
  2290. DrawingArea
  2291. .setDrawingArea(spriteDrawY + 5, 0, 512,
  2292. spriteDrawY
  2293. - chatTextDrawingArea.anInt1497
  2294. - 1);
  2295. chatTextDrawingArea.drawText(0, s,
  2296. spriteDrawY + 1 + l4, spriteDrawX);
  2297. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4,
  2298. spriteDrawX);
  2299. DrawingArea.defaultDrawingAreaSize();
  2300. }
  2301. } else {
  2302. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2303. spriteDrawX);
  2304. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY,
  2305. spriteDrawX);
  2306. }
  2307. }
  2308. } catch (Exception e) {
  2309. }
  2310. }
  2311.  
  2312. public void delFriend(long l) {
  2313. try {
  2314. if (l == 0L)
  2315. return;
  2316. for (int i = 0; i < friendsCount; i++) {
  2317. if (friendsListAsLongs[i] != l)
  2318. continue;
  2319. friendsCount--;
  2320. needDrawTabArea = true;
  2321. for (int j = i; j < friendsCount; j++) {
  2322. friendsList[j] = friendsList[j + 1];
  2323. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2324. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2325. }
  2326.  
  2327. stream.createFrame(215);
  2328. stream.writeQWord(l);
  2329. break;
  2330. }
  2331. } catch (RuntimeException runtimeexception) {
  2332. SignLink.reporterror("18622, " + false + ", " + l + ", "
  2333. + runtimeexception.toString());
  2334. throw new RuntimeException();
  2335. }
  2336. }
  2337.  
  2338. public void drawSideIcons(){
  2339. /* Top sideIcons */
  2340. if(tabInterfaceIDs[0] != -1)//attack
  2341. sideIcons[0].drawSprite(10, 4);
  2342. if(tabInterfaceIDs[1] != -1)//stat
  2343. sideIcons[1].drawSprite(43, 4);
  2344. if(tabInterfaceIDs[2] != -1)//quest
  2345. //sideIcons[2].drawSprite(76, 3);
  2346. customSideIcons[2].drawSprite(82, 8);
  2347. if(tabInterfaceIDs[3] != -1)//inventory
  2348. sideIcons[3].drawSprite(111, 5);
  2349. if(tabInterfaceIDs[4] != -1)//equipment
  2350. sideIcons[4].drawSprite(140, 1);
  2351. if(tabInterfaceIDs[5] != -1)//prayer
  2352. sideIcons[5].drawSprite(174, 1);
  2353. if(tabInterfaceIDs[6] != -1)//magic
  2354. sideIcons[6].drawSprite(208, 4);
  2355. /* Bottom sideIcons */
  2356. if(tabInterfaceIDs[7] != -1)//clan
  2357. sideIcons[7].drawSprite(113, 302);
  2358. if(tabInterfaceIDs[8] != -1)//friends
  2359. sideIcons[8].drawSprite(46, 306);
  2360. if(tabInterfaceIDs[9] != -1)//ignore
  2361. sideIcons[9].drawSprite(79, 306);
  2362. if(tabInterfaceIDs[10] != -1)//logout
  2363. sideIcons[7].drawSprite(113, 302);
  2364. if(tabInterfaceIDs[11] != -1)//options
  2365. sideIcons[11].drawSprite(145, 304);
  2366. if(tabInterfaceIDs[12] != -1)//emotes
  2367. sideIcons[12].drawSprite(181, 302);
  2368. if(tabInterfaceIDs[13] != -1)//music
  2369. customSideIcons[1].drawAdvancedSprite(212, 302);
  2370. if(tabInterfaceIDs[14] != -1)//party tab
  2371. customSideIcons[0].drawAdvancedSprite(10, 306);
  2372. }
  2373.  
  2374. public void drawRedStones() {
  2375. if (tabInterfaceIDs[tabID] != -1) {
  2376. switch (tabID) {
  2377. case 0:
  2378. redStones[0].drawSprite(3, 0);
  2379. break;
  2380. case 1:
  2381. redStones[4].drawSprite(41, 0);
  2382. break;
  2383. case 2:
  2384. redStones[4].drawSprite(74, 0);
  2385. break;
  2386. case 3:
  2387. redStones[4].drawSprite(107, 0);
  2388. break;
  2389. case 4:
  2390. redStones[4].drawSprite(140, 0);
  2391. break;
  2392. case 5:
  2393. redStones[4].drawSprite(173, 0);
  2394. break;
  2395. case 6:
  2396. redStones[1].drawSprite(206, 0);
  2397. break;
  2398. case 7:
  2399. redStones[4].drawSprite(107, 298);
  2400. break;
  2401. case 8:
  2402. redStones[4].drawSprite(41, 298);
  2403. break;
  2404. case 9:
  2405. redStones[4].drawSprite(74, 298);
  2406. break;
  2407. case 11:
  2408. redStones[4].drawSprite(140, 298);
  2409. break;
  2410. case 12:
  2411. redStones[4].drawSprite(173, 298);
  2412. break;
  2413. case 13:
  2414. redStones[3].drawSprite(206, 298);
  2415. break;
  2416. case 14:
  2417. redStones[2].drawSprite(3, 298);
  2418. break;
  2419. }
  2420. }
  2421. }
  2422.  
  2423. public void drawTabArea() {
  2424. aRSImageProducer_1163.initDrawingArea();
  2425. Rasterizer.lineOffsets = anIntArray1181;
  2426. tabArea.drawSprite(0, 0);
  2427. if (invOverlayInterfaceID == -1) {
  2428. drawRedStones();
  2429. drawSideIcons();
  2430. }
  2431. if (invOverlayInterfaceID != -1)
  2432. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2433. else if (tabInterfaceIDs[tabID] != -1)
  2434. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2435. if (menuOpen && menuScreenArea == 1)
  2436. drawMenu();
  2437. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2438. aRSImageProducer_1165.initDrawingArea();
  2439. Rasterizer.lineOffsets = anIntArray1182;
  2440. }
  2441.  
  2442. public void method38() {
  2443. for (int i = -1; i < playerCount; i++) {
  2444. int j;
  2445. if (i == -1)
  2446. j = myPlayerIndex;
  2447. else
  2448. j = playerIndices[i];
  2449. Player player = playerArray[j];
  2450. if (player != null && player.textCycle > 0) {
  2451. player.textCycle--;
  2452. if (player.textCycle == 0)
  2453. player.textSpoken = null;
  2454. }
  2455. }
  2456. for (int k = 0; k < npcCount; k++) {
  2457. int l = npcIndices[k];
  2458. NPC npc = npcArray[l];
  2459. if (npc != null && npc.textCycle > 0) {
  2460. npc.textCycle--;
  2461. if (npc.textCycle == 0)
  2462. npc.textSpoken = null;
  2463. }
  2464. }
  2465. }
  2466.  
  2467. public void calcCameraPos() {
  2468. int i = anInt1098 * 128 + 64;
  2469. int j = anInt1099 * 128 + 64;
  2470. int k = method42(plane, j, i) - anInt1100;
  2471. if (xCameraPos < i) {
  2472. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2473. if (xCameraPos > i)
  2474. xCameraPos = i;
  2475. }
  2476. if (xCameraPos > i) {
  2477. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2478. if (xCameraPos < i)
  2479. xCameraPos = i;
  2480. }
  2481. if (zCameraPos < k) {
  2482. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2483. if (zCameraPos > k)
  2484. zCameraPos = k;
  2485. }
  2486. if (zCameraPos > k) {
  2487. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2488. if (zCameraPos < k)
  2489. zCameraPos = k;
  2490. }
  2491. if (yCameraPos < j) {
  2492. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2493. if (yCameraPos > j)
  2494. yCameraPos = j;
  2495. }
  2496. if (yCameraPos > j) {
  2497. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2498. if (yCameraPos < j)
  2499. yCameraPos = j;
  2500. }
  2501. i = anInt995 * 128 + 64;
  2502. j = anInt996 * 128 + 64;
  2503. k = method42(plane, j, i) - anInt997;
  2504. int l = i - xCameraPos;
  2505. int i1 = k - zCameraPos;
  2506. int j1 = j - yCameraPos;
  2507. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2508. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2509. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2510. if (l1 < 128)
  2511. l1 = 128;
  2512. if (l1 > 383)
  2513. l1 = 383;
  2514. if (yCameraCurve < l1) {
  2515. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2516. if (yCameraCurve > l1)
  2517. yCameraCurve = l1;
  2518. }
  2519. if (yCameraCurve > l1) {
  2520. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2521. if (yCameraCurve < l1)
  2522. yCameraCurve = l1;
  2523. }
  2524. int j2 = i2 - xCameraCurve;
  2525. if (j2 > 1024)
  2526. j2 -= 2048;
  2527. if (j2 < -1024)
  2528. j2 += 2048;
  2529. if (j2 > 0) {
  2530. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2531. xCameraCurve &= 0x7ff;
  2532. }
  2533. if (j2 < 0) {
  2534. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2535. xCameraCurve &= 0x7ff;
  2536. }
  2537. int k2 = i2 - xCameraCurve;
  2538. if (k2 > 1024)
  2539. k2 -= 2048;
  2540. if (k2 < -1024)
  2541. k2 += 2048;
  2542. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2543. xCameraCurve = i2;
  2544. }
  2545.  
  2546. public void drawMenu() {
  2547. int i = menuOffsetX;
  2548. int j = menuOffsetY;
  2549. int k = (int) (menuWidth - (menuWidth * 0.14));
  2550. int l = menuHeight + 1;
  2551. int i1 = 0x112329;
  2552. DrawingArea.method338(j + 2, l - 4, 256, 0x706a5e, k, i);
  2553. DrawingArea.method338(j + 1, l - 2, 256, 0x706a5e, k - 2, i + 1);
  2554. DrawingArea.method338(j, l, 200, 0x706a5e, k - 4, i + 2);
  2555. // Outer Border
  2556. DrawingArea.method338(j + 1, l - 2, 256, 0xffffff, k - 6, i + 3);// 0x2d2822
  2557. DrawingArea.method338(j + 2, l - 4, 256, 0xffffff, k - 4, i + 2);// 0x2d2822
  2558. DrawingArea.method338(j + 3, l - 6, 256, 0xffffff, k - 2, i + 1);// 0x2d2822
  2559. // Menu Fill Side Border
  2560. DrawingArea.method338(j + 19, l - 22, 256, 0x524a3d, k - 4, i + 2);
  2561. DrawingArea.method338(j + 20, l - 22, 256, 0x524a3d, k - 6, i + 3);
  2562. // Menu Fill
  2563. DrawingArea.method335(i1, j + 20, k - 6, l - 23, 240, i + 3);
  2564. // Menu Header
  2565. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x2a291b, j + 2);
  2566. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a261b, j + 3);
  2567. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x252116, j + 4);
  2568. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x211e15, j + 5);
  2569. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1e1b12, j + 6);
  2570. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1a170e, j + 7);
  2571. DrawingArea.fillPixels(i + 2, k - 4, 2, 0x15120b, j + 8);
  2572. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x100d08, j + 10);
  2573. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 11);
  2574. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x080703, j + 12);
  2575. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 13);
  2576. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 14);
  2577. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 15);
  2578. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 16);
  2579. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 17);
  2580. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a291b, j + 18);
  2581. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x564943, j + 19);
  2582. aTextDrawingArea_1271.method385(0xc6b895, "Choose Option", j + 14, i + 3);
  2583. int j1 = super.mouseX;
  2584. int k1 = super.mouseY;
  2585.  
  2586. if (menuScreenArea == 0) {
  2587. j1 -= 4;
  2588. k1 -= 4;
  2589. }
  2590. if (menuScreenArea == 1) {
  2591. j1 -= 519;
  2592. k1 -= 168;
  2593. }
  2594. if (menuScreenArea == 2) {
  2595. j1 -= 17;
  2596. k1 -= 338;
  2597. }
  2598. if (menuScreenArea == 3) {
  2599. j1 -= 515;
  2600. k1 -= 0;
  2601. }
  2602. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2603. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2604. int textY = j + 31 + (menuActionRow - 1 - l1) * 15;
  2605. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2606. DrawingArea.drawRect(15, textY - 11, i + 3, 0x26566C, k - 6);
  2607. aTextDrawingArea_1271.method389(true, i + 3, 0xA79E83, menuActionName[l1], textY);
  2608. }
  2609. }
  2610.  
  2611. public void addFriend(long l) {
  2612. try {
  2613. if (l == 0L)
  2614. return;
  2615. if (friendsCount >= 100 && anInt1046 != 1) {
  2616. pushMessage(
  2617. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2618. 0, "");
  2619. return;
  2620. }
  2621. if (friendsCount >= 200) {
  2622. pushMessage(
  2623. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  2624. 0, "");
  2625. return;
  2626. }
  2627. String s = TextClass.fixName(TextClass.nameForLong(l));
  2628. for (int i = 0; i < friendsCount; i++)
  2629. if (friendsListAsLongs[i] == l) {
  2630. pushMessage(s + " is already on your friend list", 0, "");
  2631. return;
  2632. }
  2633. for (int j = 0; j < ignoreCount; j++)
  2634. if (ignoreListAsLongs[j] == l) {
  2635. pushMessage("Please remove " + s
  2636. + " from your ignore list first", 0, "");
  2637. return;
  2638. }
  2639.  
  2640. if (s.equals(myPlayer.name)) {
  2641. return;
  2642. } else {
  2643. friendsList[friendsCount] = s;
  2644. friendsListAsLongs[friendsCount] = l;
  2645. friendsNodeIDs[friendsCount] = 0;
  2646. friendsCount++;
  2647. needDrawTabArea = true;
  2648. stream.createFrame(188);
  2649. stream.writeQWord(l);
  2650. return;
  2651. }
  2652. } catch (RuntimeException runtimeexception) {
  2653. SignLink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  2654. + runtimeexception.toString());
  2655. }
  2656. throw new RuntimeException();
  2657. }
  2658.  
  2659. public int method42(int i, int j, int k) {
  2660. int l = k >> 7;
  2661. int i1 = j >> 7;
  2662. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2663. return 0;
  2664. int j1 = i;
  2665. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2666. j1++;
  2667. int k1 = k & 0x7f;
  2668. int l1 = j & 0x7f;
  2669. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  2670. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2671. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  2672. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2673. return i2 * (128 - l1) + j2 * l1 >> 7;
  2674. }
  2675.  
  2676. public void resetLogout() {
  2677. try {
  2678. if (socketStream != null)
  2679. socketStream.close();
  2680. } catch (Exception _ex) {
  2681. }
  2682. socketStream = null;
  2683. loggedIn = false;
  2684. loginScreenState = 0;
  2685. // myUsername = "";
  2686. // myPassword = "";
  2687. unlinkMRUNodes();
  2688. worldController.initToNull();
  2689. for (int i = 0; i < 4; i++)
  2690. aClass11Array1230[i].method210();
  2691. System.gc();
  2692. stopMidi();
  2693. currentSong = -1;
  2694. nextSong = -1;
  2695. prevSong = 0;
  2696. }
  2697.  
  2698. public void method45() {
  2699. aBoolean1031 = true;
  2700. for (int j = 0; j < 7; j++) {
  2701. anIntArray1065[j] = -1;
  2702. for (int k = 0; k < IDK.length; k++) {
  2703. if (IDK.cache[k].aBoolean662
  2704. || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2705. continue;
  2706. anIntArray1065[j] = k;
  2707. break;
  2708. }
  2709. }
  2710. }
  2711.  
  2712. public void method46(int i, Stream stream) {
  2713. while (stream.bitPosition + 21 < i * 8) {
  2714. int k = stream.readBits(14);
  2715. if (k == 16383)
  2716. break;
  2717. if (npcArray[k] == null)
  2718. npcArray[k] = new NPC();
  2719. NPC npc = npcArray[k];
  2720. npcIndices[npcCount++] = k;
  2721. npc.anInt1537 = loopCycle;
  2722. int l = stream.readBits(5);
  2723. if (l > 15)
  2724. l -= 32;
  2725. int i1 = stream.readBits(5);
  2726. if (i1 > 15)
  2727. i1 -= 32;
  2728. int j1 = stream.readBits(1);
  2729. npc.desc = EntityDef.forID(stream.readBits(16));
  2730. int k1 = stream.readBits(1);
  2731. if (k1 == 1)
  2732. anIntArray894[anInt893++] = k;
  2733. npc.anInt1540 = npc.desc.aByte68;
  2734. npc.anInt1504 = npc.desc.anInt79;
  2735. npc.anInt1554 = npc.desc.walkAnim;
  2736. npc.anInt1555 = npc.desc.anInt58;
  2737. npc.anInt1556 = npc.desc.anInt83;
  2738. npc.anInt1557 = npc.desc.anInt55;
  2739. npc.anInt1511 = npc.desc.standAnim;
  2740. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2741. }
  2742. stream.finishBitAccess();
  2743. }
  2744.  
  2745. public void processGameLoop() {
  2746. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2747. return;
  2748. loopCycle++;
  2749. if (!loggedIn)
  2750. processLoginScreenInput();
  2751. else
  2752. mainGameProcessor();
  2753. processOnDemandQueue();
  2754. }
  2755.  
  2756. public void method47(boolean flag) {
  2757. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2758. destX = 0;
  2759. int j = playerCount;
  2760. if (flag)
  2761. j = 1;
  2762. for (int l = 0; l < j; l++) {
  2763. Player player;
  2764. int i1;
  2765. if (flag) {
  2766. player = myPlayer;
  2767. i1 = myPlayerIndex << 14;
  2768. } else {
  2769. player = playerArray[playerIndices[l]];
  2770. i1 = playerIndices[l] << 14;
  2771. }
  2772. if (player == null || !player.isVisible())
  2773. continue;
  2774. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  2775. && !flag && player.anInt1517 == player.anInt1511;
  2776. int j1 = player.x >> 7;
  2777. int k1 = player.y >> 7;
  2778. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2779. continue;
  2780. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  2781. && loopCycle < player.anInt1708) {
  2782. player.aBoolean1699 = false;
  2783. player.anInt1709 = method42(plane, player.y, player.x);
  2784. worldController.method286(plane, player.y, player,
  2785. player.anInt1552, player.anInt1722, player.x,
  2786. player.anInt1709, player.anInt1719, player.anInt1721,
  2787. i1, player.anInt1720);
  2788. continue;
  2789. }
  2790. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2791. if (anIntArrayArray929[j1][k1] == anInt1265)
  2792. continue;
  2793. anIntArrayArray929[j1][k1] = anInt1265;
  2794. }
  2795. player.anInt1709 = method42(plane, player.y, player.x);
  2796. worldController.method285(plane, player.anInt1552,
  2797. player.anInt1709, i1, player.y, 60, player.x, player,
  2798. player.aBoolean1541);
  2799. }
  2800. }
  2801.  
  2802. public boolean promptUserForInput(RSInterface class9) {
  2803. int j = class9.contentType;
  2804. if (anInt900 == 2) {
  2805. if (j == 201) {
  2806. inputTaken = true;
  2807. inputDialogState = 0;
  2808. messagePromptRaised = true;
  2809. promptInput = "";
  2810. friendsListAction = 1;
  2811. aString1121 = "Enter name of friend to add to list";
  2812. }
  2813. if (j == 202) {
  2814. inputTaken = true;
  2815. inputDialogState = 0;
  2816. messagePromptRaised = true;
  2817. promptInput = "";
  2818. friendsListAction = 2;
  2819. aString1121 = "Enter name of friend to delete from list";
  2820. }
  2821. }
  2822. if (j == 205) {
  2823. anInt1011 = 250;
  2824. return true;
  2825. }
  2826. if (j == 501) {
  2827. inputTaken = true;
  2828. inputDialogState = 0;
  2829. messagePromptRaised = true;
  2830. promptInput = "";
  2831. friendsListAction = 4;
  2832. aString1121 = "Enter name of player to add to list";
  2833. }
  2834. if (j == 502) {
  2835. inputTaken = true;
  2836. inputDialogState = 0;
  2837. messagePromptRaised = true;
  2838. promptInput = "";
  2839. friendsListAction = 5;
  2840. aString1121 = "Enter name of player to delete from list";
  2841. }
  2842. if (j == 550) {
  2843. inputTaken = true;
  2844. inputDialogState = 0;
  2845. messagePromptRaised = true;
  2846. promptInput = "";
  2847. friendsListAction = 6;
  2848. aString1121 = "Enter the name of the chat you wish to join";
  2849. }
  2850. if (j >= 300 && j <= 313) {
  2851. int k = (j - 300) / 2;
  2852. int j1 = j & 1;
  2853. int i2 = anIntArray1065[k];
  2854. if (i2 != -1) {
  2855. do {
  2856. if (j1 == 0 && --i2 < 0)
  2857. i2 = IDK.length - 1;
  2858. if (j1 == 1 && ++i2 >= IDK.length)
  2859. i2 = 0;
  2860. } while (IDK.cache[i2].aBoolean662
  2861. || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2862. anIntArray1065[k] = i2;
  2863. aBoolean1031 = true;
  2864. }
  2865. }
  2866. if (j >= 314 && j <= 323) {
  2867. int l = (j - 314) / 2;
  2868. int k1 = j & 1;
  2869. int j2 = anIntArray990[l];
  2870. if (k1 == 0 && --j2 < 0)
  2871. j2 = anIntArrayArray1003[l].length - 1;
  2872. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2873. j2 = 0;
  2874. anIntArray990[l] = j2;
  2875. aBoolean1031 = true;
  2876. }
  2877. if (j == 324 && !aBoolean1047) {
  2878. aBoolean1047 = true;
  2879. method45();
  2880. }
  2881. if (j == 325 && aBoolean1047) {
  2882. aBoolean1047 = false;
  2883. method45();
  2884. }
  2885. if (j == 326) {
  2886. stream.createFrame(101);
  2887. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2888. for (int i1 = 0; i1 < 7; i1++)
  2889. stream.writeWordBigEndian(anIntArray1065[i1]);
  2890.  
  2891. for (int l1 = 0; l1 < 5; l1++)
  2892. stream.writeWordBigEndian(anIntArray990[l1]);
  2893.  
  2894. return true;
  2895. }
  2896. if (j == 613)
  2897. canMute = !canMute;
  2898. if (j >= 601 && j <= 612) {
  2899. clearTopInterfaces();
  2900. if (reportAbuseInput.length() > 0) {
  2901. stream.createFrame(218);
  2902. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2903. stream.writeWordBigEndian(j - 601);
  2904. stream.writeWordBigEndian(canMute ? 1 : 0);
  2905. }
  2906. }
  2907. return false;
  2908. }
  2909.  
  2910. public void method49(Stream stream) {
  2911. for (int j = 0; j < anInt893; j++) {
  2912. int k = anIntArray894[j];
  2913. Player player = playerArray[k];
  2914. int l = stream.readUnsignedByte();
  2915. if ((l & 0x40) != 0)
  2916. l += stream.readUnsignedByte() << 8;
  2917. method107(l, k, stream, player);
  2918. }
  2919. }
  2920.  
  2921. public void method50(int i, int k, int l, int i1, int j1) {
  2922. int k1 = worldController.method300(j1, l, i);
  2923. if (k1 != 0) {
  2924. int l1 = worldController.method304(j1, l, i, k1);
  2925. int k2 = l1 >> 6 & 3;
  2926. int i3 = l1 & 0x1f;
  2927. int k3 = k;
  2928. if (k1 > 0)
  2929. k3 = i1;
  2930. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2931. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2932. int i5 = k1 >> 14 & 0x7fff;
  2933. ObjectDef class46_2 = ObjectDef.forID(i5);
  2934. if (class46_2.anInt758 != -1) {
  2935. Background background_2 = mapScenes[class46_2.anInt758];
  2936. if (background_2 != null) {
  2937. int i6 = (class46_2.sizeX * 4 - background_2.anInt1452) / 2;
  2938. int j6 = (class46_2.sizeY * 4 - background_2.anInt1453) / 2;
  2939. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.sizeY) * 4 + j6);
  2940. }
  2941. } else {
  2942. if (i3 == 0 || i3 == 2)
  2943. if (k2 == 0) {
  2944. ai[k4] = k3;
  2945. ai[k4 + 512] = k3;
  2946. ai[k4 + 1024] = k3;
  2947. ai[k4 + 1536] = k3;
  2948. } else if (k2 == 1) {
  2949. ai[k4] = k3;
  2950. ai[k4 + 1] = k3;
  2951. ai[k4 + 2] = k3;
  2952. ai[k4 + 3] = k3;
  2953. } else if (k2 == 2) {
  2954. ai[k4 + 3] = k3;
  2955. ai[k4 + 3 + 512] = k3;
  2956. ai[k4 + 3 + 1024] = k3;
  2957. ai[k4 + 3 + 1536] = k3;
  2958. } else if (k2 == 3) {
  2959. ai[k4 + 1536] = k3;
  2960. ai[k4 + 1536 + 1] = k3;
  2961. ai[k4 + 1536 + 2] = k3;
  2962. ai[k4 + 1536 + 3] = k3;
  2963. }
  2964. if (i3 == 3)
  2965. if (k2 == 0)
  2966. ai[k4] = k3;
  2967. else if (k2 == 1)
  2968. ai[k4 + 3] = k3;
  2969. else if (k2 == 2)
  2970. ai[k4 + 3 + 1536] = k3;
  2971. else if (k2 == 3)
  2972. ai[k4 + 1536] = k3;
  2973. if (i3 == 2)
  2974. if (k2 == 3) {
  2975. ai[k4] = k3;
  2976. ai[k4 + 512] = k3;
  2977. ai[k4 + 1024] = k3;
  2978. ai[k4 + 1536] = k3;
  2979. } else if (k2 == 0) {
  2980. ai[k4] = k3;
  2981. ai[k4 + 1] = k3;
  2982. ai[k4 + 2] = k3;
  2983. ai[k4 + 3] = k3;
  2984. } else if (k2 == 1) {
  2985. ai[k4 + 3] = k3;
  2986. ai[k4 + 3 + 512] = k3;
  2987. ai[k4 + 3 + 1024] = k3;
  2988. ai[k4 + 3 + 1536] = k3;
  2989. } else if (k2 == 2) {
  2990. ai[k4 + 1536] = k3;
  2991. ai[k4 + 1536 + 1] = k3;
  2992. ai[k4 + 1536 + 2] = k3;
  2993. ai[k4 + 1536 + 3] = k3;
  2994. }
  2995. }
  2996. }
  2997. k1 = worldController.method302(j1, l, i);
  2998. if (k1 != 0) {
  2999. int i2 = worldController.method304(j1, l, i, k1);
  3000. int l2 = i2 >> 6 & 3;
  3001. int j3 = i2 & 0x1f;
  3002. int l3 = k1 >> 14 & 0x7fff;
  3003. ObjectDef class46_1 = ObjectDef.forID(l3);
  3004. if (class46_1.anInt758 != -1) {
  3005. Background background_1 = mapScenes[class46_1.anInt758];
  3006. if (background_1 != null) {
  3007. int j5 = (class46_1.sizeX * 4 - background_1.anInt1452) / 2;
  3008. int k5 = (class46_1.sizeY * 4 - background_1.anInt1453) / 2;
  3009. background_1.drawBackground(48 + l * 4 + j5, 48
  3010. + (104 - i - class46_1.sizeY) * 4 + k5);
  3011. }
  3012. } else if (j3 == 9) {
  3013. int l4 = 0xeeeeee;
  3014. if (k1 > 0)
  3015. l4 = 0xee0000;
  3016. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3017. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3018. if (l2 == 0 || l2 == 2) {
  3019. ai1[l5 + 1536] = l4;
  3020. ai1[l5 + 1024 + 1] = l4;
  3021. ai1[l5 + 512 + 2] = l4;
  3022. ai1[l5 + 3] = l4;
  3023. } else {
  3024. ai1[l5] = l4;
  3025. ai1[l5 + 512 + 1] = l4;
  3026. ai1[l5 + 1024 + 2] = l4;
  3027. ai1[l5 + 1536 + 3] = l4;
  3028. }
  3029. }
  3030. }
  3031. k1 = worldController.method303(j1, l, i);
  3032. if (k1 != 0) {
  3033. int j2 = k1 >> 14 & 0x7fff;
  3034. ObjectDef class46 = ObjectDef.forID(j2);
  3035. if (class46.anInt758 != -1) {
  3036. Background background = mapScenes[class46.anInt758];
  3037. if (background != null) {
  3038. int i4 = (class46.sizeX * 4 - background.anInt1452) / 2;
  3039. int j4 = (class46.sizeY * 4 - background.anInt1453) / 2;
  3040. background.drawBackground(48 + l * 4 + i4, 48
  3041. + (104 - i - class46.sizeY) * 4 + j4);
  3042. }
  3043. }
  3044. }
  3045. }
  3046.  
  3047. public void loadTitleScreen() {
  3048.  
  3049. aBackgroundArray1152s = new Background[12];
  3050. int j = 0;
  3051. try {
  3052. j = Integer.parseInt(getParameter("fl_icon"));
  3053. } catch (Exception _ex) {
  3054. }
  3055. if (j == 0) {
  3056. for (int k = 0; k < 12; k++)
  3057. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3058. "runes", k);
  3059.  
  3060. } else {
  3061. for (int l = 0; l < 12; l++)
  3062. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3063. "runes", 12 + (l & 3));
  3064.  
  3065. }
  3066. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3067. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3068. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0,
  3069. aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3070.  
  3071. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0,
  3072. aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3073.  
  3074. anIntArray851 = new int[256];
  3075. for (int k1 = 0; k1 < 64; k1++)
  3076. anIntArray851[k1] = k1 * 0x40000;
  3077.  
  3078. for (int l1 = 0; l1 < 64; l1++)
  3079. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3080.  
  3081. for (int i2 = 0; i2 < 64; i2++)
  3082. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3083.  
  3084. for (int j2 = 0; j2 < 64; j2++)
  3085. anIntArray851[j2 + 192] = 0xffffff;
  3086.  
  3087. anIntArray852 = new int[256];
  3088. for (int k2 = 0; k2 < 64; k2++)
  3089. anIntArray852[k2] = k2 * 1024;
  3090.  
  3091. for (int l2 = 0; l2 < 64; l2++)
  3092. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3093.  
  3094. for (int i3 = 0; i3 < 64; i3++)
  3095. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3096.  
  3097. for (int j3 = 0; j3 < 64; j3++)
  3098. anIntArray852[j3 + 192] = 0xffffff;
  3099.  
  3100. anIntArray853 = new int[256];
  3101. for (int k3 = 0; k3 < 64; k3++)
  3102. anIntArray853[k3] = k3 * 4;
  3103.  
  3104. for (int l3 = 0; l3 < 64; l3++)
  3105. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3106.  
  3107. for (int i4 = 0; i4 < 64; i4++)
  3108. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3109.  
  3110. for (int j4 = 0; j4 < 64; j4++)
  3111. anIntArray853[j4 + 192] = 0xffffff;
  3112.  
  3113. anIntArray850 = new int[256];
  3114. anIntArray1190 = new int[32768];
  3115. anIntArray1191 = new int[32768];
  3116. randomizeBackground(null);
  3117. anIntArray828 = new int[32768];
  3118. anIntArray829 = new int[32768];
  3119. drawNewLoadingText(75, "Connecting to fileserver");
  3120. if (!aBoolean831) {
  3121. drawFlames = true;
  3122. aBoolean831 = true;
  3123. startRunnable(this, 2);
  3124. }
  3125. }
  3126.  
  3127. public static void setHighMem() {
  3128. WorldController.lowMem = false;
  3129. Rasterizer.lowMem = false;
  3130. lowMem = false;
  3131. ObjectManager.lowMem = false;
  3132. ObjectDef.lowMem = false;
  3133. }
  3134.  
  3135. public static void main(String args[]) {
  3136. try {
  3137. nodeID = 10;
  3138. portOff = 0;
  3139. setHighMem();
  3140. isMembers = true;
  3141. SignLink.storeid = 32;
  3142. SignLink.startpriv(InetAddress.getLocalHost());
  3143. instance = new Jframe(args);
  3144. } catch (Exception exception) {
  3145. }
  3146. }
  3147.  
  3148. public static Client instance;
  3149.  
  3150. public void loadingStages() {
  3151. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3152. aRSImageProducer_1165.initDrawingArea();
  3153. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  3154. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  3155. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3156. loadingStage = 1;
  3157. aLong824 = System.currentTimeMillis();
  3158. }
  3159. if (loadingStage == 1) {
  3160. int j = method54();
  3161. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3162. SignLink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3163. aLong824 = System.currentTimeMillis();
  3164. }
  3165. }
  3166. if (loadingStage == 2)
  3167. method146();
  3168. if (loadingStage == 2 && plane != anInt985) {
  3169. anInt985 = plane;
  3170. method24(plane);
  3171.  
  3172. }
  3173. }
  3174.  
  3175. public int method54() {
  3176. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3177. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1) {
  3178. if (anIntArray1235[i] == 1510)// just a test
  3179. anIntArray1235[i] = -1;
  3180. return -1;// null map files
  3181. }
  3182. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1) {
  3183. if (anIntArray1236[i] == 1511)// just a test
  3184. anIntArray1236[i] = -1;
  3185. return -2;
  3186. }
  3187. }
  3188. boolean flag = true;
  3189. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3190. byte abyte0[] = aByteArrayArray1247[j];
  3191. if (abyte0 != null) {
  3192. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3193. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3194. if (aBoolean1159) {
  3195. k = 10;
  3196. l = 10;
  3197. }
  3198. flag &= ObjectManager.method189(k, abyte0, l);
  3199. }
  3200. }
  3201. if (!flag)
  3202. return -3;// couldn't parse all landscapes
  3203. if (aBoolean1080) {
  3204. return -4;
  3205. } else {
  3206. loadingStage = 2;
  3207. ObjectManager.anInt131 = plane;
  3208. method22();
  3209. stream.createFrame(121);
  3210. return 0;
  3211. }
  3212. }
  3213.  
  3214. public void method55() {
  3215. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3216. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3217. .reverseGetNext())
  3218. if (class30_sub2_sub4_sub4.anInt1597 != plane
  3219. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3220. class30_sub2_sub4_sub4.unlink();
  3221. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3222. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3223. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3224. if (npc != null && npc.x >= 0 && npc.x < 13312
  3225. && npc.y >= 0 && npc.y < 13312)
  3226. class30_sub2_sub4_sub4.method455(
  3227. loopCycle,
  3228. npc.y,
  3229. method42(class30_sub2_sub4_sub4.anInt1597,
  3230. npc.y, npc.x)
  3231. - class30_sub2_sub4_sub4.anInt1583,
  3232. npc.x);
  3233. }
  3234. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3235. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3236. Player player;
  3237. if (j == unknownInt10)
  3238. player = myPlayer;
  3239. else
  3240. player = playerArray[j];
  3241. if (player != null && player.x >= 0 && player.x < 13312
  3242. && player.y >= 0 && player.y < 13312)
  3243. class30_sub2_sub4_sub4.method455(
  3244. loopCycle,
  3245. player.y,
  3246. method42(class30_sub2_sub4_sub4.anInt1597,
  3247. player.y, player.x)
  3248. - class30_sub2_sub4_sub4.anInt1583,
  3249. player.x);
  3250. }
  3251. class30_sub2_sub4_sub4.method456(anInt945);
  3252. worldController.method285(plane,
  3253. class30_sub2_sub4_sub4.anInt1595,
  3254. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  3255. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  3256. (int) class30_sub2_sub4_sub4.aDouble1585,
  3257. class30_sub2_sub4_sub4, false);
  3258. }
  3259.  
  3260. }
  3261.  
  3262. public AppletContext getAppletContext() {
  3263. if (SignLink.mainapp != null)
  3264. return SignLink.mainapp.getAppletContext();
  3265. else
  3266. return super.getAppletContext();
  3267. }
  3268.  
  3269. public static String capitalize(String s) {
  3270. for (int i = 0; i < s.length(); i++) {
  3271. if (i == 0) {
  3272. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)),
  3273. s.substring(1));
  3274. }
  3275. if (!Character.isLetterOrDigit(s.charAt(i))) {
  3276. if (i + 1 < s.length()) {
  3277. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  3278. Character.toUpperCase(s.charAt(i + 1)),
  3279. s.substring(i + 2));
  3280. }
  3281. }
  3282. }
  3283. return s;
  3284. }
  3285.  
  3286. @SuppressWarnings("unused")
  3287. public void drawLogo() {
  3288. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3289. Sprite sprite = new Sprite(abyte0, this);
  3290. aRSImageProducer_1110.initDrawingArea();
  3291. sprite.method346(0, 0);
  3292. aRSImageProducer_1111.initDrawingArea();
  3293. sprite.method346(-637, 0);
  3294. aRSImageProducer_1107.initDrawingArea();
  3295. sprite.method346(-128, 0);
  3296. aRSImageProducer_1108.initDrawingArea();
  3297. sprite.method346(-202, -371);
  3298. aRSImageProducer_1109.initDrawingArea();
  3299. sprite.method346(0, 0);
  3300. aRSImageProducer_1112.initDrawingArea();
  3301. sprite.method346(0, -265);
  3302. aRSImageProducer_1113.initDrawingArea();
  3303. sprite.method346(-562, -265);
  3304. aRSImageProducer_1114.initDrawingArea();
  3305. sprite.method346(-128, -171);
  3306. aRSImageProducer_1115.initDrawingArea();
  3307. sprite.method346(-562, -171);
  3308. int ai[] = new int[sprite.myWidth];
  3309. for (int j = 0; j < sprite.myHeight; j++) {
  3310. for (int k = 0; k < sprite.myWidth; k++)
  3311. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3312. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3313. }
  3314. sprite = null;
  3315. Object obj = null;
  3316. Object obj1 = null;
  3317. System.gc();
  3318. }
  3319.  
  3320.  
  3321.  
  3322. public void processOnDemandQueue() {
  3323. do {
  3324. OnDemandData onDemandData;
  3325. do {
  3326. onDemandData = onDemandFetcher.getNextNode();
  3327. if (onDemandData == null)
  3328. return;
  3329. if (onDemandData.dataType == 0)
  3330. Model.method460(onDemandData.buffer, onDemandData.ID);
  3331. if (onDemandData.dataType == 1)
  3332. Class36.load(onDemandData.ID, onDemandData.buffer);
  3333. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong
  3334. && onDemandData.buffer != null)
  3335. saveMidi(songChanging, onDemandData.buffer);
  3336. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3337. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3338. if (anIntArray1235[i] == onDemandData.ID) {
  3339. aByteArrayArray1183[i] = onDemandData.buffer;
  3340. if (onDemandData.buffer == null)
  3341. anIntArray1235[i] = -1;
  3342. break;
  3343. }
  3344. if (anIntArray1236[i] != onDemandData.ID)
  3345. continue;
  3346. aByteArrayArray1247[i] = onDemandData.buffer;
  3347. if (onDemandData.buffer == null)
  3348. anIntArray1236[i] = -1;
  3349. break;
  3350. }
  3351.  
  3352. }
  3353. if (onDemandData.dataType == 4)
  3354. Texture.load(onDemandData.ID, onDemandData.buffer);
  3355. } while (onDemandData.dataType != 93
  3356. || !onDemandFetcher.method564(onDemandData.ID));
  3357. ObjectManager.method173(new Stream(onDemandData.buffer),
  3358. onDemandFetcher);
  3359. } while (true);
  3360. }
  3361.  
  3362.  
  3363. public void calcFlamesPosition() {
  3364. char c = '\u0100';
  3365. for (int j = 10; j < 117; j++) {
  3366. int k = (int) (Math.random() * 100D);
  3367. if (k < 50)
  3368. anIntArray828[j + (c - 2 << 7)] = 255;
  3369. }
  3370. for (int l = 0; l < 100; l++) {
  3371. int i1 = (int) (Math.random() * 124D) + 2;
  3372. int k1 = (int) (Math.random() * 128D) + 128;
  3373. int k2 = i1 + (k1 << 7);
  3374. anIntArray828[k2] = 192;
  3375. }
  3376.  
  3377. for (int j1 = 1; j1 < c - 1; j1++) {
  3378. for (int l1 = 1; l1 < 127; l1++) {
  3379. int l2 = l1 + (j1 << 7);
  3380. anIntArray829[l2] = (anIntArray828[l2 - 1]
  3381. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3382. }
  3383.  
  3384. }
  3385.  
  3386. anInt1275 += 128;
  3387. if (anInt1275 > anIntArray1190.length) {
  3388. anInt1275 -= anIntArray1190.length;
  3389. int i2 = (int) (Math.random() * 12D);
  3390. randomizeBackground(aBackgroundArray1152s[i2]);
  3391. }
  3392. for (int j2 = 1; j2 < c - 1; j2++) {
  3393. for (int i3 = 1; i3 < 127; i3++) {
  3394. int k3 = i3 + (j2 << 7);
  3395. int i4 = anIntArray829[k3 + 128]
  3396. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  3397. - 1] / 5;
  3398. if (i4 < 0)
  3399. i4 = 0;
  3400. anIntArray828[k3] = i4;
  3401. }
  3402.  
  3403. }
  3404.  
  3405. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3406.  
  3407. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D
  3408. + Math.sin((double) loopCycle / 15D) * 14D + Math
  3409. .sin((double) loopCycle / 16D) * 12D);
  3410. if (anInt1040 > 0)
  3411. anInt1040 -= 4;
  3412. if (anInt1041 > 0)
  3413. anInt1041 -= 4;
  3414. if (anInt1040 == 0 && anInt1041 == 0) {
  3415. int l3 = (int) (Math.random() * 2000D);
  3416. if (l3 == 0)
  3417. anInt1040 = 1024;
  3418. if (l3 == 1)
  3419. anInt1041 = 1024;
  3420. }
  3421. }
  3422.  
  3423. public boolean saveWave(byte abyte0[], int i) {
  3424. return abyte0 == null || SignLink.wavesave(abyte0, i);
  3425. }
  3426.  
  3427. public void method60(int i) {
  3428. RSInterface class9 = RSInterface.interfaceCache[i];
  3429. for (int j = 0; j < class9.children.length; j++) {
  3430. if (class9.children[j] == -1)
  3431. break;
  3432. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3433. if (class9_1.type == 1)
  3434. method60(class9_1.id);
  3435. class9_1.anInt246 = 0;
  3436. class9_1.anInt208 = 0;
  3437. }
  3438. }
  3439.  
  3440. public void drawHeadIcon() {
  3441. if (anInt855 != 2)
  3442. return;
  3443. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3444. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  3445. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3446. }
  3447.  
  3448. public void mainGameProcessor() {
  3449. if (anInt1104 > 1)
  3450. anInt1104--;
  3451. if (anInt1011 > 0)
  3452. anInt1011--;
  3453. for (int j = 0; j < 5; j++)
  3454. if (!parsePacket())
  3455. break;
  3456.  
  3457. if (!loggedIn)
  3458. return;
  3459. synchronized (mouseDetection.syncObject) {
  3460. if (flagged) {
  3461. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3462. stream.createFrame(45);
  3463. stream.writeWordBigEndian(0);
  3464. int j2 = stream.currentOffset;
  3465. int j3 = 0;
  3466. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3467. if (j2 - stream.currentOffset >= 240)
  3468. break;
  3469. j3++;
  3470. int l4 = mouseDetection.coordsY[j4];
  3471. if (l4 < 0)
  3472. l4 = 0;
  3473. else if (l4 > 502)
  3474. l4 = 502;
  3475. int k5 = mouseDetection.coordsX[j4];
  3476. if (k5 < 0)
  3477. k5 = 0;
  3478. else if (k5 > 764)
  3479. k5 = 764;
  3480. int i6 = l4 * 765 + k5;
  3481. if (mouseDetection.coordsY[j4] == -1
  3482. && mouseDetection.coordsX[j4] == -1) {
  3483. k5 = -1;
  3484. l4 = -1;
  3485. i6 = 0x7ffff;
  3486. }
  3487. if (k5 == anInt1237 && l4 == anInt1238) {
  3488. if (anInt1022 < 2047)
  3489. anInt1022++;
  3490. } else {
  3491. int j6 = k5 - anInt1237;
  3492. anInt1237 = k5;
  3493. int k6 = l4 - anInt1238;
  3494. anInt1238 = l4;
  3495. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31
  3496. && k6 >= -32 && k6 <= 31) {
  3497. j6 += 32;
  3498. k6 += 32;
  3499. stream.writeWord((anInt1022 << 12) + (j6 << 6)
  3500. + k6);
  3501. anInt1022 = 0;
  3502. } else if (anInt1022 < 8) {
  3503. stream.writeDWordBigEndian(0x800000
  3504. + (anInt1022 << 19) + i6);
  3505. anInt1022 = 0;
  3506. } else {
  3507. stream.writeDWord(0xc0000000
  3508. + (anInt1022 << 19) + i6);
  3509. anInt1022 = 0;
  3510. }
  3511. }
  3512. }
  3513.  
  3514. stream.writeBytes(stream.currentOffset - j2);
  3515. if (j3 >= mouseDetection.coordsIndex) {
  3516. mouseDetection.coordsIndex = 0;
  3517. } else {
  3518. mouseDetection.coordsIndex -= j3;
  3519. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3520. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5
  3521. + j3];
  3522. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5
  3523. + j3];
  3524. }
  3525.  
  3526. }
  3527. }
  3528. } else {
  3529. mouseDetection.coordsIndex = 0;
  3530. }
  3531. }
  3532. if (super.clickMode3 != 0) {
  3533. long l = (super.aLong29 - aLong1220) / 50L;
  3534. if (l > 4095L)
  3535. l = 4095L;
  3536. aLong1220 = super.aLong29;
  3537. int k2 = super.saveClickY;
  3538. if (k2 < 0)
  3539. k2 = 0;
  3540. else if (k2 > 502)
  3541. k2 = 502;
  3542. int k3 = super.saveClickX;
  3543. if (k3 < 0)
  3544. k3 = 0;
  3545. else if (k3 > 764)
  3546. k3 = 764;
  3547. int k4 = k2 * 765 + k3;
  3548. int j5 = 0;
  3549. if (super.clickMode3 == 2)
  3550. j5 = 1;
  3551. int l5 = (int) l;
  3552. stream.createFrame(241);
  3553. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3554. }
  3555. if (anInt1016 > 0)
  3556. anInt1016--;
  3557. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  3558. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3559. aBoolean1017 = true;
  3560. if (aBoolean1017 && anInt1016 <= 0) {
  3561. anInt1016 = 20;
  3562. aBoolean1017 = false;
  3563. stream.createFrame(86);
  3564. stream.writeWord(anInt1184);
  3565. stream.method432(viewRotation);
  3566. }
  3567. if (super.awtFocus && !aBoolean954) {
  3568. aBoolean954 = true;
  3569. stream.createFrame(3);
  3570. stream.writeWordBigEndian(1);
  3571. }
  3572. if (!super.awtFocus && aBoolean954) {
  3573. aBoolean954 = false;
  3574. stream.createFrame(3);
  3575. stream.writeWordBigEndian(0);
  3576. }
  3577. loadingStages();
  3578. method115();
  3579. method90();
  3580. anInt1009++;
  3581. if (anInt1009 > 750)
  3582. dropClient();
  3583. method114();
  3584. method95();
  3585. method38();
  3586. anInt945++;
  3587. if (crossType != 0) {
  3588. crossIndex += 20;
  3589. if (crossIndex >= 400)
  3590. crossType = 0;
  3591. }
  3592. if (atInventoryInterfaceType != 0) {
  3593. atInventoryLoopCycle++;
  3594. if (atInventoryLoopCycle >= 15) {
  3595. if (atInventoryInterfaceType == 2)
  3596. needDrawTabArea = true;
  3597. if (atInventoryInterfaceType == 3)
  3598. inputTaken = true;
  3599. atInventoryInterfaceType = 0;
  3600. }
  3601. }
  3602. if (activeInterfaceType != 0) {
  3603. anInt989++;
  3604. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  3605. || super.mouseY > anInt1088 + 5
  3606. || super.mouseY < anInt1088 - 5)
  3607. aBoolean1242 = true;
  3608. if (super.clickMode2 == 0) {
  3609. if (activeInterfaceType == 2)
  3610. needDrawTabArea = true;
  3611. if (activeInterfaceType == 3)
  3612. inputTaken = true;
  3613. activeInterfaceType = 0;
  3614. if (aBoolean1242 && anInt989 >= 5) {
  3615. lastActiveInvInterface = -1;
  3616. processRightClick();
  3617. if (lastActiveInvInterface == anInt1084
  3618. && mouseInvInterfaceIndex != anInt1085) {
  3619. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3620. int j1 = 0;
  3621. if (anInt913 == 1 && class9.contentType == 206)
  3622. j1 = 1;
  3623. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3624. j1 = 0;
  3625. if (class9.aBoolean235) {
  3626. int l2 = anInt1085;
  3627. int l3 = mouseInvInterfaceIndex;
  3628. class9.inv[l3] = class9.inv[l2];
  3629. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3630. class9.inv[l2] = -1;
  3631. class9.invStackSizes[l2] = 0;
  3632. } else if (j1 == 1) {
  3633. int i3 = anInt1085;
  3634. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3635. if (i3 > i4) {
  3636. class9.swapInventoryItems(i3, i3 - 1);
  3637. i3--;
  3638. } else if (i3 < i4) {
  3639. class9.swapInventoryItems(i3, i3 + 1);
  3640. i3++;
  3641. }
  3642.  
  3643. } else {
  3644. class9.swapInventoryItems(anInt1085,
  3645. mouseInvInterfaceIndex);
  3646. }
  3647. stream.createFrame(214);
  3648. stream.method433(anInt1084);
  3649. stream.method424(j1);
  3650. stream.method433(anInt1085);
  3651. stream.method431(mouseInvInterfaceIndex);
  3652. }
  3653. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  3654. && menuActionRow > 2)
  3655. determineMenuSize();
  3656. else if (menuActionRow > 0)
  3657. doAction(menuActionRow - 1);
  3658. atInventoryLoopCycle = 10;
  3659. super.clickMode3 = 0;
  3660. }
  3661. }
  3662. if (WorldController.anInt470 != -1) {
  3663. int k = WorldController.anInt470;
  3664. int k1 = WorldController.anInt471;
  3665. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  3666. myPlayer.smallX[0], true, k);
  3667. WorldController.anInt470 = -1;
  3668. if (flag) {
  3669. crossX = super.saveClickX;
  3670. crossY = super.saveClickY;
  3671. crossType = 1;
  3672. crossIndex = 0;
  3673. }
  3674. }
  3675. if (super.clickMode3 == 1 && aString844 != null) {
  3676. aString844 = null;
  3677. inputTaken = true;
  3678. super.clickMode3 = 0;
  3679. }
  3680. processTabClick();
  3681. processMenuClick();
  3682. processMainScreenClick();
  3683. processChatModeClick();
  3684. processMapAreaClick();
  3685. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3686. anInt1213++;
  3687. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3688. if (anInt1501 < 0 && !menuOpen) {
  3689. anInt1501++;
  3690. if (anInt1501 == 0) {
  3691. if (anInt1500 != 0) {
  3692. inputTaken = true;
  3693. }
  3694. if (anInt1044 != 0) {
  3695. }
  3696. }
  3697. }
  3698. } else if (anInt1501 > 0) {
  3699. anInt1501--;
  3700. }
  3701. if (loadingStage == 2)
  3702. method108();
  3703. if (loadingStage == 2 && aBoolean1160)
  3704. calcCameraPos();
  3705. for (int i1 = 0; i1 < 5; i1++)
  3706. anIntArray1030[i1]++;
  3707.  
  3708. method73();
  3709. super.idleTime++;
  3710. if (super.idleTime > 4500)
  3711. // if(super.idleTime > 3000)
  3712. {
  3713. anInt1011 = 250;
  3714. super.idleTime -= 500;
  3715. stream.createFrame(202);
  3716. }
  3717. /*
  3718. * anInt988++; if(anInt988 > 500) { anInt988 = 0; int l1 =
  3719. * (int)(Math.random() * 8D); if((l1 & 1) == 1) anInt1278 += anInt1279;
  3720. * if((l1 & 2) == 2) anInt1131 += anInt1132; if((l1 & 4) == 4) anInt896
  3721. * += anInt897; } if(anInt1278 < -50) anInt1279 = 2; if(anInt1278 > 50)
  3722. * anInt1279 = -2; if(anInt1131 < -55) anInt1132 = 2; if(anInt1131 > 55)
  3723. * anInt1132 = -2; if(anInt896 < -40) anInt897 = 1; if(anInt896 > 40)
  3724. * anInt897 = -1; anInt1254++; if(anInt1254 > 500) { anInt1254 = 0; int
  3725. * i2 = (int)(Math.random() * 8D); if((i2 & 1) == 1) minimapInt2 +=
  3726. * anInt1210; if((i2 & 2) == 2) minimapInt3 += anInt1171; }
  3727. * if(minimapInt2 < -60) anInt1210 = 2; if(minimapInt2 > 60) anInt1210 =
  3728. * -2; if(minimapInt3 < -20) anInt1171 = 1; if(minimapInt3 > 10)
  3729. * anInt1171 = -1;
  3730. */
  3731. anInt1010++;
  3732. if (anInt1010 > 50)
  3733. stream.createFrame(0);
  3734. try {
  3735. if (socketStream != null && stream.currentOffset > 0) {
  3736. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3737. stream.currentOffset = 0;
  3738. anInt1010 = 0;
  3739. }
  3740. } catch (IOException _ex) {
  3741. dropClient();
  3742. } catch (Exception exception) {
  3743. resetLogout();
  3744. }
  3745. }
  3746.  
  3747. public void method63() {
  3748. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  3749. .reverseGetFirst();
  3750. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  3751. .reverseGetNext())
  3752. if (class30_sub1.anInt1294 == -1) {
  3753. class30_sub1.anInt1302 = 0;
  3754. method89(class30_sub1);
  3755. } else {
  3756. class30_sub1.unlink();
  3757. }
  3758.  
  3759. }
  3760.  
  3761. public void resetImageProducers() {
  3762. if (aRSImageProducer_1107 != null)
  3763. return;
  3764. super.fullGameScreen = null;
  3765. aRSImageProducer_1166 = null;
  3766. aRSImageProducer_1164 = null;
  3767. aRSImageProducer_1163 = null;
  3768. aRSImageProducer_1165 = null;
  3769. aRSImageProducer_1123 = null;
  3770. aRSImageProducer_1124 = null;
  3771. aRSImageProducer_1125 = null;
  3772. aRSImageProducer_1110 = new RSImageProducer(128, 265,
  3773. getGameComponent());
  3774. DrawingArea.setAllPixelsToZero();
  3775. aRSImageProducer_1111 = new RSImageProducer(128, 265,
  3776. getGameComponent());
  3777. DrawingArea.setAllPixelsToZero();
  3778. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  3779. getGameComponent());
  3780. DrawingArea.setAllPixelsToZero();
  3781. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  3782. getGameComponent());
  3783. DrawingArea.setAllPixelsToZero();
  3784. aRSImageProducer_1109 = new RSImageProducer(765, 503,
  3785. getGameComponent());
  3786. DrawingArea.setAllPixelsToZero();
  3787. aRSImageProducer_1112 = new RSImageProducer(202, 238,
  3788. getGameComponent());
  3789. DrawingArea.setAllPixelsToZero();
  3790. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  3791. getGameComponent());
  3792. DrawingArea.setAllPixelsToZero();
  3793. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3794. DrawingArea.setAllPixelsToZero();
  3795. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3796. DrawingArea.setAllPixelsToZero();
  3797. if (titleStreamLoader != null) {
  3798. drawLogo();
  3799. loadTitleScreen();
  3800. }
  3801. welcomeScreenRaised = true;
  3802. }
  3803.  
  3804. void drawNewLoadingText(int i, String s)
  3805. {
  3806. anInt1079 = i;
  3807. aString1049 = s;
  3808. resetImageProducers();
  3809. if(titleStreamLoader == null) {
  3810. super.drawLoadingText(i, s);
  3811. return;
  3812. }
  3813. aRSImageProducer_1109.initDrawingArea();
  3814. loadingBarEmpty = new Sprite("/Login/empty");
  3815. loadingBarFull = new Sprite("/Login/full");
  3816. loadingBarEmpty.drawTransparentSprite(0, 453, 50);
  3817. loadingBarFull.drawSprite(8, 463);
  3818. DrawingArea.drawPixels(30, 463, (8 + i), 0x302e2c, (750 - i));
  3819. if (i == 750) {
  3820. smallText.drawText(0xffffff, s + " - 100%", 483, 370);
  3821. } else {
  3822. smallText.drawText(0xffffff, s + " - " + (i/7.5) + "%", 483, 370);
  3823. }
  3824. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  3825. if(welcomeScreenRaised) {
  3826. welcomeScreenRaised = false;
  3827. if(!aBoolean831) {
  3828. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3829. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3830. }
  3831. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3832. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3833. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3834. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3835. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3836. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3837. }
  3838. }
  3839.  
  3840. public Sprite loadingBarEmpty;
  3841. public Sprite loadingBarFull;
  3842.  
  3843. public void drawLoadingText(int i, String s) {
  3844. anInt1079 = i;
  3845. aString1049 = s;
  3846. resetImageProducers();
  3847. if (titleStreamLoader == null) {
  3848. super.drawLoadingText(i, s);
  3849. return;
  3850. }
  3851. aRSImageProducer_1109.initDrawingArea();
  3852. char c = '\u0168';
  3853. char c1 = '\310';
  3854. byte byte1 = 20;
  3855. chatTextDrawingArea.drawText(0xffffff,
  3856. "RuneScape is loading - please wait...",
  3857. c1 / 2 - 26 - byte1, c / 2);
  3858. int j = c1 / 2 - 18 - byte1;
  3859. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3860. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3861. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3862. DrawingArea
  3863. .drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3864. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3865. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3866. if (welcomeScreenRaised) {
  3867. welcomeScreenRaised = false;
  3868. if (!aBoolean831) {
  3869. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3870. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3871. }
  3872. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3873. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3874. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3875. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3876. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3877. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3878. }
  3879. }
  3880.  
  3881. public void method65(int i, int j, int k, int l, RSInterface class9,
  3882. int i1, boolean flag, int j1) {
  3883. int anInt992;
  3884. if (aBoolean972)
  3885. anInt992 = 32;
  3886. else
  3887. anInt992 = 0;
  3888. aBoolean972 = false;
  3889. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3890. class9.scrollPosition -= anInt1213 * 4;
  3891. if (flag) {
  3892. needDrawTabArea = true;
  3893. }
  3894. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3895. class9.scrollPosition += anInt1213 * 4;
  3896. if (flag) {
  3897. needDrawTabArea = true;
  3898. }
  3899. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  3900. && l < (i1 + j) - 16 && anInt1213 > 0) {
  3901. int l1 = ((j - 32) * j) / j1;
  3902. if (l1 < 8)
  3903. l1 = 8;
  3904. int i2 = l - i1 - 16 - l1 / 2;
  3905. int j2 = j - 32 - l1;
  3906. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3907. if (flag)
  3908. needDrawTabArea = true;
  3909. aBoolean972 = true;
  3910. }
  3911. }
  3912.  
  3913. private boolean method66(int i, int j, int k, int id) {
  3914. int j1 = worldController.method304(plane, k, j, i);
  3915. if(i == -1)
  3916. return false;
  3917. int k1 = j1 & 0x1f;
  3918. int l1 = j1 >> 6 & 3;
  3919. if(k1 == 10 || k1 == 11 || k1 == 22) {
  3920. ObjectDef class46 = ObjectDef.forID(id);
  3921. int i2;
  3922. int j2;
  3923. if(l1 == 0 || l1 == 2) {
  3924. i2 = class46.sizeX;
  3925. j2 = class46.sizeY;
  3926. } else {
  3927. i2 = class46.sizeY;
  3928. j2 = class46.sizeX;
  3929. }
  3930. int k2 = class46.anInt768;
  3931. if(l1 != 0)
  3932. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3933. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3934. } else {
  3935. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3936. }
  3937. crossX = super.saveClickX;
  3938. crossY = super.saveClickY;
  3939. crossType = 2;
  3940. crossIndex = 0;
  3941. return true;
  3942. }
  3943.  
  3944. @SuppressWarnings("unused")
  3945. public StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  3946. int k) {
  3947. byte abyte0[] = null;
  3948. int l = 5;
  3949. try {
  3950. if (decompressors[0] != null)
  3951. abyte0 = decompressors[0].decompress(i);
  3952. } catch (Exception _ex) {
  3953. }
  3954. if (abyte0 != null) {
  3955. // aCRC32_930.reset();
  3956. // aCRC32_930.update(abyte0);
  3957. // int i1 = (int)aCRC32_930.getValue();
  3958. // if(i1 != j)
  3959. }
  3960. if (abyte0 != null) {
  3961. StreamLoader streamLoader = new StreamLoader(abyte0, s);
  3962. return streamLoader;
  3963. }
  3964. int j1 = 0;
  3965. while (abyte0 == null) {
  3966. String s2 = "Unknown error";
  3967. drawLoadingText(k, "Requesting " + s);
  3968. Object obj = null;
  3969. try {
  3970. int k1 = 0;
  3971. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3972. byte abyte1[] = new byte[6];
  3973. datainputstream.readFully(abyte1, 0, 6);
  3974. Stream stream = new Stream(abyte1);
  3975. stream.currentOffset = 3;
  3976. int i2 = stream.read3Bytes() + 6;
  3977. int j2 = 6;
  3978. abyte0 = new byte[i2];
  3979. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3980.  
  3981. while (j2 < i2) {
  3982. int l2 = i2 - j2;
  3983. if (l2 > 1000)
  3984. l2 = 1000;
  3985. int j3 = datainputstream.read(abyte0, j2, l2);
  3986. if (j3 < 0) {
  3987. s2 = "Length error: " + j2 + "/" + i2;
  3988. throw new IOException("EOF");
  3989. }
  3990. j2 += j3;
  3991. int k3 = (j2 * 100) / i2;
  3992. if (k3 != k1)
  3993. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3994. k1 = k3;
  3995. }
  3996. datainputstream.close();
  3997. try {
  3998. if (decompressors[0] != null)
  3999. decompressors[0].method234(abyte0.length, abyte0, i);
  4000. } catch (Exception _ex) {
  4001. decompressors[0] = null;
  4002. }
  4003. /*
  4004. * if(abyte0 != null) { aCRC32_930.reset();
  4005. * aCRC32_930.update(abyte0); int i3 =
  4006. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  4007. * j1++; s2 = "Checksum error: " + i3; } }
  4008. */
  4009. } catch (IOException ioexception) {
  4010. if (s2.equals("Unknown error"))
  4011. s2 = "Connection error";
  4012. abyte0 = null;
  4013. } catch (NullPointerException _ex) {
  4014. s2 = "Null error";
  4015. abyte0 = null;
  4016. if (!SignLink.reporterror)
  4017. return null;
  4018. } catch (ArrayIndexOutOfBoundsException _ex) {
  4019. s2 = "Bounds error";
  4020. abyte0 = null;
  4021. if (!SignLink.reporterror)
  4022. return null;
  4023. } catch (Exception _ex) {
  4024. s2 = "Unexpected error";
  4025. abyte0 = null;
  4026. if (!SignLink.reporterror)
  4027. return null;
  4028. }
  4029. if (abyte0 == null) {
  4030. for (int l1 = l; l1 > 0; l1--) {
  4031. if (j1 >= 3) {
  4032. drawLoadingText(k, "Game updated - please reload page");
  4033. l1 = 10;
  4034. } else {
  4035. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4036. }
  4037. try {
  4038. Thread.sleep(1000L);
  4039. } catch (Exception _ex) {
  4040. }
  4041. }
  4042.  
  4043. l *= 2;
  4044. if (l > 60)
  4045. l = 60;
  4046. aBoolean872 = !aBoolean872;
  4047. }
  4048.  
  4049. }
  4050.  
  4051. StreamLoader streamLoader_1 = new StreamLoader(abyte0, s);
  4052. return streamLoader_1;
  4053. }
  4054.  
  4055. public void dropClient() {
  4056. if (anInt1011 > 0) {
  4057. resetLogout();
  4058. return;
  4059. }
  4060. aRSImageProducer_1165.initDrawingArea();
  4061. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2);
  4062. DrawingArea.drawPixels(37, 3, 3, 0, 227);
  4063. aTextDrawingArea_1271.drawText(0, "Connection Lost", 19, 120);
  4064. aTextDrawingArea_1271.drawText(0xffffff, "Connection Lost", 18, 119);
  4065. aTextDrawingArea_1271
  4066. .drawText(0, "Please Wait - Reconnecting", 34, 117);
  4067. aTextDrawingArea_1271.drawText(0xffffff, "Please Wait - Reconnecting",
  4068. 34, 116);
  4069. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4070. anInt1021 = 0;
  4071. destX = 0;
  4072. RSSocket rsSocket = socketStream;
  4073. loggedIn = false;
  4074. loginFailures = 0;
  4075. login(myUsername, myPassword, true);
  4076. if (!loggedIn)
  4077. resetLogout();
  4078. try {
  4079. rsSocket.close();
  4080. } catch (Exception _ex) {
  4081. }
  4082. }
  4083.  
  4084. public void doAction(int i) {
  4085. if (i < 0)
  4086. return;
  4087. if (inputDialogState != 0) {
  4088. inputDialogState = 0;
  4089. inputTaken = true;
  4090. }
  4091. int i1 = menuActionCmd1[i];
  4092. int j = menuActionCmd2[i];
  4093. int k = menuActionCmd3[i];
  4094. int cmd4 = menuActionCmd4[i];
  4095. int actionId = menuActionIds[i];
  4096. int id = (i1 > 32767 ? cmd4 : i1 >> 14 & 0x7fff);
  4097. if (actionId >= 2000)
  4098. actionId -= 2000;
  4099. if (actionId == 582) {
  4100. NPC npc = npcArray[i1];
  4101. if (npc != null) {
  4102. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  4103. myPlayer.smallX[0], false, npc.smallX[0]);
  4104. crossX = super.saveClickX;
  4105. crossY = super.saveClickY;
  4106. crossType = 2;
  4107. crossIndex = 0;
  4108. stream.createFrame(57);
  4109. stream.method432(anInt1285);
  4110. stream.method432(i1);
  4111. stream.method431(anInt1283);
  4112. stream.method432(anInt1284);
  4113. }
  4114. }
  4115. if (actionId == 234) {
  4116. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4117. myPlayer.smallX[0], false, j);
  4118. if (!flag1)
  4119. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4120. myPlayer.smallX[0], false, j);
  4121. crossX = super.saveClickX;
  4122. crossY = super.saveClickY;
  4123. crossType = 2;
  4124. crossIndex = 0;
  4125. stream.createFrame(236);
  4126. stream.method431(k + baseY);
  4127. stream.writeWord(i1);
  4128. stream.method431(j + baseX);
  4129. }
  4130. if (actionId == 474) {
  4131. counterOn = !counterOn;
  4132. }
  4133. if (actionId == 475) {
  4134. xpCounter = 0;
  4135. }
  4136. if (actionId == 62 && method66(i1, k, j, id)) {
  4137. stream.createFrame(192);
  4138. stream.writeWord(anInt1284);
  4139. stream.method431(i1 >> 14 & 0x7fff);
  4140. stream.method433(k + baseY);
  4141. stream.method431(anInt1283);
  4142. stream.method433(j + baseX);
  4143. stream.writeWord(anInt1285);
  4144. }
  4145.  
  4146. if (actionId == 511) {
  4147. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4148. myPlayer.smallX[0], false, j);
  4149. if (!flag2)
  4150. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4151. myPlayer.smallX[0], false, j);
  4152. crossX = super.saveClickX;
  4153. crossY = super.saveClickY;
  4154. crossType = 2;
  4155. crossIndex = 0;
  4156. stream.createFrame(25);
  4157. stream.method431(anInt1284);
  4158. stream.method432(anInt1285);
  4159. stream.writeWord(i1);
  4160. stream.method432(k + baseY);
  4161. stream.method433(anInt1283);
  4162. stream.writeWord(j + baseX);
  4163. }
  4164. if (actionId == 74) {
  4165. stream.createFrame(122);
  4166. stream.method433(k);
  4167. stream.method432(j);
  4168. stream.method431(i1);
  4169. atInventoryLoopCycle = 0;
  4170. atInventoryInterface = k;
  4171. atInventoryIndex = j;
  4172. atInventoryInterfaceType = 2;
  4173. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4174. atInventoryInterfaceType = 1;
  4175. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4176. atInventoryInterfaceType = 3;
  4177. }
  4178. if (actionId == 315) {
  4179. RSInterface class9 = RSInterface.interfaceCache[k];
  4180. boolean flag8 = true;
  4181. if (class9.contentType > 0)
  4182. flag8 = promptUserForInput(class9);
  4183. if (flag8) {
  4184. switch (k) {
  4185. case 19144:
  4186. sendFrame248(15106, 3213);
  4187. method60(15106);
  4188. inputTaken = true;
  4189. break;
  4190. case 2661:
  4191. tabInterfaceIDs[2] = 638;
  4192. break;
  4193. default:
  4194. stream.createFrame(185);
  4195. stream.writeWord(k);
  4196. break;
  4197.  
  4198. }
  4199. }
  4200. }
  4201. if (actionId == 561) {
  4202. Player player = playerArray[i1];
  4203. if (player != null) {
  4204. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4205. player.smallY[0], myPlayer.smallX[0], false,
  4206. player.smallX[0]);
  4207. crossX = super.saveClickX;
  4208. crossY = super.saveClickY;
  4209. crossType = 2;
  4210. crossIndex = 0;
  4211. anInt1188 += i1;
  4212. if (anInt1188 >= 90) {
  4213. stream.createFrame(136);
  4214. anInt1188 = 0;
  4215. }
  4216. stream.createFrame(128);
  4217. stream.writeWord(i1);
  4218. }
  4219. }
  4220. if (actionId == 20) {
  4221. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4222. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4223. 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]);
  4224. crossX = super.saveClickX;
  4225. crossY = super.saveClickY;
  4226. crossType = 2;
  4227. crossIndex = 0;
  4228. stream.createFrame(155);
  4229. stream.method431(i1);
  4230. }
  4231. }
  4232. if (actionId == 779) {
  4233. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4234. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4235. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4236. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  4237. myPlayer.smallX[0], false,
  4238. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  4239. crossX = super.saveClickX;
  4240. crossY = super.saveClickY;
  4241. crossType = 2;
  4242. crossIndex = 0;
  4243. stream.createFrame(153);
  4244. stream.method431(i1);
  4245. }
  4246. }
  4247. if (actionId == 516)
  4248. if (!menuOpen)
  4249. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4250. else
  4251. worldController.method312(k - 4, j - 4);
  4252. if (actionId == 1062) {
  4253. anInt924 += baseX;
  4254. if (anInt924 >= 113) {
  4255. stream.createFrame(183);
  4256. stream.writeDWordBigEndian(0xe63271);
  4257. anInt924 = 0;
  4258. }
  4259. method66(i1, k, j, id);
  4260. stream.createFrame(228);
  4261. stream.method432(i1 >> 14 & 0x7fff);
  4262. stream.method432(k + baseY);
  4263. stream.writeWord(j + baseX);
  4264. }
  4265. if (actionId == 679 && !aBoolean1149) {
  4266. stream.createFrame(40);
  4267. stream.writeWord(k);
  4268. aBoolean1149 = true;
  4269. }
  4270. if (actionId == 431) {
  4271. stream.createFrame(129);
  4272. stream.method432(j);
  4273. stream.writeWord(k);
  4274. stream.method432(i1);
  4275. atInventoryLoopCycle = 0;
  4276. atInventoryInterface = k;
  4277. atInventoryIndex = j;
  4278. atInventoryInterfaceType = 2;
  4279. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4280. atInventoryInterfaceType = 1;
  4281. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4282. atInventoryInterfaceType = 3;
  4283. }
  4284. if (actionId == 337 || actionId == 42 || actionId == 792 || actionId == 322) {
  4285. String s = menuActionName[i];
  4286. int k1 = s.indexOf("@whi@");
  4287. if (k1 != -1) {
  4288. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4289. if (actionId == 337)
  4290. addFriend(l3);
  4291. if (actionId == 42)
  4292. addIgnore(l3);
  4293. if (actionId == 792)
  4294. delFriend(l3);
  4295. if (actionId == 322)
  4296. delIgnore(l3);
  4297. }
  4298. }
  4299. if (actionId == 53) {
  4300. stream.createFrame(135);
  4301. stream.method431(j);
  4302. stream.method432(k);
  4303. stream.method431(i1);
  4304. atInventoryLoopCycle = 0;
  4305. atInventoryInterface = k;
  4306. atInventoryIndex = j;
  4307. atInventoryInterfaceType = 2;
  4308. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4309. atInventoryInterfaceType = 1;
  4310. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4311. atInventoryInterfaceType = 3;
  4312. }
  4313. if (actionId == 54) {
  4314. stream.createFrame(137);
  4315. stream.method431(j);
  4316. stream.method432(k);
  4317. stream.method431(i1);
  4318. atInventoryLoopCycle = 0;
  4319. atInventoryInterface = k;
  4320. atInventoryIndex = j;
  4321. atInventoryInterfaceType = 2;
  4322. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4323. atInventoryInterfaceType = 1;
  4324. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4325. atInventoryInterfaceType = 3;
  4326. }
  4327. if(actionId == 1505){
  4328. // set your summoning interface here or something
  4329. }
  4330. if (actionId == 539) {
  4331. stream.createFrame(16);
  4332. stream.method432(i1);
  4333. stream.method433(j);
  4334. stream.method433(k);
  4335. atInventoryLoopCycle = 0;
  4336. atInventoryInterface = k;
  4337. atInventoryIndex = j;
  4338. atInventoryInterfaceType = 2;
  4339. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4340. atInventoryInterfaceType = 1;
  4341. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4342. atInventoryInterfaceType = 3;
  4343. }
  4344. if(actionId == 484 || actionId == 6 || actionId == 424)
  4345. {
  4346. String s1 = menuActionName[i];
  4347. int l1 = s1.indexOf("@whi@");
  4348. if(l1 != -1)
  4349. {
  4350. s1 = s1.substring(l1 + 5).trim();
  4351. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4352. boolean flag9 = false;
  4353. for(int j3 = 0; j3 < playerCount; j3++)
  4354. {
  4355. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4356. 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))
  4357. continue;
  4358. 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]);
  4359. if(actionId == 484)
  4360. {
  4361. stream.createFrame(139);
  4362. stream.method431(playerIndices[j3]);
  4363. }
  4364. if(actionId == 6)
  4365. {
  4366. anInt1188 += i1;
  4367. if(anInt1188 >= 90)
  4368. {
  4369. stream.createFrame(136);
  4370. anInt1188 = 0;
  4371. }
  4372. stream.createFrame(128);
  4373. stream.writeWord(playerIndices[j3]);
  4374. }
  4375. if (actionId == 424) {
  4376. stream.createFrame(146);
  4377. stream.writeWord(playerIndices[j3]);
  4378. }
  4379. flag9 = true;
  4380. break;
  4381. }
  4382.  
  4383. if(!flag9)
  4384. pushMessage("Unable to find " + s7, 0, "");
  4385. }
  4386. }
  4387. if (actionId == 870) {
  4388. stream.createFrame(53);
  4389. stream.writeWord(j);
  4390. stream.method432(anInt1283);
  4391. stream.method433(i1);
  4392. stream.writeWord(anInt1284);
  4393. stream.method431(anInt1285);
  4394. stream.writeWord(k);
  4395. atInventoryLoopCycle = 0;
  4396. atInventoryInterface = k;
  4397. atInventoryIndex = j;
  4398. atInventoryInterfaceType = 2;
  4399. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4400. atInventoryInterfaceType = 1;
  4401. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4402. atInventoryInterfaceType = 3;
  4403. }
  4404. if (actionId == 847) {
  4405. stream.createFrame(87);
  4406. stream.method432(i1);
  4407. stream.writeWord(k);
  4408. stream.method432(j);
  4409. atInventoryLoopCycle = 0;
  4410. atInventoryInterface = k;
  4411. atInventoryIndex = j;
  4412. atInventoryInterfaceType = 2;
  4413. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4414. atInventoryInterfaceType = 1;
  4415. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4416. atInventoryInterfaceType = 3;
  4417. }
  4418. if (actionId == 626) {
  4419. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4420. spellSelected = 1;
  4421. spellID = class9_1.id;
  4422. anInt1137 = k;
  4423. spellUsableOn = class9_1.spellUsableOn;
  4424. itemSelected = 0;
  4425. needDrawTabArea = true;
  4426. spellID = class9_1.id;
  4427. String s4 = class9_1.selectedActionName;
  4428. if (s4.indexOf(" ") != -1)
  4429. s4 = s4.substring(0, s4.indexOf(" "));
  4430. String s8 = class9_1.selectedActionName;
  4431. if (s8.indexOf(" ") != -1)
  4432. s8 = s8.substring(s8.indexOf(" ") + 1);
  4433. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4434. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4435. // 0xffffff);
  4436. // class9_1.sprite1.drawSprite(200,200);
  4437. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4438. if (spellUsableOn == 16) {
  4439. needDrawTabArea = true;
  4440. tabID = 3;
  4441. tabAreaAltered = true;
  4442. }
  4443. return;
  4444. }
  4445. if (actionId == 78) {
  4446. stream.createFrame(117);
  4447. stream.method433(k);
  4448. stream.method433(i1);
  4449. stream.method431(j);
  4450. atInventoryLoopCycle = 0;
  4451. atInventoryInterface = k;
  4452. atInventoryIndex = j;
  4453. atInventoryInterfaceType = 2;
  4454. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4455. atInventoryInterfaceType = 1;
  4456. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4457. atInventoryInterfaceType = 3;
  4458. }
  4459. if (actionId == 27) {
  4460. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4461. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4462. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4463. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  4464. myPlayer.smallX[0], false,
  4465. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4466. crossX = super.saveClickX;
  4467. crossY = super.saveClickY;
  4468. crossType = 2;
  4469. crossIndex = 0;
  4470. anInt986 += i1;
  4471. if (anInt986 >= 54) {
  4472. stream.createFrame(189);
  4473. stream.writeWordBigEndian(234);
  4474. anInt986 = 0;
  4475. }
  4476. stream.createFrame(73);
  4477. stream.method431(i1);
  4478. }
  4479. }
  4480. if (actionId == 213) {
  4481. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4482. myPlayer.smallX[0], false, j);
  4483. if (!flag3)
  4484. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4485. myPlayer.smallX[0], false, j);
  4486. crossX = super.saveClickX;
  4487. crossY = super.saveClickY;
  4488. crossType = 2;
  4489. crossIndex = 0;
  4490. stream.createFrame(79);
  4491. stream.method431(k + baseY);
  4492. stream.writeWord(i1);
  4493. stream.method432(j + baseX);
  4494. }
  4495. if (actionId == 632) {
  4496. stream.createFrame(145);
  4497. stream.method432(k);
  4498. stream.method432(j);
  4499. stream.method432(i1);
  4500. atInventoryLoopCycle = 0;
  4501. atInventoryInterface = k;
  4502. atInventoryIndex = j;
  4503. atInventoryInterfaceType = 2;
  4504. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4505. atInventoryInterfaceType = 1;
  4506. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4507. atInventoryInterfaceType = 3;
  4508. }
  4509. if (actionId == 1004) {
  4510. if (tabInterfaceIDs[10] != -1) {
  4511. needDrawTabArea = true;
  4512. tabID = 10;
  4513. tabAreaAltered = true;
  4514. }
  4515. }
  4516. if (actionId == 1003) {
  4517. clanChatMode = 2;
  4518. inputTaken = true;
  4519. }
  4520. if (actionId == 1002) {
  4521. clanChatMode = 1;
  4522. inputTaken = true;
  4523. }
  4524. if (actionId == 1001) {
  4525. clanChatMode = 0;
  4526. inputTaken = true;
  4527. }
  4528. if (actionId == 1000) {
  4529. cButtonCPos = 4;
  4530. chatTypeView = 11;
  4531. inputTaken = true;
  4532. }
  4533. if (actionId == 999) {
  4534. cButtonCPos = 0;
  4535. chatTypeView = 0;
  4536. inputTaken = true;
  4537. }
  4538. if (actionId == 975) {
  4539. chatTypes = new int[500];
  4540. chatNames = new String[500];
  4541. chatMessages = new String[500];
  4542. chatRights = new int[500];
  4543. pushMessage("Your chat has been cleared.", 0, "");
  4544. }
  4545. if (actionId == 998) {
  4546. cButtonCPos = 1;
  4547. chatTypeView = 5;
  4548. inputTaken = true;
  4549. }
  4550. if (actionId == 997) {
  4551. publicChatMode = 3;
  4552. inputTaken = true;
  4553. }
  4554. if (actionId == 996) {
  4555. publicChatMode = 2;
  4556. inputTaken = true;
  4557. }
  4558. if (actionId == 995) {
  4559. publicChatMode = 1;
  4560. inputTaken = true;
  4561. }
  4562. if (actionId == 994) {
  4563. publicChatMode = 0;
  4564. inputTaken = true;
  4565. }
  4566. if (actionId == 993) {
  4567. cButtonCPos = 2;
  4568. chatTypeView = 1;
  4569. inputTaken = true;
  4570. }
  4571. if (actionId == 992) {
  4572. publicChatMode = 2;
  4573. inputTaken = true;
  4574. }
  4575. if (actionId == 991) {
  4576. publicChatMode = 1;
  4577. inputTaken = true;
  4578. }
  4579. if (actionId == 990) {
  4580. publicChatMode = 0;
  4581. inputTaken = true;
  4582. }
  4583. if (actionId == 989) {
  4584. cButtonCPos = 3;
  4585. chatTypeView = 2;
  4586. inputTaken = true;
  4587. }
  4588. if (actionId == 987) {
  4589. tradeMode = 2;
  4590. inputTaken = true;
  4591. }
  4592. if (actionId == 986) {
  4593. tradeMode = 1;
  4594. inputTaken = true;
  4595. }
  4596. if (actionId == 985) {
  4597. tradeMode = 0;
  4598. inputTaken = true;
  4599. }
  4600. if (actionId == 984) {
  4601. cButtonCPos = 5;
  4602. chatTypeView = 3;
  4603. inputTaken = true;
  4604. }
  4605. if (actionId == 983) {
  4606. duelMode = 2;
  4607. inputTaken = true;
  4608. }
  4609. if (actionId == 982) {
  4610. duelMode = 1;
  4611. inputTaken = true;
  4612. }
  4613. if (actionId == 981) {
  4614. duelMode = 0;
  4615. inputTaken = true;
  4616. }
  4617. if (actionId == 980) {
  4618. cButtonCPos = 6;
  4619. chatTypeView = 4;
  4620. inputTaken = true;
  4621. }
  4622. if (actionId == 493) {
  4623. stream.createFrame(75);
  4624. stream.method433(k);
  4625. stream.method431(j);
  4626. stream.method432(i1);
  4627. atInventoryLoopCycle = 0;
  4628. atInventoryInterface = k;
  4629. atInventoryIndex = j;
  4630. atInventoryInterfaceType = 2;
  4631. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4632. atInventoryInterfaceType = 1;
  4633. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4634. atInventoryInterfaceType = 3;
  4635. }
  4636. if (actionId == 652) {
  4637. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4638. myPlayer.smallX[0], false, j);
  4639. if (!flag4)
  4640. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4641. myPlayer.smallX[0], false, j);
  4642. crossX = super.saveClickX;
  4643. crossY = super.saveClickY;
  4644. crossType = 2;
  4645. crossIndex = 0;
  4646. stream.createFrame(156);
  4647. stream.method432(j + baseX);
  4648. stream.method431(k + baseY);
  4649. stream.method433(i1);
  4650. }
  4651. if (actionId == 94) {
  4652. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4653. myPlayer.smallX[0], false, j);
  4654. if (!flag5)
  4655. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4656. myPlayer.smallX[0], false, j);
  4657. crossX = super.saveClickX;
  4658. crossY = super.saveClickY;
  4659. crossType = 2;
  4660. crossIndex = 0;
  4661. stream.createFrame(181);
  4662. stream.method431(k + baseY);
  4663. stream.writeWord(i1);
  4664. stream.method431(j + baseX);
  4665. stream.method432(anInt1137);
  4666. }
  4667. if (actionId == 646) {
  4668. stream.createFrame(185);
  4669. stream.writeWord(k);
  4670. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4671. if (class9_2.valueIndexArray != null
  4672. && class9_2.valueIndexArray[0][0] == 5) {
  4673. int i2 = class9_2.valueIndexArray[0][1];
  4674. if (variousSettings[i2] != class9_2.requiredValues[0]) {
  4675. variousSettings[i2] = class9_2.requiredValues[0];
  4676. method33(i2);
  4677. needDrawTabArea = true;
  4678. }
  4679. }
  4680. }
  4681. if (actionId == 225) {
  4682. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4683. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4684. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4685. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  4686. myPlayer.smallX[0], false,
  4687. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4688. crossX = super.saveClickX;
  4689. crossY = super.saveClickY;
  4690. crossType = 2;
  4691. crossIndex = 0;
  4692. anInt1226 += i1;
  4693. if (anInt1226 >= 85) {
  4694. stream.createFrame(230);
  4695. stream.writeWordBigEndian(239);
  4696. anInt1226 = 0;
  4697. }
  4698. stream.createFrame(17);
  4699. stream.method433(i1);
  4700. }
  4701. }
  4702. if (actionId == 965) {
  4703. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4704. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4705. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4706. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  4707. myPlayer.smallX[0], false,
  4708. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4709. crossX = super.saveClickX;
  4710. crossY = super.saveClickY;
  4711. crossType = 2;
  4712. crossIndex = 0;
  4713. anInt1134++;
  4714. if (anInt1134 >= 96) {
  4715. stream.createFrame(152);
  4716. stream.writeWordBigEndian(88);
  4717. anInt1134 = 0;
  4718. }
  4719. stream.createFrame(21);
  4720. stream.writeWord(i1);
  4721. }
  4722. }
  4723. if (actionId == 413) {
  4724. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4725. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4726. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4727. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  4728. myPlayer.smallX[0], false,
  4729. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4730. crossX = super.saveClickX;
  4731. crossY = super.saveClickY;
  4732. crossType = 2;
  4733. crossIndex = 0;
  4734. stream.createFrame(131);
  4735. stream.method433(i1);
  4736. stream.method432(anInt1137);
  4737. }
  4738. }
  4739. if (actionId == 200)
  4740. clearTopInterfaces();
  4741. if (actionId == 1025) {
  4742. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4743. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4744. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4745. if (entityDef.childrenIDs != null)
  4746. entityDef = entityDef.method161();
  4747. if (entityDef != null) {
  4748. String s9;
  4749. if (entityDef.description != null)
  4750. s9 = new String(entityDef.description);
  4751. else
  4752. s9 = "It's a " + entityDef.name + ".";
  4753. pushMessage(s9, 0, "");
  4754. }
  4755. }
  4756. }
  4757. if (actionId == 900) {
  4758. method66(i1, k, j, id);
  4759. stream.createFrame(252);
  4760. stream.method433(i1 >> 14 & 0x7fff);
  4761. stream.method431(k + baseY);
  4762. stream.method432(j + baseX);
  4763. }
  4764. if (actionId == 412) {
  4765. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4766. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4767. 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]);
  4768. crossX = super.saveClickX;
  4769. crossY = super.saveClickY;
  4770. crossType = 2;
  4771. crossIndex = 0;
  4772. stream.createFrame(72);
  4773. stream.method432(i1);
  4774. }
  4775. }
  4776. if (actionId == 365) {
  4777. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4778. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4779. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4780. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  4781. myPlayer.smallX[0], false,
  4782. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4783. crossX = super.saveClickX;
  4784. crossY = super.saveClickY;
  4785. crossType = 2;
  4786. crossIndex = 0;
  4787. stream.createFrame(249);
  4788. stream.method432(i1);
  4789. stream.method431(anInt1137);
  4790. }
  4791. }
  4792. if (actionId == 729) {
  4793. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4794. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4795. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4796. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  4797. myPlayer.smallX[0], false,
  4798. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4799. crossX = super.saveClickX;
  4800. crossY = super.saveClickY;
  4801. crossType = 2;
  4802. crossIndex = 0;
  4803. stream.createFrame(39);
  4804. stream.method431(i1);
  4805. }
  4806. }
  4807. if (actionId == 577) {
  4808. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4809. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4810. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4811. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  4812. myPlayer.smallX[0], false,
  4813. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4814. crossX = super.saveClickX;
  4815. crossY = super.saveClickY;
  4816. crossType = 2;
  4817. crossIndex = 0;
  4818. stream.createFrame(139);
  4819. stream.method431(i1);
  4820. }
  4821. }
  4822. if (actionId == 956 && method66(i1, k, j, id)) {
  4823. stream.createFrame(35);
  4824. stream.method431(j + baseX);
  4825. stream.method432(anInt1137);
  4826. stream.method432(k + baseY);
  4827. stream.method431(i1 >> 14 & 0x7fff);
  4828. }
  4829. if (actionId == 567) {
  4830. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4831. myPlayer.smallX[0], false, j);
  4832. if (!flag6)
  4833. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4834. myPlayer.smallX[0], false, j);
  4835. crossX = super.saveClickX;
  4836. crossY = super.saveClickY;
  4837. crossType = 2;
  4838. crossIndex = 0;
  4839. stream.createFrame(23);
  4840. stream.method431(k + baseY);
  4841. stream.method431(i1);
  4842. stream.method431(j + baseX);
  4843. }
  4844. if (actionId == 867) {
  4845. if ((i1 & 3) == 0)
  4846. anInt1175++;
  4847. if (anInt1175 >= 59) {
  4848. stream.createFrame(200);
  4849. stream.createFrame(201);
  4850. stream.writeWord(25501);
  4851. anInt1175 = 0;
  4852. }
  4853. stream.createFrame(43);
  4854. stream.method431(k);
  4855. stream.method432(i1);
  4856. stream.method432(j);
  4857. atInventoryLoopCycle = 0;
  4858. atInventoryInterface = k;
  4859. atInventoryIndex = j;
  4860. atInventoryInterfaceType = 2;
  4861. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4862. atInventoryInterfaceType = 1;
  4863. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4864. atInventoryInterfaceType = 3;
  4865. }
  4866. if (actionId == 543) {
  4867. stream.createFrame(237);
  4868. stream.writeWord(j);
  4869. stream.method432(i1);
  4870. stream.writeWord(k);
  4871. stream.method432(anInt1137);
  4872. atInventoryLoopCycle = 0;
  4873. atInventoryInterface = k;
  4874. atInventoryIndex = j;
  4875. atInventoryInterfaceType = 2;
  4876. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4877. atInventoryInterfaceType = 1;
  4878. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4879. atInventoryInterfaceType = 3;
  4880. }
  4881. if (actionId == 606) {
  4882. String s2 = menuActionName[i];
  4883. int j2 = s2.indexOf("@whi@");
  4884. if (j2 != -1)
  4885. if (openInterfaceID == -1) {
  4886. clearTopInterfaces();
  4887. reportAbuseInput = s2.substring(j2 + 5).trim();
  4888. canMute = false;
  4889. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  4890. if (RSInterface.interfaceCache[i3] == null
  4891. || RSInterface.interfaceCache[i3].contentType != 600)
  4892. continue;
  4893. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4894. break;
  4895. }
  4896.  
  4897. } else {
  4898. pushMessage(
  4899. "Please close the interface you have open before using 'report abuse'",
  4900. 0, "");
  4901. }
  4902. }
  4903. if (actionId == 491) {
  4904. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4905. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  4906. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4907. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  4908. myPlayer.smallX[0], false,
  4909. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  4910. crossX = super.saveClickX;
  4911. crossY = super.saveClickY;
  4912. crossType = 2;
  4913. crossIndex = 0;
  4914. stream.createFrame(14);
  4915. stream.method432(anInt1284);
  4916. stream.writeWord(i1);
  4917. stream.writeWord(anInt1285);
  4918. stream.method431(anInt1283);
  4919. }
  4920. }
  4921. if (actionId == 639) {
  4922. String s3 = menuActionName[i];
  4923. int k2 = s3.indexOf("@whi@");
  4924. if (k2 != -1) {
  4925. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4926. int k3 = -1;
  4927. for (int i4 = 0; i4 < friendsCount; i4++) {
  4928. if (friendsListAsLongs[i4] != l4)
  4929. continue;
  4930. k3 = i4;
  4931. break;
  4932. }
  4933.  
  4934. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  4935. inputTaken = true;
  4936. inputDialogState = 0;
  4937. messagePromptRaised = true;
  4938. promptInput = "";
  4939. friendsListAction = 3;
  4940. aLong953 = friendsListAsLongs[k3];
  4941. aString1121 = "Enter message to send to " + friendsList[k3];
  4942. }
  4943. }
  4944. }
  4945. if (actionId == 1052) {
  4946. stream.createFrame(185);
  4947. stream.writeWord(154);
  4948. }
  4949.  
  4950. if (actionId == 454) {
  4951. stream.createFrame(41);
  4952. stream.writeWord(i1);
  4953. stream.method432(j);
  4954. stream.method432(k);
  4955. atInventoryLoopCycle = 0;
  4956. atInventoryInterface = k;
  4957. atInventoryIndex = j;
  4958. atInventoryInterfaceType = 2;
  4959. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4960. atInventoryInterfaceType = 1;
  4961. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4962. atInventoryInterfaceType = 3;
  4963. }
  4964. if (actionId == 478) {
  4965. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4966. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  4967. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  4968. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  4969. myPlayer.smallX[0], false,
  4970. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  4971. crossX = super.saveClickX;
  4972. crossY = super.saveClickY;
  4973. crossType = 2;
  4974. crossIndex = 0;
  4975. if ((i1 & 3) == 0)
  4976. anInt1155++;
  4977. if (anInt1155 >= 53) {
  4978. stream.createFrame(85);
  4979. stream.writeWordBigEndian(66);
  4980. anInt1155 = 0;
  4981. }
  4982. stream.createFrame(18);
  4983. stream.method431(i1);
  4984. }
  4985. }
  4986. if (actionId == 113) {
  4987. method66(i1, k, j, id);
  4988. stream.createFrame(70);
  4989. stream.method431(j + baseX);
  4990. stream.writeWord(k + baseY);
  4991. stream.method433(i1 >> 14 & 0x7fff);
  4992. }
  4993. if (actionId == 872) {
  4994. method66(i1, k, j, id);
  4995. stream.createFrame(234);
  4996. stream.method433(j + baseX);
  4997. stream.method432(i1 >> 14 & 0x7fff);
  4998. stream.method433(k + baseY);
  4999. }
  5000. if (actionId == 502) {
  5001. method66(i1, k, j, id);
  5002. stream.createFrame(132);
  5003. stream.method433(j + baseX);
  5004. stream.writeWord(i1 >> 14 & 0x7fff);
  5005. stream.method432(k + baseY);
  5006. }
  5007. if (actionId == 1125) {
  5008. ItemDef itemDef = ItemDef.forID(i1);
  5009. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5010. String s5;
  5011. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5012. s5 = NumberFormat.getInstance().format(class9_4.invStackSizes[j]) + " x " + itemDef.name;
  5013. else if (itemDef.description != null)
  5014. s5 = new String(itemDef.description);
  5015. else
  5016. s5 = "It's a " + itemDef.name + ".";
  5017. pushMessage(s5, 0, "");
  5018. }
  5019. if (actionId == 169) {
  5020. switch (k) {
  5021. case 29157:
  5022. tabInterfaceIDs[2] = 2648;
  5023. break;
  5024. case 2649:
  5025. launchURL("http://www.exodus317.com/vote");
  5026. break;
  5027. case 2652:
  5028. launchURL("http://www.exodus317.com/hiscores");
  5029. break;
  5030. case 2655:
  5031. launchURL("http://www.exodus317.com/donate");
  5032. break;
  5033. case 2658:
  5034. launchURL("http://www.exodus317.com");
  5035. break;
  5036. default:
  5037. stream.createFrame(185);
  5038. stream.writeWord(k);
  5039. break;
  5040. }
  5041. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5042. if (class9_3.valueIndexArray != null
  5043. && class9_3.valueIndexArray[0][0] == 5) {
  5044. int l2 = class9_3.valueIndexArray[0][1];
  5045. variousSettings[l2] = 1 - variousSettings[l2];
  5046. method33(l2);
  5047. needDrawTabArea = true;
  5048. }
  5049. }
  5050. if (actionId == 447) {
  5051. itemSelected = 1;
  5052. anInt1283 = j;
  5053. anInt1284 = k;
  5054. anInt1285 = i1;
  5055. selectedItemName = ItemDef.forID(i1).name;
  5056. spellSelected = 0;
  5057. needDrawTabArea = true;
  5058. return;
  5059. }
  5060. if (actionId == 1226) {
  5061. int j1 = i1 >> 14 & 0x7fff;
  5062. ObjectDef class46 = ObjectDef.forID(j1);
  5063. String s10;
  5064. if (class46.description != null)
  5065. s10 = new String(class46.description);
  5066. else
  5067. s10 = "It's a " + class46.name + ".";
  5068. pushMessage(s10, 0, "");
  5069. }
  5070. if (actionId == 244) {
  5071. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5072. myPlayer.smallX[0], false, j);
  5073. if (!flag7)
  5074. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5075. myPlayer.smallX[0], false, j);
  5076. crossX = super.saveClickX;
  5077. crossY = super.saveClickY;
  5078. crossType = 2;
  5079. crossIndex = 0;
  5080. stream.createFrame(253);
  5081. stream.method431(j + baseX);
  5082. stream.method433(k + baseY);
  5083. stream.method432(i1);
  5084. }
  5085. if (actionId == 1448) {
  5086. ItemDef itemDef_1 = ItemDef.forID(i1);
  5087. String s6;
  5088. if (itemDef_1.description != null)
  5089. s6 = new String(itemDef_1.description);
  5090. else
  5091. s6 = "It's a " + itemDef_1.name + ".";
  5092. pushMessage(s6, 0, "");
  5093. }
  5094. itemSelected = 0;
  5095. spellSelected = 0;
  5096. needDrawTabArea = true;
  5097.  
  5098. }
  5099.  
  5100. public void method70() {
  5101. anInt1251 = 0;
  5102. int j = (myPlayer.x >> 7) + baseX;
  5103. int k = (myPlayer.y >> 7) + baseY;
  5104. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5105. anInt1251 = 1;
  5106. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5107. anInt1251 = 1;
  5108. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5109. anInt1251 = 0;
  5110. }
  5111.  
  5112. public void run() {
  5113. if (drawFlames) {
  5114. drawFlames();
  5115. } else {
  5116. super.run();
  5117. }
  5118. }
  5119.  
  5120. private void build3dScreenMenu()
  5121. {
  5122. if(itemSelected == 0 && spellSelected == 0)
  5123. {
  5124. menuActionName[menuActionRow] = "Walk here";
  5125. menuActionIds[menuActionRow] = 516;
  5126. menuActionCmd2[menuActionRow] = super.mouseX;
  5127. menuActionCmd3[menuActionRow] = super.mouseY;
  5128. menuActionRow++;
  5129. }
  5130. int j = -1;
  5131. for(int k = 0; k < Model.objectsRendered; k++) {
  5132. int l = Model.objectsInCurrentRegion[k];
  5133. int i1 = l & 0x7f;
  5134. int j1 = l >> 7 & 0x7f;
  5135. int k1 = l >> 29 & 3;
  5136. int l1 = l >> 14 & 0x7fff;
  5137. if(l == j)
  5138. continue;
  5139. j = l;
  5140. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5141. l1 = Model.renderedObjectId[k];
  5142. ObjectDef class46 = ObjectDef.forID(l1);
  5143. if(class46.childrenIDs != null)
  5144. class46 = class46.method580();
  5145. if(class46 == null || class46.name == null || class46.name.equals("null"))
  5146. continue;
  5147. if(itemSelected == 1) {
  5148. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  5149. menuActionIds[menuActionRow] = 62;
  5150. menuActionCmd1[menuActionRow] = l;
  5151. menuActionCmd2[menuActionRow] = i1;
  5152. menuActionCmd3[menuActionRow] = j1;
  5153. menuActionCmd4[menuActionRow] = l1;
  5154. menuActionRow++;
  5155. } else if(spellSelected == 1) {
  5156. if((spellUsableOn & 4) == 4) {
  5157. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5158. menuActionIds[menuActionRow] = 956;
  5159. menuActionCmd1[menuActionRow] = l;
  5160. menuActionCmd2[menuActionRow] = i1;
  5161. menuActionCmd3[menuActionRow] = j1;
  5162. menuActionCmd4[menuActionRow] = l1;
  5163. menuActionRow++;
  5164. }
  5165. } else {
  5166. if(class46.actions != null) {
  5167. for(int i2 = 4; i2 >= 0; i2--)
  5168. if(class46.actions[i2] != null) {
  5169. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5170. if(i2 == 0)
  5171. menuActionIds[menuActionRow] = 502;
  5172. if(i2 == 1)
  5173. menuActionIds[menuActionRow] = 900;
  5174. if(i2 == 2)
  5175. menuActionIds[menuActionRow] = 113;
  5176. if(i2 == 3)
  5177. menuActionIds[menuActionRow] = 872;
  5178. if(i2 == 4)
  5179. menuActionIds[menuActionRow] = 1062;
  5180. menuActionCmd1[menuActionRow] = l;
  5181. menuActionCmd2[menuActionRow] = i1;
  5182. menuActionCmd3[menuActionRow] = j1;
  5183. menuActionCmd4[menuActionRow] = l1;
  5184. menuActionRow++;
  5185. }
  5186. }
  5187. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " (Anim: "+class46.anInt781+") (ID: "+ l1 + " / Models: " + class46.anIntArray773[0] +") ";
  5188. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  5189. 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@)";
  5190. } else {
  5191. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5192. }
  5193. menuActionIds[menuActionRow] = 1226;
  5194. menuActionCmd1[menuActionRow] = class46.type << 14;
  5195. menuActionCmd2[menuActionRow] = i1;
  5196. menuActionCmd3[menuActionRow] = j1;
  5197. menuActionCmd4[menuActionRow] = l1;
  5198. menuActionRow++;
  5199. }
  5200. }
  5201. if(k1 == 1)
  5202. {
  5203. NPC npc = npcArray[l1];
  5204. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  5205. {
  5206. for(int j2 = 0; j2 < npcCount; j2++)
  5207. {
  5208. NPC npc2 = npcArray[npcIndices[j2]];
  5209. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5210. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5211. }
  5212.  
  5213. for(int l2 = 0; l2 < playerCount; l2++)
  5214. {
  5215. Player player = playerArray[playerIndices[l2]];
  5216. if(player != null && player.x == npc.x && player.y == npc.y)
  5217. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5218. }
  5219.  
  5220. }
  5221. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5222. }
  5223. if(k1 == 0)
  5224. {
  5225. Player player = playerArray[l1];
  5226. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  5227. {
  5228. for(int k2 = 0; k2 < npcCount; k2++)
  5229. {
  5230. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5231. if(class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1 && class30_sub2_sub4_sub1_sub1_2.x == player.x && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  5232. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5233. }
  5234.  
  5235. for(int i3 = 0; i3 < playerCount; i3++)
  5236. {
  5237. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5238. 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)
  5239. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5240. }
  5241.  
  5242. }
  5243. buildAtPlayerMenu(i1, l1, player, j1);
  5244. }
  5245. if(k1 == 3)
  5246. {
  5247. NodeList class19 = groundArray[plane][i1][j1];
  5248. if(class19 != null)
  5249. {
  5250. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5251. {
  5252. ItemDef itemDef = ItemDef.forID(item.ID);
  5253. if(itemSelected == 1)
  5254. {
  5255. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5256. menuActionIds[menuActionRow] = 511;
  5257. menuActionCmd1[menuActionRow] = item.ID;
  5258. menuActionCmd2[menuActionRow] = i1;
  5259. menuActionCmd3[menuActionRow] = j1;
  5260. menuActionRow++;
  5261. } else
  5262. if(spellSelected == 1)
  5263. {
  5264. if((spellUsableOn & 1) == 1)
  5265. {
  5266. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5267. menuActionIds[menuActionRow] = 94;
  5268. menuActionCmd1[menuActionRow] = item.ID;
  5269. menuActionCmd2[menuActionRow] = i1;
  5270. menuActionCmd3[menuActionRow] = j1;
  5271. menuActionRow++;
  5272. }
  5273. } else
  5274. {
  5275. for(int j3 = 4; j3 >= 0; j3--)
  5276. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5277. {
  5278. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5279. if(j3 == 0)
  5280. menuActionIds[menuActionRow] = 652;
  5281. if(j3 == 1)
  5282. menuActionIds[menuActionRow] = 567;
  5283. if(j3 == 2)
  5284. menuActionIds[menuActionRow] = 234;
  5285. if(j3 == 3)
  5286. menuActionIds[menuActionRow] = 244;
  5287. if(j3 == 4)
  5288. menuActionIds[menuActionRow] = 213;
  5289. menuActionCmd1[menuActionRow] = item.ID;
  5290. menuActionCmd2[menuActionRow] = i1;
  5291. menuActionCmd3[menuActionRow] = j1;
  5292. menuActionRow++;
  5293. } else
  5294. if(j3 == 2)
  5295. {
  5296. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5297. menuActionIds[menuActionRow] = 234;
  5298. menuActionCmd1[menuActionRow] = item.ID;
  5299. menuActionCmd2[menuActionRow] = i1;
  5300. menuActionCmd3[menuActionRow] = j1;
  5301. menuActionRow++;
  5302. }
  5303. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  5304. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5305. } else {
  5306. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5307. }
  5308. menuActionIds[menuActionRow] = 1448;
  5309. menuActionCmd1[menuActionRow] = item.ID;
  5310. menuActionCmd2[menuActionRow] = i1;
  5311. menuActionCmd3[menuActionRow] = j1;
  5312. menuActionRow++;
  5313. }
  5314. }
  5315.  
  5316. }
  5317. }
  5318. }
  5319. }
  5320.  
  5321. public void cleanUpForQuit() {
  5322. SignLink.reporterror = false;
  5323. try {
  5324. if (socketStream != null)
  5325. socketStream.close();
  5326. } catch (Exception _ex) {
  5327. }
  5328. HPBarFull = null;
  5329. HPBarEmpty = null;
  5330. socketStream = null;
  5331. stopMidi();
  5332. if (mouseDetection != null)
  5333. mouseDetection.running = false;
  5334. mapIcon = null;
  5335. mouseDetection = null;
  5336. onDemandFetcher.disable();
  5337. onDemandFetcher = null;
  5338. aStream_834 = null;
  5339. stream = null;
  5340. aStream_847 = null;
  5341. inStream = null;
  5342. anIntArray1234 = null;
  5343. aByteArrayArray1183 = null;
  5344. aByteArrayArray1247 = null;
  5345. anIntArray1235 = null;
  5346. anIntArray1236 = null;
  5347. intGroundArray = null;
  5348. byteGroundArray = null;
  5349. worldController = null;
  5350. aClass11Array1230 = null;
  5351. anIntArrayArray901 = null;
  5352. anIntArrayArray825 = null;
  5353.  
  5354. chatArea = null;
  5355. chatButtons = null;
  5356. tabArea = null;
  5357. mapArea = null;
  5358. ORBS = null;
  5359. worldMapIcon = null;
  5360. logIconH = null;
  5361. logIconC = null;
  5362.  
  5363. bigX = null;
  5364. bigY = null;
  5365. aByteArray912 = null;
  5366. aRSImageProducer_1163 = null;
  5367. mapEdgeIP = null;
  5368. leftFrame = null;
  5369. topFrame = null;
  5370. rightFrame = null;
  5371. aRSImageProducer_1164 = null;
  5372. aRSImageProducer_1165 = null;
  5373. aRSImageProducer_1166 = null;
  5374. aRSImageProducer_1123 = null;
  5375. aRSImageProducer_1124 = null;
  5376. aRSImageProducer_1125 = null;
  5377. /* Null pointers for custom sprites */
  5378. multiOverlay = null;
  5379. chatArea = null;
  5380. chatButtons = null;
  5381. tabArea = null;
  5382. /**/
  5383. sideIcons = null;
  5384. redStones = null;
  5385. compass = null;
  5386. hitMarks = null;
  5387. headIcons = null;
  5388. skullIcons = null;
  5389. headIconsHint = null;
  5390. crosses = null;
  5391. mapDotItem = null;
  5392. mapDotNPC = null;
  5393. mapDotPlayer = null;
  5394. mapDotFriend = null;
  5395. mapDotTeam = null;
  5396. mapScenes = null;
  5397. mapFunctions = null;
  5398. anIntArrayArray929 = null;
  5399. playerArray = null;
  5400. playerIndices = null;
  5401. anIntArray894 = null;
  5402. aStreamArray895s = null;
  5403. anIntArray840 = null;
  5404. npcArray = null;
  5405. npcIndices = null;
  5406. groundArray = null;
  5407. aClass19_1179 = null;
  5408. aClass19_1013 = null;
  5409. aClass19_1056 = null;
  5410. menuActionCmd2 = null;
  5411. menuActionCmd3 = null;
  5412. menuActionCmd4 = null;
  5413. menuActionIds = null;
  5414. menuActionCmd1 = null;
  5415. menuActionName = null;
  5416. variousSettings = null;
  5417. anIntArray1072 = null;
  5418. anIntArray1073 = null;
  5419. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5420. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5421. friendsList = null;
  5422. friendsListAsLongs = null;
  5423. friendsNodeIDs = null;
  5424. aRSImageProducer_1110 = null;
  5425. aRSImageProducer_1111 = null;
  5426. aRSImageProducer_1107 = null;
  5427. aRSImageProducer_1108 = null;
  5428. aRSImageProducer_1109 = null;
  5429. aRSImageProducer_1112 = null;
  5430. aRSImageProducer_1113 = null;
  5431. aRSImageProducer_1114 = null;
  5432. aRSImageProducer_1115 = null;
  5433. nullLoader();
  5434. ObjectDef.nullLoader();
  5435. EntityDef.nullLoader();
  5436. ItemDef.nullLoader();
  5437. Flo.cache = null;
  5438. IDK.cache = null;
  5439. RSInterface.interfaceCache = null;
  5440. Animation.anims = null;
  5441. SpotAnim.cache = null;
  5442. SpotAnim.aMRUNodes_415 = null;
  5443. Varp.cache = null;
  5444. super.fullGameScreen = null;
  5445. Player.mruNodes = null;
  5446. Rasterizer.nullLoader();
  5447. WorldController.nullLoader();
  5448. Model.nullLoader();
  5449. Class36.nullLoader();
  5450. System.gc();
  5451. }
  5452.  
  5453. public void printDebug() {
  5454. System.out.println("============");
  5455. System.out.println("flame-cycle:" + anInt1208);
  5456. if (onDemandFetcher != null)
  5457. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5458. System.out.println("loop-cycle:" + loopCycle);
  5459. System.out.println("draw-cycle:" + anInt1061);
  5460. System.out.println("ptype:" + pktType);
  5461. System.out.println("psize:" + pktSize);
  5462. if (socketStream != null)
  5463. socketStream.printDebug();
  5464. super.shouldDebug = true;
  5465. }
  5466.  
  5467. Component getGameComponent() {
  5468. if (SignLink.mainapp != null)
  5469. return SignLink.mainapp;
  5470. if (super.gameFrame != null)
  5471. return super.gameFrame;
  5472. else
  5473. return this;
  5474. }
  5475.  
  5476. public void pmTabToReply() {
  5477. String name = null;
  5478. for (int k = 0; k < 100; k++) {
  5479. if (chatMessages[k] == null) {
  5480. continue;
  5481. }
  5482. int l = chatTypes[k];
  5483. if (l == 3 || l == 7) {
  5484. name = chatNames[k];
  5485. break;
  5486. }
  5487. }
  5488.  
  5489. if (name == null) {
  5490. pushMessage("You haven't received any messages to which you can reply.", 0, "");
  5491. return;
  5492. }
  5493.  
  5494. if (name.startsWith("@cr")) {
  5495. name = name.substring(5);
  5496. }
  5497.  
  5498. long nameAsLong = TextClass.longForName(name.trim());
  5499. int k3 = -1;
  5500. for (int i4 = 0; i4 < friendsCount; i4++) {
  5501. if (friendsListAsLongs[i4] != nameAsLong)
  5502. continue;
  5503. k3 = i4;
  5504. break;
  5505. }
  5506.  
  5507. if (k3 != -1) {
  5508. if (friendsNodeIDs[k3] > 0) {
  5509. inputTaken = true;
  5510. inputDialogState = 0;
  5511. messagePromptRaised = true;
  5512. promptInput = "";
  5513. friendsListAction = 3;
  5514. aLong953 = friendsListAsLongs[k3];
  5515. aString1121 = "Enter message to send to " + friendsList[k3];
  5516. } else {
  5517. pushMessage("That player is currently offline.", 0, "");
  5518. }
  5519. }
  5520. }
  5521.  
  5522. public class ObjectSizes {
  5523. int objectId, sizeX, sizeY;
  5524.  
  5525. public ObjectSizes() {
  5526. }
  5527.  
  5528. public ObjectSizes(int objectId, int sizeX, int sizeY) {
  5529. this.objectId = objectId;
  5530. this.sizeX = sizeX;
  5531. this.sizeY = sizeY;
  5532. }
  5533.  
  5534. public int getObjectId() {
  5535. return objectId;
  5536. }
  5537.  
  5538. public void setObjectId(int objectId) {
  5539. this.objectId = objectId;
  5540. }
  5541.  
  5542. public int getSizeX() {
  5543. return sizeX;
  5544. }
  5545.  
  5546. public void setSizeX(int sizeX) {
  5547. this.sizeX = sizeX;
  5548. }
  5549.  
  5550. public int getSizeY() {
  5551. return sizeY;
  5552. }
  5553.  
  5554. public void setSizeY(int sizeY) {
  5555. this.sizeY = sizeY;
  5556. }
  5557. }
  5558.  
  5559. public void method73() {
  5560. do {
  5561. int j = readChar(-796);
  5562. if(j == -1)
  5563. break;
  5564. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5565. if(j == 8 && reportAbuseInput.length() > 0)
  5566. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5567. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5568. reportAbuseInput += (char)j;
  5569. } else if(messagePromptRaised) {
  5570. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5571. promptInput += (char)j;
  5572. inputTaken = true;
  5573. }
  5574. if(j == 8 && promptInput.length() > 0) {
  5575. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5576. inputTaken = true;
  5577. }
  5578. if(j == 13 || j == 10) {
  5579. messagePromptRaised = false;
  5580. inputTaken = true;
  5581. if(friendsListAction == 1) {
  5582. long l = TextClass.longForName(promptInput);
  5583. addFriend(l);
  5584. }
  5585. if(friendsListAction == 2 && friendsCount > 0) {
  5586. long l1 = TextClass.longForName(promptInput);
  5587. delFriend(l1);
  5588. }
  5589. if(friendsListAction == 3 && promptInput.length() > 0) {
  5590. stream.createFrame(126);
  5591. stream.writeWordBigEndian(0);
  5592. int k = stream.currentOffset;
  5593. stream.writeQWord(aLong953);
  5594. TextInput.method526(promptInput, stream);
  5595. stream.writeBytes(stream.currentOffset - k);
  5596. promptInput = TextInput.processText(promptInput);
  5597. //promptInput = Censor.doCensor(promptInput);
  5598. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5599. if(publicChatMode == 2) {
  5600. publicChatMode = 1;
  5601. stream.createFrame(95);
  5602. stream.writeWordBigEndian(publicChatMode);
  5603. stream.writeWordBigEndian(publicChatMode);
  5604. stream.writeWordBigEndian(tradeMode);
  5605. }
  5606. }
  5607. if(friendsListAction == 4 && ignoreCount < 100) {
  5608. long l2 = TextClass.longForName(promptInput);
  5609. addIgnore(l2);
  5610. }
  5611. if(friendsListAction == 5 && ignoreCount > 0) {
  5612. long l3 = TextClass.longForName(promptInput);
  5613. delIgnore(l3);
  5614. }
  5615. if(friendsListAction == 6) {
  5616. long l3 = TextClass.longForName(promptInput);
  5617. chatJoin(l3);
  5618. }
  5619. }
  5620. } else if (inputDialogState == 1) {
  5621. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5622. amountOrNameInput += (char) j;
  5623. inputTaken = true;
  5624. }
  5625. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  5626. amountOrNameInput += (char) j;
  5627. inputTaken = true;
  5628. }
  5629. if (j == 8 && amountOrNameInput.length() > 0) {
  5630. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5631. inputTaken = true;
  5632. }
  5633. if (j == 13 || j == 10) {
  5634. if (amountOrNameInput.length() > 0) {
  5635. if (amountOrNameInput.toLowerCase().contains("k")) {
  5636. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  5637. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  5638. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  5639. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  5640. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  5641. }
  5642.  
  5643. long amount = Long.parseLong(amountOrNameInput);
  5644.  
  5645. if (amount > Integer.MAX_VALUE) {
  5646. amount = Integer.MAX_VALUE;
  5647. }
  5648.  
  5649. stream.createFrame(208);
  5650. stream.writeDWord((int) amount);
  5651. }
  5652. inputDialogState = 0;
  5653. inputTaken = true;
  5654. }
  5655. } else if(inputDialogState == 2) {
  5656. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5657. amountOrNameInput += (char)j;
  5658. inputTaken = true;
  5659. }
  5660. if(j == 8 && amountOrNameInput.length() > 0) {
  5661. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5662. inputTaken = true;
  5663. }
  5664. if(j == 13 || j == 10) {
  5665. if(amountOrNameInput.length() > 0) {
  5666. stream.createFrame(60);
  5667. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5668. }
  5669. inputDialogState = 0;
  5670. inputTaken = true;
  5671. }
  5672. } else if(backDialogID == -1) {
  5673. if(j >= 32 && j <= 122 && inputString.length() < 100) {
  5674. inputString += (char) j;
  5675. inputString = inputString.replaceAll("<[^>]*>", "").replaceAll("@[^@]*@", "").replaceAll(":tradereq:", "").replaceAll(":duelreq:", "");
  5676. inputTaken = true;
  5677. }
  5678. if(j == 8 && inputString.length() > 0) {
  5679. inputString = inputString.substring(0, inputString.length() - 1);
  5680. inputTaken = true;
  5681. }
  5682. if (j == 9)
  5683. pmTabToReply();
  5684. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5685. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  5686. if (inputString.startsWith("//setspecto")) {
  5687. int amt = Integer.parseInt(inputString
  5688. .substring(12));
  5689. anIntArray1045[300] = amt;
  5690. if (variousSettings[300] != amt) {
  5691. variousSettings[300] = amt;
  5692. method33(300);
  5693. needDrawTabArea = true;
  5694. if (dialogID != -1)
  5695. inputTaken = true;
  5696. }
  5697. }
  5698. if (inputString.equals("::clientdrop"))
  5699. dropClient();
  5700. /*if (inputString.startsWith("full")) {
  5701. try {
  5702. String[] args = inputString.split(" ");
  5703. int id1 = Integer.parseInt(args[1]);
  5704. int id2 = Integer.parseInt(args[2]);
  5705. fullscreenInterfaceID = id1;
  5706. openInterfaceID = id2;
  5707. pushMessage("Opened Interface", 0, "");
  5708. } catch (Exception e) {
  5709. pushMessage("Interface Failed to load", 0, "");
  5710. }
  5711. }*/
  5712. if (inputString.equals("::lag"))
  5713. printDebug();
  5714. /*if (inputString.equals("::prefetchmusic")) {
  5715. for (int j1 = 0; j1 < onDemandFetcher
  5716. .getVersionCount(2); j1++)
  5717. onDemandFetcher.method563((byte) 1, 2, j1);
  5718.  
  5719. }
  5720. if (inputString.equals("::maps"))
  5721. addMaps();
  5722. if (inputString.equals("::models"))
  5723. addModels();*/
  5724. if (inputString.equals("::fpson"))
  5725. fpsOn = true;
  5726. if (inputString.equals("::fpsoff"))
  5727. fpsOn = false;
  5728. if (inputString.equals("::dataon"))
  5729. clientData = true;
  5730. if (inputString.equals("::dataoff"))
  5731. clientData = false;
  5732. if (inputString.equals("::noclip")) {
  5733. for (int k1 = 0; k1 < 4; k1++) {
  5734. for (int i2 = 1; i2 < 103; i2++) {
  5735. for (int k2 = 1; k2 < 103; k2++)
  5736. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5737. }
  5738. }
  5739. }
  5740. /*if (inputString.equals("dump")) {
  5741. List<ObjectDef> list = new ArrayList<ObjectDef>();
  5742. for (int i = 0; i < ObjectDef.totalObjects; i++) {
  5743. ObjectDef object = ObjectDef.forID(i);
  5744. System.out.println(new Gson().toJson(object));
  5745. list.add(object.type, object);
  5746. }
  5747.  
  5748. // System.out.println(new Gson().toJson(list));
  5749.  
  5750. PrintWriter writer;
  5751. try {
  5752. writer = new PrintWriter("./objects.json", "UTF-8");
  5753. writer.println(new Gson().toJson(list));
  5754. writer.close();
  5755. } catch (Exception e) {
  5756. e.printStackTrace();
  5757. }
  5758. }*/
  5759. if (inputString.equals("::sprites")) {
  5760. if (Sprite.sprites.size() == 0) {
  5761. Sprite.walk(SignLink.findcachedir() + "Sprites");
  5762. }
  5763.  
  5764. for (String sprite : Sprite.spritesInUse) {
  5765. if (!Sprite.sprites.contains(sprite)) {
  5766. /*File file = new File(sprite);
  5767. file.delete();*/
  5768. System.out.println(sprite);
  5769. }
  5770. }
  5771.  
  5772. System.out.println(Sprite.sprites.size() + "-" + Sprite.spritesInUse.size());
  5773. }
  5774. if (inputString.equals("::rsint")) {
  5775. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  5776. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  5777. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  5778. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  5779. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  5780. };
  5781. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  5782. }
  5783. }
  5784.  
  5785. /*if (inputString.equals("add model")) {
  5786. try {
  5787. int ModelIndex = Integer.parseInt(JOptionPane
  5788. .showInputDialog(this, "Enter model ID",
  5789. "Model", 3));
  5790. byte[] abyte0 = getModel(ModelIndex);
  5791. if (abyte0 != null && abyte0.length > 0) {
  5792. decompressors[1].method234(abyte0.length,
  5793. abyte0, ModelIndex);
  5794. pushMessage("Model: [" + ModelIndex
  5795. + "] added successfully!", 0, "");
  5796. } else {
  5797. pushMessage("Unable to find the model. "
  5798. + ModelIndex, 0, "");
  5799. }
  5800. } catch (Exception e) {
  5801. pushMessage("Syntax - ::add model <path>", 0, "");
  5802. }
  5803. }
  5804. if (inputString.equalsIgnoreCase("hd")) {
  5805. disableUnderlayTexture = !disableUnderlayTexture;
  5806. disableOverlayTexture = !disableOverlayTexture;
  5807. }*/
  5808. if(inputString.startsWith("/"))
  5809. inputString = "::" + inputString;
  5810. if (inputString.startsWith("::")) {
  5811. stream.createFrame(103);
  5812. stream.writeWordBigEndian(inputString.length() - 1);
  5813. stream.writeString(inputString.substring(2));
  5814. } else {
  5815. String s = inputString.toLowerCase();
  5816. int j2 = 0;
  5817. if (s.startsWith("yellow:")) {
  5818. j2 = 0;
  5819. inputString = inputString.substring(7);
  5820. } else if (s.startsWith("red:")) {
  5821. j2 = 1;
  5822. inputString = inputString.substring(4);
  5823. } else if (s.startsWith("green:")) {
  5824. j2 = 2;
  5825. inputString = inputString.substring(6);
  5826. } else if (s.startsWith("cyan:")) {
  5827. j2 = 3;
  5828. inputString = inputString.substring(5);
  5829. } else if (s.startsWith("purple:")) {
  5830. j2 = 4;
  5831. inputString = inputString.substring(7);
  5832. } else if (s.startsWith("white:")) {
  5833. j2 = 5;
  5834. inputString = inputString.substring(6);
  5835. } else if (s.startsWith("flash1:")) {
  5836. j2 = 6;
  5837. inputString = inputString.substring(7);
  5838. } else if (s.startsWith("flash2:")) {
  5839. j2 = 7;
  5840. inputString = inputString.substring(7);
  5841. } else if (s.startsWith("flash3:")) {
  5842. j2 = 8;
  5843. inputString = inputString.substring(7);
  5844. } else if (s.startsWith("glow1:")) {
  5845. j2 = 9;
  5846. inputString = inputString.substring(6);
  5847. } else if (s.startsWith("glow2:")) {
  5848. j2 = 10;
  5849. inputString = inputString.substring(6);
  5850. } else if (s.startsWith("glow3:")) {
  5851. j2 = 11;
  5852. inputString = inputString.substring(6);
  5853. }
  5854. s = inputString.toLowerCase();
  5855. int i3 = 0;
  5856. if (s.startsWith("wave:")) {
  5857. i3 = 1;
  5858. inputString = inputString.substring(5);
  5859. } else if (s.startsWith("wave2:")) {
  5860. i3 = 2;
  5861. inputString = inputString.substring(6);
  5862. } else if (s.startsWith("shake:")) {
  5863. i3 = 3;
  5864. inputString = inputString.substring(6);
  5865. } else if (s.startsWith("scroll:")) {
  5866. i3 = 4;
  5867. inputString = inputString.substring(7);
  5868. } else if (s.startsWith("slide:")) {
  5869. i3 = 5;
  5870. inputString = inputString.substring(6);
  5871. }
  5872. stream.createFrame(4);
  5873. stream.writeWordBigEndian(0);
  5874. int j3 = stream.currentOffset;
  5875. stream.method425(i3);
  5876. stream.method425(j2);
  5877. aStream_834.currentOffset = 0;
  5878. TextInput.method526(inputString, aStream_834);
  5879. stream.method441(0, aStream_834.buffer,
  5880. aStream_834.currentOffset);
  5881. stream.writeBytes(stream.currentOffset - j3);
  5882. inputString = TextInput.processText(inputString);
  5883. // inputString = Censor.doCensor(inputString);
  5884. myPlayer.textSpoken = inputString;
  5885. myPlayer.anInt1513 = j2;
  5886. myPlayer.anInt1531 = i3;
  5887. myPlayer.textCycle = 150;
  5888. if (myPrivilege == 1)
  5889. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5890. else if (myPrivilege == 2)
  5891. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5892. else if (myPrivilege == 3)
  5893. pushMessage(myPlayer.textSpoken, 2, "@cr3@" + myPlayer.name);
  5894. else if (myPrivilege == 4)
  5895. pushMessage(myPlayer.textSpoken, 2, "@cr4@" + myPlayer.name);
  5896. else if (myPrivilege == 5)
  5897. pushMessage(myPlayer.textSpoken, 2, "@cr5@" + myPlayer.name);
  5898. else if (myPrivilege == 6)
  5899. pushMessage(myPlayer.textSpoken, 2, "@cr6@" + myPlayer.name);
  5900. else if (myPrivilege == 7)
  5901. pushMessage(myPlayer.textSpoken, 2, "@cr7@" + myPlayer.name);
  5902. else if (myPrivilege == 8)
  5903. pushMessage(myPlayer.textSpoken, 2, "@cr8@" + myPlayer.name);
  5904. else if (myPrivilege == 9)
  5905. pushMessage(myPlayer.textSpoken, 2, "@cr9@" + myPlayer.name);
  5906. else if (myPrivilege == 10)
  5907. pushMessage(myPlayer.textSpoken, 2, "@cr10@" + myPlayer.name);
  5908. else if (myPrivilege == 11)
  5909. pushMessage(myPlayer.textSpoken, 2, "@cr11@" + myPlayer.name);
  5910. else if (myPrivilege == 12)
  5911. pushMessage(myPlayer.textSpoken, 2, "@cr12@" + myPlayer.name);
  5912. else if (myPrivilege == 13)
  5913. pushMessage(myPlayer.textSpoken, 2, "@cr13@" + myPlayer.name);
  5914. else if (myPrivilege == 14)
  5915. pushMessage(myPlayer.textSpoken, 2, "@cr14@" + myPlayer.name);
  5916. else if (myPrivilege == 15)
  5917. pushMessage(myPlayer.textSpoken, 2, "@cr15@" + myPlayer.name);
  5918. else if (myPrivilege == 16)
  5919. pushMessage(myPlayer.textSpoken, 2, "@cr16@" + myPlayer.name);
  5920. else if (myPrivilege == 17)
  5921. pushMessage(myPlayer.textSpoken, 2, "@cr17@" + myPlayer.name);
  5922. else if (myPrivilege == 18)
  5923. pushMessage(myPlayer.textSpoken, 2, "@cr18@" + myPlayer.name);
  5924. else if (myPrivilege == 19)
  5925. pushMessage(myPlayer.textSpoken, 2, "@cr19@" + myPlayer.name);
  5926. else if (myPrivilege == 20)
  5927. pushMessage(myPlayer.textSpoken, 2, "@cr20@" + myPlayer.name);
  5928. else
  5929. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5930. if (publicChatMode == 2) {
  5931. publicChatMode = 3;
  5932. aBoolean1233 = true;
  5933. stream.createFrame(95);
  5934. stream.writeWordBigEndian(publicChatMode);
  5935. stream.writeWordBigEndian(publicChatMode);
  5936. stream.writeWordBigEndian(tradeMode);
  5937. }
  5938. }
  5939. inputString = "";
  5940. inputTaken = true;
  5941. }
  5942. }
  5943. } while (true);
  5944. }
  5945.  
  5946. @SuppressWarnings("unused")
  5947. public void buildPublicChat(int j) {
  5948. int l = 0;
  5949. for (int i1 = 0; i1 < 500; i1++) {
  5950. if (chatMessages[i1] == null)
  5951. continue;
  5952. if (chatTypeView != 1)
  5953. continue;
  5954. int j1 = chatTypes[i1];
  5955. String s = chatNames[i1];
  5956. String ct = chatMessages[i1];
  5957. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5958. if (k1 < -23)
  5959. break;
  5960. if(s != null && s.startsWith("@cr1@"))
  5961. s = s.substring(5);
  5962. if(s != null && s.startsWith("@cr2@"))
  5963. s = s.substring(5);
  5964. if(s != null && s.startsWith("@cr3@"))
  5965. s = s.substring(5);
  5966. if(s != null && s.startsWith("@cr4@"))
  5967. s = s.substring(5);
  5968. if(s != null && s.startsWith("@cr5@"))
  5969. s = s.substring(5);
  5970. if(s != null && s.startsWith("@cr6@"))
  5971. s = s.substring(5);
  5972. if(s != null && s.startsWith("@cr7@"))
  5973. s = s.substring(5);
  5974. if(s != null && s.startsWith("@cr8@"))
  5975. s = s.substring(5);
  5976. if(s != null && s.startsWith("@cr9@"))
  5977. s = s.substring(5);
  5978. if(s != null && s.startsWith("@cr10@"))
  5979. s = s.substring(6);
  5980. if(s != null && s.startsWith("@cr11@"))
  5981. s = s.substring(6);
  5982. if(s != null && s.startsWith("@cr12@"))
  5983. s = s.substring(6);
  5984. if(s != null && s.startsWith("@cr13@"))
  5985. s = s.substring(6);
  5986. if(s != null && s.startsWith("@cr14@"))
  5987. s = s.substring(6);
  5988. if(s != null && s.startsWith("@cr15@"))
  5989. s = s.substring(6);
  5990. if(s != null && s.startsWith("@cr16@"))
  5991. s = s.substring(6);
  5992. if(s != null && s.startsWith("@cr17@"))
  5993. s = s.substring(6);
  5994. if(s != null && s.startsWith("@cr18@"))
  5995. s = s.substring(6);
  5996. if(s != null && s.startsWith("@cr19@"))
  5997. s = s.substring(6);
  5998. if(s != null && s.startsWith("@cr20@"))
  5999. s = s.substring(6);
  6000. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6001. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6002. if (myPrivilege >= 1) {
  6003. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6004. menuActionIds[menuActionRow] = 606;
  6005. menuActionRow++;
  6006. }
  6007. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6008. menuActionIds[menuActionRow] = 42;
  6009. menuActionRow++;
  6010. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6011. menuActionIds[menuActionRow] = 337;
  6012. menuActionRow++;
  6013. }
  6014. l++;
  6015. }
  6016. }
  6017. }
  6018.  
  6019. @SuppressWarnings("unused")
  6020. public void buildFriendChat(int j) {
  6021. int l = 0;
  6022. for (int i1 = 0; i1 < 500; i1++) {
  6023. if (chatMessages[i1] == null)
  6024. continue;
  6025. if (chatTypeView != 2)
  6026. continue;
  6027. int j1 = chatTypes[i1];
  6028. String s = chatNames[i1];
  6029. String ct = chatMessages[i1];
  6030. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6031. if (k1 < -23)
  6032. break;
  6033. if(s != null && s.startsWith("@cr1@"))
  6034. s = s.substring(5);
  6035. if(s != null && s.startsWith("@cr2@"))
  6036. s = s.substring(5);
  6037. if(s != null && s.startsWith("@cr3@"))
  6038. s = s.substring(5);
  6039. if(s != null && s.startsWith("@cr4@"))
  6040. s = s.substring(5);
  6041. if(s != null && s.startsWith("@cr5@"))
  6042. s = s.substring(5);
  6043. if(s != null && s.startsWith("@cr6@"))
  6044. s = s.substring(5);
  6045. if(s != null && s.startsWith("@cr7@"))
  6046. s = s.substring(5);
  6047. if(s != null && s.startsWith("@cr8@"))
  6048. s = s.substring(5);
  6049. if(s != null && s.startsWith("@cr9@"))
  6050. s = s.substring(5);
  6051. if(s != null && s.startsWith("@cr10@"))
  6052. s = s.substring(6);
  6053. if(s != null && s.startsWith("@cr11@"))
  6054. s = s.substring(6);
  6055. if(s != null && s.startsWith("@cr12@"))
  6056. s = s.substring(6);
  6057. if(s != null && s.startsWith("@cr13@"))
  6058. s = s.substring(6);
  6059. if(s != null && s.startsWith("@cr14@"))
  6060. s = s.substring(6);
  6061. if(s != null && s.startsWith("@cr15@"))
  6062. s = s.substring(6);
  6063. if(s != null && s.startsWith("@cr16@"))
  6064. s = s.substring(6);
  6065. if(s != null && s.startsWith("@cr17@"))
  6066. s = s.substring(6);
  6067. if(s != null && s.startsWith("@cr18@"))
  6068. s = s.substring(6);
  6069. if(s != null && s.startsWith("@cr19@"))
  6070. s = s.substring(6);
  6071. if(s != null && s.startsWith("@cr20@"))
  6072. s = s.substring(6);
  6073. if ((j1 == 5 || j1 == 6)
  6074. && (splitpublicChat == 0 || chatTypeView == 2)
  6075. && (j1 == 6 || publicChatMode == 0 || publicChatMode == 1
  6076. && isFriendOrSelf(s)))
  6077. l++;
  6078. if ((j1 == 3 || j1 == 7)
  6079. && (splitpublicChat == 0 || chatTypeView == 2)
  6080. && (j1 == 7 || publicChatMode == 0 || publicChatMode == 1
  6081. && isFriendOrSelf(s))) {
  6082. if (j > k1 - 14 && j <= k1) {
  6083. if (myPrivilege >= 1) {
  6084. menuActionName[menuActionRow] = "Report abuse @whi@"
  6085. + s;
  6086. menuActionIds[menuActionRow] = 606;
  6087. menuActionRow++;
  6088. }
  6089. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6090. menuActionIds[menuActionRow] = 42;
  6091. menuActionRow++;
  6092. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6093. menuActionIds[menuActionRow] = 337;
  6094. menuActionRow++;
  6095. }
  6096. l++;
  6097. }
  6098. }
  6099. }
  6100.  
  6101. public void buildDuelorTrade(int j) {
  6102. int l = 0;
  6103. for (int i1 = 0; i1 < 500; i1++) {
  6104. if (chatMessages[i1] == null)
  6105. continue;
  6106. if (chatTypeView != 3 && chatTypeView != 4)
  6107. continue;
  6108. int j1 = chatTypes[i1];
  6109. String s = chatNames[i1];
  6110. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6111. if (k1 < -23)
  6112. break;
  6113. if(s != null && s.startsWith("@cr1@"))
  6114. s = s.substring(5);
  6115. if(s != null && s.startsWith("@cr2@"))
  6116. s = s.substring(5);
  6117. if(s != null && s.startsWith("@cr3@"))
  6118. s = s.substring(5);
  6119. if(s != null && s.startsWith("@cr4@"))
  6120. s = s.substring(5);
  6121. if(s != null && s.startsWith("@cr5@"))
  6122. s = s.substring(5);
  6123. if(s != null && s.startsWith("@cr6@"))
  6124. s = s.substring(5);
  6125. if(s != null && s.startsWith("@cr7@"))
  6126. s = s.substring(5);
  6127. if(s != null && s.startsWith("@cr8@"))
  6128. s = s.substring(5);
  6129. if(s != null && s.startsWith("@cr9@"))
  6130. s = s.substring(5);
  6131. if(s != null && s.startsWith("@cr10@"))
  6132. s = s.substring(6);
  6133. if(s != null && s.startsWith("@cr11@"))
  6134. s = s.substring(6);
  6135. if(s != null && s.startsWith("@cr12@"))
  6136. s = s.substring(6);
  6137. if(s != null && s.startsWith("@cr13@"))
  6138. s = s.substring(6);
  6139. if(s != null && s.startsWith("@cr14@"))
  6140. s = s.substring(6);
  6141. if(s != null && s.startsWith("@cr15@"))
  6142. s = s.substring(6);
  6143. if(s != null && s.startsWith("@cr16@"))
  6144. s = s.substring(6);
  6145. if(s != null && s.startsWith("@cr17@"))
  6146. s = s.substring(6);
  6147. if(s != null && s.startsWith("@cr18@"))
  6148. s = s.substring(6);
  6149. if(s != null && s.startsWith("@cr19@"))
  6150. s = s.substring(6);
  6151. if(s != null && s.startsWith("@cr20@"))
  6152. s = s.substring(6);
  6153. if (chatTypeView == 3 && j1 == 4
  6154. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6155. if (j > k1 - 14 && j <= k1) {
  6156. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6157. menuActionIds[menuActionRow] = 484;
  6158. menuActionRow++;
  6159. }
  6160. l++;
  6161. }
  6162. if (chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6163. if (j > k1 - 14 && j <= k1) {
  6164. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6165. + s;
  6166. menuActionIds[menuActionRow] = 6;
  6167. menuActionRow++;
  6168. }
  6169. l++;
  6170. }
  6171. if(chatTypeView == 4 && j1 == 15 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6172. if(j > k1 - 14 && j <= k1) {
  6173. menuActionName[menuActionRow] = "Accept party invite @whi@" + s;
  6174. menuActionIds[menuActionRow] = 424;
  6175. menuActionRow++;
  6176. }
  6177. l++;
  6178. }
  6179. if (j1 == 12) {
  6180. if (j > k1 - 14 && j <= k1) {
  6181. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6182. menuActionIds[menuActionRow] = 915;
  6183. menuActionRow++;
  6184. }
  6185. l++;
  6186. }
  6187. }
  6188. }
  6189.  
  6190. @SuppressWarnings("unused")
  6191. public void buildChatAreaMenu(int j) {
  6192. int l = 0;
  6193. int test = 0;
  6194. for (int i1 = 0; i1 < 500; i1++) {
  6195. if (chatMessages[i1] == null)
  6196. continue;
  6197. int j1 = chatTypes[i1];
  6198. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6199. if (k1 < -23)
  6200. break;
  6201. String s = chatNames[i1];
  6202. String ct = chatMessages[i1];
  6203. boolean flag = false;
  6204. if (chatTypeView == 1) {
  6205. buildPublicChat(j);
  6206. break;
  6207. }
  6208. if (chatTypeView == 2) {
  6209. buildFriendChat(j);
  6210. break;
  6211. }
  6212. if (chatTypeView == 3 || chatTypeView == 4) {
  6213. buildDuelorTrade(j);
  6214. break;
  6215. }
  6216. if (chatTypeView == 5) {
  6217. break;
  6218. }
  6219. if(s != null && s.startsWith("@cr1@")) {
  6220. s = s.substring(5);
  6221. }
  6222. if(s != null && s.startsWith("@cr2@")) {
  6223. s = s.substring(5);
  6224. }
  6225. if(s != null && s.startsWith("@cr3@")) {
  6226. s = s.substring(5);
  6227. }
  6228. if(s != null && s.startsWith("@cr4@")) {
  6229. s = s.substring(5);
  6230. }
  6231. if(s != null && s.startsWith("@cr5@")) {
  6232. s = s.substring(5);
  6233. }
  6234. if(s != null && s.startsWith("@cr6@")) {
  6235. s = s.substring(5);
  6236. }
  6237. if(s != null && s.startsWith("@cr7@")) {
  6238. s = s.substring(5);
  6239. }
  6240. if(s != null && s.startsWith("@cr8@")) {
  6241. s = s.substring(5);
  6242. }
  6243. if(s != null && s.startsWith("@cr9@")) {
  6244. s = s.substring(5);
  6245. }
  6246. if(s != null && s.startsWith("@cr10@")) {
  6247. s = s.substring(6);
  6248. }
  6249. if(s != null && s.startsWith("@cr11@")) {
  6250. s = s.substring(6);
  6251. }
  6252. if(s != null && s.startsWith("@cr12@")) {
  6253. s = s.substring(6);
  6254. }
  6255. if(s != null && s.startsWith("@cr13@")) {
  6256. s = s.substring(6);
  6257. }
  6258. if(s != null && s.startsWith("@cr14@")) {
  6259. s = s.substring(6);
  6260. }
  6261. if(s != null && s.startsWith("@cr15@")) {
  6262. s = s.substring(6);
  6263. }
  6264. if(s != null && s.startsWith("@cr16@")) {
  6265. s = s.substring(6);
  6266. }
  6267. if(s != null && s.startsWith("@cr17@")) {
  6268. s = s.substring(6);
  6269. }
  6270. if(s != null && s.startsWith("@cr18@")) {
  6271. s = s.substring(6);
  6272. }
  6273. if(s != null && s.startsWith("@cr19@")) {
  6274. s = s.substring(6);
  6275. }
  6276. if(s != null && s.startsWith("@cr20@")) {
  6277. s = s.substring(6);
  6278. }
  6279. if (j1 == 0)
  6280. l++;
  6281. if ((j1 == 1 || j1 == 2)
  6282. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  6283. && isFriendOrSelf(s))) {
  6284. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6285. if (myPrivilege >= 1) {
  6286. menuActionName[menuActionRow] = "Report abuse @whi@"
  6287. + s;
  6288. menuActionIds[menuActionRow] = 606;
  6289. menuActionRow++;
  6290. }
  6291. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6292. menuActionIds[menuActionRow] = 42;
  6293. menuActionRow++;
  6294. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6295. menuActionIds[menuActionRow] = 337;
  6296. menuActionRow++;
  6297. }
  6298. l++;
  6299. }
  6300. if ((j1 == 3 || j1 == 7)
  6301. && splitpublicChat == 0
  6302. && (j1 == 7 || publicChatMode == 0 || publicChatMode == 1
  6303. && isFriendOrSelf(s))) {
  6304. if (j > k1 - 14 && j <= k1) {
  6305. if (myPrivilege >= 1) {
  6306. menuActionName[menuActionRow] = "Report abuse @whi@"
  6307. + s;
  6308. menuActionIds[menuActionRow] = 606;
  6309. menuActionRow++;
  6310. }
  6311. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6312. menuActionIds[menuActionRow] = 42;
  6313. menuActionRow++;
  6314. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6315. menuActionIds[menuActionRow] = 337;
  6316. menuActionRow++;
  6317. }
  6318. l++;
  6319. }
  6320. if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6321. if (j > k1 - 14 && j <= k1) {
  6322. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6323. menuActionIds[menuActionRow] = 484;
  6324. menuActionRow++;
  6325. }
  6326. l++;
  6327. }
  6328. if ((j1 == 5 || j1 == 6) && splitpublicChat == 0
  6329. && publicChatMode < 2)
  6330. l++;
  6331. if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6332. if (j > k1 - 14 && j <= k1) {
  6333. menuActionName[menuActionRow] = "Accept challenge @whi@"
  6334. + s;
  6335. menuActionIds[menuActionRow] = 6;
  6336. menuActionRow++;
  6337. }
  6338. l++;
  6339. }
  6340. if(j1 == 15 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6341. if(j > k1 - 14 && j <= k1) {
  6342. menuActionName[menuActionRow] = "Accept party invite @whi@" + s;
  6343. menuActionIds[menuActionRow] = 424;
  6344. menuActionRow++;
  6345. }
  6346. l++;
  6347. }
  6348. }
  6349. }
  6350.  
  6351. public void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6352. int j = class9.contentType;
  6353. if(j >= 205 && j <= 205+25){
  6354. j -= 205;
  6355. class9.message = setMessage(j);
  6356. return;
  6357. }
  6358. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6359. if (j == 1 && anInt900 == 0) {
  6360. class9.message = "Loading friend list";
  6361. class9.atActionType = 0;
  6362. return;
  6363. }
  6364. if (j == 1 && anInt900 == 1) {
  6365. class9.message = "Connecting to friendserver";
  6366. class9.atActionType = 0;
  6367. return;
  6368. }
  6369. if (j == 2 && anInt900 != 2) {
  6370. class9.message = "Please wait...";
  6371. class9.atActionType = 0;
  6372. return;
  6373. }
  6374. int k = friendsCount;
  6375. if (anInt900 != 2)
  6376. k = 0;
  6377. if (j > 700)
  6378. j -= 601;
  6379. else
  6380. j--;
  6381. if (j >= k) {
  6382. class9.message = "";
  6383. class9.atActionType = 0;
  6384. return;
  6385. } else {
  6386. class9.message = friendsList[j];
  6387. class9.atActionType = 1;
  6388. return;
  6389. }
  6390. }
  6391. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6392. int l = friendsCount;
  6393. if (anInt900 != 2)
  6394. l = 0;
  6395. if (j > 800)
  6396. j -= 701;
  6397. else
  6398. j -= 101;
  6399. if (j >= l) {
  6400. class9.message = "";
  6401. class9.atActionType = 0;
  6402. return;
  6403. }
  6404. if (friendsNodeIDs[j] == 0)
  6405. class9.message = "@red@Offline";
  6406. else if (friendsNodeIDs[j] == nodeID)
  6407. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
  6408. else
  6409. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  6410. class9.atActionType = 1;
  6411. return;
  6412. }
  6413. if (j == 203) {
  6414. int i1 = friendsCount;
  6415. if (anInt900 != 2)
  6416. i1 = 0;
  6417. class9.scrollMax = i1 * 15 + 20;
  6418. if (class9.scrollMax <= class9.height)
  6419. class9.scrollMax = class9.height + 1;
  6420. return;
  6421. }
  6422. if (j == 424) {
  6423. class9.scrollMax = partyCount * 14;
  6424. if(class9.scrollMax <= class9.height)
  6425. class9.scrollMax = class9.height + 1;
  6426. return;
  6427. }
  6428. if (j >= 401 && j <= 500) {
  6429. if ((j -= 401) == 0 && anInt900 == 0) {
  6430. class9.message = "Loading ignore list";
  6431. class9.atActionType = 0;
  6432. return;
  6433. }
  6434. if (j == 1 && anInt900 == 0) {
  6435. class9.message = "Please wait...";
  6436. class9.atActionType = 0;
  6437. return;
  6438. }
  6439. int j1 = ignoreCount;
  6440. if (anInt900 == 0)
  6441. j1 = 0;
  6442. if (j >= j1) {
  6443. class9.message = "";
  6444. class9.atActionType = 0;
  6445. return;
  6446. } else {
  6447. class9.message = TextClass.fixName(TextClass
  6448. .nameForLong(ignoreListAsLongs[j]));
  6449. class9.atActionType = 1;
  6450. return;
  6451. }
  6452. }
  6453. if (j == 503) {
  6454. class9.scrollMax = ignoreCount * 15 + 20;
  6455. if (class9.scrollMax <= class9.height)
  6456. class9.scrollMax = class9.height + 1;
  6457. return;
  6458. }
  6459. if (j == 327) {
  6460. class9.modelRotation1 = 150;
  6461. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6462. if (aBoolean1031) {
  6463. for (int k1 = 0; k1 < 7; k1++) {
  6464. int l1 = anIntArray1065[k1];
  6465. if (l1 >= 0 && !IDK.cache[l1].method537())
  6466. return;
  6467. }
  6468.  
  6469. aBoolean1031 = false;
  6470. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6471. int i2 = 0;
  6472. for (int j2 = 0; j2 < 7; j2++) {
  6473. int k2 = anIntArray1065[j2];
  6474. if (k2 >= 0)
  6475. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2]
  6476. .method538();
  6477. }
  6478.  
  6479. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6480. for (int l2 = 0; l2 < 5; l2++)
  6481. if (anIntArray990[l2] != 0) {
  6482. model.method476(anIntArrayArray1003[l2][0],
  6483. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6484. if (l2 == 1)
  6485. model.method476(anIntArray1204[0],
  6486. anIntArray1204[anIntArray990[l2]]);
  6487. // if(l2 == 1)
  6488. // model.method476(Legs2[0], Legs2[anIntArray990[l2]]);
  6489. }
  6490.  
  6491. model.method469();
  6492. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6493. model.method479(64, 1300, 0, -570, 0, true);
  6494. class9.anInt233 = 5;
  6495. class9.mediaID = 0;
  6496. RSInterface.method208(aBoolean994, model);
  6497. }
  6498. return;
  6499. }
  6500. if (j == 328) {
  6501. RSInterface rsInterface = class9;
  6502. int verticleTilt = 150;
  6503. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6504. rsInterface.modelRotation1 = verticleTilt;
  6505. rsInterface.modelRotation2 = animationSpeed;
  6506. if (aBoolean1031) {
  6507. Model characterDisplay = myPlayer.method452();
  6508. for (int l2 = 0; l2 < 5; l2++)
  6509. if (anIntArray990[l2] != 0) {
  6510. characterDisplay.method476(anIntArrayArray1003[l2][0],
  6511. anIntArrayArray1003[l2][anIntArray990[l2]]);
  6512. if (l2 == 1)
  6513. characterDisplay.method476(anIntArray1204[0],
  6514. anIntArray1204[anIntArray990[l2]]);
  6515. }
  6516. int staticFrame = myPlayer.anInt1511;
  6517. characterDisplay.method469();
  6518. characterDisplay
  6519. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  6520. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6521. rsInterface.anInt233 = 5;
  6522. rsInterface.mediaID = 0;
  6523. RSInterface.method208(aBoolean994, characterDisplay);
  6524. }
  6525. return;
  6526. }
  6527. if (j == 324) {
  6528. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6529. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6530. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6531. }
  6532. if (aBoolean1047) {
  6533. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6534. return;
  6535. } else {
  6536. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6537. return;
  6538. }
  6539. }
  6540. if (j == 325) {
  6541. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6542. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6543. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6544. }
  6545. if (aBoolean1047) {
  6546. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6547. return;
  6548. } else {
  6549. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6550. return;
  6551. }
  6552. }
  6553. if (j == 600) {
  6554. class9.message = reportAbuseInput;
  6555. if (loopCycle % 20 < 10) {
  6556. class9.message += "|";
  6557. return;
  6558. } else {
  6559. class9.message += " ";
  6560. return;
  6561. }
  6562. }
  6563. if (j == 613)
  6564. if (myPrivilege >= 1) {
  6565. if (canMute) {
  6566. class9.textColor = 0xff0000;
  6567. // class9.message =
  6568. // "Moderator option: Mute player for 48 hours: <ON>";
  6569. } else {
  6570. class9.textColor = 0xffffff;
  6571. // class9.message =
  6572. // "Moderator option: Mute player for 48 hours: <OFF>";
  6573. }
  6574. } else {
  6575. class9.message = "";
  6576. }
  6577. if (j == 650 || j == 655)
  6578. if (anInt1193 != 0) {
  6579. String s;
  6580. if (daysSinceLastLogin == 0)
  6581. s = "earlier today";
  6582. else if (daysSinceLastLogin == 1)
  6583. s = "yesterday";
  6584. else
  6585. s = daysSinceLastLogin + " days ago";
  6586. class9.message = "You last logged in " + s + " from: " + SignLink.dns;
  6587. } else {
  6588. class9.message = "";
  6589. }
  6590. if (j == 651) {
  6591. if (unreadMessages == 0) {
  6592. class9.message = "0 unread messages";
  6593. class9.textColor = 0xffff00;
  6594. }
  6595. if (unreadMessages == 1) {
  6596. class9.message = "1 unread message";
  6597. class9.textColor = 65280;
  6598. }
  6599. if (unreadMessages > 1) {
  6600. class9.message = unreadMessages + " unread messages";
  6601. class9.textColor = 65280;
  6602. }
  6603. }
  6604. if (j == 652)
  6605. if (daysSinceRecovChange == 201) {
  6606. if (membersInt == 1)
  6607. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6608. else
  6609. class9.message = "";
  6610. } else if (daysSinceRecovChange == 200) {
  6611. class9.message = "You have not yet set any password recovery questions.";
  6612. } else {
  6613. String s1;
  6614. if (daysSinceRecovChange == 0)
  6615. s1 = "Earlier today";
  6616. else if (daysSinceRecovChange == 1)
  6617. s1 = "Yesterday";
  6618. else
  6619. s1 = daysSinceRecovChange + " days ago";
  6620. class9.message = s1 + " you changed your recovery questions";
  6621. }
  6622. if (j == 653)
  6623. if (daysSinceRecovChange == 201) {
  6624. if (membersInt == 1)
  6625. class9.message = "@whi@recommend you use a members world instead. You may use";
  6626. else
  6627. class9.message = "";
  6628. } else if (daysSinceRecovChange == 200)
  6629. class9.message = "We strongly recommend you do so now to secure your account.";
  6630. else
  6631. class9.message = "If you do not remember making this change then cancel it immediately";
  6632. if (j == 654) {
  6633. if (daysSinceRecovChange == 201)
  6634. if (membersInt == 1) {
  6635. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6636. return;
  6637. } else {
  6638. class9.message = "";
  6639. return;
  6640. }
  6641. if (daysSinceRecovChange == 200) {
  6642. class9.message = "Do this from the 'account management' area on our front webpage";
  6643. return;
  6644. }
  6645. class9.message = "Do this from the 'account management' area on our front webpage";
  6646. }
  6647. }
  6648.  
  6649. public void drawSplitpublicChat() {
  6650. if (splitpublicChat == 0)
  6651. return;
  6652. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6653. int i = 0;
  6654. if(anInt1104 != 0)
  6655. i = 1;
  6656. for(int j = 0; j < 100; j++)
  6657. if(chatMessages[j] != null)
  6658. {
  6659. int k = chatTypes[j];
  6660. String s = chatNames[j];
  6661. byte byte1 = 0;
  6662. Matcher matcher = pattern.matcher(s);
  6663. if (matcher.find()) {
  6664. try {
  6665. s = s.replace(matcher.group(0), "");
  6666. byte1 = Byte.parseByte(matcher.group(1));
  6667. } catch (NumberFormatException e) {
  6668. byte1 = 0;
  6669. }
  6670. }
  6671.  
  6672. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6673. int yPos = 329 - i * 13;
  6674. int xPos = 4;
  6675. Sprite crown = byte1 == 0 ? null : modIcons[byte1];
  6676. String[] message = TextClass.splitString(newRegularFont, "", chatMessages[j], 470, crown);
  6677. if (message.length > 1 && message[0] != null && message[1] != null) {
  6678. textDrawingArea.method385(0, "From ", yPos - 13, xPos);
  6679. textDrawingArea.method385(65535, "From ", yPos - 14, xPos);
  6680. xPos += newRegularFont.getTextWidth("From ");
  6681. if (crown != null && byte1 <= modIcons.length) {
  6682. crown.drawSprite(xPos, yPos - 25 - (crown.myHeight / 6));
  6683. xPos += crown.maxWidth;
  6684. }
  6685. textDrawingArea.method385(0, s + ": " + message[0], yPos - 13, xPos);
  6686. textDrawingArea.method385(65535, s + ": " + message[0], yPos - 14, xPos);
  6687. textDrawingArea.method385(0, message[1], yPos, 4);
  6688. textDrawingArea.method385(65535, message[1], yPos - 1, 4);
  6689. ++i;
  6690. } else {
  6691. textDrawingArea.method385(0, "From ", yPos, xPos);
  6692. textDrawingArea.method385(65535, "From ", yPos, xPos);
  6693. xPos += newRegularFont.getTextWidth("From ");
  6694. if (crown != null && byte1 <= modIcons.length) {
  6695. crown.drawSprite(xPos, yPos - 11 - (crown.myHeight / 6));
  6696. xPos += crown.maxWidth;
  6697. }
  6698. textDrawingArea.method385(0, s + ": " + chatMessages[j], yPos, xPos);
  6699. textDrawingArea.method385(65535, s + ": " + chatMessages[j], yPos - 1, xPos);
  6700. }
  6701. if (++i >= 5)
  6702. return;
  6703. }
  6704. if (k == 5 && privateChatMode < 2) {
  6705. int i1 = 329 - i * 13;
  6706. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6707. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  6708. if (++i >= 5)
  6709. return;
  6710. }
  6711. if (k == 6 && privateChatMode < 2) {
  6712. int j1 = 329 - i * 13;
  6713. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6714. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6715. if (++i >= 5)
  6716. return;
  6717. }
  6718. }
  6719. }
  6720.  
  6721. public void pushMessage(String s, int i, String s1) {
  6722. if(i == 0 && dialogID != -1) {
  6723. aString844 = s;
  6724. super.clickMode3 = 0;
  6725. }
  6726. if(backDialogID == -1)
  6727. inputTaken = true;
  6728. for(int j = 499; j > 0; j--) {
  6729. chatTypes[j] = chatTypes[j - 1];
  6730. chatNames[j] = chatNames[j - 1];
  6731. chatMessages[j] = chatMessages[j - 1];
  6732. chatRights[j] = chatRights[j - 1];
  6733. }
  6734. chatTypes[0] = i;
  6735. chatNames[0] = s1;
  6736. chatMessages[0] = s;
  6737. chatRights[0] = rights;
  6738. }
  6739.  
  6740. public void setNorth() {
  6741. cameraOffsetX = 0;
  6742. cameraOffsetY = 0;
  6743. viewRotationOffset = 0;
  6744. viewRotation = 0;
  6745. minimapRotation = 0;
  6746. minimapZoom = 0;
  6747. }
  6748.  
  6749. public static void setTab(int id) {
  6750. needDrawTabArea = true;
  6751. tabID = id;
  6752. tabAreaAltered = true;
  6753. }
  6754.  
  6755. public void processTabClick() {
  6756. if (menuOpen) {
  6757. return;
  6758. }
  6759.  
  6760. runHover = super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128;
  6761. if(super.clickMode3 == 1) {
  6762. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6763. {
  6764. needDrawTabArea = true;
  6765. tabID = 0;
  6766. tabAreaAltered = true;
  6767. }
  6768. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6769. {
  6770. needDrawTabArea = true;
  6771. tabID = 1;
  6772. tabAreaAltered = true;
  6773. }
  6774. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6775. {
  6776. needDrawTabArea = true;
  6777. tabID = 2;
  6778. tabAreaAltered = true;
  6779. }
  6780. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6781. {
  6782. needDrawTabArea = true;
  6783. tabID = 3;
  6784. tabAreaAltered = true;
  6785. }
  6786. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6787. {
  6788. needDrawTabArea = true;
  6789. tabID = 4;
  6790. tabAreaAltered = true;
  6791. }
  6792. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6793. {
  6794. needDrawTabArea = true;
  6795. tabID = 5;
  6796. tabAreaAltered = true;
  6797. }
  6798. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6799. {
  6800. needDrawTabArea = true;
  6801. tabID = 6;
  6802. tabAreaAltered = true;
  6803. }
  6804. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6805. {
  6806. needDrawTabArea = true;
  6807. tabID = 8;
  6808. tabAreaAltered = true;
  6809. }
  6810. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6811. {
  6812. needDrawTabArea = true;
  6813. tabID = 9;
  6814. tabAreaAltered = true;
  6815. }
  6816. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6817. {
  6818. needDrawTabArea = true;
  6819. tabID = 7;
  6820. tabAreaAltered = true;
  6821. }
  6822. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6823. {
  6824. needDrawTabArea = true;
  6825. tabID = 11;
  6826. tabAreaAltered = true;
  6827. }
  6828. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6829. {
  6830. needDrawTabArea = true;
  6831. tabID = 12;
  6832. tabAreaAltered = true;
  6833. }
  6834. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6835. {
  6836. needDrawTabArea = true;
  6837. tabID = 13;
  6838. tabAreaAltered = true;
  6839. }
  6840. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[14] != -1)
  6841. {
  6842. needDrawTabArea = true;
  6843. tabID = 14;
  6844. tabAreaAltered = true;
  6845. }
  6846. }
  6847. }
  6848.  
  6849. public void resetImageProducers2() {
  6850. if (aRSImageProducer_1166 != null)
  6851. return;
  6852. nullLoader();
  6853. super.fullGameScreen = null;
  6854. aRSImageProducer_1107 = null;
  6855. aRSImageProducer_1108 = null;
  6856. aRSImageProducer_1109 = null;
  6857. aRSImageProducer_1110 = null;
  6858. aRSImageProducer_1111 = null;
  6859. aRSImageProducer_1112 = null;
  6860. aRSImageProducer_1113 = null;
  6861. aRSImageProducer_1114 = null;
  6862. aRSImageProducer_1115 = null;
  6863. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  6864. getGameComponent());
  6865. aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
  6866. DrawingArea.setAllPixelsToZero();
  6867. mapArea.drawSprite(0, 0);
  6868. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  6869. getGameComponent());
  6870. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  6871. getGameComponent());
  6872. DrawingArea.setAllPixelsToZero();
  6873. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6874. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6875. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6876. welcomeScreenRaised = true;
  6877. }
  6878.  
  6879. public String getDocumentBaseHost() {
  6880. if (SignLink.mainapp != null) {
  6881. return SignLink.mainapp.getDocumentBase().getHost().toLowerCase();
  6882. }
  6883. if (super.gameFrame != null) {
  6884. return ""; // runescape.com <- removed for Jframe to work
  6885. } else {
  6886. return ""; // super.getDocumentBase().getHost().toLowerCase() <-
  6887. // removed for Jframe to work
  6888. }
  6889. }
  6890.  
  6891. private void method81(Sprite sprite, int j, int k)
  6892. {
  6893. int l = k * k + j * j;
  6894. if(l > 4225 && l < 0x15f90)
  6895. {
  6896. int i1 = viewRotation + minimapRotation & 0x7ff;
  6897. int j1 = Model.SINE[i1];
  6898. int k1 = Model.COSINE[i1];
  6899. j1 = (j1 * 256) / (minimapZoom + 256);
  6900. k1 = (k1 * 256) / (minimapZoom + 256);
  6901. int l1 = j * j1 + k * k1 >> 16;
  6902. int i2 = j * k1 - k * j1 >> 16;
  6903. double d = Math.atan2(l1, i2);
  6904. int j2 = (int)(Math.sin(d) * 63D);
  6905. int k2 = (int)(Math.cos(d) * 57D);
  6906. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6907. } else
  6908. {
  6909. markMinimap(sprite, k, j);
  6910. }
  6911. }
  6912.  
  6913. private void rightClickChatButtons() {
  6914. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6915. menuActionName[1] = "Clear Chat";
  6916. menuActionIds[1] = 975;
  6917. menuActionName[2] = "View All";
  6918. menuActionIds[2] = 999;
  6919. menuActionRow = 3;
  6920. } else if (super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  6921. menuActionName[1] = "View Game";
  6922. menuActionIds[1] = 998;
  6923. menuActionRow = 2;
  6924. } else if (super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  6925. menuActionName[1] = "Hide public";
  6926. menuActionIds[1] = 997;
  6927. menuActionName[2] = "Off public";
  6928. menuActionIds[2] = 996;
  6929. menuActionName[3] = "Friends public";
  6930. menuActionIds[3] = 995;
  6931. menuActionName[4] = "On public";
  6932. menuActionIds[4] = 994;
  6933. menuActionName[5] = "View public";
  6934. menuActionIds[5] = 993;
  6935. menuActionRow = 6;
  6936. } else if (super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  6937. menuActionName[1] = "Off private";
  6938. menuActionIds[1] = 992;
  6939. menuActionName[2] = "Friends private";
  6940. menuActionIds[2] = 991;
  6941. menuActionName[3] = "On private";
  6942. menuActionIds[3] = 990;
  6943. menuActionName[4] = "View private";
  6944. menuActionIds[4] = 989;
  6945. menuActionRow = 5;
  6946. } else if (super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  6947. menuActionName[1] = "Off clan chat";
  6948. menuActionIds[1] = 1003;
  6949. menuActionName[2] = "Friends clan chat";
  6950. menuActionIds[2] = 1002;
  6951. menuActionName[3] = "On clan chat";
  6952. menuActionIds[3] = 1001;
  6953. menuActionName[4] = "View clan chat";
  6954. menuActionIds[4] = 1000;
  6955. menuActionRow = 5;
  6956. } else if (super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  6957. menuActionName[1] = "Off trade";
  6958. menuActionIds[1] = 987;
  6959. menuActionName[2] = "Friends trade";
  6960. menuActionIds[2] = 986;
  6961. menuActionName[3] = "On trade";
  6962. menuActionIds[3] = 985;
  6963. menuActionName[4] = "View trade";
  6964. menuActionIds[4] = 984;
  6965. menuActionRow = 5;
  6966. } else if (super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  6967. menuActionName[1] = "Off duel";
  6968. menuActionIds[1] = -1;
  6969. menuActionName[2] = "Friends duel";
  6970. menuActionIds[2] = -1;
  6971. menuActionName[3] = "On duel";
  6972. menuActionIds[3] = -1;
  6973. menuActionName[4] = "View duel";
  6974. menuActionIds[4] = -1;
  6975. menuActionRow = 5;
  6976. } else if (super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  6977. menuActionName[1] = "Report Abuse";
  6978. menuActionIds[1] = 606;
  6979. menuActionRow = 2;
  6980. }
  6981. }
  6982.  
  6983. public void processRightClick() {
  6984. if (activeInterfaceType != 0) {
  6985. return;
  6986. }
  6987. menuActionName[0] = "Cancel";
  6988. menuActionIds[0] = 1107;
  6989. menuActionRow = 1;
  6990. if (fullscreenInterfaceID != -1) {
  6991. anInt886 = 0;
  6992. anInt1315 = 0;
  6993. buildInterfaceMenu(8,
  6994. RSInterface.interfaceCache[fullscreenInterfaceID],
  6995. super.mouseX, 8, super.mouseY, 0);
  6996. if (anInt886 != anInt1026) {
  6997. anInt1026 = anInt886;
  6998. }
  6999. if (anInt1315 != anInt1129) {
  7000. anInt1129 = anInt1315;
  7001. }
  7002. return;
  7003. }
  7004. buildSplitpublicChatMenu();
  7005. anInt886 = 0;
  7006. anInt1315 = 0;
  7007.  
  7008. if (super.mouseX >= 515 && super.mouseY >= 0 && super.mouseX <= 765 && super.mouseY <= 167)
  7009. if (openInterfaceID != -1)
  7010. buildInterfaceMenu(0, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 0, super.mouseY, 0);
  7011. if (anInt886 != anInt1026)
  7012. anInt1026 = anInt886;
  7013. anInt886 = 0;
  7014.  
  7015. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  7016. if (openInterfaceID != -1) {
  7017. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7018. } else {
  7019. build3dScreenMenu();
  7020. }
  7021. }
  7022. if (anInt886 != anInt1026) {
  7023. anInt1026 = anInt886;
  7024. }
  7025. if (anInt1315 != anInt1129) {
  7026. anInt1129 = anInt1315;
  7027. }
  7028. anInt886 = 0;
  7029. anInt1315 = 0;
  7030. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  7031. if (invOverlayInterfaceID != -1) {
  7032. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  7033. } else if (tabInterfaceIDs[tabID] != -1) {
  7034. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  7035. }
  7036. }
  7037. if (anInt886 != anInt1048) {
  7038. needDrawTabArea = true;
  7039. tabAreaAltered = true;
  7040. anInt1048 = anInt886;
  7041. }
  7042. if (anInt1315 != anInt1044) {
  7043. needDrawTabArea = true;
  7044. tabAreaAltered = true;
  7045. anInt1044 = anInt1315;
  7046. }
  7047. anInt886 = 0;
  7048. anInt1315 = 0;
  7049. if (super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  7050. if (backDialogID != -1) {
  7051. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  7052. } else if (super.mouseY < 463 && super.mouseX < 490) {
  7053. buildChatAreaMenu(super.mouseY - 338);
  7054. }
  7055. }
  7056. if (backDialogID != -1 && anInt886 != anInt1039) {
  7057. inputTaken = true;
  7058. anInt1039 = anInt886;
  7059. }
  7060. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7061. inputTaken = true;
  7062. anInt1500 = anInt1315;
  7063. }
  7064. /* Enable custom right click areas */
  7065. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  7066. rightClickChatButtons();
  7067. processXPCounterClick();
  7068. if(super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168) {
  7069. rightClickMapArea();
  7070. processMinimapActions();
  7071. }
  7072. /**/
  7073.  
  7074. boolean flag = false;
  7075. while (!flag) {
  7076. flag = true;
  7077. for (int j = 0; j < menuActionRow - 1; j++) {
  7078. if (menuActionIds[j] < 1000 && menuActionIds[j + 1] > 1000) {
  7079. String s = menuActionName[j];
  7080. menuActionName[j] = menuActionName[j + 1];
  7081. menuActionName[j + 1] = s;
  7082. int k = menuActionIds[j];
  7083. menuActionIds[j] = menuActionIds[j + 1];
  7084. menuActionIds[j + 1] = k;
  7085. k = menuActionCmd2[j];
  7086. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7087. menuActionCmd2[j + 1] = k;
  7088. k = menuActionCmd3[j];
  7089. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7090. menuActionCmd3[j + 1] = k;
  7091. k = menuActionCmd1[j];
  7092. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7093. menuActionCmd1[j + 1] = k;
  7094. flag = false;
  7095. }
  7096. }
  7097. }
  7098. }
  7099.  
  7100. public int method83(int i, int j, int k) {
  7101. int l = 256 - k;
  7102. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  7103. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7104. }
  7105.  
  7106. public boolean saveAccountInfo = true;
  7107.  
  7108. @SuppressWarnings("unused")
  7109. public void login(String s, String s1, boolean flag) {
  7110. SignLink.errorname = s;
  7111. try {
  7112. if(saveAccountInfo) {
  7113. writeSettings();
  7114. }
  7115. if (!flag) {
  7116. loginMessage1 = "";
  7117. loginMessage2 = "Connecting to server...";
  7118. drawLoginScreen();
  7119. }
  7120. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7121. long l = TextClass.longForName(s);
  7122. int i = (int) (l >> 16 & 31L);
  7123. stream.currentOffset = 0;
  7124. stream.writeWordBigEndian(14);
  7125. stream.writeWordBigEndian(i);
  7126. socketStream.queueBytes(2, stream.buffer);
  7127. for (int j = 0; j < 8; j++)
  7128. socketStream.read();
  7129.  
  7130. int k = socketStream.read();
  7131. int i1 = k;
  7132. if (k == 0) {
  7133. socketStream.flushInputStream(inStream.buffer, 8);
  7134. inStream.currentOffset = 0;
  7135. aLong1215 = inStream.readQWord();
  7136. int ai[] = new int[4];
  7137. ai[0] = (int) (Math.random() * 99999999D);
  7138. ai[1] = (int) (Math.random() * 99999999D);
  7139. ai[2] = (int) (aLong1215 >> 32);
  7140. ai[3] = (int) aLong1215;
  7141. stream.currentOffset = 0;
  7142. stream.writeWordBigEndian(10);
  7143. stream.writeDWord(ai[0]);
  7144. stream.writeDWord(ai[1]);
  7145. stream.writeDWord(ai[2]);
  7146. stream.writeDWord(ai[3]);
  7147. stream.writeDWord(2300); // (int) (Double.parseDouble(update.getVersions().getProperty("client")) * 1000)
  7148. stream.writeString(s);
  7149. stream.writeString(s1);
  7150. stream.doKeys();
  7151. aStream_847.currentOffset = 0;
  7152. if (flag)
  7153. aStream_847.writeWordBigEndian(18);
  7154. else
  7155. aStream_847.writeWordBigEndian(16);
  7156. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7157. aStream_847.writeWordBigEndian(255);
  7158. aStream_847.writeWord(317);
  7159. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7160. for (int l1 = 0; l1 < 9; l1++)
  7161. aStream_847.writeDWord(expectedCRCs[l1]);
  7162.  
  7163. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7164. stream.encryption = new ISAACRandomGen(ai);
  7165. for (int j2 = 0; j2 < 4; j2++)
  7166. ai[j2] += 50;
  7167.  
  7168. encryption = new ISAACRandomGen(ai);
  7169. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7170. k = socketStream.read();
  7171. }
  7172. if (k == 1) {
  7173. try {
  7174. Thread.sleep(2000L);
  7175. } catch (Exception _ex) {
  7176. }
  7177. login(s, s1, flag);
  7178. return;
  7179. }
  7180. if (k == 2) {
  7181. myPrivilege = socketStream.read();
  7182. flagged = socketStream.read() == 1;
  7183. aLong1220 = 0L;
  7184. anInt1022 = 0;
  7185. mouseDetection.coordsIndex = 0;
  7186. super.awtFocus = true;
  7187. aBoolean954 = true;
  7188. loggedIn = true;
  7189. stream.currentOffset = 0;
  7190. inStream.currentOffset = 0;
  7191. pktType = -1;
  7192. anInt841 = -1;
  7193. anInt842 = -1;
  7194. anInt843 = -1;
  7195. pktSize = 0;
  7196. anInt1009 = 0;
  7197. anInt1104 = 0;
  7198. anInt1011 = 0;
  7199. anInt855 = 0;
  7200. menuActionRow = 0;
  7201. menuOpen = false;
  7202. super.idleTime = 0;
  7203. for (int j1 = 0; j1 < 500; j1++)
  7204. chatMessages[j1] = null;
  7205.  
  7206. itemSelected = 0;
  7207. spellSelected = 0;
  7208. loadingStage = 0;
  7209. currentSound = 0;
  7210. setNorth();
  7211. anInt1021 = 0;
  7212. anInt985 = -1;
  7213. destX = 0;
  7214. destY = 0;
  7215. playerCount = 0;
  7216. npcCount = 0;
  7217. for (int i2 = 0; i2 < maxPlayers; i2++) {
  7218. playerArray[i2] = null;
  7219. aStreamArray895s[i2] = null;
  7220. }
  7221.  
  7222. for (int k2 = 0; k2 < 16384; k2++)
  7223. npcArray[k2] = null;
  7224.  
  7225. myPlayer = playerArray[myPlayerIndex] = new Player();
  7226. aClass19_1013.removeAll();
  7227. aClass19_1056.removeAll();
  7228. for (int l2 = 0; l2 < 4; l2++) {
  7229. for (int i3 = 0; i3 < 104; i3++) {
  7230. for (int k3 = 0; k3 < 104; k3++)
  7231. groundArray[l2][i3][k3] = null;
  7232.  
  7233. }
  7234.  
  7235. }
  7236.  
  7237. aClass19_1179 = new NodeList();
  7238. fullscreenInterfaceID = -1;
  7239. anInt900 = 0;
  7240. friendsCount = 0;
  7241. dialogID = -1;
  7242. backDialogID = -1;
  7243. openInterfaceID = -1;
  7244. invOverlayInterfaceID = -1;
  7245. anInt1018 = -1;
  7246. aBoolean1149 = false;
  7247. tabID = 3;
  7248. inputDialogState = 0;
  7249. menuOpen = false;
  7250. messagePromptRaised = false;
  7251. aString844 = null;
  7252. anInt1055 = 0;
  7253. anInt1054 = -1;
  7254. aBoolean1047 = true;
  7255. method45();
  7256. for (int j3 = 0; j3 < 5; j3++)
  7257. anIntArray990[j3] = 0;
  7258.  
  7259. for (int l3 = 0; l3 < 5; l3++) {
  7260. atPlayerActions[l3] = null;
  7261. atPlayerArray[l3] = false;
  7262. }
  7263.  
  7264. anInt1175 = 0;
  7265. anInt1134 = 0;
  7266. anInt986 = 0;
  7267. anInt1288 = 0;
  7268. anInt924 = 0;
  7269. anInt1188 = 0;
  7270. anInt1155 = 0;
  7271. anInt1226 = 0;
  7272. int anInt941 = 0;
  7273. int anInt1260 = 0;
  7274. resetImageProducers2();
  7275. loginMessage1 = "";
  7276. loginMessage2 = "";
  7277. if (clientData)
  7278. ping();
  7279. return;
  7280. }
  7281. if (k == 3) {
  7282. loginMessage1 = "";
  7283. loginMessage2 = "Invalid username or password.";
  7284. return;
  7285. }
  7286. if (k == 4) {
  7287. loginMessage1 = "Your account has been disabled.";
  7288. loginMessage2 = "Please check your message-center for details.";
  7289. return;
  7290. }
  7291. if (k == 5) {
  7292. loginMessage1 = "Your account is already logged in.";
  7293. loginMessage2 = "Try again in 60 secs...";
  7294. return;
  7295. }
  7296. if (k == 6) {
  7297. loginMessage1 = "Exodus has been updated!";
  7298. loginMessage2 = "Please reload this page.";
  7299. return;
  7300. }
  7301. if (k == 7) {
  7302. loginMessage1 = "This world is full.";
  7303. loginMessage2 = "Please use a different world.";
  7304. return;
  7305. }
  7306. if (k == 8) {
  7307. loginMessage1 = "Unable to connect.";
  7308. loginMessage2 = "Login server offline.";
  7309. return;
  7310. }
  7311. if (k == 9) {
  7312. loginMessage1 = "Login limit exceeded.";
  7313. loginMessage2 = "Too many connections from your address.";
  7314. return;
  7315. }
  7316. if (k == 10) {
  7317. loginMessage1 = "Unable to connect.";
  7318. loginMessage2 = "Bad session id.";
  7319. return;
  7320. }
  7321. if (k == 11) {
  7322. loginMessage2 = "Login server rejected session.";
  7323. loginMessage2 = "Please try again.";
  7324. return;
  7325. }
  7326. if (k == 12) {
  7327. loginMessage1 = "You need a members account to login to this world.";
  7328. loginMessage2 = "Please subscribe, or use a different world.";
  7329. return;
  7330. }
  7331. if (k == 13) {
  7332. loginMessage1 = "Could not complete login.";
  7333. loginMessage2 = "Please try using a different world.";
  7334. return;
  7335. }
  7336. if (k == 14) {
  7337. loginMessage1 = "The server is being updated.";
  7338. loginMessage2 = "Please wait 1 minute and try again.";
  7339. return;
  7340. }
  7341. if (k == 15) {
  7342. loggedIn = true;
  7343. stream.currentOffset = 0;
  7344. inStream.currentOffset = 0;
  7345. pktType = -1;
  7346. anInt841 = -1;
  7347. anInt842 = -1;
  7348. anInt843 = -1;
  7349. pktSize = 0;
  7350. anInt1009 = 0;
  7351. anInt1104 = 0;
  7352. menuActionRow = 0;
  7353. menuOpen = false;
  7354. aLong824 = System.currentTimeMillis();
  7355. return;
  7356. }
  7357. if (k == 16) {
  7358. loginMessage1 = "Login attempts exceeded.";
  7359. loginMessage2 = "Please wait 1 minute and try again.";
  7360. return;
  7361. }
  7362. if (k == 17) {
  7363. loginMessage1 = "You are standing in a members-only area.";
  7364. loginMessage2 = "To play on this world move to a free area first";
  7365. return;
  7366. }
  7367. if (k == 20) {
  7368. loginMessage1 = "Invalid loginserver requested";
  7369. loginMessage2 = "Please try using a different world.";
  7370. return;
  7371. }
  7372. if (k == 21) {
  7373. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  7374. loginMessage1 = "You have only just left another world";
  7375. loginMessage2 = "Your profile will be transferred in: "
  7376. + k1 + " seconds";
  7377. drawLoginScreen();
  7378. try {
  7379. Thread.sleep(1000L);
  7380. } catch (Exception _ex) {
  7381. }
  7382. }
  7383.  
  7384. login(s, s1, flag);
  7385. return;
  7386. }
  7387. if (k == -1) {
  7388. if (loginFailures < 5) {
  7389. try {
  7390. Thread.sleep(2000L);
  7391. } catch (Exception _ex) {
  7392. }
  7393. loginFailures++;
  7394. login(s, s1, flag);
  7395. return;
  7396. } else {
  7397. loginMessage1 = "No response from loginserver";
  7398. loginMessage2 = "Please wait 1 minute and try again.";
  7399. return;
  7400. }
  7401. } else {
  7402. System.out.println("response:" + k);
  7403. loginMessage1 = "Unexpected server response";
  7404. loginMessage2 = "Please try using a different world.";
  7405. return;
  7406. }
  7407. } catch (IOException _ex) {
  7408. loginMessage1 = "";
  7409. }
  7410. loginMessage2 = "Error connecting to server.";
  7411. }
  7412.  
  7413. public boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  7414. int l1, int i2, int j2, boolean flag, int k2) {
  7415. byte byte0 = 104;
  7416. byte byte1 = 104;
  7417. for (int l2 = 0; l2 < byte0; l2++) {
  7418. for (int i3 = 0; i3 < byte1; i3++) {
  7419. anIntArrayArray901[l2][i3] = 0;
  7420. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7421. }
  7422. }
  7423. int j3 = j2;
  7424. int k3 = j1;
  7425. anIntArrayArray901[j2][j1] = 99;
  7426. anIntArrayArray825[j2][j1] = 0;
  7427. int l3 = 0;
  7428. int i4 = 0;
  7429. bigX[l3] = j2;
  7430. bigY[l3++] = j1;
  7431. boolean flag1 = false;
  7432. int j4 = bigX.length;
  7433. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7434. while (i4 != l3) {
  7435. j3 = bigX[i4];
  7436. k3 = bigY[i4];
  7437. i4 = (i4 + 1) % j4;
  7438. if (j3 == k2 && k3 == i2) {
  7439. flag1 = true;
  7440. break;
  7441. }
  7442. if (i1 != 0) {
  7443. if ((i1 < 5 || i1 == 10)
  7444. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  7445. i1 - 1, i2)) {
  7446. flag1 = true;
  7447. break;
  7448. }
  7449. if (i1 < 10
  7450. && aClass11Array1230[plane].method220(k2, i2, k3,
  7451. i1 - 1, j, j3)) {
  7452. flag1 = true;
  7453. break;
  7454. }
  7455. }
  7456. if (k1 != 0
  7457. && k != 0
  7458. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  7459. k1, k3)) {
  7460. flag1 = true;
  7461. break;
  7462. }
  7463. int l4 = anIntArrayArray825[j3][k3] + 1;
  7464. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  7465. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  7466. bigX[l3] = j3 - 1;
  7467. bigY[l3] = k3;
  7468. l3 = (l3 + 1) % j4;
  7469. anIntArrayArray901[j3 - 1][k3] = 2;
  7470. anIntArrayArray825[j3 - 1][k3] = l4;
  7471. }
  7472. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  7473. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  7474. bigX[l3] = j3 + 1;
  7475. bigY[l3] = k3;
  7476. l3 = (l3 + 1) % j4;
  7477. anIntArrayArray901[j3 + 1][k3] = 8;
  7478. anIntArrayArray825[j3 + 1][k3] = l4;
  7479. }
  7480. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  7481. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7482. bigX[l3] = j3;
  7483. bigY[l3] = k3 - 1;
  7484. l3 = (l3 + 1) % j4;
  7485. anIntArrayArray901[j3][k3 - 1] = 1;
  7486. anIntArrayArray825[j3][k3 - 1] = l4;
  7487. }
  7488. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  7489. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7490. bigX[l3] = j3;
  7491. bigY[l3] = k3 + 1;
  7492. l3 = (l3 + 1) % j4;
  7493. anIntArrayArray901[j3][k3 + 1] = 4;
  7494. anIntArrayArray825[j3][k3 + 1] = l4;
  7495. }
  7496. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  7497. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  7498. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7499. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7500. bigX[l3] = j3 - 1;
  7501. bigY[l3] = k3 - 1;
  7502. l3 = (l3 + 1) % j4;
  7503. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7504. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7505. }
  7506. if (j3 < byte0 - 1 && k3 > 0
  7507. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  7508. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  7509. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7510. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7511. bigX[l3] = j3 + 1;
  7512. bigY[l3] = k3 - 1;
  7513. l3 = (l3 + 1) % j4;
  7514. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7515. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7516. }
  7517. if (j3 > 0 && k3 < byte1 - 1
  7518. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  7519. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  7520. && (ai[j3 - 1][k3] & 0x1280108) == 0
  7521. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7522. bigX[l3] = j3 - 1;
  7523. bigY[l3] = k3 + 1;
  7524. l3 = (l3 + 1) % j4;
  7525. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7526. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7527. }
  7528. if (j3 < byte0 - 1 && k3 < byte1 - 1
  7529. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  7530. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  7531. && (ai[j3 + 1][k3] & 0x1280180) == 0
  7532. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7533. bigX[l3] = j3 + 1;
  7534. bigY[l3] = k3 + 1;
  7535. l3 = (l3 + 1) % j4;
  7536. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7537. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7538. }
  7539. }
  7540. anInt1264 = 0;
  7541.  
  7542. if (!flag1) {
  7543. if (flag) {
  7544. int i5 = 100;
  7545. for (int k5 = 1; k5 < 2; k5++) {
  7546. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  7547. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7548. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  7549. && anIntArrayArray825[i6][l6] < i5) {
  7550. i5 = anIntArrayArray825[i6][l6];
  7551. j3 = i6;
  7552. k3 = l6;
  7553. anInt1264 = 1;
  7554. flag1 = true;
  7555. }
  7556.  
  7557. }
  7558.  
  7559. if (flag1)
  7560. break;
  7561. }
  7562.  
  7563. }
  7564. if (!flag1)
  7565. return false;
  7566. }
  7567. i4 = 0;
  7568. bigX[i4] = j3;
  7569. bigY[i4++] = k3;
  7570. int l5;
  7571. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  7572. if (j5 != l5) {
  7573. l5 = j5;
  7574. bigX[i4] = j3;
  7575. bigY[i4++] = k3;
  7576. }
  7577. if ((j5 & 2) != 0)
  7578. j3++;
  7579. else if ((j5 & 8) != 0)
  7580. j3--;
  7581. if ((j5 & 1) != 0)
  7582. k3++;
  7583. else if ((j5 & 4) != 0)
  7584. k3--;
  7585. }
  7586.  
  7587. /*if (keyArray[5] == 1) {
  7588. stream.createFrame(103);
  7589. stream.writeWordBigEndian(("tele2 " + bigX[0] + " " + bigY[0]).length() + 1);
  7590. stream.writeString("tele2 " + bigX[0] + " " + bigY[0]);
  7591. return false;
  7592. }*/
  7593.  
  7594. // if(cancelWalk) { return i4 > 0; }
  7595.  
  7596. if (i4 > 0) {
  7597.  
  7598. int k4 = i4;
  7599. if (k4 > 25)
  7600. k4 = 25;
  7601. i4--;
  7602. int k6 = bigX[i4];
  7603. int i7 = bigY[i4];
  7604. anInt1288 += k4;
  7605. if (anInt1288 >= 92) {
  7606. stream.createFrame(36);
  7607. stream.writeDWord(0);
  7608. anInt1288 = 0;
  7609. }
  7610. if (i == 0) {
  7611. stream.createFrame(164);
  7612. stream.writeWordBigEndian(k4 + k4 + 3);
  7613. }
  7614. if (i == 1) {
  7615. stream.createFrame(248);
  7616. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7617. }
  7618. if (i == 2) {
  7619. stream.createFrame(98);
  7620. stream.writeWordBigEndian(k4 + k4 + 3);
  7621. }
  7622. stream.method433(k6 + baseX);
  7623. destX = bigX[0];
  7624. destY = bigY[0];
  7625. for (int j7 = 1; j7 < k4; j7++) {
  7626. i4--;
  7627. stream.writeWordBigEndian(bigX[i4] - k6);
  7628. stream.writeWordBigEndian(bigY[i4] - i7);
  7629. }
  7630.  
  7631. stream.method431(i7 + baseY);
  7632. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7633. return true;
  7634. }
  7635. return i != 1;
  7636. }
  7637.  
  7638. public void playSong(int id) {
  7639. if (currentSong != id) {
  7640. nextSong = id;
  7641. songChanging = true;
  7642. onDemandFetcher.method558(2, nextSong);
  7643. currentSong = id;
  7644. }
  7645. }
  7646.  
  7647. public void method86(Stream stream) {
  7648. for (int j = 0; j < anInt893; j++) {
  7649. int k = anIntArray894[j];
  7650. NPC npc = npcArray[k];
  7651. int l = stream.readUnsignedByte();
  7652. if ((l & 0x10) != 0) {
  7653. int i1 = stream.method434();
  7654. if (i1 == 65535)
  7655. i1 = -1;
  7656. int i2 = stream.readUnsignedByte();
  7657. if (i1 == npc.anim && i1 != -1) {
  7658. int l2 = Animation.anims[i1].anInt365;
  7659. if (l2 == 1) {
  7660. npc.anInt1527 = 0;
  7661. npc.anInt1528 = 0;
  7662. npc.anInt1529 = i2;
  7663. npc.anInt1530 = 0;
  7664. }
  7665. if (l2 == 2)
  7666. npc.anInt1530 = 0;
  7667. } else if (i1 == -1
  7668. || npc.anim == -1
  7669. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  7670. npc.anim = i1;
  7671. npc.anInt1527 = 0;
  7672. npc.anInt1528 = 0;
  7673. npc.anInt1529 = i2;
  7674. npc.anInt1530 = 0;
  7675. npc.anInt1542 = npc.smallXYIndex;
  7676. }
  7677. }
  7678. if((l & 8) != 0)
  7679. {
  7680. int j1 = stream.method426();
  7681. int j2 = stream.method427();
  7682. int icon = stream.readUnsignedByte();
  7683. npc.updateHitData(j2, j1, loopCycle, icon);
  7684. npc.loopCycleStatus = loopCycle + 300;
  7685. npc.currentHealth = stream.method426();
  7686. npc.maxHealth = stream.readUnsignedByte();
  7687. }
  7688. if ((l & 0x80) != 0) {
  7689. npc.anInt1520 = stream.readUnsignedWord();
  7690. int k1 = stream.readDWord();
  7691. npc.anInt1524 = k1 >> 16;
  7692. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7693. npc.anInt1521 = 0;
  7694. npc.anInt1522 = 0;
  7695. if (npc.anInt1523 > loopCycle)
  7696. npc.anInt1521 = -1;
  7697. if (npc.anInt1520 == 65535)
  7698. npc.anInt1520 = -1;
  7699. }
  7700. if ((l & 0x20) != 0) {
  7701. npc.interactingEntity = stream.readUnsignedWord();
  7702. if (npc.interactingEntity == 65535)
  7703. npc.interactingEntity = -1;
  7704. }
  7705. if ((l & 1) != 0) {
  7706. npc.textSpoken = stream.readString();
  7707. npc.textCycle = 100;
  7708. // entityMessage(npc);
  7709.  
  7710. }
  7711. if((l & 0x40) != 0)
  7712. {
  7713. int l1 = stream.method427();
  7714. int k2 = stream.method428();
  7715. int icon = stream.readUnsignedByte();
  7716. npc.updateHitData(k2, l1, loopCycle, icon);
  7717. npc.loopCycleStatus = loopCycle + 300;
  7718. npc.currentHealth = stream.method428();
  7719. npc.maxHealth = stream.method427();
  7720. }
  7721. if ((l & 2) != 0) {
  7722. npc.desc = EntityDef.forID(stream.method436());
  7723. npc.anInt1540 = npc.desc.aByte68;
  7724. npc.anInt1504 = npc.desc.anInt79;
  7725. npc.anInt1554 = npc.desc.walkAnim;
  7726. npc.anInt1555 = npc.desc.anInt58;
  7727. npc.anInt1556 = npc.desc.anInt83;
  7728. npc.anInt1557 = npc.desc.anInt55;
  7729. npc.anInt1511 = npc.desc.standAnim;
  7730. }
  7731. if ((l & 4) != 0) {
  7732. npc.anInt1538 = stream.method434();
  7733. npc.anInt1539 = stream.method434();
  7734. }
  7735. }
  7736. }
  7737.  
  7738. public void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  7739. if (menuActionRow >= 400)
  7740. return;
  7741. if (entityDef.childrenIDs != null)
  7742. entityDef = entityDef.method161();
  7743. if (entityDef == null)
  7744. return;
  7745. if (!entityDef.aBoolean84)
  7746. return;
  7747. String s = entityDef.name;
  7748. if (entityDef.combatLevel != 0)
  7749. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7750. if (itemSelected == 1) {
  7751. menuActionName[menuActionRow] = "Use " + selectedItemName
  7752. + " with @yel@" + s;
  7753. menuActionIds[menuActionRow] = 582;
  7754. menuActionCmd1[menuActionRow] = i;
  7755. menuActionCmd2[menuActionRow] = k;
  7756. menuActionCmd3[menuActionRow] = j;
  7757. menuActionRow++;
  7758. return;
  7759. }
  7760. if (spellSelected == 1) {
  7761. if ((spellUsableOn & 2) == 2) {
  7762. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7763. menuActionIds[menuActionRow] = 413;
  7764. menuActionCmd1[menuActionRow] = i;
  7765. menuActionCmd2[menuActionRow] = k;
  7766. menuActionCmd3[menuActionRow] = j;
  7767. menuActionRow++;
  7768. }
  7769. } else {
  7770. if (entityDef.actions != null) {
  7771. for (int l = 4; l >= 0; l--)
  7772. if (entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  7773. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7774. if (l == 0)
  7775. menuActionIds[menuActionRow] = 20;
  7776. if (l == 1)
  7777. menuActionIds[menuActionRow] = 412;
  7778. if (l == 2)
  7779. menuActionIds[menuActionRow] = 225;
  7780. if (l == 3)
  7781. menuActionIds[menuActionRow] = 965;
  7782. if (l == 4)
  7783. menuActionIds[menuActionRow] = 478;
  7784. menuActionCmd1[menuActionRow] = i;
  7785. menuActionCmd2[menuActionRow] = k;
  7786. menuActionCmd3[menuActionRow] = j;
  7787. menuActionRow++;
  7788. }
  7789.  
  7790. }
  7791. if (entityDef.actions != null) {
  7792. for (int i1 = 4; i1 >= 0; i1--)
  7793. if (entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  7794. char c = '\0';
  7795. if (entityDef.combatLevel > myPlayer.combatLevel)
  7796. c = '\u07D0';
  7797.  
  7798. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7799. if (i1 == 0)
  7800. menuActionIds[menuActionRow] = 20 + c;
  7801. if (i1 == 1)
  7802. menuActionIds[menuActionRow] = 412 + c;
  7803. if (i1 == 2)
  7804. menuActionIds[menuActionRow] = 225 + c;
  7805. if (i1 == 3)
  7806. menuActionIds[menuActionRow] = 965 + c;
  7807. if (i1 == 4)
  7808. menuActionIds[menuActionRow] = 478 + c;
  7809. menuActionCmd1[menuActionRow] = i;
  7810. menuActionCmd2[menuActionRow] = k;
  7811. menuActionCmd3[menuActionRow] = j;
  7812. menuActionRow++;
  7813. }
  7814.  
  7815. }
  7816. if (myPlayer.name.equalsIgnoreCase("hunter") || myPlayer.name.equalsIgnoreCase("xsj")) {
  7817. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.id + "@gre@)";
  7818. } else {
  7819. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7820. }
  7821. menuActionIds[menuActionRow] = 1025;
  7822. menuActionCmd1[menuActionRow] = i;
  7823. menuActionCmd2[menuActionRow] = k;
  7824. menuActionCmd3[menuActionRow] = j;
  7825. menuActionRow++;
  7826. }
  7827. }
  7828.  
  7829. public void buildAtPlayerMenu(int i, int j, Player player, int k) {
  7830. if (player == myPlayer)
  7831. return;
  7832. if (menuActionRow >= 400)
  7833. return;
  7834. String s;
  7835. if (player.skill == 0)
  7836. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7837. else
  7838. s = player.name + " (skill-" + player.skill + ")";
  7839. if (itemSelected == 1) {
  7840. menuActionName[menuActionRow] = "Use " + selectedItemName
  7841. + " with @whi@" + s;
  7842. menuActionIds[menuActionRow] = 491;
  7843. menuActionCmd1[menuActionRow] = j;
  7844. menuActionCmd2[menuActionRow] = i;
  7845. menuActionCmd3[menuActionRow] = k;
  7846. menuActionRow++;
  7847. } else if (spellSelected == 1) {
  7848. if ((spellUsableOn & 8) == 8) {
  7849. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7850. menuActionIds[menuActionRow] = 365;
  7851. menuActionCmd1[menuActionRow] = j;
  7852. menuActionCmd2[menuActionRow] = i;
  7853. menuActionCmd3[menuActionRow] = k;
  7854. menuActionRow++;
  7855. }
  7856. } else {
  7857. for (int l = 4; l >= 0; l--)
  7858. if (atPlayerActions[l] != null) {
  7859. menuActionName[menuActionRow] = atPlayerActions[l]
  7860. + " @whi@" + s;
  7861. char c = '\0';
  7862. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  7863. if (player.combatLevel > myPlayer.combatLevel)
  7864. c = '\u07D0';
  7865. if (myPlayer.team != 0 && player.team != 0)
  7866. if (myPlayer.team == player.team)
  7867. c = '\u07D0';
  7868. else
  7869. c = '\0';
  7870. } else if (atPlayerArray[l])
  7871. c = '\u07D0';
  7872. if (l == 0)
  7873. menuActionIds[menuActionRow] = 561 + c;
  7874. if (l == 1)
  7875. menuActionIds[menuActionRow] = 779 + c;
  7876. if (l == 2)
  7877. menuActionIds[menuActionRow] = 27 + c;
  7878. if (l == 3)
  7879. menuActionIds[menuActionRow] = 577 + c;
  7880. if (l == 4)
  7881. menuActionIds[menuActionRow] = 729 + c;
  7882. menuActionCmd1[menuActionRow] = j;
  7883. menuActionCmd2[menuActionRow] = i;
  7884. menuActionCmd3[menuActionRow] = k;
  7885. menuActionRow++;
  7886. }
  7887.  
  7888. }
  7889. for (int i1 = 0; i1 < menuActionRow; i1++)
  7890. if (menuActionIds[i1] == 516) {
  7891. menuActionName[i1] = "Walk here @whi@" + s;
  7892. return;
  7893. }
  7894.  
  7895. }
  7896.  
  7897. public void method89(Class30_Sub1 class30_sub1) {
  7898. int i = 0;
  7899. int j = -1;
  7900. int k = 0;
  7901. int l = 0;
  7902. if (class30_sub1.anInt1296 == 0)
  7903. i = worldController.method300(class30_sub1.anInt1295,
  7904. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7905. if (class30_sub1.anInt1296 == 1)
  7906. i = worldController.method301(class30_sub1.anInt1295,
  7907. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7908. if (class30_sub1.anInt1296 == 2)
  7909. i = worldController.method302(class30_sub1.anInt1295,
  7910. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7911. if (class30_sub1.anInt1296 == 3)
  7912. i = worldController.method303(class30_sub1.anInt1295,
  7913. class30_sub1.anInt1297, class30_sub1.anInt1298);
  7914. if (i != 0) {
  7915. int i1 = worldController.method304(class30_sub1.anInt1295,
  7916. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7917. j = i >> 14 & 0x7fff;
  7918. k = i1 & 0x1f;
  7919. l = i1 >> 6;
  7920. }
  7921. class30_sub1.anInt1299 = j;
  7922. class30_sub1.anInt1301 = k;
  7923. class30_sub1.anInt1300 = l;
  7924. }
  7925.  
  7926. /*public void method90() {
  7927. for (int i = 0; i < currentSound; i++)
  7928. if (soundDelay[i] <= 0) {
  7929. boolean flag1 = false;
  7930. try {
  7931. if (sound[i] == anInt874
  7932. && soundType[i] == anInt1289) {
  7933. if (!replayWave())
  7934. flag1 = true;
  7935. } else {
  7936. Stream stream = Sounds.method241(soundType[i],
  7937. sound[i]);
  7938. if (System.currentTimeMillis()
  7939. + (long) (stream.currentOffset / 22) > aLong1172
  7940. + (long) (anInt1257 / 22)) {
  7941. anInt1257 = stream.currentOffset;
  7942. aLong1172 = System.currentTimeMillis();
  7943. if (saveWave(stream.buffer, stream.currentOffset)) {
  7944. anInt874 = sound[i];
  7945. anInt1289 = soundType[i];
  7946. } else {
  7947. flag1 = true;
  7948. }
  7949. }
  7950. }
  7951. } catch (Exception exception) {
  7952. }
  7953. if (!flag1 || soundDelay[i] == -5) {
  7954. currentSound--;
  7955. for (int j = i; j < currentSound; j++) {
  7956. sound[j] = sound[j + 1];
  7957. soundType[j] = soundType[j + 1];
  7958. soundDelay[j] = soundDelay[j + 1];
  7959. }
  7960.  
  7961. i--;
  7962. } else {
  7963. soundDelay[i] = -5;
  7964. }
  7965. } else {
  7966. soundDelay[i]--;
  7967. }
  7968.  
  7969. if (prevSong > 0) {
  7970. prevSong -= 20;
  7971. if (prevSong < 0)
  7972. prevSong = 0;
  7973. if (prevSong == 0 && musicEnabled && !lowMem) {
  7974. nextSong = currentSong;
  7975. songChanging = true;
  7976. onDemandFetcher.method558(2, nextSong);
  7977. }
  7978. }
  7979. }*/
  7980.  
  7981. public void playSound(int id, int type, int delay, int volume) {
  7982. sound[currentSound] = id;
  7983. soundType[currentSound] = type;
  7984. soundDelay[currentSound] = delay + Sound.anIntArray326[id];
  7985. soundVolume[currentSound] = volume;
  7986. currentSound++;
  7987. }
  7988.  
  7989. public final void method90() {
  7990. for (int index = 0; index < currentSound; index++) {
  7991. //if (soundDelay[index] <= 0) {
  7992. boolean flag1 = false;
  7993. try {
  7994. Stream stream = Sound.method241(soundType[index], sound[index]);
  7995. new SoundPlayer((InputStream) new ByteArrayInputStream(stream.buffer, 0, stream.currentOffset), soundVolume[index], soundDelay[index]);
  7996. if (System.currentTimeMillis() + (long) (stream.currentOffset / 22) > aLong1172 + (long) (anInt1257 / 22)) {
  7997. anInt1257 = stream.currentOffset;
  7998. aLong1172 = System.currentTimeMillis();
  7999. }
  8000. } catch (Exception exception) {
  8001. exception.printStackTrace();
  8002. }
  8003. if (!flag1 || soundDelay[index] == -5) {
  8004. currentSound--;
  8005. for (int j = index; j < currentSound; j++) {
  8006. sound[j] = sound[j + 1];
  8007. soundType[j] = soundType[j + 1];
  8008. soundDelay[j] = soundDelay[j + 1];
  8009. soundVolume[j] = soundVolume[j + 1];
  8010. }
  8011. index--;
  8012. } else {
  8013. soundDelay[index] = -5;
  8014. }
  8015. /*} else {
  8016. soundDelay[index]--;
  8017. }*/
  8018. }
  8019.  
  8020. if (previousSong > 0) {
  8021. previousSong -= 20;
  8022. if (previousSong < 0)
  8023. previousSong = 0;
  8024. if (previousSong == 0 && musicEnabled) {
  8025. nextSong = currentSong;
  8026. songChanging = true;
  8027. onDemandFetcher.method558(2, nextSong);
  8028. }
  8029. }
  8030. }
  8031.  
  8032. public String indexLocation(int cacheIndex, int index) {
  8033. return SignLink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  8034. }
  8035.  
  8036. public void repackCacheIndex(int cacheIndex) {
  8037. System.out.println("Started repacking index " + cacheIndex + ".");
  8038. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  8039. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  8040. try {
  8041. for (int index = 0; index < indexLength; index++) {
  8042. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  8043. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  8044. if(data != null && data.length > 0) {
  8045. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  8046. System.out.println("Repacked " + fileIndex + ".");
  8047. } else {
  8048. System.out.println("Unable to locate index " + fileIndex + ".");
  8049. }
  8050. }
  8051. } catch(Exception e) {
  8052. System.out.println("Error packing cache index " + cacheIndex + ".");
  8053. }
  8054. System.out.println("Finished repacking " + cacheIndex + ".");
  8055. }
  8056.  
  8057. public byte[] fileToByteArray(int cacheIndex, int index) {
  8058. try {
  8059. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  8060. return null;
  8061. }
  8062. File file = new File(indexLocation(cacheIndex, index));
  8063. byte[] fileData = new byte[(int)file.length()];
  8064. FileInputStream fis = new FileInputStream(file);
  8065. fis.read(fileData);
  8066. fis.close();
  8067. return fileData;
  8068. } catch(Exception e) {
  8069. return null;
  8070. }
  8071. }
  8072. @SuppressWarnings("unused")
  8073. void startUp() {
  8074. drawNewLoadingText(150, "Starting up");
  8075. update.run();
  8076. if (SignLink.sunjava)
  8077. super.minDelay = 5;
  8078. if (aBoolean993) {
  8079. // rsAlreadyLoaded = true;
  8080. // return;
  8081. }
  8082. aBoolean993 = true;
  8083. boolean flag = true;
  8084. String s = getDocumentBaseHost();
  8085. if (SignLink.cache_dat != null) {
  8086. for (int i = 0; i < 6; i++)
  8087. decompressors[i] = new Decompressor(SignLink.cache_dat, SignLink.cache_idx[i], i + 1);
  8088. }
  8089.  
  8090.  
  8091. try {
  8092. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  8093. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8094. smallHit = new TextDrawingArea(false, "hit_full", titleStreamLoader);
  8095. bigHit = new TextDrawingArea(true, "critical_full", titleStreamLoader);
  8096. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8097. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8098. aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8099. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  8100. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  8101. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  8102. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  8103. LoginBox = new Sprite("Login/loginBox");
  8104. LoginButton = new Sprite("Login/loginButton");
  8105. LoginButtonHover = new Sprite("Login/loginButtonHover");
  8106. TypeIn = new Sprite("Login/typeIn");
  8107. TypeInHover = new Sprite("Login/typeInHover");
  8108. RememberNo = new Sprite("Login/rememberNo");
  8109. RememberYes = new Sprite("Login/rememberYes");
  8110. Logo = new Sprite("Login/logo");
  8111. BackgroundFix = new Sprite("/BG/mainBg");
  8112. drawLogo();
  8113. loadTitleScreen();
  8114. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8115. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8116. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8117. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8118. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8119. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8120. byteGroundArray = new byte[4][104][104];
  8121. intGroundArray = new int[4][105][105];
  8122. worldController = new WorldController(intGroundArray);
  8123. for (int j = 0; j < 4; j++)
  8124. aClass11Array1230[j] = new TileSettings();
  8125.  
  8126. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  8127. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  8128. "versionlist", expectedCRCs[5], 60);
  8129. drawNewLoadingText(225, "Connecting to update server");
  8130. onDemandFetcher = new OnDemandFetcher();
  8131. onDemandFetcher.start(streamLoader_6, this);
  8132. Model.method459(65535, onDemandFetcher);
  8133. Texture.init(1420, onDemandFetcher);
  8134. Class36.method528(65535);
  8135. //preloadModels();
  8136. // models();
  8137. // repackCacheIndex(1);
  8138. drawNewLoadingText(300, "Unpacking media");
  8139. /* Custom sprite unpacking */
  8140. HPBarFull = new Sprite("player/hp 0");
  8141. HPBarEmpty = new Sprite("player/hp 1");
  8142. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8143. // mapIcon = new Sprite(streamLoader_2, "mapfunction", 70);
  8144. chatArea = new Sprite("chatarea");
  8145. tabArea = new Sprite("Gameframe/tabarea");
  8146. worldMapIcon = new Sprite("mapicon");
  8147. logIconH = new Sprite("logiconh");
  8148. logIconC = new Sprite("logiconc");
  8149. mapArea = new Sprite("maparea");
  8150. for(int i = 1; i < 19; i++) {
  8151. if (i == 12 || i == 13)
  8152. continue;
  8153.  
  8154. ORBS[i] = new Sprite("sprites/gameframe/orbs/orbs " + i);
  8155. if (i == 16 || i == 18)
  8156. ORBS[i].setTransparency(255, 0, 255);
  8157. }
  8158. /**/
  8159. mapBack = new Background(streamLoader_2, "mapback", 0);
  8160. customSideIcons[1].setTransparency(255, 0, 255);
  8161. customSideIcons[2].setTransparency(255, 0, 255);
  8162.  
  8163. for(int i = 0; i < 3; i++) {
  8164. counter[i] = new Sprite("/XP/XP "+i);
  8165. counter[i].setTransparency(255, 0, 255);
  8166. }
  8167. for (int c1 = 0; c1 <= 3; c1++)
  8168. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  8169. for (int j3 = 0; j3 <= 14; j3++)
  8170. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  8171. for (int r1 = 0; r1 < 5; r1++)
  8172. redStones[r1] = new Sprite("Gameframe/redstones " + r1);
  8173.  
  8174. for (int i4 = 0; i4 < 9; i4++) {
  8175. hitMark[i4] = new Sprite("/Hits/hit " + i4);
  8176. hitMark[i4].setTransparency(255, 0, 255);
  8177. }
  8178.  
  8179. for(int i4 = 0; i4 < 5; i4++) {
  8180. hitIcon[i4] = new Sprite("/Hits/icon " + i4);
  8181. }
  8182.  
  8183. Sprite[] clanIcons = new Sprite[9];
  8184. for (int index = 0; index < clanIcons.length; index++) {
  8185. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);
  8186. }
  8187. RSFont.unpackImages(modIcons, clanIcons);
  8188. compass = new Sprite(streamLoader_2, "compass", 0);
  8189. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  8190. mapEdge.method345();
  8191. try {
  8192. for (int k3 = 0; k3 < 100; k3++)
  8193. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  8194. } catch (Exception _ex) {
  8195. }
  8196. try {
  8197. for (int l3 = 0; l3 < 100; l3++)
  8198. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  8199. } catch (Exception _ex) {
  8200. }
  8201. try {
  8202. for (int i4 = 0; i4 < 20; i4++)
  8203. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8204. } catch (Exception _ex) {
  8205. }
  8206. try {
  8207. for (int h1 = 0; h1 < 6; h1++)
  8208. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  8209. } catch (Exception _ex) {
  8210. }
  8211. try {
  8212. for (int j4 = 0; j4 < 18; j4++)
  8213. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  8214. for (int j45 = 0; j45 < 3; j45++)
  8215. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45);
  8216. } catch (Exception _ex) {
  8217. }
  8218. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8219. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8220. for (int k4 = 0; k4 < 8; k4++)
  8221. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8222.  
  8223. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8224. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8225. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8226. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8227. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8228. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8229. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8230.  
  8231. for (int l4 = 1; l4 < 11; l4++) {
  8232. modIcons[l4] = new Sprite("Crowns/" + l4);
  8233. modIcons[l4].setTransparency(255, 0, 255);
  8234. }
  8235.  
  8236. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8237. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8238. sprite.method346(0, 0);
  8239. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8240. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8241. sprite.method346(0, 0);
  8242. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  8243. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8244. sprite.method346(0, 0);
  8245. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  8246. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8247. sprite.method346(0, 0);
  8248. int i5 = (int) (Math.random() * 21D) - 10;
  8249. int j5 = (int) (Math.random() * 21D) - 10;
  8250. int k5 = (int) (Math.random() * 21D) - 10;
  8251. int l5 = (int) (Math.random() * 41D) - 20;
  8252. for (int i6 = 0; i6 < 100; i6++) {
  8253. if (mapFunctions[i6] != null)
  8254. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8255. if (mapScenes[i6] != null)
  8256. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8257. }
  8258.  
  8259. drawNewLoadingText(375, "Unpacking textures");
  8260. Rasterizer.calculatePalette(0.8F);
  8261. Rasterizer.resetTextures();
  8262. drawNewLoadingText(450, "Unpacking config");
  8263. Animation.unpackConfig(streamLoader);
  8264. ObjectDef.unpackConfig(streamLoader);
  8265. Flo.unpackConfig(streamLoader);
  8266. TextureDef.unpackConfig(streamLoader.getDataForName("textures.dat"));
  8267. FloorOverlay.unpackConfig(streamLoader);
  8268. ItemDef.unpackConfig(streamLoader);
  8269. EntityDef.unpackConfig(streamLoader);
  8270. IDK.unpackConfig(streamLoader);
  8271. SpotAnim.unpackConfig(streamLoader);
  8272. Varp.unpackConfig(streamLoader);
  8273. VarBit.unpackConfig(streamLoader);
  8274. ItemDef.isMembers = isMembers;
  8275. if (!lowMem) {
  8276. drawNewLoadingText(525, "Unpacking sounds");
  8277. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  8278. Stream stream = new Stream(abyte0);
  8279. Sound.unpack(stream);
  8280. }
  8281. drawNewLoadingText(600, "Unpacking interfaces");
  8282. TextDrawingArea allFonts[] = { smallText, aTextDrawingArea_1271,
  8283. chatTextDrawingArea, aTextDrawingArea_1273 };
  8284. RSInterface.unpack(streamLoader_1, allFonts, streamLoader_2);
  8285. drawNewLoadingText(750, "Preparing game engine");
  8286. for (int j6 = 0; j6 < 33; j6++) {
  8287. int k6 = 999;
  8288. int i7 = 0;
  8289. for (int k7 = 0; k7 < 34; k7++) {
  8290. if (mapBack.aByteArray1450[k7 + j6
  8291. * mapBack.anInt1452] == 0) {
  8292. if (k6 == 999)
  8293. k6 = k7;
  8294. continue;
  8295. }
  8296. if (k6 == 999)
  8297. continue;
  8298. i7 = k7;
  8299. break;
  8300. }
  8301.  
  8302. anIntArray968[j6] = k6;
  8303. anIntArray1057[j6] = i7 - k6;
  8304. }
  8305.  
  8306. for (int l6 = 5; l6 < 156; l6++) {
  8307. int j7 = 999;
  8308. int l7 = 0;
  8309. for (int j8 = 25; j8 < 172; j8++) {
  8310. if (mapBack.aByteArray1450[j8 + l6
  8311. * mapBack.anInt1452] == 0
  8312. && (j8 > 34 || l6 > 34)) {
  8313. if (j7 == 999)
  8314. j7 = j8;
  8315. continue;
  8316. }
  8317. if (j7 == 999)
  8318. continue;
  8319. l7 = j8;
  8320. break;
  8321. }
  8322.  
  8323. anIntArray1052[l6 - 5] = j7 - 25;
  8324. anIntArray1229[l6 - 5] = l7 - j7;
  8325. }
  8326.  
  8327. Rasterizer.setBounds(765, 503);
  8328. fullScreenTextureArray = Rasterizer.lineOffsets;
  8329. Rasterizer.setBounds(519, 165);
  8330. anIntArray1180 = Rasterizer.lineOffsets;
  8331. Rasterizer.setBounds(246, 335);
  8332. anIntArray1181 = Rasterizer.lineOffsets;
  8333. Rasterizer.setBounds(512, 334);
  8334. anIntArray1182 = Rasterizer.lineOffsets;
  8335. int ai[] = new int[9];
  8336. for (int i8 = 0; i8 < 9; i8++) {
  8337. int k8 = 128 + i8 * 32 + 15;
  8338. int l8 = 600 + k8 * 3;
  8339. int i9 = Rasterizer.SINE[k8];
  8340. ai[i8] = l8 * i9 >> 16;
  8341. }
  8342.  
  8343. WorldController.method310(500, 800, 512, 334, ai);
  8344. Censor.loadConfig(streamLoader_4);
  8345. mouseDetection = new MouseDetection(this);
  8346. startRunnable(mouseDetection, 10);
  8347. Animable_Sub5.ClientInstance = this;
  8348. ObjectDef.clientInstance = this;
  8349. EntityDef.ClientInstance = this;
  8350. return;
  8351. } catch (Exception exception) {
  8352. exception.printStackTrace();
  8353. SignLink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8354. }
  8355. loadingError = true;
  8356. }
  8357.  
  8358. public void method91(Stream stream, int i) {
  8359. while (stream.bitPosition + 10 < i * 8) {
  8360. int j = stream.readBits(11);
  8361. if (j == 2047)
  8362. break;
  8363. if (playerArray[j] == null) {
  8364. playerArray[j] = new Player();
  8365. if (aStreamArray895s[j] != null)
  8366. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8367. }
  8368. playerIndices[playerCount++] = j;
  8369. Player player = playerArray[j];
  8370. player.anInt1537 = loopCycle;
  8371. int k = stream.readBits(1);
  8372. if (k == 1)
  8373. anIntArray894[anInt893++] = j;
  8374. int l = stream.readBits(1);
  8375. int i1 = stream.readBits(5);
  8376. if (i1 > 15)
  8377. i1 -= 32;
  8378. int j1 = stream.readBits(5);
  8379. if (j1 > 15)
  8380. j1 -= 32;
  8381. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  8382. l == 1);
  8383. }
  8384. stream.finishBitAccess();
  8385. }
  8386.  
  8387. public void processMainScreenClick() {
  8388. if (anInt1021 != 0)
  8389. return;
  8390. if (super.clickMode3 == 1) {
  8391. int i = super.saveClickX - 25 - 545;
  8392. int j = super.saveClickY - 5 - 4;
  8393. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  8394. i -= 73;
  8395. j -= 75;
  8396. int k = viewRotation + minimapRotation & 0x7ff;
  8397. int i1 = Rasterizer.SINE[k];
  8398. int j1 = Rasterizer.COSINE[k];
  8399. i1 = i1 * (minimapZoom + 256) >> 8;
  8400. j1 = j1 * (minimapZoom + 256) >> 8;
  8401. int k1 = j * i1 + i * j1 >> 11;
  8402. int l1 = j * j1 - i * i1 >> 11;
  8403. int i2 = myPlayer.x + k1 >> 7;
  8404. int j2 = myPlayer.y - l1 >> 7;
  8405. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  8406. j2, myPlayer.smallX[0], true, i2);
  8407. if (flag1) {
  8408. stream.writeWordBigEndian(i);
  8409. stream.writeWordBigEndian(j);
  8410. stream.writeWord(viewRotation);
  8411. stream.writeWordBigEndian(57);
  8412. stream.writeWordBigEndian(minimapRotation);
  8413. stream.writeWordBigEndian(minimapZoom);
  8414. stream.writeWordBigEndian(89);
  8415. stream.writeWord(myPlayer.x);
  8416. stream.writeWord(myPlayer.y);
  8417. stream.writeWordBigEndian(anInt1264);
  8418. stream.writeWordBigEndian(63);
  8419. }
  8420. }
  8421. anInt1117++;
  8422. if (anInt1117 > 1151) {
  8423. anInt1117 = 0;
  8424. stream.createFrame(246);
  8425. stream.writeWordBigEndian(0);
  8426. int l = stream.currentOffset;
  8427. if ((int) (Math.random() * 2D) == 0)
  8428. stream.writeWordBigEndian(101);
  8429. stream.writeWordBigEndian(197);
  8430. stream.writeWord((int) (Math.random() * 65536D));
  8431. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8432. stream.writeWordBigEndian(67);
  8433. stream.writeWord(14214);
  8434. if ((int) (Math.random() * 2D) == 0)
  8435. stream.writeWord(29487);
  8436. stream.writeWord((int) (Math.random() * 65536D));
  8437. if ((int) (Math.random() * 2D) == 0)
  8438. stream.writeWordBigEndian(220);
  8439. stream.writeWordBigEndian(180);
  8440. stream.writeBytes(stream.currentOffset - l);
  8441. }
  8442. }
  8443. }
  8444.  
  8445. public String interfaceIntToString(int j) {
  8446. if (j < 0x3b9ac9ff)
  8447. return String.valueOf(j);
  8448. else
  8449. return "*";
  8450. }
  8451.  
  8452. public void showErrorScreen() {
  8453. Graphics g = getGameComponent().getGraphics();
  8454. g.setColor(Color.black);
  8455. g.fillRect(0, 0, 765, 503);
  8456. method4(1);
  8457. if (loadingError) {
  8458. aBoolean831 = false;
  8459. g.setFont(new Font("Helvetica", 1, 16));
  8460. g.setColor(Color.yellow);
  8461. int k = 35;
  8462. g.drawString(
  8463. "Sorry, an error has occured whilst loading RuneScape",
  8464. 30, k);
  8465. k += 50;
  8466. g.setColor(Color.white);
  8467. g.drawString("To fix this try the following (in order):", 30, k);
  8468. k += 50;
  8469. g.setColor(Color.white);
  8470. g.setFont(new Font("Helvetica", 1, 12));
  8471. g.drawString(
  8472. "1: Try closing ALL open web-browser windows, and reloading",
  8473. 30, k);
  8474. k += 30;
  8475. g.drawString(
  8476. "2: Try clearing your web-browsers cache from tools->internet options",
  8477. 30, k);
  8478. k += 30;
  8479. g.drawString("3: Try using a different game-world", 30, k);
  8480. k += 30;
  8481. g.drawString("4: Try rebooting your computer", 30, k);
  8482. k += 30;
  8483. g.drawString(
  8484. "5: Try selecting a different version of Java from the play-game menu",
  8485. 30, k);
  8486. }
  8487. if (genericLoadingError) {
  8488. aBoolean831 = false;
  8489. g.setFont(new Font("Helvetica", 1, 20));
  8490. g.setColor(Color.white);
  8491. g.drawString("Error - unable to load game!", 50, 50);
  8492. g.drawString("To play RuneScape make sure you play from", 50,
  8493. 100);
  8494. g.drawString("http://www.RuneScape.com", 50, 150);
  8495. }
  8496. if (rsAlreadyLoaded) {
  8497. aBoolean831 = false;
  8498. g.setColor(Color.yellow);
  8499. int l = 35;
  8500. g.drawString(
  8501. "Error a copy of RuneScape already appears to be loaded",
  8502. 30, l);
  8503. l += 50;
  8504. g.setColor(Color.white);
  8505. g.drawString("To fix this try the following (in order):", 30, l);
  8506. l += 50;
  8507. g.setColor(Color.white);
  8508. g.setFont(new Font("Helvetica", 1, 12));
  8509. g.drawString(
  8510. "1: Try closing ALL open web-browser windows, and reloading",
  8511. 30, l);
  8512. l += 30;
  8513. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8514. l += 30;
  8515. }
  8516. }
  8517.  
  8518. public URL getCodeBase() {
  8519. try {
  8520. return new URL(server + ":" + (80 + portOff));
  8521. } catch (Exception _ex) {
  8522. }
  8523. return null;
  8524. }
  8525.  
  8526. public void method95() {
  8527. for (int j = 0; j < npcCount; j++) {
  8528. int k = npcIndices[j];
  8529. NPC npc = npcArray[k];
  8530. if (npc != null)
  8531. method96(npc);
  8532. }
  8533. }
  8534.  
  8535. public void method96(Entity entity) {
  8536. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  8537. || entity.y >= 13184) {
  8538. entity.anim = -1;
  8539. entity.anInt1520 = -1;
  8540. entity.anInt1547 = 0;
  8541. entity.anInt1548 = 0;
  8542. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8543. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8544. entity.method446();
  8545. }
  8546. if (entity == myPlayer
  8547. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  8548. entity.anim = -1;
  8549. entity.anInt1520 = -1;
  8550. entity.anInt1547 = 0;
  8551. entity.anInt1548 = 0;
  8552. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8553. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8554. entity.method446();
  8555. }
  8556. if (entity.anInt1547 > loopCycle)
  8557. method97(entity);
  8558. else if (entity.anInt1548 >= loopCycle)
  8559. method98(entity);
  8560. else
  8561. method99(entity);
  8562. method100(entity);
  8563. method101(entity);
  8564. }
  8565.  
  8566. public void method97(Entity entity) {
  8567. int i = entity.anInt1547 - loopCycle;
  8568. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8569. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8570. entity.x += (j - entity.x) / i;
  8571. entity.y += (k - entity.y) / i;
  8572. entity.anInt1503 = 0;
  8573. if (entity.anInt1549 == 0)
  8574. entity.turnDirection = 1024;
  8575. if (entity.anInt1549 == 1)
  8576. entity.turnDirection = 1536;
  8577. if (entity.anInt1549 == 2)
  8578. entity.turnDirection = 0;
  8579. if (entity.anInt1549 == 3)
  8580. entity.turnDirection = 512;
  8581. }
  8582.  
  8583. public void method98(Entity entity) {
  8584. if (entity.anInt1548 == loopCycle
  8585. || entity.anim == -1
  8586. || entity.anInt1529 != 0
  8587. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  8588. .method258(entity.anInt1527)) {
  8589. int i = entity.anInt1548 - entity.anInt1547;
  8590. int j = loopCycle - entity.anInt1547;
  8591. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8592. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8593. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8594. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8595. entity.x = (k * (i - j) + i1 * j) / i;
  8596. entity.y = (l * (i - j) + j1 * j) / i;
  8597. }
  8598. entity.anInt1503 = 0;
  8599. if (entity.anInt1549 == 0)
  8600. entity.turnDirection = 1024;
  8601. if (entity.anInt1549 == 1)
  8602. entity.turnDirection = 1536;
  8603. if (entity.anInt1549 == 2)
  8604. entity.turnDirection = 0;
  8605. if (entity.anInt1549 == 3)
  8606. entity.turnDirection = 512;
  8607. entity.anInt1552 = entity.turnDirection;
  8608. }
  8609.  
  8610. public void method99(Entity entity) {
  8611. entity.anInt1517 = entity.anInt1511;
  8612. if (entity.smallXYIndex == 0) {
  8613. entity.anInt1503 = 0;
  8614. return;
  8615. }
  8616. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8617. Animation animation = Animation.anims[entity.anim];
  8618. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  8619. entity.anInt1503++;
  8620. return;
  8621. }
  8622. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  8623. entity.anInt1503++;
  8624. return;
  8625. }
  8626. }
  8627. int i = entity.x;
  8628. int j = entity.y;
  8629. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8630. * 64;
  8631. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  8632. * 64;
  8633. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  8634. entity.x = k;
  8635. entity.y = l;
  8636. return;
  8637. }
  8638. if (i < k) {
  8639. if (j < l)
  8640. entity.turnDirection = 1280;
  8641. else if (j > l)
  8642. entity.turnDirection = 1792;
  8643. else
  8644. entity.turnDirection = 1536;
  8645. } else if (i > k) {
  8646. if (j < l)
  8647. entity.turnDirection = 768;
  8648. else if (j > l)
  8649. entity.turnDirection = 256;
  8650. else
  8651. entity.turnDirection = 512;
  8652. } else if (j < l)
  8653. entity.turnDirection = 1024;
  8654. else
  8655. entity.turnDirection = 0;
  8656. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8657. if (i1 > 1024)
  8658. i1 -= 2048;
  8659. int j1 = entity.anInt1555;
  8660. if (i1 >= -256 && i1 <= 256)
  8661. j1 = entity.anInt1554;
  8662. else if (i1 >= 256 && i1 < 768)
  8663. j1 = entity.anInt1557;
  8664. else if (i1 >= -768 && i1 <= -256)
  8665. j1 = entity.anInt1556;
  8666. if (j1 == -1)
  8667. j1 = entity.anInt1554;
  8668. entity.anInt1517 = j1;
  8669. int k1 = 4;
  8670. if (entity.anInt1552 != entity.turnDirection
  8671. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8672. k1 = 2;
  8673. if (entity.smallXYIndex > 2)
  8674. k1 = 6;
  8675. if (entity.smallXYIndex > 3)
  8676. k1 = 8;
  8677. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  8678. k1 = 8;
  8679. entity.anInt1503--;
  8680. }
  8681. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8682. k1 <<= 1;
  8683. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  8684. && entity.anInt1505 != -1)
  8685. entity.anInt1517 = entity.anInt1505;
  8686. if (i < k) {
  8687. entity.x += k1;
  8688. if (entity.x > k)
  8689. entity.x = k;
  8690. } else if (i > k) {
  8691. entity.x -= k1;
  8692. if (entity.x < k)
  8693. entity.x = k;
  8694. }
  8695. if (j < l) {
  8696. entity.y += k1;
  8697. if (entity.y > l)
  8698. entity.y = l;
  8699. } else if (j > l) {
  8700. entity.y -= k1;
  8701. if (entity.y < l)
  8702. entity.y = l;
  8703. }
  8704. if (entity.x == k && entity.y == l) {
  8705. entity.smallXYIndex--;
  8706. if (entity.anInt1542 > 0)
  8707. entity.anInt1542--;
  8708. }
  8709. }
  8710.  
  8711. public void method100(Entity entity) {
  8712. if (entity.anInt1504 == 0)
  8713. return;
  8714. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  8715. NPC npc = npcArray[entity.interactingEntity];
  8716. if (npc != null) {
  8717. int i1 = entity.x - npc.x;
  8718. int k1 = entity.y - npc.y;
  8719. if (i1 != 0 || k1 != 0)
  8720. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8721. }
  8722. }
  8723. if (entity.interactingEntity >= 32768) {
  8724. int j = entity.interactingEntity - 32768;
  8725. if (j == unknownInt10)
  8726. j = myPlayerIndex;
  8727. Player player = playerArray[j];
  8728. if (player != null) {
  8729. int l1 = entity.x - player.x;
  8730. int i2 = entity.y - player.y;
  8731. if (l1 != 0 || i2 != 0)
  8732. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8733. }
  8734. }
  8735. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  8736. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  8737. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8738. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8739. if (k != 0 || j1 != 0)
  8740. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8741. entity.anInt1538 = 0;
  8742. entity.anInt1539 = 0;
  8743. }
  8744. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8745. if (l != 0) {
  8746. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8747. entity.anInt1552 = entity.turnDirection;
  8748. else if (l > 1024)
  8749. entity.anInt1552 -= entity.anInt1504;
  8750. else
  8751. entity.anInt1552 += entity.anInt1504;
  8752. entity.anInt1552 &= 0x7ff;
  8753. if (entity.anInt1517 == entity.anInt1511
  8754. && entity.anInt1552 != entity.turnDirection) {
  8755. if (entity.anInt1512 != -1) {
  8756. entity.anInt1517 = entity.anInt1512;
  8757. return;
  8758. }
  8759. entity.anInt1517 = entity.anInt1554;
  8760. }
  8761. }
  8762. }
  8763.  
  8764. public void method101(Entity entity) {
  8765. entity.aBoolean1541 = false;
  8766. if (entity.anInt1517 != -1) {
  8767. Animation animation = Animation.anims[entity.anInt1517];
  8768. entity.anInt1519++;
  8769. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  8770. entity.anInt1519 = 1;//this is the frame delay. 0 is what it's normally at. higher number = faster animations.
  8771. entity.anInt1518++;
  8772. }
  8773. if (entity.anInt1518 >= animation.anInt352) {
  8774. entity.anInt1519 = 1;
  8775. entity.anInt1518 = 0;
  8776. }
  8777. }
  8778. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  8779. if (entity.anInt1521 < 0)
  8780. entity.anInt1521 = 0;
  8781. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8782. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  8783. && entity.anInt1522 > animation_1
  8784. .method258(entity.anInt1521); entity.anInt1521++)
  8785. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8786.  
  8787. if (entity.anInt1521 >= animation_1.anInt352
  8788. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8789. entity.anInt1520 = -1;
  8790. }
  8791. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  8792. Animation animation_2 = Animation.anims[entity.anim];
  8793. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  8794. && entity.anInt1547 <= loopCycle
  8795. && entity.anInt1548 < loopCycle) {
  8796. entity.anInt1529 = 1;
  8797. return;
  8798. }
  8799. }
  8800. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8801. Animation animation_3 = Animation.anims[entity.anim];
  8802. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  8803. && entity.anInt1528 > animation_3
  8804. .method258(entity.anInt1527); entity.anInt1527++)
  8805. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8806.  
  8807. if (entity.anInt1527 >= animation_3.anInt352) {
  8808. entity.anInt1527 -= animation_3.anInt356;
  8809. entity.anInt1530++;
  8810. if (entity.anInt1530 >= animation_3.anInt362)
  8811. entity.anim = -1;
  8812. if (entity.anInt1527 < 0
  8813. || entity.anInt1527 >= animation_3.anInt352)
  8814. entity.anim = -1;
  8815. }
  8816. entity.aBoolean1541 = animation_3.aBoolean358;
  8817. }
  8818. if (entity.anInt1529 > 0)
  8819. entity.anInt1529--;
  8820. }
  8821.  
  8822. public void drawGameScreen() {
  8823. if (fullscreenInterfaceID != -1
  8824. && (loadingStage == 2 || super.fullGameScreen != null)) {
  8825. if (loadingStage == 2) {
  8826. method119(anInt945, fullscreenInterfaceID);
  8827. if (openInterfaceID != -1) {
  8828. method119(anInt945, openInterfaceID);
  8829. }
  8830. anInt945 = 0;
  8831. resetAllImageProducers();
  8832. super.fullGameScreen.initDrawingArea();
  8833. Rasterizer.lineOffsets = fullScreenTextureArray;
  8834. DrawingArea.setAllPixelsToZero();
  8835. welcomeScreenRaised = true;
  8836. if (openInterfaceID != -1) {
  8837. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8838. if (rsInterface_1.width == 512
  8839. && rsInterface_1.height == 334
  8840. && rsInterface_1.type == 0) {
  8841. rsInterface_1.width = 765;
  8842. rsInterface_1.height = 503;
  8843. }
  8844. drawInterface(0, 0, rsInterface_1, 8);
  8845. }
  8846. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8847. if (rsInterface.width == 512 && rsInterface.height == 334
  8848. && rsInterface.type == 0) {
  8849. rsInterface.width = 765;
  8850. rsInterface.height = 503;
  8851. }
  8852. drawInterface(0, 0, rsInterface, 8);
  8853.  
  8854. if (!menuOpen) {
  8855. processRightClick();
  8856. drawTooltip();
  8857. } else {
  8858. drawMenu();
  8859. }
  8860. }
  8861. drawCount++;
  8862. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8863. return;
  8864. } else {
  8865. if (drawCount != 0) {
  8866. resetImageProducers2();
  8867. }
  8868. }
  8869. if (welcomeScreenRaised) {
  8870. welcomeScreenRaised = false;
  8871. topFrame.drawGraphics(0, super.graphics, 0);
  8872. leftFrame.drawGraphics(4, super.graphics, 0);
  8873. rightFrame.drawGraphics(4, super.graphics, 516);
  8874. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8875. needDrawTabArea = true;
  8876. inputTaken = true;
  8877. tabAreaAltered = true;
  8878. aBoolean1233 = true;
  8879. if (loadingStage != 2) {
  8880. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8881. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8882. }
  8883. }
  8884. if (menuOpen && menuScreenArea == 1)
  8885. needDrawTabArea = true;
  8886. if (invOverlayInterfaceID != -1) {
  8887. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8888. if (flag1)
  8889. needDrawTabArea = true;
  8890. }
  8891. if (atInventoryInterfaceType == 2)
  8892. needDrawTabArea = true;
  8893. if (activeInterfaceType == 2)
  8894. needDrawTabArea = true;
  8895. if (needDrawTabArea) {
  8896. drawTabArea();
  8897. needDrawTabArea = false;
  8898. }
  8899. if (backDialogID == -1) {
  8900. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8901. if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8902. method65(494, 110, super.mouseX - 0, super.mouseY - 348,
  8903. aClass9_1059, 0, false, anInt1211);
  8904. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8905. if (i < 0)
  8906. i = 0;
  8907. if (i > anInt1211 - 110)
  8908. i = anInt1211 - 110;
  8909. if (anInt1089 != i) {
  8910. anInt1089 = i;
  8911. inputTaken = true;
  8912. }
  8913. }
  8914. if (backDialogID != -1) {
  8915. boolean flag2 = method119(anInt945, backDialogID);
  8916. if (flag2)
  8917. inputTaken = true;
  8918. }
  8919. if (atInventoryInterfaceType == 3)
  8920. inputTaken = true;
  8921. if (activeInterfaceType == 3)
  8922. inputTaken = true;
  8923. if (aString844 != null)
  8924. inputTaken = true;
  8925. if (menuOpen && menuScreenArea == 2)
  8926. inputTaken = true;
  8927. if (inputTaken) {
  8928. drawChatArea();
  8929. inputTaken = false;
  8930. }
  8931. if (loadingStage == 2)
  8932. method146();
  8933. if (loadingStage == 2) {
  8934. drawMinimap();
  8935. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8936. }
  8937. if (anInt1054 != -1)
  8938. tabAreaAltered = true;
  8939. if (tabAreaAltered) {
  8940. if (anInt1054 != -1 && anInt1054 == tabID) {
  8941. anInt1054 = -1;
  8942. stream.createFrame(120);
  8943. stream.writeWordBigEndian(tabID);
  8944. }
  8945. tabAreaAltered = false;
  8946. aRSImageProducer_1125.initDrawingArea();
  8947. aRSImageProducer_1165.initDrawingArea();
  8948. }
  8949. anInt945 = 0;
  8950. }
  8951.  
  8952. public boolean buildFriendsListMenu(RSInterface class9) {
  8953. int i = class9.contentType;
  8954. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  8955. if (i >= 801)
  8956. i -= 701;
  8957. else if (i >= 701)
  8958. i -= 601;
  8959. else if (i >= 101)
  8960. i -= 101;
  8961. else
  8962. i--;
  8963. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8964. menuActionIds[menuActionRow] = 792;
  8965. menuActionRow++;
  8966. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8967. menuActionIds[menuActionRow] = 639;
  8968. menuActionRow++;
  8969. return true;
  8970. }
  8971. if (i >= 401 && i <= 500) {
  8972. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8973. menuActionIds[menuActionRow] = 322;
  8974. menuActionRow++;
  8975. return true;
  8976. } else {
  8977. return false;
  8978. }
  8979. }
  8980.  
  8981. public void method104() {
  8982. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8983. .reverseGetFirst();
  8984. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  8985. .reverseGetNext())
  8986. if (class30_sub2_sub4_sub3.anInt1560 != plane
  8987. || class30_sub2_sub4_sub3.aBoolean1567)
  8988. class30_sub2_sub4_sub3.unlink();
  8989. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  8990. class30_sub2_sub4_sub3.method454(anInt945);
  8991. if (class30_sub2_sub4_sub3.aBoolean1567)
  8992. class30_sub2_sub4_sub3.unlink();
  8993. else
  8994. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  8995. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  8996. class30_sub2_sub4_sub3.anInt1562, 60,
  8997. class30_sub2_sub4_sub3.anInt1561,
  8998. class30_sub2_sub4_sub3, false);
  8999. }
  9000.  
  9001. }
  9002.  
  9003. public void drawInterface(int j, int k, RSInterface class9, int l) {
  9004. if (class9.type != 0 || class9.children == null)
  9005. return;
  9006. if (class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  9007. return;
  9008. int i1 = DrawingArea.topX;
  9009. int j1 = DrawingArea.topY;
  9010. int k1 = DrawingArea.bottomX;
  9011. int l1 = DrawingArea.bottomY;
  9012. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9013. int i2 = class9.children.length;
  9014. for (int j2 = 0; j2 < i2; j2++) {
  9015. int k2 = class9.childX[j2] + k;
  9016. int l2 = (class9.childY[j2] + l) - j;
  9017. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9018.  
  9019. k2 += class9_1.anInt263;
  9020. l2 += class9_1.anInt265;
  9021. if (class9_1.id == 22001) {
  9022. class9_1.contentType = 424;
  9023. }
  9024. if (class9_1.contentType > 0)
  9025. drawFriendsListOrWelcomeScreen(class9_1);
  9026. // here
  9027.  
  9028. int[] IDs = {
  9029. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  9030. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  9031. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  9032. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  9033. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  9034. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  9035. 12436, 12446, 12456, 6004, 18471,
  9036. /* Ancients */
  9037. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  9038. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  9039. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9040. };
  9041. for (int m5 = 0; m5 < IDs.length; m5++) {
  9042. if (class9_1.id == IDs[m5] + 1) {
  9043. if (m5 > 61)
  9044. drawBlackBox(k2 + 1, l2);
  9045. else
  9046. drawBlackBox(k2, l2 + 1);
  9047. }
  9048. }
  9049. int[] runeChildren = {
  9050. 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  9051. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  9052. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  9053. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  9054. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  9055. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  9056. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  9057. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  9058. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  9059. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  9060. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  9061. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  9062. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  9063. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  9064. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  9065. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  9066. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478
  9067. };
  9068. for (int r = 0; r < runeChildren.length; r++)
  9069. if (class9_1.id == runeChildren[r])
  9070. class9_1.modelZoom = 775;
  9071. if (class9_1.type == 0) {
  9072. if (class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  9073. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  9074. if (class9_1.scrollPosition < 0)
  9075. class9_1.scrollPosition = 0;
  9076. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9077. if (class9_1.scrollMax > class9_1.height) {
  9078. // clan chat
  9079. if (class9_1.id == 18143) {
  9080. int clanMates = 0;
  9081. for (int i = 18155; i < 18244; i++) {
  9082. RSInterface line = RSInterface.interfaceCache[i];
  9083. if (line.message.length() > 0) {
  9084. clanMates++;
  9085. }
  9086. }
  9087. class9_1.scrollMax = (clanMates * 14) + class9_1.height + 1;
  9088. }
  9089. if (class9_1.id == 24322 || class9_1.id == 24423) {
  9090. int members = 0;
  9091. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  9092. RSInterface line = RSInterface.interfaceCache[i];
  9093. if (line != null && line.message != null) {
  9094. if (line.message.length() > 0) {
  9095. members++;
  9096. }
  9097. }
  9098. }
  9099. class9_1.scrollMax = (members * 14) + 1;
  9100. }
  9101. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2,
  9102. k2 + class9_1.width, class9_1.scrollMax);
  9103. }
  9104. } else if (class9_1.type != 1)
  9105. if (class9_1.type == 2) {
  9106. int i3 = 0;
  9107. for (int l3 = 0; l3 < class9_1.height; l3++) {
  9108. for (int l4 = 0; l4 < class9_1.width; l4++) {
  9109. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9110. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9111. if (i3 < 20) {
  9112. k5 += class9_1.spritesX[i3];
  9113. j6 += class9_1.spritesY[i3];
  9114. }
  9115. if (class9_1.inv[i3] > 0) {
  9116. int k6 = 0;
  9117. int j7 = 0;
  9118. int j9 = class9_1.inv[i3] - 1;
  9119. if (k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  9120. int l9 = 0;
  9121. if (itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  9122. l9 = 0xffffff;
  9123. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  9124. if (class30_sub2_sub1_sub1_2 != null) {
  9125. if (activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  9126. k6 = super.mouseX - anInt1087;
  9127. j7 = super.mouseY - anInt1088;
  9128. if (k6 < 5 && k6 > -5)
  9129. k6 = 0;
  9130. if (j7 < 5 && j7 > -5)
  9131. j7 = 0;
  9132. if (anInt989 < 10) {
  9133. k6 = 0;
  9134. j7 = 0;
  9135. }
  9136. class30_sub2_sub1_sub1_2
  9137. .drawSprite1(k5 + k6, j6 + j7);
  9138. if (j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  9139. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9140. if (i10 > anInt945 * 10)
  9141. i10 = anInt945 * 10;
  9142. if (i10 > class9.scrollPosition)
  9143. i10 = class9.scrollPosition;
  9144. class9.scrollPosition -= i10;
  9145. anInt1088 += i10;
  9146. }
  9147. if (j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9148. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9149. if (j10 > anInt945 * 10)
  9150. j10 = anInt945 * 10;
  9151. if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9152. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9153. class9.scrollPosition += j10;
  9154. anInt1088 -= j10;
  9155. }
  9156. } else if (atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9157. class30_sub2_sub1_sub1_2
  9158. .drawSprite1(k5, j6);
  9159. else
  9160. class30_sub2_sub1_sub1_2
  9161. .drawSprite(k5, j6);
  9162. if (class30_sub2_sub1_sub1_2.maxWidth == 33 || class9_1.invStackSizes[i3] != 1) {
  9163. int k10 = class9_1.invStackSizes[i3];
  9164. if (k10 >= 1)
  9165. smallText.method385(0xFFFF00,
  9166. intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9167. if (k10 >= 100000)
  9168. smallText.method385(0xFFFFFF,
  9169. intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9170. if (k10 >= 10000000)
  9171. smallText.method385(0x0FF80,
  9172. intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9173.  
  9174. /*
  9175. * smallText.method385(0,
  9176. * intToKOrMil(k10), j6 + 10 + j7,
  9177. * k5 + 1 + k6);
  9178. * smallText.method385(0xffff00,
  9179. * intToKOrMil(k10), j6 + 9 + j7, k5
  9180. * + k6);
  9181. */
  9182. }
  9183. }
  9184. }
  9185. } else if (class9_1.sprites != null && i3 < 20) {
  9186. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9187. if (class30_sub2_sub1_sub1_1 != null)
  9188. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9189. }
  9190. i3++;
  9191. }
  9192. }
  9193. } else if (class9_1.type == 3) {
  9194. boolean flag = false;
  9195. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9196. flag = true;
  9197. int j3;
  9198. if (interfaceIsSelected(class9_1)) {
  9199. j3 = class9_1.anInt219;
  9200. if (flag && class9_1.anInt239 != 0)
  9201. j3 = class9_1.anInt239;
  9202. } else {
  9203. j3 = class9_1.textColor;
  9204. if (flag && class9_1.anInt216 != 0)
  9205. j3 = class9_1.anInt216;
  9206. }
  9207. if (class9_1.opacity == 0) {
  9208. if (class9_1.aBoolean227)
  9209. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  9210. class9_1.width);
  9211. else
  9212. DrawingArea.fillPixels(k2, class9_1.width,
  9213. class9_1.height, j3, l2);
  9214. } else if (class9_1.aBoolean227)
  9215. DrawingArea.method335(j3, l2, class9_1.width,
  9216. class9_1.height,
  9217. 256 - (class9_1.opacity & 0xff), k2);
  9218. else
  9219. DrawingArea.method338(l2, class9_1.height,
  9220. 256 - (class9_1.opacity & 0xff), j3,
  9221. class9_1.width, k2);
  9222. } else if (class9_1.type == 4) {
  9223. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9224. String s = class9_1.message;
  9225. boolean flag1 = false;
  9226. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9227. flag1 = true;
  9228. int i4;
  9229. if (interfaceIsSelected(class9_1)) {
  9230. i4 = class9_1.anInt219;
  9231. if (flag1 && class9_1.anInt239 != 0)
  9232. i4 = class9_1.anInt239;
  9233. if (class9_1.aString228 != null && class9_1.aString228.length() > 0)
  9234. s = class9_1.aString228;
  9235. } else {
  9236. i4 = class9_1.textColor;
  9237. if (flag1 && class9_1.anInt216 != 0)
  9238. i4 = class9_1.anInt216;
  9239. }
  9240. if (class9_1.atActionType == 6 && aBoolean1149) {
  9241. s = "Please wait...";
  9242. i4 = class9_1.textColor;
  9243. }
  9244. if (DrawingArea.width == 519) {
  9245. if (i4 == 0xffff00)
  9246. i4 = 255;
  9247. if (i4 == 49152)
  9248. i4 = 0xffffff;
  9249. }
  9250. if ((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9251. switch (i4) {
  9252. case 16773120:
  9253. i4 = 0xFE981F;
  9254. break;
  9255. case 7040819:
  9256. i4 = 0xAF6A1A;
  9257. break;
  9258. }
  9259. }
  9260.  
  9261. /*int id = 4004;
  9262. int id2 = 4005;
  9263. 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) {
  9264. if (i4 == 16776960)
  9265. i4 = 0x0000;
  9266. class9_1.textShadow = false;
  9267. }*/
  9268.  
  9269. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  9270. if (s.indexOf("%") != -1) {
  9271. do {
  9272. int k7 = s.indexOf("%1");
  9273. if (k7 == -1)
  9274. break;
  9275. 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)
  9276. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9277. else
  9278. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9279. } while (true);
  9280. do {
  9281. int l7 = s.indexOf("%2");
  9282. if (l7 == -1)
  9283. break;
  9284. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  9285. } while (true);
  9286. do {
  9287. int i8 = s.indexOf("%3");
  9288. if (i8 == -1)
  9289. break;
  9290. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  9291. } while (true);
  9292. do {
  9293. int j8 = s.indexOf("%4");
  9294. if (j8 == -1)
  9295. break;
  9296. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  9297. } while (true);
  9298. do {
  9299. int k8 = s.indexOf("%5");
  9300. if (k8 == -1)
  9301. break;
  9302. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  9303. } while (true);
  9304. }
  9305. int l8 = s.indexOf("\\n");
  9306. String s1;
  9307. if (l8 != -1) {
  9308. s1 = s.substring(0, l8);
  9309. s = s.substring(l8 + 2);
  9310. } else {
  9311. s1 = s;
  9312. s = "";
  9313. }
  9314. RSFont font = null;
  9315. if (textDrawingArea == smallText) {
  9316. font = newSmallFont;
  9317. } else if (textDrawingArea == aTextDrawingArea_1271) {
  9318. font = newRegularFont;
  9319. } else if (textDrawingArea == chatTextDrawingArea) {
  9320. font = newBoldFont;
  9321. } else if (textDrawingArea == aTextDrawingArea_1273) {
  9322. font = newFancyFont;
  9323. } else {
  9324. font = newRegularFont;
  9325. }
  9326.  
  9327. if (class9_1.centerText) {
  9328. font.drawCenteredString(s1, k2 + class9_1.width / 2, l6, i4, class9_1.textShadow ? 0 : -1);
  9329. } else {
  9330. font.drawBasicString(s1, k2, l6, i4, class9_1.textShadow ? 0 : -1);
  9331. }
  9332. }
  9333. } else if (class9_1.type == 5) {
  9334. Sprite image;
  9335. Sprite hover;
  9336. if (interfaceIsSelected(class9_1)) {
  9337. image = class9_1.sprite2;
  9338. hover = class9_1.enabledHover;
  9339. } else {
  9340. image = class9_1.sprite1;
  9341. hover = class9_1.disabledHover;
  9342. }
  9343. if (image != null) {
  9344. if (spellSelected == 1 && class9_1.id == spellID && spellID != 0) {
  9345. image.drawSprite(k2, l2, 0xffffff);
  9346. } else {
  9347. image.drawSprite(k2, l2);
  9348. }
  9349. if (hover != null) {
  9350. if (hoverId == class9_1.id) {
  9351. hover.drawSprite(k2, l2);
  9352. }
  9353. }
  9354. }
  9355. } else if (class9_1.type == 6) {
  9356. int k3 = Rasterizer.centerX;
  9357. int j4 = Rasterizer.centerY;
  9358. Rasterizer.centerX = k2 + class9_1.width / 2;
  9359. Rasterizer.centerY = l2 + class9_1.height / 2;
  9360. int i5 = Rasterizer.SINE[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9361. int l5 = Rasterizer.COSINE[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9362. boolean flag2 = interfaceIsSelected(class9_1);
  9363. int i7;
  9364. if (flag2)
  9365. i7 = class9_1.anInt258;
  9366. else
  9367. i7 = class9_1.anInt257;
  9368. Model model;
  9369. if (i7 == -1) {
  9370. model = class9_1.method209(-1, -1, flag2);
  9371. } else {
  9372. Animation animation = Animation.anims[i7];
  9373. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  9374. }
  9375. if (model != null)
  9376. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  9377. Rasterizer.centerX = k3;
  9378. Rasterizer.centerY = j4;
  9379. } else if (class9_1.type == 7) {
  9380. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9381. int k4 = 0;
  9382. for (int j5 = 0; j5 < class9_1.height; j5++) {
  9383. for (int i6 = 0; i6 < class9_1.width; i6++) {
  9384. if (class9_1.inv[k4] > 0) {
  9385. ItemDef itemDef = ItemDef
  9386. .forID(class9_1.inv[k4] - 1);
  9387. String s2 = itemDef.name;
  9388. if (itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  9389. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9390. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  9391. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  9392. if (class9_1.centerText)
  9393. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  9394. else
  9395. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  9396. }
  9397. k4++;
  9398. }
  9399. }
  9400. } else if (class9_1.type == 9) {
  9401. drawHoverBox(k2, l2, class9_1.message);
  9402. }
  9403. if (class9_1.type == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 0 && !menuOpen) {
  9404. int boxWidth = 0;
  9405. int boxHeight = 0;
  9406. TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
  9407. for (String s1 = class9_1.message; s1.length() > 0;) {
  9408. if (s1.indexOf("%") != -1) {
  9409. do {
  9410. int k7 = s1.indexOf("%1");
  9411. if (k7 == -1)
  9412. break;
  9413. s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s1.substring(k7 + 2);
  9414. } while (true);
  9415. do {
  9416. int l7 = s1.indexOf("%2");
  9417. if (l7 == -1)
  9418. break;
  9419. s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s1.substring(l7 + 2);
  9420. } while (true);
  9421. do {
  9422. int i8 = s1.indexOf("%3");
  9423. if (i8 == -1)
  9424. break;
  9425. s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s1.substring(i8 + 2);
  9426. } while (true);
  9427. do {
  9428. int j8 = s1.indexOf("%4");
  9429. if (j8 == -1)
  9430. break;
  9431. s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s1.substring(j8 + 2);
  9432. } while (true);
  9433. do {
  9434. int k8 = s1.indexOf("%5");
  9435. if (k8 == -1)
  9436. break;
  9437. s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s1.substring(k8 + 2);
  9438. } while (true);
  9439. }
  9440. int l7 = s1.indexOf("\\n");
  9441. String s4;
  9442. if (l7 != -1) {
  9443. s4 = s1.substring(0, l7);
  9444. s1 = s1.substring(l7 + 2);
  9445. } else {
  9446. s4 = s1;
  9447. s1 = "";
  9448. }
  9449. int j10 = textDrawingArea_2.getTextWidth(s4);
  9450. if (j10 > boxWidth) {
  9451. boxWidth = j10;
  9452. }
  9453. boxHeight += textDrawingArea_2.anInt1497 + 1;
  9454. }
  9455. boxWidth += 6;
  9456. boxHeight += 7;
  9457. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  9458. int yPos = l2 + class9_1.height + 5;
  9459. if (xPos < k2 + 5) {
  9460. xPos = k2 + 5;
  9461. }
  9462. if (xPos + boxWidth > k + class9.width) {
  9463. xPos = (k + class9.width) - boxWidth;
  9464. }
  9465. if (yPos + boxHeight > l + class9.height) {
  9466. yPos = (l2 - boxHeight);
  9467. }
  9468. if (class9_1.inventoryhover) {
  9469. if (xPos + boxWidth + k > 249) {
  9470. xPos = 251 - boxWidth - k;
  9471. }
  9472. if (class9_1.id == 3985) {
  9473. yPos = yPos - boxHeight - 17;
  9474. } else if (yPos + boxHeight + l >= 366) {
  9475. yPos = 245 - boxHeight - 10;
  9476. } else if (yPos + boxHeight + l > 320) {
  9477. yPos = 245 - boxHeight - l;
  9478. }
  9479. }
  9480. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  9481. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  9482. String s2 = class9_1.message;
  9483. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) { // anInt1497
  9484. if (s2.indexOf("%") != -1) {
  9485. do {
  9486. int k7 = s2.indexOf("%1");
  9487. if (k7 == -1)
  9488. break;
  9489. s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s2.substring(k7 + 2);
  9490. } while (true);
  9491. do {
  9492. int l7 = s2.indexOf("%2");
  9493. if (l7 == -1)
  9494. break;
  9495. s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s2.substring(l7 + 2);
  9496. } while (true);
  9497. do {
  9498. int i8 = s2.indexOf("%3");
  9499. if (i8 == -1)
  9500. break;
  9501. s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s2.substring(i8 + 2);
  9502. } while (true);
  9503. do {
  9504. int j8 = s2.indexOf("%4");
  9505. if (j8 == -1)
  9506. break;
  9507. s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s2.substring(j8 + 2);
  9508. } while (true);
  9509. do {
  9510. int k8 = s2.indexOf("%5");
  9511. if (k8 == -1)
  9512. break;
  9513. s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s2.substring(k8 + 2);
  9514. } while (true);
  9515. }
  9516. int l11 = s2.indexOf("\\n");
  9517. String s5;
  9518. if (l11 != -1) {
  9519. s5 = s2.substring(0, l11);
  9520. s2 = s2.substring(l11 + 2);
  9521. } else {
  9522. s5 = s2;
  9523. s2 = "";
  9524. }
  9525. if (class9_1.centerText) {
  9526. textDrawingArea_2.method382(yPos, xPos + class9_1.width / 2, s5, j11, false);
  9527. } else {
  9528. if (s5.contains("\\r")) {
  9529. String text = s5.substring(0, s5.indexOf("\\r"));
  9530. String text2 = s5.substring(s5.indexOf("\\r") + 2);
  9531. textDrawingArea_2.method389(false, xPos + 3, 0, text, j11);
  9532. int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
  9533. textDrawingArea_2.method389(false, rightX, 0, text2, j11);
  9534. System.out.println("Box: " + boxWidth + "");
  9535. } else
  9536. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  9537. }
  9538. }
  9539. }
  9540. }
  9541. /*if (class9_1.type == 12) {
  9542. Sprite sprite;
  9543. if (interfaceIsSelected(class9_1))
  9544. sprite = class9_1.sprite2;
  9545. else
  9546. sprite = class9_1.sprite1;
  9547. if (sprite != null)
  9548. sprite.drawAdvancedSprite(k2, l2);
  9549. } else if (class9_1.type == 9) {
  9550. System.out.println("here");
  9551. drawHoverBox(k2, l2, class9_1.message);
  9552. }*/
  9553. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9554. }
  9555.  
  9556. public final String methodR(int j) {
  9557. if (j >= 0 && j < 10000)
  9558. return String.valueOf(j);
  9559. if (j >= 10000 && j < 10000000)
  9560. return j / 1000 + "K";
  9561. if (j >= 10000000 && j < 999999999)
  9562. return j / 1000000 + "M";
  9563. if (j >= 999999999)
  9564. return "*";
  9565. else
  9566. return "?";
  9567. }
  9568.  
  9569. public void drawHoverBox(int xPos, int yPos, String text) {
  9570. String[] results = text.split("\n");
  9571. int height = (results.length * 16) + 6;
  9572. int width;
  9573. width = chatTextDrawingArea.getTextWidth(results[0]) + 6;
  9574. for (int i = 1; i < results.length; i++)
  9575. if (width <= chatTextDrawingArea.getTextWidth(results[i]) + 6)
  9576. width = chatTextDrawingArea.getTextWidth(results[i]) + 6;
  9577. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  9578. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  9579. yPos += 14;
  9580. for (int i = 0; i < results.length; i++) {
  9581. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i],
  9582. yPos);
  9583. yPos += 16;
  9584. }
  9585. }
  9586.  
  9587. public void drawBlackBox(int xPos, int yPos) {
  9588. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  9589. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  9590. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  9591. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  9592. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  9593. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  9594. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  9595. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  9596. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  9597. }
  9598.  
  9599. public void randomizeBackground(Background background) {
  9600. int j = 256;
  9601. for (int k = 0; k < anIntArray1190.length; k++)
  9602. anIntArray1190[k] = 0;
  9603.  
  9604. for (int l = 0; l < 5000; l++) {
  9605. int i1 = (int) (Math.random() * 128D * (double) j);
  9606. anIntArray1190[i1] = (int) (Math.random() * 256D);
  9607. }
  9608. for (int j1 = 0; j1 < 20; j1++) {
  9609. for (int k1 = 1; k1 < j - 1; k1++) {
  9610. for (int i2 = 1; i2 < 127; i2++) {
  9611. int k2 = i2 + (k1 << 7);
  9612. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  9613. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9614. }
  9615.  
  9616. }
  9617. int ai[] = anIntArray1190;
  9618. anIntArray1190 = anIntArray1191;
  9619. anIntArray1191 = ai;
  9620. }
  9621. if (background != null) {
  9622. int l1 = 0;
  9623. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  9624. for (int l2 = 0; l2 < background.anInt1452; l2++)
  9625. if (background.aByteArray1450[l1++] != 0) {
  9626. int i3 = l2 + 16 + background.anInt1454;
  9627. int j3 = j2 + 16 + background.anInt1455;
  9628. int k3 = i3 + (j3 << 7);
  9629. anIntArray1190[k3] = 0;
  9630. }
  9631. }
  9632. }
  9633. }
  9634.  
  9635. public void method107(int i, int j, Stream stream, Player player) {
  9636. if ((i & 0x400) != 0) {
  9637. player.anInt1543 = stream.method428();
  9638. player.anInt1545 = stream.method428();
  9639. player.anInt1544 = stream.method428();
  9640. player.anInt1546 = stream.method428();
  9641. player.anInt1547 = stream.method436() + loopCycle;
  9642. player.anInt1548 = stream.method435() + loopCycle;
  9643. player.anInt1549 = stream.method428();
  9644. player.method446();
  9645. }
  9646. if ((i & 0x100) != 0) {
  9647. player.anInt1520 = stream.method434();
  9648. int k = stream.readDWord();
  9649. player.anInt1524 = k >> 16;
  9650. player.anInt1523 = loopCycle + (k & 0xffff);
  9651. player.anInt1521 = 0;
  9652. player.anInt1522 = 0;
  9653. if (player.anInt1523 > loopCycle)
  9654. player.anInt1521 = -1;
  9655. if (player.anInt1520 == 65535)
  9656. player.anInt1520 = -1;
  9657. }
  9658. if ((i & 8) != 0) {
  9659. int l = stream.method434();
  9660. if (l == 65535)
  9661. l = -1;
  9662. int i2 = stream.method427();
  9663. if (l == player.anim && l != -1) {
  9664. int i3 = Animation.anims[l].anInt365;
  9665. if (i3 == 1) {
  9666. player.anInt1527 = 0;
  9667. player.anInt1528 = 0;
  9668. player.anInt1529 = i2;
  9669. player.anInt1530 = 0;
  9670. }
  9671. if (i3 == 2)
  9672. player.anInt1530 = 0;
  9673. } else if (l == -1
  9674. || player.anim == -1
  9675. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  9676. player.anim = l;
  9677. player.anInt1527 = 0;
  9678. player.anInt1528 = 0;
  9679. player.anInt1529 = i2;
  9680. player.anInt1530 = 0;
  9681. player.anInt1542 = player.smallXYIndex;
  9682. }
  9683. }
  9684. if ((i & 4) != 0) {
  9685. player.textSpoken = stream.readString();
  9686. if (player.textSpoken.charAt(0) == '~') {
  9687. player.textSpoken = player.textSpoken.substring(1);
  9688. pushMessage(player.textSpoken, 2, player.name);
  9689. } else if (player == myPlayer)
  9690. pushMessage(player.textSpoken, 2, player.name);
  9691. player.anInt1513 = 0;
  9692. player.anInt1531 = 0;
  9693. player.textCycle = 150;
  9694. }
  9695. if ((i & 0x80) != 0) {
  9696. int i1 = stream.method434();
  9697. int j2 = stream.readUnsignedByte();
  9698. int j3 = stream.method427();
  9699. int k3 = stream.currentOffset;
  9700. if (player.name != null && player.visible) {
  9701. long l3 = TextClass.longForName(player.name);
  9702. boolean flag = false;
  9703. if (j2 <= 1) {
  9704. for (int i4 = 0; i4 < ignoreCount; i4++) {
  9705. if (ignoreListAsLongs[i4] != l3)
  9706. continue;
  9707. flag = true;
  9708. break;
  9709. }
  9710.  
  9711. }
  9712. if (!flag && anInt1251 == 0)
  9713. try {
  9714. aStream_834.currentOffset = 0;
  9715. stream.method442(j3, 0, aStream_834.buffer);
  9716. aStream_834.currentOffset = 0;
  9717. String s = TextInput.method525(j3, aStream_834);
  9718. player.textSpoken = s;
  9719. player.anInt1513 = i1 >> 8;
  9720. player.privelage = j2;
  9721. player.anInt1531 = i1 & 0xff;
  9722. player.textCycle = 150;
  9723. if(j2 == 1)
  9724. pushMessage(s, 1, "@cr1@" + player.name);
  9725. else if(j2 == 2)
  9726. pushMessage(s, 1, "@cr2@" + player.name);
  9727. else if(j2 == 3)
  9728. pushMessage(s, 1, "@cr3@" + player.name);
  9729. else if(j2 == 4)
  9730. pushMessage(s, 1, "@cr4@" + player.name);
  9731. else if(j2 == 5)
  9732. pushMessage(s, 1, "@cr5@" + player.name);
  9733. else if(j2 == 6)
  9734. pushMessage(s, 1, "@cr6@" + player.name);
  9735. else if(j2 == 7)
  9736. pushMessage(s, 1, "@cr7@" + player.name);
  9737. else if(j2 == 8)
  9738. pushMessage(s, 1, "@cr8@" + player.name);
  9739. else if(j2 == 9)
  9740. pushMessage(s, 1, "@cr9@" + player.name);
  9741. else if(j2 == 10)
  9742. pushMessage(s, 1, "@cr10@" + player.name);
  9743. else if(j2 == 11)
  9744. pushMessage(s, 1, "@cr11@" + player.name);
  9745. else if(j2 == 12)
  9746. pushMessage(s, 1, "@cr12@" + player.name);
  9747. else if(j2 == 13)
  9748. pushMessage(s, 1, "@cr13@" + player.name);
  9749. else if(j2 == 14)
  9750. pushMessage(s, 1, "@cr14@" + player.name);
  9751. else if(j2 == 15)
  9752. pushMessage(s, 1, "@cr15@" + player.name);
  9753. else if(j2 == 16)
  9754. pushMessage(s, 1, "@cr16@" + player.name);
  9755. else if(j2 == 17)
  9756. pushMessage(s, 1, "@cr17@" + player.name);
  9757. else if(j2 == 18)
  9758. pushMessage(s, 1, "@cr18@" + player.name);
  9759. else if(j2 == 19)
  9760. pushMessage(s, 1, "@cr19@" + player.name);
  9761. else if(j2 == 20)
  9762. pushMessage(s, 1, "@cr20@" + player.name);
  9763. else
  9764. pushMessage(s, 2, player.name);
  9765. } catch (Exception exception) {
  9766. SignLink.reporterror("cde2");
  9767. }
  9768. }
  9769. stream.currentOffset = k3 + j3;
  9770. }
  9771. if ((i & 1) != 0) {
  9772. player.interactingEntity = stream.method434();
  9773. if (player.interactingEntity == 65535)
  9774. player.interactingEntity = -1;
  9775. }
  9776. if ((i & 0x10) != 0) {
  9777. int j1 = stream.method427();
  9778. byte abyte0[] = new byte[j1];
  9779. Stream stream_1 = new Stream(abyte0);
  9780. stream.readBytes(j1, 0, abyte0);
  9781. aStreamArray895s[j] = stream_1;
  9782. player.updatePlayer(stream_1);
  9783. }
  9784. if ((i & 2) != 0) {
  9785. player.anInt1538 = stream.method436();
  9786. player.anInt1539 = stream.method434();
  9787. }
  9788. if((i & 0x20) != 0)
  9789. {
  9790. int k1 = stream.readUnsignedByte();
  9791. int k2 = stream.method426();
  9792. int icon = stream.readUnsignedByte();
  9793. player.updateHitData(k2, k1, loopCycle, icon == 255 ? -1 : icon);
  9794. player.loopCycleStatus = loopCycle + 300;
  9795. player.currentHealth = stream.method427();
  9796. player.maxHealth = stream.readUnsignedByte();
  9797. }
  9798. if((i & 0x200) != 0)
  9799. {
  9800. int l1 = stream.readUnsignedByte();
  9801. int l2 = stream.method428();
  9802. int icon = stream.readUnsignedByte();
  9803. player.updateHitData(l2, l1, loopCycle, icon);
  9804. player.loopCycleStatus = loopCycle + 300;
  9805. player.currentHealth = stream.readUnsignedByte();
  9806. player.maxHealth = stream.method427();
  9807. }
  9808. }
  9809.  
  9810. public void method108() {
  9811. try {
  9812. int j = myPlayer.x + cameraOffsetX;
  9813. int k = myPlayer.y + cameraOffsetY;
  9814. if (anInt1014 - j < -500 || anInt1014 - j > 500
  9815. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  9816. anInt1014 = j;
  9817. anInt1015 = k;
  9818. }
  9819. if (anInt1014 != j)
  9820. anInt1014 += (j - anInt1014) / 16;
  9821. if (anInt1015 != k)
  9822. anInt1015 += (k - anInt1015) / 16;
  9823. if (super.keyArray[1] == 1)
  9824. anInt1186 += (-24 - anInt1186) / 2;
  9825. else if (super.keyArray[2] == 1)
  9826. anInt1186 += (24 - anInt1186) / 2;
  9827. else
  9828. anInt1186 /= 2;
  9829. if (super.keyArray[3] == 1)
  9830. anInt1187 += (12 - anInt1187) / 2;
  9831. else if (super.keyArray[4] == 1)
  9832. anInt1187 += (-12 - anInt1187) / 2;
  9833. else
  9834. anInt1187 /= 2;
  9835. viewRotation = viewRotation + anInt1186 / 2 & 0x7ff;
  9836. anInt1184 += anInt1187 / 2;
  9837. if (anInt1184 < 128)
  9838. anInt1184 = 128;
  9839. if (anInt1184 > 383)
  9840. anInt1184 = 383;
  9841. int l = anInt1014 >> 7;
  9842. int i1 = anInt1015 >> 7;
  9843. int j1 = method42(plane, anInt1015, anInt1014);
  9844. int k1 = 0;
  9845. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  9846. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  9847. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  9848. int l2 = plane;
  9849. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9850. l2++;
  9851. int i3 = j1 - intGroundArray[l2][l1][k2];
  9852. if (i3 > k1)
  9853. k1 = i3;
  9854. }
  9855.  
  9856. }
  9857.  
  9858. }
  9859. anInt1005++;
  9860. if (anInt1005 > 1512) {
  9861. anInt1005 = 0;
  9862. stream.createFrame(77);
  9863. stream.writeWordBigEndian(0);
  9864. int i2 = stream.currentOffset;
  9865. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9866. stream.writeWordBigEndian(101);
  9867. stream.writeWordBigEndian(233);
  9868. stream.writeWord(45092);
  9869. if ((int) (Math.random() * 2D) == 0)
  9870. stream.writeWord(35784);
  9871. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9872. stream.writeWordBigEndian(64);
  9873. stream.writeWordBigEndian(38);
  9874. stream.writeWord((int) (Math.random() * 65536D));
  9875. stream.writeWord((int) (Math.random() * 65536D));
  9876. stream.writeBytes(stream.currentOffset - i2);
  9877. }
  9878. int j2 = k1 * 192;
  9879. if (j2 > 0x17f00)
  9880. j2 = 0x17f00;
  9881. if (j2 < 32768)
  9882. j2 = 32768;
  9883. if (j2 > anInt984) {
  9884. anInt984 += (j2 - anInt984) / 24;
  9885. return;
  9886. }
  9887. if (j2 < anInt984) {
  9888. anInt984 += (j2 - anInt984) / 80;
  9889. }
  9890. } catch (Exception _ex) {
  9891. SignLink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  9892. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  9893. + anInt1070 + "," + baseX + "," + baseY);
  9894. throw new RuntimeException("eek");
  9895. }
  9896. }
  9897.  
  9898. public void processDrawing() {
  9899. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  9900. showErrorScreen();
  9901. return;
  9902. }
  9903. anInt1061++;
  9904. if (!loggedIn)
  9905. drawLoginScreen();
  9906. else
  9907. drawGameScreen();
  9908. anInt1213 = 0;
  9909. }
  9910.  
  9911. public boolean isFriendOrSelf(String s) {
  9912. if (s == null)
  9913. return false;
  9914. for (int i = 0; i < friendsCount; i++)
  9915. if (s.equalsIgnoreCase(friendsList[i]))
  9916. return true;
  9917. return s.equalsIgnoreCase(myPlayer.name);
  9918. }
  9919.  
  9920. public static String combatDiffColor(int i, int j) {
  9921. int k = i - j;
  9922. if (k < -9)
  9923. return "@red@";
  9924. if (k < -6)
  9925. return "@or3@";
  9926. if (k < -3)
  9927. return "@or2@";
  9928. if (k < 0)
  9929. return "@or1@";
  9930. if (k > 9)
  9931. return "@gre@";
  9932. if (k > 6)
  9933. return "@gr3@";
  9934. if (k > 3)
  9935. return "@gr2@";
  9936. if (k > 0)
  9937. return "@gr1@";
  9938. else
  9939. return "@yel@";
  9940. }
  9941.  
  9942. public void setWaveVolume(int i) {
  9943. SignLink.wavevol = i;
  9944. }
  9945.  
  9946. @SuppressWarnings("unused")
  9947. public void draw3dScreen() {
  9948. drawSplitpublicChat();
  9949. if (counterOn)
  9950. drawCounterOnScreen();
  9951. if (crossType == 1) {
  9952. crosses[crossIndex / 100]
  9953. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9954. anInt1142++;
  9955. if (anInt1142 > 67) {
  9956. anInt1142 = 0;
  9957. stream.createFrame(78);
  9958. }
  9959. }
  9960. if (crossType == 2)
  9961. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  9962. crossY - 8 - 4);
  9963. if (anInt1018 != -1) {
  9964. method119(anInt945, anInt1018);
  9965. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9966. }
  9967. if (openInterfaceID != -1) {
  9968. method119(anInt945, openInterfaceID);
  9969. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9970. }
  9971. method70();
  9972. if (!menuOpen) {
  9973. processRightClick();
  9974. drawTooltip();
  9975. } else if (menuScreenArea == 0)
  9976. drawMenu();
  9977. if (anInt1055 == 1)
  9978. multiOverlay.drawSprite(472, 296);
  9979. if (fpsOn) {
  9980. char c = '\u01FB';
  9981. int k = 20;
  9982. int i1 = 0xffff00;
  9983. if (super.fps < 15)
  9984. i1 = 0xff0000;
  9985. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9986. k += 15;
  9987. Runtime runtime = Runtime.getRuntime();
  9988. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9989. i1 = 0xffff00;
  9990. if (j1 > 0x2000000 && lowMem)
  9991. i1 = 0xff0000;
  9992. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9993. k += 15;
  9994. }
  9995. int i1 = 0xffff00;
  9996. int x = baseX + (myPlayer.x - 6 >> 7);
  9997. int y = baseY + (myPlayer.y - 6 >> 7);
  9998. if (clientData) {
  9999. char c = '\u01FB';
  10000. int k = 20;
  10001. if (super.fps < 15)
  10002. i1 = 0xff0000;
  10003. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 270 - 15, 5);
  10004. aTextDrawingArea_1271.method385(0xffff00, "Ping: " + ping + "ms", 270, 5);
  10005. Runtime runtime = Runtime.getRuntime();
  10006. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10007. i1 = 0xffff00;
  10008. if (j1 > 0x2000000 && lowMem)
  10009. i1 = 0xff0000;
  10010. k += 15;
  10011. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 284, 5);
  10012. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 299, 5);
  10013. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 314, 5);
  10014. aTextDrawingArea_1271.method385(0xffff00, "Client/Cache: " + update.getVersions().getProperty("client") + "/" + update.getVersions().getProperty("cache"), 329, 5);
  10015. }
  10016. if (anInt1104 != 0) {
  10017. int j = anInt1104 / 50;
  10018. int l = j / 60;
  10019. j %= 60;
  10020. if (j < 10)
  10021. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  10022. + l + ":0" + j, 329, 4);
  10023. else
  10024. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  10025. + l + ":" + j, 329, 4);
  10026. anInt849++;
  10027. if (anInt849 > 75) {
  10028. anInt849 = 0;
  10029. stream.createFrame(148);
  10030. }
  10031. }
  10032. }
  10033.  
  10034. public void addIgnore(long l) {
  10035. try {
  10036. if (l == 0L)
  10037. return;
  10038. if (ignoreCount >= 100) {
  10039. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10040. return;
  10041. }
  10042. String s = TextClass.fixName(TextClass.nameForLong(l));
  10043. for (int j = 0; j < ignoreCount; j++)
  10044. if (ignoreListAsLongs[j] == l) {
  10045. pushMessage(s + " is already on your ignore list", 0, "");
  10046. return;
  10047. }
  10048. for (int k = 0; k < friendsCount; k++)
  10049. if (friendsListAsLongs[k] == l) {
  10050. pushMessage("Please remove " + s
  10051. + " from your friend list first", 0, "");
  10052. return;
  10053. }
  10054.  
  10055. ignoreListAsLongs[ignoreCount++] = l;
  10056. needDrawTabArea = true;
  10057. stream.createFrame(133);
  10058. stream.writeQWord(l);
  10059. return;
  10060. } catch (RuntimeException runtimeexception) {
  10061. SignLink.reporterror("45688, " + l + ", " + 4 + ", "
  10062. + runtimeexception.toString());
  10063. }
  10064. throw new RuntimeException();
  10065. }
  10066.  
  10067. public void method114() {
  10068. for (int i = -1; i < playerCount; i++) {
  10069. int j;
  10070. if (i == -1)
  10071. j = myPlayerIndex;
  10072. else
  10073. j = playerIndices[i];
  10074. Player player = playerArray[j];
  10075. if (player != null)
  10076. method96(player);
  10077. }
  10078.  
  10079. }
  10080.  
  10081. public void method115() {
  10082. if (loadingStage == 2) {
  10083. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  10084. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  10085. .reverseGetNext()) {
  10086. if (class30_sub1.anInt1294 > 0)
  10087. class30_sub1.anInt1294--;
  10088. if (class30_sub1.anInt1294 == 0) {
  10089. if (class30_sub1.anInt1299 < 0
  10090. || ObjectManager.method178(class30_sub1.anInt1299,
  10091. class30_sub1.anInt1301)) {
  10092. method142(class30_sub1.anInt1298,
  10093. class30_sub1.anInt1295, class30_sub1.anInt1300,
  10094. class30_sub1.anInt1301, class30_sub1.anInt1297,
  10095. class30_sub1.anInt1296, class30_sub1.anInt1299);
  10096. class30_sub1.unlink();
  10097. }
  10098. } else {
  10099. if (class30_sub1.anInt1302 > 0)
  10100. class30_sub1.anInt1302--;
  10101. if (class30_sub1.anInt1302 == 0
  10102. && class30_sub1.anInt1297 >= 1
  10103. && class30_sub1.anInt1298 >= 1
  10104. && class30_sub1.anInt1297 <= 102
  10105. && class30_sub1.anInt1298 <= 102
  10106. && (class30_sub1.anInt1291 < 0 || ObjectManager
  10107. .method178(class30_sub1.anInt1291,
  10108. class30_sub1.anInt1293))) {
  10109. method142(class30_sub1.anInt1298,
  10110. class30_sub1.anInt1295, class30_sub1.anInt1292,
  10111. class30_sub1.anInt1293, class30_sub1.anInt1297,
  10112. class30_sub1.anInt1296, class30_sub1.anInt1291);
  10113. class30_sub1.anInt1302 = -1;
  10114. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10115. && class30_sub1.anInt1299 == -1)
  10116. class30_sub1.unlink();
  10117. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  10118. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  10119. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10120. class30_sub1.unlink();
  10121. }
  10122. }
  10123. }
  10124.  
  10125. }
  10126. }
  10127.  
  10128. public void determineMenuSize() {
  10129. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10130. for (int j = 0; j < menuActionRow; j++) {
  10131. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10132. if (k > i)
  10133. i = k;
  10134. }
  10135.  
  10136. i += 8;
  10137. int l = 15 * menuActionRow + 21;
  10138. if (super.saveClickX > 4 && super.saveClickY > 4
  10139. && super.saveClickX < 516 && super.saveClickY < 338) {
  10140. int i1 = super.saveClickX - 4 - i / 2;
  10141. if (i1 + i > 512)
  10142. i1 = 512 - i;
  10143. if (i1 < 0)
  10144. i1 = 0;
  10145. int l1 = super.saveClickY - 4;
  10146. if (l1 + l > 334)
  10147. l1 = 334 - l;
  10148. if (l1 < 0)
  10149. l1 = 0;
  10150. menuOpen = true;
  10151. menuScreenArea = 0;
  10152. menuOffsetX = i1;
  10153. menuOffsetY = l1;
  10154. menuWidth = i;
  10155. menuHeight = 15 * menuActionRow + 22;
  10156. }
  10157. if (super.saveClickX > 519 && super.saveClickY > 168
  10158. && super.saveClickX < 765 && super.saveClickY < 503) {
  10159. int j1 = super.saveClickX - 519 - i / 2;
  10160. if (j1 < 0)
  10161. j1 = 0;
  10162. else if (j1 + i > 245)
  10163. j1 = 245 - i;
  10164. int i2 = super.saveClickY - 168;
  10165. if (i2 < 0)
  10166. i2 = 0;
  10167. else if (i2 + l > 333)
  10168. i2 = 333 - l;
  10169. menuOpen = true;
  10170. menuScreenArea = 1;
  10171. menuOffsetX = j1;
  10172. menuOffsetY = i2;
  10173. menuWidth = i;
  10174. menuHeight = 15 * menuActionRow + 22;
  10175. }
  10176. if (super.saveClickX > 0 && super.saveClickY > 338
  10177. && super.saveClickX < 516 && super.saveClickY < 503) {
  10178. int k1 = super.saveClickX - 0 - i / 2;
  10179. if (k1 < 0)
  10180. k1 = 0;
  10181. else if (k1 + i > 516)
  10182. k1 = 516 - i;
  10183. int j2 = super.saveClickY - 338;
  10184. if (j2 < 0)
  10185. j2 = 0;
  10186. else if (j2 + l > 165)
  10187. j2 = 165 - l;
  10188. menuOpen = true;
  10189. menuScreenArea = 2;
  10190. menuOffsetX = k1;
  10191. menuOffsetY = j2;
  10192. menuWidth = i;
  10193. menuHeight = 15 * menuActionRow + 22;
  10194. }
  10195. if (super.saveClickX >= 515 && super.saveClickY >= 0 && super.saveClickX <= 765 && super.saveClickY <= 169) {
  10196. int k1 = super.saveClickX -515- i / 2;
  10197. if (k1 < 0)
  10198. k1 = 0;
  10199. else if (k1 + i > 249)
  10200. k1 =249-i;
  10201. int j2 = super.saveClickY;
  10202. if (j2 < 0)
  10203. j2 = 0;
  10204. else if (j2 + l > 168)
  10205. j2 = 168 - l;
  10206. menuOpen = true;
  10207. menuScreenArea = 3;
  10208. menuOffsetX = k1;
  10209. menuOffsetY = j2;
  10210. menuWidth = i;
  10211. menuHeight = 15 * menuActionRow + 22;
  10212. }
  10213. }
  10214.  
  10215. public void method117(Stream stream) {
  10216. stream.initBitAccess();
  10217. int j = stream.readBits(1);
  10218. if (j == 0)
  10219. return;
  10220. int k = stream.readBits(2);
  10221. if (k == 0) {
  10222. anIntArray894[anInt893++] = myPlayerIndex;
  10223. return;
  10224. }
  10225. if (k == 1) {
  10226. int l = stream.readBits(3);
  10227. myPlayer.moveInDir(false, l);
  10228. int k1 = stream.readBits(1);
  10229. if (k1 == 1)
  10230. anIntArray894[anInt893++] = myPlayerIndex;
  10231. return;
  10232. }
  10233. if (k == 2) {
  10234. int i1 = stream.readBits(3);
  10235. myPlayer.moveInDir(true, i1);
  10236. int l1 = stream.readBits(3);
  10237. myPlayer.moveInDir(true, l1);
  10238. int j2 = stream.readBits(1);
  10239. if (j2 == 1)
  10240. anIntArray894[anInt893++] = myPlayerIndex;
  10241. return;
  10242. }
  10243. if (k == 3) {
  10244. plane = stream.readBits(2);
  10245. int j1 = stream.readBits(1);
  10246. int i2 = stream.readBits(1);
  10247. if (i2 == 1)
  10248. anIntArray894[anInt893++] = myPlayerIndex;
  10249. int k2 = stream.readBits(7);
  10250. int l2 = stream.readBits(7);
  10251. myPlayer.setPos(l2, k2, j1 == 1);
  10252. }
  10253. }
  10254.  
  10255. public void nullLoader() {
  10256. aBoolean831 = false;
  10257. while (drawingFlames) {
  10258. aBoolean831 = false;
  10259. try {
  10260. Thread.sleep(50L);
  10261. } catch (Exception _ex) {
  10262. }
  10263. }
  10264. aBackgroundArray1152s = null;
  10265. anIntArray850 = null;
  10266. anIntArray851 = null;
  10267. anIntArray852 = null;
  10268. anIntArray853 = null;
  10269. anIntArray1190 = null;
  10270. anIntArray1191 = null;
  10271. anIntArray828 = null;
  10272. anIntArray829 = null;
  10273. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10274. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10275. }
  10276.  
  10277. public boolean method119(int i, int j) {
  10278. boolean flag1 = false;
  10279. RSInterface class9 = RSInterface.interfaceCache[j];
  10280. for (int k = 0; k < class9.children.length; k++) {
  10281. if (class9.children[k] == -1)
  10282. break;
  10283. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10284. if (class9_1.type == 1)
  10285. flag1 |= method119(i, class9_1.id);
  10286. if (class9_1.type == 6
  10287. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  10288. boolean flag2 = interfaceIsSelected(class9_1);
  10289. int l;
  10290. if (flag2)
  10291. l = class9_1.anInt258;
  10292. else
  10293. l = class9_1.anInt257;
  10294. if (l != -1) {
  10295. Animation animation = Animation.anims[l];
  10296. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  10297. .method258(class9_1.anInt246);) {
  10298. class9_1.anInt208 -= animation
  10299. .method258(class9_1.anInt246) + 1;
  10300. class9_1.anInt246++;
  10301. if (class9_1.anInt246 >= animation.anInt352) {
  10302. class9_1.anInt246 -= animation.anInt356;
  10303. if (class9_1.anInt246 < 0
  10304. || class9_1.anInt246 >= animation.anInt352)
  10305. class9_1.anInt246 = 0;
  10306. }
  10307. flag1 = true;
  10308. }
  10309.  
  10310. }
  10311. }
  10312. }
  10313.  
  10314. return flag1;
  10315. }
  10316.  
  10317. public int method120() {
  10318. int j = 3;
  10319. if (yCameraCurve < 310) {
  10320. int k = xCameraPos >> 7;
  10321. int l = yCameraPos >> 7;
  10322. int i1 = myPlayer.x >> 7;
  10323. int j1 = myPlayer.y >> 7;
  10324. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10325. j = plane;
  10326. int k1;
  10327. if (i1 > k)
  10328. k1 = i1 - k;
  10329. else
  10330. k1 = k - i1;
  10331. int l1;
  10332. if (j1 > l)
  10333. l1 = j1 - l;
  10334. else
  10335. l1 = l - j1;
  10336. if (k1 > l1) {
  10337. int i2 = (l1 * 0x10000) / k1;
  10338. int k2 = 32768;
  10339. while (k != i1) {
  10340. if (k < i1)
  10341. k++;
  10342. else if (k > i1)
  10343. k--;
  10344. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10345. j = plane;
  10346. k2 += i2;
  10347. if (k2 >= 0x10000) {
  10348. k2 -= 0x10000;
  10349. if (l < j1)
  10350. l++;
  10351. else if (l > j1)
  10352. l--;
  10353. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10354. j = plane;
  10355. }
  10356. }
  10357. } else {
  10358. int j2 = (k1 * 0x10000) / l1;
  10359. int l2 = 32768;
  10360. while (l != j1) {
  10361. if (l < j1)
  10362. l++;
  10363. else if (l > j1)
  10364. l--;
  10365. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10366. j = plane;
  10367. l2 += j2;
  10368. if (l2 >= 0x10000) {
  10369. l2 -= 0x10000;
  10370. if (k < i1)
  10371. k++;
  10372. else if (k > i1)
  10373. k--;
  10374. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10375. j = plane;
  10376. }
  10377. }
  10378. }
  10379. }
  10380. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10381. j = plane;
  10382. return j;
  10383. }
  10384.  
  10385. public int method121() {
  10386. int j = method42(plane, yCameraPos, xCameraPos);
  10387. if (j - zCameraPos < 800
  10388. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10389. return plane;
  10390. else
  10391. return 3;
  10392. }
  10393.  
  10394. public void delIgnore(long l) {
  10395. try {
  10396. if (l == 0L)
  10397. return;
  10398. for (int j = 0; j < ignoreCount; j++)
  10399. if (ignoreListAsLongs[j] == l) {
  10400. ignoreCount--;
  10401. needDrawTabArea = true;
  10402. System.arraycopy(ignoreListAsLongs, j + 1,
  10403. ignoreListAsLongs, j, ignoreCount - j);
  10404.  
  10405. stream.createFrame(74);
  10406. stream.writeQWord(l);
  10407. return;
  10408. }
  10409.  
  10410. return;
  10411. } catch (RuntimeException runtimeexception) {
  10412. SignLink.reporterror("47229, " + 3 + ", " + l + ", "
  10413. + runtimeexception.toString());
  10414. }
  10415. throw new RuntimeException();
  10416. }
  10417.  
  10418. public void chatJoin(long l) {
  10419. try {
  10420. if (l == 0L)
  10421. return;
  10422. stream.createFrame(60);
  10423. stream.writeQWord(l);
  10424. return;
  10425. } catch (RuntimeException runtimeexception) {
  10426. SignLink.reporterror("47229, " + 3 + ", " + l + ", "
  10427. + runtimeexception.toString());
  10428. }
  10429. throw new RuntimeException();
  10430.  
  10431. }
  10432.  
  10433. public String getParameter(String s) {
  10434. if (SignLink.mainapp != null)
  10435. return SignLink.mainapp.getParameter(s);
  10436. else
  10437. return super.getParameter(s);
  10438. }
  10439.  
  10440. public void adjustVolume(boolean flag, int i) {
  10441. SignLink.midivol = i;
  10442. if (flag)
  10443. SignLink.midi = "voladjust";
  10444. }
  10445.  
  10446. public int extractInterfaceValues(RSInterface class9, int j) {
  10447. if (class9.valueIndexArray == null
  10448. || j >= class9.valueIndexArray.length)
  10449. return -2;
  10450. try {
  10451. int ai[] = class9.valueIndexArray[j];
  10452. int k = 0;
  10453. int l = 0;
  10454. int i1 = 0;
  10455. do {
  10456. int j1 = ai[l++];
  10457. int k1 = 0;
  10458. byte byte0 = 0;
  10459. if (j1 == 0)
  10460. return k;
  10461. if (j1 == 1)
  10462. k1 = currentStats[ai[l++]];
  10463. if (j1 == 2)
  10464. k1 = maxStats[ai[l++]];
  10465. if (j1 == 3)
  10466. k1 = currentExp[ai[l++]];
  10467. if (j1 == 4) {
  10468. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10469. int k2 = ai[l++];
  10470. if (k2 >= 0 && k2 < ItemDef.totalItems
  10471. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  10472. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  10473. if (class9_1.inv[j3] == k2 + 1)
  10474. k1 += class9_1.invStackSizes[j3];
  10475.  
  10476. }
  10477. }
  10478. if (j1 == 5)
  10479. k1 = variousSettings[ai[l++]];
  10480. if (j1 == 6)
  10481. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10482. if (j1 == 7)
  10483. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10484. if (j1 == 8)
  10485. k1 = myPlayer.combatLevel;
  10486. if (j1 == 9) {
  10487. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  10488. if (Skills.skillEnabled[l1])
  10489. k1 += maxStats[l1];
  10490.  
  10491. }
  10492. if (j1 == 10) {
  10493. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10494. int l2 = ai[l++] + 1;
  10495. if (l2 >= 0 && l2 < ItemDef.totalItems
  10496. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  10497. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  10498. if (class9_2.inv[k3] != l2)
  10499. continue;
  10500. k1 = 0x3b9ac9ff;
  10501. break;
  10502. }
  10503.  
  10504. }
  10505. }
  10506. if (j1 == 11)
  10507. k1 = energy;
  10508. if (j1 == 12)
  10509. k1 = weight;
  10510. if (j1 == 13) {
  10511. int i2 = variousSettings[ai[l++]];
  10512. int i3 = ai[l++];
  10513. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10514. }
  10515. if (j1 == 14) {
  10516. int j2 = ai[l++];
  10517. VarBit varBit = VarBit.cache[j2];
  10518. int l3 = varBit.anInt648;
  10519. int i4 = varBit.anInt649;
  10520. int j4 = varBit.anInt650;
  10521. int k4 = anIntArray1232[j4 - i4];
  10522. k1 = variousSettings[l3] >> i4 & k4;
  10523. }
  10524. if (j1 == 15)
  10525. byte0 = 1;
  10526. if (j1 == 16)
  10527. byte0 = 2;
  10528. if (j1 == 17)
  10529. byte0 = 3;
  10530. if (j1 == 18)
  10531. k1 = (myPlayer.x >> 7) + baseX;
  10532. if (j1 == 19)
  10533. k1 = (myPlayer.y >> 7) + baseY;
  10534. if (j1 == 20)
  10535. k1 = ai[l++];
  10536. if (byte0 == 0) {
  10537. if (i1 == 0)
  10538. k += k1;
  10539. if (i1 == 1)
  10540. k -= k1;
  10541. if (i1 == 2 && k1 != 0)
  10542. k /= k1;
  10543. if (i1 == 3)
  10544. k *= k1;
  10545. i1 = 0;
  10546. } else {
  10547. i1 = byte0;
  10548. }
  10549. } while (true);
  10550. } catch (Exception _ex) {
  10551. return -1;
  10552. }
  10553. }
  10554.  
  10555. public void drawTooltip() {
  10556. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10557. return;
  10558. String s;
  10559. if (itemSelected == 1 && menuActionRow < 2)
  10560. s = "Use " + selectedItemName + " with...";
  10561. else if (spellSelected == 1 && menuActionRow < 2)
  10562. s = spellTooltip + "...";
  10563. else
  10564. s = menuActionName[menuActionRow - 1];
  10565. if (menuActionRow > 2)
  10566. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10567. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10568. }
  10569.  
  10570. public boolean runClicked = false;
  10571. public boolean Resting = false;
  10572. public boolean runHover;
  10573.  
  10574. public void loadExtraSprites() {
  10575. for(int k = 1; k <= 15; k++)
  10576. ORBS[k] = new Sprite((new StringBuilder()).append("Frame/ORBS ").append(k).append("").toString());
  10577. }
  10578. public void drawWorldMapButton() {
  10579. worldMapIcon.drawSprite(8, 124);
  10580. }
  10581.  
  10582. public int logIconHPos = 0;
  10583.  
  10584. public void processMapAreaClick() {
  10585. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
  10586. logIconHPos = 1;
  10587. } else {
  10588. logIconHPos = 0;
  10589. }
  10590. }
  10591.  
  10592. private void processMinimapActions() {
  10593. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128) {
  10594. menuActionName[1] = !runClicked ? "Toggle Run-Mode On" : "Toggle Run-Mode On";
  10595. menuActionIds[1] = 1050;
  10596. menuActionRow = 2;
  10597. }
  10598. if (super.mouseX >= 695 && super.mouseX <= 751 && super.mouseY >= 134 && super.mouseY < 165) {
  10599. menuActionName[1] = "Familar Information";
  10600. menuActionIds[1] = 1505;
  10601. menuActionRow = 2;
  10602. }
  10603. }
  10604.  
  10605. public void drawLogoutButton() {
  10606. if (tabInterfaceIDs[10] != -1 && anInt1054 == 9)
  10607. if (loopCycle % 20 >= 10)
  10608. ;
  10609. // sideIcons[7].drawSprite(223, 1);
  10610. if (logIconHPos == 0) {
  10611. logIconH.drawSprite(223, 1);
  10612. } else {
  10613. logIconC.drawSprite(223, 1);
  10614. }
  10615. if (tabID == 10)
  10616. logIconC.drawSprite(223, 1);
  10617. }
  10618.  
  10619. private void rightClickMapArea() {
  10620. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
  10621. menuActionName[1] = "Logout";
  10622. menuActionIds[1] = 1004;
  10623. menuActionRow = 2;
  10624. } else if (super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118) {
  10625. menuActionName[1] = "Run";
  10626. menuActionIds[1] = 1051;
  10627. menuActionRow = 2;
  10628. }
  10629. }
  10630.  
  10631. public void drawRunOrb(){
  10632. ORBS[0] = new Sprite(SignLink.findcachedir() + "/Sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(100));
  10633. if(energy != 100){
  10634. ORBS[0].drawSprite(193, 95);
  10635. }
  10636. runClicked = anIntArray1045[173] == 1;
  10637. Resting = anIntArray1045[174] == 1;
  10638. ORBS[runHover ? 7 : 1].drawSprite(190, 92);
  10639. ORBS[runClicked ? 11 : 10].drawSprite(193, 95);
  10640. if(!Resting)
  10641. ORBS[runClicked ? 9 : 8].drawSprite(200, 100);
  10642. else
  10643. ORBS[Resting ? 12 : 8].drawSprite(200, 100);
  10644. String currentEnergy = RSInterface.interfaceCache[149].message;
  10645. currentEnergy = currentEnergy.replaceAll("%","");
  10646. smallText.method382(getOrbTextColor(100), 232, currentEnergy, 118, true);
  10647. }
  10648.  
  10649. public void drawPrayer()
  10650. {
  10651. String s1 = RSInterface.interfaceCache[4012].message;
  10652. String s2 = RSInterface.interfaceCache[4013].message;
  10653. s1 = s1.replace("%1", "1");
  10654. s2 = s2.replace("%1", "1");
  10655. int i = Integer.parseInt(s1);
  10656. int j = Integer.parseInt(s2);
  10657. int k = (int)(((double)i / (double)j) * 100D);
  10658. ORBS[0] = new Sprite(SignLink.findcachedir() + "/Sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(k));
  10659. ORBS[1].drawSprite(190, 53);
  10660. ORBS[4].drawSprite(193, 56);
  10661. ORBS[0].drawSprite(194, 56);
  10662. ORBS[6].drawSprite(197, 60);
  10663. smallText.method382(getOrbTextColor(k), 234, (new StringBuilder()).append("").append(i).toString(), 79, true);
  10664. }
  10665.  
  10666. public void drawHP() {
  10667. int health;
  10668. String cHP = RSInterface.interfaceCache[4016].message;
  10669. cHP = cHP.replaceAll("%", "");
  10670. int currentHP = Integer.parseInt(cHP);
  10671. String mHP = RSInterface.interfaceCache[4017].message;
  10672. mHP = mHP.replaceAll("%", "");
  10673. int maxHP2 = Integer.parseInt(mHP);
  10674. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  10675. ORBS[0] = new Sprite(SignLink.findcachedir() + "/Sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(health));
  10676. ORBS[1].drawSprite(174, 14);
  10677. ORBS[2].drawSprite(177, 17);
  10678. ORBS[0].drawSprite(177, 17);
  10679. if (health <= 20) {
  10680. if (loopCycle % 20 < 10) {
  10681. ORBS[3].drawSprite(183, 25);
  10682. }
  10683. } else {
  10684. ORBS[3].drawSprite(183, 25);
  10685. }
  10686. int Y = 40;
  10687. smallText.method382(getOrbTextColor(health), 218, currentHP + "", Y, true);
  10688. }
  10689.  
  10690. public void drawSumm() {
  10691. if (RSInterface.interfaceCache[18167].message.isEmpty() || RSInterface.interfaceCache[18171].message.isEmpty())
  10692. return;
  10693.  
  10694. int currentPR = Integer.parseInt(RSInterface.interfaceCache[18167].message);
  10695. int maxPR2 = Integer.parseInt(RSInterface.interfaceCache[18171].message);
  10696. int summ = (int) (((double) currentPR / (double) maxPR2) * 100D);
  10697.  
  10698. Sprite background = new Sprite(SignLink.findcachedir() + "/Sprites/sprites/gameframe/orbs/orbs 0.png", 27, getOrbFill(summ));
  10699.  
  10700. if (summHover) {
  10701. ORBS[7].drawSprite(174, 130);
  10702. } else if (!summHover) {
  10703. ORBS[1].drawSprite(174, 130);
  10704. }
  10705.  
  10706. ORBS[16].drawSprite(177, 133);
  10707. background.drawSprite(177, 133);
  10708.  
  10709. if (summ <= 25) {
  10710. if (loopCycle % 20 < 10) {
  10711. ORBS[18].drawSprite(182, 139);
  10712. }
  10713. } else {
  10714. ORBS[18].drawSprite(182, 139);
  10715. }
  10716. smallText.method382(getOrbTextColor(summ), 218, currentPR + "", 157, true);
  10717. }
  10718.  
  10719. public int getOrbTextColor(int i)
  10720. {
  10721. if(i >= 75 && i <= 0x7fffffff)
  10722. return 65280;
  10723. if(i >= 50 && i <= 74)
  10724. return 0xffff00;
  10725. return i < 25 || i > 49 ? 0xff0000 : 0xff981f;
  10726. }
  10727.  
  10728. public int getOrbFill(int i)
  10729. {
  10730. if(i <= 0x7fffffff && i >= 97)
  10731. return 0;
  10732. if(i <= 96 && i >= 93)
  10733. return 1;
  10734. if(i <= 92 && i >= 89)
  10735. return 2;
  10736. if(i <= 88 && i >= 85)
  10737. return 3;
  10738. if(i <= 84 && i >= 81)
  10739. return 4;
  10740. if(i <= 80 && i >= 77)
  10741. return 5;
  10742. if(i <= 76 && i >= 73)
  10743. return 6;
  10744. if(i <= 72 && i >= 69)
  10745. return 7;
  10746. if(i <= 68 && i >= 65)
  10747. return 8;
  10748. if(i <= 64 && i >= 61)
  10749. return 9;
  10750. if(i <= 60 && i >= 57)
  10751. return 10;
  10752. if(i <= 56 && i >= 53)
  10753. return 11;
  10754. if(i <= 52 && i >= 49)
  10755. return 12;
  10756. if(i <= 48 && i >= 45)
  10757. return 13;
  10758. if(i <= 44 && i >= 41)
  10759. return 14;
  10760. if(i <= 40 && i >= 37)
  10761. return 15;
  10762. if(i <= 36 && i >= 33)
  10763. return 16;
  10764. if(i <= 32 && i >= 29)
  10765. return 17;
  10766. if(i <= 28 && i >= 25)
  10767. return 18;
  10768. if(i <= 24 && i >= 21)
  10769. return 19;
  10770. if(i <= 20 && i >= 17)
  10771. return 20;
  10772. if(i <= 16 && i >= 13)
  10773. return 21;
  10774. if(i <= 12 && i >= 9)
  10775. return 22;
  10776. if(i <= 8 && i >= 7)
  10777. return 23;
  10778. if(i <= 6 && i >= 5)
  10779. return 24;
  10780. if(i <= 4 && i >= 3)
  10781. return 25;
  10782. if(i <= 2 && i >= 1)
  10783. return 26;
  10784. return i > 0 ? 0 : 27;
  10785. }
  10786.  
  10787. private void drawMinimap() {
  10788. aRSImageProducer_1164.initDrawingArea();
  10789. if(anInt1021 == 2) {
  10790. byte abyte0[] = mapBack.aByteArray1450;
  10791. int ai[] = DrawingArea.pixels;
  10792. int k2 = abyte0.length;
  10793. for(int i5 = 0; i5 < k2; i5++)
  10794. if(abyte0[i5] == 0)
  10795. ai[i5] = 0;
  10796. compass.method352(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10797. aRSImageProducer_1165.initDrawingArea();
  10798. return;
  10799. }
  10800. int i = viewRotation + minimapRotation & 0x7ff;
  10801. int j = 48 + myPlayer.x / 32;
  10802. int l2 = 464 - myPlayer.y / 32;
  10803. for (int x = 0; x < anIntArray1229.length; x++){
  10804. anIntArray1229[x] = 170;
  10805. anIntArray1052[x] = -23;
  10806. }
  10807. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapZoom, anIntArray1052, l2, 10, 45, 146, j);
  10808. compass.method352(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10809. for(int j5 = 0; j5 < anInt1071; j5++) {
  10810. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10811. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10812. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10813. }
  10814.  
  10815. for(int k5 = 0; k5 < 104; k5++) {
  10816. for(int l5 = 0; l5 < 104; l5++) {
  10817. NodeList class19 = groundArray[plane][k5][l5];
  10818. if(class19 != null) {
  10819. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10820. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10821. markMinimap(mapDotItem, l, j3);
  10822. }
  10823. }
  10824. }
  10825.  
  10826. for(int i6 = 0; i6 < npcCount; i6++) {
  10827. NPC npc = npcArray[npcIndices[i6]];
  10828. if(npc != null && npc.isVisible()) {
  10829. EntityDef entityDef = npc.desc;
  10830. if(entityDef.childrenIDs != null)
  10831. entityDef = entityDef.method161();
  10832. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10833. int i1 = npc.x / 32 - myPlayer.x / 32;
  10834. int k3 = npc.y / 32 - myPlayer.y / 32;
  10835. markMinimap(mapDotNPC, i1, k3);
  10836. }
  10837. }
  10838. }
  10839.  
  10840. for(int j6 = 0; j6 < playerCount; j6++) {
  10841. Player player = playerArray[playerIndices[j6]];
  10842. if(player != null && player.isVisible()) {
  10843. int j1 = player.x / 32 - myPlayer.x / 32;
  10844. int l3 = player.y / 32 - myPlayer.y / 32;
  10845. boolean flag1 = false;
  10846. long l6 = TextClass.longForName(player.name);
  10847. for(int k6 = 0; k6 < friendsCount; k6++) {
  10848. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10849. continue;
  10850. flag1 = true;
  10851. break;
  10852. }
  10853. @SuppressWarnings("unused")
  10854. boolean flag2 = false;
  10855. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10856. flag2 = true;
  10857. if(flag1)
  10858. markMinimap(mapDotFriend, j1, l3);
  10859. else
  10860. markMinimap(mapDotPlayer, j1, l3);
  10861. }
  10862. }
  10863.  
  10864. if(anInt855 != 0 && loopCycle % 20 < 10) {
  10865. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10866. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10867. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  10868. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10869. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10870. method81(mapMarker, i4, k1);
  10871. }
  10872. }
  10873. if(anInt855 == 2) {
  10874. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10875. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10876. method81(mapMarker, j4, l1);
  10877. }
  10878. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  10879. {
  10880. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10881. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  10882. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10883. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10884. method81(mapMarker, k4, i2);
  10885. }
  10886. }
  10887. }
  10888. if(destX != 0) {
  10889. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10890. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10891. markMinimap(mapFlag, j2, l4);
  10892. }
  10893. DrawingArea.drawPixels(3, 78+5, 97+20, 0xffffff, 3);
  10894. mapArea.drawSprite(0, 0);
  10895. drawWorldMapButton();
  10896. drawLogoutButton();
  10897. drawHP();
  10898. drawPrayer();
  10899. drawSumm();
  10900. drawRunOrb();
  10901. drawXPCounter();
  10902. if(menuOpen && menuScreenArea == 3) {
  10903. drawMenu();
  10904. }
  10905. aRSImageProducer_1165.initDrawingArea();
  10906. }
  10907.  
  10908. public void npcScreenPos(Entity entity, int i) {
  10909. calcEntityScreenPos(entity.x, i, entity.y);
  10910. }
  10911.  
  10912. public void calcEntityScreenPos(int i, int j, int l) {
  10913. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  10914. spriteDrawX = -1;
  10915. spriteDrawY = -1;
  10916. return;
  10917. }
  10918. int i1 = method42(plane, l, i) - j;
  10919. i -= xCameraPos;
  10920. i1 -= zCameraPos;
  10921. l -= yCameraPos;
  10922. int j1 = Model.SINE[yCameraCurve];
  10923. int k1 = Model.COSINE[yCameraCurve];
  10924. int l1 = Model.SINE[xCameraCurve];
  10925. int i2 = Model.COSINE[xCameraCurve];
  10926. int j2 = l * l1 + i * i2 >> 16;
  10927. l = l * i2 - i * l1 >> 16;
  10928. i = j2;
  10929. j2 = i1 * k1 - l * j1 >> 16;
  10930. l = i1 * j1 + l * k1 >> 16;
  10931. i1 = j2;
  10932. if (l >= 50) {
  10933. spriteDrawX = Rasterizer.centerX + (i << 9) / l;
  10934. spriteDrawY = Rasterizer.centerY + (i1 << 9) / l;
  10935. } else {
  10936. spriteDrawX = -1;
  10937. spriteDrawY = -1;
  10938. }
  10939. }
  10940.  
  10941. @SuppressWarnings("unused")
  10942. public void buildSplitpublicChatMenu() {
  10943. if (splitpublicChat == 0)
  10944. return;
  10945. int i = 0;
  10946. if (anInt1104 != 0)
  10947. i = 1;
  10948. for (int j = 0; j < 100; j++)
  10949. if (chatMessages[j] != null) {
  10950. int k = chatTypes[j];
  10951. String s = chatNames[j];
  10952. boolean flag1 = false;
  10953. if(s != null && s.startsWith("@cr1@"))
  10954. {
  10955. s = s.substring(5);
  10956. }
  10957. if(s != null && s.startsWith("@cr2@"))
  10958. {
  10959. s = s.substring(5);
  10960. }
  10961. if(s != null && s.startsWith("@cr4@"))
  10962. {
  10963. s = s.substring(5);
  10964. }
  10965. if(s != null && s.startsWith("@cr5@"))
  10966. {
  10967. s = s.substring(5);
  10968. }
  10969. if(s != null && s.startsWith("@cr6@"))
  10970. {
  10971. s = s.substring(5);
  10972. }
  10973. if(s != null && s.startsWith("@cr7@"))
  10974. {
  10975. s = s.substring(5);
  10976. }
  10977. if(s != null && s.startsWith("@cr8@"))
  10978. {
  10979. s = s.substring(5);
  10980. }
  10981. if(s != null && s.startsWith("@cr9@"))
  10982. {
  10983. s = s.substring(5);
  10984. }
  10985. if(s != null && s.startsWith("@cr10@"))
  10986. {
  10987. s = s.substring(6);
  10988. }
  10989. if(s != null && s.startsWith("@cr11@"))
  10990. {
  10991. s = s.substring(6);
  10992. }
  10993. if(s != null && s.startsWith("@cr12@"))
  10994. {
  10995. s = s.substring(6);
  10996. }
  10997. if(s != null && s.startsWith("@cr13@"))
  10998. {
  10999. s = s.substring(6);
  11000. }
  11001. if(s != null && s.startsWith("@cr14@"))
  11002. {
  11003. s = s.substring(6);
  11004. }
  11005. if(s != null && s.startsWith("@cr15@"))
  11006. {
  11007. s = s.substring(6);
  11008. }
  11009. if(s != null && s.startsWith("@cr16@"))
  11010. {
  11011. s = s.substring(6);
  11012. }
  11013. if(s != null && s.startsWith("@cr17@"))
  11014. {
  11015. s = s.substring(6);
  11016. }
  11017. if(s != null && s.startsWith("@cr18@"))
  11018. {
  11019. s = s.substring(6);
  11020. }
  11021. if(s != null && s.startsWith("@cr19@"))
  11022. {
  11023. s = s.substring(6);
  11024. }
  11025. if(s != null && s.startsWith("@cr20@"))
  11026. {
  11027. s = s.substring(6);
  11028. }
  11029. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  11030. {
  11031. int l = 329 - i * 13;
  11032. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11033. {
  11034. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11035. if(i1 > 450)
  11036. i1 = 450;
  11037. if(super.mouseX < 4 + i1)
  11038. {
  11039. if(myPrivilege >= 1)
  11040. {
  11041. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11042. menuActionIds[menuActionRow] = 2606;
  11043. menuActionRow++;
  11044. }
  11045. menuActionName[menuActionRow] = "Add ignore @whi@"
  11046. + s;
  11047. menuActionIds[menuActionRow] = 2042;
  11048. menuActionRow++;
  11049. menuActionName[menuActionRow] = "Add friend @whi@"
  11050. + s;
  11051. menuActionIds[menuActionRow] = 2337;
  11052. menuActionRow++;
  11053. }
  11054. }
  11055. if (++i >= 5)
  11056. return;
  11057. }
  11058. if ((k == 5 || k == 6) && publicChatMode < 2 && ++i >= 5)
  11059. return;
  11060. }
  11061.  
  11062. }
  11063.  
  11064. public void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  11065. int i2, int j2) {
  11066. Class30_Sub1 class30_sub1 = null;
  11067. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11068. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11069. .reverseGetNext()) {
  11070. if (class30_sub1_1.anInt1295 != l1
  11071. || class30_sub1_1.anInt1297 != i2
  11072. || class30_sub1_1.anInt1298 != j1
  11073. || class30_sub1_1.anInt1296 != i1)
  11074. continue;
  11075. class30_sub1 = class30_sub1_1;
  11076. break;
  11077. }
  11078.  
  11079. if (class30_sub1 == null) {
  11080. class30_sub1 = new Class30_Sub1();
  11081. class30_sub1.anInt1295 = l1;
  11082. class30_sub1.anInt1296 = i1;
  11083. class30_sub1.anInt1297 = i2;
  11084. class30_sub1.anInt1298 = j1;
  11085. method89(class30_sub1);
  11086. aClass19_1179.insertHead(class30_sub1);
  11087. }
  11088. class30_sub1.anInt1291 = k;
  11089. class30_sub1.anInt1293 = k1;
  11090. class30_sub1.anInt1292 = l;
  11091. class30_sub1.anInt1302 = j2;
  11092. class30_sub1.anInt1294 = j;
  11093. }
  11094.  
  11095. public boolean interfaceIsSelected(RSInterface class9) {
  11096. if (class9.valueCompareType == null)
  11097. return false;
  11098. for (int i = 0; i < class9.valueCompareType.length; i++) {
  11099. int j = extractInterfaceValues(class9, i);
  11100. int k = class9.requiredValues[i];
  11101. if (class9.valueCompareType[i] == 2) {
  11102. if (j >= k)
  11103. return false;
  11104. } else if (class9.valueCompareType[i] == 3) {
  11105. if (j <= k)
  11106. return false;
  11107. } else if (class9.valueCompareType[i] == 4) {
  11108. if (j == k)
  11109. return false;
  11110. } else if (j != k)
  11111. return false;
  11112. }
  11113.  
  11114. return true;
  11115. }
  11116.  
  11117. public DataInputStream openJagGrabInputStream(String s) throws IOException {
  11118. // if(!aBoolean872)
  11119. // if(SignLink.mainapp != null)
  11120. // return SignLink.openurl(s);
  11121. // else
  11122. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11123. if (aSocket832 != null) {
  11124. try {
  11125. aSocket832.close();
  11126. } catch (Exception _ex) {
  11127. }
  11128. aSocket832 = null;
  11129. }
  11130. aSocket832 = openSocket(43595);
  11131. aSocket832.setSoTimeout(10000);
  11132. java.io.InputStream inputstream = aSocket832.getInputStream();
  11133. OutputStream outputstream = aSocket832.getOutputStream();
  11134. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11135. return new DataInputStream(inputstream);
  11136. }
  11137.  
  11138. public void doFlamesDrawing() {
  11139. char c = '\u0100';
  11140. if (anInt1040 > 0) {
  11141. for (int i = 0; i < 256; i++)
  11142. if (anInt1040 > 768)
  11143. anIntArray850[i] = method83(anIntArray851[i],
  11144. anIntArray852[i], 1024 - anInt1040);
  11145. else if (anInt1040 > 256)
  11146. anIntArray850[i] = anIntArray852[i];
  11147. else
  11148. anIntArray850[i] = method83(anIntArray852[i],
  11149. anIntArray851[i], 256 - anInt1040);
  11150.  
  11151. } else if (anInt1041 > 0) {
  11152. for (int j = 0; j < 256; j++)
  11153. if (anInt1041 > 768)
  11154. anIntArray850[j] = method83(anIntArray851[j],
  11155. anIntArray853[j], 1024 - anInt1041);
  11156. else if (anInt1041 > 256)
  11157. anIntArray850[j] = anIntArray853[j];
  11158. else
  11159. anIntArray850[j] = method83(anIntArray853[j],
  11160. anIntArray851[j], 256 - anInt1041);
  11161.  
  11162. } else {
  11163. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11164.  
  11165. }
  11166. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  11167. aRSImageProducer_1110.anIntArray315, 0, 33920);
  11168.  
  11169. int i1 = 0;
  11170. int j1 = 1152;
  11171. for (int k1 = 1; k1 < c - 1; k1++) {
  11172. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11173. int j2 = 22 + l1;
  11174. if (j2 < 0)
  11175. j2 = 0;
  11176. i1 += j2;
  11177. for (int l2 = j2; l2 < 128; l2++) {
  11178. int j3 = anIntArray828[i1++];
  11179. if (j3 != 0) {
  11180. int l3 = j3;
  11181. int j4 = 256 - j3;
  11182. j3 = anIntArray850[j3];
  11183. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  11184. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff)
  11185. * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  11186. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11187. } else {
  11188. j1++;
  11189. }
  11190. }
  11191.  
  11192. j1 += j2;
  11193. }
  11194.  
  11195. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  11196. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  11197. aRSImageProducer_1111.anIntArray315, 0, 33920);
  11198.  
  11199. i1 = 0;
  11200. j1 = 1176;
  11201. for (int k2 = 1; k2 < c - 1; k2++) {
  11202. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11203. int k3 = 103 - i3;
  11204. j1 += i3;
  11205. for (int i4 = 0; i4 < k3; i4++) {
  11206. int k4 = anIntArray828[i1++];
  11207. if (k4 != 0) {
  11208. int i5 = k4;
  11209. int j5 = 256 - k4;
  11210. k4 = anIntArray850[k4];
  11211. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  11212. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff)
  11213. * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  11214. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11215. } else {
  11216. j1++;
  11217. }
  11218. }
  11219.  
  11220. i1 += 128 - k3;
  11221. j1 += 128 - k3 - i3;
  11222. }
  11223.  
  11224. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11225. }
  11226.  
  11227. public void method134(Stream stream) {
  11228. int j = stream.readBits(8);
  11229. if (j < playerCount) {
  11230. for (int k = j; k < playerCount; k++)
  11231. anIntArray840[anInt839++] = playerIndices[k];
  11232.  
  11233. }
  11234. if (j > playerCount) {
  11235. SignLink.reporterror(myUsername + " Too many players");
  11236. throw new RuntimeException("eek");
  11237. }
  11238. playerCount = 0;
  11239. for (int l = 0; l < j; l++) {
  11240. int i1 = playerIndices[l];
  11241. Player player = playerArray[i1];
  11242. int j1 = stream.readBits(1);
  11243. if (j1 == 0) {
  11244. playerIndices[playerCount++] = i1;
  11245. player.anInt1537 = loopCycle;
  11246. } else {
  11247. int k1 = stream.readBits(2);
  11248. if (k1 == 0) {
  11249. playerIndices[playerCount++] = i1;
  11250. player.anInt1537 = loopCycle;
  11251. anIntArray894[anInt893++] = i1;
  11252. } else if (k1 == 1) {
  11253. playerIndices[playerCount++] = i1;
  11254. player.anInt1537 = loopCycle;
  11255. int l1 = stream.readBits(3);
  11256. player.moveInDir(false, l1);
  11257. int j2 = stream.readBits(1);
  11258. if (j2 == 1)
  11259. anIntArray894[anInt893++] = i1;
  11260. } else if (k1 == 2) {
  11261. playerIndices[playerCount++] = i1;
  11262. player.anInt1537 = loopCycle;
  11263. int i2 = stream.readBits(3);
  11264. player.moveInDir(true, i2);
  11265. int k2 = stream.readBits(3);
  11266. player.moveInDir(true, k2);
  11267. int l2 = stream.readBits(1);
  11268. if (l2 == 1)
  11269. anIntArray894[anInt893++] = i1;
  11270. } else if (k1 == 3)
  11271. anIntArray840[anInt839++] = i1;
  11272. }
  11273. }
  11274. }
  11275.  
  11276. public void drawLoginScreen() {
  11277. CheckBackgrounds();
  11278. resetImageProducers();
  11279. aRSImageProducer_1109.initDrawingArea();
  11280. this.LoginBox.drawTransparentSprite(257, 127, 200);
  11281. aRSImageProducer_1109.initDrawingArea();
  11282. this.Logo.drawAdvancedSprite(150, 45);
  11283. BackgroundSwitcher();
  11284. HandleLoginButton();
  11285. HandleTypeInBoxes();
  11286. RememberAccountInfo();
  11287. this.smallText.method382(16777215, 390, this.loginMessage1, 300, true);
  11288. this.smallText.method382(16777215, 391, this.loginMessage2, 310, true);
  11289. 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);
  11290. 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);
  11291. int i1 = 0xffff00;
  11292. if (clientData) {
  11293. if (super.fps < 15)
  11294. i1 = 0xff0000;
  11295. aTextDrawingArea_1271.method385(i1, "Fps: " + super.fps, 12, 0);
  11296. Runtime runtime = Runtime.getRuntime();
  11297. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11298. i1 = 0xffff00;
  11299. if (j1 > 0x2000000 && lowMem)
  11300. i1 = 0xff0000;
  11301. aTextDrawingArea_1271.method385(i1, "Mem: " + j1 + "k", 27, 0);
  11302. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 42, 0);
  11303. aTextDrawingArea_1271.method385(0xffff00, "Client/Cache: " + update.getVersions().getProperty("client") + "/" + update.getVersions().getProperty("cache"), 57, 0);
  11304. }
  11305. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  11306. }
  11307.  
  11308. public void CheckBackgrounds() {
  11309. if(FadingBackgrounds)
  11310. fadingTimer();
  11311. else
  11312. BackgroundFix.drawAdvancedSprite(0, 0);
  11313. }
  11314.  
  11315. public void HandleLoginButton() {
  11316. if (this.mouseX >= 269 && this.mouseX <= 496 && this.mouseY >= 312 && this.mouseY <= 354)
  11317. this.LoginButtonHover.drawTransparentSprite(269, 312, 200);
  11318. else
  11319. this.LoginButton.drawTransparentSprite(269, 312, 200);
  11320. }
  11321.  
  11322. public void HandleTypeInBoxes() {
  11323. if (this.mouseX >= 270 && this.mouseX <= 495 && this.mouseY >= 170 && this.mouseY <= 195)
  11324. this.TypeInHover.drawTransparentSprite(270, 170, 50);
  11325. else
  11326. this.TypeIn.drawTransparentSprite(270, 170, 50);
  11327.  
  11328. if (this.mouseX >= 270 && this.mouseX <= 495 && this.mouseY >= 224 && this.mouseY <= 249)
  11329. this.TypeInHover.drawTransparentSprite(270, 224, 50);
  11330. else
  11331. this.TypeIn.drawTransparentSprite(270, 224, 50);
  11332. }
  11333.  
  11334. public void RememberAccountInfo() {
  11335. if(saveAccountInfo)
  11336. this.RememberYes.drawTransparentSprite(311, 272, 200);
  11337. else
  11338. this.RememberNo.drawTransparentSprite(311, 272, 200);
  11339. }
  11340.  
  11341. public void BackgroundSwitcher() {
  11342. if(this.mouseX >= 0 && this.mouseX <= 57 && this.mouseY >= 468 && this.mouseY <= 503) {
  11343. if(FadingBackgrounds) {
  11344. Bg = new Sprite("/Login/anim4");
  11345. this.Bg.drawAdvancedSprite(0, 468);
  11346. } else {
  11347. Bg = new Sprite("/Login/anim2");
  11348. this.Bg.drawAdvancedSprite(0, 468);
  11349. }
  11350. } else if(FadingBackgrounds) {
  11351. Bg = new Sprite("/Login/anim3");
  11352. this.Bg.drawAdvancedSprite(0, 468);
  11353. } else {
  11354. Bg = new Sprite("/Login/anim");
  11355. this.Bg.drawAdvancedSprite(0, 468);
  11356. }
  11357. }
  11358.  
  11359. public void worldSwitcher() {
  11360. }
  11361.  
  11362. public void processLoginScreenInput() {
  11363. resetImage();
  11364. if (super.clickMode3 == 1 && super.saveClickX >= 0
  11365. && super.saveClickX <= 57 && super.saveClickY >= 468
  11366. && super.saveClickY <= 503)
  11367. if(FadingBackgrounds)
  11368. FadingBackgrounds = false;
  11369. else
  11370. FadingBackgrounds = true;
  11371.  
  11372. if (super.clickMode3 == 1 && super.saveClickX >= 270
  11373. && super.saveClickX <= 495 && super.saveClickY >= 170
  11374. && super.saveClickY <= 195) {
  11375. loginScreenCursorPos = 0;
  11376. } else if (super.clickMode3 == 1 && super.mouseX >= 270
  11377. && super.mouseX <= 495 && super.mouseY >= 224
  11378. && super.mouseY <= 249) {
  11379. loginScreenCursorPos = 1;
  11380. }
  11381. if (super.clickMode3 == 1 && super.saveClickX >= 311 && super.saveClickX <= 329
  11382. && super.saveClickY >= 272 && super.saveClickY <= 290) {
  11383. if(saveAccountInfo) {
  11384. saveAccountInfo = false;
  11385. } else {
  11386. saveAccountInfo = true;
  11387. }
  11388. }
  11389. if (super.clickMode3 == 1 && super.saveClickX >= 269
  11390. && super.saveClickX <= 496 && super.saveClickY >= 312
  11391. && super.saveClickY <= 354) {
  11392. loginFailures = 0;
  11393. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  11394. login(myUsername, myPassword, false);
  11395. } else {
  11396. this.loginScreenCursorPos = 0;
  11397. this.loginMessage1 = "Username & Password";
  11398. this.loginMessage2 = "Must be more than 1 character";
  11399. }
  11400. if (this.loggedIn)
  11401. return;
  11402. }
  11403. do {
  11404. int l1 = readChar(-796);
  11405. if (l1 == -1)
  11406. break;
  11407. boolean flag1 = false;
  11408. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  11409. if (l1 != validUserPassChars.charAt(i2))
  11410. continue;
  11411. flag1 = true;
  11412. break;
  11413. }
  11414.  
  11415.  
  11416. if (loginScreenCursorPos == 0) {
  11417. if (l1 == 8 && myUsername.length() > 0)
  11418. myUsername = myUsername.substring(0,
  11419. myUsername.length() - 1);
  11420. if (l1 == 9 || l1 == 10 || l1 == 13)
  11421. loginScreenCursorPos = 1;
  11422. if (flag1)
  11423. myUsername += (char) l1;
  11424. if (myUsername.length() > 12)
  11425. myUsername = myUsername.substring(0, 12);
  11426. } else if (loginScreenCursorPos == 1) {
  11427. if (l1 == 8 && myPassword.length() > 0)
  11428. myPassword = myPassword.substring(0,
  11429. myPassword.length() - 1);
  11430. if (l1 == 9 || l1 == 10 || l1 == 13)
  11431. loginScreenCursorPos = 0;
  11432. if (flag1)
  11433. myPassword += (char) l1;
  11434. if (myPassword.length() > 20)
  11435. myPassword = myPassword.substring(0, 20);
  11436. }
  11437. } while (true);
  11438. return;
  11439. }
  11440.  
  11441.  
  11442.  
  11443. /**
  11444. * Handle the Fading Timer.
  11445. * @author Unknown
  11446. */
  11447.  
  11448. public void fadingTimer() {
  11449. if (bgId > 2) {
  11450. bgId = 0;
  11451. }
  11452. if (bgFinal <= 0) {
  11453. bgId++;
  11454. bgBoolean = false;
  11455. }
  11456. if (bgFinal >= 250) {
  11457. bgBoolean = true;
  11458. }
  11459. waitTicker += 5;
  11460.  
  11461. if (bgBoolean) {
  11462. waitTicker += 1;
  11463. if (waitTicker >= 750) {
  11464. waitTicker = 0;
  11465. }
  11466. if (waitTicker >= 500) {
  11467. Sprite sprite = new Sprite("BG/" + bgId);
  11468. bgFinal -= 10;
  11469. sprite.drawBackground(0, 0, bgFinal);
  11470. } else {
  11471. Sprite sprite = new Sprite("BG/" + bgId);
  11472. sprite.drawBackground(0, 0, 250);
  11473. }
  11474. } else {
  11475. bgFinal += 10;
  11476. Sprite sprite = new Sprite("BG/" + bgId);
  11477. sprite.drawBackground(0, 0, bgFinal);
  11478. }
  11479. }
  11480.  
  11481. public static void writeSettings() throws IOException {
  11482. try {
  11483. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(SignLink.findcachedir() + "settings.dat")));
  11484. out.writeUTF(myUsername);
  11485. out.writeUTF(myPassword);
  11486. out.close();
  11487. } catch(Exception e) { }
  11488. }
  11489.  
  11490. public static void writeLoginSettings() throws IOException {
  11491. try {
  11492. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(SignLink.findcachedir() + "lsettings.dat")));
  11493. out.writeUTF(myUsername);
  11494. out.writeUTF(myPassword);
  11495. out.close();
  11496. } catch(Exception e) { }
  11497. }
  11498.  
  11499. public static void readSettings() throws IOException {
  11500. try {
  11501. DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(SignLink.findcachedir() + "settings.dat")));
  11502. myUsername = in.readUTF();
  11503. myPassword = in.readUTF();
  11504. in.close();
  11505. } catch(Exception e) { }
  11506. }
  11507.  
  11508. public void drawFlames() {
  11509. /*drawingFlames = true;
  11510. try {
  11511. long l = System.currentTimeMillis();
  11512. int i = 0;
  11513. int j = 20;
  11514. while (aBoolean831) {
  11515. anInt1208++;
  11516. calcFlamesPosition();
  11517. calcFlamesPosition();
  11518. doFlamesDrawing();
  11519. if (++i > 10) {
  11520. long l1 = System.currentTimeMillis();
  11521. int k = (int) (l1 - l) / 10 - j;
  11522. j = 40 - k;
  11523. if (j < 5)
  11524. j = 5;
  11525. i = 0;
  11526. l = l1;
  11527. }
  11528. try {
  11529. Thread.sleep(j);
  11530. } catch (Exception _ex) {
  11531. }
  11532. }
  11533. } catch (Exception _ex) {
  11534. }
  11535. drawingFlames = false;*/
  11536. }
  11537.  
  11538. public void raiseWelcomeScreen() {
  11539. welcomeScreenRaised = true;
  11540. }
  11541.  
  11542. public void method137(Stream stream, int j) {
  11543. if (j == 84) {
  11544. int k = stream.readUnsignedByte();
  11545. int j3 = anInt1268 + (k >> 4 & 7);
  11546. int i6 = anInt1269 + (k & 7);
  11547. int l8 = stream.readUnsignedWord();
  11548. int k11 = stream.readUnsignedWord();
  11549. int l13 = stream.readUnsignedWord();
  11550. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  11551. NodeList class19_1 = groundArray[plane][j3][i6];
  11552. if (class19_1 != null) {
  11553. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  11554. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  11555. .reverseGetNext()) {
  11556. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  11557. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11558. continue;
  11559. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11560. break;
  11561. }
  11562.  
  11563. spawnGroundItem(j3, i6);
  11564. }
  11565. }
  11566. return;
  11567. }
  11568. if (j == 105) {
  11569. int l = stream.readUnsignedByte();
  11570. int k3 = anInt1268 + (l >> 4 & 7);
  11571. int j6 = anInt1269 + (l & 7);
  11572. int i9 = stream.readUnsignedWord();
  11573. int l11 = stream.readUnsignedByte();
  11574. int i14 = l11 >> 4 & 0xf;
  11575. int i16 = l11 & 7;
  11576. if (myPlayer.smallX[0] >= k3 - i14
  11577. && myPlayer.smallX[0] <= k3 + i14
  11578. && myPlayer.smallY[0] >= j6 - i14
  11579. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  11580. && currentSound < 50) {
  11581. sound[currentSound] = i9;
  11582. soundType[currentSound] = i16;
  11583. soundDelay[currentSound] = Sound.anIntArray326[i9];
  11584. currentSound++;
  11585. }
  11586. }
  11587. if (j == 215) {
  11588. int i1 = stream.method435();
  11589. int l3 = stream.method428();
  11590. int k6 = anInt1268 + (l3 >> 4 & 7);
  11591. int j9 = anInt1269 + (l3 & 7);
  11592. int i12 = stream.method435();
  11593. int j14 = stream.readUnsignedWord();
  11594. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  11595. && i12 != unknownInt10) {
  11596. Item class30_sub2_sub4_sub2_2 = new Item();
  11597. class30_sub2_sub4_sub2_2.ID = i1;
  11598. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11599. if (groundArray[plane][k6][j9] == null)
  11600. groundArray[plane][k6][j9] = new NodeList();
  11601. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11602. spawnGroundItem(k6, j9);
  11603. }
  11604. return;
  11605. }
  11606. if (j == 156) {
  11607. int j1 = stream.method426();
  11608. int i4 = anInt1268 + (j1 >> 4 & 7);
  11609. int l6 = anInt1269 + (j1 & 7);
  11610. int k9 = stream.readUnsignedWord();
  11611. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  11612. NodeList class19 = groundArray[plane][i4][l6];
  11613. if (class19 != null) {
  11614. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  11615. .reverseGetNext()) {
  11616. if (item.ID != (k9 & 0x7fff))
  11617. continue;
  11618. item.unlink();
  11619. break;
  11620. }
  11621.  
  11622. if (class19.reverseGetFirst() == null)
  11623. groundArray[plane][i4][l6] = null;
  11624. spawnGroundItem(i4, l6);
  11625. }
  11626. }
  11627. return;
  11628. }
  11629. if (j == 160) {
  11630. int k1 = stream.method428();
  11631. int j4 = anInt1268 + (k1 >> 4 & 7);
  11632. int i7 = anInt1269 + (k1 & 7);
  11633. int l9 = stream.method428();
  11634. int j12 = l9 >> 2;
  11635. int k14 = l9 & 3;
  11636. int j16 = anIntArray1177[j12];
  11637. int j17 = stream.method435();
  11638. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  11639. int j18 = intGroundArray[plane][j4][i7];
  11640. int i19 = intGroundArray[plane][j4 + 1][i7];
  11641. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11642. int k20 = intGroundArray[plane][j4][i7 + 1];
  11643. if (j16 == 0) {
  11644. Object1 class10 = worldController.method296(plane, j4, i7);
  11645. if (class10 != null) {
  11646. int k21 = class10.uid >> 14 & 0x7fff;
  11647. if (j12 == 2) {
  11648. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11649. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  11650. false);
  11651. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  11652. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  11653. j17, false);
  11654. } else {
  11655. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  11656. k21, k14, j12, i19, l19, j18, k20, j17,
  11657. false);
  11658. }
  11659. }
  11660. }
  11661. if (j16 == 1) {
  11662. Object2 class26 = worldController.method297(j4, i7, plane);
  11663. if (class26 != null)
  11664. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  11665. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  11666. j18, k20, j17, false);
  11667. }
  11668. if (j16 == 2) {
  11669. Object5 class28 = worldController.method298(j4, i7, plane);
  11670. if (j12 == 11)
  11671. j12 = 10;
  11672. if (class28 != null)
  11673. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  11674. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  11675. j18, k20, j17, false);
  11676. }
  11677. if (j16 == 3) {
  11678. Object3 class49 = worldController.method299(i7, j4, plane);
  11679. if (class49 != null)
  11680. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  11681. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  11682. j18, k20, j17, false);
  11683. }
  11684. }
  11685. return;
  11686. }
  11687. if (j == 147) {
  11688. int l1 = stream.method428();
  11689. int k4 = anInt1268 + (l1 >> 4 & 7);
  11690. int j7 = anInt1269 + (l1 & 7);
  11691. int i10 = stream.readUnsignedWord();
  11692. byte byte0 = stream.method430();
  11693. int l14 = stream.method434();
  11694. byte byte1 = stream.method429();
  11695. int k17 = stream.readUnsignedWord();
  11696. int k18 = stream.method428();
  11697. int j19 = k18 >> 2;
  11698. int i20 = k18 & 3;
  11699. int l20 = anIntArray1177[j19];
  11700. byte byte2 = stream.readSignedByte();
  11701. int l21 = stream.readUnsignedWord();
  11702. byte byte3 = stream.method429();
  11703. Player player;
  11704. if (i10 == unknownInt10)
  11705. player = myPlayer;
  11706. else
  11707. player = playerArray[i10];
  11708. if (player != null) {
  11709. ObjectDef class46 = ObjectDef.forID(l21);
  11710. int i22 = intGroundArray[plane][k4][j7];
  11711. int j22 = intGroundArray[plane][k4 + 1][j7];
  11712. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11713. int l22 = intGroundArray[plane][k4][j7 + 1];
  11714. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  11715. -1);
  11716. if (model != null) {
  11717. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11718. player.anInt1707 = l14 + loopCycle;
  11719. player.anInt1708 = k17 + loopCycle;
  11720. player.aModel_1714 = model;
  11721. int i23 = class46.sizeX;
  11722. int j23 = class46.sizeY;
  11723. if (i20 == 1 || i20 == 3) {
  11724. i23 = class46.sizeY;
  11725. j23 = class46.sizeX;
  11726. }
  11727. player.anInt1711 = k4 * 128 + i23 * 64;
  11728. player.anInt1713 = j7 * 128 + j23 * 64;
  11729. player.anInt1712 = method42(plane, player.anInt1713,
  11730. player.anInt1711);
  11731. if (byte2 > byte0) {
  11732. byte byte4 = byte2;
  11733. byte2 = byte0;
  11734. byte0 = byte4;
  11735. }
  11736. if (byte3 > byte1) {
  11737. byte byte5 = byte3;
  11738. byte3 = byte1;
  11739. byte1 = byte5;
  11740. }
  11741. player.anInt1719 = k4 + byte2;
  11742. player.anInt1721 = k4 + byte0;
  11743. player.anInt1720 = j7 + byte3;
  11744. player.anInt1722 = j7 + byte1;
  11745. }
  11746. }
  11747. }
  11748. if (j == 151) {
  11749. int i2 = stream.method426();
  11750. int l4 = anInt1268 + (i2 >> 4 & 7);
  11751. int k7 = anInt1269 + (i2 & 7);
  11752. int j10 = stream.method434();
  11753. int k12 = stream.method428();
  11754. int i15 = k12 >> 2;
  11755. int k16 = k12 & 3;
  11756. int l17 = anIntArray1177[i15];
  11757. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11758. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11759. return;
  11760. }
  11761. if (j == 4) {
  11762. int j2 = stream.readUnsignedByte();
  11763. int i5 = anInt1268 + (j2 >> 4 & 7);
  11764. int l7 = anInt1269 + (j2 & 7);
  11765. int k10 = stream.readUnsignedWord();
  11766. int l12 = stream.readUnsignedByte();
  11767. int j15 = stream.readUnsignedWord();
  11768. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  11769. i5 = i5 * 128 + 64;
  11770. l7 = l7 * 128 + 64;
  11771. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  11772. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  11773. i5);
  11774. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11775. }
  11776. return;
  11777. }
  11778. if (j == 44) {
  11779. int itemId = stream.method436();
  11780. int itemAmount = stream.readUnsignedWord();
  11781. int i8 = stream.readUnsignedByte();
  11782. int l10 = anInt1268 + (i8 >> 4 & 7);
  11783. int i13 = anInt1269 + (i8 & 7);
  11784. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  11785. Item item = new Item();
  11786. item.ID = itemId;
  11787. item.anInt1559 = itemAmount;
  11788. if (groundArray[plane][l10][i13] == null)
  11789. groundArray[plane][l10][i13] = new NodeList();
  11790. groundArray[plane][l10][i13].insertHead(item);
  11791. spawnGroundItem(l10, i13);
  11792. }
  11793. return;
  11794. }
  11795. if (j == 101) {
  11796. int l2 = stream.method427();
  11797. int k5 = l2 >> 2;
  11798. int j8 = l2 & 3;
  11799. int i11 = anIntArray1177[k5];
  11800. int j13 = stream.readUnsignedByte();
  11801. int k15 = anInt1268 + (j13 >> 4 & 7);
  11802. int l16 = anInt1269 + (j13 & 7);
  11803. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11804. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11805. return;
  11806. }
  11807. if (j == 117) {
  11808. int i3 = stream.readUnsignedByte();
  11809. int l5 = anInt1268 + (i3 >> 4 & 7);
  11810. int k8 = anInt1269 + (i3 & 7);
  11811. int j11 = l5 + stream.readSignedByte();
  11812. int k13 = k8 + stream.readSignedByte();
  11813. int l15 = stream.readSignedWord();
  11814. int i17 = stream.readUnsignedWord();
  11815. int i18 = stream.readUnsignedByte() * 4;
  11816. int l18 = stream.readUnsignedByte() * 4;
  11817. int k19 = stream.readUnsignedWord();
  11818. int j20 = stream.readUnsignedWord();
  11819. int i21 = stream.readUnsignedByte();
  11820. int j21 = stream.readUnsignedByte();
  11821. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  11822. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  11823. l5 = l5 * 128 + 64;
  11824. k8 = k8 * 128 + 64;
  11825. j11 = j11 * 128 + 64;
  11826. k13 = k13 * 128 + 64;
  11827. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  11828. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  11829. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  11830. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  11831. method42(plane, k13, j11) - l18, j11);
  11832. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11833. }
  11834. }
  11835. }
  11836. public static void setLowMem() {
  11837. WorldController.lowMem = true;
  11838. Rasterizer.lowMem = true;
  11839. lowMem = true;
  11840. ObjectManager.lowMem = true;
  11841. ObjectDef.lowMem = true;
  11842. }
  11843.  
  11844. public void method139(Stream stream) {
  11845. stream.initBitAccess();
  11846. int k = stream.readBits(8);
  11847. if (k < npcCount) {
  11848. for (int l = k; l < npcCount; l++)
  11849. anIntArray840[anInt839++] = npcIndices[l];
  11850.  
  11851. }
  11852. if (k > npcCount) {
  11853. SignLink.reporterror(myUsername + " Too many npcs");
  11854. throw new RuntimeException("eek");
  11855. }
  11856. npcCount = 0;
  11857. for (int i1 = 0; i1 < k; i1++) {
  11858. int j1 = npcIndices[i1];
  11859. NPC npc = npcArray[j1];
  11860. int k1 = stream.readBits(1);
  11861. if (k1 == 0) {
  11862. npcIndices[npcCount++] = j1;
  11863. npc.anInt1537 = loopCycle;
  11864. } else {
  11865. int l1 = stream.readBits(2);
  11866. if (l1 == 0) {
  11867. npcIndices[npcCount++] = j1;
  11868. npc.anInt1537 = loopCycle;
  11869. anIntArray894[anInt893++] = j1;
  11870. } else if (l1 == 1) {
  11871. npcIndices[npcCount++] = j1;
  11872. npc.anInt1537 = loopCycle;
  11873. int i2 = stream.readBits(3);
  11874. npc.moveInDir(false, i2);
  11875. int k2 = stream.readBits(1);
  11876. if (k2 == 1)
  11877. anIntArray894[anInt893++] = j1;
  11878. } else if (l1 == 2) {
  11879. npcIndices[npcCount++] = j1;
  11880. npc.anInt1537 = loopCycle;
  11881. int j2 = stream.readBits(3);
  11882. npc.moveInDir(true, j2);
  11883. int l2 = stream.readBits(3);
  11884. npc.moveInDir(true, l2);
  11885. int i3 = stream.readBits(1);
  11886. if (i3 == 1)
  11887. anIntArray894[anInt893++] = j1;
  11888. } else if (l1 == 3)
  11889. anIntArray840[anInt839++] = j1;
  11890. }
  11891. }
  11892.  
  11893. }
  11894.  
  11895. public void resetImage() {
  11896. DrawingArea.setAllPixelsToZero();
  11897. }
  11898.  
  11899. private void markMinimap(Sprite sprite, int i, int j) {
  11900. int k = viewRotation + minimapRotation & 0x7ff;
  11901. int l = i * i + j * j;
  11902. if(l > 6400)
  11903. return;
  11904. int i1 = Model.SINE[k];
  11905. int j1 = Model.COSINE[k];
  11906. i1 = (i1 * 256) / (minimapZoom + 256);
  11907. j1 = (j1 * 256) / (minimapZoom + 256);
  11908. int k1 = j * i1 + i * j1 >> 16;
  11909. int l1 = j * j1 - i * i1 >> 16;
  11910. if(l > 2500) {
  11911. if (sprite == null)
  11912. return;
  11913. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4 + 20, 83 - l1 - sprite.maxHeight / 2 - 4 + 5);
  11914. } else {
  11915. if (sprite == null)
  11916. return;
  11917. sprite.drawSprite(((94 + k1) - sprite.maxWidth / 2) + 4 + 20, 83 - l1 - sprite.maxHeight / 2 - 4 + 5);
  11918. }
  11919. }
  11920.  
  11921. public void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  11922. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  11923. if (lowMem && j != plane)
  11924. return;
  11925. int i2 = 0;
  11926. if (j1 == 0)
  11927. i2 = worldController.method300(j, i1, i);
  11928. if (j1 == 1)
  11929. i2 = worldController.method301(j, i1, i);
  11930. if (j1 == 2)
  11931. i2 = worldController.method302(j, i1, i);
  11932. if (j1 == 3)
  11933. i2 = worldController.method303(j, i1, i);
  11934. if (i2 != 0) {
  11935. int i3 = worldController.method304(j, i1, i, i2);
  11936. int j2 = i2 >> 14 & 0x7fff;
  11937. int k2 = i3 & 0x1f;
  11938. int l2 = i3 >> 6;
  11939. if (j1 == 0) {
  11940. worldController.method291(i1, j, i, (byte) -119);
  11941. ObjectDef class46 = ObjectDef.forID(j2);
  11942. if (class46.aBoolean767)
  11943. aClass11Array1230[j].method215(l2, k2,
  11944. class46.aBoolean757, i1, i);
  11945. }
  11946. if (j1 == 1)
  11947. worldController.method292(i, j, i1);
  11948. if (j1 == 2) {
  11949. worldController.method293(j, i1, i);
  11950. ObjectDef class46_1 = ObjectDef.forID(j2);
  11951. if (i1 + class46_1.sizeX > 103
  11952. || i + class46_1.sizeX > 103
  11953. || i1 + class46_1.sizeY > 103
  11954. || i + class46_1.sizeY > 103)
  11955. return;
  11956. if (class46_1.aBoolean767)
  11957. aClass11Array1230[j].method216(l2, class46_1.sizeX,
  11958. i1, i, class46_1.sizeY,
  11959. class46_1.aBoolean757);
  11960. }
  11961. if (j1 == 3) {
  11962. worldController.method294(j, i, i1);
  11963. ObjectDef class46_2 = ObjectDef.forID(j2);
  11964. if (class46_2.aBoolean767 && class46_2.hasActions)
  11965. aClass11Array1230[j].method218(i, i1);
  11966. }
  11967. }
  11968. if (k1 >= 0) {
  11969. int j3 = j;
  11970. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11971. j3++;
  11972. ObjectManager.method188(worldController, k, i, l, j3,
  11973. aClass11Array1230[j], intGroundArray, i1, k1, j);
  11974. }
  11975. }
  11976. }
  11977.  
  11978. public void updatePlayers(int i, Stream stream) {
  11979. anInt839 = 0;
  11980. anInt893 = 0;
  11981. method117(stream);
  11982. method134(stream);
  11983. method91(stream, i);
  11984. method49(stream);
  11985. for (int k = 0; k < anInt839; k++) {
  11986. int l = anIntArray840[k];
  11987. if (playerArray[l].anInt1537 != loopCycle)
  11988. playerArray[l] = null;
  11989. }
  11990.  
  11991. if (stream.currentOffset != i) {
  11992. SignLink.reporterror("Error packet size mismatch in getplayer pos:"
  11993. + stream.currentOffset + " psize:" + i);
  11994. throw new RuntimeException("eek");
  11995. }
  11996. for (int i1 = 0; i1 < playerCount; i1++)
  11997. if (playerArray[playerIndices[i1]] == null) {
  11998. SignLink.reporterror(myUsername
  11999. + " null entry in pl list - pos:" + i1 + " size:"
  12000. + playerCount);
  12001. throw new RuntimeException("eek");
  12002. }
  12003.  
  12004. }
  12005.  
  12006. public void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  12007. int l1 = 2048 - k & 0x7ff;
  12008. int i2 = 2048 - j1 & 0x7ff;
  12009. int j2 = 0;
  12010. int k2 = 0;
  12011. int l2 = j;
  12012. if (l1 != 0) {
  12013. int i3 = Model.SINE[l1];
  12014. int k3 = Model.COSINE[l1];
  12015. int i4 = k2 * k3 - l2 * i3 >> 16;
  12016. l2 = k2 * i3 + l2 * k3 >> 16;
  12017. k2 = i4;
  12018. }
  12019. if (i2 != 0) {
  12020. /*
  12021. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  12022. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  12023. * l2 = fwdbwd; }
  12024. */
  12025. int j3 = Model.SINE[i2];
  12026. int l3 = Model.COSINE[i2];
  12027. int j4 = l2 * j3 + j2 * l3 >> 16;
  12028. l2 = l2 * l3 - j2 * j3 >> 16;
  12029. j2 = j4;
  12030. }
  12031. xCameraPos = l - j2;
  12032. zCameraPos = i1 - k2;
  12033. yCameraPos = k1 - l2;
  12034. yCameraCurve = k;
  12035. xCameraCurve = j1;
  12036. }
  12037.  
  12038. public void updateStrings(String str, int i) {
  12039. switch (i) {
  12040. case 1675:
  12041. sendFrame126(str, 17508);
  12042. break;// Stab
  12043. case 1676:
  12044. sendFrame126(str, 17509);
  12045. break;// Slash
  12046. case 1678:
  12047. sendFrame126(str, 17511);
  12048. break;// Magic
  12049. case 1679:
  12050. sendFrame126(str, 17512);
  12051. break;// Range
  12052. case 1680:
  12053. sendFrame126(str, 17513);
  12054. break;// Stab
  12055. case 1681:
  12056. sendFrame126(str, 17514);
  12057. break;// Slash
  12058. case 1682:
  12059. sendFrame126(str, 17515);
  12060. break;// Crush
  12061. case 1683:
  12062. sendFrame126(str, 17516);
  12063. break;// Magic
  12064. case 1684:
  12065. sendFrame126(str, 17517);
  12066. break;// Range
  12067. case 1686:
  12068. sendFrame126(str, 17518);
  12069. break;// Strength
  12070. case 1687:
  12071. sendFrame126(str, 17519);
  12072. break;// Prayer
  12073. }
  12074. }
  12075.  
  12076. public void sendFrame126(String str, int i) {
  12077. RSInterface.interfaceCache[i].message = str;
  12078. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  12079. needDrawTabArea = true;
  12080. }
  12081.  
  12082. public void sendPacket185(int button, int toggle, int type) {
  12083. switch (type) {
  12084. case 135:
  12085. RSInterface class9 = RSInterface.interfaceCache[button];
  12086. boolean flag8 = true;
  12087. if (class9.contentType > 0)
  12088. flag8 = promptUserForInput(class9);
  12089. if (flag8) {
  12090. stream.createFrame(185);
  12091. stream.writeWord(button);
  12092. }
  12093. break;
  12094. case 646:
  12095. stream.createFrame(185);
  12096. stream.writeWord(button);
  12097. RSInterface class9_2 = RSInterface.interfaceCache[button];
  12098. if (class9_2.valueIndexArray != null
  12099. && class9_2.valueIndexArray[0][0] == 5) {
  12100. if (variousSettings[toggle] != class9_2.requiredValues[0]) {
  12101. variousSettings[toggle] = class9_2.requiredValues[0];
  12102. method33(toggle);
  12103. needDrawTabArea = true;
  12104. }
  12105. }
  12106. break;
  12107. case 169:
  12108. stream.createFrame(185);
  12109. stream.writeWord(button);
  12110. RSInterface class9_3 = RSInterface.interfaceCache[button];
  12111. if (class9_3.valueIndexArray != null
  12112. && class9_3.valueIndexArray[0][0] == 5) {
  12113. variousSettings[toggle] = 1 - variousSettings[toggle];
  12114. method33(toggle);
  12115. needDrawTabArea = true;
  12116. }
  12117. switch (button) {
  12118. case 19136:
  12119. if (toggle == 0)
  12120. sendFrame36(173, toggle);
  12121. if (toggle == 1)
  12122. sendPacket185(153, 173, 646);
  12123. break;
  12124. }
  12125. break;
  12126. }
  12127. }
  12128.  
  12129. public void sendFrame36(int id, int state) {
  12130. anIntArray1045[id] = state;
  12131. if (variousSettings[id] != state) {
  12132. variousSettings[id] = state;
  12133. method33(id);
  12134. needDrawTabArea = true;
  12135. if (dialogID != -1)
  12136. inputTaken = true;
  12137. }
  12138. }
  12139.  
  12140. public void sendFrame219() {
  12141. if (invOverlayInterfaceID != -1) {
  12142. invOverlayInterfaceID = -1;
  12143. needDrawTabArea = true;
  12144. tabAreaAltered = true;
  12145. }
  12146. if (backDialogID != -1) {
  12147. backDialogID = -1;
  12148. inputTaken = true;
  12149. }
  12150. if (inputDialogState != 0) {
  12151. inputDialogState = 0;
  12152. inputTaken = true;
  12153. }
  12154. openInterfaceID = -1;
  12155. aBoolean1149 = false;
  12156. }
  12157.  
  12158. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  12159. if (backDialogID != -1) {
  12160. backDialogID = -1;
  12161. inputTaken = true;
  12162. }
  12163. if (inputDialogState != 0) {
  12164. inputDialogState = 0;
  12165. inputTaken = true;
  12166. }
  12167. openInterfaceID = interfaceID;
  12168. invOverlayInterfaceID = sideInterfaceID;
  12169. needDrawTabArea = true;
  12170. tabAreaAltered = true;
  12171. aBoolean1149 = false;
  12172. }
  12173.  
  12174. private void ping() {
  12175. pingStart = System.currentTimeMillis();
  12176. stream.createFrame(90);
  12177. }
  12178.  
  12179. @SuppressWarnings("unused")
  12180. public boolean parsePacket() {
  12181. if (socketStream == null)
  12182. return false;
  12183. try {
  12184. int i = socketStream.available();
  12185. if (i == 0)
  12186. return false;
  12187. if (pktType == -1) {
  12188. socketStream.flushInputStream(inStream.buffer, 1);
  12189. pktType = inStream.buffer[0] & 0xff;
  12190. if (encryption != null)
  12191. pktType = pktType - encryption.getNextKey() & 0xff;
  12192. pktSize = SizeConstants.packetSizes[pktType];
  12193. i--;
  12194. }
  12195. if (pktSize == -1)
  12196. if (i > 0) {
  12197. socketStream.flushInputStream(inStream.buffer, 1);
  12198. pktSize = inStream.buffer[0] & 0xff;
  12199. i--;
  12200. } else {
  12201. return false;
  12202. }
  12203. if (pktSize == -2)
  12204. if (i > 1) {
  12205. socketStream.flushInputStream(inStream.buffer, 2);
  12206. inStream.currentOffset = 0;
  12207. pktSize = inStream.readUnsignedWord();
  12208. i -= 2;
  12209. } else {
  12210. return false;
  12211. }
  12212. if (i < pktSize)
  12213. return false;
  12214. inStream.currentOffset = 0;
  12215. socketStream.flushInputStream(inStream.buffer, pktSize);
  12216. anInt1009 = 0;
  12217. anInt843 = anInt842;
  12218. anInt842 = anInt841;
  12219. anInt841 = pktType;
  12220. switch (pktType) {
  12221. case 81:
  12222. updatePlayers(pktSize, inStream);
  12223. aBoolean1080 = false;
  12224. pktType = -1;
  12225. return true;
  12226.  
  12227. case 176:
  12228. daysSinceRecovChange = inStream.method427();
  12229. unreadMessages = inStream.method435();
  12230. membersInt = inStream.readUnsignedByte();
  12231. anInt1193 = inStream.method440();
  12232. daysSinceLastLogin = inStream.readUnsignedWord();
  12233. if (anInt1193 != 0 && openInterfaceID == -1) {
  12234. SignLink.dnslookup(TextClass.method586(anInt1193));
  12235. clearTopInterfaces();
  12236. char c = '\u028A';
  12237. if (daysSinceRecovChange != 201 || membersInt == 1)
  12238. c = '\u028F';
  12239. reportAbuseInput = "";
  12240. canMute = false;
  12241. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  12242. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  12243. continue;
  12244. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  12245.  
  12246. }
  12247. }
  12248. pktType = -1;
  12249. return true;
  12250.  
  12251. case 64:
  12252. anInt1268 = inStream.method427();
  12253. anInt1269 = inStream.method428();
  12254. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  12255. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  12256. if (groundArray[plane][j][l9] != null) {
  12257. groundArray[plane][j][l9] = null;
  12258. spawnGroundItem(j, l9);
  12259. }
  12260. }
  12261. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  12262. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  12263. .reverseGetNext())
  12264. if (class30_sub1.anInt1297 >= anInt1268
  12265. && class30_sub1.anInt1297 < anInt1268 + 8
  12266. && class30_sub1.anInt1298 >= anInt1269
  12267. && class30_sub1.anInt1298 < anInt1269 + 8
  12268. && class30_sub1.anInt1295 == plane)
  12269. class30_sub1.anInt1294 = 0;
  12270. pktType = -1;
  12271. return true;
  12272.  
  12273. case 185:
  12274. int k = inStream.method436();
  12275. RSInterface.interfaceCache[k].anInt233 = 3;
  12276. if (myPlayer.desc == null)
  12277. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  12278. + (myPlayer.anIntArray1700[4] << 20)
  12279. + (myPlayer.equipment[0] << 15)
  12280. + (myPlayer.equipment[8] << 10)
  12281. + (myPlayer.equipment[11] << 5)
  12282. + myPlayer.equipment[1];
  12283. else
  12284. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.id);
  12285. pktType = -1;
  12286. return true;
  12287.  
  12288. /* Clan message packet */
  12289. case 217:
  12290. try {
  12291. name = inStream.readString();
  12292. message = inStream.readString();
  12293. clanname = inStream.readString();
  12294. rights = inStream.readUnsignedWord();
  12295. pushMessage(message, 16, name);
  12296. } catch(Exception e) {
  12297. e.printStackTrace();
  12298. }
  12299. pktType = -1;
  12300. return true;
  12301.  
  12302. case 107:
  12303. aBoolean1160 = false;
  12304. for(int l = 0; l < 5; l++)
  12305. aBooleanArray876[l] = false;
  12306. xpCounter = 0;
  12307. pktType = -1;
  12308. return true;
  12309.  
  12310. case 72:
  12311. int i1 = inStream.method434();
  12312. RSInterface class9 = RSInterface.interfaceCache[i1];
  12313. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  12314. class9.inv[k15] = -1;
  12315. class9.inv[k15] = 0;
  12316. }
  12317. pktType = -1;
  12318. return true;
  12319.  
  12320. case 214:
  12321. ignoreCount = pktSize / 8;
  12322. for (int j1 = 0; j1 < ignoreCount; j1++)
  12323. ignoreListAsLongs[j1] = inStream.readQWord();
  12324. pktType = -1;
  12325. return true;
  12326.  
  12327. case 166:
  12328. aBoolean1160 = true;
  12329. anInt1098 = inStream.readUnsignedByte();
  12330. anInt1099 = inStream.readUnsignedByte();
  12331. anInt1100 = inStream.readUnsignedWord();
  12332. anInt1101 = inStream.readUnsignedByte();
  12333. anInt1102 = inStream.readUnsignedByte();
  12334. if (anInt1102 >= 100) {
  12335. xCameraPos = anInt1098 * 128 + 64;
  12336. yCameraPos = anInt1099 * 128 + 64;
  12337. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  12338. - anInt1100;
  12339. }
  12340. pktType = -1;
  12341. return true;
  12342.  
  12343. case 134:
  12344. needDrawTabArea = true;
  12345. int k1 = inStream.readUnsignedByte();
  12346. int i10 = inStream.method439();
  12347. int l15 = inStream.readUnsignedByte();
  12348. int xp = currentExp[k1];
  12349. currentExp[k1] = i10;
  12350. currentStats[k1] = l15;
  12351. maxStats[k1] = 1;
  12352. xpCounter += currentExp[k1]-xp;
  12353. expAdded = currentExp[k1]-xp;
  12354. for(int k20 = 0; k20 < 98; k20++)
  12355. if(i10 >= anIntArray1019[k20])
  12356. maxStats[k1] = k20 + 2;
  12357.  
  12358. int totalLevel = 0;
  12359. long totalXP = 0;
  12360.  
  12361. for (int id = 0; id < Skills.skillsCount; id++) {
  12362. if (id == 24) {
  12363. totalLevel += getLevelForXP(currentExp[id], 120);
  12364. } else {
  12365. totalLevel += getLevelForXP(currentExp[id]);
  12366. }
  12367. totalXP += currentExp[id];
  12368. }
  12369.  
  12370. RSInterface.interfaceCache[3984].message = "Total level: " + NumberFormat.getInstance().format(totalLevel);
  12371. RSInterface.interfaceCache[3985].message = "Total Experience: " + NumberFormat.getInstance().format(totalXP);
  12372.  
  12373. pktType = -1;
  12374. return true;
  12375.  
  12376. case 71:
  12377. int l1 = inStream.readUnsignedWord();
  12378. int j10 = inStream.method426();
  12379. if (l1 == 65535)
  12380. l1 = -1;
  12381. tabInterfaceIDs[j10] = l1;
  12382. needDrawTabArea = true;
  12383. tabAreaAltered = true;
  12384. pktType = -1;
  12385. return true;
  12386.  
  12387. case 74:
  12388. int songID = inStream.method434();
  12389. if (songID == 65535) {
  12390. songID = -1;
  12391. }
  12392. if (songID != currentSong && previousSong == 0 && songID != -1) {
  12393. nextSong = songID;
  12394. songChanging = true;
  12395. onDemandFetcher.method558(2, nextSong);
  12396. }
  12397. currentSong = songID;
  12398. pktType = -1;
  12399. return true;
  12400.  
  12401. case 121:
  12402. int songId = inStream.method436();
  12403. int songDelay = inStream.method435();
  12404. if (musicEnabled && !lowMem) {
  12405. nextSong = songId;
  12406. songChanging = false;
  12407. onDemandFetcher.method558(2, nextSong);
  12408. previousSong = songDelay;
  12409. }
  12410. pktType = -1;
  12411. return true;
  12412.  
  12413. case 109:
  12414. resetLogout();
  12415. pktType = -1;
  12416. return false;
  12417.  
  12418. case 70:
  12419. int k2 = inStream.readSignedWord();
  12420. int l10 = inStream.method437();
  12421. int i16 = inStream.method434();
  12422. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  12423. class9_5.anInt263 = k2;
  12424. class9_5.anInt265 = l10;
  12425. pktType = -1;
  12426. return true;
  12427.  
  12428. case 73:
  12429. case 241:
  12430. int l2 = anInt1069;
  12431. int i11 = anInt1070;
  12432. if (pktType == 73) {
  12433. l2 = inStream.method435();
  12434. i11 = inStream.readUnsignedWord();
  12435. aBoolean1159 = false;
  12436. }
  12437. if (pktType == 241) {
  12438. i11 = inStream.method435();
  12439. inStream.initBitAccess();
  12440. for (int j16 = 0; j16 < 4; j16++) {
  12441. for (int l20 = 0; l20 < 13; l20++) {
  12442. for (int j23 = 0; j23 < 13; j23++) {
  12443. int i26 = inStream.readBits(1);
  12444. if (i26 == 1)
  12445. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  12446. else
  12447. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12448. }
  12449. }
  12450. }
  12451. inStream.finishBitAccess();
  12452. l2 = inStream.readUnsignedWord();
  12453. aBoolean1159 = true;
  12454. }
  12455. if (pktType != 241 && anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12456. pktType = -1;
  12457. return true;
  12458. }
  12459.  
  12460. /*if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12461. pktType = -1;
  12462. return true;
  12463. }*/
  12464. anInt1069 = l2;
  12465. anInt1070 = i11;
  12466. baseX = (anInt1069 - 6) * 8;
  12467. baseY = (anInt1070 - 6) * 8;
  12468. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  12469. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12470. aBoolean1141 = true;
  12471. loadingStage = 1;
  12472. aLong824 = System.currentTimeMillis();
  12473. aRSImageProducer_1165.initDrawingArea();
  12474. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2);
  12475. DrawingArea.drawPixels(20, 3, 3, 0, 128);
  12476. aTextDrawingArea_1271.drawText(0, "Loading - Please Wait", 18, 68);
  12477. aTextDrawingArea_1271.drawText(0xffffff, "Loading - Please Wait", 17, 67);
  12478. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12479. if (pktType == 73) {
  12480. int k16 = 0;
  12481. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12482. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12483. k16++;
  12484. }
  12485. aByteArrayArray1183 = new byte[k16][];
  12486. aByteArrayArray1247 = new byte[k16][];
  12487. anIntArray1234 = new int[k16];
  12488. anIntArray1235 = new int[k16];
  12489. anIntArray1236 = new int[k16];
  12490. k16 = 0;
  12491. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12492. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12493. anIntArray1234[k16] = (l23 << 8) + j26;
  12494. if (aBoolean1141
  12495. && (j26 == 49 || j26 == 149 || j26 == 147
  12496. || l23 == 50 || l23 == 49
  12497. && j26 == 47)) {
  12498. anIntArray1235[k16] = -1;
  12499. anIntArray1236[k16] = -1;
  12500. k16++;
  12501. } else {
  12502. int k28 = anIntArray1235[k16] = onDemandFetcher
  12503. .method562(0, j26, l23);
  12504. if (k28 != -1)
  12505. onDemandFetcher.method558(3, k28);
  12506. int j30 = anIntArray1236[k16] = onDemandFetcher
  12507. .method562(1, j26, l23);
  12508. if (j30 != -1)
  12509. onDemandFetcher.method558(3, j30);
  12510. k16++;
  12511. }
  12512. }
  12513. }
  12514. }
  12515. if (pktType == 241) {
  12516. int l16 = 0;
  12517. int ai[] = new int[676];
  12518. for (int i24 = 0; i24 < 4; i24++) {
  12519. for (int k26 = 0; k26 < 13; k26++) {
  12520. for (int l28 = 0; l28 < 13; l28++) {
  12521. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12522. if (k30 != -1) {
  12523. int k31 = k30 >> 14 & 0x3ff;
  12524. int i32 = k30 >> 3 & 0x7ff;
  12525. int k32 = (k31 / 8 << 8) + i32 / 8;
  12526. for (int j33 = 0; j33 < l16; j33++) {
  12527. if (ai[j33] != k32)
  12528. continue;
  12529. k32 = -1;
  12530.  
  12531. }
  12532. if (k32 != -1)
  12533. ai[l16++] = k32;
  12534. }
  12535. }
  12536. }
  12537. }
  12538. aByteArrayArray1183 = new byte[l16][];
  12539. aByteArrayArray1247 = new byte[l16][];
  12540. anIntArray1234 = new int[l16];
  12541. anIntArray1235 = new int[l16];
  12542. anIntArray1236 = new int[l16];
  12543. for (int l26 = 0; l26 < l16; l26++) {
  12544. int i29 = anIntArray1234[l26] = ai[l26];
  12545. int l30 = i29 >> 8 & 0xff;
  12546. int l31 = i29 & 0xff;
  12547. int j32 = anIntArray1235[l26] = onDemandFetcher
  12548. .method562(0, l31, l30);
  12549. if (j32 != -1)
  12550. onDemandFetcher.method558(3, j32);
  12551. int i33 = anIntArray1236[l26] = onDemandFetcher
  12552. .method562(1, l31, l30);
  12553. if (i33 != -1)
  12554. onDemandFetcher.method558(3, i33);
  12555. }
  12556. }
  12557. int i17 = baseX - anInt1036;
  12558. int j21 = baseY - anInt1037;
  12559. anInt1036 = baseX;
  12560. anInt1037 = baseY;
  12561. for (int j24 = 0; j24 < 16384; j24++) {
  12562. NPC npc = npcArray[j24];
  12563. if (npc != null) {
  12564. for (int j29 = 0; j29 < 10; j29++) {
  12565. npc.smallX[j29] -= i17;
  12566. npc.smallY[j29] -= j21;
  12567. }
  12568. npc.x -= i17 * 128;
  12569. npc.y -= j21 * 128;
  12570. }
  12571. }
  12572. for (int i27 = 0; i27 < maxPlayers; i27++) {
  12573. Player player = playerArray[i27];
  12574. if (player != null) {
  12575. for (int i31 = 0; i31 < 10; i31++) {
  12576. player.smallX[i31] -= i17;
  12577. player.smallY[i31] -= j21;
  12578. }
  12579. player.x -= i17 * 128;
  12580. player.y -= j21 * 128;
  12581. }
  12582. }
  12583. aBoolean1080 = true;
  12584. byte byte1 = 0;
  12585. byte byte2 = 104;
  12586. byte byte3 = 1;
  12587. if (i17 < 0) {
  12588. byte1 = 103;
  12589. byte2 = -1;
  12590. byte3 = -1;
  12591. }
  12592. byte byte4 = 0;
  12593. byte byte5 = 104;
  12594. byte byte6 = 1;
  12595. if (j21 < 0) {
  12596. byte4 = 103;
  12597. byte5 = -1;
  12598. byte6 = -1;
  12599. }
  12600. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  12601. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  12602. int i34 = k33 + i17;
  12603. int j34 = l33 + j21;
  12604. for (int k34 = 0; k34 < 4; k34++)
  12605. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12606. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12607. else
  12608. groundArray[k34][k33][l33] = null;
  12609. }
  12610. }
  12611. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12612. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12613. .reverseGetNext()) {
  12614. class30_sub1_1.anInt1297 -= i17;
  12615. class30_sub1_1.anInt1298 -= j21;
  12616. if (class30_sub1_1.anInt1297 < 0
  12617. || class30_sub1_1.anInt1298 < 0
  12618. || class30_sub1_1.anInt1297 >= 104
  12619. || class30_sub1_1.anInt1298 >= 104)
  12620. class30_sub1_1.unlink();
  12621. }
  12622. if (destX != 0) {
  12623. destX -= i17;
  12624. destY -= j21;
  12625. }
  12626. aBoolean1160 = false;
  12627. pktType = -1;
  12628. return true;
  12629.  
  12630. case 208:
  12631. int i3 = inStream.method437();
  12632. if (i3 >= 0)
  12633. method60(i3);
  12634. anInt1018 = i3;
  12635. pktType = -1;
  12636. return true;
  12637.  
  12638. case 99:
  12639. /*
  12640. * Black map, mape state 2, causes blackness
  12641. */
  12642. anInt1021 = inStream.readUnsignedByte();
  12643. pktType = -1;
  12644. return true;
  12645.  
  12646. case 75:
  12647. int j3 = inStream.method436();
  12648. int j11 = inStream.method436();
  12649. RSInterface.interfaceCache[j11].anInt233 = 2;
  12650. RSInterface.interfaceCache[j11].mediaID = j3;
  12651. pktType = -1;
  12652. return true;
  12653.  
  12654.  
  12655. case 114:
  12656. anInt1104 = inStream.method434() * 30;
  12657. pktType = -1;
  12658. return true;
  12659.  
  12660. case 60:
  12661. anInt1269 = inStream.readUnsignedByte();
  12662. anInt1268 = inStream.method427();
  12663. while (inStream.currentOffset < pktSize) {
  12664. int k3 = inStream.readUnsignedByte();
  12665. method137(inStream, k3);
  12666. }
  12667. pktType = -1;
  12668. return true;
  12669.  
  12670. case 35:
  12671. int l3 = inStream.readUnsignedByte();
  12672. int k11 = inStream.readUnsignedByte();
  12673. int j17 = inStream.readUnsignedByte();
  12674. int k21 = inStream.readUnsignedByte();
  12675. aBooleanArray876[l3] = true;
  12676. anIntArray873[l3] = k11;
  12677. anIntArray1203[l3] = j17;
  12678. anIntArray928[l3] = k21;
  12679. anIntArray1030[l3] = 0;
  12680. pktType = -1;
  12681. return true;
  12682.  
  12683. /*case 174:
  12684. int i4 = inStream.readUnsignedWord();
  12685. int l11 = inStream.readUnsignedByte();
  12686. int k17 = inStream.readUnsignedWord();
  12687. if (aBoolean848 && !lowMem && currentSound < 50) {
  12688. sound[currentSound] = i4;
  12689. soundType[currentSound] = l11;
  12690. soundDelay[currentSound] = k17 + Sound.anIntArray326[i4];
  12691. currentSound++;
  12692. }
  12693. pktType = -1;
  12694. return true;*/
  12695.  
  12696. /* 174:
  12697. int soundId = inStream.readUnsignedWord();
  12698. int type = inStream.readUnsignedByte();
  12699. int delay = inStream.readUnsignedWord();
  12700. int volume = inStream.readUnsignedWord();
  12701. sound[currentSound] = soundId;
  12702. soundType[currentSound] = type;
  12703. soundDelay[currentSound] = delay + Sound.anIntArray326[soundId];
  12704. soundVolume[currentSound] = volume;
  12705. currentSound++;
  12706. pktType = -1;
  12707. return true;*/
  12708.  
  12709. case 174:
  12710. int soundId = inStream.readUnsignedWord();
  12711. int type = inStream.readUnsignedByte();
  12712. int delay = inStream.readUnsignedWord();
  12713. int volume = inStream.readUnsignedWord();
  12714. sound[currentSound] = soundId;
  12715. soundType[currentSound] = type;
  12716. soundDelay[currentSound] = delay + Sound.anIntArray326[soundId];
  12717. soundVolume[currentSound] = volume;
  12718. currentSound++;
  12719. pktType = -1;
  12720. return true;
  12721.  
  12722. case 104:
  12723. int j4 = inStream.method427();
  12724. int i12 = inStream.method426();
  12725. String s6 = inStream.readString();
  12726. if (j4 >= 1 && j4 <= 5) {
  12727. if (s6.equalsIgnoreCase("null"))
  12728. s6 = null;
  12729. atPlayerActions[j4 - 1] = s6;
  12730. atPlayerArray[j4 - 1] = i12 == 0;
  12731. }
  12732. pktType = -1;
  12733. return true;
  12734.  
  12735. case 78:
  12736. destX = 0;
  12737. pktType = -1;
  12738. return true;
  12739.  
  12740. case 253:
  12741. String s = inStream.readString();
  12742. if(s.endsWith(":tradereq:")) {
  12743. String s3 = s.substring(0, s.indexOf(":"));
  12744. long l17 = TextClass.longForName(s3);
  12745. boolean flag2 = false;
  12746. for(int j27 = 0; j27 < ignoreCount; j27++) {
  12747. if(ignoreListAsLongs[j27] != l17)
  12748. continue;
  12749. flag2 = true;
  12750. }
  12751. if(!flag2 && anInt1251 == 0)
  12752. pushMessage("wishes to trade with you.", 4, s3);
  12753. } else if (s.endsWith(":clan:")) {
  12754. String s4 = s.substring(0, s.indexOf(":"));
  12755. TextClass.longForName(s4);
  12756. pushMessage("Clan: ", 8, s4);
  12757. } else if(s.endsWith("#url#")) {
  12758. String link = s.substring(0, s.indexOf("#"));
  12759. pushMessage("Join us at: ", 9, link);
  12760. } else if(s.endsWith(":duelreq:")) {
  12761. String s4 = s.substring(0, s.indexOf(":"));
  12762. long l18 = TextClass.longForName(s4);
  12763. boolean flag3 = false;
  12764. for(int k27 = 0; k27 < ignoreCount; k27++) {
  12765. if(ignoreListAsLongs[k27] != l18)
  12766. continue;
  12767. flag3 = true;
  12768.  
  12769. }
  12770. if(!flag3 && anInt1251 == 0)
  12771. pushMessage("wishes to duel with you.", 8, s4);
  12772. } else if(s.endsWith(":chalreq:")) {
  12773. String s5 = s.substring(0, s.indexOf(":"));
  12774. long l19 = TextClass.longForName(s5);
  12775. boolean flag4 = false;
  12776. for(int l27 = 0; l27 < ignoreCount; l27++) {
  12777. if(ignoreListAsLongs[l27] != l19)
  12778. continue;
  12779. flag4 = true;
  12780.  
  12781. }
  12782. if(!flag4 && anInt1251 == 0) {
  12783. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12784. pushMessage(s8, 8, s5);
  12785. }
  12786. } else if(s.endsWith("-partyinvite")) {
  12787. String[] data = s.split("-");
  12788. String username = data[0];
  12789. String partyType = "";
  12790.  
  12791. for (int k5 = 1; k5 < data.length - 1; k5++)
  12792. partyType += data[k5] + "-";
  12793. partyType = partyType.substring(0, partyType.length() - 1);
  12794.  
  12795. long usernameAsLong = TextClass.longForName(username);
  12796. boolean isIgnored = false;
  12797.  
  12798. for(int i5 = 0; i5 < ignoreCount; i5++) {
  12799. if(ignoreListAsLongs[i5] != usernameAsLong)
  12800. continue;
  12801. isIgnored = true;
  12802.  
  12803. }
  12804.  
  12805. if (!isIgnored && anInt1251 == 0) {
  12806. if (partyType.length() > 0)
  12807. partyType = " " + partyType;
  12808. pushMessage("wants you to join their" + partyType + " party.", 15, username);
  12809. }
  12810. } else {
  12811. pushMessage(s, 0, "");
  12812. }
  12813. pktType = -1;
  12814. return true;
  12815.  
  12816. case 1:
  12817. for (int k4 = 0; k4 < playerArray.length; k4++)
  12818. if (playerArray[k4] != null)
  12819. playerArray[k4].anim = -1;
  12820. for (int j12 = 0; j12 < npcArray.length; j12++)
  12821. if (npcArray[j12] != null)
  12822. npcArray[j12].anim = -1;
  12823. pktType = -1;
  12824. return true;
  12825.  
  12826. case 90:
  12827. ping = (int) (System.currentTimeMillis() - pingStart);
  12828. ping();
  12829. pktType = -1;
  12830. return true;
  12831.  
  12832. case 124:
  12833. String interfaceType = TextClass.nameForLong(inStream.readQWord());
  12834. int amount = inStream.readUnsignedByte();
  12835.  
  12836. if (interfaceType.equalsIgnoreCase("party")) {
  12837. partyCount = amount;
  12838. }
  12839.  
  12840. pktType = -1;
  12841. return true;
  12842.  
  12843. case 50:
  12844. long l4 = inStream.readQWord();
  12845. int i18 = inStream.readUnsignedByte();
  12846. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12847. for (int k24 = 0; k24 < friendsCount; k24++) {
  12848. if (l4 != friendsListAsLongs[k24])
  12849. continue;
  12850. if (friendsNodeIDs[k24] != i18) {
  12851. friendsNodeIDs[k24] = i18;
  12852. needDrawTabArea = true;
  12853. if (i18 >= 2) {
  12854. pushMessage(s7 + " has logged in.", 5, "");
  12855. }
  12856. if (i18 <= 1) {
  12857. pushMessage(s7 + " has logged out.", 5, "");
  12858. }
  12859. }
  12860. s7 = null;
  12861.  
  12862. }
  12863. if (s7 != null && friendsCount < 200) {
  12864. friendsListAsLongs[friendsCount] = l4;
  12865. friendsList[friendsCount] = s7;
  12866. friendsNodeIDs[friendsCount] = i18;
  12867. friendsCount++;
  12868. needDrawTabArea = true;
  12869. }
  12870. for (boolean flag6 = false; !flag6;) {
  12871. flag6 = true;
  12872. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  12873. if (friendsNodeIDs[k29] != nodeID
  12874. && friendsNodeIDs[k29 + 1] == nodeID
  12875. || friendsNodeIDs[k29] == 0
  12876. && friendsNodeIDs[k29 + 1] != 0) {
  12877. int j31 = friendsNodeIDs[k29];
  12878. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12879. friendsNodeIDs[k29 + 1] = j31;
  12880. String s10 = friendsList[k29];
  12881. friendsList[k29] = friendsList[k29 + 1];
  12882. friendsList[k29 + 1] = s10;
  12883. long l32 = friendsListAsLongs[k29];
  12884. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12885. friendsListAsLongs[k29 + 1] = l32;
  12886. needDrawTabArea = true;
  12887. flag6 = false;
  12888. }
  12889. }
  12890. pktType = -1;
  12891. return true;
  12892.  
  12893. case 110:
  12894. if (tabID == 12)
  12895. needDrawTabArea = true;
  12896. energy = inStream.readUnsignedByte();
  12897. pktType = -1;
  12898. return true;
  12899.  
  12900. case 254:
  12901. anInt855 = inStream.readUnsignedByte();
  12902. if (anInt855 == 1)
  12903. anInt1222 = inStream.readUnsignedWord();
  12904. if (anInt855 >= 2 && anInt855 <= 6) {
  12905. if (anInt855 == 2) {
  12906. anInt937 = 64;
  12907. anInt938 = 64;
  12908. }
  12909. if (anInt855 == 3) {
  12910. anInt937 = 0;
  12911. anInt938 = 64;
  12912. }
  12913. if (anInt855 == 4) {
  12914. anInt937 = 128;
  12915. anInt938 = 64;
  12916. }
  12917. if (anInt855 == 5) {
  12918. anInt937 = 64;
  12919. anInt938 = 0;
  12920. }
  12921. if (anInt855 == 6) {
  12922. anInt937 = 64;
  12923. anInt938 = 128;
  12924. }
  12925. anInt855 = 2;
  12926. anInt934 = inStream.readUnsignedWord();
  12927. anInt935 = inStream.readUnsignedWord();
  12928. anInt936 = inStream.readUnsignedByte();
  12929. }
  12930. if (anInt855 == 10)
  12931. anInt933 = inStream.readUnsignedWord();
  12932. pktType = -1;
  12933. return true;
  12934.  
  12935. case 248:
  12936. int i5 = inStream.method435();
  12937. int k12 = inStream.readUnsignedWord();
  12938. if (backDialogID != -1) {
  12939. backDialogID = -1;
  12940. inputTaken = true;
  12941. }
  12942. if (inputDialogState != 0) {
  12943. inputDialogState = 0;
  12944. inputTaken = true;
  12945. }
  12946. openInterfaceID = i5;
  12947. invOverlayInterfaceID = k12;
  12948. needDrawTabArea = true;
  12949. tabAreaAltered = true;
  12950. aBoolean1149 = false;
  12951. pktType = -1;
  12952. return true;
  12953.  
  12954. case 79:
  12955. int j5 = inStream.method434();
  12956. int l12 = inStream.method435();
  12957. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12958. if (class9_3 != null && class9_3.type == 0) {
  12959. if (l12 < 0)
  12960. l12 = 0;
  12961. if (l12 > class9_3.scrollMax - class9_3.height)
  12962. l12 = class9_3.scrollMax - class9_3.height;
  12963. class9_3.scrollPosition = l12;
  12964. }
  12965. pktType = -1;
  12966. return true;
  12967.  
  12968. case 68:
  12969. for (int k5 = 0; k5 < variousSettings.length; k5++)
  12970. if (variousSettings[k5] != anIntArray1045[k5]) {
  12971. variousSettings[k5] = anIntArray1045[k5];
  12972. method33(k5);
  12973. needDrawTabArea = true;
  12974. }
  12975. pktType = -1;
  12976. return true;
  12977.  
  12978. case 196:
  12979. long l5 = inStream.readQWord();
  12980. int j18 = inStream.readDWord();
  12981. int l21 = inStream.readUnsignedByte();
  12982. boolean flag5 = false;
  12983. if (l21 <= 1) {
  12984. for (int l29 = 0; l29 < ignoreCount; l29++) {
  12985. if (ignoreListAsLongs[l29] != l5)
  12986. continue;
  12987. flag5 = true;
  12988.  
  12989. }
  12990. }
  12991. if (!flag5 && anInt1251 == 0)
  12992. try {
  12993. String s9 = TextInput.method525(pktSize - 13, inStream);
  12994. if (l21 == 1)
  12995. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12996. else if (l21 == 2)
  12997. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12998. else if (l21 == 3)
  12999. pushMessage(s9, 7, "@cr3@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13000. else if (l21 == 4)
  13001. pushMessage(s9, 7, "@cr4@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13002. else if (l21 == 5)
  13003. pushMessage(s9, 7, "@cr5@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13004. else if (l21 == 6)
  13005. pushMessage(s9, 7, "@cr6@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13006. else if (l21 == 7)
  13007. pushMessage(s9, 7, "@cr7@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13008. else if (l21 == 8)
  13009. pushMessage(s9, 7, "@cr8@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13010. else if (l21 == 9)
  13011. pushMessage(s9, 7, "@cr9@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13012. else if (l21 == 10)
  13013. pushMessage(s9, 7, "@cr10@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13014. else if (l21 == 11)
  13015. pushMessage(s9, 7, "@cr11@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13016. else if (l21 == 12)
  13017. pushMessage(s9, 7, "@cr12@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13018. else if (l21 == 13)
  13019. pushMessage(s9, 7, "@cr13@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13020. else if (l21 == 14)
  13021. pushMessage(s9, 7, "@cr14@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13022. else if (l21 == 15)
  13023. pushMessage(s9, 7, "@cr15@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13024. else if (l21 == 16)
  13025. pushMessage(s9, 7, "@cr16@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13026. else if (l21 == 17)
  13027. pushMessage(s9, 7, "@cr17@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13028. else if (l21 == 18)
  13029. pushMessage(s9, 7, "@cr18@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13030. else if (l21 == 19)
  13031. pushMessage(s9, 7, "@cr19@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13032. else if (l21 == 20)
  13033. pushMessage(s9, 7, "@cr20@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13034. else
  13035. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  13036. } catch (Exception exception1) {
  13037. SignLink.reporterror("cde1");
  13038. }
  13039. pktType = -1;
  13040. return true;
  13041.  
  13042. case 85:
  13043. anInt1269 = inStream.method427();
  13044. anInt1268 = inStream.method427();
  13045. pktType = -1;
  13046. return true;
  13047.  
  13048. case 24:
  13049. anInt1054 = inStream.method428();
  13050. if (anInt1054 == tabID) {
  13051. if (anInt1054 == 3)
  13052. tabID = 1;
  13053. else
  13054. tabID = 3;
  13055. needDrawTabArea = true;
  13056. }
  13057. pktType = -1;
  13058. return true;
  13059.  
  13060. case 246:
  13061. int i6 = inStream.method434();
  13062. int i13 = inStream.readUnsignedWord();
  13063. int k18 = inStream.readUnsignedWord();
  13064. if (k18 == 65535) {
  13065. RSInterface.interfaceCache[i6].anInt233 = 0;
  13066. pktType = -1;
  13067. return true;
  13068. } else {
  13069. ItemDef itemDef = ItemDef.forID(k18);
  13070. RSInterface.interfaceCache[i6].anInt233 = 4;
  13071. RSInterface.interfaceCache[i6].mediaID = k18;
  13072. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  13073. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  13074. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100)
  13075. / i13;
  13076. pktType = -1;
  13077. return true;
  13078. }
  13079.  
  13080. case 171:
  13081. boolean flag1 = inStream.readUnsignedByte() == 1;
  13082. int j13 = inStream.readUnsignedWord();
  13083. RSInterface.interfaceCache[j13].interfaceShown = flag1;
  13084. pktType = -1;
  13085. return true;
  13086.  
  13087. case 142:
  13088. int j6 = inStream.method434();
  13089. method60(j6);
  13090. if (backDialogID != -1) {
  13091. backDialogID = -1;
  13092. inputTaken = true;
  13093. }
  13094. if (inputDialogState != 0) {
  13095. inputDialogState = 0;
  13096. inputTaken = true;
  13097. }
  13098. invOverlayInterfaceID = j6;
  13099. needDrawTabArea = true;
  13100. tabAreaAltered = true;
  13101. openInterfaceID = -1;
  13102. aBoolean1149 = false;
  13103. pktType = -1;
  13104. return true;
  13105.  
  13106. case 126:
  13107. try {
  13108. String text = inStream.readString();
  13109. int frame = inStream.method435();
  13110. if (text.startsWith("www.")) {
  13111. launchURL(text);
  13112. pktType = -1;
  13113. return true;
  13114. }
  13115. RSInterface.interfaceCache[frame].message = text;
  13116. if(RSInterface.interfaceCache[frame].parentID == tabInterfaceIDs[tabID] ||frame >= 7562 && frame <= 7586)
  13117. needDrawTabArea = true;
  13118. pktType = -1;
  13119. } catch (Exception e) {
  13120. }
  13121. pktType = -1;
  13122. return true;
  13123.  
  13124. case 206:
  13125. publicChatMode = inStream.readUnsignedByte();
  13126. publicChatMode = inStream.readUnsignedByte();
  13127. tradeMode = inStream.readUnsignedByte();
  13128. aBoolean1233 = true;
  13129. inputTaken = true;
  13130. pktType = -1;
  13131. return true;
  13132.  
  13133. case 240:
  13134. if (tabID == 12)
  13135. needDrawTabArea = true;
  13136. weight = inStream.readSignedWord();
  13137. pktType = -1;
  13138. return true;
  13139.  
  13140. case 8:
  13141. int k6 = inStream.method436();
  13142. int l13 = inStream.readUnsignedWord();
  13143. RSInterface.interfaceCache[k6].anInt233 = 1;
  13144. RSInterface.interfaceCache[k6].mediaID = l13;
  13145. pktType = -1;
  13146. return true;
  13147.  
  13148. case 122:
  13149. int l6 = inStream.method436();
  13150. int i14 = inStream.method436();
  13151. int i19 = i14 >> 10 & 0x1f;
  13152. int i22 = i14 >> 5 & 0x1f;
  13153. int l24 = i14 & 0x1f;
  13154. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  13155. + (i22 << 11) + (l24 << 3);
  13156. pktType = -1;
  13157. return true;
  13158.  
  13159. case 53:
  13160. needDrawTabArea = true;
  13161. int i7 = inStream.readUnsignedWord();
  13162. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  13163. int j19 = inStream.readUnsignedWord();
  13164. for (int j22 = 0; j22 < j19; j22++) {
  13165. int i25 = inStream.readUnsignedByte();
  13166. if (i25 == 255)
  13167. i25 = inStream.method440();
  13168. class9_1.inv[j22] = inStream.method436();
  13169. class9_1.invStackSizes[j22] = i25;
  13170. }
  13171. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  13172. class9_1.inv[j25] = 0;
  13173. class9_1.invStackSizes[j25] = 0;
  13174. }
  13175. pktType = -1;
  13176. return true;
  13177.  
  13178. case 230:
  13179. int j7 = inStream.method435();
  13180. int j14 = inStream.readUnsignedWord();
  13181. int k19 = inStream.readUnsignedWord();
  13182. int k22 = inStream.method436();
  13183. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  13184. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  13185. RSInterface.interfaceCache[j14].modelZoom = j7;
  13186. pktType = -1;
  13187. return true;
  13188.  
  13189. case 221:
  13190. anInt900 = inStream.readUnsignedByte();
  13191. needDrawTabArea = true;
  13192. pktType = -1;
  13193. return true;
  13194.  
  13195. case 177:
  13196. aBoolean1160 = true;
  13197. anInt995 = inStream.readUnsignedByte();
  13198. anInt996 = inStream.readUnsignedByte();
  13199. anInt997 = inStream.readUnsignedWord();
  13200. anInt998 = inStream.readUnsignedByte();
  13201. anInt999 = inStream.readUnsignedByte();
  13202. if (anInt999 >= 100) {
  13203. int k7 = anInt995 * 128 + 64;
  13204. int k14 = anInt996 * 128 + 64;
  13205. int i20 = method42(plane, k14, k7) - anInt997;
  13206. int l22 = k7 - xCameraPos;
  13207. int k25 = i20 - zCameraPos;
  13208. int j28 = k14 - yCameraPos;
  13209. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  13210. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  13211. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  13212. if (yCameraCurve < 128)
  13213. yCameraCurve = 128;
  13214. if (yCameraCurve > 383)
  13215. yCameraCurve = 383;
  13216. }
  13217. pktType = -1;
  13218. return true;
  13219.  
  13220. case 249:
  13221. anInt1046 = inStream.method426();
  13222. unknownInt10 = inStream.method436();
  13223. pktType = -1;
  13224. return true;
  13225.  
  13226. case 65:
  13227. updateNPCs(inStream, pktSize);
  13228. pktType = -1;
  13229. return true;
  13230.  
  13231. case 27:
  13232. messagePromptRaised = false;
  13233. inputDialogState = 1;
  13234. amountOrNameInput = "";
  13235. inputTaken = true;
  13236. pktType = -1;
  13237. return true;
  13238.  
  13239. case 187:
  13240. messagePromptRaised = false;
  13241. inputDialogState = 2;
  13242. amountOrNameInput = "";
  13243. inputTaken = true;
  13244. pktType = -1;
  13245. return true;
  13246.  
  13247. case 97:
  13248. int l7 = inStream.readUnsignedWord();
  13249. method60(l7);
  13250. if (invOverlayInterfaceID != -1) {
  13251. invOverlayInterfaceID = -1;
  13252. needDrawTabArea = true;
  13253. tabAreaAltered = true;
  13254. }
  13255. if (backDialogID != -1) {
  13256. backDialogID = -1;
  13257. inputTaken = true;
  13258. }
  13259. if (inputDialogState != 0) {
  13260. inputDialogState = 0;
  13261. inputTaken = true;
  13262. }
  13263. // 17511 = Question Type
  13264. // 15819 = Christmas Type
  13265. // 15812 = Security Type
  13266. // 15801 = Item Scam Type
  13267. // 15791 = Password Safety ?
  13268. // 15774 = Good/Bad Password
  13269. // 15767 = Drama Type ????
  13270. if (l7 == 15244) {
  13271. openInterfaceID = 15767;
  13272. fullscreenInterfaceID = 15244;
  13273. } else {
  13274. openInterfaceID = l7;
  13275. }
  13276. aBoolean1149 = false;
  13277. pktType = -1;
  13278. return true;
  13279.  
  13280. case 218:
  13281. int i8 = inStream.method438();
  13282. dialogID = i8;
  13283. inputTaken = true;
  13284. pktType = -1;
  13285. return true;
  13286.  
  13287. case 87:
  13288. int j8 = inStream.method434();
  13289. int l14 = inStream.method439();
  13290. anIntArray1045[j8] = l14;
  13291. if (variousSettings[j8] != l14) {
  13292. variousSettings[j8] = l14;
  13293. method33(j8);
  13294. needDrawTabArea = true;
  13295. if (dialogID != -1)
  13296. inputTaken = true;
  13297. }
  13298. pktType = -1;
  13299. return true;
  13300.  
  13301. case 36:
  13302. int k8 = inStream.method434();
  13303. byte byte0 = inStream.readSignedByte();
  13304. anIntArray1045[k8] = byte0;
  13305. if (variousSettings[k8] != byte0) {
  13306. variousSettings[k8] = byte0;
  13307. method33(k8);
  13308. needDrawTabArea = true;
  13309. if (dialogID != -1)
  13310. inputTaken = true;
  13311. }
  13312. pktType = -1;
  13313. return true;
  13314.  
  13315. case 61:
  13316. anInt1055 = inStream.readUnsignedByte();
  13317. pktType = -1;
  13318. return true;
  13319.  
  13320. case 200:
  13321. int l8 = inStream.readUnsignedWord();
  13322. int i15 = inStream.readSignedWord();
  13323. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  13324. class9_4.anInt257 = i15;
  13325. class9_4.modelZoom = 1600;
  13326. if (i15 == 591 || i15 == 588) {
  13327. class9_4.modelZoom = 900; // anInt269
  13328. }
  13329. if (i15 == -1) {
  13330. class9_4.anInt246 = 0;
  13331. class9_4.anInt208 = 0;
  13332. }
  13333. pktType = -1;
  13334. return true;
  13335.  
  13336.  
  13337. case 219:
  13338. if (invOverlayInterfaceID != -1) {
  13339. invOverlayInterfaceID = -1;
  13340. needDrawTabArea = true;
  13341. tabAreaAltered = true;
  13342. }
  13343. if (backDialogID != -1) {
  13344. backDialogID = -1;
  13345. inputTaken = true;
  13346. }
  13347. if (inputDialogState != 0) {
  13348. inputDialogState = 0;
  13349. inputTaken = true;
  13350. }
  13351. openInterfaceID = -1;
  13352. aBoolean1149 = false;
  13353. pktType = -1;
  13354. return true;
  13355.  
  13356. case 34:
  13357. needDrawTabArea = true;
  13358. int i9 = inStream.readUnsignedWord();
  13359. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  13360. while (inStream.currentOffset < pktSize) {
  13361. int j20 = inStream.method422();
  13362. int i23 = inStream.readUnsignedWord();
  13363. int l25 = inStream.readUnsignedByte();
  13364. if (l25 == 255)
  13365. l25 = inStream.readDWord();
  13366. if (j20 >= 0 && j20 < class9_2.inv.length) {
  13367. class9_2.inv[j20] = i23;
  13368. class9_2.invStackSizes[j20] = l25;
  13369. }
  13370. }
  13371. pktType = -1;
  13372. return true;
  13373.  
  13374. case 4:
  13375. case 44:
  13376. case 84:
  13377. case 101:
  13378. case 105:
  13379. case 117:
  13380. case 147:
  13381. case 151:
  13382. case 156:
  13383. case 160:
  13384. case 215:
  13385. method137(inStream, pktType);
  13386. pktType = -1;
  13387. return true;
  13388.  
  13389. case 106:
  13390. tabID = inStream.method427();
  13391. needDrawTabArea = true;
  13392. tabAreaAltered = true;
  13393. pktType = -1;
  13394. return true;
  13395.  
  13396. case 164:
  13397. int j9 = inStream.method434();
  13398. method60(j9);
  13399. if (invOverlayInterfaceID != -1) {
  13400. invOverlayInterfaceID = -1;
  13401. needDrawTabArea = true;
  13402. tabAreaAltered = true;
  13403. }
  13404. backDialogID = j9;
  13405. inputTaken = true;
  13406. openInterfaceID = -1;
  13407. aBoolean1149 = false;
  13408. pktType = -1;
  13409. return true;
  13410.  
  13411. }
  13412. SignLink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  13413. + anInt842 + "," + anInt843);
  13414. resetLogout();
  13415. } catch (IOException _ex) {
  13416. dropClient();
  13417. } catch (Exception exception) {
  13418. exception.printStackTrace();
  13419. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  13420. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  13421. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  13422. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  13423. s2 = s2 + inStream.buffer[j15] + ",";
  13424. SignLink.reporterror(s2);
  13425. resetLogout();
  13426. }
  13427. return true;
  13428. }
  13429.  
  13430. public void method146() {
  13431. anInt1265++;
  13432. method47(true);
  13433. method26(true);
  13434. method47(false);
  13435. method26(false);
  13436. method55();
  13437. method104();
  13438. if (!aBoolean1160) {
  13439. int i = anInt1184;
  13440. if (anInt984 / 256 > i)
  13441. i = anInt984 / 256;
  13442. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  13443. i = anIntArray1203[4] + 128;
  13444. int k = viewRotation + viewRotationOffset & 0x7ff;
  13445. setCameraPos(600 + i * 3, i, anInt1014,
  13446. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  13447. }
  13448. int j;
  13449. if (!aBoolean1160)
  13450. j = method120();
  13451. else
  13452. j = method121();
  13453. int l = xCameraPos;
  13454. int i1 = zCameraPos;
  13455. int j1 = yCameraPos;
  13456. int k1 = yCameraCurve;
  13457. int l1 = xCameraCurve;
  13458. for (int i2 = 0; i2 < 5; i2++)
  13459. if (aBooleanArray876[i2]) {
  13460. int j2 = (int) ((Math.random()
  13461. * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  13462. .sin((double) anIntArray1030[i2]
  13463. * ((double) anIntArray928[i2] / 100D))
  13464. * (double) anIntArray1203[i2]);
  13465. if (i2 == 0)
  13466. xCameraPos += j2;
  13467. if (i2 == 1)
  13468. zCameraPos += j2;
  13469. if (i2 == 2)
  13470. yCameraPos += j2;
  13471. if (i2 == 3)
  13472. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  13473. if (i2 == 4) {
  13474. yCameraCurve += j2;
  13475. if (yCameraCurve < 128)
  13476. yCameraCurve = 128;
  13477. if (yCameraCurve > 383)
  13478. yCameraCurve = 383;
  13479. }
  13480. }
  13481. // int k2 = Rasterizer.textureGetCount;
  13482. Model.objectExists = true;
  13483. Model.objectsRendered = 0;
  13484. Model.currentCursorX = super.mouseX - 4;
  13485. Model.currentCursorY = super.mouseY - 4;
  13486. DrawingArea.setAllPixelsToZero();
  13487. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  13488. zCameraPos, j, yCameraCurve);
  13489. worldController.clearObj5Cache();
  13490. updateEntities();
  13491. drawHeadIcon();
  13492. TextureAnimating.animateTexture();
  13493. draw3dScreen();
  13494. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  13495. xCameraPos = l;
  13496. zCameraPos = i1;
  13497. yCameraPos = j1;
  13498. yCameraCurve = k1;
  13499. xCameraCurve = l1;
  13500. }
  13501.  
  13502. public void clearTopInterfaces() {
  13503. stream.createFrame(130);
  13504. if (invOverlayInterfaceID != -1) {
  13505. invOverlayInterfaceID = -1;
  13506. needDrawTabArea = true;
  13507. aBoolean1149 = false;
  13508. tabAreaAltered = true;
  13509. }
  13510. if (backDialogID != -1) {
  13511. backDialogID = -1;
  13512. inputTaken = true;
  13513. aBoolean1149 = false;
  13514. }
  13515. openInterfaceID = -1;
  13516. fullscreenInterfaceID = -1;
  13517. }
  13518.  
  13519. public Client() {
  13520. xpAddedPos = expAdded = 0;
  13521. expAdded = 0;
  13522. xpLock = false;
  13523. xpCounter = 0;
  13524. counter = new Sprite[3];
  13525. chatRights = new int[500];
  13526. fullscreenInterfaceID = -1;
  13527. chatTypeView = 0;
  13528. clanChatMode = 0;
  13529. cButtonHPos = -1;
  13530. cButtonHCPos = -1;
  13531. cButtonCPos = 0;
  13532. server = Address.SERVER_IP;
  13533. anIntArrayArray825 = new int[104][104];
  13534. friendsNodeIDs = new int[200];
  13535. groundArray = new NodeList[4][104][104];
  13536. aBoolean831 = false;
  13537. aStream_834 = new Stream(new byte[5000]);
  13538. npcArray = new NPC[16384];
  13539. npcIndices = new int[16384];
  13540. anIntArray840 = new int[1000];
  13541. aStream_847 = Stream.create();
  13542. aBoolean848 = true;
  13543. openInterfaceID = -1;
  13544. currentExp = new int[Skills.skillsCount];
  13545. aBoolean872 = false;
  13546. anIntArray873 = new int[5];
  13547. anInt874 = -1;
  13548. aBooleanArray876 = new boolean[5];
  13549. drawFlames = false;
  13550. reportAbuseInput = "";
  13551. unknownInt10 = -1;
  13552. menuOpen = false;
  13553. inputString = "";
  13554. maxPlayers = 2048;
  13555. myPlayerIndex = 2047;
  13556. playerArray = new Player[maxPlayers];
  13557. playerIndices = new int[maxPlayers];
  13558. anIntArray894 = new int[maxPlayers];
  13559. aStreamArray895s = new Stream[maxPlayers];
  13560. anInt897 = 1;
  13561. anIntArrayArray901 = new int[104][104];
  13562. anInt902 = 0x766654;
  13563. aByteArray912 = new byte[16384];
  13564. currentStats = new int[Skills.skillsCount];
  13565. ignoreListAsLongs = new long[100];
  13566. loadingError = false;
  13567. anInt927 = 0x332d25;
  13568. anIntArray928 = new int[5];
  13569. anIntArrayArray929 = new int[104][104];
  13570. chatTypes = new int[500];
  13571. chatNames = new String[500];
  13572. chatMessages = new String[500];
  13573. chatButtons = new Sprite[4];
  13574. sideIcons = new Sprite[15];
  13575. redStones = new Sprite[5];
  13576. aBoolean954 = true;
  13577. friendsListAsLongs = new long[200];
  13578. currentSong = -1;
  13579. drawingFlames = false;
  13580. spriteDrawX = -1;
  13581. spriteDrawY = -1;
  13582. anIntArray968 = new int[33];
  13583. anIntArray969 = new int[256];
  13584. decompressors = new Decompressor[6];
  13585. variousSettings = new int[2000];
  13586. aBoolean972 = false;
  13587. anInt975 = 50;
  13588. anIntArray976 = new int[anInt975];
  13589. anIntArray977 = new int[anInt975];
  13590. anIntArray978 = new int[anInt975];
  13591. anIntArray979 = new int[anInt975];
  13592. anIntArray980 = new int[anInt975];
  13593. anIntArray981 = new int[anInt975];
  13594. anIntArray982 = new int[anInt975];
  13595. aStringArray983 = new String[anInt975];
  13596. anInt985 = -1;
  13597. hitMarks = new Sprite[20];
  13598. hitMark = new Sprite[20];
  13599. hitIcon = new Sprite[20];
  13600. anIntArray990 = new int[5];
  13601. aBoolean994 = false;
  13602. anInt1002 = 0x23201b;
  13603. amountOrNameInput = "";
  13604. aClass19_1013 = new NodeList();
  13605. aBoolean1017 = false;
  13606. anInt1018 = -1;
  13607. anIntArray1030 = new int[5];
  13608. aBoolean1031 = false;
  13609. mapFunctions = new Sprite[100];
  13610. dialogID = -1;
  13611. maxStats = new int[Skills.skillsCount];
  13612. anIntArray1045 = new int[2000];
  13613. aBoolean1047 = true;
  13614. anIntArray1052 = new int[151];
  13615. anInt1054 = -1;
  13616. aClass19_1056 = new NodeList();
  13617. anIntArray1057 = new int[33];
  13618. aClass9_1059 = new RSInterface();
  13619. mapScenes = new Background[100];
  13620. barFillColor = 0x4d4233;
  13621. anIntArray1065 = new int[7];
  13622. anIntArray1072 = new int[1000];
  13623. anIntArray1073 = new int[1000];
  13624. aBoolean1080 = false;
  13625. friendsList = new String[200];
  13626. inStream = Stream.create();
  13627. expectedCRCs = new int[9];
  13628. menuActionCmd2 = new int[500];
  13629. menuActionCmd3 = new int[500];
  13630. menuActionCmd4 = new int[500];
  13631. menuActionIds = new int[500];
  13632. menuActionCmd1 = new int[500];
  13633. headIcons = new Sprite[20];
  13634. skullIcons = new Sprite[20];
  13635. headIconsHint = new Sprite[20];
  13636. tabAreaAltered = false;
  13637. aString1121 = "";
  13638. atPlayerActions = new String[5];
  13639. atPlayerArray = new boolean[5];
  13640. anIntArrayArrayArray1129 = new int[4][13][13];
  13641. anInt1132 = 2;
  13642. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13643. aBoolean1141 = false;
  13644. aBoolean1149 = false;
  13645. crosses = new Sprite[8];
  13646. musicEnabled = true;
  13647. needDrawTabArea = false;
  13648. loggedIn = false;
  13649. canMute = false;
  13650. aBoolean1159 = false;
  13651. aBoolean1160 = false;
  13652. anInt1171 = 1;
  13653. myUsername = "";
  13654. myPassword = "";
  13655. genericLoadingError = false;
  13656. reportAbuseInterfaceID = -1;
  13657. aClass19_1179 = new NodeList();
  13658. anInt1184 = 128;
  13659. invOverlayInterfaceID = -1;
  13660. stream = Stream.create();
  13661. menuActionName = new String[500];
  13662. anIntArray1203 = new int[5];
  13663. sound = new int[50];
  13664. anInt1210 = 2;
  13665. anInt1211 = 78;
  13666. promptInput = "";
  13667. modIcons = new Sprite[12];
  13668. tabID = 3;
  13669. inputTaken = false;
  13670. songChanging = true;
  13671. anIntArray1229 = new int[151];
  13672. aClass11Array1230 = new TileSettings[4];
  13673. aBoolean1233 = false;
  13674. anIntArray1240 = new int[100];
  13675. soundType = new int[50];
  13676. aBoolean1242 = false;
  13677. soundDelay = new int[50];
  13678. soundVolume = new int[50];
  13679. rsAlreadyLoaded = false;
  13680. welcomeScreenRaised = false;
  13681. messagePromptRaised = false;
  13682. loginMessage1 = "";
  13683. loginMessage2 = "";
  13684. backDialogID = -1;
  13685. anInt1279 = 2;
  13686. bigX = new int[4000];
  13687. bigY = new int[4000];
  13688. anInt1289 = -1;
  13689. }
  13690. public String clanUsername;
  13691. public String clanMessage;
  13692. public int[] chatRights;
  13693. public int hoverId;
  13694. public boolean summHover = false;
  13695. public int rights;
  13696. public String name;
  13697. public String message;
  13698. public String clanname;
  13699. public int chatTypeView;
  13700. public int clanChatMode;
  13701. public int duelMode;
  13702.  
  13703. /* Declare custom sprites */
  13704. @SuppressWarnings("unused")
  13705. private static Sprite mapIcon;
  13706. private Sprite chatArea;
  13707. private Sprite[] chatButtons;
  13708. private Background mapBack;
  13709. private Sprite tabArea;
  13710. private Sprite worldMapIcon;
  13711. private Sprite logIconH;
  13712. private Sprite logIconC;
  13713. private Sprite mapArea;
  13714. private Sprite[] ORBS = new Sprite[19];
  13715. /**/
  13716.  
  13717. public RSImageProducer leftFrame;
  13718. public RSImageProducer topFrame;
  13719. public RSImageProducer rightFrame;
  13720. public int ignoreCount;
  13721. public long aLong824;
  13722. public int[][] anIntArrayArray825;
  13723. public int[] friendsNodeIDs;
  13724. public NodeList[][][] groundArray;
  13725. public int[] anIntArray828;
  13726. public int[] anIntArray829;
  13727. public volatile boolean aBoolean831;
  13728. public Socket aSocket832;
  13729. public int loginScreenState;
  13730. public Stream aStream_834;
  13731. public NPC[] npcArray;
  13732. public int npcCount;
  13733. public int[] npcIndices;
  13734. public int anInt839;
  13735. public int[] anIntArray840;
  13736. public int anInt841;
  13737. public int anInt842;
  13738. public int anInt843;
  13739. public String aString844;
  13740. public Stream aStream_847;
  13741. public boolean aBoolean848;
  13742. public static int anInt849;
  13743. public int[] anIntArray850;
  13744. public int[] anIntArray851;
  13745. public int[] anIntArray852;
  13746. public int[] anIntArray853;
  13747. public static int anInt854;
  13748. public int anInt855;
  13749. public static int openInterfaceID;
  13750. public int xCameraPos;
  13751. public int zCameraPos;
  13752. public int yCameraPos;
  13753. public int yCameraCurve;
  13754. public int xCameraCurve;
  13755. public int myPrivilege;
  13756. public final int[] currentExp;
  13757. public Sprite[] redStones;
  13758. public Sprite mapFlag;
  13759. public Sprite mapMarker;
  13760. public boolean aBoolean872;
  13761. public final int[] anIntArray873;
  13762. public int anInt874;
  13763. public final boolean[] aBooleanArray876;
  13764. public int weight;
  13765. public MouseDetection mouseDetection;
  13766. public volatile boolean drawFlames;
  13767. public String reportAbuseInput;
  13768. public int unknownInt10;
  13769. public boolean menuOpen;
  13770. public int anInt886;
  13771. public String inputString;
  13772. public final int maxPlayers;
  13773. public final int myPlayerIndex;
  13774. public Player[] playerArray;
  13775. public int playerCount;
  13776. public int[] playerIndices;
  13777. public int anInt893;
  13778. public int[] anIntArray894;
  13779. public Stream[] aStreamArray895s;
  13780. public int viewRotationOffset;
  13781. public int anInt897;
  13782. public int friendsCount;
  13783. public int anInt900;
  13784. public int[][] anIntArrayArray901;
  13785. public final int anInt902;
  13786. public byte[] aByteArray912;
  13787. public int anInt913;
  13788. public int crossX;
  13789. public int crossY;
  13790. public int crossIndex;
  13791. public int crossType;
  13792. public int plane;
  13793. public final int[] currentStats;
  13794. public static int anInt924;
  13795. public final long[] ignoreListAsLongs;
  13796. public boolean loadingError;
  13797. public final int anInt927;
  13798. public final int[] anIntArray928;
  13799. public int[][] anIntArrayArray929;
  13800. public Sprite aClass30_Sub2_Sub1_Sub1_931;
  13801. public Sprite aClass30_Sub2_Sub1_Sub1_932;
  13802. public int anInt933;
  13803. public int anInt934;
  13804. public int anInt935;
  13805. public int anInt936;
  13806. public int anInt937;
  13807. public int anInt938;
  13808. public static int anInt940;
  13809. public int[] chatTypes;
  13810. public String[] chatNames;
  13811. public String[] chatMessages;
  13812. public int anInt945;
  13813. public WorldController worldController;
  13814. public Sprite[] sideIcons;
  13815. public Sprite[] customSideIcons = new Sprite[] {new Sprite("SideIcon 1"), new Sprite("SideIcon 2"), new Sprite("SideIcon 3")};
  13816. public int menuScreenArea;
  13817. public int menuOffsetX;
  13818. public int menuOffsetY;
  13819. public int menuWidth;
  13820. public int menuHeight;
  13821. public long aLong953;
  13822. public boolean aBoolean954;
  13823.  
  13824. public String[] clanList = new String[100];
  13825. public long[] friendsListAsLongs;
  13826. public int currentSong;
  13827. public static int nodeID = 10;
  13828. public static int portOff;
  13829. static boolean clientData;
  13830. public static boolean isMembers = true;
  13831. public static boolean lowMem;
  13832. public volatile boolean drawingFlames;
  13833. public int spriteDrawX;
  13834. public int spriteDrawY;
  13835. public final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  13836. 0xff00ff, 0xffffff };
  13837. public Sprite LoginBox;
  13838. public Sprite LoginButton;
  13839. public Sprite LoginButtonHover;
  13840. public Sprite TypeIn;
  13841. public Sprite TypeInHover;
  13842. public Sprite RememberNo;
  13843. public Sprite RememberYes;
  13844. public Sprite Logo;
  13845. public Sprite Bg;
  13846. public boolean FadingBackgrounds = true;
  13847. public Sprite BackgroundFix;
  13848. public final int[] anIntArray968;
  13849. public final int[] anIntArray969;
  13850. public final Decompressor[] decompressors;
  13851. public int variousSettings[];
  13852. public boolean aBoolean972;
  13853. public final int anInt975;
  13854. public final int[] anIntArray976;
  13855. public final int[] anIntArray977;
  13856. public final int[] anIntArray978;
  13857. public final int[] anIntArray979;
  13858. public final int[] anIntArray980;
  13859. public final int[] anIntArray981;
  13860. public final int[] anIntArray982;
  13861. public final String[] aStringArray983;
  13862. public int anInt984;
  13863. public int anInt985;
  13864. public static int anInt986;
  13865. public Sprite[] hitMarks;
  13866. private Sprite[] hitMark;
  13867. private Sprite[] hitIcon;
  13868. private Sprite HPBarFull, HPBarEmpty;
  13869.  
  13870. public int anInt988;
  13871. public int anInt989;
  13872. public final int[] anIntArray990;
  13873. public static boolean aBoolean993;
  13874. public final boolean aBoolean994;
  13875. public int anInt995;
  13876. public int anInt996;
  13877. public int anInt997;
  13878. public int anInt998;
  13879. public int anInt999;
  13880. public ISAACRandomGen encryption;
  13881. public Sprite mapEdge;
  13882.  
  13883. public final int anInt1002;
  13884. public static final int[][] anIntArrayArray1003 = {
  13885. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  13886. 54193 },
  13887. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13888. 56621, 4783, 1341, 16578, 35003, 25239 },
  13889. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13890. 10153, 56621, 4783, 1341, 16578, 35003 },
  13891. { 4626, 11146, 6439, 12, 4758, 10270 },
  13892. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  13893.  
  13894. public Sprite multiOverlay;
  13895. public String amountOrNameInput;
  13896. public static int anInt1005;
  13897. public int daysSinceLastLogin;
  13898. public int pktSize;
  13899. public int pktType;
  13900. public int anInt1009;
  13901. public int anInt1010;
  13902. public int anInt1011;
  13903. public NodeList aClass19_1013;
  13904. public int anInt1014;
  13905. public int anInt1015;
  13906. public int anInt1016;
  13907. public int bgId = 0, waitTicker = 0, bgFinal = 0;
  13908. public boolean bgBoolean;
  13909. public boolean aBoolean1017;
  13910. public static int anInt1018;
  13911. public static final int[] anIntArray1019;
  13912. public int anInt1021;
  13913. public int anInt1022;
  13914. public int loadingStage;
  13915. public Sprite scrollBar1;
  13916. public Sprite scrollBar2;
  13917. public int anInt1026;
  13918.  
  13919. public Background backBase1;
  13920.  
  13921. public Background backBase2;
  13922.  
  13923. public Background backHmid1;
  13924. public final int[] anIntArray1030;
  13925. public boolean aBoolean1031;
  13926. public static Sprite[] mapFunctions;
  13927. public static int baseX;
  13928. public static int baseY;
  13929. public int anInt1036;
  13930. public int anInt1037;
  13931. public int loginFailures;
  13932. public int anInt1039;
  13933. public int anInt1040;
  13934. public int anInt1041;
  13935. public int dialogID;
  13936. public final int[] maxStats;
  13937. public final int[] anIntArray1045;
  13938. public int anInt1046;
  13939. public boolean aBoolean1047;
  13940. public TextDrawingArea smallText;
  13941. private TextDrawingArea smallHit;
  13942. private TextDrawingArea bigHit;
  13943. public TextDrawingArea aTextDrawingArea_1271;
  13944. public TextDrawingArea chatTextDrawingArea;
  13945. public TextDrawingArea aTextDrawingArea_1273;
  13946. public RSFont newSmallFont;
  13947. public RSFont newRegularFont;
  13948. public RSFont newBoldFont;
  13949. public RSFont newFancyFont;
  13950. public int anInt1048;
  13951. public String aString1049;
  13952. public static int anInt1051;
  13953. public final int[] anIntArray1052;
  13954. public StreamLoader titleStreamLoader;
  13955. public int anInt1054;
  13956. public int anInt1055;
  13957. public NodeList aClass19_1056;
  13958. public final int[] anIntArray1057;
  13959. public final RSInterface aClass9_1059;
  13960. public Background[] mapScenes;
  13961. public static int anInt1061;
  13962. public int currentSound;
  13963. public final int barFillColor;
  13964. public int friendsListAction;
  13965. public final int[] anIntArray1065;
  13966. public int mouseInvInterfaceIndex;
  13967. public int lastActiveInvInterface;
  13968. public OnDemandFetcher onDemandFetcher;
  13969. public int anInt1069;
  13970. public int anInt1070;
  13971. public int anInt1071;
  13972. public int[] anIntArray1072;
  13973. public int[] anIntArray1073;
  13974. public Sprite mapDotItem;
  13975. public Sprite mapDotNPC;
  13976. public Sprite mapDotPlayer;
  13977. public Sprite mapDotFriend;
  13978.  
  13979. public Sprite mapDotTeam;
  13980.  
  13981. public Sprite mapDotClan;
  13982. public int anInt1079;
  13983. public boolean aBoolean1080;
  13984. public String[] friendsList;
  13985. public Stream inStream;
  13986. public int anInt1084;
  13987. public int anInt1085;
  13988. public int activeInterfaceType;
  13989. public int anInt1087;
  13990. public int anInt1088;
  13991. public static int anInt1089;
  13992. public final int[] expectedCRCs;
  13993. public int[] menuActionCmd2;
  13994. public int[] menuActionCmd3;
  13995. public int[] menuActionIds;
  13996. public int[] menuActionCmd1;
  13997. public Sprite[] headIcons;
  13998. public Sprite[] skullIcons;
  13999. public Sprite[] headIconsHint;
  14000. public static int anInt1097;
  14001. public int anInt1098;
  14002. public int anInt1099;
  14003. public int anInt1100;
  14004. public int anInt1101;
  14005. public int anInt1102;
  14006. public static boolean tabAreaAltered;
  14007. public int anInt1104;
  14008. public RSImageProducer aRSImageProducer_1107;
  14009. public RSImageProducer aRSImageProducer_1108;
  14010. public RSImageProducer aRSImageProducer_1109;
  14011. public RSImageProducer aRSImageProducer_1110;
  14012. public RSImageProducer aRSImageProducer_1111;
  14013. public RSImageProducer aRSImageProducer_1112;
  14014. public RSImageProducer aRSImageProducer_1113;
  14015. public RSImageProducer aRSImageProducer_1114;
  14016. public RSImageProducer aRSImageProducer_1115;
  14017. public static int anInt1117;
  14018. public int membersInt;
  14019. public String aString1121;
  14020. public Sprite compass;
  14021.  
  14022. public RSImageProducer aRSImageProducer_1123;
  14023.  
  14024. public RSImageProducer aRSImageProducer_1124;
  14025. public RSImageProducer aRSImageProducer_1125;
  14026. public static Player myPlayer;
  14027. public final String[] atPlayerActions;
  14028. public final boolean[] atPlayerArray;
  14029. public final int[][][] anIntArrayArrayArray1129;
  14030. public static final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1,
  14031. -1, -1, -1, -1, -1, -1, -1, -1 };
  14032. public int cameraOffsetY;
  14033.  
  14034. public int anInt1132;
  14035. public int menuActionRow;
  14036. public static int anInt1134;
  14037. public int spellSelected;
  14038. public int anInt1137;
  14039. public int spellUsableOn;
  14040. public String spellTooltip;
  14041. public Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  14042. public boolean aBoolean1141;
  14043. public static int anInt1142;
  14044. public int energy;
  14045. public boolean aBoolean1149;
  14046. public Sprite[] crosses;
  14047. public boolean musicEnabled;
  14048. public Background[] aBackgroundArray1152s;
  14049. public static boolean needDrawTabArea;
  14050. public int unreadMessages;
  14051. public static int anInt1155;
  14052. public static boolean fpsOn;
  14053. public boolean loggedIn;
  14054. public boolean canMute;
  14055. public boolean aBoolean1159;
  14056. public boolean aBoolean1160;
  14057. public static int loopCycle;
  14058. public static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  14059. public RSImageProducer aRSImageProducer_1163;
  14060. public RSImageProducer mapEdgeIP;
  14061. public RSImageProducer aRSImageProducer_1164;
  14062. public RSImageProducer aRSImageProducer_1165;
  14063. public RSImageProducer aRSImageProducer_1166;
  14064. public int daysSinceRecovChange;
  14065. public RSSocket socketStream;
  14066.  
  14067. public int anInt1169;
  14068. public static int minimapZoom;
  14069.  
  14070. public int anInt1171;
  14071. public long aLong1172;
  14072. public static String myUsername;
  14073. public static String myPassword;
  14074. public static int anInt1175;
  14075. public boolean genericLoadingError;
  14076. public final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  14077. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  14078. public int reportAbuseInterfaceID;
  14079. public NodeList aClass19_1179;
  14080. public int[] anIntArray1180;
  14081. public int[] anIntArray1181;
  14082. public int[] anIntArray1182;
  14083. public byte[][] aByteArrayArray1183;
  14084. public int anInt1184;
  14085. public static int viewRotation;
  14086. public int anInt1186;
  14087. public int anInt1187;
  14088. public static int anInt1188;
  14089. public int invOverlayInterfaceID;
  14090. public int[] anIntArray1190;
  14091. public int[] anIntArray1191;
  14092. public Stream stream;
  14093. public int anInt1193;
  14094. public int splitpublicChat;
  14095.  
  14096. public String[] menuActionName;
  14097. public Sprite aClass30_Sub2_Sub1_Sub1_1201;
  14098. public Sprite aClass30_Sub2_Sub1_Sub1_1202;
  14099. public final int[] anIntArray1203;
  14100. public static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  14101. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  14102. public static boolean flagged;
  14103. public final int[] sound;
  14104. public int anInt1208;
  14105. public static int minimapRotation;
  14106. public int anInt1210;
  14107. public static int anInt1211;
  14108. public String promptInput;
  14109. public int anInt1213;
  14110. public int[][][] intGroundArray;
  14111. public long aLong1215;
  14112. public int loginScreenCursorPos;
  14113. public final Sprite[] modIcons;
  14114. public long aLong1220;
  14115. public static int tabID;
  14116. public int anInt1222;
  14117. public static boolean inputTaken;
  14118. public int inputDialogState;
  14119. public static int anInt1226;
  14120. public int nextSong;
  14121. public boolean songChanging;
  14122. public final int[] anIntArray1229;
  14123. public TileSettings[] aClass11Array1230;
  14124. public static int anIntArray1232[];
  14125. public boolean aBoolean1233;
  14126. public int[] anIntArray1234;
  14127. public int[] anIntArray1235;
  14128. public int[] anIntArray1236;
  14129. public int anInt1237;
  14130. public int anInt1238;
  14131. public final int anInt1239 = 100;
  14132.  
  14133. public final int[] anIntArray1240;
  14134. public final int[] soundType;
  14135. public boolean aBoolean1242;
  14136. public int atInventoryLoopCycle;
  14137. public int atInventoryInterface;
  14138. public int atInventoryIndex;
  14139. public int atInventoryInterfaceType;
  14140. public byte[][] aByteArrayArray1247;
  14141. public int tradeMode;
  14142. public int anInt1249;
  14143. public final int[] soundDelay;
  14144. public final int[] soundVolume;
  14145. public int anInt1251;
  14146. public final boolean rsAlreadyLoaded;
  14147. public int anInt1253;
  14148. public int anInt1254;
  14149. public boolean welcomeScreenRaised;
  14150. public boolean messagePromptRaised;
  14151. public int anInt1257;
  14152. public byte[][][] byteGroundArray;
  14153. public int prevSong;
  14154. public int destX;
  14155. public int destY;
  14156. public Sprite aClass30_Sub2_Sub1_Sub1_1263;
  14157. public int anInt1264;
  14158. public int anInt1265;
  14159. public String loginMessage1;
  14160. public String loginMessage2;
  14161. public int anInt1268;
  14162. public int anInt1269;
  14163. public int anInt1275;
  14164. public int backDialogID;
  14165. public int cameraOffsetX;
  14166. public int anInt1279;
  14167. public int[] bigX;
  14168. public int[] bigY;
  14169. public int itemSelected;
  14170. public int anInt1283;
  14171. public int anInt1284;
  14172. public int anInt1285;
  14173. public String selectedItemName;
  14174. public int publicChatMode;
  14175. public static int anInt1288;
  14176. public int anInt1289;
  14177. public static int anInt1290;
  14178. public static String server = "localhost";
  14179. public static int dataVersion = 602;
  14180. public static boolean disableUnderlayTexture = false;
  14181. public static boolean disableOverlayTexture = false;
  14182.  
  14183. public int drawCount;
  14184. public int fullscreenInterfaceID;
  14185. public int anInt1044;// 377
  14186. public int anInt1129;// 377
  14187. public int anInt1315;// 377
  14188. public int anInt1500;// 377
  14189. public int anInt1501;// 377
  14190. public int[] fullScreenTextureArray;
  14191.  
  14192. public void resetAllImageProducers() {
  14193. if (super.fullGameScreen != null) {
  14194. return;
  14195. }
  14196. aRSImageProducer_1166 = null;
  14197. aRSImageProducer_1164 = null;
  14198. aRSImageProducer_1163 = null;
  14199. aRSImageProducer_1165 = null;
  14200. aRSImageProducer_1123 = null;
  14201. aRSImageProducer_1124 = null;
  14202. aRSImageProducer_1125 = null;
  14203. aRSImageProducer_1107 = null;
  14204. aRSImageProducer_1108 = null;
  14205. aRSImageProducer_1109 = null;
  14206. aRSImageProducer_1110 = null;
  14207. aRSImageProducer_1111 = null;
  14208. aRSImageProducer_1112 = null;
  14209. aRSImageProducer_1113 = null;
  14210. aRSImageProducer_1114 = null;
  14211. aRSImageProducer_1115 = null;
  14212. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  14213. welcomeScreenRaised = true;
  14214. }
  14215.  
  14216. @SuppressWarnings({ "unchecked", "rawtypes" })
  14217. public void launchURL(String url) {
  14218. String osName = System.getProperty("os.name");
  14219. try {
  14220. if (osName.startsWith("Mac OS")) {
  14221. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  14222. Method openURL = fileMgr.getDeclaredMethod("openURL",
  14223. new Class[] { String.class });
  14224. openURL.invoke(null, new Object[] { url });
  14225. } else if (osName.startsWith("Windows"))
  14226. Runtime.getRuntime().exec(
  14227. "rundll32 url.dll,FileProtocolHandler " + url);
  14228. else { // assume Unix or Linux
  14229. String[] browsers = { "firefox", "opera", "konqueror",
  14230. "epiphany", "mozilla", "netscape", "safari" };
  14231. String browser = null;
  14232. for (int count = 0; count < browsers.length && browser == null; count++)
  14233. if (Runtime.getRuntime()
  14234. .exec(new String[] { "which", browsers[count] })
  14235. .waitFor() == 0)
  14236. browser = browsers[count];
  14237. if (browser == null) {
  14238. throw new Exception("Could not find web browser");
  14239. } else
  14240. Runtime.getRuntime().exec(new String[] { browser, url });
  14241. }
  14242. } catch (Exception e) {
  14243. pushMessage("Failed to open URL.", 0, "");
  14244. }
  14245. }
  14246.  
  14247. static {
  14248. anIntArray1019 = new int[120];
  14249. int i = 0;
  14250. for (int j = 0; j < 120; j++) {
  14251. int l = j + 1;
  14252. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  14253. i += i1;
  14254. anIntArray1019[j] = i / 4;
  14255. }
  14256. anIntArray1232 = new int[32];
  14257. i = 2;
  14258. for (int k = 0; k < 32; k++) {
  14259. anIntArray1232[k] = i - 1;
  14260. i += i;
  14261. }
  14262. }
  14263. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement