Advertisement
Guest User

Client.java

a guest
Mar 29th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 482.23 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.math.BigInteger;
  9. import java.net.*;
  10. import java.util.zip.CRC32;
  11. import java.util.zip.*;
  12. import java.lang.reflect.Method;
  13. import sign.signlink;
  14. import javax.swing.*;
  15.  
  16. public class client extends RSApplet {
  17. public Sprite magicAuto;
  18. public boolean Autocast = false;
  19. public int autocastId = 0;
  20. public boolean
  21. is459 = false,
  22. is474 = false,
  23. is480 = false,
  24. is508 = false,
  25. is525 = false,
  26. is562 = true,
  27. idToggle = false,
  28. hitbarToggle = true,
  29. menuToggle = true,
  30. namesToggle = false,
  31. hitmarks = true;
  32. public static boolean
  33. newDamage = true,
  34. normalLogin = true;//KEEP TRUE!
  35.  
  36. public TextDrawingArea newSmallFont;
  37. public TextDrawingArea newRegularFont;
  38. public TextDrawingArea newBoldFont;
  39. public TextDrawingArea newFancyFont;
  40. public Sprite[] chatImages = new Sprite[7];
  41. public AlertHandler alertHandler;
  42. public Sprite alertBack;
  43. public Sprite alertBorder;
  44. public Sprite alertBorderH;
  45.  
  46. private Sprite LFull;
  47. private Sprite LEmpty;
  48. public int followPlayer = 0;
  49. public int followNPC = 0;
  50. public int followDistance = 1;
  51. public boolean selectAction;
  52. public int isClicked;
  53. public Sprite[] LOGIN = new Sprite[27];
  54. public Sprite[] combatIcons = new Sprite[4];
  55. public Sprite qc;
  56.  
  57. public void welcome() {
  58. }
  59.  
  60. public void addLoginScreenHover(Sprite[] spriteName,int spriteId, int Xpos, int Ypos, int hoverId){
  61. spriteName[spriteId].drawSprite(Xpos, Ypos);
  62. if(super.mouseX >= Xpos && super.mouseX <= Xpos + spriteName[spriteId].myWidth && super.mouseY >= Ypos+3 && super.mouseY <= Ypos+spriteName[spriteId].myHeight+2){
  63. spriteName[hoverId].drawSprite(Xpos, Ypos);
  64. }
  65. }
  66.  
  67. public void setSidebarInterface(int sidebarID, int interfaceID) {
  68. tabInterfaceIDs[sidebarID] = interfaceID;
  69. tabID = sidebarID;
  70. needDrawTabArea = true;
  71. tabAreaAltered = true;
  72. }
  73.  
  74. public int positions[] = new int[2000];
  75. public int landScapes[] = new int[2000];
  76. public int objects[] = new int[2000];
  77.  
  78. public void setNewMaps() {
  79. try {
  80. BufferedReader in = new BufferedReader(new FileReader("mapConfig.txt"));
  81.  
  82. String s;
  83. int D = 0;
  84. while ((s = in.readLine()) != null) {
  85. positions[D] = Integer.parseInt(s.substring(s.indexOf("=")+1,s.indexOf("(")));
  86. landScapes[D] = Integer.parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")));
  87. objects[D] = Integer.parseInt(s.substring(s.indexOf("[")+1,s.indexOf("]")));
  88. D++;
  89. }
  90. } catch (IOException e) {
  91. e.printStackTrace();
  92. }
  93. }
  94.  
  95. public static String capitalize(String s) {
  96. for (int i = 0; i < s.length(); i++) {
  97. if (i == 0) {
  98. s = String.format( "%s%s",
  99. Character.toUpperCase(s.charAt(0)),
  100. s.substring(1) );
  101. }
  102. if (!Character.isLetterOrDigit(s.charAt(i))) {
  103. if (i + 1 < s.length()) {
  104. s = String.format( "%s%s%s",
  105. s.subSequence(0, i+1),
  106. Character.toUpperCase(s.charAt(i + 1)),
  107. s.substring(i+2) );
  108. }
  109. }
  110. }
  111. return s;
  112. }
  113.  
  114. public int MapX, MapY;
  115. public static int spellID = 0;
  116. private static String intToKOrMilLongName(int i) {
  117. String s = String.valueOf(i);
  118. for(int k = s.length() - 3; k > 0; k -= 3)
  119. s = s.substring(0, k) + "," + s.substring(k);
  120. //if(j != 0)
  121. // aBoolean1224 = !aBoolean1224;
  122. if(s.length() > 8)
  123. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  124. else
  125. if(s.length() > 4)
  126. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  127. return " " + s;
  128. }
  129. public final String methodR(/*int i,*/ int j) {
  130. //if(i <= 0)
  131. // pktType = inStream.readUnsignedByte();
  132. if(j >= 0 && j < 10000)
  133. return String.valueOf(j);
  134. if(j >= 10000 && j < 10000000)
  135. return j / 1000 + "K";
  136. if(j >= 10000000 && j < 999999999)
  137. return j / 1000000 + "M";
  138. if(j >= 999999999)
  139. return "*";
  140. else
  141. return "?";
  142. }
  143.  
  144. public void models() {
  145. for(int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  146. byte[] abyte0 = getModel(ModelIndex);
  147. if(abyte0 != null && abyte0.length > 0) {
  148.  
  149. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  150. pushMessage("Model added successfully!", 0, "");
  151. }
  152. }
  153. }
  154. public byte[] getModel(int Index) {
  155. try {
  156. File Model = new File(signlink.findcachedir() + "/Raw/"+Index+".dat");//there we go.
  157. byte[] aByte = new byte[(int)Model.length()];
  158. FileInputStream fis = new FileInputStream(Model);
  159. fis.read(aByte);
  160. pushMessage("aByte = ["+aByte+"]!", 0, "");
  161. fis.close();
  162.  
  163. return aByte;
  164. }
  165. catch(Exception e)
  166. {return null;}
  167. }
  168.  
  169. private void stopMidi() {
  170. signlink.midifade = 0;
  171. signlink.midi = "stop";
  172. }
  173.  
  174. private boolean menuHasAddFriend(int j) {
  175. if(j < 0)
  176. return false;
  177. int k = menuActionID[j];
  178. if(k >= 2000)
  179. k -= 2000;
  180. return k == 337;
  181. }
  182.  
  183. public void drawChannelButtons() {
  184. if(is459) {
  185. aTextDrawingArea_1271.method389(true, 25, 0xffffff, "Public chat", 142);
  186. aTextDrawingArea_1271.method389(true, 150, 0xffffff, "Private chat", 142);
  187. aTextDrawingArea_1271.method389(true, 285, 0xffffff, "Trade/compete", 142);
  188. aTextDrawingArea_1271.method389(true, 422, 0xffffff, "Report Abuse", 147);
  189. if(publicChatMode == 0)
  190. aTextDrawingArea_1271.method382(65280, 55, "On", 153, true);
  191. if(publicChatMode == 1)
  192. aTextDrawingArea_1271.method382(0xffff00, 55, "Friends", 153, true);
  193. if(publicChatMode == 2)
  194. aTextDrawingArea_1271.method382(0xff0000, 55, "Off", 153, true);
  195. if(publicChatMode == 3)
  196. aTextDrawingArea_1271.method382(65535, 55, "Hide", 153, true);
  197. if(privateChatMode == 0)
  198. aTextDrawingArea_1271.method382(65280, 180, "On", 153, true);
  199. if(privateChatMode == 1)
  200. aTextDrawingArea_1271.method382(0xffff00, 180, "Friends", 153, true);
  201. if(privateChatMode == 2)
  202. aTextDrawingArea_1271.method382(0xff0000, 180, "Off", 153, true);
  203. if(tradeMode == 0)
  204. aTextDrawingArea_1271.method382(65280, 324, "On", 153, true);
  205. if(tradeMode == 1)
  206. aTextDrawingArea_1271.method382(0xffff00, 324, "Friends", 153, true);
  207. if(tradeMode == 2)
  208. aTextDrawingArea_1271.method382(0xff0000, 324, "Off", 153, true);
  209. } else if(is480 || is508 || is525 || is562) {
  210. String text[] = { "On", "Friends", "Off", "Hide" };
  211. int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  212. switch(cButtonCPos) {
  213. case 0: chatButtons[1].drawSprite(5, 142); break;
  214. case 1: chatButtons[1].drawSprite(62, 142); break;
  215. case 2: chatButtons[1].drawSprite(119, 142); break;
  216. case 3: chatButtons[1].drawSprite(176, 142); break;
  217. case 4: chatButtons[1].drawSprite(233, 142); break;
  218. case 5: chatButtons[1].drawSprite(290, 142); break;
  219. case 6: chatButtons[1].drawSprite(347, 142); break;
  220. } if(cButtonHPos == cButtonCPos) {
  221. switch(cButtonHPos) {
  222. case 0: chatButtons[2].drawSprite(5, 142); break;
  223. case 1: chatButtons[2].drawSprite(62, 142); break;
  224. case 2: chatButtons[2].drawSprite(119, 142); break;
  225. case 3: chatButtons[2].drawSprite(176, 142); break;
  226. case 4: chatButtons[2].drawSprite(233, 142); break;
  227. case 5: chatButtons[2].drawSprite(290, 142); break;
  228. case 7: chatButtons[2].drawSprite(347, 142); break;
  229. case 6: chatButtons[3].drawSprite(404, 142); break;
  230. }
  231. } else {
  232. switch(cButtonHPos) {
  233. case 0: chatButtons[2].drawSprite(5, 142); break;
  234. case 1: chatButtons[2].drawSprite(62, 142); break;
  235. case 2: chatButtons[2].drawSprite(119, 142); break;
  236. case 3: chatButtons[2].drawSprite(176, 142); break;
  237. case 4: chatButtons[2].drawSprite(233, 142); break;
  238. case 5: chatButtons[2].drawSprite(290, 142); break;
  239. case 7: chatButtons[2].drawSprite(347, 142); break;
  240. case 6: chatButtons[3].drawSprite(404, 142); break;
  241. }
  242. }
  243. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  244. smallText.method389(true, 26, 0xffffff, "All", 157);
  245. smallText.method389(true, 76, 0xffffff, "Game", 157);
  246. smallText.method389(true, 131, 0xffffff, "Public", 153);
  247. smallText.method389(true, 184, 0xffffff, "Private", 153);
  248. smallText.method389(true, 249, 0xffffff, "Clan", 153);
  249. smallText.method389(true, 304, 0xffffff, "Trade", 153);
  250. smallText.method389(true, 359, 0xffffff, "Assist", 153);
  251.  
  252. smallText.method382(disabledColor[publicChatMode], 147, text[publicChatMode], 164, true);
  253. smallText.method382(disabledColor[privateChatMode], 203, text[privateChatMode], 164, true);
  254. smallText.method382(disabledColor[clanChatMode], 261, text[clanChatMode], 164, true);
  255. smallText.method382(disabledColor[tradeMode], 318, text[tradeMode], 164, true);
  256. smallText.method382(0xff0000, 374, "Off", 164, true);
  257. } else if(is474) {
  258. String text[] = { "On", "Friends", "Off", "Hide" };
  259. int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  260. switch(cButtonCPos) {
  261. case 0: chatButtons[1].drawSprite(5, 142); break;
  262. case 1: chatButtons[1].drawSprite(71, 142); break;
  263. case 2: chatButtons[1].drawSprite(137, 142); break;
  264. case 3: chatButtons[1].drawSprite(203, 142); break;
  265. case 4: chatButtons[1].drawSprite(269, 142); break;
  266. case 5: chatButtons[1].drawSprite(335, 142); break;
  267. } if(cButtonHPos == cButtonCPos) {
  268. switch(cButtonHPos) {
  269. case 0: chatButtons[2].drawSprite(5, 142); break;
  270. case 1: chatButtons[2].drawSprite(71, 142); break;
  271. case 2: chatButtons[2].drawSprite(137, 142); break;
  272. case 3: chatButtons[2].drawSprite(203, 142); break;
  273. case 4: chatButtons[2].drawSprite(269, 142); break;
  274. case 5: chatButtons[2].drawSprite(335, 142); break;
  275. case 6: chatButtons[3].drawSprite(404, 142); break;
  276. }
  277. } else {
  278. switch(cButtonHPos) {
  279. case 0: chatButtons[0].drawSprite(5, 142); break;
  280. case 1: chatButtons[0].drawSprite(71, 142); break;
  281. case 2: chatButtons[0].drawSprite(137, 142); break;
  282. case 3: chatButtons[0].drawSprite(203, 142); break;
  283. case 4: chatButtons[0].drawSprite(269, 142); break;
  284. case 5: chatButtons[0].drawSprite(335, 142); break;
  285. case 6: chatButtons[3].drawSprite(404, 142); break;
  286. }
  287. }
  288. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  289. smallText.method389(true, 26, 0xffffff, "All", 157);
  290. smallText.method389(true, 86, 0xffffff, "Game", 157);
  291. smallText.method389(true, 150, 0xffffff, "Public", 152);
  292. smallText.method389(true, 212, 0xffffff, "Private", 152);
  293. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  294. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  295. smallText.method382(disabledColor[publicChatMode], 164, text[publicChatMode], 163, true);
  296. smallText.method382(disabledColor[privateChatMode], 230, text[privateChatMode], 163, true);
  297. smallText.method382(disabledColor[clanChatMode], 296, text[clanChatMode], 163, true);
  298. smallText.method382(disabledColor[tradeMode], 362, text[tradeMode], 163, true);
  299. }
  300. if(menuOpen){
  301. drawMenu(0, 338);
  302. }
  303. }
  304.  
  305. private void drawChatArea() {
  306. chatBackImage.initDrawingArea();
  307. Texture.anIntArray1472 = anIntArray1180;
  308. chatArea[getSpriteID()].drawSprite(0, 0);
  309. if(spriteChanged){
  310. aBoolean1233 = true;
  311. inputTaken = true;
  312. }
  313. if(is459) {
  314. RSFont textDrawingArea = aTextDrawingArea_1271;
  315. if(messagePromptRaised) {
  316. newBoldFont.drawCenteredString(aString1121, 239, 60, 0, -1);
  317. newBoldFont.drawCenteredString( promptInput + "*", 239, 80, 128, -1);
  318. } else if(inputDialogState == 1) {
  319. newBoldFont.drawCenteredString("Enter amount:", 239, 60, 0, -1);
  320. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  321. } else if(inputDialogState == 2) {
  322. newBoldFont.drawCenteredString("Enter name:", 239, 60, 0, -1);
  323. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  324. } else if(aString844 != null) {
  325. newBoldFont.drawCenteredString(aString844, 239, 60, 0, -1);
  326. newBoldFont.drawCenteredString("Click to continue", 239, 80, 128, -1);
  327. } else if(backDialogID != -1) {
  328. drawInterface(0, 16, RSInterface.interfaceCache[backDialogID], 20);
  329. } else if(dialogID != -1) {
  330. drawInterface(0, 16, RSInterface.interfaceCache[dialogID], 20);
  331. } else {
  332. int j77 = 0;
  333. int j = 0;
  334. DrawingArea.setDrawingArea(93+5, 0, 463, 22);
  335. for(int k = 0; k < 100; k++)
  336. if(chatMessages[k] != null) {
  337. int chatType = chatTypes[k];
  338. int yPos = (88 - j77 * 14) + anInt1089 + 5;
  339. String s1 = chatNames[k];
  340. byte byte0 = 0;
  341. if (s1 != null && s1.startsWith("@cr0@")) {
  342. s1 = s1.substring(5);
  343. byte0 = 1;
  344. } else if(s1 != null && s1.startsWith("@cr1@")) {
  345. s1 = s1.substring(5);
  346. byte0 = 2;
  347. } else if(s1 != null && s1.startsWith("@cr2@")) {
  348. s1 = s1.substring(5);
  349. byte0 = 3;
  350. } else if(s1 != null && s1.startsWith("@cr3@")) {
  351. s1 = s1.substring(5);
  352. byte0 = 4;
  353. }
  354. /* Draws Chat Colored Messages */
  355. if(chatType == 0) {
  356. if (chatTypeView == 5 || chatTypeView == 0) {
  357. if(yPos > 0 && yPos < 110)
  358. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0, -1);
  359. j++;
  360. j77++;
  361. }
  362. }
  363. /* Draws clickable URL text into chatarea */
  364. if(chatType == 9) {
  365. if (chatTypeView == 5 || chatTypeView == 0) {
  366. if(yPos > 0 && yPos < 110)
  367. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 19, yPos, 0x7e3200, -1);
  368. j++;
  369. j77++;
  370. }
  371. }
  372. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  373. if (chatTypeView == 1 || chatTypeView == 0) {
  374. if(yPos > 0 && yPos < 110) {
  375. int xPos = 19;
  376. switch(byte0) {
  377. case 1:
  378. modIcons[0].drawSprite(xPos, yPos - 12);
  379. xPos += 14;
  380. break;
  381. case 2:
  382. modIcons[1].drawSprite(xPos, yPos - 12);
  383. xPos += 14;
  384. break;
  385. case 3:
  386. modIcons[2].drawSprite(xPos, yPos - 12);
  387. xPos += 14;
  388. break;
  389. case 4:
  390. modIcons[3].drawSprite(xPos, yPos - 12);
  391. xPos += 14;
  392. break;
  393. }
  394. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  395. xPos += newRegularFont.getTextWidth(s1) + 8;
  396. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  397. }
  398. j++;
  399. j77++;
  400. }
  401. }
  402. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  403. if (chatTypeView == 2 || chatTypeView == 0) {
  404. if(yPos > 0 && yPos < 110) {
  405. int k1 = 4;
  406. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  407. k1 += newRegularFont.getTextWidth("From ");
  408. switch(byte0) {
  409. case 1:
  410. modIcons[0].drawSprite(k1, yPos - 12);
  411. k1 += 14;
  412. break;
  413. case 2:
  414. modIcons[1].drawSprite(k1, yPos - 12);
  415. k1 += 14;
  416. break;
  417. case 3:
  418. modIcons[2].drawSprite(k1, yPos - 12);
  419. k1 += 14;
  420. break;
  421. case 4:
  422. modIcons[3].drawSprite(k1, yPos - 12);
  423. k1 += 14;
  424. break;
  425. }
  426. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  427. k1 += newRegularFont.getTextWidth(s1) + 8;
  428. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  429. }
  430. j++;
  431. j77++;
  432. }
  433. }
  434. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  435. if (chatTypeView == 3 || chatTypeView == 0) {
  436. if(yPos > 0 && yPos < 110)
  437. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 19, yPos, 0x800080, -1);
  438. j++;
  439. j77++;
  440. }
  441. }
  442. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  443. if (chatTypeView == 2 || chatTypeView == 0) {
  444. if(yPos > 0 && yPos < 110)
  445. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0x800000, -1);
  446. j++;
  447. j77++;
  448. }
  449. }
  450. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  451. if (chatTypeView == 2 || chatTypeView == 0) {
  452. if(yPos > 0 && yPos < 110) {
  453. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  454. newRegularFont.drawBasicString(chatMessages[k], 12 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  455. }
  456. j++;
  457. j77++;
  458. }
  459. }
  460. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  461. if (chatTypeView == 3 || chatTypeView == 0) {
  462. if(yPos > 0 && yPos < 110)
  463. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  464. j++;
  465. j77++;
  466. }
  467. if(chatType == 11 && (clanChatMode == 0)) {
  468. if (chatTypeView == 11) {
  469. if(yPos > 0 && yPos < 110)
  470. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  471. j++;
  472. j77++;
  473. }
  474. }
  475. }
  476. if(chatType == 16) {
  477. int j2 = 40+11;
  478. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  479. if(chatTypeView == 11 || chatTypeView == 0) {
  480. if(yPos > 0 && yPos < 110)
  481. switch(chatRights[k]) {
  482. case 1:
  483. j2 += clanNameWidth;
  484. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  485. j2 += 15;
  486. break;
  487. case 2:
  488. j2 += clanNameWidth;
  489. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  490. j2 += 15;
  491. break;
  492. case 3:
  493. j2 += clanNameWidth;
  494. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  495. j2 += 15;
  496. break;
  497. case 4:
  498. j2 += clanNameWidth;
  499. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  500. j2 += 15;
  501. break;
  502. default:
  503. j2 += clanNameWidth;
  504. break;
  505. }
  506. newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
  507. newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
  508. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
  509. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  510. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  511. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  512.  
  513. j++;
  514. j77++;
  515. }
  516. }
  517. }
  518. DrawingArea.defaultDrawingAreaSize();
  519. anInt1211 = j * 14 + 7;
  520. if(anInt1211 < 78)
  521. anInt1211 = 78;
  522. drawScrollbar(77, anInt1211 - anInt1089 - 77, 20, 480, anInt1211);
  523. String s;
  524. if(myPlayer != null && myPlayer.name != null)
  525. s = myPlayer.name;
  526. else
  527. s = TextClass.fixName(capitalize(myUsername));
  528. newRegularFont.drawBasicString(s + ":", 19, 110, 0, -1);
  529. newRegularFont.drawBasicString(inputString + "*", 20 + textDrawingArea.getTextWidth(s + ": "), 110, 255, -1);
  530. DrawingArea.method339(97, 0x000000, 479, 17);
  531. }
  532. } else if(is474 || is480 || is508 || is525 || is562) {
  533. RSFont textDrawingArea = aTextDrawingArea_1271;
  534. if(messagePromptRaised) {
  535. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  536. newBoldFont.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
  537. } else if(inputDialogState == 1) {
  538. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  539. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  540. } else if(inputDialogState == 2) {
  541. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  542. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  543. } else if(aString844 != null) {
  544. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  545. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128, -1);
  546. } else if(backDialogID != -1) {
  547. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  548. } else if(dialogID != -1) {
  549. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  550. } else {
  551. int j77 = -3;
  552. int j = 0;
  553. DrawingArea.setDrawingArea(122, 8, 497, 7);
  554. for(int k = 0; k < 500; k++)
  555. if(chatMessages[k] != null) {
  556. int chatType = chatTypes[k];
  557. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  558. String s1 = chatNames[k];
  559. byte byte0 = 0;
  560. if (s1 != null && s1.startsWith("@cr0@")) {
  561. s1 = s1.substring(5);
  562. byte0 = 1;
  563. } else if(s1 != null && s1.startsWith("@cr1@")) {
  564. s1 = s1.substring(5);
  565. byte0 = 2;
  566. } else if(s1 != null && s1.startsWith("@cr2@")) {
  567. s1 = s1.substring(5);
  568. byte0 = 3;
  569. } else if(s1 != null && s1.startsWith("@cr3@")) {
  570. s1 = s1.substring(5);
  571. byte0 = 4;
  572. }
  573. /* Draws Chat Colored Messages */
  574. if(chatType == 0) {
  575. if (chatTypeView == 5 || chatTypeView == 0) {
  576. if(yPos > 0 && yPos < 210)
  577. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
  578. j++;
  579. j77++;
  580. }
  581. }
  582. /* Draws clickable URL text into chatarea */
  583. if(chatType == 9) {
  584. if (chatTypeView == 5 || chatTypeView == 0) {
  585. if(yPos > 0 && yPos < 210)
  586. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11, yPos, 0x7e3200, -1);
  587. j++;
  588. j77++;
  589. }
  590. }
  591. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  592. if (chatTypeView == 1 || chatTypeView == 0) {
  593. if(yPos > 0 && yPos < 210) {
  594. int xPos = 11;
  595. switch(byte0) {
  596. case 1:
  597. modIcons[0].drawSprite(xPos, yPos - 12);
  598. xPos += 14;
  599. break;
  600. case 2:
  601. modIcons[1].drawSprite(xPos, yPos - 12);
  602. xPos += 14;
  603. break;
  604. case 3:
  605. modIcons[2].drawSprite(xPos, yPos - 12);
  606. xPos += 14;
  607. break;
  608. case 4:
  609. modIcons[3].drawSprite(xPos, yPos - 12);
  610. xPos += 14;
  611. break;
  612. }
  613. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  614. xPos += newRegularFont.getTextWidth(s1) + 8;
  615. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  616. }
  617. j++;
  618. j77++;
  619. }
  620. }
  621. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  622. if (chatTypeView == 2 || chatTypeView == 0) {
  623. if(yPos > 0 && yPos < 210) {
  624. int k1 = 11;
  625. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  626. k1 += newRegularFont.getTextWidth("From ");
  627. switch(byte0) {
  628. case 1:
  629. modIcons[0].drawSprite(k1, yPos - 12);
  630. k1 += 14;
  631. break;
  632. case 2:
  633. modIcons[1].drawSprite(k1, yPos - 12);
  634. k1 += 14;
  635. break;
  636. case 3:
  637. modIcons[2].drawSprite(k1, yPos - 12);
  638. k1 += 14;
  639. break;
  640. case 4:
  641. modIcons[3].drawSprite(k1, yPos - 12);
  642. k1 += 14;
  643. break;
  644. }
  645. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  646. k1 += newRegularFont.getTextWidth(s1) + 8;
  647. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  648. }
  649. j++;
  650. j77++;
  651. }
  652. }
  653. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  654. if (chatTypeView == 3 || chatTypeView == 0) {
  655. if(yPos > 0 && yPos < 210)
  656. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
  657. j++;
  658. j77++;
  659. }
  660. }
  661. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  662. if (chatTypeView == 2 || chatTypeView == 0) {
  663. if(yPos > 0 && yPos < 210)
  664. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  665. j++;
  666. j77++;
  667. }
  668. }
  669. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  670. if (chatTypeView == 2 || chatTypeView == 0) {
  671. if(yPos > 0 && yPos < 210) {
  672. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  673. newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  674. }
  675. j++;
  676. j77++;
  677. }
  678. }
  679. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  680. if (chatTypeView == 3 || chatTypeView == 0) {
  681. if(yPos > 0 && yPos < 210)
  682. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  683. j++;
  684. j77++;
  685. }
  686. if(chatType == 11 && (clanChatMode == 0)) {
  687. if (chatTypeView == 11) {
  688. if(yPos > 0 && yPos < 210)
  689. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  690. j++;
  691. j77++;
  692. }
  693. }
  694. }
  695. if(chatType == 16) {
  696. int j2 = 40;
  697. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  698. if(chatTypeView == 11 || chatTypeView == 0) {
  699. if(yPos > 3 && yPos < 130)
  700. switch(chatRights[k]) {
  701. case 1:
  702. j2 += clanNameWidth;
  703. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  704. j2 += 14;
  705. break;
  706. case 2:
  707. j2 += clanNameWidth;
  708. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  709. j2 += 14;
  710. break;
  711. case 3:
  712. j2 += clanNameWidth;
  713. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  714. j2 += 14;
  715. break;
  716. case 4:
  717. j2 += clanNameWidth;
  718. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  719. j2 += 14;
  720. break;
  721. default:
  722. j2 += clanNameWidth;
  723. break;
  724. }
  725. newRegularFont.drawBasicString("[", 8, yPos, 0, -1);
  726. newRegularFont.drawBasicString("]", clanNameWidth + 16, yPos, 0, -1);
  727. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 14, yPos, 255, -1);
  728. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  729. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  730. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  731.  
  732. j++;
  733. j77++;
  734. }
  735. }
  736. }
  737. DrawingArea.defaultDrawingAreaSize();
  738. anInt1211 = j * 14 + 7 + 5;
  739. if(anInt1211 < 111)
  740. anInt1211 = 111;
  741. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  742. String s;
  743. if(myPlayer != null && myPlayer.name != null)
  744. s = myPlayer.name;
  745. else
  746. s = TextClass.fixName(capitalize(myUsername));
  747. if(is508) {
  748. qc.drawSprite(textDrawingArea.getTextWidth(s) + 11, 123);
  749. newRegularFont.drawBasicString(s, 11, 133, 0, -1);
  750. newRegularFont.drawBasicString(":", (25 + textDrawingArea.getTextWidth(s)), 133, 0, -1);
  751. newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "<col=0>|" : ""), 23 + textDrawingArea.getTextWidth(s + ": "), 133 ,255 , -1);
  752. DrawingArea.method339(121, 0x807660, 506, 7);
  753. } else {
  754. newRegularFont.drawBasicString(s + ":", 11, 133, 0, -1);
  755. newRegularFont.drawBasicString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
  756. DrawingArea.method339(121, 0x807660, 506, 7);
  757. }
  758. }
  759. }
  760. drawChannelButtons();
  761. chatBackImage.drawGraphics(338, super.graphics, 0);
  762. inGameScreen.initDrawingArea();
  763. Texture.anIntArray1472 = anIntArray1182;
  764. }
  765.  
  766. public void init() {
  767. try {
  768. System.out.println("ErasedPkz is loading..");
  769. nodeID = 10;//friends list order
  770. portOff = 0;
  771. setHighMem();
  772. isMembers = true;
  773. signlink.startpriv(InetAddress.getLocalHost());
  774. instance = this;
  775. initClientFrame(503, 765);//this it? 510 770
  776. } catch (Exception e) {
  777. e.printStackTrace();
  778. }
  779. }
  780.  
  781. public void drawTabHover() {
  782. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  783. tabHover.drawSprite(3+3, 0);
  784. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  785. tabHover.drawSprite(33+3, 0);
  786. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  787. tabHover.drawSprite(63+3, 0);
  788. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  789. tabHover.drawSprite(93+3, 0);
  790. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  791. tabHover.drawSprite(123+3, 0);
  792. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  793. tabHover.drawSprite(153+3, 0);
  794. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  795. tabHover.drawSprite(183+3, 0);
  796. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  797. tabHover.drawSprite(213+3, 0);
  798. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  799. tabHover.drawSprite(3+3, 298);
  800. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  801. tabHover.drawSprite(33+3, 298);
  802. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  803. tabHover.drawSprite(63+3, 298);
  804. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  805. tabHover.drawSprite(93+3, 298);
  806. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  807. tabHover.drawSprite(123+3, 298);
  808. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  809. tabHover.drawSprite(153+3, 298);
  810. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  811. tabHover.drawSprite(183+3,298);
  812. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  813. tabHover.drawSprite(213+3, 298);
  814. }
  815.  
  816. public void startRunnable(Runnable runnable, int i) {
  817. if(i > 10)
  818. i = 10;
  819. if(signlink.mainapp != null) {
  820. signlink.startthread(runnable, i);
  821. } else {
  822. super.startRunnable(runnable, i);
  823.  
  824. }
  825. }
  826.  
  827. public Socket openSocket(int port) throws IOException {
  828. return new Socket(InetAddress.getByName(server), port);
  829. }
  830.  
  831. private void processMenuClick() {
  832. if(activeInterfaceType != 0)
  833. return;
  834. int j = super.clickMode3;
  835. if(spellSelected == 1 && super.saveClickX >= 503 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  836. j = 0;
  837. if(menuOpen) {
  838. if(j != 1) {
  839. int k = super.mouseX;
  840. int j1 = super.mouseY;
  841. if(menuScreenArea == 0) {
  842. k -= 4;
  843. j1 -= 4;
  844. }
  845. if(menuScreenArea == 1) {
  846. k -= 516;//519
  847. j1 -= 168;
  848. }
  849. if(menuScreenArea == 2) {
  850. k -= 5;
  851. j1 -= 338;
  852. }
  853. if(menuScreenArea == 3) {
  854. k -= 516;//519
  855. j1 -= 0;
  856. }
  857. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  858. menuOpen = false;
  859. if(menuScreenArea == 1)
  860. needDrawTabArea = true;
  861. if(menuScreenArea == 2)
  862. inputTaken = true;
  863. }
  864. }
  865. if(j == 1) {
  866. int l = menuOffsetX;
  867. int k1 = menuOffsetY;
  868. int i2 = menuWidth;
  869. int k2 = super.saveClickX;
  870. int l2 = super.saveClickY;
  871. if(menuScreenArea == 0) {
  872. k2 -= 4;
  873. l2 -= 4;
  874. }
  875. if(menuScreenArea == 1) {
  876. k2 -= 516;//519
  877. l2 -= 168;
  878. }
  879. if(menuScreenArea == 2) {
  880. k2 -= 5;//17
  881. l2 -= 338;
  882. }
  883. if(menuScreenArea == 3) {
  884. k2 -= 516;//519
  885. l2 -= 0;
  886. }
  887. int i3 = -1;
  888. for(int j3 = 0; j3 < menuActionRow; j3++) {
  889. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  890. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  891. i3 = j3;
  892. }
  893. System.out.println(i3);
  894. if(i3 != -1)
  895. doAction(i3);
  896. menuOpen = false;
  897. if(menuScreenArea == 1)
  898. needDrawTabArea = true;
  899. if(menuScreenArea == 2) {
  900. inputTaken = true;
  901. }
  902. }
  903. } else {
  904. if(j == 1 && menuActionRow > 0) {
  905. int i1 = menuActionID[menuActionRow - 1];
  906. if(i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125) {
  907. int l1 = menuActionCmd2[menuActionRow - 1];
  908. int j2 = menuActionCmd3[menuActionRow - 1];
  909. RSInterface class9 = RSInterface.interfaceCache[j2];
  910. if(class9.allowSwapItems || class9.deletesTargetSlot) {
  911. aBoolean1242 = false;
  912. anInt989 = 0;
  913. anInt1084 = j2;
  914. anInt1085 = l1;
  915. activeInterfaceType = 2;
  916. anInt1087 = super.saveClickX;
  917. anInt1088 = super.saveClickY;
  918. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  919. activeInterfaceType = 1;
  920. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  921. activeInterfaceType = 3;
  922. return;
  923. }
  924. }
  925. }
  926. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  927. j = 2;
  928. if(j == 1 && menuActionRow > 0)
  929. doAction(menuActionRow - 1);
  930. if(j == 2 && menuActionRow > 0)
  931. determineMenuSize();
  932.  
  933. }
  934. }
  935.  
  936.  
  937. public static int totalRead = 0;
  938.  
  939. public static String getFileNameWithoutExtension(String fileName) {
  940. File tmpFile = new File(fileName);
  941. tmpFile.getName();
  942. int whereDot = tmpFile.getName().lastIndexOf('.');
  943. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  944. return tmpFile.getName().substring(0, whereDot);
  945. }
  946. return "";
  947. }
  948.  
  949. public void preloadModels() {
  950. File file = new File(signlink.findcachedir()+"Raw/");
  951. File[] fileArray = file.listFiles();
  952. for(int y = 0; y < fileArray.length; y++) {
  953. String s = fileArray[y].getName();
  954. byte[] buffer = ReadFile(signlink.findcachedir()+"Raw/"+s);
  955. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  956. }
  957. }
  958.  
  959. public static final byte[] ReadFile(String s) {
  960. try {
  961. byte abyte0[];
  962. File file = new File(s);
  963. int i = (int)file.length();
  964. abyte0 = new byte[i];
  965. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  966. datainputstream.readFully(abyte0, 0, i);
  967. datainputstream.close();
  968. return abyte0;
  969. } catch(Exception e) {
  970. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  971. return null;
  972. }
  973. }
  974.  
  975. private void saveMidi(boolean flag, byte abyte0[]) {
  976. signlink.midifade = flag ? 1 : 0;
  977. signlink.midisave(abyte0, abyte0.length);
  978. }
  979.  
  980. public static void writeFile(byte[] data, String fileName) throws IOException{
  981. OutputStream out = new FileOutputStream(fileName);
  982. out.write(data);
  983. out.close();
  984. }
  985.  
  986. public final void method22() {
  987. try {
  988. anInt985 = -1;
  989. aClass19_1056.removeAll();
  990. aClass19_1013.removeAll();
  991. Texture.method366();
  992. unlinkMRUNodes();
  993. worldController.initToNull();
  994. System.gc();
  995. for(int i = 0; i < 4; i++)
  996. aClass11Array1230[i].method210();
  997. for(int l = 0; l < 4; l++) {
  998. for(int k1 = 0; k1 < 104; k1++) {
  999. for(int j2 = 0; j2 < 104; j2++)
  1000. byteGroundArray[l][k1][j2] = 0;
  1001. }
  1002. }
  1003. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  1004. int k2 = aByteArrayArray1183.length;
  1005. int k18 = 64;
  1006. for(int A = 0; A < k2; A++)
  1007. for(int B = 0; B < 2000; B++)
  1008. if(anIntArray1234[A] == positions[B]){
  1009. anIntArray1235[A] = landScapes[B];
  1010. anIntArray1236[A] = objects[B];
  1011. }
  1012. stream.createFrame(0);
  1013. if(!aBoolean1159) {
  1014. for(int i3 = 0; i3 < k2; i3++) {
  1015. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1016. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1017. byte abyte0[] = aByteArrayArray1183[i3];
  1018. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat"))
  1019. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat");
  1020. if(abyte0 != null)
  1021. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  1022. }
  1023. for(int j4 = 0; j4 < k2; j4++) {
  1024. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1025. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1026. byte abyte2[] = aByteArrayArray1183[j4];
  1027. if(abyte2 == null && anInt1070 < 800)
  1028. objectManager.method174(k7, 64, 64, l5);
  1029. }
  1030. anInt1097++;
  1031. if(anInt1097 > 160) {
  1032. anInt1097 = 0;
  1033. stream.createFrame(238);
  1034. stream.writeWordBigEndian(96);
  1035. }
  1036. stream.createFrame(0);
  1037. for(int i6 = 0; i6 < k2; i6++) {
  1038. byte abyte1[] = aByteArrayArray1247[i6];
  1039. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat"))
  1040. abyte1 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat");
  1041. if(abyte1 != null) {
  1042. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1043. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1044. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  1045. }
  1046. }
  1047. }
  1048. if(aBoolean1159) {
  1049. for(int j3 = 0; j3 < 4; j3++) {
  1050. for(int k4 = 0; k4 < 13; k4++) {
  1051. for(int j6 = 0; j6 < 13; j6++) {
  1052. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1053. if(l7 != -1) {
  1054. int i9 = l7 >> 24 & 3;
  1055. int l9 = l7 >> 1 & 3;
  1056. int j10 = l7 >> 14 & 0x3ff;
  1057. int l10 = l7 >> 3 & 0x7ff;
  1058. int j11 = (j10 / 8 << 8) + l10 / 8;
  1059. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  1060. {
  1061. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  1062. continue;
  1063. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  1064. break;
  1065. }
  1066.  
  1067. }
  1068. }
  1069.  
  1070. }
  1071.  
  1072. }
  1073. for(int l4 = 0; l4 < 13; l4++) {
  1074. for(int k6 = 0; k6 < 13; k6++){
  1075. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1076. if(i8 == -1)
  1077. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1078. }
  1079. }
  1080. stream.createFrame(0);
  1081. for(int l6 = 0; l6 < 4; l6++) {
  1082. for(int j8 = 0; j8 < 13; j8++) {
  1083. for(int j9 = 0; j9 < 13; j9++) {
  1084. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1085. if(i10 != -1) {
  1086. int k10 = i10 >> 24 & 3;
  1087. int i11 = i10 >> 1 & 3;
  1088. int k11 = i10 >> 14 & 0x3ff;
  1089. int i12 = i10 >> 3 & 0x7ff;
  1090. int j12 = (k11 / 8 << 8) + i12 / 8;
  1091. for(int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1092. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  1093. continue;
  1094. byte abyte0[] = aByteArrayArray1247[k12];
  1095. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1096. break;
  1097. }
  1098. }
  1099. }
  1100. }
  1101. }
  1102. }
  1103. stream.createFrame(0);
  1104. objectManager.method171(aClass11Array1230, worldController);
  1105. inGameScreen.initDrawingArea();
  1106. stream.createFrame(0);
  1107. int k3 = ObjectManager.anInt145;
  1108. if(k3 > plane)
  1109. k3 = plane;
  1110. if(k3 < plane - 1)
  1111. k3 = plane - 1;
  1112. if(lowMem)
  1113. worldController.method275(ObjectManager.anInt145);
  1114. else
  1115. worldController.method275(0);
  1116. for(int i5 = 0; i5 < 104; i5++) {
  1117. for(int i7 = 0; i7 < 104; i7++)
  1118. spawnGroundItem(i5, i7);
  1119. }
  1120. anInt1051++;
  1121. if(anInt1051 > 98) {
  1122. anInt1051 = 0;
  1123. stream.createFrame(150);
  1124. }
  1125. method63();
  1126. } catch(Exception exception) { }
  1127. ObjectDef.mruNodes1.unlinkAll();
  1128. if(super.gameFrame != null) {
  1129. stream.createFrame(210);
  1130. stream.writeDWord(0x3f008edd);
  1131. }
  1132. System.gc();
  1133. Texture.method367();
  1134. onDemandFetcher.method566();
  1135. int k = (anInt1069 - 6) / 8 - 1;
  1136. int j1 = (anInt1069 + 6) / 8 + 1;
  1137. int i2 = (anInt1070 - 6) / 8 - 1;
  1138. int l2 = (anInt1070 + 6) / 8 + 1;
  1139. if(aBoolean1141) {
  1140. k = 49;
  1141. j1 = 50;
  1142. i2 = 49;
  1143. l2 = 50;
  1144. }
  1145. for(int l3 = k; l3 <= j1; l3++) {
  1146. for(int j5 = i2; j5 <= l2; j5++)
  1147. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1148. int j7 = onDemandFetcher.method562(0, j5, l3);
  1149. if(j7 != -1)
  1150. onDemandFetcher.method560(j7, 3);
  1151. int k8 = onDemandFetcher.method562(1, j5, l3);
  1152. if(k8 != -1)
  1153. onDemandFetcher.method560(k8, 3);
  1154. }
  1155. }
  1156. }
  1157.  
  1158.  
  1159. private void unlinkMRUNodes()
  1160. {
  1161. ObjectDef.mruNodes1.unlinkAll();
  1162. ObjectDef.mruNodes2.unlinkAll();
  1163. EntityDef.mruNodes.unlinkAll();
  1164. ItemDef.mruNodes2.unlinkAll();
  1165. ItemDef.mruNodes1.unlinkAll();
  1166. Player.mruNodes.unlinkAll();
  1167. SpotAnim.aMRUNodes_415.unlinkAll();
  1168. }
  1169.  
  1170. private void method24(int i)
  1171. {
  1172. int ai[] = aSprite_1263.myPixels;
  1173. int j = ai.length;
  1174. for(int k = 0; k < j; k++)
  1175. ai[k] = 0;
  1176.  
  1177. for(int l = 1; l < 103; l++)
  1178. {
  1179. int i1 = 24628 + (103 - l) * 512 * 4;
  1180. for(int k1 = 1; k1 < 103; k1++)
  1181. {
  1182.  
  1183. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1184. worldController.method309(ai, i1, i, k1, l);
  1185. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1186. worldController.method309(ai, i1, i + 1, k1, l);
  1187. i1 += 4;
  1188. }
  1189.  
  1190. }
  1191.  
  1192. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1193. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1194. aSprite_1263.method343();
  1195. for(int i2 = 1; i2 < 103; i2++)
  1196. {
  1197. for(int j2 = 1; j2 < 103; j2++)
  1198. {
  1199. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1200. method50(i2, j1, j2, l1, i);
  1201. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1202. method50(i2, j1, j2, l1, i + 1);
  1203. }
  1204.  
  1205. }
  1206.  
  1207. inGameScreen.initDrawingArea();
  1208. anInt1071 = 0;
  1209. for(int k2 = 0; k2 < 104; k2++)
  1210. {
  1211. for(int l2 = 0; l2 < 104; l2++)
  1212. {
  1213. int i3 = worldController.method303(plane, k2, l2);
  1214. if(i3 != 0)
  1215. {
  1216. i3 = i3 >> 14 & 0x7fff;
  1217. int j3 = ObjectDef.forID(i3).anInt746;
  1218. if(j3 >= 0)
  1219. {
  1220. int k3 = k2;
  1221. int l3 = l2;
  1222. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1223. {
  1224. byte byte0 = 104;
  1225. byte byte1 = 104;
  1226. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1227. for(int i4 = 0; i4 < 10; i4++)
  1228. {
  1229. int j4 = (int)(Math.random() * 4D);
  1230. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1231. k3--;
  1232. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1233. k3++;
  1234. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1235. l3--;
  1236. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1237. l3++;
  1238. }
  1239.  
  1240. }
  1241. aSpriteArray1140[anInt1071] = mapFunctions[j3];
  1242. anIntArray1072[anInt1071] = k3;
  1243. anIntArray1073[anInt1071] = l3;
  1244. anInt1071++;
  1245. }
  1246. }
  1247. }
  1248.  
  1249. }
  1250.  
  1251. }
  1252.  
  1253. private void spawnGroundItem(int i, int j)
  1254. {
  1255. NodeList class19 = groundArray[plane][i][j];
  1256. if(class19 == null)
  1257. {
  1258. worldController.method295(plane, i, j);
  1259. return;
  1260. }
  1261. int k = 0xfa0a1f01;
  1262. Object obj = null;
  1263. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1264. {
  1265. ItemDef itemDef = ItemDef.forID(item.ID);
  1266. int l = itemDef.value;
  1267. if(itemDef.stackable)
  1268. l *= item.anInt1559 + 1;
  1269. // notifyItemSpawn(item, i + baseX, j + baseY);
  1270. if(l > k)
  1271. {
  1272. k = l;
  1273. obj = item;
  1274. }
  1275. }
  1276. class19.insertTail(((Node) (obj)));
  1277. Object obj1 = null;
  1278. Object obj2 = null;
  1279. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1280. {
  1281. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1282. obj1 = class30_sub2_sub4_sub2_1;
  1283. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1284. obj2 = class30_sub2_sub4_sub2_1;
  1285. }
  1286. int i1 = i + (j << 7) + 0x60000000;
  1287. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1288. }
  1289.  
  1290. private void method26(boolean flag)
  1291. {
  1292. for(int j = 0; j < npcCount; j++)
  1293. {
  1294. NPC npc = npcArray[npcIndices[j]];
  1295. int k = 0x20000000 + (npcIndices[j] << 14);
  1296. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1297. continue;
  1298. int l = npc.x >> 7;
  1299. int i1 = npc.y >> 7;
  1300. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1301. continue;
  1302. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1303. {
  1304. if(anIntArrayArray929[l][i1] == anInt1265)
  1305. continue;
  1306. anIntArrayArray929[l][i1] = anInt1265;
  1307. }
  1308. if(!npc.desc.aBoolean84)
  1309. k += 0x80000000;
  1310. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1311. }
  1312. }
  1313.  
  1314. private boolean replayWave()
  1315. {
  1316. return signlink.wavereplay();
  1317. }
  1318.  
  1319. private void loadError()
  1320. {
  1321. String s = "ondemand";//was a constant parameter
  1322. System.out.println(s);
  1323. try
  1324. {
  1325. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1326. }
  1327. catch(Exception exception)
  1328. {
  1329. exception.printStackTrace();
  1330. }
  1331. do
  1332. try
  1333. {
  1334. Thread.sleep(1000L);
  1335. }
  1336. catch(Exception _ex) { }
  1337. while(true);
  1338. }
  1339.  
  1340. public void drawHoverBox(int xPos, int yPos, String text) {
  1341. String[] results = text.split("\n");
  1342. int height = (results.length * 16) + 3;
  1343. int width;
  1344. width = aTextDrawingArea_1271.getTextWidth(results[0]) + 6;
  1345. for(int i = 1; i < results.length; i++)
  1346. if(width <= aTextDrawingArea_1271.getTextWidth(results[i]) + 6)
  1347. width = aTextDrawingArea_1271.getTextWidth(results[i]) + 6;
  1348. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1349. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1350. yPos += 14;
  1351. for(int i = 0; i < results.length; i++) {
  1352. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i], yPos);
  1353. yPos += 16;
  1354. }
  1355. }
  1356.  
  1357. public void drawBlackBox(int xPos, int yPos) {
  1358. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  1359. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  1360. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  1361. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  1362. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  1363. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  1364. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  1365. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  1366. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  1367. }
  1368.  
  1369. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1370. {
  1371. if(class9.interfaceType != 0 || class9.children == null || class9.interfaceShown)
  1372. return;
  1373. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1374. return;
  1375. int k1 = class9.children.length;
  1376. for(int l1 = 0; l1 < k1; l1++)
  1377. {
  1378. int i2 = class9.childX[l1] + i;
  1379. int j2 = (class9.childY[l1] + l) - j1;
  1380. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1381. i2 += class9_1.xOffset;
  1382. j2 += class9_1.yOffset;
  1383. if((class9_1.hoverType >= 0 || class9_1.disabledHoverColor != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1384. if(class9_1.hoverType >= 0)
  1385. anInt886 = class9_1.hoverType;
  1386. else
  1387. anInt886 = class9_1.id;
  1388. if (class9_1.interfaceType == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1389. anInt1315 = class9_1.id;
  1390. }
  1391. if(class9_1.interfaceType == 0)
  1392. {
  1393. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1394. if(class9_1.scrollMax > class9_1.height)
  1395. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1396. } else
  1397. {
  1398. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1399. {
  1400. boolean flag = false;
  1401. if(class9_1.contentType != 0)
  1402. flag = buildFriendsListMenu(class9_1);
  1403. if(!flag)
  1404. {
  1405. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1406. if(idToggle == true) {
  1407. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1408. menuActionID[menuActionRow] = 315;
  1409. menuActionCmd3[menuActionRow] = class9_1.id;
  1410. menuActionRow++;
  1411. } else {
  1412. menuActionName[menuActionRow] = class9_1.tooltip;
  1413. menuActionID[menuActionRow] = 315;
  1414. menuActionCmd3[menuActionRow] = class9_1.id;
  1415. menuActionRow++;
  1416. }
  1417. }
  1418. }
  1419. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1420. {
  1421. String s = class9_1.selectedActionName;
  1422. if(s.indexOf(" ") != -1)
  1423. s = s.substring(0, s.indexOf(" "));
  1424. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1425. menuActionID[menuActionRow] = 626;
  1426. menuActionCmd3[menuActionRow] = class9_1.id;
  1427. menuActionRow++;
  1428. }
  1429. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1430. {
  1431. menuActionName[menuActionRow] = "Close";
  1432. menuActionID[menuActionRow] = 200;
  1433. menuActionCmd3[menuActionRow] = class9_1.id;
  1434. menuActionRow++;
  1435. }
  1436. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1437. {
  1438. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1439. if(idToggle == true) {
  1440. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1441. menuActionID[menuActionRow] = 169;
  1442. menuActionCmd3[menuActionRow] = class9_1.id;
  1443. menuActionRow++;
  1444. } else {
  1445. menuActionName[menuActionRow] = class9_1.tooltip;
  1446. menuActionID[menuActionRow] = 169;
  1447. menuActionCmd3[menuActionRow] = class9_1.id;
  1448. menuActionRow++;
  1449. }
  1450. if (class9_1.hoverText != null) {
  1451. //drawHoverBox(k, l, class9_1.hoverText);
  1452. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1453. }
  1454. }
  1455. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1456. {
  1457. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1458. if(idToggle == true) {
  1459. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1460. menuActionID[menuActionRow] = 646;
  1461. menuActionCmd3[menuActionRow] = class9_1.id;
  1462. menuActionRow++;
  1463. } else {
  1464. menuActionName[menuActionRow] = class9_1.tooltip;
  1465. menuActionID[menuActionRow] = 646;
  1466. menuActionCmd3[menuActionRow] = class9_1.id;
  1467. menuActionRow++;
  1468. }
  1469. }
  1470. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1471. {
  1472. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1473. if(idToggle == true) {
  1474. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1475. menuActionID[menuActionRow] = 679;
  1476. menuActionCmd3[menuActionRow] = class9_1.id;
  1477. menuActionRow++;
  1478. } else {
  1479. menuActionName[menuActionRow] = class9_1.tooltip;
  1480. menuActionID[menuActionRow] = 679;
  1481. menuActionCmd3[menuActionRow] = class9_1.id;
  1482. menuActionRow++;
  1483. }
  1484. }
  1485. if(class9_1.interfaceType == 2)
  1486. {
  1487. int k2 = 0;
  1488. for(int l2 = 0; l2 < class9_1.height; l2++)
  1489. {
  1490. for(int i3 = 0; i3 < class9_1.width; i3++)
  1491. {
  1492. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1493. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1494. if(k2 < 20)
  1495. {
  1496. j3 += class9_1.spritesX[k2];
  1497. k3 += class9_1.spritesY[k2];
  1498. }
  1499. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1500. {
  1501. mouseInvInterfaceIndex = k2;
  1502. lastActiveInvInterface = class9_1.id;
  1503. if(class9_1.inventory[k2] > 0)
  1504. {
  1505. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k2] - 1);
  1506. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1507. {
  1508. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1509. {
  1510. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  1511. menuActionID[menuActionRow] = 870;
  1512. menuActionCmd1[menuActionRow] = itemDef.id;
  1513. menuActionCmd2[menuActionRow] = k2;
  1514. menuActionCmd3[menuActionRow] = class9_1.id;
  1515. menuActionRow++;
  1516. }
  1517. } else
  1518. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1519. {
  1520. if((spellUsableOn & 0x10) == 16)
  1521. {
  1522. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1523. menuActionID[menuActionRow] = 543;
  1524. menuActionCmd1[menuActionRow] = itemDef.id;
  1525. menuActionCmd2[menuActionRow] = k2;
  1526. menuActionCmd3[menuActionRow] = class9_1.id;
  1527. menuActionRow++;
  1528. }
  1529. } else
  1530. {
  1531. if(class9_1.isInventoryInterface)
  1532. {
  1533. for(int l3 = 4; l3 >= 3; l3--)
  1534. if(itemDef.itemActions != null && itemDef.itemActions[l3] != null)
  1535. {
  1536. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1537. if(l3 == 3)
  1538. menuActionID[menuActionRow] = 493;
  1539. if(l3 == 4)
  1540. menuActionID[menuActionRow] = 847;
  1541. menuActionCmd1[menuActionRow] = itemDef.id;
  1542. menuActionCmd2[menuActionRow] = k2;
  1543. menuActionCmd3[menuActionRow] = class9_1.id;
  1544. menuActionRow++;
  1545. } else
  1546. if(l3 == 4)
  1547. {
  1548. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1549. menuActionID[menuActionRow] = 847;
  1550. menuActionCmd1[menuActionRow] = itemDef.id;
  1551. menuActionCmd2[menuActionRow] = k2;
  1552. menuActionCmd3[menuActionRow] = class9_1.id;
  1553. menuActionRow++;
  1554. }
  1555.  
  1556. }
  1557. if(class9_1.usableItemInterface)
  1558. {
  1559. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1560. menuActionID[menuActionRow] = 447;
  1561. menuActionCmd1[menuActionRow] = itemDef.id;
  1562. //k2 = inventory spot
  1563. //System.out.println(k2);
  1564. menuActionCmd2[menuActionRow] = k2;
  1565. menuActionCmd3[menuActionRow] = class9_1.id;
  1566. menuActionRow++;
  1567. }
  1568. if(class9_1.isInventoryInterface && itemDef.itemActions != null)
  1569. {
  1570. for(int i4 = 2; i4 >= 0; i4--)
  1571. if(itemDef.itemActions[i4] != null)
  1572. {
  1573. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1574. if(i4 == 0)
  1575. menuActionID[menuActionRow] = 74;
  1576. if(i4 == 1)
  1577. menuActionID[menuActionRow] = 454;
  1578. if(i4 == 2)
  1579. menuActionID[menuActionRow] = 539;
  1580. menuActionCmd1[menuActionRow] = itemDef.id;
  1581. menuActionCmd2[menuActionRow] = k2;
  1582. menuActionCmd3[menuActionRow] = class9_1.id;
  1583. menuActionRow++;
  1584. }
  1585.  
  1586. }
  1587. if(class9_1.itemActions != null)
  1588. {
  1589. for(int j4 = 4; j4 >= 0; j4--)
  1590. if(class9_1.itemActions[j4] != null)
  1591. {
  1592. menuActionName[menuActionRow] = class9_1.itemActions[j4] + " @lre@" + itemDef.name;
  1593. if(j4 == 0)
  1594. menuActionID[menuActionRow] = 632;
  1595. if(j4 == 1)
  1596. menuActionID[menuActionRow] = 78;
  1597. if(j4 == 2)
  1598. menuActionID[menuActionRow] = 867;
  1599. if(j4 == 3)
  1600. menuActionID[menuActionRow] = 431;
  1601. if(j4 == 4)
  1602. menuActionID[menuActionRow] = 53;
  1603. menuActionCmd1[menuActionRow] = itemDef.id;
  1604. menuActionCmd2[menuActionRow] = k2;
  1605. menuActionCmd3[menuActionRow] = class9_1.id;
  1606. menuActionRow++;
  1607. }
  1608.  
  1609. }
  1610. if(idToggle == true) {
  1611. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inventory[k2] - 1) + "@gre@)";
  1612. } else {
  1613. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1614. }
  1615. menuActionID[menuActionRow] = 1125;
  1616. menuActionCmd1[menuActionRow] = itemDef.id;
  1617. menuActionCmd2[menuActionRow] = k2;
  1618. menuActionCmd3[menuActionRow] = class9_1.id;
  1619. menuActionRow++;
  1620. }
  1621. }
  1622. }
  1623. k2++;
  1624. }
  1625.  
  1626. }
  1627.  
  1628. }
  1629. }
  1630. }
  1631.  
  1632. }
  1633.  
  1634. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1635. if(is474 || is480 || is508 || is525 || is562) {
  1636. scrollBar1.drawSprite(i1, l);
  1637. scrollBar2.drawSprite(i1, (l + j) - 16);
  1638. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1639. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1640. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1641. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1642. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1643. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1644. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1645. int k1 = ((j - 32) * j) / j1;
  1646. if(k1 < 8)
  1647. k1 = 8;
  1648. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1649. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1650. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1651. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1652. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1653. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1654. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1655. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1656. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1657. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1658. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1659. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1660. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1661. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1662. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1663. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1664. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1665. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1666. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1667. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1668. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1669. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1670. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1671. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1672. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1673. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1674. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1675. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1676. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1677. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1678. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1679. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1680. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1681. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1682. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1683. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1684. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1685. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1686. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1687. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1688. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1689. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1690. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1691. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1692. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1693. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1694. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1695. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1696. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1697. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1698. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1699. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1700. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1701. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1702. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1703. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1704. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1705. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1706. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1707. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1708. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1709. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1710. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1711. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1712. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1713. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1714. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1715. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1716. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1717. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1718. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1719. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1720. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1721. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1722. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1723. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1724. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1725. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1726. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1727. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1728. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1729. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1730. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1731. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1732. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1733. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1734. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1735. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1736. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1737. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1738. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1739. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1740. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1741. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1742. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1743. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1744. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1745. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1746. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1747. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1748. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1749. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1750. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1751. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1752. } else {
  1753. scrollBar3.drawSprite(i1, l);
  1754. scrollBar4.drawSprite(i1, (l + j) - 16);
  1755. DrawingArea.method336(j - 32, l + 16, i1, anInt1002, 16);
  1756. int k1 = ((j - 32) * j) / j1;
  1757. if(k1 < 8)
  1758. k1 = 8;
  1759. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1760. DrawingArea.method336(k1, l + 16 + l1, i1, barFillColor, 16);
  1761. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1);
  1762. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1 + 1);
  1763. DrawingArea.method339(l + 16 + l1, anInt902, 16, i1);
  1764. DrawingArea.method339(l + 17 + l1, anInt902, 16, i1);
  1765. DrawingArea.method341(l + 16 + l1, anInt927, k1, i1 + 15);
  1766. DrawingArea.method341(l + 17 + l1, anInt927, k1 - 1, i1 + 14);
  1767. DrawingArea.method339(l + 15 + l1 + k1, anInt927, 16, i1);
  1768. DrawingArea.method339(l + 14 + l1 + k1, anInt927, 15, i1 + 1);
  1769. }
  1770. }
  1771.  
  1772.  
  1773.  
  1774. private void updateNPCs(Stream stream, int i)
  1775. {
  1776. anInt839 = 0;
  1777. anInt893 = 0;
  1778. method139(stream);
  1779. method46(i, stream);
  1780. method86(stream);
  1781. for(int k = 0; k < anInt839; k++)
  1782. {
  1783. int l = anIntArray840[k];
  1784. if(npcArray[l].anInt1537 != loopCycle)
  1785. {
  1786. npcArray[l].desc = null;
  1787. npcArray[l] = null;
  1788. }
  1789. }
  1790. if(stream.currentOffset != i)
  1791. {
  1792. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1793. throw new RuntimeException("eek");
  1794. }
  1795. for(int i1 = 0; i1 < npcCount; i1++)
  1796. if(npcArray[npcIndices[i1]] == null)
  1797. {
  1798. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1799. throw new RuntimeException("eek");
  1800. }
  1801. }
  1802.  
  1803. private int cButtonHPos;
  1804. private int cButtonHCPos;
  1805. private int cButtonCPos;
  1806.  
  1807. private void processChatModeClick() {
  1808. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  1809. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1810. cButtonHPos = 0;
  1811. aBoolean1233 = true;
  1812. inputTaken = true;
  1813. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  1814. cButtonHPos = 1;
  1815. aBoolean1233 = true;
  1816. inputTaken = true;
  1817. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  1818. cButtonHPos = 2;
  1819. aBoolean1233 = true;
  1820. inputTaken = true;
  1821. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  1822. cButtonHPos = 3;
  1823. aBoolean1233 = true;
  1824. inputTaken = true;
  1825. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  1826. cButtonHPos = 4;
  1827. aBoolean1233 = true;
  1828. inputTaken = true;
  1829. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  1830. cButtonHPos = 5;
  1831. aBoolean1233 = true;
  1832. inputTaken = true;
  1833. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  1834. cButtonHPos = 7;
  1835. aBoolean1233 = true;
  1836. inputTaken = true;
  1837. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  1838. cButtonHPos = 6;
  1839. aBoolean1233 = true;
  1840. inputTaken = true;
  1841. } else {
  1842. cButtonHPos = -1;
  1843. aBoolean1233 = true;
  1844. inputTaken = true;
  1845. }
  1846. if(super.clickMode3 == 1) {
  1847. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1848. cButtonCPos = 0;
  1849. chatTypeView = 0;
  1850. aBoolean1233 = true;
  1851. inputTaken = true;
  1852. } else if(super.saveClickX >= 62 && super.saveClickX <= 117 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1853. cButtonCPos = 1;
  1854. chatTypeView = 5;
  1855. aBoolean1233 = true;
  1856. inputTaken = true;
  1857. } else if(super.saveClickX >= 119 && super.saveClickX <= 174 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1858. cButtonCPos = 2;
  1859. chatTypeView = 1;
  1860. aBoolean1233 = true;
  1861. inputTaken = true;
  1862. } else if(super.saveClickX >= 176 && super.saveClickX <= 231 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1863. cButtonCPos = 3;
  1864. chatTypeView = 2;
  1865. aBoolean1233 = true;
  1866. inputTaken = true;
  1867. } else if(super.saveClickX >= 233 && super.saveClickX <= 288 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1868. cButtonCPos = 4;
  1869. chatTypeView = 11;
  1870. aBoolean1233 = true;
  1871. inputTaken = true;
  1872. } else if(super.saveClickX >= 290 && super.saveClickX <= 345 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1873. cButtonCPos = 5;
  1874. chatTypeView = 3;
  1875. aBoolean1233 = true;
  1876. inputTaken = true;
  1877. } else if(super.saveClickX >= 347 && super.saveClickX <= 402 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1878. cButtonCPos = 6;
  1879. //chatTypeView = 3;
  1880. aBoolean1233 = true;
  1881. inputTaken = true;
  1882. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1883. if(openInterfaceID == -1) {
  1884. clearTopInterfaces();
  1885. reportAbuseInput = "";
  1886. canMute = false;
  1887. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1888. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1889. continue;
  1890. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1891. break;
  1892. }
  1893. } else {
  1894. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1895. }
  1896. }
  1897. }
  1898. } else if(is474) {
  1899. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1900. cButtonHPos = 0;
  1901. aBoolean1233 = true;
  1902. inputTaken = true;
  1903. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1904. cButtonHPos = 1;
  1905. aBoolean1233 = true;
  1906. inputTaken = true;
  1907. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1908. cButtonHPos = 2;
  1909. aBoolean1233 = true;
  1910. inputTaken = true;
  1911. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1912. cButtonHPos = 3;
  1913. aBoolean1233 = true;
  1914. inputTaken = true;
  1915. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1916. cButtonHPos = 4;
  1917. aBoolean1233 = true;
  1918. inputTaken = true;
  1919. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1920. cButtonHPos = 5;
  1921. aBoolean1233 = true;
  1922. inputTaken = true;
  1923. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1924. cButtonHPos = 6;
  1925. aBoolean1233 = true;
  1926. inputTaken = true;
  1927. } else {
  1928. cButtonHPos = -1;
  1929. aBoolean1233 = true;
  1930. inputTaken = true;
  1931. }
  1932. if(super.clickMode3 == 1) {
  1933. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1934. cButtonCPos = 0;
  1935. chatTypeView = 0;
  1936. aBoolean1233 = true;
  1937. inputTaken = true;
  1938. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1939. cButtonCPos = 1;
  1940. chatTypeView = 5;
  1941. aBoolean1233 = true;
  1942. inputTaken = true;
  1943. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1944. cButtonCPos = 2;
  1945. chatTypeView = 1;
  1946. aBoolean1233 = true;
  1947. inputTaken = true;
  1948. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1949. cButtonCPos = 3;
  1950. chatTypeView = 2;
  1951. aBoolean1233 = true;
  1952. inputTaken = true;
  1953. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1954. cButtonCPos = 4;
  1955. chatTypeView = 11;
  1956. aBoolean1233 = true;
  1957. inputTaken = true;
  1958. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1959. cButtonCPos = 5;
  1960. chatTypeView = 3;
  1961. aBoolean1233 = true;
  1962. inputTaken = true;
  1963. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1964. if(openInterfaceID == -1) {
  1965. clearTopInterfaces();
  1966. reportAbuseInput = "";
  1967. canMute = false;
  1968. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1969. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1970. continue;
  1971. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1972. break;
  1973. }
  1974. } else {
  1975. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1976. }
  1977. }
  1978. }
  1979. } else {
  1980. if(super.clickMode3 == 1) {
  1981. if(super.saveClickX >= 6 && super.saveClickX <= 106 && super.saveClickY >= 467 && super.saveClickY <= 499)
  1982. {
  1983. publicChatMode = (publicChatMode + 1) % 4;
  1984. aBoolean1233 = true;
  1985. inputTaken = true;
  1986. stream.createFrame(95);
  1987. stream.writeWordBigEndian(publicChatMode);
  1988. stream.writeWordBigEndian(privateChatMode);
  1989. stream.writeWordBigEndian(tradeMode);
  1990. }
  1991. if(super.saveClickX >= 135 && super.saveClickX <= 235 && super.saveClickY >= 467 && super.saveClickY <= 499)
  1992. {
  1993. privateChatMode = (privateChatMode + 1) % 3;
  1994. aBoolean1233 = true;
  1995. inputTaken = true;
  1996. stream.createFrame(95);
  1997. stream.writeWordBigEndian(publicChatMode);
  1998. stream.writeWordBigEndian(privateChatMode);
  1999. stream.writeWordBigEndian(tradeMode);
  2000. }
  2001. if(super.saveClickX >= 273 && super.saveClickX <= 373 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2002. {
  2003. tradeMode = (tradeMode + 1) % 3;
  2004. aBoolean1233 = true;
  2005. inputTaken = true;
  2006. stream.createFrame(95);
  2007. stream.writeWordBigEndian(publicChatMode);
  2008. stream.writeWordBigEndian(privateChatMode);
  2009. stream.writeWordBigEndian(tradeMode);
  2010. }
  2011. if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2012. if(openInterfaceID == -1) {
  2013. clearTopInterfaces();
  2014. reportAbuseInput = "";
  2015. canMute = false;
  2016. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2017. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  2018. continue;
  2019. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2020. break;
  2021. }
  2022. } else {
  2023. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2024. }
  2025. }
  2026. }
  2027. }
  2028. }
  2029.  
  2030. private void method33(int i)
  2031. {
  2032. int j = Varp.cache[i].anInt709;
  2033. if(j == 0)
  2034. return;
  2035. int k = variousSettings[i];
  2036. if(j == 1)
  2037. {
  2038. if(k == 1)
  2039. Texture.method372(0.90000000000000002D);
  2040. if(k == 2)
  2041. Texture.method372(0.80000000000000004D);
  2042. if(k == 3)
  2043. Texture.method372(0.69999999999999996D);
  2044. if(k == 4)
  2045. Texture.method372(0.59999999999999998D);
  2046. ItemDef.mruNodes1.unlinkAll();
  2047. welcomeScreenRaised = true;
  2048. }
  2049. if(j == 3)
  2050. {
  2051. boolean flag1 = musicEnabled;
  2052. if(k == 0)
  2053. {
  2054. adjustVolume(musicEnabled, 0);
  2055. musicEnabled = true;
  2056. }
  2057. if(k == 1)
  2058. {
  2059. adjustVolume(musicEnabled, -400);
  2060. musicEnabled = true;
  2061. }
  2062. if(k == 2)
  2063. {
  2064. adjustVolume(musicEnabled, -800);
  2065. musicEnabled = true;
  2066. }
  2067. if(k == 3)
  2068. {
  2069. adjustVolume(musicEnabled, -1200);
  2070. musicEnabled = true;
  2071. }
  2072. if(k == 4)
  2073. musicEnabled = false;
  2074. if(musicEnabled != flag1 && !lowMem)
  2075. {
  2076. if(musicEnabled)
  2077. {
  2078. nextSong = currentSong;
  2079. songChanging = true;
  2080. onDemandFetcher.method558(2, nextSong);
  2081. } else
  2082. {
  2083. stopMidi();
  2084. }
  2085. prevSong = 0;
  2086. }
  2087. }
  2088. if(j == 4)
  2089. {
  2090. if(k == 0)
  2091. {
  2092. aBoolean848 = true;
  2093. setWaveVolume(0);
  2094. }
  2095. if(k == 1)
  2096. {
  2097. aBoolean848 = true;
  2098. setWaveVolume(-400);
  2099. }
  2100. if(k == 2)
  2101. {
  2102. aBoolean848 = true;
  2103. setWaveVolume(-800);
  2104. }
  2105. if(k == 3)
  2106. {
  2107. aBoolean848 = true;
  2108. setWaveVolume(-1200);
  2109. }
  2110. if(k == 4)
  2111. aBoolean848 = false;
  2112. }
  2113. if(j == 5)
  2114. anInt1253 = k;
  2115. if(j == 6)
  2116. anInt1249 = k;
  2117. if(j == 8)
  2118. {
  2119. splitPrivateChat = k;
  2120. inputTaken = true;
  2121. }
  2122. if(j == 9)
  2123. anInt913 = k;
  2124. }
  2125.  
  2126. /* void noSoakHit1(int i, int j, int k, int l, int i1, String s)
  2127. {
  2128. if(i > loopCycle)
  2129. {
  2130. k -= 30;
  2131. int j1 = i - loopCycle;
  2132. int k1 = (int)Math.round((double)j1 * 3.5D);
  2133. int l1 = Math.round(j1 / 6);
  2134. hitMark[5].drawTransparent(j - 8, (k - 12) + l1, k1);
  2135. hitMark[5].drawTransparent(j - 8, (k - 12) + l1, k1);
  2136. hitMark[5].drawTransparent(j - 8, (k - 12) + l1, k1);
  2137. smallText.drawText(0, s, k + 4 + l1, j);
  2138. smallText.drawText(0xffffff, s, k + 3 + l1, j - 1);
  2139. }
  2140. }
  2141.  
  2142. void noSoakHit10(int i, int j, int k, int l, int i1, String s)
  2143. {
  2144. if(i > loopCycle)
  2145. {
  2146. k -= 30;
  2147. int j1 = i - loopCycle;
  2148. int k1 = (int)Math.round((double)j1 * 3.5D);
  2149. int l1 = Math.round(j1 / 6);
  2150. hitMark[l].drawTransparent(j - 12, (k - 12) + l1, k1);
  2151. hitMark[l].drawTransparent(j - 12, (k - 12) + l1, k1);
  2152. hitMark[l].drawTransparent(j - 12, (k - 12) + l1, k1);
  2153. smallText.drawText(0, s, k + 4 + l1, j);
  2154. smallText.drawText(0xffffff, s, k + 3 + l1, j - 1);
  2155. }
  2156. }
  2157.  
  2158. void noSoakHit100(int i, int j, int k, int l, int i1, String s)
  2159. {
  2160. if(i > loopCycle)
  2161. {
  2162. k -= 30;
  2163. int j1 = i - loopCycle;
  2164. int k1 = (int)Math.round((double)j1 * 3.5D);
  2165. int l1 = Math.round(j1 / 6);
  2166. hitMark[l].drawTransparent(j - 20, (k - 13) + l1, k1);
  2167. hitMark[l].drawTransparent(j - 20, (k - 13) + l1, k1);
  2168. hitMark[l].drawTransparent(j - 20, (k - 13) + l1, k1);
  2169. smallText.drawText(0, s, k + 4 + l1, j);
  2170. smallText.drawText(0xffffff, s, k + 3 + l1, j - 1);
  2171. }
  2172. }
  2173.  
  2174. void noSoakHitMax(int i, int j, int k, int l, String s)
  2175. {
  2176. if(i > loopCycle)
  2177. {
  2178. k -= 30;
  2179. int i1 = i - loopCycle;
  2180. int j1 = (int)Math.round((double)i1 * 3.5D);
  2181. int k1 = Math.round(i1 / 6);
  2182. hitMark[4].drawTransparent(j - 20, (k - 13) + k1, j1);
  2183. hitMark[4].drawTransparent(j - 20, (k - 13) + k1, j1);
  2184. hitMark[4].drawTransparent(j - 20, (k - 13) + k1, j1);
  2185. chatTextDrawingArea.drawText(0xffffff, s, k + 3 + k1, j - 1);
  2186. }
  2187. }
  2188.  
  2189. void soakHit1(int i, int j, int k, int l, int i1, String s, String s1)
  2190. {
  2191. if(i > loopCycle)
  2192. {
  2193. k -= 30;
  2194. int j1 = i - loopCycle;
  2195. int k1 = (int)Math.round((double)j1 * 3.5D);
  2196. int l1 = Math.round(j1 / 6);
  2197. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2198. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2199. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2200. smallText.drawText(0, s, k + 4 + l1, j - 9);
  2201. smallText.drawText(0xffffff, s, k + 3 + l1, j - 10);
  2202. hitMark[6].drawTransparent(j + 24, (k - 11) + l1, k1);
  2203. hitMark[6].drawTransparent(j + 24, (k - 11) + l1, k1);
  2204. hitMark[6].drawTransparent(j + 24, (k - 11) + l1, k1);
  2205. smallText.drawText(0, s1, k + 5 + l1, j + 32);
  2206. smallText.drawText(0xffffff, s1, k + 4 + l1, j + 31);
  2207. }
  2208. }
  2209.  
  2210. void soakHit(int i, int j, int k, int l, int i1, String s, String s1)
  2211. {
  2212. if(i > loopCycle)
  2213. {
  2214. k -= 30;
  2215. int j1 = i - loopCycle;
  2216. int k1 = (int)Math.round((double)j1 * 3.5D);
  2217. int l1 = Math.round(j1 / 6);
  2218. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2219. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2220. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2221. smallText.drawText(0, s, k + 4 + l1, j - 9);
  2222. smallText.drawText(0xffffff, s, k + 3 + l1, j - 10);
  2223. hitMark[0].drawTransparent(j + 24, (k - 11) + l1, k1);
  2224. hitMark[0].drawTransparent(j + 24, (k - 11) + l1, k1);
  2225. hitMark[0].drawTransparent(j + 24, (k - 11) + l1, k1);
  2226. smallText.drawText(0, s1, k + 5 + l1, j + 38);
  2227. smallText.drawText(0xffffff, s1, k + 4 + l1, j + 37);
  2228. }
  2229. }
  2230.  
  2231. void soakHitMax(int i, int j, int k, int l, String s, String s1)
  2232. {
  2233. if(i > loopCycle)
  2234. {
  2235. k -= 30;
  2236. int i1 = i - loopCycle;
  2237. int j1 = (int)Math.round((double)i1 * 3.5D);
  2238. int k1 = Math.round(i1 / 6);
  2239. hitMark[4].drawTransparent(j - 29, (k - 13) + k1, j1);
  2240. hitMark[4].drawTransparent(j - 29, (k - 13) + k1, j1);
  2241. hitMark[4].drawTransparent(j - 29, (k - 13) + k1, j1);
  2242. chatTextDrawingArea.drawText(0xffffff, s, k + 4 + k1, j - 10);
  2243. hitMark[0].drawTransparent(j + 24, (k - 11) + k1, j1);
  2244. hitMark[0].drawTransparent(j + 24, (k - 11) + k1, j1);
  2245. hitMark[0].drawTransparent(j + 24, (k - 11) + k1, j1);
  2246. smallText.drawText(0, s1, k + 5 + k1, j + 38);
  2247. smallText.drawText(0xffffff, s1, k + 4 + k1, j + 37);
  2248. }
  2249. }*/
  2250.  
  2251. private Sprite HPBarFull;
  2252. private Sprite HPBarEmpty;
  2253.  
  2254. private void updateEntities() {
  2255.  
  2256. try{
  2257. int anInt974 = 0;
  2258. for(int j = -1; j < playerCount + npcCount; j++) {
  2259. Object obj;
  2260. if(j == -1)
  2261. obj = myPlayer;
  2262. else
  2263. if(j < playerCount)
  2264. obj = playerArray[playerIndices[j]];
  2265. else
  2266. obj = npcArray[npcIndices[j - playerCount]];
  2267. if(obj == null || !((Entity) (obj)).isVisible())
  2268. continue;
  2269. if(obj instanceof NPC) {
  2270. EntityDef entityDef = ((NPC)obj).desc;
  2271.  
  2272. if(namesToggle == true) {
  2273. String s = entityDef.name;
  2274. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  2275. if(entityDef.combatLevel != 0) {
  2276. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height+15);
  2277. smallText.method382(0xFFFF33, spriteDrawX, s, spriteDrawY-8, true);
  2278. } else if(entityDef.combatLevel == 0) {
  2279. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height+15);
  2280. smallText.method382(0xFFFF33, spriteDrawX, entityDef.name, spriteDrawY-8, true);
  2281. }
  2282. } else if(namesToggle == false) {
  2283.  
  2284. }
  2285.  
  2286. if(entityDef.childrenIDs != null)
  2287. entityDef = entityDef.method161();
  2288. if(entityDef == null)
  2289. continue;
  2290. }
  2291. if(namesToggle == true) {
  2292. if(j < playerCount) {
  2293. int l = 45;
  2294. Player player = (Player)obj;
  2295. if(player.headIcon >= 0) {
  2296. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2297. if(spriteDrawX > -1) {
  2298. if (player.skullIcon < 2) {
  2299. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2300. l += 25;//25
  2301. }
  2302. /*if (player.headIcon < 7) {
  2303. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2304. l += 20;//20
  2305. }*/
  2306. if(player.headIcon < 18) {
  2307. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2308. l += 26;
  2309. }
  2310. }
  2311. }
  2312. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2313. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2314. if(spriteDrawX > -1)
  2315. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2316. l += 30;
  2317. }
  2318. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2319. int col = 0x3399ff;
  2320. newSmallFont.drawCenteredString(player.name, spriteDrawX, spriteDrawY-8, col, 100);
  2321.  
  2322. } else {
  2323. EntityDef entityDef_1 = ((NPC)obj).desc;
  2324. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2325. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2326. if(spriteDrawX > -1)
  2327. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 50);
  2328. }
  2329. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2330. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2331. if(spriteDrawX > -1)
  2332. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 50);
  2333. }
  2334. }
  2335. } else if(namesToggle == false) {
  2336. if(j < playerCount) {
  2337. int l = 30;
  2338. Player player = (Player)obj;
  2339. if(player.headIcon >= 0) {
  2340. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2341. if(spriteDrawX > -1) {
  2342. if (player.skullIcon < 2) {
  2343. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2344. l += 25;
  2345. }
  2346. /*if (player.headIcon < 7) {
  2347. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2348. l += 18;
  2349. }*/
  2350. if(player.headIcon < 18) {
  2351. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2352. l += 26;
  2353. }
  2354. }
  2355. }
  2356. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2357. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2358. if(spriteDrawX > -1)
  2359. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2360. }
  2361. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2362.  
  2363. } else {
  2364. EntityDef entityDef_1 = ((NPC)obj).desc;
  2365. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2366. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2367. if(spriteDrawX > -1)
  2368. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2369. }
  2370. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2371. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2372. if(spriteDrawX > -1)
  2373. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2374. }
  2375. }
  2376. }
  2377. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  2378. {
  2379. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2380. if(spriteDrawX > -1 && anInt974 < anInt975)
  2381. {
  2382. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  2383. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2384. anIntArray976[anInt974] = spriteDrawX;
  2385. anIntArray977[anInt974] = spriteDrawY;
  2386. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2387. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2388. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2389. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2390. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  2391. {
  2392. anIntArray978[anInt974] += 10;
  2393. anIntArray977[anInt974] += 5;
  2394. }
  2395. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2396. anIntArray979[anInt974] = 60;
  2397. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2398. anIntArray978[anInt974] += 5;
  2399. }
  2400. }
  2401. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  2402. {
  2403. try{
  2404. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2405. if(spriteDrawX > -1)
  2406. {
  2407. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2408. if(i1 > 30) {
  2409. i1 = 30;
  2410. }
  2411. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  2412. if (HpPercent > 56) {
  2413. HpPercent = 56;
  2414. }
  2415. //if(namesToggle) {
  2416. // newSmallFont.drawCenteredString((new StringBuilder()).append(((Entity) (Entity) obj).currentHealth).append("/").append(((Entity) (Entity) obj).maxHealth).toString(), spriteDrawX, spriteDrawY - 19, 0x3399ff, 100);
  2417. //}//draws HP above head
  2418. //HPBar crap
  2419. if(!hitbarToggle){
  2420. DrawingArea.method336(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  2421. DrawingArea.method336(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2422. } else {
  2423. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);//3
  2424. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", HpPercent, 7);
  2425. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  2426. }
  2427. }
  2428. }catch(Exception e){ }
  2429. }
  2430. for(int j1 = 0; j1 < 4; j1++)
  2431. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  2432. {
  2433. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2434. if(spriteDrawX > -1)
  2435. {
  2436. if(j1 == 1)
  2437. spriteDrawY -= 20;
  2438. if(j1 == 2)
  2439. {
  2440. spriteDrawX -= 15;
  2441. spriteDrawY -= 10;
  2442. }
  2443. if(j1 == 3)
  2444. {
  2445. spriteDrawX += 15;
  2446. spriteDrawY -= 10;
  2447. }
  2448. if (((Entity) (obj)).hitArray[j1] > 99) {
  2449. hitMarks[22].drawSprite(spriteDrawX - 22, spriteDrawY - 14);
  2450. } else if (((Entity) (obj)).hitMarkTypes[j1] == 1) {
  2451. hitMarks[20].drawSprite(spriteDrawX - 11, spriteDrawY - 12);
  2452. } else if (((Entity) (obj)).hitMarkTypes[j1] == 0) {
  2453. hitMarks[21].drawSprite(spriteDrawX - 12, spriteDrawY - 13);
  2454. } else if (((Entity) (obj)).hitArray[j1] < 11) {
  2455. hitMarks[23].drawSprite(spriteDrawX - 12, spriteDrawY - 13);
  2456. } else {
  2457. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2458. }
  2459. }
  2460. if (((Entity) (obj)).hitArray[j1] > 0) {
  2461. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2462. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2463. }
  2464. }
  2465. }
  2466.  
  2467. /*} catch(Exception exception1) { }
  2468. for(int k1 = 0; k1 < 4; k1++)
  2469. {
  2470. if(((Entity)(Entity)obj).hitsLoopCycle[k1] <= loopCycle)
  2471. continue;
  2472. npcScreenPos((Entity)(Entity)obj, ((Entity)(Entity)obj).height / 2);
  2473. if(spriteDrawX <= -1)
  2474. continue;
  2475. if(k1 > 0)
  2476. spriteDrawY += 19 * k1;
  2477. if(newHits)
  2478. {
  2479. if(((Entity)(Entity)obj).hitArray[k1] == 0 || ((Entity)(Entity)obj).hitType[k1] == 3)
  2480. {
  2481. block(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY);
  2482. continue;
  2483. }
  2484. if(((Entity)(Entity)obj).hitArray[k1] > 199 && ((Entity)(Entity)obj).hitDoSoak[k1] == 1 && ((Entity)(Entity)obj).hitSoak[k1] >= 1)
  2485. {
  2486. if(((Entity)(Entity)obj).hitMax[k1] == 1)
  2487. {
  2488. soakHitMax(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY, ((Entity)(Entity)obj).hitType[k1], String.valueOf(((Entity)(Entity)obj).hitArray[k1]), String.valueOf(((Entity)(Entity)obj).hitSoak[k1]));
  2489. continue;
  2490. }
  2491. if(((Entity)(Entity)obj).hitSoak[k1] > 9)
  2492. {
  2493. soakHit(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY, ((Entity)(Entity)obj).hitType[k1], ((Entity)(Entity)obj).hitMarkTypes[k1], String.valueOf(((Entity)(Entity)obj).hitArray[k1]), String.valueOf(((Entity)(Entity)obj).hitSoak[k1]));
  2494. continue;
  2495. }
  2496. if(((Entity)(Entity)obj).hitSoak[k1] < 10)
  2497. soakHit1(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY, ((Entity)(Entity)obj).hitType[k1], ((Entity)(Entity)obj).hitMarkTypes[k1], String.valueOf(((Entity)(Entity)obj).hitArray[k1]), String.valueOf(((Entity)(Entity)obj).hitSoak[k1]));
  2498. continue;
  2499. }
  2500. if(((Entity)(Entity)obj).hitArray[k1] < 10)
  2501. {
  2502. noSoakHit1(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY, ((Entity)(Entity)obj).hitMarkTypes[k1], ((Entity)(Entity)obj).hitType[k1], String.valueOf(((Entity)(Entity)obj).hitArray[k1]));
  2503. continue;
  2504. }
  2505. if(((Entity)(Entity)obj).hitArray[k1] > 9 && ((Entity)(Entity)obj).hitArray[k1] < 100)
  2506. {
  2507. noSoakHit10(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY, ((Entity)(Entity)obj).hitMarkTypes[k1], ((Entity)(Entity)obj).hitType[k1], String.valueOf(((Entity)(Entity)obj).hitArray[k1]));
  2508. continue;
  2509. }
  2510. if(((Entity)(Entity)obj).hitMax[k1] == 1)
  2511. noSoakHitMax(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY, ((Entity)(Entity)obj).hitType[k1], String.valueOf(((Entity)(Entity)obj).hitArray[k1]));
  2512. else
  2513. noSoakHit100(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY, ((Entity)(Entity)obj).hitMarkTypes[k1], ((Entity)(Entity)obj).hitType[k1], String.valueOf(((Entity)(Entity)obj).hitArray[k1]));
  2514. } else
  2515. {
  2516. hitMarks[((Entity)(Entity)obj).hitMarkTypes[k1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2517. smallText.drawText(0, String.valueOf(((Entity)(Entity)obj).hitArray[k1]), spriteDrawY + 4, spriteDrawX);
  2518. smallText.drawText(0xffffff, String.valueOf(((Entity)(Entity)obj).hitArray[k1]), spriteDrawY + 3, spriteDrawX - 1);
  2519. }
  2520. }
  2521. }
  2522. }*/
  2523. for(int k = 0; k < anInt974; k++) {
  2524. int k1 = anIntArray976[k];
  2525. int l1 = anIntArray977[k];
  2526. int j2 = anIntArray979[k];
  2527. int k2 = anIntArray978[k];
  2528. boolean flag = true;
  2529. while(flag)
  2530. {
  2531. flag = false;
  2532. for(int l2 = 0; l2 < k; l2++)
  2533. if(l1 + 2 > anIntArray977[l2] - anIntArray978[l2] && l1 - k2 < anIntArray977[l2] + 2 && k1 - j2 < anIntArray976[l2] + anIntArray979[l2] && k1 + j2 > anIntArray976[l2] - anIntArray979[l2] && anIntArray977[l2] - anIntArray978[l2] < l1)
  2534. {
  2535. l1 = anIntArray977[l2] - anIntArray978[l2];
  2536. flag = true;
  2537. }
  2538.  
  2539. }
  2540. spriteDrawX = anIntArray976[k];
  2541. spriteDrawY = anIntArray977[k] = l1;
  2542. String s = aStringArray983[k];
  2543. if(anInt1249 == 0)
  2544. {
  2545. int i3 = 0xffff00;
  2546. if(anIntArray980[k] < 6)
  2547. i3 = anIntArray965[anIntArray980[k]];
  2548. if(anIntArray980[k] == 6)
  2549. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2550. if(anIntArray980[k] == 7)
  2551. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2552. if(anIntArray980[k] == 8)
  2553. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2554. if(anIntArray980[k] == 9) {
  2555. int j3 = 150 - anIntArray982[k];
  2556. if(j3 < 50)
  2557. i3 = 0xff0000 + 1280 * j3;
  2558. else
  2559. if(j3 < 100)
  2560. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2561. else
  2562. if(j3 < 150)
  2563. i3 = 65280 + 5 * (j3 - 100);
  2564. }
  2565. if(anIntArray980[k] == 10) {
  2566. int k3 = 150 - anIntArray982[k];
  2567. if(k3 < 50)
  2568. i3 = 0xff0000 + 5 * k3;
  2569. else
  2570. if(k3 < 100)
  2571. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2572. else
  2573. if(k3 < 150)
  2574. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2575. }
  2576. if(anIntArray980[k] == 11) {
  2577. int l3 = 150 - anIntArray982[k];
  2578. if(l3 < 50)
  2579. i3 = 0xffffff - 0x50005 * l3;
  2580. else
  2581. if(l3 < 100)
  2582. i3 = 65280 + 0x50005 * (l3 - 50);
  2583. else
  2584. if(l3 < 150)
  2585. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2586. }
  2587. if(anIntArray981[k] == 0) {
  2588. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2589. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  2590. }
  2591. if(anIntArray981[k] == 1) {
  2592. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2593. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2594. }
  2595. if(anIntArray981[k] == 2) {
  2596. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2597. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2598. }
  2599. if(anIntArray981[k] == 3) {
  2600. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2601. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2602. }
  2603. if(anIntArray981[k] == 4) {
  2604. int i4 = chatTextDrawingArea.method384(s);
  2605. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2606. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2607. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2608. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2609. DrawingArea.defaultDrawingAreaSize();
  2610. }
  2611. if(anIntArray981[k] == 5) {
  2612. int j4 = 150 - anIntArray982[k];
  2613. int l4 = 0;
  2614. if(j4 < 25)
  2615. l4 = j4 - 25;
  2616. else
  2617. if(j4 > 125)
  2618. l4 = j4 - 125;
  2619. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  2620. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2621. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2622. DrawingArea.defaultDrawingAreaSize();
  2623. }
  2624. } else {
  2625. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2626. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2627. }
  2628. }
  2629. } catch(Exception e){ }
  2630. }
  2631.  
  2632. private void delFriend(long l)
  2633. {
  2634. try
  2635. {
  2636. if(l == 0L)
  2637. return;
  2638. for(int i = 0; i < friendsCount; i++)
  2639. {
  2640. if(friendsListAsLongs[i] != l)
  2641. continue;
  2642. friendsCount--;
  2643. needDrawTabArea = true;
  2644. for(int j = i; j < friendsCount; j++)
  2645. {
  2646. friendsList[j] = friendsList[j + 1];
  2647. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2648. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2649. }
  2650.  
  2651. stream.createFrame(215);
  2652. stream.writeQWord(l);
  2653. break;
  2654. }
  2655. }
  2656. catch(RuntimeException runtimeexception)
  2657. {
  2658. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2659. throw new RuntimeException();
  2660. }
  2661. }
  2662.  
  2663. public void drawSideIcons(){
  2664. if(is480 || is508 || is525) {
  2665. /* Top sideIcons */
  2666. if(tabInterfaceIDs[0] != -1)//attack
  2667. sideIcons[0].drawSprite(10+3, 4);
  2668. if(tabInterfaceIDs[1] != -1)//stat
  2669. sideIcons[1].drawSprite(43+3, 4);
  2670. if(tabInterfaceIDs[2] != -1)//quest
  2671. sideIcons[2].drawSprite(76+3, 3);
  2672. if(tabInterfaceIDs[3] != -1)//inventory
  2673. sideIcons[3].drawSprite(111+3, 5);
  2674. if(tabInterfaceIDs[4] != -1)//equipment
  2675. sideIcons[4].drawSprite(140+3, 1);
  2676. if(tabInterfaceIDs[5] != -1)//prayer
  2677. sideIcons[5].drawSprite(174+3, 1);
  2678. if(tabInterfaceIDs[6] != -1)//magic
  2679. sideIcons[6].drawSprite(208+3, 4);
  2680. /* Bottom sideIcons */
  2681. if(tabInterfaceIDs[7] != -1)//summoning
  2682. sIcons483[7].drawSprite(11+3, 303);
  2683. if(tabInterfaceIDs[8] != -1)//friends
  2684. sideIcons[8].drawSprite(46+3, 306);
  2685. if(tabInterfaceIDs[9] != -1)//ignore
  2686. sideIcons[9].drawSprite(79+3, 306);
  2687. if(tabInterfaceIDs[10] != -1)//logout
  2688. sideIcons[7].drawSprite(113+3, 302);
  2689. if(tabInterfaceIDs[11] != -1)//options
  2690. sideIcons[11].drawSprite(145+3, 304);
  2691. if(tabInterfaceIDs[12] != -1)//emotes
  2692. sideIcons[12].drawSprite(181+3, 302);
  2693. if(tabInterfaceIDs[13] != -1)//music
  2694. sideIcons[13].drawSprite(213+3, 303);
  2695. } else if(is474){
  2696. /** Top sideIcons */
  2697. if(tabInterfaceIDs[0] != -1)///attack
  2698. sideIcons[0].drawSprite(10+3, 4);
  2699. if(tabInterfaceIDs[1] != -1)///stat
  2700. sideIcons[1].drawSprite(43+3, 4);
  2701. if(tabInterfaceIDs[2] != -1)///quest
  2702. sideIcons[2].drawSprite(76+3, 3);
  2703. if(tabInterfaceIDs[3] != -1)///inventory
  2704. sideIcons[3].drawSprite(111+3, 5);
  2705. if(tabInterfaceIDs[4] != -1)///equipment
  2706. sideIcons[4].drawSprite(140+3, 1);
  2707. if(tabInterfaceIDs[5] != -1)///prayer
  2708. sideIcons[5].drawSprite(174+3, 1);
  2709. if(tabInterfaceIDs[6] != -1)///magic
  2710. sideIcons[6].drawSprite(208+3, 4);
  2711. /** Bottom sideIcons */
  2712. if(tabInterfaceIDs[7] != -1)///clan
  2713. sideIcons[7].drawSprite(11+3, 303);
  2714. if(tabInterfaceIDs[8] != -1)///friends
  2715. sideIcons[8].drawSprite(46+3, 306);
  2716. if(tabInterfaceIDs[9] != -1)///ignore
  2717. sideIcons[9].drawSprite(79+3, 306);
  2718. if(tabInterfaceIDs[10] != -1)///logout
  2719. sideIcons[10].drawSprite(113+3, 302);
  2720. if(tabInterfaceIDs[11] != -1)///options
  2721. sideIcons[11].drawSprite(145+3, 304);
  2722. if(tabInterfaceIDs[12] != -1)///emotes
  2723. sideIcons[12].drawSprite(181+3, 302);
  2724. if(tabInterfaceIDs[13] != -1)///music
  2725. sideIcons[13].drawSprite(213+3, 303);
  2726. } else if(is562){
  2727. /* Top sideIcons */
  2728. if(tabInterfaceIDs[0] != -1)
  2729. newSideIcons[0].drawSprite(8+3, 8);
  2730. if(tabInterfaceIDs[1] != -1)
  2731. newSideIcons[1].drawSprite(37+3, 8);
  2732. if(tabInterfaceIDs[2] != -1)
  2733. newSideIcons[2].drawSprite(67+3, 8);
  2734. if(tabInterfaceIDs[14] != -1)
  2735. newSideIcons[3].drawSprite(97+3, 8);
  2736. if(tabInterfaceIDs[3] != -1)
  2737. newSideIcons[4].drawSprite(127+3, 8);
  2738. if(tabInterfaceIDs[4] != -1)
  2739. newSideIcons[5].drawSprite(159+3, 8);
  2740. if(tabInterfaceIDs[5] != -1)
  2741. newSideIcons[6].drawSprite(187+3, 8);
  2742. if(tabInterfaceIDs[6] != -1)
  2743. newSideIcons[7].drawSprite(217+3, 8);
  2744. /* Bottom sideIcons */
  2745. if(tabInterfaceIDs[10] != -1)
  2746. newSideIcons[15].drawSprite(8+3, 306);
  2747. if(tabInterfaceIDs[9] != -1)
  2748. newSideIcons[8].drawSprite(38+3, 306);
  2749. if(tabInterfaceIDs[8] != -1)
  2750. newSideIcons[9].drawSprite(70+3, 306);
  2751. if(tabInterfaceIDs[7] != -1)
  2752. newSideIcons[13].drawSprite(97+3, 306);
  2753. if(tabInterfaceIDs[11] != -1)
  2754. newSideIcons[10].drawSprite(127+3, 306);
  2755. if(tabInterfaceIDs[12] != -1)
  2756. newSideIcons[11].drawSprite(157+3, 306);
  2757. if(tabInterfaceIDs[13] != -1)
  2758. newSideIcons[12].drawSprite(187+3, 306);
  2759. if(tabInterfaceIDs[15] != -1)
  2760. newSideIcons[14].drawSprite(216+3, 307);
  2761. } else {
  2762. /** Top sideIcons */
  2763. if(tabInterfaceIDs[0] != -1)///attack
  2764. sIcons459[0].drawSprite(32, 11);
  2765. if(tabInterfaceIDs[1] != -1)///stat
  2766. sIcons459[1].drawSprite(57, 9);
  2767. if(tabInterfaceIDs[2] != -1)///quest
  2768. sIcons459[2].drawSprite(86, 9);
  2769. if(tabInterfaceIDs[3] != -1)///inventory
  2770. sIcons459[3].drawSprite(116, 4);
  2771. if(tabInterfaceIDs[4] != -1)///equipment
  2772. sIcons459[4].drawSprite(155, 5);
  2773. if(tabInterfaceIDs[5] != -1)///prayer
  2774. sIcons459[5].drawSprite(183, 5);
  2775. if(tabInterfaceIDs[6] != -1)///magic
  2776. sIcons459[6].drawSprite(212, 10);
  2777. /** Bottom sideIcons */
  2778. if(tabInterfaceIDs[7] != -1)///clan
  2779. sideIcons[7].drawSprite(31, 300);
  2780. if(tabInterfaceIDs[8] != -1)///friends
  2781. sIcons459[7].drawSprite(57, 306);
  2782. if(tabInterfaceIDs[9] != -1)///ignore
  2783. sIcons459[8].drawSprite(85, 308);
  2784. if(tabInterfaceIDs[10] != -1)///logout
  2785. sIcons459[9].drawSprite(121, 302);
  2786. if(tabInterfaceIDs[11] != -1)///options
  2787. sIcons459[10].drawSprite(157, 305);
  2788. if(tabInterfaceIDs[12] != -1)///emotes
  2789. sIcons459[11].drawSprite(187, 302);
  2790. if(tabInterfaceIDs[13] != -1)///music
  2791. sIcons459[12].drawSprite(211, 302);
  2792. }
  2793. }
  2794. public void drawRedStones() {
  2795. if(is474 || is480 || is508 || is525) {
  2796. if(tabInterfaceIDs[tabID] != -1) {
  2797. switch(tabID) {
  2798. case 0:
  2799. redStones[0].drawSprite(3+3, 0);
  2800. break;
  2801. case 1:
  2802. redStones[4].drawSprite(41+3, 0);
  2803. break;
  2804. case 2:
  2805. redStones[4].drawSprite(74+3, 0);
  2806. break;
  2807. case 3:
  2808. redStones[4].drawSprite(107+3, 0);
  2809. break;
  2810. case 4:
  2811. redStones[4].drawSprite(140+3, 0);
  2812. break;
  2813. case 5:
  2814. redStones[4].drawSprite(173+3, 0);
  2815. break;
  2816. case 6:
  2817. redStones[1].drawSprite(206+3, 0);
  2818. break;
  2819. case 7:
  2820. redStones[2].drawSprite(3+3, 298);
  2821. break;
  2822. case 8:
  2823. redStones[4].drawSprite(41+3, 298);
  2824. break;
  2825. case 9:
  2826. redStones[4].drawSprite(74+3, 298);
  2827. break;
  2828. case 10:
  2829. redStones[4].drawSprite(107+3, 298);
  2830. break;
  2831. case 11:
  2832. redStones[4].drawSprite(140+3, 298);
  2833. break;
  2834. case 12:
  2835. redStones[4].drawSprite(173+3, 298);
  2836. break;
  2837. case 13:
  2838. redStones[3].drawSprite(206+3, 298);
  2839. break;
  2840. }
  2841. }
  2842. } else if(is562){
  2843. drawTabHover();
  2844. if(tabInterfaceIDs[tabID] != -1)
  2845. {
  2846. if(tabID == 0)
  2847. tabClicked.drawSprite(2+3, 0);
  2848. if(tabID == 1)
  2849. tabClicked.drawSprite(32+3, 0);
  2850. if(tabID == 2)
  2851. tabClicked.drawSprite(62+3, 0);
  2852. if(tabID == 14)
  2853. tabClicked.drawSprite(92+3, 0);
  2854. if(tabID == 3)
  2855. tabClicked.drawSprite(122+3, 0);
  2856. if(tabID == 4)
  2857. tabClicked.drawSprite(152+3, 0);
  2858. if(tabID == 5)
  2859. tabClicked.drawSprite(182+3, 0);
  2860. if(tabID == 6)
  2861. tabClicked.drawSprite(212+3, 0);
  2862. if(tabID == 16)
  2863. tabClicked.drawSprite(2+3, 298);
  2864. if(tabID == 8)
  2865. tabClicked.drawSprite(32+3, 298);
  2866. if(tabID == 9)
  2867. tabClicked.drawSprite(62+3, 298);
  2868. if(tabID == 7)
  2869. tabClicked.drawSprite(92+3, 298);
  2870. if(tabID == 11)
  2871. tabClicked.drawSprite(122+3, 298);
  2872. if(tabID == 12)
  2873. tabClicked.drawSprite(152+3, 298);
  2874. if(tabID == 13)
  2875. tabClicked.drawSprite(182+3, 298);
  2876. if(tabID == 15)
  2877. tabClicked.drawSprite(212+3, 298);
  2878. }
  2879. } else {
  2880. if(tabInterfaceIDs[tabID] != -1) {
  2881. switch(tabID) {
  2882. case 0:
  2883. redStones[5].drawSprite(16+7, 1);
  2884. break;
  2885. case 1:
  2886. redStones[13].drawSprite(48+7, 1);
  2887. break;
  2888. case 2:
  2889. redStones[13].drawSprite(75+7, 1);
  2890. break;
  2891. case 3:
  2892. redStones[7].drawSprite(103+7, 0);
  2893. break;
  2894. case 4:
  2895. redStones[14].drawSprite(146+7, 1);
  2896. break;
  2897. case 5:
  2898. redStones[14].drawSprite(174+7, 1);
  2899. break;
  2900. case 6:
  2901. redStones[6].drawSprite(202+7, 2);
  2902. break;
  2903.  
  2904. case 7:
  2905. redStones[12].drawSprite(22, 296);
  2906. break;
  2907. case 8:
  2908. redStones[9].drawSprite(54, 297);
  2909. break;
  2910. case 9:
  2911. redStones[9].drawSprite(82, 297);
  2912. break;
  2913. case 10:
  2914. redStones[10].drawSprite(110, 299);
  2915. break;
  2916. case 11:
  2917. redStones[8].drawSprite(153, 297);
  2918. break;
  2919. case 12:
  2920. redStones[8].drawSprite(181, 297);
  2921. break;
  2922. case 13:
  2923. redStones[11].drawSprite(209, 297);
  2924. break;
  2925. }
  2926. }
  2927. }
  2928. }
  2929.  
  2930. private void drawTabArea() {
  2931. inventoryBackImage.initDrawingArea();
  2932. Texture.anIntArray1472 = anIntArray1181;
  2933. tabArea[getSpriteID()].drawSprite(0, 0);
  2934. if(spriteChanged)
  2935. needDrawTabArea = true;
  2936. tabAreaAltered = true;
  2937. if(invOverlayInterfaceID == -1) {
  2938. drawRedStones();
  2939. drawSideIcons();
  2940. }
  2941. if(is474 || is480 || is508 || is525 || is562) {
  2942. if(invOverlayInterfaceID != -1)
  2943. drawInterface(0, 32, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2944. else if(tabInterfaceIDs[tabID] != -1)
  2945. drawInterface(0, 32, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2946. } else if(is562){
  2947. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  2948. tabHover.drawSprite(3, 0);
  2949. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  2950. tabHover.drawSprite(33, 0);
  2951. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  2952. tabHover.drawSprite(63, 0);
  2953. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  2954. tabHover.drawSprite(93, 0);
  2955. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  2956. tabHover.drawSprite(123, 0);
  2957. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  2958. tabHover.drawSprite(153, 0);
  2959. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  2960. tabHover.drawSprite(183, 0);
  2961. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  2962. tabHover.drawSprite(213, 0);
  2963. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  2964. tabHover.drawSprite(3, 298);
  2965. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  2966. tabHover.drawSprite(33, 298);
  2967. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  2968. tabHover.drawSprite(63, 298);
  2969. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  2970. tabHover.drawSprite(93, 298);
  2971. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  2972. tabHover.drawSprite(123, 298);
  2973. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  2974. tabHover.drawSprite(153, 298);
  2975. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  2976. tabHover.drawSprite(183,298);
  2977. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  2978. tabHover.drawSprite(213, 298);
  2979. } else {
  2980. if(invOverlayInterfaceID != -1)
  2981. drawInterface(0, 38, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2982. else if(tabInterfaceIDs[tabID] != -1)
  2983. drawInterface(0, 38, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2984. }
  2985. if(menuOpen)
  2986. drawMenu(516, 168);
  2987. inventoryBackImage.drawGraphics(168, super.graphics, 516);//519
  2988. inGameScreen.initDrawingArea();
  2989. Texture.anIntArray1472 = anIntArray1182;
  2990. }
  2991.  
  2992. private void method37(int j) {
  2993. if(!lowMem) {
  2994. if(Texture.anIntArray1480[17] >= j) {
  2995.  
  2996. Background background = Texture.aBackgroundArray1474s[17];
  2997. int k = background.anInt1452 * background.anInt1453 - 1;
  2998. //fire cape apparently?
  2999. int j1 = background.anInt1452 * anInt945 * 2;
  3000. byte abyte0[] = background.aByteArray1450;
  3001. byte abyte3[] = aByteArray912;
  3002. for(int i2 = 0; i2 <= k; i2++)
  3003. abyte3[i2] = abyte0[i2 - j1 & k];
  3004.  
  3005. background.aByteArray1450 = abyte3;
  3006. aByteArray912 = abyte0;
  3007. Texture.method370(17);
  3008. anInt854++;
  3009. if(anInt854 > 1235) {
  3010. anInt854 = 0;
  3011. stream.createFrame(226);
  3012. stream.writeWordBigEndian(0);
  3013. int l2 = stream.currentOffset;
  3014. stream.writeWord(58722);
  3015. stream.writeWordBigEndian(240);
  3016. stream.writeWord((int)(Math.random() * 65536D));
  3017. stream.writeWordBigEndian((int)(Math.random() * 256D));
  3018. if((int)(Math.random() * 2D) == 0)
  3019. stream.writeWord(51825);
  3020. stream.writeWordBigEndian((int)(Math.random() * 256D));
  3021. stream.writeWord((int)(Math.random() * 65536D));
  3022. stream.writeWord(7130);
  3023. stream.writeWord((int)(Math.random() * 65536D));
  3024. stream.writeWord(61657);
  3025. stream.writeBytes(stream.currentOffset - l2);
  3026. }
  3027. }
  3028. if(Texture.anIntArray1480[24] >= j) {
  3029. Background background_1 = Texture.aBackgroundArray1474s[24];
  3030. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  3031. int k1 = background_1.anInt1452 * anInt945 * 2;
  3032. byte abyte1[] = background_1.aByteArray1450;
  3033. byte abyte4[] = aByteArray912;
  3034. for(int j2 = 0; j2 <= l; j2++)
  3035. abyte4[j2] = abyte1[j2 - k1 & l];
  3036.  
  3037. background_1.aByteArray1450 = abyte4;
  3038. aByteArray912 = abyte1;
  3039. Texture.method370(24);
  3040. }
  3041. if(Texture.anIntArray1480[34] >= j) {
  3042. Background background_2 = Texture.aBackgroundArray1474s[34];
  3043. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3044. int l1 = background_2.anInt1452 * anInt945 * 2;
  3045. byte abyte2[] = background_2.aByteArray1450;
  3046. byte abyte5[] = aByteArray912;
  3047. for(int k2 = 0; k2 <= i1; k2++)
  3048. abyte5[k2] = abyte2[k2 - l1 & i1];
  3049.  
  3050. background_2.aByteArray1450 = abyte5;
  3051. aByteArray912 = abyte2;
  3052. Texture.method370(34);
  3053. }
  3054. if(Texture.anIntArray1480[40] >= j)
  3055. {
  3056. Background background_2 = Texture.aBackgroundArray1474s[40];
  3057. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3058. int l1 = background_2.anInt1452 * anInt945 * 2;
  3059. byte abyte2[] = background_2.aByteArray1450;
  3060. byte abyte5[] = aByteArray912;
  3061. for(int k2 = 0; k2 <= i1; k2++)
  3062. abyte5[k2] = abyte2[k2 - l1 & i1];
  3063.  
  3064. background_2.aByteArray1450 = abyte5;
  3065. aByteArray912 = abyte2;
  3066. Texture.method370(40);
  3067.  
  3068. }
  3069. }
  3070. }
  3071.  
  3072. private void method38() {
  3073. for(int i = -1; i < playerCount; i++) {
  3074. int j;
  3075. if(i == -1)
  3076. j = myPlayerIndex;
  3077. else
  3078. j = playerIndices[i];
  3079. Player player = playerArray[j];
  3080. if(player != null && player.textCycle > 0) {
  3081. player.textCycle--;
  3082. if(player.textCycle == 0)
  3083. player.textSpoken = null;
  3084. }
  3085. }
  3086. for(int k = 0; k < npcCount; k++) {
  3087. int l = npcIndices[k];
  3088. NPC npc = npcArray[l];
  3089. if(npc != null && npc.textCycle > 0) {
  3090. npc.textCycle--;
  3091. if(npc.textCycle == 0)
  3092. npc.textSpoken = null;
  3093. }
  3094. }
  3095. }
  3096.  
  3097. private void calcCameraPos() {
  3098.  
  3099. int i = anInt1098 * 128 + 64;
  3100. int j = anInt1099 * 128 + 64;
  3101. int k = method42(plane, j, i) - anInt1100;
  3102. if(xCameraPos < i) {
  3103. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  3104. if(xCameraPos > i)
  3105. xCameraPos = i;
  3106. }
  3107. if(xCameraPos > i) {
  3108. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  3109. if(xCameraPos < i)
  3110. xCameraPos = i;
  3111. }
  3112. if(zCameraPos < k) {
  3113. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  3114. if(zCameraPos > k)
  3115. zCameraPos = k;
  3116. }
  3117. if(zCameraPos > k) {
  3118. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  3119. if(zCameraPos < k)
  3120. zCameraPos = k;
  3121. }
  3122. if(yCameraPos < j) {
  3123. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  3124. if(yCameraPos > j)
  3125. yCameraPos = j;
  3126. }
  3127. if(yCameraPos > j) {
  3128. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  3129. if(yCameraPos < j)
  3130. yCameraPos = j;
  3131. }
  3132. i = anInt995 * 128 + 64;
  3133. j = anInt996 * 128 + 64;
  3134. k = method42(plane, j, i) - anInt997;
  3135. int l = i - xCameraPos;
  3136. int i1 = k - zCameraPos;
  3137. int j1 = j - yCameraPos;
  3138. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  3139. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  3140. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  3141. if(l1 < 128)
  3142. l1 = 128;
  3143. if(l1 > 383)
  3144. l1 = 383;
  3145. if(yCameraCurve < l1) {
  3146. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  3147. if(yCameraCurve > l1)
  3148. yCameraCurve = l1;
  3149. }
  3150. if(yCameraCurve > l1) {
  3151. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  3152. if(yCameraCurve < l1)
  3153. yCameraCurve = l1;
  3154. }
  3155. int j2 = i2 - xCameraCurve;
  3156. if(j2 > 1024)
  3157. j2 -= 2048;
  3158. if(j2 < -1024)
  3159. j2 += 2048;
  3160. if(j2 > 0) {
  3161. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  3162. xCameraCurve &= 0x7ff;
  3163. }
  3164. if(j2 < 0) {
  3165. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  3166. xCameraCurve &= 0x7ff;
  3167. }
  3168. int k2 = i2 - xCameraCurve;
  3169. if(k2 > 1024)
  3170. k2 -= 2048;
  3171. if(k2 < -1024)
  3172. k2 += 2048;
  3173. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  3174. xCameraCurve = i2;
  3175. }
  3176.  
  3177. private void drawMenu(int xOffSet, int yOffSet) {
  3178. if(menuToggle == false) {
  3179. int xPos = menuOffsetX - (xOffSet - 4);
  3180. int yPos = (-yOffSet + 4) + menuOffsetY;
  3181. int menuW = menuWidth;
  3182. int menuH = menuHeight + 1;
  3183. int color = 0x5d5447;
  3184. needDrawTabArea = true;
  3185. inputTaken = true;
  3186. tabAreaAltered = true;
  3187. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  3188. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  3189. DrawingArea.drawPixels(menuH, yPos, xPos, color, menuW);
  3190. DrawingArea.drawPixels(16, yPos + 1, xPos + 1, 0, menuW - 2);
  3191. DrawingArea.fillPixels(xPos + 1, menuW - 2, menuH - 19, 0, yPos + 18);
  3192. chatTextDrawingArea.method385(color, "Choose Option", yPos + 14, xPos + 3);
  3193. int mouseX = super.mouseX - (xOffSet);
  3194. int mouseY = (-yOffSet) + super.mouseY;
  3195. for(int l1 = 0; l1 < menuActionRow; l1++) {
  3196. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  3197. int disColor = 0xffffff;
  3198. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3)
  3199. disColor = 0xffff00;
  3200. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  3201. }
  3202. } else if(menuToggle == true) {
  3203. int xPos = menuOffsetX - (xOffSet - 4);
  3204. int yPos = (-yOffSet + 4) + menuOffsetY;
  3205. int menuW = menuWidth;
  3206. int menuH = menuHeight + 1;
  3207. needDrawTabArea = true;
  3208. inputTaken = true;
  3209. tabAreaAltered = true;
  3210. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  3211. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  3212. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  3213. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e, menuW - 2);
  3214. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  3215. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822, menuW - 6);
  3216. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822, menuW - 4);
  3217. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822, menuW - 2);
  3218. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d, menuW - 4);
  3219. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d, menuW - 6);
  3220. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c, menuW - 6);
  3221. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  3222. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  3223. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  3224. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  3225. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  3226. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  3227. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  3228. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  3229. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  3230. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  3231. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  3232. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  3233. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  3234. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  3235. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  3236. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  3237. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  3238. chatTextDrawingArea.method385(0xc6b895, "Choose Option", yPos + 14, xPos + 3);
  3239. int j1 = super.mouseX;
  3240. int k1 = super.mouseY;
  3241. int mouseX = super.mouseX - (xOffSet);
  3242. int mouseY = (-yOffSet) + super.mouseY;
  3243. for(int l1 = 0; l1 < menuActionRow; l1++) {
  3244. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  3245. int disColor = 0xc6b895;
  3246. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  3247. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  3248. disColor = 0xeee5c6;
  3249. }
  3250. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  3251. }
  3252. }
  3253. }
  3254.  
  3255. private void addFriend(long l) {
  3256. try {
  3257. if(l == 0L)
  3258. return;
  3259. if(friendsCount >= 100 && anInt1046 != 1) {
  3260. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3261. return;
  3262. }
  3263. if(friendsCount >= 200) {
  3264. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3265. return;
  3266. }
  3267. String s = TextClass.fixName(TextClass.nameForLong(l));
  3268. for(int i = 0; i < friendsCount; i++)
  3269. if(friendsListAsLongs[i] == l) {
  3270. pushMessage(s + " is already on your friend list", 0, "");
  3271. return;
  3272. }
  3273. for(int j = 0; j < ignoreCount; j++)
  3274. if(ignoreListAsLongs[j] == l) {
  3275. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  3276. return;
  3277. }
  3278.  
  3279. if(s.equals(myPlayer.name)) {
  3280. return;
  3281. } else {
  3282. friendsList[friendsCount] = s;
  3283. friendsListAsLongs[friendsCount] = l;
  3284. friendsNodeIDs[friendsCount] = 0;
  3285. friendsCount++;
  3286. needDrawTabArea = true;
  3287. stream.createFrame(188);
  3288. stream.writeQWord(l);
  3289. return;
  3290. }
  3291. } catch(RuntimeException runtimeexception) {
  3292. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  3293. }
  3294. throw new RuntimeException();
  3295. }
  3296.  
  3297. private int method42(int i, int j, int k) {
  3298. int l = k >> 7;
  3299. int i1 = j >> 7;
  3300. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  3301. return 0;
  3302. int j1 = i;
  3303. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  3304. j1++;
  3305. int k1 = k & 0x7f;
  3306. int l1 = j & 0x7f;
  3307. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  3308. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  3309. return i2 * (128 - l1) + j2 * l1 >> 7;
  3310. }
  3311.  
  3312. private static String intToKOrMil(int j) {
  3313. if(j < 0x186a0)
  3314. return String.valueOf(j);
  3315. if(j < 0x989680)
  3316. return j / 1000 + "K";
  3317. else
  3318. return j / 0xf4240 + "M";
  3319. }
  3320. public int canWalkDelay = 0;
  3321. public int getDis(int coordX1, int coordY1, int coordX2, int coordY2)
  3322. {
  3323. int deltaX = coordX2 - coordX1;
  3324. int deltaY = coordY2 - coordY1;
  3325. return ((int)Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)));
  3326. }
  3327. public int random(int range)
  3328. {
  3329. return (int)(Math.random() * range);
  3330. }
  3331. public boolean withinDistance(int x1, int y1, int x2, int y2, int dis)
  3332. {
  3333. for (int i = 0; i <= dis; i++)
  3334. {
  3335. try{
  3336. if ((x1 + i) == x2 && ((y1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3337. return true;
  3338. else
  3339. if ((x1 - i) == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3340. return true;
  3341. else
  3342. if (x1 == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3343. return true;
  3344. } catch(Exception ex){
  3345. System.out.println("Exception in following, method : WithingDistance");
  3346. }
  3347. }
  3348. return false;
  3349. }
  3350.  
  3351. private void resetLogout() {
  3352. try {
  3353. if(socketStream != null)
  3354. socketStream.close();
  3355. }
  3356. catch(Exception _ex) { }
  3357. socketStream = null;
  3358. alertHandler.alert = null;
  3359. loggedIn = false;
  3360. runClicked = true;
  3361. musicOrb = false;
  3362. restOrb = false;
  3363. followPlayer = 0;
  3364. followNPC = 0;
  3365. followDistance = 1;
  3366. prayClicked = false;
  3367. xpClicked = false;
  3368. drawXpBar = false;
  3369. loginScreenState = 0;
  3370. //myUsername = "";
  3371. //myPassword = "";
  3372. unlinkMRUNodes();
  3373. worldController.initToNull();
  3374. for(int i = 0; i < 4; i++)
  3375. aClass11Array1230[i].method210();
  3376. System.gc();
  3377. stopMidi();
  3378. currentSong = -1;
  3379. nextSong = -1;
  3380. prevSong = 0;
  3381. }
  3382.  
  3383. private void method45() {
  3384.  
  3385.  
  3386. aBoolean1031 = true;
  3387. for(int j = 0; j < 7; j++) {
  3388. anIntArray1065[j] = -1;
  3389. for(int k = 0; k < IdentityKit.length; k++) {
  3390. if(IdentityKit.cache[k].aBoolean662 || IdentityKit.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  3391. continue;
  3392. anIntArray1065[j] = k;
  3393. break;
  3394. }
  3395. }
  3396. }
  3397.  
  3398. private void method46(int i, Stream stream) {
  3399. while(stream.bitPosition + 21 < i * 8) {
  3400. int k = stream.readBits(14);
  3401. if(k == 16383)
  3402. break;
  3403. if(npcArray[k] == null)
  3404. npcArray[k] = new NPC();
  3405. NPC npc = npcArray[k];
  3406. npcIndices[npcCount++] = k;
  3407. npc.anInt1537 = loopCycle;
  3408. int l = stream.readBits(5);
  3409. if(l > 15)
  3410. l -= 32;
  3411. int i1 = stream.readBits(5);
  3412. if(i1 > 15)
  3413. i1 -= 32;
  3414. int j1 = stream.readBits(1);
  3415. npc.desc = EntityDef.forID(stream.readBits(14));//NPC FIX
  3416. int k1 = stream.readBits(1);
  3417. if(k1 == 1)
  3418. anIntArray894[anInt893++] = k;
  3419. npc.anInt1540 = npc.desc.aByte68;
  3420. npc.anInt1504 = npc.desc.anInt79;
  3421. npc.anInt1554 = npc.desc.anInt67;
  3422. npc.anInt1555 = npc.desc.anInt58;
  3423. npc.anInt1556 = npc.desc.anInt83;
  3424. npc.anInt1557 = npc.desc.anInt55;
  3425. npc.anInt1511 = npc.desc.anInt77;
  3426. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  3427. }
  3428. stream.finishBitAccess();
  3429. }
  3430.  
  3431. public void processGameLoop() {
  3432.  
  3433.  
  3434. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  3435. return;
  3436. loopCycle++;
  3437. if(!loggedIn)
  3438. processLoginScreenInput();
  3439. else
  3440. mainGameProcessor();
  3441. processOnDemandQueue();
  3442. }
  3443.  
  3444. private void method47(boolean flag) {
  3445. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  3446. destX = 0;
  3447. int j = playerCount;
  3448. if(flag)
  3449. j = 1;
  3450. for(int l = 0; l < j; l++) {
  3451. Player player;
  3452. int i1;
  3453. if(flag) {
  3454. player = myPlayer;
  3455. i1 = myPlayerIndex << 14;
  3456. } else {
  3457. player = playerArray[playerIndices[l]];
  3458. i1 = playerIndices[l] << 14;
  3459. }
  3460. if(player == null || !player.isVisible())
  3461. continue;
  3462. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  3463. int j1 = player.x >> 7;
  3464. int k1 = player.y >> 7;
  3465. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3466. continue;
  3467. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  3468. player.aBoolean1699 = false;
  3469. player.anInt1709 = method42(plane, player.y, player.x);
  3470. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  3471. continue;
  3472. }
  3473. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3474. if(anIntArrayArray929[j1][k1] == anInt1265)
  3475. continue;
  3476. anIntArrayArray929[j1][k1] = anInt1265;
  3477. }
  3478. player.anInt1709 = method42(plane, player.y, player.x);
  3479. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  3480. }
  3481. }
  3482.  
  3483. private boolean promptUserForInput(RSInterface class9) {
  3484. int j = class9.contentType;
  3485. if(anInt900 == 2) {
  3486. if(j == 201) {
  3487. inputTaken = true;
  3488. inputDialogState = 0;
  3489. messagePromptRaised = true;
  3490. promptInput = "";
  3491. friendsListAction = 1;
  3492. aString1121 = "Enter name of friend to add to list";
  3493. }
  3494. if(j == 202) {
  3495. inputTaken = true;
  3496. inputDialogState = 0;
  3497. messagePromptRaised = true;
  3498. promptInput = "";
  3499. friendsListAction = 2;
  3500. aString1121 = "Enter name of friend to delete from list";
  3501. }
  3502. }
  3503. if(j == 205) {
  3504. anInt1011 = 250;
  3505. return true;
  3506. }
  3507. if(j == 501) {
  3508. inputTaken = true;
  3509. inputDialogState = 0;
  3510. messagePromptRaised = true;
  3511. promptInput = "";
  3512. friendsListAction = 4;
  3513. aString1121 = "Enter name of player to add to list";
  3514. }
  3515. if(j == 502) {
  3516. inputTaken = true;
  3517. inputDialogState = 0;
  3518. messagePromptRaised = true;
  3519. promptInput = "";
  3520. friendsListAction = 5;
  3521. aString1121 = "Enter name of player to delete from list";
  3522. }
  3523. if(j == 550) {
  3524. inputTaken = true;
  3525. inputDialogState = 0;
  3526. messagePromptRaised = true;
  3527. promptInput = "";
  3528. friendsListAction = 6;
  3529. aString1121 = "Enter the name of the chat you wish to join";
  3530. }
  3531. if(j >= 300 && j <= 313) {
  3532. int k = (j - 300) / 2;
  3533. int j1 = j & 1;
  3534. int i2 = anIntArray1065[k];
  3535. if(i2 != -1) {
  3536. do {
  3537. if(j1 == 0 && --i2 < 0)
  3538. i2 = IdentityKit.length - 1;
  3539. if(j1 == 1 && ++i2 >= IdentityKit.length)
  3540. i2 = 0;
  3541. } while(IdentityKit.cache[i2].aBoolean662 || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3542. anIntArray1065[k] = i2;
  3543. aBoolean1031 = true;
  3544. }
  3545. }
  3546. if(j >= 314 && j <= 323) {
  3547. int l = (j - 314) / 2;
  3548. int k1 = j & 1;
  3549. int j2 = anIntArray990[l];
  3550. if(k1 == 0 && --j2 < 0)
  3551. j2 = anIntArrayArray1003[l].length - 1;
  3552. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3553. j2 = 0;
  3554. anIntArray990[l] = j2;
  3555. aBoolean1031 = true;
  3556. }
  3557. if(j == 324 && !aBoolean1047) {
  3558. aBoolean1047 = true;
  3559. method45();
  3560. }
  3561. if(j == 325 && aBoolean1047) {
  3562. aBoolean1047 = false;
  3563. method45();
  3564. }
  3565. if(j == 326) {
  3566. stream.createFrame(101);
  3567. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3568. for(int i1 = 0; i1 < 7; i1++)
  3569. stream.writeWordBigEndian(anIntArray1065[i1]);
  3570.  
  3571. for(int l1 = 0; l1 < 5; l1++)
  3572. stream.writeWordBigEndian(anIntArray990[l1]);
  3573.  
  3574. return true;
  3575. }
  3576. if(j == 613)
  3577. canMute = !canMute;
  3578. if(j >= 601 && j <= 612) {
  3579. clearTopInterfaces();
  3580. if(reportAbuseInput.length() > 0) {
  3581. stream.createFrame(218);
  3582. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3583. stream.writeWordBigEndian(j - 601);
  3584. stream.writeWordBigEndian(canMute ? 1 : 0);
  3585. }
  3586. }
  3587. return false;
  3588. }
  3589.  
  3590. private void method49(Stream stream) {
  3591. for(int j = 0; j < anInt893; j++) {
  3592. int k = anIntArray894[j];
  3593. Player player = playerArray[k];
  3594. int l = stream.readUnsignedByte();
  3595. if((l & 0x40) != 0)
  3596. l += stream.readUnsignedByte() << 8;
  3597. method107(l, k, stream, player);
  3598. }
  3599. }
  3600.  
  3601. private void method50(int i, int k, int l, int i1, int j1) {
  3602. int k1 = worldController.method300(j1, l, i);
  3603. if(k1 != 0) {
  3604. int l1 = worldController.method304(j1, l, i, k1);
  3605. int k2 = l1 >> 6 & 3;
  3606. int i3 = l1 & 0x1f;
  3607. int k3 = k;
  3608. if(k1 > 0)
  3609. k3 = i1;
  3610. int ai[] = aSprite_1263.myPixels;
  3611. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3612. int i5 = k1 >> 14 & 0x7fff;
  3613. ObjectDef class46_2 = ObjectDef.forID(i5);
  3614. if(class46_2.anInt758 != -1) {
  3615. Background background_2 = mapScenes[class46_2.anInt758];
  3616. if(background_2 != null) {
  3617. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3618. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3619. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  3620. }
  3621. } else {
  3622. if(i3 == 0 || i3 == 2)
  3623. if(k2 == 0) {
  3624. ai[k4] = k3;
  3625. ai[k4 + 512] = k3;
  3626. ai[k4 + 1024] = k3;
  3627. ai[k4 + 1536] = k3;
  3628. } else if(k2 == 1) {
  3629. ai[k4] = k3;
  3630. ai[k4 + 1] = k3;
  3631. ai[k4 + 2] = k3;
  3632. ai[k4 + 3] = k3;
  3633. } else if(k2 == 2) {
  3634. ai[k4 + 3] = k3;
  3635. ai[k4 + 3 + 512] = k3;
  3636. ai[k4 + 3 + 1024] = k3;
  3637. ai[k4 + 3 + 1536] = k3;
  3638. } else if(k2 == 3) {
  3639. ai[k4 + 1536] = k3;
  3640. ai[k4 + 1536 + 1] = k3;
  3641. ai[k4 + 1536 + 2] = k3;
  3642. ai[k4 + 1536 + 3] = k3;
  3643. }
  3644. if(i3 == 3)
  3645. if(k2 == 0)
  3646. ai[k4] = k3;
  3647. else if(k2 == 1)
  3648. ai[k4 + 3] = k3;
  3649. else if(k2 == 2)
  3650. ai[k4 + 3 + 1536] = k3;
  3651. else if(k2 == 3)
  3652. ai[k4 + 1536] = k3;
  3653. if(i3 == 2)
  3654. if(k2 == 3) {
  3655. ai[k4] = k3;
  3656. ai[k4 + 512] = k3;
  3657. ai[k4 + 1024] = k3;
  3658. ai[k4 + 1536] = k3;
  3659. } else if(k2 == 0) {
  3660. ai[k4] = k3;
  3661. ai[k4 + 1] = k3;
  3662. ai[k4 + 2] = k3;
  3663. ai[k4 + 3] = k3;
  3664. } else if(k2 == 1) {
  3665. ai[k4 + 3] = k3;
  3666. ai[k4 + 3 + 512] = k3;
  3667. ai[k4 + 3 + 1024] = k3;
  3668. ai[k4 + 3 + 1536] = k3;
  3669. } else if(k2 == 2) {
  3670. ai[k4 + 1536] = k3;
  3671. ai[k4 + 1536 + 1] = k3;
  3672. ai[k4 + 1536 + 2] = k3;
  3673. ai[k4 + 1536 + 3] = k3;
  3674. }
  3675. }
  3676. }
  3677. k1 = worldController.method302(j1, l, i);
  3678. if(k1 != 0) {
  3679. int i2 = worldController.method304(j1, l, i, k1);
  3680. int l2 = i2 >> 6 & 3;
  3681. int j3 = i2 & 0x1f;
  3682. int l3 = k1 >> 14 & 0x7fff;
  3683. ObjectDef class46_1 = ObjectDef.forID(l3);
  3684. if(class46_1.anInt758 != -1) {
  3685. Background background_1 = mapScenes[class46_1.anInt758];
  3686. if(background_1 != null) {
  3687. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3688. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3689. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  3690. }
  3691. } else if(j3 == 9) {
  3692. int l4 = 0xeeeeee;
  3693. if(k1 > 0)
  3694. l4 = 0xee0000;
  3695. int ai1[] = aSprite_1263.myPixels;
  3696. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3697. if(l2 == 0 || l2 == 2) {
  3698. ai1[l5 + 1536] = l4;
  3699. ai1[l5 + 1024 + 1] = l4;
  3700. ai1[l5 + 512 + 2] = l4;
  3701. ai1[l5 + 3] = l4;
  3702. } else {
  3703. ai1[l5] = l4;
  3704. ai1[l5 + 512 + 1] = l4;
  3705. ai1[l5 + 1024 + 2] = l4;
  3706. ai1[l5 + 1536 + 3] = l4;
  3707. }
  3708. }
  3709. }
  3710. k1 = worldController.method303(j1, l, i);
  3711. if(k1 != 0) {
  3712. int j2 = k1 >> 14 & 0x7fff;
  3713. ObjectDef class46 = ObjectDef.forID(j2);
  3714. if(class46.anInt758 != -1) {
  3715. Background background = mapScenes[class46.anInt758];
  3716. if(background != null) {
  3717. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3718. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3719. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3720. }
  3721. }
  3722. }
  3723. }
  3724.  
  3725. private void loadTitleScreen() {
  3726. if(normalLogin == true)
  3727. titleBox = new Background(titleStreamLoader, "titlebox", 0);
  3728. else
  3729. titleBox1 = new Sprite("Login/Random/TITLEBOX");
  3730. titleButton = new Background(titleStreamLoader, "titlebutton", 0);
  3731. aBackgroundArray1152s = new Background[12];
  3732. int j = 0;
  3733. try {
  3734. j = Integer.parseInt(getParameter("fl_icon"));
  3735. } catch(Exception _ex) {
  3736. }
  3737. if(j == 0) {
  3738. for(int k = 0; k < 12; k++)
  3739. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3740.  
  3741. } else {
  3742. for(int l = 0; l < 12; l++)
  3743. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3744.  
  3745. }
  3746. aSprite_1201 = new Sprite(128, 265);
  3747. aSprite_1202 = new Sprite(128, 265);
  3748. System.arraycopy(leftSideFlame.anIntArray315, 0, aSprite_1201.myPixels, 0, 33920);
  3749.  
  3750. System.arraycopy(rightSideFlame.anIntArray315, 0, aSprite_1202.myPixels, 0, 33920);
  3751.  
  3752. anIntArray851 = new int[256];
  3753. for(int k1 = 0; k1 < 64; k1++)
  3754. anIntArray851[k1] = k1 * 0x40000;
  3755.  
  3756. for(int l1 = 0; l1 < 64; l1++)
  3757. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3758.  
  3759. for(int i2 = 0; i2 < 64; i2++)
  3760. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3761.  
  3762. for(int j2 = 0; j2 < 64; j2++)
  3763. anIntArray851[j2 + 192] = 0xffffff;
  3764.  
  3765. anIntArray852 = new int[256];
  3766. for(int k2 = 0; k2 < 64; k2++)
  3767. anIntArray852[k2] = k2 * 1024;
  3768.  
  3769. for(int l2 = 0; l2 < 64; l2++)
  3770. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3771.  
  3772. for(int i3 = 0; i3 < 64; i3++)
  3773. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3774.  
  3775. for(int j3 = 0; j3 < 64; j3++)
  3776. anIntArray852[j3 + 192] = 0xffffff;
  3777.  
  3778. anIntArray853 = new int[256];
  3779. for(int k3 = 0; k3 < 64; k3++)
  3780. anIntArray853[k3] = k3 * 4;
  3781.  
  3782. for(int l3 = 0; l3 < 64; l3++)
  3783. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3784.  
  3785. for(int i4 = 0; i4 < 64; i4++)
  3786. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3787.  
  3788. for(int j4 = 0; j4 < 64; j4++)
  3789. anIntArray853[j4 + 192] = 0xffffff;
  3790.  
  3791. anIntArray850 = new int[256];
  3792. anIntArray1190 = new int[32768];
  3793. anIntArray1191 = new int[32768];
  3794. randomizeBackground(null);
  3795. anIntArray828 = new int[32768];
  3796. anIntArray829 = new int[32768];
  3797. if(!aBoolean831) {
  3798. drawFlames = true;
  3799. aBoolean831 = true;
  3800. startRunnable(this, 2);
  3801. }
  3802. }
  3803.  
  3804. private static void setHighMem() {
  3805. WorldController.lowMem = true;
  3806. Texture.lowMem = false;
  3807. lowMem = false;
  3808. ObjectManager.lowMem = false;
  3809. ObjectDef.lowMem = false;
  3810. }
  3811.  
  3812. public static void main(String args[]) {
  3813. try {
  3814. nodeID = 10;
  3815. portOff = 0;
  3816. setHighMem(); //sets high or low detail
  3817. isMembers = true;
  3818. signlink.storeid = 32;
  3819. signlink.startpriv(InetAddress.getLocalHost());
  3820. instance = new client();
  3821. instance.createClientFrame(503, 765);//client frame size
  3822. } catch(Exception e) {
  3823. e.printStackTrace();
  3824. }
  3825. }
  3826.  
  3827. public static client instance;
  3828.  
  3829. private void loadingStages()
  3830. {
  3831. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane)
  3832. {
  3833. inGameScreen.initDrawingArea();
  3834. loadingPleaseWait.drawSprite(8,9);;
  3835. inGameScreen.drawGraphics(4, super.graphics, 4);
  3836. loadingStage = 1;
  3837. aLong824 = System.currentTimeMillis();
  3838. }
  3839. if(loadingStage == 1)
  3840. {
  3841. int j = method54();
  3842. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L)
  3843. {
  3844. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3845. aLong824 = System.currentTimeMillis();
  3846. }
  3847. }
  3848. if(loadingStage == 2 && plane != anInt985)
  3849. {
  3850. anInt985 = plane;
  3851. method24(plane);
  3852. }
  3853. }
  3854.  
  3855. private int method54() {
  3856. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  3857. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3858. return -1;
  3859. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3860. return -2;
  3861. }
  3862. boolean flag = true;
  3863. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  3864. byte abyte0[] = aByteArrayArray1247[j];
  3865. if(abyte0 != null) {
  3866. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3867. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3868. if(aBoolean1159) {
  3869. k = 10;
  3870. l = 10;
  3871. }
  3872. flag &= ObjectManager.method189(k, abyte0, l);
  3873. }
  3874. }
  3875. if(!flag)
  3876. return -3;
  3877. if(aBoolean1080) {
  3878. return -4;
  3879. } else {
  3880. loadingStage = 2;
  3881. ObjectManager.anInt131 = plane;
  3882. method22();
  3883. stream.createFrame(121);
  3884. return 0;
  3885. }
  3886. }
  3887.  
  3888. private void method55()
  3889. {
  3890. for(Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetNext())
  3891. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3892. class30_sub2_sub4_sub4.unlink();
  3893. else
  3894. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  3895. {
  3896. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  3897. {
  3898. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3899. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3900. class30_sub2_sub4_sub4.method455(loopCycle, npc.y, method42(class30_sub2_sub4_sub4.anInt1597, npc.y, npc.x) - class30_sub2_sub4_sub4.anInt1583, npc.x);
  3901. }
  3902. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  3903. {
  3904. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3905. Player player;
  3906. if(j == unknownInt10)
  3907. player = myPlayer;
  3908. else
  3909. player = playerArray[j];
  3910. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3911. class30_sub2_sub4_sub4.method455(loopCycle, player.y, method42(class30_sub2_sub4_sub4.anInt1597, player.y, player.x) - class30_sub2_sub4_sub4.anInt1583, player.x);
  3912. }
  3913. class30_sub2_sub4_sub4.method456(anInt945);
  3914. worldController.method285(plane, class30_sub2_sub4_sub4.anInt1595, (int)class30_sub2_sub4_sub4.aDouble1587, -1, (int)class30_sub2_sub4_sub4.aDouble1586, 60, (int)class30_sub2_sub4_sub4.aDouble1585, class30_sub2_sub4_sub4, false);
  3915. }
  3916.  
  3917. }
  3918.  
  3919. public AppletContext getAppletContext()
  3920. {
  3921. if(signlink.mainapp != null)
  3922. return signlink.mainapp.getAppletContext();
  3923. else
  3924. return super.getAppletContext();
  3925. }
  3926.  
  3927. private void drawLogo() {
  3928. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3929. Sprite sprite = new Sprite(abyte0, this);
  3930. if(normalLogin == true) {
  3931. leftSideFlame.initDrawingArea();
  3932. sprite.method346(0, 0);
  3933. rightSideFlame.initDrawingArea();
  3934. sprite.method346(-637, 0);
  3935. aRSImageProducer_1107.initDrawingArea();
  3936. sprite.method346(-128, 0);
  3937. aRSImageProducer_1108.initDrawingArea();
  3938. sprite.method346(-202, -371);
  3939. loginScreenArea.initDrawingArea();
  3940. sprite.method346(-202, -171);
  3941. gameLogo.initDrawingArea();
  3942. sprite.method346(0, -265);
  3943. aRSImageProducer_1113.initDrawingArea();
  3944. sprite.method346(-562, -265);
  3945. aRSImageProducer_1114.initDrawingArea();
  3946. sprite.method346(-128, -171);
  3947. aRSImageProducer_1115.initDrawingArea();
  3948. sprite.method346(-562, -171);
  3949. int ai[] = new int[sprite.myWidth];
  3950. for(int j = 0; j < sprite.myHeight; j++) {
  3951. for(int k = 0; k < sprite.myWidth; k++)
  3952. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3953. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3954. }
  3955. if(normalLogin == true) {
  3956. /*leftSideFlame.initDrawingArea();
  3957. sprite.method346(382, 0);
  3958. rightSideFlame.initDrawingArea();
  3959. sprite.method346(-255, 0);
  3960. aRSImageProducer_1107.initDrawingArea();
  3961. sprite.method346(254, 0);
  3962. aRSImageProducer_1108.initDrawingArea();
  3963. sprite.method346(180, -371);
  3964. loginScreenArea.initDrawingArea();
  3965. sprite.method346(180, -171);
  3966. gameLogo.initDrawingArea();
  3967. sprite.method346(382, -265);
  3968. aRSImageProducer_1113.initDrawingArea();
  3969. sprite.method346(-180, -265);
  3970. aRSImageProducer_1114.initDrawingArea();
  3971. sprite.method346(254, -171);
  3972. aRSImageProducer_1115.initDrawingArea();
  3973. sprite.method346(-180, -171);*/
  3974. sprite = new Sprite(titleStreamLoader, "logo", 0);
  3975. aRSImageProducer_1107.initDrawingArea();
  3976. //sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3977. }
  3978. } else {
  3979. int ai[] = new int[sprite.myWidth];
  3980. for(int j = 0; j < sprite.myHeight; j++) {
  3981. for(int k = 0; k < sprite.myWidth; k++)
  3982. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3983. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3984. }
  3985. LFull = new Sprite("Login/Random/LFull.png");
  3986. LEmpty = new Sprite("Login/Random/LEmpty.png");
  3987. Sprite logo = new Sprite(sign.signlink.findcachedir()+"/Sprites/Logo.PNG");
  3988. logo.drawSprite(385-174-174, 14+25);
  3989. loginScreenArea.initDrawingArea();
  3990. sprite.method346(0, 0);
  3991. }
  3992. sprite = null;
  3993. Object obj = null;
  3994. Object obj1 = null;
  3995. System.gc();
  3996. }
  3997.  
  3998. private void processOnDemandQueue()
  3999. {
  4000. do
  4001. {
  4002. OnDemandData onDemandData;
  4003. do
  4004. {
  4005. onDemandData = onDemandFetcher.getNextNode();
  4006. if(onDemandData == null)
  4007. return;
  4008. if(onDemandData.dataType == 0)
  4009. {
  4010. Model.method460(onDemandData.buffer, onDemandData.ID);
  4011. needDrawTabArea = true;
  4012. if(backDialogID != -1)
  4013. inputTaken = true;
  4014. }
  4015. //if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  4016. // Class36.method529(onDemandData.buffer, onDemandData.ID);
  4017. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  4018. saveMidi(songChanging, onDemandData.buffer);
  4019. if(onDemandData.dataType == 3 && loadingStage == 1)
  4020. {
  4021. //System.out.println(onDemandData.ID);
  4022. try {
  4023. writeFile(onDemandData.buffer, "./maps/" + onDemandData.ID + ".dat");
  4024. } catch (Exception e) {}
  4025. for(int i = 0; i < aByteArrayArray1183.length; i++)
  4026. {
  4027. if(anIntArray1235[i] == onDemandData.ID)
  4028. {
  4029. aByteArrayArray1183[i] = onDemandData.buffer;
  4030. if(onDemandData.buffer == null) {
  4031. anIntArray1235[i] = -1;
  4032. }
  4033. break;
  4034. }
  4035. if(anIntArray1236[i] != onDemandData.ID)
  4036. continue;
  4037. aByteArrayArray1247[i] = onDemandData.buffer;
  4038. if(onDemandData.buffer == null) {
  4039. anIntArray1236[i] = -1;
  4040. }
  4041. break;
  4042. }
  4043.  
  4044. }
  4045. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  4046. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  4047. } while(true);
  4048. }
  4049.  
  4050. private void calcFlamesPosition()
  4051. {
  4052. char c = '\u0100';
  4053. for(int j = 10; j < 117; j++)
  4054. {
  4055. int k = (int)(Math.random() * 100D);
  4056. if(k < 50)
  4057. anIntArray828[j + (c - 2 << 7)] = 255;
  4058. }
  4059. for(int l = 0; l < 100; l++)
  4060. {
  4061. int i1 = (int)(Math.random() * 124D) + 2;
  4062. int k1 = (int)(Math.random() * 128D) + 128;
  4063. int k2 = i1 + (k1 << 7);
  4064. anIntArray828[k2] = 192;
  4065. }
  4066.  
  4067. for(int j1 = 1; j1 < c - 1; j1++)
  4068. {
  4069. for(int l1 = 1; l1 < 127; l1++)
  4070. {
  4071. int l2 = l1 + (j1 << 7);
  4072. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  4073. }
  4074.  
  4075. }
  4076.  
  4077. anInt1275 += 128;
  4078. if(anInt1275 > anIntArray1190.length)
  4079. {
  4080. anInt1275 -= anIntArray1190.length;
  4081. int i2 = (int)(Math.random() * 12D);
  4082. randomizeBackground(aBackgroundArray1152s[i2]);
  4083. }
  4084. for(int j2 = 1; j2 < c - 1; j2++)
  4085. {
  4086. for(int i3 = 1; i3 < 127; i3++)
  4087. {
  4088. int k3 = i3 + (j2 << 7);
  4089. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  4090. if(i4 < 0)
  4091. i4 = 0;
  4092. anIntArray828[k3] = i4;
  4093. }
  4094.  
  4095. }
  4096.  
  4097. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  4098.  
  4099. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  4100. if(anInt1040 > 0)
  4101. anInt1040 -= 4;
  4102. if(anInt1041 > 0)
  4103. anInt1041 -= 4;
  4104. if(anInt1040 == 0 && anInt1041 == 0)
  4105. {
  4106. int l3 = (int)(Math.random() * 2000D);
  4107. if(l3 == 0)
  4108. anInt1040 = 1024;
  4109. if(l3 == 1)
  4110. anInt1041 = 1024;
  4111. }
  4112. }
  4113.  
  4114. private boolean saveWave(byte abyte0[], int i)
  4115. {
  4116. return abyte0 == null || signlink.wavesave(abyte0, i);
  4117. }
  4118.  
  4119. private void method60(int i)
  4120. {
  4121. RSInterface class9 = RSInterface.interfaceCache[i];
  4122. for(int j = 0; j < class9.children.length; j++)
  4123. {
  4124. if(class9.children[j] == -1)
  4125. break;
  4126. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  4127. if(class9_1.interfaceType == 1)
  4128. method60(class9_1.id);
  4129. class9_1.animationLength = 0;
  4130. class9_1.animationDelay = 0;
  4131. }
  4132. }
  4133.  
  4134. private void drawHeadIcon()
  4135. {
  4136. if(anInt855 != 2)
  4137. return;
  4138. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  4139. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  4140. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  4141. }
  4142.  
  4143. private void mainGameProcessor()
  4144. {
  4145. if(anInt1104 > 1)
  4146. anInt1104--;
  4147. if(anInt1011 > 0)
  4148. anInt1011--;
  4149. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4150. if (anInt1501 < 100) {
  4151. anInt1501++;
  4152. if (anInt1501 == 100) {
  4153. if (anInt1500 != 0) {
  4154. inputTaken = true;
  4155. }
  4156. if (anInt1044 != 0) {
  4157. needDrawTabArea = true;
  4158. }
  4159. }
  4160. }
  4161. } else if (anInt1501 > 0) {
  4162. anInt1501--;
  4163. }
  4164. for(int j = 0; j < 5; j++)
  4165. if(!parsePacket())
  4166. break;
  4167. if(!loggedIn)
  4168. return;
  4169. try{
  4170. canWalkDelay--;
  4171. if (followNPC > 0)
  4172. {
  4173. NPC n = npcArray[followNPC];
  4174. if (n != null)
  4175. {
  4176. if (!withinDistance(myPlayer.smallX[0], myPlayer.smallY[0], n.smallX[0], n.smallY[0], followDistance))
  4177. {
  4178. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, n.smallY[0], myPlayer.smallX[0], false, n.smallX[0]);
  4179. }
  4180. }
  4181. }
  4182. else if (followPlayer > 0 && canWalkDelay <= 0)
  4183. {
  4184. Player p = playerArray[followPlayer];
  4185. if (p != null)
  4186. {
  4187. int dis = getDis(myPlayer.smallX[0], myPlayer.smallY[0], p.smallX[0], p.smallY[0]);
  4188. if (dis > followDistance)
  4189. {
  4190. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], followDistance, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0]);
  4191. canWalkDelay = 30;
  4192. }
  4193. else if (dis == 0)
  4194. {
  4195. int rnd = random(4);
  4196. if (rnd == 0)
  4197. {
  4198. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] - 2);
  4199. }
  4200. else if (rnd == 1)
  4201. {
  4202. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] + 2);
  4203. }
  4204. else if (rnd == 2)
  4205. {
  4206. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] - 2, myPlayer.smallX[0], false, p.smallX[0]);
  4207. }
  4208. else if (rnd == 3)
  4209. {
  4210. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] + 2, myPlayer.smallX[0], false, p.smallX[0]);
  4211. }
  4212. canWalkDelay = 60;
  4213. }
  4214. }
  4215. }
  4216. } catch(Exception ex){
  4217. System.out.println("Exception in following, method : in process.)");
  4218. }
  4219. synchronized(mouseDetection.syncObject)
  4220. {
  4221. if(flagged)
  4222. {
  4223. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  4224. {
  4225. stream.createFrame(45);
  4226. stream.writeWordBigEndian(0);
  4227. int j2 = stream.currentOffset;
  4228. int j3 = 0;
  4229. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  4230. {
  4231. if(j2 - stream.currentOffset >= 240)
  4232. break;
  4233. j3++;
  4234. int l4 = mouseDetection.coordsY[j4];
  4235. if(l4 < 0)
  4236. l4 = 0;
  4237. else
  4238. if(l4 > 502)
  4239. l4 = 502;
  4240. int k5 = mouseDetection.coordsX[j4];
  4241. if(k5 < 0)
  4242. k5 = 0;
  4243. else
  4244. if(k5 > 764)
  4245. k5 = 764;
  4246. int i6 = l4 * 765 + k5;
  4247. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  4248. {
  4249. k5 = -1;
  4250. l4 = -1;
  4251. i6 = 0x7ffff;
  4252. }
  4253. if(k5 == anInt1237 && l4 == anInt1238)
  4254. {
  4255. if(anInt1022 < 2047)
  4256. anInt1022++;
  4257. } else
  4258. {
  4259. int j6 = k5 - anInt1237;
  4260. anInt1237 = k5;
  4261. int k6 = l4 - anInt1238;
  4262. anInt1238 = l4;
  4263. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  4264. {
  4265. j6 += 32;
  4266. k6 += 32;
  4267. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  4268. anInt1022 = 0;
  4269. } else
  4270. if(anInt1022 < 8)
  4271. {
  4272. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  4273. anInt1022 = 0;
  4274. } else
  4275. {
  4276. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  4277. anInt1022 = 0;
  4278. }
  4279. }
  4280. }
  4281.  
  4282. stream.writeBytes(stream.currentOffset - j2);
  4283. if(j3 >= mouseDetection.coordsIndex)
  4284. {
  4285. mouseDetection.coordsIndex = 0;
  4286. } else
  4287. {
  4288. mouseDetection.coordsIndex -= j3;
  4289. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  4290. {
  4291. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  4292. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  4293. }
  4294.  
  4295. }
  4296. }
  4297. } else
  4298. {
  4299. mouseDetection.coordsIndex = 0;
  4300. }
  4301. }
  4302. if(super.clickMode3 != 0)
  4303. {
  4304. long l = (super.aLong29 - aLong1220) / 50L;
  4305. if(l > 4095L)
  4306. l = 4095L;
  4307. aLong1220 = super.aLong29;
  4308. int k2 = super.saveClickY;
  4309. if(k2 < 0)
  4310. k2 = 0;
  4311. else
  4312. if(k2 > 502)
  4313. k2 = 502;
  4314. int k3 = super.saveClickX;
  4315. if(k3 < 0)
  4316. k3 = 0;
  4317. else
  4318. if(k3 > 764)
  4319. k3 = 764;
  4320. int k4 = k2 * 765 + k3;
  4321. int j5 = 0;
  4322. if(super.clickMode3 == 2)
  4323. j5 = 1;
  4324. int l5 = (int)l;
  4325. stream.createFrame(241);
  4326. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  4327. }
  4328. if(anInt1016 > 0)
  4329. anInt1016--;
  4330. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  4331. aBoolean1017 = true;
  4332. if(aBoolean1017 && anInt1016 <= 0)
  4333. {
  4334. anInt1016 = 20;
  4335. aBoolean1017 = false;
  4336. stream.createFrame(86);
  4337. stream.writeWord(anInt1184);
  4338. stream.method432(minimapInt1);
  4339. }
  4340. if(super.awtFocus && !aBoolean954)
  4341. {
  4342. aBoolean954 = true;
  4343. stream.createFrame(3);
  4344. stream.writeWordBigEndian(1);
  4345. }
  4346. if(!super.awtFocus && aBoolean954)
  4347. {
  4348. aBoolean954 = false;
  4349. stream.createFrame(3);
  4350. stream.writeWordBigEndian(0);
  4351. }
  4352. loadingStages();
  4353. method115();
  4354. method90();
  4355. anInt1009++;
  4356. if(anInt1009 > 750)
  4357. dropClient();
  4358. method114();
  4359. method95();
  4360. method38();
  4361.  
  4362. anInt945++;
  4363. if(crossType != 0)
  4364. {
  4365. crossIndex += 20;
  4366. if(crossIndex >= 400)
  4367. crossType = 0;
  4368. }
  4369. if(atInventoryInterfaceType != 0)
  4370. {
  4371. atInventoryLoopCycle++;
  4372. if(atInventoryLoopCycle >= 15)
  4373. {
  4374. if(atInventoryInterfaceType == 2)
  4375. needDrawTabArea = true;
  4376. if(atInventoryInterfaceType == 3)
  4377. inputTaken = true;
  4378. atInventoryInterfaceType = 0;
  4379. }
  4380. }
  4381. if(activeInterfaceType != 0)
  4382. {
  4383. anInt989++;
  4384. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  4385. aBoolean1242 = true;
  4386. if(super.clickMode2 == 0)
  4387. {
  4388. if(activeInterfaceType == 2)
  4389. needDrawTabArea = true;
  4390. if(activeInterfaceType == 3)
  4391. inputTaken = true;
  4392. activeInterfaceType = 0;
  4393. if(aBoolean1242 && anInt989 >= 5)
  4394. {
  4395. lastActiveInvInterface = -1;
  4396. processRightClick();
  4397. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  4398. {
  4399. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4400. int j1 = 0;
  4401. if(anInt913 == 1 && class9.contentType == 206)
  4402. j1 = 1;
  4403. if(class9.inventory[mouseInvInterfaceIndex] <= 0)
  4404. j1 = 0;
  4405. if(class9.deletesTargetSlot)
  4406. {
  4407. int l2 = anInt1085;
  4408. int l3 = mouseInvInterfaceIndex;
  4409. class9.inventory[l3] = class9.inventory[l2];
  4410. class9.inventoryValue[l3] = class9.inventoryValue[l2];
  4411. class9.inventory[l2] = -1;
  4412. class9.inventoryValue[l2] = 0;
  4413. } else
  4414. if(j1 == 1)
  4415. {
  4416. int i3 = anInt1085;
  4417. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  4418. if(i3 > i4)
  4419. {
  4420. class9.swapInventoryItems(i3, i3 - 1);
  4421. i3--;
  4422. } else
  4423. if(i3 < i4)
  4424. {
  4425. class9.swapInventoryItems(i3, i3 + 1);
  4426. i3++;
  4427. }
  4428.  
  4429. } else
  4430. {
  4431. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  4432. }
  4433. stream.createFrame(214);
  4434. stream.method433(anInt1084);
  4435. stream.method424(j1);
  4436. stream.method433(anInt1085);
  4437. stream.method431(mouseInvInterfaceIndex);
  4438. }
  4439. } else
  4440. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  4441. determineMenuSize();
  4442. else
  4443. if(menuActionRow > 0)
  4444. doAction(menuActionRow - 1);
  4445. atInventoryLoopCycle = 10;
  4446. super.clickMode3 = 0;
  4447. }
  4448. }
  4449. if(WorldController.anInt470 != -1)
  4450. {
  4451. int k = WorldController.anInt470;
  4452. int k1 = WorldController.anInt471;
  4453. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  4454. WorldController.anInt470 = -1;
  4455. if(flag)
  4456. {
  4457. crossX = super.saveClickX;
  4458. crossY = super.saveClickY;
  4459. crossType = 1;
  4460. crossIndex = 0;
  4461. }
  4462. }
  4463. if(super.clickMode3 == 1 && aString844 != null)
  4464. {
  4465. aString844 = null;
  4466. inputTaken = true;
  4467. super.clickMode3 = 0;
  4468. }
  4469. processMenuClick();
  4470. processMainScreenClick();
  4471. processTabClick();
  4472. processChatModeClick();
  4473. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  4474. anInt1213++;
  4475. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4476. if (anInt1501 < 100) {
  4477. anInt1501++;
  4478. if (anInt1501 == 100) {
  4479. if (anInt1500 != 0) {
  4480. inputTaken = true;
  4481. }
  4482. if (anInt1044 != 0) {
  4483. needDrawTabArea = true;
  4484. }
  4485. }
  4486. }
  4487. } else if (anInt1501 > 0) {
  4488. anInt1501--;
  4489. }
  4490. if(loadingStage == 2)
  4491. method108();
  4492. if(loadingStage == 2 && aBoolean1160)
  4493. calcCameraPos();
  4494. for(int i1 = 0; i1 < 5; i1++)
  4495. anIntArray1030[i1]++;
  4496.  
  4497. method73();
  4498. super.idleTime++;
  4499. if(super.idleTime > 4500)
  4500. {
  4501. anInt1011 = 250;
  4502. super.idleTime -= 500;
  4503. stream.createFrame(202);
  4504. }
  4505. anInt988++;
  4506. if(anInt988 > 500)
  4507. {
  4508. anInt988 = 0;
  4509. int l1 = (int)(Math.random() * 8D);
  4510. if((l1 & 1) == 1)
  4511. anInt1278 += anInt1279;
  4512. if((l1 & 2) == 2)
  4513. anInt1131 += anInt1132;
  4514. if((l1 & 4) == 4)
  4515. anInt896 += anInt897;
  4516. }
  4517. if(anInt1278 < -50)
  4518. anInt1279 = 2;
  4519. if(anInt1278 > 50)
  4520. anInt1279 = -2;
  4521. if(anInt1131 < -55)
  4522. anInt1132 = 2;
  4523. if(anInt1131 > 55)
  4524. anInt1132 = -2;
  4525. if(anInt896 < -40)
  4526. anInt897 = 1;
  4527. if(anInt896 > 40)
  4528. anInt897 = -1;
  4529. anInt1254++;
  4530. if(anInt1254 > 500)
  4531. {
  4532. anInt1254 = 0;
  4533. int i2 = (int)(Math.random() * 8D);
  4534. if((i2 & 1) == 1)
  4535. minimapInt2 += anInt1210;
  4536. if((i2 & 2) == 2)
  4537. minimapInt3 += anInt1171;
  4538. }
  4539. if(minimapInt2 < -60)
  4540. anInt1210 = 2;
  4541. if(minimapInt2 > 60)
  4542. anInt1210 = -2;
  4543. if(minimapInt3 < -20)
  4544. anInt1171 = 1;
  4545. if(minimapInt3 > 10)
  4546. anInt1171 = -1;
  4547. anInt1010++;
  4548. if(anInt1010 > 50)
  4549. stream.createFrame(0);
  4550. try
  4551. {
  4552. if(socketStream != null && stream.currentOffset > 0)
  4553. {
  4554. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  4555. stream.currentOffset = 0;
  4556. anInt1010 = 0;
  4557. }
  4558. } catch(IOException _ex) {
  4559. dropClient();
  4560. } catch(Exception exception) {
  4561. resetLogout();
  4562. }
  4563. }
  4564.  
  4565. private void method63()
  4566. {
  4567. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  4568. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  4569. if(class30_sub1.anInt1294 == -1) {
  4570. class30_sub1.anInt1302 = 0;
  4571. method89(class30_sub1);
  4572. } else {
  4573. class30_sub1.unlink();
  4574. }
  4575.  
  4576. }
  4577.  
  4578. private void resetImageProducers()
  4579. {
  4580. if(aRSImageProducer_1107 != null)
  4581. return;
  4582. super.fullGameScreen = null;
  4583. chatBackImage = null;
  4584. mapBackImage = null;
  4585. inventoryBackImage = null;
  4586. inGameScreen = null;
  4587. //aRSImageProducer_1123 = null;
  4588. aRSImageProducer_1124 = null;
  4589. aRSImageProducer_1125 = null;
  4590.  
  4591. leftSideFlame = new RSImageProducer(128, 265, getGameComponent());
  4592. DrawingArea.setAllPixelsToZero();
  4593. rightSideFlame = new RSImageProducer(128, 265, getGameComponent());
  4594. DrawingArea.setAllPixelsToZero();
  4595. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  4596. DrawingArea.setAllPixelsToZero();
  4597. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  4598. DrawingArea.setAllPixelsToZero();
  4599. if(normalLogin == true) {
  4600. loginScreenArea = new RSImageProducer(360, 200, getGameComponent());
  4601. DrawingArea.setAllPixelsToZero();
  4602. } else if(normalLogin == false) {
  4603. loginScreenArea = new RSImageProducer(765, 503, getGameComponent());
  4604. DrawingArea.setAllPixelsToZero();
  4605. }
  4606. gameLogo = new RSImageProducer(202, 238, getGameComponent());
  4607. DrawingArea.setAllPixelsToZero();
  4608. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  4609. DrawingArea.setAllPixelsToZero();
  4610. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4611. DrawingArea.setAllPixelsToZero();
  4612. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4613. DrawingArea.setAllPixelsToZero();
  4614. if(titleStreamLoader != null) {
  4615. drawLogo();
  4616. loadTitleScreen();
  4617. }
  4618. welcomeScreenRaised = true;
  4619. }
  4620.  
  4621. void drawLoadingText(int i, String s) {
  4622. anInt1079 = i;
  4623. aString1049 = s;
  4624. resetImageProducers();
  4625. if(titleStreamLoader == null) {
  4626. super.drawLoadingText(i, s);
  4627. return;
  4628. }
  4629. loginScreenArea.initDrawingArea();
  4630. Sprite loadingBarBkg = new Sprite("Login/Loading 1");
  4631. Sprite loadingBar = new Sprite(sign.signlink.findcachedir() + "Sprites/Login/Loading 2.png", (int)Math.round(i*2.02), 12);
  4632. loadingBarBkg.drawSprite(20, 30);
  4633. loadingBar.drawSprite(82, 54);
  4634. newRegularFont.drawCenteredString(s + " - "+i+"%", 180, 46, 0xFFFFFD, 0);
  4635.  
  4636. loginScreenArea.drawGraphics(171, super.graphics, 202);
  4637. if(welcomeScreenRaised)
  4638. {
  4639. welcomeScreenRaised = false;
  4640. if(!aBoolean831)
  4641. {
  4642. leftSideFlame.drawGraphics(0, super.graphics, 0);
  4643. rightSideFlame.drawGraphics(0, super.graphics, 637);
  4644. }
  4645. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  4646. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  4647. gameLogo.drawGraphics(265, super.graphics, 0);
  4648. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  4649. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  4650. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  4651. }
  4652. }
  4653.  
  4654.  
  4655. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  4656. int j1)
  4657. {
  4658. int anInt992;
  4659. if(aBoolean972)
  4660. anInt992 = 32;
  4661. else
  4662. anInt992 = 0;
  4663. aBoolean972 = false;
  4664. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  4665. {
  4666. class9.scrollPosition -= anInt1213 * 4;
  4667. if(flag)
  4668. {
  4669. needDrawTabArea = true;
  4670. }
  4671. } else
  4672. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  4673. {
  4674. class9.scrollPosition += anInt1213 * 4;
  4675. if(flag)
  4676. {
  4677. needDrawTabArea = true;
  4678. }
  4679. } else
  4680. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  4681. {
  4682. int l1 = ((j - 32) * j) / j1;
  4683. if(l1 < 8)
  4684. l1 = 8;
  4685. int i2 = l - i1 - 16 - l1 / 2;
  4686. int j2 = j - 32 - l1;
  4687. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4688. if(flag)
  4689. needDrawTabArea = true;
  4690. aBoolean972 = true;
  4691. }
  4692. }
  4693.  
  4694. private boolean method66(int i, int j, int k)
  4695. {
  4696. int i1 = i >> 14 & 0x7fff;
  4697. int j1 = worldController.method304(plane, k, j, i);
  4698. if(j1 == -1)
  4699. return false;
  4700. int k1 = j1 & 0x1f;
  4701. int l1 = j1 >> 6 & 3;
  4702. if(k1 == 10 || k1 == 11 || k1 == 22)
  4703. {
  4704. ObjectDef class46 = ObjectDef.forID(i1);
  4705. int i2;
  4706. int j2;
  4707. if(l1 == 0 || l1 == 2)
  4708. {
  4709. i2 = class46.anInt744;
  4710. j2 = class46.anInt761;
  4711. } else
  4712. {
  4713. i2 = class46.anInt761;
  4714. j2 = class46.anInt744;
  4715. }
  4716. int k2 = class46.anInt768;
  4717. if(l1 != 0)
  4718. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4719. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  4720. } else
  4721. {
  4722. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  4723. }
  4724. crossX = super.saveClickX;
  4725. crossY = super.saveClickY;
  4726. crossType = 2;
  4727. crossIndex = 0;
  4728. return true;
  4729. }
  4730.  
  4731. private NamedArchive streamLoaderForName(int i, String s, String s1, int j, int k)
  4732. {
  4733. byte abyte0[] = null;
  4734. int l = 5;
  4735. try
  4736. {
  4737. if(decompressors[0] != null) {
  4738. abyte0 = decompressors[0].decompress(i);
  4739. }
  4740. if(abyte0 == null)
  4741. {
  4742. drawLoadingText(0, "Connecting to File Server...");
  4743. new Update("http://dl.dropbox.com/u/33278148/ErasedPkzcache1.zip", "ErasedPkzcache1.zip", signlink.findcachedir());
  4744. abyte0 = decompressors[0].decompress(i);
  4745. }
  4746. } catch (Exception e) {
  4747. e.printStackTrace();
  4748. }
  4749. if(abyte0 != null)
  4750. {
  4751. NamedArchive archive = new NamedArchive(abyte0, s);
  4752. return archive;
  4753. }
  4754. while (true) {
  4755. drawLoadingText(0, "Error loading... Please report!");
  4756. try {
  4757. Thread.sleep(1000);
  4758. } catch (Exception e) {
  4759. e.printStackTrace();
  4760. }
  4761. }
  4762. }
  4763.  
  4764. private void dropClient()
  4765. {
  4766. if(anInt1011 > 0)
  4767. {
  4768. resetLogout();
  4769. return;
  4770. }
  4771. inGameScreen.initDrawingArea();
  4772. reestablish.drawSprite(8,9);
  4773. inGameScreen.drawGraphics(4, super.graphics, 4);
  4774. anInt1021 = 0;
  4775. destX = 0;
  4776. RSSocket rsSocket = socketStream;
  4777. loggedIn = false;
  4778. loginFailures = 0;
  4779. login(myUsername, myPassword, true);
  4780. if(!loggedIn)
  4781. resetLogout();
  4782. try
  4783. {
  4784. rsSocket.close();
  4785. }
  4786. catch(Exception _ex)
  4787. {
  4788. }
  4789. }
  4790.  
  4791. private void doAction(int i)
  4792. {
  4793. if(i < 0)
  4794. return;
  4795. if(inputDialogState != 0)
  4796. {
  4797. inputDialogState = 0;
  4798. inputTaken = true;
  4799. }
  4800. int j = menuActionCmd2[i];
  4801. int k = menuActionCmd3[i];
  4802. int l = menuActionID[i];
  4803. int i1 = menuActionCmd1[i];
  4804. if(l >= 2000)
  4805. l -= 2000;
  4806. if (l == 476) {
  4807. alertHandler.close();
  4808. }
  4809. if(l == 582)
  4810. {
  4811. NPC npc = npcArray[i1];
  4812. if(npc != null)
  4813. {
  4814. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4815. crossX = super.saveClickX;
  4816. crossY = super.saveClickY;
  4817. crossType = 2;
  4818. crossIndex = 0;
  4819. stream.createFrame(57);
  4820. stream.method432(anInt1285);
  4821. stream.method432(i1);
  4822. stream.method431(anInt1283);
  4823. stream.method432(anInt1284);
  4824. }
  4825. }
  4826. if(l == 234)
  4827. {
  4828. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4829. if(!flag1)
  4830. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4831. crossX = super.saveClickX;
  4832. crossY = super.saveClickY;
  4833. crossType = 2;
  4834. crossIndex = 0;
  4835. stream.createFrame(236);
  4836. stream.method431(k + baseY);
  4837. stream.writeWord(i1);
  4838. stream.method431(j + baseX);
  4839. }
  4840. if(l == 62 && method66(i1, k, j))
  4841. {
  4842. stream.createFrame(192);
  4843. stream.writeWord(anInt1284);
  4844. stream.method431(i1 >> 14 & 0x7fff);
  4845. stream.method433(k + baseY);
  4846. stream.method431(anInt1283);
  4847. stream.method433(j + baseX);
  4848. stream.writeWord(anInt1285);
  4849. }
  4850. if(l == 511)
  4851. {
  4852. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4853. if(!flag2)
  4854. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4855. crossX = super.saveClickX;
  4856. crossY = super.saveClickY;
  4857. crossType = 2;
  4858. crossIndex = 0;
  4859. stream.createFrame(25);
  4860. stream.method431(anInt1284);
  4861. stream.method432(anInt1285);
  4862. stream.writeWord(i1);
  4863. stream.method432(k + baseY);
  4864. stream.method433(anInt1283);
  4865. stream.writeWord(j + baseX);
  4866. }
  4867. if(l == 74)
  4868. {
  4869. stream.createFrame(122);
  4870. stream.method433(k);
  4871. stream.method432(j);
  4872. stream.method431(i1);
  4873. atInventoryLoopCycle = 0;
  4874. atInventoryInterface = k;
  4875. atInventoryIndex = j;
  4876. atInventoryInterfaceType = 2;
  4877. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4878. atInventoryInterfaceType = 1;
  4879. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4880. atInventoryInterfaceType = 3;
  4881. }
  4882. /*if(is480 || is508 || is525) {
  4883. switch(l){
  4884. case 1014: setTab(13); setSidebarInterface(13, 29500); break;//harp
  4885. case 1013: setTab(12); setSidebarInterface(12, 147); break;//emotes
  4886. case 1012: setTab(11); setSidebarInterface(11, 904); break;//options
  4887. case 1010: setTab(9); setSidebarInterface(9, 5715); break;//ignore
  4888. case 1009: setTab(8); setSidebarInterface(8, 5065); break;//friend
  4889. case 1027: setTab(6); break;//spellbook
  4890. case 1026: setTab(5); break;//prayer
  4891. case 1030: setTab(4); setSidebarInterface(4, 1644); break;//worn
  4892. case 1024: setTab(3); setSidebarInterface(3, 3213); break;//inventory
  4893. case 1023: setTab(2); setSidebarInterface(2, 638); break;//quests
  4894. case 1022: setTab(1); setSidebarInterface(1, 3917); break;//stats
  4895. case 1021: setTab(0); break;//style
  4896. case 1008: setTab(10); setSidebarInterface(10, 18128); break;//logout new clan
  4897. case 1011: setTab(14); setSidebarInterface(14, 2449); break;//logout
  4898. case 1502: setTab(7); setSidebarInterface(7, 2449); break;//clan
  4899. }
  4900. } else {
  4901. switch(l){
  4902. case 1014: setTab(13); setSidebarInterface(13, 29500); break;//harp
  4903. case 1013: setTab(12); setSidebarInterface(12, 147); break;//emotes
  4904. case 1012: setTab(11); setSidebarInterface(11, 904); break;//options
  4905. case 1010: setTab(9); setSidebarInterface(9, 5715); break;//ignore
  4906. case 1009: setTab(8); setSidebarInterface(8, 5065); break;//friend
  4907. case 1027: setTab(6); break;//spellbook
  4908. case 1026: setTab(5); break;//prayer
  4909. case 1030: setTab(4); setSidebarInterface(4, 1644); break;//worn
  4910. case 1024: setTab(3); setSidebarInterface(3, 3213); break;//inventory
  4911. case 1023: setTab(2); setSidebarInterface(2, 638); break;//quests
  4912. case 1022: setTab(1); setSidebarInterface(1, 3917); break;//stats
  4913. case 1021: setTab(0); break;//style
  4914. case 1008: setTab(7); setSidebarInterface(7, 18128); break;
  4915. case 1011: setTab(10); setSidebarInterface(10, 2449); break;
  4916. }
  4917. }*/
  4918. switch(l){
  4919. case 1050:
  4920. runState = 1;
  4921. if(!runClicked) {
  4922. runClicked = true;
  4923. musicOrb = false;
  4924. restOrb = false;
  4925. stream.createFrame(185);
  4926. stream.writeWord(153);
  4927. } else {
  4928. runClicked = false;
  4929. stream.createFrame(185);
  4930. stream.writeWord(152);
  4931. }
  4932. break;
  4933. case 1500:
  4934. if(!prayClicked){
  4935. prayClicked = true;
  4936. } else {
  4937. prayClicked = false;
  4938. }
  4939. break;
  4940. case 1501:
  4941. runState = 2;
  4942. if(!musicOrb && restOrb){
  4943. musicOrb = true;
  4944. restOrb = false;
  4945. } else if(musicOrb && !restOrb){
  4946. musicOrb = false;
  4947. restOrb = true;
  4948. } else if(!musicOrb && !restOrb){
  4949. musicOrb =false;
  4950. restOrb = true;
  4951. }
  4952. break;
  4953. case 1503:
  4954. if(!drawXpBar) {
  4955. drawXpBar = true;
  4956. } else {
  4957. drawXpBar = false;
  4958. }
  4959. break;
  4960. case 1504:
  4961. testXp = 0;
  4962. break;
  4963. }
  4964. if (l == 315) {
  4965. System.out.println("sendPacket185("+k+")");
  4966. RSInterface class9 = RSInterface.interfaceCache[k];
  4967. boolean flag8 = true;
  4968. if (class9.contentType > 0)
  4969. flag8 = promptUserForInput(class9);
  4970. if (flag8) {
  4971.  
  4972. switch(k){
  4973. case 19144:
  4974. sendFrame248(15106,3213);
  4975. method60(15106);
  4976. inputTaken = true;
  4977. break;
  4978. case 27615:
  4979. setSidebarInterface(4, 1644);
  4980. break;
  4981. case 25843://arrow
  4982. setSidebarInterface(11, 24500);
  4983. break;
  4984. case 27610://return
  4985. setSidebarInterface(11, 904);
  4986. break;
  4987. case 27508://hp
  4988. sendFrame126("OFF", 27528);
  4989. if (hitbarToggle) {
  4990. hitbarToggle = false;
  4991. sendFrame126("OFF", 27528); sendFrame126("", 27524);
  4992. } else {
  4993. hitbarToggle = true;
  4994. sendFrame126("ON", 27524); sendFrame126("", 27528);
  4995. }
  4996. break;
  4997. case 27509://menu
  4998. sendFrame126("OFF", 27529);
  4999. if (menuToggle) {
  5000. menuToggle = false;
  5001. sendFrame126("OFF", 27529); sendFrame126("", 27525);
  5002. } else {
  5003. menuToggle = true;
  5004. sendFrame126("ON", 27525); sendFrame126("", 27529);
  5005. }
  5006. break;
  5007. case 27510://names
  5008. sendFrame126("OFF", 27530);
  5009. if (namesToggle) {
  5010. namesToggle = false;
  5011. sendFrame126("OFF", 27530); sendFrame126("", 27526);
  5012. } else {
  5013. namesToggle = true;
  5014. sendFrame126("ON", 27526); sendFrame126("", 27530);
  5015. }
  5016. break;
  5017. case 27532://gameframe
  5018. if(anInt1021 == 2) {
  5019. pushMessage("Switching gameframes is disabled while in barrows.", 0, "");
  5020. } else {
  5021. sendFrame126("459", 27531);
  5022. if(is459) {
  5023. is459 = false; is474 = true;
  5024. sendFrame126("474", 27536);
  5025. sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  5026. } else if(is474) {
  5027. is474 = false; is480 = true;
  5028. sendFrame126("483", 27536);
  5029. sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  5030. } else if (is480) {
  5031. is480 = false; is508 = true;
  5032. sendFrame126("508", 27537);
  5033. sendFrame126("", 27533); sendFrame126("", 27536); sendFrame126("", 27538); sendFrame126("", 27531);
  5034. } else if(is508) {
  5035. is508 = false; is525 = true;
  5036. sendFrame126("525", 27538);
  5037. sendFrame126("", 27536); sendFrame126("", 27537); sendFrame126("", 27533); sendFrame126("", 27531);
  5038. } else if(is525) {
  5039. is525 = false; is562 = true;
  5040. sendFrame126("562", 27536);
  5041. sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  5042. } else if(is562) {
  5043. is562 = false; is508 = false; is525 = false; is480 = false; is474 = false; is459 = true;
  5044. sendFrame126("", 27533); sendFrame126("", 27536); sendFrame126("", 27537); sendFrame126("", 27538);
  5045. sendFrame126("377", 27531);
  5046. }
  5047. }
  5048. break;
  5049. case 27606://x10
  5050. sendFrame126("OFF", 27605);
  5051. if (newDamage) {
  5052. newDamage = false;
  5053. sendFrame126("OFF", 27605);
  5054. sendFrame126("", 27604);
  5055. } else {
  5056. newDamage = true;
  5057. sendFrame126("ON", 27604);
  5058. sendFrame126("", 27605);
  5059. }
  5060. break;
  5061. case 27521://hitmarks
  5062. sendFrame126("OFF", 27603);
  5063. if (hitmarks) {
  5064. hitmarks = false;
  5065. sendFrame126("OFF", 27603);
  5066. sendFrame126("", 27602);
  5067. } else {
  5068. hitmarks = true;
  5069. sendFrame126("ON", 27602);
  5070. sendFrame126("", 27603);
  5071. }
  5072. break;
  5073. case 29156://achievement
  5074. setSidebarInterface(2, 29265);
  5075. break;
  5076. case 29267://Quest
  5077. setSidebarInterface(2, 638);
  5078. break;
  5079.  
  5080. default:
  5081. stream.createFrame(185);
  5082. stream.writeWord(k);
  5083. break;
  5084.  
  5085. }
  5086. }
  5087. }
  5088. if(l == 561)
  5089. {
  5090. Player player = playerArray[i1];
  5091. if(player != null)
  5092. {
  5093. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  5094. crossX = super.saveClickX;
  5095. crossY = super.saveClickY;
  5096. crossType = 2;
  5097. crossIndex = 0;
  5098. anInt1188 += i1;
  5099. if(anInt1188 >= 90)
  5100. {
  5101. stream.createFrame(136);
  5102. anInt1188 = 0;
  5103. }
  5104. stream.createFrame(128);
  5105. stream.writeWord(i1);
  5106. }
  5107. }
  5108. if(l == 20)
  5109. {
  5110. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  5111. if(class30_sub2_sub4_sub1_sub1_1 != null)
  5112. {
  5113. 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]);
  5114. crossX = super.saveClickX;
  5115. crossY = super.saveClickY;
  5116. crossType = 2;
  5117. crossIndex = 0;
  5118. stream.createFrame(155);
  5119. stream.method431(i1);
  5120. }
  5121. }
  5122. if(l == 779)
  5123. {
  5124. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  5125. if(class30_sub2_sub4_sub1_sub2_1 != null)
  5126. {
  5127. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  5128. crossX = super.saveClickX;
  5129. crossY = super.saveClickY;
  5130. crossType = 2;
  5131. crossIndex = 0;
  5132. stream.createFrame(153);
  5133. stream.method431(i1);
  5134. }
  5135. }
  5136. if(l == 516)
  5137. if(!menuOpen)
  5138. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  5139. else
  5140. worldController.method312(k - 4, j - 4);
  5141. if(l == 1062)
  5142. {
  5143. anInt924 += baseX;
  5144. if(anInt924 >= 113)
  5145. {
  5146. stream.createFrame(183);
  5147. stream.writeDWordBigEndian(0xe63271);
  5148. anInt924 = 0;
  5149. }
  5150. method66(i1, k, j);
  5151. stream.createFrame(228);
  5152. stream.method432(i1 >> 14 & 0x7fff);
  5153. stream.method432(k + baseY);
  5154. stream.writeWord(j + baseX);
  5155. }
  5156. if(l == 679 && !aBoolean1149)
  5157. {
  5158. stream.createFrame(40);
  5159. stream.writeWord(k);
  5160. aBoolean1149 = true;
  5161. }
  5162. if(l == 431)
  5163. {
  5164. stream.createFrame(129);
  5165. stream.method432(j);
  5166. stream.writeWord(k);
  5167. stream.method432(i1);
  5168. atInventoryLoopCycle = 0;
  5169. atInventoryInterface = k;
  5170. atInventoryIndex = j;
  5171. atInventoryInterfaceType = 2;
  5172. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5173. atInventoryInterfaceType = 1;
  5174. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5175. atInventoryInterfaceType = 3;
  5176. }
  5177. if(l == 337 || l == 42 || l == 792 || l == 322)
  5178. {
  5179. String s = menuActionName[i];
  5180. int k1 = s.indexOf("@whi@");
  5181. if(k1 != -1)
  5182. {
  5183. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  5184. if(l == 337)
  5185. addFriend(l3);
  5186. if(l == 42)
  5187. addIgnore(l3);
  5188. if(l == 792)
  5189. delFriend(l3);
  5190. if(l == 322)
  5191. delIgnore(l3);
  5192. }
  5193. }
  5194. if(l == 53)
  5195. {
  5196. stream.createFrame(135);
  5197. stream.method431(j);
  5198. stream.method432(k);
  5199. stream.method431(i1);
  5200. atInventoryLoopCycle = 0;
  5201. atInventoryInterface = k;
  5202. atInventoryIndex = j;
  5203. atInventoryInterfaceType = 2;
  5204. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5205. atInventoryInterfaceType = 1;
  5206. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5207. atInventoryInterfaceType = 3;
  5208. }
  5209. if(l == 539)
  5210. {
  5211. stream.createFrame(16);
  5212. stream.method432(i1);
  5213. stream.method433(j);
  5214. stream.method433(k);
  5215. atInventoryLoopCycle = 0;
  5216. atInventoryInterface = k;
  5217. atInventoryIndex = j;
  5218. atInventoryInterfaceType = 2;
  5219. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5220. atInventoryInterfaceType = 1;
  5221. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5222. atInventoryInterfaceType = 3;
  5223. }
  5224. if(l == 927) {
  5225. String s1 = menuActionName[i];
  5226. int l1 = s1.indexOf("@lre@");
  5227. s1 = s1.substring(l1 + 5).trim();
  5228. launchURL(s1);//Launches the URL in a web browser when clicked
  5229. }
  5230. if(l == 484 || l == 6)
  5231. {
  5232. String s1 = menuActionName[i];
  5233. int l1 = s1.indexOf("@whi@");
  5234. if(l1 != -1)
  5235. {
  5236. s1 = s1.substring(l1 + 5).trim();
  5237. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  5238. boolean flag9 = false;
  5239. for(int j3 = 0; j3 < playerCount; j3++)
  5240. {
  5241. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  5242. 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))
  5243. continue;
  5244. 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]);
  5245. if(l == 484)
  5246. {
  5247. stream.createFrame(139);
  5248. stream.method431(playerIndices[j3]);
  5249. }
  5250. if(l == 6)
  5251. {
  5252. anInt1188 += i1;
  5253. if(anInt1188 >= 90)
  5254. {
  5255. stream.createFrame(136);
  5256. anInt1188 = 0;
  5257. }
  5258. stream.createFrame(128);
  5259. stream.writeWord(playerIndices[j3]);
  5260. }
  5261. flag9 = true;
  5262. break;
  5263. }
  5264.  
  5265. if(!flag9)
  5266. pushMessage("Unable to find " + s7, 0, "");
  5267. }
  5268. }
  5269. if(l == 870)
  5270. {
  5271. stream.createFrame(53);
  5272. stream.writeWord(j);
  5273. stream.method432(anInt1283);
  5274. stream.method433(i1);
  5275. stream.writeWord(anInt1284);
  5276. stream.method431(anInt1285);
  5277. stream.writeWord(k);
  5278. atInventoryLoopCycle = 0;
  5279. atInventoryInterface = k;
  5280. atInventoryIndex = j;
  5281. atInventoryInterfaceType = 2;
  5282. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5283. atInventoryInterfaceType = 1;
  5284. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5285. atInventoryInterfaceType = 3;
  5286. }
  5287. if(l == 847)
  5288. {
  5289. stream.createFrame(87);
  5290. stream.method432(i1);
  5291. stream.writeWord(k);
  5292. stream.method432(j);
  5293. atInventoryLoopCycle = 0;
  5294. atInventoryInterface = k;
  5295. atInventoryIndex = j;
  5296. atInventoryInterfaceType = 2;
  5297. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5298. atInventoryInterfaceType = 1;
  5299. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5300. atInventoryInterfaceType = 3;
  5301. }
  5302. if(l == 626)
  5303. {
  5304. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5305. spellSelected = 1;
  5306. spellID = class9_1.id;
  5307. anInt1137 = k;
  5308. spellUsableOn = class9_1.spellUsableOn;
  5309. itemSelected = 0;
  5310. needDrawTabArea = true;
  5311. spellID = class9_1.id;
  5312. String s4 = class9_1.selectedActionName;
  5313. if(s4.indexOf(" ") != -1)
  5314. s4 = s4.substring(0, s4.indexOf(" "));
  5315. String s8 = class9_1.selectedActionName;
  5316. if(s8.indexOf(" ") != -1)
  5317. s8 = s8.substring(s8.indexOf(" ") + 1);
  5318. if(s8.equals("on")) s8 = "@whi@->";
  5319. spellTooltip = s4 + " " + "@gre@" + class9_1.spellName + " " + s8;
  5320.  
  5321. //spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  5322. //class9_1.disabledSprite.drawSprite(class9_1.xOffset, class9_1.yOffset, 0xffffff);
  5323. //class9_1.disabledSprite.drawSprite(200,200);
  5324. //System.out.println("Sprite: " + class9_1.disabledSprite.toString());
  5325. if(spellUsableOn == 16)
  5326. {
  5327. needDrawTabArea = true;
  5328. tabID = 3;
  5329. tabAreaAltered = true;
  5330. }
  5331. return;
  5332. }
  5333. if(l == 78)
  5334. {
  5335. stream.createFrame(117);
  5336. stream.method433(k);
  5337. stream.method433(i1);
  5338. stream.method431(j);
  5339. atInventoryLoopCycle = 0;
  5340. atInventoryInterface = k;
  5341. atInventoryIndex = j;
  5342. atInventoryInterfaceType = 2;
  5343. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5344. atInventoryInterfaceType = 1;
  5345. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5346. atInventoryInterfaceType = 3;
  5347. }
  5348. if(l == 27)
  5349. {
  5350. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  5351. if(class30_sub2_sub4_sub1_sub2_2 != null)
  5352. {
  5353. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  5354. crossX = super.saveClickX;
  5355. crossY = super.saveClickY;
  5356. crossType = 2;
  5357. crossIndex = 0;
  5358. anInt986 += i1;
  5359. if(anInt986 >= 54)
  5360. {
  5361. stream.createFrame(189);
  5362. stream.writeWordBigEndian(234);
  5363. anInt986 = 0;
  5364. }
  5365. stream.createFrame(73);
  5366. stream.method431(i1);
  5367. }
  5368. }
  5369.  
  5370.  
  5371.  
  5372. if(l == 213)
  5373. {
  5374. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5375. if(!flag3)
  5376. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5377. crossX = super.saveClickX;
  5378. crossY = super.saveClickY;
  5379. crossType = 2;
  5380. crossIndex = 0;
  5381. stream.createFrame(79);
  5382. stream.method431(k + baseY);
  5383. stream.writeWord(i1);
  5384. stream.method432(j + baseX);
  5385. }
  5386. if(l == 632)
  5387. {
  5388. stream.createFrame(145);
  5389. stream.method432(k);
  5390. stream.method432(j);
  5391. stream.method432(i1);
  5392. atInventoryLoopCycle = 0;
  5393. atInventoryInterface = k;
  5394. atInventoryIndex = j;
  5395. atInventoryInterfaceType = 2;
  5396. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5397. atInventoryInterfaceType = 1;
  5398. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5399. atInventoryInterfaceType = 3;
  5400. }
  5401. if(l == 1005) {
  5402. launchURL("WM.bat");
  5403. pushMessage("Loading worldmap.", 0, "");
  5404. }
  5405. if(l == 1004) {
  5406. if(tabInterfaceIDs[10] != -1) {
  5407. needDrawTabArea = true;
  5408. tabID = 10;
  5409. tabAreaAltered = true;
  5410. }
  5411. }
  5412. if(l == 1003) {
  5413. clanChatMode = 2;
  5414. aBoolean1233 = true;
  5415. inputTaken = true;
  5416. }
  5417. if(l == 1002) {
  5418. clanChatMode = 1;
  5419. aBoolean1233 = true;
  5420. inputTaken = true;
  5421. }
  5422. if(l == 1001) {
  5423. clanChatMode = 0;
  5424. aBoolean1233 = true;
  5425. inputTaken = true;
  5426. }
  5427. if(l == 1000) {
  5428. cButtonCPos = 4;
  5429. chatTypeView = 11;
  5430. aBoolean1233 = true;
  5431. inputTaken = true;
  5432. }
  5433. if(l == 999) {
  5434. cButtonCPos = 0;
  5435. chatTypeView = 0;
  5436. aBoolean1233 = true;
  5437. inputTaken = true;
  5438. }
  5439. if(l == 998) {
  5440. cButtonCPos = 1;
  5441. chatTypeView = 5;
  5442. aBoolean1233 = true;
  5443. inputTaken = true;
  5444. }
  5445. if(l == 997) {
  5446. publicChatMode = 3;
  5447. aBoolean1233 = true;
  5448. inputTaken = true;
  5449. }
  5450. if(l == 996) {
  5451. publicChatMode = 2;
  5452. aBoolean1233 = true;
  5453. inputTaken = true;
  5454. }
  5455. if(l == 995) {
  5456. publicChatMode = 1;
  5457. aBoolean1233 = true;
  5458. inputTaken = true;
  5459. }
  5460. if(l == 994) {
  5461. publicChatMode = 0;
  5462. aBoolean1233 = true;
  5463. inputTaken = true;
  5464. }
  5465. if(l == 993) {
  5466. cButtonCPos = 2;
  5467. chatTypeView = 1;
  5468. aBoolean1233 = true;
  5469. inputTaken = true;
  5470. }
  5471. if(l == 992) {
  5472. privateChatMode = 2;
  5473. aBoolean1233 = true;
  5474. inputTaken = true;
  5475. }
  5476. if(l == 991) {
  5477. privateChatMode = 1;
  5478. aBoolean1233 = true;
  5479. inputTaken = true;
  5480. }
  5481. if(l == 990) {
  5482. privateChatMode = 0;
  5483. aBoolean1233 = true;
  5484. inputTaken = true;
  5485. }
  5486. if(l == 989) {
  5487. cButtonCPos = 3;
  5488. chatTypeView = 2;
  5489. aBoolean1233 = true;
  5490. inputTaken = true;
  5491. }
  5492. if(l == 987) {
  5493. tradeMode = 2;
  5494. aBoolean1233 = true;
  5495. inputTaken = true;
  5496. }
  5497. if(l == 986) {
  5498. tradeMode = 1;
  5499. aBoolean1233 = true;
  5500. inputTaken = true;
  5501. }
  5502. if(l == 985) {
  5503. tradeMode = 0;
  5504. aBoolean1233 = true;
  5505. inputTaken = true;
  5506. }
  5507. if(l == 984) {
  5508. cButtonCPos = 5;
  5509. chatTypeView = 3;
  5510. aBoolean1233 = true;
  5511. inputTaken = true;
  5512. }
  5513. if(l == 983) {
  5514. duelMode = 2;
  5515. aBoolean1233 = true;
  5516. inputTaken = true;
  5517. }
  5518. if(l == 982) {
  5519. duelMode = 1;
  5520. aBoolean1233 = true;
  5521. inputTaken = true;
  5522. }
  5523. if(l == 981) {
  5524. duelMode = 0;
  5525. aBoolean1233 = true;
  5526. inputTaken = true;
  5527. }
  5528. if(l == 980) {
  5529. cButtonCPos = 6;
  5530. chatTypeView = 4;
  5531. aBoolean1233 = true;
  5532. inputTaken = true;
  5533. }
  5534. if(l == 493)
  5535. {
  5536. stream.createFrame(75);
  5537. stream.method433(k);
  5538. stream.method431(j);
  5539. stream.method432(i1);
  5540. atInventoryLoopCycle = 0;
  5541. atInventoryInterface = k;
  5542. atInventoryIndex = j;
  5543. atInventoryInterfaceType = 2;
  5544. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5545. atInventoryInterfaceType = 1;
  5546. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5547. atInventoryInterfaceType = 3;
  5548. }
  5549. if(l == 652)
  5550. {
  5551. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5552. if(!flag4)
  5553. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5554. crossX = super.saveClickX;
  5555. crossY = super.saveClickY;
  5556. crossType = 2;
  5557. crossIndex = 0;
  5558. stream.createFrame(156);
  5559. stream.method432(j + baseX);
  5560. stream.method431(k + baseY);
  5561. stream.method433(i1);
  5562. }
  5563. if(l == 94)
  5564. {
  5565. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5566. if(!flag5)
  5567. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5568. crossX = super.saveClickX;
  5569. crossY = super.saveClickY;
  5570. crossType = 2;
  5571. crossIndex = 0;
  5572. stream.createFrame(181);
  5573. stream.method431(k + baseY);
  5574. stream.writeWord(i1);
  5575. stream.method431(j + baseX);
  5576. stream.method432(anInt1137);
  5577. }
  5578. if(l == 646)
  5579. {
  5580. stream.createFrame(185);
  5581. stream.writeWord(k);
  5582. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5583. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  5584. {
  5585. int i2 = class9_2.valueIndexArray[0][1];
  5586. if(variousSettings[i2] != class9_2.requiredValues[0])
  5587. {
  5588. variousSettings[i2] = class9_2.requiredValues[0];
  5589. method33(i2);
  5590. needDrawTabArea = true;
  5591. }
  5592. }
  5593. }
  5594. if(l == 225)
  5595. {
  5596. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5597. if(class30_sub2_sub4_sub1_sub1_2 != null)
  5598. {
  5599. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  5600. crossX = super.saveClickX;
  5601. crossY = super.saveClickY;
  5602. crossType = 2;
  5603. crossIndex = 0;
  5604. anInt1226 += i1;
  5605. if(anInt1226 >= 85)
  5606. {
  5607. stream.createFrame(230);
  5608. stream.writeWordBigEndian(239);
  5609. anInt1226 = 0;
  5610. }
  5611. stream.createFrame(17);
  5612. stream.method433(i1);
  5613. }
  5614. }
  5615. if(l == 965)
  5616. {
  5617. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5618. if(class30_sub2_sub4_sub1_sub1_3 != null)
  5619. {
  5620. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  5621. crossX = super.saveClickX;
  5622. crossY = super.saveClickY;
  5623. crossType = 2;
  5624. crossIndex = 0;
  5625. anInt1134++;
  5626. if(anInt1134 >= 96)
  5627. {
  5628. stream.createFrame(152);
  5629. stream.writeWordBigEndian(88);
  5630. anInt1134 = 0;
  5631. }
  5632. stream.createFrame(21);
  5633. stream.writeWord(i1);
  5634. }
  5635. }
  5636. if(l == 413)
  5637. {
  5638. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5639. if(class30_sub2_sub4_sub1_sub1_4 != null)
  5640. {
  5641. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  5642. crossX = super.saveClickX;
  5643. crossY = super.saveClickY;
  5644. crossType = 2;
  5645. crossIndex = 0;
  5646. stream.createFrame(131);
  5647. stream.method433(i1);
  5648. stream.method432(anInt1137);
  5649. }
  5650. }
  5651. if(l == 200)
  5652. clearTopInterfaces();
  5653. if(l == 1025)
  5654. {
  5655. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5656. if(class30_sub2_sub4_sub1_sub1_5 != null)
  5657. {
  5658. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5659. if(entityDef.childrenIDs != null)
  5660. entityDef = entityDef.method161();
  5661. if(entityDef != null)
  5662. {
  5663. String s9;
  5664. if(entityDef.description != null)
  5665. s9 = new String(entityDef.description);
  5666. else
  5667. s9 = "It's a " + entityDef.name + ".";
  5668. pushMessage(s9, 0, "");
  5669. }
  5670. }
  5671. }
  5672. if(l == 900)
  5673. {
  5674. method66(i1, k, j);
  5675. stream.createFrame(252);
  5676. stream.method433(i1 >> 14 & 0x7fff);
  5677. stream.method431(k + baseY);
  5678. stream.method432(j + baseX);
  5679. }
  5680. if(l == 412)
  5681. {
  5682. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5683. if(class30_sub2_sub4_sub1_sub1_6 != null)
  5684. {
  5685. 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]);
  5686. crossX = super.saveClickX;
  5687. crossY = super.saveClickY;
  5688. crossType = 2;
  5689. crossIndex = 0;
  5690. stream.createFrame(72);
  5691. stream.method432(i1);
  5692. }
  5693. }
  5694. if(l == 365)
  5695. {
  5696. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5697. if(class30_sub2_sub4_sub1_sub2_3 != null)
  5698. {
  5699. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  5700. crossX = super.saveClickX;
  5701. crossY = super.saveClickY;
  5702. crossType = 2;
  5703. crossIndex = 0;
  5704. stream.createFrame(249);
  5705. stream.method432(i1);
  5706. stream.method431(anInt1137);
  5707. }
  5708. }
  5709. if(l == 729)
  5710. {
  5711. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5712. if(class30_sub2_sub4_sub1_sub2_4 != null)
  5713. {
  5714. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  5715. crossX = super.saveClickX;
  5716. crossY = super.saveClickY;
  5717. crossType = 2;
  5718. crossIndex = 0;
  5719. stream.createFrame(39);
  5720. stream.method431(i1);
  5721. }
  5722. }
  5723. if(l == 577)
  5724. {
  5725. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5726. if(class30_sub2_sub4_sub1_sub2_5 != null)
  5727. {
  5728. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_5.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  5729. crossX = super.saveClickX;
  5730. crossY = super.saveClickY;
  5731. crossType = 2;
  5732. crossIndex = 0;
  5733. stream.createFrame(139);
  5734. stream.method431(i1);
  5735. }
  5736. }
  5737. if(l == 956 && method66(i1, k, j))
  5738. {
  5739. stream.createFrame(35);
  5740. stream.method431(j + baseX);
  5741. stream.method432(anInt1137);
  5742. stream.method432(k + baseY);
  5743. stream.method431(i1 >> 14 & 0x7fff);
  5744. }
  5745. if(l == 567)
  5746. {
  5747. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5748. if(!flag6)
  5749. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5750. crossX = super.saveClickX;
  5751. crossY = super.saveClickY;
  5752. crossType = 2;
  5753. crossIndex = 0;
  5754. stream.createFrame(23);
  5755. stream.method431(k + baseY);
  5756. stream.method431(i1);
  5757. stream.method431(j + baseX);
  5758. }
  5759. if(l == 867)
  5760. {
  5761. if((i1 & 3) == 0)
  5762. anInt1175++;
  5763. if(anInt1175 >= 59)
  5764. {
  5765. stream.createFrame(200);
  5766. stream.writeWord(25501);
  5767. anInt1175 = 0;
  5768. }
  5769. stream.createFrame(43);
  5770. stream.method431(k);
  5771. stream.method432(i1);
  5772. stream.method432(j);
  5773. atInventoryLoopCycle = 0;
  5774. atInventoryInterface = k;
  5775. atInventoryIndex = j;
  5776. atInventoryInterfaceType = 2;
  5777. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5778. atInventoryInterfaceType = 1;
  5779. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5780. atInventoryInterfaceType = 3;
  5781. }
  5782. if(l == 543)
  5783. {
  5784. stream.createFrame(237);
  5785. stream.writeWord(j);
  5786. stream.method432(i1);
  5787. stream.writeWord(k);
  5788. stream.method432(anInt1137);
  5789. atInventoryLoopCycle = 0;
  5790. atInventoryInterface = k;
  5791. atInventoryIndex = j;
  5792. atInventoryInterfaceType = 2;
  5793. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5794. atInventoryInterfaceType = 1;
  5795. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5796. atInventoryInterfaceType = 3;
  5797. }
  5798. if(l == 606)
  5799. {
  5800. String s2 = menuActionName[i];
  5801. int j2 = s2.indexOf("@whi@");
  5802. if(j2 != -1)
  5803. if(openInterfaceID == -1)
  5804. {
  5805. clearTopInterfaces();
  5806. reportAbuseInput = s2.substring(j2 + 5).trim();
  5807. canMute = false;
  5808. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  5809. {
  5810. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  5811. continue;
  5812. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5813. break;
  5814. }
  5815.  
  5816. } else
  5817. {
  5818. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  5819. }
  5820. }
  5821. if(l == 491)
  5822. {
  5823. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5824. if(class30_sub2_sub4_sub1_sub2_6 != null)
  5825. {
  5826. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  5827. crossX = super.saveClickX;
  5828. crossY = super.saveClickY;
  5829. crossType = 2;
  5830. crossIndex = 0;
  5831. stream.createFrame(14);
  5832. stream.method432(anInt1284);
  5833. stream.writeWord(i1);
  5834. stream.writeWord(anInt1285);
  5835. stream.method431(anInt1283);
  5836. }
  5837. }
  5838. if(l == 639)
  5839. {
  5840. String s3 = menuActionName[i];
  5841. int k2 = s3.indexOf("@whi@");
  5842. if(k2 != -1)
  5843. {
  5844. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5845. int k3 = -1;
  5846. for(int i4 = 0; i4 < friendsCount; i4++)
  5847. {
  5848. if(friendsListAsLongs[i4] != l4)
  5849. continue;
  5850. k3 = i4;
  5851. break;
  5852. }
  5853.  
  5854. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  5855. {
  5856. inputTaken = true;
  5857. inputDialogState = 0;
  5858. messagePromptRaised = true;
  5859. promptInput = "";
  5860. friendsListAction = 3;
  5861. aLong953 = friendsListAsLongs[k3];
  5862. aString1121 = "Enter message to send to " + friendsList[k3];
  5863. }
  5864. }
  5865. }
  5866. if(l == 454)
  5867. {
  5868. stream.createFrame(41);
  5869. stream.writeWord(i1);
  5870. stream.method432(j);
  5871. stream.method432(k);
  5872. atInventoryLoopCycle = 0;
  5873. atInventoryInterface = k;
  5874. atInventoryIndex = j;
  5875. atInventoryInterfaceType = 2;
  5876. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5877. atInventoryInterfaceType = 1;
  5878. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5879. atInventoryInterfaceType = 3;
  5880. }
  5881. if(l == 478)
  5882. {
  5883. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5884. if(class30_sub2_sub4_sub1_sub1_7 != null)
  5885. {
  5886. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  5887. crossX = super.saveClickX;
  5888. crossY = super.saveClickY;
  5889. crossType = 2;
  5890. crossIndex = 0;
  5891. if((i1 & 3) == 0)
  5892. anInt1155++;
  5893. if(anInt1155 >= 53)
  5894. {
  5895. stream.createFrame(85);
  5896. stream.writeWordBigEndian(66);
  5897. anInt1155 = 0;
  5898. }
  5899. stream.createFrame(18);
  5900. stream.method431(i1);
  5901. }
  5902. }
  5903. if(l == 113)
  5904. {
  5905. method66(i1, k, j);
  5906. stream.createFrame(70);
  5907. stream.method431(j + baseX);
  5908. stream.writeWord(k + baseY);
  5909. stream.method433(i1 >> 14 & 0x7fff);
  5910. }
  5911. if(l == 872)
  5912. {
  5913. method66(i1, k, j);
  5914. stream.createFrame(234);
  5915. stream.method433(j + baseX);
  5916. stream.method432(i1 >> 14 & 0x7fff);
  5917. stream.method433(k + baseY);
  5918. }
  5919. if(l == 502)
  5920. {
  5921. method66(i1, k, j);
  5922. stream.createFrame(132);
  5923. stream.method433(j + baseX);
  5924. stream.writeWord(i1 >> 14 & 0x7fff);
  5925. stream.method432(k + baseY);
  5926. }
  5927. if(l == 1125)
  5928. {
  5929. atInventoryLoopCycle = 0;
  5930. atInventoryInterface = k;
  5931. atInventoryIndex = j;
  5932. atInventoryInterfaceType = 2;
  5933. ItemDef itemDef = ItemDef.forID(i1);
  5934. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5935. String s5;
  5936. if(class9_4 != null && class9_4.inventoryValue[j] >= 0x186a0)
  5937. s5 = class9_4.inventoryValue[j] + " x " + itemDef.name;
  5938. else
  5939. if(itemDef.description != null)
  5940. s5 = new String(itemDef.description);
  5941. else
  5942. s5 = "It's a " + itemDef.name + ".";
  5943. pushMessage(s5, 0, "");
  5944. }
  5945. if(l == 169)
  5946. {
  5947. stream.createFrame(185);
  5948. stream.writeWord(k);
  5949. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5950. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  5951. {
  5952. int l2 = class9_3.valueIndexArray[0][1];
  5953. variousSettings[l2] = 1 - variousSettings[l2];
  5954. method33(l2);
  5955. needDrawTabArea = true;
  5956. }
  5957. }
  5958. if(l == 447)
  5959. {
  5960. itemSelected = 1;
  5961. anInt1283 = j;
  5962. anInt1284 = k;
  5963. anInt1285 = i1;
  5964. selectedItemName = ItemDef.forID(i1).name;
  5965. spellSelected = 0;
  5966. needDrawTabArea = true;
  5967. return;
  5968. }
  5969. if(l == 1226)
  5970. {
  5971. int j1 = i1 >> 14 & 0x7fff;
  5972. ObjectDef class46 = ObjectDef.forID(j1);
  5973. String s10;
  5974. if(class46.description != null)
  5975. s10 = new String(class46.description);
  5976. else
  5977. s10 = "It's a " + class46.name + ".";
  5978. pushMessage(s10, 0, "");
  5979. }
  5980. if(l == 244)
  5981. {
  5982. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5983. if(!flag7)
  5984. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5985. crossX = super.saveClickX;
  5986. crossY = super.saveClickY;
  5987. crossType = 2;
  5988. crossIndex = 0;
  5989. stream.createFrame(253);
  5990. stream.method431(j + baseX);
  5991. stream.method433(k + baseY);
  5992. stream.method432(i1);
  5993. }
  5994. if(l == 1448)
  5995. {
  5996. ItemDef itemDef_1 = ItemDef.forID(i1);
  5997. String s6;
  5998. if(itemDef_1.description != null)
  5999. s6 = new String(itemDef_1.description);
  6000. else
  6001. s6 = "It's a " + itemDef_1.name + ".";
  6002. pushMessage(s6, 0, "");
  6003. }
  6004. itemSelected = 0;
  6005. spellSelected = 0;
  6006. needDrawTabArea = true;
  6007.  
  6008. }
  6009.  
  6010. private void method70()
  6011. {
  6012. anInt1251 = 0;
  6013. int j = (myPlayer.x >> 7) + baseX;
  6014. int k = (myPlayer.y >> 7) + baseY;
  6015. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  6016. anInt1251 = 1;
  6017. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  6018. anInt1251 = 1;
  6019. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  6020. anInt1251 = 0;
  6021. }
  6022.  
  6023. public void run() {
  6024.  
  6025. if(drawFlames) {
  6026. drawFlames();
  6027. } else {
  6028. super.run();
  6029. }
  6030. }
  6031.  
  6032. private void build3dScreenMenu()
  6033. {
  6034. if(itemSelected == 0 && spellSelected == 0)
  6035. {
  6036. menuActionName[menuActionRow] = "Walk here";
  6037. menuActionID[menuActionRow] = 516;
  6038. menuActionCmd2[menuActionRow] = super.mouseX;
  6039. menuActionCmd3[menuActionRow] = super.mouseY;
  6040. menuActionRow++;
  6041. }
  6042. int j = -1;
  6043. for(int k = 0; k < Model.anInt1687; k++)
  6044. {
  6045. int l = Model.anIntArray1688[k];
  6046. int i1 = l & 0x7f;
  6047. int j1 = l >> 7 & 0x7f;
  6048. int k1 = l >> 29 & 3;
  6049. int l1 = l >> 14 & 0x7fff;
  6050. if(l == j)
  6051. continue;
  6052. j = l;
  6053. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  6054. {
  6055. ObjectDef class46 = ObjectDef.forID(l1);
  6056. if(class46.childrenIDs != null)
  6057. class46 = class46.method580();
  6058. if(class46 == null)
  6059. continue;
  6060. if(itemSelected == 1)
  6061. {
  6062. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  6063. menuActionID[menuActionRow] = 62;
  6064. menuActionCmd1[menuActionRow] = l;
  6065. menuActionCmd2[menuActionRow] = i1;
  6066. menuActionCmd3[menuActionRow] = j1;
  6067. menuActionRow++;
  6068. } else
  6069. if(spellSelected == 1)
  6070. {
  6071. if((spellUsableOn & 4) == 4)
  6072. {
  6073. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  6074. menuActionID[menuActionRow] = 956;
  6075. menuActionCmd1[menuActionRow] = l;
  6076. menuActionCmd2[menuActionRow] = i1;
  6077. menuActionCmd3[menuActionRow] = j1;
  6078. menuActionRow++;
  6079. }
  6080. } else
  6081. {
  6082. if(class46.itemActions != null)
  6083. {
  6084. for(int i2 = 4; i2 >= 0; i2--)
  6085. if(class46.itemActions[i2] != null)
  6086. {
  6087. menuActionName[menuActionRow] = class46.itemActions[i2] + " @cya@" + class46.name;
  6088. if(i2 == 0)
  6089. menuActionID[menuActionRow] = 502;
  6090. if(i2 == 1)
  6091. menuActionID[menuActionRow] = 900;
  6092. if(i2 == 2)
  6093. menuActionID[menuActionRow] = 113;
  6094. if(i2 == 3)
  6095. menuActionID[menuActionRow] = 872;
  6096. if(i2 == 4)
  6097. menuActionID[menuActionRow] = 1062;
  6098. menuActionCmd1[menuActionRow] = l;
  6099. menuActionCmd2[menuActionRow] = i1;
  6100. menuActionCmd3[menuActionRow] = j1;
  6101. menuActionRow++;
  6102. }
  6103.  
  6104. }
  6105. if(idToggle == true) {
  6106. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  6107. } else {
  6108. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  6109. }
  6110. menuActionID[menuActionRow] = 1226;
  6111. menuActionCmd1[menuActionRow] = class46.type << 14;
  6112. menuActionCmd2[menuActionRow] = i1;
  6113. menuActionCmd3[menuActionRow] = j1;
  6114. menuActionRow++;
  6115. }
  6116. }
  6117. if(k1 == 1)
  6118. {
  6119. NPC npc = npcArray[l1];
  6120. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  6121. {
  6122. for(int j2 = 0; j2 < npcCount; j2++)
  6123. {
  6124. NPC npc2 = npcArray[npcIndices[j2]];
  6125. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  6126. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  6127. }
  6128.  
  6129. for(int l2 = 0; l2 < playerCount; l2++)
  6130. {
  6131. Player player = playerArray[playerIndices[l2]];
  6132. if(player != null && player.x == npc.x && player.y == npc.y)
  6133. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  6134. }
  6135.  
  6136. }
  6137. buildAtNPCMenu(npc.desc, l1, j1, i1);
  6138. }
  6139. if(k1 == 0)
  6140. {
  6141. Player player = playerArray[l1];
  6142. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  6143. {
  6144. for(int k2 = 0; k2 < npcCount; k2++)
  6145. {
  6146. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  6147. 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)
  6148. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  6149. }
  6150.  
  6151. for(int i3 = 0; i3 < playerCount; i3++)
  6152. {
  6153. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  6154. 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)
  6155. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  6156. }
  6157.  
  6158. }
  6159. buildAtPlayerMenu(i1, l1, player, j1);
  6160. }
  6161. if(k1 == 3)
  6162. {
  6163. NodeList class19 = groundArray[plane][i1][j1];
  6164. if(class19 != null)
  6165. {
  6166. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  6167. {
  6168. ItemDef itemDef = ItemDef.forID(item.ID);
  6169. if(itemSelected == 1)
  6170. {
  6171. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  6172. menuActionID[menuActionRow] = 511;
  6173. menuActionCmd1[menuActionRow] = item.ID;
  6174. menuActionCmd2[menuActionRow] = i1;
  6175. menuActionCmd3[menuActionRow] = j1;
  6176. menuActionRow++;
  6177. } else
  6178. if(spellSelected == 1)
  6179. {
  6180. if((spellUsableOn & 1) == 1)
  6181. {
  6182. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  6183. menuActionID[menuActionRow] = 94;
  6184. menuActionCmd1[menuActionRow] = item.ID;
  6185. menuActionCmd2[menuActionRow] = i1;
  6186. menuActionCmd3[menuActionRow] = j1;
  6187. menuActionRow++;
  6188. }
  6189. } else
  6190. {
  6191. for(int j3 = 4; j3 >= 0; j3--)
  6192. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  6193. {
  6194. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  6195. if(j3 == 0)
  6196. menuActionID[menuActionRow] = 652;
  6197. if(j3 == 1)
  6198. menuActionID[menuActionRow] = 567;
  6199. if(j3 == 2)
  6200. menuActionID[menuActionRow] = 234;
  6201. if(j3 == 3)
  6202. menuActionID[menuActionRow] = 244;
  6203. if(j3 == 4)
  6204. menuActionID[menuActionRow] = 213;
  6205. menuActionCmd1[menuActionRow] = item.ID;
  6206. menuActionCmd2[menuActionRow] = i1;
  6207. menuActionCmd3[menuActionRow] = j1;
  6208. menuActionRow++;
  6209. } else
  6210. if(j3 == 2)
  6211. {
  6212. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  6213. menuActionID[menuActionRow] = 234;
  6214. menuActionCmd1[menuActionRow] = item.ID;
  6215. menuActionCmd2[menuActionRow] = i1;
  6216. menuActionCmd3[menuActionRow] = j1;
  6217. menuActionRow++;
  6218. }
  6219. if(idToggle == true) {
  6220. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  6221. } else {
  6222. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  6223. }
  6224. menuActionID[menuActionRow] = 1448;
  6225. menuActionCmd1[menuActionRow] = item.ID;
  6226. menuActionCmd2[menuActionRow] = i1;
  6227. menuActionCmd3[menuActionRow] = j1;
  6228. menuActionRow++;
  6229. }
  6230. }
  6231.  
  6232. }
  6233. }
  6234. }
  6235. }
  6236.  
  6237. public void cleanUpForQuit()
  6238. {
  6239. signlink.reporterror = false;
  6240. try
  6241. {
  6242. if(socketStream != null)
  6243. socketStream.close();
  6244. System.out.println("Here6");
  6245. }
  6246. catch(Exception _ex) { }
  6247. socketStream = null;
  6248. stopMidi();
  6249. if(mouseDetection != null)
  6250. mouseDetection.running = false;
  6251. mouseDetection = null;
  6252. onDemandFetcher.disable();
  6253. onDemandFetcher = null;
  6254. aStream_834 = null;
  6255. stream = null;
  6256. aStream_847 = null;
  6257. inStream = null;
  6258. anIntArray1234 = null;
  6259. aByteArrayArray1183 = null;
  6260. aByteArrayArray1247 = null;
  6261. anIntArray1235 = null;
  6262. anIntArray1236 = null;
  6263. intGroundArray = null;
  6264. byteGroundArray = null;
  6265. worldController = null;
  6266. aClass11Array1230 = null;
  6267. anIntArrayArray901 = null;
  6268. anIntArrayArray825 = null;
  6269. bigX = null;
  6270. bigY = null;
  6271. aByteArray912 = null;
  6272. inventoryBackImage = null;
  6273. mapEdgeIP = null;
  6274. leftFrame = null;
  6275. topFrame = null;
  6276. rightFrame = null;
  6277. mapBackImage = null;
  6278. inGameScreen = null;
  6279. chatBackImage = null;
  6280. //aRSImageProducer_1123 = null;
  6281. aRSImageProducer_1124 = null;
  6282. aRSImageProducer_1125 = null;
  6283. /* Null pointers for custom sprites */
  6284.  
  6285. alertBack = null;
  6286. alertBorder = null;
  6287. alertBorderH = null;
  6288. chatArea = null;
  6289. loadingPleaseWait = null;
  6290. reestablish = null;
  6291. loadingBarFull = null;
  6292. loadingBarEmpty = null;
  6293. chatButtons = null;
  6294. tabArea = null;
  6295. mapArea = null;
  6296. HPBarFull = null;
  6297. HPBarEmpty = null;
  6298. magicAuto = null;
  6299. tabHover = null;
  6300. tabClicked = null;
  6301. newSideIcons = null;
  6302. /**/
  6303. mapBack = null;
  6304. CustomMapback = null;
  6305.  
  6306. sideIcons = null;
  6307. sIcons483 = null;
  6308. sIcons459 = null;
  6309.  
  6310. redStones = null;
  6311. compass = null;
  6312. hitMarks = null;
  6313. hitMark = null;
  6314. headIcons = null;
  6315. skullIcons = null;
  6316. headIconsHint = null;
  6317. crosses = null;
  6318. mapDotItem = null;
  6319. mapDotNPC = null;
  6320. mapDotPlayer = null;
  6321. mapDotFriend = null;
  6322. mapDotTeam = null;
  6323. mapScenes = null;
  6324. mapFunctions = null;
  6325. anIntArrayArray929 = null;
  6326. playerArray = null;
  6327. playerIndices = null;
  6328. anIntArray894 = null;
  6329. aStreamArray895s = null;
  6330. anIntArray840 = null;
  6331. npcArray = null;
  6332. npcIndices = null;
  6333. groundArray = null;
  6334. aClass19_1179 = null;
  6335. aClass19_1013 = null;
  6336. aClass19_1056 = null;
  6337. menuActionCmd2 = null;
  6338. menuActionCmd3 = null;
  6339. menuActionID = null;
  6340. menuActionCmd1 = null;
  6341. menuActionName = null;
  6342. variousSettings = null;
  6343. anIntArray1072 = null;
  6344. anIntArray1073 = null;
  6345. aSpriteArray1140 = null;
  6346. aSprite_1263 = null;
  6347. friendsList = null;
  6348. friendsListAsLongs = null;
  6349. friendsNodeIDs = null;
  6350. leftSideFlame = null;
  6351. rightSideFlame = null;
  6352. aRSImageProducer_1107 = null;
  6353. aRSImageProducer_1108 = null;
  6354. loginScreenArea = null;
  6355. gameLogo = null;
  6356. aRSImageProducer_1113 = null;
  6357. aRSImageProducer_1114 = null;
  6358. aRSImageProducer_1115 = null;
  6359. multiOverlay = null;
  6360. nullLoader();
  6361. ObjectDef.nullLoader();
  6362. EntityDef.nullLoader();
  6363. ItemDef.nullLoader();
  6364. Flo.cache = null;
  6365. IdentityKit.cache = null;
  6366. RSInterface.interfaceCache = null;
  6367. DummyClass.cache = null;
  6368. Animation.anims = null;
  6369. SpotAnim.cache = null;
  6370. SpotAnim.aMRUNodes_415 = null;
  6371. Varp.cache = null;
  6372. super.fullGameScreen = null;
  6373. Player.mruNodes = null;
  6374. Texture.nullLoader();
  6375. WorldController.nullLoader();
  6376. Model.nullLoader();
  6377. Class36.nullLoader();
  6378. System.gc();
  6379. }
  6380.  
  6381. private void printDebug()
  6382. {
  6383. System.out.println("============");
  6384. System.out.println("flame-cycle:" + anInt1208);
  6385. if(onDemandFetcher != null)
  6386. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  6387. System.out.println("loop-cycle:" + loopCycle);
  6388. System.out.println("draw-cycle:" + anInt1061);
  6389. System.out.println("ptype:" + pktType);
  6390. System.out.println("psize:" + pktSize);
  6391. if(socketStream != null)
  6392. socketStream.printDebug();
  6393. super.shouldDebug = true;
  6394. }
  6395.  
  6396. Component getGameComponent() {
  6397.  
  6398.  
  6399. if(signlink.mainapp != null)
  6400. return signlink.mainapp;
  6401. if(super.gameFrame != null)
  6402. return super.gameFrame;
  6403. else
  6404. return this;
  6405. }
  6406.  
  6407. private void method73() {
  6408. do {
  6409. int j = readChar(-796);
  6410. if(j == -1)
  6411. break;
  6412. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  6413. if(j == 8 && reportAbuseInput.length() > 0)
  6414. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  6415. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  6416. reportAbuseInput += (char)j;
  6417. } else if(messagePromptRaised) {
  6418. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  6419. promptInput += (char)j;
  6420. inputTaken = true;
  6421. }
  6422. if(j == 8 && promptInput.length() > 0) {
  6423. promptInput = promptInput.substring(0, promptInput.length() - 1);
  6424. inputTaken = true;
  6425. }
  6426. if(j == 13 || j == 10) {
  6427. messagePromptRaised = false;
  6428. inputTaken = true;
  6429. if(friendsListAction == 1) {
  6430. long l = TextClass.longForName(promptInput);
  6431. addFriend(l);
  6432. }
  6433. if(friendsListAction == 2 && friendsCount > 0) {
  6434. long l1 = TextClass.longForName(promptInput);
  6435. delFriend(l1);
  6436. }
  6437. if(friendsListAction == 3 && promptInput.length() > 0) {
  6438. stream.createFrame(126);
  6439. stream.writeWordBigEndian(0);
  6440. int k = stream.currentOffset;
  6441. stream.writeQWord(aLong953);
  6442. TextInput.method526(promptInput, stream);
  6443. stream.writeBytes(stream.currentOffset - k);
  6444. promptInput = TextInput.processText(promptInput);
  6445. //promptInput = Censor.doCensor(promptInput);
  6446. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  6447. if(privateChatMode == 2) {
  6448. privateChatMode = 1;
  6449. aBoolean1233 = true;
  6450. stream.createFrame(95);
  6451. stream.writeWordBigEndian(publicChatMode);
  6452. stream.writeWordBigEndian(privateChatMode);
  6453. stream.writeWordBigEndian(tradeMode);
  6454. }
  6455. }
  6456. if(friendsListAction == 4 && ignoreCount < 100) {
  6457. long l2 = TextClass.longForName(promptInput);
  6458. addIgnore(l2);
  6459. }
  6460. if(friendsListAction == 5 && ignoreCount > 0) {
  6461. long l3 = TextClass.longForName(promptInput);
  6462. delIgnore(l3);
  6463. }
  6464. if(friendsListAction == 6) {
  6465. long l3 = TextClass.longForName(promptInput);
  6466. chatJoin(l3);
  6467. }
  6468. }
  6469. } else if(inputDialogState == 1) {
  6470. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6471. amountOrNameInput += (char)j;
  6472. inputTaken = true;
  6473. }
  6474. if(j == 8 && amountOrNameInput.length() > 0) {
  6475. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6476. inputTaken = true;
  6477. }
  6478. if(j == 13 || j == 10) {
  6479. if(amountOrNameInput.length() > 0) {
  6480. int i1 = 0;
  6481. try {
  6482. i1 = Integer.parseInt(amountOrNameInput);
  6483. }
  6484. catch(Exception _ex) { }
  6485. stream.createFrame(208);
  6486. stream.writeDWord(i1);
  6487. }
  6488. inputDialogState = 0;
  6489. inputTaken = true;
  6490. }
  6491. } else if(inputDialogState == 2) {
  6492. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6493. amountOrNameInput += (char)j;
  6494. inputTaken = true;
  6495. }
  6496. if(j == 8 && amountOrNameInput.length() > 0) {
  6497. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6498. inputTaken = true;
  6499. }
  6500. if(j == 13 || j == 10) {
  6501. if(amountOrNameInput.length() > 0) {
  6502. stream.createFrame(60);
  6503. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  6504. }
  6505. inputDialogState = 0;
  6506. inputTaken = true;
  6507. }
  6508. } else if(backDialogID == -1) {
  6509. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  6510. inputString += (char)j;
  6511. inputTaken = true;
  6512. }
  6513. if(j == 8 && inputString.length() > 0) {
  6514. inputString = inputString.substring(0, inputString.length() - 1);
  6515. inputTaken = true;
  6516. }
  6517. if((j == 13 || j == 10) && inputString.length() > 0) {
  6518.  
  6519. if(myPrivilege >= 2 || server.equals("64.186.153.193") || 1 == 1) {
  6520. if(inputString.equals("region")) {
  6521. System.out.println("Current region: " + anInt1069 + ", " + anInt1070);
  6522. }
  6523. //17511 = Question Type
  6524. //15819 = Christmas Type
  6525. //15812 = Security Type
  6526. //15801 = Item Scam Type
  6527. //15791 = Password Safety ?
  6528. //15774 = Good/Bad Password
  6529. //15767 = Drama Type ????
  6530. }
  6531.  
  6532. if(inputString.equals("::fpson"))
  6533. fpsOn = true;
  6534. if(inputString.equals("::fpsoff"))
  6535. fpsOn = false;
  6536. if(inputString.equals("::dataon"))
  6537. clientData = true;
  6538. if(inputString.equals("::dataoff"))
  6539. clientData = false;
  6540. if(inputString.equals("::vote") || inputString.equals("::Vote") || inputString.equals("::VOTE"))
  6541. launchURL("http://www.runelocus.com/toplist/vote-32208.html");
  6542. if(inputString.equals("::register") || inputString.equals("::Register") || inputString.equals("::REGISTER"))
  6543. launchURL("http://projecttpk.webs.com");
  6544. if(inputString.equals("::donate") || inputString.equals("::Donate") || inputString.equals("::DONATE"))
  6545. launchURL("http://projecttpk.webs.com/donate");
  6546. if(inputString.equals("::Dumpmodels"))
  6547. models();
  6548. if (inputString.startsWith("::woot")) {
  6549. int newItemID = 0;
  6550. try {
  6551. String[] args = inputString.split(" ");
  6552. if (args.length == 2) {
  6553. newItemID = Integer.parseInt(args[1]);
  6554. stream.createFrame(237); //magic on items
  6555. stream.writeWord(0); // slot
  6556. stream.method432(newItemID); // itemid
  6557. stream.writeWord(0); // junk
  6558. stream.method432(1155);// spellid
  6559. }
  6560. } catch(Exception e) {}
  6561. }
  6562. if(inputString.startsWith("/"))
  6563. inputString = "::" + inputString;
  6564. if(inputString.startsWith("::")) {
  6565. stream.createFrame(103);
  6566. stream.writeWordBigEndian(inputString.length() - 1);
  6567. stream.writeString(inputString.substring(2));
  6568. } else {
  6569. String s = inputString.toLowerCase();
  6570. int j2 = 0;
  6571. if(s.startsWith("yellow:"))
  6572. {
  6573. j2 = 0;
  6574. inputString = inputString.substring(7);
  6575. } else if(s.startsWith("red:"))
  6576. {
  6577. j2 = 1;
  6578. inputString = inputString.substring(4);
  6579. } else if(s.startsWith("green:"))
  6580. {
  6581. j2 = 2;
  6582. inputString = inputString.substring(6);
  6583. } else if(s.startsWith("cyan:"))
  6584. {
  6585. j2 = 3;
  6586. inputString = inputString.substring(5);
  6587. } else if(s.startsWith("purple:"))
  6588. {
  6589. j2 = 4;
  6590. inputString = inputString.substring(7);
  6591. } else if(s.startsWith("white:"))
  6592. {
  6593. j2 = 5;
  6594. inputString = inputString.substring(6);
  6595. } else if(s.startsWith("flash1:"))
  6596. {
  6597. j2 = 6;
  6598. inputString = inputString.substring(7);
  6599. } else if(s.startsWith("flash2:"))
  6600. {
  6601. j2 = 7;
  6602. inputString = inputString.substring(7);
  6603. } else if(s.startsWith("flash3:"))
  6604. {
  6605. j2 = 8;
  6606. inputString = inputString.substring(7);
  6607. } else if(s.startsWith("glow1:"))
  6608. {
  6609. j2 = 9;
  6610. inputString = inputString.substring(6);
  6611. } else if(s.startsWith("glow2:"))
  6612. {
  6613. j2 = 10;
  6614. inputString = inputString.substring(6);
  6615. } else if(s.startsWith("glow3:"))
  6616. {
  6617. j2 = 11;
  6618. inputString = inputString.substring(6);
  6619. }
  6620. s = inputString.toLowerCase();
  6621. int i3 = 0;
  6622. if(s.startsWith("wave:"))
  6623. {
  6624. i3 = 1;
  6625. inputString = inputString.substring(5);
  6626. } else if(s.startsWith("wave2:"))
  6627. {
  6628. i3 = 2;
  6629. inputString = inputString.substring(6);
  6630. } else if(s.startsWith("shake:"))
  6631. {
  6632. i3 = 3;
  6633. inputString = inputString.substring(6);
  6634. } else if(s.startsWith("scroll:"))
  6635. {
  6636. i3 = 4;
  6637. inputString = inputString.substring(7);
  6638. } else if(s.startsWith("slide:"))
  6639. {
  6640. i3 = 5;
  6641. inputString = inputString.substring(6);
  6642. }
  6643. stream.createFrame(4);
  6644. stream.writeWordBigEndian(0);
  6645. int j3 = stream.currentOffset;
  6646. stream.method425(i3);
  6647. stream.method425(j2);
  6648. aStream_834.currentOffset = 0;
  6649. TextInput.method526(inputString, aStream_834);
  6650. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  6651. stream.writeBytes(stream.currentOffset - j3);
  6652. inputString = TextInput.processText(inputString);
  6653. //inputString = Censor.doCensor(inputString);
  6654. myPlayer.textSpoken = inputString;
  6655. myPlayer.anInt1513 = j2;
  6656. myPlayer.anInt1531 = i3;
  6657. myPlayer.textCycle = 150;
  6658. //My players icons showing up when I speak
  6659. if(myPrivilege == 4) {
  6660. pushMessage(myPlayer.textSpoken, 2, "@cr0@" + myPlayer.name);
  6661. } else if(myPrivilege == 3) {
  6662. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  6663. } else if(myPrivilege == 2) {
  6664. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  6665. } else if(myPrivilege == 1) {
  6666. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  6667. } else {
  6668. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  6669. }
  6670. if(publicChatMode == 2)
  6671. {
  6672. publicChatMode = 3;
  6673. aBoolean1233 = true;
  6674. stream.createFrame(95);
  6675. stream.writeWordBigEndian(publicChatMode);
  6676. stream.writeWordBigEndian(privateChatMode);
  6677. stream.writeWordBigEndian(tradeMode);
  6678. }
  6679. }
  6680. inputString = "";
  6681. inputTaken = true;
  6682. }
  6683. }
  6684. } while(true);
  6685. }
  6686.  
  6687. private void buildPublicChat(int j)
  6688. {
  6689. int l = 0;
  6690. for(int i1 = 0; i1 < 500; i1++)
  6691. {
  6692. if(chatMessages[i1] == null)
  6693. continue;
  6694. if(chatTypeView != 1)
  6695. continue;
  6696. int j1 = chatTypes[i1];
  6697. String s = chatNames[i1];
  6698. String ct = chatMessages[i1];
  6699. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6700. if(k1 < -23)
  6701. break;
  6702. if(s != null && s.startsWith("@cr0@"))
  6703. s = s.substring(5);
  6704. if(s != null && s.startsWith("@cr1@"))
  6705. s = s.substring(5);
  6706. if(s != null && s.startsWith("@cr2@"))
  6707. s = s.substring(5);
  6708. if(s != null && s.startsWith("@cr3@"))
  6709. s = s.substring(5);
  6710. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6711. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6712. if(myPrivilege >= 1) {
  6713. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6714. menuActionID[menuActionRow] = 606;
  6715. menuActionRow++;
  6716. }
  6717. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6718. menuActionID[menuActionRow] = 42;
  6719. menuActionRow++;
  6720. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6721. menuActionID[menuActionRow] = 337;
  6722. menuActionRow++;
  6723. }
  6724. l++;
  6725. }
  6726. }
  6727. }
  6728.  
  6729. private void buildFriendChat(int j)
  6730. {
  6731. int l = 0;
  6732. for(int i1 = 0; i1 < 500; i1++) {
  6733. if(chatMessages[i1] == null)
  6734. continue;
  6735. if(chatTypeView != 2)
  6736. continue;
  6737. int j1 = chatTypes[i1];
  6738. String s = chatNames[i1];
  6739. String ct = chatMessages[i1];
  6740. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6741. if(k1 < -23)
  6742. break;
  6743. if(s != null && s.startsWith("@cr0@"))
  6744. s = s.substring(5);
  6745. if(s != null && s.startsWith("@cr1@"))
  6746. s = s.substring(5);
  6747. if(s != null && s.startsWith("@cr2@"))
  6748. s = s.substring(5);
  6749. if(s != null && s.startsWith("@cr3@"))
  6750. s = s.substring(5);
  6751. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6752. l++;
  6753. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6754. {
  6755. if(j > k1 - 14 && j <= k1) {
  6756. if(myPrivilege >= 1) {
  6757. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6758. menuActionID[menuActionRow] = 606;
  6759. menuActionRow++;
  6760. }
  6761. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6762. menuActionID[menuActionRow] = 42;
  6763. menuActionRow++;
  6764. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6765. menuActionID[menuActionRow] = 337;
  6766. menuActionRow++;
  6767. }
  6768. l++;
  6769. }
  6770. }
  6771. }
  6772.  
  6773. private void buildDuelorTrade(int j) {
  6774. int l = 0;
  6775. for(int i1 = 0; i1 < 500; i1++) {
  6776. if(chatMessages[i1] == null)
  6777. continue;
  6778. if(chatTypeView != 3 && chatTypeView != 4)
  6779. continue;
  6780. int j1 = chatTypes[i1];
  6781. String s = chatNames[i1];
  6782. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6783. if(k1 < -23)
  6784. break;
  6785. if(s != null && s.startsWith("@cr0@"))
  6786. s = s.substring(5);
  6787. if(s != null && s.startsWith("@cr1@"))
  6788. s = s.substring(5);
  6789. if(s != null && s.startsWith("@cr2@"))
  6790. s = s.substring(5);
  6791. if(s != null && s.startsWith("@cr3@"))
  6792. s = s.substring(5);
  6793. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6794. if(j > k1 - 14 && j <= k1) {
  6795. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6796. menuActionID[menuActionRow] = 484;
  6797. menuActionRow++;
  6798. }
  6799. l++;
  6800. }
  6801. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6802. if(j > k1 - 14 && j <= k1) {
  6803. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6804. menuActionID[menuActionRow] = 6;
  6805. menuActionRow++;
  6806. }
  6807. l++;
  6808. }
  6809. if(j1 == 12) {
  6810. if(j > k1 - 14 && j <= k1) {
  6811. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  6812. menuActionID[menuActionRow] = 915;
  6813. menuActionRow++;
  6814. }
  6815. l++;
  6816. }
  6817. }
  6818. }
  6819.  
  6820. private void buildChatAreaMenu(int j) {
  6821. int l = 0;
  6822. int test = 0;
  6823. for(int i1 = 0; i1 < 500; i1++) {
  6824. if(chatMessages[i1] == null)
  6825. continue;
  6826. int j1 = chatTypes[i1];
  6827. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6828. if(k1 < -23)
  6829. break;
  6830. String s = chatNames[i1];
  6831. String ct = chatMessages[i1];
  6832. boolean flag = false;
  6833. if(chatTypeView == 1) {
  6834. buildPublicChat(j);
  6835. break;
  6836. }
  6837. if(chatTypeView == 2) {
  6838. buildFriendChat(j);
  6839. break;
  6840. }
  6841. if(chatTypeView == 3 || chatTypeView == 4) {
  6842. buildDuelorTrade(j);
  6843. break;
  6844. }
  6845. if(chatTypeView == 5) {
  6846. break;
  6847. }
  6848. if (s != null && s.startsWith("@cr0@")) {
  6849. s = s.substring(5);
  6850. byte byte0 = 1;
  6851. }
  6852. if(s != null && s.startsWith("@cr1@")) {
  6853. s = s.substring(5);
  6854. boolean flag1 = true;
  6855. byte byte0 = 2;
  6856. }
  6857. if(s != null && s.startsWith("@cr2@")) {
  6858. s = s.substring(5);
  6859. byte byte0 = 3;
  6860. }
  6861. if(s != null && s.startsWith("@cr3@")) {
  6862. s = s.substring(5);
  6863. byte byte0 = 4;
  6864. }
  6865. if(j1 == 0)
  6866. l++;
  6867. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6868. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6869. if(myPrivilege >= 1) {
  6870. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6871. menuActionID[menuActionRow] = 606;
  6872. menuActionRow++;
  6873. }
  6874. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6875. menuActionID[menuActionRow] = 42;
  6876. menuActionRow++;
  6877. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6878. menuActionID[menuActionRow] = 337;
  6879. menuActionRow++;
  6880. }
  6881. l++;
  6882. }
  6883. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6884. if(j > k1 - 14 && j <= k1) {
  6885. if(myPrivilege >= 1) {
  6886. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6887. menuActionID[menuActionRow] = 606;
  6888. menuActionRow++;
  6889. }
  6890. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6891. menuActionID[menuActionRow] = 42;
  6892. menuActionRow++;
  6893. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6894. menuActionID[menuActionRow] = 337;
  6895. menuActionRow++;
  6896. }
  6897. l++;
  6898. }
  6899. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6900. if(j > k1 - 14 && j <= k1) {
  6901. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6902. menuActionID[menuActionRow] = 484;
  6903. menuActionRow++;
  6904. }
  6905. l++;
  6906. }
  6907. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6908. l++;
  6909. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6910. if(j > k1 - 14 && j <= k1) {
  6911. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6912. menuActionID[menuActionRow] = 6;
  6913. menuActionRow++;
  6914. }
  6915. l++;
  6916. }
  6917. if(j1 == 9) {
  6918. if(j > k1 - 14 && j <= k1) {
  6919. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  6920. menuActionID[menuActionRow] = 927;
  6921. menuActionRow++;
  6922. }
  6923. l++;
  6924. }
  6925. if(j1 == 10) {
  6926. if(j > k1 - 14 && j <= k1) {
  6927. menuActionName[menuActionRow] = s;
  6928. menuActionID[menuActionRow] = 1090;
  6929. menuActionRow++;
  6930. }
  6931. l++;
  6932. }
  6933. }
  6934.  
  6935. }
  6936.  
  6937.  
  6938.  
  6939. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  6940. {
  6941. int j = class9.contentType;
  6942. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  6943. {
  6944. if(j == 1 && anInt900 == 0)
  6945. {
  6946. class9.disabledMessage = "Loading friend list";
  6947. class9.atActionType = 0;
  6948. return;
  6949. }
  6950. if(j == 1 && anInt900 == 1)
  6951. {
  6952. class9.disabledMessage = "Connecting to friendserver";
  6953. class9.atActionType = 0;
  6954. return;
  6955. }
  6956. if(j == 2 && anInt900 != 2)
  6957. {
  6958. class9.disabledMessage = "Please wait...";
  6959. class9.atActionType = 0;
  6960. return;
  6961. }
  6962. int k = friendsCount;
  6963. if(anInt900 != 2)
  6964. k = 0;
  6965. if(j > 700)
  6966. j -= 601;
  6967. else
  6968. j--;
  6969. if(j >= k)
  6970. {
  6971. class9.disabledMessage = "";
  6972. class9.atActionType = 0;
  6973. return;
  6974. } else
  6975. {
  6976. class9.disabledMessage = friendsList[j];
  6977. class9.atActionType = 1;
  6978. return;
  6979. }
  6980. }
  6981. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  6982. {
  6983. int l = friendsCount;
  6984. if(anInt900 != 2)
  6985. l = 0;
  6986. if(j > 800)
  6987. j -= 701;
  6988. else
  6989. j -= 101;
  6990. if(j >= l)
  6991. {
  6992. class9.disabledMessage = "";
  6993. class9.atActionType = 0;
  6994. return;
  6995. }
  6996. if(friendsNodeIDs[j] == 10)
  6997. class9.disabledMessage = "@gre@Online";
  6998. else
  6999. if(friendsNodeIDs[j] == nodeID)
  7000. class9.disabledMessage = "@red@Offline";
  7001. else
  7002. class9.disabledMessage = "@red@Offline";
  7003. class9.atActionType = 1;
  7004. return;
  7005. }
  7006. if(j == 203)
  7007. {
  7008. int i1 = friendsCount;
  7009. if(anInt900 != 2)
  7010. i1 = 0;
  7011. class9.scrollMax = i1 * 15 + 20;
  7012. if(class9.scrollMax <= class9.height)
  7013. class9.scrollMax = class9.height + 1;
  7014. return;
  7015. }
  7016. if(j >= 401 && j <= 500)
  7017. {
  7018. if((j -= 401) == 0 && anInt900 == 0)
  7019. {
  7020. class9.disabledMessage = "Loading ignore list";
  7021. class9.atActionType = 0;
  7022. return;
  7023. }
  7024. if(j == 1 && anInt900 == 0)
  7025. {
  7026. class9.disabledMessage = "Please wait...";
  7027. class9.atActionType = 0;
  7028. return;
  7029. }
  7030. int j1 = ignoreCount;
  7031. if(anInt900 == 0)
  7032. j1 = 0;
  7033. if(j >= j1)
  7034. {
  7035. class9.disabledMessage = "";
  7036. class9.atActionType = 0;
  7037. return;
  7038. } else
  7039. {
  7040. class9.disabledMessage = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  7041. class9.atActionType = 1;
  7042. return;
  7043. }
  7044. }
  7045. if(j == 503)
  7046. {
  7047. class9.scrollMax = ignoreCount * 15 + 20;
  7048. if(class9.scrollMax <= class9.height)
  7049. class9.scrollMax = class9.height + 1;
  7050. return;
  7051. }
  7052. if(j == 327)
  7053. {
  7054. class9.modelRotationY = 150;
  7055. class9.modelRotationX = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  7056. if(aBoolean1031)
  7057. {
  7058. for(int k1 = 0; k1 < 7; k1++)
  7059. {
  7060. int l1 = anIntArray1065[k1];
  7061. if(l1 >= 0 && !IdentityKit.cache[l1].method537())
  7062. return;
  7063. }
  7064.  
  7065. aBoolean1031 = false;
  7066. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  7067. int i2 = 0;
  7068. for(int j2 = 0; j2 < 7; j2++)
  7069. {
  7070. int k2 = anIntArray1065[j2];
  7071. if(k2 >= 0)
  7072. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2].method538();
  7073. }
  7074.  
  7075. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  7076. for(int l2 = 0; l2 < 5; l2++)
  7077. if(anIntArray990[l2] != 0)
  7078. {
  7079. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  7080. if(l2 == 1)
  7081. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7082. }
  7083.  
  7084. model.method469();
  7085. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  7086. model.method479(64, 850, -30, -50, -30, true);
  7087. class9.disabledMediaType = 5;
  7088. class9.disabledMediaID = 0;
  7089. RSInterface.method208(aBoolean994, model);
  7090. }
  7091. return;
  7092. }
  7093. if(j == 328) {
  7094. RSInterface rsInterface = class9;
  7095. int verticleTilt = 150;
  7096. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  7097. rsInterface.modelRotationY = verticleTilt;
  7098. rsInterface.modelRotationX = animationSpeed;
  7099. if(aBoolean1031) {
  7100. Model characterDisplay = myPlayer.method452();
  7101. for(int l2 = 0; l2 < 5; l2++)
  7102. if(anIntArray990[l2] != 0) {
  7103. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  7104. if(l2 == 1)
  7105. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7106. }
  7107. int staticFrame = myPlayer.anInt1511;
  7108. characterDisplay.method469();
  7109. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  7110. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  7111. rsInterface.disabledMediaType = 5;
  7112. rsInterface.disabledMediaID = 0;
  7113. RSInterface.method208(aBoolean994, characterDisplay);
  7114. }
  7115. return;
  7116. }
  7117. if(j == 324)
  7118. {
  7119. if(aSprite_931 == null)
  7120. {
  7121. aSprite_931 = class9.disabledSprite;
  7122. aSprite_932 = class9.enabledSprite;
  7123. }
  7124. if(aBoolean1047)
  7125. {
  7126. class9.disabledSprite = aSprite_932;
  7127. return;
  7128. } else
  7129. {
  7130. class9.disabledSprite = aSprite_931;
  7131. return;
  7132. }
  7133. }
  7134. if(j == 325)
  7135. {
  7136. if(aSprite_931 == null)
  7137. {
  7138. aSprite_931 = class9.disabledSprite;
  7139. aSprite_932 = class9.enabledSprite;
  7140. }
  7141. if(aBoolean1047)
  7142. {
  7143. class9.disabledSprite = aSprite_931;
  7144. return;
  7145. } else
  7146. {
  7147. class9.disabledSprite = aSprite_932;
  7148. return;
  7149. }
  7150. }
  7151. if(j == 600)
  7152. {
  7153. class9.disabledMessage = reportAbuseInput;
  7154. if(loopCycle % 20 < 10)
  7155. {
  7156. class9.disabledMessage += "|";
  7157. return;
  7158. } else
  7159. {
  7160. class9.disabledMessage += " ";
  7161. return;
  7162. }
  7163. }
  7164. if(j == 613)
  7165. if(myPrivilege >= 1)
  7166. {
  7167. if(canMute) {
  7168. class9.disabledColor = 0xff0000;
  7169. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <ON>";
  7170. } else {
  7171. class9.disabledColor = 0xffffff;
  7172. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <OFF>";
  7173. }
  7174. } else {
  7175. class9.disabledMessage = "";
  7176. }
  7177. if(j == 650 || j == 655)
  7178. if(anInt1193 != 0)
  7179. {
  7180. String s;
  7181. if(daysSinceLastLogin == 0)
  7182. s = "earlier today";
  7183. else
  7184. if(daysSinceLastLogin == 1)
  7185. s = "yesterday";
  7186. else
  7187. s = daysSinceLastLogin + " days ago";
  7188. class9.disabledMessage = "You last logged in " + s + " from: " + signlink.dns;
  7189. } else
  7190. {
  7191. class9.disabledMessage = "";
  7192. }
  7193. if(j == 651)
  7194. {
  7195. if(unreadMessages == 0)
  7196. {
  7197. class9.disabledMessage = "0 unread messages";
  7198. class9.disabledColor = 0xffff00;
  7199. }
  7200. if(unreadMessages == 1)
  7201. {
  7202. class9.disabledMessage = "1 unread disabledMessage";
  7203. class9.disabledColor = 65280;
  7204. }
  7205. if(unreadMessages > 1)
  7206. {
  7207. class9.disabledMessage = unreadMessages + " unread messages";
  7208. class9.disabledColor = 65280;
  7209. }
  7210. }
  7211. if(j == 652)
  7212. if(daysSinceRecovChange == 201)
  7213. {
  7214. if(membersInt == 1)
  7215. class9.disabledMessage = "@yel@This is a non-members world: @whi@Since you are a member we";
  7216. else
  7217. class9.disabledMessage = "";
  7218. } else
  7219. if(daysSinceRecovChange == 200)
  7220. {
  7221. class9.disabledMessage = "You have not yet set any password recovery questions.";
  7222. } else
  7223. {
  7224. String s1;
  7225. if(daysSinceRecovChange == 0)
  7226. s1 = "Earlier today";
  7227. else
  7228. if(daysSinceRecovChange == 1)
  7229. s1 = "Yesterday";
  7230. else
  7231. s1 = daysSinceRecovChange + " days ago";
  7232. class9.disabledMessage = s1 + " you changed your recovery questions";
  7233. }
  7234. if(j == 653)
  7235. if(daysSinceRecovChange == 201)
  7236. {
  7237. if(membersInt == 1)
  7238. class9.disabledMessage = "@whi@recommend you use a members world instead. You may use";
  7239. else
  7240. class9.disabledMessage = "";
  7241. } else
  7242. if(daysSinceRecovChange == 200)
  7243. class9.disabledMessage = "We strongly recommend you do so now to secure your account.";
  7244. else
  7245. class9.disabledMessage = "If you do not remember making this change then cancel it immediately";
  7246. if(j == 654)
  7247. {
  7248. if(daysSinceRecovChange == 201)
  7249. if(membersInt == 1)
  7250. {
  7251. class9.disabledMessage = "@whi@this world but member benefits are unavailable whilst here.";
  7252. return;
  7253. } else
  7254. {
  7255. class9.disabledMessage = "";
  7256. return;
  7257. }
  7258. if(daysSinceRecovChange == 200)
  7259. {
  7260. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7261. return;
  7262. }
  7263. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7264. }
  7265. }
  7266.  
  7267. private void drawSplitPrivateChat()
  7268. {
  7269. if(splitPrivateChat == 0)
  7270. return;
  7271. RSFont textDrawingArea = aTextDrawingArea_1271;
  7272. int i = 0;
  7273. if(anInt1104 != 0)
  7274. i = 1;
  7275. for(int j = 0; j < 100; j++)
  7276. if(chatMessages[j] != null)
  7277. {
  7278. int k = chatTypes[j];
  7279. String s = chatNames[j];
  7280. byte byte1 = 0;
  7281. if(s != null && s.startsWith("@cr0@")) {
  7282. s = s.substring(5);
  7283. byte1 = 1;
  7284. }
  7285. if(s != null && s.startsWith("@cr1@")) {
  7286. s = s.substring(5);
  7287. byte1 = 2;
  7288. }
  7289. if(s != null && s.startsWith("@cr2@")) {
  7290. s = s.substring(5);
  7291. byte1 = 3;
  7292. }
  7293. if(s != null && s.startsWith("@cr3@")) {
  7294. s = s.substring(5);
  7295. byte1 = 4;
  7296. }
  7297. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  7298. {
  7299. int l = 329 - i * 13;
  7300. int k1 = 4;
  7301. textDrawingArea.method385(0, "From", l, k1);
  7302. textDrawingArea.method385(65535, "From", l - 1, k1);
  7303. k1 += textDrawingArea.getTextWidth("From ");
  7304. if(byte1 == 1) {
  7305. modIcons[0].drawSprite(k1, l - 12);
  7306. k1 += 12;
  7307. }
  7308. if(byte1 == 2) {
  7309. modIcons[1].drawSprite(k1, l - 12);
  7310. k1 += 12;
  7311. }
  7312. if(byte1 == 3) {
  7313. modIcons[2].drawSprite(k1, l - 12);
  7314. k1 += 12;
  7315. }
  7316. if(byte1 == 4) {
  7317. modIcons[3].drawSprite(k1, l - 12);
  7318. k1 += 12;
  7319. }
  7320. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  7321. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  7322. if(++i >= 5)
  7323. return;
  7324. }
  7325. if(k == 5 && privateChatMode < 2)
  7326. {
  7327. int i1 = 329 - i * 13;
  7328. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  7329. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  7330. if(++i >= 5)
  7331. return;
  7332. }
  7333. if(k == 6 && privateChatMode < 2)
  7334. {
  7335. int j1 = 329 - i * 13;
  7336. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  7337. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  7338. if(++i >= 5)
  7339. return;
  7340. }
  7341. }
  7342.  
  7343. }
  7344.  
  7345. public void pushMessage(String s, int i, String s1) {
  7346. if(i == 0 && dialogID != -1) {
  7347. aString844 = s;
  7348. super.clickMode3 = 0;
  7349. }
  7350. if(backDialogID == -1)
  7351. inputTaken = true;
  7352. for(int j = 499; j > 0; j--) {
  7353. chatTypes[j] = chatTypes[j - 1];
  7354. chatNames[j] = chatNames[j - 1];
  7355. chatMessages[j] = chatMessages[j - 1];
  7356. chatRights[j] = chatRights[j - 1];
  7357. }
  7358. chatTypes[0] = i;
  7359. chatNames[0] = s1;
  7360. chatMessages[0] = s;
  7361. chatRights[0] = rights;
  7362. }
  7363.  
  7364. public static void setTab(int id) {
  7365. needDrawTabArea = true;
  7366. tabID = id;
  7367. tabAreaAltered = true;
  7368. }
  7369. public int tabHPos;
  7370. private void processTabClick() {
  7371. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  7372. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  7373. runHover = true;
  7374. } else {
  7375. runHover = false;
  7376. }
  7377. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  7378. prayHover = true;
  7379. } else {
  7380. prayHover = false;
  7381. }
  7382. if(super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 3 && super.mouseY <= 25){
  7383. logHover = true;
  7384. } else {
  7385. logHover = false;
  7386. }
  7387. }
  7388. if(is562 == false){
  7389. if(super.clickMode3 == 1) {
  7390. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  7391. {
  7392. needDrawTabArea = true;
  7393. tabID = 0;
  7394. tabAreaAltered = true;
  7395. }
  7396. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  7397. {
  7398. needDrawTabArea = true;
  7399. tabID = 1;
  7400. tabAreaAltered = true;
  7401. }
  7402. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  7403. {
  7404. needDrawTabArea = true;
  7405. tabID = 2;
  7406. tabAreaAltered = true;
  7407. }
  7408. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  7409. {
  7410. needDrawTabArea = true;
  7411. tabID = 3;
  7412. tabAreaAltered = true;
  7413. }
  7414. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  7415. {
  7416. needDrawTabArea = true;
  7417. tabID = 4;
  7418. tabAreaAltered = true;
  7419. }
  7420. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  7421. {
  7422. needDrawTabArea = true;
  7423. tabID = 5;
  7424. tabAreaAltered = true;
  7425. }
  7426. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  7427. {
  7428. needDrawTabArea = true;
  7429. tabID = 6;
  7430. tabAreaAltered = true;
  7431. }
  7432. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  7433. {
  7434. needDrawTabArea = true;
  7435. tabID = 7;
  7436. tabAreaAltered = true;
  7437. }
  7438. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  7439. {
  7440. needDrawTabArea = true;
  7441. tabID = 8;
  7442. tabAreaAltered = true;
  7443. }
  7444. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  7445. {
  7446. needDrawTabArea = true;
  7447. tabID = 9;
  7448. tabAreaAltered = true;
  7449. }
  7450. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  7451. {
  7452. needDrawTabArea = true;
  7453. tabID = 10;
  7454. tabAreaAltered = true;
  7455. }
  7456. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  7457. {
  7458. needDrawTabArea = true;
  7459. tabID = 11;
  7460. tabAreaAltered = true;
  7461. }
  7462. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  7463. {
  7464. needDrawTabArea = true;
  7465. tabID = 12;
  7466. tabAreaAltered = true;
  7467. }
  7468. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  7469. {
  7470. needDrawTabArea = true;
  7471. tabID = 13;
  7472. tabAreaAltered = true;
  7473. }
  7474. }
  7475. } else {
  7476. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  7477. tabHPos = 0;
  7478. needDrawTabArea = true;
  7479. tabAreaAltered = true;
  7480. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  7481. tabHPos = 1;
  7482. needDrawTabArea = true;
  7483. tabAreaAltered = true;
  7484. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  7485. tabHPos = 2;
  7486. needDrawTabArea = true;
  7487. tabAreaAltered = true;
  7488. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  7489. tabHPos = 3;
  7490. needDrawTabArea = true;
  7491. tabAreaAltered = true;
  7492. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  7493. tabHPos = 4;
  7494. needDrawTabArea = true;
  7495. tabAreaAltered = true;
  7496. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  7497. tabHPos = 5;
  7498. needDrawTabArea = true;
  7499. tabAreaAltered = true;
  7500. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  7501. tabHPos = 6;
  7502. needDrawTabArea = true;
  7503. tabAreaAltered = true;
  7504. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  7505. tabHPos = 7;
  7506. needDrawTabArea = true;
  7507. tabAreaAltered = true;
  7508. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  7509. tabHPos = 15;
  7510. needDrawTabArea = true;
  7511. tabAreaAltered = true;
  7512. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  7513. tabHPos = 8;
  7514. needDrawTabArea = true;
  7515. tabAreaAltered = true;
  7516. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  7517. tabHPos = 9;
  7518. needDrawTabArea = true;
  7519. tabAreaAltered = true;
  7520. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  7521. tabHPos = 10;
  7522. needDrawTabArea = true;
  7523. tabAreaAltered = true;
  7524. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  7525. tabHPos = 11;
  7526. needDrawTabArea = true;
  7527. tabAreaAltered = true;
  7528. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  7529. tabHPos = 12;
  7530. needDrawTabArea = true;
  7531. tabAreaAltered = true;
  7532. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  7533. tabHPos = 13;
  7534. needDrawTabArea = true;
  7535. tabAreaAltered = true;
  7536. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  7537. tabHPos = 14;
  7538. needDrawTabArea = true;
  7539. tabAreaAltered = true;
  7540. } else {
  7541. tabHPos = -1;
  7542. needDrawTabArea = true;
  7543. tabAreaAltered = true;
  7544. }
  7545. if(super.clickMode3 == 1) {
  7546. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  7547. needDrawTabArea = true;
  7548. tabID = 0;
  7549. tabAreaAltered = true;
  7550. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  7551. needDrawTabArea = true;
  7552. tabID = 1;
  7553. tabAreaAltered = true;
  7554. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  7555. needDrawTabArea = true;
  7556. tabID = 2;
  7557. tabAreaAltered = true;
  7558. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  7559. needDrawTabArea = true;
  7560. tabID = 14;
  7561. tabAreaAltered = true;
  7562. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  7563. needDrawTabArea = true;
  7564. tabID = 3;
  7565. tabAreaAltered = true;
  7566. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  7567. needDrawTabArea = true;
  7568. tabID = 4;
  7569. tabAreaAltered = true;
  7570. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  7571. needDrawTabArea = true;
  7572. tabID = 5;
  7573. tabAreaAltered = true;
  7574. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  7575. needDrawTabArea = true;
  7576. tabID = 6;
  7577. tabAreaAltered = true;
  7578. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  7579. needDrawTabArea = true;
  7580. tabID = 16;
  7581. tabAreaAltered = true;
  7582. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  7583. needDrawTabArea = true;
  7584. tabID = 8;
  7585. tabAreaAltered = true;
  7586. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  7587. needDrawTabArea = true;
  7588. tabID = 9;
  7589. tabAreaAltered = true;
  7590. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  7591. needDrawTabArea = true;
  7592. tabID = 7;
  7593. tabAreaAltered = true;
  7594. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  7595. needDrawTabArea = true;
  7596. tabID = 11;
  7597. tabAreaAltered = true;
  7598. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  7599. needDrawTabArea = true;
  7600. tabID = 12;
  7601. tabAreaAltered = true;
  7602. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  7603. needDrawTabArea = true;
  7604. tabID = 13;
  7605. tabAreaAltered = true;
  7606. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  7607. needDrawTabArea = true;
  7608. tabID = 15;
  7609. tabAreaAltered = true;
  7610. }
  7611. /* Logout X */
  7612. else if(super.saveClickX >= 742 && super.saveClickX <= 764 && super.saveClickY >= 1 && super.saveClickY < 24 && tabInterfaceIDs[10] != -1) {
  7613. needDrawTabArea = true;
  7614. tabID = 10;
  7615. tabAreaAltered = true;
  7616. }
  7617.  
  7618. }
  7619. }
  7620.  
  7621. }
  7622.  
  7623. private void resetImageProducers2() {
  7624. if(chatBackImage != null)
  7625. return;
  7626. nullLoader();
  7627. super.fullGameScreen = null;
  7628. aRSImageProducer_1107 = null;
  7629. aRSImageProducer_1108 = null;
  7630. loginScreenArea = null;
  7631. leftSideFlame = null;
  7632. rightSideFlame = null;
  7633. gameLogo = null;
  7634. aRSImageProducer_1113 = null;
  7635. aRSImageProducer_1114 = null;
  7636. aRSImageProducer_1115 = null;
  7637. chatBackImage = new RSImageProducer(516, 165, getGameComponent());//519
  7638. mapBackImage = new RSImageProducer(249, 168, getGameComponent());//
  7639. DrawingArea.setAllPixelsToZero();
  7640. //mapBack.drawBackground(0, 0);
  7641. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7642. inventoryBackImage = new RSImageProducer(250, 335, getGameComponent());
  7643. inGameScreen = new RSImageProducer(512, 334, getGameComponent());
  7644. DrawingArea.setAllPixelsToZero();
  7645. //aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  7646. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  7647. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7648. welcomeScreenRaised = true;
  7649. }
  7650.  
  7651. public String getDocumentBaseHost() {
  7652. if (signlink.mainapp != null) {
  7653. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7654. }
  7655. return null;
  7656. }
  7657.  
  7658. private void method81(Sprite sprite, int j, int k) {
  7659. int l = k * k + j * j;
  7660. if(l > 4225 && l < 0x15f90) {
  7661. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  7662. int j1 = Model.modelIntArray1[i1];
  7663. int k1 = Model.modelIntArray2[i1];
  7664. j1 = (j1 * 256) / (minimapInt3 + 256);
  7665. k1 = (k1 * 256) / (minimapInt3 + 256);
  7666. int l1 = j * j1 + k * k1 >> 16;
  7667. int i2 = j * k1 - k * j1 >> 16;
  7668. double d = Math.atan2(l1, i2);
  7669. int j2 = (int)(Math.sin(d) * 63D);
  7670. int k2 = (int)(Math.cos(d) * 57D);
  7671. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7672. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7673. return;
  7674. } else {
  7675. markMinimap(sprite, k, j, false);
  7676. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7677. }
  7678. }
  7679.  
  7680. public void processRightClick() {
  7681. if (activeInterfaceType != 0) {
  7682. return;
  7683. }
  7684. menuActionName[0] = "Cancel";
  7685. menuActionID[0] = 1107;
  7686. menuActionRow = 1;
  7687. if (fullscreenInterfaceID != -1) {
  7688. anInt886 = 0;
  7689. anInt1315 = 0;
  7690. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  7691. if (anInt886 != anInt1026) {
  7692. anInt1026 = anInt886;
  7693. }
  7694. if (anInt1315 != anInt1129) {
  7695. anInt1129 = anInt1315;
  7696. }
  7697. return;
  7698. }
  7699. buildSplitPrivateChatMenu();
  7700. anInt886 = 0;
  7701. anInt1315 = 0;
  7702. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  7703. if (openInterfaceID != -1) {
  7704. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7705. } else {
  7706. build3dScreenMenu();
  7707. }
  7708. }
  7709. if (anInt886 != anInt1026) {
  7710. anInt1026 = anInt886;
  7711. }
  7712. if (anInt1315 != anInt1129) {
  7713. anInt1129 = anInt1315;
  7714. }
  7715. anInt886 = 0;
  7716. anInt1315 = 0;
  7717. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  7718. if(invOverlayInterfaceID != -1) {
  7719. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  7720. } else if(tabInterfaceIDs[tabID] != -1) {
  7721. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  7722. }
  7723. }
  7724. if (anInt886 != anInt1048) {
  7725. needDrawTabArea = true;
  7726. tabAreaAltered = true;
  7727. anInt1048 = anInt886;
  7728. }
  7729. if (anInt1315 != anInt1044) {
  7730. needDrawTabArea = true;
  7731. tabAreaAltered = true;
  7732. anInt1044 = anInt1315;
  7733. }
  7734. anInt886 = 0;
  7735. anInt1315 = 0;
  7736. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  7737. if(backDialogID != -1) {
  7738. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  7739. } else if(super.mouseY < 463 && super.mouseX < 490) {
  7740. buildChatAreaMenu(super.mouseY - 338);
  7741. }
  7742. }
  7743. if (backDialogID != -1 && anInt886 != anInt1039) {
  7744. inputTaken = true;
  7745. anInt1039 = anInt886;
  7746. }
  7747. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7748. inputTaken = true;
  7749. anInt1500 = anInt1315;
  7750. }
  7751. /** Custom menu drawing */
  7752. rightClickChatButtons();
  7753. alertHandler.processMouse(super.mouseX, super.mouseY); determineTopTabs();
  7754. determineBottomTabs();
  7755.  
  7756. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  7757. processMinimapActions();
  7758. }
  7759.  
  7760. boolean flag = false;
  7761. while (!flag) {
  7762. flag = true;
  7763. for (int j = 0; j < menuActionRow - 1; j++) {
  7764. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7765. String s = menuActionName[j];
  7766. menuActionName[j] = menuActionName[j + 1];
  7767. menuActionName[j + 1] = s;
  7768. int k = menuActionID[j];
  7769. menuActionID[j] = menuActionID[j + 1];
  7770. menuActionID[j + 1] = k;
  7771. k = menuActionCmd2[j];
  7772. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7773. menuActionCmd2[j + 1] = k;
  7774. k = menuActionCmd3[j];
  7775. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7776. menuActionCmd3[j + 1] = k;
  7777. k = menuActionCmd1[j];
  7778. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7779. menuActionCmd1[j + 1] = k;
  7780. flag = false;
  7781. }
  7782. }
  7783. }
  7784. }
  7785.  
  7786. private int method83(int i, int j, int k)
  7787. {
  7788. int l = 256 - k;
  7789. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7790. }
  7791.  
  7792. private void login(String s, String s1, boolean flag)
  7793. {
  7794. signlink.errorname = s;
  7795. try
  7796. {
  7797. if(!flag)
  7798. {
  7799. loginMessage1 = "";
  7800. loginMessage2 = "Connecting to server...";
  7801. drawLoginScreen(true);
  7802. }
  7803. socketStream = new RSSocket(this, openSocket(43594));
  7804. long l = TextClass.longForName(s);
  7805. int i = (int)(l >> 16 & 31L);
  7806. stream.currentOffset = 0;
  7807. stream.writeWordBigEndian(14);
  7808. stream.writeWordBigEndian(i);
  7809. socketStream.queueBytes(2, stream.buffer);
  7810. for(int j = 0; j < 8; j++)
  7811. socketStream.read();
  7812.  
  7813. int k = socketStream.read();
  7814. int i1 = k;
  7815. if(k == 0)
  7816. {
  7817. socketStream.flushInputStream(inStream.buffer, 8);
  7818. inStream.currentOffset = 0;
  7819. aLong1215 = inStream.readQWord();
  7820. int ai[] = new int[4];
  7821. ai[0] = (int)(Math.random() * 99999999D);
  7822. ai[1] = (int)(Math.random() * 99999999D);
  7823. ai[2] = (int)(aLong1215 >> 32);
  7824. ai[3] = (int)aLong1215;
  7825. stream.currentOffset = 0;
  7826. stream.writeWordBigEndian(10);
  7827. stream.writeDWord(ai[0]);
  7828. stream.writeDWord(ai[1]);
  7829. stream.writeDWord(ai[2]);
  7830. stream.writeDWord(ai[3]);
  7831. stream.writeDWord(123456);
  7832. stream.writeString(s);
  7833. stream.writeString(s1);
  7834. stream.doKeys();
  7835. aStream_847.currentOffset = 0;
  7836. if(flag)
  7837. aStream_847.writeWordBigEndian(18);
  7838. else
  7839. aStream_847.writeWordBigEndian(16);
  7840. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7841. aStream_847.writeWordBigEndian(255);
  7842. aStream_847.writeWord(317);
  7843. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7844. for(int l1 = 0; l1 < 9; l1++)
  7845. aStream_847.writeDWord(expectedCRCs[l1]);
  7846.  
  7847. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7848. stream.encryption = new ISAACRandomGen(ai);
  7849. for(int j2 = 0; j2 < 4; j2++)
  7850. ai[j2] += 50;
  7851.  
  7852. encryption = new ISAACRandomGen(ai);
  7853. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7854. k = socketStream.read();
  7855. }
  7856. if(k == 1)
  7857. {
  7858. try
  7859. {
  7860. Thread.sleep(2000L);
  7861. }
  7862. catch(Exception _ex) { }
  7863. login(s, s1, flag);
  7864. return;
  7865. }
  7866. if(k == 2)
  7867. {
  7868. myPrivilege = socketStream.read();
  7869. flagged = socketStream.read() == 1;
  7870. aLong1220 = 0L;
  7871. anInt1022 = 0;
  7872. mouseDetection.coordsIndex = 0;
  7873. super.awtFocus = true;
  7874. aBoolean954 = true;
  7875. loggedIn = true;
  7876. stream.currentOffset = 0;
  7877. inStream.currentOffset = 0;
  7878. pktType = -1;
  7879. anInt841 = -1;
  7880. anInt842 = -1;
  7881. anInt843 = -1;
  7882. pktSize = 0;
  7883. anInt1009 = 0;
  7884. anInt1104 = 0;
  7885. anInt1011 = 0;
  7886. anInt855 = 0;
  7887. menuActionRow = 0;
  7888. menuOpen = false;
  7889. super.idleTime = 0;
  7890. for(int j1 = 0; j1 < 100; j1++)
  7891. chatMessages[j1] = null;
  7892.  
  7893. itemSelected = 0;
  7894. spellSelected = 0;
  7895. loadingStage = 0;
  7896. anInt1062 = 0;
  7897. anInt1278 = (int)(Math.random() * 100D) - 50;
  7898. anInt1131 = (int)(Math.random() * 110D) - 55;
  7899. anInt896 = (int)(Math.random() * 80D) - 40;
  7900. minimapInt2 = (int)(Math.random() * 120D) - 60;
  7901. minimapInt3 = (int)(Math.random() * 30D) - 20;
  7902. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  7903. anInt1021 = 0;
  7904. anInt985 = -1;
  7905. destX = 0;
  7906. destY = 0;
  7907. playerCount = 0;
  7908. npcCount = 0;
  7909. for(int i2 = 0; i2 < maxPlayers; i2++)
  7910. {
  7911. playerArray[i2] = null;
  7912. aStreamArray895s[i2] = null;
  7913. }
  7914.  
  7915. for(int k2 = 0; k2 < 16384; k2++)
  7916. npcArray[k2] = null;
  7917.  
  7918. myPlayer = playerArray[myPlayerIndex] = new Player();
  7919. aClass19_1013.removeAll();
  7920. aClass19_1056.removeAll();
  7921. for(int l2 = 0; l2 < 4; l2++)
  7922. {
  7923. for(int i3 = 0; i3 < 104; i3++)
  7924. {
  7925. for(int k3 = 0; k3 < 104; k3++)
  7926. groundArray[l2][i3][k3] = null;
  7927.  
  7928. }
  7929.  
  7930. }
  7931. aClass19_1179 = new NodeList();
  7932. fullscreenInterfaceID = -1;
  7933. anInt900 = 0;
  7934. friendsCount = 0;
  7935. dialogID = -1;
  7936. backDialogID = -1;
  7937. openInterfaceID = -1;
  7938. invOverlayInterfaceID = -1;
  7939. anInt1018 = -1;
  7940. aBoolean1149 = false;
  7941. tabID = 3;
  7942. inputDialogState = 0;
  7943. menuOpen = false;
  7944. messagePromptRaised = false;
  7945. aString844 = null;
  7946. anInt1055 = 0;
  7947. anInt1054 = -1;
  7948. aBoolean1047 = true;
  7949. method45();
  7950. welcome();
  7951. for(int j3 = 0; j3 < 5; j3++)
  7952. anIntArray990[j3] = 0;
  7953.  
  7954. for(int l3 = 0; l3 < 5; l3++)
  7955. {
  7956. atPlayerActions[l3] = null;
  7957. atPlayerArray[l3] = false;
  7958. }
  7959.  
  7960. anInt1175 = 0;
  7961. anInt1134 = 0;
  7962. anInt986 = 0;
  7963. anInt1288 = 0;
  7964. anInt924 = 0;
  7965. anInt1188 = 0;
  7966. anInt1155 = 0;
  7967. anInt1226 = 0;
  7968. int anInt941 = 0;
  7969. int anInt1260 = 0;
  7970. resetImageProducers2();
  7971. return;
  7972. }
  7973. if(k == 3)
  7974. {
  7975. loginMessage1 = "";
  7976. loginMessage2 = "Invalid username or password.";
  7977. return;
  7978. }
  7979. if(k == 4)
  7980. {
  7981. loginMessage1 = "Your account has been disabled.";
  7982. loginMessage2 = "Please check your disabledMessage-center for details.";
  7983. return;
  7984. }
  7985. if(k == 5)
  7986. {
  7987. loginMessage1 = "Your account is already logged in.";
  7988. loginMessage2 = "Try again in 60 secs...";
  7989. return;
  7990. }
  7991. if(k == 6)
  7992. {
  7993. loginMessage1 = "ErasedPkz has been updated!";
  7994. loginMessage2 = "Please reload this page.";
  7995. return;
  7996. }
  7997. if(k == 7)
  7998. {
  7999. loginMessage1 = "This world is full.";
  8000. loginMessage2 = "Please use a different world.";
  8001. return;
  8002. }
  8003. if(k == 8)
  8004. {
  8005. loginMessage1 = "Unable to connect.";
  8006. loginMessage2 = "Login server offline.";
  8007. return;
  8008. }
  8009. if(k == 9)
  8010. {
  8011. loginMessage1 = "Login limit exceeded.";
  8012. loginMessage2 = "Too many connections from your address.";
  8013. return;
  8014. }
  8015. if(k == 10)
  8016. {
  8017. loginMessage1 = "Unable to connect.";
  8018. loginMessage2 = "Bad session id.";
  8019. return;
  8020. }
  8021. if(k == 11)
  8022. {
  8023. loginMessage2 = "Login server rejected session.";
  8024. loginMessage2 = "Please try again.";
  8025. return;
  8026. }
  8027. if(k == 12)
  8028. {
  8029. loginMessage1 = "You need a members account to login to this world.";
  8030. loginMessage2 = "Please subscribe, or use a different world.";
  8031. return;
  8032. }
  8033. if(k == 13)
  8034. {
  8035. loginMessage1 = "Could not complete login.";
  8036. loginMessage2 = "Please try using a different world.";
  8037. return;
  8038. }
  8039. if(k == 14)
  8040. {
  8041. loginMessage1 = "The server is being updated.";
  8042. loginMessage2 = "Please wait 1 minute and try again.";
  8043. return;
  8044. }
  8045. if(k == 15)
  8046. {
  8047. loggedIn = true;
  8048. stream.currentOffset = 0;
  8049. inStream.currentOffset = 0;
  8050. pktType = -1;
  8051. anInt841 = -1;
  8052. anInt842 = -1;
  8053. anInt843 = -1;
  8054. pktSize = 0;
  8055. anInt1009 = 0;
  8056. anInt1104 = 0;
  8057. menuActionRow = 0;
  8058. menuOpen = false;
  8059. aLong824 = System.currentTimeMillis();
  8060. return;
  8061. }
  8062. if(k == 16)
  8063. {
  8064. loginMessage1 = "Login attempts exceeded.";
  8065. loginMessage2 = "Please wait 1 minute and try again.";
  8066. return;
  8067. }
  8068. if(k == 17)
  8069. {
  8070. loginMessage1 = "You are standing in a members-only area.";
  8071. loginMessage2 = "To play on this world move to a free area first";
  8072. return;
  8073. }
  8074. if(k == 20)
  8075. {
  8076. loginMessage1 = "Invalid loginserver requested";
  8077. loginMessage2 = "Please try using a different world.";
  8078. return;
  8079. }
  8080. if(k == 21)
  8081. {
  8082. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  8083. {
  8084. loginMessage1 = "You have only just left another world";
  8085. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  8086. drawLoginScreen(true);
  8087. try
  8088. {
  8089. Thread.sleep(1000L);
  8090. }
  8091. catch(Exception _ex) { }
  8092. }
  8093.  
  8094. login(s, s1, flag);
  8095. return;
  8096. }
  8097. if(k == -1)
  8098. {
  8099. if(i1 == 0)
  8100. {
  8101. if(loginFailures < 2)
  8102. {
  8103. try
  8104. {
  8105. Thread.sleep(2000L);
  8106. }
  8107. catch(Exception _ex) { }
  8108. loginFailures++;
  8109. login(s, s1, flag);
  8110. return;
  8111. } else
  8112. {
  8113. loginMessage1 = "You must download The latest";
  8114. loginMessage2 = "client at www.erased-pkz.comyr.com";
  8115. return;
  8116. }
  8117. } else
  8118. {
  8119. loginMessage1 = "No response from server";
  8120. loginMessage2 = "Please try using a different world.";
  8121. return;
  8122. }
  8123. } else
  8124. {
  8125. System.out.println("response:" + k);
  8126. loginMessage1 = "Unexpected server response";
  8127. loginMessage2 = "Please try using a different world.";
  8128. return;
  8129. }
  8130. }
  8131. catch(IOException _ex)
  8132. {
  8133. loginMessage1 = "";
  8134. }
  8135. loginMessage2 = "Error connecting to server.";
  8136. }
  8137.  
  8138. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag, int k2) {
  8139. byte byte0 = 104;
  8140. byte byte1 = 104;
  8141. for(int l2 = 0; l2 < byte0; l2++) {
  8142. for(int i3 = 0; i3 < byte1; i3++) {
  8143. anIntArrayArray901[l2][i3] = 0;
  8144. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  8145. }
  8146. }
  8147. int j3 = j2;
  8148. int k3 = j1;
  8149. anIntArrayArray901[j2][j1] = 99;
  8150. anIntArrayArray825[j2][j1] = 0;
  8151. int l3 = 0;
  8152. int i4 = 0;
  8153. bigX[l3] = j2;
  8154. bigY[l3++] = j1;
  8155. boolean flag1 = false;
  8156. int j4 = bigX.length;
  8157. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  8158. while(i4 != l3)
  8159. {
  8160. j3 = bigX[i4];
  8161. k3 = bigY[i4];
  8162. i4 = (i4 + 1) % j4;
  8163. if(j3 == k2 && k3 == i2)
  8164. {
  8165. flag1 = true;
  8166. break;
  8167. }
  8168. if(i1 != 0)
  8169. {
  8170. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  8171. {
  8172. flag1 = true;
  8173. break;
  8174. }
  8175. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  8176. {
  8177. flag1 = true;
  8178. break;
  8179. }
  8180. }
  8181. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  8182. {
  8183. flag1 = true;
  8184. break;
  8185. }
  8186. int l4 = anIntArrayArray825[j3][k3] + 1;
  8187. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  8188. {
  8189. bigX[l3] = j3 - 1;
  8190. bigY[l3] = k3;
  8191. l3 = (l3 + 1) % j4;
  8192. anIntArrayArray901[j3 - 1][k3] = 2;
  8193. anIntArrayArray825[j3 - 1][k3] = l4;
  8194. }
  8195. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  8196. {
  8197. bigX[l3] = j3 + 1;
  8198. bigY[l3] = k3;
  8199. l3 = (l3 + 1) % j4;
  8200. anIntArrayArray901[j3 + 1][k3] = 8;
  8201. anIntArrayArray825[j3 + 1][k3] = l4;
  8202. }
  8203. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  8204. {
  8205. bigX[l3] = j3;
  8206. bigY[l3] = k3 - 1;
  8207. l3 = (l3 + 1) % j4;
  8208. anIntArrayArray901[j3][k3 - 1] = 1;
  8209. anIntArrayArray825[j3][k3 - 1] = l4;
  8210. }
  8211. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  8212. {
  8213. bigX[l3] = j3;
  8214. bigY[l3] = k3 + 1;
  8215. l3 = (l3 + 1) % j4;
  8216. anIntArrayArray901[j3][k3 + 1] = 4;
  8217. anIntArrayArray825[j3][k3 + 1] = l4;
  8218. }
  8219. if(j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0 && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  8220. {
  8221. bigX[l3] = j3 - 1;
  8222. bigY[l3] = k3 - 1;
  8223. l3 = (l3 + 1) % j4;
  8224. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  8225. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  8226. }
  8227. if(j3 < byte0 - 1 && k3 > 0 && anIntArrayArray901[j3 + 1][k3 - 1] == 0 && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  8228. {
  8229. bigX[l3] = j3 + 1;
  8230. bigY[l3] = k3 - 1;
  8231. l3 = (l3 + 1) % j4;
  8232. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  8233. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  8234. }
  8235. if(j3 > 0 && k3 < byte1 - 1 && anIntArrayArray901[j3 - 1][k3 + 1] == 0 && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  8236. {
  8237. bigX[l3] = j3 - 1;
  8238. bigY[l3] = k3 + 1;
  8239. l3 = (l3 + 1) % j4;
  8240. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  8241. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  8242. }
  8243. if(j3 < byte0 - 1 && k3 < byte1 - 1 && anIntArrayArray901[j3 + 1][k3 + 1] == 0 && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  8244. {
  8245. bigX[l3] = j3 + 1;
  8246. bigY[l3] = k3 + 1;
  8247. l3 = (l3 + 1) % j4;
  8248. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  8249. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  8250. }
  8251. }
  8252. anInt1264 = 0;
  8253. if(!flag1)
  8254. {
  8255. if(flag)
  8256. {
  8257. int i5 = 100;
  8258. for(int k5 = 1; k5 < 2; k5++)
  8259. {
  8260. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  8261. {
  8262. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  8263. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  8264. {
  8265. i5 = anIntArrayArray825[i6][l6];
  8266. j3 = i6;
  8267. k3 = l6;
  8268. anInt1264 = 1;
  8269. flag1 = true;
  8270. }
  8271.  
  8272. }
  8273.  
  8274. if(flag1)
  8275. break;
  8276. }
  8277.  
  8278. }
  8279. if(!flag1)
  8280. return false;
  8281. }
  8282. i4 = 0;
  8283. bigX[i4] = j3;
  8284. bigY[i4++] = k3;
  8285. int l5;
  8286. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  8287. {
  8288. if(j5 != l5)
  8289. {
  8290. l5 = j5;
  8291. bigX[i4] = j3;
  8292. bigY[i4++] = k3;
  8293. }
  8294. if((j5 & 2) != 0)
  8295. j3++;
  8296. else
  8297. if((j5 & 8) != 0)
  8298. j3--;
  8299. if((j5 & 1) != 0)
  8300. k3++;
  8301. else
  8302. if((j5 & 4) != 0)
  8303. k3--;
  8304. }
  8305. // if(cancelWalk) { return i4 > 0; }
  8306.  
  8307.  
  8308. if(i4 > 0)
  8309. {
  8310. int k4 = i4;
  8311. if(k4 > 25)
  8312. k4 = 25;
  8313. i4--;
  8314. int k6 = bigX[i4];
  8315. int i7 = bigY[i4];
  8316. anInt1288 += k4;
  8317. if(anInt1288 >= 92)
  8318. {
  8319. stream.createFrame(36);
  8320. stream.writeDWord(0);
  8321. anInt1288 = 0;
  8322. }
  8323. if(i == 0)
  8324. {
  8325. stream.createFrame(164);
  8326. stream.writeWordBigEndian(k4 + k4 + 3);
  8327. }
  8328. if(i == 1)
  8329. {
  8330. stream.createFrame(248);
  8331. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8332. }
  8333. if(i == 2)
  8334. {
  8335. stream.createFrame(98);
  8336. stream.writeWordBigEndian(k4 + k4 + 3);
  8337. }
  8338. stream.method433(k6 + baseX);
  8339. destX = bigX[0];
  8340. destY = bigY[0];
  8341. for(int j7 = 1; j7 < k4; j7++)
  8342. {
  8343. i4--;
  8344. stream.writeWordBigEndian(bigX[i4] - k6);
  8345. stream.writeWordBigEndian(bigY[i4] - i7);
  8346. }
  8347.  
  8348. stream.method431(i7 + baseY);
  8349. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8350. return true;
  8351. }
  8352. return i != 1;
  8353. }
  8354.  
  8355. private void method86(Stream stream)
  8356. {
  8357. for(int j = 0; j < anInt893; j++)
  8358. {
  8359. int k = anIntArray894[j];
  8360. NPC npc = npcArray[k];
  8361. int l = stream.readUnsignedByte();
  8362. if((l & 0x10) != 0)
  8363. {
  8364. int i1 = stream.method434();
  8365. if(i1 == 65535)
  8366. i1 = -1;
  8367. int i2 = stream.readUnsignedByte();
  8368. if(i1 == npc.anim && i1 != -1)
  8369. {
  8370. int l2 = Animation.anims[i1].anInt365;
  8371. if(l2 == 1)
  8372. {
  8373. npc.anInt1527 = 0;
  8374. npc.anInt1528 = 0;
  8375. npc.anInt1529 = i2;
  8376. npc.anInt1530 = 0;
  8377. }
  8378. if(l2 == 2)
  8379. npc.anInt1530 = 0;
  8380. } else
  8381. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  8382. {
  8383. npc.anim = i1;
  8384. npc.anInt1527 = 0;
  8385. npc.anInt1528 = 0;
  8386. npc.anInt1529 = i2;
  8387. npc.anInt1530 = 0;
  8388. npc.anInt1542 = npc.smallXYIndex;
  8389. }
  8390. }
  8391. if((l & 8) != 0)
  8392. {
  8393. int j1 = stream.method426();
  8394. int j2 = stream.method427();
  8395. npc.updateHitData(j2, j1, loopCycle);
  8396. npc.loopCycleStatus = loopCycle + 300;
  8397. npc.currentHealth = stream.method426();
  8398. npc.maxHealth = stream.readUnsignedByte();
  8399. }
  8400. if((l & 0x80) != 0)
  8401. {
  8402. npc.anInt1520 = stream.readUnsignedWord();
  8403. int k1 = stream.readDWord();
  8404. npc.anInt1524 = k1 >> 16;
  8405. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8406. npc.anInt1521 = 0;
  8407. npc.anInt1522 = 0;
  8408. if(npc.anInt1523 > loopCycle)
  8409. npc.anInt1521 = -1;
  8410. if(npc.anInt1520 == 65535)
  8411. npc.anInt1520 = -1;
  8412. }
  8413. if((l & 0x20) != 0)
  8414. {
  8415. npc.interactingEntity = stream.readUnsignedWord();
  8416. if(npc.interactingEntity == 65535)
  8417. npc.interactingEntity = -1;
  8418. }
  8419. if((l & 1) != 0)
  8420. {
  8421. npc.textSpoken = stream.readString();
  8422. npc.textCycle = 100;
  8423. // entityMessage(npc);
  8424.  
  8425. }
  8426. if((l & 0x40) != 0)
  8427. {
  8428. int l1 = stream.method427();
  8429. int k2 = stream.method428();
  8430. npc.updateHitData(k2, l1, loopCycle);
  8431. npc.loopCycleStatus = loopCycle + 300;
  8432. npc.currentHealth = stream.method428();
  8433. npc.maxHealth = stream.method427();
  8434. }
  8435. if((l & 2) != 0)
  8436. {
  8437. npc.desc = EntityDef.forID(stream.method436());
  8438. npc.anInt1540 = npc.desc.aByte68;
  8439. npc.anInt1504 = npc.desc.anInt79;
  8440. npc.anInt1554 = npc.desc.anInt67;
  8441. npc.anInt1555 = npc.desc.anInt58;
  8442. npc.anInt1556 = npc.desc.anInt83;
  8443. npc.anInt1557 = npc.desc.anInt55;
  8444. npc.anInt1511 = npc.desc.anInt77;
  8445. }
  8446. if((l & 4) != 0)
  8447. {
  8448. npc.anInt1538 = stream.method434();
  8449. npc.anInt1539 = stream.method434();
  8450. }
  8451. }
  8452. }
  8453.  
  8454. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  8455. {
  8456. if(menuActionRow >= 400)
  8457. return;
  8458. if(entityDef.childrenIDs != null)
  8459. entityDef = entityDef.method161();
  8460. if(entityDef == null)
  8461. return;
  8462. if(!entityDef.aBoolean84)
  8463. return;
  8464. String s = entityDef.name;
  8465. if(entityDef.combatLevel != 0)
  8466. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  8467. if(itemSelected == 1)
  8468. {
  8469. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  8470. menuActionID[menuActionRow] = 582;
  8471. menuActionCmd1[menuActionRow] = i;
  8472. menuActionCmd2[menuActionRow] = k;
  8473. menuActionCmd3[menuActionRow] = j;
  8474. menuActionRow++;
  8475. return;
  8476. }
  8477. if(spellSelected == 1)
  8478. {
  8479. if((spellUsableOn & 2) == 2)
  8480. {
  8481. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8482. menuActionID[menuActionRow] = 413;
  8483. menuActionCmd1[menuActionRow] = i;
  8484. menuActionCmd2[menuActionRow] = k;
  8485. menuActionCmd3[menuActionRow] = j;
  8486. menuActionRow++;
  8487. }
  8488. } else
  8489. {
  8490. if(entityDef.itemActions != null)
  8491. {
  8492. for(int l = 4; l >= 0; l--)
  8493. if(entityDef.itemActions[l] != null && !entityDef.itemActions[l].equalsIgnoreCase("attack"))
  8494. {
  8495. menuActionName[menuActionRow] = entityDef.itemActions[l] + " @yel@" + s;
  8496. if(l == 0)
  8497. menuActionID[menuActionRow] = 20;
  8498. if(l == 1)
  8499. menuActionID[menuActionRow] = 412;
  8500. if(l == 2)
  8501. menuActionID[menuActionRow] = 225;
  8502. if(l == 3)
  8503. menuActionID[menuActionRow] = 965;
  8504. if(l == 4)
  8505. menuActionID[menuActionRow] = 478;
  8506. menuActionCmd1[menuActionRow] = i;
  8507. menuActionCmd2[menuActionRow] = k;
  8508. menuActionCmd3[menuActionRow] = j;
  8509. menuActionRow++;
  8510. }
  8511.  
  8512. }
  8513. if(entityDef.itemActions != null)
  8514. {
  8515. for(int i1 = 4; i1 >= 0; i1--)
  8516. if(entityDef.itemActions[i1] != null && entityDef.itemActions[i1].equalsIgnoreCase("attack"))
  8517. {
  8518. char c = '\0';
  8519. if(entityDef.combatLevel > myPlayer.combatLevel)
  8520. c = '\u07D0';
  8521. menuActionName[menuActionRow] = entityDef.itemActions[i1] + " @yel@" + s;
  8522. if(i1 == 0)
  8523. menuActionID[menuActionRow] = 20 + c;
  8524. if(i1 == 1)
  8525. menuActionID[menuActionRow] = 412 + c;
  8526. if(i1 == 2)
  8527. menuActionID[menuActionRow] = 225 + c;
  8528. if(i1 == 3)
  8529. menuActionID[menuActionRow] = 965 + c;
  8530. if(i1 == 4)
  8531. menuActionID[menuActionRow] = 478 + c;
  8532. menuActionCmd1[menuActionRow] = i;
  8533. menuActionCmd2[menuActionRow] = k;
  8534. menuActionCmd3[menuActionRow] = j;
  8535. menuActionRow++;
  8536. }
  8537.  
  8538. }
  8539. if(idToggle == true) {
  8540. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.interfaceType + "@gre@)";
  8541. } else {
  8542. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8543. }
  8544. menuActionID[menuActionRow] = 1025;
  8545. menuActionCmd1[menuActionRow] = i;
  8546. menuActionCmd2[menuActionRow] = k;
  8547. menuActionCmd3[menuActionRow] = j;
  8548. menuActionRow++;
  8549. }
  8550. }
  8551.  
  8552. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  8553. {
  8554. if(player == myPlayer)
  8555. return;
  8556. if(menuActionRow >= 400)
  8557. return;
  8558. String s;
  8559. if(player.skill == 0)
  8560. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  8561. else
  8562. s = player.name + " (skill-" + player.skill + ")";
  8563. if(itemSelected == 1)
  8564. {
  8565. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @whi@" + s;
  8566. menuActionID[menuActionRow] = 491;
  8567. menuActionCmd1[menuActionRow] = j;
  8568. menuActionCmd2[menuActionRow] = i;
  8569. menuActionCmd3[menuActionRow] = k;
  8570. menuActionRow++;
  8571. } else
  8572. if(spellSelected == 1)
  8573. {
  8574. if((spellUsableOn & 8) == 8)
  8575. {
  8576. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8577. menuActionID[menuActionRow] = 365;
  8578. menuActionCmd1[menuActionRow] = j;
  8579. menuActionCmd2[menuActionRow] = i;
  8580. menuActionCmd3[menuActionRow] = k;
  8581. menuActionRow++;
  8582. }
  8583. } else
  8584. {
  8585. for(int l = 4; l >= 0; l--)
  8586. if(atPlayerActions[l] != null)
  8587. {
  8588. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  8589. char c = '\0';
  8590. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  8591. {
  8592. if(player.combatLevel > myPlayer.combatLevel)
  8593. c = '\u07D0';
  8594. if(myPlayer.team != 0 && player.team != 0)
  8595. if(myPlayer.team == player.team)
  8596. c = '\u07D0';
  8597. else
  8598. c = '\0';
  8599. } else
  8600. if(atPlayerArray[l])
  8601. c = '\u07D0';
  8602. if(l == 0)
  8603. menuActionID[menuActionRow] = 561 + c;
  8604. if(l == 1)
  8605. menuActionID[menuActionRow] = 779 + c;
  8606. if(l == 2)
  8607. menuActionID[menuActionRow] = 27 + c;
  8608. if(l == 3)
  8609. menuActionID[menuActionRow] = 577 + c;
  8610. if(l == 4)
  8611. menuActionID[menuActionRow] = 729 + c;
  8612. menuActionCmd1[menuActionRow] = j;
  8613. menuActionCmd2[menuActionRow] = i;
  8614. menuActionCmd3[menuActionRow] = k;
  8615. menuActionRow++;
  8616. }
  8617.  
  8618. }
  8619. for(int i1 = 0; i1 < menuActionRow; i1++)
  8620. if(menuActionID[i1] == 516)
  8621. {
  8622. menuActionName[i1] = "Walk here @whi@" + s;
  8623. return;
  8624. }
  8625.  
  8626. }
  8627.  
  8628. private void method89(Class30_Sub1 class30_sub1)
  8629. {
  8630. int i = 0;
  8631. int j = -1;
  8632. int k = 0;
  8633. int l = 0;
  8634. if(class30_sub1.anInt1296 == 0)
  8635. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8636. if(class30_sub1.anInt1296 == 1)
  8637. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8638. if(class30_sub1.anInt1296 == 2)
  8639. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8640. if(class30_sub1.anInt1296 == 3)
  8641. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8642. if(i != 0)
  8643. {
  8644. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8645. j = i >> 14 & 0x7fff;
  8646. k = i1 & 0x1f;
  8647. l = i1 >> 6;
  8648. }
  8649. class30_sub1.anInt1299 = j;
  8650. class30_sub1.anInt1301 = k;
  8651. class30_sub1.anInt1300 = l;
  8652. }
  8653.  
  8654. private void method90()
  8655. {
  8656. for(int i = 0; i < anInt1062; i++)
  8657. if(anIntArray1250[i] <= 0)
  8658. {
  8659. boolean flag1 = false;
  8660. try
  8661. {
  8662. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  8663. {
  8664. if(!replayWave())
  8665. flag1 = true;
  8666. } else
  8667. {
  8668. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  8669. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  8670. {
  8671. anInt1257 = stream.currentOffset;
  8672. aLong1172 = System.currentTimeMillis();
  8673. if(saveWave(stream.buffer, stream.currentOffset))
  8674. {
  8675. anInt874 = anIntArray1207[i];
  8676. anInt1289 = anIntArray1241[i];
  8677. } else
  8678. {
  8679. flag1 = true;
  8680. }
  8681. }
  8682. }
  8683. }
  8684. catch(Exception exception) { }
  8685. if(!flag1 || anIntArray1250[i] == -5)
  8686. {
  8687. anInt1062--;
  8688. for(int j = i; j < anInt1062; j++)
  8689. {
  8690. anIntArray1207[j] = anIntArray1207[j + 1];
  8691. anIntArray1241[j] = anIntArray1241[j + 1];
  8692. anIntArray1250[j] = anIntArray1250[j + 1];
  8693. }
  8694.  
  8695. i--;
  8696. } else
  8697. {
  8698. anIntArray1250[i] = -5;
  8699. }
  8700. } else
  8701. {
  8702. anIntArray1250[i]--;
  8703. }
  8704.  
  8705. if(prevSong > 0)
  8706. {
  8707. prevSong -= 20;
  8708. if(prevSong < 0)
  8709. prevSong = 0;
  8710. if(prevSong == 0 && musicEnabled && !lowMem)
  8711. {
  8712. nextSong = currentSong;
  8713. songChanging = true;
  8714. onDemandFetcher.method558(2, nextSong);
  8715. }
  8716. }
  8717. }
  8718.  
  8719. /* public static void compress(int ID) {
  8720. try {
  8721. String inF = "C:/ErasedPkzCache1.zip/gzip/"+ ID +".dat";
  8722. String outF = "C:/ErasedPkzCache1.zip/gzip/"+ ID;
  8723. File inF2 = new File(inF);
  8724. File outF2 = new File(outF);
  8725. System.out.println("GZipping: " + inF2 + " file");
  8726. FileOutputStream FOS = new FileOutputStream(outF2 + ".gz");
  8727. GZIPOutputStream GZOS = new GZIPOutputStream(FOS);
  8728. FileInputStream FIN = new FileInputStream(inF2);
  8729. BufferedInputStream IN = new BufferedInputStream(FIN);
  8730. byte[] buffer = new byte[1024];
  8731. int i;
  8732. while ((i = IN.read(buffer)) >= 0) {
  8733. GZOS.write(buffer, 0, i);
  8734. }
  8735. System.out.println("File has been GZipped succesfully");
  8736. IN.close();
  8737. GZOS.close();
  8738. }
  8739. catch(IOException e) {
  8740. System.out.println("Error: " + e);
  8741. }
  8742. compress(ID + 1);
  8743. }
  8744. void main() {
  8745. compress(29);
  8746. }*/
  8747.  
  8748.  
  8749. void startUp()
  8750. {
  8751. //main();
  8752. //models();
  8753. drawLoadingText(20, "Starting up");
  8754. new CacheDownloader(this).downloadCache();
  8755. setNewMaps();
  8756. if(signlink.sunjava)
  8757. super.minDelay = 5;
  8758. aBoolean993 = true;
  8759. String s = getDocumentBaseHost();
  8760. if(signlink.cache_dat != null) {
  8761. for(int i = 0; i < 5; i++)
  8762. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  8763. }
  8764. try {
  8765. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  8766. smallText = new RSFont(false, "p11_full", titleStreamLoader);
  8767. aTextDrawingArea_1271 = new RSFont(false, "p12_full", titleStreamLoader);
  8768. chatTextDrawingArea = new RSFont(false, "b12_full", titleStreamLoader);
  8769. RSFont aTextDrawingArea_1273 = new RSFont(true, "q8_full", titleStreamLoader);
  8770.  
  8771. newSmallFont = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8772. newRegularFont = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8773. newBoldFont = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8774. newFancyFont = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8775. //UserInterface.fonts = newFonts;
  8776. newSmallFont.unpackChatImages(chatImages);
  8777. newRegularFont.unpackChatImages(chatImages);
  8778. newBoldFont.unpackChatImages(chatImages);
  8779. newFancyFont.unpackChatImages(chatImages);
  8780.  
  8781. drawLogo();
  8782. loadTitleScreen();
  8783. NamedArchive archive = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8784. NamedArchive streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8785. NamedArchive mediaArchive = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8786. NamedArchive streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8787. NamedArchive streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8788. NamedArchive streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8789. byteGroundArray = new byte[4][104][104];
  8790. intGroundArray = new int[4][105][105];
  8791. worldController = new WorldController(intGroundArray);
  8792. for(int j = 0; j < 4; j++)
  8793. aClass11Array1230[j] = new Class11();
  8794. aSprite_1263 = new Sprite(512, 512);
  8795. NamedArchive streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  8796. drawLoadingText(60, "Unpacking Models");
  8797. System.out.println("This could take a minute just sit back and relax.");
  8798. onDemandFetcher = new OnDemandFetcher();
  8799. onDemandFetcher.start(streamLoader_6, this);
  8800. Class36.method528(onDemandFetcher.getAnimCount());
  8801. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8802. /* All 525 Models */
  8803. ModelDecompressor.hdgfx();
  8804. System.out.println("Loaded 525 graphics...");
  8805. /* 525 End */
  8806. ModelDecompressor.loadModelDataFile();
  8807. drawLoadingText(80, "Unpacking media");
  8808. preloadModels();
  8809. DataBase.loadAnimations();
  8810.  
  8811. /* Custom sprite unpacking */
  8812. loadExtraSprites();
  8813. loadingPleaseWait = new Sprite("loadingPleaseWait");
  8814. reestablish = new Sprite("reestablish");
  8815. hitMarks[20] = new Sprite("hitMark");
  8816. hitMarks[21] = new Sprite("hitMark2");
  8817. hitMarks[22] = new Sprite("hitMark3");
  8818. hitMarks[23] = new Sprite("hitMark4");
  8819. compass = new Sprite(mediaArchive, "compass", 0);
  8820. mapArea = new Sprite("maparea");
  8821. multiOverlay = new Sprite(mediaArchive, "overlay_multiway", 0);
  8822. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", 1);
  8823. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 1.PNG", 1);
  8824. /**/
  8825.  
  8826. mapBack = new Background(mediaArchive, "mapback", 0);
  8827. for(int i = 0; i <= 3; i++) {
  8828. combatIcons[i] = new Sprite("Player/combatIcon "+i+"");
  8829. }
  8830.  
  8831. for(int c1 = 0; c1 <= 3; c1++)
  8832. chatButtons[c1] = new Sprite(mediaArchive, "chatbuttons", c1);
  8833.  
  8834. for(int j3 = 0; j3 <= 13; j3++)
  8835. sideIcons[j3] = new Sprite(mediaArchive, "sideicons", j3);
  8836.  
  8837. for(int j3 = 0; j3 <= 13; j3++)
  8838. sIcons483[j3] = new Sprite("Gameframe/SIcons/483/"+j3+"");
  8839.  
  8840. for(int j3 = 0; j3 <= 12; j3++)
  8841. sIcons459[j3] = new Sprite("Gameframe/SIcons/459/SIDEICONS "+j3+"");
  8842.  
  8843. for(int nSI = 0; nSI <= 15; nSI++)
  8844. newSideIcons[nSI] = new Sprite("Gameframe/SIcons/562/icon "+nSI);
  8845.  
  8846. tabHover = new Sprite("Gameframe/SIcons/562/tabhover");
  8847. tabClicked = new Sprite("Gameframe/SIcons/562/tabclicked1");
  8848.  
  8849. for(int r1 = 0; r1 < 15; r1++)
  8850. redStones[r1] = new Sprite("redstones " + r1);
  8851. mapEdge = new Sprite(mediaArchive, "mapedge", 0);
  8852. mapEdge.method345();
  8853. try
  8854. {
  8855. for(int k3 = 0; k3 < 100; k3++)
  8856. mapScenes[k3] = new Background(mediaArchive, "mapscene", k3);
  8857. }
  8858. catch(Exception _ex) { }
  8859. try
  8860. {
  8861. for(int l3 = 0; l3 < 100; l3++)
  8862. mapFunctions[l3] = new Sprite(mediaArchive, "mapfunction", l3);
  8863. }
  8864. catch(Exception _ex) { }
  8865. try
  8866. {
  8867. for(int i4 = 0; i4 < 20; i4++)
  8868. hitMarks[i4] = new Sprite(mediaArchive, "hitmarks", i4);
  8869. }
  8870. catch(Exception _ex) { }
  8871. try
  8872. {
  8873. for(int h1 = 0; h1 < 6; h1++)
  8874. headIconsHint[h1] = new Sprite(mediaArchive, "headicons_hint", h1);
  8875. } catch(Exception _ex) { }
  8876. try {
  8877. for(int j4 = 0; j4 < 8; j4++)
  8878. headIcons[j4] = new Sprite(mediaArchive, "headicons_prayer", j4);
  8879. for(int idx = 0; idx < 18; idx++)
  8880. headIcons[idx] = new Sprite("Player/Prayer/Prayer "+idx);
  8881. for(int j45 = 0; j45 < 3; j45++)
  8882. skullIcons[j45] = new Sprite(mediaArchive, "headicons_pk", j45 );
  8883. }
  8884. catch(Exception _ex) { }
  8885. mapFlag = new Sprite(mediaArchive, "mapmarker", 0);
  8886. mapMarker = new Sprite(mediaArchive, "mapmarker", 1);
  8887. for(int k4 = 0; k4 < 8; k4++)
  8888. crosses[k4] = new Sprite(mediaArchive, "cross", k4);
  8889.  
  8890. mapDotItem = new Sprite(mediaArchive, "mapdots", 0);
  8891. mapDotNPC = new Sprite(mediaArchive, "mapdots", 1);
  8892. mapDotPlayer = new Sprite(mediaArchive, "mapdots", 2);
  8893. mapDotFriend = new Sprite(mediaArchive, "mapdots", 3);
  8894. mapDotTeam = new Sprite(mediaArchive, "mapdots", 4);
  8895. mapDotClan = new Sprite(mediaArchive, "mapdots", 5);
  8896.  
  8897. scrollBar1 = new Sprite(mediaArchive, "scrollbar", 0);
  8898. scrollBar2 = new Sprite(mediaArchive, "scrollbar", 1);
  8899. alertBack = new Sprite("alertback");
  8900. alertBorder = new Sprite("alertborder");
  8901. alertBorderH = new Sprite("alertborderh");
  8902. scrollBar3 = new Sprite("Gameframe/SCROLLBAR 0");
  8903. scrollBar4 = new Sprite("Gameframe/SCROLLBAR 1");
  8904.  
  8905. Sprite sprite = new Sprite(mediaArchive, "screenframe", 0);
  8906. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8907. sprite.method346(0, 0);
  8908. sprite = new Sprite(mediaArchive, "screenframe", 1);
  8909. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8910. sprite.method346(0, 0);
  8911. sprite = new Sprite(mediaArchive, "screenframe", 2);
  8912. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8913. sprite.method346(0, 0);
  8914. sprite = new Sprite(mediaArchive, "mapedge", 0);
  8915. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8916. sprite.method346(0, 0);
  8917.  
  8918. int i5 = (int)(Math.random() * 21D) - 10;
  8919. int j5 = (int)(Math.random() * 21D) - 10;
  8920. int k5 = (int)(Math.random() * 21D) - 10;
  8921. int l5 = (int)(Math.random() * 41D) - 20;
  8922. for(int i6 = 0; i6 < 100; i6++)
  8923. {
  8924. if(mapFunctions[i6] != null)
  8925. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8926. if(mapScenes[i6] != null)
  8927. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8928. }
  8929. drawLoadingText(83, "Unpacking textures");
  8930. Texture.method368(streamLoader_3);
  8931. Texture.method372(0.80000000000000004D);
  8932. Texture.method367();
  8933. drawLoadingText(86, "Unpacking config");
  8934. try {
  8935. Animation.unpackConfig(archive);
  8936. ObjectDef.unpackConfig(archive);
  8937. Flo.unpackConfig(archive);
  8938. ItemDef.unpackConfig(archive);
  8939. EntityDef.unpackConfig(archive);
  8940. IdentityKit.unpackConfig(archive);
  8941. SpotAnim.unpackConfig(archive);
  8942. Varp.unpackConfig(archive);
  8943. VarBit.unpackConfig(archive);
  8944. ItemDef.isMembers = true;
  8945. } catch(Exception e) {
  8946. e.printStackTrace();
  8947. }
  8948. drawLoadingText(95, "Unpacking interfaces");
  8949. RSFont aclass30_sub2_sub1_sub4s[] = {
  8950. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  8951. };
  8952. RSInterface.fonts = aclass30_sub2_sub1_sub4s;
  8953. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, mediaArchive);
  8954. drawLoadingText(100, "Preparing game engine");
  8955. for(int j6 = 0; j6 < 33; j6++)
  8956. {
  8957. int k6 = 999;
  8958. int i7 = 0;
  8959. for(int k7 = 0; k7 < 34; k7++)
  8960. {
  8961. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  8962. {
  8963. if(k6 == 999)
  8964. k6 = k7;
  8965. continue;
  8966. }
  8967. if(k6 == 999)
  8968. continue;
  8969. i7 = k7;
  8970. break;
  8971. }
  8972.  
  8973. anIntArray968[j6] = k6;
  8974. anIntArray1057[j6] = i7 - k6;
  8975. }
  8976. for (int l6 = 1; l6 < 153; l6++) {
  8977. int j7 = 999;
  8978. int l7 = 0;
  8979. for (int j8 = 24; j8 < 177; j8++) {
  8980. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  8981. if (j7 == 999) {
  8982. j7 = j8;
  8983. }
  8984. continue;
  8985. }
  8986. if (j7 == 999) {
  8987. continue;
  8988. }
  8989. l7 = j8;
  8990. break;
  8991. }
  8992.  
  8993. anIntArray1052[l6 - 1] = j7 - 24;
  8994. anIntArray1229[l6 - 1] = l7 - j7;
  8995. }
  8996. Texture.method365(765, 503);
  8997. fullScreenTextureArray = Texture.anIntArray1472;
  8998. Texture.method365(516, 165);//519
  8999. anIntArray1180 = Texture.anIntArray1472;
  9000. Texture.method365(250, 335);
  9001. anIntArray1181 = Texture.anIntArray1472;
  9002. Texture.method365(512, 334);//512 334
  9003. anIntArray1182 = Texture.anIntArray1472;
  9004.  
  9005. int ai[] = new int[9];
  9006. for(int i8 = 0; i8 < 9; i8++)
  9007. {
  9008. int k8 = 128 + i8 * 32 + 15;
  9009. int l8 = 600 + k8 * 3;
  9010. int i9 = Texture.anIntArray1470[k8];
  9011. ai[i8] = l8 * i9 >> 16;
  9012. }
  9013.  
  9014. WorldController.method310(500, 800, 512, 334, ai);
  9015.  
  9016. Censor.loadConfig(streamLoader_4);
  9017. mouseDetection = new MouseDetection(this);
  9018. startRunnable(mouseDetection, 10);
  9019. Animable_Sub5.clientInstance = this;
  9020. ObjectDef.clientInstance = this;
  9021. EntityDef.clientInstance = this;
  9022. return;
  9023. }
  9024. catch(Exception exception)
  9025. {
  9026. exception.printStackTrace();
  9027. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  9028. }
  9029. loadingError = true;
  9030. }
  9031.  
  9032. private void method91(Stream stream, int i)
  9033. {
  9034. while(stream.bitPosition + 10 < i * 8)
  9035. {
  9036. int j = stream.readBits(11);
  9037. if(j == 2047)
  9038. break;
  9039. if(playerArray[j] == null)
  9040. {
  9041. playerArray[j] = new Player();
  9042. if(aStreamArray895s[j] != null)
  9043. playerArray[j].updatePlayer(aStreamArray895s[j]);
  9044. }
  9045. playerIndices[playerCount++] = j;
  9046. Player player = playerArray[j];
  9047. player.anInt1537 = loopCycle;
  9048. int k = stream.readBits(1);
  9049. if(k == 1)
  9050. anIntArray894[anInt893++] = j;
  9051. int l = stream.readBits(1);
  9052. int i1 = stream.readBits(5);
  9053. if(i1 > 15)
  9054. i1 -= 32;
  9055. int j1 = stream.readBits(5);
  9056. if(j1 > 15)
  9057. j1 -= 32;
  9058. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  9059. }
  9060. stream.finishBitAccess();
  9061. }
  9062.  
  9063. private void processMainScreenClick() {
  9064. if(anInt1021 != 0)
  9065. return;
  9066. if(super.clickMode3 == 1) {
  9067. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  9068. int i = super.saveClickX - 25 - 530;//
  9069. int j = super.saveClickY - 8;
  9070. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  9071. i -= 73;
  9072. j -= 75;
  9073. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9074. int i1 = Texture.anIntArray1470[k];
  9075. int j1 = Texture.anIntArray1471[k];
  9076. i1 = i1 * (minimapInt3 + 256) >> 8;
  9077. j1 = j1 * (minimapInt3 + 256) >> 8;
  9078. int k1 = j * i1 + i * j1 >> 11;
  9079. int l1 = j * j1 - i * i1 >> 11;
  9080. int i2 = myPlayer.x + k1 >> 7;
  9081. int j2 = myPlayer.y - l1 >> 7;
  9082. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9083. if(flag1) {
  9084. stream.writeWordBigEndian(i);
  9085. stream.writeWordBigEndian(j);
  9086. stream.writeWord(minimapInt1);
  9087. stream.writeWordBigEndian(57);
  9088. stream.writeWordBigEndian(minimapInt2);
  9089. stream.writeWordBigEndian(minimapInt3);
  9090. stream.writeWordBigEndian(89);
  9091. stream.writeWord(myPlayer.x);
  9092. stream.writeWord(myPlayer.y);
  9093. stream.writeWordBigEndian(anInt1264);
  9094. stream.writeWordBigEndian(63);
  9095. }
  9096. }
  9097. } else {
  9098. int i = super.saveClickX - 25 - 545;//545
  9099. int j = super.saveClickY - 5 - 4;
  9100. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  9101. i -= 73;
  9102. j -= 75;
  9103. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9104. int i1 = Texture.anIntArray1470[k];
  9105. int j1 = Texture.anIntArray1471[k];
  9106. i1 = i1 * (minimapInt3 + 256) >> 8;
  9107. j1 = j1 * (minimapInt3 + 256) >> 8;
  9108. int k1 = j * i1 + i * j1 >> 11;
  9109. int l1 = j * j1 - i * i1 >> 11;
  9110. int i2 = myPlayer.x + k1 >> 7;
  9111. int j2 = myPlayer.y - l1 >> 7;
  9112. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9113. if(flag1) {
  9114. stream.writeWordBigEndian(i);
  9115. stream.writeWordBigEndian(j);
  9116. stream.writeWord(minimapInt1);
  9117. stream.writeWordBigEndian(57);
  9118. stream.writeWordBigEndian(minimapInt2);
  9119. stream.writeWordBigEndian(minimapInt3);
  9120. stream.writeWordBigEndian(89);
  9121. stream.writeWord(myPlayer.x);
  9122. stream.writeWord(myPlayer.y);
  9123. stream.writeWordBigEndian(anInt1264);
  9124. stream.writeWordBigEndian(63);
  9125. }
  9126. }
  9127. }
  9128. anInt1117++;
  9129. if(anInt1117 > 1151) {
  9130. anInt1117 = 0;
  9131. stream.createFrame(246);
  9132. stream.writeWordBigEndian(0);
  9133. int l = stream.currentOffset;
  9134. if((int)(Math.random() * 2D) == 0)
  9135. stream.writeWordBigEndian(101);
  9136. stream.writeWordBigEndian(197);
  9137. stream.writeWord((int)(Math.random() * 65536D));
  9138. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9139. stream.writeWordBigEndian(67);
  9140. stream.writeWord(14214);
  9141. if((int)(Math.random() * 2D) == 0)
  9142. stream.writeWord(29487);
  9143. stream.writeWord((int)(Math.random() * 65536D));
  9144. if((int)(Math.random() * 2D) == 0)
  9145. stream.writeWordBigEndian(220);
  9146. stream.writeWordBigEndian(180);
  9147. stream.writeBytes(stream.currentOffset - l);
  9148. }
  9149. }
  9150. }
  9151.  
  9152. private String interfaceIntToString(int j) {
  9153. if(j < 0x3b9ac9ff)
  9154. return String.valueOf(j);
  9155. else
  9156. return "*";
  9157. }
  9158.  
  9159. private void showErrorScreen()
  9160. {
  9161. Graphics g = getGameComponent().getGraphics();
  9162. g.setColor(Color.black);
  9163. g.fillRect(0, 0, 765, 503);
  9164. method4(1);
  9165. if(loadingError)
  9166. {
  9167. aBoolean831 = false;
  9168. g.setFont(new Font("Helvetica", 1, 16));
  9169. g.setColor(Color.yellow);
  9170. int k = 35;
  9171. g.drawString("Sorry, an error has occured whilst loading ErasedPkz.", 30, k);
  9172. k += 50;
  9173. g.setColor(Color.white);
  9174. g.drawString("To fix this try the following (in order):", 30, k);
  9175. k += 50;
  9176. g.setColor(Color.white);
  9177. g.setFont(new Font("Helvetica", 1, 12));
  9178. g.drawString("1: Try closing and reopening the client and/or web browser", 30, k);
  9179. k += 30;
  9180. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  9181. k += 30;
  9182. g.drawString("3: Try rebooting your computer", 30, k);
  9183. k += 30;
  9184. g.drawString(" ", 30, k);
  9185. k += 30;
  9186. g.drawString("If problems still occur, visit the forums at http://erased-pkz.comyr.com/ and request help", 30, k);
  9187. }
  9188. if(genericLoadingError)
  9189. {
  9190. aBoolean831 = false;
  9191. g.setFont(new Font("Helvetica", 1, 20));
  9192. g.setColor(Color.white);
  9193. g.drawString("Error - unable to load game!", 50, 50);
  9194. g.drawString("To play ErasedPkz make sure you play from", 50, 100);
  9195. g.drawString("http://www.erased-pkz.comyr.com/", 50, 150);
  9196. }
  9197. if(rsAlreadyLoaded)
  9198. {
  9199. aBoolean831 = false;
  9200. g.setColor(Color.yellow);
  9201. int l = 35;
  9202. g.drawString("Error a copy of ErasedPKz already appears to be loaded", 30, l);
  9203. l += 50;
  9204. g.setColor(Color.white);
  9205. g.drawString("To fix this try the following (in order):", 30, l);
  9206. l += 50;
  9207. g.setColor(Color.white);
  9208. g.setFont(new Font("Helvetica", 1, 12));
  9209. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  9210. l += 30;
  9211. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  9212. l += 30;
  9213. }
  9214. }
  9215.  
  9216. public URL getCodeBase() {
  9217.  
  9218.  
  9219. try {
  9220. return new URL(server +":" + (80 + portOff));
  9221. } catch(Exception _ex) {
  9222. }
  9223. return null;
  9224. }
  9225.  
  9226. private void method95() {
  9227. for(int j = 0; j < npcCount; j++) {
  9228. int k = npcIndices[j];
  9229. NPC npc = npcArray[k];
  9230. if(npc != null)
  9231. method96(npc);
  9232. }
  9233. }
  9234.  
  9235. private void method96(Entity entity)
  9236. {
  9237. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  9238. {
  9239. entity.anim = -1;
  9240. entity.anInt1520 = -1;
  9241. entity.anInt1547 = 0;
  9242. entity.anInt1548 = 0;
  9243. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9244. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9245. entity.method446();
  9246. }
  9247. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  9248. {
  9249. entity.anim = -1;
  9250. entity.anInt1520 = -1;
  9251. entity.anInt1547 = 0;
  9252. entity.anInt1548 = 0;
  9253. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9254. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9255. entity.method446();
  9256. }
  9257. if(entity.anInt1547 > loopCycle)
  9258. method97(entity);
  9259. else
  9260. if(entity.anInt1548 >= loopCycle)
  9261. method98(entity);
  9262. else
  9263. method99(entity);
  9264. method100(entity);
  9265. method101(entity);
  9266. }
  9267.  
  9268. private void method97(Entity entity)
  9269. {
  9270. int i = entity.anInt1547 - loopCycle;
  9271. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9272. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9273. entity.x += (j - entity.x) / i;
  9274. entity.y += (k - entity.y) / i;
  9275. entity.anInt1503 = 0;
  9276. if(entity.anInt1549 == 0)
  9277. entity.turnDirection = 1024;
  9278. if(entity.anInt1549 == 1)
  9279. entity.turnDirection = 1536;
  9280. if(entity.anInt1549 == 2)
  9281. entity.turnDirection = 0;
  9282. if(entity.anInt1549 == 3)
  9283. entity.turnDirection = 512;
  9284. }
  9285.  
  9286. private void method98(Entity entity)
  9287. {
  9288. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  9289. {
  9290. int i = entity.anInt1548 - entity.anInt1547;
  9291. int j = loopCycle - entity.anInt1547;
  9292. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9293. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9294. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9295. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9296. entity.x = (k * (i - j) + i1 * j) / i;
  9297. entity.y = (l * (i - j) + j1 * j) / i;
  9298. }
  9299. entity.anInt1503 = 0;
  9300. if(entity.anInt1549 == 0)
  9301. entity.turnDirection = 1024;
  9302. if(entity.anInt1549 == 1)
  9303. entity.turnDirection = 1536;
  9304. if(entity.anInt1549 == 2)
  9305. entity.turnDirection = 0;
  9306. if(entity.anInt1549 == 3)
  9307. entity.turnDirection = 512;
  9308. entity.anInt1552 = entity.turnDirection;
  9309. }
  9310.  
  9311. private void method99(Entity entity)
  9312. {
  9313. entity.anInt1517 = entity.anInt1511;
  9314. if(entity.smallXYIndex == 0)
  9315. {
  9316. entity.anInt1503 = 0;
  9317. return;
  9318. }
  9319. if(entity.anim != -1 && entity.anInt1529 == 0)
  9320. {
  9321. Animation animation = Animation.anims[entity.anim];
  9322. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  9323. {
  9324. entity.anInt1503++;
  9325. return;
  9326. }
  9327. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  9328. {
  9329. entity.anInt1503++;
  9330. return;
  9331. }
  9332. }
  9333. int i = entity.x;
  9334. int j = entity.y;
  9335. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9336. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9337. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  9338. {
  9339. entity.x = k;
  9340. entity.y = l;
  9341. return;
  9342. }
  9343. if(i < k)
  9344. {
  9345. if(j < l)
  9346. entity.turnDirection = 1280;
  9347. else
  9348. if(j > l)
  9349. entity.turnDirection = 1792;
  9350. else
  9351. entity.turnDirection = 1536;
  9352. } else
  9353. if(i > k)
  9354. {
  9355. if(j < l)
  9356. entity.turnDirection = 768;
  9357. else
  9358. if(j > l)
  9359. entity.turnDirection = 256;
  9360. else
  9361. entity.turnDirection = 512;
  9362. } else
  9363. if(j < l)
  9364. entity.turnDirection = 1024;
  9365. else
  9366. entity.turnDirection = 0;
  9367. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9368. if(i1 > 1024)
  9369. i1 -= 2048;
  9370. int j1 = entity.anInt1555;
  9371. if(i1 >= -256 && i1 <= 256)
  9372. j1 = entity.anInt1554;
  9373. else
  9374. if(i1 >= 256 && i1 < 768)
  9375. j1 = entity.anInt1557;
  9376. else
  9377. if(i1 >= -768 && i1 <= -256)
  9378. j1 = entity.anInt1556;
  9379. if(j1 == -1)
  9380. j1 = entity.anInt1554;
  9381. entity.anInt1517 = j1;
  9382. int k1 = 4;
  9383. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9384. k1 = 2;
  9385. if(entity.smallXYIndex > 2)
  9386. k1 = 6;
  9387. if(entity.smallXYIndex > 3)
  9388. k1 = 8;
  9389. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  9390. {
  9391. k1 = 8;
  9392. entity.anInt1503--;
  9393. }
  9394. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9395. k1 <<= 1;
  9396. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  9397. entity.anInt1517 = entity.anInt1505;
  9398. if(i < k)
  9399. {
  9400. entity.x += k1;
  9401. if(entity.x > k)
  9402. entity.x = k;
  9403. } else
  9404. if(i > k)
  9405. {
  9406. entity.x -= k1;
  9407. if(entity.x < k)
  9408. entity.x = k;
  9409. }
  9410. if(j < l)
  9411. {
  9412. entity.y += k1;
  9413. if(entity.y > l)
  9414. entity.y = l;
  9415. } else
  9416. if(j > l)
  9417. {
  9418. entity.y -= k1;
  9419. if(entity.y < l)
  9420. entity.y = l;
  9421. }
  9422. if(entity.x == k && entity.y == l)
  9423. {
  9424. entity.smallXYIndex--;
  9425. if(entity.anInt1542 > 0)
  9426. entity.anInt1542--;
  9427. }
  9428. }
  9429.  
  9430. private void method100(Entity entity)
  9431. {
  9432. if(entity.anInt1504 == 0)
  9433. return;
  9434. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  9435. {
  9436. NPC npc = npcArray[entity.interactingEntity];
  9437. if(npc != null)
  9438. {
  9439. int i1 = entity.x - npc.x;
  9440. int k1 = entity.y - npc.y;
  9441. if(i1 != 0 || k1 != 0)
  9442. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9443. }
  9444. }
  9445. if(entity.interactingEntity >= 32768)
  9446. {
  9447. int j = entity.interactingEntity - 32768;
  9448. if(j == unknownInt10)
  9449. j = myPlayerIndex;
  9450. Player player = playerArray[j];
  9451. if(player != null)
  9452. {
  9453. int l1 = entity.x - player.x;
  9454. int i2 = entity.y - player.y;
  9455. if(l1 != 0 || i2 != 0)
  9456. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9457. }
  9458. }
  9459. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  9460. {
  9461. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9462. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9463. if(k != 0 || j1 != 0)
  9464. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9465. entity.anInt1538 = 0;
  9466. entity.anInt1539 = 0;
  9467. }
  9468. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9469. if(l != 0)
  9470. {
  9471. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9472. entity.anInt1552 = entity.turnDirection;
  9473. else
  9474. if(l > 1024)
  9475. entity.anInt1552 -= entity.anInt1504;
  9476. else
  9477. entity.anInt1552 += entity.anInt1504;
  9478. entity.anInt1552 &= 0x7ff;
  9479. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  9480. {
  9481. if(entity.anInt1512 != -1)
  9482. {
  9483. entity.anInt1517 = entity.anInt1512;
  9484. return;
  9485. }
  9486. entity.anInt1517 = entity.anInt1554;
  9487. }
  9488. }
  9489. }
  9490.  
  9491. private void method101(Entity entity)
  9492. {
  9493. entity.aBoolean1541 = false;
  9494. if(entity.anInt1517 != -1)
  9495. {
  9496. Animation animation = Animation.anims[entity.anInt1517];
  9497. entity.anInt1519++;
  9498. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  9499. {
  9500. entity.anInt1519 = 0;
  9501. entity.anInt1518++;
  9502. }
  9503. if(entity.anInt1518 >= animation.anInt352)
  9504. {
  9505. entity.anInt1519 = 0;
  9506. entity.anInt1518 = 0;
  9507. }
  9508. }
  9509. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  9510. {
  9511. if(entity.anInt1521 < 0)
  9512. entity.anInt1521 = 0;
  9513. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9514. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)//huhhhhh
  9515. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9516.  
  9517. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9518. entity.anInt1520 = -1;
  9519. }
  9520. if(entity.anim != -1 && entity.anInt1529 <= 1)
  9521. {
  9522. Animation animation_2 = Animation.anims[entity.anim];
  9523. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  9524. {
  9525. entity.anInt1529 = 1;
  9526. return;
  9527. }
  9528. }
  9529. if(entity.anim != -1 && entity.anInt1529 == 0)
  9530. {
  9531. Animation animation_3 = Animation.anims[entity.anim];
  9532. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  9533. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9534.  
  9535. if(entity.anInt1527 >= animation_3.anInt352)
  9536. {
  9537. entity.anInt1527 -= animation_3.anInt356;
  9538. entity.anInt1530++;
  9539. if(entity.anInt1530 >= animation_3.anInt362)
  9540. entity.anim = -1;
  9541. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  9542. entity.anim = -1;
  9543. }
  9544. entity.aBoolean1541 = animation_3.aBoolean358;
  9545. }
  9546. if(entity.anInt1529 > 0)
  9547. entity.anInt1529--;
  9548. }
  9549.  
  9550. private void drawGameScreen()
  9551. {
  9552. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  9553. if (loadingStage == 2) {
  9554. method119(anInt945, fullscreenInterfaceID);
  9555. if (openInterfaceID != -1) {
  9556. method119(anInt945, openInterfaceID);
  9557. }
  9558. anInt945 = 0;
  9559. resetAllImageProducers();
  9560. super.fullGameScreen.initDrawingArea();
  9561. Texture.anIntArray1472 = fullScreenTextureArray;
  9562. DrawingArea.setAllPixelsToZero();
  9563. welcomeScreenRaised = true;
  9564. if (openInterfaceID != -1) {
  9565. RSInterface class9_1 = RSInterface.interfaceCache[openInterfaceID];
  9566. if (class9_1.width == 512 && class9_1.height == 334 && class9_1.interfaceType == 0) {
  9567. class9_1.width = 765;
  9568. class9_1.height = 503;
  9569. }
  9570. drawInterface(0, 0, class9_1, 8);
  9571. }
  9572. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9573. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.interfaceType == 0) {
  9574. rsInterface.width = 765;
  9575. rsInterface.height = 503;
  9576. }
  9577. drawInterface(0, 0, rsInterface, 8);
  9578.  
  9579. if (!menuOpen) {
  9580. processRightClick();
  9581. drawTooltip();
  9582. } else {
  9583. drawMenu(0, 0);
  9584. }
  9585. }
  9586. drawCount++;
  9587. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9588. return;
  9589. } else {
  9590. if (drawCount != 0) {
  9591. resetImageProducers2();
  9592. }
  9593. }
  9594. if(welcomeScreenRaised) {
  9595. welcomeScreenRaised = false;
  9596. topFrame.drawGraphics(0, super.graphics, 0);
  9597. leftFrame.drawGraphics(4, super.graphics, 0);
  9598. //rightFrame.drawGraphics(4, super.graphics, 516);
  9599. //mapEdgeIP.drawGraphics(4, super.graphics, 516);//519
  9600. needDrawTabArea = true;
  9601. inputTaken = true;
  9602. tabAreaAltered = true;
  9603. aBoolean1233 = true;
  9604.  
  9605. if(loadingStage != 2) {
  9606. inGameScreen.drawGraphics(4, super.graphics, 4);
  9607. mapBackImage.drawGraphics(0, super.graphics, 516);//545
  9608.  
  9609. }
  9610. }
  9611. if(menuOpen)
  9612. needDrawTabArea = true;
  9613. if(menuOpen)
  9614. drawMenu(4,4);
  9615.  
  9616. if(invOverlayInterfaceID != -1)
  9617. {
  9618. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9619. if(flag1)
  9620. needDrawTabArea = true;
  9621. }
  9622. if(atInventoryInterfaceType == 2)
  9623. needDrawTabArea = true;
  9624. if(activeInterfaceType == 2)
  9625. needDrawTabArea = true;
  9626. drawTabArea();
  9627. if(loadingStage == 2) {
  9628. method146();
  9629. }
  9630. if(backDialogID == -1)
  9631. {
  9632. if(is474 || is480 || is508 || is525 || is562) {
  9633. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  9634. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  9635. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  9636. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  9637. if(i < 0)
  9638. i = 0;
  9639. if(i > anInt1211 - 110)
  9640. i = anInt1211 - 110;
  9641. if(anInt1089 != i) {
  9642. anInt1089 = i;
  9643. inputTaken = true;
  9644. }
  9645. } else {
  9646. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 77;
  9647. if(super.mouseX > 448 && super.mouseX < 560 && super.mouseY > 332)
  9648. method65(463, 77, super.mouseX - 17, super.mouseY - 357, aClass9_1059, 0, false, anInt1211);
  9649. int i = anInt1211 - 77 - aClass9_1059.scrollPosition;
  9650. if(i < 0)
  9651. i = 0;
  9652. if(i > anInt1211 - 77)
  9653. i = anInt1211 - 77;
  9654. if(anInt1089 != i) {
  9655. anInt1089 = i;
  9656. inputTaken = true;
  9657. }
  9658. }
  9659. }
  9660. if(backDialogID != -1) {
  9661. boolean flag2 = method119(anInt945, backDialogID);
  9662. if(flag2)
  9663. inputTaken = true;
  9664. }
  9665. if(atInventoryInterfaceType == 3)
  9666. inputTaken = true;
  9667. if(activeInterfaceType == 3)
  9668. inputTaken = true;
  9669. if(aString844 != null)
  9670. inputTaken = true;
  9671. if(menuOpen && menuScreenArea == 2)
  9672. inputTaken = true;
  9673. if(inputTaken) {
  9674. drawChatArea();
  9675. inputTaken = false;
  9676. }
  9677. if(loadingStage == 2) {
  9678. drawMinimap();
  9679. mapBackImage.drawGraphics(0, super.graphics, 516);//545
  9680. }
  9681. if(anInt1054 != -1)
  9682. tabAreaAltered = true;
  9683. if(tabAreaAltered)
  9684. {
  9685. if(anInt1054 != -1 && anInt1054 == tabID)
  9686. {
  9687. anInt1054 = -1;
  9688. stream.createFrame(120);
  9689. stream.writeWordBigEndian(tabID);
  9690. }
  9691. tabAreaAltered = false;
  9692. aRSImageProducer_1125.initDrawingArea();
  9693. inGameScreen.initDrawingArea();
  9694. }
  9695. if(menuOpen){
  9696. drawMenu(516, 466);
  9697. }
  9698. anInt945 = 0;
  9699. }
  9700.  
  9701. private boolean buildFriendsListMenu(RSInterface class9)
  9702. {
  9703. int i = class9.contentType;
  9704. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  9705. {
  9706. if(i >= 801)
  9707. i -= 701;
  9708. else
  9709. if(i >= 701)
  9710. i -= 601;
  9711. else
  9712. if(i >= 101)
  9713. i -= 101;
  9714. else
  9715. i--;
  9716. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9717. menuActionID[menuActionRow] = 792;
  9718. menuActionRow++;
  9719. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9720. menuActionID[menuActionRow] = 639;
  9721. menuActionRow++;
  9722. return true;
  9723. }
  9724. if(i >= 401 && i <= 500)
  9725. {
  9726. menuActionName[menuActionRow] = "Remove @whi@" + class9.disabledMessage;
  9727. menuActionID[menuActionRow] = 322;
  9728. menuActionRow++;
  9729. return true;
  9730. } else
  9731. {
  9732. return false;
  9733. }
  9734. }
  9735.  
  9736. private void method104()
  9737. {
  9738. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  9739. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  9740. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  9741. class30_sub2_sub4_sub3.unlink();
  9742. else
  9743. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  9744. {
  9745. class30_sub2_sub4_sub3.method454(anInt945);
  9746. if(class30_sub2_sub4_sub3.aBoolean1567)
  9747. class30_sub2_sub4_sub3.unlink();
  9748. else
  9749. worldController.method285(class30_sub2_sub4_sub3.anInt1560, 0, class30_sub2_sub4_sub3.anInt1563, -1, class30_sub2_sub4_sub3.anInt1562, 60, class30_sub2_sub4_sub3.anInt1561, class30_sub2_sub4_sub3, false);
  9750. }
  9751.  
  9752. }
  9753.  
  9754. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9755. if(class9.interfaceType != 0 || class9.children == null)
  9756. return;
  9757. if(class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  9758. return;
  9759. int i1 = DrawingArea.topX;
  9760. int j1 = DrawingArea.topY;
  9761. int k1 = DrawingArea.bottomX;
  9762. int l1 = DrawingArea.bottomY;
  9763. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9764. int i2 = class9.children.length;
  9765. for(int j2 = 0; j2 < i2; j2++) {
  9766. int k2 = class9.childX[j2] + k;
  9767. int l2 = (class9.childY[j2] + l) - j;
  9768. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9769. k2 += class9_1.xOffset;
  9770. l2 += class9_1.yOffset;
  9771. if(class9_1.contentType > 0)
  9772. drawFriendsListOrWelcomeScreen(class9_1);
  9773. //here
  9774. int[] IDs = {
  9775. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  9776. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  9777. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  9778. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  9779. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  9780. /* Ancients */
  9781. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  9782. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9783. };
  9784. for(int m5 = 0; m5 < IDs.length; m5++) {
  9785. if(class9_1.id == IDs[m5] + 1) {
  9786. if(m5 > 61)
  9787. drawBlackBox(k2 + 1, l2);
  9788. else
  9789. drawBlackBox(k2, l2 + 1);
  9790. }
  9791. }
  9792. int[] runeChildren = {
  9793. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  9794. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  9795. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  9796. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  9797. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  9798. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  9799. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  9800. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  9801. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  9802. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  9803. 15885, 18474, 18475, 18478
  9804. };
  9805. for(int r = 0; r < runeChildren.length; r++)
  9806. if(class9_1.id == runeChildren[r])
  9807. class9_1.modelZoom = 775;
  9808.  
  9809.  
  9810. if(class9_1.interfaceType == 0) {
  9811. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  9812. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  9813. if(class9_1.scrollPosition < 0)
  9814. class9_1.scrollPosition = 0;
  9815. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9816. if(class9_1.scrollMax > class9_1.height)
  9817. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  9818. } else if(class9_1.interfaceType != 1)
  9819. if(class9_1.interfaceType == 2) {
  9820. int i3 = 0;
  9821. for(int l3 = 0; l3 < class9_1.height; l3++) {
  9822. for(int l4 = 0; l4 < class9_1.width; l4++) {
  9823. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9824. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9825. if(i3 < 20) {
  9826. k5 += class9_1.spritesX[i3];
  9827. j6 += class9_1.spritesY[i3];
  9828. }
  9829. if(class9_1.inventory[i3] > 0) {
  9830. int k6 = 0;
  9831. int j7 = 0;
  9832. int j9 = class9_1.inventory[i3] - 1;
  9833. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  9834. int l9 = 0;
  9835. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  9836. l9 = 0xffffff;
  9837. Sprite Sprite_2 = ItemDef.getSprite(j9, class9_1.inventoryValue[i3], l9);
  9838. if(Sprite_2 != null) {
  9839. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  9840. k6 = super.mouseX - anInt1087;
  9841. j7 = super.mouseY - anInt1088;
  9842. if(k6 < 5 && k6 > -5)
  9843. k6 = 0;
  9844. if(j7 < 5 && j7 > -5)
  9845. j7 = 0;
  9846. if(anInt989 < 5) {
  9847. k6 = 0;
  9848. j7 = 0;
  9849. }
  9850. Sprite_2.drawSprite1(k5 + k6, j6 + j7);
  9851. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  9852. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9853. if(i10 > anInt945 * 10)
  9854. i10 = anInt945 * 10;
  9855. if(i10 > class9.scrollPosition)
  9856. i10 = class9.scrollPosition;
  9857. class9.scrollPosition -= i10;
  9858. anInt1088 += i10;
  9859. }
  9860. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9861. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9862. if(j10 > anInt945 * 10)
  9863. j10 = anInt945 * 10;
  9864. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9865. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9866. class9.scrollPosition += j10;
  9867. anInt1088 -= j10;
  9868. }
  9869. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9870. Sprite_2.drawSprite1(k5, j6);
  9871. else
  9872. Sprite_2.drawSprite(k5, j6);
  9873. if(Sprite_2.maxWidth == 33 || class9_1.inventoryValue[i3] != 1)
  9874. {
  9875. int k10 = class9_1.inventoryValue[i3];
  9876. smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  9877. if(k10 >= 1)
  9878. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9879. if(k10 >= 100000)
  9880. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9881. if(k10 >= 10000000)
  9882. smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9883. }
  9884. }
  9885. }
  9886. } else if(class9_1.sprites != null && i3 < 20) {
  9887. Sprite Sprite_1 = class9_1.sprites[i3];
  9888. if(Sprite_1 != null)
  9889. Sprite_1.drawSprite(k5, j6);
  9890. }
  9891. i3++;
  9892. }
  9893. }
  9894. } else if(class9_1.interfaceType == 3) {
  9895. boolean flag = false;
  9896. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9897. flag = true;
  9898. int j3;
  9899. if(interfaceIsSelected(class9_1)) {
  9900. j3 = class9_1.enabledColor;
  9901. if(flag && class9_1.enabledHoverColor != 0)
  9902. j3 = class9_1.enabledHoverColor;
  9903. } else {
  9904. j3 = class9_1.disabledColor;
  9905. if(flag && class9_1.disabledHoverColor != 0)
  9906. j3 = class9_1.disabledHoverColor;
  9907. }
  9908. if(class9_1.opacity == 0) {
  9909. if(class9_1.boxFilled)
  9910. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  9911. else
  9912. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  9913. } else if(class9_1.boxFilled)
  9914. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.opacity & 0xff), k2);
  9915. else
  9916. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.opacity & 0xff), j3, class9_1.width, k2);
  9917. } else if(class9_1.interfaceType == 4) {
  9918. RSFont textDrawingArea = class9_1.rsFonts;
  9919. String s = class9_1.disabledMessage;
  9920. boolean flag1 = false;
  9921. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9922. flag1 = true;
  9923. int i4;
  9924. if(interfaceIsSelected(class9_1)) {
  9925. i4 = class9_1.enabledColor;
  9926. if(flag1 && class9_1.enabledHoverColor != 0)
  9927. i4 = class9_1.enabledHoverColor;
  9928. if(class9_1.enabledMessage.length() > 0)
  9929. s = class9_1.enabledMessage;
  9930. } else {
  9931. i4 = class9_1.disabledColor;
  9932. if(flag1 && class9_1.disabledHoverColor != 0)
  9933. i4 = class9_1.disabledHoverColor;
  9934. }
  9935. if(class9_1.atActionType == 6 && aBoolean1149) {
  9936. s = "Please wait...";
  9937. i4 = class9_1.disabledColor;
  9938. }
  9939. if(DrawingArea.width == 516) {//519
  9940. if(i4 == 0xffff00)
  9941. i4 = 255;
  9942. if(i4 == 49152)
  9943. i4 = 0xffffff;
  9944. }
  9945. //Magic interface
  9946. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9947. switch (i4) {
  9948. case 16773120: i4 = 0xFE981F; break;
  9949. case 7040819: i4 = 0xAF6A1A; break;
  9950. }
  9951. }
  9952. //Skill interface
  9953. int id = 4004; int id2 = 4005;
  9954. if(class9_1.parentID == 3917 && class9_1.id != id && class9_1.id != id+2 && class9_1.id != id+4 && class9_1.id != id+6
  9955. && 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
  9956. && 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
  9957. && class9_1.id != id+28 && class9_1.id != id+30 && class9_1.id != id+32 && class9_1.id != id+34 && class9_1.id != 13926
  9958. && 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
  9959. && 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
  9960. && 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
  9961. && class9_1.id != id2+28 && class9_1.id != id2+30 && class9_1.id != id2+32 && class9_1.id != id2+34 && class9_1.id != 13927
  9962. && class9_1.id != 4153 && class9_1.id != 12167 && class9_1.id != 4026) {
  9963. if(i4 == 16776960)
  9964. i4 = 0x0000;
  9965. class9_1.textShadowed = false;
  9966. }
  9967. /*if(class9_1.parentID == 3917) {
  9968. for(int i = 4004; i < 4040; i++) {
  9969. int[] moreData = {
  9970. 13926, 4152, 12166, 13927,
  9971. 4153, 12167, 4026
  9972. };
  9973. if(class9_1.id == i || class9_1.id == moreData[i]) {
  9974. return;
  9975. }
  9976. if(i4 == 16776960) {
  9977. i4 = 0x0000;
  9978. class9_1.textShadowed = false;
  9979. }
  9980. }
  9981. }*/
  9982. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  9983. {
  9984. if(s.indexOf("%") != -1)
  9985. {
  9986. do
  9987. {
  9988. int k7 = s.indexOf("%1");
  9989. if(k7 == -1)
  9990. break;
  9991. 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)
  9992. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9993. else
  9994. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9995. } while(true);
  9996. do
  9997. {
  9998. int l7 = s.indexOf("%2");
  9999. if(l7 == -1)
  10000. break;
  10001. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  10002. } while(true);
  10003. do
  10004. {
  10005. int i8 = s.indexOf("%3");
  10006. if(i8 == -1)
  10007. break;
  10008. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  10009. } while(true);
  10010. do
  10011. {
  10012. int j8 = s.indexOf("%4");
  10013. if(j8 == -1)
  10014. break;
  10015. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  10016. } while(true);
  10017. do
  10018. {
  10019. int k8 = s.indexOf("%5");
  10020. if(k8 == -1)
  10021. break;
  10022. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  10023. } while(true);
  10024. }
  10025. int l8 = s.indexOf("\\n");
  10026. String s1;
  10027. if(l8 != -1)
  10028. {
  10029. s1 = s.substring(0, l8);
  10030. s = s.substring(l8 + 2);
  10031. } else
  10032. {
  10033. s1 = s;
  10034. s = "";
  10035. }
  10036. if(class9_1.textCentered)
  10037. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadowed);
  10038. else
  10039. textDrawingArea.method389(class9_1.textShadowed, k2, i4, s1, l6);
  10040. }
  10041. } else if(class9_1.interfaceType == 5) {
  10042. //whats this?
  10043.  
  10044. Sprite sprite;
  10045. if(interfaceIsSelected(class9_1))
  10046. sprite = class9_1.enabledSprite;
  10047. else
  10048. sprite = class9_1.disabledSprite;
  10049. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  10050. sprite.drawSprite2(k2, l2, 0xffffff);
  10051. } else {
  10052. if(Autocast && class9_1.id == autocastId)
  10053. magicAuto.drawSprite(k2-3, l2-3);
  10054. if (sprite != null)
  10055. sprite.drawSprite(k2, l2);
  10056. }
  10057. if(sprite != null)
  10058. sprite.drawSprite(k2, l2);
  10059. } else if(class9_1.interfaceType == 6) {
  10060. int k3 = Texture.textureInt1;
  10061. int j4 = Texture.textureInt2;
  10062. Texture.textureInt1 = k2 + class9_1.width / 2;
  10063. Texture.textureInt2 = l2 + class9_1.height / 2;
  10064. int i5 = Texture.anIntArray1470[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  10065. int l5 = Texture.anIntArray1471[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  10066. boolean flag2 = interfaceIsSelected(class9_1);
  10067. int i7;
  10068. if(flag2)
  10069. i7 = class9_1.enabledAnimation;
  10070. else
  10071. i7 = class9_1.disabledAnimation;
  10072. Model model;
  10073. if(i7 == -1) {
  10074. model = class9_1.method209(-1, -1, flag2);
  10075. } else {
  10076. Animation animation = Animation.anims[i7];
  10077. model = class9_1.method209(animation.anIntArray354[class9_1.animationLength], animation.anIntArray353[class9_1.animationLength], flag2);
  10078. }
  10079. if(model != null)
  10080. model.method482(class9_1.modelRotationX, 0, class9_1.modelRotationY, 0, i5, l5);
  10081. Texture.textureInt1 = k3;
  10082. Texture.textureInt2 = j4;
  10083. } else if(class9_1.interfaceType == 7) {
  10084. RSFont textDrawingArea_1 = class9_1.rsFonts;
  10085. int k4 = 0;
  10086. for(int j5 = 0; j5 < class9_1.height; j5++) {
  10087. for(int i6 = 0; i6 < class9_1.width; i6++) {
  10088. if(class9_1.inventory[k4] > 0) {
  10089. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k4] - 1);
  10090. String s2 = itemDef.name;
  10091. if(itemDef.stackable || class9_1.inventoryValue[k4] != 1)
  10092. s2 = s2 + " x" + intToKOrMilLongName(class9_1.inventoryValue[k4]);
  10093. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  10094. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  10095. if(class9_1.textCentered)
  10096. textDrawingArea_1.method382(class9_1.disabledColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadowed);
  10097. else
  10098. textDrawingArea_1.method389(class9_1.textShadowed, i9, class9_1.disabledColor, s2, k9);
  10099. }
  10100. k4++;
  10101. }
  10102. }
  10103. }
  10104. else if (class9_1.interfaceType == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 100) {
  10105. int boxWidth = 0;
  10106. int boxHeight = 0;
  10107. RSFont textDrawingArea_2 = aTextDrawingArea_1271;
  10108. for (String s1 = class9_1.disabledMessage; s1.length() > 0;) {
  10109. int l7 = s1.indexOf("\\n");
  10110. String s4;
  10111. if (l7 != -1) {
  10112. s4 = s1.substring(0, l7);
  10113. s1 = s1.substring(l7 + 2);
  10114. } else {
  10115. s4 = s1;
  10116. s1 = "";
  10117. }
  10118. int j10 = textDrawingArea_2.getTextWidth(s4);
  10119. if (j10 > boxWidth) {
  10120. boxWidth = j10;
  10121. }
  10122. boxHeight += textDrawingArea_2.anInt1497 + 1;
  10123. }
  10124. boxWidth += 6;
  10125. boxHeight += 7;
  10126. int xPos = (l2 + class9_1.width) - 5 - boxWidth;
  10127. int yPos = k2 + class9_1.height + 5;
  10128. if (xPos < l2 + 5) {
  10129. xPos = l2 + 5;
  10130. }
  10131. if (xPos + boxWidth > j + class9.width) {
  10132. xPos = (j + class9.width) - boxWidth;
  10133. }
  10134. if (yPos + boxHeight > k + class9.height) {
  10135. yPos = (k + class9.height) - boxHeight;
  10136. }
  10137. DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  10138. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  10139. String s2 = class9_1.disabledMessage;
  10140. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
  10141. int l11 = s2.indexOf("\\n");
  10142. String s5;
  10143. if (l11 != -1) {
  10144. s5 = s2.substring(0, l11);
  10145. s2 = s2.substring(l11 + 2);
  10146. } else {
  10147. s5 = s2;
  10148. s2 = "";
  10149. }
  10150. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  10151. }
  10152. } else if (class9_1.interfaceType == 9) {
  10153. drawHoverBox(k2, l2, class9_1.disabledMessage);
  10154. }
  10155. }
  10156. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10157. }
  10158.  
  10159. private void randomizeBackground(Background background) {
  10160. int j = 256;
  10161. for(int k = 0; k < anIntArray1190.length; k++)
  10162. anIntArray1190[k] = 0;
  10163.  
  10164. for(int l = 0; l < 5000; l++) {
  10165. int i1 = (int)(Math.random() * 128D * (double)j);
  10166. anIntArray1190[i1] = (int)(Math.random() * 256D);
  10167. }
  10168. for(int j1 = 0; j1 < 20; j1++) {
  10169. for(int k1 = 1; k1 < j - 1; k1++) {
  10170. for(int i2 = 1; i2 < 127; i2++) {
  10171. int k2 = i2 + (k1 << 7);
  10172. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10173. }
  10174.  
  10175. }
  10176. int ai[] = anIntArray1190;
  10177. anIntArray1190 = anIntArray1191;
  10178. anIntArray1191 = ai;
  10179. }
  10180. if(background != null) {
  10181. int l1 = 0;
  10182. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  10183. for(int l2 = 0; l2 < background.anInt1452; l2++)
  10184. if(background.aByteArray1450[l1++] != 0) {
  10185. int i3 = l2 + 16 + background.anInt1454;
  10186. int j3 = j2 + 16 + background.anInt1455;
  10187. int k3 = i3 + (j3 << 7);
  10188. anIntArray1190[k3] = 0;
  10189. }
  10190. }
  10191. }
  10192. }
  10193.  
  10194. private void method107(int i, int j, Stream stream, Player player)
  10195. {
  10196. if((i & 0x400) != 0)
  10197. {
  10198. player.anInt1543 = stream.method428();
  10199. player.anInt1545 = stream.method428();
  10200. player.anInt1544 = stream.method428();
  10201. player.anInt1546 = stream.method428();
  10202. player.anInt1547 = stream.method436() + loopCycle;
  10203. player.anInt1548 = stream.method435() + loopCycle;
  10204. player.anInt1549 = stream.method428();
  10205. player.method446();
  10206. }
  10207. if((i & 0x100) != 0)
  10208. {
  10209. player.anInt1520 = stream.method434();
  10210. int k = stream.readDWord();
  10211. player.anInt1524 = k >> 16;
  10212. player.anInt1523 = loopCycle + (k & 0xffff);
  10213. player.anInt1521 = 0;
  10214. player.anInt1522 = 0;
  10215. if(player.anInt1523 > loopCycle)
  10216. player.anInt1521 = -1;
  10217. if(player.anInt1520 == 65535)
  10218. player.anInt1520 = -1;
  10219. }
  10220. if((i & 8) != 0)
  10221. {
  10222. int l = stream.method434();
  10223. if(l == 65535)
  10224. l = -1;
  10225. int i2 = stream.method427();
  10226. if(l == player.anim && l != -1)
  10227. {
  10228. int i3 = Animation.anims[l].anInt365;
  10229. if(i3 == 1)
  10230. {
  10231. player.anInt1527 = 0;
  10232. player.anInt1528 = 0;
  10233. player.anInt1529 = i2;
  10234. player.anInt1530 = 0;
  10235. }
  10236. if(i3 == 2)
  10237. player.anInt1530 = 0;
  10238. } else
  10239. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  10240. {
  10241. player.anim = l;
  10242. player.anInt1527 = 0;
  10243. player.anInt1528 = 0;
  10244. player.anInt1529 = i2;
  10245. player.anInt1530 = 0;
  10246. player.anInt1542 = player.smallXYIndex;
  10247. }
  10248. }
  10249. if((i & 4) != 0)
  10250. {
  10251. player.textSpoken = stream.readString();
  10252. if(player.textSpoken.charAt(0) == '~')
  10253. {
  10254. player.textSpoken = player.textSpoken.substring(1);
  10255. pushMessage(player.textSpoken, 2, player.name);
  10256. } else
  10257. if(player == myPlayer)
  10258. pushMessage(player.textSpoken, 2, player.name);
  10259. player.anInt1513 = 0;
  10260. player.anInt1531 = 0;
  10261. player.textCycle = 150;
  10262. }
  10263. if((i & 0x80) != 0)
  10264. {
  10265. //right fucking here
  10266. int i1 = stream.method434();
  10267. int j2 = stream.readUnsignedByte();
  10268. int j3 = stream.method427();
  10269. int k3 = stream.currentOffset;
  10270. if(player.name != null && player.visible)
  10271. {
  10272. long l3 = TextClass.longForName(player.name);
  10273. boolean flag = false;
  10274. if(j2 <= 1)
  10275. {
  10276. for(int i4 = 0; i4 < ignoreCount; i4++)
  10277. {
  10278. if(ignoreListAsLongs[i4] != l3)
  10279. continue;
  10280. flag = true;
  10281. break;
  10282. }
  10283.  
  10284. }
  10285. if(!flag && anInt1251 == 0)
  10286. try
  10287. {
  10288. aStream_834.currentOffset = 0;
  10289. stream.method442(j3, 0, aStream_834.buffer);
  10290. aStream_834.currentOffset = 0;
  10291. String s = TextInput.method525(j3, aStream_834);
  10292. //s = Censor.doCensor(s);
  10293. player.textSpoken = s;
  10294. player.anInt1513 = i1 >> 8;
  10295. player.privelage = j2;
  10296. player.anInt1531 = i1 & 0xff;
  10297. player.textCycle = 150;
  10298. //Other players see your icon
  10299. if(j2 == 4)
  10300. pushMessage(s, 1, "@cr0@" + player.name);
  10301. else if(j2 == 3)
  10302. pushMessage(s, 1, "@cr2@" + player.name);
  10303. else if(j2 == 2)
  10304. pushMessage(s, 1, "@cr2@" + player.name);
  10305. else if (j2 == 1)
  10306. pushMessage(s, 1, "@cr1@" + player.name);
  10307. else
  10308. pushMessage(s, 2, player.name);
  10309. }
  10310. catch(Exception exception)
  10311. {
  10312. signlink.reporterror("cde2");
  10313. }
  10314. }
  10315. stream.currentOffset = k3 + j3;
  10316. }
  10317. if((i & 1) != 0)
  10318. {
  10319. player.interactingEntity = stream.method434();
  10320. if(player.interactingEntity == 65535)
  10321. player.interactingEntity = -1;
  10322. }
  10323. if((i & 0x10) != 0)
  10324. {
  10325. int j1 = stream.method427();
  10326. byte abyte0[] = new byte[j1];
  10327. Stream stream_1 = new Stream(abyte0);
  10328. stream.readBytes(j1, 0, abyte0);
  10329. aStreamArray895s[j] = stream_1;
  10330. player.updatePlayer(stream_1);
  10331. }
  10332. if((i & 2) != 0)
  10333. {
  10334. player.anInt1538 = stream.method436();
  10335. player.anInt1539 = stream.method434();
  10336. }
  10337. if((i & 0x20) != 0)
  10338. {
  10339. int k1 = stream.readUnsignedByte();
  10340. int k2 = stream.method426();
  10341. player.updateHitData(k2, k1, loopCycle);
  10342. player.loopCycleStatus = loopCycle + 300;
  10343. player.currentHealth = stream.method427();
  10344. player.maxHealth = stream.readUnsignedByte();
  10345. }
  10346. if((i & 0x200) != 0)
  10347. {
  10348. int l1 = stream.readUnsignedByte();
  10349. int l2 = stream.method428();
  10350. player.updateHitData(l2, l1, loopCycle);
  10351. player.loopCycleStatus = loopCycle + 300;
  10352. player.currentHealth = stream.readUnsignedByte();
  10353. player.maxHealth = stream.method427();
  10354. }
  10355. }
  10356.  
  10357. private void method108()
  10358. {
  10359. try
  10360. {
  10361. int j = myPlayer.x + anInt1278;
  10362. int k = myPlayer.y + anInt1131;
  10363. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  10364. {
  10365. anInt1014 = j;
  10366. anInt1015 = k;
  10367. }
  10368. if(anInt1014 != j)
  10369. anInt1014 += (j - anInt1014) / 16;
  10370. if(anInt1015 != k)
  10371. anInt1015 += (k - anInt1015) / 16;
  10372. if(super.keyArray[1] == 1)
  10373. anInt1186 += (-24 - anInt1186) / 2;
  10374. else
  10375. if(super.keyArray[2] == 1)
  10376. anInt1186 += (24 - anInt1186) / 2;
  10377. else
  10378. anInt1186 /= 2;
  10379. if(super.keyArray[3] == 1)
  10380. anInt1187 += (12 - anInt1187) / 2;
  10381. else
  10382. if(super.keyArray[4] == 1)
  10383. anInt1187 += (-12 - anInt1187) / 2;
  10384. else
  10385. anInt1187 /= 2;
  10386. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  10387. anInt1184 += anInt1187 / 2;
  10388. if(anInt1184 < 128)
  10389. anInt1184 = 128;
  10390. if(anInt1184 > 383)
  10391. anInt1184 = 383;
  10392. int l = anInt1014 >> 7;
  10393. int i1 = anInt1015 >> 7;
  10394. int j1 = method42(plane, anInt1015, anInt1014);
  10395. int k1 = 0;
  10396. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  10397. {
  10398. for(int l1 = l - 4; l1 <= l + 4; l1++)
  10399. {
  10400. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  10401. {
  10402. int l2 = plane;
  10403. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10404. l2++;
  10405. int i3 = j1 - intGroundArray[l2][l1][k2];
  10406. if(i3 > k1)
  10407. k1 = i3;
  10408. }
  10409.  
  10410. }
  10411.  
  10412. }
  10413. anInt1005++;
  10414. if(anInt1005 > 1512)
  10415. {
  10416. anInt1005 = 0;
  10417. stream.createFrame(77);
  10418. stream.writeWordBigEndian(0);
  10419. int i2 = stream.currentOffset;
  10420. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10421. stream.writeWordBigEndian(101);
  10422. stream.writeWordBigEndian(233);
  10423. stream.writeWord(45092);
  10424. if((int)(Math.random() * 2D) == 0)
  10425. stream.writeWord(35784);
  10426. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10427. stream.writeWordBigEndian(64);
  10428. stream.writeWordBigEndian(38);
  10429. stream.writeWord((int)(Math.random() * 65536D));
  10430. stream.writeWord((int)(Math.random() * 65536D));
  10431. stream.writeBytes(stream.currentOffset - i2);
  10432. }
  10433. int j2 = k1 * 192;
  10434. if(j2 > 0x17f00)
  10435. j2 = 0x17f00;
  10436. if(j2 < 32768)
  10437. j2 = 32768;
  10438. if(j2 > anInt984)
  10439. {
  10440. anInt984 += (j2 - anInt984) / 24;
  10441. return;
  10442. }
  10443. if(j2 < anInt984)
  10444. {
  10445. anInt984 += (j2 - anInt984) / 80;
  10446. }
  10447. }
  10448. catch(Exception _ex)
  10449. {
  10450. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  10451. throw new RuntimeException("eek");
  10452. }
  10453. }
  10454.  
  10455. public void processDrawing()
  10456. {
  10457. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  10458. {
  10459. showErrorScreen();
  10460. return;
  10461. }
  10462. anInt1061++;
  10463. if(!loggedIn) {
  10464. drawLoginScreen(false);
  10465. }else{
  10466. drawGameScreen();
  10467. }
  10468. anInt1213 = 0;
  10469. }
  10470.  
  10471. private boolean isFriendOrSelf(String s)
  10472. {
  10473. if(s == null)
  10474. return false;
  10475. for(int i = 0; i < friendsCount; i++)
  10476. if(s.equalsIgnoreCase(friendsList[i]))
  10477. return true;
  10478. return s.equalsIgnoreCase(myPlayer.name);
  10479. }
  10480.  
  10481. private static String combatDiffColor(int i, int j)
  10482. {
  10483. int k = i - j;
  10484. if(k < -9)
  10485. return "@red@";
  10486. if(k < -6)
  10487. return "@or3@";
  10488. if(k < -3)
  10489. return "@or2@";
  10490. if(k < 0)
  10491. return "@or1@";
  10492. if(k > 9)
  10493. return "@gre@";
  10494. if(k > 6)
  10495. return "@gr3@";
  10496. if(k > 3)
  10497. return "@gr2@";
  10498. if(k > 0)
  10499. return "@gr1@";
  10500. else
  10501. return "@yel@";
  10502. }
  10503.  
  10504. private void setWaveVolume(int i)
  10505. {
  10506. signlink.wavevol = i;
  10507. }
  10508.  
  10509. private void draw3dScreen()
  10510. {
  10511. alertHandler.processAlerts();
  10512. drawSplitPrivateChat();
  10513. if(crossType == 1)
  10514. {
  10515. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10516. anInt1142++;
  10517. if(anInt1142 > 67)
  10518. {
  10519. anInt1142 = 0;
  10520. stream.createFrame(78);
  10521. }
  10522. }
  10523. if(crossType == 2)
  10524. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10525. if(anInt1018 != -1)
  10526. {
  10527. method119(anInt945, anInt1018);
  10528. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  10529. }
  10530. if(openInterfaceID != -1)
  10531. {
  10532. method119(anInt945, openInterfaceID);
  10533. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  10534. }
  10535. method70();
  10536. if(!menuOpen)
  10537. {
  10538. processRightClick();
  10539. drawTooltip();
  10540. } else
  10541. drawMenu(4, 4);
  10542. if(anInt1055 == 1)
  10543. multiOverlay.drawSprite(472, 296);
  10544. if(fpsOn)
  10545. {
  10546. char c = '\u01FB';
  10547. int k = 20;
  10548. int i1 = 0xffff00;
  10549. if(super.fps < 15)
  10550. i1 = 0xff0000;
  10551. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  10552. k += 15;
  10553. Runtime runtime = Runtime.getRuntime();
  10554. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10555. i1 = 0xffff00;
  10556. if(j1 > 0x2000000 && lowMem)
  10557. i1 = 0xff0000;
  10558. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10559. k += 15;
  10560. }
  10561. int i1 = 0xffff00;
  10562. int x = baseX + (myPlayer.x - 6 >> 7);
  10563. int y = baseY + (myPlayer.y - 6 >> 7);
  10564. if (clientData)
  10565. {
  10566. char c = '\u01FB';
  10567. int k = 20;
  10568. if(super.fps < 15)
  10569. i1 = 0xff0000;
  10570. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  10571. Runtime runtime = Runtime.getRuntime();
  10572. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10573. i1 = 0xffff00;
  10574. if(j1 > 0x2000000 && lowMem)
  10575. i1 = 0xff0000;
  10576. k += 15;
  10577. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  10578. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  10579. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  10580. }
  10581. if(anInt1104 != 0)
  10582. {
  10583. int j = anInt1104 / 50;
  10584. int l = j / 60;
  10585. j %= 60;
  10586. if(j < 10)
  10587. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  10588. else
  10589. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  10590. anInt849++;
  10591. if(anInt849 > 75)
  10592. {
  10593. anInt849 = 0;
  10594. stream.createFrame(148);
  10595. }
  10596. }
  10597. }
  10598.  
  10599. private void addIgnore(long l)
  10600. {
  10601. try
  10602. {
  10603. if(l == 0L)
  10604. return;
  10605. if(ignoreCount >= 100)
  10606. {
  10607. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10608. return;
  10609. }
  10610. String s = TextClass.fixName(TextClass.nameForLong(l));
  10611. for(int j = 0; j < ignoreCount; j++)
  10612. if(ignoreListAsLongs[j] == l)
  10613. {
  10614. pushMessage(s + " is already on your ignore list", 0, "");
  10615. return;
  10616. }
  10617. for(int k = 0; k < friendsCount; k++)
  10618. if(friendsListAsLongs[k] == l)
  10619. {
  10620. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  10621. return;
  10622. }
  10623.  
  10624. ignoreListAsLongs[ignoreCount++] = l;
  10625. needDrawTabArea = true;
  10626. stream.createFrame(133);
  10627. stream.writeQWord(l);
  10628. return;
  10629. }
  10630. catch(RuntimeException runtimeexception)
  10631. {
  10632. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  10633. }
  10634. throw new RuntimeException();
  10635. }
  10636.  
  10637. private void method114()
  10638. {
  10639. for(int i = -1; i < playerCount; i++)
  10640. {
  10641. int j;
  10642. if(i == -1)
  10643. j = myPlayerIndex;
  10644. else
  10645. j = playerIndices[i];
  10646. Player player = playerArray[j];
  10647. if(player != null)
  10648. method96(player);
  10649. }
  10650.  
  10651. }
  10652.  
  10653. private void method115()
  10654. {
  10655. if(loadingStage == 2)
  10656. {
  10657. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10658. {
  10659. if(class30_sub1.anInt1294 > 0)
  10660. class30_sub1.anInt1294--;
  10661. if(class30_sub1.anInt1294 == 0)
  10662. {
  10663. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  10664. {
  10665. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  10666. class30_sub1.unlink();
  10667. }
  10668. } else
  10669. {
  10670. if(class30_sub1.anInt1302 > 0)
  10671. class30_sub1.anInt1302--;
  10672. if(class30_sub1.anInt1302 == 0 && class30_sub1.anInt1297 >= 1 && class30_sub1.anInt1298 >= 1 && class30_sub1.anInt1297 <= 102 && class30_sub1.anInt1298 <= 102 && (class30_sub1.anInt1291 < 0 || ObjectManager.method178(class30_sub1.anInt1291, class30_sub1.anInt1293)))
  10673. {
  10674. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  10675. class30_sub1.anInt1302 = -1;
  10676. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  10677. class30_sub1.unlink();
  10678. else
  10679. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10680. class30_sub1.unlink();
  10681. }
  10682. }
  10683. }
  10684.  
  10685. }
  10686. }
  10687.  
  10688.  
  10689. private void determineMenuSize() {
  10690. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10691. for(int j = 0; j < menuActionRow; j++)
  10692. {
  10693. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10694. if(k > i)
  10695. i = k;
  10696. }
  10697. i += 8;
  10698. int l = 15 * menuActionRow + 21;
  10699. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < 765 && super.saveClickY < 503) {
  10700. int i1 = super.saveClickX - i / 2;
  10701. if(i1 + i > 765){
  10702. i1 = 765 - i;
  10703. }
  10704. if(i1 < 0){
  10705. i1 = 0;
  10706. }
  10707. int l1 = super.saveClickY - 0;
  10708. if(l1 + l > 503){
  10709. l1 = 503 - l;
  10710. }
  10711. if(l1 < 0){
  10712. l1 = 0;
  10713. }
  10714. menuOpen = true;
  10715. menuOffsetX = i1;
  10716. menuOffsetY = l1;
  10717. menuWidth = i;
  10718. menuHeight = 15 * menuActionRow + 22;
  10719. }
  10720. }
  10721.  
  10722. private void method117(Stream stream)
  10723. {
  10724. stream.initBitAccess();
  10725. int j = stream.readBits(1);
  10726. if(j == 0)
  10727. return;
  10728. int k = stream.readBits(2);
  10729. if(k == 0)
  10730. {
  10731. anIntArray894[anInt893++] = myPlayerIndex;
  10732. return;
  10733. }
  10734. if(k == 1)
  10735. {
  10736. int l = stream.readBits(3);
  10737. myPlayer.moveInDir(false, l);
  10738. int k1 = stream.readBits(1);
  10739. if(k1 == 1)
  10740. anIntArray894[anInt893++] = myPlayerIndex;
  10741. return;
  10742. }
  10743. if(k == 2)
  10744. {
  10745. int i1 = stream.readBits(3);
  10746. myPlayer.moveInDir(true, i1);
  10747. int l1 = stream.readBits(3);
  10748. myPlayer.moveInDir(true, l1);
  10749. int j2 = stream.readBits(1);
  10750. if(j2 == 1)
  10751. anIntArray894[anInt893++] = myPlayerIndex;
  10752. return;
  10753. }
  10754. if(k == 3)
  10755. {
  10756. plane = stream.readBits(2);
  10757. int j1 = stream.readBits(1);
  10758. int i2 = stream.readBits(1);
  10759. if(i2 == 1)
  10760. anIntArray894[anInt893++] = myPlayerIndex;
  10761. int k2 = stream.readBits(7);
  10762. int l2 = stream.readBits(7);
  10763. myPlayer.setPos(l2, k2, j1 == 1);
  10764. }
  10765. }
  10766.  
  10767. private void nullLoader()
  10768. {
  10769. aBoolean831 = false;
  10770. while(drawingFlames)
  10771. {
  10772. aBoolean831 = false;
  10773. try
  10774. {
  10775. Thread.sleep(50L);
  10776. }
  10777. catch(Exception _ex) { }
  10778. }
  10779. titleBox = null;
  10780. titleBox1 = null;
  10781. titleButton = null;
  10782. aBackgroundArray1152s = null;
  10783. anIntArray850 = null;
  10784. anIntArray851 = null;
  10785. anIntArray852 = null;
  10786. anIntArray853 = null;
  10787. anIntArray1190 = null;
  10788. anIntArray1191 = null;
  10789. anIntArray828 = null;
  10790. anIntArray829 = null;
  10791. aSprite_1201 = null;
  10792. aSprite_1202 = null;
  10793. }
  10794.  
  10795. private boolean method119(int i, int j)
  10796. {
  10797. boolean flag1 = false;
  10798. RSInterface class9 = RSInterface.interfaceCache[j];
  10799. for(int k = 0; k < class9.children.length; k++)
  10800. {
  10801. if(class9.children[k] == -1)
  10802. break;
  10803. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10804. if(class9_1.interfaceType == 1)
  10805. flag1 |= method119(i, class9_1.id);
  10806. if(class9_1.interfaceType == 6 && (class9_1.disabledAnimation != -1 || class9_1.enabledAnimation != -1))
  10807. {
  10808. boolean flag2 = interfaceIsSelected(class9_1);
  10809. int l;
  10810. if(flag2)
  10811. l = class9_1.enabledAnimation;
  10812. else
  10813. l = class9_1.disabledAnimation;
  10814. if(l != -1)
  10815. {
  10816. Animation animation = Animation.anims[l];
  10817. for(class9_1.animationDelay += i; class9_1.animationDelay > animation.method258(class9_1.animationLength);)
  10818. {
  10819. class9_1.animationDelay -= animation.method258(class9_1.animationLength) + 1;
  10820. class9_1.animationLength++;
  10821. if(class9_1.animationLength >= animation.anInt352)
  10822. {
  10823. class9_1.animationLength -= animation.anInt356;
  10824. if(class9_1.animationLength < 0 || class9_1.animationLength >= animation.anInt352)
  10825. class9_1.animationLength = 0;
  10826. }
  10827. flag1 = true;
  10828. }
  10829.  
  10830. }
  10831. }
  10832. }
  10833.  
  10834. return flag1;
  10835. }
  10836.  
  10837. private int method120()
  10838. {
  10839. int j = 3;
  10840. if(yCameraCurve < 310)
  10841. {
  10842. int k = xCameraPos >> 7;
  10843. int l = yCameraPos >> 7;
  10844. int i1 = myPlayer.x >> 7;
  10845. int j1 = myPlayer.y >> 7;
  10846. if((byteGroundArray[plane][k][l] & 4) != 0)
  10847. j = plane;
  10848. int k1;
  10849. if(i1 > k)
  10850. k1 = i1 - k;
  10851. else
  10852. k1 = k - i1;
  10853. int l1;
  10854. if(j1 > l)
  10855. l1 = j1 - l;
  10856. else
  10857. l1 = l - j1;
  10858. if(k1 > l1)
  10859. {
  10860. int i2 = (l1 * 0x10000) / k1;
  10861. int k2 = 32768;
  10862. while(k != i1)
  10863. {
  10864. if(k < i1)
  10865. k++;
  10866. else
  10867. if(k > i1)
  10868. k--;
  10869. if((byteGroundArray[plane][k][l] & 4) != 0)
  10870. j = plane;
  10871. k2 += i2;
  10872. if(k2 >= 0x10000)
  10873. {
  10874. k2 -= 0x10000;
  10875. if(l < j1)
  10876. l++;
  10877. else
  10878. if(l > j1)
  10879. l--;
  10880. if((byteGroundArray[plane][k][l] & 4) != 0)
  10881. j = plane;
  10882. }
  10883. }
  10884. } else
  10885. {
  10886. int j2 = (k1 * 0x10000) / l1;
  10887. int l2 = 32768;
  10888. while(l != j1)
  10889. {
  10890. if(l < j1)
  10891. l++;
  10892. else
  10893. if(l > j1)
  10894. l--;
  10895. if((byteGroundArray[plane][k][l] & 4) != 0)
  10896. j = plane;
  10897. l2 += j2;
  10898. if(l2 >= 0x10000)
  10899. {
  10900. l2 -= 0x10000;
  10901. if(k < i1)
  10902. k++;
  10903. else
  10904. if(k > i1)
  10905. k--;
  10906. if((byteGroundArray[plane][k][l] & 4) != 0)
  10907. j = plane;
  10908. }
  10909. }
  10910. }
  10911. }
  10912. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10913. j = plane;
  10914. return j;
  10915. }
  10916.  
  10917. private int method121()
  10918. {
  10919. int j = method42(plane, yCameraPos, xCameraPos);
  10920. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10921. return plane;
  10922. else
  10923. return 3;
  10924. }
  10925.  
  10926. private void delIgnore(long l)
  10927. {
  10928. try
  10929. {
  10930. if(l == 0L)
  10931. return;
  10932. for(int j = 0; j < ignoreCount; j++)
  10933. if(ignoreListAsLongs[j] == l)
  10934. {
  10935. ignoreCount--;
  10936. needDrawTabArea = true;
  10937. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10938.  
  10939. stream.createFrame(74);
  10940. stream.writeQWord(l);
  10941. return;
  10942. }
  10943.  
  10944. return;
  10945. }
  10946. catch(RuntimeException runtimeexception)
  10947. {
  10948. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10949. }
  10950. throw new RuntimeException();
  10951. }
  10952.  
  10953.  
  10954. private void chatJoin(long l) {
  10955. try {
  10956. if(l == 0L)
  10957. return;
  10958. stream.createFrame(60);
  10959. stream.writeQWord(l);
  10960. return;
  10961. }
  10962. catch(RuntimeException runtimeexception)
  10963. {
  10964. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10965. }
  10966. throw new RuntimeException();
  10967.  
  10968. }
  10969.  
  10970. public String getParameter(String s)
  10971. {
  10972. if(signlink.mainapp != null)
  10973. return signlink.mainapp.getParameter(s);
  10974. else
  10975. return super.getParameter(s);
  10976. }
  10977.  
  10978. private void adjustVolume(boolean flag, int i)
  10979. {
  10980. signlink.midivol = i;
  10981. if(flag)
  10982. signlink.midi = "voladjust";
  10983. }
  10984.  
  10985. private int extractInterfaceValues(RSInterface class9, int j)
  10986. {
  10987. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10988. return -2;
  10989. try
  10990. {
  10991. int ai[] = class9.valueIndexArray[j];
  10992. int k = 0;
  10993. int l = 0;
  10994. int i1 = 0;
  10995. do
  10996. {
  10997. int j1 = ai[l++];
  10998. int k1 = 0;
  10999. byte byte0 = 0;
  11000. if(j1 == 0)
  11001. return k;
  11002. if(j1 == 1)
  11003. k1 = currentStats[ai[l++]];
  11004. if(j1 == 2)
  11005. k1 = maxStats[ai[l++]];
  11006. if(j1 == 3)
  11007. k1 = currentExp[ai[l++]];
  11008. if(j1 == 4)
  11009. {
  11010. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  11011. int k2 = ai[l++];
  11012. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  11013. {
  11014. for(int j3 = 0; j3 < class9_1.inventory.length; j3++)
  11015. if(class9_1.inventory[j3] == k2 + 1)
  11016. k1 += class9_1.inventoryValue[j3];
  11017.  
  11018. }
  11019. }
  11020. if(j1 == 5)
  11021. k1 = variousSettings[ai[l++]];
  11022. if(j1 == 6)
  11023. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  11024. if(j1 == 7)
  11025. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11026. if(j1 == 8)
  11027. k1 = myPlayer.combatLevel;
  11028. if(j1 == 9)
  11029. {
  11030. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  11031. if(Skills.skillEnabled[l1])
  11032. k1 += maxStats[l1];
  11033.  
  11034. }
  11035. if(j1 == 10)
  11036. {
  11037. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11038. int l2 = ai[l++] + 1;
  11039. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  11040. {
  11041. for(int k3 = 0; k3 < class9_2.inventory.length; k3++)
  11042. {
  11043. if(class9_2.inventory[k3] != l2)
  11044. continue;
  11045. k1 = 0x3b9ac9ff;
  11046. break;
  11047. }
  11048.  
  11049. }
  11050. }
  11051. if(j1 == 11)
  11052. k1 = energy;
  11053. if(j1 == 12)
  11054. k1 = weight;
  11055. if(j1 == 13)
  11056. {
  11057. int i2 = variousSettings[ai[l++]];
  11058. int i3 = ai[l++];
  11059. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11060. }
  11061. if(j1 == 14)
  11062. {
  11063. int j2 = ai[l++];
  11064. VarBit varBit = VarBit.cache[j2];
  11065. int l3 = varBit.anInt648;
  11066. int i4 = varBit.anInt649;
  11067. int j4 = varBit.anInt650;
  11068. int k4 = anIntArray1232[j4 - i4];
  11069. k1 = variousSettings[l3] >> i4 & k4;
  11070. }
  11071. if(j1 == 15)
  11072. byte0 = 1;
  11073. if(j1 == 16)
  11074. byte0 = 2;
  11075. if(j1 == 17)
  11076. byte0 = 3;
  11077. if(j1 == 18)
  11078. k1 = (myPlayer.x >> 7) + baseX;
  11079. if(j1 == 19)
  11080. k1 = (myPlayer.y >> 7) + baseY;
  11081. if(j1 == 20)
  11082. k1 = ai[l++];
  11083. if(byte0 == 0)
  11084. {
  11085. if(i1 == 0)
  11086. k += k1;
  11087. if(i1 == 1)
  11088. k -= k1;
  11089. if(i1 == 2 && k1 != 0)
  11090. k /= k1;
  11091. if(i1 == 3)
  11092. k *= k1;
  11093. i1 = 0;
  11094. } else
  11095. {
  11096. i1 = byte0;
  11097. }
  11098. } while(true);
  11099. }
  11100. catch(Exception _ex)
  11101. {
  11102. return -1;
  11103. }
  11104. }
  11105.  
  11106. private void drawTooltip() {
  11107. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11108. return;
  11109. String s;
  11110. if(itemSelected == 1 && menuActionRow < 2)
  11111. s = "Use " + selectedItemName + " with...";
  11112. else if(spellSelected == 1 && menuActionRow < 2)
  11113. s = spellTooltip + "...";
  11114. else
  11115. s = menuActionName[menuActionRow - 1];
  11116. if(menuActionRow > 2)
  11117. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11118. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11119. }
  11120.  
  11121. private void drawMinimap() {
  11122. int compassX, compassY, MapY, MapX;
  11123. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11124. compassX = 11;
  11125. compassY = 8;
  11126. MapY = 9;
  11127. MapX = 38;
  11128. } else if(is474) {
  11129. compassX = 30;
  11130. compassY = 4;
  11131. MapY = 9;
  11132. MapX = 50;
  11133. } else {
  11134. compassX = 30+5;
  11135. compassY = 4;
  11136. MapY = 9;
  11137. MapX = 50+6;
  11138. }
  11139. mapBackImage.initDrawingArea();
  11140. if (anInt1021 == 2) {
  11141. Black[getSpriteID()].drawSprite(0, 0);
  11142. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11143. loadOrbs();
  11144. }
  11145. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, compassY, compassX-1, 33, 25);
  11146. if(menuOpen){
  11147. drawMenu(516, 0);
  11148. }
  11149. inGameScreen.initDrawingArea();
  11150. return;
  11151. }
  11152. int i = minimapInt1 + minimapInt2 & 0x7ff;
  11153. int j = 48 + myPlayer.x / 32;
  11154. int l2 = 464 - myPlayer.y / 32;
  11155.  
  11156. for(int j1 = 0; j1 < anIntArray1229.length; j1++){
  11157. anIntArray1229[j1] = 172;
  11158. anIntArray1052[j1] = -22;
  11159. }
  11160. aSprite_1263.method352(152, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, MapY, MapX, 146, j);
  11161. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, compassY, compassX-1, 33, 25);
  11162.  
  11163. for(int j5 = 0; j5 < anInt1071; j5++) {
  11164. try {
  11165. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11166. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11167. markMinimap(aSpriteArray1140[j5], k, i3, false);
  11168. } catch(Exception exception) {
  11169. }
  11170. }
  11171.  
  11172. for(int k5 = 0; k5 < 104; k5++) {
  11173. for(int l5 = 0; l5 < 104; l5++) {
  11174. NodeList class19 = groundArray[plane][k5][l5];
  11175. if(class19 != null) {
  11176. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11177. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11178. markMinimap(mapDotItem, l, j3, false);
  11179. }
  11180. }
  11181. }
  11182.  
  11183. for(int i6 = 0; i6 < npcCount; i6++) {
  11184. NPC npc = npcArray[npcIndices[i6]];
  11185. if(npc != null && npc.isVisible()) {
  11186. EntityDef entityDef = npc.desc;
  11187. if(entityDef.childrenIDs != null)
  11188. entityDef = entityDef.method161();
  11189. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  11190. int i1 = npc.x / 32 - myPlayer.x / 32;
  11191. int k3 = npc.y / 32 - myPlayer.y / 32;
  11192. markMinimap(mapDotNPC, i1, k3, false);
  11193. }
  11194. }
  11195. }
  11196. for(int j6 = 0; j6 < playerCount; j6++) {
  11197. Player player = playerArray[playerIndices[j6]];
  11198. if(player != null && player.isVisible()) {
  11199. int j1 = player.x / 32 - myPlayer.x / 32;
  11200. int l3 = player.y / 32 - myPlayer.y / 32;
  11201. boolean flag1 = false;
  11202. boolean flag3 = false;
  11203. for (int j3 = 0; j3 < clanList.length; j3++) {
  11204. if (clanList[j3] == null)
  11205. continue;
  11206. if (!clanList[j3].equalsIgnoreCase(player.name))
  11207. continue;
  11208. flag3 = true;
  11209. break;
  11210. }
  11211. long l6 = TextClass.longForName(player.name);
  11212. for(int k6 = 0; k6 < friendsCount; k6++) {
  11213. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  11214. continue;
  11215. flag1 = true;
  11216. break;
  11217. }
  11218. boolean flag2 = false;
  11219. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  11220. flag2 = true;
  11221. if(flag1)
  11222. markMinimap(mapDotFriend, j1, l3, false);
  11223. else if(flag3)
  11224. markMinimap(mapDotClan, j1, l3, false);
  11225. else if(flag2)
  11226. markMinimap(mapDotTeam, j1, l3, false);
  11227. else
  11228. markMinimap(mapDotPlayer, j1, l3, false);
  11229. }
  11230. }
  11231. if(anInt855 != 0 && loopCycle % 20 < 10) {
  11232. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  11233. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11234. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  11235. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  11236. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  11237. method81(mapMarker, i4, k1);
  11238. }
  11239. }
  11240. if(anInt855 == 2) {
  11241. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11242. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11243. method81(mapMarker, j4, l1);
  11244. }
  11245. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  11246. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11247. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  11248. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  11249. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  11250. method81(mapMarker, k4, i2);
  11251. }
  11252. }
  11253. }
  11254. if(destX != 0) {
  11255. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11256. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11257. markMinimap(mapFlag, j2, l4, false);
  11258. }
  11259. CustomMapback[getSpriteID()].drawSprite(0, 0);
  11260. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11261. loadOrbs();
  11262. DrawingArea.drawPixels(3, 84, 108, 0xffffff, 3);
  11263. } else {
  11264. DrawingArea.drawPixels(3, 84, 124, 0xffffff, 3);
  11265. }
  11266. if(menuOpen)
  11267. drawMenu(516, 0);
  11268. inGameScreen.initDrawingArea();
  11269. }
  11270.  
  11271. private void npcScreenPos(Entity entity, int i) {
  11272. calcEntityScreenPos(entity.x, i, entity.y);
  11273. }
  11274.  
  11275. private void calcEntityScreenPos(int i, int j, int l) {
  11276. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  11277. spriteDrawX = -1;
  11278. spriteDrawY = -1;
  11279. return;
  11280. }
  11281. int i1 = method42(plane, l, i) - j;
  11282. i -= xCameraPos;
  11283. i1 -= zCameraPos;
  11284. l -= yCameraPos;
  11285. int j1 = Model.modelIntArray1[yCameraCurve];
  11286. int k1 = Model.modelIntArray2[yCameraCurve];
  11287. int l1 = Model.modelIntArray1[xCameraCurve];
  11288. int i2 = Model.modelIntArray2[xCameraCurve];
  11289. int j2 = l * l1 + i * i2 >> 16;
  11290. l = l * i2 - i * l1 >> 16;
  11291. i = j2;
  11292. j2 = i1 * k1 - l * j1 >> 16;
  11293. l = i1 * j1 + l * k1 >> 16;
  11294. i1 = j2;
  11295. if(l >= 50) {
  11296. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  11297. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  11298. } else {
  11299. spriteDrawX = -1;
  11300. spriteDrawY = -1;
  11301. }
  11302. }
  11303.  
  11304. private void buildSplitPrivateChatMenu()
  11305. {
  11306. if(splitPrivateChat == 0)
  11307. return;
  11308. int i = 0;
  11309. if(anInt1104 != 0)
  11310. i = 1;
  11311. for(int j = 0; j < 100; j++)
  11312. if(chatMessages[j] != null)
  11313. {
  11314. int k = chatTypes[j];
  11315. String s = chatNames[j];
  11316. boolean flag1 = false;
  11317. if(s != null && s.startsWith("@cr0@")) {
  11318. s = s.substring(5);
  11319. byte byte0 = 1;
  11320. }
  11321. if(s != null && s.startsWith("@cr1@")) {
  11322. s = s.substring(5);
  11323. boolean flag2 = true;
  11324. byte byte0 = 2;
  11325. }
  11326. if(s != null && s.startsWith("@cr2@")) {
  11327. s = s.substring(5);
  11328. byte byte0 = 3;
  11329. }
  11330. if(s != null && s.startsWith("@cr3@")) {
  11331. s = s.substring(5);
  11332. byte byte0 = 4;
  11333. }
  11334. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  11335. {
  11336. int l = 329 - i * 13;
  11337. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11338. {
  11339. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11340. if(i1 > 450)
  11341. i1 = 450;
  11342. if(super.mouseX < 4 + i1)
  11343. {
  11344. if(myPrivilege >= 1)
  11345. {
  11346. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11347. menuActionID[menuActionRow] = 2606;
  11348. menuActionRow++;
  11349. }
  11350. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  11351. menuActionID[menuActionRow] = 2042;
  11352. menuActionRow++;
  11353. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  11354. menuActionID[menuActionRow] = 2337;
  11355. menuActionRow++;
  11356. }
  11357. }
  11358. if(++i >= 5)
  11359. return;
  11360. }
  11361. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11362. return;
  11363. }
  11364.  
  11365. }
  11366.  
  11367. private void method130(int j, int k, int l, int i1, int j1, int k1,
  11368. int l1, int i2, int j2)
  11369. {
  11370. Class30_Sub1 class30_sub1 = null;
  11371. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11372. {
  11373. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  11374. continue;
  11375. class30_sub1 = class30_sub1_1;
  11376. break;
  11377. }
  11378.  
  11379. if(class30_sub1 == null)
  11380. {
  11381. class30_sub1 = new Class30_Sub1();
  11382. class30_sub1.anInt1295 = l1;
  11383. class30_sub1.anInt1296 = i1;
  11384. class30_sub1.anInt1297 = i2;
  11385. class30_sub1.anInt1298 = j1;
  11386. method89(class30_sub1);
  11387. aClass19_1179.insertHead(class30_sub1);
  11388. }
  11389. class30_sub1.anInt1291 = k;
  11390. class30_sub1.anInt1293 = k1;
  11391. class30_sub1.anInt1292 = l;
  11392. class30_sub1.anInt1302 = j2;
  11393. class30_sub1.anInt1294 = j;
  11394. }
  11395.  
  11396. private boolean interfaceIsSelected(RSInterface class9)
  11397. {
  11398. if(class9.valueCompareType == null)
  11399. return false;
  11400. for(int i = 0; i < class9.valueCompareType.length; i++)
  11401. {
  11402. int j = extractInterfaceValues(class9, i);
  11403. int k = class9.requiredValues[i];
  11404. if(class9.valueCompareType[i] == 2)
  11405. {
  11406. if(j >= k)
  11407. return false;
  11408. } else
  11409. if(class9.valueCompareType[i] == 3)
  11410. {
  11411. if(j <= k)
  11412. return false;
  11413. } else
  11414. if(class9.valueCompareType[i] == 4)
  11415. {
  11416. if(j == k)
  11417. return false;
  11418. } else
  11419. if(j != k)
  11420. return false;
  11421. }
  11422.  
  11423. return true;
  11424. }
  11425.  
  11426. private DataInputStream openJagGrabInputStream(String s)
  11427. throws IOException
  11428. {
  11429. // if(!aBoolean872)
  11430. // if(signlink.mainapp != null)
  11431. // return signlink.openurl(s);
  11432. // else
  11433. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11434. if(aSocket832 != null)
  11435. {
  11436. try
  11437. {
  11438. aSocket832.close();
  11439. System.out.println("Here5");
  11440. }
  11441. catch(Exception _ex) { }
  11442. aSocket832 = null;
  11443. }
  11444. aSocket832 = openSocket(43594);//43594
  11445. aSocket832.setSoTimeout(10000);
  11446. java.io.InputStream inputstream = aSocket832.getInputStream();
  11447. OutputStream outputstream = aSocket832.getOutputStream();
  11448. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11449. return new DataInputStream(inputstream);
  11450. }
  11451.  
  11452. private void doFlamesDrawing()
  11453. {
  11454. char c = '\u0100';
  11455. if(anInt1040 > 0)
  11456. {
  11457. for(int i = 0; i < 256; i++)
  11458. if(anInt1040 > 768)
  11459. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  11460. else
  11461. if(anInt1040 > 256)
  11462. anIntArray850[i] = anIntArray852[i];
  11463. else
  11464. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  11465.  
  11466. } else
  11467. if(anInt1041 > 0)
  11468. {
  11469. for(int j = 0; j < 256; j++)
  11470. if(anInt1041 > 768)
  11471. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  11472. else
  11473. if(anInt1041 > 256)
  11474. anIntArray850[j] = anIntArray853[j];
  11475. else
  11476. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  11477.  
  11478. } else
  11479. {
  11480. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11481.  
  11482. }
  11483. System.arraycopy(aSprite_1201.myPixels, 0, leftSideFlame.anIntArray315, 0, 33920);
  11484.  
  11485. int i1 = 0;
  11486. int j1 = 1152;
  11487. for(int k1 = 1; k1 < c - 1; k1++)
  11488. {
  11489. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11490. int j2 = 22 + l1;
  11491. if(j2 < 0)
  11492. j2 = 0;
  11493. i1 += j2;
  11494. for(int l2 = j2; l2 < 128; l2++)
  11495. {
  11496. int j3 = anIntArray828[i1++];
  11497. if(j3 != 0)
  11498. {
  11499. int l3 = j3;
  11500. int j4 = 256 - j3;
  11501. j3 = anIntArray850[j3];
  11502. int l4 = leftSideFlame.anIntArray315[j1];
  11503. leftSideFlame.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11504. } else
  11505. {
  11506. j1++;
  11507. }
  11508. }
  11509.  
  11510. j1 += j2;
  11511. }
  11512.  
  11513. leftSideFlame.drawGraphics(0, super.graphics, 0);
  11514. System.arraycopy(aSprite_1202.myPixels, 0, rightSideFlame.anIntArray315, 0, 33920);
  11515.  
  11516. i1 = 0;
  11517. j1 = 1176;
  11518. for(int k2 = 1; k2 < c - 1; k2++)
  11519. {
  11520. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11521. int k3 = 103 - i3;
  11522. j1 += i3;
  11523. for(int i4 = 0; i4 < k3; i4++)
  11524. {
  11525. int k4 = anIntArray828[i1++];
  11526. if(k4 != 0)
  11527. {
  11528. int i5 = k4;
  11529. int j5 = 256 - k4;
  11530. k4 = anIntArray850[k4];
  11531. int k5 = rightSideFlame.anIntArray315[j1];
  11532. rightSideFlame.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11533. } else
  11534. {
  11535. j1++;
  11536. }
  11537. }
  11538.  
  11539. i1 += 128 - k3;
  11540. j1 += 128 - k3 - i3;
  11541. }
  11542.  
  11543. rightSideFlame.drawGraphics(0, super.graphics, 637);
  11544. }
  11545.  
  11546. private void method134(Stream stream)
  11547. {
  11548. int j = stream.readBits(8);
  11549. if(j < playerCount)
  11550. {
  11551. for(int k = j; k < playerCount; k++)
  11552. anIntArray840[anInt839++] = playerIndices[k];
  11553.  
  11554. }
  11555. if(j > playerCount)
  11556. {
  11557. signlink.reporterror(myUsername + " Too many players");
  11558. throw new RuntimeException("eek");
  11559. }
  11560. playerCount = 0;
  11561. for(int l = 0; l < j; l++)
  11562. {
  11563. int i1 = playerIndices[l];
  11564. Player player = playerArray[i1];
  11565. int j1 = stream.readBits(1);
  11566. if(j1 == 0)
  11567. {
  11568. playerIndices[playerCount++] = i1;
  11569. player.anInt1537 = loopCycle;
  11570. } else
  11571. {
  11572. int k1 = stream.readBits(2);
  11573. if(k1 == 0)
  11574. {
  11575. playerIndices[playerCount++] = i1;
  11576. player.anInt1537 = loopCycle;
  11577. anIntArray894[anInt893++] = i1;
  11578. } else
  11579. if(k1 == 1)
  11580. {
  11581. playerIndices[playerCount++] = i1;
  11582. player.anInt1537 = loopCycle;
  11583. int l1 = stream.readBits(3);
  11584. player.moveInDir(false, l1);
  11585. int j2 = stream.readBits(1);
  11586. if(j2 == 1)
  11587. anIntArray894[anInt893++] = i1;
  11588. } else
  11589. if(k1 == 2)
  11590. {
  11591. playerIndices[playerCount++] = i1;
  11592. player.anInt1537 = loopCycle;
  11593. int i2 = stream.readBits(3);
  11594. player.moveInDir(true, i2);
  11595. int k2 = stream.readBits(3);
  11596. player.moveInDir(true, k2);
  11597. int l2 = stream.readBits(1);
  11598. if(l2 == 1)
  11599. anIntArray894[anInt893++] = i1;
  11600. } else
  11601. if(k1 == 3)
  11602. anIntArray840[anInt839++] = i1;
  11603. }
  11604. }
  11605. }
  11606.  
  11607. private void drawLoginScreen(boolean flag) {
  11608. if (normalLogin == true) {
  11609. resetImageProducers();
  11610. loginScreenArea.initDrawingArea();
  11611. titleBox.drawBackground(0, 0);
  11612. char c = '\u0168';
  11613. char c1 = '\310';
  11614. if(loginScreenState == 0) {
  11615. int i = c1 / 2 + 80;
  11616. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  11617. i = c1 / 2 - 20;
  11618. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to ProjectPk", i, true);
  11619. i += 30;
  11620. int l = c / 2 - 80;
  11621. int k1 = c1 / 2 + 20;
  11622. titleButton.drawBackground(l - 73, k1 - 20);
  11623. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  11624. l = c / 2 + 80;
  11625. titleButton.drawBackground(l - 73, k1 - 20);
  11626. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  11627. }
  11628. if(loginScreenState == 2) {
  11629. int j = c1 / 2 - 40;
  11630. if(loginMessage1.length() > 0) {
  11631. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  11632. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  11633. j += 30;
  11634. } else {
  11635. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  11636. j += 30;
  11637. }
  11638. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + capitalize(myUsername) + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11639. j += 15;
  11640. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11641. j += 15;
  11642. if(!flag) {
  11643. int i1 = c / 2 - 80;
  11644. int l1 = c1 / 2 + 50;
  11645. titleButton.drawBackground(i1 - 73, l1 - 20);
  11646. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  11647. i1 = c / 2 + 80;
  11648. titleButton.drawBackground(i1 - 73, l1 - 20);
  11649. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  11650. }
  11651. }
  11652. if(loginScreenState == 3) {
  11653. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  11654. int k = c1 / 2 - 35;
  11655. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  11656. k += 15;
  11657. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the previous screen", k, true);
  11658. k += 15;
  11659. chatTextDrawingArea.method382(0xffffff, c / 2, "and click 'Existing User'.", k, true);
  11660. k += 15;
  11661. chatTextDrawingArea.method382(0xffffff, c / 2, "Loging in from there will register you.", k, true);
  11662. k += 15;
  11663. int j1 = c / 2;
  11664. int i2 = c1 / 2 + 50;
  11665. titleButton.drawBackground(j1 - 73, i2 - 20);
  11666. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  11667. }
  11668. loginScreenArea.drawGraphics(171, super.graphics, 202);
  11669. if(welcomeScreenRaised) {
  11670. welcomeScreenRaised = false;
  11671. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  11672. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  11673. gameLogo.drawGraphics(265, super.graphics, 0);
  11674. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  11675. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  11676. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  11677. }
  11678. } else if(normalLogin == false) {
  11679. resetImageProducers();
  11680. loginScreenArea.initDrawingArea();
  11681. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  11682. Sprite loginArea = new Sprite(abyte0, this);
  11683. loginArea.drawSprite(0, 0);
  11684.  
  11685. if(loginScreenState == 0) {
  11686. titleBox1.drawSprite(237-204, 138+25);
  11687. addLoginScreenHover(LOGIN, 8, 287-204, 182+25, 9);
  11688. if (super.saveClickX >= 361-204 && super.saveClickX <= 361-204+34 && super.saveClickY >= 360+15 && super.saveClickY <= 360+15+15) {
  11689. }
  11690. Sprite scrollLine = new Sprite("Login/Random/LINE");
  11691. scrollLine.drawSprite(297-204, 277+25);
  11692. scrollLine.drawSprite(297-204, 356+25);
  11693. smallText.method382(0xffffff, 332-204, "Standard Detail", 351+25, false);
  11694. smallText.method382(0xffffff, 428-204, "High Detail", 351+25, false);
  11695. if (super.saveClickX >= 306-204 && super.saveClickX <= 362-204 && super.saveClickY >= 303+25 && super.saveClickY <= 336+25) {
  11696. isClicked = 0;
  11697. }
  11698. if(super.saveClickX >= 402-204 && super.saveClickX <= 458-204 && super.saveClickY >= 302+25 && super.saveClickY <= 336+25) {
  11699. isClicked = 1;
  11700. }
  11701. if(isClicked != 0){
  11702. LOGIN[26].drawSprite(401-204, 303+25);
  11703. addLoginScreenHover(LOGIN, 25, 305-204, 303+25, 20);
  11704. LOGIN[22].drawSprite(446-204, 326+25);
  11705. } else if(isClicked == 0) {
  11706. LOGIN[20].drawSprite(305-204, 303+25);
  11707. addLoginScreenHover(LOGIN, 21, 401-204, 303+25, 27);
  11708. LOGIN[22].drawSprite(350-204, 326+25);
  11709. }
  11710. loginScreenArea.drawGraphics(0, super.graphics, 0);
  11711. }
  11712. if(loginScreenState == 1) {
  11713. titleBox1.drawSprite(237-204, 138+25);
  11714. LOGIN[0].drawSprite(333-204, 182+25);
  11715. LOGIN[1].drawSprite(344-204, 253+32);
  11716. LOGIN[2].drawSprite(346-204, 308+40);
  11717. LOGIN[5].drawSprite(290-204, 267+25);
  11718. LOGIN[5].drawSprite(290-204, 329+25);
  11719. addLoginScreenHover(LOGIN, 3, 358-204, 380+25, 4);
  11720. addLoginScreenHover(LOGIN, 6, 338-204, 415+25, 7);
  11721. smallText.method382(0xffffff, 380-204, "World 1", 212+25, false);
  11722. smallText.method382(0xffe1be, 380-204, myUsername, 238+25, false);
  11723. smallText.method382(0xffe1bef, 380-204, myPassword, 237+25, false);
  11724. chatTextDrawingArea.method389(true, 311-204, 0x461e00, capitalize(myUsername) + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "|" : ""), 288+25);
  11725. chatTextDrawingArea.method389(true, 311-204, 0x461e00, TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "|" : ""), 349+25);
  11726. loginScreenArea.drawGraphics(0, super.graphics, 0);
  11727. }
  11728. }
  11729. }
  11730.  
  11731. private void drawFlames()
  11732. {
  11733. if(normalLogin == true) {
  11734. try
  11735. {
  11736. long l = System.currentTimeMillis();
  11737. int i = 0;
  11738. int j = 20;
  11739. while(aBoolean831)
  11740. {
  11741. anInt1208++;
  11742. if(normalLogin == true) {
  11743. //calcFlamesPosition();
  11744. //calcFlamesPosition();
  11745. }
  11746. doFlamesDrawing();
  11747. if(++i > 10)
  11748. {
  11749. long l1 = System.currentTimeMillis();
  11750. int k = (int)(l1 - l) / 10 - j;
  11751. j = 40 - k;
  11752. if(j < 5)
  11753. j = 5;
  11754. i = 0;
  11755. l = l1;
  11756. }
  11757. try
  11758. {
  11759. Thread.sleep(j);
  11760. }
  11761. catch(Exception _ex) { }
  11762. }
  11763. } catch(Exception _ex) { }
  11764. drawingFlames = false;
  11765. } else if(normalLogin == false) {
  11766.  
  11767. }
  11768. }
  11769.  
  11770. public void raiseWelcomeScreen()
  11771. {
  11772. welcomeScreenRaised = true;
  11773. }
  11774.  
  11775. private void method137(Stream stream, int j)
  11776. {
  11777. if(j == 84)
  11778. {
  11779. int k = stream.readUnsignedByte();
  11780. int j3 = anInt1268 + (k >> 4 & 7);
  11781. int i6 = anInt1269 + (k & 7);
  11782. int l8 = stream.readUnsignedWord();
  11783. int k11 = stream.readUnsignedWord();
  11784. int l13 = stream.readUnsignedWord();
  11785. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  11786. {
  11787. NodeList class19_1 = groundArray[plane][j3][i6];
  11788. if(class19_1 != null)
  11789. {
  11790. for(Item class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetNext())
  11791. {
  11792. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11793. continue;
  11794. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11795. break;
  11796. }
  11797.  
  11798. spawnGroundItem(j3, i6);
  11799. }
  11800. }
  11801. return;
  11802. }
  11803. if(j == 105)
  11804. {
  11805. int l = stream.readUnsignedByte();
  11806. int k3 = anInt1268 + (l >> 4 & 7);
  11807. int j6 = anInt1269 + (l & 7);
  11808. int i9 = stream.readUnsignedWord();
  11809. int l11 = stream.readUnsignedByte();
  11810. int i14 = l11 >> 4 & 0xf;
  11811. int i16 = l11 & 7;
  11812. if(myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14 && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem && anInt1062 < 50)
  11813. {
  11814. anIntArray1207[anInt1062] = i9;
  11815. anIntArray1241[anInt1062] = i16;
  11816. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11817. anInt1062++;
  11818. }
  11819. }
  11820. if(j == 215)
  11821. {
  11822. int i1 = stream.method435();
  11823. int l3 = stream.method428();
  11824. int k6 = anInt1268 + (l3 >> 4 & 7);
  11825. int j9 = anInt1269 + (l3 & 7);
  11826. int i12 = stream.method435();
  11827. int j14 = stream.readUnsignedWord();
  11828. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  11829. {
  11830. Item class30_sub2_sub4_sub2_2 = new Item();
  11831. class30_sub2_sub4_sub2_2.ID = i1;
  11832. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11833. if(groundArray[plane][k6][j9] == null)
  11834. groundArray[plane][k6][j9] = new NodeList();
  11835. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11836. spawnGroundItem(k6, j9);
  11837. }
  11838. return;
  11839. }
  11840. if(j == 156)
  11841. {
  11842. int j1 = stream.method426();
  11843. int i4 = anInt1268 + (j1 >> 4 & 7);
  11844. int l6 = anInt1269 + (j1 & 7);
  11845. int k9 = stream.readUnsignedWord();
  11846. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  11847. {
  11848. NodeList class19 = groundArray[plane][i4][l6];
  11849. if(class19 != null)
  11850. {
  11851. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  11852. {
  11853. if(item.ID != (k9 & 0x7fff))
  11854. continue;
  11855. item.unlink();
  11856. break;
  11857. }
  11858.  
  11859. if(class19.reverseGetFirst() == null)
  11860. groundArray[plane][i4][l6] = null;
  11861. spawnGroundItem(i4, l6);
  11862. }
  11863. }
  11864. return;
  11865. }
  11866. if(j == 160)
  11867. {
  11868. int k1 = stream.method428();
  11869. int j4 = anInt1268 + (k1 >> 4 & 7);
  11870. int i7 = anInt1269 + (k1 & 7);
  11871. int l9 = stream.method428();
  11872. int j12 = l9 >> 2;
  11873. int k14 = l9 & 3;
  11874. int j16 = anIntArray1177[j12];
  11875. int j17 = stream.method435();
  11876. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  11877. {
  11878. int j18 = intGroundArray[plane][j4][i7];
  11879. int i19 = intGroundArray[plane][j4 + 1][i7];
  11880. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11881. int k20 = intGroundArray[plane][j4][i7 + 1];
  11882. if(j16 == 0)
  11883. {
  11884. Object1 class10 = worldController.method296(plane, j4, i7);
  11885. if(class10 != null)
  11886. {
  11887. int k21 = class10.uid >> 14 & 0x7fff;
  11888. if(j12 == 2)
  11889. {
  11890. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11891. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11892. } else
  11893. {
  11894. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11895. }
  11896. }
  11897. }
  11898. if(j16 == 1)
  11899. {
  11900. Object2 class26 = worldController.method297(j4, i7, plane);
  11901. if(class26 != null)
  11902. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11903. }
  11904. if(j16 == 2)
  11905. {
  11906. Object5 class28 = worldController.method298(j4, i7, plane);
  11907. if(j12 == 11)
  11908. j12 = 10;
  11909. if(class28 != null)
  11910. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11911. }
  11912. if(j16 == 3)
  11913. {
  11914. Object3 class49 = worldController.method299(i7, j4, plane);
  11915. if(class49 != null)
  11916. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11917. }
  11918. }
  11919. return;
  11920. }
  11921. if(j == 147)
  11922. {
  11923. int l1 = stream.method428();
  11924. int k4 = anInt1268 + (l1 >> 4 & 7);
  11925. int j7 = anInt1269 + (l1 & 7);
  11926. int i10 = stream.readUnsignedWord();
  11927. byte byte0 = stream.method430();
  11928. int l14 = stream.method434();
  11929. byte byte1 = stream.method429();
  11930. int k17 = stream.readUnsignedWord();
  11931. int k18 = stream.method428();
  11932. int j19 = k18 >> 2;
  11933. int i20 = k18 & 3;
  11934. int l20 = anIntArray1177[j19];
  11935. byte byte2 = stream.readSignedByte();
  11936. int l21 = stream.readUnsignedWord();
  11937. byte byte3 = stream.method429();
  11938. Player player;
  11939. if(i10 == unknownInt10)
  11940. player = myPlayer;
  11941. else
  11942. player = playerArray[i10];
  11943. if(player != null)
  11944. {
  11945. ObjectDef class46 = ObjectDef.forID(l21);
  11946. int i22 = intGroundArray[plane][k4][j7];
  11947. int j22 = intGroundArray[plane][k4 + 1][j7];
  11948. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11949. int l22 = intGroundArray[plane][k4][j7 + 1];
  11950. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11951. if(model != null)
  11952. {
  11953. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11954. player.anInt1707 = l14 + loopCycle;
  11955. player.anInt1708 = k17 + loopCycle;
  11956. player.aModel_1714 = model;
  11957. int i23 = class46.anInt744;
  11958. int j23 = class46.anInt761;
  11959. if(i20 == 1 || i20 == 3)
  11960. {
  11961. i23 = class46.anInt761;
  11962. j23 = class46.anInt744;
  11963. }
  11964. player.anInt1711 = k4 * 128 + i23 * 64;
  11965. player.anInt1713 = j7 * 128 + j23 * 64;
  11966. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11967. if(byte2 > byte0)
  11968. {
  11969. byte byte4 = byte2;
  11970. byte2 = byte0;
  11971. byte0 = byte4;
  11972. }
  11973. if(byte3 > byte1)
  11974. {
  11975. byte byte5 = byte3;
  11976. byte3 = byte1;
  11977. byte1 = byte5;
  11978. }
  11979. player.anInt1719 = k4 + byte2;
  11980. player.anInt1721 = k4 + byte0;
  11981. player.anInt1720 = j7 + byte3;
  11982. player.anInt1722 = j7 + byte1;
  11983. }
  11984. }
  11985. }
  11986. if(j == 151)
  11987. {
  11988. int i2 = stream.method426();
  11989. int l4 = anInt1268 + (i2 >> 4 & 7);
  11990. int k7 = anInt1269 + (i2 & 7);
  11991. int j10 = stream.method434();
  11992. int k12 = stream.method428();
  11993. int i15 = k12 >> 2;
  11994. int k16 = k12 & 3;
  11995. int l17 = anIntArray1177[i15];
  11996. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11997. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11998. return;
  11999. }
  12000. if(j == 4)
  12001. {
  12002. int j2 = stream.readUnsignedByte();
  12003. int i5 = anInt1268 + (j2 >> 4 & 7);
  12004. int l7 = anInt1269 + (j2 & 7);
  12005. int k10 = stream.readUnsignedWord();
  12006. int l12 = stream.readUnsignedByte();
  12007. int j15 = stream.readUnsignedWord();
  12008. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  12009. {
  12010. i5 = i5 * 128 + 64;
  12011. l7 = l7 * 128 + 64;
  12012. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  12013. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  12014. }
  12015. return;
  12016. }
  12017. if(j == 44)
  12018. {
  12019. int k2 = stream.method436();
  12020. int j5 = stream.readUnsignedWord();
  12021. int i8 = stream.readUnsignedByte();
  12022. int l10 = anInt1268 + (i8 >> 4 & 7);
  12023. int i13 = anInt1269 + (i8 & 7);
  12024. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  12025. {
  12026. Item class30_sub2_sub4_sub2_1 = new Item();
  12027. class30_sub2_sub4_sub2_1.ID = k2;
  12028. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  12029. if(groundArray[plane][l10][i13] == null)
  12030. groundArray[plane][l10][i13] = new NodeList();
  12031. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  12032. spawnGroundItem(l10, i13);
  12033. }
  12034. return;
  12035. }
  12036. if(j == 101)
  12037. {
  12038. int l2 = stream.method427();
  12039. int k5 = l2 >> 2;
  12040. int j8 = l2 & 3;
  12041. int i11 = anIntArray1177[k5];
  12042. int j13 = stream.readUnsignedByte();
  12043. int k15 = anInt1268 + (j13 >> 4 & 7);
  12044. int l16 = anInt1269 + (j13 & 7);
  12045. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  12046. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  12047. return;
  12048. }
  12049. if(j == 117)
  12050. {
  12051. int i3 = stream.readUnsignedByte();
  12052. int l5 = anInt1268 + (i3 >> 4 & 7);
  12053. int k8 = anInt1269 + (i3 & 7);
  12054. int j11 = l5 + stream.readSignedByte();
  12055. int k13 = k8 + stream.readSignedByte();
  12056. int l15 = stream.readSignedWord();
  12057. int i17 = stream.readUnsignedWord();
  12058. int i18 = stream.readUnsignedByte() * 4;
  12059. int l18 = stream.readUnsignedByte() * 4;
  12060. int k19 = stream.readUnsignedWord();
  12061. int j20 = stream.readUnsignedWord();
  12062. int i21 = stream.readUnsignedByte();
  12063. int j21 = stream.readUnsignedByte();
  12064. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  12065. {
  12066. l5 = l5 * 128 + 64;
  12067. k8 = k8 * 128 + 64;
  12068. j11 = j11 * 128 + 64;
  12069. k13 = k13 * 128 + 64;
  12070. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21, l18, k19 + loopCycle, j20 + loopCycle, j21, plane, method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  12071. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  12072. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  12073. }
  12074. }
  12075. }
  12076.  
  12077. private static void setLowMem()
  12078. {
  12079. WorldController.lowMem = true;
  12080. Texture.lowMem = true;
  12081. lowMem = true;
  12082. ObjectManager.lowMem = true;
  12083. ObjectDef.lowMem = true;
  12084. }
  12085.  
  12086. private void method139(Stream stream)
  12087. {
  12088. stream.initBitAccess();
  12089. int k = stream.readBits(8);
  12090. if(k < npcCount)
  12091. {
  12092. for(int l = k; l < npcCount; l++)
  12093. anIntArray840[anInt839++] = npcIndices[l];
  12094.  
  12095. }
  12096. if(k > npcCount)
  12097. {
  12098. signlink.reporterror(myUsername + " Too many npcs");
  12099. throw new RuntimeException("eek");
  12100. }
  12101. npcCount = 0;
  12102. for(int i1 = 0; i1 < k; i1++)
  12103. {
  12104. int j1 = npcIndices[i1];
  12105. NPC npc = npcArray[j1];
  12106. int k1 = stream.readBits(1);
  12107. if(k1 == 0)
  12108. {
  12109. npcIndices[npcCount++] = j1;
  12110. npc.anInt1537 = loopCycle;
  12111. } else
  12112. {
  12113. int l1 = stream.readBits(2);
  12114. if(l1 == 0)
  12115. {
  12116. npcIndices[npcCount++] = j1;
  12117. npc.anInt1537 = loopCycle;
  12118. anIntArray894[anInt893++] = j1;
  12119. } else
  12120. if(l1 == 1)
  12121. {
  12122. npcIndices[npcCount++] = j1;
  12123. npc.anInt1537 = loopCycle;
  12124. int i2 = stream.readBits(3);
  12125. npc.moveInDir(false, i2);
  12126. int k2 = stream.readBits(1);
  12127. if(k2 == 1)
  12128. anIntArray894[anInt893++] = j1;
  12129. } else
  12130. if(l1 == 2)
  12131. {
  12132. npcIndices[npcCount++] = j1;
  12133. npc.anInt1537 = loopCycle;
  12134. int j2 = stream.readBits(3);
  12135. npc.moveInDir(true, j2);
  12136. int l2 = stream.readBits(3);
  12137. npc.moveInDir(true, l2);
  12138. int i3 = stream.readBits(1);
  12139. if(i3 == 1)
  12140. anIntArray894[anInt893++] = j1;
  12141. } else
  12142. if(l1 == 3)
  12143. anIntArray840[anInt839++] = j1;
  12144. }
  12145. }
  12146.  
  12147. }
  12148.  
  12149. private void processLoginScreenInput() {
  12150. //if(normalLogin == true) {
  12151. if(loginScreenState == 0) {
  12152. int i = super.myWidth / 2 - 80;
  12153. int l = super.myHeight / 2 + 20;
  12154. l += 20;
  12155. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  12156. loginScreenState = 3;
  12157. loginScreenCursorPos = 0;
  12158. }
  12159. i = super.myWidth / 2 + 80;
  12160. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  12161. loginMessage1 = "";
  12162. loginMessage2 = "Enter your username & password.";
  12163. loginScreenState = 2;
  12164. loginScreenCursorPos = 0;
  12165. }
  12166. } else {
  12167. if(loginScreenState == 2) {
  12168. int j = super.myHeight / 2 - 40;
  12169. j += 30;
  12170. j += 25;
  12171. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  12172. loginScreenCursorPos = 0;
  12173. j += 15;
  12174. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  12175. loginScreenCursorPos = 1;
  12176. j += 15;
  12177. int i1 = super.myWidth / 2 - 80;
  12178. int k1 = super.myHeight / 2 + 50;
  12179. k1 += 20;
  12180. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  12181. loginFailures = 0;
  12182. login(capitalize(myUsername), myPassword, false);
  12183. if(loggedIn)
  12184. return;
  12185. }
  12186. i1 = super.myWidth / 2 + 80;
  12187. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  12188. loginScreenState = 0;
  12189. myUsername = "";
  12190. myPassword = "";
  12191. }
  12192. do {
  12193. int l1 = readChar(-796);
  12194. if(l1 == -1)
  12195. break;
  12196. boolean flag1 = false;
  12197. for(int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  12198. if(l1 != validUserPassChars.charAt(i2))
  12199. continue;
  12200. flag1 = true;
  12201. break;
  12202. } if(loginScreenCursorPos == 0) {
  12203. if(l1 == 8 && myUsername.length() > 0)
  12204. myUsername = myUsername.substring(0, myUsername.length() - 1);
  12205. if(l1 == 9 || l1 == 10 || l1 == 13)
  12206. loginScreenCursorPos = 1;
  12207. if(flag1)
  12208. myUsername += (char)l1;
  12209. if(myUsername.length() > 12)
  12210. myUsername = capitalize(myUsername.substring(0, 12));
  12211. } else if(loginScreenCursorPos == 1) {
  12212. if(l1 == 8 && myPassword.length() > 0)
  12213. myPassword = myPassword.substring(0, myPassword.length() - 1);
  12214. if(l1 == 9 || l1 == 10 || l1 == 13)
  12215. loginScreenCursorPos = 0;
  12216. if(flag1)
  12217. myPassword += (char)l1;
  12218. if(myPassword.length() > 20)
  12219. myPassword = myPassword.substring(0, 20);
  12220. }
  12221. } while(true);
  12222. return;
  12223. }
  12224. if(loginScreenState == 3) {
  12225. int k = super.myWidth / 2;
  12226. int j1 = super.myHeight / 2 + 50;
  12227. j1 += 20;
  12228. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  12229. loginScreenState = 0;
  12230. }
  12231. }
  12232. //} else if(normalLogin == false) {
  12233.  
  12234. /** Custom Login Screen areas and crap */
  12235. //}
  12236. }
  12237.  
  12238. private void markMinimap(Sprite sprite, int i, int j, boolean flag) {
  12239. int k = minimapInt1 + minimapInt2 & 0x7ff;
  12240. int l = i * i + j * j;
  12241. if(flag)
  12242. return;
  12243. if(l > 6400)
  12244. return;
  12245. int i1 = Model.modelIntArray1[k];
  12246. int j1 = Model.modelIntArray2[k];
  12247. i1 = (i1 * 256) / (minimapInt3 + 256);
  12248. j1 = (j1 * 256) / (minimapInt3 + 256);
  12249. int k1 = j * i1 + i * j1 >> 16;
  12250. int l1 = j * j1 - i * i1 >> 16;
  12251. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  12252. sprite.drawSprite(((106 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  12253. } else {
  12254. sprite.drawSprite(((122 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  12255. }
  12256. CustomMapback[getSpriteID()].drawSprite(0, 0);
  12257. }
  12258.  
  12259. public int flagPos = 72;
  12260. public int runState = 1;
  12261. public boolean logHover = false;
  12262. public boolean xpHover = false;
  12263. public boolean xpClicked = false;
  12264. public boolean drawXpBar = false;
  12265. public boolean drawFlag = false;
  12266. public int xpToDraw = 0;
  12267. public int testXp = 0;
  12268. public Sprite[] globe = new Sprite[3];
  12269. public Sprite[] ORBS = new Sprite[18];
  12270. public Sprite[] LOGOUT = new Sprite[5];
  12271. public Sprite xpOrb;
  12272. public Sprite sprite1;
  12273. public Sprite xpFlag;
  12274.  
  12275. public static boolean globeState[] = {
  12276. false, false
  12277. };
  12278. public void drawXpOrb() {
  12279. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY <= 80){
  12280. xpHover = true;
  12281. } else {
  12282. xpHover = false;
  12283. }
  12284. if(super.clickMode3 == 1 && super.saveClickX >= 516 && super.saveClickX <= 550 && super.saveClickY >= 46 && super.saveClickY <= 80) {
  12285. if(!xpClicked) {
  12286. xpClicked = true;
  12287. drawXpBar = true;
  12288. } else {
  12289. xpClicked = false;
  12290. drawXpBar = false;
  12291. }
  12292. }
  12293. if(!xpClicked) {
  12294. if(!xpHover) {
  12295. ORBS[17].drawSprite(0, 46);
  12296. } else {
  12297. ORBS[16].drawSprite(0, 46);
  12298. }
  12299. } else {
  12300. if(!xpHover) {
  12301. ORBS[17].drawSprite(0, 46);
  12302. } else {
  12303. ORBS[16].drawSprite(0, 46);
  12304. }
  12305. }
  12306. }
  12307. public void drawGlobe(){
  12308. if(is508 == true || is525 == true || is562 == true) {
  12309. if(super.clickMode3 == 1){
  12310. if(super.saveClickX >= 522 && super.saveClickX <= 558 && super.saveClickY >= 124 && super.saveClickY < 161){
  12311. if(globeState[0]){
  12312. globeState[0] = false;
  12313. } else {
  12314. globeState[0] = true;
  12315. }
  12316. }
  12317. }
  12318. if(super.mouseX >= 522 && super.mouseX <= 558 && super.mouseY >= 124 && super.mouseY < 161){
  12319. globeState[1] = true;
  12320. } else {
  12321. globeState[1] = false;
  12322. }
  12323. } else {
  12324. }
  12325. }
  12326.  
  12327. public void drawLogout(){
  12328. if(is508 || is525 || is562) {
  12329. if(!logHover){
  12330. LOGOUT[0].drawSprite(226, 1);
  12331. } else {
  12332. LOGOUT[1].drawSprite(226, 1);
  12333. }
  12334. if(super.clickMode2 == 1 && super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 1 && super.mouseY <= 25){
  12335. LOGOUT[2].drawSprite(226, 1);
  12336. }
  12337. } else if(is480) {
  12338. if(tabID == 14) {
  12339. LOGOUT[4].drawSprite(226, 1);
  12340. } if(tabID != 14) {
  12341. LOGOUT[3].drawSprite(226, 1);
  12342. }
  12343. }
  12344. }
  12345.  
  12346. public void loadOrbs() {
  12347. drawLogout();
  12348. drawHP();
  12349. if(is562){
  12350. drawXpOrb();
  12351. }
  12352. drawPrayer();
  12353. drawRunOrb();
  12354. if(is508 == true) {
  12355. globe[0].drawSprite(10, 123);
  12356. } else if(is525 == true || is562 == true) {
  12357. drawGlobe();
  12358. if (globeState[0] && globeState[1]) {
  12359. globe[2].drawSprite(10, 123);
  12360. } else if (globeState[1]) {
  12361. globe[2].drawSprite(10, 123);
  12362. } else if (globeState[0]) {
  12363. globe[1].drawSprite(10, 123);
  12364. } else {
  12365. globe[1].drawSprite(10, 123);
  12366. }
  12367. }
  12368. }
  12369. public Sprite[] Black = new Sprite[5];
  12370.  
  12371. public void loadExtraSprites(){
  12372. magicAuto = new Sprite("Misc/magicAuto");
  12373. sprite1 = new Sprite("Gameframe/sprite1");
  12374. xpFlag = new Sprite("Gameframe/xpFlag");
  12375. for(int i = 1; i <= 17; i++) {
  12376. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  12377. }
  12378. for(int i = 0; i <= 4;i++) {
  12379. LOGOUT[i] = new Sprite("Gameframe/Orbs/X "+i+"");
  12380. }
  12381. for (int j3 = 0; j3 <= 26; j3++) {
  12382. LOGIN[j3] = new Sprite("Login/Buttons/BUTTON "+j3+"");
  12383. }
  12384. for (int i = 0; i <= 2; i++) {
  12385. globe[i] = new Sprite("Gameframe/Globe "+i+"");
  12386. }
  12387. for(int i = 0; i <= 4; i++){
  12388. chatArea[i] = new Sprite("Gameframe/Gameframes/chatArea "+i+"");
  12389. }
  12390. for(int i = 0; i <= 4; i++){
  12391. tabArea[i] = new Sprite("Gameframe/Gameframes/tabArea "+i+"");
  12392. }
  12393. for(int i = 0; i <= 4; i++){
  12394. CustomMapback[i] = new Sprite("Gameframe/Gameframes/Mapback "+i+"");
  12395. }
  12396. for(int i = 0; i <= 6; i++){
  12397. modIcons[i] = new Sprite("Player/MODICONS "+i+"");
  12398. }
  12399. for(int i = 0; i <= 6; i++){
  12400. chatImages[i] = new Sprite("Player/MODICONS "+i+"");
  12401. }
  12402. for(int i = 0; i <= 4; i++){
  12403. Black[i] = new Sprite("Gameframe/Gameframes/Black "+i+"");
  12404. }
  12405. for(int i4 = 0; i4 < 3; i4++) {
  12406. hitMark[i4] = new Sprite("Player/Hits "+i4+"");
  12407. }
  12408. qc = new Sprite("Gameframe/Quickchat");
  12409. }
  12410.  
  12411. public boolean restOrb = false;
  12412. public boolean musicOrb = false;
  12413. public boolean prayClicked = false;
  12414. public boolean prayHover = false;
  12415. public boolean runClicked = true;
  12416. public boolean runHover = false;
  12417.  
  12418. private void rightClickChatButtons() {
  12419. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  12420. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12421. menuActionName[1] = "View All";
  12422. menuActionID[1] = 999;
  12423. menuActionRow = 2;
  12424. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  12425. menuActionName[1] = "View Game";
  12426. menuActionID[1] = 998;
  12427. menuActionRow = 2;
  12428. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  12429. menuActionName[1] = "Hide public";
  12430. menuActionID[1] = 997;
  12431. menuActionName[2] = "Off public";
  12432. menuActionID[2] = 996;
  12433. menuActionName[3] = "Friends public";
  12434. menuActionID[3] = 995;
  12435. menuActionName[4] = "On public";
  12436. menuActionID[4] = 994;
  12437. menuActionName[5] = "View public";
  12438. menuActionID[5] = 993;
  12439. menuActionRow = 6;
  12440. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  12441. menuActionName[1] = "Off private";
  12442. menuActionID[1] = 992;
  12443. menuActionName[2] = "Friends private";
  12444. menuActionID[2] = 991;
  12445. menuActionName[3] = "On private";
  12446. menuActionID[3] = 990;
  12447. menuActionName[4] = "View private";
  12448. menuActionID[4] = 989;
  12449. menuActionRow = 5;
  12450. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  12451. menuActionName[1] = "Off clan chat";
  12452. menuActionID[1] = 1003;
  12453. menuActionName[2] = "Friends clan chat";
  12454. menuActionID[2] = 1002;
  12455. menuActionName[3] = "On clan chat";
  12456. menuActionID[3] = 1001;
  12457. menuActionName[4] = "View clan chat";
  12458. menuActionID[4] = 1000;
  12459. menuActionRow = 5;
  12460. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  12461. menuActionName[1] = "Off trade";
  12462. menuActionID[1] = 987;
  12463. menuActionName[2] = "Friends trade";
  12464. menuActionID[2] = 986;
  12465. menuActionName[3] = "On trade";
  12466. menuActionID[3] = 985;
  12467. menuActionName[4] = "View trade";
  12468. menuActionID[4] = 984;
  12469. menuActionRow = 5;
  12470. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  12471. menuActionName[1] = "Off assist";
  12472. menuActionID[1] = -1;
  12473. menuActionName[2] = "Friends assist";
  12474. menuActionID[2] = -1;
  12475. menuActionName[3] = "On assist";
  12476. menuActionID[3] = -1;
  12477. menuActionName[4] = "View assist";
  12478. menuActionID[4] = -1;
  12479. menuActionRow = 5;
  12480. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  12481. menuActionName[1] = "Report Abuse";
  12482. menuActionID[1] = 606;
  12483. menuActionRow = 2;
  12484. }
  12485. } else if(is474) {
  12486. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12487. menuActionName[1] = "View All";
  12488. menuActionID[1] = 999;
  12489. menuActionRow = 2;
  12490. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  12491. menuActionName[1] = "View Game";
  12492. menuActionID[1] = 998;
  12493. menuActionRow = 2;
  12494. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  12495. menuActionName[1] = "Hide public";
  12496. menuActionID[1] = 997;
  12497. menuActionName[2] = "Off public";
  12498. menuActionID[2] = 996;
  12499. menuActionName[3] = "Friends public";
  12500. menuActionID[3] = 995;
  12501. menuActionName[4] = "On public";
  12502. menuActionID[4] = 994;
  12503. menuActionName[5] = "View public";
  12504. menuActionID[5] = 993;
  12505. menuActionRow = 6;
  12506. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  12507. menuActionName[1] = "Off private";
  12508. menuActionID[1] = 992;
  12509. menuActionName[2] = "Friends private";
  12510. menuActionID[2] = 991;
  12511. menuActionName[3] = "On private";
  12512. menuActionID[3] = 990;
  12513. menuActionName[4] = "View private";
  12514. menuActionID[4] = 989;
  12515. menuActionRow = 5;
  12516. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  12517. menuActionName[1] = "Off clan chat";
  12518. menuActionID[1] = 1003;
  12519. menuActionName[2] = "Friends clan chat";
  12520. menuActionID[2] = 1002;
  12521. menuActionName[3] = "On clan chat";
  12522. menuActionID[3] = 1001;
  12523. menuActionName[4] = "View clan chat";
  12524. menuActionID[4] = 1000;
  12525. menuActionRow = 5;
  12526. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  12527. menuActionName[1] = "Off trade";
  12528. menuActionID[1] = 987;
  12529. menuActionName[2] = "Friends trade";
  12530. menuActionID[2] = 986;
  12531. menuActionName[3] = "On trade";
  12532. menuActionID[3] = 985;
  12533. menuActionName[4] = "View trade";
  12534. menuActionID[4] = 984;
  12535. menuActionRow = 5;
  12536. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  12537. menuActionName[1] = "Report Abuse";
  12538. menuActionID[1] = 606;
  12539. menuActionRow = 2;
  12540. }
  12541. } else {
  12542.  
  12543. }
  12544.  
  12545. }
  12546.  
  12547. public void determineTopTabs(){
  12548. if(is474 || is480 || is508 || is525) {
  12549. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 168 && super.mouseY < 203) {
  12550. menuActionName[1] = "Combat Options";
  12551. menuActionID[1] = 1021;
  12552. menuActionRow = 2;
  12553. } else if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 168 && super.mouseY < 203) {
  12554. menuActionName[1] = "Stats";
  12555. menuActionID[1] = 1022;
  12556. menuActionRow = 2;
  12557. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 168 && super.mouseY < 203) {
  12558. menuActionName[1] = "Quest List";
  12559. menuActionID[1] = 1023;
  12560. menuActionRow = 2;
  12561. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 168 && super.mouseY < 203) {
  12562. menuActionName[1] = "Inventory";
  12563. menuActionID[1] = 1024;
  12564. menuActionRow = 2;
  12565. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 168 && super.mouseY < 203) {
  12566. menuActionName[1] = "Worn Equipment";
  12567. menuActionID[1] = 1030;
  12568. menuActionRow = 2;
  12569. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 168 && super.mouseY < 203) {
  12570. menuActionName[1] = "Prayer";
  12571. menuActionID[1] = 1026;
  12572. menuActionRow = 2;
  12573. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 168 && super.mouseY < 203) {
  12574. menuActionName[1] = "Magic";
  12575. menuActionID[1] = 1027;
  12576. menuActionRow = 2;
  12577. }
  12578. } else if(is562) {
  12579.  
  12580. }
  12581. }
  12582.  
  12583. public void determineBottomTabs(){
  12584. if(is480 || is508 || is525) {
  12585. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  12586. menuActionName[1] = "Logout";
  12587. menuActionID[1] = 1502;
  12588. menuActionRow = 2;
  12589. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  12590. menuActionName[1] = "Clan Chat";
  12591. menuActionID[1] = 1008;
  12592. menuActionRow = 2;
  12593. } else if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
  12594. menuActionName[1] = "Logout";
  12595. menuActionID[1] = 1011;
  12596. menuActionRow = 2;
  12597. }
  12598. } else if(is474 && !is562) {
  12599. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  12600. menuActionName[1] = "Clan Chat";
  12601. menuActionID[1] = 1008;
  12602. menuActionRow = 2;
  12603. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  12604. menuActionName[1] = "Logout";
  12605. menuActionID[1] = 1011;
  12606. menuActionRow = 2;
  12607. }
  12608. } else if(is562){
  12609. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  12610. tabHPos = 0;
  12611. needDrawTabArea = true;
  12612. tabAreaAltered = true;
  12613. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  12614. tabHPos = 1;
  12615. needDrawTabArea = true;
  12616. tabAreaAltered = true;
  12617. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  12618. tabHPos = 2;
  12619. needDrawTabArea = true;
  12620. tabAreaAltered = true;
  12621. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  12622. tabHPos = 3;
  12623. needDrawTabArea = true;
  12624. tabAreaAltered = true;
  12625. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  12626. tabHPos = 4;
  12627. needDrawTabArea = true;
  12628. tabAreaAltered = true;
  12629. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  12630. tabHPos = 5;
  12631. needDrawTabArea = true;
  12632. tabAreaAltered = true;
  12633. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  12634. tabHPos = 6;
  12635. needDrawTabArea = true;
  12636. tabAreaAltered = true;
  12637. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  12638. tabHPos = 7;
  12639. needDrawTabArea = true;
  12640. tabAreaAltered = true;
  12641. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  12642. tabHPos = 15;
  12643. needDrawTabArea = true;
  12644. tabAreaAltered = true;
  12645. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  12646. tabHPos = 8;
  12647. needDrawTabArea = true;
  12648. tabAreaAltered = true;
  12649. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  12650. tabHPos = 9;
  12651. needDrawTabArea = true;
  12652. tabAreaAltered = true;
  12653. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  12654. tabHPos = 10;
  12655. needDrawTabArea = true;
  12656. tabAreaAltered = true;
  12657. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  12658. tabHPos = 11;
  12659. needDrawTabArea = true;
  12660. tabAreaAltered = true;
  12661. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  12662. tabHPos = 12;
  12663. needDrawTabArea = true;
  12664. tabAreaAltered = true;
  12665. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  12666. tabHPos = 13;
  12667. needDrawTabArea = true;
  12668. tabAreaAltered = true;
  12669. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  12670. tabHPos = 14;
  12671. needDrawTabArea = true;
  12672. tabAreaAltered = true;
  12673. } else {
  12674. tabHPos = -1;
  12675. needDrawTabArea = true;
  12676. tabAreaAltered = true;
  12677. }
  12678. if(super.clickMode3 == 1) {
  12679. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  12680. needDrawTabArea = true;
  12681. tabID = 0;
  12682. tabAreaAltered = true;
  12683. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  12684. needDrawTabArea = true;
  12685. tabID = 1;
  12686. tabAreaAltered = true;
  12687. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  12688. needDrawTabArea = true;
  12689. tabID = 2;
  12690. tabAreaAltered = true;
  12691. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  12692. needDrawTabArea = true;
  12693. tabID = 14;
  12694. tabAreaAltered = true;
  12695. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  12696. needDrawTabArea = true;
  12697. tabID = 3;
  12698. tabAreaAltered = true;
  12699. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  12700. needDrawTabArea = true;
  12701. tabID = 4;
  12702. tabAreaAltered = true;
  12703. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  12704. needDrawTabArea = true;
  12705. tabID = 5;
  12706. tabAreaAltered = true;
  12707. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  12708. needDrawTabArea = true;
  12709. tabID = 6;
  12710. tabAreaAltered = true;
  12711. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  12712. needDrawTabArea = true;
  12713. tabID = 16;
  12714. tabAreaAltered = true;
  12715. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  12716. needDrawTabArea = true;
  12717. tabID = 8;
  12718. tabAreaAltered = true;
  12719. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  12720. needDrawTabArea = true;
  12721. tabID = 9;
  12722. tabAreaAltered = true;
  12723. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  12724. needDrawTabArea = true;
  12725. tabID = 7;
  12726. tabAreaAltered = true;
  12727. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  12728. needDrawTabArea = true;
  12729. tabID = 11;
  12730. tabAreaAltered = true;
  12731. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  12732. needDrawTabArea = true;
  12733. tabID = 12;
  12734. tabAreaAltered = true;
  12735. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  12736. needDrawTabArea = true;
  12737. tabID = 13;
  12738. tabAreaAltered = true;
  12739. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  12740. needDrawTabArea = true;
  12741. tabID = 15;
  12742. tabAreaAltered = true;
  12743. }
  12744. }
  12745.  
  12746. }
  12747. if(is474 || is480 || is508 || is525) {
  12748. if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 466 && super.mouseY < 503) {
  12749. menuActionName[1] = "Friend List";
  12750. menuActionID[1] = 1009;
  12751. menuActionRow = 2;
  12752. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 466 && super.mouseY < 503) {
  12753. menuActionName[1] = "Ignore List";
  12754. menuActionID[1] = 1010;
  12755. menuActionRow = 2;
  12756. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 466 && super.mouseY < 503) {
  12757. menuActionName[1] = "Options";
  12758. menuActionID[1] = 1012;
  12759. menuActionRow = 2;
  12760. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 466 && super.mouseY < 503) {
  12761. menuActionName[1] = "Emotes";
  12762. menuActionID[1] = 1013;
  12763. menuActionRow = 2;
  12764. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 466 && super.mouseY < 503) {
  12765. menuActionName[1] = "Music Player";
  12766. menuActionID[1] = 1014;
  12767. menuActionRow = 2;
  12768. }
  12769. }
  12770. }
  12771.  
  12772. private void processMinimapActions() {
  12773.  
  12774.  
  12775.  
  12776. if(is508 == true || is525 == true || is562 == true) {
  12777. if(super.mouseX >= 527 && super.mouseX <= 560 && super.mouseY >= 126 && super.mouseY <= 159) {
  12778. menuActionName[1] = "World Map";
  12779. menuActionID[1] = 1005;
  12780. menuActionRow = 2;
  12781. }
  12782. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  12783. if(!runClicked){
  12784. menuActionName[2] = "Toggle Run-Mode On";
  12785. } else if(runClicked){
  12786. menuActionName[2] = "Toggle Run-Mode Off";
  12787. }
  12788. menuActionID[2] = 1050;
  12789. menuActionRow = 2;
  12790. menuActionName[1] = "Rest";
  12791. menuActionID[1] = 1501;
  12792. menuActionRow = 3;
  12793. }
  12794. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY < 80){
  12795. menuActionName[2] = "Toggle XP Total";
  12796. menuActionID[2] = 1503;
  12797. menuActionRow = 2;
  12798. menuActionName[1] = "Reset XP Total";
  12799. menuActionID[1] = 1504;
  12800. menuActionRow = 3;
  12801. }
  12802. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  12803. if(!prayClicked){
  12804. menuActionName[1] = "Toggle Quick-Prayers On";
  12805. } else if(prayClicked){
  12806. menuActionName[1] = "Toggle Quick-Prayers Off";
  12807. }
  12808. menuActionID[1] = 1500;
  12809. menuActionRow = 2;
  12810. }
  12811. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  12812. if(!prayClicked){
  12813. menuActionName[1] = "Toggle Quick-Prayers On";
  12814. } else if(prayClicked){
  12815. menuActionName[1] = "Toggle Quick-Prayers Off";
  12816. }
  12817. menuActionID[1] = 1500;
  12818. menuActionRow = 2;
  12819. }
  12820. }
  12821. }
  12822.  
  12823. public int getOrbTextColor(int statusInt){
  12824. if(statusInt >= 75 && statusInt <= 100){
  12825. return 0x00FF00;
  12826. } else if(statusInt >= 50 && statusInt <= 74){
  12827. return 0xFFFF00;
  12828. } else if(statusInt >= 25 && statusInt <= 49){
  12829. return 0xFF981F;
  12830. } else {
  12831. return 0xFF0000;
  12832. }
  12833. }
  12834.  
  12835. public int getOrbFill(int statusInt){
  12836. if(statusInt <= 100 && statusInt >= 97) {
  12837. return 0;
  12838. } else if(statusInt <= 96 && statusInt >= 93) {
  12839. return 1;
  12840. } else if(statusInt <= 92 && statusInt >= 89) {
  12841. return 2;
  12842. } else if(statusInt <= 88 && statusInt >= 85) {
  12843. return 3;
  12844. } else if(statusInt <= 84 && statusInt >= 81) {
  12845. return 4;
  12846. } else if(statusInt <= 80 && statusInt >= 77) {
  12847. return 5;
  12848. } else if(statusInt <= 76 && statusInt >= 73) {
  12849. return 6;
  12850. } else if(statusInt <= 72 && statusInt >= 69) {
  12851. return 7;
  12852. } else if(statusInt <= 68 && statusInt >= 65) {
  12853. return 8;
  12854. } else if(statusInt <= 64 && statusInt >= 61) {
  12855. return 9;
  12856. } else if(statusInt <= 60 && statusInt >= 57) {
  12857. return 10;
  12858. } else if(statusInt <= 56 && statusInt >= 53) {
  12859. return 11;
  12860. } else if(statusInt <= 52 && statusInt >= 49) {
  12861. return 12;
  12862. } else if(statusInt <= 48 && statusInt >= 45) {
  12863. return 13;
  12864. } else if(statusInt <= 44 && statusInt >= 41) {
  12865. return 14;
  12866. } else if(statusInt <= 40 && statusInt >= 37) {
  12867. return 15;
  12868. } else if(statusInt <= 36 && statusInt >= 33) {
  12869. return 16;
  12870. } else if(statusInt <= 32 && statusInt >= 29) {
  12871. return 17;
  12872. } else if(statusInt <= 28 && statusInt >= 25) {
  12873. return 18;
  12874. } else if(statusInt <= 24 && statusInt >= 21) {
  12875. return 19;
  12876. } else if(statusInt <= 20 && statusInt >= 17) {
  12877. return 20;
  12878. } else if(statusInt <= 16 && statusInt >= 13) {
  12879. return 21;
  12880. } else if(statusInt <= 12 && statusInt >= 9) {
  12881. return 22;
  12882. } else if(statusInt <= 8 && statusInt >= 7) {
  12883. return 23;
  12884. } else if(statusInt <= 6 && statusInt >= 5) {
  12885. return 24;
  12886. } else if(statusInt <= 4 && statusInt >= 3) {
  12887. return 25;
  12888. } else if(statusInt <= 2 && statusInt >= 1) {
  12889. return 26;
  12890. } else if(statusInt <= 0) {
  12891. return 27;
  12892. }
  12893. return 0;
  12894. }
  12895.  
  12896. public void drawHP() {
  12897. int health;
  12898. String OrbDirectory = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12899. String cHP = RSInterface.interfaceCache[4016].disabledMessage; cHP = cHP.replaceAll("%","");
  12900. int currentHP = Integer.parseInt(cHP);
  12901. String mHP = RSInterface.interfaceCache[4017].disabledMessage; mHP = mHP.replaceAll("%","");
  12902. int maxHP2 = Integer.parseInt(mHP);
  12903. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  12904. ORBS[0] = new Sprite(OrbDirectory+"ORBS 0.PNG", 27, getOrbFill(health));
  12905. if(is480){
  12906. ORBS[14].drawSprite(174, 14);
  12907. } else {
  12908. ORBS[1].drawSprite(174, 14);
  12909. }
  12910. ORBS[2].drawSprite(177, 17);
  12911. ORBS[0].drawSprite(177, 17);
  12912. if(health <= 20){
  12913. if(loopCycle % 20 < 10){
  12914. ORBS[3].drawSprite(183, 25);
  12915. }
  12916. } else {
  12917. ORBS[3].drawSprite(183, 25);
  12918. }
  12919. int Y = 40;
  12920. if(is480){
  12921. Y = 43;
  12922. }
  12923. smallText.method382(getOrbTextColor(health), 218, RSInterface.interfaceCache[4016].disabledMessage, Y, true);
  12924. }
  12925.  
  12926. public void drawPrayer() {
  12927. int prayer;
  12928. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12929. String cPR = RSInterface.interfaceCache[4012].disabledMessage;
  12930. int currentPR = Integer.parseInt(cPR);
  12931. String mPR = RSInterface.interfaceCache[4013].disabledMessage;
  12932. int maxPR2 = Integer.parseInt(mPR);
  12933. prayer = (int)(((double)currentPR / (double)maxPR2) * 100D);
  12934. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(prayer));
  12935. if(!prayClicked){
  12936. if(!is480){
  12937. if(prayHover){
  12938. ORBS[7].drawSprite(190, 53);
  12939. }else if(!prayHover){
  12940. ORBS[1].drawSprite(190, 53);
  12941. }
  12942. } else {
  12943. if(prayHover){
  12944. ORBS[15].drawSprite(190, 53);
  12945. } else {
  12946. ORBS[14].drawSprite(190, 53);
  12947. }
  12948. }
  12949. ORBS[4].drawSprite(193, 56);
  12950. } else if(prayClicked){
  12951. if(!is480){
  12952. if(prayHover){
  12953. ORBS[7].drawSprite(190, 53);
  12954. } else if(!prayHover){
  12955. ORBS[1].drawSprite(190, 53);
  12956. }
  12957. } else {
  12958. if(prayHover){
  12959. ORBS[15].drawSprite(190, 53);
  12960. } else {
  12961. ORBS[14].drawSprite(190, 53);
  12962. }
  12963. }
  12964. ORBS[5].drawSprite(193, 56);
  12965. }
  12966. ORBS[0].drawSprite(194, 56);
  12967. if(prayer <= 25) {
  12968. if(loopCycle % 20 < 10) {
  12969. ORBS[6].drawSprite(197, 60);
  12970. }
  12971. } else {
  12972. ORBS[6].drawSprite(197, 60);
  12973. }
  12974. int Y = 79;
  12975. if(is480){
  12976. Y = 82;
  12977. }
  12978. smallText.method382(getOrbTextColor(prayer), 234, RSInterface.interfaceCache[4012].disabledMessage, Y, true);
  12979. }
  12980.  
  12981. public void drawRunOrb(){
  12982. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12983. String cEn = RSInterface.interfaceCache[149].disabledMessage; cEn = cEn.replaceAll("%","");
  12984. int currentEner = Integer.parseInt(cEn);
  12985. energy = (int)(((double)currentEner / 100) * 100D);
  12986. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(energy));
  12987. if(!runClicked){
  12988. if(!is480){
  12989. if(runHover){
  12990. ORBS[7].drawSprite(190, 92);
  12991. } else{
  12992. ORBS[1].drawSprite(190, 92);
  12993. }
  12994. } else {
  12995. ORBS[14].drawSprite(190, 92);
  12996. }
  12997. ORBS[10].drawSprite(193, 95);
  12998. if(energy != 100){
  12999. ORBS[0].drawSprite(193, 95);
  13000. }
  13001. ORBS[8].drawSprite(199, 100);
  13002. } else {
  13003. if(!is480){
  13004. if(runHover){
  13005. ORBS[7].drawSprite(190, 92);
  13006. } else {
  13007. ORBS[1].drawSprite(190, 92);
  13008. }
  13009. } else {
  13010. ORBS[14].drawSprite(190, 92);
  13011. }
  13012. ORBS[11].drawSprite(193, 95);
  13013. if(energy != 100){
  13014. ORBS[0].drawSprite(193, 95);
  13015. }
  13016. ORBS[9].drawSprite(199, 100);
  13017. }
  13018. int Y = 117;
  13019. if(is480){
  13020. Y = 120;
  13021. }
  13022. smallText.method382(getOrbTextColor(energy), 234, ""+energy, Y, true);
  13023. }
  13024.  
  13025. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  13026. )
  13027. {
  13028. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  13029. {
  13030. if(lowMem && j != plane)
  13031. return;
  13032. int i2 = 0;
  13033. if(j1 == 0)
  13034. i2 = worldController.method300(j, i1, i);
  13035. if(j1 == 1)
  13036. i2 = worldController.method301(j, i1, i);
  13037. if(j1 == 2)
  13038. i2 = worldController.method302(j, i1, i);
  13039. if(j1 == 3)
  13040. i2 = worldController.method303(j, i1, i);
  13041. if(i2 != 0)
  13042. {
  13043. int i3 = worldController.method304(j, i1, i, i2);
  13044. int j2 = i2 >> 14 & 0x7fff;
  13045. int k2 = i3 & 0x1f;
  13046. int l2 = i3 >> 6;
  13047. if(j1 == 0)
  13048. {
  13049. worldController.method291(i1, j, i, (byte)-119);
  13050. ObjectDef class46 = ObjectDef.forID(j2);
  13051. if(class46.aBoolean767)
  13052. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  13053. }
  13054. if(j1 == 1)
  13055. worldController.method292(i, j, i1);
  13056. if(j1 == 2)
  13057. {
  13058. worldController.method293(j, i1, i);
  13059. ObjectDef class46_1 = ObjectDef.forID(j2);
  13060. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  13061. return;
  13062. if(class46_1.aBoolean767)
  13063. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  13064. }
  13065. if(j1 == 3)
  13066. {
  13067. worldController.method294(j, i, i1);
  13068. ObjectDef class46_2 = ObjectDef.forID(j2);
  13069. if(class46_2.aBoolean767 && class46_2.hasActions)
  13070. aClass11Array1230[j].method218(i, i1);
  13071. }
  13072. }
  13073. if(k1 >= 0)
  13074. {
  13075. int j3 = j;
  13076. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  13077. j3++;
  13078. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  13079. }
  13080. }
  13081. }
  13082.  
  13083. private void updatePlayers(int i, Stream stream)
  13084. {
  13085. anInt839 = 0;
  13086. anInt893 = 0;
  13087. method117(stream);
  13088. method134(stream);
  13089. method91(stream, i);
  13090. method49(stream);
  13091. for(int k = 0; k < anInt839; k++)
  13092. {
  13093. int l = anIntArray840[k];
  13094. if(playerArray[l].anInt1537 != loopCycle)
  13095. playerArray[l] = null;
  13096. }
  13097.  
  13098. if(stream.currentOffset != i)
  13099. {
  13100. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  13101. throw new RuntimeException("eek");
  13102. }
  13103. for(int i1 = 0; i1 < playerCount; i1++)
  13104. if(playerArray[playerIndices[i1]] == null)
  13105. {
  13106. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  13107. throw new RuntimeException("eek");
  13108. }
  13109.  
  13110. }
  13111.  
  13112. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  13113. {
  13114. int l1 = 2048 - k & 0x7ff;
  13115. int i2 = 2048 - j1 & 0x7ff;
  13116. int j2 = 0;
  13117. int k2 = 0;
  13118. int l2 = j;
  13119. if(l1 != 0)
  13120. {
  13121. int i3 = Model.modelIntArray1[l1];
  13122. int k3 = Model.modelIntArray2[l1];
  13123. int i4 = k2 * k3 - l2 * i3 >> 16;
  13124. l2 = k2 * i3 + l2 * k3 >> 16;
  13125. k2 = i4;
  13126. }
  13127. if(i2 != 0)
  13128. {
  13129. /* xxx if(cameratoggle){
  13130. if(zoom == 0)
  13131. zoom = k2;
  13132. if(lftrit == 0)
  13133. lftrit = j2;
  13134. if(fwdbwd == 0)
  13135. fwdbwd = l2;
  13136. k2 = zoom;
  13137. j2 = lftrit;
  13138. l2 = fwdbwd;
  13139. }
  13140. */
  13141. int j3 = Model.modelIntArray1[i2];
  13142. int l3 = Model.modelIntArray2[i2];
  13143. int j4 = l2 * j3 + j2 * l3 >> 16;
  13144. l2 = l2 * l3 - j2 * j3 >> 16;
  13145. j2 = j4;
  13146. }
  13147. xCameraPos = l - j2;
  13148. zCameraPos = i1 - k2;
  13149. yCameraPos = k1 - l2;
  13150. yCameraCurve = k;
  13151. xCameraCurve = j1;
  13152. }
  13153.  
  13154. public void updateStrings(String str, int i) {
  13155. switch(i) {
  13156. case 1675: sendFrame126(str, 17508); break;//Stab
  13157. case 1676: sendFrame126(str, 17509); break;//Slash
  13158. case 1677: sendFrame126(str, 17510); break;//Cursh
  13159. case 1678: sendFrame126(str, 17511); break;//Magic
  13160. case 1679: sendFrame126(str, 17512); break;//Range
  13161. case 1680: sendFrame126(str, 17513); break;//Stab
  13162. case 1681: sendFrame126(str, 17514); break;//Slash
  13163. case 1682: sendFrame126(str, 17515); break;//Crush
  13164. case 1683: sendFrame126(str, 17516); break;//Magic
  13165. case 1684: sendFrame126(str, 17517); break;//Range
  13166. case 1686: sendFrame126(str, 17518); break;//Strength
  13167. case 1687: sendFrame126(str, 17519); break;//Prayer
  13168. }
  13169. }
  13170.  
  13171. public void sendFrame126(String str,int i) {
  13172. RSInterface.interfaceCache[i].disabledMessage = str;
  13173. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  13174. needDrawTabArea = true;
  13175. }
  13176.  
  13177. public void sendPacket185(int button,int toggle,int interfaceType) {
  13178. switch(interfaceType) {
  13179. case 135:
  13180. RSInterface class9 = RSInterface.interfaceCache[button];
  13181. boolean flag8 = true;
  13182. if(class9.contentType > 0)
  13183. flag8 = promptUserForInput(class9);
  13184. if(flag8) {
  13185. stream.createFrame(185);
  13186. stream.writeWord(button);
  13187. }
  13188. break;
  13189. case 646:
  13190. stream.createFrame(185);
  13191. stream.writeWord(button);
  13192. RSInterface class9_2 = RSInterface.interfaceCache[button];
  13193. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  13194. if(variousSettings[toggle] != class9_2.requiredValues[0]) {
  13195. variousSettings[toggle] = class9_2.requiredValues[0];
  13196. method33(toggle);
  13197. needDrawTabArea = true;
  13198. }
  13199. }
  13200. break;
  13201. case 169:
  13202. stream.createFrame(185);
  13203. stream.writeWord(button);
  13204. RSInterface class9_3 = RSInterface.interfaceCache[button];
  13205. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  13206. variousSettings[toggle] = 1 - variousSettings[toggle];
  13207. method33(toggle);
  13208. needDrawTabArea = true;
  13209. }
  13210. switch(button) {
  13211. case 19136:
  13212. System.out.println("toggle = "+toggle);
  13213. if(toggle == 0)
  13214. sendFrame36(173,toggle);
  13215. if(toggle == 1)
  13216. sendPacket185(153,173,646);
  13217. break;
  13218. }
  13219. break;
  13220. }
  13221. }
  13222.  
  13223. public void sendFrame36(int id,int state) {
  13224. anIntArray1045[id] = state;
  13225. if(variousSettings[id] != state) {
  13226. variousSettings[id] = state;
  13227. method33(id);
  13228. needDrawTabArea = true;
  13229. if(dialogID != -1)
  13230. inputTaken = true;
  13231. }
  13232. }
  13233.  
  13234. public void sendFrame219() {
  13235.  
  13236.  
  13237. if(invOverlayInterfaceID != -1) {
  13238. invOverlayInterfaceID = -1;
  13239. needDrawTabArea = true;
  13240. tabAreaAltered = true;
  13241. }
  13242. if(backDialogID != -1) {
  13243. backDialogID = -1;
  13244. inputTaken = true;
  13245. }
  13246. if(inputDialogState != 0) {
  13247. inputDialogState = 0;
  13248. inputTaken = true;
  13249. }
  13250. openInterfaceID = -1;
  13251. aBoolean1149 = false;
  13252. }
  13253.  
  13254. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  13255. if(backDialogID != -1) {
  13256. backDialogID = -1;
  13257. inputTaken = true;
  13258. }
  13259. if(inputDialogState != 0) {
  13260. inputDialogState = 0;
  13261. inputTaken = true;
  13262. }
  13263. openInterfaceID = interfaceID;
  13264. invOverlayInterfaceID = sideInterfaceID;
  13265. needDrawTabArea = true;
  13266. tabAreaAltered = true;
  13267. aBoolean1149 = false;
  13268. }
  13269.  
  13270. private boolean parsePacket() {
  13271.  
  13272.  
  13273. if(socketStream == null)
  13274. return false;
  13275. try {
  13276. int i = socketStream.available();
  13277. if(i == 0)
  13278. return false;
  13279. if(pktType == -1) {
  13280. socketStream.flushInputStream(inStream.buffer, 1);
  13281. pktType = inStream.buffer[0] & 0xff;
  13282. if(encryption != null)
  13283. pktType = pktType - encryption.getNextKey() & 0xff;
  13284. pktSize = SizeConstants.packetSizes[pktType];
  13285. i--;
  13286. }
  13287. if(pktSize == -1)
  13288. if(i > 0) {
  13289. socketStream.flushInputStream(inStream.buffer, 1);
  13290. pktSize = inStream.buffer[0] & 0xff;
  13291. i--;
  13292. } else {
  13293. return false;
  13294. }
  13295. if(pktSize == -2)
  13296. if(i > 1) {
  13297. socketStream.flushInputStream(inStream.buffer, 2);
  13298. inStream.currentOffset = 0;
  13299. pktSize = inStream.readUnsignedWord();
  13300. i -= 2;
  13301. } else {
  13302. return false;
  13303. }
  13304. if(i < pktSize)
  13305. return false;
  13306. inStream.currentOffset = 0;
  13307. socketStream.flushInputStream(inStream.buffer, pktSize);
  13308. anInt1009 = 0;
  13309. anInt843 = anInt842;
  13310. anInt842 = anInt841;
  13311. anInt841 = pktType;
  13312. switch(pktType) {
  13313. case 81:
  13314. updatePlayers(pktSize, inStream);
  13315. aBoolean1080 = false;
  13316. pktType = -1;
  13317. return true;
  13318.  
  13319. case 176:
  13320. daysSinceRecovChange = inStream.method427();
  13321. unreadMessages = inStream.method435();
  13322. membersInt = inStream.readUnsignedByte();
  13323. anInt1193 = inStream.method440();
  13324. daysSinceLastLogin = inStream.readUnsignedWord();
  13325. if(anInt1193 != 0 && openInterfaceID == -1) {
  13326. signlink.dnslookup(TextClass.method586(anInt1193));
  13327. clearTopInterfaces();
  13328. char c = '\u028A';
  13329. if(daysSinceRecovChange != 201 || membersInt == 1)
  13330. c = '\u028F';
  13331. reportAbuseInput = "";
  13332. canMute = false;
  13333. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13334. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  13335. continue;
  13336. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13337.  
  13338. }
  13339. }
  13340. pktType = -1;
  13341. return true;
  13342.  
  13343. case 64:
  13344. anInt1268 = inStream.method427();
  13345. anInt1269 = inStream.method428();
  13346. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  13347. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  13348. if(groundArray[plane][j][l9] != null) {
  13349. groundArray[plane][j][l9] = null;
  13350. spawnGroundItem(j, l9);
  13351. }
  13352. }
  13353. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  13354. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  13355. class30_sub1.anInt1294 = 0;
  13356. pktType = -1;
  13357. return true;
  13358.  
  13359. case 185:
  13360. int k = inStream.method436();
  13361. RSInterface.interfaceCache[k].disabledMediaType = 3;
  13362. if(myPlayer.desc == null)
  13363. RSInterface.interfaceCache[k].disabledMediaID = (myPlayer.anIntArray1700[0] << 25) + (myPlayer.anIntArray1700[4] << 20) + (myPlayer.equipment[0] << 15) + (myPlayer.equipment[8] << 10) + (myPlayer.equipment[11] << 5) + myPlayer.equipment[1];
  13364. else
  13365. RSInterface.interfaceCache[k].disabledMediaID = (int)(0x12345678L + myPlayer.desc.interfaceType);
  13366. pktType = -1;
  13367. return true;
  13368.  
  13369. /* Clan chat packet */
  13370. case 217:
  13371. try {
  13372. name = inStream.readString();
  13373. disabledMessage = inStream.readString();
  13374. clanname = inStream.readString();
  13375. rights = inStream.readUnsignedWord();
  13376. //disabledMessage = TextInput.processText(disabledMessage);
  13377. //disabledMessage = Censor.doCensor(disabledMessage);
  13378. System.out.println(clanname);
  13379. pushMessage(disabledMessage, 16, name);
  13380. } catch(Exception e) {
  13381. e.printStackTrace();
  13382. }
  13383. pktType = -1;
  13384. return true;
  13385.  
  13386. case 107:
  13387. aBoolean1160 = false;
  13388. for(int l = 0; l < 5; l++)
  13389. aBooleanArray876[l] = false;
  13390. pktType = -1;
  13391. return true;
  13392.  
  13393. case 72:
  13394. int i1 = inStream.method434();
  13395. RSInterface class9 = RSInterface.interfaceCache[i1];
  13396. for(int k15 = 0; k15 < class9.inventory.length; k15++) {
  13397. class9.inventory[k15] = -1;
  13398. class9.inventory[k15] = 0;
  13399. }
  13400. pktType = -1;
  13401. return true;
  13402.  
  13403. case 214:
  13404. ignoreCount = pktSize / 8;
  13405. for(int j1 = 0; j1 < ignoreCount; j1++)
  13406. ignoreListAsLongs[j1] = inStream.readQWord();
  13407. pktType = -1;
  13408. return true;
  13409.  
  13410. case 166:
  13411. aBoolean1160 = true;
  13412. anInt1098 = inStream.readUnsignedByte();
  13413. anInt1099 = inStream.readUnsignedByte();
  13414. anInt1100 = inStream.readUnsignedWord();
  13415. anInt1101 = inStream.readUnsignedByte();
  13416. anInt1102 = inStream.readUnsignedByte();
  13417. if(anInt1102 >= 100) {
  13418. xCameraPos = anInt1098 * 128 + 64;
  13419. yCameraPos = anInt1099 * 128 + 64;
  13420. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  13421. }
  13422. pktType = -1;
  13423. return true;
  13424.  
  13425. case 134:
  13426. needDrawTabArea = true;
  13427. int k1 = inStream.readUnsignedByte();
  13428. int i10 = inStream.method439();
  13429. int l15 = inStream.readUnsignedByte();
  13430. int oldXp = currentExp[k1];
  13431. if(drawXpBar) {
  13432. drawFlag = true;
  13433. }
  13434. currentExp[k1] = i10;
  13435. currentStats[k1] = l15;
  13436. maxStats[k1] = 1;
  13437. testXp += i10-oldXp;
  13438. xpToDraw += i10-oldXp;
  13439. if(testXp == currentExp[k1]) {
  13440. testXp = 0;
  13441. xpToDraw = 0;
  13442. }
  13443. for(int k20 = 0; k20 < 98; k20++)
  13444. if(i10 >= anIntArray1019[k20])
  13445. maxStats[k1] = k20 + 2;
  13446. pktType = -1;
  13447. return true;
  13448.  
  13449. case 71:
  13450. int l1 = inStream.readUnsignedWord();
  13451. int j10 = inStream.method426();
  13452. if(l1 == 65535)
  13453. l1 = -1;
  13454. tabInterfaceIDs[j10] = l1;
  13455. needDrawTabArea = true;
  13456. tabAreaAltered = true;
  13457. pktType = -1;
  13458. return true;
  13459.  
  13460. case 74:
  13461. int i2 = inStream.method434();
  13462. if(i2 == 65535)
  13463. i2 = -1;
  13464. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  13465. nextSong = i2;
  13466. songChanging = true;
  13467. onDemandFetcher.method558(2, nextSong);
  13468. }
  13469. currentSong = i2;
  13470. pktType = -1;
  13471. return true;
  13472.  
  13473. case 121:
  13474. int j2 = inStream.method436();
  13475. int k10 = inStream.method435();
  13476. if(musicEnabled && !lowMem) {
  13477. nextSong = j2;
  13478. songChanging = false;
  13479. onDemandFetcher.method558(2, nextSong);
  13480. prevSong = k10;
  13481. }
  13482. pktType = -1;
  13483. return true;
  13484.  
  13485. case 109:
  13486. resetLogout();
  13487. pktType = -1;
  13488. return false;
  13489.  
  13490. case 70:
  13491. int k2 = inStream.readSignedWord();
  13492. int l10 = inStream.method437();
  13493. int i16 = inStream.method434();
  13494. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  13495. class9_5.xOffset = k2;
  13496. class9_5.yOffset = l10;
  13497. pktType = -1;
  13498. return true;
  13499.  
  13500. case 73:
  13501. case 241:
  13502. int l2 = anInt1069;
  13503. int i11 = anInt1070;
  13504. if(pktType == 73) {
  13505. l2 = inStream.method435();
  13506. i11 = inStream.readUnsignedWord();
  13507. aBoolean1159 = false;
  13508. }
  13509. if(pktType == 241) {
  13510. i11 = inStream.method435();
  13511. inStream.initBitAccess();
  13512. for(int j16 = 0; j16 < 4; j16++) {
  13513. for(int l20 = 0; l20 < 13; l20++) {
  13514. for(int j23 = 0; j23 < 13; j23++) {
  13515. int i26 = inStream.readBits(1);
  13516. if(i26 == 1)
  13517. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  13518. else
  13519. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  13520. }
  13521. }
  13522. }
  13523. inStream.finishBitAccess();
  13524. l2 = inStream.readUnsignedWord();
  13525. aBoolean1159 = true;
  13526. }
  13527. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2)
  13528. {
  13529. pktType = -1;
  13530. return true;
  13531. }
  13532. anInt1069 = l2;
  13533. anInt1070 = i11;
  13534. baseX = (anInt1069 - 6) * 8;
  13535. baseY = (anInt1070 - 6) * 8;
  13536. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  13537. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  13538. aBoolean1141 = true;
  13539. loadingStage = 1;
  13540. aLong824 = System.currentTimeMillis();
  13541. inGameScreen.initDrawingArea();
  13542. loadingPleaseWait.drawSprite(8,9);;
  13543. inGameScreen.drawGraphics(4, super.graphics, 4);
  13544. if(pktType == 73) {
  13545. int k16 = 0;
  13546. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  13547. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  13548. k16++;
  13549. }
  13550. aByteArrayArray1183 = new byte[k16][];
  13551. aByteArrayArray1247 = new byte[k16][];
  13552. anIntArray1234 = new int[k16];
  13553. anIntArray1235 = new int[k16];
  13554. anIntArray1236 = new int[k16];
  13555. k16 = 0;
  13556. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  13557. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  13558. anIntArray1234[k16] = (l23 << 8) + j26;
  13559. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  13560. anIntArray1235[k16] = -1;
  13561. anIntArray1236[k16] = -1;
  13562. k16++;
  13563. } else {
  13564. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  13565. if(k28 != -1)
  13566. onDemandFetcher.method558(3, k28);
  13567. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  13568. if(j30 != -1)
  13569. onDemandFetcher.method558(3, j30);
  13570. k16++;
  13571. }
  13572. }
  13573. }
  13574. }
  13575. if(pktType == 241) {
  13576. int l16 = 0;
  13577. int ai[] = new int[676];
  13578. for(int i24 = 0; i24 < 4; i24++) {
  13579. for(int k26 = 0; k26 < 13; k26++) {
  13580. for(int l28 = 0; l28 < 13; l28++) {
  13581. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  13582. if(k30 != -1) {
  13583. int k31 = k30 >> 14 & 0x3ff;
  13584. int i32 = k30 >> 3 & 0x7ff;
  13585. int k32 = (k31 / 8 << 8) + i32 / 8;
  13586. for(int j33 = 0; j33 < l16; j33++) {
  13587. if(ai[j33] != k32)
  13588. continue;
  13589. k32 = -1;
  13590.  
  13591. }
  13592. if(k32 != -1)
  13593. ai[l16++] = k32;
  13594. }
  13595. }
  13596. }
  13597. }
  13598. aByteArrayArray1183 = new byte[l16][];
  13599. aByteArrayArray1247 = new byte[l16][];
  13600. anIntArray1234 = new int[l16];
  13601. anIntArray1235 = new int[l16];
  13602. anIntArray1236 = new int[l16];
  13603. for(int l26 = 0; l26 < l16; l26++) {
  13604. int i29 = anIntArray1234[l26] = ai[l26];
  13605. int l30 = i29 >> 8 & 0xff;
  13606. int l31 = i29 & 0xff;
  13607. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  13608. if(j32 != -1)
  13609. onDemandFetcher.method558(3, j32);
  13610. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  13611. if(i33 != -1)
  13612. onDemandFetcher.method558(3, i33);
  13613. }
  13614. }
  13615. int i17 = baseX - anInt1036;
  13616. int j21 = baseY - anInt1037;
  13617. anInt1036 = baseX;
  13618. anInt1037 = baseY;
  13619. for(int j24 = 0; j24 < 16384; j24++) {
  13620. NPC npc = npcArray[j24];
  13621. if(npc != null) {
  13622. for(int j29 = 0; j29 < 10; j29++) {
  13623. npc.smallX[j29] -= i17;
  13624. npc.smallY[j29] -= j21;
  13625. }
  13626. npc.x -= i17 * 128;
  13627. npc.y -= j21 * 128;
  13628. }
  13629. }
  13630. for(int i27 = 0; i27 < maxPlayers; i27++) {
  13631. Player player = playerArray[i27];
  13632. if(player != null) {
  13633. for(int i31 = 0; i31 < 10; i31++) {
  13634. player.smallX[i31] -= i17;
  13635. player.smallY[i31] -= j21;
  13636. }
  13637. player.x -= i17 * 128;
  13638. player.y -= j21 * 128;
  13639. }
  13640. }
  13641. aBoolean1080 = true;
  13642. byte byte1 = 0;
  13643. byte byte2 = 104;
  13644. byte byte3 = 1;
  13645. if(i17 < 0) {
  13646. byte1 = 103;
  13647. byte2 = -1;
  13648. byte3 = -1;
  13649. }
  13650. byte byte4 = 0;
  13651. byte byte5 = 104;
  13652. byte byte6 = 1;
  13653. if(j21 < 0) {
  13654. byte4 = 103;
  13655. byte5 = -1;
  13656. byte6 = -1;
  13657. }
  13658. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  13659. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  13660. int i34 = k33 + i17;
  13661. int j34 = l33 + j21;
  13662. for(int k34 = 0; k34 < 4; k34++)
  13663. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  13664. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  13665. else
  13666. groundArray[k34][k33][l33] = null;
  13667. }
  13668. }
  13669. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  13670. class30_sub1_1.anInt1297 -= i17;
  13671. class30_sub1_1.anInt1298 -= j21;
  13672. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  13673. class30_sub1_1.unlink();
  13674. }
  13675. if(destX != 0) {
  13676. destX -= i17;
  13677. destY -= j21;
  13678. }
  13679. aBoolean1160 = false;
  13680. pktType = -1;
  13681. return true;
  13682.  
  13683. case 208:
  13684. int i3 = inStream.method437();
  13685. if(i3 >= 0)
  13686. method60(i3);
  13687. anInt1018 = i3;
  13688. pktType = -1;
  13689. return true;
  13690.  
  13691. case 99:
  13692. /*
  13693. * Black map, mape state 2, causes blackness
  13694. */
  13695. anInt1021 = inStream.readUnsignedByte();
  13696. pktType = -1;
  13697. return true;
  13698.  
  13699. case 75:
  13700. int j3 = inStream.method436();
  13701. int j11 = inStream.method436();
  13702. RSInterface.interfaceCache[j11].disabledMediaType = 2;
  13703. RSInterface.interfaceCache[j11].disabledMediaID = j3;
  13704. pktType = -1;
  13705. return true;
  13706.  
  13707. case 114:
  13708. anInt1104 = inStream.method434() * 30;
  13709. pktType = -1;
  13710. return true;
  13711.  
  13712. case 60:
  13713. anInt1269 = inStream.readUnsignedByte();
  13714. anInt1268 = inStream.method427();
  13715. while(inStream.currentOffset < pktSize) {
  13716. int k3 = inStream.readUnsignedByte();
  13717. method137(inStream, k3);
  13718. }
  13719. pktType = -1;
  13720. return true;
  13721.  
  13722. case 35:
  13723. int l3 = inStream.readUnsignedByte();
  13724. int k11 = inStream.readUnsignedByte();
  13725. int j17 = inStream.readUnsignedByte();
  13726. int k21 = inStream.readUnsignedByte();
  13727. aBooleanArray876[l3] = true;
  13728. anIntArray873[l3] = k11;
  13729. anIntArray1203[l3] = j17;
  13730. anIntArray928[l3] = k21;
  13731. anIntArray1030[l3] = 0;
  13732. pktType = -1;
  13733. return true;
  13734.  
  13735. case 174:
  13736.  
  13737. /*Empty Following Packet*/
  13738. followPlayer = 0;
  13739. followNPC = 0;
  13740. int l11z = inStream.readUnsignedWord();
  13741. int iq = inStream.readUnsignedByte();
  13742. followDistance = inStream.readUnsignedWord();
  13743. if (iq == 0)
  13744. {
  13745. followNPC = l11z;
  13746. }
  13747. else if (iq == 1)
  13748. {
  13749. followPlayer = l11z;
  13750. }
  13751. pktType = -1;
  13752. return true;
  13753.  
  13754. case 104:
  13755. int j4 = inStream.method427();
  13756. int i12 = inStream.method426();
  13757. String s6 = inStream.readString();
  13758. if(j4 >= 1 && j4 <= 5) {
  13759. if(s6.equalsIgnoreCase("null"))
  13760. s6 = null;
  13761. atPlayerActions[j4 - 1] = s6;
  13762. atPlayerArray[j4 - 1] = i12 == 0;
  13763. }
  13764. pktType = -1;
  13765. return true;
  13766.  
  13767. case 78:
  13768. destX = 0;
  13769. pktType = -1;
  13770. return true;
  13771.  
  13772. case 253:
  13773. String s = inStream.readString();
  13774. if(s.startsWith("Alert##")) {
  13775. String[] args = s.split("##");
  13776. if (args.length == 3) {
  13777. alertHandler.alert = new Alert("Notification", args[1], args[2]);
  13778. } else if (args.length == 4) {
  13779. alertHandler.alert = new Alert(args[1], args[2], args[3]);
  13780. }
  13781. pktType = -1;
  13782. return true;
  13783. }
  13784. if(s.endsWith(":tradereq:")) {
  13785. String s3 = s.substring(0, s.indexOf(":"));
  13786. long l17 = TextClass.longForName(s3);
  13787. boolean flag2 = false;
  13788. for(int j27 = 0; j27 < ignoreCount; j27++) {
  13789. if(ignoreListAsLongs[j27] != l17)
  13790. continue;
  13791. flag2 = true;
  13792. }
  13793. if(!flag2 && anInt1251 == 0)
  13794. pushMessage("wishes to trade with you.", 4, s3);
  13795. } else if (s.endsWith(":clan:")) {
  13796. String s4 = s.substring(0, s.indexOf(":"));
  13797. long l18 = TextClass.longForName(s4);
  13798. pushMessage("Clan: ", 8, s4);
  13799. } else if(s.endsWith("#url#")) {
  13800. String text = s.substring(0, s.indexOf("-"));
  13801. s = s.substring(text.length()+1).trim();
  13802. String link = s.substring(0, s.indexOf("#"));
  13803. pushMessage(text, 9, link);
  13804. } else if(s.endsWith(":resetautocast:")) {
  13805. Autocast = false;
  13806. autocastId = 0;
  13807. magicAuto.drawSprite(1000, 1000);
  13808. } else if(s.endsWith(":duelreq:")) {
  13809. String s4 = s.substring(0, s.indexOf(":"));
  13810. long l18 = TextClass.longForName(s4);
  13811. boolean flag3 = false;
  13812. for(int k27 = 0; k27 < ignoreCount; k27++) {
  13813. if(ignoreListAsLongs[k27] != l18)
  13814. continue;
  13815. flag3 = true;
  13816.  
  13817. }
  13818. if(!flag3 && anInt1251 == 0)
  13819. pushMessage("wishes to duel with you.", 8, s4);
  13820. } else if(s.endsWith(":chalreq:")) {
  13821. String s5 = s.substring(0, s.indexOf(":"));
  13822. long l19 = TextClass.longForName(s5);
  13823. boolean flag4 = false;
  13824. for(int l27 = 0; l27 < ignoreCount; l27++) {
  13825. if(ignoreListAsLongs[l27] != l19)
  13826. continue;
  13827. flag4 = true;
  13828.  
  13829. }
  13830. if(!flag4 && anInt1251 == 0) {
  13831. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  13832. pushMessage(s8, 8, s5);
  13833. }
  13834. } else {
  13835. pushMessage(s, 0, "");
  13836. }
  13837. pktType = -1;
  13838. return true;
  13839.  
  13840. case 1:
  13841. for(int k4 = 0; k4 < playerArray.length; k4++)
  13842. if(playerArray[k4] != null)
  13843. playerArray[k4].anim = -1;
  13844. for(int j12 = 0; j12 < npcArray.length; j12++)
  13845. if(npcArray[j12] != null)
  13846. npcArray[j12].anim = -1;
  13847. pktType = -1;
  13848. return true;
  13849.  
  13850. case 50:
  13851. long l4 = inStream.readQWord();
  13852. int i18 = inStream.readUnsignedByte();
  13853. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  13854. for(int k24 = 0; k24 < friendsCount; k24++) {
  13855. if(l4 != friendsListAsLongs[k24])
  13856. continue;
  13857. if(friendsNodeIDs[k24] != i18) {
  13858. friendsNodeIDs[k24] = i18;
  13859. needDrawTabArea = true;
  13860. if(i18 >= 2) {
  13861. pushMessage(s7 + " has logged in.", 5, "");
  13862. }
  13863. if(i18 <= 1) {
  13864. pushMessage(s7 + " has logged out.", 5, "");
  13865. }
  13866. }
  13867. s7 = null;
  13868.  
  13869. }
  13870. if(s7 != null && friendsCount < 200) {
  13871. friendsListAsLongs[friendsCount] = l4;
  13872. friendsList[friendsCount] = s7;
  13873. friendsNodeIDs[friendsCount] = i18;
  13874. friendsCount++;
  13875. needDrawTabArea = true;
  13876. }
  13877. for(boolean flag6 = false; !flag6;) {
  13878. flag6 = true;
  13879. for(int index = 0; index < friendsCount - 1; index++)
  13880. if(friendsNodeIDs[index] != nodeID && friendsNodeIDs[index + 1] == nodeID || friendsNodeIDs[index] == 0 && friendsNodeIDs[index + 1] != 0) {
  13881. int j31 = friendsNodeIDs[index];
  13882. friendsNodeIDs[index] = friendsNodeIDs[index + 1];
  13883. friendsNodeIDs[index + 1] = j31;
  13884. String s10 = friendsList[index];
  13885. friendsList[index] = friendsList[index + 1];
  13886. friendsList[index + 1] = s10;
  13887. long l32 = friendsListAsLongs[index];
  13888. friendsListAsLongs[index] = friendsListAsLongs[index + 1];
  13889. friendsListAsLongs[index + 1] = l32;
  13890. needDrawTabArea = true;
  13891. flag6 = false;
  13892. }
  13893. }//friends list sorting
  13894. pktType = -1;
  13895. return true;
  13896.  
  13897. case 110:
  13898. if(tabID == 12)
  13899. needDrawTabArea = true;
  13900. energy = inStream.readUnsignedByte();
  13901. pktType = -1;
  13902. return true;
  13903.  
  13904. case 254:
  13905. anInt855 = inStream.readUnsignedByte();
  13906. if(anInt855 == 1)
  13907. anInt1222 = inStream.readUnsignedWord();
  13908. if(anInt855 >= 2 && anInt855 <= 6) {
  13909. if(anInt855 == 2) {
  13910. anInt937 = 64;
  13911. anInt938 = 64;
  13912. }
  13913. if(anInt855 == 3) {
  13914. anInt937 = 0;
  13915. anInt938 = 64;
  13916. }
  13917. if(anInt855 == 4) {
  13918. anInt937 = 128;
  13919. anInt938 = 64;
  13920. }
  13921. if(anInt855 == 5) {
  13922. anInt937 = 64;
  13923. anInt938 = 0;
  13924. }
  13925. if(anInt855 == 6) {
  13926. anInt937 = 64;
  13927. anInt938 = 128;
  13928. }
  13929. anInt855 = 2;
  13930. anInt934 = inStream.readUnsignedWord();
  13931. anInt935 = inStream.readUnsignedWord();
  13932. anInt936 = inStream.readUnsignedByte();
  13933. }
  13934. if(anInt855 == 10)
  13935. anInt933 = inStream.readUnsignedWord();
  13936. pktType = -1;
  13937. return true;
  13938.  
  13939. case 248:
  13940. int i5 = inStream.method435();
  13941. int k12 = inStream.readUnsignedWord();
  13942. if(backDialogID != -1) {
  13943. backDialogID = -1;
  13944. inputTaken = true;
  13945. }
  13946. if(inputDialogState != 0) {
  13947. inputDialogState = 0;
  13948. inputTaken = true;
  13949. }
  13950. openInterfaceID = i5;
  13951. invOverlayInterfaceID = k12;
  13952. needDrawTabArea = true;
  13953. tabAreaAltered = true;
  13954. aBoolean1149 = false;
  13955. pktType = -1;
  13956. return true;
  13957.  
  13958. case 79:
  13959. int j5 = inStream.method434();
  13960. int l12 = inStream.method435();
  13961. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  13962. if(class9_3 != null && class9_3.interfaceType == 0) {
  13963. if(l12 < 0)
  13964. l12 = 0;
  13965. if(l12 > class9_3.scrollMax - class9_3.height)
  13966. l12 = class9_3.scrollMax - class9_3.height;
  13967. class9_3.scrollPosition = l12;
  13968. }
  13969. pktType = -1;
  13970. return true;
  13971.  
  13972. case 68:
  13973. for(int k5 = 0; k5 < variousSettings.length; k5++)
  13974. if(variousSettings[k5] != anIntArray1045[k5]) {
  13975. variousSettings[k5] = anIntArray1045[k5];
  13976. method33(k5);
  13977. needDrawTabArea = true;
  13978. }
  13979. pktType = -1;
  13980. return true;
  13981.  
  13982. case 196:
  13983. long l5 = inStream.readQWord();
  13984. int j18 = inStream.readDWord();
  13985. int l21 = inStream.readUnsignedByte();
  13986. boolean flag5 = false;
  13987. for(int i28 = 0; i28 < 100; i28++) {
  13988. if(anIntArray1240[i28] != j18)
  13989. continue;
  13990. flag5 = true;
  13991.  
  13992. }
  13993. if(l21 <= 1) {
  13994. for(int l29 = 0; l29 < ignoreCount; l29++) {
  13995. if(ignoreListAsLongs[l29] != l5)
  13996. continue;
  13997. flag5 = true;
  13998.  
  13999. }
  14000. }
  14001. if(!flag5 && anInt1251 == 0)
  14002. try {
  14003. anIntArray1240[anInt1169] = j18;
  14004. anInt1169 = (anInt1169 + 1) % 100;
  14005. String s9 = TextInput.method525(pktSize - 13, inStream);
  14006. //if(l21 != 3)
  14007. //s9 = Censor.doCensor(s9);
  14008. if(l21 == 4) {
  14009. pushMessage(s9, 7, "@cr3@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14010. } else if(l21 == 3) {
  14011. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14012. } else if(l21 == 2) {
  14013. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14014. } else if(l21 == 1) {
  14015. pushMessage(s9, 7, "@cr0@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14016. } else {
  14017. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  14018. }
  14019. } catch(Exception exception1) {
  14020. signlink.reporterror("cde1");
  14021. }
  14022. pktType = -1;
  14023. return true;
  14024.  
  14025. case 85:
  14026. anInt1269 = inStream.method427();
  14027. anInt1268 = inStream.method427();
  14028. pktType = -1;
  14029. return true;
  14030.  
  14031. case 24:
  14032. anInt1054 = inStream.method428();
  14033. if(anInt1054 == tabID) {
  14034. if(anInt1054 == 3)
  14035. tabID = 1;
  14036. else
  14037. tabID = 3;
  14038. needDrawTabArea = true;
  14039. }
  14040. pktType = -1;
  14041. return true;
  14042.  
  14043. case 246:
  14044. int i6 = inStream.method434();
  14045. int i13 = inStream.readUnsignedWord();
  14046. int k18 = inStream.readUnsignedWord();
  14047. if(k18 == 65535) {
  14048. RSInterface.interfaceCache[i6].disabledMediaType = 0;
  14049. pktType = -1;
  14050. return true;
  14051. } else {
  14052. ItemDef itemDef = ItemDef.forID(k18);
  14053. RSInterface.interfaceCache[i6].disabledMediaType = 4;
  14054. RSInterface.interfaceCache[i6].disabledMediaID = k18;
  14055. RSInterface.interfaceCache[i6].modelRotationY = itemDef.modelRotationY;
  14056. RSInterface.interfaceCache[i6].modelRotationX = itemDef.modelRotationX;
  14057. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  14058. pktType = -1;
  14059. return true;
  14060. }
  14061.  
  14062. case 171:
  14063. boolean flag1 = inStream.readUnsignedByte() == 1;
  14064. int j13 = inStream.readUnsignedWord();
  14065. RSInterface.interfaceCache[j13].interfaceShown = flag1;
  14066. pktType = -1;
  14067. return true;
  14068.  
  14069. case 142:
  14070. int j6 = inStream.method434();
  14071. method60(j6);
  14072. if(backDialogID != -1) {
  14073. backDialogID = -1;
  14074. inputTaken = true;
  14075. }
  14076. if(inputDialogState != 0) {
  14077. inputDialogState = 0;
  14078. inputTaken = true;
  14079. }
  14080. invOverlayInterfaceID = j6;
  14081. needDrawTabArea = true;
  14082. tabAreaAltered = true;
  14083. openInterfaceID = -1;
  14084. aBoolean1149 = false;
  14085. pktType = -1;
  14086. return true;
  14087.  
  14088. case 126:
  14089. String text = inStream.readString();
  14090. int frame = inStream.method435();
  14091. if (text.startsWith("www.")) {
  14092. launchURL(text);
  14093. pktType = -1;
  14094. return true;
  14095. }
  14096. updateStrings(text, frame);
  14097. sendFrame126(text, frame);
  14098. if (frame >= 18144 && frame <= 18244) {
  14099. clanList[frame - 18144] = text;
  14100. }
  14101. pktType = -1;
  14102. return true;
  14103.  
  14104. case 206:
  14105. publicChatMode = inStream.readUnsignedByte();
  14106. privateChatMode = inStream.readUnsignedByte();
  14107. tradeMode = inStream.readUnsignedByte();
  14108. aBoolean1233 = true;
  14109. inputTaken = true;
  14110. pktType = -1;
  14111. return true;
  14112.  
  14113. case 240:
  14114. if(tabID == 12)
  14115. needDrawTabArea = true;
  14116. weight = inStream.readSignedWord();
  14117. pktType = -1;
  14118. return true;
  14119.  
  14120. case 8:
  14121. int k6 = inStream.method436();
  14122. int l13 = inStream.readUnsignedWord();
  14123. RSInterface.interfaceCache[k6].disabledMediaType = 1;
  14124. RSInterface.interfaceCache[k6].disabledMediaID = l13;
  14125. pktType = -1;
  14126. return true;
  14127.  
  14128. case 122:
  14129. int l6 = inStream.method436();
  14130. int i14 = inStream.method436();
  14131. int i19 = i14 >> 10 & 0x1f;
  14132. int i22 = i14 >> 5 & 0x1f;
  14133. int l24 = i14 & 0x1f;
  14134. RSInterface.interfaceCache[l6].disabledColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  14135. pktType = -1;
  14136. return true;
  14137.  
  14138. case 53:
  14139. needDrawTabArea = true;
  14140. int i7 = inStream.readUnsignedWord();
  14141. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  14142. int j19 = inStream.readUnsignedWord();
  14143. for(int j22 = 0; j22 < j19; j22++) {
  14144. int i25 = inStream.readUnsignedByte();
  14145. if(i25 == 255)
  14146. i25 = inStream.method440();
  14147. class9_1.inventory[j22] = inStream.method436();
  14148. class9_1.inventoryValue[j22] = i25;
  14149. }
  14150. for(int j25 = j19; j25 < class9_1.inventory.length; j25++) {
  14151. class9_1.inventory[j25] = 0;
  14152. class9_1.inventoryValue[j25] = 0;
  14153. }
  14154. pktType = -1;
  14155. return true;
  14156.  
  14157. case 230:
  14158. int j7 = inStream.method435();
  14159. int j14 = inStream.readUnsignedWord();
  14160. int k19 = inStream.readUnsignedWord();
  14161. int k22 = inStream.method436();
  14162. RSInterface.interfaceCache[j14].modelRotationY = k19;
  14163. RSInterface.interfaceCache[j14].modelRotationX = k22;
  14164. RSInterface.interfaceCache[j14].modelZoom = j7;
  14165. pktType = -1;
  14166. return true;
  14167.  
  14168. case 221:
  14169. anInt900 = inStream.readUnsignedByte();
  14170. needDrawTabArea = true;
  14171. pktType = -1;
  14172. return true;
  14173.  
  14174. case 177:
  14175. aBoolean1160 = true;
  14176. anInt995 = inStream.readUnsignedByte();
  14177. anInt996 = inStream.readUnsignedByte();
  14178. anInt997 = inStream.readUnsignedWord();
  14179. anInt998 = inStream.readUnsignedByte();
  14180. anInt999 = inStream.readUnsignedByte();
  14181. if(anInt999 >= 100) {
  14182. int k7 = anInt995 * 128 + 64;
  14183. int k14 = anInt996 * 128 + 64;
  14184. int i20 = method42(plane, k14, k7) - anInt997;
  14185. int l22 = k7 - xCameraPos;
  14186. int k25 = i20 - zCameraPos;
  14187. int j28 = k14 - yCameraPos;
  14188. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  14189. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14190. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14191. if(yCameraCurve < 128)
  14192. yCameraCurve = 128;
  14193. if(yCameraCurve > 383)
  14194. yCameraCurve = 383;
  14195. }
  14196. pktType = -1;
  14197. return true;
  14198.  
  14199. case 249:
  14200. anInt1046 = inStream.method426();
  14201. unknownInt10 = inStream.method436();
  14202. pktType = -1;
  14203. return true;
  14204.  
  14205. case 65:
  14206. updateNPCs(inStream, pktSize);
  14207. pktType = -1;
  14208. return true;
  14209.  
  14210. case 27:
  14211. messagePromptRaised = false;
  14212. inputDialogState = 1;
  14213. amountOrNameInput = "";
  14214. inputTaken = true;
  14215. pktType = -1;
  14216. return true;
  14217.  
  14218. case 187:
  14219. messagePromptRaised = false;
  14220. inputDialogState = 2;
  14221. amountOrNameInput = "";
  14222. inputTaken = true;
  14223. pktType = -1;
  14224. return true;
  14225. case 97:
  14226. int l7 = inStream.readUnsignedWord();
  14227. method60(l7);
  14228. if (invOverlayInterfaceID != -1) {
  14229. invOverlayInterfaceID = -1;
  14230. needDrawTabArea = true;
  14231. tabAreaAltered = true;
  14232. }
  14233. if (backDialogID != -1) {
  14234. backDialogID = -1;
  14235. inputTaken = true;
  14236. }
  14237. if (inputDialogState != 0) {
  14238. inputDialogState = 0;
  14239. inputTaken = true;
  14240. }
  14241. //17511 = Question Type
  14242. //15819 = Christmas Type
  14243. //15812 = Security Type
  14244. //15801 = Item Scam Type
  14245. //15791 = Password Safety ?
  14246. //15774 = Good/Bad Password
  14247. //15767 = Drama Type ????
  14248. if (l7 == 15244) {
  14249. openInterfaceID = 15774;
  14250. fullscreenInterfaceID = 15244;
  14251. } else {
  14252. openInterfaceID = l7;
  14253. }
  14254. aBoolean1149 = false;
  14255. pktType = -1;
  14256. return true;
  14257. case 218:
  14258. int i8 = inStream.method438();
  14259. dialogID = i8;
  14260. inputTaken = true;
  14261. pktType = -1;
  14262. return true;
  14263.  
  14264. case 87:
  14265. int j8 = inStream.method434();
  14266. int l14 = inStream.method439();
  14267. anIntArray1045[j8] = l14;
  14268. if(variousSettings[j8] != l14) {
  14269. variousSettings[j8] = l14;
  14270. method33(j8);
  14271. needDrawTabArea = true;
  14272. if(dialogID != -1)
  14273. inputTaken = true;
  14274. }
  14275. pktType = -1;
  14276. return true;
  14277.  
  14278. case 36:
  14279. int k8 = inStream.method434();
  14280. byte byte0 = inStream.readSignedByte();
  14281. anIntArray1045[k8] = byte0;
  14282. if(variousSettings[k8] != byte0) {
  14283. variousSettings[k8] = byte0;
  14284. method33(k8);
  14285. needDrawTabArea = true;
  14286. if(dialogID != -1)
  14287. inputTaken = true;
  14288. }
  14289. pktType = -1;
  14290. return true;
  14291.  
  14292. case 61:
  14293. anInt1055 = inStream.readUnsignedByte();
  14294. pktType = -1;
  14295. return true;
  14296.  
  14297. case 200:
  14298. int l8 = inStream.readUnsignedWord();
  14299. int i15 = inStream.readSignedWord();
  14300. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14301. class9_4.disabledAnimation = i15;
  14302. if(i15 == 591 || i15 == 588)
  14303. {
  14304. class9_4.modelZoom = 1600;
  14305. }
  14306. if(i15 == -1) {
  14307. class9_4.animationLength = 0;
  14308. class9_4.animationDelay = 0;
  14309. }
  14310. pktType = -1;
  14311. return true;
  14312.  
  14313. case 219:
  14314. if(invOverlayInterfaceID != -1) {
  14315. invOverlayInterfaceID = -1;
  14316. needDrawTabArea = true;
  14317. tabAreaAltered = true;
  14318. }
  14319. if(backDialogID != -1) {
  14320. backDialogID = -1;
  14321. inputTaken = true;
  14322. }
  14323. if(inputDialogState != 0) {
  14324. inputDialogState = 0;
  14325. inputTaken = true;
  14326. }
  14327. openInterfaceID = -1;
  14328. aBoolean1149 = false;
  14329. pktType = -1;
  14330. return true;
  14331.  
  14332. case 34:
  14333. needDrawTabArea = true;
  14334. int i9 = inStream.readUnsignedWord();
  14335. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14336. while(inStream.currentOffset < pktSize) {
  14337. int j20 = inStream.method422();
  14338. int i23 = inStream.readUnsignedWord();
  14339. int l25 = inStream.readUnsignedByte();
  14340. if(l25 == 255)
  14341. l25 = inStream.readDWord();
  14342. if(j20 >= 0 && j20 < class9_2.inventory.length) {
  14343. class9_2.inventory[j20] = i23;
  14344. class9_2.inventoryValue[j20] = l25;
  14345. }
  14346. }
  14347. pktType = -1;
  14348. return true;
  14349.  
  14350. case 4:
  14351. case 44:
  14352. case 84:
  14353. case 101:
  14354. case 105:
  14355. case 117:
  14356. case 147:
  14357. case 151:
  14358. case 156:
  14359. case 160:
  14360. case 215:
  14361. method137(inStream, pktType);
  14362. pktType = -1;
  14363. return true;
  14364.  
  14365. case 106:
  14366. tabID = inStream.method427();
  14367. needDrawTabArea = true;
  14368. tabAreaAltered = true;
  14369. pktType = -1;
  14370. return true;
  14371.  
  14372. case 164:
  14373. int j9 = inStream.method434();
  14374. method60(j9);
  14375. if(invOverlayInterfaceID != -1) {
  14376. invOverlayInterfaceID = -1;
  14377. needDrawTabArea = true;
  14378. tabAreaAltered = true;
  14379. }
  14380. backDialogID = j9;
  14381. inputTaken = true;
  14382. openInterfaceID = -1;
  14383. aBoolean1149 = false;
  14384. pktType = -1;
  14385. return true;
  14386.  
  14387. }
  14388. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  14389. //resetLogout();
  14390. } catch(IOException _ex) {
  14391. dropClient();
  14392. } catch(Exception exception) {
  14393. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  14394. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  14395. s2 = s2 + inStream.buffer[j15] + ",";
  14396. signlink.reporterror(s2);
  14397. //resetLogout();
  14398. }
  14399. pktType = -1;
  14400. return true;
  14401. }
  14402.  
  14403. private void method146() {
  14404.  
  14405.  
  14406. anInt1265++;
  14407. method47(true);
  14408. method26(true);
  14409. method47(false);
  14410. method26(false);
  14411. method55();
  14412. method104();
  14413. if(!aBoolean1160) {
  14414. int i = anInt1184;
  14415. if(anInt984 / 256 > i)
  14416. i = anInt984 / 256;
  14417. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  14418. i = anIntArray1203[4] + 128;
  14419. int k = minimapInt1 + anInt896 & 0x7ff;
  14420. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  14421.  
  14422.  
  14423.  
  14424. }
  14425. int j;
  14426. if(!aBoolean1160)
  14427. j = method120();
  14428. else
  14429. j = method121();
  14430. int l = xCameraPos;
  14431. int i1 = zCameraPos;
  14432. int j1 = yCameraPos;
  14433. int k1 = yCameraCurve;
  14434. int l1 = xCameraCurve;
  14435. for(int i2 = 0; i2 < 5; i2++)
  14436. if(aBooleanArray876[i2]) {
  14437. int j2 = (int)((Math.random() * (double)(anIntArray873[i2] * 2 + 1) - (double)anIntArray873[i2]) + Math.sin((double)anIntArray1030[i2] * ((double)anIntArray928[i2] / 100D)) * (double)anIntArray1203[i2]);
  14438. if(i2 == 0)
  14439. xCameraPos += j2;
  14440. if(i2 == 1)
  14441. zCameraPos += j2;
  14442. if(i2 == 2)
  14443. yCameraPos += j2;
  14444. if(i2 == 3)
  14445. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  14446. if(i2 == 4) {
  14447. yCameraCurve += j2;
  14448. if(yCameraCurve < 128)
  14449. yCameraCurve = 128;
  14450. if(yCameraCurve > 383)
  14451. yCameraCurve = 383;
  14452. }
  14453. }
  14454. int k2 = Texture.anInt1481;
  14455. Model.aBoolean1684 = true;
  14456. Model.anInt1687 = 0;
  14457. Model.anInt1685 = super.mouseX - 4;
  14458. Model.anInt1686 = super.mouseY - 4;
  14459. DrawingArea.setAllPixelsToZero();
  14460. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  14461. worldController.clearObj5Cache();
  14462. updateEntities();
  14463. drawHeadIcon();
  14464. method37(k2);
  14465. draw3dScreen();
  14466. if(drawFlag) {
  14467. if(xpToDraw != 0) {
  14468. if(flagPos < 125) {
  14469. if(flagPos < 100) {
  14470. flagPos += 2;
  14471. } else {
  14472. flagPos += 1;
  14473. }
  14474. xpFlag.drawSprite(423, flagPos);
  14475. newSmallFont.drawBasicString(""+xpToDraw+"xp", 470, flagPos+20, 0xCC6600, 1);
  14476. } else { }
  14477. if(flagPos >= 125) {
  14478. drawFlag = false;
  14479. flagPos = 72;
  14480. xpToDraw = 0;
  14481. }
  14482. }
  14483. }
  14484. if(drawXpBar) {
  14485. String text = ""+testXp;
  14486. int txtWidth = newRegularFont.getTextWidth(text);
  14487. int drawX = 505-txtWidth;
  14488. sprite1.drawSprite(419, 51);
  14489. newRegularFont.drawBasicString("XP:", 421, 64, 0xFFFFFD, 0);
  14490. newRegularFont.drawBasicString(text, drawX, 64, 0xFFFFFD, 0);
  14491. }
  14492. inGameScreen.drawGraphics(4, super.graphics, 4);
  14493. xCameraPos = l;
  14494. zCameraPos = i1;
  14495. yCameraPos = j1;
  14496. yCameraCurve = k1;
  14497. xCameraCurve = l1;
  14498. }
  14499.  
  14500. /* Packets that opens interfaces */
  14501. public void sendFrame97(int interfaceID) {
  14502. method60(interfaceID);
  14503. if (invOverlayInterfaceID != -1) {
  14504. invOverlayInterfaceID = -1;
  14505. needDrawTabArea = true;
  14506. tabAreaAltered = true;
  14507. }
  14508. if (backDialogID != -1) {
  14509. backDialogID = -1;
  14510. inputTaken = true;
  14511. }
  14512. if (inputDialogState != 0) {
  14513. inputDialogState = 0;
  14514. inputTaken = true;
  14515. }
  14516. openInterfaceID = interfaceID;
  14517. aBoolean1149 = false;
  14518. }
  14519. public void clearTopInterfaces() {
  14520.  
  14521. stream.createFrame(130);
  14522. if (invOverlayInterfaceID != -1) {
  14523. invOverlayInterfaceID = -1;
  14524. needDrawTabArea = true;
  14525. aBoolean1149 = false;
  14526. tabAreaAltered = true;
  14527. }
  14528. if (backDialogID != -1) {
  14529. backDialogID = -1;
  14530. inputTaken = true;
  14531. aBoolean1149 = false;
  14532. }
  14533. openInterfaceID = -1;
  14534. fullscreenInterfaceID = -1;
  14535. }
  14536.  
  14537. public client() {
  14538. tabHPos = -1;
  14539. alertHandler = new AlertHandler(this);
  14540. fullscreenInterfaceID = -1;
  14541. chatRights = new int[500];
  14542. chatTypeView = 0;
  14543. clanChatMode = 0;
  14544. cButtonHPos = -1;
  14545. cButtonHCPos = -1;
  14546. cButtonCPos = 0;
  14547. server = "23.249.164.178";
  14548. anIntArrayArray825 = new int[104][104];
  14549. friendsNodeIDs = new int[200];
  14550. groundArray = new NodeList[4][104][104];
  14551. aBoolean831 = false;
  14552. aStream_834 = new Stream(new byte[17000]);
  14553. npcArray = new NPC[16384];
  14554. npcIndices = new int[16384];
  14555. anIntArray840 = new int[1000];
  14556. aStream_847 = Stream.create();
  14557. aBoolean848 = true;
  14558. openInterfaceID = -1;
  14559. currentExp = new int[Skills.skillsCount];
  14560. aBoolean872 = false;
  14561. anIntArray873 = new int[5];
  14562. anInt874 = -1;
  14563. aBooleanArray876 = new boolean[5];
  14564. drawFlames = false;
  14565. reportAbuseInput = "";
  14566. unknownInt10 = -1;
  14567. menuOpen = false;
  14568. inputString = "";
  14569. maxPlayers = 2048;
  14570. myPlayerIndex = 2047;
  14571. playerArray = new Player[maxPlayers];
  14572. playerIndices = new int[maxPlayers];
  14573. anIntArray894 = new int[maxPlayers];
  14574. aStreamArray895s = new Stream[maxPlayers];
  14575. anInt897 = 1;
  14576. anIntArrayArray901 = new int[104][104];
  14577. anInt902 = 0x766654;
  14578. aByteArray912 = new byte[16384];
  14579. currentStats = new int[Skills.skillsCount];
  14580. ignoreListAsLongs = new long[100];
  14581. loadingError = false;
  14582. anInt927 = 0x332d25;
  14583. anIntArray928 = new int[5];
  14584. anIntArrayArray929 = new int[104][104];
  14585. chatTypes = new int[500];
  14586. chatNames = new String[500];
  14587. chatMessages = new String[500];
  14588. chatButtons = new Sprite[4];
  14589. sideIcons = new Sprite[14];
  14590. sIcons483 = new Sprite[14];
  14591. newSideIcons = new Sprite[16];
  14592. sIcons459 = new Sprite[13];
  14593.  
  14594. redStones = new Sprite[16];
  14595. aBoolean954 = true;
  14596. friendsListAsLongs = new long[200];
  14597. currentSong = -1;
  14598. drawingFlames = false;
  14599. spriteDrawX = -1;
  14600. spriteDrawY = -1;
  14601. anIntArray968 = new int[33];
  14602. anIntArray969 = new int[256];
  14603. decompressors = new Decompressor[5];
  14604. variousSettings = new int[2000];
  14605. aBoolean972 = false;
  14606. anInt975 = 50;
  14607. anIntArray976 = new int[anInt975];
  14608. anIntArray977 = new int[anInt975];
  14609. anIntArray978 = new int[anInt975];
  14610. anIntArray979 = new int[anInt975];
  14611. anIntArray980 = new int[anInt975];
  14612. anIntArray981 = new int[anInt975];
  14613. anIntArray982 = new int[anInt975];
  14614. aStringArray983 = new String[anInt975];
  14615. anInt985 = -1;
  14616. hitMarks = new Sprite[24];
  14617. hitMark = new Sprite[4];
  14618. anIntArray990 = new int[5];
  14619. aBoolean994 = false;
  14620. anInt1002 = 0x23201b;
  14621. amountOrNameInput = "";
  14622. aClass19_1013 = new NodeList();
  14623. aBoolean1017 = false;
  14624. anInt1018 = -1;
  14625. anIntArray1030 = new int[5];
  14626. aBoolean1031 = false;
  14627. mapFunctions = new Sprite[100];
  14628. dialogID = -1;
  14629. maxStats = new int[Skills.skillsCount];
  14630. anIntArray1045 = new int[2000];
  14631. aBoolean1047 = true;
  14632. anIntArray1052 = new int[152];//map
  14633. anInt1054 = -1;
  14634. aClass19_1056 = new NodeList();
  14635. anIntArray1057 = new int[33];
  14636. aClass9_1059 = new RSInterface();
  14637. mapScenes = new Background[100];
  14638. barFillColor = 0x4d4233;
  14639. anIntArray1065 = new int[7];
  14640. anIntArray1072 = new int[1000];
  14641. anIntArray1073 = new int[1000];
  14642. aBoolean1080 = false;
  14643. friendsList = new String[200];
  14644. inStream = Stream.create();
  14645. expectedCRCs = new int[9];
  14646. menuActionCmd2 = new int[500];
  14647. menuActionCmd3 = new int[500];
  14648. menuActionID = new int[500];
  14649. menuActionCmd1 = new int[500];
  14650. headIcons = new Sprite[29];
  14651. skullIcons = new Sprite[20];
  14652. headIconsHint = new Sprite[20];
  14653. tabAreaAltered = false;
  14654. aString1121 = "";
  14655. atPlayerActions = new String[5];
  14656. atPlayerArray = new boolean[5];
  14657. anIntArrayArrayArray1129 = new int[4][13][13];
  14658. anInt1132 = 2;
  14659. aSpriteArray1140 = new Sprite[1000];
  14660. aBoolean1141 = false;
  14661. aBoolean1149 = false;
  14662. crosses = new Sprite[8];
  14663. musicEnabled = true;
  14664. needDrawTabArea = false;
  14665. loggedIn = false;
  14666. canMute = false;
  14667. aBoolean1159 = false;
  14668. aBoolean1160 = false;
  14669. anInt1171 = 1;
  14670. myUsername = "";
  14671. myPassword = "";
  14672. genericLoadingError = false;
  14673. reportAbuseInterfaceID = -1;
  14674. aClass19_1179 = new NodeList();
  14675. anInt1184 = 128;
  14676. invOverlayInterfaceID = -1;
  14677. stream = Stream.create();
  14678. menuActionName = new String[500];
  14679. anIntArray1203 = new int[5];
  14680. anIntArray1207 = new int[50];
  14681. anInt1210 = 2;
  14682. anInt1211 = 78;
  14683. promptInput = "";
  14684. //modIcons = new Background[2];
  14685. modIcons = new Sprite[7];
  14686. chatImages = new Sprite[7];
  14687. tabID = 3;
  14688. inputTaken = false;
  14689. songChanging = true;
  14690. anIntArray1229 = new int[152];//map
  14691. aClass11Array1230 = new Class11[4];
  14692. aBoolean1233 = false;
  14693. anIntArray1240 = new int[100];
  14694. anIntArray1241 = new int[50];
  14695. aBoolean1242 = false;
  14696. anIntArray1250 = new int[50];
  14697. rsAlreadyLoaded = false;
  14698. welcomeScreenRaised = true;
  14699. messagePromptRaised = false;
  14700. loginMessage1 = "";
  14701. loginMessage2 = "";
  14702. backDialogID = -1;
  14703. anInt1279 = 2;
  14704. bigX = new int[4000];
  14705. bigY = new int[4000];
  14706. anInt1289 = -1;
  14707. }
  14708.  
  14709. public int rights;
  14710.  
  14711.  
  14712. public String name;
  14713. public String disabledMessage;
  14714. public String clanname;
  14715. private final int[] chatRights;
  14716. public int chatTypeView;
  14717. public int clanChatMode;
  14718. public int duelMode;
  14719. /* Declare custom sprites */
  14720. //private Sprite chatArea;
  14721. private Sprite loadingPleaseWait;
  14722. private Sprite reestablish;
  14723. private Sprite loadingBarFull;
  14724. private Sprite loadingBarEmpty;
  14725. private Sprite[] chatButtons;
  14726. //private Sprite tabArea;
  14727. private Sprite mapArea;
  14728. private Sprite tabHover;
  14729. private Sprite tabClicked;
  14730. private Sprite[] newSideIcons;
  14731. //private Sprite CustomMapback;
  14732. public Sprite[] CustomMapback = new Sprite[5];
  14733. public Sprite[] chatArea = new Sprite[5];
  14734. public Sprite[] tabArea = new Sprite[5];
  14735. //public Sprite[] mapArea = new Sprite[3];
  14736. /**/
  14737. private RSImageProducer leftFrame;
  14738. private RSImageProducer topFrame;
  14739. private RSImageProducer rightFrame;
  14740. private int ignoreCount;
  14741. private long aLong824;
  14742. private int[][] anIntArrayArray825;
  14743. private int[] friendsNodeIDs;
  14744. private NodeList[][][] groundArray;
  14745. private int[] anIntArray828;
  14746. private int[] anIntArray829;
  14747. private volatile boolean aBoolean831;
  14748. private Socket aSocket832;
  14749. private int loginScreenState;
  14750. private Stream aStream_834;
  14751. private NPC[] npcArray;
  14752. private int npcCount;
  14753. private int[] npcIndices;
  14754. private int anInt839;
  14755. private int[] anIntArray840;
  14756. private int anInt841;
  14757. private int anInt842;
  14758. private int anInt843;
  14759. private String aString844;
  14760. private int privateChatMode;
  14761. private Stream aStream_847;
  14762. private boolean aBoolean848;
  14763. private static int anInt849;
  14764. private int[] anIntArray850;
  14765. private int[] anIntArray851;
  14766. private int[] anIntArray852;
  14767. private int[] anIntArray853;
  14768. private static int anInt854;
  14769. private int anInt855;
  14770. private int openInterfaceID;
  14771. private int xCameraPos;
  14772. private int zCameraPos;
  14773. private int yCameraPos;
  14774. private int yCameraCurve;
  14775. private int xCameraCurve;
  14776. public int myPrivilege;
  14777. private final int[] currentExp;
  14778. private Sprite[] redStones;
  14779. private Sprite mapFlag;
  14780. private Sprite mapMarker;
  14781. private boolean aBoolean872;
  14782. private final int[] anIntArray873;
  14783. private int anInt874;
  14784. private final boolean[] aBooleanArray876;
  14785. private int weight;
  14786. private MouseDetection mouseDetection;
  14787. private volatile boolean drawFlames;
  14788. private String reportAbuseInput;
  14789. private int unknownInt10;
  14790. private boolean menuOpen;
  14791. private int anInt886;
  14792. private String inputString;
  14793. private final int maxPlayers;
  14794. private final int myPlayerIndex;
  14795. private Player[] playerArray;
  14796. private int playerCount;
  14797. private int[] playerIndices;
  14798. private int anInt893;
  14799. private int[] anIntArray894;
  14800. private Stream[] aStreamArray895s;
  14801. private int anInt896;
  14802. private int anInt897;
  14803. private int friendsCount;
  14804. private int anInt900;
  14805. private int[][] anIntArrayArray901;
  14806. private final int anInt902;
  14807. private byte[] aByteArray912;
  14808. private int anInt913;
  14809. private int crossX;
  14810. private int crossY;
  14811. private int crossIndex;
  14812. private int crossType;
  14813. private int plane;
  14814. private final int[] currentStats;
  14815. private static int anInt924;
  14816. private final long[] ignoreListAsLongs;
  14817. private boolean loadingError;
  14818. private final int anInt927;
  14819. private final int[] anIntArray928;
  14820. private int[][] anIntArrayArray929;
  14821. private Sprite aSprite_931;
  14822. private Sprite aSprite_932;
  14823. private int anInt933;
  14824. private int anInt934;
  14825. private int anInt935;
  14826. private int anInt936;
  14827. private int anInt937;
  14828. private int anInt938;
  14829. private static int anInt940;
  14830. private final int[] chatTypes;
  14831. private final String[] chatNames;
  14832. private final String[] chatMessages;
  14833. private int anInt945;
  14834. private WorldController worldController;
  14835. private Sprite[] sideIcons;
  14836. private Sprite[] sIcons483;
  14837. private Sprite[] sIcons459;
  14838. private int menuScreenArea;
  14839. private int menuOffsetX;
  14840. private int menuOffsetY;
  14841. private int menuWidth;
  14842. private int menuHeight;
  14843. private long aLong953;
  14844. private boolean aBoolean954;
  14845. private long[] friendsListAsLongs;
  14846. private String[] clanList = new String[100];
  14847. private int currentSong;
  14848. private static int nodeID = 10;
  14849. static int portOff;
  14850. static boolean clientData;
  14851. private static boolean isMembers = true;
  14852. private static boolean lowMem;
  14853. private volatile boolean drawingFlames;
  14854. private int spriteDrawX;
  14855. private int spriteDrawY;
  14856. private final int[] anIntArray965 = {
  14857. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  14858. };
  14859. private Background titleBox;
  14860. public Sprite titleBox1;
  14861. private Background titleButton;
  14862. private final int[] anIntArray968;
  14863. private final int[] anIntArray969;
  14864. final Decompressor[] decompressors;
  14865. public int variousSettings[];
  14866. private boolean aBoolean972;
  14867. private final int anInt975;
  14868. private final int[] anIntArray976;
  14869. private final int[] anIntArray977;
  14870. private final int[] anIntArray978;
  14871. private final int[] anIntArray979;
  14872. private final int[] anIntArray980;
  14873. private final int[] anIntArray981;
  14874. private final int[] anIntArray982;
  14875. private final String[] aStringArray983;
  14876. private int anInt984;
  14877. private int anInt985;
  14878. private static int anInt986;
  14879. private Sprite[] hitMarks;
  14880. private Sprite[] hitMark;
  14881. private int anInt988;
  14882. private int anInt989;
  14883. private final int[] anIntArray990;
  14884. private static boolean aBoolean993;
  14885. private final boolean aBoolean994;
  14886. private int anInt995;
  14887. private int anInt996;
  14888. private int anInt997;
  14889. private int anInt998;
  14890. private int anInt999;
  14891. private ISAACRandomGen encryption;
  14892. private Sprite mapEdge;
  14893. private Sprite multiOverlay;
  14894. private final int anInt1002;
  14895. static final int[][] anIntArrayArray1003 = {
  14896. {
  14897. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  14898. 2983, 54193
  14899. }, {
  14900. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  14901. 56621, 4783, 1341, 16578, 35003, 25239
  14902. }, {
  14903. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  14904. 10153, 56621, 4783, 1341, 16578, 35003
  14905. }, {
  14906. 4626, 11146, 6439, 12, 4758, 10270
  14907. }, {
  14908. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  14909. }
  14910. };
  14911. private String amountOrNameInput;
  14912. private static int anInt1005;
  14913. private int daysSinceLastLogin;
  14914. private int pktSize;
  14915. private int pktType;
  14916. private int anInt1009;
  14917. private int anInt1010;
  14918. private int anInt1011;
  14919. private NodeList aClass19_1013;
  14920. private int anInt1014;
  14921. private int anInt1015;
  14922. private int anInt1016;
  14923. private boolean aBoolean1017;
  14924. private int anInt1018;
  14925. private static final int[] anIntArray1019;
  14926. private int anInt1021;
  14927. private int anInt1022;
  14928. private int loadingStage;
  14929. private Sprite scrollBar1;
  14930. private Sprite scrollBar2;
  14931. private Sprite scrollBar3;
  14932. private Sprite scrollBar4;
  14933. private int anInt1026;
  14934. private Background backBase1;
  14935. private Background backBase2;
  14936. private Background backHmid1;
  14937. private final int[] anIntArray1030;
  14938. private boolean aBoolean1031;
  14939. private Sprite[] mapFunctions;
  14940. private int baseX;
  14941. private int baseY;
  14942. private int anInt1036;
  14943. private int anInt1037;
  14944. private int loginFailures;
  14945. private int anInt1039;
  14946. private int anInt1040;
  14947. private int anInt1041;
  14948. private int dialogID;
  14949. private final int[] maxStats;
  14950. private final int[] anIntArray1045;
  14951. private int anInt1046;
  14952. private boolean aBoolean1047;
  14953. private int anInt1048;
  14954. private String aString1049;
  14955. private static int anInt1051;
  14956. private final int[] anIntArray1052;
  14957. private NamedArchive titleStreamLoader;
  14958. private int anInt1054;
  14959. private int anInt1055;
  14960. private NodeList aClass19_1056;
  14961. private final int[] anIntArray1057;
  14962. public final RSInterface aClass9_1059;
  14963. private Background[] mapScenes;
  14964. private static int anInt1061;
  14965. private int anInt1062;
  14966. private final int barFillColor;
  14967. private int friendsListAction;
  14968. private final int[] anIntArray1065;
  14969. private int mouseInvInterfaceIndex;
  14970. private int lastActiveInvInterface;
  14971. public OnDemandFetcher onDemandFetcher;
  14972. private int anInt1069;
  14973. private int anInt1070;
  14974. private int anInt1071;
  14975. private int[] anIntArray1072;
  14976. private int[] anIntArray1073;
  14977. private Sprite mapDotItem;
  14978. private Sprite mapDotNPC;
  14979. private Sprite mapDotPlayer;
  14980. private Sprite mapDotFriend;
  14981. private Sprite mapDotTeam;
  14982. private Sprite mapDotClan;
  14983. private int anInt1079;
  14984. private boolean aBoolean1080;
  14985. private String[] friendsList;
  14986. private Stream inStream;
  14987. private int anInt1084;
  14988. private int anInt1085;
  14989. private int activeInterfaceType;
  14990. private int anInt1087;
  14991. private int anInt1088;
  14992. public static int anInt1089;
  14993. private final int[] expectedCRCs;
  14994. public int[] menuActionCmd2;
  14995. public int[] menuActionCmd3;
  14996. public int[] menuActionID;
  14997. public int[] menuActionCmd1;
  14998. private Sprite[] headIcons;
  14999. private Sprite[] skullIcons;
  15000. private Sprite[] headIconsHint;
  15001. private static int anInt1097;
  15002. private int anInt1098;
  15003. private int anInt1099;
  15004. private int anInt1100;
  15005. private int anInt1101;
  15006. private int anInt1102;
  15007. private static boolean tabAreaAltered;
  15008. private int anInt1104;
  15009. private RSImageProducer aRSImageProducer_1107;
  15010. private RSImageProducer aRSImageProducer_1108;
  15011. private RSImageProducer loginScreenArea;
  15012. private RSImageProducer leftSideFlame;
  15013. private RSImageProducer rightSideFlame;
  15014. private RSImageProducer gameLogo;
  15015. private RSImageProducer aRSImageProducer_1113;
  15016. private RSImageProducer aRSImageProducer_1114;
  15017. private RSImageProducer aRSImageProducer_1115;
  15018. private static int anInt1117;
  15019. private int membersInt;
  15020. private String aString1121;
  15021. private Sprite compass;
  15022. private RSImageProducer aRSImageProducer_1123;
  15023. private RSImageProducer aRSImageProducer_1124;
  15024. private RSImageProducer aRSImageProducer_1125;
  15025. public static Player myPlayer;
  15026. private final String[] atPlayerActions;
  15027. private final boolean[] atPlayerArray;
  15028. private final int[][][] anIntArrayArrayArray1129;
  15029. private final int[] tabInterfaceIDs = {
  15030. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  15031. -1, -1, -1, -1, -1, -1, -1
  15032. };
  15033. private int anInt1131;
  15034. private int anInt1132;
  15035. public int menuActionRow;
  15036. private static int anInt1134;
  15037. private int spellSelected;
  15038. private int anInt1137;
  15039. private int spellUsableOn;
  15040. private String spellTooltip;
  15041. private Sprite[] aSpriteArray1140;
  15042. private boolean aBoolean1141;
  15043. private static int anInt1142;
  15044. public int energy;
  15045. private boolean aBoolean1149;
  15046. private Sprite[] crosses;
  15047. private boolean musicEnabled;
  15048. private Background[] aBackgroundArray1152s;
  15049. private static boolean needDrawTabArea;
  15050. private int unreadMessages;
  15051. private static int anInt1155;
  15052. private static boolean fpsOn;
  15053. public boolean loggedIn;
  15054. private boolean canMute;
  15055. private boolean aBoolean1159;
  15056. private boolean aBoolean1160;
  15057. static int loopCycle;
  15058. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  15059. private RSImageProducer inventoryBackImage;
  15060. private RSImageProducer mapEdgeIP;
  15061. private RSImageProducer mapBackImage;
  15062. private RSImageProducer inGameScreen;
  15063. private RSImageProducer chatBackImage;
  15064. private int daysSinceRecovChange;
  15065. private RSSocket socketStream;
  15066. private int anInt1169;
  15067. private int minimapInt3;
  15068. private int anInt1171;
  15069. private long aLong1172;
  15070. private String myUsername;
  15071. private String myPassword;
  15072. private static int anInt1175;
  15073. private boolean genericLoadingError;
  15074. private final int[] anIntArray1177 = {
  15075. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  15076. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  15077. 2, 2, 3
  15078. };
  15079. private int reportAbuseInterfaceID;
  15080. private NodeList aClass19_1179;
  15081. private int[] anIntArray1180;
  15082. private int[] anIntArray1181;
  15083. private int[] anIntArray1182;
  15084. private byte[][] aByteArrayArray1183;
  15085. private int anInt1184;
  15086. private int minimapInt1;
  15087. private int anInt1186;
  15088. private int anInt1187;
  15089. private static int anInt1188;
  15090. private int invOverlayInterfaceID;
  15091. private int[] anIntArray1190;
  15092. private int[] anIntArray1191;
  15093. public Stream stream;
  15094. private int anInt1193;
  15095. private int splitPrivateChat;
  15096. private Background mapBack;
  15097. public String[] menuActionName;
  15098. private Sprite aSprite_1201;
  15099. private Sprite aSprite_1202;
  15100. private final int[] anIntArray1203;
  15101. static final int[] anIntArray1204 = {
  15102. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  15103. 58654, 5027, 1457, 16565, 34991, 25486
  15104. };
  15105. private static boolean flagged;
  15106. private final int[] anIntArray1207;
  15107. private int anInt1208;
  15108. private int minimapInt2;
  15109. private int anInt1210;
  15110. private int anInt1211;
  15111. private String promptInput;
  15112. private int anInt1213;
  15113. private int[][][] intGroundArray;
  15114. private long aLong1215;
  15115. private int loginScreenCursorPos;
  15116. //private final Background[] modIcons;
  15117. public final Sprite[] modIcons;
  15118. private long aLong1220;
  15119. private static int tabID;
  15120. private int anInt1222;
  15121. public static boolean inputTaken;
  15122. public int inputDialogState;
  15123. private static int anInt1226;
  15124. private int nextSong;
  15125. private boolean songChanging;
  15126. private final int[] anIntArray1229;
  15127. private Class11[] aClass11Array1230;
  15128. public static int anIntArray1232[];
  15129. private boolean aBoolean1233;
  15130. private int[] anIntArray1234;
  15131. private int[] anIntArray1235;
  15132. private int[] anIntArray1236;
  15133. private int anInt1237;
  15134. private int anInt1238;
  15135. public final int anInt1239 = 100;
  15136. private final int[] anIntArray1240;
  15137. private final int[] anIntArray1241;
  15138. private boolean aBoolean1242;
  15139. private int atInventoryLoopCycle;
  15140. private int atInventoryInterface;
  15141. private int atInventoryIndex;
  15142. private int atInventoryInterfaceType;
  15143. private byte[][] aByteArrayArray1247;
  15144. private int tradeMode;
  15145. private int anInt1249;
  15146. private final int[] anIntArray1250;
  15147. private int anInt1251;
  15148. private final boolean rsAlreadyLoaded;
  15149. private int anInt1253;
  15150. private int anInt1254;
  15151. private boolean welcomeScreenRaised;
  15152. private boolean messagePromptRaised;
  15153. private int anInt1257;
  15154. private byte[][][] byteGroundArray;
  15155. private int prevSong;
  15156. private int destX;
  15157. private int destY;
  15158. private Sprite aSprite_1263;
  15159. private int anInt1264;
  15160. private int anInt1265;
  15161. private String loginMessage1;
  15162. private String loginMessage2;
  15163. private int anInt1268;
  15164. private int anInt1269;
  15165. public RSFont smallText;
  15166. public RSFont aTextDrawingArea_1271;
  15167. private RSFont chatTextDrawingArea;
  15168. private int anInt1275;
  15169. private int backDialogID;
  15170. private int anInt1278;
  15171. private int anInt1279;
  15172. private int[] bigX;
  15173. private int[] bigY;
  15174. private int itemSelected;
  15175. private int anInt1283;
  15176. private int anInt1284;
  15177. private int anInt1285;
  15178. private String selectedItemName;
  15179. private int publicChatMode;
  15180. private static int anInt1288;
  15181. private int anInt1289;
  15182. public static int anInt1290;
  15183. public static String server = "23.249.164.178";
  15184.  
  15185. public int drawCount;
  15186. public int fullscreenInterfaceID;
  15187. public int anInt1044;//377
  15188. public int anInt1129;//377
  15189. public int anInt1315;//377
  15190. public int anInt1500;//377
  15191. public int anInt1501;//377
  15192. public int[] fullScreenTextureArray;
  15193. public void resetAllImageProducers() {
  15194. if (super.fullGameScreen != null) {
  15195. return;
  15196. }
  15197. chatBackImage = null;
  15198. mapBackImage = null;
  15199. inventoryBackImage = null;
  15200. inGameScreen = null;
  15201. aRSImageProducer_1124 = null;
  15202. aRSImageProducer_1125 = null;
  15203. aRSImageProducer_1107 = null;
  15204. aRSImageProducer_1108 = null;
  15205. loginScreenArea = null;
  15206. leftSideFlame = null;
  15207. rightSideFlame = null;
  15208. gameLogo = null;
  15209. aRSImageProducer_1113 = null;
  15210. aRSImageProducer_1114 = null;
  15211. aRSImageProducer_1115 = null;
  15212. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  15213. welcomeScreenRaised = true;
  15214. }
  15215. public boolean spriteChanged = false;
  15216. public int getSpriteID(){
  15217. spriteChanged = true;
  15218. if(is562)
  15219. return 4;
  15220. if(is459)
  15221. return 3;
  15222. if(is480)
  15223. return 2;
  15224. if(is508 || is525)
  15225. return 1;
  15226. if(is474)
  15227. return 0;
  15228. else
  15229. return 0;
  15230. }
  15231. public void launchURL(String url) {
  15232. String osName = System.getProperty("os.name");
  15233. try {
  15234. if (osName.startsWith("Mac OS")) {
  15235. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  15236. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  15237. openURL.invoke(null, new Object[] {url});
  15238. } else if (osName.startsWith("Windows"))
  15239. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  15240. else { //assume Unix or Linux
  15241. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  15242. String browser = null;
  15243. for (int count = 0; count < browsers.length && browser == null; count++)
  15244. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  15245. browser = browsers[count];
  15246. if (browser == null) {
  15247. throw new Exception("Could not find web browser");
  15248. } else
  15249. Runtime.getRuntime().exec(new String[] {browser, url});
  15250. }
  15251. } catch (Exception e) {
  15252. pushMessage("Failed to open URL.", 0, "");
  15253. }
  15254. }
  15255.  
  15256. static {
  15257. anIntArray1019 = new int[99];
  15258. int i = 0;
  15259. for(int j = 0; j < 99; j++) {
  15260. int l = j + 1;
  15261. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  15262. i += i1;
  15263. anIntArray1019[j] = i / 4;
  15264. }
  15265. anIntArray1232 = new int[32];
  15266. i = 2;
  15267. for(int k = 0; k < 32; k++) {
  15268. anIntArray1232[k] = i - 1;
  15269. i += i;
  15270. }
  15271. }
  15272. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement