Guest User

torvapkz v1 client-client.java

a guest
Aug 27th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 482.25 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(signlink.findcachedir()+"Maps/mapConfig.txt"));
  81. String s;
  82. int D = 0;
  83. while ((s = in.readLine()) != null) {
  84. positions[D] = Integer.parseInt(s.substring(s.indexOf("=")+1,s.indexOf("(")));
  85. landScapes[D] = Integer.parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")));
  86. objects[D] = Integer.parseInt(s.substring(s.indexOf("[")+1,s.indexOf("]")));
  87. D++;
  88. }
  89. } catch (IOException e) {
  90. e.printStackTrace();
  91. }
  92. }
  93.  
  94. public static String capitalize(String s) {
  95. for (int i = 0; i < s.length(); i++) {
  96. if (i == 0) {
  97. s = String.format( "%s%s",
  98. Character.toUpperCase(s.charAt(0)),
  99. s.substring(1) );
  100. }
  101. if (!Character.isLetterOrDigit(s.charAt(i))) {
  102. if (i + 1 < s.length()) {
  103. s = String.format( "%s%s%s",
  104. s.subSequence(0, i+1),
  105. Character.toUpperCase(s.charAt(i + 1)),
  106. s.substring(i+2) );
  107. }
  108. }
  109. }
  110. return s;
  111. }
  112.  
  113. public int MapX, MapY;
  114. public static int spellID = 0;
  115. private static String intToKOrMilLongName(int i) {
  116. String s = String.valueOf(i);
  117. for(int k = s.length() - 3; k > 0; k -= 3)
  118. s = s.substring(0, k) + "," + s.substring(k);
  119. //if(j != 0)
  120. // aBoolean1224 = !aBoolean1224;
  121. if(s.length() > 8)
  122. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  123. else
  124. if(s.length() > 4)
  125. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  126. return " " + s;
  127. }
  128. public final String methodR(/*int i,*/ int j) {
  129. //if(i <= 0)
  130. // pktType = inStream.readUnsignedByte();
  131. if(j >= 0 && j < 10000)
  132. return String.valueOf(j);
  133. if(j >= 10000 && j < 10000000)
  134. return j / 1000 + "K";
  135. if(j >= 10000000 && j < 999999999)
  136. return j / 1000000 + "M";
  137. if(j >= 999999999)
  138. return "*";
  139. else
  140. return "?";
  141. }
  142.  
  143. public void models() {
  144. for(int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  145. byte[] abyte0 = getModel(ModelIndex);
  146. if(abyte0 != null && abyte0.length > 0) {
  147.  
  148. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  149. pushMessage("Model added successfully!", 0, "");
  150. }
  151. }
  152. }
  153. public byte[] getModel(int Index) {
  154. try {
  155. File Model = new File(signlink.findcachedir() + "/Raw/"+Index+".dat");//there we go.
  156. byte[] aByte = new byte[(int)Model.length()];
  157. FileInputStream fis = new FileInputStream(Model);
  158. fis.read(aByte);
  159. pushMessage("aByte = ["+aByte+"]!", 0, "");
  160. fis.close();
  161.  
  162. return aByte;
  163. }
  164. catch(Exception e)
  165. {return null;}
  166. }
  167.  
  168. private void stopMidi() {
  169. signlink.midifade = 0;
  170. signlink.midi = "stop";
  171. }
  172.  
  173. private boolean menuHasAddFriend(int j) {
  174. if(j < 0)
  175. return false;
  176. int k = menuActionID[j];
  177. if(k >= 2000)
  178. k -= 2000;
  179. return k == 337;
  180. }
  181.  
  182. public void drawChannelButtons() {
  183. if(is459) {
  184. aTextDrawingArea_1271.method389(true, 25, 0xffffff, "Public chat", 142);
  185. aTextDrawingArea_1271.method389(true, 150, 0xffffff, "Private chat", 142);
  186. aTextDrawingArea_1271.method389(true, 285, 0xffffff, "Trade/compete", 142);
  187. aTextDrawingArea_1271.method389(true, 422, 0xffffff, "Report Abuse", 147);
  188. if(publicChatMode == 0)
  189. aTextDrawingArea_1271.method382(65280, 55, "On", 153, true);
  190. if(publicChatMode == 1)
  191. aTextDrawingArea_1271.method382(0xffff00, 55, "Friends", 153, true);
  192. if(publicChatMode == 2)
  193. aTextDrawingArea_1271.method382(0xff0000, 55, "Off", 153, true);
  194. if(publicChatMode == 3)
  195. aTextDrawingArea_1271.method382(65535, 55, "Hide", 153, true);
  196. if(privateChatMode == 0)
  197. aTextDrawingArea_1271.method382(65280, 180, "On", 153, true);
  198. if(privateChatMode == 1)
  199. aTextDrawingArea_1271.method382(0xffff00, 180, "Friends", 153, true);
  200. if(privateChatMode == 2)
  201. aTextDrawingArea_1271.method382(0xff0000, 180, "Off", 153, true);
  202. if(tradeMode == 0)
  203. aTextDrawingArea_1271.method382(65280, 324, "On", 153, true);
  204. if(tradeMode == 1)
  205. aTextDrawingArea_1271.method382(0xffff00, 324, "Friends", 153, true);
  206. if(tradeMode == 2)
  207. aTextDrawingArea_1271.method382(0xff0000, 324, "Off", 153, true);
  208. } else if(is480 || is508 || is525 || is562) {
  209. String text[] = { "On", "Friends", "Off", "Hide" };
  210. int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  211. switch(cButtonCPos) {
  212. case 0: chatButtons[1].drawSprite(5, 142); break;
  213. case 1: chatButtons[1].drawSprite(62, 142); break;
  214. case 2: chatButtons[1].drawSprite(119, 142); break;
  215. case 3: chatButtons[1].drawSprite(176, 142); break;
  216. case 4: chatButtons[1].drawSprite(233, 142); break;
  217. case 5: chatButtons[1].drawSprite(290, 142); break;
  218. case 6: chatButtons[1].drawSprite(347, 142); break;
  219. } if(cButtonHPos == cButtonCPos) {
  220. switch(cButtonHPos) {
  221. case 0: chatButtons[2].drawSprite(5, 142); break;
  222. case 1: chatButtons[2].drawSprite(62, 142); break;
  223. case 2: chatButtons[2].drawSprite(119, 142); break;
  224. case 3: chatButtons[2].drawSprite(176, 142); break;
  225. case 4: chatButtons[2].drawSprite(233, 142); break;
  226. case 5: chatButtons[2].drawSprite(290, 142); break;
  227. case 7: chatButtons[2].drawSprite(347, 142); break;
  228. case 6: chatButtons[3].drawSprite(404, 142); break;
  229. }
  230. } else {
  231. switch(cButtonHPos) {
  232. case 0: chatButtons[2].drawSprite(5, 142); break;
  233. case 1: chatButtons[2].drawSprite(62, 142); break;
  234. case 2: chatButtons[2].drawSprite(119, 142); break;
  235. case 3: chatButtons[2].drawSprite(176, 142); break;
  236. case 4: chatButtons[2].drawSprite(233, 142); break;
  237. case 5: chatButtons[2].drawSprite(290, 142); break;
  238. case 7: chatButtons[2].drawSprite(347, 142); break;
  239. case 6: chatButtons[3].drawSprite(404, 142); break;
  240. }
  241. }
  242. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  243. smallText.method389(true, 26, 0xffffff, "All", 157);
  244. smallText.method389(true, 76, 0xffffff, "Game", 157);
  245. smallText.method389(true, 131, 0xffffff, "Public", 153);
  246. smallText.method389(true, 184, 0xffffff, "Private", 153);
  247. smallText.method389(true, 249, 0xffffff, "Clan", 153);
  248. smallText.method389(true, 304, 0xffffff, "Trade", 153);
  249. smallText.method389(true, 359, 0xffffff, "Assist", 153);
  250.  
  251. smallText.method382(disabledColor[publicChatMode], 147, text[publicChatMode], 164, true);
  252. smallText.method382(disabledColor[privateChatMode], 203, text[privateChatMode], 164, true);
  253. smallText.method382(disabledColor[clanChatMode], 261, text[clanChatMode], 164, true);
  254. smallText.method382(disabledColor[tradeMode], 318, text[tradeMode], 164, true);
  255. smallText.method382(0xff0000, 374, "Off", 164, true);
  256. } else if(is474) {
  257. String text[] = { "On", "Friends", "Off", "Hide" };
  258. int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  259. switch(cButtonCPos) {
  260. case 0: chatButtons[1].drawSprite(5, 142); break;
  261. case 1: chatButtons[1].drawSprite(71, 142); break;
  262. case 2: chatButtons[1].drawSprite(137, 142); break;
  263. case 3: chatButtons[1].drawSprite(203, 142); break;
  264. case 4: chatButtons[1].drawSprite(269, 142); break;
  265. case 5: chatButtons[1].drawSprite(335, 142); break;
  266. } if(cButtonHPos == cButtonCPos) {
  267. switch(cButtonHPos) {
  268. case 0: chatButtons[2].drawSprite(5, 142); break;
  269. case 1: chatButtons[2].drawSprite(71, 142); break;
  270. case 2: chatButtons[2].drawSprite(137, 142); break;
  271. case 3: chatButtons[2].drawSprite(203, 142); break;
  272. case 4: chatButtons[2].drawSprite(269, 142); break;
  273. case 5: chatButtons[2].drawSprite(335, 142); break;
  274. case 6: chatButtons[3].drawSprite(404, 142); break;
  275. }
  276. } else {
  277. switch(cButtonHPos) {
  278. case 0: chatButtons[0].drawSprite(5, 142); break;
  279. case 1: chatButtons[0].drawSprite(71, 142); break;
  280. case 2: chatButtons[0].drawSprite(137, 142); break;
  281. case 3: chatButtons[0].drawSprite(203, 142); break;
  282. case 4: chatButtons[0].drawSprite(269, 142); break;
  283. case 5: chatButtons[0].drawSprite(335, 142); break;
  284. case 6: chatButtons[3].drawSprite(404, 142); break;
  285. }
  286. }
  287. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  288. smallText.method389(true, 26, 0xffffff, "All", 157);
  289. smallText.method389(true, 86, 0xffffff, "Game", 157);
  290. smallText.method389(true, 150, 0xffffff, "Public", 152);
  291. smallText.method389(true, 212, 0xffffff, "Private", 152);
  292. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  293. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  294. smallText.method382(disabledColor[publicChatMode], 164, text[publicChatMode], 163, true);
  295. smallText.method382(disabledColor[privateChatMode], 230, text[privateChatMode], 163, true);
  296. smallText.method382(disabledColor[clanChatMode], 296, text[clanChatMode], 163, true);
  297. smallText.method382(disabledColor[tradeMode], 362, text[tradeMode], 163, true);
  298. }
  299. if(menuOpen){
  300. drawMenu(0, 338);
  301. }
  302. }
  303.  
  304. private void drawChatArea() {
  305. chatBackImage.initDrawingArea();
  306. Texture.anIntArray1472 = anIntArray1180;
  307. chatArea[getSpriteID()].drawSprite(0, 0);
  308. if(spriteChanged){
  309. aBoolean1233 = true;
  310. inputTaken = true;
  311. }
  312. if(is459) {
  313. RSFont textDrawingArea = aTextDrawingArea_1271;
  314. if(messagePromptRaised) {
  315. newBoldFont.drawCenteredString(aString1121, 239, 60, 0, -1);
  316. newBoldFont.drawCenteredString( promptInput + "*", 239, 80, 128, -1);
  317. } else if(inputDialogState == 1) {
  318. newBoldFont.drawCenteredString("Enter amount:", 239, 60, 0, -1);
  319. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  320. } else if(inputDialogState == 2) {
  321. newBoldFont.drawCenteredString("Enter name:", 239, 60, 0, -1);
  322. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  323. } else if(aString844 != null) {
  324. newBoldFont.drawCenteredString(aString844, 239, 60, 0, -1);
  325. newBoldFont.drawCenteredString("Click to continue", 239, 80, 128, -1);
  326. } else if(backDialogID != -1) {
  327. drawInterface(0, 16, RSInterface.interfaceCache[backDialogID], 20);
  328. } else if(dialogID != -1) {
  329. drawInterface(0, 16, RSInterface.interfaceCache[dialogID], 20);
  330. } else {
  331. int j77 = 0;
  332. int j = 0;
  333. DrawingArea.setDrawingArea(93+5, 0, 463, 22);
  334. for(int k = 0; k < 100; k++)
  335. if(chatMessages[k] != null) {
  336. int chatType = chatTypes[k];
  337. int yPos = (88 - j77 * 14) + anInt1089 + 5;
  338. String s1 = chatNames[k];
  339. byte byte0 = 0;
  340. if (s1 != null && s1.startsWith("@cr0@")) {
  341. s1 = s1.substring(5);
  342. byte0 = 1;
  343. } else if(s1 != null && s1.startsWith("@cr1@")) {
  344. s1 = s1.substring(5);
  345. byte0 = 2;
  346. } else if(s1 != null && s1.startsWith("@cr2@")) {
  347. s1 = s1.substring(5);
  348. byte0 = 3;
  349. } else if(s1 != null && s1.startsWith("@cr3@")) {
  350. s1 = s1.substring(5);
  351. byte0 = 4;
  352. }
  353. /* Draws Chat Colored Messages */
  354. if(chatType == 0) {
  355. if (chatTypeView == 5 || chatTypeView == 0) {
  356. if(yPos > 0 && yPos < 110)
  357. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0, -1);
  358. j++;
  359. j77++;
  360. }
  361. }
  362. /* Draws clickable URL text into chatarea */
  363. if(chatType == 9) {
  364. if (chatTypeView == 5 || chatTypeView == 0) {
  365. if(yPos > 0 && yPos < 110)
  366. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 19, yPos, 0x7e3200, -1);
  367. j++;
  368. j77++;
  369. }
  370. }
  371. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  372. if (chatTypeView == 1 || chatTypeView == 0) {
  373. if(yPos > 0 && yPos < 110) {
  374. int xPos = 19;
  375. switch(byte0) {
  376. case 1:
  377. modIcons[0].drawSprite(xPos, yPos - 12);
  378. xPos += 14;
  379. break;
  380. case 2:
  381. modIcons[1].drawSprite(xPos, yPos - 12);
  382. xPos += 14;
  383. break;
  384. case 3:
  385. modIcons[2].drawSprite(xPos, yPos - 12);
  386. xPos += 14;
  387. break;
  388. case 4:
  389. modIcons[3].drawSprite(xPos, yPos - 12);
  390. xPos += 14;
  391. break;
  392. }
  393. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  394. xPos += newRegularFont.getTextWidth(s1) + 8;
  395. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  396. }
  397. j++;
  398. j77++;
  399. }
  400. }
  401. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  402. if (chatTypeView == 2 || chatTypeView == 0) {
  403. if(yPos > 0 && yPos < 110) {
  404. int k1 = 4;
  405. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  406. k1 += newRegularFont.getTextWidth("From ");
  407. switch(byte0) {
  408. case 1:
  409. modIcons[0].drawSprite(k1, yPos - 12);
  410. k1 += 14;
  411. break;
  412. case 2:
  413. modIcons[1].drawSprite(k1, yPos - 12);
  414. k1 += 14;
  415. break;
  416. case 3:
  417. modIcons[2].drawSprite(k1, yPos - 12);
  418. k1 += 14;
  419. break;
  420. case 4:
  421. modIcons[3].drawSprite(k1, yPos - 12);
  422. k1 += 14;
  423. break;
  424. }
  425. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  426. k1 += newRegularFont.getTextWidth(s1) + 8;
  427. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  428. }
  429. j++;
  430. j77++;
  431. }
  432. }
  433. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  434. if (chatTypeView == 3 || chatTypeView == 0) {
  435. if(yPos > 0 && yPos < 110)
  436. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 19, yPos, 0x800080, -1);
  437. j++;
  438. j77++;
  439. }
  440. }
  441. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  442. if (chatTypeView == 2 || chatTypeView == 0) {
  443. if(yPos > 0 && yPos < 110)
  444. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0x800000, -1);
  445. j++;
  446. j77++;
  447. }
  448. }
  449. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  450. if (chatTypeView == 2 || chatTypeView == 0) {
  451. if(yPos > 0 && yPos < 110) {
  452. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  453. newRegularFont.drawBasicString(chatMessages[k], 12 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  454. }
  455. j++;
  456. j77++;
  457. }
  458. }
  459. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  460. if (chatTypeView == 3 || chatTypeView == 0) {
  461. if(yPos > 0 && yPos < 110)
  462. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  463. j++;
  464. j77++;
  465. }
  466. if(chatType == 11 && (clanChatMode == 0)) {
  467. if (chatTypeView == 11) {
  468. if(yPos > 0 && yPos < 110)
  469. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  470. j++;
  471. j77++;
  472. }
  473. }
  474. }
  475. if(chatType == 16) {
  476. int j2 = 40+11;
  477. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  478. if(chatTypeView == 11 || chatTypeView == 0) {
  479. if(yPos > 0 && yPos < 110)
  480. switch(chatRights[k]) {
  481. case 1:
  482. j2 += clanNameWidth;
  483. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  484. j2 += 15;
  485. break;
  486. case 2:
  487. j2 += clanNameWidth;
  488. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  489. j2 += 15;
  490. break;
  491. case 3:
  492. j2 += clanNameWidth;
  493. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  494. j2 += 15;
  495. break;
  496. case 4:
  497. j2 += clanNameWidth;
  498. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  499. j2 += 15;
  500. break;
  501. default:
  502. j2 += clanNameWidth;
  503. break;
  504. }
  505. newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
  506. newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
  507. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
  508. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  509. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  510. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  511.  
  512. j++;
  513. j77++;
  514. }
  515. }
  516. }
  517. DrawingArea.defaultDrawingAreaSize();
  518. anInt1211 = j * 14 + 7;
  519. if(anInt1211 < 78)
  520. anInt1211 = 78;
  521. drawScrollbar(77, anInt1211 - anInt1089 - 77, 20, 480, anInt1211);
  522. String s;
  523. if(myPlayer != null && myPlayer.name != null)
  524. s = myPlayer.name;
  525. else
  526. s = TextClass.fixName(capitalize(myUsername));
  527. newRegularFont.drawBasicString(s + ":", 19, 110, 0, -1);
  528. newRegularFont.drawBasicString(inputString + "*", 20 + textDrawingArea.getTextWidth(s + ": "), 110, 255, -1);
  529. DrawingArea.method339(97, 0x000000, 479, 17);
  530. }
  531. } else if(is474 || is480 || is508 || is525 || is562) {
  532. RSFont textDrawingArea = aTextDrawingArea_1271;
  533. if(messagePromptRaised) {
  534. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  535. newBoldFont.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
  536. } else if(inputDialogState == 1) {
  537. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  538. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  539. } else if(inputDialogState == 2) {
  540. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  541. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  542. } else if(aString844 != null) {
  543. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  544. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128, -1);
  545. } else if(backDialogID != -1) {
  546. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  547. } else if(dialogID != -1) {
  548. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  549. } else {
  550. int j77 = -3;
  551. int j = 0;
  552. DrawingArea.setDrawingArea(122, 8, 497, 7);
  553. for(int k = 0; k < 500; k++)
  554. if(chatMessages[k] != null) {
  555. int chatType = chatTypes[k];
  556. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  557. String s1 = chatNames[k];
  558. byte byte0 = 0;
  559. if (s1 != null && s1.startsWith("@cr0@")) {
  560. s1 = s1.substring(5);
  561. byte0 = 1;
  562. } else if(s1 != null && s1.startsWith("@cr1@")) {
  563. s1 = s1.substring(5);
  564. byte0 = 2;
  565. } else if(s1 != null && s1.startsWith("@cr2@")) {
  566. s1 = s1.substring(5);
  567. byte0 = 3;
  568. } else if(s1 != null && s1.startsWith("@cr3@")) {
  569. s1 = s1.substring(5);
  570. byte0 = 4;
  571. }
  572. /* Draws Chat Colored Messages */
  573. if(chatType == 0) {
  574. if (chatTypeView == 5 || chatTypeView == 0) {
  575. if(yPos > 0 && yPos < 210)
  576. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
  577. j++;
  578. j77++;
  579. }
  580. }
  581. /* Draws clickable URL text into chatarea */
  582. if(chatType == 9) {
  583. if (chatTypeView == 5 || chatTypeView == 0) {
  584. if(yPos > 0 && yPos < 210)
  585. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11, yPos, 0x7e3200, -1);
  586. j++;
  587. j77++;
  588. }
  589. }
  590. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  591. if (chatTypeView == 1 || chatTypeView == 0) {
  592. if(yPos > 0 && yPos < 210) {
  593. int xPos = 11;
  594. switch(byte0) {
  595. case 1:
  596. modIcons[0].drawSprite(xPos, yPos - 12);
  597. xPos += 14;
  598. break;
  599. case 2:
  600. modIcons[1].drawSprite(xPos, yPos - 12);
  601. xPos += 14;
  602. break;
  603. case 3:
  604. modIcons[2].drawSprite(xPos, yPos - 12);
  605. xPos += 14;
  606. break;
  607. case 4:
  608. modIcons[3].drawSprite(xPos, yPos - 12);
  609. xPos += 14;
  610. break;
  611. }
  612. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  613. xPos += newRegularFont.getTextWidth(s1) + 8;
  614. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  615. }
  616. j++;
  617. j77++;
  618. }
  619. }
  620. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  621. if (chatTypeView == 2 || chatTypeView == 0) {
  622. if(yPos > 0 && yPos < 210) {
  623. int k1 = 11;
  624. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  625. k1 += newRegularFont.getTextWidth("From ");
  626. switch(byte0) {
  627. case 1:
  628. modIcons[0].drawSprite(k1, yPos - 12);
  629. k1 += 14;
  630. break;
  631. case 2:
  632. modIcons[1].drawSprite(k1, yPos - 12);
  633. k1 += 14;
  634. break;
  635. case 3:
  636. modIcons[2].drawSprite(k1, yPos - 12);
  637. k1 += 14;
  638. break;
  639. case 4:
  640. modIcons[3].drawSprite(k1, yPos - 12);
  641. k1 += 14;
  642. break;
  643. }
  644. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  645. k1 += newRegularFont.getTextWidth(s1) + 8;
  646. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  647. }
  648. j++;
  649. j77++;
  650. }
  651. }
  652. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  653. if (chatTypeView == 3 || chatTypeView == 0) {
  654. if(yPos > 0 && yPos < 210)
  655. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
  656. j++;
  657. j77++;
  658. }
  659. }
  660. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  661. if (chatTypeView == 2 || chatTypeView == 0) {
  662. if(yPos > 0 && yPos < 210)
  663. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  664. j++;
  665. j77++;
  666. }
  667. }
  668. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  669. if (chatTypeView == 2 || chatTypeView == 0) {
  670. if(yPos > 0 && yPos < 210) {
  671. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  672. newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  673. }
  674. j++;
  675. j77++;
  676. }
  677. }
  678. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  679. if (chatTypeView == 3 || chatTypeView == 0) {
  680. if(yPos > 0 && yPos < 210)
  681. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  682. j++;
  683. j77++;
  684. }
  685. if(chatType == 11 && (clanChatMode == 0)) {
  686. if (chatTypeView == 11) {
  687. if(yPos > 0 && yPos < 210)
  688. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  689. j++;
  690. j77++;
  691. }
  692. }
  693. }
  694. if(chatType == 16) {
  695. int j2 = 40;
  696. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  697. if(chatTypeView == 11 || chatTypeView == 0) {
  698. if(yPos > 3 && yPos < 130)
  699. switch(chatRights[k]) {
  700. case 1:
  701. j2 += clanNameWidth;
  702. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  703. j2 += 14;
  704. break;
  705. case 2:
  706. j2 += clanNameWidth;
  707. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  708. j2 += 14;
  709. break;
  710. case 3:
  711. j2 += clanNameWidth;
  712. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  713. j2 += 14;
  714. break;
  715. case 4:
  716. j2 += clanNameWidth;
  717. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  718. j2 += 14;
  719. break;
  720. default:
  721. j2 += clanNameWidth;
  722. break;
  723. }
  724. newRegularFont.drawBasicString("[", 8, yPos, 0, -1);
  725. newRegularFont.drawBasicString("]", clanNameWidth + 16, yPos, 0, -1);
  726. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 14, yPos, 255, -1);
  727. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  728. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  729. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  730.  
  731. j++;
  732. j77++;
  733. }
  734. }
  735. }
  736. DrawingArea.defaultDrawingAreaSize();
  737. anInt1211 = j * 14 + 7 + 5;
  738. if(anInt1211 < 111)
  739. anInt1211 = 111;
  740. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  741. String s;
  742. if(myPlayer != null && myPlayer.name != null)
  743. s = myPlayer.name;
  744. else
  745. s = TextClass.fixName(capitalize(myUsername));
  746. if(is508) {
  747. qc.drawSprite(textDrawingArea.getTextWidth(s) + 11, 123);
  748. newRegularFont.drawBasicString(s, 11, 133, 0, -1);
  749. newRegularFont.drawBasicString(":", (25 + textDrawingArea.getTextWidth(s)), 133, 0, -1);
  750. newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "<col=0>|" : ""), 23 + textDrawingArea.getTextWidth(s + ": "), 133 ,255 , -1);
  751. DrawingArea.method339(121, 0x807660, 506, 7);
  752. } else {
  753. newRegularFont.drawBasicString(s + ":", 11, 133, 0, -1);
  754. newRegularFont.drawBasicString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
  755. DrawingArea.method339(121, 0x807660, 506, 7);
  756. }
  757. }
  758. }
  759. drawChannelButtons();
  760. chatBackImage.drawGraphics(338, super.graphics, 0);
  761. inGameScreen.initDrawingArea();
  762. Texture.anIntArray1472 = anIntArray1182;
  763. }
  764.  
  765. public void init() {
  766. try {
  767. System.out.println("ErasedPkz is loading..");
  768. nodeID = 10;//friends list order
  769. portOff = 0;
  770. setHighMem();
  771. isMembers = true;
  772. signlink.startpriv(InetAddress.getLocalHost());
  773. instance = this;
  774. initClientFrame(503, 765);//this it? 510 770
  775. } catch (Exception e) {
  776. e.printStackTrace();
  777. }
  778. }
  779.  
  780. public void drawTabHover() {
  781. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  782. tabHover.drawSprite(3+3, 0);
  783. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  784. tabHover.drawSprite(33+3, 0);
  785. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  786. tabHover.drawSprite(63+3, 0);
  787. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  788. tabHover.drawSprite(93+3, 0);
  789. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  790. tabHover.drawSprite(123+3, 0);
  791. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  792. tabHover.drawSprite(153+3, 0);
  793. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  794. tabHover.drawSprite(183+3, 0);
  795. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  796. tabHover.drawSprite(213+3, 0);
  797. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  798. tabHover.drawSprite(3+3, 298);
  799. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  800. tabHover.drawSprite(33+3, 298);
  801. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  802. tabHover.drawSprite(63+3, 298);
  803. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  804. tabHover.drawSprite(93+3, 298);
  805. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  806. tabHover.drawSprite(123+3, 298);
  807. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  808. tabHover.drawSprite(153+3, 298);
  809. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  810. tabHover.drawSprite(183+3,298);
  811. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  812. tabHover.drawSprite(213+3, 298);
  813. }
  814.  
  815. public void startRunnable(Runnable runnable, int i) {
  816. if(i > 10)
  817. i = 10;
  818. if(signlink.mainapp != null) {
  819. signlink.startthread(runnable, i);
  820. } else {
  821. super.startRunnable(runnable, i);
  822.  
  823. }
  824. }
  825.  
  826. public Socket openSocket(int port) throws IOException {
  827. return new Socket(InetAddress.getByName(server), port);
  828. }
  829.  
  830. private void processMenuClick() {
  831. if(activeInterfaceType != 0)
  832. return;
  833. int j = super.clickMode3;
  834. if(spellSelected == 1 && super.saveClickX >= 503 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  835. j = 0;
  836. if(menuOpen) {
  837. if(j != 1) {
  838. int k = super.mouseX;
  839. int j1 = super.mouseY;
  840. if(menuScreenArea == 0) {
  841. k -= 4;
  842. j1 -= 4;
  843. }
  844. if(menuScreenArea == 1) {
  845. k -= 516;//519
  846. j1 -= 168;
  847. }
  848. if(menuScreenArea == 2) {
  849. k -= 5;
  850. j1 -= 338;
  851. }
  852. if(menuScreenArea == 3) {
  853. k -= 516;//519
  854. j1 -= 0;
  855. }
  856. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  857. menuOpen = false;
  858. if(menuScreenArea == 1)
  859. needDrawTabArea = true;
  860. if(menuScreenArea == 2)
  861. inputTaken = true;
  862. }
  863. }
  864. if(j == 1) {
  865. int l = menuOffsetX;
  866. int k1 = menuOffsetY;
  867. int i2 = menuWidth;
  868. int k2 = super.saveClickX;
  869. int l2 = super.saveClickY;
  870. if(menuScreenArea == 0) {
  871. k2 -= 4;
  872. l2 -= 4;
  873. }
  874. if(menuScreenArea == 1) {
  875. k2 -= 516;//519
  876. l2 -= 168;
  877. }
  878. if(menuScreenArea == 2) {
  879. k2 -= 5;//17
  880. l2 -= 338;
  881. }
  882. if(menuScreenArea == 3) {
  883. k2 -= 516;//519
  884. l2 -= 0;
  885. }
  886. int i3 = -1;
  887. for(int j3 = 0; j3 < menuActionRow; j3++) {
  888. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  889. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  890. i3 = j3;
  891. }
  892. System.out.println(i3);
  893. if(i3 != -1)
  894. doAction(i3);
  895. menuOpen = false;
  896. if(menuScreenArea == 1)
  897. needDrawTabArea = true;
  898. if(menuScreenArea == 2) {
  899. inputTaken = true;
  900. }
  901. }
  902. } else {
  903. if(j == 1 && menuActionRow > 0) {
  904. int i1 = menuActionID[menuActionRow - 1];
  905. 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) {
  906. int l1 = menuActionCmd2[menuActionRow - 1];
  907. int j2 = menuActionCmd3[menuActionRow - 1];
  908. RSInterface class9 = RSInterface.interfaceCache[j2];
  909. if(class9.allowSwapItems || class9.deletesTargetSlot) {
  910. aBoolean1242 = false;
  911. anInt989 = 0;
  912. anInt1084 = j2;
  913. anInt1085 = l1;
  914. activeInterfaceType = 2;
  915. anInt1087 = super.saveClickX;
  916. anInt1088 = super.saveClickY;
  917. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  918. activeInterfaceType = 1;
  919. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  920. activeInterfaceType = 3;
  921. return;
  922. }
  923. }
  924. }
  925. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  926. j = 2;
  927. if(j == 1 && menuActionRow > 0)
  928. doAction(menuActionRow - 1);
  929. if(j == 2 && menuActionRow > 0)
  930. determineMenuSize();
  931.  
  932. }
  933. }
  934.  
  935.  
  936. public static int totalRead = 0;
  937.  
  938. public static String getFileNameWithoutExtension(String fileName) {
  939. File tmpFile = new File(fileName);
  940. tmpFile.getName();
  941. int whereDot = tmpFile.getName().lastIndexOf('.');
  942. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  943. return tmpFile.getName().substring(0, whereDot);
  944. }
  945. return "";
  946. }
  947.  
  948. public void preloadModels() {
  949. File file = new File(signlink.findcachedir()+"Raw/");
  950. File[] fileArray = file.listFiles();
  951. for(int y = 0; y < fileArray.length; y++) {
  952. String s = fileArray[y].getName();
  953. byte[] buffer = ReadFile(signlink.findcachedir()+"Raw/"+s);
  954. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  955. }
  956. }
  957.  
  958. public static final byte[] ReadFile(String s) {
  959. try {
  960. byte abyte0[];
  961. File file = new File(s);
  962. int i = (int)file.length();
  963. abyte0 = new byte[i];
  964. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  965. datainputstream.readFully(abyte0, 0, i);
  966. datainputstream.close();
  967. return abyte0;
  968. } catch(Exception e) {
  969. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  970. return null;
  971. }
  972. }
  973.  
  974. private void saveMidi(boolean flag, byte abyte0[]) {
  975. signlink.midifade = flag ? 1 : 0;
  976. signlink.midisave(abyte0, abyte0.length);
  977. }
  978.  
  979. public static void writeFile(byte[] data, String fileName) throws IOException{
  980. OutputStream out = new FileOutputStream(fileName);
  981. out.write(data);
  982. out.close();
  983. }
  984.  
  985. public final void method22() {
  986. try {
  987. anInt985 = -1;
  988. aClass19_1056.removeAll();
  989. aClass19_1013.removeAll();
  990. Texture.method366();
  991. unlinkMRUNodes();
  992. worldController.initToNull();
  993. System.gc();
  994. for(int i = 0; i < 4; i++)
  995. aClass11Array1230[i].method210();
  996. for(int l = 0; l < 4; l++) {
  997. for(int k1 = 0; k1 < 104; k1++) {
  998. for(int j2 = 0; j2 < 104; j2++)
  999. byteGroundArray[l][k1][j2] = 0;
  1000. }
  1001. }
  1002. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  1003. int k2 = aByteArrayArray1183.length;
  1004. int k18 = 64;
  1005. for(int A = 0; A < k2; A++)
  1006. for(int B = 0; B < 2000; B++)
  1007. if(anIntArray1234[A] == positions[B]){
  1008. anIntArray1235[A] = landScapes[B];
  1009. anIntArray1236[A] = objects[B];
  1010. }
  1011. stream.createFrame(0);
  1012. if(!aBoolean1159) {
  1013. for(int i3 = 0; i3 < k2; i3++) {
  1014. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1015. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1016. byte abyte0[] = aByteArrayArray1183[i3];
  1017. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat"))
  1018. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat");
  1019. if(abyte0 != null)
  1020. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  1021. }
  1022. for(int j4 = 0; j4 < k2; j4++) {
  1023. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1024. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1025. byte abyte2[] = aByteArrayArray1183[j4];
  1026. if(abyte2 == null && anInt1070 < 800)
  1027. objectManager.method174(k7, 64, 64, l5);
  1028. }
  1029. anInt1097++;
  1030. if(anInt1097 > 160) {
  1031. anInt1097 = 0;
  1032. stream.createFrame(238);
  1033. stream.writeWordBigEndian(96);
  1034. }
  1035. stream.createFrame(0);
  1036. for(int i6 = 0; i6 < k2; i6++) {
  1037. byte abyte1[] = aByteArrayArray1247[i6];
  1038. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat"))
  1039. abyte1 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat");
  1040. if(abyte1 != null) {
  1041. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1042. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1043. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  1044. }
  1045. }
  1046. }
  1047. if(aBoolean1159) {
  1048. for(int j3 = 0; j3 < 4; j3++) {
  1049. for(int k4 = 0; k4 < 13; k4++) {
  1050. for(int j6 = 0; j6 < 13; j6++) {
  1051. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1052. if(l7 != -1) {
  1053. int i9 = l7 >> 24 & 3;
  1054. int l9 = l7 >> 1 & 3;
  1055. int j10 = l7 >> 14 & 0x3ff;
  1056. int l10 = l7 >> 3 & 0x7ff;
  1057. int j11 = (j10 / 8 << 8) + l10 / 8;
  1058. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  1059. {
  1060. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  1061. continue;
  1062. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  1063. break;
  1064. }
  1065.  
  1066. }
  1067. }
  1068.  
  1069. }
  1070.  
  1071. }
  1072. for(int l4 = 0; l4 < 13; l4++) {
  1073. for(int k6 = 0; k6 < 13; k6++){
  1074. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1075. if(i8 == -1)
  1076. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1077. }
  1078. }
  1079. stream.createFrame(0);
  1080. for(int l6 = 0; l6 < 4; l6++) {
  1081. for(int j8 = 0; j8 < 13; j8++) {
  1082. for(int j9 = 0; j9 < 13; j9++) {
  1083. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1084. if(i10 != -1) {
  1085. int k10 = i10 >> 24 & 3;
  1086. int i11 = i10 >> 1 & 3;
  1087. int k11 = i10 >> 14 & 0x3ff;
  1088. int i12 = i10 >> 3 & 0x7ff;
  1089. int j12 = (k11 / 8 << 8) + i12 / 8;
  1090. for(int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1091. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  1092. continue;
  1093. byte abyte0[] = aByteArrayArray1247[k12];
  1094. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1095. break;
  1096. }
  1097. }
  1098. }
  1099. }
  1100. }
  1101. }
  1102. stream.createFrame(0);
  1103. objectManager.method171(aClass11Array1230, worldController);
  1104. inGameScreen.initDrawingArea();
  1105. stream.createFrame(0);
  1106. int k3 = ObjectManager.anInt145;
  1107. if(k3 > plane)
  1108. k3 = plane;
  1109. if(k3 < plane - 1)
  1110. k3 = plane - 1;
  1111. if(lowMem)
  1112. worldController.method275(ObjectManager.anInt145);
  1113. else
  1114. worldController.method275(0);
  1115. for(int i5 = 0; i5 < 104; i5++) {
  1116. for(int i7 = 0; i7 < 104; i7++)
  1117. spawnGroundItem(i5, i7);
  1118. }
  1119. anInt1051++;
  1120. if(anInt1051 > 98) {
  1121. anInt1051 = 0;
  1122. stream.createFrame(150);
  1123. }
  1124. method63();
  1125. } catch(Exception exception) { }
  1126. ObjectDef.mruNodes1.unlinkAll();
  1127. if(super.gameFrame != null) {
  1128. stream.createFrame(210);
  1129. stream.writeDWord(0x3f008edd);
  1130. }
  1131. System.gc();
  1132. Texture.method367();
  1133. onDemandFetcher.method566();
  1134. int k = (anInt1069 - 6) / 8 - 1;
  1135. int j1 = (anInt1069 + 6) / 8 + 1;
  1136. int i2 = (anInt1070 - 6) / 8 - 1;
  1137. int l2 = (anInt1070 + 6) / 8 + 1;
  1138. if(aBoolean1141) {
  1139. k = 49;
  1140. j1 = 50;
  1141. i2 = 49;
  1142. l2 = 50;
  1143. }
  1144. for(int l3 = k; l3 <= j1; l3++) {
  1145. for(int j5 = i2; j5 <= l2; j5++)
  1146. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1147. int j7 = onDemandFetcher.method562(0, j5, l3);
  1148. if(j7 != -1)
  1149. onDemandFetcher.method560(j7, 3);
  1150. int k8 = onDemandFetcher.method562(1, j5, l3);
  1151. if(k8 != -1)
  1152. onDemandFetcher.method560(k8, 3);
  1153. }
  1154. }
  1155. }
  1156.  
  1157.  
  1158. private void unlinkMRUNodes()
  1159. {
  1160. ObjectDef.mruNodes1.unlinkAll();
  1161. ObjectDef.mruNodes2.unlinkAll();
  1162. EntityDef.mruNodes.unlinkAll();
  1163. ItemDef.mruNodes2.unlinkAll();
  1164. ItemDef.mruNodes1.unlinkAll();
  1165. Player.mruNodes.unlinkAll();
  1166. SpotAnim.aMRUNodes_415.unlinkAll();
  1167. }
  1168.  
  1169. private void method24(int i)
  1170. {
  1171. int ai[] = aSprite_1263.myPixels;
  1172. int j = ai.length;
  1173. for(int k = 0; k < j; k++)
  1174. ai[k] = 0;
  1175.  
  1176. for(int l = 1; l < 103; l++)
  1177. {
  1178. int i1 = 24628 + (103 - l) * 512 * 4;
  1179. for(int k1 = 1; k1 < 103; k1++)
  1180. {
  1181.  
  1182. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1183. worldController.method309(ai, i1, i, k1, l);
  1184. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1185. worldController.method309(ai, i1, i + 1, k1, l);
  1186. i1 += 4;
  1187. }
  1188.  
  1189. }
  1190.  
  1191. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1192. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1193. aSprite_1263.method343();
  1194. for(int i2 = 1; i2 < 103; i2++)
  1195. {
  1196. for(int j2 = 1; j2 < 103; j2++)
  1197. {
  1198. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1199. method50(i2, j1, j2, l1, i);
  1200. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1201. method50(i2, j1, j2, l1, i + 1);
  1202. }
  1203.  
  1204. }
  1205.  
  1206. inGameScreen.initDrawingArea();
  1207. anInt1071 = 0;
  1208. for(int k2 = 0; k2 < 104; k2++)
  1209. {
  1210. for(int l2 = 0; l2 < 104; l2++)
  1211. {
  1212. int i3 = worldController.method303(plane, k2, l2);
  1213. if(i3 != 0)
  1214. {
  1215. i3 = i3 >> 14 & 0x7fff;
  1216. int j3 = ObjectDef.forID(i3).anInt746;
  1217. if(j3 >= 0)
  1218. {
  1219. int k3 = k2;
  1220. int l3 = l2;
  1221. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1222. {
  1223. byte byte0 = 104;
  1224. byte byte1 = 104;
  1225. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1226. for(int i4 = 0; i4 < 10; i4++)
  1227. {
  1228. int j4 = (int)(Math.random() * 4D);
  1229. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1230. k3--;
  1231. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1232. k3++;
  1233. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1234. l3--;
  1235. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1236. l3++;
  1237. }
  1238.  
  1239. }
  1240. aSpriteArray1140[anInt1071] = mapFunctions[j3];
  1241. anIntArray1072[anInt1071] = k3;
  1242. anIntArray1073[anInt1071] = l3;
  1243. anInt1071++;
  1244. }
  1245. }
  1246. }
  1247.  
  1248. }
  1249.  
  1250. }
  1251.  
  1252. private void spawnGroundItem(int i, int j)
  1253. {
  1254. NodeList class19 = groundArray[plane][i][j];
  1255. if(class19 == null)
  1256. {
  1257. worldController.method295(plane, i, j);
  1258. return;
  1259. }
  1260. int k = 0xfa0a1f01;
  1261. Object obj = null;
  1262. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1263. {
  1264. ItemDef itemDef = ItemDef.forID(item.ID);
  1265. int l = itemDef.value;
  1266. if(itemDef.stackable)
  1267. l *= item.anInt1559 + 1;
  1268. // notifyItemSpawn(item, i + baseX, j + baseY);
  1269. if(l > k)
  1270. {
  1271. k = l;
  1272. obj = item;
  1273. }
  1274. }
  1275. class19.insertTail(((Node) (obj)));
  1276. Object obj1 = null;
  1277. Object obj2 = null;
  1278. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1279. {
  1280. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1281. obj1 = class30_sub2_sub4_sub2_1;
  1282. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1283. obj2 = class30_sub2_sub4_sub2_1;
  1284. }
  1285. int i1 = i + (j << 7) + 0x60000000;
  1286. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1287. }
  1288.  
  1289. private void method26(boolean flag)
  1290. {
  1291. for(int j = 0; j < npcCount; j++)
  1292. {
  1293. NPC npc = npcArray[npcIndices[j]];
  1294. int k = 0x20000000 + (npcIndices[j] << 14);
  1295. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1296. continue;
  1297. int l = npc.x >> 7;
  1298. int i1 = npc.y >> 7;
  1299. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1300. continue;
  1301. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1302. {
  1303. if(anIntArrayArray929[l][i1] == anInt1265)
  1304. continue;
  1305. anIntArrayArray929[l][i1] = anInt1265;
  1306. }
  1307. if(!npc.desc.aBoolean84)
  1308. k += 0x80000000;
  1309. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1310. }
  1311. }
  1312.  
  1313. private boolean replayWave()
  1314. {
  1315. return signlink.wavereplay();
  1316. }
  1317.  
  1318. private void loadError()
  1319. {
  1320. String s = "ondemand";//was a constant parameter
  1321. System.out.println(s);
  1322. try
  1323. {
  1324. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1325. }
  1326. catch(Exception exception)
  1327. {
  1328. exception.printStackTrace();
  1329. }
  1330. do
  1331. try
  1332. {
  1333. Thread.sleep(1000L);
  1334. }
  1335. catch(Exception _ex) { }
  1336. while(true);
  1337. }
  1338.  
  1339. public void drawHoverBox(int xPos, int yPos, String text) {
  1340. String[] results = text.split("\n");
  1341. int height = (results.length * 16) + 3;
  1342. int width;
  1343. width = aTextDrawingArea_1271.getTextWidth(results[0]) + 6;
  1344. for(int i = 1; i < results.length; i++)
  1345. if(width <= aTextDrawingArea_1271.getTextWidth(results[i]) + 6)
  1346. width = aTextDrawingArea_1271.getTextWidth(results[i]) + 6;
  1347. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1348. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1349. yPos += 14;
  1350. for(int i = 0; i < results.length; i++) {
  1351. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i], yPos);
  1352. yPos += 16;
  1353. }
  1354. }
  1355.  
  1356. public void drawBlackBox(int xPos, int yPos) {
  1357. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  1358. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  1359. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  1360. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  1361. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  1362. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  1363. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  1364. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  1365. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  1366. }
  1367.  
  1368. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1369. {
  1370. if(class9.interfaceType != 0 || class9.children == null || class9.interfaceShown)
  1371. return;
  1372. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1373. return;
  1374. int k1 = class9.children.length;
  1375. for(int l1 = 0; l1 < k1; l1++)
  1376. {
  1377. int i2 = class9.childX[l1] + i;
  1378. int j2 = (class9.childY[l1] + l) - j1;
  1379. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1380. i2 += class9_1.xOffset;
  1381. j2 += class9_1.yOffset;
  1382. if((class9_1.hoverType >= 0 || class9_1.disabledHoverColor != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1383. if(class9_1.hoverType >= 0)
  1384. anInt886 = class9_1.hoverType;
  1385. else
  1386. anInt886 = class9_1.id;
  1387. if (class9_1.interfaceType == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1388. anInt1315 = class9_1.id;
  1389. }
  1390. if(class9_1.interfaceType == 0)
  1391. {
  1392. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1393. if(class9_1.scrollMax > class9_1.height)
  1394. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1395. } else
  1396. {
  1397. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1398. {
  1399. boolean flag = false;
  1400. if(class9_1.contentType != 0)
  1401. flag = buildFriendsListMenu(class9_1);
  1402. if(!flag)
  1403. {
  1404. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1405. if(idToggle == true) {
  1406. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1407. menuActionID[menuActionRow] = 315;
  1408. menuActionCmd3[menuActionRow] = class9_1.id;
  1409. menuActionRow++;
  1410. } else {
  1411. menuActionName[menuActionRow] = class9_1.tooltip;
  1412. menuActionID[menuActionRow] = 315;
  1413. menuActionCmd3[menuActionRow] = class9_1.id;
  1414. menuActionRow++;
  1415. }
  1416. }
  1417. }
  1418. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1419. {
  1420. String s = class9_1.selectedActionName;
  1421. if(s.indexOf(" ") != -1)
  1422. s = s.substring(0, s.indexOf(" "));
  1423. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1424. menuActionID[menuActionRow] = 626;
  1425. menuActionCmd3[menuActionRow] = class9_1.id;
  1426. menuActionRow++;
  1427. }
  1428. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1429. {
  1430. menuActionName[menuActionRow] = "Close";
  1431. menuActionID[menuActionRow] = 200;
  1432. menuActionCmd3[menuActionRow] = class9_1.id;
  1433. menuActionRow++;
  1434. }
  1435. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1436. {
  1437. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1438. if(idToggle == true) {
  1439. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1440. menuActionID[menuActionRow] = 169;
  1441. menuActionCmd3[menuActionRow] = class9_1.id;
  1442. menuActionRow++;
  1443. } else {
  1444. menuActionName[menuActionRow] = class9_1.tooltip;
  1445. menuActionID[menuActionRow] = 169;
  1446. menuActionCmd3[menuActionRow] = class9_1.id;
  1447. menuActionRow++;
  1448. }
  1449. if (class9_1.hoverText != null) {
  1450. //drawHoverBox(k, l, class9_1.hoverText);
  1451. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1452. }
  1453. }
  1454. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1455. {
  1456. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1457. if(idToggle == true) {
  1458. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1459. menuActionID[menuActionRow] = 646;
  1460. menuActionCmd3[menuActionRow] = class9_1.id;
  1461. menuActionRow++;
  1462. } else {
  1463. menuActionName[menuActionRow] = class9_1.tooltip;
  1464. menuActionID[menuActionRow] = 646;
  1465. menuActionCmd3[menuActionRow] = class9_1.id;
  1466. menuActionRow++;
  1467. }
  1468. }
  1469. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1470. {
  1471. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1472. if(idToggle == true) {
  1473. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1474. menuActionID[menuActionRow] = 679;
  1475. menuActionCmd3[menuActionRow] = class9_1.id;
  1476. menuActionRow++;
  1477. } else {
  1478. menuActionName[menuActionRow] = class9_1.tooltip;
  1479. menuActionID[menuActionRow] = 679;
  1480. menuActionCmd3[menuActionRow] = class9_1.id;
  1481. menuActionRow++;
  1482. }
  1483. }
  1484. if(class9_1.interfaceType == 2)
  1485. {
  1486. int k2 = 0;
  1487. for(int l2 = 0; l2 < class9_1.height; l2++)
  1488. {
  1489. for(int i3 = 0; i3 < class9_1.width; i3++)
  1490. {
  1491. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1492. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1493. if(k2 < 20)
  1494. {
  1495. j3 += class9_1.spritesX[k2];
  1496. k3 += class9_1.spritesY[k2];
  1497. }
  1498. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1499. {
  1500. mouseInvInterfaceIndex = k2;
  1501. lastActiveInvInterface = class9_1.id;
  1502. if(class9_1.inventory[k2] > 0)
  1503. {
  1504. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k2] - 1);
  1505. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1506. {
  1507. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1508. {
  1509. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  1510. menuActionID[menuActionRow] = 870;
  1511. menuActionCmd1[menuActionRow] = itemDef.id;
  1512. menuActionCmd2[menuActionRow] = k2;
  1513. menuActionCmd3[menuActionRow] = class9_1.id;
  1514. menuActionRow++;
  1515. }
  1516. } else
  1517. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1518. {
  1519. if((spellUsableOn & 0x10) == 16)
  1520. {
  1521. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1522. menuActionID[menuActionRow] = 543;
  1523. menuActionCmd1[menuActionRow] = itemDef.id;
  1524. menuActionCmd2[menuActionRow] = k2;
  1525. menuActionCmd3[menuActionRow] = class9_1.id;
  1526. menuActionRow++;
  1527. }
  1528. } else
  1529. {
  1530. if(class9_1.isInventoryInterface)
  1531. {
  1532. for(int l3 = 4; l3 >= 3; l3--)
  1533. if(itemDef.itemActions != null && itemDef.itemActions[l3] != null)
  1534. {
  1535. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1536. if(l3 == 3)
  1537. menuActionID[menuActionRow] = 493;
  1538. if(l3 == 4)
  1539. menuActionID[menuActionRow] = 847;
  1540. menuActionCmd1[menuActionRow] = itemDef.id;
  1541. menuActionCmd2[menuActionRow] = k2;
  1542. menuActionCmd3[menuActionRow] = class9_1.id;
  1543. menuActionRow++;
  1544. } else
  1545. if(l3 == 4)
  1546. {
  1547. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1548. menuActionID[menuActionRow] = 847;
  1549. menuActionCmd1[menuActionRow] = itemDef.id;
  1550. menuActionCmd2[menuActionRow] = k2;
  1551. menuActionCmd3[menuActionRow] = class9_1.id;
  1552. menuActionRow++;
  1553. }
  1554.  
  1555. }
  1556. if(class9_1.usableItemInterface)
  1557. {
  1558. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1559. menuActionID[menuActionRow] = 447;
  1560. menuActionCmd1[menuActionRow] = itemDef.id;
  1561. //k2 = inventory spot
  1562. //System.out.println(k2);
  1563. menuActionCmd2[menuActionRow] = k2;
  1564. menuActionCmd3[menuActionRow] = class9_1.id;
  1565. menuActionRow++;
  1566. }
  1567. if(class9_1.isInventoryInterface && itemDef.itemActions != null)
  1568. {
  1569. for(int i4 = 2; i4 >= 0; i4--)
  1570. if(itemDef.itemActions[i4] != null)
  1571. {
  1572. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1573. if(i4 == 0)
  1574. menuActionID[menuActionRow] = 74;
  1575. if(i4 == 1)
  1576. menuActionID[menuActionRow] = 454;
  1577. if(i4 == 2)
  1578. menuActionID[menuActionRow] = 539;
  1579. menuActionCmd1[menuActionRow] = itemDef.id;
  1580. menuActionCmd2[menuActionRow] = k2;
  1581. menuActionCmd3[menuActionRow] = class9_1.id;
  1582. menuActionRow++;
  1583. }
  1584.  
  1585. }
  1586. if(class9_1.itemActions != null)
  1587. {
  1588. for(int j4 = 4; j4 >= 0; j4--)
  1589. if(class9_1.itemActions[j4] != null)
  1590. {
  1591. menuActionName[menuActionRow] = class9_1.itemActions[j4] + " @lre@" + itemDef.name;
  1592. if(j4 == 0)
  1593. menuActionID[menuActionRow] = 632;
  1594. if(j4 == 1)
  1595. menuActionID[menuActionRow] = 78;
  1596. if(j4 == 2)
  1597. menuActionID[menuActionRow] = 867;
  1598. if(j4 == 3)
  1599. menuActionID[menuActionRow] = 431;
  1600. if(j4 == 4)
  1601. menuActionID[menuActionRow] = 53;
  1602. menuActionCmd1[menuActionRow] = itemDef.id;
  1603. menuActionCmd2[menuActionRow] = k2;
  1604. menuActionCmd3[menuActionRow] = class9_1.id;
  1605. menuActionRow++;
  1606. }
  1607.  
  1608. }
  1609. if(idToggle == true) {
  1610. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inventory[k2] - 1) + "@gre@)";
  1611. } else {
  1612. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1613. }
  1614. menuActionID[menuActionRow] = 1125;
  1615. menuActionCmd1[menuActionRow] = itemDef.id;
  1616. menuActionCmd2[menuActionRow] = k2;
  1617. menuActionCmd3[menuActionRow] = class9_1.id;
  1618. menuActionRow++;
  1619. }
  1620. }
  1621. }
  1622. k2++;
  1623. }
  1624.  
  1625. }
  1626.  
  1627. }
  1628. }
  1629. }
  1630.  
  1631. }
  1632.  
  1633. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1634. if(is474 || is480 || is508 || is525 || is562) {
  1635. scrollBar1.drawSprite(i1, l);
  1636. scrollBar2.drawSprite(i1, (l + j) - 16);
  1637. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1638. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1639. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1640. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1641. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1642. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1643. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1644. int k1 = ((j - 32) * j) / j1;
  1645. if(k1 < 8)
  1646. k1 = 8;
  1647. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1648. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1649. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1650. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1651. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1652. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1653. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1654. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1655. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1656. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1657. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1658. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1659. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1660. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1661. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1662. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1663. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1664. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1665. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1666. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1667. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1668. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1669. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1670. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1671. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1672. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1673. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1674. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1675. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1676. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1677. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1678. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1679. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1680. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1681. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1682. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1683. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1684. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1685. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1686. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1687. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1688. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1689. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1690. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1691. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1692. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1693. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1694. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1695. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1696. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1697. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1698. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1699. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1700. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1701. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1702. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1703. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1704. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1705. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1706. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1707. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1708. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1709. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1710. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1711. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1712. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1713. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1714. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1715. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1716. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1717. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1718. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1719. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1720. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1721. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1722. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1723. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1724. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1725. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1726. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1727. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1728. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1729. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1730. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1731. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1732. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1733. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1734. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1735. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1736. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1737. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1738. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1739. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1740. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1741. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1742. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1743. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1744. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1745. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1746. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1747. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1748. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1749. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1750. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1751. } else {
  1752. scrollBar3.drawSprite(i1, l);
  1753. scrollBar4.drawSprite(i1, (l + j) - 16);
  1754. DrawingArea.method336(j - 32, l + 16, i1, anInt1002, 16);
  1755. int k1 = ((j - 32) * j) / j1;
  1756. if(k1 < 8)
  1757. k1 = 8;
  1758. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1759. DrawingArea.method336(k1, l + 16 + l1, i1, barFillColor, 16);
  1760. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1);
  1761. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1 + 1);
  1762. DrawingArea.method339(l + 16 + l1, anInt902, 16, i1);
  1763. DrawingArea.method339(l + 17 + l1, anInt902, 16, i1);
  1764. DrawingArea.method341(l + 16 + l1, anInt927, k1, i1 + 15);
  1765. DrawingArea.method341(l + 17 + l1, anInt927, k1 - 1, i1 + 14);
  1766. DrawingArea.method339(l + 15 + l1 + k1, anInt927, 16, i1);
  1767. DrawingArea.method339(l + 14 + l1 + k1, anInt927, 15, i1 + 1);
  1768. }
  1769. }
  1770.  
  1771.  
  1772.  
  1773. private void updateNPCs(Stream stream, int i)
  1774. {
  1775. anInt839 = 0;
  1776. anInt893 = 0;
  1777. method139(stream);
  1778. method46(i, stream);
  1779. method86(stream);
  1780. for(int k = 0; k < anInt839; k++)
  1781. {
  1782. int l = anIntArray840[k];
  1783. if(npcArray[l].anInt1537 != loopCycle)
  1784. {
  1785. npcArray[l].desc = null;
  1786. npcArray[l] = null;
  1787. }
  1788. }
  1789. if(stream.currentOffset != i)
  1790. {
  1791. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1792. throw new RuntimeException("eek");
  1793. }
  1794. for(int i1 = 0; i1 < npcCount; i1++)
  1795. if(npcArray[npcIndices[i1]] == null)
  1796. {
  1797. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1798. throw new RuntimeException("eek");
  1799. }
  1800. }
  1801.  
  1802. private int cButtonHPos;
  1803. private int cButtonHCPos;
  1804. private int cButtonCPos;
  1805.  
  1806. private void processChatModeClick() {
  1807. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  1808. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1809. cButtonHPos = 0;
  1810. aBoolean1233 = true;
  1811. inputTaken = true;
  1812. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  1813. cButtonHPos = 1;
  1814. aBoolean1233 = true;
  1815. inputTaken = true;
  1816. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  1817. cButtonHPos = 2;
  1818. aBoolean1233 = true;
  1819. inputTaken = true;
  1820. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  1821. cButtonHPos = 3;
  1822. aBoolean1233 = true;
  1823. inputTaken = true;
  1824. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  1825. cButtonHPos = 4;
  1826. aBoolean1233 = true;
  1827. inputTaken = true;
  1828. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  1829. cButtonHPos = 5;
  1830. aBoolean1233 = true;
  1831. inputTaken = true;
  1832. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  1833. cButtonHPos = 7;
  1834. aBoolean1233 = true;
  1835. inputTaken = true;
  1836. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  1837. cButtonHPos = 6;
  1838. aBoolean1233 = true;
  1839. inputTaken = true;
  1840. } else {
  1841. cButtonHPos = -1;
  1842. aBoolean1233 = true;
  1843. inputTaken = true;
  1844. }
  1845. if(super.clickMode3 == 1) {
  1846. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1847. cButtonCPos = 0;
  1848. chatTypeView = 0;
  1849. aBoolean1233 = true;
  1850. inputTaken = true;
  1851. } else if(super.saveClickX >= 62 && super.saveClickX <= 117 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1852. cButtonCPos = 1;
  1853. chatTypeView = 5;
  1854. aBoolean1233 = true;
  1855. inputTaken = true;
  1856. } else if(super.saveClickX >= 119 && super.saveClickX <= 174 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1857. cButtonCPos = 2;
  1858. chatTypeView = 1;
  1859. aBoolean1233 = true;
  1860. inputTaken = true;
  1861. } else if(super.saveClickX >= 176 && super.saveClickX <= 231 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1862. cButtonCPos = 3;
  1863. chatTypeView = 2;
  1864. aBoolean1233 = true;
  1865. inputTaken = true;
  1866. } else if(super.saveClickX >= 233 && super.saveClickX <= 288 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1867. cButtonCPos = 4;
  1868. chatTypeView = 11;
  1869. aBoolean1233 = true;
  1870. inputTaken = true;
  1871. } else if(super.saveClickX >= 290 && super.saveClickX <= 345 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1872. cButtonCPos = 5;
  1873. chatTypeView = 3;
  1874. aBoolean1233 = true;
  1875. inputTaken = true;
  1876. } else if(super.saveClickX >= 347 && super.saveClickX <= 402 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1877. cButtonCPos = 6;
  1878. //chatTypeView = 3;
  1879. aBoolean1233 = true;
  1880. inputTaken = true;
  1881. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1882. if(openInterfaceID == -1) {
  1883. clearTopInterfaces();
  1884. reportAbuseInput = "";
  1885. canMute = false;
  1886. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1887. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1888. continue;
  1889. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1890. break;
  1891. }
  1892. } else {
  1893. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1894. }
  1895. }
  1896. }
  1897. } else if(is474) {
  1898. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1899. cButtonHPos = 0;
  1900. aBoolean1233 = true;
  1901. inputTaken = true;
  1902. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1903. cButtonHPos = 1;
  1904. aBoolean1233 = true;
  1905. inputTaken = true;
  1906. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1907. cButtonHPos = 2;
  1908. aBoolean1233 = true;
  1909. inputTaken = true;
  1910. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1911. cButtonHPos = 3;
  1912. aBoolean1233 = true;
  1913. inputTaken = true;
  1914. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1915. cButtonHPos = 4;
  1916. aBoolean1233 = true;
  1917. inputTaken = true;
  1918. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1919. cButtonHPos = 5;
  1920. aBoolean1233 = true;
  1921. inputTaken = true;
  1922. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1923. cButtonHPos = 6;
  1924. aBoolean1233 = true;
  1925. inputTaken = true;
  1926. } else {
  1927. cButtonHPos = -1;
  1928. aBoolean1233 = true;
  1929. inputTaken = true;
  1930. }
  1931. if(super.clickMode3 == 1) {
  1932. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1933. cButtonCPos = 0;
  1934. chatTypeView = 0;
  1935. aBoolean1233 = true;
  1936. inputTaken = true;
  1937. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1938. cButtonCPos = 1;
  1939. chatTypeView = 5;
  1940. aBoolean1233 = true;
  1941. inputTaken = true;
  1942. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1943. cButtonCPos = 2;
  1944. chatTypeView = 1;
  1945. aBoolean1233 = true;
  1946. inputTaken = true;
  1947. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1948. cButtonCPos = 3;
  1949. chatTypeView = 2;
  1950. aBoolean1233 = true;
  1951. inputTaken = true;
  1952. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1953. cButtonCPos = 4;
  1954. chatTypeView = 11;
  1955. aBoolean1233 = true;
  1956. inputTaken = true;
  1957. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1958. cButtonCPos = 5;
  1959. chatTypeView = 3;
  1960. aBoolean1233 = true;
  1961. inputTaken = true;
  1962. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1963. if(openInterfaceID == -1) {
  1964. clearTopInterfaces();
  1965. reportAbuseInput = "";
  1966. canMute = false;
  1967. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1968. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1969. continue;
  1970. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1971. break;
  1972. }
  1973. } else {
  1974. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1975. }
  1976. }
  1977. }
  1978. } else {
  1979. if(super.clickMode3 == 1) {
  1980. if(super.saveClickX >= 6 && super.saveClickX <= 106 && super.saveClickY >= 467 && super.saveClickY <= 499)
  1981. {
  1982. publicChatMode = (publicChatMode + 1) % 4;
  1983. aBoolean1233 = true;
  1984. inputTaken = true;
  1985. stream.createFrame(95);
  1986. stream.writeWordBigEndian(publicChatMode);
  1987. stream.writeWordBigEndian(privateChatMode);
  1988. stream.writeWordBigEndian(tradeMode);
  1989. }
  1990. if(super.saveClickX >= 135 && super.saveClickX <= 235 && super.saveClickY >= 467 && super.saveClickY <= 499)
  1991. {
  1992. privateChatMode = (privateChatMode + 1) % 3;
  1993. aBoolean1233 = true;
  1994. inputTaken = true;
  1995. stream.createFrame(95);
  1996. stream.writeWordBigEndian(publicChatMode);
  1997. stream.writeWordBigEndian(privateChatMode);
  1998. stream.writeWordBigEndian(tradeMode);
  1999. }
  2000. if(super.saveClickX >= 273 && super.saveClickX <= 373 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2001. {
  2002. tradeMode = (tradeMode + 1) % 3;
  2003. aBoolean1233 = true;
  2004. inputTaken = true;
  2005. stream.createFrame(95);
  2006. stream.writeWordBigEndian(publicChatMode);
  2007. stream.writeWordBigEndian(privateChatMode);
  2008. stream.writeWordBigEndian(tradeMode);
  2009. }
  2010. if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2011. if(openInterfaceID == -1) {
  2012. clearTopInterfaces();
  2013. reportAbuseInput = "";
  2014. canMute = false;
  2015. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2016. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  2017. continue;
  2018. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2019. break;
  2020. }
  2021. } else {
  2022. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2023. }
  2024. }
  2025. }
  2026. }
  2027. }
  2028.  
  2029. private void method33(int i)
  2030. {
  2031. int j = Varp.cache[i].anInt709;
  2032. if(j == 0)
  2033. return;
  2034. int k = variousSettings[i];
  2035. if(j == 1)
  2036. {
  2037. if(k == 1)
  2038. Texture.method372(0.90000000000000002D);
  2039. if(k == 2)
  2040. Texture.method372(0.80000000000000004D);
  2041. if(k == 3)
  2042. Texture.method372(0.69999999999999996D);
  2043. if(k == 4)
  2044. Texture.method372(0.59999999999999998D);
  2045. ItemDef.mruNodes1.unlinkAll();
  2046. welcomeScreenRaised = true;
  2047. }
  2048. if(j == 3)
  2049. {
  2050. boolean flag1 = musicEnabled;
  2051. if(k == 0)
  2052. {
  2053. adjustVolume(musicEnabled, 0);
  2054. musicEnabled = true;
  2055. }
  2056. if(k == 1)
  2057. {
  2058. adjustVolume(musicEnabled, -400);
  2059. musicEnabled = true;
  2060. }
  2061. if(k == 2)
  2062. {
  2063. adjustVolume(musicEnabled, -800);
  2064. musicEnabled = true;
  2065. }
  2066. if(k == 3)
  2067. {
  2068. adjustVolume(musicEnabled, -1200);
  2069. musicEnabled = true;
  2070. }
  2071. if(k == 4)
  2072. musicEnabled = false;
  2073. if(musicEnabled != flag1 && !lowMem)
  2074. {
  2075. if(musicEnabled)
  2076. {
  2077. nextSong = currentSong;
  2078. songChanging = true;
  2079. onDemandFetcher.method558(2, nextSong);
  2080. } else
  2081. {
  2082. stopMidi();
  2083. }
  2084. prevSong = 0;
  2085. }
  2086. }
  2087. if(j == 4)
  2088. {
  2089. if(k == 0)
  2090. {
  2091. aBoolean848 = true;
  2092. setWaveVolume(0);
  2093. }
  2094. if(k == 1)
  2095. {
  2096. aBoolean848 = true;
  2097. setWaveVolume(-400);
  2098. }
  2099. if(k == 2)
  2100. {
  2101. aBoolean848 = true;
  2102. setWaveVolume(-800);
  2103. }
  2104. if(k == 3)
  2105. {
  2106. aBoolean848 = true;
  2107. setWaveVolume(-1200);
  2108. }
  2109. if(k == 4)
  2110. aBoolean848 = false;
  2111. }
  2112. if(j == 5)
  2113. anInt1253 = k;
  2114. if(j == 6)
  2115. anInt1249 = k;
  2116. if(j == 8)
  2117. {
  2118. splitPrivateChat = k;
  2119. inputTaken = true;
  2120. }
  2121. if(j == 9)
  2122. anInt913 = k;
  2123. }
  2124.  
  2125. /* void noSoakHit1(int i, int j, int k, int l, int i1, String s)
  2126. {
  2127. if(i > loopCycle)
  2128. {
  2129. k -= 30;
  2130. int j1 = i - loopCycle;
  2131. int k1 = (int)Math.round((double)j1 * 3.5D);
  2132. int l1 = Math.round(j1 / 6);
  2133. hitMark[5].drawTransparent(j - 8, (k - 12) + l1, k1);
  2134. hitMark[5].drawTransparent(j - 8, (k - 12) + l1, k1);
  2135. hitMark[5].drawTransparent(j - 8, (k - 12) + l1, k1);
  2136. smallText.drawText(0, s, k + 4 + l1, j);
  2137. smallText.drawText(0xffffff, s, k + 3 + l1, j - 1);
  2138. }
  2139. }
  2140.  
  2141. void noSoakHit10(int i, int j, int k, int l, int i1, String s)
  2142. {
  2143. if(i > loopCycle)
  2144. {
  2145. k -= 30;
  2146. int j1 = i - loopCycle;
  2147. int k1 = (int)Math.round((double)j1 * 3.5D);
  2148. int l1 = Math.round(j1 / 6);
  2149. hitMark[l].drawTransparent(j - 12, (k - 12) + l1, k1);
  2150. hitMark[l].drawTransparent(j - 12, (k - 12) + l1, k1);
  2151. hitMark[l].drawTransparent(j - 12, (k - 12) + l1, k1);
  2152. smallText.drawText(0, s, k + 4 + l1, j);
  2153. smallText.drawText(0xffffff, s, k + 3 + l1, j - 1);
  2154. }
  2155. }
  2156.  
  2157. void noSoakHit100(int i, int j, int k, int l, int i1, String s)
  2158. {
  2159. if(i > loopCycle)
  2160. {
  2161. k -= 30;
  2162. int j1 = i - loopCycle;
  2163. int k1 = (int)Math.round((double)j1 * 3.5D);
  2164. int l1 = Math.round(j1 / 6);
  2165. hitMark[l].drawTransparent(j - 20, (k - 13) + l1, k1);
  2166. hitMark[l].drawTransparent(j - 20, (k - 13) + l1, k1);
  2167. hitMark[l].drawTransparent(j - 20, (k - 13) + l1, k1);
  2168. smallText.drawText(0, s, k + 4 + l1, j);
  2169. smallText.drawText(0xffffff, s, k + 3 + l1, j - 1);
  2170. }
  2171. }
  2172.  
  2173. void noSoakHitMax(int i, int j, int k, int l, String s)
  2174. {
  2175. if(i > loopCycle)
  2176. {
  2177. k -= 30;
  2178. int i1 = i - loopCycle;
  2179. int j1 = (int)Math.round((double)i1 * 3.5D);
  2180. int k1 = Math.round(i1 / 6);
  2181. hitMark[4].drawTransparent(j - 20, (k - 13) + k1, j1);
  2182. hitMark[4].drawTransparent(j - 20, (k - 13) + k1, j1);
  2183. hitMark[4].drawTransparent(j - 20, (k - 13) + k1, j1);
  2184. chatTextDrawingArea.drawText(0xffffff, s, k + 3 + k1, j - 1);
  2185. }
  2186. }
  2187.  
  2188. void soakHit1(int i, int j, int k, int l, int i1, String s, String s1)
  2189. {
  2190. if(i > loopCycle)
  2191. {
  2192. k -= 30;
  2193. int j1 = i - loopCycle;
  2194. int k1 = (int)Math.round((double)j1 * 3.5D);
  2195. int l1 = Math.round(j1 / 6);
  2196. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2197. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2198. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2199. smallText.drawText(0, s, k + 4 + l1, j - 9);
  2200. smallText.drawText(0xffffff, s, k + 3 + l1, j - 10);
  2201. hitMark[6].drawTransparent(j + 24, (k - 11) + l1, k1);
  2202. hitMark[6].drawTransparent(j + 24, (k - 11) + l1, k1);
  2203. hitMark[6].drawTransparent(j + 24, (k - 11) + l1, k1);
  2204. smallText.drawText(0, s1, k + 5 + l1, j + 32);
  2205. smallText.drawText(0xffffff, s1, k + 4 + l1, j + 31);
  2206. }
  2207. }
  2208.  
  2209. void soakHit(int i, int j, int k, int l, int i1, String s, String s1)
  2210. {
  2211. if(i > loopCycle)
  2212. {
  2213. k -= 30;
  2214. int j1 = i - loopCycle;
  2215. int k1 = (int)Math.round((double)j1 * 3.5D);
  2216. int l1 = Math.round(j1 / 6);
  2217. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2218. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2219. hitMark[i1].drawTransparent(j - 29, (k - 13) + l1, k1);
  2220. smallText.drawText(0, s, k + 4 + l1, j - 9);
  2221. smallText.drawText(0xffffff, s, k + 3 + l1, j - 10);
  2222. hitMark[0].drawTransparent(j + 24, (k - 11) + l1, k1);
  2223. hitMark[0].drawTransparent(j + 24, (k - 11) + l1, k1);
  2224. hitMark[0].drawTransparent(j + 24, (k - 11) + l1, k1);
  2225. smallText.drawText(0, s1, k + 5 + l1, j + 38);
  2226. smallText.drawText(0xffffff, s1, k + 4 + l1, j + 37);
  2227. }
  2228. }
  2229.  
  2230. void soakHitMax(int i, int j, int k, int l, String s, String s1)
  2231. {
  2232. if(i > loopCycle)
  2233. {
  2234. k -= 30;
  2235. int i1 = i - loopCycle;
  2236. int j1 = (int)Math.round((double)i1 * 3.5D);
  2237. int k1 = Math.round(i1 / 6);
  2238. hitMark[4].drawTransparent(j - 29, (k - 13) + k1, j1);
  2239. hitMark[4].drawTransparent(j - 29, (k - 13) + k1, j1);
  2240. hitMark[4].drawTransparent(j - 29, (k - 13) + k1, j1);
  2241. chatTextDrawingArea.drawText(0xffffff, s, k + 4 + k1, j - 10);
  2242. hitMark[0].drawTransparent(j + 24, (k - 11) + k1, j1);
  2243. hitMark[0].drawTransparent(j + 24, (k - 11) + k1, j1);
  2244. hitMark[0].drawTransparent(j + 24, (k - 11) + k1, j1);
  2245. smallText.drawText(0, s1, k + 5 + k1, j + 38);
  2246. smallText.drawText(0xffffff, s1, k + 4 + k1, j + 37);
  2247. }
  2248. }*/
  2249.  
  2250. private Sprite HPBarFull;
  2251. private Sprite HPBarEmpty;
  2252.  
  2253. private void updateEntities() {
  2254.  
  2255. try{
  2256. int anInt974 = 0;
  2257. for(int j = -1; j < playerCount + npcCount; j++) {
  2258. Object obj;
  2259. if(j == -1)
  2260. obj = myPlayer;
  2261. else
  2262. if(j < playerCount)
  2263. obj = playerArray[playerIndices[j]];
  2264. else
  2265. obj = npcArray[npcIndices[j - playerCount]];
  2266. if(obj == null || !((Entity) (obj)).isVisible())
  2267. continue;
  2268. if(obj instanceof NPC) {
  2269. EntityDef entityDef = ((NPC)obj).desc;
  2270.  
  2271. if(namesToggle == true) {
  2272. String s = entityDef.name;
  2273. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  2274. if(entityDef.combatLevel != 0) {
  2275. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height+15);
  2276. smallText.method382(0xFFFF33, spriteDrawX, s, spriteDrawY-8, true);
  2277. } else if(entityDef.combatLevel == 0) {
  2278. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height+15);
  2279. smallText.method382(0xFFFF33, spriteDrawX, entityDef.name, spriteDrawY-8, true);
  2280. }
  2281. } else if(namesToggle == false) {
  2282.  
  2283. }
  2284.  
  2285. if(entityDef.childrenIDs != null)
  2286. entityDef = entityDef.method161();
  2287. if(entityDef == null)
  2288. continue;
  2289. }
  2290. if(namesToggle == true) {
  2291. if(j < playerCount) {
  2292. int l = 45;
  2293. Player player = (Player)obj;
  2294. if(player.headIcon >= 0) {
  2295. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2296. if(spriteDrawX > -1) {
  2297. if (player.skullIcon < 2) {
  2298. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2299. l += 25;//25
  2300. }
  2301. /*if (player.headIcon < 7) {
  2302. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2303. l += 20;//20
  2304. }*/
  2305. if(player.headIcon < 18) {
  2306. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2307. l += 26;
  2308. }
  2309. }
  2310. }
  2311. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2312. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2313. if(spriteDrawX > -1)
  2314. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2315. l += 30;
  2316. }
  2317. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2318. int col = 0x3399ff;
  2319. newSmallFont.drawCenteredString(player.name, spriteDrawX, spriteDrawY-8, col, 100);
  2320.  
  2321. } else {
  2322. EntityDef entityDef_1 = ((NPC)obj).desc;
  2323. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2324. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2325. if(spriteDrawX > -1)
  2326. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 50);
  2327. }
  2328. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2329. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2330. if(spriteDrawX > -1)
  2331. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 50);
  2332. }
  2333. }
  2334. } else if(namesToggle == false) {
  2335. if(j < playerCount) {
  2336. int l = 30;
  2337. Player player = (Player)obj;
  2338. if(player.headIcon >= 0) {
  2339. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2340. if(spriteDrawX > -1) {
  2341. if (player.skullIcon < 2) {
  2342. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2343. l += 25;
  2344. }
  2345. /*if (player.headIcon < 7) {
  2346. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2347. l += 18;
  2348. }*/
  2349. if(player.headIcon < 18) {
  2350. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2351. l += 26;
  2352. }
  2353. }
  2354. }
  2355. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2356. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2357. if(spriteDrawX > -1)
  2358. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2359. }
  2360. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2361.  
  2362. } else {
  2363. EntityDef entityDef_1 = ((NPC)obj).desc;
  2364. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2365. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2366. if(spriteDrawX > -1)
  2367. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2368. }
  2369. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2370. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2371. if(spriteDrawX > -1)
  2372. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2373. }
  2374. }
  2375. }
  2376. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  2377. {
  2378. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2379. if(spriteDrawX > -1 && anInt974 < anInt975)
  2380. {
  2381. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  2382. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2383. anIntArray976[anInt974] = spriteDrawX;
  2384. anIntArray977[anInt974] = spriteDrawY;
  2385. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2386. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2387. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2388. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2389. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  2390. {
  2391. anIntArray978[anInt974] += 10;
  2392. anIntArray977[anInt974] += 5;
  2393. }
  2394. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2395. anIntArray979[anInt974] = 60;
  2396. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2397. anIntArray978[anInt974] += 5;
  2398. }
  2399. }
  2400. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  2401. {
  2402. try{
  2403. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2404. if(spriteDrawX > -1)
  2405. {
  2406. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2407. if(i1 > 30) {
  2408. i1 = 30;
  2409. }
  2410. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  2411. if (HpPercent > 56) {
  2412. HpPercent = 56;
  2413. }
  2414. //if(namesToggle) {
  2415. // newSmallFont.drawCenteredString((new StringBuilder()).append(((Entity) (Entity) obj).currentHealth).append("/").append(((Entity) (Entity) obj).maxHealth).toString(), spriteDrawX, spriteDrawY - 19, 0x3399ff, 100);
  2416. //}//draws HP above head
  2417. //HPBar crap
  2418. if(!hitbarToggle){
  2419. DrawingArea.method336(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  2420. DrawingArea.method336(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2421. } else {
  2422. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);//3
  2423. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", HpPercent, 7);
  2424. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  2425. }
  2426. }
  2427. }catch(Exception e){ }
  2428. }
  2429. for(int j1 = 0; j1 < 4; j1++)
  2430. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  2431. {
  2432. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2433. if(spriteDrawX > -1)
  2434. {
  2435. if(j1 == 1)
  2436. spriteDrawY -= 20;
  2437. if(j1 == 2)
  2438. {
  2439. spriteDrawX -= 15;
  2440. spriteDrawY -= 10;
  2441. }
  2442. if(j1 == 3)
  2443. {
  2444. spriteDrawX += 15;
  2445. spriteDrawY -= 10;
  2446. }
  2447. if (((Entity) (obj)).hitArray[j1] > 99) {
  2448. hitMarks[22].drawSprite(spriteDrawX - 22, spriteDrawY - 14);
  2449. } else if (((Entity) (obj)).hitMarkTypes[j1] == 1) {
  2450. hitMarks[20].drawSprite(spriteDrawX - 11, spriteDrawY - 12);
  2451. } else if (((Entity) (obj)).hitMarkTypes[j1] == 0) {
  2452. hitMarks[21].drawSprite(spriteDrawX - 12, spriteDrawY - 13);
  2453. } else if (((Entity) (obj)).hitArray[j1] < 11) {
  2454. hitMarks[23].drawSprite(spriteDrawX - 12, spriteDrawY - 13);
  2455. } else {
  2456. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2457. }
  2458. }
  2459. if (((Entity) (obj)).hitArray[j1] > 0) {
  2460. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2461. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2462. }
  2463. }
  2464. }
  2465.  
  2466. /*} catch(Exception exception1) { }
  2467. for(int k1 = 0; k1 < 4; k1++)
  2468. {
  2469. if(((Entity)(Entity)obj).hitsLoopCycle[k1] <= loopCycle)
  2470. continue;
  2471. npcScreenPos((Entity)(Entity)obj, ((Entity)(Entity)obj).height / 2);
  2472. if(spriteDrawX <= -1)
  2473. continue;
  2474. if(k1 > 0)
  2475. spriteDrawY += 19 * k1;
  2476. if(newHits)
  2477. {
  2478. if(((Entity)(Entity)obj).hitArray[k1] == 0 || ((Entity)(Entity)obj).hitType[k1] == 3)
  2479. {
  2480. block(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY);
  2481. continue;
  2482. }
  2483. if(((Entity)(Entity)obj).hitArray[k1] > 199 && ((Entity)(Entity)obj).hitDoSoak[k1] == 1 && ((Entity)(Entity)obj).hitSoak[k1] >= 1)
  2484. {
  2485. if(((Entity)(Entity)obj).hitMax[k1] == 1)
  2486. {
  2487. 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]));
  2488. continue;
  2489. }
  2490. if(((Entity)(Entity)obj).hitSoak[k1] > 9)
  2491. {
  2492. 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]));
  2493. continue;
  2494. }
  2495. if(((Entity)(Entity)obj).hitSoak[k1] < 10)
  2496. 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]));
  2497. continue;
  2498. }
  2499. if(((Entity)(Entity)obj).hitArray[k1] < 10)
  2500. {
  2501. 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]));
  2502. continue;
  2503. }
  2504. if(((Entity)(Entity)obj).hitArray[k1] > 9 && ((Entity)(Entity)obj).hitArray[k1] < 100)
  2505. {
  2506. 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]));
  2507. continue;
  2508. }
  2509. if(((Entity)(Entity)obj).hitMax[k1] == 1)
  2510. noSoakHitMax(((Entity)(Entity)obj).hitsLoopCycle[k1], spriteDrawX, spriteDrawY, ((Entity)(Entity)obj).hitType[k1], String.valueOf(((Entity)(Entity)obj).hitArray[k1]));
  2511. else
  2512. 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]));
  2513. } else
  2514. {
  2515. hitMarks[((Entity)(Entity)obj).hitMarkTypes[k1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2516. smallText.drawText(0, String.valueOf(((Entity)(Entity)obj).hitArray[k1]), spriteDrawY + 4, spriteDrawX);
  2517. smallText.drawText(0xffffff, String.valueOf(((Entity)(Entity)obj).hitArray[k1]), spriteDrawY + 3, spriteDrawX - 1);
  2518. }
  2519. }
  2520. }
  2521. }*/
  2522. for(int k = 0; k < anInt974; k++) {
  2523. int k1 = anIntArray976[k];
  2524. int l1 = anIntArray977[k];
  2525. int j2 = anIntArray979[k];
  2526. int k2 = anIntArray978[k];
  2527. boolean flag = true;
  2528. while(flag)
  2529. {
  2530. flag = false;
  2531. for(int l2 = 0; l2 < k; l2++)
  2532. 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)
  2533. {
  2534. l1 = anIntArray977[l2] - anIntArray978[l2];
  2535. flag = true;
  2536. }
  2537.  
  2538. }
  2539. spriteDrawX = anIntArray976[k];
  2540. spriteDrawY = anIntArray977[k] = l1;
  2541. String s = aStringArray983[k];
  2542. if(anInt1249 == 0)
  2543. {
  2544. int i3 = 0xffff00;
  2545. if(anIntArray980[k] < 6)
  2546. i3 = anIntArray965[anIntArray980[k]];
  2547. if(anIntArray980[k] == 6)
  2548. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2549. if(anIntArray980[k] == 7)
  2550. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2551. if(anIntArray980[k] == 8)
  2552. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2553. if(anIntArray980[k] == 9) {
  2554. int j3 = 150 - anIntArray982[k];
  2555. if(j3 < 50)
  2556. i3 = 0xff0000 + 1280 * j3;
  2557. else
  2558. if(j3 < 100)
  2559. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2560. else
  2561. if(j3 < 150)
  2562. i3 = 65280 + 5 * (j3 - 100);
  2563. }
  2564. if(anIntArray980[k] == 10) {
  2565. int k3 = 150 - anIntArray982[k];
  2566. if(k3 < 50)
  2567. i3 = 0xff0000 + 5 * k3;
  2568. else
  2569. if(k3 < 100)
  2570. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2571. else
  2572. if(k3 < 150)
  2573. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2574. }
  2575. if(anIntArray980[k] == 11) {
  2576. int l3 = 150 - anIntArray982[k];
  2577. if(l3 < 50)
  2578. i3 = 0xffffff - 0x50005 * l3;
  2579. else
  2580. if(l3 < 100)
  2581. i3 = 65280 + 0x50005 * (l3 - 50);
  2582. else
  2583. if(l3 < 150)
  2584. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2585. }
  2586. if(anIntArray981[k] == 0) {
  2587. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2588. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  2589. }
  2590. if(anIntArray981[k] == 1) {
  2591. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2592. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2593. }
  2594. if(anIntArray981[k] == 2) {
  2595. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2596. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2597. }
  2598. if(anIntArray981[k] == 3) {
  2599. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2600. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2601. }
  2602. if(anIntArray981[k] == 4) {
  2603. int i4 = chatTextDrawingArea.method384(s);
  2604. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2605. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2606. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2607. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2608. DrawingArea.defaultDrawingAreaSize();
  2609. }
  2610. if(anIntArray981[k] == 5) {
  2611. int j4 = 150 - anIntArray982[k];
  2612. int l4 = 0;
  2613. if(j4 < 25)
  2614. l4 = j4 - 25;
  2615. else
  2616. if(j4 > 125)
  2617. l4 = j4 - 125;
  2618. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  2619. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2620. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2621. DrawingArea.defaultDrawingAreaSize();
  2622. }
  2623. } else {
  2624. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2625. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2626. }
  2627. }
  2628. } catch(Exception e){ }
  2629. }
  2630.  
  2631. private void delFriend(long l)
  2632. {
  2633. try
  2634. {
  2635. if(l == 0L)
  2636. return;
  2637. for(int i = 0; i < friendsCount; i++)
  2638. {
  2639. if(friendsListAsLongs[i] != l)
  2640. continue;
  2641. friendsCount--;
  2642. needDrawTabArea = true;
  2643. for(int j = i; j < friendsCount; j++)
  2644. {
  2645. friendsList[j] = friendsList[j + 1];
  2646. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2647. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2648. }
  2649.  
  2650. stream.createFrame(215);
  2651. stream.writeQWord(l);
  2652. break;
  2653. }
  2654. }
  2655. catch(RuntimeException runtimeexception)
  2656. {
  2657. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2658. throw new RuntimeException();
  2659. }
  2660. }
  2661.  
  2662. public void drawSideIcons(){
  2663. if(is480 || is508 || is525) {
  2664. /* Top sideIcons */
  2665. if(tabInterfaceIDs[0] != -1)//attack
  2666. sideIcons[0].drawSprite(10+3, 4);
  2667. if(tabInterfaceIDs[1] != -1)//stat
  2668. sideIcons[1].drawSprite(43+3, 4);
  2669. if(tabInterfaceIDs[2] != -1)//quest
  2670. sideIcons[2].drawSprite(76+3, 3);
  2671. if(tabInterfaceIDs[3] != -1)//inventory
  2672. sideIcons[3].drawSprite(111+3, 5);
  2673. if(tabInterfaceIDs[4] != -1)//equipment
  2674. sideIcons[4].drawSprite(140+3, 1);
  2675. if(tabInterfaceIDs[5] != -1)//prayer
  2676. sideIcons[5].drawSprite(174+3, 1);
  2677. if(tabInterfaceIDs[6] != -1)//magic
  2678. sideIcons[6].drawSprite(208+3, 4);
  2679. /* Bottom sideIcons */
  2680. if(tabInterfaceIDs[7] != -1)//summoning
  2681. sIcons483[7].drawSprite(11+3, 303);
  2682. if(tabInterfaceIDs[8] != -1)//friends
  2683. sideIcons[8].drawSprite(46+3, 306);
  2684. if(tabInterfaceIDs[9] != -1)//ignore
  2685. sideIcons[9].drawSprite(79+3, 306);
  2686. if(tabInterfaceIDs[10] != -1)//logout
  2687. sideIcons[7].drawSprite(113+3, 302);
  2688. if(tabInterfaceIDs[11] != -1)//options
  2689. sideIcons[11].drawSprite(145+3, 304);
  2690. if(tabInterfaceIDs[12] != -1)//emotes
  2691. sideIcons[12].drawSprite(181+3, 302);
  2692. if(tabInterfaceIDs[13] != -1)//music
  2693. sideIcons[13].drawSprite(213+3, 303);
  2694. } else if(is474){
  2695. /** Top sideIcons */
  2696. if(tabInterfaceIDs[0] != -1)///attack
  2697. sideIcons[0].drawSprite(10+3, 4);
  2698. if(tabInterfaceIDs[1] != -1)///stat
  2699. sideIcons[1].drawSprite(43+3, 4);
  2700. if(tabInterfaceIDs[2] != -1)///quest
  2701. sideIcons[2].drawSprite(76+3, 3);
  2702. if(tabInterfaceIDs[3] != -1)///inventory
  2703. sideIcons[3].drawSprite(111+3, 5);
  2704. if(tabInterfaceIDs[4] != -1)///equipment
  2705. sideIcons[4].drawSprite(140+3, 1);
  2706. if(tabInterfaceIDs[5] != -1)///prayer
  2707. sideIcons[5].drawSprite(174+3, 1);
  2708. if(tabInterfaceIDs[6] != -1)///magic
  2709. sideIcons[6].drawSprite(208+3, 4);
  2710. /** Bottom sideIcons */
  2711. if(tabInterfaceIDs[7] != -1)///clan
  2712. sideIcons[7].drawSprite(11+3, 303);
  2713. if(tabInterfaceIDs[8] != -1)///friends
  2714. sideIcons[8].drawSprite(46+3, 306);
  2715. if(tabInterfaceIDs[9] != -1)///ignore
  2716. sideIcons[9].drawSprite(79+3, 306);
  2717. if(tabInterfaceIDs[10] != -1)///logout
  2718. sideIcons[10].drawSprite(113+3, 302);
  2719. if(tabInterfaceIDs[11] != -1)///options
  2720. sideIcons[11].drawSprite(145+3, 304);
  2721. if(tabInterfaceIDs[12] != -1)///emotes
  2722. sideIcons[12].drawSprite(181+3, 302);
  2723. if(tabInterfaceIDs[13] != -1)///music
  2724. sideIcons[13].drawSprite(213+3, 303);
  2725. } else if(is562){
  2726. /* Top sideIcons */
  2727. if(tabInterfaceIDs[0] != -1)
  2728. newSideIcons[0].drawSprite(8+3, 8);
  2729. if(tabInterfaceIDs[1] != -1)
  2730. newSideIcons[1].drawSprite(37+3, 8);
  2731. if(tabInterfaceIDs[2] != -1)
  2732. newSideIcons[2].drawSprite(67+3, 8);
  2733. if(tabInterfaceIDs[14] != -1)
  2734. newSideIcons[3].drawSprite(97+3, 8);
  2735. if(tabInterfaceIDs[3] != -1)
  2736. newSideIcons[4].drawSprite(127+3, 8);
  2737. if(tabInterfaceIDs[4] != -1)
  2738. newSideIcons[5].drawSprite(159+3, 8);
  2739. if(tabInterfaceIDs[5] != -1)
  2740. newSideIcons[6].drawSprite(187+3, 8);
  2741. if(tabInterfaceIDs[6] != -1)
  2742. newSideIcons[7].drawSprite(217+3, 8);
  2743. /* Bottom sideIcons */
  2744. if(tabInterfaceIDs[10] != -1)
  2745. newSideIcons[15].drawSprite(8+3, 306);
  2746. if(tabInterfaceIDs[9] != -1)
  2747. newSideIcons[8].drawSprite(38+3, 306);
  2748. if(tabInterfaceIDs[8] != -1)
  2749. newSideIcons[9].drawSprite(70+3, 306);
  2750. if(tabInterfaceIDs[7] != -1)
  2751. newSideIcons[13].drawSprite(97+3, 306);
  2752. if(tabInterfaceIDs[11] != -1)
  2753. newSideIcons[10].drawSprite(127+3, 306);
  2754. if(tabInterfaceIDs[12] != -1)
  2755. newSideIcons[11].drawSprite(157+3, 306);
  2756. if(tabInterfaceIDs[13] != -1)
  2757. newSideIcons[12].drawSprite(187+3, 306);
  2758. if(tabInterfaceIDs[15] != -1)
  2759. newSideIcons[14].drawSprite(216+3, 307);
  2760. } else {
  2761. /** Top sideIcons */
  2762. if(tabInterfaceIDs[0] != -1)///attack
  2763. sIcons459[0].drawSprite(32, 11);
  2764. if(tabInterfaceIDs[1] != -1)///stat
  2765. sIcons459[1].drawSprite(57, 9);
  2766. if(tabInterfaceIDs[2] != -1)///quest
  2767. sIcons459[2].drawSprite(86, 9);
  2768. if(tabInterfaceIDs[3] != -1)///inventory
  2769. sIcons459[3].drawSprite(116, 4);
  2770. if(tabInterfaceIDs[4] != -1)///equipment
  2771. sIcons459[4].drawSprite(155, 5);
  2772. if(tabInterfaceIDs[5] != -1)///prayer
  2773. sIcons459[5].drawSprite(183, 5);
  2774. if(tabInterfaceIDs[6] != -1)///magic
  2775. sIcons459[6].drawSprite(212, 10);
  2776. /** Bottom sideIcons */
  2777. if(tabInterfaceIDs[7] != -1)///clan
  2778. sideIcons[7].drawSprite(31, 300);
  2779. if(tabInterfaceIDs[8] != -1)///friends
  2780. sIcons459[7].drawSprite(57, 306);
  2781. if(tabInterfaceIDs[9] != -1)///ignore
  2782. sIcons459[8].drawSprite(85, 308);
  2783. if(tabInterfaceIDs[10] != -1)///logout
  2784. sIcons459[9].drawSprite(121, 302);
  2785. if(tabInterfaceIDs[11] != -1)///options
  2786. sIcons459[10].drawSprite(157, 305);
  2787. if(tabInterfaceIDs[12] != -1)///emotes
  2788. sIcons459[11].drawSprite(187, 302);
  2789. if(tabInterfaceIDs[13] != -1)///music
  2790. sIcons459[12].drawSprite(211, 302);
  2791. }
  2792. }
  2793. public void drawRedStones() {
  2794. if(is474 || is480 || is508 || is525) {
  2795. if(tabInterfaceIDs[tabID] != -1) {
  2796. switch(tabID) {
  2797. case 0:
  2798. redStones[0].drawSprite(3+3, 0);
  2799. break;
  2800. case 1:
  2801. redStones[4].drawSprite(41+3, 0);
  2802. break;
  2803. case 2:
  2804. redStones[4].drawSprite(74+3, 0);
  2805. break;
  2806. case 3:
  2807. redStones[4].drawSprite(107+3, 0);
  2808. break;
  2809. case 4:
  2810. redStones[4].drawSprite(140+3, 0);
  2811. break;
  2812. case 5:
  2813. redStones[4].drawSprite(173+3, 0);
  2814. break;
  2815. case 6:
  2816. redStones[1].drawSprite(206+3, 0);
  2817. break;
  2818. case 7:
  2819. redStones[2].drawSprite(3+3, 298);
  2820. break;
  2821. case 8:
  2822. redStones[4].drawSprite(41+3, 298);
  2823. break;
  2824. case 9:
  2825. redStones[4].drawSprite(74+3, 298);
  2826. break;
  2827. case 10:
  2828. redStones[4].drawSprite(107+3, 298);
  2829. break;
  2830. case 11:
  2831. redStones[4].drawSprite(140+3, 298);
  2832. break;
  2833. case 12:
  2834. redStones[4].drawSprite(173+3, 298);
  2835. break;
  2836. case 13:
  2837. redStones[3].drawSprite(206+3, 298);
  2838. break;
  2839. }
  2840. }
  2841. } else if(is562){
  2842. drawTabHover();
  2843. if(tabInterfaceIDs[tabID] != -1)
  2844. {
  2845. if(tabID == 0)
  2846. tabClicked.drawSprite(2+3, 0);
  2847. if(tabID == 1)
  2848. tabClicked.drawSprite(32+3, 0);
  2849. if(tabID == 2)
  2850. tabClicked.drawSprite(62+3, 0);
  2851. if(tabID == 14)
  2852. tabClicked.drawSprite(92+3, 0);
  2853. if(tabID == 3)
  2854. tabClicked.drawSprite(122+3, 0);
  2855. if(tabID == 4)
  2856. tabClicked.drawSprite(152+3, 0);
  2857. if(tabID == 5)
  2858. tabClicked.drawSprite(182+3, 0);
  2859. if(tabID == 6)
  2860. tabClicked.drawSprite(212+3, 0);
  2861. if(tabID == 16)
  2862. tabClicked.drawSprite(2+3, 298);
  2863. if(tabID == 8)
  2864. tabClicked.drawSprite(32+3, 298);
  2865. if(tabID == 9)
  2866. tabClicked.drawSprite(62+3, 298);
  2867. if(tabID == 7)
  2868. tabClicked.drawSprite(92+3, 298);
  2869. if(tabID == 11)
  2870. tabClicked.drawSprite(122+3, 298);
  2871. if(tabID == 12)
  2872. tabClicked.drawSprite(152+3, 298);
  2873. if(tabID == 13)
  2874. tabClicked.drawSprite(182+3, 298);
  2875. if(tabID == 15)
  2876. tabClicked.drawSprite(212+3, 298);
  2877. }
  2878. } else {
  2879. if(tabInterfaceIDs[tabID] != -1) {
  2880. switch(tabID) {
  2881. case 0:
  2882. redStones[5].drawSprite(16+7, 1);
  2883. break;
  2884. case 1:
  2885. redStones[13].drawSprite(48+7, 1);
  2886. break;
  2887. case 2:
  2888. redStones[13].drawSprite(75+7, 1);
  2889. break;
  2890. case 3:
  2891. redStones[7].drawSprite(103+7, 0);
  2892. break;
  2893. case 4:
  2894. redStones[14].drawSprite(146+7, 1);
  2895. break;
  2896. case 5:
  2897. redStones[14].drawSprite(174+7, 1);
  2898. break;
  2899. case 6:
  2900. redStones[6].drawSprite(202+7, 2);
  2901. break;
  2902.  
  2903. case 7:
  2904. redStones[12].drawSprite(22, 296);
  2905. break;
  2906. case 8:
  2907. redStones[9].drawSprite(54, 297);
  2908. break;
  2909. case 9:
  2910. redStones[9].drawSprite(82, 297);
  2911. break;
  2912. case 10:
  2913. redStones[10].drawSprite(110, 299);
  2914. break;
  2915. case 11:
  2916. redStones[8].drawSprite(153, 297);
  2917. break;
  2918. case 12:
  2919. redStones[8].drawSprite(181, 297);
  2920. break;
  2921. case 13:
  2922. redStones[11].drawSprite(209, 297);
  2923. break;
  2924. }
  2925. }
  2926. }
  2927. }
  2928.  
  2929. private void drawTabArea() {
  2930. inventoryBackImage.initDrawingArea();
  2931. Texture.anIntArray1472 = anIntArray1181;
  2932. tabArea[getSpriteID()].drawSprite(0, 0);
  2933. if(spriteChanged)
  2934. needDrawTabArea = true;
  2935. tabAreaAltered = true;
  2936. if(invOverlayInterfaceID == -1) {
  2937. drawRedStones();
  2938. drawSideIcons();
  2939. }
  2940. if(is474 || is480 || is508 || is525 || is562) {
  2941. if(invOverlayInterfaceID != -1)
  2942. drawInterface(0, 32, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2943. else if(tabInterfaceIDs[tabID] != -1)
  2944. drawInterface(0, 32, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2945. } else if(is562){
  2946. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  2947. tabHover.drawSprite(3, 0);
  2948. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  2949. tabHover.drawSprite(33, 0);
  2950. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  2951. tabHover.drawSprite(63, 0);
  2952. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  2953. tabHover.drawSprite(93, 0);
  2954. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  2955. tabHover.drawSprite(123, 0);
  2956. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  2957. tabHover.drawSprite(153, 0);
  2958. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  2959. tabHover.drawSprite(183, 0);
  2960. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  2961. tabHover.drawSprite(213, 0);
  2962. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  2963. tabHover.drawSprite(3, 298);
  2964. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  2965. tabHover.drawSprite(33, 298);
  2966. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  2967. tabHover.drawSprite(63, 298);
  2968. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  2969. tabHover.drawSprite(93, 298);
  2970. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  2971. tabHover.drawSprite(123, 298);
  2972. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  2973. tabHover.drawSprite(153, 298);
  2974. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  2975. tabHover.drawSprite(183,298);
  2976. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  2977. tabHover.drawSprite(213, 298);
  2978. } else {
  2979. if(invOverlayInterfaceID != -1)
  2980. drawInterface(0, 38, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2981. else if(tabInterfaceIDs[tabID] != -1)
  2982. drawInterface(0, 38, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2983. }
  2984. if(menuOpen)
  2985. drawMenu(516, 168);
  2986. inventoryBackImage.drawGraphics(168, super.graphics, 516);//519
  2987. inGameScreen.initDrawingArea();
  2988. Texture.anIntArray1472 = anIntArray1182;
  2989. }
  2990.  
  2991. private void method37(int j) {
  2992. if(!lowMem) {
  2993. if(Texture.anIntArray1480[17] >= j) {
  2994.  
  2995. Background background = Texture.aBackgroundArray1474s[17];
  2996. int k = background.anInt1452 * background.anInt1453 - 1;
  2997. //fire cape apparently?
  2998. int j1 = background.anInt1452 * anInt945 * 2;
  2999. byte abyte0[] = background.aByteArray1450;
  3000. byte abyte3[] = aByteArray912;
  3001. for(int i2 = 0; i2 <= k; i2++)
  3002. abyte3[i2] = abyte0[i2 - j1 & k];
  3003.  
  3004. background.aByteArray1450 = abyte3;
  3005. aByteArray912 = abyte0;
  3006. Texture.method370(17);
  3007. anInt854++;
  3008. if(anInt854 > 1235) {
  3009. anInt854 = 0;
  3010. stream.createFrame(226);
  3011. stream.writeWordBigEndian(0);
  3012. int l2 = stream.currentOffset;
  3013. stream.writeWord(58722);
  3014. stream.writeWordBigEndian(240);
  3015. stream.writeWord((int)(Math.random() * 65536D));
  3016. stream.writeWordBigEndian((int)(Math.random() * 256D));
  3017. if((int)(Math.random() * 2D) == 0)
  3018. stream.writeWord(51825);
  3019. stream.writeWordBigEndian((int)(Math.random() * 256D));
  3020. stream.writeWord((int)(Math.random() * 65536D));
  3021. stream.writeWord(7130);
  3022. stream.writeWord((int)(Math.random() * 65536D));
  3023. stream.writeWord(61657);
  3024. stream.writeBytes(stream.currentOffset - l2);
  3025. }
  3026. }
  3027. if(Texture.anIntArray1480[24] >= j) {
  3028. Background background_1 = Texture.aBackgroundArray1474s[24];
  3029. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  3030. int k1 = background_1.anInt1452 * anInt945 * 2;
  3031. byte abyte1[] = background_1.aByteArray1450;
  3032. byte abyte4[] = aByteArray912;
  3033. for(int j2 = 0; j2 <= l; j2++)
  3034. abyte4[j2] = abyte1[j2 - k1 & l];
  3035.  
  3036. background_1.aByteArray1450 = abyte4;
  3037. aByteArray912 = abyte1;
  3038. Texture.method370(24);
  3039. }
  3040. if(Texture.anIntArray1480[34] >= j) {
  3041. Background background_2 = Texture.aBackgroundArray1474s[34];
  3042. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3043. int l1 = background_2.anInt1452 * anInt945 * 2;
  3044. byte abyte2[] = background_2.aByteArray1450;
  3045. byte abyte5[] = aByteArray912;
  3046. for(int k2 = 0; k2 <= i1; k2++)
  3047. abyte5[k2] = abyte2[k2 - l1 & i1];
  3048.  
  3049. background_2.aByteArray1450 = abyte5;
  3050. aByteArray912 = abyte2;
  3051. Texture.method370(34);
  3052. }
  3053. if(Texture.anIntArray1480[40] >= j)
  3054. {
  3055. Background background_2 = Texture.aBackgroundArray1474s[40];
  3056. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3057. int l1 = background_2.anInt1452 * anInt945 * 2;
  3058. byte abyte2[] = background_2.aByteArray1450;
  3059. byte abyte5[] = aByteArray912;
  3060. for(int k2 = 0; k2 <= i1; k2++)
  3061. abyte5[k2] = abyte2[k2 - l1 & i1];
  3062.  
  3063. background_2.aByteArray1450 = abyte5;
  3064. aByteArray912 = abyte2;
  3065. Texture.method370(40);
  3066.  
  3067. }
  3068. }
  3069. }
  3070.  
  3071. private void method38() {
  3072. for(int i = -1; i < playerCount; i++) {
  3073. int j;
  3074. if(i == -1)
  3075. j = myPlayerIndex;
  3076. else
  3077. j = playerIndices[i];
  3078. Player player = playerArray[j];
  3079. if(player != null && player.textCycle > 0) {
  3080. player.textCycle--;
  3081. if(player.textCycle == 0)
  3082. player.textSpoken = null;
  3083. }
  3084. }
  3085. for(int k = 0; k < npcCount; k++) {
  3086. int l = npcIndices[k];
  3087. NPC npc = npcArray[l];
  3088. if(npc != null && npc.textCycle > 0) {
  3089. npc.textCycle--;
  3090. if(npc.textCycle == 0)
  3091. npc.textSpoken = null;
  3092. }
  3093. }
  3094. }
  3095.  
  3096. private void calcCameraPos() {
  3097.  
  3098. int i = anInt1098 * 128 + 64;
  3099. int j = anInt1099 * 128 + 64;
  3100. int k = method42(plane, j, i) - anInt1100;
  3101. if(xCameraPos < i) {
  3102. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  3103. if(xCameraPos > i)
  3104. xCameraPos = i;
  3105. }
  3106. if(xCameraPos > i) {
  3107. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  3108. if(xCameraPos < i)
  3109. xCameraPos = i;
  3110. }
  3111. if(zCameraPos < k) {
  3112. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  3113. if(zCameraPos > k)
  3114. zCameraPos = k;
  3115. }
  3116. if(zCameraPos > k) {
  3117. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  3118. if(zCameraPos < k)
  3119. zCameraPos = k;
  3120. }
  3121. if(yCameraPos < j) {
  3122. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  3123. if(yCameraPos > j)
  3124. yCameraPos = j;
  3125. }
  3126. if(yCameraPos > j) {
  3127. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  3128. if(yCameraPos < j)
  3129. yCameraPos = j;
  3130. }
  3131. i = anInt995 * 128 + 64;
  3132. j = anInt996 * 128 + 64;
  3133. k = method42(plane, j, i) - anInt997;
  3134. int l = i - xCameraPos;
  3135. int i1 = k - zCameraPos;
  3136. int j1 = j - yCameraPos;
  3137. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  3138. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  3139. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  3140. if(l1 < 128)
  3141. l1 = 128;
  3142. if(l1 > 383)
  3143. l1 = 383;
  3144. if(yCameraCurve < l1) {
  3145. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  3146. if(yCameraCurve > l1)
  3147. yCameraCurve = l1;
  3148. }
  3149. if(yCameraCurve > l1) {
  3150. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  3151. if(yCameraCurve < l1)
  3152. yCameraCurve = l1;
  3153. }
  3154. int j2 = i2 - xCameraCurve;
  3155. if(j2 > 1024)
  3156. j2 -= 2048;
  3157. if(j2 < -1024)
  3158. j2 += 2048;
  3159. if(j2 > 0) {
  3160. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  3161. xCameraCurve &= 0x7ff;
  3162. }
  3163. if(j2 < 0) {
  3164. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  3165. xCameraCurve &= 0x7ff;
  3166. }
  3167. int k2 = i2 - xCameraCurve;
  3168. if(k2 > 1024)
  3169. k2 -= 2048;
  3170. if(k2 < -1024)
  3171. k2 += 2048;
  3172. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  3173. xCameraCurve = i2;
  3174. }
  3175.  
  3176. private void drawMenu(int xOffSet, int yOffSet) {
  3177. if(menuToggle == false) {
  3178. int xPos = menuOffsetX - (xOffSet - 4);
  3179. int yPos = (-yOffSet + 4) + menuOffsetY;
  3180. int menuW = menuWidth;
  3181. int menuH = menuHeight + 1;
  3182. int color = 0x5d5447;
  3183. needDrawTabArea = true;
  3184. inputTaken = true;
  3185. tabAreaAltered = true;
  3186. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  3187. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  3188. DrawingArea.drawPixels(menuH, yPos, xPos, color, menuW);
  3189. DrawingArea.drawPixels(16, yPos + 1, xPos + 1, 0, menuW - 2);
  3190. DrawingArea.fillPixels(xPos + 1, menuW - 2, menuH - 19, 0, yPos + 18);
  3191. chatTextDrawingArea.method385(color, "Choose Option", yPos + 14, xPos + 3);
  3192. int mouseX = super.mouseX - (xOffSet);
  3193. int mouseY = (-yOffSet) + super.mouseY;
  3194. for(int l1 = 0; l1 < menuActionRow; l1++) {
  3195. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  3196. int disColor = 0xffffff;
  3197. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3)
  3198. disColor = 0xffff00;
  3199. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  3200. }
  3201. } else if(menuToggle == true) {
  3202. int xPos = menuOffsetX - (xOffSet - 4);
  3203. int yPos = (-yOffSet + 4) + menuOffsetY;
  3204. int menuW = menuWidth;
  3205. int menuH = menuHeight + 1;
  3206. needDrawTabArea = true;
  3207. inputTaken = true;
  3208. tabAreaAltered = true;
  3209. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  3210. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  3211. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  3212. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e, menuW - 2);
  3213. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  3214. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822, menuW - 6);
  3215. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822, menuW - 4);
  3216. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822, menuW - 2);
  3217. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d, menuW - 4);
  3218. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d, menuW - 6);
  3219. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c, menuW - 6);
  3220. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  3221. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  3222. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  3223. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  3224. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  3225. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  3226. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  3227. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  3228. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  3229. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  3230. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  3231. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  3232. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  3233. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  3234. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  3235. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  3236. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  3237. chatTextDrawingArea.method385(0xc6b895, "Choose Option", yPos + 14, xPos + 3);
  3238. int j1 = super.mouseX;
  3239. int k1 = super.mouseY;
  3240. int mouseX = super.mouseX - (xOffSet);
  3241. int mouseY = (-yOffSet) + super.mouseY;
  3242. for(int l1 = 0; l1 < menuActionRow; l1++) {
  3243. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  3244. int disColor = 0xc6b895;
  3245. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  3246. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  3247. disColor = 0xeee5c6;
  3248. }
  3249. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  3250. }
  3251. }
  3252. }
  3253.  
  3254. private void addFriend(long l) {
  3255. try {
  3256. if(l == 0L)
  3257. return;
  3258. if(friendsCount >= 100 && anInt1046 != 1) {
  3259. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3260. return;
  3261. }
  3262. if(friendsCount >= 200) {
  3263. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3264. return;
  3265. }
  3266. String s = TextClass.fixName(TextClass.nameForLong(l));
  3267. for(int i = 0; i < friendsCount; i++)
  3268. if(friendsListAsLongs[i] == l) {
  3269. pushMessage(s + " is already on your friend list", 0, "");
  3270. return;
  3271. }
  3272. for(int j = 0; j < ignoreCount; j++)
  3273. if(ignoreListAsLongs[j] == l) {
  3274. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  3275. return;
  3276. }
  3277.  
  3278. if(s.equals(myPlayer.name)) {
  3279. return;
  3280. } else {
  3281. friendsList[friendsCount] = s;
  3282. friendsListAsLongs[friendsCount] = l;
  3283. friendsNodeIDs[friendsCount] = 0;
  3284. friendsCount++;
  3285. needDrawTabArea = true;
  3286. stream.createFrame(188);
  3287. stream.writeQWord(l);
  3288. return;
  3289. }
  3290. } catch(RuntimeException runtimeexception) {
  3291. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  3292. }
  3293. throw new RuntimeException();
  3294. }
  3295.  
  3296. private int method42(int i, int j, int k) {
  3297. int l = k >> 7;
  3298. int i1 = j >> 7;
  3299. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  3300. return 0;
  3301. int j1 = i;
  3302. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  3303. j1++;
  3304. int k1 = k & 0x7f;
  3305. int l1 = j & 0x7f;
  3306. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  3307. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  3308. return i2 * (128 - l1) + j2 * l1 >> 7;
  3309. }
  3310.  
  3311. private static String intToKOrMil(int j) {
  3312. if(j < 0x186a0)
  3313. return String.valueOf(j);
  3314. if(j < 0x989680)
  3315. return j / 1000 + "K";
  3316. else
  3317. return j / 0xf4240 + "M";
  3318. }
  3319. public int canWalkDelay = 0;
  3320. public int getDis(int coordX1, int coordY1, int coordX2, int coordY2)
  3321. {
  3322. int deltaX = coordX2 - coordX1;
  3323. int deltaY = coordY2 - coordY1;
  3324. return ((int)Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)));
  3325. }
  3326. public int random(int range)
  3327. {
  3328. return (int)(Math.random() * range);
  3329. }
  3330. public boolean withinDistance(int x1, int y1, int x2, int y2, int dis)
  3331. {
  3332. for (int i = 0; i <= dis; i++)
  3333. {
  3334. try{
  3335. if ((x1 + i) == x2 && ((y1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3336. return true;
  3337. else
  3338. if ((x1 - i) == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3339. return true;
  3340. else
  3341. if (x1 == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3342. return true;
  3343. } catch(Exception ex){
  3344. System.out.println("Exception in following, method : WithingDistance");
  3345. }
  3346. }
  3347. return false;
  3348. }
  3349.  
  3350. private void resetLogout() {
  3351. try {
  3352. if(socketStream != null)
  3353. socketStream.close();
  3354. }
  3355. catch(Exception _ex) { }
  3356. socketStream = null;
  3357. alertHandler.alert = null;
  3358. loggedIn = false;
  3359. runClicked = true;
  3360. musicOrb = false;
  3361. restOrb = false;
  3362. followPlayer = 0;
  3363. followNPC = 0;
  3364. followDistance = 1;
  3365. prayClicked = false;
  3366. xpClicked = false;
  3367. drawXpBar = false;
  3368. loginScreenState = 0;
  3369. //myUsername = "";
  3370. //myPassword = "";
  3371. unlinkMRUNodes();
  3372. worldController.initToNull();
  3373. for(int i = 0; i < 4; i++)
  3374. aClass11Array1230[i].method210();
  3375. System.gc();
  3376. stopMidi();
  3377. currentSong = -1;
  3378. nextSong = -1;
  3379. prevSong = 0;
  3380. }
  3381.  
  3382. private void method45() {
  3383.  
  3384.  
  3385. aBoolean1031 = true;
  3386. for(int j = 0; j < 7; j++) {
  3387. anIntArray1065[j] = -1;
  3388. for(int k = 0; k < IdentityKit.length; k++) {
  3389. if(IdentityKit.cache[k].aBoolean662 || IdentityKit.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  3390. continue;
  3391. anIntArray1065[j] = k;
  3392. break;
  3393. }
  3394. }
  3395. }
  3396.  
  3397. private void method46(int i, Stream stream) {
  3398. while(stream.bitPosition + 21 < i * 8) {
  3399. int k = stream.readBits(14);
  3400. if(k == 16383)
  3401. break;
  3402. if(npcArray[k] == null)
  3403. npcArray[k] = new NPC();
  3404. NPC npc = npcArray[k];
  3405. npcIndices[npcCount++] = k;
  3406. npc.anInt1537 = loopCycle;
  3407. int l = stream.readBits(5);
  3408. if(l > 15)
  3409. l -= 32;
  3410. int i1 = stream.readBits(5);
  3411. if(i1 > 15)
  3412. i1 -= 32;
  3413. int j1 = stream.readBits(1);
  3414. npc.desc = EntityDef.forID(stream.readBits(14));//NPC FIX
  3415. int k1 = stream.readBits(1);
  3416. if(k1 == 1)
  3417. anIntArray894[anInt893++] = k;
  3418. npc.anInt1540 = npc.desc.aByte68;
  3419. npc.anInt1504 = npc.desc.anInt79;
  3420. npc.anInt1554 = npc.desc.anInt67;
  3421. npc.anInt1555 = npc.desc.anInt58;
  3422. npc.anInt1556 = npc.desc.anInt83;
  3423. npc.anInt1557 = npc.desc.anInt55;
  3424. npc.anInt1511 = npc.desc.anInt77;
  3425. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  3426. }
  3427. stream.finishBitAccess();
  3428. }
  3429.  
  3430. public void processGameLoop() {
  3431.  
  3432.  
  3433. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  3434. return;
  3435. loopCycle++;
  3436. if(!loggedIn)
  3437. processLoginScreenInput();
  3438. else
  3439. mainGameProcessor();
  3440. processOnDemandQueue();
  3441. }
  3442.  
  3443. private void method47(boolean flag) {
  3444. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  3445. destX = 0;
  3446. int j = playerCount;
  3447. if(flag)
  3448. j = 1;
  3449. for(int l = 0; l < j; l++) {
  3450. Player player;
  3451. int i1;
  3452. if(flag) {
  3453. player = myPlayer;
  3454. i1 = myPlayerIndex << 14;
  3455. } else {
  3456. player = playerArray[playerIndices[l]];
  3457. i1 = playerIndices[l] << 14;
  3458. }
  3459. if(player == null || !player.isVisible())
  3460. continue;
  3461. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  3462. int j1 = player.x >> 7;
  3463. int k1 = player.y >> 7;
  3464. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3465. continue;
  3466. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  3467. player.aBoolean1699 = false;
  3468. player.anInt1709 = method42(plane, player.y, player.x);
  3469. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  3470. continue;
  3471. }
  3472. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3473. if(anIntArrayArray929[j1][k1] == anInt1265)
  3474. continue;
  3475. anIntArrayArray929[j1][k1] = anInt1265;
  3476. }
  3477. player.anInt1709 = method42(plane, player.y, player.x);
  3478. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  3479. }
  3480. }
  3481.  
  3482. private boolean promptUserForInput(RSInterface class9) {
  3483. int j = class9.contentType;
  3484. if(anInt900 == 2) {
  3485. if(j == 201) {
  3486. inputTaken = true;
  3487. inputDialogState = 0;
  3488. messagePromptRaised = true;
  3489. promptInput = "";
  3490. friendsListAction = 1;
  3491. aString1121 = "Enter name of friend to add to list";
  3492. }
  3493. if(j == 202) {
  3494. inputTaken = true;
  3495. inputDialogState = 0;
  3496. messagePromptRaised = true;
  3497. promptInput = "";
  3498. friendsListAction = 2;
  3499. aString1121 = "Enter name of friend to delete from list";
  3500. }
  3501. }
  3502. if(j == 205) {
  3503. anInt1011 = 250;
  3504. return true;
  3505. }
  3506. if(j == 501) {
  3507. inputTaken = true;
  3508. inputDialogState = 0;
  3509. messagePromptRaised = true;
  3510. promptInput = "";
  3511. friendsListAction = 4;
  3512. aString1121 = "Enter name of player to add to list";
  3513. }
  3514. if(j == 502) {
  3515. inputTaken = true;
  3516. inputDialogState = 0;
  3517. messagePromptRaised = true;
  3518. promptInput = "";
  3519. friendsListAction = 5;
  3520. aString1121 = "Enter name of player to delete from list";
  3521. }
  3522. if(j == 550) {
  3523. inputTaken = true;
  3524. inputDialogState = 0;
  3525. messagePromptRaised = true;
  3526. promptInput = "";
  3527. friendsListAction = 6;
  3528. aString1121 = "Enter the name of the chat you wish to join";
  3529. }
  3530. if(j >= 300 && j <= 313) {
  3531. int k = (j - 300) / 2;
  3532. int j1 = j & 1;
  3533. int i2 = anIntArray1065[k];
  3534. if(i2 != -1) {
  3535. do {
  3536. if(j1 == 0 && --i2 < 0)
  3537. i2 = IdentityKit.length - 1;
  3538. if(j1 == 1 && ++i2 >= IdentityKit.length)
  3539. i2 = 0;
  3540. } while(IdentityKit.cache[i2].aBoolean662 || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3541. anIntArray1065[k] = i2;
  3542. aBoolean1031 = true;
  3543. }
  3544. }
  3545. if(j >= 314 && j <= 323) {
  3546. int l = (j - 314) / 2;
  3547. int k1 = j & 1;
  3548. int j2 = anIntArray990[l];
  3549. if(k1 == 0 && --j2 < 0)
  3550. j2 = anIntArrayArray1003[l].length - 1;
  3551. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3552. j2 = 0;
  3553. anIntArray990[l] = j2;
  3554. aBoolean1031 = true;
  3555. }
  3556. if(j == 324 && !aBoolean1047) {
  3557. aBoolean1047 = true;
  3558. method45();
  3559. }
  3560. if(j == 325 && aBoolean1047) {
  3561. aBoolean1047 = false;
  3562. method45();
  3563. }
  3564. if(j == 326) {
  3565. stream.createFrame(101);
  3566. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3567. for(int i1 = 0; i1 < 7; i1++)
  3568. stream.writeWordBigEndian(anIntArray1065[i1]);
  3569.  
  3570. for(int l1 = 0; l1 < 5; l1++)
  3571. stream.writeWordBigEndian(anIntArray990[l1]);
  3572.  
  3573. return true;
  3574. }
  3575. if(j == 613)
  3576. canMute = !canMute;
  3577. if(j >= 601 && j <= 612) {
  3578. clearTopInterfaces();
  3579. if(reportAbuseInput.length() > 0) {
  3580. stream.createFrame(218);
  3581. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3582. stream.writeWordBigEndian(j - 601);
  3583. stream.writeWordBigEndian(canMute ? 1 : 0);
  3584. }
  3585. }
  3586. return false;
  3587. }
  3588.  
  3589. private void method49(Stream stream) {
  3590. for(int j = 0; j < anInt893; j++) {
  3591. int k = anIntArray894[j];
  3592. Player player = playerArray[k];
  3593. int l = stream.readUnsignedByte();
  3594. if((l & 0x40) != 0)
  3595. l += stream.readUnsignedByte() << 8;
  3596. method107(l, k, stream, player);
  3597. }
  3598. }
  3599.  
  3600. private void method50(int i, int k, int l, int i1, int j1) {
  3601. int k1 = worldController.method300(j1, l, i);
  3602. if(k1 != 0) {
  3603. int l1 = worldController.method304(j1, l, i, k1);
  3604. int k2 = l1 >> 6 & 3;
  3605. int i3 = l1 & 0x1f;
  3606. int k3 = k;
  3607. if(k1 > 0)
  3608. k3 = i1;
  3609. int ai[] = aSprite_1263.myPixels;
  3610. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3611. int i5 = k1 >> 14 & 0x7fff;
  3612. ObjectDef class46_2 = ObjectDef.forID(i5);
  3613. if(class46_2.anInt758 != -1) {
  3614. Background background_2 = mapScenes[class46_2.anInt758];
  3615. if(background_2 != null) {
  3616. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3617. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3618. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  3619. }
  3620. } else {
  3621. if(i3 == 0 || i3 == 2)
  3622. if(k2 == 0) {
  3623. ai[k4] = k3;
  3624. ai[k4 + 512] = k3;
  3625. ai[k4 + 1024] = k3;
  3626. ai[k4 + 1536] = k3;
  3627. } else if(k2 == 1) {
  3628. ai[k4] = k3;
  3629. ai[k4 + 1] = k3;
  3630. ai[k4 + 2] = k3;
  3631. ai[k4 + 3] = k3;
  3632. } else if(k2 == 2) {
  3633. ai[k4 + 3] = k3;
  3634. ai[k4 + 3 + 512] = k3;
  3635. ai[k4 + 3 + 1024] = k3;
  3636. ai[k4 + 3 + 1536] = k3;
  3637. } else if(k2 == 3) {
  3638. ai[k4 + 1536] = k3;
  3639. ai[k4 + 1536 + 1] = k3;
  3640. ai[k4 + 1536 + 2] = k3;
  3641. ai[k4 + 1536 + 3] = k3;
  3642. }
  3643. if(i3 == 3)
  3644. if(k2 == 0)
  3645. ai[k4] = k3;
  3646. else if(k2 == 1)
  3647. ai[k4 + 3] = k3;
  3648. else if(k2 == 2)
  3649. ai[k4 + 3 + 1536] = k3;
  3650. else if(k2 == 3)
  3651. ai[k4 + 1536] = k3;
  3652. if(i3 == 2)
  3653. if(k2 == 3) {
  3654. ai[k4] = k3;
  3655. ai[k4 + 512] = k3;
  3656. ai[k4 + 1024] = k3;
  3657. ai[k4 + 1536] = k3;
  3658. } else if(k2 == 0) {
  3659. ai[k4] = k3;
  3660. ai[k4 + 1] = k3;
  3661. ai[k4 + 2] = k3;
  3662. ai[k4 + 3] = k3;
  3663. } else if(k2 == 1) {
  3664. ai[k4 + 3] = k3;
  3665. ai[k4 + 3 + 512] = k3;
  3666. ai[k4 + 3 + 1024] = k3;
  3667. ai[k4 + 3 + 1536] = k3;
  3668. } else if(k2 == 2) {
  3669. ai[k4 + 1536] = k3;
  3670. ai[k4 + 1536 + 1] = k3;
  3671. ai[k4 + 1536 + 2] = k3;
  3672. ai[k4 + 1536 + 3] = k3;
  3673. }
  3674. }
  3675. }
  3676. k1 = worldController.method302(j1, l, i);
  3677. if(k1 != 0) {
  3678. int i2 = worldController.method304(j1, l, i, k1);
  3679. int l2 = i2 >> 6 & 3;
  3680. int j3 = i2 & 0x1f;
  3681. int l3 = k1 >> 14 & 0x7fff;
  3682. ObjectDef class46_1 = ObjectDef.forID(l3);
  3683. if(class46_1.anInt758 != -1) {
  3684. Background background_1 = mapScenes[class46_1.anInt758];
  3685. if(background_1 != null) {
  3686. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3687. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3688. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  3689. }
  3690. } else if(j3 == 9) {
  3691. int l4 = 0xeeeeee;
  3692. if(k1 > 0)
  3693. l4 = 0xee0000;
  3694. int ai1[] = aSprite_1263.myPixels;
  3695. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3696. if(l2 == 0 || l2 == 2) {
  3697. ai1[l5 + 1536] = l4;
  3698. ai1[l5 + 1024 + 1] = l4;
  3699. ai1[l5 + 512 + 2] = l4;
  3700. ai1[l5 + 3] = l4;
  3701. } else {
  3702. ai1[l5] = l4;
  3703. ai1[l5 + 512 + 1] = l4;
  3704. ai1[l5 + 1024 + 2] = l4;
  3705. ai1[l5 + 1536 + 3] = l4;
  3706. }
  3707. }
  3708. }
  3709. k1 = worldController.method303(j1, l, i);
  3710. if(k1 != 0) {
  3711. int j2 = k1 >> 14 & 0x7fff;
  3712. ObjectDef class46 = ObjectDef.forID(j2);
  3713. if(class46.anInt758 != -1) {
  3714. Background background = mapScenes[class46.anInt758];
  3715. if(background != null) {
  3716. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3717. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3718. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3719. }
  3720. }
  3721. }
  3722. }
  3723.  
  3724. private void loadTitleScreen() {
  3725. if(normalLogin == true)
  3726. titleBox = new Background(titleStreamLoader, "titlebox", 0);
  3727. else
  3728. titleBox1 = new Sprite("Login/Random/TITLEBOX");
  3729. titleButton = new Background(titleStreamLoader, "titlebutton", 0);
  3730. aBackgroundArray1152s = new Background[12];
  3731. int j = 0;
  3732. try {
  3733. j = Integer.parseInt(getParameter("fl_icon"));
  3734. } catch(Exception _ex) {
  3735. }
  3736. if(j == 0) {
  3737. for(int k = 0; k < 12; k++)
  3738. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3739.  
  3740. } else {
  3741. for(int l = 0; l < 12; l++)
  3742. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3743.  
  3744. }
  3745. aSprite_1201 = new Sprite(128, 265);
  3746. aSprite_1202 = new Sprite(128, 265);
  3747. System.arraycopy(leftSideFlame.anIntArray315, 0, aSprite_1201.myPixels, 0, 33920);
  3748.  
  3749. System.arraycopy(rightSideFlame.anIntArray315, 0, aSprite_1202.myPixels, 0, 33920);
  3750.  
  3751. anIntArray851 = new int[256];
  3752. for(int k1 = 0; k1 < 64; k1++)
  3753. anIntArray851[k1] = k1 * 0x40000;
  3754.  
  3755. for(int l1 = 0; l1 < 64; l1++)
  3756. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3757.  
  3758. for(int i2 = 0; i2 < 64; i2++)
  3759. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3760.  
  3761. for(int j2 = 0; j2 < 64; j2++)
  3762. anIntArray851[j2 + 192] = 0xffffff;
  3763.  
  3764. anIntArray852 = new int[256];
  3765. for(int k2 = 0; k2 < 64; k2++)
  3766. anIntArray852[k2] = k2 * 1024;
  3767.  
  3768. for(int l2 = 0; l2 < 64; l2++)
  3769. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3770.  
  3771. for(int i3 = 0; i3 < 64; i3++)
  3772. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3773.  
  3774. for(int j3 = 0; j3 < 64; j3++)
  3775. anIntArray852[j3 + 192] = 0xffffff;
  3776.  
  3777. anIntArray853 = new int[256];
  3778. for(int k3 = 0; k3 < 64; k3++)
  3779. anIntArray853[k3] = k3 * 4;
  3780.  
  3781. for(int l3 = 0; l3 < 64; l3++)
  3782. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3783.  
  3784. for(int i4 = 0; i4 < 64; i4++)
  3785. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3786.  
  3787. for(int j4 = 0; j4 < 64; j4++)
  3788. anIntArray853[j4 + 192] = 0xffffff;
  3789.  
  3790. anIntArray850 = new int[256];
  3791. anIntArray1190 = new int[32768];
  3792. anIntArray1191 = new int[32768];
  3793. randomizeBackground(null);
  3794. anIntArray828 = new int[32768];
  3795. anIntArray829 = new int[32768];
  3796. if(!aBoolean831) {
  3797. drawFlames = true;
  3798. aBoolean831 = true;
  3799. startRunnable(this, 2);
  3800. }
  3801. }
  3802.  
  3803. private static void setHighMem() {
  3804. WorldController.lowMem = true;
  3805. Texture.lowMem = false;
  3806. lowMem = false;
  3807. ObjectManager.lowMem = false;
  3808. ObjectDef.lowMem = false;
  3809. }
  3810.  
  3811. public static void main(String args[]) {
  3812. try {
  3813. nodeID = 10;
  3814. portOff = 0;
  3815. setHighMem(); //sets high or low detail
  3816. isMembers = true;
  3817. signlink.storeid = 32;
  3818. signlink.startpriv(InetAddress.getLocalHost());
  3819. instance = new client();
  3820. instance.createClientFrame(503, 765);//client frame size
  3821. } catch(Exception e) {
  3822. e.printStackTrace();
  3823. }
  3824. }
  3825.  
  3826. public static client instance;
  3827.  
  3828. private void loadingStages()
  3829. {
  3830. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane)
  3831. {
  3832. inGameScreen.initDrawingArea();
  3833. loadingPleaseWait.drawSprite(8,9);;
  3834. inGameScreen.drawGraphics(4, super.graphics, 4);
  3835. loadingStage = 1;
  3836. aLong824 = System.currentTimeMillis();
  3837. }
  3838. if(loadingStage == 1)
  3839. {
  3840. int j = method54();
  3841. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L)
  3842. {
  3843. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3844. aLong824 = System.currentTimeMillis();
  3845. }
  3846. }
  3847. if(loadingStage == 2 && plane != anInt985)
  3848. {
  3849. anInt985 = plane;
  3850. method24(plane);
  3851. }
  3852. }
  3853.  
  3854. private int method54() {
  3855. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  3856. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3857. return -1;
  3858. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3859. return -2;
  3860. }
  3861. boolean flag = true;
  3862. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  3863. byte abyte0[] = aByteArrayArray1247[j];
  3864. if(abyte0 != null) {
  3865. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3866. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3867. if(aBoolean1159) {
  3868. k = 10;
  3869. l = 10;
  3870. }
  3871. flag &= ObjectManager.method189(k, abyte0, l);
  3872. }
  3873. }
  3874. if(!flag)
  3875. return -3;
  3876. if(aBoolean1080) {
  3877. return -4;
  3878. } else {
  3879. loadingStage = 2;
  3880. ObjectManager.anInt131 = plane;
  3881. method22();
  3882. stream.createFrame(121);
  3883. return 0;
  3884. }
  3885. }
  3886.  
  3887. private void method55()
  3888. {
  3889. 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())
  3890. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3891. class30_sub2_sub4_sub4.unlink();
  3892. else
  3893. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  3894. {
  3895. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  3896. {
  3897. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3898. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3899. 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);
  3900. }
  3901. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  3902. {
  3903. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3904. Player player;
  3905. if(j == unknownInt10)
  3906. player = myPlayer;
  3907. else
  3908. player = playerArray[j];
  3909. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3910. 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);
  3911. }
  3912. class30_sub2_sub4_sub4.method456(anInt945);
  3913. 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);
  3914. }
  3915.  
  3916. }
  3917.  
  3918. public AppletContext getAppletContext()
  3919. {
  3920. if(signlink.mainapp != null)
  3921. return signlink.mainapp.getAppletContext();
  3922. else
  3923. return super.getAppletContext();
  3924. }
  3925.  
  3926. private void drawLogo() {
  3927. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3928. Sprite sprite = new Sprite(abyte0, this);
  3929. if(normalLogin == true) {
  3930. leftSideFlame.initDrawingArea();
  3931. sprite.method346(0, 0);
  3932. rightSideFlame.initDrawingArea();
  3933. sprite.method346(-637, 0);
  3934. aRSImageProducer_1107.initDrawingArea();
  3935. sprite.method346(-128, 0);
  3936. aRSImageProducer_1108.initDrawingArea();
  3937. sprite.method346(-202, -371);
  3938. loginScreenArea.initDrawingArea();
  3939. sprite.method346(-202, -171);
  3940. gameLogo.initDrawingArea();
  3941. sprite.method346(0, -265);
  3942. aRSImageProducer_1113.initDrawingArea();
  3943. sprite.method346(-562, -265);
  3944. aRSImageProducer_1114.initDrawingArea();
  3945. sprite.method346(-128, -171);
  3946. aRSImageProducer_1115.initDrawingArea();
  3947. sprite.method346(-562, -171);
  3948. int ai[] = new int[sprite.myWidth];
  3949. for(int j = 0; j < sprite.myHeight; j++) {
  3950. for(int k = 0; k < sprite.myWidth; k++)
  3951. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3952. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3953. }
  3954. if(normalLogin == true) {
  3955. /*leftSideFlame.initDrawingArea();
  3956. sprite.method346(382, 0);
  3957. rightSideFlame.initDrawingArea();
  3958. sprite.method346(-255, 0);
  3959. aRSImageProducer_1107.initDrawingArea();
  3960. sprite.method346(254, 0);
  3961. aRSImageProducer_1108.initDrawingArea();
  3962. sprite.method346(180, -371);
  3963. loginScreenArea.initDrawingArea();
  3964. sprite.method346(180, -171);
  3965. gameLogo.initDrawingArea();
  3966. sprite.method346(382, -265);
  3967. aRSImageProducer_1113.initDrawingArea();
  3968. sprite.method346(-180, -265);
  3969. aRSImageProducer_1114.initDrawingArea();
  3970. sprite.method346(254, -171);
  3971. aRSImageProducer_1115.initDrawingArea();
  3972. sprite.method346(-180, -171);*/
  3973. sprite = new Sprite(titleStreamLoader, "logo", 0);
  3974. aRSImageProducer_1107.initDrawingArea();
  3975. //sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3976. }
  3977. } else {
  3978. int ai[] = new int[sprite.myWidth];
  3979. for(int j = 0; j < sprite.myHeight; j++) {
  3980. for(int k = 0; k < sprite.myWidth; k++)
  3981. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3982. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3983. }
  3984. LFull = new Sprite("Login/Random/LFull.png");
  3985. LEmpty = new Sprite("Login/Random/LEmpty.png");
  3986. Sprite logo = new Sprite(sign.signlink.findcachedir()+"/Sprites/Logo.PNG");
  3987. logo.drawSprite(385-174-174, 14+25);
  3988. loginScreenArea.initDrawingArea();
  3989. sprite.method346(0, 0);
  3990. }
  3991. sprite = null;
  3992. Object obj = null;
  3993. Object obj1 = null;
  3994. System.gc();
  3995. }
  3996.  
  3997. private void processOnDemandQueue()
  3998. {
  3999. do
  4000. {
  4001. OnDemandData onDemandData;
  4002. do
  4003. {
  4004. onDemandData = onDemandFetcher.getNextNode();
  4005. if(onDemandData == null)
  4006. return;
  4007. if(onDemandData.dataType == 0)
  4008. {
  4009. Model.method460(onDemandData.buffer, onDemandData.ID);
  4010. needDrawTabArea = true;
  4011. if(backDialogID != -1)
  4012. inputTaken = true;
  4013. }
  4014. //if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  4015. // Class36.method529(onDemandData.buffer, onDemandData.ID);
  4016. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  4017. saveMidi(songChanging, onDemandData.buffer);
  4018. if(onDemandData.dataType == 3 && loadingStage == 1)
  4019. {
  4020. //System.out.println(onDemandData.ID);
  4021. try {
  4022. writeFile(onDemandData.buffer, "./maps/" + onDemandData.ID + ".dat");
  4023. } catch (Exception e) {}
  4024. for(int i = 0; i < aByteArrayArray1183.length; i++)
  4025. {
  4026. if(anIntArray1235[i] == onDemandData.ID)
  4027. {
  4028. aByteArrayArray1183[i] = onDemandData.buffer;
  4029. if(onDemandData.buffer == null) {
  4030. anIntArray1235[i] = -1;
  4031. }
  4032. break;
  4033. }
  4034. if(anIntArray1236[i] != onDemandData.ID)
  4035. continue;
  4036. aByteArrayArray1247[i] = onDemandData.buffer;
  4037. if(onDemandData.buffer == null) {
  4038. anIntArray1236[i] = -1;
  4039. }
  4040. break;
  4041. }
  4042.  
  4043. }
  4044. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  4045. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  4046. } while(true);
  4047. }
  4048.  
  4049. private void calcFlamesPosition()
  4050. {
  4051. char c = '\u0100';
  4052. for(int j = 10; j < 117; j++)
  4053. {
  4054. int k = (int)(Math.random() * 100D);
  4055. if(k < 50)
  4056. anIntArray828[j + (c - 2 << 7)] = 255;
  4057. }
  4058. for(int l = 0; l < 100; l++)
  4059. {
  4060. int i1 = (int)(Math.random() * 124D) + 2;
  4061. int k1 = (int)(Math.random() * 128D) + 128;
  4062. int k2 = i1 + (k1 << 7);
  4063. anIntArray828[k2] = 192;
  4064. }
  4065.  
  4066. for(int j1 = 1; j1 < c - 1; j1++)
  4067. {
  4068. for(int l1 = 1; l1 < 127; l1++)
  4069. {
  4070. int l2 = l1 + (j1 << 7);
  4071. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  4072. }
  4073.  
  4074. }
  4075.  
  4076. anInt1275 += 128;
  4077. if(anInt1275 > anIntArray1190.length)
  4078. {
  4079. anInt1275 -= anIntArray1190.length;
  4080. int i2 = (int)(Math.random() * 12D);
  4081. randomizeBackground(aBackgroundArray1152s[i2]);
  4082. }
  4083. for(int j2 = 1; j2 < c - 1; j2++)
  4084. {
  4085. for(int i3 = 1; i3 < 127; i3++)
  4086. {
  4087. int k3 = i3 + (j2 << 7);
  4088. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  4089. if(i4 < 0)
  4090. i4 = 0;
  4091. anIntArray828[k3] = i4;
  4092. }
  4093.  
  4094. }
  4095.  
  4096. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  4097.  
  4098. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  4099. if(anInt1040 > 0)
  4100. anInt1040 -= 4;
  4101. if(anInt1041 > 0)
  4102. anInt1041 -= 4;
  4103. if(anInt1040 == 0 && anInt1041 == 0)
  4104. {
  4105. int l3 = (int)(Math.random() * 2000D);
  4106. if(l3 == 0)
  4107. anInt1040 = 1024;
  4108. if(l3 == 1)
  4109. anInt1041 = 1024;
  4110. }
  4111. }
  4112.  
  4113. private boolean saveWave(byte abyte0[], int i)
  4114. {
  4115. return abyte0 == null || signlink.wavesave(abyte0, i);
  4116. }
  4117.  
  4118. private void method60(int i)
  4119. {
  4120. RSInterface class9 = RSInterface.interfaceCache[i];
  4121. for(int j = 0; j < class9.children.length; j++)
  4122. {
  4123. if(class9.children[j] == -1)
  4124. break;
  4125. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  4126. if(class9_1.interfaceType == 1)
  4127. method60(class9_1.id);
  4128. class9_1.animationLength = 0;
  4129. class9_1.animationDelay = 0;
  4130. }
  4131. }
  4132.  
  4133. private void drawHeadIcon()
  4134. {
  4135. if(anInt855 != 2)
  4136. return;
  4137. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  4138. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  4139. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  4140. }
  4141.  
  4142. private void mainGameProcessor()
  4143. {
  4144. if(anInt1104 > 1)
  4145. anInt1104--;
  4146. if(anInt1011 > 0)
  4147. anInt1011--;
  4148. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4149. if (anInt1501 < 100) {
  4150. anInt1501++;
  4151. if (anInt1501 == 100) {
  4152. if (anInt1500 != 0) {
  4153. inputTaken = true;
  4154. }
  4155. if (anInt1044 != 0) {
  4156. needDrawTabArea = true;
  4157. }
  4158. }
  4159. }
  4160. } else if (anInt1501 > 0) {
  4161. anInt1501--;
  4162. }
  4163. for(int j = 0; j < 5; j++)
  4164. if(!parsePacket())
  4165. break;
  4166. if(!loggedIn)
  4167. return;
  4168. try{
  4169. canWalkDelay--;
  4170. if (followNPC > 0)
  4171. {
  4172. NPC n = npcArray[followNPC];
  4173. if (n != null)
  4174. {
  4175. if (!withinDistance(myPlayer.smallX[0], myPlayer.smallY[0], n.smallX[0], n.smallY[0], followDistance))
  4176. {
  4177. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, n.smallY[0], myPlayer.smallX[0], false, n.smallX[0]);
  4178. }
  4179. }
  4180. }
  4181. else if (followPlayer > 0 && canWalkDelay <= 0)
  4182. {
  4183. Player p = playerArray[followPlayer];
  4184. if (p != null)
  4185. {
  4186. int dis = getDis(myPlayer.smallX[0], myPlayer.smallY[0], p.smallX[0], p.smallY[0]);
  4187. if (dis > followDistance)
  4188. {
  4189. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], followDistance, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0]);
  4190. canWalkDelay = 30;
  4191. }
  4192. else if (dis == 0)
  4193. {
  4194. int rnd = random(4);
  4195. if (rnd == 0)
  4196. {
  4197. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] - 2);
  4198. }
  4199. else if (rnd == 1)
  4200. {
  4201. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] + 2);
  4202. }
  4203. else if (rnd == 2)
  4204. {
  4205. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] - 2, myPlayer.smallX[0], false, p.smallX[0]);
  4206. }
  4207. else if (rnd == 3)
  4208. {
  4209. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] + 2, myPlayer.smallX[0], false, p.smallX[0]);
  4210. }
  4211. canWalkDelay = 60;
  4212. }
  4213. }
  4214. }
  4215. } catch(Exception ex){
  4216. System.out.println("Exception in following, method : in process.)");
  4217. }
  4218. synchronized(mouseDetection.syncObject)
  4219. {
  4220. if(flagged)
  4221. {
  4222. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  4223. {
  4224. stream.createFrame(45);
  4225. stream.writeWordBigEndian(0);
  4226. int j2 = stream.currentOffset;
  4227. int j3 = 0;
  4228. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  4229. {
  4230. if(j2 - stream.currentOffset >= 240)
  4231. break;
  4232. j3++;
  4233. int l4 = mouseDetection.coordsY[j4];
  4234. if(l4 < 0)
  4235. l4 = 0;
  4236. else
  4237. if(l4 > 502)
  4238. l4 = 502;
  4239. int k5 = mouseDetection.coordsX[j4];
  4240. if(k5 < 0)
  4241. k5 = 0;
  4242. else
  4243. if(k5 > 764)
  4244. k5 = 764;
  4245. int i6 = l4 * 765 + k5;
  4246. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  4247. {
  4248. k5 = -1;
  4249. l4 = -1;
  4250. i6 = 0x7ffff;
  4251. }
  4252. if(k5 == anInt1237 && l4 == anInt1238)
  4253. {
  4254. if(anInt1022 < 2047)
  4255. anInt1022++;
  4256. } else
  4257. {
  4258. int j6 = k5 - anInt1237;
  4259. anInt1237 = k5;
  4260. int k6 = l4 - anInt1238;
  4261. anInt1238 = l4;
  4262. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  4263. {
  4264. j6 += 32;
  4265. k6 += 32;
  4266. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  4267. anInt1022 = 0;
  4268. } else
  4269. if(anInt1022 < 8)
  4270. {
  4271. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  4272. anInt1022 = 0;
  4273. } else
  4274. {
  4275. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  4276. anInt1022 = 0;
  4277. }
  4278. }
  4279. }
  4280.  
  4281. stream.writeBytes(stream.currentOffset - j2);
  4282. if(j3 >= mouseDetection.coordsIndex)
  4283. {
  4284. mouseDetection.coordsIndex = 0;
  4285. } else
  4286. {
  4287. mouseDetection.coordsIndex -= j3;
  4288. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  4289. {
  4290. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  4291. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  4292. }
  4293.  
  4294. }
  4295. }
  4296. } else
  4297. {
  4298. mouseDetection.coordsIndex = 0;
  4299. }
  4300. }
  4301. if(super.clickMode3 != 0)
  4302. {
  4303. long l = (super.aLong29 - aLong1220) / 50L;
  4304. if(l > 4095L)
  4305. l = 4095L;
  4306. aLong1220 = super.aLong29;
  4307. int k2 = super.saveClickY;
  4308. if(k2 < 0)
  4309. k2 = 0;
  4310. else
  4311. if(k2 > 502)
  4312. k2 = 502;
  4313. int k3 = super.saveClickX;
  4314. if(k3 < 0)
  4315. k3 = 0;
  4316. else
  4317. if(k3 > 764)
  4318. k3 = 764;
  4319. int k4 = k2 * 765 + k3;
  4320. int j5 = 0;
  4321. if(super.clickMode3 == 2)
  4322. j5 = 1;
  4323. int l5 = (int)l;
  4324. stream.createFrame(241);
  4325. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  4326. }
  4327. if(anInt1016 > 0)
  4328. anInt1016--;
  4329. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  4330. aBoolean1017 = true;
  4331. if(aBoolean1017 && anInt1016 <= 0)
  4332. {
  4333. anInt1016 = 20;
  4334. aBoolean1017 = false;
  4335. stream.createFrame(86);
  4336. stream.writeWord(anInt1184);
  4337. stream.method432(minimapInt1);
  4338. }
  4339. if(super.awtFocus && !aBoolean954)
  4340. {
  4341. aBoolean954 = true;
  4342. stream.createFrame(3);
  4343. stream.writeWordBigEndian(1);
  4344. }
  4345. if(!super.awtFocus && aBoolean954)
  4346. {
  4347. aBoolean954 = false;
  4348. stream.createFrame(3);
  4349. stream.writeWordBigEndian(0);
  4350. }
  4351. loadingStages();
  4352. method115();
  4353. method90();
  4354. anInt1009++;
  4355. if(anInt1009 > 750)
  4356. dropClient();
  4357. method114();
  4358. method95();
  4359. method38();
  4360.  
  4361. anInt945++;
  4362. if(crossType != 0)
  4363. {
  4364. crossIndex += 20;
  4365. if(crossIndex >= 400)
  4366. crossType = 0;
  4367. }
  4368. if(atInventoryInterfaceType != 0)
  4369. {
  4370. atInventoryLoopCycle++;
  4371. if(atInventoryLoopCycle >= 15)
  4372. {
  4373. if(atInventoryInterfaceType == 2)
  4374. needDrawTabArea = true;
  4375. if(atInventoryInterfaceType == 3)
  4376. inputTaken = true;
  4377. atInventoryInterfaceType = 0;
  4378. }
  4379. }
  4380. if(activeInterfaceType != 0)
  4381. {
  4382. anInt989++;
  4383. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  4384. aBoolean1242 = true;
  4385. if(super.clickMode2 == 0)
  4386. {
  4387. if(activeInterfaceType == 2)
  4388. needDrawTabArea = true;
  4389. if(activeInterfaceType == 3)
  4390. inputTaken = true;
  4391. activeInterfaceType = 0;
  4392. if(aBoolean1242 && anInt989 >= 5)
  4393. {
  4394. lastActiveInvInterface = -1;
  4395. processRightClick();
  4396. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  4397. {
  4398. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4399. int j1 = 0;
  4400. if(anInt913 == 1 && class9.contentType == 206)
  4401. j1 = 1;
  4402. if(class9.inventory[mouseInvInterfaceIndex] <= 0)
  4403. j1 = 0;
  4404. if(class9.deletesTargetSlot)
  4405. {
  4406. int l2 = anInt1085;
  4407. int l3 = mouseInvInterfaceIndex;
  4408. class9.inventory[l3] = class9.inventory[l2];
  4409. class9.inventoryValue[l3] = class9.inventoryValue[l2];
  4410. class9.inventory[l2] = -1;
  4411. class9.inventoryValue[l2] = 0;
  4412. } else
  4413. if(j1 == 1)
  4414. {
  4415. int i3 = anInt1085;
  4416. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  4417. if(i3 > i4)
  4418. {
  4419. class9.swapInventoryItems(i3, i3 - 1);
  4420. i3--;
  4421. } else
  4422. if(i3 < i4)
  4423. {
  4424. class9.swapInventoryItems(i3, i3 + 1);
  4425. i3++;
  4426. }
  4427.  
  4428. } else
  4429. {
  4430. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  4431. }
  4432. stream.createFrame(214);
  4433. stream.method433(anInt1084);
  4434. stream.method424(j1);
  4435. stream.method433(anInt1085);
  4436. stream.method431(mouseInvInterfaceIndex);
  4437. }
  4438. } else
  4439. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  4440. determineMenuSize();
  4441. else
  4442. if(menuActionRow > 0)
  4443. doAction(menuActionRow - 1);
  4444. atInventoryLoopCycle = 10;
  4445. super.clickMode3 = 0;
  4446. }
  4447. }
  4448. if(WorldController.anInt470 != -1)
  4449. {
  4450. int k = WorldController.anInt470;
  4451. int k1 = WorldController.anInt471;
  4452. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  4453. WorldController.anInt470 = -1;
  4454. if(flag)
  4455. {
  4456. crossX = super.saveClickX;
  4457. crossY = super.saveClickY;
  4458. crossType = 1;
  4459. crossIndex = 0;
  4460. }
  4461. }
  4462. if(super.clickMode3 == 1 && aString844 != null)
  4463. {
  4464. aString844 = null;
  4465. inputTaken = true;
  4466. super.clickMode3 = 0;
  4467. }
  4468. processMenuClick();
  4469. processMainScreenClick();
  4470. processTabClick();
  4471. processChatModeClick();
  4472. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  4473. anInt1213++;
  4474. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4475. if (anInt1501 < 100) {
  4476. anInt1501++;
  4477. if (anInt1501 == 100) {
  4478. if (anInt1500 != 0) {
  4479. inputTaken = true;
  4480. }
  4481. if (anInt1044 != 0) {
  4482. needDrawTabArea = true;
  4483. }
  4484. }
  4485. }
  4486. } else if (anInt1501 > 0) {
  4487. anInt1501--;
  4488. }
  4489. if(loadingStage == 2)
  4490. method108();
  4491. if(loadingStage == 2 && aBoolean1160)
  4492. calcCameraPos();
  4493. for(int i1 = 0; i1 < 5; i1++)
  4494. anIntArray1030[i1]++;
  4495.  
  4496. method73();
  4497. super.idleTime++;
  4498. if(super.idleTime > 4500)
  4499. {
  4500. anInt1011 = 250;
  4501. super.idleTime -= 500;
  4502. stream.createFrame(202);
  4503. }
  4504. anInt988++;
  4505. if(anInt988 > 500)
  4506. {
  4507. anInt988 = 0;
  4508. int l1 = (int)(Math.random() * 8D);
  4509. if((l1 & 1) == 1)
  4510. anInt1278 += anInt1279;
  4511. if((l1 & 2) == 2)
  4512. anInt1131 += anInt1132;
  4513. if((l1 & 4) == 4)
  4514. anInt896 += anInt897;
  4515. }
  4516. if(anInt1278 < -50)
  4517. anInt1279 = 2;
  4518. if(anInt1278 > 50)
  4519. anInt1279 = -2;
  4520. if(anInt1131 < -55)
  4521. anInt1132 = 2;
  4522. if(anInt1131 > 55)
  4523. anInt1132 = -2;
  4524. if(anInt896 < -40)
  4525. anInt897 = 1;
  4526. if(anInt896 > 40)
  4527. anInt897 = -1;
  4528. anInt1254++;
  4529. if(anInt1254 > 500)
  4530. {
  4531. anInt1254 = 0;
  4532. int i2 = (int)(Math.random() * 8D);
  4533. if((i2 & 1) == 1)
  4534. minimapInt2 += anInt1210;
  4535. if((i2 & 2) == 2)
  4536. minimapInt3 += anInt1171;
  4537. }
  4538. if(minimapInt2 < -60)
  4539. anInt1210 = 2;
  4540. if(minimapInt2 > 60)
  4541. anInt1210 = -2;
  4542. if(minimapInt3 < -20)
  4543. anInt1171 = 1;
  4544. if(minimapInt3 > 10)
  4545. anInt1171 = -1;
  4546. anInt1010++;
  4547. if(anInt1010 > 50)
  4548. stream.createFrame(0);
  4549. try
  4550. {
  4551. if(socketStream != null && stream.currentOffset > 0)
  4552. {
  4553. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  4554. stream.currentOffset = 0;
  4555. anInt1010 = 0;
  4556. }
  4557. } catch(IOException _ex) {
  4558. dropClient();
  4559. } catch(Exception exception) {
  4560. resetLogout();
  4561. }
  4562. }
  4563.  
  4564. private void method63()
  4565. {
  4566. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  4567. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  4568. if(class30_sub1.anInt1294 == -1) {
  4569. class30_sub1.anInt1302 = 0;
  4570. method89(class30_sub1);
  4571. } else {
  4572. class30_sub1.unlink();
  4573. }
  4574.  
  4575. }
  4576.  
  4577. private void resetImageProducers()
  4578. {
  4579. if(aRSImageProducer_1107 != null)
  4580. return;
  4581. super.fullGameScreen = null;
  4582. chatBackImage = null;
  4583. mapBackImage = null;
  4584. inventoryBackImage = null;
  4585. inGameScreen = null;
  4586. //aRSImageProducer_1123 = null;
  4587. aRSImageProducer_1124 = null;
  4588. aRSImageProducer_1125 = null;
  4589.  
  4590. leftSideFlame = new RSImageProducer(128, 265, getGameComponent());
  4591. DrawingArea.setAllPixelsToZero();
  4592. rightSideFlame = new RSImageProducer(128, 265, getGameComponent());
  4593. DrawingArea.setAllPixelsToZero();
  4594. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  4595. DrawingArea.setAllPixelsToZero();
  4596. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  4597. DrawingArea.setAllPixelsToZero();
  4598. if(normalLogin == true) {
  4599. loginScreenArea = new RSImageProducer(360, 200, getGameComponent());
  4600. DrawingArea.setAllPixelsToZero();
  4601. } else if(normalLogin == false) {
  4602. loginScreenArea = new RSImageProducer(765, 503, getGameComponent());
  4603. DrawingArea.setAllPixelsToZero();
  4604. }
  4605. gameLogo = new RSImageProducer(202, 238, getGameComponent());
  4606. DrawingArea.setAllPixelsToZero();
  4607. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  4608. DrawingArea.setAllPixelsToZero();
  4609. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4610. DrawingArea.setAllPixelsToZero();
  4611. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4612. DrawingArea.setAllPixelsToZero();
  4613. if(titleStreamLoader != null) {
  4614. drawLogo();
  4615. loadTitleScreen();
  4616. }
  4617. welcomeScreenRaised = true;
  4618. }
  4619.  
  4620. void drawLoadingText(int i, String s) {
  4621. anInt1079 = i;
  4622. aString1049 = s;
  4623. resetImageProducers();
  4624. if(titleStreamLoader == null) {
  4625. super.drawLoadingText(i, s);
  4626. return;
  4627. }
  4628. loginScreenArea.initDrawingArea();
  4629. Sprite loadingBarBkg = new Sprite("Login/Loading 1");
  4630. Sprite loadingBar = new Sprite(sign.signlink.findcachedir() + "Sprites/Login/Loading 2.png", (int)Math.round(i*2.02), 12);
  4631. loadingBarBkg.drawSprite(20, 30);
  4632. loadingBar.drawSprite(82, 54);
  4633. newRegularFont.drawCenteredString(s + " - "+i+"%", 180, 46, 0xFFFFFD, 0);
  4634.  
  4635. loginScreenArea.drawGraphics(171, super.graphics, 202);
  4636. if(welcomeScreenRaised)
  4637. {
  4638. welcomeScreenRaised = false;
  4639. if(!aBoolean831)
  4640. {
  4641. leftSideFlame.drawGraphics(0, super.graphics, 0);
  4642. rightSideFlame.drawGraphics(0, super.graphics, 637);
  4643. }
  4644. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  4645. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  4646. gameLogo.drawGraphics(265, super.graphics, 0);
  4647. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  4648. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  4649. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  4650. }
  4651. }
  4652.  
  4653.  
  4654. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  4655. int j1)
  4656. {
  4657. int anInt992;
  4658. if(aBoolean972)
  4659. anInt992 = 32;
  4660. else
  4661. anInt992 = 0;
  4662. aBoolean972 = false;
  4663. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  4664. {
  4665. class9.scrollPosition -= anInt1213 * 4;
  4666. if(flag)
  4667. {
  4668. needDrawTabArea = true;
  4669. }
  4670. } else
  4671. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  4672. {
  4673. class9.scrollPosition += anInt1213 * 4;
  4674. if(flag)
  4675. {
  4676. needDrawTabArea = true;
  4677. }
  4678. } else
  4679. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  4680. {
  4681. int l1 = ((j - 32) * j) / j1;
  4682. if(l1 < 8)
  4683. l1 = 8;
  4684. int i2 = l - i1 - 16 - l1 / 2;
  4685. int j2 = j - 32 - l1;
  4686. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4687. if(flag)
  4688. needDrawTabArea = true;
  4689. aBoolean972 = true;
  4690. }
  4691. }
  4692.  
  4693. private boolean method66(int i, int j, int k)
  4694. {
  4695. int i1 = i >> 14 & 0x7fff;
  4696. int j1 = worldController.method304(plane, k, j, i);
  4697. if(j1 == -1)
  4698. return false;
  4699. int k1 = j1 & 0x1f;
  4700. int l1 = j1 >> 6 & 3;
  4701. if(k1 == 10 || k1 == 11 || k1 == 22)
  4702. {
  4703. ObjectDef class46 = ObjectDef.forID(i1);
  4704. int i2;
  4705. int j2;
  4706. if(l1 == 0 || l1 == 2)
  4707. {
  4708. i2 = class46.anInt744;
  4709. j2 = class46.anInt761;
  4710. } else
  4711. {
  4712. i2 = class46.anInt761;
  4713. j2 = class46.anInt744;
  4714. }
  4715. int k2 = class46.anInt768;
  4716. if(l1 != 0)
  4717. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4718. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  4719. } else
  4720. {
  4721. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  4722. }
  4723. crossX = super.saveClickX;
  4724. crossY = super.saveClickY;
  4725. crossType = 2;
  4726. crossIndex = 0;
  4727. return true;
  4728. }
  4729.  
  4730. private NamedArchive streamLoaderForName(int i, String s, String s1, int j, int k)
  4731. {
  4732. byte abyte0[] = null;
  4733. int l = 5;
  4734. try
  4735. {
  4736. if(decompressors[0] != null) {
  4737. abyte0 = decompressors[0].decompress(i);
  4738. }
  4739. if(abyte0 == null)
  4740. {
  4741. drawLoadingText(0, "Connecting to File Server...");
  4742. new Update("http://dl.dropbox.com/u/33278148/ErasedPkzcache1.zip", "ErasedPkzcache1.zip", signlink.findcachedir());
  4743. abyte0 = decompressors[0].decompress(i);
  4744. }
  4745. } catch (Exception e) {
  4746. e.printStackTrace();
  4747. }
  4748. if(abyte0 != null)
  4749. {
  4750. NamedArchive archive = new NamedArchive(abyte0, s);
  4751. return archive;
  4752. }
  4753. while (true) {
  4754. drawLoadingText(0, "Error loading... Please report!");
  4755. try {
  4756. Thread.sleep(1000);
  4757. } catch (Exception e) {
  4758. e.printStackTrace();
  4759. }
  4760. }
  4761. }
  4762.  
  4763. private void dropClient()
  4764. {
  4765. if(anInt1011 > 0)
  4766. {
  4767. resetLogout();
  4768. return;
  4769. }
  4770. inGameScreen.initDrawingArea();
  4771. reestablish.drawSprite(8,9);
  4772. inGameScreen.drawGraphics(4, super.graphics, 4);
  4773. anInt1021 = 0;
  4774. destX = 0;
  4775. RSSocket rsSocket = socketStream;
  4776. loggedIn = false;
  4777. loginFailures = 0;
  4778. login(myUsername, myPassword, true);
  4779. if(!loggedIn)
  4780. resetLogout();
  4781. try
  4782. {
  4783. rsSocket.close();
  4784. }
  4785. catch(Exception _ex)
  4786. {
  4787. }
  4788. }
  4789.  
  4790. private void doAction(int i)
  4791. {
  4792. if(i < 0)
  4793. return;
  4794. if(inputDialogState != 0)
  4795. {
  4796. inputDialogState = 0;
  4797. inputTaken = true;
  4798. }
  4799. int j = menuActionCmd2[i];
  4800. int k = menuActionCmd3[i];
  4801. int l = menuActionID[i];
  4802. int i1 = menuActionCmd1[i];
  4803. if(l >= 2000)
  4804. l -= 2000;
  4805. if (l == 476) {
  4806. alertHandler.close();
  4807. }
  4808. if(l == 582)
  4809. {
  4810. NPC npc = npcArray[i1];
  4811. if(npc != null)
  4812. {
  4813. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4814. crossX = super.saveClickX;
  4815. crossY = super.saveClickY;
  4816. crossType = 2;
  4817. crossIndex = 0;
  4818. stream.createFrame(57);
  4819. stream.method432(anInt1285);
  4820. stream.method432(i1);
  4821. stream.method431(anInt1283);
  4822. stream.method432(anInt1284);
  4823. }
  4824. }
  4825. if(l == 234)
  4826. {
  4827. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4828. if(!flag1)
  4829. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4830. crossX = super.saveClickX;
  4831. crossY = super.saveClickY;
  4832. crossType = 2;
  4833. crossIndex = 0;
  4834. stream.createFrame(236);
  4835. stream.method431(k + baseY);
  4836. stream.writeWord(i1);
  4837. stream.method431(j + baseX);
  4838. }
  4839. if(l == 62 && method66(i1, k, j))
  4840. {
  4841. stream.createFrame(192);
  4842. stream.writeWord(anInt1284);
  4843. stream.method431(i1 >> 14 & 0x7fff);
  4844. stream.method433(k + baseY);
  4845. stream.method431(anInt1283);
  4846. stream.method433(j + baseX);
  4847. stream.writeWord(anInt1285);
  4848. }
  4849. if(l == 511)
  4850. {
  4851. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4852. if(!flag2)
  4853. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4854. crossX = super.saveClickX;
  4855. crossY = super.saveClickY;
  4856. crossType = 2;
  4857. crossIndex = 0;
  4858. stream.createFrame(25);
  4859. stream.method431(anInt1284);
  4860. stream.method432(anInt1285);
  4861. stream.writeWord(i1);
  4862. stream.method432(k + baseY);
  4863. stream.method433(anInt1283);
  4864. stream.writeWord(j + baseX);
  4865. }
  4866. if(l == 74)
  4867. {
  4868. stream.createFrame(122);
  4869. stream.method433(k);
  4870. stream.method432(j);
  4871. stream.method431(i1);
  4872. atInventoryLoopCycle = 0;
  4873. atInventoryInterface = k;
  4874. atInventoryIndex = j;
  4875. atInventoryInterfaceType = 2;
  4876. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4877. atInventoryInterfaceType = 1;
  4878. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4879. atInventoryInterfaceType = 3;
  4880. }
  4881. /*if(is480 || is508 || is525) {
  4882. switch(l){
  4883. case 1014: setTab(13); setSidebarInterface(13, 29500); break;//harp
  4884. case 1013: setTab(12); setSidebarInterface(12, 147); break;//emotes
  4885. case 1012: setTab(11); setSidebarInterface(11, 904); break;//options
  4886. case 1010: setTab(9); setSidebarInterface(9, 5715); break;//ignore
  4887. case 1009: setTab(8); setSidebarInterface(8, 5065); break;//friend
  4888. case 1027: setTab(6); break;//spellbook
  4889. case 1026: setTab(5); break;//prayer
  4890. case 1030: setTab(4); setSidebarInterface(4, 1644); break;//worn
  4891. case 1024: setTab(3); setSidebarInterface(3, 3213); break;//inventory
  4892. case 1023: setTab(2); setSidebarInterface(2, 638); break;//quests
  4893. case 1022: setTab(1); setSidebarInterface(1, 3917); break;//stats
  4894. case 1021: setTab(0); break;//style
  4895. case 1008: setTab(10); setSidebarInterface(10, 18128); break;//logout new clan
  4896. case 1011: setTab(14); setSidebarInterface(14, 2449); break;//logout
  4897. case 1502: setTab(7); setSidebarInterface(7, 2449); break;//clan
  4898. }
  4899. } else {
  4900. switch(l){
  4901. case 1014: setTab(13); setSidebarInterface(13, 29500); break;//harp
  4902. case 1013: setTab(12); setSidebarInterface(12, 147); break;//emotes
  4903. case 1012: setTab(11); setSidebarInterface(11, 904); break;//options
  4904. case 1010: setTab(9); setSidebarInterface(9, 5715); break;//ignore
  4905. case 1009: setTab(8); setSidebarInterface(8, 5065); break;//friend
  4906. case 1027: setTab(6); break;//spellbook
  4907. case 1026: setTab(5); break;//prayer
  4908. case 1030: setTab(4); setSidebarInterface(4, 1644); break;//worn
  4909. case 1024: setTab(3); setSidebarInterface(3, 3213); break;//inventory
  4910. case 1023: setTab(2); setSidebarInterface(2, 638); break;//quests
  4911. case 1022: setTab(1); setSidebarInterface(1, 3917); break;//stats
  4912. case 1021: setTab(0); break;//style
  4913. case 1008: setTab(7); setSidebarInterface(7, 18128); break;
  4914. case 1011: setTab(10); setSidebarInterface(10, 2449); break;
  4915. }
  4916. }*/
  4917. switch(l){
  4918. case 1050:
  4919. runState = 1;
  4920. if(!runClicked) {
  4921. runClicked = true;
  4922. musicOrb = false;
  4923. restOrb = false;
  4924. stream.createFrame(185);
  4925. stream.writeWord(153);
  4926. } else {
  4927. runClicked = false;
  4928. stream.createFrame(185);
  4929. stream.writeWord(152);
  4930. }
  4931. break;
  4932. case 1500:
  4933. if(!prayClicked){
  4934. prayClicked = true;
  4935. } else {
  4936. prayClicked = false;
  4937. }
  4938. break;
  4939. case 1501:
  4940. runState = 2;
  4941. if(!musicOrb && restOrb){
  4942. musicOrb = true;
  4943. restOrb = false;
  4944. } else if(musicOrb && !restOrb){
  4945. musicOrb = false;
  4946. restOrb = true;
  4947. } else if(!musicOrb && !restOrb){
  4948. musicOrb =false;
  4949. restOrb = true;
  4950. }
  4951. break;
  4952. case 1503:
  4953. if(!drawXpBar) {
  4954. drawXpBar = true;
  4955. } else {
  4956. drawXpBar = false;
  4957. }
  4958. break;
  4959. case 1504:
  4960. testXp = 0;
  4961. break;
  4962. }
  4963. if (l == 315) {
  4964. System.out.println("sendPacket185("+k+")");
  4965. RSInterface class9 = RSInterface.interfaceCache[k];
  4966. boolean flag8 = true;
  4967. if (class9.contentType > 0)
  4968. flag8 = promptUserForInput(class9);
  4969. if (flag8) {
  4970.  
  4971. switch(k){
  4972. case 19144:
  4973. sendFrame248(15106,3213);
  4974. method60(15106);
  4975. inputTaken = true;
  4976. break;
  4977. case 27615:
  4978. setSidebarInterface(4, 1644);
  4979. break;
  4980. case 25843://arrow
  4981. setSidebarInterface(11, 24500);
  4982. break;
  4983. case 27610://return
  4984. setSidebarInterface(11, 904);
  4985. break;
  4986. case 27508://hp
  4987. sendFrame126("OFF", 27528);
  4988. if (hitbarToggle) {
  4989. hitbarToggle = false;
  4990. sendFrame126("OFF", 27528); sendFrame126("", 27524);
  4991. } else {
  4992. hitbarToggle = true;
  4993. sendFrame126("ON", 27524); sendFrame126("", 27528);
  4994. }
  4995. break;
  4996. case 27509://menu
  4997. sendFrame126("OFF", 27529);
  4998. if (menuToggle) {
  4999. menuToggle = false;
  5000. sendFrame126("OFF", 27529); sendFrame126("", 27525);
  5001. } else {
  5002. menuToggle = true;
  5003. sendFrame126("ON", 27525); sendFrame126("", 27529);
  5004. }
  5005. break;
  5006. case 27510://names
  5007. sendFrame126("OFF", 27530);
  5008. if (namesToggle) {
  5009. namesToggle = false;
  5010. sendFrame126("OFF", 27530); sendFrame126("", 27526);
  5011. } else {
  5012. namesToggle = true;
  5013. sendFrame126("ON", 27526); sendFrame126("", 27530);
  5014. }
  5015. break;
  5016. case 27532://gameframe
  5017. if(anInt1021 == 2) {
  5018. pushMessage("Switching gameframes is disabled while in barrows.", 0, "");
  5019. } else {
  5020. sendFrame126("459", 27531);
  5021. if(is459) {
  5022. is459 = false; is474 = true;
  5023. sendFrame126("474", 27536);
  5024. sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  5025. } else if(is474) {
  5026. is474 = false; is480 = true;
  5027. sendFrame126("483", 27536);
  5028. sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  5029. } else if (is480) {
  5030. is480 = false; is508 = true;
  5031. sendFrame126("508", 27537);
  5032. sendFrame126("", 27533); sendFrame126("", 27536); sendFrame126("", 27538); sendFrame126("", 27531);
  5033. } else if(is508) {
  5034. is508 = false; is525 = true;
  5035. sendFrame126("525", 27538);
  5036. sendFrame126("", 27536); sendFrame126("", 27537); sendFrame126("", 27533); sendFrame126("", 27531);
  5037. } else if(is525) {
  5038. is525 = false; is562 = true;
  5039. sendFrame126("562", 27536);
  5040. sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  5041. } else if(is562) {
  5042. is562 = false; is508 = false; is525 = false; is480 = false; is474 = false; is459 = true;
  5043. sendFrame126("", 27533); sendFrame126("", 27536); sendFrame126("", 27537); sendFrame126("", 27538);
  5044. sendFrame126("377", 27531);
  5045. }
  5046. }
  5047. break;
  5048. case 27606://x10
  5049. sendFrame126("OFF", 27605);
  5050. if (newDamage) {
  5051. newDamage = false;
  5052. sendFrame126("OFF", 27605);
  5053. sendFrame126("", 27604);
  5054. } else {
  5055. newDamage = true;
  5056. sendFrame126("ON", 27604);
  5057. sendFrame126("", 27605);
  5058. }
  5059. break;
  5060. case 27521://hitmarks
  5061. sendFrame126("OFF", 27603);
  5062. if (hitmarks) {
  5063. hitmarks = false;
  5064. sendFrame126("OFF", 27603);
  5065. sendFrame126("", 27602);
  5066. } else {
  5067. hitmarks = true;
  5068. sendFrame126("ON", 27602);
  5069. sendFrame126("", 27603);
  5070. }
  5071. break;
  5072. case 29156://achievement
  5073. setSidebarInterface(2, 29265);
  5074. break;
  5075. case 29267://Quest
  5076. setSidebarInterface(2, 638);
  5077. break;
  5078.  
  5079. default:
  5080. stream.createFrame(185);
  5081. stream.writeWord(k);
  5082. break;
  5083.  
  5084. }
  5085. }
  5086. }
  5087. if(l == 561)
  5088. {
  5089. Player player = playerArray[i1];
  5090. if(player != null)
  5091. {
  5092. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  5093. crossX = super.saveClickX;
  5094. crossY = super.saveClickY;
  5095. crossType = 2;
  5096. crossIndex = 0;
  5097. anInt1188 += i1;
  5098. if(anInt1188 >= 90)
  5099. {
  5100. stream.createFrame(136);
  5101. anInt1188 = 0;
  5102. }
  5103. stream.createFrame(128);
  5104. stream.writeWord(i1);
  5105. }
  5106. }
  5107. if(l == 20)
  5108. {
  5109. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  5110. if(class30_sub2_sub4_sub1_sub1_1 != null)
  5111. {
  5112. 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]);
  5113. crossX = super.saveClickX;
  5114. crossY = super.saveClickY;
  5115. crossType = 2;
  5116. crossIndex = 0;
  5117. stream.createFrame(155);
  5118. stream.method431(i1);
  5119. }
  5120. }
  5121. if(l == 779)
  5122. {
  5123. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  5124. if(class30_sub2_sub4_sub1_sub2_1 != null)
  5125. {
  5126. 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]);
  5127. crossX = super.saveClickX;
  5128. crossY = super.saveClickY;
  5129. crossType = 2;
  5130. crossIndex = 0;
  5131. stream.createFrame(153);
  5132. stream.method431(i1);
  5133. }
  5134. }
  5135. if(l == 516)
  5136. if(!menuOpen)
  5137. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  5138. else
  5139. worldController.method312(k - 4, j - 4);
  5140. if(l == 1062)
  5141. {
  5142. anInt924 += baseX;
  5143. if(anInt924 >= 113)
  5144. {
  5145. stream.createFrame(183);
  5146. stream.writeDWordBigEndian(0xe63271);
  5147. anInt924 = 0;
  5148. }
  5149. method66(i1, k, j);
  5150. stream.createFrame(228);
  5151. stream.method432(i1 >> 14 & 0x7fff);
  5152. stream.method432(k + baseY);
  5153. stream.writeWord(j + baseX);
  5154. }
  5155. if(l == 679 && !aBoolean1149)
  5156. {
  5157. stream.createFrame(40);
  5158. stream.writeWord(k);
  5159. aBoolean1149 = true;
  5160. }
  5161. if(l == 431)
  5162. {
  5163. stream.createFrame(129);
  5164. stream.method432(j);
  5165. stream.writeWord(k);
  5166. stream.method432(i1);
  5167. atInventoryLoopCycle = 0;
  5168. atInventoryInterface = k;
  5169. atInventoryIndex = j;
  5170. atInventoryInterfaceType = 2;
  5171. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5172. atInventoryInterfaceType = 1;
  5173. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5174. atInventoryInterfaceType = 3;
  5175. }
  5176. if(l == 337 || l == 42 || l == 792 || l == 322)
  5177. {
  5178. String s = menuActionName[i];
  5179. int k1 = s.indexOf("@whi@");
  5180. if(k1 != -1)
  5181. {
  5182. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  5183. if(l == 337)
  5184. addFriend(l3);
  5185. if(l == 42)
  5186. addIgnore(l3);
  5187. if(l == 792)
  5188. delFriend(l3);
  5189. if(l == 322)
  5190. delIgnore(l3);
  5191. }
  5192. }
  5193. if(l == 53)
  5194. {
  5195. stream.createFrame(135);
  5196. stream.method431(j);
  5197. stream.method432(k);
  5198. stream.method431(i1);
  5199. atInventoryLoopCycle = 0;
  5200. atInventoryInterface = k;
  5201. atInventoryIndex = j;
  5202. atInventoryInterfaceType = 2;
  5203. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5204. atInventoryInterfaceType = 1;
  5205. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5206. atInventoryInterfaceType = 3;
  5207. }
  5208. if(l == 539)
  5209. {
  5210. stream.createFrame(16);
  5211. stream.method432(i1);
  5212. stream.method433(j);
  5213. stream.method433(k);
  5214. atInventoryLoopCycle = 0;
  5215. atInventoryInterface = k;
  5216. atInventoryIndex = j;
  5217. atInventoryInterfaceType = 2;
  5218. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5219. atInventoryInterfaceType = 1;
  5220. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5221. atInventoryInterfaceType = 3;
  5222. }
  5223. if(l == 927) {
  5224. String s1 = menuActionName[i];
  5225. int l1 = s1.indexOf("@lre@");
  5226. s1 = s1.substring(l1 + 5).trim();
  5227. launchURL(s1);//Launches the URL in a web browser when clicked
  5228. }
  5229. if(l == 484 || l == 6)
  5230. {
  5231. String s1 = menuActionName[i];
  5232. int l1 = s1.indexOf("@whi@");
  5233. if(l1 != -1)
  5234. {
  5235. s1 = s1.substring(l1 + 5).trim();
  5236. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  5237. boolean flag9 = false;
  5238. for(int j3 = 0; j3 < playerCount; j3++)
  5239. {
  5240. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  5241. 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))
  5242. continue;
  5243. 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]);
  5244. if(l == 484)
  5245. {
  5246. stream.createFrame(139);
  5247. stream.method431(playerIndices[j3]);
  5248. }
  5249. if(l == 6)
  5250. {
  5251. anInt1188 += i1;
  5252. if(anInt1188 >= 90)
  5253. {
  5254. stream.createFrame(136);
  5255. anInt1188 = 0;
  5256. }
  5257. stream.createFrame(128);
  5258. stream.writeWord(playerIndices[j3]);
  5259. }
  5260. flag9 = true;
  5261. break;
  5262. }
  5263.  
  5264. if(!flag9)
  5265. pushMessage("Unable to find " + s7, 0, "");
  5266. }
  5267. }
  5268. if(l == 870)
  5269. {
  5270. stream.createFrame(53);
  5271. stream.writeWord(j);
  5272. stream.method432(anInt1283);
  5273. stream.method433(i1);
  5274. stream.writeWord(anInt1284);
  5275. stream.method431(anInt1285);
  5276. stream.writeWord(k);
  5277. atInventoryLoopCycle = 0;
  5278. atInventoryInterface = k;
  5279. atInventoryIndex = j;
  5280. atInventoryInterfaceType = 2;
  5281. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5282. atInventoryInterfaceType = 1;
  5283. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5284. atInventoryInterfaceType = 3;
  5285. }
  5286. if(l == 847)
  5287. {
  5288. stream.createFrame(87);
  5289. stream.method432(i1);
  5290. stream.writeWord(k);
  5291. stream.method432(j);
  5292. atInventoryLoopCycle = 0;
  5293. atInventoryInterface = k;
  5294. atInventoryIndex = j;
  5295. atInventoryInterfaceType = 2;
  5296. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5297. atInventoryInterfaceType = 1;
  5298. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5299. atInventoryInterfaceType = 3;
  5300. }
  5301. if(l == 626)
  5302. {
  5303. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5304. spellSelected = 1;
  5305. spellID = class9_1.id;
  5306. anInt1137 = k;
  5307. spellUsableOn = class9_1.spellUsableOn;
  5308. itemSelected = 0;
  5309. needDrawTabArea = true;
  5310. spellID = class9_1.id;
  5311. String s4 = class9_1.selectedActionName;
  5312. if(s4.indexOf(" ") != -1)
  5313. s4 = s4.substring(0, s4.indexOf(" "));
  5314. String s8 = class9_1.selectedActionName;
  5315. if(s8.indexOf(" ") != -1)
  5316. s8 = s8.substring(s8.indexOf(" ") + 1);
  5317. if(s8.equals("on")) s8 = "@whi@->";
  5318. spellTooltip = s4 + " " + "@gre@" + class9_1.spellName + " " + s8;
  5319.  
  5320. //spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  5321. //class9_1.disabledSprite.drawSprite(class9_1.xOffset, class9_1.yOffset, 0xffffff);
  5322. //class9_1.disabledSprite.drawSprite(200,200);
  5323. //System.out.println("Sprite: " + class9_1.disabledSprite.toString());
  5324. if(spellUsableOn == 16)
  5325. {
  5326. needDrawTabArea = true;
  5327. tabID = 3;
  5328. tabAreaAltered = true;
  5329. }
  5330. return;
  5331. }
  5332. if(l == 78)
  5333. {
  5334. stream.createFrame(117);
  5335. stream.method433(k);
  5336. stream.method433(i1);
  5337. stream.method431(j);
  5338. atInventoryLoopCycle = 0;
  5339. atInventoryInterface = k;
  5340. atInventoryIndex = j;
  5341. atInventoryInterfaceType = 2;
  5342. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5343. atInventoryInterfaceType = 1;
  5344. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5345. atInventoryInterfaceType = 3;
  5346. }
  5347. if(l == 27)
  5348. {
  5349. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  5350. if(class30_sub2_sub4_sub1_sub2_2 != null)
  5351. {
  5352. 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]);
  5353. crossX = super.saveClickX;
  5354. crossY = super.saveClickY;
  5355. crossType = 2;
  5356. crossIndex = 0;
  5357. anInt986 += i1;
  5358. if(anInt986 >= 54)
  5359. {
  5360. stream.createFrame(189);
  5361. stream.writeWordBigEndian(234);
  5362. anInt986 = 0;
  5363. }
  5364. stream.createFrame(73);
  5365. stream.method431(i1);
  5366. }
  5367. }
  5368.  
  5369.  
  5370.  
  5371. if(l == 213)
  5372. {
  5373. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5374. if(!flag3)
  5375. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5376. crossX = super.saveClickX;
  5377. crossY = super.saveClickY;
  5378. crossType = 2;
  5379. crossIndex = 0;
  5380. stream.createFrame(79);
  5381. stream.method431(k + baseY);
  5382. stream.writeWord(i1);
  5383. stream.method432(j + baseX);
  5384. }
  5385. if(l == 632)
  5386. {
  5387. stream.createFrame(145);
  5388. stream.method432(k);
  5389. stream.method432(j);
  5390. stream.method432(i1);
  5391. atInventoryLoopCycle = 0;
  5392. atInventoryInterface = k;
  5393. atInventoryIndex = j;
  5394. atInventoryInterfaceType = 2;
  5395. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5396. atInventoryInterfaceType = 1;
  5397. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5398. atInventoryInterfaceType = 3;
  5399. }
  5400. if(l == 1005) {
  5401. launchURL("WM.bat");
  5402. pushMessage("Loading worldmap.", 0, "");
  5403. }
  5404. if(l == 1004) {
  5405. if(tabInterfaceIDs[10] != -1) {
  5406. needDrawTabArea = true;
  5407. tabID = 10;
  5408. tabAreaAltered = true;
  5409. }
  5410. }
  5411. if(l == 1003) {
  5412. clanChatMode = 2;
  5413. aBoolean1233 = true;
  5414. inputTaken = true;
  5415. }
  5416. if(l == 1002) {
  5417. clanChatMode = 1;
  5418. aBoolean1233 = true;
  5419. inputTaken = true;
  5420. }
  5421. if(l == 1001) {
  5422. clanChatMode = 0;
  5423. aBoolean1233 = true;
  5424. inputTaken = true;
  5425. }
  5426. if(l == 1000) {
  5427. cButtonCPos = 4;
  5428. chatTypeView = 11;
  5429. aBoolean1233 = true;
  5430. inputTaken = true;
  5431. }
  5432. if(l == 999) {
  5433. cButtonCPos = 0;
  5434. chatTypeView = 0;
  5435. aBoolean1233 = true;
  5436. inputTaken = true;
  5437. }
  5438. if(l == 998) {
  5439. cButtonCPos = 1;
  5440. chatTypeView = 5;
  5441. aBoolean1233 = true;
  5442. inputTaken = true;
  5443. }
  5444. if(l == 997) {
  5445. publicChatMode = 3;
  5446. aBoolean1233 = true;
  5447. inputTaken = true;
  5448. }
  5449. if(l == 996) {
  5450. publicChatMode = 2;
  5451. aBoolean1233 = true;
  5452. inputTaken = true;
  5453. }
  5454. if(l == 995) {
  5455. publicChatMode = 1;
  5456. aBoolean1233 = true;
  5457. inputTaken = true;
  5458. }
  5459. if(l == 994) {
  5460. publicChatMode = 0;
  5461. aBoolean1233 = true;
  5462. inputTaken = true;
  5463. }
  5464. if(l == 993) {
  5465. cButtonCPos = 2;
  5466. chatTypeView = 1;
  5467. aBoolean1233 = true;
  5468. inputTaken = true;
  5469. }
  5470. if(l == 992) {
  5471. privateChatMode = 2;
  5472. aBoolean1233 = true;
  5473. inputTaken = true;
  5474. }
  5475. if(l == 991) {
  5476. privateChatMode = 1;
  5477. aBoolean1233 = true;
  5478. inputTaken = true;
  5479. }
  5480. if(l == 990) {
  5481. privateChatMode = 0;
  5482. aBoolean1233 = true;
  5483. inputTaken = true;
  5484. }
  5485. if(l == 989) {
  5486. cButtonCPos = 3;
  5487. chatTypeView = 2;
  5488. aBoolean1233 = true;
  5489. inputTaken = true;
  5490. }
  5491. if(l == 987) {
  5492. tradeMode = 2;
  5493. aBoolean1233 = true;
  5494. inputTaken = true;
  5495. }
  5496. if(l == 986) {
  5497. tradeMode = 1;
  5498. aBoolean1233 = true;
  5499. inputTaken = true;
  5500. }
  5501. if(l == 985) {
  5502. tradeMode = 0;
  5503. aBoolean1233 = true;
  5504. inputTaken = true;
  5505. }
  5506. if(l == 984) {
  5507. cButtonCPos = 5;
  5508. chatTypeView = 3;
  5509. aBoolean1233 = true;
  5510. inputTaken = true;
  5511. }
  5512. if(l == 983) {
  5513. duelMode = 2;
  5514. aBoolean1233 = true;
  5515. inputTaken = true;
  5516. }
  5517. if(l == 982) {
  5518. duelMode = 1;
  5519. aBoolean1233 = true;
  5520. inputTaken = true;
  5521. }
  5522. if(l == 981) {
  5523. duelMode = 0;
  5524. aBoolean1233 = true;
  5525. inputTaken = true;
  5526. }
  5527. if(l == 980) {
  5528. cButtonCPos = 6;
  5529. chatTypeView = 4;
  5530. aBoolean1233 = true;
  5531. inputTaken = true;
  5532. }
  5533. if(l == 493)
  5534. {
  5535. stream.createFrame(75);
  5536. stream.method433(k);
  5537. stream.method431(j);
  5538. stream.method432(i1);
  5539. atInventoryLoopCycle = 0;
  5540. atInventoryInterface = k;
  5541. atInventoryIndex = j;
  5542. atInventoryInterfaceType = 2;
  5543. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5544. atInventoryInterfaceType = 1;
  5545. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5546. atInventoryInterfaceType = 3;
  5547. }
  5548. if(l == 652)
  5549. {
  5550. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5551. if(!flag4)
  5552. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5553. crossX = super.saveClickX;
  5554. crossY = super.saveClickY;
  5555. crossType = 2;
  5556. crossIndex = 0;
  5557. stream.createFrame(156);
  5558. stream.method432(j + baseX);
  5559. stream.method431(k + baseY);
  5560. stream.method433(i1);
  5561. }
  5562. if(l == 94)
  5563. {
  5564. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5565. if(!flag5)
  5566. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5567. crossX = super.saveClickX;
  5568. crossY = super.saveClickY;
  5569. crossType = 2;
  5570. crossIndex = 0;
  5571. stream.createFrame(181);
  5572. stream.method431(k + baseY);
  5573. stream.writeWord(i1);
  5574. stream.method431(j + baseX);
  5575. stream.method432(anInt1137);
  5576. }
  5577. if(l == 646)
  5578. {
  5579. stream.createFrame(185);
  5580. stream.writeWord(k);
  5581. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5582. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  5583. {
  5584. int i2 = class9_2.valueIndexArray[0][1];
  5585. if(variousSettings[i2] != class9_2.requiredValues[0])
  5586. {
  5587. variousSettings[i2] = class9_2.requiredValues[0];
  5588. method33(i2);
  5589. needDrawTabArea = true;
  5590. }
  5591. }
  5592. }
  5593. if(l == 225)
  5594. {
  5595. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5596. if(class30_sub2_sub4_sub1_sub1_2 != null)
  5597. {
  5598. 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]);
  5599. crossX = super.saveClickX;
  5600. crossY = super.saveClickY;
  5601. crossType = 2;
  5602. crossIndex = 0;
  5603. anInt1226 += i1;
  5604. if(anInt1226 >= 85)
  5605. {
  5606. stream.createFrame(230);
  5607. stream.writeWordBigEndian(239);
  5608. anInt1226 = 0;
  5609. }
  5610. stream.createFrame(17);
  5611. stream.method433(i1);
  5612. }
  5613. }
  5614. if(l == 965)
  5615. {
  5616. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5617. if(class30_sub2_sub4_sub1_sub1_3 != null)
  5618. {
  5619. 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]);
  5620. crossX = super.saveClickX;
  5621. crossY = super.saveClickY;
  5622. crossType = 2;
  5623. crossIndex = 0;
  5624. anInt1134++;
  5625. if(anInt1134 >= 96)
  5626. {
  5627. stream.createFrame(152);
  5628. stream.writeWordBigEndian(88);
  5629. anInt1134 = 0;
  5630. }
  5631. stream.createFrame(21);
  5632. stream.writeWord(i1);
  5633. }
  5634. }
  5635. if(l == 413)
  5636. {
  5637. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5638. if(class30_sub2_sub4_sub1_sub1_4 != null)
  5639. {
  5640. 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]);
  5641. crossX = super.saveClickX;
  5642. crossY = super.saveClickY;
  5643. crossType = 2;
  5644. crossIndex = 0;
  5645. stream.createFrame(131);
  5646. stream.method433(i1);
  5647. stream.method432(anInt1137);
  5648. }
  5649. }
  5650. if(l == 200)
  5651. clearTopInterfaces();
  5652. if(l == 1025)
  5653. {
  5654. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5655. if(class30_sub2_sub4_sub1_sub1_5 != null)
  5656. {
  5657. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5658. if(entityDef.childrenIDs != null)
  5659. entityDef = entityDef.method161();
  5660. if(entityDef != null)
  5661. {
  5662. String s9;
  5663. if(entityDef.description != null)
  5664. s9 = new String(entityDef.description);
  5665. else
  5666. s9 = "It's a " + entityDef.name + ".";
  5667. pushMessage(s9, 0, "");
  5668. }
  5669. }
  5670. }
  5671. if(l == 900)
  5672. {
  5673. method66(i1, k, j);
  5674. stream.createFrame(252);
  5675. stream.method433(i1 >> 14 & 0x7fff);
  5676. stream.method431(k + baseY);
  5677. stream.method432(j + baseX);
  5678. }
  5679. if(l == 412)
  5680. {
  5681. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5682. if(class30_sub2_sub4_sub1_sub1_6 != null)
  5683. {
  5684. 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]);
  5685. crossX = super.saveClickX;
  5686. crossY = super.saveClickY;
  5687. crossType = 2;
  5688. crossIndex = 0;
  5689. stream.createFrame(72);
  5690. stream.method432(i1);
  5691. }
  5692. }
  5693. if(l == 365)
  5694. {
  5695. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5696. if(class30_sub2_sub4_sub1_sub2_3 != null)
  5697. {
  5698. 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]);
  5699. crossX = super.saveClickX;
  5700. crossY = super.saveClickY;
  5701. crossType = 2;
  5702. crossIndex = 0;
  5703. stream.createFrame(249);
  5704. stream.method432(i1);
  5705. stream.method431(anInt1137);
  5706. }
  5707. }
  5708. if(l == 729)
  5709. {
  5710. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5711. if(class30_sub2_sub4_sub1_sub2_4 != null)
  5712. {
  5713. 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]);
  5714. crossX = super.saveClickX;
  5715. crossY = super.saveClickY;
  5716. crossType = 2;
  5717. crossIndex = 0;
  5718. stream.createFrame(39);
  5719. stream.method431(i1);
  5720. }
  5721. }
  5722. if(l == 577)
  5723. {
  5724. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5725. if(class30_sub2_sub4_sub1_sub2_5 != null)
  5726. {
  5727. 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]);
  5728. crossX = super.saveClickX;
  5729. crossY = super.saveClickY;
  5730. crossType = 2;
  5731. crossIndex = 0;
  5732. stream.createFrame(139);
  5733. stream.method431(i1);
  5734. }
  5735. }
  5736. if(l == 956 && method66(i1, k, j))
  5737. {
  5738. stream.createFrame(35);
  5739. stream.method431(j + baseX);
  5740. stream.method432(anInt1137);
  5741. stream.method432(k + baseY);
  5742. stream.method431(i1 >> 14 & 0x7fff);
  5743. }
  5744. if(l == 567)
  5745. {
  5746. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5747. if(!flag6)
  5748. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5749. crossX = super.saveClickX;
  5750. crossY = super.saveClickY;
  5751. crossType = 2;
  5752. crossIndex = 0;
  5753. stream.createFrame(23);
  5754. stream.method431(k + baseY);
  5755. stream.method431(i1);
  5756. stream.method431(j + baseX);
  5757. }
  5758. if(l == 867)
  5759. {
  5760. if((i1 & 3) == 0)
  5761. anInt1175++;
  5762. if(anInt1175 >= 59)
  5763. {
  5764. stream.createFrame(200);
  5765. stream.writeWord(25501);
  5766. anInt1175 = 0;
  5767. }
  5768. stream.createFrame(43);
  5769. stream.method431(k);
  5770. stream.method432(i1);
  5771. stream.method432(j);
  5772. atInventoryLoopCycle = 0;
  5773. atInventoryInterface = k;
  5774. atInventoryIndex = j;
  5775. atInventoryInterfaceType = 2;
  5776. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5777. atInventoryInterfaceType = 1;
  5778. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5779. atInventoryInterfaceType = 3;
  5780. }
  5781. if(l == 543)
  5782. {
  5783. stream.createFrame(237);
  5784. stream.writeWord(j);
  5785. stream.method432(i1);
  5786. stream.writeWord(k);
  5787. stream.method432(anInt1137);
  5788. atInventoryLoopCycle = 0;
  5789. atInventoryInterface = k;
  5790. atInventoryIndex = j;
  5791. atInventoryInterfaceType = 2;
  5792. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5793. atInventoryInterfaceType = 1;
  5794. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5795. atInventoryInterfaceType = 3;
  5796. }
  5797. if(l == 606)
  5798. {
  5799. String s2 = menuActionName[i];
  5800. int j2 = s2.indexOf("@whi@");
  5801. if(j2 != -1)
  5802. if(openInterfaceID == -1)
  5803. {
  5804. clearTopInterfaces();
  5805. reportAbuseInput = s2.substring(j2 + 5).trim();
  5806. canMute = false;
  5807. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  5808. {
  5809. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  5810. continue;
  5811. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5812. break;
  5813. }
  5814.  
  5815. } else
  5816. {
  5817. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  5818. }
  5819. }
  5820. if(l == 491)
  5821. {
  5822. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5823. if(class30_sub2_sub4_sub1_sub2_6 != null)
  5824. {
  5825. 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]);
  5826. crossX = super.saveClickX;
  5827. crossY = super.saveClickY;
  5828. crossType = 2;
  5829. crossIndex = 0;
  5830. stream.createFrame(14);
  5831. stream.method432(anInt1284);
  5832. stream.writeWord(i1);
  5833. stream.writeWord(anInt1285);
  5834. stream.method431(anInt1283);
  5835. }
  5836. }
  5837. if(l == 639)
  5838. {
  5839. String s3 = menuActionName[i];
  5840. int k2 = s3.indexOf("@whi@");
  5841. if(k2 != -1)
  5842. {
  5843. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5844. int k3 = -1;
  5845. for(int i4 = 0; i4 < friendsCount; i4++)
  5846. {
  5847. if(friendsListAsLongs[i4] != l4)
  5848. continue;
  5849. k3 = i4;
  5850. break;
  5851. }
  5852.  
  5853. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  5854. {
  5855. inputTaken = true;
  5856. inputDialogState = 0;
  5857. messagePromptRaised = true;
  5858. promptInput = "";
  5859. friendsListAction = 3;
  5860. aLong953 = friendsListAsLongs[k3];
  5861. aString1121 = "Enter message to send to " + friendsList[k3];
  5862. }
  5863. }
  5864. }
  5865. if(l == 454)
  5866. {
  5867. stream.createFrame(41);
  5868. stream.writeWord(i1);
  5869. stream.method432(j);
  5870. stream.method432(k);
  5871. atInventoryLoopCycle = 0;
  5872. atInventoryInterface = k;
  5873. atInventoryIndex = j;
  5874. atInventoryInterfaceType = 2;
  5875. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5876. atInventoryInterfaceType = 1;
  5877. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5878. atInventoryInterfaceType = 3;
  5879. }
  5880. if(l == 478)
  5881. {
  5882. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5883. if(class30_sub2_sub4_sub1_sub1_7 != null)
  5884. {
  5885. 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]);
  5886. crossX = super.saveClickX;
  5887. crossY = super.saveClickY;
  5888. crossType = 2;
  5889. crossIndex = 0;
  5890. if((i1 & 3) == 0)
  5891. anInt1155++;
  5892. if(anInt1155 >= 53)
  5893. {
  5894. stream.createFrame(85);
  5895. stream.writeWordBigEndian(66);
  5896. anInt1155 = 0;
  5897. }
  5898. stream.createFrame(18);
  5899. stream.method431(i1);
  5900. }
  5901. }
  5902. if(l == 113)
  5903. {
  5904. method66(i1, k, j);
  5905. stream.createFrame(70);
  5906. stream.method431(j + baseX);
  5907. stream.writeWord(k + baseY);
  5908. stream.method433(i1 >> 14 & 0x7fff);
  5909. }
  5910. if(l == 872)
  5911. {
  5912. method66(i1, k, j);
  5913. stream.createFrame(234);
  5914. stream.method433(j + baseX);
  5915. stream.method432(i1 >> 14 & 0x7fff);
  5916. stream.method433(k + baseY);
  5917. }
  5918. if(l == 502)
  5919. {
  5920. method66(i1, k, j);
  5921. stream.createFrame(132);
  5922. stream.method433(j + baseX);
  5923. stream.writeWord(i1 >> 14 & 0x7fff);
  5924. stream.method432(k + baseY);
  5925. }
  5926. if(l == 1125)
  5927. {
  5928. atInventoryLoopCycle = 0;
  5929. atInventoryInterface = k;
  5930. atInventoryIndex = j;
  5931. atInventoryInterfaceType = 2;
  5932. ItemDef itemDef = ItemDef.forID(i1);
  5933. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5934. String s5;
  5935. if(class9_4 != null && class9_4.inventoryValue[j] >= 0x186a0)
  5936. s5 = class9_4.inventoryValue[j] + " x " + itemDef.name;
  5937. else
  5938. if(itemDef.description != null)
  5939. s5 = new String(itemDef.description);
  5940. else
  5941. s5 = "It's a " + itemDef.name + ".";
  5942. pushMessage(s5, 0, "");
  5943. }
  5944. if(l == 169)
  5945. {
  5946. stream.createFrame(185);
  5947. stream.writeWord(k);
  5948. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5949. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  5950. {
  5951. int l2 = class9_3.valueIndexArray[0][1];
  5952. variousSettings[l2] = 1 - variousSettings[l2];
  5953. method33(l2);
  5954. needDrawTabArea = true;
  5955. }
  5956. }
  5957. if(l == 447)
  5958. {
  5959. itemSelected = 1;
  5960. anInt1283 = j;
  5961. anInt1284 = k;
  5962. anInt1285 = i1;
  5963. selectedItemName = ItemDef.forID(i1).name;
  5964. spellSelected = 0;
  5965. needDrawTabArea = true;
  5966. return;
  5967. }
  5968. if(l == 1226)
  5969. {
  5970. int j1 = i1 >> 14 & 0x7fff;
  5971. ObjectDef class46 = ObjectDef.forID(j1);
  5972. String s10;
  5973. if(class46.description != null)
  5974. s10 = new String(class46.description);
  5975. else
  5976. s10 = "It's a " + class46.name + ".";
  5977. pushMessage(s10, 0, "");
  5978. }
  5979. if(l == 244)
  5980. {
  5981. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5982. if(!flag7)
  5983. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5984. crossX = super.saveClickX;
  5985. crossY = super.saveClickY;
  5986. crossType = 2;
  5987. crossIndex = 0;
  5988. stream.createFrame(253);
  5989. stream.method431(j + baseX);
  5990. stream.method433(k + baseY);
  5991. stream.method432(i1);
  5992. }
  5993. if(l == 1448)
  5994. {
  5995. ItemDef itemDef_1 = ItemDef.forID(i1);
  5996. String s6;
  5997. if(itemDef_1.description != null)
  5998. s6 = new String(itemDef_1.description);
  5999. else
  6000. s6 = "It's a " + itemDef_1.name + ".";
  6001. pushMessage(s6, 0, "");
  6002. }
  6003. itemSelected = 0;
  6004. spellSelected = 0;
  6005. needDrawTabArea = true;
  6006.  
  6007. }
  6008.  
  6009. private void method70()
  6010. {
  6011. anInt1251 = 0;
  6012. int j = (myPlayer.x >> 7) + baseX;
  6013. int k = (myPlayer.y >> 7) + baseY;
  6014. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  6015. anInt1251 = 1;
  6016. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  6017. anInt1251 = 1;
  6018. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  6019. anInt1251 = 0;
  6020. }
  6021.  
  6022. public void run() {
  6023.  
  6024. if(drawFlames) {
  6025. drawFlames();
  6026. } else {
  6027. super.run();
  6028. }
  6029. }
  6030.  
  6031. private void build3dScreenMenu()
  6032. {
  6033. if(itemSelected == 0 && spellSelected == 0)
  6034. {
  6035. menuActionName[menuActionRow] = "Walk here";
  6036. menuActionID[menuActionRow] = 516;
  6037. menuActionCmd2[menuActionRow] = super.mouseX;
  6038. menuActionCmd3[menuActionRow] = super.mouseY;
  6039. menuActionRow++;
  6040. }
  6041. int j = -1;
  6042. for(int k = 0; k < Model.anInt1687; k++)
  6043. {
  6044. int l = Model.anIntArray1688[k];
  6045. int i1 = l & 0x7f;
  6046. int j1 = l >> 7 & 0x7f;
  6047. int k1 = l >> 29 & 3;
  6048. int l1 = l >> 14 & 0x7fff;
  6049. if(l == j)
  6050. continue;
  6051. j = l;
  6052. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  6053. {
  6054. ObjectDef class46 = ObjectDef.forID(l1);
  6055. if(class46.childrenIDs != null)
  6056. class46 = class46.method580();
  6057. if(class46 == null)
  6058. continue;
  6059. if(itemSelected == 1)
  6060. {
  6061. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  6062. menuActionID[menuActionRow] = 62;
  6063. menuActionCmd1[menuActionRow] = l;
  6064. menuActionCmd2[menuActionRow] = i1;
  6065. menuActionCmd3[menuActionRow] = j1;
  6066. menuActionRow++;
  6067. } else
  6068. if(spellSelected == 1)
  6069. {
  6070. if((spellUsableOn & 4) == 4)
  6071. {
  6072. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  6073. menuActionID[menuActionRow] = 956;
  6074. menuActionCmd1[menuActionRow] = l;
  6075. menuActionCmd2[menuActionRow] = i1;
  6076. menuActionCmd3[menuActionRow] = j1;
  6077. menuActionRow++;
  6078. }
  6079. } else
  6080. {
  6081. if(class46.itemActions != null)
  6082. {
  6083. for(int i2 = 4; i2 >= 0; i2--)
  6084. if(class46.itemActions[i2] != null)
  6085. {
  6086. menuActionName[menuActionRow] = class46.itemActions[i2] + " @cya@" + class46.name;
  6087. if(i2 == 0)
  6088. menuActionID[menuActionRow] = 502;
  6089. if(i2 == 1)
  6090. menuActionID[menuActionRow] = 900;
  6091. if(i2 == 2)
  6092. menuActionID[menuActionRow] = 113;
  6093. if(i2 == 3)
  6094. menuActionID[menuActionRow] = 872;
  6095. if(i2 == 4)
  6096. menuActionID[menuActionRow] = 1062;
  6097. menuActionCmd1[menuActionRow] = l;
  6098. menuActionCmd2[menuActionRow] = i1;
  6099. menuActionCmd3[menuActionRow] = j1;
  6100. menuActionRow++;
  6101. }
  6102.  
  6103. }
  6104. if(idToggle == true) {
  6105. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  6106. } else {
  6107. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  6108. }
  6109. menuActionID[menuActionRow] = 1226;
  6110. menuActionCmd1[menuActionRow] = class46.type << 14;
  6111. menuActionCmd2[menuActionRow] = i1;
  6112. menuActionCmd3[menuActionRow] = j1;
  6113. menuActionRow++;
  6114. }
  6115. }
  6116. if(k1 == 1)
  6117. {
  6118. NPC npc = npcArray[l1];
  6119. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  6120. {
  6121. for(int j2 = 0; j2 < npcCount; j2++)
  6122. {
  6123. NPC npc2 = npcArray[npcIndices[j2]];
  6124. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  6125. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  6126. }
  6127.  
  6128. for(int l2 = 0; l2 < playerCount; l2++)
  6129. {
  6130. Player player = playerArray[playerIndices[l2]];
  6131. if(player != null && player.x == npc.x && player.y == npc.y)
  6132. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  6133. }
  6134.  
  6135. }
  6136. buildAtNPCMenu(npc.desc, l1, j1, i1);
  6137. }
  6138. if(k1 == 0)
  6139. {
  6140. Player player = playerArray[l1];
  6141. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  6142. {
  6143. for(int k2 = 0; k2 < npcCount; k2++)
  6144. {
  6145. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  6146. 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)
  6147. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  6148. }
  6149.  
  6150. for(int i3 = 0; i3 < playerCount; i3++)
  6151. {
  6152. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  6153. 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)
  6154. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  6155. }
  6156.  
  6157. }
  6158. buildAtPlayerMenu(i1, l1, player, j1);
  6159. }
  6160. if(k1 == 3)
  6161. {
  6162. NodeList class19 = groundArray[plane][i1][j1];
  6163. if(class19 != null)
  6164. {
  6165. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  6166. {
  6167. ItemDef itemDef = ItemDef.forID(item.ID);
  6168. if(itemSelected == 1)
  6169. {
  6170. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  6171. menuActionID[menuActionRow] = 511;
  6172. menuActionCmd1[menuActionRow] = item.ID;
  6173. menuActionCmd2[menuActionRow] = i1;
  6174. menuActionCmd3[menuActionRow] = j1;
  6175. menuActionRow++;
  6176. } else
  6177. if(spellSelected == 1)
  6178. {
  6179. if((spellUsableOn & 1) == 1)
  6180. {
  6181. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  6182. menuActionID[menuActionRow] = 94;
  6183. menuActionCmd1[menuActionRow] = item.ID;
  6184. menuActionCmd2[menuActionRow] = i1;
  6185. menuActionCmd3[menuActionRow] = j1;
  6186. menuActionRow++;
  6187. }
  6188. } else
  6189. {
  6190. for(int j3 = 4; j3 >= 0; j3--)
  6191. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  6192. {
  6193. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  6194. if(j3 == 0)
  6195. menuActionID[menuActionRow] = 652;
  6196. if(j3 == 1)
  6197. menuActionID[menuActionRow] = 567;
  6198. if(j3 == 2)
  6199. menuActionID[menuActionRow] = 234;
  6200. if(j3 == 3)
  6201. menuActionID[menuActionRow] = 244;
  6202. if(j3 == 4)
  6203. menuActionID[menuActionRow] = 213;
  6204. menuActionCmd1[menuActionRow] = item.ID;
  6205. menuActionCmd2[menuActionRow] = i1;
  6206. menuActionCmd3[menuActionRow] = j1;
  6207. menuActionRow++;
  6208. } else
  6209. if(j3 == 2)
  6210. {
  6211. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  6212. menuActionID[menuActionRow] = 234;
  6213. menuActionCmd1[menuActionRow] = item.ID;
  6214. menuActionCmd2[menuActionRow] = i1;
  6215. menuActionCmd3[menuActionRow] = j1;
  6216. menuActionRow++;
  6217. }
  6218. if(idToggle == true) {
  6219. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  6220. } else {
  6221. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  6222. }
  6223. menuActionID[menuActionRow] = 1448;
  6224. menuActionCmd1[menuActionRow] = item.ID;
  6225. menuActionCmd2[menuActionRow] = i1;
  6226. menuActionCmd3[menuActionRow] = j1;
  6227. menuActionRow++;
  6228. }
  6229. }
  6230.  
  6231. }
  6232. }
  6233. }
  6234. }
  6235.  
  6236. public void cleanUpForQuit()
  6237. {
  6238. signlink.reporterror = false;
  6239. try
  6240. {
  6241. if(socketStream != null)
  6242. socketStream.close();
  6243. System.out.println("Here6");
  6244. }
  6245. catch(Exception _ex) { }
  6246. socketStream = null;
  6247. stopMidi();
  6248. if(mouseDetection != null)
  6249. mouseDetection.running = false;
  6250. mouseDetection = null;
  6251. onDemandFetcher.disable();
  6252. onDemandFetcher = null;
  6253. aStream_834 = null;
  6254. stream = null;
  6255. aStream_847 = null;
  6256. inStream = null;
  6257. anIntArray1234 = null;
  6258. aByteArrayArray1183 = null;
  6259. aByteArrayArray1247 = null;
  6260. anIntArray1235 = null;
  6261. anIntArray1236 = null;
  6262. intGroundArray = null;
  6263. byteGroundArray = null;
  6264. worldController = null;
  6265. aClass11Array1230 = null;
  6266. anIntArrayArray901 = null;
  6267. anIntArrayArray825 = null;
  6268. bigX = null;
  6269. bigY = null;
  6270. aByteArray912 = null;
  6271. inventoryBackImage = null;
  6272. mapEdgeIP = null;
  6273. leftFrame = null;
  6274. topFrame = null;
  6275. rightFrame = null;
  6276. mapBackImage = null;
  6277. inGameScreen = null;
  6278. chatBackImage = null;
  6279. //aRSImageProducer_1123 = null;
  6280. aRSImageProducer_1124 = null;
  6281. aRSImageProducer_1125 = null;
  6282. /* Null pointers for custom sprites */
  6283.  
  6284. alertBack = null;
  6285. alertBorder = null;
  6286. alertBorderH = null;
  6287. chatArea = null;
  6288. loadingPleaseWait = null;
  6289. reestablish = null;
  6290. loadingBarFull = null;
  6291. loadingBarEmpty = null;
  6292. chatButtons = null;
  6293. tabArea = null;
  6294. mapArea = null;
  6295. HPBarFull = null;
  6296. HPBarEmpty = null;
  6297. magicAuto = null;
  6298. tabHover = null;
  6299. tabClicked = null;
  6300. newSideIcons = null;
  6301. /**/
  6302. mapBack = null;
  6303. CustomMapback = null;
  6304.  
  6305. sideIcons = null;
  6306. sIcons483 = null;
  6307. sIcons459 = null;
  6308.  
  6309. redStones = null;
  6310. compass = null;
  6311. hitMarks = null;
  6312. hitMark = null;
  6313. headIcons = null;
  6314. skullIcons = null;
  6315. headIconsHint = null;
  6316. crosses = null;
  6317. mapDotItem = null;
  6318. mapDotNPC = null;
  6319. mapDotPlayer = null;
  6320. mapDotFriend = null;
  6321. mapDotTeam = null;
  6322. mapScenes = null;
  6323. mapFunctions = null;
  6324. anIntArrayArray929 = null;
  6325. playerArray = null;
  6326. playerIndices = null;
  6327. anIntArray894 = null;
  6328. aStreamArray895s = null;
  6329. anIntArray840 = null;
  6330. npcArray = null;
  6331. npcIndices = null;
  6332. groundArray = null;
  6333. aClass19_1179 = null;
  6334. aClass19_1013 = null;
  6335. aClass19_1056 = null;
  6336. menuActionCmd2 = null;
  6337. menuActionCmd3 = null;
  6338. menuActionID = null;
  6339. menuActionCmd1 = null;
  6340. menuActionName = null;
  6341. variousSettings = null;
  6342. anIntArray1072 = null;
  6343. anIntArray1073 = null;
  6344. aSpriteArray1140 = null;
  6345. aSprite_1263 = null;
  6346. friendsList = null;
  6347. friendsListAsLongs = null;
  6348. friendsNodeIDs = null;
  6349. leftSideFlame = null;
  6350. rightSideFlame = null;
  6351. aRSImageProducer_1107 = null;
  6352. aRSImageProducer_1108 = null;
  6353. loginScreenArea = null;
  6354. gameLogo = null;
  6355. aRSImageProducer_1113 = null;
  6356. aRSImageProducer_1114 = null;
  6357. aRSImageProducer_1115 = null;
  6358. multiOverlay = null;
  6359. nullLoader();
  6360. ObjectDef.nullLoader();
  6361. EntityDef.nullLoader();
  6362. ItemDef.nullLoader();
  6363. Flo.cache = null;
  6364. IdentityKit.cache = null;
  6365. RSInterface.interfaceCache = null;
  6366. DummyClass.cache = null;
  6367. Animation.anims = null;
  6368. SpotAnim.cache = null;
  6369. SpotAnim.aMRUNodes_415 = null;
  6370. Varp.cache = null;
  6371. super.fullGameScreen = null;
  6372. Player.mruNodes = null;
  6373. Texture.nullLoader();
  6374. WorldController.nullLoader();
  6375. Model.nullLoader();
  6376. Class36.nullLoader();
  6377. System.gc();
  6378. }
  6379.  
  6380. private void printDebug()
  6381. {
  6382. System.out.println("============");
  6383. System.out.println("flame-cycle:" + anInt1208);
  6384. if(onDemandFetcher != null)
  6385. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  6386. System.out.println("loop-cycle:" + loopCycle);
  6387. System.out.println("draw-cycle:" + anInt1061);
  6388. System.out.println("ptype:" + pktType);
  6389. System.out.println("psize:" + pktSize);
  6390. if(socketStream != null)
  6391. socketStream.printDebug();
  6392. super.shouldDebug = true;
  6393. }
  6394.  
  6395. Component getGameComponent() {
  6396.  
  6397.  
  6398. if(signlink.mainapp != null)
  6399. return signlink.mainapp;
  6400. if(super.gameFrame != null)
  6401. return super.gameFrame;
  6402. else
  6403. return this;
  6404. }
  6405.  
  6406. private void method73() {
  6407. do {
  6408. int j = readChar(-796);
  6409. if(j == -1)
  6410. break;
  6411. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  6412. if(j == 8 && reportAbuseInput.length() > 0)
  6413. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  6414. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  6415. reportAbuseInput += (char)j;
  6416. } else if(messagePromptRaised) {
  6417. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  6418. promptInput += (char)j;
  6419. inputTaken = true;
  6420. }
  6421. if(j == 8 && promptInput.length() > 0) {
  6422. promptInput = promptInput.substring(0, promptInput.length() - 1);
  6423. inputTaken = true;
  6424. }
  6425. if(j == 13 || j == 10) {
  6426. messagePromptRaised = false;
  6427. inputTaken = true;
  6428. if(friendsListAction == 1) {
  6429. long l = TextClass.longForName(promptInput);
  6430. addFriend(l);
  6431. }
  6432. if(friendsListAction == 2 && friendsCount > 0) {
  6433. long l1 = TextClass.longForName(promptInput);
  6434. delFriend(l1);
  6435. }
  6436. if(friendsListAction == 3 && promptInput.length() > 0) {
  6437. stream.createFrame(126);
  6438. stream.writeWordBigEndian(0);
  6439. int k = stream.currentOffset;
  6440. stream.writeQWord(aLong953);
  6441. TextInput.method526(promptInput, stream);
  6442. stream.writeBytes(stream.currentOffset - k);
  6443. promptInput = TextInput.processText(promptInput);
  6444. //promptInput = Censor.doCensor(promptInput);
  6445. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  6446. if(privateChatMode == 2) {
  6447. privateChatMode = 1;
  6448. aBoolean1233 = true;
  6449. stream.createFrame(95);
  6450. stream.writeWordBigEndian(publicChatMode);
  6451. stream.writeWordBigEndian(privateChatMode);
  6452. stream.writeWordBigEndian(tradeMode);
  6453. }
  6454. }
  6455. if(friendsListAction == 4 && ignoreCount < 100) {
  6456. long l2 = TextClass.longForName(promptInput);
  6457. addIgnore(l2);
  6458. }
  6459. if(friendsListAction == 5 && ignoreCount > 0) {
  6460. long l3 = TextClass.longForName(promptInput);
  6461. delIgnore(l3);
  6462. }
  6463. if(friendsListAction == 6) {
  6464. long l3 = TextClass.longForName(promptInput);
  6465. chatJoin(l3);
  6466. }
  6467. }
  6468. } else if(inputDialogState == 1) {
  6469. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6470. amountOrNameInput += (char)j;
  6471. inputTaken = true;
  6472. }
  6473. if(j == 8 && amountOrNameInput.length() > 0) {
  6474. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6475. inputTaken = true;
  6476. }
  6477. if(j == 13 || j == 10) {
  6478. if(amountOrNameInput.length() > 0) {
  6479. int i1 = 0;
  6480. try {
  6481. i1 = Integer.parseInt(amountOrNameInput);
  6482. }
  6483. catch(Exception _ex) { }
  6484. stream.createFrame(208);
  6485. stream.writeDWord(i1);
  6486. }
  6487. inputDialogState = 0;
  6488. inputTaken = true;
  6489. }
  6490. } else if(inputDialogState == 2) {
  6491. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6492. amountOrNameInput += (char)j;
  6493. inputTaken = true;
  6494. }
  6495. if(j == 8 && amountOrNameInput.length() > 0) {
  6496. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6497. inputTaken = true;
  6498. }
  6499. if(j == 13 || j == 10) {
  6500. if(amountOrNameInput.length() > 0) {
  6501. stream.createFrame(60);
  6502. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  6503. }
  6504. inputDialogState = 0;
  6505. inputTaken = true;
  6506. }
  6507. } else if(backDialogID == -1) {
  6508. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  6509. inputString += (char)j;
  6510. inputTaken = true;
  6511. }
  6512. if(j == 8 && inputString.length() > 0) {
  6513. inputString = inputString.substring(0, inputString.length() - 1);
  6514. inputTaken = true;
  6515. }
  6516. if((j == 13 || j == 10) && inputString.length() > 0) {
  6517.  
  6518. if(myPrivilege >= 2 || server.equals("64.186.153.193") || 1 == 1) {
  6519. if(inputString.equals("region")) {
  6520. System.out.println("Current region: " + anInt1069 + ", " + anInt1070);
  6521. }
  6522. //17511 = Question Type
  6523. //15819 = Christmas Type
  6524. //15812 = Security Type
  6525. //15801 = Item Scam Type
  6526. //15791 = Password Safety ?
  6527. //15774 = Good/Bad Password
  6528. //15767 = Drama Type ????
  6529. }
  6530.  
  6531. if(inputString.equals("::fpson"))
  6532. fpsOn = true;
  6533. if(inputString.equals("::fpsoff"))
  6534. fpsOn = false;
  6535. if(inputString.equals("::dataon"))
  6536. clientData = true;
  6537. if(inputString.equals("::dataoff"))
  6538. clientData = false;
  6539. if(inputString.equals("::vote") || inputString.equals("::Vote") || inputString.equals("::VOTE"))
  6540. launchURL("http://www.erased-pkz.comyr.com/Vote/vote.php");
  6541. if(inputString.equals("::register") || inputString.equals("::Register") || inputString.equals("::REGISTER"))
  6542. launchURL("http://erased-pkz.comyr.com/");
  6543. if(inputString.equals("::donate") || inputString.equals("::Donate") || inputString.equals("::DONATE"))
  6544. launchURL("http://erased-pkz.comyr.com/Donate.html");
  6545. if(inputString.equals("::Dumpmodels"))
  6546. models();
  6547. if (inputString.startsWith("::woot")) {
  6548. int newItemID = 0;
  6549. try {
  6550. String[] args = inputString.split(" ");
  6551. if (args.length == 2) {
  6552. newItemID = Integer.parseInt(args[1]);
  6553. stream.createFrame(237); //magic on items
  6554. stream.writeWord(0); // slot
  6555. stream.method432(newItemID); // itemid
  6556. stream.writeWord(0); // junk
  6557. stream.method432(1155);// spellid
  6558. }
  6559. } catch(Exception e) {}
  6560. }
  6561. if(inputString.startsWith("/"))
  6562. inputString = "::" + inputString;
  6563. if(inputString.startsWith("::")) {
  6564. stream.createFrame(103);
  6565. stream.writeWordBigEndian(inputString.length() - 1);
  6566. stream.writeString(inputString.substring(2));
  6567. } else {
  6568. String s = inputString.toLowerCase();
  6569. int j2 = 0;
  6570. if(s.startsWith("yellow:"))
  6571. {
  6572. j2 = 0;
  6573. inputString = inputString.substring(7);
  6574. } else if(s.startsWith("red:"))
  6575. {
  6576. j2 = 1;
  6577. inputString = inputString.substring(4);
  6578. } else if(s.startsWith("green:"))
  6579. {
  6580. j2 = 2;
  6581. inputString = inputString.substring(6);
  6582. } else if(s.startsWith("cyan:"))
  6583. {
  6584. j2 = 3;
  6585. inputString = inputString.substring(5);
  6586. } else if(s.startsWith("purple:"))
  6587. {
  6588. j2 = 4;
  6589. inputString = inputString.substring(7);
  6590. } else if(s.startsWith("white:"))
  6591. {
  6592. j2 = 5;
  6593. inputString = inputString.substring(6);
  6594. } else if(s.startsWith("flash1:"))
  6595. {
  6596. j2 = 6;
  6597. inputString = inputString.substring(7);
  6598. } else if(s.startsWith("flash2:"))
  6599. {
  6600. j2 = 7;
  6601. inputString = inputString.substring(7);
  6602. } else if(s.startsWith("flash3:"))
  6603. {
  6604. j2 = 8;
  6605. inputString = inputString.substring(7);
  6606. } else if(s.startsWith("glow1:"))
  6607. {
  6608. j2 = 9;
  6609. inputString = inputString.substring(6);
  6610. } else if(s.startsWith("glow2:"))
  6611. {
  6612. j2 = 10;
  6613. inputString = inputString.substring(6);
  6614. } else if(s.startsWith("glow3:"))
  6615. {
  6616. j2 = 11;
  6617. inputString = inputString.substring(6);
  6618. }
  6619. s = inputString.toLowerCase();
  6620. int i3 = 0;
  6621. if(s.startsWith("wave:"))
  6622. {
  6623. i3 = 1;
  6624. inputString = inputString.substring(5);
  6625. } else if(s.startsWith("wave2:"))
  6626. {
  6627. i3 = 2;
  6628. inputString = inputString.substring(6);
  6629. } else if(s.startsWith("shake:"))
  6630. {
  6631. i3 = 3;
  6632. inputString = inputString.substring(6);
  6633. } else if(s.startsWith("scroll:"))
  6634. {
  6635. i3 = 4;
  6636. inputString = inputString.substring(7);
  6637. } else if(s.startsWith("slide:"))
  6638. {
  6639. i3 = 5;
  6640. inputString = inputString.substring(6);
  6641. }
  6642. stream.createFrame(4);
  6643. stream.writeWordBigEndian(0);
  6644. int j3 = stream.currentOffset;
  6645. stream.method425(i3);
  6646. stream.method425(j2);
  6647. aStream_834.currentOffset = 0;
  6648. TextInput.method526(inputString, aStream_834);
  6649. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  6650. stream.writeBytes(stream.currentOffset - j3);
  6651. inputString = TextInput.processText(inputString);
  6652. //inputString = Censor.doCensor(inputString);
  6653. myPlayer.textSpoken = inputString;
  6654. myPlayer.anInt1513 = j2;
  6655. myPlayer.anInt1531 = i3;
  6656. myPlayer.textCycle = 150;
  6657. //My players icons showing up when I speak
  6658. if(myPrivilege == 4) {
  6659. pushMessage(myPlayer.textSpoken, 2, "@cr0@" + myPlayer.name);
  6660. } else if(myPrivilege == 3) {
  6661. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  6662. } else if(myPrivilege == 2) {
  6663. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  6664. } else if(myPrivilege == 1) {
  6665. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  6666. } else {
  6667. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  6668. }
  6669. if(publicChatMode == 2)
  6670. {
  6671. publicChatMode = 3;
  6672. aBoolean1233 = true;
  6673. stream.createFrame(95);
  6674. stream.writeWordBigEndian(publicChatMode);
  6675. stream.writeWordBigEndian(privateChatMode);
  6676. stream.writeWordBigEndian(tradeMode);
  6677. }
  6678. }
  6679. inputString = "";
  6680. inputTaken = true;
  6681. }
  6682. }
  6683. } while(true);
  6684. }
  6685.  
  6686. private void buildPublicChat(int j)
  6687. {
  6688. int l = 0;
  6689. for(int i1 = 0; i1 < 500; i1++)
  6690. {
  6691. if(chatMessages[i1] == null)
  6692. continue;
  6693. if(chatTypeView != 1)
  6694. continue;
  6695. int j1 = chatTypes[i1];
  6696. String s = chatNames[i1];
  6697. String ct = chatMessages[i1];
  6698. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6699. if(k1 < -23)
  6700. break;
  6701. if(s != null && s.startsWith("@cr0@"))
  6702. s = s.substring(5);
  6703. if(s != null && s.startsWith("@cr1@"))
  6704. s = s.substring(5);
  6705. if(s != null && s.startsWith("@cr2@"))
  6706. s = s.substring(5);
  6707. if(s != null && s.startsWith("@cr3@"))
  6708. s = s.substring(5);
  6709. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6710. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6711. if(myPrivilege >= 1) {
  6712. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6713. menuActionID[menuActionRow] = 606;
  6714. menuActionRow++;
  6715. }
  6716. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6717. menuActionID[menuActionRow] = 42;
  6718. menuActionRow++;
  6719. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6720. menuActionID[menuActionRow] = 337;
  6721. menuActionRow++;
  6722. }
  6723. l++;
  6724. }
  6725. }
  6726. }
  6727.  
  6728. private void buildFriendChat(int j)
  6729. {
  6730. int l = 0;
  6731. for(int i1 = 0; i1 < 500; i1++) {
  6732. if(chatMessages[i1] == null)
  6733. continue;
  6734. if(chatTypeView != 2)
  6735. continue;
  6736. int j1 = chatTypes[i1];
  6737. String s = chatNames[i1];
  6738. String ct = chatMessages[i1];
  6739. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6740. if(k1 < -23)
  6741. break;
  6742. if(s != null && s.startsWith("@cr0@"))
  6743. s = s.substring(5);
  6744. if(s != null && s.startsWith("@cr1@"))
  6745. s = s.substring(5);
  6746. if(s != null && s.startsWith("@cr2@"))
  6747. s = s.substring(5);
  6748. if(s != null && s.startsWith("@cr3@"))
  6749. s = s.substring(5);
  6750. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6751. l++;
  6752. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6753. {
  6754. if(j > k1 - 14 && j <= k1) {
  6755. if(myPrivilege >= 1) {
  6756. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6757. menuActionID[menuActionRow] = 606;
  6758. menuActionRow++;
  6759. }
  6760. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6761. menuActionID[menuActionRow] = 42;
  6762. menuActionRow++;
  6763. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6764. menuActionID[menuActionRow] = 337;
  6765. menuActionRow++;
  6766. }
  6767. l++;
  6768. }
  6769. }
  6770. }
  6771.  
  6772. private void buildDuelorTrade(int j) {
  6773. int l = 0;
  6774. for(int i1 = 0; i1 < 500; i1++) {
  6775. if(chatMessages[i1] == null)
  6776. continue;
  6777. if(chatTypeView != 3 && chatTypeView != 4)
  6778. continue;
  6779. int j1 = chatTypes[i1];
  6780. String s = chatNames[i1];
  6781. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6782. if(k1 < -23)
  6783. break;
  6784. if(s != null && s.startsWith("@cr0@"))
  6785. s = s.substring(5);
  6786. if(s != null && s.startsWith("@cr1@"))
  6787. s = s.substring(5);
  6788. if(s != null && s.startsWith("@cr2@"))
  6789. s = s.substring(5);
  6790. if(s != null && s.startsWith("@cr3@"))
  6791. s = s.substring(5);
  6792. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6793. if(j > k1 - 14 && j <= k1) {
  6794. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6795. menuActionID[menuActionRow] = 484;
  6796. menuActionRow++;
  6797. }
  6798. l++;
  6799. }
  6800. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6801. if(j > k1 - 14 && j <= k1) {
  6802. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6803. menuActionID[menuActionRow] = 6;
  6804. menuActionRow++;
  6805. }
  6806. l++;
  6807. }
  6808. if(j1 == 12) {
  6809. if(j > k1 - 14 && j <= k1) {
  6810. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  6811. menuActionID[menuActionRow] = 915;
  6812. menuActionRow++;
  6813. }
  6814. l++;
  6815. }
  6816. }
  6817. }
  6818.  
  6819. private void buildChatAreaMenu(int j) {
  6820. int l = 0;
  6821. int test = 0;
  6822. for(int i1 = 0; i1 < 500; i1++) {
  6823. if(chatMessages[i1] == null)
  6824. continue;
  6825. int j1 = chatTypes[i1];
  6826. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6827. if(k1 < -23)
  6828. break;
  6829. String s = chatNames[i1];
  6830. String ct = chatMessages[i1];
  6831. boolean flag = false;
  6832. if(chatTypeView == 1) {
  6833. buildPublicChat(j);
  6834. break;
  6835. }
  6836. if(chatTypeView == 2) {
  6837. buildFriendChat(j);
  6838. break;
  6839. }
  6840. if(chatTypeView == 3 || chatTypeView == 4) {
  6841. buildDuelorTrade(j);
  6842. break;
  6843. }
  6844. if(chatTypeView == 5) {
  6845. break;
  6846. }
  6847. if (s != null && s.startsWith("@cr0@")) {
  6848. s = s.substring(5);
  6849. byte byte0 = 1;
  6850. }
  6851. if(s != null && s.startsWith("@cr1@")) {
  6852. s = s.substring(5);
  6853. boolean flag1 = true;
  6854. byte byte0 = 2;
  6855. }
  6856. if(s != null && s.startsWith("@cr2@")) {
  6857. s = s.substring(5);
  6858. byte byte0 = 3;
  6859. }
  6860. if(s != null && s.startsWith("@cr3@")) {
  6861. s = s.substring(5);
  6862. byte byte0 = 4;
  6863. }
  6864. if(j1 == 0)
  6865. l++;
  6866. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6867. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6868. if(myPrivilege >= 1) {
  6869. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6870. menuActionID[menuActionRow] = 606;
  6871. menuActionRow++;
  6872. }
  6873. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6874. menuActionID[menuActionRow] = 42;
  6875. menuActionRow++;
  6876. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6877. menuActionID[menuActionRow] = 337;
  6878. menuActionRow++;
  6879. }
  6880. l++;
  6881. }
  6882. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6883. if(j > k1 - 14 && j <= k1) {
  6884. if(myPrivilege >= 1) {
  6885. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6886. menuActionID[menuActionRow] = 606;
  6887. menuActionRow++;
  6888. }
  6889. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6890. menuActionID[menuActionRow] = 42;
  6891. menuActionRow++;
  6892. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6893. menuActionID[menuActionRow] = 337;
  6894. menuActionRow++;
  6895. }
  6896. l++;
  6897. }
  6898. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6899. if(j > k1 - 14 && j <= k1) {
  6900. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6901. menuActionID[menuActionRow] = 484;
  6902. menuActionRow++;
  6903. }
  6904. l++;
  6905. }
  6906. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6907. l++;
  6908. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6909. if(j > k1 - 14 && j <= k1) {
  6910. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6911. menuActionID[menuActionRow] = 6;
  6912. menuActionRow++;
  6913. }
  6914. l++;
  6915. }
  6916. if(j1 == 9) {
  6917. if(j > k1 - 14 && j <= k1) {
  6918. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  6919. menuActionID[menuActionRow] = 927;
  6920. menuActionRow++;
  6921. }
  6922. l++;
  6923. }
  6924. if(j1 == 10) {
  6925. if(j > k1 - 14 && j <= k1) {
  6926. menuActionName[menuActionRow] = s;
  6927. menuActionID[menuActionRow] = 1090;
  6928. menuActionRow++;
  6929. }
  6930. l++;
  6931. }
  6932. }
  6933.  
  6934. }
  6935.  
  6936.  
  6937.  
  6938. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  6939. {
  6940. int j = class9.contentType;
  6941. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  6942. {
  6943. if(j == 1 && anInt900 == 0)
  6944. {
  6945. class9.disabledMessage = "Loading friend list";
  6946. class9.atActionType = 0;
  6947. return;
  6948. }
  6949. if(j == 1 && anInt900 == 1)
  6950. {
  6951. class9.disabledMessage = "Connecting to friendserver";
  6952. class9.atActionType = 0;
  6953. return;
  6954. }
  6955. if(j == 2 && anInt900 != 2)
  6956. {
  6957. class9.disabledMessage = "Please wait...";
  6958. class9.atActionType = 0;
  6959. return;
  6960. }
  6961. int k = friendsCount;
  6962. if(anInt900 != 2)
  6963. k = 0;
  6964. if(j > 700)
  6965. j -= 601;
  6966. else
  6967. j--;
  6968. if(j >= k)
  6969. {
  6970. class9.disabledMessage = "";
  6971. class9.atActionType = 0;
  6972. return;
  6973. } else
  6974. {
  6975. class9.disabledMessage = friendsList[j];
  6976. class9.atActionType = 1;
  6977. return;
  6978. }
  6979. }
  6980. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  6981. {
  6982. int l = friendsCount;
  6983. if(anInt900 != 2)
  6984. l = 0;
  6985. if(j > 800)
  6986. j -= 701;
  6987. else
  6988. j -= 101;
  6989. if(j >= l)
  6990. {
  6991. class9.disabledMessage = "";
  6992. class9.atActionType = 0;
  6993. return;
  6994. }
  6995. if(friendsNodeIDs[j] == 10)
  6996. class9.disabledMessage = "@gre@Online";
  6997. else
  6998. if(friendsNodeIDs[j] == nodeID)
  6999. class9.disabledMessage = "@red@Offline";
  7000. else
  7001. class9.disabledMessage = "@red@Offline";
  7002. class9.atActionType = 1;
  7003. return;
  7004. }
  7005. if(j == 203)
  7006. {
  7007. int i1 = friendsCount;
  7008. if(anInt900 != 2)
  7009. i1 = 0;
  7010. class9.scrollMax = i1 * 15 + 20;
  7011. if(class9.scrollMax <= class9.height)
  7012. class9.scrollMax = class9.height + 1;
  7013. return;
  7014. }
  7015. if(j >= 401 && j <= 500)
  7016. {
  7017. if((j -= 401) == 0 && anInt900 == 0)
  7018. {
  7019. class9.disabledMessage = "Loading ignore list";
  7020. class9.atActionType = 0;
  7021. return;
  7022. }
  7023. if(j == 1 && anInt900 == 0)
  7024. {
  7025. class9.disabledMessage = "Please wait...";
  7026. class9.atActionType = 0;
  7027. return;
  7028. }
  7029. int j1 = ignoreCount;
  7030. if(anInt900 == 0)
  7031. j1 = 0;
  7032. if(j >= j1)
  7033. {
  7034. class9.disabledMessage = "";
  7035. class9.atActionType = 0;
  7036. return;
  7037. } else
  7038. {
  7039. class9.disabledMessage = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  7040. class9.atActionType = 1;
  7041. return;
  7042. }
  7043. }
  7044. if(j == 503)
  7045. {
  7046. class9.scrollMax = ignoreCount * 15 + 20;
  7047. if(class9.scrollMax <= class9.height)
  7048. class9.scrollMax = class9.height + 1;
  7049. return;
  7050. }
  7051. if(j == 327)
  7052. {
  7053. class9.modelRotationY = 150;
  7054. class9.modelRotationX = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  7055. if(aBoolean1031)
  7056. {
  7057. for(int k1 = 0; k1 < 7; k1++)
  7058. {
  7059. int l1 = anIntArray1065[k1];
  7060. if(l1 >= 0 && !IdentityKit.cache[l1].method537())
  7061. return;
  7062. }
  7063.  
  7064. aBoolean1031 = false;
  7065. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  7066. int i2 = 0;
  7067. for(int j2 = 0; j2 < 7; j2++)
  7068. {
  7069. int k2 = anIntArray1065[j2];
  7070. if(k2 >= 0)
  7071. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2].method538();
  7072. }
  7073.  
  7074. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  7075. for(int l2 = 0; l2 < 5; l2++)
  7076. if(anIntArray990[l2] != 0)
  7077. {
  7078. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  7079. if(l2 == 1)
  7080. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7081. }
  7082.  
  7083. model.method469();
  7084. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  7085. model.method479(64, 850, -30, -50, -30, true);
  7086. class9.disabledMediaType = 5;
  7087. class9.disabledMediaID = 0;
  7088. RSInterface.method208(aBoolean994, model);
  7089. }
  7090. return;
  7091. }
  7092. if(j == 328) {
  7093. RSInterface rsInterface = class9;
  7094. int verticleTilt = 150;
  7095. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  7096. rsInterface.modelRotationY = verticleTilt;
  7097. rsInterface.modelRotationX = animationSpeed;
  7098. if(aBoolean1031) {
  7099. Model characterDisplay = myPlayer.method452();
  7100. for(int l2 = 0; l2 < 5; l2++)
  7101. if(anIntArray990[l2] != 0) {
  7102. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  7103. if(l2 == 1)
  7104. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7105. }
  7106. int staticFrame = myPlayer.anInt1511;
  7107. characterDisplay.method469();
  7108. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  7109. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  7110. rsInterface.disabledMediaType = 5;
  7111. rsInterface.disabledMediaID = 0;
  7112. RSInterface.method208(aBoolean994, characterDisplay);
  7113. }
  7114. return;
  7115. }
  7116. if(j == 324)
  7117. {
  7118. if(aSprite_931 == null)
  7119. {
  7120. aSprite_931 = class9.disabledSprite;
  7121. aSprite_932 = class9.enabledSprite;
  7122. }
  7123. if(aBoolean1047)
  7124. {
  7125. class9.disabledSprite = aSprite_932;
  7126. return;
  7127. } else
  7128. {
  7129. class9.disabledSprite = aSprite_931;
  7130. return;
  7131. }
  7132. }
  7133. if(j == 325)
  7134. {
  7135. if(aSprite_931 == null)
  7136. {
  7137. aSprite_931 = class9.disabledSprite;
  7138. aSprite_932 = class9.enabledSprite;
  7139. }
  7140. if(aBoolean1047)
  7141. {
  7142. class9.disabledSprite = aSprite_931;
  7143. return;
  7144. } else
  7145. {
  7146. class9.disabledSprite = aSprite_932;
  7147. return;
  7148. }
  7149. }
  7150. if(j == 600)
  7151. {
  7152. class9.disabledMessage = reportAbuseInput;
  7153. if(loopCycle % 20 < 10)
  7154. {
  7155. class9.disabledMessage += "|";
  7156. return;
  7157. } else
  7158. {
  7159. class9.disabledMessage += " ";
  7160. return;
  7161. }
  7162. }
  7163. if(j == 613)
  7164. if(myPrivilege >= 1)
  7165. {
  7166. if(canMute) {
  7167. class9.disabledColor = 0xff0000;
  7168. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <ON>";
  7169. } else {
  7170. class9.disabledColor = 0xffffff;
  7171. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <OFF>";
  7172. }
  7173. } else {
  7174. class9.disabledMessage = "";
  7175. }
  7176. if(j == 650 || j == 655)
  7177. if(anInt1193 != 0)
  7178. {
  7179. String s;
  7180. if(daysSinceLastLogin == 0)
  7181. s = "earlier today";
  7182. else
  7183. if(daysSinceLastLogin == 1)
  7184. s = "yesterday";
  7185. else
  7186. s = daysSinceLastLogin + " days ago";
  7187. class9.disabledMessage = "You last logged in " + s + " from: " + signlink.dns;
  7188. } else
  7189. {
  7190. class9.disabledMessage = "";
  7191. }
  7192. if(j == 651)
  7193. {
  7194. if(unreadMessages == 0)
  7195. {
  7196. class9.disabledMessage = "0 unread messages";
  7197. class9.disabledColor = 0xffff00;
  7198. }
  7199. if(unreadMessages == 1)
  7200. {
  7201. class9.disabledMessage = "1 unread disabledMessage";
  7202. class9.disabledColor = 65280;
  7203. }
  7204. if(unreadMessages > 1)
  7205. {
  7206. class9.disabledMessage = unreadMessages + " unread messages";
  7207. class9.disabledColor = 65280;
  7208. }
  7209. }
  7210. if(j == 652)
  7211. if(daysSinceRecovChange == 201)
  7212. {
  7213. if(membersInt == 1)
  7214. class9.disabledMessage = "@yel@This is a non-members world: @whi@Since you are a member we";
  7215. else
  7216. class9.disabledMessage = "";
  7217. } else
  7218. if(daysSinceRecovChange == 200)
  7219. {
  7220. class9.disabledMessage = "You have not yet set any password recovery questions.";
  7221. } else
  7222. {
  7223. String s1;
  7224. if(daysSinceRecovChange == 0)
  7225. s1 = "Earlier today";
  7226. else
  7227. if(daysSinceRecovChange == 1)
  7228. s1 = "Yesterday";
  7229. else
  7230. s1 = daysSinceRecovChange + " days ago";
  7231. class9.disabledMessage = s1 + " you changed your recovery questions";
  7232. }
  7233. if(j == 653)
  7234. if(daysSinceRecovChange == 201)
  7235. {
  7236. if(membersInt == 1)
  7237. class9.disabledMessage = "@whi@recommend you use a members world instead. You may use";
  7238. else
  7239. class9.disabledMessage = "";
  7240. } else
  7241. if(daysSinceRecovChange == 200)
  7242. class9.disabledMessage = "We strongly recommend you do so now to secure your account.";
  7243. else
  7244. class9.disabledMessage = "If you do not remember making this change then cancel it immediately";
  7245. if(j == 654)
  7246. {
  7247. if(daysSinceRecovChange == 201)
  7248. if(membersInt == 1)
  7249. {
  7250. class9.disabledMessage = "@whi@this world but member benefits are unavailable whilst here.";
  7251. return;
  7252. } else
  7253. {
  7254. class9.disabledMessage = "";
  7255. return;
  7256. }
  7257. if(daysSinceRecovChange == 200)
  7258. {
  7259. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7260. return;
  7261. }
  7262. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7263. }
  7264. }
  7265.  
  7266. private void drawSplitPrivateChat()
  7267. {
  7268. if(splitPrivateChat == 0)
  7269. return;
  7270. RSFont textDrawingArea = aTextDrawingArea_1271;
  7271. int i = 0;
  7272. if(anInt1104 != 0)
  7273. i = 1;
  7274. for(int j = 0; j < 100; j++)
  7275. if(chatMessages[j] != null)
  7276. {
  7277. int k = chatTypes[j];
  7278. String s = chatNames[j];
  7279. byte byte1 = 0;
  7280. if(s != null && s.startsWith("@cr0@")) {
  7281. s = s.substring(5);
  7282. byte1 = 1;
  7283. }
  7284. if(s != null && s.startsWith("@cr1@")) {
  7285. s = s.substring(5);
  7286. byte1 = 2;
  7287. }
  7288. if(s != null && s.startsWith("@cr2@")) {
  7289. s = s.substring(5);
  7290. byte1 = 3;
  7291. }
  7292. if(s != null && s.startsWith("@cr3@")) {
  7293. s = s.substring(5);
  7294. byte1 = 4;
  7295. }
  7296. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  7297. {
  7298. int l = 329 - i * 13;
  7299. int k1 = 4;
  7300. textDrawingArea.method385(0, "From", l, k1);
  7301. textDrawingArea.method385(65535, "From", l - 1, k1);
  7302. k1 += textDrawingArea.getTextWidth("From ");
  7303. if(byte1 == 1) {
  7304. modIcons[0].drawSprite(k1, l - 12);
  7305. k1 += 12;
  7306. }
  7307. if(byte1 == 2) {
  7308. modIcons[1].drawSprite(k1, l - 12);
  7309. k1 += 12;
  7310. }
  7311. if(byte1 == 3) {
  7312. modIcons[2].drawSprite(k1, l - 12);
  7313. k1 += 12;
  7314. }
  7315. if(byte1 == 4) {
  7316. modIcons[3].drawSprite(k1, l - 12);
  7317. k1 += 12;
  7318. }
  7319. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  7320. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  7321. if(++i >= 5)
  7322. return;
  7323. }
  7324. if(k == 5 && privateChatMode < 2)
  7325. {
  7326. int i1 = 329 - i * 13;
  7327. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  7328. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  7329. if(++i >= 5)
  7330. return;
  7331. }
  7332. if(k == 6 && privateChatMode < 2)
  7333. {
  7334. int j1 = 329 - i * 13;
  7335. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  7336. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  7337. if(++i >= 5)
  7338. return;
  7339. }
  7340. }
  7341.  
  7342. }
  7343.  
  7344. public void pushMessage(String s, int i, String s1) {
  7345. if(i == 0 && dialogID != -1) {
  7346. aString844 = s;
  7347. super.clickMode3 = 0;
  7348. }
  7349. if(backDialogID == -1)
  7350. inputTaken = true;
  7351. for(int j = 499; j > 0; j--) {
  7352. chatTypes[j] = chatTypes[j - 1];
  7353. chatNames[j] = chatNames[j - 1];
  7354. chatMessages[j] = chatMessages[j - 1];
  7355. chatRights[j] = chatRights[j - 1];
  7356. }
  7357. chatTypes[0] = i;
  7358. chatNames[0] = s1;
  7359. chatMessages[0] = s;
  7360. chatRights[0] = rights;
  7361. }
  7362.  
  7363. public static void setTab(int id) {
  7364. needDrawTabArea = true;
  7365. tabID = id;
  7366. tabAreaAltered = true;
  7367. }
  7368. public int tabHPos;
  7369. private void processTabClick() {
  7370. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  7371. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  7372. runHover = true;
  7373. } else {
  7374. runHover = false;
  7375. }
  7376. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  7377. prayHover = true;
  7378. } else {
  7379. prayHover = false;
  7380. }
  7381. if(super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 3 && super.mouseY <= 25){
  7382. logHover = true;
  7383. } else {
  7384. logHover = false;
  7385. }
  7386. }
  7387. if(is562 == false){
  7388. if(super.clickMode3 == 1) {
  7389. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  7390. {
  7391. needDrawTabArea = true;
  7392. tabID = 0;
  7393. tabAreaAltered = true;
  7394. }
  7395. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  7396. {
  7397. needDrawTabArea = true;
  7398. tabID = 1;
  7399. tabAreaAltered = true;
  7400. }
  7401. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  7402. {
  7403. needDrawTabArea = true;
  7404. tabID = 2;
  7405. tabAreaAltered = true;
  7406. }
  7407. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  7408. {
  7409. needDrawTabArea = true;
  7410. tabID = 3;
  7411. tabAreaAltered = true;
  7412. }
  7413. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  7414. {
  7415. needDrawTabArea = true;
  7416. tabID = 4;
  7417. tabAreaAltered = true;
  7418. }
  7419. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  7420. {
  7421. needDrawTabArea = true;
  7422. tabID = 5;
  7423. tabAreaAltered = true;
  7424. }
  7425. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  7426. {
  7427. needDrawTabArea = true;
  7428. tabID = 6;
  7429. tabAreaAltered = true;
  7430. }
  7431. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  7432. {
  7433. needDrawTabArea = true;
  7434. tabID = 7;
  7435. tabAreaAltered = true;
  7436. }
  7437. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  7438. {
  7439. needDrawTabArea = true;
  7440. tabID = 8;
  7441. tabAreaAltered = true;
  7442. }
  7443. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  7444. {
  7445. needDrawTabArea = true;
  7446. tabID = 9;
  7447. tabAreaAltered = true;
  7448. }
  7449. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  7450. {
  7451. needDrawTabArea = true;
  7452. tabID = 10;
  7453. tabAreaAltered = true;
  7454. }
  7455. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  7456. {
  7457. needDrawTabArea = true;
  7458. tabID = 11;
  7459. tabAreaAltered = true;
  7460. }
  7461. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  7462. {
  7463. needDrawTabArea = true;
  7464. tabID = 12;
  7465. tabAreaAltered = true;
  7466. }
  7467. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  7468. {
  7469. needDrawTabArea = true;
  7470. tabID = 13;
  7471. tabAreaAltered = true;
  7472. }
  7473. }
  7474. } else {
  7475. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  7476. tabHPos = 0;
  7477. needDrawTabArea = true;
  7478. tabAreaAltered = true;
  7479. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  7480. tabHPos = 1;
  7481. needDrawTabArea = true;
  7482. tabAreaAltered = true;
  7483. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  7484. tabHPos = 2;
  7485. needDrawTabArea = true;
  7486. tabAreaAltered = true;
  7487. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  7488. tabHPos = 3;
  7489. needDrawTabArea = true;
  7490. tabAreaAltered = true;
  7491. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  7492. tabHPos = 4;
  7493. needDrawTabArea = true;
  7494. tabAreaAltered = true;
  7495. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  7496. tabHPos = 5;
  7497. needDrawTabArea = true;
  7498. tabAreaAltered = true;
  7499. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  7500. tabHPos = 6;
  7501. needDrawTabArea = true;
  7502. tabAreaAltered = true;
  7503. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  7504. tabHPos = 7;
  7505. needDrawTabArea = true;
  7506. tabAreaAltered = true;
  7507. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  7508. tabHPos = 15;
  7509. needDrawTabArea = true;
  7510. tabAreaAltered = true;
  7511. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  7512. tabHPos = 8;
  7513. needDrawTabArea = true;
  7514. tabAreaAltered = true;
  7515. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  7516. tabHPos = 9;
  7517. needDrawTabArea = true;
  7518. tabAreaAltered = true;
  7519. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  7520. tabHPos = 10;
  7521. needDrawTabArea = true;
  7522. tabAreaAltered = true;
  7523. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  7524. tabHPos = 11;
  7525. needDrawTabArea = true;
  7526. tabAreaAltered = true;
  7527. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  7528. tabHPos = 12;
  7529. needDrawTabArea = true;
  7530. tabAreaAltered = true;
  7531. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  7532. tabHPos = 13;
  7533. needDrawTabArea = true;
  7534. tabAreaAltered = true;
  7535. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  7536. tabHPos = 14;
  7537. needDrawTabArea = true;
  7538. tabAreaAltered = true;
  7539. } else {
  7540. tabHPos = -1;
  7541. needDrawTabArea = true;
  7542. tabAreaAltered = true;
  7543. }
  7544. if(super.clickMode3 == 1) {
  7545. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  7546. needDrawTabArea = true;
  7547. tabID = 0;
  7548. tabAreaAltered = true;
  7549. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  7550. needDrawTabArea = true;
  7551. tabID = 1;
  7552. tabAreaAltered = true;
  7553. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  7554. needDrawTabArea = true;
  7555. tabID = 2;
  7556. tabAreaAltered = true;
  7557. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  7558. needDrawTabArea = true;
  7559. tabID = 14;
  7560. tabAreaAltered = true;
  7561. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  7562. needDrawTabArea = true;
  7563. tabID = 3;
  7564. tabAreaAltered = true;
  7565. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  7566. needDrawTabArea = true;
  7567. tabID = 4;
  7568. tabAreaAltered = true;
  7569. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  7570. needDrawTabArea = true;
  7571. tabID = 5;
  7572. tabAreaAltered = true;
  7573. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  7574. needDrawTabArea = true;
  7575. tabID = 6;
  7576. tabAreaAltered = true;
  7577. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  7578. needDrawTabArea = true;
  7579. tabID = 16;
  7580. tabAreaAltered = true;
  7581. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  7582. needDrawTabArea = true;
  7583. tabID = 8;
  7584. tabAreaAltered = true;
  7585. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  7586. needDrawTabArea = true;
  7587. tabID = 9;
  7588. tabAreaAltered = true;
  7589. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  7590. needDrawTabArea = true;
  7591. tabID = 7;
  7592. tabAreaAltered = true;
  7593. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  7594. needDrawTabArea = true;
  7595. tabID = 11;
  7596. tabAreaAltered = true;
  7597. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  7598. needDrawTabArea = true;
  7599. tabID = 12;
  7600. tabAreaAltered = true;
  7601. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  7602. needDrawTabArea = true;
  7603. tabID = 13;
  7604. tabAreaAltered = true;
  7605. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  7606. needDrawTabArea = true;
  7607. tabID = 15;
  7608. tabAreaAltered = true;
  7609. }
  7610. /* Logout X */
  7611. else if(super.saveClickX >= 742 && super.saveClickX <= 764 && super.saveClickY >= 1 && super.saveClickY < 24 && tabInterfaceIDs[10] != -1) {
  7612. needDrawTabArea = true;
  7613. tabID = 10;
  7614. tabAreaAltered = true;
  7615. }
  7616.  
  7617. }
  7618. }
  7619.  
  7620. }
  7621.  
  7622. private void resetImageProducers2() {
  7623. if(chatBackImage != null)
  7624. return;
  7625. nullLoader();
  7626. super.fullGameScreen = null;
  7627. aRSImageProducer_1107 = null;
  7628. aRSImageProducer_1108 = null;
  7629. loginScreenArea = null;
  7630. leftSideFlame = null;
  7631. rightSideFlame = null;
  7632. gameLogo = null;
  7633. aRSImageProducer_1113 = null;
  7634. aRSImageProducer_1114 = null;
  7635. aRSImageProducer_1115 = null;
  7636. chatBackImage = new RSImageProducer(516, 165, getGameComponent());//519
  7637. mapBackImage = new RSImageProducer(249, 168, getGameComponent());//
  7638. DrawingArea.setAllPixelsToZero();
  7639. //mapBack.drawBackground(0, 0);
  7640. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7641. inventoryBackImage = new RSImageProducer(250, 335, getGameComponent());
  7642. inGameScreen = new RSImageProducer(512, 334, getGameComponent());
  7643. DrawingArea.setAllPixelsToZero();
  7644. //aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  7645. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  7646. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7647. welcomeScreenRaised = true;
  7648. }
  7649.  
  7650. public String getDocumentBaseHost() {
  7651. if (signlink.mainapp != null) {
  7652. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7653. }
  7654. return null;
  7655. }
  7656.  
  7657. private void method81(Sprite sprite, int j, int k) {
  7658. int l = k * k + j * j;
  7659. if(l > 4225 && l < 0x15f90) {
  7660. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  7661. int j1 = Model.modelIntArray1[i1];
  7662. int k1 = Model.modelIntArray2[i1];
  7663. j1 = (j1 * 256) / (minimapInt3 + 256);
  7664. k1 = (k1 * 256) / (minimapInt3 + 256);
  7665. int l1 = j * j1 + k * k1 >> 16;
  7666. int i2 = j * k1 - k * j1 >> 16;
  7667. double d = Math.atan2(l1, i2);
  7668. int j2 = (int)(Math.sin(d) * 63D);
  7669. int k2 = (int)(Math.cos(d) * 57D);
  7670. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7671. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7672. return;
  7673. } else {
  7674. markMinimap(sprite, k, j, false);
  7675. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7676. }
  7677. }
  7678.  
  7679. public void processRightClick() {
  7680. if (activeInterfaceType != 0) {
  7681. return;
  7682. }
  7683. menuActionName[0] = "Cancel";
  7684. menuActionID[0] = 1107;
  7685. menuActionRow = 1;
  7686. if (fullscreenInterfaceID != -1) {
  7687. anInt886 = 0;
  7688. anInt1315 = 0;
  7689. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  7690. if (anInt886 != anInt1026) {
  7691. anInt1026 = anInt886;
  7692. }
  7693. if (anInt1315 != anInt1129) {
  7694. anInt1129 = anInt1315;
  7695. }
  7696. return;
  7697. }
  7698. buildSplitPrivateChatMenu();
  7699. anInt886 = 0;
  7700. anInt1315 = 0;
  7701. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  7702. if (openInterfaceID != -1) {
  7703. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7704. } else {
  7705. build3dScreenMenu();
  7706. }
  7707. }
  7708. if (anInt886 != anInt1026) {
  7709. anInt1026 = anInt886;
  7710. }
  7711. if (anInt1315 != anInt1129) {
  7712. anInt1129 = anInt1315;
  7713. }
  7714. anInt886 = 0;
  7715. anInt1315 = 0;
  7716. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  7717. if(invOverlayInterfaceID != -1) {
  7718. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  7719. } else if(tabInterfaceIDs[tabID] != -1) {
  7720. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  7721. }
  7722. }
  7723. if (anInt886 != anInt1048) {
  7724. needDrawTabArea = true;
  7725. tabAreaAltered = true;
  7726. anInt1048 = anInt886;
  7727. }
  7728. if (anInt1315 != anInt1044) {
  7729. needDrawTabArea = true;
  7730. tabAreaAltered = true;
  7731. anInt1044 = anInt1315;
  7732. }
  7733. anInt886 = 0;
  7734. anInt1315 = 0;
  7735. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  7736. if(backDialogID != -1) {
  7737. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  7738. } else if(super.mouseY < 463 && super.mouseX < 490) {
  7739. buildChatAreaMenu(super.mouseY - 338);
  7740. }
  7741. }
  7742. if (backDialogID != -1 && anInt886 != anInt1039) {
  7743. inputTaken = true;
  7744. anInt1039 = anInt886;
  7745. }
  7746. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7747. inputTaken = true;
  7748. anInt1500 = anInt1315;
  7749. }
  7750. /** Custom menu drawing */
  7751. rightClickChatButtons();
  7752. alertHandler.processMouse(super.mouseX, super.mouseY); determineTopTabs();
  7753. determineBottomTabs();
  7754.  
  7755. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  7756. processMinimapActions();
  7757. }
  7758.  
  7759. boolean flag = false;
  7760. while (!flag) {
  7761. flag = true;
  7762. for (int j = 0; j < menuActionRow - 1; j++) {
  7763. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7764. String s = menuActionName[j];
  7765. menuActionName[j] = menuActionName[j + 1];
  7766. menuActionName[j + 1] = s;
  7767. int k = menuActionID[j];
  7768. menuActionID[j] = menuActionID[j + 1];
  7769. menuActionID[j + 1] = k;
  7770. k = menuActionCmd2[j];
  7771. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7772. menuActionCmd2[j + 1] = k;
  7773. k = menuActionCmd3[j];
  7774. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7775. menuActionCmd3[j + 1] = k;
  7776. k = menuActionCmd1[j];
  7777. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7778. menuActionCmd1[j + 1] = k;
  7779. flag = false;
  7780. }
  7781. }
  7782. }
  7783. }
  7784.  
  7785. private int method83(int i, int j, int k)
  7786. {
  7787. int l = 256 - k;
  7788. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7789. }
  7790.  
  7791. private void login(String s, String s1, boolean flag)
  7792. {
  7793. signlink.errorname = s;
  7794. try
  7795. {
  7796. if(!flag)
  7797. {
  7798. loginMessage1 = "";
  7799. loginMessage2 = "Connecting to server...";
  7800. drawLoginScreen(true);
  7801. }
  7802. socketStream = new RSSocket(this, openSocket(43594));
  7803. long l = TextClass.longForName(s);
  7804. int i = (int)(l >> 16 & 31L);
  7805. stream.currentOffset = 0;
  7806. stream.writeWordBigEndian(14);
  7807. stream.writeWordBigEndian(i);
  7808. socketStream.queueBytes(2, stream.buffer);
  7809. for(int j = 0; j < 8; j++)
  7810. socketStream.read();
  7811.  
  7812. int k = socketStream.read();
  7813. int i1 = k;
  7814. if(k == 0)
  7815. {
  7816. socketStream.flushInputStream(inStream.buffer, 8);
  7817. inStream.currentOffset = 0;
  7818. aLong1215 = inStream.readQWord();
  7819. int ai[] = new int[4];
  7820. ai[0] = (int)(Math.random() * 99999999D);
  7821. ai[1] = (int)(Math.random() * 99999999D);
  7822. ai[2] = (int)(aLong1215 >> 32);
  7823. ai[3] = (int)aLong1215;
  7824. stream.currentOffset = 0;
  7825. stream.writeWordBigEndian(10);
  7826. stream.writeDWord(ai[0]);
  7827. stream.writeDWord(ai[1]);
  7828. stream.writeDWord(ai[2]);
  7829. stream.writeDWord(ai[3]);
  7830. stream.writeDWord(123456);
  7831. stream.writeString(s);
  7832. stream.writeString(s1);
  7833. stream.doKeys();
  7834. aStream_847.currentOffset = 0;
  7835. if(flag)
  7836. aStream_847.writeWordBigEndian(18);
  7837. else
  7838. aStream_847.writeWordBigEndian(16);
  7839. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7840. aStream_847.writeWordBigEndian(255);
  7841. aStream_847.writeWord(317);
  7842. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7843. for(int l1 = 0; l1 < 9; l1++)
  7844. aStream_847.writeDWord(expectedCRCs[l1]);
  7845.  
  7846. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7847. stream.encryption = new ISAACRandomGen(ai);
  7848. for(int j2 = 0; j2 < 4; j2++)
  7849. ai[j2] += 50;
  7850.  
  7851. encryption = new ISAACRandomGen(ai);
  7852. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7853. k = socketStream.read();
  7854. }
  7855. if(k == 1)
  7856. {
  7857. try
  7858. {
  7859. Thread.sleep(2000L);
  7860. }
  7861. catch(Exception _ex) { }
  7862. login(s, s1, flag);
  7863. return;
  7864. }
  7865. if(k == 2)
  7866. {
  7867. myPrivilege = socketStream.read();
  7868. flagged = socketStream.read() == 1;
  7869. aLong1220 = 0L;
  7870. anInt1022 = 0;
  7871. mouseDetection.coordsIndex = 0;
  7872. super.awtFocus = true;
  7873. aBoolean954 = true;
  7874. loggedIn = true;
  7875. stream.currentOffset = 0;
  7876. inStream.currentOffset = 0;
  7877. pktType = -1;
  7878. anInt841 = -1;
  7879. anInt842 = -1;
  7880. anInt843 = -1;
  7881. pktSize = 0;
  7882. anInt1009 = 0;
  7883. anInt1104 = 0;
  7884. anInt1011 = 0;
  7885. anInt855 = 0;
  7886. menuActionRow = 0;
  7887. menuOpen = false;
  7888. super.idleTime = 0;
  7889. for(int j1 = 0; j1 < 100; j1++)
  7890. chatMessages[j1] = null;
  7891.  
  7892. itemSelected = 0;
  7893. spellSelected = 0;
  7894. loadingStage = 0;
  7895. anInt1062 = 0;
  7896. anInt1278 = (int)(Math.random() * 100D) - 50;
  7897. anInt1131 = (int)(Math.random() * 110D) - 55;
  7898. anInt896 = (int)(Math.random() * 80D) - 40;
  7899. minimapInt2 = (int)(Math.random() * 120D) - 60;
  7900. minimapInt3 = (int)(Math.random() * 30D) - 20;
  7901. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  7902. anInt1021 = 0;
  7903. anInt985 = -1;
  7904. destX = 0;
  7905. destY = 0;
  7906. playerCount = 0;
  7907. npcCount = 0;
  7908. for(int i2 = 0; i2 < maxPlayers; i2++)
  7909. {
  7910. playerArray[i2] = null;
  7911. aStreamArray895s[i2] = null;
  7912. }
  7913.  
  7914. for(int k2 = 0; k2 < 16384; k2++)
  7915. npcArray[k2] = null;
  7916.  
  7917. myPlayer = playerArray[myPlayerIndex] = new Player();
  7918. aClass19_1013.removeAll();
  7919. aClass19_1056.removeAll();
  7920. for(int l2 = 0; l2 < 4; l2++)
  7921. {
  7922. for(int i3 = 0; i3 < 104; i3++)
  7923. {
  7924. for(int k3 = 0; k3 < 104; k3++)
  7925. groundArray[l2][i3][k3] = null;
  7926.  
  7927. }
  7928.  
  7929. }
  7930. aClass19_1179 = new NodeList();
  7931. fullscreenInterfaceID = -1;
  7932. anInt900 = 0;
  7933. friendsCount = 0;
  7934. dialogID = -1;
  7935. backDialogID = -1;
  7936. openInterfaceID = -1;
  7937. invOverlayInterfaceID = -1;
  7938. anInt1018 = -1;
  7939. aBoolean1149 = false;
  7940. tabID = 3;
  7941. inputDialogState = 0;
  7942. menuOpen = false;
  7943. messagePromptRaised = false;
  7944. aString844 = null;
  7945. anInt1055 = 0;
  7946. anInt1054 = -1;
  7947. aBoolean1047 = true;
  7948. method45();
  7949. welcome();
  7950. for(int j3 = 0; j3 < 5; j3++)
  7951. anIntArray990[j3] = 0;
  7952.  
  7953. for(int l3 = 0; l3 < 5; l3++)
  7954. {
  7955. atPlayerActions[l3] = null;
  7956. atPlayerArray[l3] = false;
  7957. }
  7958.  
  7959. anInt1175 = 0;
  7960. anInt1134 = 0;
  7961. anInt986 = 0;
  7962. anInt1288 = 0;
  7963. anInt924 = 0;
  7964. anInt1188 = 0;
  7965. anInt1155 = 0;
  7966. anInt1226 = 0;
  7967. int anInt941 = 0;
  7968. int anInt1260 = 0;
  7969. resetImageProducers2();
  7970. return;
  7971. }
  7972. if(k == 3)
  7973. {
  7974. loginMessage1 = "";
  7975. loginMessage2 = "Invalid username or password.";
  7976. return;
  7977. }
  7978. if(k == 4)
  7979. {
  7980. loginMessage1 = "Your account has been disabled.";
  7981. loginMessage2 = "Please check your disabledMessage-center for details.";
  7982. return;
  7983. }
  7984. if(k == 5)
  7985. {
  7986. loginMessage1 = "Your account is already logged in.";
  7987. loginMessage2 = "Try again in 60 secs...";
  7988. return;
  7989. }
  7990. if(k == 6)
  7991. {
  7992. loginMessage1 = "ErasedPkz has been updated!";
  7993. loginMessage2 = "Please reload this page.";
  7994. return;
  7995. }
  7996. if(k == 7)
  7997. {
  7998. loginMessage1 = "This world is full.";
  7999. loginMessage2 = "Please use a different world.";
  8000. return;
  8001. }
  8002. if(k == 8)
  8003. {
  8004. loginMessage1 = "Unable to connect.";
  8005. loginMessage2 = "Login server offline.";
  8006. return;
  8007. }
  8008. if(k == 9)
  8009. {
  8010. loginMessage1 = "Login limit exceeded.";
  8011. loginMessage2 = "Too many connections from your address.";
  8012. return;
  8013. }
  8014. if(k == 10)
  8015. {
  8016. loginMessage1 = "Unable to connect.";
  8017. loginMessage2 = "Bad session id.";
  8018. return;
  8019. }
  8020. if(k == 11)
  8021. {
  8022. loginMessage2 = "Login server rejected session.";
  8023. loginMessage2 = "Please try again.";
  8024. return;
  8025. }
  8026. if(k == 12)
  8027. {
  8028. loginMessage1 = "You need a members account to login to this world.";
  8029. loginMessage2 = "Please subscribe, or use a different world.";
  8030. return;
  8031. }
  8032. if(k == 13)
  8033. {
  8034. loginMessage1 = "Could not complete login.";
  8035. loginMessage2 = "Please try using a different world.";
  8036. return;
  8037. }
  8038. if(k == 14)
  8039. {
  8040. loginMessage1 = "The server is being updated.";
  8041. loginMessage2 = "Please wait 1 minute and try again.";
  8042. return;
  8043. }
  8044. if(k == 15)
  8045. {
  8046. loggedIn = true;
  8047. stream.currentOffset = 0;
  8048. inStream.currentOffset = 0;
  8049. pktType = -1;
  8050. anInt841 = -1;
  8051. anInt842 = -1;
  8052. anInt843 = -1;
  8053. pktSize = 0;
  8054. anInt1009 = 0;
  8055. anInt1104 = 0;
  8056. menuActionRow = 0;
  8057. menuOpen = false;
  8058. aLong824 = System.currentTimeMillis();
  8059. return;
  8060. }
  8061. if(k == 16)
  8062. {
  8063. loginMessage1 = "Login attempts exceeded.";
  8064. loginMessage2 = "Please wait 1 minute and try again.";
  8065. return;
  8066. }
  8067. if(k == 17)
  8068. {
  8069. loginMessage1 = "You are standing in a members-only area.";
  8070. loginMessage2 = "To play on this world move to a free area first";
  8071. return;
  8072. }
  8073. if(k == 20)
  8074. {
  8075. loginMessage1 = "Invalid loginserver requested";
  8076. loginMessage2 = "Please try using a different world.";
  8077. return;
  8078. }
  8079. if(k == 21)
  8080. {
  8081. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  8082. {
  8083. loginMessage1 = "You have only just left another world";
  8084. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  8085. drawLoginScreen(true);
  8086. try
  8087. {
  8088. Thread.sleep(1000L);
  8089. }
  8090. catch(Exception _ex) { }
  8091. }
  8092.  
  8093. login(s, s1, flag);
  8094. return;
  8095. }
  8096. if(k == -1)
  8097. {
  8098. if(i1 == 0)
  8099. {
  8100. if(loginFailures < 2)
  8101. {
  8102. try
  8103. {
  8104. Thread.sleep(2000L);
  8105. }
  8106. catch(Exception _ex) { }
  8107. loginFailures++;
  8108. login(s, s1, flag);
  8109. return;
  8110. } else
  8111. {
  8112. loginMessage1 = "You must download The latest";
  8113. loginMessage2 = "client at www.erased-pkz.comyr.com";
  8114. return;
  8115. }
  8116. } else
  8117. {
  8118. loginMessage1 = "No response from server";
  8119. loginMessage2 = "Please try using a different world.";
  8120. return;
  8121. }
  8122. } else
  8123. {
  8124. System.out.println("response:" + k);
  8125. loginMessage1 = "Unexpected server response";
  8126. loginMessage2 = "Please try using a different world.";
  8127. return;
  8128. }
  8129. }
  8130. catch(IOException _ex)
  8131. {
  8132. loginMessage1 = "";
  8133. }
  8134. loginMessage2 = "Error connecting to server.";
  8135. }
  8136.  
  8137. 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) {
  8138. byte byte0 = 104;
  8139. byte byte1 = 104;
  8140. for(int l2 = 0; l2 < byte0; l2++) {
  8141. for(int i3 = 0; i3 < byte1; i3++) {
  8142. anIntArrayArray901[l2][i3] = 0;
  8143. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  8144. }
  8145. }
  8146. int j3 = j2;
  8147. int k3 = j1;
  8148. anIntArrayArray901[j2][j1] = 99;
  8149. anIntArrayArray825[j2][j1] = 0;
  8150. int l3 = 0;
  8151. int i4 = 0;
  8152. bigX[l3] = j2;
  8153. bigY[l3++] = j1;
  8154. boolean flag1 = false;
  8155. int j4 = bigX.length;
  8156. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  8157. while(i4 != l3)
  8158. {
  8159. j3 = bigX[i4];
  8160. k3 = bigY[i4];
  8161. i4 = (i4 + 1) % j4;
  8162. if(j3 == k2 && k3 == i2)
  8163. {
  8164. flag1 = true;
  8165. break;
  8166. }
  8167. if(i1 != 0)
  8168. {
  8169. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  8170. {
  8171. flag1 = true;
  8172. break;
  8173. }
  8174. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  8175. {
  8176. flag1 = true;
  8177. break;
  8178. }
  8179. }
  8180. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  8181. {
  8182. flag1 = true;
  8183. break;
  8184. }
  8185. int l4 = anIntArrayArray825[j3][k3] + 1;
  8186. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  8187. {
  8188. bigX[l3] = j3 - 1;
  8189. bigY[l3] = k3;
  8190. l3 = (l3 + 1) % j4;
  8191. anIntArrayArray901[j3 - 1][k3] = 2;
  8192. anIntArrayArray825[j3 - 1][k3] = l4;
  8193. }
  8194. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  8195. {
  8196. bigX[l3] = j3 + 1;
  8197. bigY[l3] = k3;
  8198. l3 = (l3 + 1) % j4;
  8199. anIntArrayArray901[j3 + 1][k3] = 8;
  8200. anIntArrayArray825[j3 + 1][k3] = l4;
  8201. }
  8202. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  8203. {
  8204. bigX[l3] = j3;
  8205. bigY[l3] = k3 - 1;
  8206. l3 = (l3 + 1) % j4;
  8207. anIntArrayArray901[j3][k3 - 1] = 1;
  8208. anIntArrayArray825[j3][k3 - 1] = l4;
  8209. }
  8210. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  8211. {
  8212. bigX[l3] = j3;
  8213. bigY[l3] = k3 + 1;
  8214. l3 = (l3 + 1) % j4;
  8215. anIntArrayArray901[j3][k3 + 1] = 4;
  8216. anIntArrayArray825[j3][k3 + 1] = l4;
  8217. }
  8218. 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)
  8219. {
  8220. bigX[l3] = j3 - 1;
  8221. bigY[l3] = k3 - 1;
  8222. l3 = (l3 + 1) % j4;
  8223. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  8224. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  8225. }
  8226. 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)
  8227. {
  8228. bigX[l3] = j3 + 1;
  8229. bigY[l3] = k3 - 1;
  8230. l3 = (l3 + 1) % j4;
  8231. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  8232. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  8233. }
  8234. 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)
  8235. {
  8236. bigX[l3] = j3 - 1;
  8237. bigY[l3] = k3 + 1;
  8238. l3 = (l3 + 1) % j4;
  8239. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  8240. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  8241. }
  8242. 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)
  8243. {
  8244. bigX[l3] = j3 + 1;
  8245. bigY[l3] = k3 + 1;
  8246. l3 = (l3 + 1) % j4;
  8247. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  8248. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  8249. }
  8250. }
  8251. anInt1264 = 0;
  8252. if(!flag1)
  8253. {
  8254. if(flag)
  8255. {
  8256. int i5 = 100;
  8257. for(int k5 = 1; k5 < 2; k5++)
  8258. {
  8259. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  8260. {
  8261. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  8262. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  8263. {
  8264. i5 = anIntArrayArray825[i6][l6];
  8265. j3 = i6;
  8266. k3 = l6;
  8267. anInt1264 = 1;
  8268. flag1 = true;
  8269. }
  8270.  
  8271. }
  8272.  
  8273. if(flag1)
  8274. break;
  8275. }
  8276.  
  8277. }
  8278. if(!flag1)
  8279. return false;
  8280. }
  8281. i4 = 0;
  8282. bigX[i4] = j3;
  8283. bigY[i4++] = k3;
  8284. int l5;
  8285. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  8286. {
  8287. if(j5 != l5)
  8288. {
  8289. l5 = j5;
  8290. bigX[i4] = j3;
  8291. bigY[i4++] = k3;
  8292. }
  8293. if((j5 & 2) != 0)
  8294. j3++;
  8295. else
  8296. if((j5 & 8) != 0)
  8297. j3--;
  8298. if((j5 & 1) != 0)
  8299. k3++;
  8300. else
  8301. if((j5 & 4) != 0)
  8302. k3--;
  8303. }
  8304. // if(cancelWalk) { return i4 > 0; }
  8305.  
  8306.  
  8307. if(i4 > 0)
  8308. {
  8309. int k4 = i4;
  8310. if(k4 > 25)
  8311. k4 = 25;
  8312. i4--;
  8313. int k6 = bigX[i4];
  8314. int i7 = bigY[i4];
  8315. anInt1288 += k4;
  8316. if(anInt1288 >= 92)
  8317. {
  8318. stream.createFrame(36);
  8319. stream.writeDWord(0);
  8320. anInt1288 = 0;
  8321. }
  8322. if(i == 0)
  8323. {
  8324. stream.createFrame(164);
  8325. stream.writeWordBigEndian(k4 + k4 + 3);
  8326. }
  8327. if(i == 1)
  8328. {
  8329. stream.createFrame(248);
  8330. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8331. }
  8332. if(i == 2)
  8333. {
  8334. stream.createFrame(98);
  8335. stream.writeWordBigEndian(k4 + k4 + 3);
  8336. }
  8337. stream.method433(k6 + baseX);
  8338. destX = bigX[0];
  8339. destY = bigY[0];
  8340. for(int j7 = 1; j7 < k4; j7++)
  8341. {
  8342. i4--;
  8343. stream.writeWordBigEndian(bigX[i4] - k6);
  8344. stream.writeWordBigEndian(bigY[i4] - i7);
  8345. }
  8346.  
  8347. stream.method431(i7 + baseY);
  8348. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8349. return true;
  8350. }
  8351. return i != 1;
  8352. }
  8353.  
  8354. private void method86(Stream stream)
  8355. {
  8356. for(int j = 0; j < anInt893; j++)
  8357. {
  8358. int k = anIntArray894[j];
  8359. NPC npc = npcArray[k];
  8360. int l = stream.readUnsignedByte();
  8361. if((l & 0x10) != 0)
  8362. {
  8363. int i1 = stream.method434();
  8364. if(i1 == 65535)
  8365. i1 = -1;
  8366. int i2 = stream.readUnsignedByte();
  8367. if(i1 == npc.anim && i1 != -1)
  8368. {
  8369. int l2 = Animation.anims[i1].anInt365;
  8370. if(l2 == 1)
  8371. {
  8372. npc.anInt1527 = 0;
  8373. npc.anInt1528 = 0;
  8374. npc.anInt1529 = i2;
  8375. npc.anInt1530 = 0;
  8376. }
  8377. if(l2 == 2)
  8378. npc.anInt1530 = 0;
  8379. } else
  8380. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  8381. {
  8382. npc.anim = i1;
  8383. npc.anInt1527 = 0;
  8384. npc.anInt1528 = 0;
  8385. npc.anInt1529 = i2;
  8386. npc.anInt1530 = 0;
  8387. npc.anInt1542 = npc.smallXYIndex;
  8388. }
  8389. }
  8390. if((l & 8) != 0)
  8391. {
  8392. int j1 = stream.method426();
  8393. int j2 = stream.method427();
  8394. npc.updateHitData(j2, j1, loopCycle);
  8395. npc.loopCycleStatus = loopCycle + 300;
  8396. npc.currentHealth = stream.method426();
  8397. npc.maxHealth = stream.readUnsignedByte();
  8398. }
  8399. if((l & 0x80) != 0)
  8400. {
  8401. npc.anInt1520 = stream.readUnsignedWord();
  8402. int k1 = stream.readDWord();
  8403. npc.anInt1524 = k1 >> 16;
  8404. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8405. npc.anInt1521 = 0;
  8406. npc.anInt1522 = 0;
  8407. if(npc.anInt1523 > loopCycle)
  8408. npc.anInt1521 = -1;
  8409. if(npc.anInt1520 == 65535)
  8410. npc.anInt1520 = -1;
  8411. }
  8412. if((l & 0x20) != 0)
  8413. {
  8414. npc.interactingEntity = stream.readUnsignedWord();
  8415. if(npc.interactingEntity == 65535)
  8416. npc.interactingEntity = -1;
  8417. }
  8418. if((l & 1) != 0)
  8419. {
  8420. npc.textSpoken = stream.readString();
  8421. npc.textCycle = 100;
  8422. // entityMessage(npc);
  8423.  
  8424. }
  8425. if((l & 0x40) != 0)
  8426. {
  8427. int l1 = stream.method427();
  8428. int k2 = stream.method428();
  8429. npc.updateHitData(k2, l1, loopCycle);
  8430. npc.loopCycleStatus = loopCycle + 300;
  8431. npc.currentHealth = stream.method428();
  8432. npc.maxHealth = stream.method427();
  8433. }
  8434. if((l & 2) != 0)
  8435. {
  8436. npc.desc = EntityDef.forID(stream.method436());
  8437. npc.anInt1540 = npc.desc.aByte68;
  8438. npc.anInt1504 = npc.desc.anInt79;
  8439. npc.anInt1554 = npc.desc.anInt67;
  8440. npc.anInt1555 = npc.desc.anInt58;
  8441. npc.anInt1556 = npc.desc.anInt83;
  8442. npc.anInt1557 = npc.desc.anInt55;
  8443. npc.anInt1511 = npc.desc.anInt77;
  8444. }
  8445. if((l & 4) != 0)
  8446. {
  8447. npc.anInt1538 = stream.method434();
  8448. npc.anInt1539 = stream.method434();
  8449. }
  8450. }
  8451. }
  8452.  
  8453. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  8454. {
  8455. if(menuActionRow >= 400)
  8456. return;
  8457. if(entityDef.childrenIDs != null)
  8458. entityDef = entityDef.method161();
  8459. if(entityDef == null)
  8460. return;
  8461. if(!entityDef.aBoolean84)
  8462. return;
  8463. String s = entityDef.name;
  8464. if(entityDef.combatLevel != 0)
  8465. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  8466. if(itemSelected == 1)
  8467. {
  8468. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  8469. menuActionID[menuActionRow] = 582;
  8470. menuActionCmd1[menuActionRow] = i;
  8471. menuActionCmd2[menuActionRow] = k;
  8472. menuActionCmd3[menuActionRow] = j;
  8473. menuActionRow++;
  8474. return;
  8475. }
  8476. if(spellSelected == 1)
  8477. {
  8478. if((spellUsableOn & 2) == 2)
  8479. {
  8480. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8481. menuActionID[menuActionRow] = 413;
  8482. menuActionCmd1[menuActionRow] = i;
  8483. menuActionCmd2[menuActionRow] = k;
  8484. menuActionCmd3[menuActionRow] = j;
  8485. menuActionRow++;
  8486. }
  8487. } else
  8488. {
  8489. if(entityDef.itemActions != null)
  8490. {
  8491. for(int l = 4; l >= 0; l--)
  8492. if(entityDef.itemActions[l] != null && !entityDef.itemActions[l].equalsIgnoreCase("attack"))
  8493. {
  8494. menuActionName[menuActionRow] = entityDef.itemActions[l] + " @yel@" + s;
  8495. if(l == 0)
  8496. menuActionID[menuActionRow] = 20;
  8497. if(l == 1)
  8498. menuActionID[menuActionRow] = 412;
  8499. if(l == 2)
  8500. menuActionID[menuActionRow] = 225;
  8501. if(l == 3)
  8502. menuActionID[menuActionRow] = 965;
  8503. if(l == 4)
  8504. menuActionID[menuActionRow] = 478;
  8505. menuActionCmd1[menuActionRow] = i;
  8506. menuActionCmd2[menuActionRow] = k;
  8507. menuActionCmd3[menuActionRow] = j;
  8508. menuActionRow++;
  8509. }
  8510.  
  8511. }
  8512. if(entityDef.itemActions != null)
  8513. {
  8514. for(int i1 = 4; i1 >= 0; i1--)
  8515. if(entityDef.itemActions[i1] != null && entityDef.itemActions[i1].equalsIgnoreCase("attack"))
  8516. {
  8517. char c = '\0';
  8518. if(entityDef.combatLevel > myPlayer.combatLevel)
  8519. c = '\u07D0';
  8520. menuActionName[menuActionRow] = entityDef.itemActions[i1] + " @yel@" + s;
  8521. if(i1 == 0)
  8522. menuActionID[menuActionRow] = 20 + c;
  8523. if(i1 == 1)
  8524. menuActionID[menuActionRow] = 412 + c;
  8525. if(i1 == 2)
  8526. menuActionID[menuActionRow] = 225 + c;
  8527. if(i1 == 3)
  8528. menuActionID[menuActionRow] = 965 + c;
  8529. if(i1 == 4)
  8530. menuActionID[menuActionRow] = 478 + c;
  8531. menuActionCmd1[menuActionRow] = i;
  8532. menuActionCmd2[menuActionRow] = k;
  8533. menuActionCmd3[menuActionRow] = j;
  8534. menuActionRow++;
  8535. }
  8536.  
  8537. }
  8538. if(idToggle == true) {
  8539. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.interfaceType + "@gre@)";
  8540. } else {
  8541. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8542. }
  8543. menuActionID[menuActionRow] = 1025;
  8544. menuActionCmd1[menuActionRow] = i;
  8545. menuActionCmd2[menuActionRow] = k;
  8546. menuActionCmd3[menuActionRow] = j;
  8547. menuActionRow++;
  8548. }
  8549. }
  8550.  
  8551. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  8552. {
  8553. if(player == myPlayer)
  8554. return;
  8555. if(menuActionRow >= 400)
  8556. return;
  8557. String s;
  8558. if(player.skill == 0)
  8559. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  8560. else
  8561. s = player.name + " (skill-" + player.skill + ")";
  8562. if(itemSelected == 1)
  8563. {
  8564. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @whi@" + s;
  8565. menuActionID[menuActionRow] = 491;
  8566. menuActionCmd1[menuActionRow] = j;
  8567. menuActionCmd2[menuActionRow] = i;
  8568. menuActionCmd3[menuActionRow] = k;
  8569. menuActionRow++;
  8570. } else
  8571. if(spellSelected == 1)
  8572. {
  8573. if((spellUsableOn & 8) == 8)
  8574. {
  8575. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8576. menuActionID[menuActionRow] = 365;
  8577. menuActionCmd1[menuActionRow] = j;
  8578. menuActionCmd2[menuActionRow] = i;
  8579. menuActionCmd3[menuActionRow] = k;
  8580. menuActionRow++;
  8581. }
  8582. } else
  8583. {
  8584. for(int l = 4; l >= 0; l--)
  8585. if(atPlayerActions[l] != null)
  8586. {
  8587. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  8588. char c = '\0';
  8589. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  8590. {
  8591. if(player.combatLevel > myPlayer.combatLevel)
  8592. c = '\u07D0';
  8593. if(myPlayer.team != 0 && player.team != 0)
  8594. if(myPlayer.team == player.team)
  8595. c = '\u07D0';
  8596. else
  8597. c = '\0';
  8598. } else
  8599. if(atPlayerArray[l])
  8600. c = '\u07D0';
  8601. if(l == 0)
  8602. menuActionID[menuActionRow] = 561 + c;
  8603. if(l == 1)
  8604. menuActionID[menuActionRow] = 779 + c;
  8605. if(l == 2)
  8606. menuActionID[menuActionRow] = 27 + c;
  8607. if(l == 3)
  8608. menuActionID[menuActionRow] = 577 + c;
  8609. if(l == 4)
  8610. menuActionID[menuActionRow] = 729 + c;
  8611. menuActionCmd1[menuActionRow] = j;
  8612. menuActionCmd2[menuActionRow] = i;
  8613. menuActionCmd3[menuActionRow] = k;
  8614. menuActionRow++;
  8615. }
  8616.  
  8617. }
  8618. for(int i1 = 0; i1 < menuActionRow; i1++)
  8619. if(menuActionID[i1] == 516)
  8620. {
  8621. menuActionName[i1] = "Walk here @whi@" + s;
  8622. return;
  8623. }
  8624.  
  8625. }
  8626.  
  8627. private void method89(Class30_Sub1 class30_sub1)
  8628. {
  8629. int i = 0;
  8630. int j = -1;
  8631. int k = 0;
  8632. int l = 0;
  8633. if(class30_sub1.anInt1296 == 0)
  8634. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8635. if(class30_sub1.anInt1296 == 1)
  8636. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8637. if(class30_sub1.anInt1296 == 2)
  8638. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8639. if(class30_sub1.anInt1296 == 3)
  8640. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8641. if(i != 0)
  8642. {
  8643. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8644. j = i >> 14 & 0x7fff;
  8645. k = i1 & 0x1f;
  8646. l = i1 >> 6;
  8647. }
  8648. class30_sub1.anInt1299 = j;
  8649. class30_sub1.anInt1301 = k;
  8650. class30_sub1.anInt1300 = l;
  8651. }
  8652.  
  8653. private void method90()
  8654. {
  8655. for(int i = 0; i < anInt1062; i++)
  8656. if(anIntArray1250[i] <= 0)
  8657. {
  8658. boolean flag1 = false;
  8659. try
  8660. {
  8661. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  8662. {
  8663. if(!replayWave())
  8664. flag1 = true;
  8665. } else
  8666. {
  8667. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  8668. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  8669. {
  8670. anInt1257 = stream.currentOffset;
  8671. aLong1172 = System.currentTimeMillis();
  8672. if(saveWave(stream.buffer, stream.currentOffset))
  8673. {
  8674. anInt874 = anIntArray1207[i];
  8675. anInt1289 = anIntArray1241[i];
  8676. } else
  8677. {
  8678. flag1 = true;
  8679. }
  8680. }
  8681. }
  8682. }
  8683. catch(Exception exception) { }
  8684. if(!flag1 || anIntArray1250[i] == -5)
  8685. {
  8686. anInt1062--;
  8687. for(int j = i; j < anInt1062; j++)
  8688. {
  8689. anIntArray1207[j] = anIntArray1207[j + 1];
  8690. anIntArray1241[j] = anIntArray1241[j + 1];
  8691. anIntArray1250[j] = anIntArray1250[j + 1];
  8692. }
  8693.  
  8694. i--;
  8695. } else
  8696. {
  8697. anIntArray1250[i] = -5;
  8698. }
  8699. } else
  8700. {
  8701. anIntArray1250[i]--;
  8702. }
  8703.  
  8704. if(prevSong > 0)
  8705. {
  8706. prevSong -= 20;
  8707. if(prevSong < 0)
  8708. prevSong = 0;
  8709. if(prevSong == 0 && musicEnabled && !lowMem)
  8710. {
  8711. nextSong = currentSong;
  8712. songChanging = true;
  8713. onDemandFetcher.method558(2, nextSong);
  8714. }
  8715. }
  8716. }
  8717.  
  8718. /* public static void compress(int ID) {
  8719. try {
  8720. String inF = "C:/ErasedPkzCache1.zip/gzip/"+ ID +".dat";
  8721. String outF = "C:/ErasedPkzCache1.zip/gzip/"+ ID;
  8722. File inF2 = new File(inF);
  8723. File outF2 = new File(outF);
  8724. System.out.println("GZipping: " + inF2 + " file");
  8725. FileOutputStream FOS = new FileOutputStream(outF2 + ".gz");
  8726. GZIPOutputStream GZOS = new GZIPOutputStream(FOS);
  8727. FileInputStream FIN = new FileInputStream(inF2);
  8728. BufferedInputStream IN = new BufferedInputStream(FIN);
  8729. byte[] buffer = new byte[1024];
  8730. int i;
  8731. while ((i = IN.read(buffer)) >= 0) {
  8732. GZOS.write(buffer, 0, i);
  8733. }
  8734. System.out.println("File has been GZipped succesfully");
  8735. IN.close();
  8736. GZOS.close();
  8737. }
  8738. catch(IOException e) {
  8739. System.out.println("Error: " + e);
  8740. }
  8741. compress(ID + 1);
  8742. }
  8743. void main() {
  8744. compress(29);
  8745. }*/
  8746.  
  8747.  
  8748. void startUp()
  8749. {
  8750. //main();
  8751. //models();
  8752. drawLoadingText(20, "Starting up");
  8753. new CacheDownloader(this).downloadCache();
  8754. setNewMaps();
  8755. if(signlink.sunjava)
  8756. super.minDelay = 5;
  8757. aBoolean993 = true;
  8758. String s = getDocumentBaseHost();
  8759. if(signlink.cache_dat != null) {
  8760. for(int i = 0; i < 5; i++)
  8761. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  8762. }
  8763. try {
  8764. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  8765. smallText = new RSFont(false, "p11_full", titleStreamLoader);
  8766. aTextDrawingArea_1271 = new RSFont(false, "p12_full", titleStreamLoader);
  8767. chatTextDrawingArea = new RSFont(false, "b12_full", titleStreamLoader);
  8768. RSFont aTextDrawingArea_1273 = new RSFont(true, "q8_full", titleStreamLoader);
  8769.  
  8770. newSmallFont = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8771. newRegularFont = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8772. newBoldFont = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8773. newFancyFont = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8774. //UserInterface.fonts = newFonts;
  8775. newSmallFont.unpackChatImages(chatImages);
  8776. newRegularFont.unpackChatImages(chatImages);
  8777. newBoldFont.unpackChatImages(chatImages);
  8778. newFancyFont.unpackChatImages(chatImages);
  8779.  
  8780. drawLogo();
  8781. loadTitleScreen();
  8782. NamedArchive archive = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8783. NamedArchive streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8784. NamedArchive mediaArchive = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8785. NamedArchive streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8786. NamedArchive streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8787. NamedArchive streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8788. byteGroundArray = new byte[4][104][104];
  8789. intGroundArray = new int[4][105][105];
  8790. worldController = new WorldController(intGroundArray);
  8791. for(int j = 0; j < 4; j++)
  8792. aClass11Array1230[j] = new Class11();
  8793. aSprite_1263 = new Sprite(512, 512);
  8794. NamedArchive streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  8795. drawLoadingText(60, "Unpacking Models");
  8796. System.out.println("This could take a minute just sit back and relax.");
  8797. onDemandFetcher = new OnDemandFetcher();
  8798. onDemandFetcher.start(streamLoader_6, this);
  8799. Class36.method528(onDemandFetcher.getAnimCount());
  8800. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8801. /* All 525 Models */
  8802. ModelDecompressor.hdgfx();
  8803. System.out.println("Loaded 525 graphics...");
  8804. /* 525 End */
  8805. ModelDecompressor.loadModelDataFile();
  8806. drawLoadingText(80, "Unpacking media");
  8807. preloadModels();
  8808. DataBase.loadAnimations();
  8809.  
  8810. /* Custom sprite unpacking */
  8811. loadExtraSprites();
  8812. loadingPleaseWait = new Sprite("loadingPleaseWait");
  8813. reestablish = new Sprite("reestablish");
  8814. hitMarks[20] = new Sprite("hitMark");
  8815. hitMarks[21] = new Sprite("hitMark2");
  8816. hitMarks[22] = new Sprite("hitMark3");
  8817. hitMarks[23] = new Sprite("hitMark4");
  8818. compass = new Sprite(mediaArchive, "compass", 0);
  8819. mapArea = new Sprite("maparea");
  8820. multiOverlay = new Sprite(mediaArchive, "overlay_multiway", 0);
  8821. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", 1);
  8822. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 1.PNG", 1);
  8823. /**/
  8824.  
  8825. mapBack = new Background(mediaArchive, "mapback", 0);
  8826. for(int i = 0; i <= 3; i++) {
  8827. combatIcons[i] = new Sprite("Player/combatIcon "+i+"");
  8828. }
  8829.  
  8830. for(int c1 = 0; c1 <= 3; c1++)
  8831. chatButtons[c1] = new Sprite(mediaArchive, "chatbuttons", c1);
  8832.  
  8833. for(int j3 = 0; j3 <= 13; j3++)
  8834. sideIcons[j3] = new Sprite(mediaArchive, "sideicons", j3);
  8835.  
  8836. for(int j3 = 0; j3 <= 13; j3++)
  8837. sIcons483[j3] = new Sprite("Gameframe/SIcons/483/"+j3+"");
  8838.  
  8839. for(int j3 = 0; j3 <= 12; j3++)
  8840. sIcons459[j3] = new Sprite("Gameframe/SIcons/459/SIDEICONS "+j3+"");
  8841.  
  8842. for(int nSI = 0; nSI <= 15; nSI++)
  8843. newSideIcons[nSI] = new Sprite("Gameframe/SIcons/562/icon "+nSI);
  8844.  
  8845. tabHover = new Sprite("Gameframe/SIcons/562/tabhover");
  8846. tabClicked = new Sprite("Gameframe/SIcons/562/tabclicked1");
  8847.  
  8848. for(int r1 = 0; r1 < 15; r1++)
  8849. redStones[r1] = new Sprite("redstones " + r1);
  8850. mapEdge = new Sprite(mediaArchive, "mapedge", 0);
  8851. mapEdge.method345();
  8852. try
  8853. {
  8854. for(int k3 = 0; k3 < 100; k3++)
  8855. mapScenes[k3] = new Background(mediaArchive, "mapscene", k3);
  8856. }
  8857. catch(Exception _ex) { }
  8858. try
  8859. {
  8860. for(int l3 = 0; l3 < 100; l3++)
  8861. mapFunctions[l3] = new Sprite(mediaArchive, "mapfunction", l3);
  8862. }
  8863. catch(Exception _ex) { }
  8864. try
  8865. {
  8866. for(int i4 = 0; i4 < 20; i4++)
  8867. hitMarks[i4] = new Sprite(mediaArchive, "hitmarks", i4);
  8868. }
  8869. catch(Exception _ex) { }
  8870. try
  8871. {
  8872. for(int h1 = 0; h1 < 6; h1++)
  8873. headIconsHint[h1] = new Sprite(mediaArchive, "headicons_hint", h1);
  8874. } catch(Exception _ex) { }
  8875. try {
  8876. for(int j4 = 0; j4 < 8; j4++)
  8877. headIcons[j4] = new Sprite(mediaArchive, "headicons_prayer", j4);
  8878. for(int idx = 0; idx < 18; idx++)
  8879. headIcons[idx] = new Sprite("Player/Prayer/Prayer "+idx);
  8880. for(int j45 = 0; j45 < 3; j45++)
  8881. skullIcons[j45] = new Sprite(mediaArchive, "headicons_pk", j45 );
  8882. }
  8883. catch(Exception _ex) { }
  8884. mapFlag = new Sprite(mediaArchive, "mapmarker", 0);
  8885. mapMarker = new Sprite(mediaArchive, "mapmarker", 1);
  8886. for(int k4 = 0; k4 < 8; k4++)
  8887. crosses[k4] = new Sprite(mediaArchive, "cross", k4);
  8888.  
  8889. mapDotItem = new Sprite(mediaArchive, "mapdots", 0);
  8890. mapDotNPC = new Sprite(mediaArchive, "mapdots", 1);
  8891. mapDotPlayer = new Sprite(mediaArchive, "mapdots", 2);
  8892. mapDotFriend = new Sprite(mediaArchive, "mapdots", 3);
  8893. mapDotTeam = new Sprite(mediaArchive, "mapdots", 4);
  8894. mapDotClan = new Sprite(mediaArchive, "mapdots", 5);
  8895.  
  8896. scrollBar1 = new Sprite(mediaArchive, "scrollbar", 0);
  8897. scrollBar2 = new Sprite(mediaArchive, "scrollbar", 1);
  8898. alertBack = new Sprite("alertback");
  8899. alertBorder = new Sprite("alertborder");
  8900. alertBorderH = new Sprite("alertborderh");
  8901. scrollBar3 = new Sprite("Gameframe/SCROLLBAR 0");
  8902. scrollBar4 = new Sprite("Gameframe/SCROLLBAR 1");
  8903.  
  8904. Sprite sprite = new Sprite(mediaArchive, "screenframe", 0);
  8905. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8906. sprite.method346(0, 0);
  8907. sprite = new Sprite(mediaArchive, "screenframe", 1);
  8908. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8909. sprite.method346(0, 0);
  8910. sprite = new Sprite(mediaArchive, "screenframe", 2);
  8911. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8912. sprite.method346(0, 0);
  8913. sprite = new Sprite(mediaArchive, "mapedge", 0);
  8914. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8915. sprite.method346(0, 0);
  8916.  
  8917. int i5 = (int)(Math.random() * 21D) - 10;
  8918. int j5 = (int)(Math.random() * 21D) - 10;
  8919. int k5 = (int)(Math.random() * 21D) - 10;
  8920. int l5 = (int)(Math.random() * 41D) - 20;
  8921. for(int i6 = 0; i6 < 100; i6++)
  8922. {
  8923. if(mapFunctions[i6] != null)
  8924. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8925. if(mapScenes[i6] != null)
  8926. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8927. }
  8928. drawLoadingText(83, "Unpacking textures");
  8929. Texture.method368(streamLoader_3);
  8930. Texture.method372(0.80000000000000004D);
  8931. Texture.method367();
  8932. drawLoadingText(86, "Unpacking config");
  8933. try {
  8934. Animation.unpackConfig(archive);
  8935. ObjectDef.unpackConfig(archive);
  8936. Flo.unpackConfig(archive);
  8937. ItemDef.unpackConfig(archive);
  8938. EntityDef.unpackConfig(archive);
  8939. IdentityKit.unpackConfig(archive);
  8940. SpotAnim.unpackConfig(archive);
  8941. Varp.unpackConfig(archive);
  8942. VarBit.unpackConfig(archive);
  8943. ItemDef.isMembers = true;
  8944. } catch(Exception e) {
  8945. e.printStackTrace();
  8946. }
  8947. drawLoadingText(95, "Unpacking interfaces");
  8948. RSFont aclass30_sub2_sub1_sub4s[] = {
  8949. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  8950. };
  8951. RSInterface.fonts = aclass30_sub2_sub1_sub4s;
  8952. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, mediaArchive);
  8953. drawLoadingText(100, "Preparing game engine");
  8954. for(int j6 = 0; j6 < 33; j6++)
  8955. {
  8956. int k6 = 999;
  8957. int i7 = 0;
  8958. for(int k7 = 0; k7 < 34; k7++)
  8959. {
  8960. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  8961. {
  8962. if(k6 == 999)
  8963. k6 = k7;
  8964. continue;
  8965. }
  8966. if(k6 == 999)
  8967. continue;
  8968. i7 = k7;
  8969. break;
  8970. }
  8971.  
  8972. anIntArray968[j6] = k6;
  8973. anIntArray1057[j6] = i7 - k6;
  8974. }
  8975. for (int l6 = 1; l6 < 153; l6++) {
  8976. int j7 = 999;
  8977. int l7 = 0;
  8978. for (int j8 = 24; j8 < 177; j8++) {
  8979. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  8980. if (j7 == 999) {
  8981. j7 = j8;
  8982. }
  8983. continue;
  8984. }
  8985. if (j7 == 999) {
  8986. continue;
  8987. }
  8988. l7 = j8;
  8989. break;
  8990. }
  8991.  
  8992. anIntArray1052[l6 - 1] = j7 - 24;
  8993. anIntArray1229[l6 - 1] = l7 - j7;
  8994. }
  8995. Texture.method365(765, 503);
  8996. fullScreenTextureArray = Texture.anIntArray1472;
  8997. Texture.method365(516, 165);//519
  8998. anIntArray1180 = Texture.anIntArray1472;
  8999. Texture.method365(250, 335);
  9000. anIntArray1181 = Texture.anIntArray1472;
  9001. Texture.method365(512, 334);//512 334
  9002. anIntArray1182 = Texture.anIntArray1472;
  9003.  
  9004. int ai[] = new int[9];
  9005. for(int i8 = 0; i8 < 9; i8++)
  9006. {
  9007. int k8 = 128 + i8 * 32 + 15;
  9008. int l8 = 600 + k8 * 3;
  9009. int i9 = Texture.anIntArray1470[k8];
  9010. ai[i8] = l8 * i9 >> 16;
  9011. }
  9012.  
  9013. WorldController.method310(500, 800, 512, 334, ai);
  9014.  
  9015. Censor.loadConfig(streamLoader_4);
  9016. mouseDetection = new MouseDetection(this);
  9017. startRunnable(mouseDetection, 10);
  9018. Animable_Sub5.clientInstance = this;
  9019. ObjectDef.clientInstance = this;
  9020. EntityDef.clientInstance = this;
  9021. return;
  9022. }
  9023. catch(Exception exception)
  9024. {
  9025. exception.printStackTrace();
  9026. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  9027. }
  9028. loadingError = true;
  9029. }
  9030.  
  9031. private void method91(Stream stream, int i)
  9032. {
  9033. while(stream.bitPosition + 10 < i * 8)
  9034. {
  9035. int j = stream.readBits(11);
  9036. if(j == 2047)
  9037. break;
  9038. if(playerArray[j] == null)
  9039. {
  9040. playerArray[j] = new Player();
  9041. if(aStreamArray895s[j] != null)
  9042. playerArray[j].updatePlayer(aStreamArray895s[j]);
  9043. }
  9044. playerIndices[playerCount++] = j;
  9045. Player player = playerArray[j];
  9046. player.anInt1537 = loopCycle;
  9047. int k = stream.readBits(1);
  9048. if(k == 1)
  9049. anIntArray894[anInt893++] = j;
  9050. int l = stream.readBits(1);
  9051. int i1 = stream.readBits(5);
  9052. if(i1 > 15)
  9053. i1 -= 32;
  9054. int j1 = stream.readBits(5);
  9055. if(j1 > 15)
  9056. j1 -= 32;
  9057. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  9058. }
  9059. stream.finishBitAccess();
  9060. }
  9061.  
  9062. private void processMainScreenClick() {
  9063. if(anInt1021 != 0)
  9064. return;
  9065. if(super.clickMode3 == 1) {
  9066. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  9067. int i = super.saveClickX - 25 - 530;//
  9068. int j = super.saveClickY - 8;
  9069. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  9070. i -= 73;
  9071. j -= 75;
  9072. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9073. int i1 = Texture.anIntArray1470[k];
  9074. int j1 = Texture.anIntArray1471[k];
  9075. i1 = i1 * (minimapInt3 + 256) >> 8;
  9076. j1 = j1 * (minimapInt3 + 256) >> 8;
  9077. int k1 = j * i1 + i * j1 >> 11;
  9078. int l1 = j * j1 - i * i1 >> 11;
  9079. int i2 = myPlayer.x + k1 >> 7;
  9080. int j2 = myPlayer.y - l1 >> 7;
  9081. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9082. if(flag1) {
  9083. stream.writeWordBigEndian(i);
  9084. stream.writeWordBigEndian(j);
  9085. stream.writeWord(minimapInt1);
  9086. stream.writeWordBigEndian(57);
  9087. stream.writeWordBigEndian(minimapInt2);
  9088. stream.writeWordBigEndian(minimapInt3);
  9089. stream.writeWordBigEndian(89);
  9090. stream.writeWord(myPlayer.x);
  9091. stream.writeWord(myPlayer.y);
  9092. stream.writeWordBigEndian(anInt1264);
  9093. stream.writeWordBigEndian(63);
  9094. }
  9095. }
  9096. } else {
  9097. int i = super.saveClickX - 25 - 545;//545
  9098. int j = super.saveClickY - 5 - 4;
  9099. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  9100. i -= 73;
  9101. j -= 75;
  9102. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9103. int i1 = Texture.anIntArray1470[k];
  9104. int j1 = Texture.anIntArray1471[k];
  9105. i1 = i1 * (minimapInt3 + 256) >> 8;
  9106. j1 = j1 * (minimapInt3 + 256) >> 8;
  9107. int k1 = j * i1 + i * j1 >> 11;
  9108. int l1 = j * j1 - i * i1 >> 11;
  9109. int i2 = myPlayer.x + k1 >> 7;
  9110. int j2 = myPlayer.y - l1 >> 7;
  9111. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9112. if(flag1) {
  9113. stream.writeWordBigEndian(i);
  9114. stream.writeWordBigEndian(j);
  9115. stream.writeWord(minimapInt1);
  9116. stream.writeWordBigEndian(57);
  9117. stream.writeWordBigEndian(minimapInt2);
  9118. stream.writeWordBigEndian(minimapInt3);
  9119. stream.writeWordBigEndian(89);
  9120. stream.writeWord(myPlayer.x);
  9121. stream.writeWord(myPlayer.y);
  9122. stream.writeWordBigEndian(anInt1264);
  9123. stream.writeWordBigEndian(63);
  9124. }
  9125. }
  9126. }
  9127. anInt1117++;
  9128. if(anInt1117 > 1151) {
  9129. anInt1117 = 0;
  9130. stream.createFrame(246);
  9131. stream.writeWordBigEndian(0);
  9132. int l = stream.currentOffset;
  9133. if((int)(Math.random() * 2D) == 0)
  9134. stream.writeWordBigEndian(101);
  9135. stream.writeWordBigEndian(197);
  9136. stream.writeWord((int)(Math.random() * 65536D));
  9137. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9138. stream.writeWordBigEndian(67);
  9139. stream.writeWord(14214);
  9140. if((int)(Math.random() * 2D) == 0)
  9141. stream.writeWord(29487);
  9142. stream.writeWord((int)(Math.random() * 65536D));
  9143. if((int)(Math.random() * 2D) == 0)
  9144. stream.writeWordBigEndian(220);
  9145. stream.writeWordBigEndian(180);
  9146. stream.writeBytes(stream.currentOffset - l);
  9147. }
  9148. }
  9149. }
  9150.  
  9151. private String interfaceIntToString(int j) {
  9152. if(j < 0x3b9ac9ff)
  9153. return String.valueOf(j);
  9154. else
  9155. return "*";
  9156. }
  9157.  
  9158. private void showErrorScreen()
  9159. {
  9160. Graphics g = getGameComponent().getGraphics();
  9161. g.setColor(Color.black);
  9162. g.fillRect(0, 0, 765, 503);
  9163. method4(1);
  9164. if(loadingError)
  9165. {
  9166. aBoolean831 = false;
  9167. g.setFont(new Font("Helvetica", 1, 16));
  9168. g.setColor(Color.yellow);
  9169. int k = 35;
  9170. g.drawString("Sorry, an error has occured whilst loading ErasedPkz.", 30, k);
  9171. k += 50;
  9172. g.setColor(Color.white);
  9173. g.drawString("To fix this try the following (in order):", 30, k);
  9174. k += 50;
  9175. g.setColor(Color.white);
  9176. g.setFont(new Font("Helvetica", 1, 12));
  9177. g.drawString("1: Try closing and reopening the client and/or web browser", 30, k);
  9178. k += 30;
  9179. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  9180. k += 30;
  9181. g.drawString("3: Try rebooting your computer", 30, k);
  9182. k += 30;
  9183. g.drawString(" ", 30, k);
  9184. k += 30;
  9185. g.drawString("If problems still occur, visit the forums at http://erased-pkz.comyr.com/ and request help", 30, k);
  9186. }
  9187. if(genericLoadingError)
  9188. {
  9189. aBoolean831 = false;
  9190. g.setFont(new Font("Helvetica", 1, 20));
  9191. g.setColor(Color.white);
  9192. g.drawString("Error - unable to load game!", 50, 50);
  9193. g.drawString("To play ErasedPkz make sure you play from", 50, 100);
  9194. g.drawString("http://www.erased-pkz.comyr.com/", 50, 150);
  9195. }
  9196. if(rsAlreadyLoaded)
  9197. {
  9198. aBoolean831 = false;
  9199. g.setColor(Color.yellow);
  9200. int l = 35;
  9201. g.drawString("Error a copy of ErasedPKz already appears to be loaded", 30, l);
  9202. l += 50;
  9203. g.setColor(Color.white);
  9204. g.drawString("To fix this try the following (in order):", 30, l);
  9205. l += 50;
  9206. g.setColor(Color.white);
  9207. g.setFont(new Font("Helvetica", 1, 12));
  9208. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  9209. l += 30;
  9210. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  9211. l += 30;
  9212. }
  9213. }
  9214.  
  9215. public URL getCodeBase() {
  9216.  
  9217.  
  9218. try {
  9219. return new URL(server +":" + (80 + portOff));
  9220. } catch(Exception _ex) {
  9221. }
  9222. return null;
  9223. }
  9224.  
  9225. private void method95() {
  9226. for(int j = 0; j < npcCount; j++) {
  9227. int k = npcIndices[j];
  9228. NPC npc = npcArray[k];
  9229. if(npc != null)
  9230. method96(npc);
  9231. }
  9232. }
  9233.  
  9234. private void method96(Entity entity)
  9235. {
  9236. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  9237. {
  9238. entity.anim = -1;
  9239. entity.anInt1520 = -1;
  9240. entity.anInt1547 = 0;
  9241. entity.anInt1548 = 0;
  9242. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9243. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9244. entity.method446();
  9245. }
  9246. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  9247. {
  9248. entity.anim = -1;
  9249. entity.anInt1520 = -1;
  9250. entity.anInt1547 = 0;
  9251. entity.anInt1548 = 0;
  9252. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9253. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9254. entity.method446();
  9255. }
  9256. if(entity.anInt1547 > loopCycle)
  9257. method97(entity);
  9258. else
  9259. if(entity.anInt1548 >= loopCycle)
  9260. method98(entity);
  9261. else
  9262. method99(entity);
  9263. method100(entity);
  9264. method101(entity);
  9265. }
  9266.  
  9267. private void method97(Entity entity)
  9268. {
  9269. int i = entity.anInt1547 - loopCycle;
  9270. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9271. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9272. entity.x += (j - entity.x) / i;
  9273. entity.y += (k - entity.y) / i;
  9274. entity.anInt1503 = 0;
  9275. if(entity.anInt1549 == 0)
  9276. entity.turnDirection = 1024;
  9277. if(entity.anInt1549 == 1)
  9278. entity.turnDirection = 1536;
  9279. if(entity.anInt1549 == 2)
  9280. entity.turnDirection = 0;
  9281. if(entity.anInt1549 == 3)
  9282. entity.turnDirection = 512;
  9283. }
  9284.  
  9285. private void method98(Entity entity)
  9286. {
  9287. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  9288. {
  9289. int i = entity.anInt1548 - entity.anInt1547;
  9290. int j = loopCycle - entity.anInt1547;
  9291. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9292. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9293. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9294. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9295. entity.x = (k * (i - j) + i1 * j) / i;
  9296. entity.y = (l * (i - j) + j1 * j) / i;
  9297. }
  9298. entity.anInt1503 = 0;
  9299. if(entity.anInt1549 == 0)
  9300. entity.turnDirection = 1024;
  9301. if(entity.anInt1549 == 1)
  9302. entity.turnDirection = 1536;
  9303. if(entity.anInt1549 == 2)
  9304. entity.turnDirection = 0;
  9305. if(entity.anInt1549 == 3)
  9306. entity.turnDirection = 512;
  9307. entity.anInt1552 = entity.turnDirection;
  9308. }
  9309.  
  9310. private void method99(Entity entity)
  9311. {
  9312. entity.anInt1517 = entity.anInt1511;
  9313. if(entity.smallXYIndex == 0)
  9314. {
  9315. entity.anInt1503 = 0;
  9316. return;
  9317. }
  9318. if(entity.anim != -1 && entity.anInt1529 == 0)
  9319. {
  9320. Animation animation = Animation.anims[entity.anim];
  9321. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  9322. {
  9323. entity.anInt1503++;
  9324. return;
  9325. }
  9326. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  9327. {
  9328. entity.anInt1503++;
  9329. return;
  9330. }
  9331. }
  9332. int i = entity.x;
  9333. int j = entity.y;
  9334. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9335. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9336. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  9337. {
  9338. entity.x = k;
  9339. entity.y = l;
  9340. return;
  9341. }
  9342. if(i < k)
  9343. {
  9344. if(j < l)
  9345. entity.turnDirection = 1280;
  9346. else
  9347. if(j > l)
  9348. entity.turnDirection = 1792;
  9349. else
  9350. entity.turnDirection = 1536;
  9351. } else
  9352. if(i > k)
  9353. {
  9354. if(j < l)
  9355. entity.turnDirection = 768;
  9356. else
  9357. if(j > l)
  9358. entity.turnDirection = 256;
  9359. else
  9360. entity.turnDirection = 512;
  9361. } else
  9362. if(j < l)
  9363. entity.turnDirection = 1024;
  9364. else
  9365. entity.turnDirection = 0;
  9366. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9367. if(i1 > 1024)
  9368. i1 -= 2048;
  9369. int j1 = entity.anInt1555;
  9370. if(i1 >= -256 && i1 <= 256)
  9371. j1 = entity.anInt1554;
  9372. else
  9373. if(i1 >= 256 && i1 < 768)
  9374. j1 = entity.anInt1557;
  9375. else
  9376. if(i1 >= -768 && i1 <= -256)
  9377. j1 = entity.anInt1556;
  9378. if(j1 == -1)
  9379. j1 = entity.anInt1554;
  9380. entity.anInt1517 = j1;
  9381. int k1 = 4;
  9382. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9383. k1 = 2;
  9384. if(entity.smallXYIndex > 2)
  9385. k1 = 6;
  9386. if(entity.smallXYIndex > 3)
  9387. k1 = 8;
  9388. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  9389. {
  9390. k1 = 8;
  9391. entity.anInt1503--;
  9392. }
  9393. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9394. k1 <<= 1;
  9395. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  9396. entity.anInt1517 = entity.anInt1505;
  9397. if(i < k)
  9398. {
  9399. entity.x += k1;
  9400. if(entity.x > k)
  9401. entity.x = k;
  9402. } else
  9403. if(i > k)
  9404. {
  9405. entity.x -= k1;
  9406. if(entity.x < k)
  9407. entity.x = k;
  9408. }
  9409. if(j < l)
  9410. {
  9411. entity.y += k1;
  9412. if(entity.y > l)
  9413. entity.y = l;
  9414. } else
  9415. if(j > l)
  9416. {
  9417. entity.y -= k1;
  9418. if(entity.y < l)
  9419. entity.y = l;
  9420. }
  9421. if(entity.x == k && entity.y == l)
  9422. {
  9423. entity.smallXYIndex--;
  9424. if(entity.anInt1542 > 0)
  9425. entity.anInt1542--;
  9426. }
  9427. }
  9428.  
  9429. private void method100(Entity entity)
  9430. {
  9431. if(entity.anInt1504 == 0)
  9432. return;
  9433. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  9434. {
  9435. NPC npc = npcArray[entity.interactingEntity];
  9436. if(npc != null)
  9437. {
  9438. int i1 = entity.x - npc.x;
  9439. int k1 = entity.y - npc.y;
  9440. if(i1 != 0 || k1 != 0)
  9441. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9442. }
  9443. }
  9444. if(entity.interactingEntity >= 32768)
  9445. {
  9446. int j = entity.interactingEntity - 32768;
  9447. if(j == unknownInt10)
  9448. j = myPlayerIndex;
  9449. Player player = playerArray[j];
  9450. if(player != null)
  9451. {
  9452. int l1 = entity.x - player.x;
  9453. int i2 = entity.y - player.y;
  9454. if(l1 != 0 || i2 != 0)
  9455. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9456. }
  9457. }
  9458. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  9459. {
  9460. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9461. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9462. if(k != 0 || j1 != 0)
  9463. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9464. entity.anInt1538 = 0;
  9465. entity.anInt1539 = 0;
  9466. }
  9467. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9468. if(l != 0)
  9469. {
  9470. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9471. entity.anInt1552 = entity.turnDirection;
  9472. else
  9473. if(l > 1024)
  9474. entity.anInt1552 -= entity.anInt1504;
  9475. else
  9476. entity.anInt1552 += entity.anInt1504;
  9477. entity.anInt1552 &= 0x7ff;
  9478. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  9479. {
  9480. if(entity.anInt1512 != -1)
  9481. {
  9482. entity.anInt1517 = entity.anInt1512;
  9483. return;
  9484. }
  9485. entity.anInt1517 = entity.anInt1554;
  9486. }
  9487. }
  9488. }
  9489.  
  9490. private void method101(Entity entity)
  9491. {
  9492. entity.aBoolean1541 = false;
  9493. if(entity.anInt1517 != -1)
  9494. {
  9495. Animation animation = Animation.anims[entity.anInt1517];
  9496. entity.anInt1519++;
  9497. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  9498. {
  9499. entity.anInt1519 = 0;
  9500. entity.anInt1518++;
  9501. }
  9502. if(entity.anInt1518 >= animation.anInt352)
  9503. {
  9504. entity.anInt1519 = 0;
  9505. entity.anInt1518 = 0;
  9506. }
  9507. }
  9508. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  9509. {
  9510. if(entity.anInt1521 < 0)
  9511. entity.anInt1521 = 0;
  9512. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9513. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)//huhhhhh
  9514. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9515.  
  9516. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9517. entity.anInt1520 = -1;
  9518. }
  9519. if(entity.anim != -1 && entity.anInt1529 <= 1)
  9520. {
  9521. Animation animation_2 = Animation.anims[entity.anim];
  9522. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  9523. {
  9524. entity.anInt1529 = 1;
  9525. return;
  9526. }
  9527. }
  9528. if(entity.anim != -1 && entity.anInt1529 == 0)
  9529. {
  9530. Animation animation_3 = Animation.anims[entity.anim];
  9531. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  9532. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9533.  
  9534. if(entity.anInt1527 >= animation_3.anInt352)
  9535. {
  9536. entity.anInt1527 -= animation_3.anInt356;
  9537. entity.anInt1530++;
  9538. if(entity.anInt1530 >= animation_3.anInt362)
  9539. entity.anim = -1;
  9540. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  9541. entity.anim = -1;
  9542. }
  9543. entity.aBoolean1541 = animation_3.aBoolean358;
  9544. }
  9545. if(entity.anInt1529 > 0)
  9546. entity.anInt1529--;
  9547. }
  9548.  
  9549. private void drawGameScreen()
  9550. {
  9551. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  9552. if (loadingStage == 2) {
  9553. method119(anInt945, fullscreenInterfaceID);
  9554. if (openInterfaceID != -1) {
  9555. method119(anInt945, openInterfaceID);
  9556. }
  9557. anInt945 = 0;
  9558. resetAllImageProducers();
  9559. super.fullGameScreen.initDrawingArea();
  9560. Texture.anIntArray1472 = fullScreenTextureArray;
  9561. DrawingArea.setAllPixelsToZero();
  9562. welcomeScreenRaised = true;
  9563. if (openInterfaceID != -1) {
  9564. RSInterface class9_1 = RSInterface.interfaceCache[openInterfaceID];
  9565. if (class9_1.width == 512 && class9_1.height == 334 && class9_1.interfaceType == 0) {
  9566. class9_1.width = 765;
  9567. class9_1.height = 503;
  9568. }
  9569. drawInterface(0, 0, class9_1, 8);
  9570. }
  9571. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9572. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.interfaceType == 0) {
  9573. rsInterface.width = 765;
  9574. rsInterface.height = 503;
  9575. }
  9576. drawInterface(0, 0, rsInterface, 8);
  9577.  
  9578. if (!menuOpen) {
  9579. processRightClick();
  9580. drawTooltip();
  9581. } else {
  9582. drawMenu(0, 0);
  9583. }
  9584. }
  9585. drawCount++;
  9586. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9587. return;
  9588. } else {
  9589. if (drawCount != 0) {
  9590. resetImageProducers2();
  9591. }
  9592. }
  9593. if(welcomeScreenRaised) {
  9594. welcomeScreenRaised = false;
  9595. topFrame.drawGraphics(0, super.graphics, 0);
  9596. leftFrame.drawGraphics(4, super.graphics, 0);
  9597. //rightFrame.drawGraphics(4, super.graphics, 516);
  9598. //mapEdgeIP.drawGraphics(4, super.graphics, 516);//519
  9599. needDrawTabArea = true;
  9600. inputTaken = true;
  9601. tabAreaAltered = true;
  9602. aBoolean1233 = true;
  9603.  
  9604. if(loadingStage != 2) {
  9605. inGameScreen.drawGraphics(4, super.graphics, 4);
  9606. mapBackImage.drawGraphics(0, super.graphics, 516);//545
  9607.  
  9608. }
  9609. }
  9610. if(menuOpen)
  9611. needDrawTabArea = true;
  9612. if(menuOpen)
  9613. drawMenu(4,4);
  9614.  
  9615. if(invOverlayInterfaceID != -1)
  9616. {
  9617. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9618. if(flag1)
  9619. needDrawTabArea = true;
  9620. }
  9621. if(atInventoryInterfaceType == 2)
  9622. needDrawTabArea = true;
  9623. if(activeInterfaceType == 2)
  9624. needDrawTabArea = true;
  9625. drawTabArea();
  9626. if(loadingStage == 2) {
  9627. method146();
  9628. }
  9629. if(backDialogID == -1)
  9630. {
  9631. if(is474 || is480 || is508 || is525 || is562) {
  9632. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  9633. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  9634. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  9635. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  9636. if(i < 0)
  9637. i = 0;
  9638. if(i > anInt1211 - 110)
  9639. i = anInt1211 - 110;
  9640. if(anInt1089 != i) {
  9641. anInt1089 = i;
  9642. inputTaken = true;
  9643. }
  9644. } else {
  9645. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 77;
  9646. if(super.mouseX > 448 && super.mouseX < 560 && super.mouseY > 332)
  9647. method65(463, 77, super.mouseX - 17, super.mouseY - 357, aClass9_1059, 0, false, anInt1211);
  9648. int i = anInt1211 - 77 - aClass9_1059.scrollPosition;
  9649. if(i < 0)
  9650. i = 0;
  9651. if(i > anInt1211 - 77)
  9652. i = anInt1211 - 77;
  9653. if(anInt1089 != i) {
  9654. anInt1089 = i;
  9655. inputTaken = true;
  9656. }
  9657. }
  9658. }
  9659. if(backDialogID != -1) {
  9660. boolean flag2 = method119(anInt945, backDialogID);
  9661. if(flag2)
  9662. inputTaken = true;
  9663. }
  9664. if(atInventoryInterfaceType == 3)
  9665. inputTaken = true;
  9666. if(activeInterfaceType == 3)
  9667. inputTaken = true;
  9668. if(aString844 != null)
  9669. inputTaken = true;
  9670. if(menuOpen && menuScreenArea == 2)
  9671. inputTaken = true;
  9672. if(inputTaken) {
  9673. drawChatArea();
  9674. inputTaken = false;
  9675. }
  9676. if(loadingStage == 2) {
  9677. drawMinimap();
  9678. mapBackImage.drawGraphics(0, super.graphics, 516);//545
  9679. }
  9680. if(anInt1054 != -1)
  9681. tabAreaAltered = true;
  9682. if(tabAreaAltered)
  9683. {
  9684. if(anInt1054 != -1 && anInt1054 == tabID)
  9685. {
  9686. anInt1054 = -1;
  9687. stream.createFrame(120);
  9688. stream.writeWordBigEndian(tabID);
  9689. }
  9690. tabAreaAltered = false;
  9691. aRSImageProducer_1125.initDrawingArea();
  9692. inGameScreen.initDrawingArea();
  9693. }
  9694. if(menuOpen){
  9695. drawMenu(516, 466);
  9696. }
  9697. anInt945 = 0;
  9698. }
  9699.  
  9700. private boolean buildFriendsListMenu(RSInterface class9)
  9701. {
  9702. int i = class9.contentType;
  9703. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  9704. {
  9705. if(i >= 801)
  9706. i -= 701;
  9707. else
  9708. if(i >= 701)
  9709. i -= 601;
  9710. else
  9711. if(i >= 101)
  9712. i -= 101;
  9713. else
  9714. i--;
  9715. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9716. menuActionID[menuActionRow] = 792;
  9717. menuActionRow++;
  9718. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9719. menuActionID[menuActionRow] = 639;
  9720. menuActionRow++;
  9721. return true;
  9722. }
  9723. if(i >= 401 && i <= 500)
  9724. {
  9725. menuActionName[menuActionRow] = "Remove @whi@" + class9.disabledMessage;
  9726. menuActionID[menuActionRow] = 322;
  9727. menuActionRow++;
  9728. return true;
  9729. } else
  9730. {
  9731. return false;
  9732. }
  9733. }
  9734.  
  9735. private void method104()
  9736. {
  9737. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  9738. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  9739. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  9740. class30_sub2_sub4_sub3.unlink();
  9741. else
  9742. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  9743. {
  9744. class30_sub2_sub4_sub3.method454(anInt945);
  9745. if(class30_sub2_sub4_sub3.aBoolean1567)
  9746. class30_sub2_sub4_sub3.unlink();
  9747. else
  9748. 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);
  9749. }
  9750.  
  9751. }
  9752.  
  9753. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9754. if(class9.interfaceType != 0 || class9.children == null)
  9755. return;
  9756. if(class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  9757. return;
  9758. int i1 = DrawingArea.topX;
  9759. int j1 = DrawingArea.topY;
  9760. int k1 = DrawingArea.bottomX;
  9761. int l1 = DrawingArea.bottomY;
  9762. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9763. int i2 = class9.children.length;
  9764. for(int j2 = 0; j2 < i2; j2++) {
  9765. int k2 = class9.childX[j2] + k;
  9766. int l2 = (class9.childY[j2] + l) - j;
  9767. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9768. k2 += class9_1.xOffset;
  9769. l2 += class9_1.yOffset;
  9770. if(class9_1.contentType > 0)
  9771. drawFriendsListOrWelcomeScreen(class9_1);
  9772. //here
  9773. int[] IDs = {
  9774. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  9775. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  9776. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  9777. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  9778. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  9779. /* Ancients */
  9780. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  9781. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9782. };
  9783. for(int m5 = 0; m5 < IDs.length; m5++) {
  9784. if(class9_1.id == IDs[m5] + 1) {
  9785. if(m5 > 61)
  9786. drawBlackBox(k2 + 1, l2);
  9787. else
  9788. drawBlackBox(k2, l2 + 1);
  9789. }
  9790. }
  9791. int[] runeChildren = {
  9792. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  9793. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  9794. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  9795. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  9796. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  9797. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  9798. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  9799. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  9800. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  9801. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  9802. 15885, 18474, 18475, 18478
  9803. };
  9804. for(int r = 0; r < runeChildren.length; r++)
  9805. if(class9_1.id == runeChildren[r])
  9806. class9_1.modelZoom = 775;
  9807.  
  9808.  
  9809. if(class9_1.interfaceType == 0) {
  9810. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  9811. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  9812. if(class9_1.scrollPosition < 0)
  9813. class9_1.scrollPosition = 0;
  9814. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9815. if(class9_1.scrollMax > class9_1.height)
  9816. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  9817. } else if(class9_1.interfaceType != 1)
  9818. if(class9_1.interfaceType == 2) {
  9819. int i3 = 0;
  9820. for(int l3 = 0; l3 < class9_1.height; l3++) {
  9821. for(int l4 = 0; l4 < class9_1.width; l4++) {
  9822. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9823. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9824. if(i3 < 20) {
  9825. k5 += class9_1.spritesX[i3];
  9826. j6 += class9_1.spritesY[i3];
  9827. }
  9828. if(class9_1.inventory[i3] > 0) {
  9829. int k6 = 0;
  9830. int j7 = 0;
  9831. int j9 = class9_1.inventory[i3] - 1;
  9832. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  9833. int l9 = 0;
  9834. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  9835. l9 = 0xffffff;
  9836. Sprite Sprite_2 = ItemDef.getSprite(j9, class9_1.inventoryValue[i3], l9);
  9837. if(Sprite_2 != null) {
  9838. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  9839. k6 = super.mouseX - anInt1087;
  9840. j7 = super.mouseY - anInt1088;
  9841. if(k6 < 5 && k6 > -5)
  9842. k6 = 0;
  9843. if(j7 < 5 && j7 > -5)
  9844. j7 = 0;
  9845. if(anInt989 < 5) {
  9846. k6 = 0;
  9847. j7 = 0;
  9848. }
  9849. Sprite_2.drawSprite1(k5 + k6, j6 + j7);
  9850. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  9851. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9852. if(i10 > anInt945 * 10)
  9853. i10 = anInt945 * 10;
  9854. if(i10 > class9.scrollPosition)
  9855. i10 = class9.scrollPosition;
  9856. class9.scrollPosition -= i10;
  9857. anInt1088 += i10;
  9858. }
  9859. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9860. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9861. if(j10 > anInt945 * 10)
  9862. j10 = anInt945 * 10;
  9863. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9864. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9865. class9.scrollPosition += j10;
  9866. anInt1088 -= j10;
  9867. }
  9868. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9869. Sprite_2.drawSprite1(k5, j6);
  9870. else
  9871. Sprite_2.drawSprite(k5, j6);
  9872. if(Sprite_2.maxWidth == 33 || class9_1.inventoryValue[i3] != 1)
  9873. {
  9874. int k10 = class9_1.inventoryValue[i3];
  9875. smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  9876. if(k10 >= 1)
  9877. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9878. if(k10 >= 100000)
  9879. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9880. if(k10 >= 10000000)
  9881. smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9882. }
  9883. }
  9884. }
  9885. } else if(class9_1.sprites != null && i3 < 20) {
  9886. Sprite Sprite_1 = class9_1.sprites[i3];
  9887. if(Sprite_1 != null)
  9888. Sprite_1.drawSprite(k5, j6);
  9889. }
  9890. i3++;
  9891. }
  9892. }
  9893. } else if(class9_1.interfaceType == 3) {
  9894. boolean flag = false;
  9895. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9896. flag = true;
  9897. int j3;
  9898. if(interfaceIsSelected(class9_1)) {
  9899. j3 = class9_1.enabledColor;
  9900. if(flag && class9_1.enabledHoverColor != 0)
  9901. j3 = class9_1.enabledHoverColor;
  9902. } else {
  9903. j3 = class9_1.disabledColor;
  9904. if(flag && class9_1.disabledHoverColor != 0)
  9905. j3 = class9_1.disabledHoverColor;
  9906. }
  9907. if(class9_1.opacity == 0) {
  9908. if(class9_1.boxFilled)
  9909. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  9910. else
  9911. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  9912. } else if(class9_1.boxFilled)
  9913. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.opacity & 0xff), k2);
  9914. else
  9915. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.opacity & 0xff), j3, class9_1.width, k2);
  9916. } else if(class9_1.interfaceType == 4) {
  9917. RSFont textDrawingArea = class9_1.rsFonts;
  9918. String s = class9_1.disabledMessage;
  9919. boolean flag1 = false;
  9920. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9921. flag1 = true;
  9922. int i4;
  9923. if(interfaceIsSelected(class9_1)) {
  9924. i4 = class9_1.enabledColor;
  9925. if(flag1 && class9_1.enabledHoverColor != 0)
  9926. i4 = class9_1.enabledHoverColor;
  9927. if(class9_1.enabledMessage.length() > 0)
  9928. s = class9_1.enabledMessage;
  9929. } else {
  9930. i4 = class9_1.disabledColor;
  9931. if(flag1 && class9_1.disabledHoverColor != 0)
  9932. i4 = class9_1.disabledHoverColor;
  9933. }
  9934. if(class9_1.atActionType == 6 && aBoolean1149) {
  9935. s = "Please wait...";
  9936. i4 = class9_1.disabledColor;
  9937. }
  9938. if(DrawingArea.width == 516) {//519
  9939. if(i4 == 0xffff00)
  9940. i4 = 255;
  9941. if(i4 == 49152)
  9942. i4 = 0xffffff;
  9943. }
  9944. //Magic interface
  9945. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9946. switch (i4) {
  9947. case 16773120: i4 = 0xFE981F; break;
  9948. case 7040819: i4 = 0xAF6A1A; break;
  9949. }
  9950. }
  9951. //Skill interface
  9952. int id = 4004; int id2 = 4005;
  9953. if(class9_1.parentID == 3917 && class9_1.id != id && class9_1.id != id+2 && class9_1.id != id+4 && class9_1.id != id+6
  9954. && 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
  9955. && 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
  9956. && class9_1.id != id+28 && class9_1.id != id+30 && class9_1.id != id+32 && class9_1.id != id+34 && class9_1.id != 13926
  9957. && 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
  9958. && 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
  9959. && 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
  9960. && class9_1.id != id2+28 && class9_1.id != id2+30 && class9_1.id != id2+32 && class9_1.id != id2+34 && class9_1.id != 13927
  9961. && class9_1.id != 4153 && class9_1.id != 12167 && class9_1.id != 4026) {
  9962. if(i4 == 16776960)
  9963. i4 = 0x0000;
  9964. class9_1.textShadowed = false;
  9965. }
  9966. /*if(class9_1.parentID == 3917) {
  9967. for(int i = 4004; i < 4040; i++) {
  9968. int[] moreData = {
  9969. 13926, 4152, 12166, 13927,
  9970. 4153, 12167, 4026
  9971. };
  9972. if(class9_1.id == i || class9_1.id == moreData[i]) {
  9973. return;
  9974. }
  9975. if(i4 == 16776960) {
  9976. i4 = 0x0000;
  9977. class9_1.textShadowed = false;
  9978. }
  9979. }
  9980. }*/
  9981. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  9982. {
  9983. if(s.indexOf("%") != -1)
  9984. {
  9985. do
  9986. {
  9987. int k7 = s.indexOf("%1");
  9988. if(k7 == -1)
  9989. break;
  9990. 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)
  9991. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9992. else
  9993. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9994. } while(true);
  9995. do
  9996. {
  9997. int l7 = s.indexOf("%2");
  9998. if(l7 == -1)
  9999. break;
  10000. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  10001. } while(true);
  10002. do
  10003. {
  10004. int i8 = s.indexOf("%3");
  10005. if(i8 == -1)
  10006. break;
  10007. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  10008. } while(true);
  10009. do
  10010. {
  10011. int j8 = s.indexOf("%4");
  10012. if(j8 == -1)
  10013. break;
  10014. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  10015. } while(true);
  10016. do
  10017. {
  10018. int k8 = s.indexOf("%5");
  10019. if(k8 == -1)
  10020. break;
  10021. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  10022. } while(true);
  10023. }
  10024. int l8 = s.indexOf("\\n");
  10025. String s1;
  10026. if(l8 != -1)
  10027. {
  10028. s1 = s.substring(0, l8);
  10029. s = s.substring(l8 + 2);
  10030. } else
  10031. {
  10032. s1 = s;
  10033. s = "";
  10034. }
  10035. if(class9_1.textCentered)
  10036. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadowed);
  10037. else
  10038. textDrawingArea.method389(class9_1.textShadowed, k2, i4, s1, l6);
  10039. }
  10040. } else if(class9_1.interfaceType == 5) {
  10041. //whats this?
  10042.  
  10043. Sprite sprite;
  10044. if(interfaceIsSelected(class9_1))
  10045. sprite = class9_1.enabledSprite;
  10046. else
  10047. sprite = class9_1.disabledSprite;
  10048. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  10049. sprite.drawSprite2(k2, l2, 0xffffff);
  10050. } else {
  10051. if(Autocast && class9_1.id == autocastId)
  10052. magicAuto.drawSprite(k2-3, l2-3);
  10053. if (sprite != null)
  10054. sprite.drawSprite(k2, l2);
  10055. }
  10056. if(sprite != null)
  10057. sprite.drawSprite(k2, l2);
  10058. } else if(class9_1.interfaceType == 6) {
  10059. int k3 = Texture.textureInt1;
  10060. int j4 = Texture.textureInt2;
  10061. Texture.textureInt1 = k2 + class9_1.width / 2;
  10062. Texture.textureInt2 = l2 + class9_1.height / 2;
  10063. int i5 = Texture.anIntArray1470[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  10064. int l5 = Texture.anIntArray1471[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  10065. boolean flag2 = interfaceIsSelected(class9_1);
  10066. int i7;
  10067. if(flag2)
  10068. i7 = class9_1.enabledAnimation;
  10069. else
  10070. i7 = class9_1.disabledAnimation;
  10071. Model model;
  10072. if(i7 == -1) {
  10073. model = class9_1.method209(-1, -1, flag2);
  10074. } else {
  10075. Animation animation = Animation.anims[i7];
  10076. model = class9_1.method209(animation.anIntArray354[class9_1.animationLength], animation.anIntArray353[class9_1.animationLength], flag2);
  10077. }
  10078. if(model != null)
  10079. model.method482(class9_1.modelRotationX, 0, class9_1.modelRotationY, 0, i5, l5);
  10080. Texture.textureInt1 = k3;
  10081. Texture.textureInt2 = j4;
  10082. } else if(class9_1.interfaceType == 7) {
  10083. RSFont textDrawingArea_1 = class9_1.rsFonts;
  10084. int k4 = 0;
  10085. for(int j5 = 0; j5 < class9_1.height; j5++) {
  10086. for(int i6 = 0; i6 < class9_1.width; i6++) {
  10087. if(class9_1.inventory[k4] > 0) {
  10088. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k4] - 1);
  10089. String s2 = itemDef.name;
  10090. if(itemDef.stackable || class9_1.inventoryValue[k4] != 1)
  10091. s2 = s2 + " x" + intToKOrMilLongName(class9_1.inventoryValue[k4]);
  10092. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  10093. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  10094. if(class9_1.textCentered)
  10095. textDrawingArea_1.method382(class9_1.disabledColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadowed);
  10096. else
  10097. textDrawingArea_1.method389(class9_1.textShadowed, i9, class9_1.disabledColor, s2, k9);
  10098. }
  10099. k4++;
  10100. }
  10101. }
  10102. }
  10103. else if (class9_1.interfaceType == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 100) {
  10104. int boxWidth = 0;
  10105. int boxHeight = 0;
  10106. RSFont textDrawingArea_2 = aTextDrawingArea_1271;
  10107. for (String s1 = class9_1.disabledMessage; s1.length() > 0;) {
  10108. int l7 = s1.indexOf("\\n");
  10109. String s4;
  10110. if (l7 != -1) {
  10111. s4 = s1.substring(0, l7);
  10112. s1 = s1.substring(l7 + 2);
  10113. } else {
  10114. s4 = s1;
  10115. s1 = "";
  10116. }
  10117. int j10 = textDrawingArea_2.getTextWidth(s4);
  10118. if (j10 > boxWidth) {
  10119. boxWidth = j10;
  10120. }
  10121. boxHeight += textDrawingArea_2.anInt1497 + 1;
  10122. }
  10123. boxWidth += 6;
  10124. boxHeight += 7;
  10125. int xPos = (l2 + class9_1.width) - 5 - boxWidth;
  10126. int yPos = k2 + class9_1.height + 5;
  10127. if (xPos < l2 + 5) {
  10128. xPos = l2 + 5;
  10129. }
  10130. if (xPos + boxWidth > j + class9.width) {
  10131. xPos = (j + class9.width) - boxWidth;
  10132. }
  10133. if (yPos + boxHeight > k + class9.height) {
  10134. yPos = (k + class9.height) - boxHeight;
  10135. }
  10136. DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  10137. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  10138. String s2 = class9_1.disabledMessage;
  10139. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
  10140. int l11 = s2.indexOf("\\n");
  10141. String s5;
  10142. if (l11 != -1) {
  10143. s5 = s2.substring(0, l11);
  10144. s2 = s2.substring(l11 + 2);
  10145. } else {
  10146. s5 = s2;
  10147. s2 = "";
  10148. }
  10149. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  10150. }
  10151. } else if (class9_1.interfaceType == 9) {
  10152. drawHoverBox(k2, l2, class9_1.disabledMessage);
  10153. }
  10154. }
  10155. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10156. }
  10157.  
  10158. private void randomizeBackground(Background background) {
  10159. int j = 256;
  10160. for(int k = 0; k < anIntArray1190.length; k++)
  10161. anIntArray1190[k] = 0;
  10162.  
  10163. for(int l = 0; l < 5000; l++) {
  10164. int i1 = (int)(Math.random() * 128D * (double)j);
  10165. anIntArray1190[i1] = (int)(Math.random() * 256D);
  10166. }
  10167. for(int j1 = 0; j1 < 20; j1++) {
  10168. for(int k1 = 1; k1 < j - 1; k1++) {
  10169. for(int i2 = 1; i2 < 127; i2++) {
  10170. int k2 = i2 + (k1 << 7);
  10171. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10172. }
  10173.  
  10174. }
  10175. int ai[] = anIntArray1190;
  10176. anIntArray1190 = anIntArray1191;
  10177. anIntArray1191 = ai;
  10178. }
  10179. if(background != null) {
  10180. int l1 = 0;
  10181. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  10182. for(int l2 = 0; l2 < background.anInt1452; l2++)
  10183. if(background.aByteArray1450[l1++] != 0) {
  10184. int i3 = l2 + 16 + background.anInt1454;
  10185. int j3 = j2 + 16 + background.anInt1455;
  10186. int k3 = i3 + (j3 << 7);
  10187. anIntArray1190[k3] = 0;
  10188. }
  10189. }
  10190. }
  10191. }
  10192.  
  10193. private void method107(int i, int j, Stream stream, Player player)
  10194. {
  10195. if((i & 0x400) != 0)
  10196. {
  10197. player.anInt1543 = stream.method428();
  10198. player.anInt1545 = stream.method428();
  10199. player.anInt1544 = stream.method428();
  10200. player.anInt1546 = stream.method428();
  10201. player.anInt1547 = stream.method436() + loopCycle;
  10202. player.anInt1548 = stream.method435() + loopCycle;
  10203. player.anInt1549 = stream.method428();
  10204. player.method446();
  10205. }
  10206. if((i & 0x100) != 0)
  10207. {
  10208. player.anInt1520 = stream.method434();
  10209. int k = stream.readDWord();
  10210. player.anInt1524 = k >> 16;
  10211. player.anInt1523 = loopCycle + (k & 0xffff);
  10212. player.anInt1521 = 0;
  10213. player.anInt1522 = 0;
  10214. if(player.anInt1523 > loopCycle)
  10215. player.anInt1521 = -1;
  10216. if(player.anInt1520 == 65535)
  10217. player.anInt1520 = -1;
  10218. }
  10219. if((i & 8) != 0)
  10220. {
  10221. int l = stream.method434();
  10222. if(l == 65535)
  10223. l = -1;
  10224. int i2 = stream.method427();
  10225. if(l == player.anim && l != -1)
  10226. {
  10227. int i3 = Animation.anims[l].anInt365;
  10228. if(i3 == 1)
  10229. {
  10230. player.anInt1527 = 0;
  10231. player.anInt1528 = 0;
  10232. player.anInt1529 = i2;
  10233. player.anInt1530 = 0;
  10234. }
  10235. if(i3 == 2)
  10236. player.anInt1530 = 0;
  10237. } else
  10238. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  10239. {
  10240. player.anim = l;
  10241. player.anInt1527 = 0;
  10242. player.anInt1528 = 0;
  10243. player.anInt1529 = i2;
  10244. player.anInt1530 = 0;
  10245. player.anInt1542 = player.smallXYIndex;
  10246. }
  10247. }
  10248. if((i & 4) != 0)
  10249. {
  10250. player.textSpoken = stream.readString();
  10251. if(player.textSpoken.charAt(0) == '~')
  10252. {
  10253. player.textSpoken = player.textSpoken.substring(1);
  10254. pushMessage(player.textSpoken, 2, player.name);
  10255. } else
  10256. if(player == myPlayer)
  10257. pushMessage(player.textSpoken, 2, player.name);
  10258. player.anInt1513 = 0;
  10259. player.anInt1531 = 0;
  10260. player.textCycle = 150;
  10261. }
  10262. if((i & 0x80) != 0)
  10263. {
  10264. //right fucking here
  10265. int i1 = stream.method434();
  10266. int j2 = stream.readUnsignedByte();
  10267. int j3 = stream.method427();
  10268. int k3 = stream.currentOffset;
  10269. if(player.name != null && player.visible)
  10270. {
  10271. long l3 = TextClass.longForName(player.name);
  10272. boolean flag = false;
  10273. if(j2 <= 1)
  10274. {
  10275. for(int i4 = 0; i4 < ignoreCount; i4++)
  10276. {
  10277. if(ignoreListAsLongs[i4] != l3)
  10278. continue;
  10279. flag = true;
  10280. break;
  10281. }
  10282.  
  10283. }
  10284. if(!flag && anInt1251 == 0)
  10285. try
  10286. {
  10287. aStream_834.currentOffset = 0;
  10288. stream.method442(j3, 0, aStream_834.buffer);
  10289. aStream_834.currentOffset = 0;
  10290. String s = TextInput.method525(j3, aStream_834);
  10291. //s = Censor.doCensor(s);
  10292. player.textSpoken = s;
  10293. player.anInt1513 = i1 >> 8;
  10294. player.privelage = j2;
  10295. player.anInt1531 = i1 & 0xff;
  10296. player.textCycle = 150;
  10297. //Other players see your icon
  10298. if(j2 == 4)
  10299. pushMessage(s, 1, "@cr0@" + player.name);
  10300. else if(j2 == 3)
  10301. pushMessage(s, 1, "@cr2@" + player.name);
  10302. else if(j2 == 2)
  10303. pushMessage(s, 1, "@cr2@" + player.name);
  10304. else if (j2 == 1)
  10305. pushMessage(s, 1, "@cr1@" + player.name);
  10306. else
  10307. pushMessage(s, 2, player.name);
  10308. }
  10309. catch(Exception exception)
  10310. {
  10311. signlink.reporterror("cde2");
  10312. }
  10313. }
  10314. stream.currentOffset = k3 + j3;
  10315. }
  10316. if((i & 1) != 0)
  10317. {
  10318. player.interactingEntity = stream.method434();
  10319. if(player.interactingEntity == 65535)
  10320. player.interactingEntity = -1;
  10321. }
  10322. if((i & 0x10) != 0)
  10323. {
  10324. int j1 = stream.method427();
  10325. byte abyte0[] = new byte[j1];
  10326. Stream stream_1 = new Stream(abyte0);
  10327. stream.readBytes(j1, 0, abyte0);
  10328. aStreamArray895s[j] = stream_1;
  10329. player.updatePlayer(stream_1);
  10330. }
  10331. if((i & 2) != 0)
  10332. {
  10333. player.anInt1538 = stream.method436();
  10334. player.anInt1539 = stream.method434();
  10335. }
  10336. if((i & 0x20) != 0)
  10337. {
  10338. int k1 = stream.readUnsignedByte();
  10339. int k2 = stream.method426();
  10340. player.updateHitData(k2, k1, loopCycle);
  10341. player.loopCycleStatus = loopCycle + 300;
  10342. player.currentHealth = stream.method427();
  10343. player.maxHealth = stream.readUnsignedByte();
  10344. }
  10345. if((i & 0x200) != 0)
  10346. {
  10347. int l1 = stream.readUnsignedByte();
  10348. int l2 = stream.method428();
  10349. player.updateHitData(l2, l1, loopCycle);
  10350. player.loopCycleStatus = loopCycle + 300;
  10351. player.currentHealth = stream.readUnsignedByte();
  10352. player.maxHealth = stream.method427();
  10353. }
  10354. }
  10355.  
  10356. private void method108()
  10357. {
  10358. try
  10359. {
  10360. int j = myPlayer.x + anInt1278;
  10361. int k = myPlayer.y + anInt1131;
  10362. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  10363. {
  10364. anInt1014 = j;
  10365. anInt1015 = k;
  10366. }
  10367. if(anInt1014 != j)
  10368. anInt1014 += (j - anInt1014) / 16;
  10369. if(anInt1015 != k)
  10370. anInt1015 += (k - anInt1015) / 16;
  10371. if(super.keyArray[1] == 1)
  10372. anInt1186 += (-24 - anInt1186) / 2;
  10373. else
  10374. if(super.keyArray[2] == 1)
  10375. anInt1186 += (24 - anInt1186) / 2;
  10376. else
  10377. anInt1186 /= 2;
  10378. if(super.keyArray[3] == 1)
  10379. anInt1187 += (12 - anInt1187) / 2;
  10380. else
  10381. if(super.keyArray[4] == 1)
  10382. anInt1187 += (-12 - anInt1187) / 2;
  10383. else
  10384. anInt1187 /= 2;
  10385. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  10386. anInt1184 += anInt1187 / 2;
  10387. if(anInt1184 < 128)
  10388. anInt1184 = 128;
  10389. if(anInt1184 > 383)
  10390. anInt1184 = 383;
  10391. int l = anInt1014 >> 7;
  10392. int i1 = anInt1015 >> 7;
  10393. int j1 = method42(plane, anInt1015, anInt1014);
  10394. int k1 = 0;
  10395. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  10396. {
  10397. for(int l1 = l - 4; l1 <= l + 4; l1++)
  10398. {
  10399. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  10400. {
  10401. int l2 = plane;
  10402. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10403. l2++;
  10404. int i3 = j1 - intGroundArray[l2][l1][k2];
  10405. if(i3 > k1)
  10406. k1 = i3;
  10407. }
  10408.  
  10409. }
  10410.  
  10411. }
  10412. anInt1005++;
  10413. if(anInt1005 > 1512)
  10414. {
  10415. anInt1005 = 0;
  10416. stream.createFrame(77);
  10417. stream.writeWordBigEndian(0);
  10418. int i2 = stream.currentOffset;
  10419. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10420. stream.writeWordBigEndian(101);
  10421. stream.writeWordBigEndian(233);
  10422. stream.writeWord(45092);
  10423. if((int)(Math.random() * 2D) == 0)
  10424. stream.writeWord(35784);
  10425. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10426. stream.writeWordBigEndian(64);
  10427. stream.writeWordBigEndian(38);
  10428. stream.writeWord((int)(Math.random() * 65536D));
  10429. stream.writeWord((int)(Math.random() * 65536D));
  10430. stream.writeBytes(stream.currentOffset - i2);
  10431. }
  10432. int j2 = k1 * 192;
  10433. if(j2 > 0x17f00)
  10434. j2 = 0x17f00;
  10435. if(j2 < 32768)
  10436. j2 = 32768;
  10437. if(j2 > anInt984)
  10438. {
  10439. anInt984 += (j2 - anInt984) / 24;
  10440. return;
  10441. }
  10442. if(j2 < anInt984)
  10443. {
  10444. anInt984 += (j2 - anInt984) / 80;
  10445. }
  10446. }
  10447. catch(Exception _ex)
  10448. {
  10449. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  10450. throw new RuntimeException("eek");
  10451. }
  10452. }
  10453.  
  10454. public void processDrawing()
  10455. {
  10456. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  10457. {
  10458. showErrorScreen();
  10459. return;
  10460. }
  10461. anInt1061++;
  10462. if(!loggedIn) {
  10463. drawLoginScreen(false);
  10464. }else{
  10465. drawGameScreen();
  10466. }
  10467. anInt1213 = 0;
  10468. }
  10469.  
  10470. private boolean isFriendOrSelf(String s)
  10471. {
  10472. if(s == null)
  10473. return false;
  10474. for(int i = 0; i < friendsCount; i++)
  10475. if(s.equalsIgnoreCase(friendsList[i]))
  10476. return true;
  10477. return s.equalsIgnoreCase(myPlayer.name);
  10478. }
  10479.  
  10480. private static String combatDiffColor(int i, int j)
  10481. {
  10482. int k = i - j;
  10483. if(k < -9)
  10484. return "@red@";
  10485. if(k < -6)
  10486. return "@or3@";
  10487. if(k < -3)
  10488. return "@or2@";
  10489. if(k < 0)
  10490. return "@or1@";
  10491. if(k > 9)
  10492. return "@gre@";
  10493. if(k > 6)
  10494. return "@gr3@";
  10495. if(k > 3)
  10496. return "@gr2@";
  10497. if(k > 0)
  10498. return "@gr1@";
  10499. else
  10500. return "@yel@";
  10501. }
  10502.  
  10503. private void setWaveVolume(int i)
  10504. {
  10505. signlink.wavevol = i;
  10506. }
  10507.  
  10508. private void draw3dScreen()
  10509. {
  10510. alertHandler.processAlerts();
  10511. drawSplitPrivateChat();
  10512. if(crossType == 1)
  10513. {
  10514. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10515. anInt1142++;
  10516. if(anInt1142 > 67)
  10517. {
  10518. anInt1142 = 0;
  10519. stream.createFrame(78);
  10520. }
  10521. }
  10522. if(crossType == 2)
  10523. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10524. if(anInt1018 != -1)
  10525. {
  10526. method119(anInt945, anInt1018);
  10527. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  10528. }
  10529. if(openInterfaceID != -1)
  10530. {
  10531. method119(anInt945, openInterfaceID);
  10532. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  10533. }
  10534. method70();
  10535. if(!menuOpen)
  10536. {
  10537. processRightClick();
  10538. drawTooltip();
  10539. } else
  10540. drawMenu(4, 4);
  10541. if(anInt1055 == 1)
  10542. multiOverlay.drawSprite(472, 296);
  10543. if(fpsOn)
  10544. {
  10545. char c = '\u01FB';
  10546. int k = 20;
  10547. int i1 = 0xffff00;
  10548. if(super.fps < 15)
  10549. i1 = 0xff0000;
  10550. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  10551. k += 15;
  10552. Runtime runtime = Runtime.getRuntime();
  10553. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10554. i1 = 0xffff00;
  10555. if(j1 > 0x2000000 && lowMem)
  10556. i1 = 0xff0000;
  10557. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10558. k += 15;
  10559. }
  10560. int i1 = 0xffff00;
  10561. int x = baseX + (myPlayer.x - 6 >> 7);
  10562. int y = baseY + (myPlayer.y - 6 >> 7);
  10563. if (clientData)
  10564. {
  10565. char c = '\u01FB';
  10566. int k = 20;
  10567. if(super.fps < 15)
  10568. i1 = 0xff0000;
  10569. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  10570. Runtime runtime = Runtime.getRuntime();
  10571. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10572. i1 = 0xffff00;
  10573. if(j1 > 0x2000000 && lowMem)
  10574. i1 = 0xff0000;
  10575. k += 15;
  10576. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  10577. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  10578. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  10579. }
  10580. if(anInt1104 != 0)
  10581. {
  10582. int j = anInt1104 / 50;
  10583. int l = j / 60;
  10584. j %= 60;
  10585. if(j < 10)
  10586. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  10587. else
  10588. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  10589. anInt849++;
  10590. if(anInt849 > 75)
  10591. {
  10592. anInt849 = 0;
  10593. stream.createFrame(148);
  10594. }
  10595. }
  10596. }
  10597.  
  10598. private void addIgnore(long l)
  10599. {
  10600. try
  10601. {
  10602. if(l == 0L)
  10603. return;
  10604. if(ignoreCount >= 100)
  10605. {
  10606. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10607. return;
  10608. }
  10609. String s = TextClass.fixName(TextClass.nameForLong(l));
  10610. for(int j = 0; j < ignoreCount; j++)
  10611. if(ignoreListAsLongs[j] == l)
  10612. {
  10613. pushMessage(s + " is already on your ignore list", 0, "");
  10614. return;
  10615. }
  10616. for(int k = 0; k < friendsCount; k++)
  10617. if(friendsListAsLongs[k] == l)
  10618. {
  10619. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  10620. return;
  10621. }
  10622.  
  10623. ignoreListAsLongs[ignoreCount++] = l;
  10624. needDrawTabArea = true;
  10625. stream.createFrame(133);
  10626. stream.writeQWord(l);
  10627. return;
  10628. }
  10629. catch(RuntimeException runtimeexception)
  10630. {
  10631. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  10632. }
  10633. throw new RuntimeException();
  10634. }
  10635.  
  10636. private void method114()
  10637. {
  10638. for(int i = -1; i < playerCount; i++)
  10639. {
  10640. int j;
  10641. if(i == -1)
  10642. j = myPlayerIndex;
  10643. else
  10644. j = playerIndices[i];
  10645. Player player = playerArray[j];
  10646. if(player != null)
  10647. method96(player);
  10648. }
  10649.  
  10650. }
  10651.  
  10652. private void method115()
  10653. {
  10654. if(loadingStage == 2)
  10655. {
  10656. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10657. {
  10658. if(class30_sub1.anInt1294 > 0)
  10659. class30_sub1.anInt1294--;
  10660. if(class30_sub1.anInt1294 == 0)
  10661. {
  10662. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  10663. {
  10664. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  10665. class30_sub1.unlink();
  10666. }
  10667. } else
  10668. {
  10669. if(class30_sub1.anInt1302 > 0)
  10670. class30_sub1.anInt1302--;
  10671. 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)))
  10672. {
  10673. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  10674. class30_sub1.anInt1302 = -1;
  10675. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  10676. class30_sub1.unlink();
  10677. else
  10678. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10679. class30_sub1.unlink();
  10680. }
  10681. }
  10682. }
  10683.  
  10684. }
  10685. }
  10686.  
  10687.  
  10688. private void determineMenuSize() {
  10689. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10690. for(int j = 0; j < menuActionRow; j++)
  10691. {
  10692. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10693. if(k > i)
  10694. i = k;
  10695. }
  10696. i += 8;
  10697. int l = 15 * menuActionRow + 21;
  10698. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < 765 && super.saveClickY < 503) {
  10699. int i1 = super.saveClickX - i / 2;
  10700. if(i1 + i > 765){
  10701. i1 = 765 - i;
  10702. }
  10703. if(i1 < 0){
  10704. i1 = 0;
  10705. }
  10706. int l1 = super.saveClickY - 0;
  10707. if(l1 + l > 503){
  10708. l1 = 503 - l;
  10709. }
  10710. if(l1 < 0){
  10711. l1 = 0;
  10712. }
  10713. menuOpen = true;
  10714. menuOffsetX = i1;
  10715. menuOffsetY = l1;
  10716. menuWidth = i;
  10717. menuHeight = 15 * menuActionRow + 22;
  10718. }
  10719. }
  10720.  
  10721. private void method117(Stream stream)
  10722. {
  10723. stream.initBitAccess();
  10724. int j = stream.readBits(1);
  10725. if(j == 0)
  10726. return;
  10727. int k = stream.readBits(2);
  10728. if(k == 0)
  10729. {
  10730. anIntArray894[anInt893++] = myPlayerIndex;
  10731. return;
  10732. }
  10733. if(k == 1)
  10734. {
  10735. int l = stream.readBits(3);
  10736. myPlayer.moveInDir(false, l);
  10737. int k1 = stream.readBits(1);
  10738. if(k1 == 1)
  10739. anIntArray894[anInt893++] = myPlayerIndex;
  10740. return;
  10741. }
  10742. if(k == 2)
  10743. {
  10744. int i1 = stream.readBits(3);
  10745. myPlayer.moveInDir(true, i1);
  10746. int l1 = stream.readBits(3);
  10747. myPlayer.moveInDir(true, l1);
  10748. int j2 = stream.readBits(1);
  10749. if(j2 == 1)
  10750. anIntArray894[anInt893++] = myPlayerIndex;
  10751. return;
  10752. }
  10753. if(k == 3)
  10754. {
  10755. plane = stream.readBits(2);
  10756. int j1 = stream.readBits(1);
  10757. int i2 = stream.readBits(1);
  10758. if(i2 == 1)
  10759. anIntArray894[anInt893++] = myPlayerIndex;
  10760. int k2 = stream.readBits(7);
  10761. int l2 = stream.readBits(7);
  10762. myPlayer.setPos(l2, k2, j1 == 1);
  10763. }
  10764. }
  10765.  
  10766. private void nullLoader()
  10767. {
  10768. aBoolean831 = false;
  10769. while(drawingFlames)
  10770. {
  10771. aBoolean831 = false;
  10772. try
  10773. {
  10774. Thread.sleep(50L);
  10775. }
  10776. catch(Exception _ex) { }
  10777. }
  10778. titleBox = null;
  10779. titleBox1 = null;
  10780. titleButton = null;
  10781. aBackgroundArray1152s = null;
  10782. anIntArray850 = null;
  10783. anIntArray851 = null;
  10784. anIntArray852 = null;
  10785. anIntArray853 = null;
  10786. anIntArray1190 = null;
  10787. anIntArray1191 = null;
  10788. anIntArray828 = null;
  10789. anIntArray829 = null;
  10790. aSprite_1201 = null;
  10791. aSprite_1202 = null;
  10792. }
  10793.  
  10794. private boolean method119(int i, int j)
  10795. {
  10796. boolean flag1 = false;
  10797. RSInterface class9 = RSInterface.interfaceCache[j];
  10798. for(int k = 0; k < class9.children.length; k++)
  10799. {
  10800. if(class9.children[k] == -1)
  10801. break;
  10802. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10803. if(class9_1.interfaceType == 1)
  10804. flag1 |= method119(i, class9_1.id);
  10805. if(class9_1.interfaceType == 6 && (class9_1.disabledAnimation != -1 || class9_1.enabledAnimation != -1))
  10806. {
  10807. boolean flag2 = interfaceIsSelected(class9_1);
  10808. int l;
  10809. if(flag2)
  10810. l = class9_1.enabledAnimation;
  10811. else
  10812. l = class9_1.disabledAnimation;
  10813. if(l != -1)
  10814. {
  10815. Animation animation = Animation.anims[l];
  10816. for(class9_1.animationDelay += i; class9_1.animationDelay > animation.method258(class9_1.animationLength);)
  10817. {
  10818. class9_1.animationDelay -= animation.method258(class9_1.animationLength) + 1;
  10819. class9_1.animationLength++;
  10820. if(class9_1.animationLength >= animation.anInt352)
  10821. {
  10822. class9_1.animationLength -= animation.anInt356;
  10823. if(class9_1.animationLength < 0 || class9_1.animationLength >= animation.anInt352)
  10824. class9_1.animationLength = 0;
  10825. }
  10826. flag1 = true;
  10827. }
  10828.  
  10829. }
  10830. }
  10831. }
  10832.  
  10833. return flag1;
  10834. }
  10835.  
  10836. private int method120()
  10837. {
  10838. int j = 3;
  10839. if(yCameraCurve < 310)
  10840. {
  10841. int k = xCameraPos >> 7;
  10842. int l = yCameraPos >> 7;
  10843. int i1 = myPlayer.x >> 7;
  10844. int j1 = myPlayer.y >> 7;
  10845. if((byteGroundArray[plane][k][l] & 4) != 0)
  10846. j = plane;
  10847. int k1;
  10848. if(i1 > k)
  10849. k1 = i1 - k;
  10850. else
  10851. k1 = k - i1;
  10852. int l1;
  10853. if(j1 > l)
  10854. l1 = j1 - l;
  10855. else
  10856. l1 = l - j1;
  10857. if(k1 > l1)
  10858. {
  10859. int i2 = (l1 * 0x10000) / k1;
  10860. int k2 = 32768;
  10861. while(k != i1)
  10862. {
  10863. if(k < i1)
  10864. k++;
  10865. else
  10866. if(k > i1)
  10867. k--;
  10868. if((byteGroundArray[plane][k][l] & 4) != 0)
  10869. j = plane;
  10870. k2 += i2;
  10871. if(k2 >= 0x10000)
  10872. {
  10873. k2 -= 0x10000;
  10874. if(l < j1)
  10875. l++;
  10876. else
  10877. if(l > j1)
  10878. l--;
  10879. if((byteGroundArray[plane][k][l] & 4) != 0)
  10880. j = plane;
  10881. }
  10882. }
  10883. } else
  10884. {
  10885. int j2 = (k1 * 0x10000) / l1;
  10886. int l2 = 32768;
  10887. while(l != j1)
  10888. {
  10889. if(l < j1)
  10890. l++;
  10891. else
  10892. if(l > j1)
  10893. l--;
  10894. if((byteGroundArray[plane][k][l] & 4) != 0)
  10895. j = plane;
  10896. l2 += j2;
  10897. if(l2 >= 0x10000)
  10898. {
  10899. l2 -= 0x10000;
  10900. if(k < i1)
  10901. k++;
  10902. else
  10903. if(k > i1)
  10904. k--;
  10905. if((byteGroundArray[plane][k][l] & 4) != 0)
  10906. j = plane;
  10907. }
  10908. }
  10909. }
  10910. }
  10911. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10912. j = plane;
  10913. return j;
  10914. }
  10915.  
  10916. private int method121()
  10917. {
  10918. int j = method42(plane, yCameraPos, xCameraPos);
  10919. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10920. return plane;
  10921. else
  10922. return 3;
  10923. }
  10924.  
  10925. private void delIgnore(long l)
  10926. {
  10927. try
  10928. {
  10929. if(l == 0L)
  10930. return;
  10931. for(int j = 0; j < ignoreCount; j++)
  10932. if(ignoreListAsLongs[j] == l)
  10933. {
  10934. ignoreCount--;
  10935. needDrawTabArea = true;
  10936. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10937.  
  10938. stream.createFrame(74);
  10939. stream.writeQWord(l);
  10940. return;
  10941. }
  10942.  
  10943. return;
  10944. }
  10945. catch(RuntimeException runtimeexception)
  10946. {
  10947. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10948. }
  10949. throw new RuntimeException();
  10950. }
  10951.  
  10952.  
  10953. private void chatJoin(long l) {
  10954. try {
  10955. if(l == 0L)
  10956. return;
  10957. stream.createFrame(60);
  10958. stream.writeQWord(l);
  10959. return;
  10960. }
  10961. catch(RuntimeException runtimeexception)
  10962. {
  10963. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10964. }
  10965. throw new RuntimeException();
  10966.  
  10967. }
  10968.  
  10969. public String getParameter(String s)
  10970. {
  10971. if(signlink.mainapp != null)
  10972. return signlink.mainapp.getParameter(s);
  10973. else
  10974. return super.getParameter(s);
  10975. }
  10976.  
  10977. private void adjustVolume(boolean flag, int i)
  10978. {
  10979. signlink.midivol = i;
  10980. if(flag)
  10981. signlink.midi = "voladjust";
  10982. }
  10983.  
  10984. private int extractInterfaceValues(RSInterface class9, int j)
  10985. {
  10986. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10987. return -2;
  10988. try
  10989. {
  10990. int ai[] = class9.valueIndexArray[j];
  10991. int k = 0;
  10992. int l = 0;
  10993. int i1 = 0;
  10994. do
  10995. {
  10996. int j1 = ai[l++];
  10997. int k1 = 0;
  10998. byte byte0 = 0;
  10999. if(j1 == 0)
  11000. return k;
  11001. if(j1 == 1)
  11002. k1 = currentStats[ai[l++]];
  11003. if(j1 == 2)
  11004. k1 = maxStats[ai[l++]];
  11005. if(j1 == 3)
  11006. k1 = currentExp[ai[l++]];
  11007. if(j1 == 4)
  11008. {
  11009. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  11010. int k2 = ai[l++];
  11011. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  11012. {
  11013. for(int j3 = 0; j3 < class9_1.inventory.length; j3++)
  11014. if(class9_1.inventory[j3] == k2 + 1)
  11015. k1 += class9_1.inventoryValue[j3];
  11016.  
  11017. }
  11018. }
  11019. if(j1 == 5)
  11020. k1 = variousSettings[ai[l++]];
  11021. if(j1 == 6)
  11022. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  11023. if(j1 == 7)
  11024. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11025. if(j1 == 8)
  11026. k1 = myPlayer.combatLevel;
  11027. if(j1 == 9)
  11028. {
  11029. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  11030. if(Skills.skillEnabled[l1])
  11031. k1 += maxStats[l1];
  11032.  
  11033. }
  11034. if(j1 == 10)
  11035. {
  11036. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11037. int l2 = ai[l++] + 1;
  11038. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  11039. {
  11040. for(int k3 = 0; k3 < class9_2.inventory.length; k3++)
  11041. {
  11042. if(class9_2.inventory[k3] != l2)
  11043. continue;
  11044. k1 = 0x3b9ac9ff;
  11045. break;
  11046. }
  11047.  
  11048. }
  11049. }
  11050. if(j1 == 11)
  11051. k1 = energy;
  11052. if(j1 == 12)
  11053. k1 = weight;
  11054. if(j1 == 13)
  11055. {
  11056. int i2 = variousSettings[ai[l++]];
  11057. int i3 = ai[l++];
  11058. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11059. }
  11060. if(j1 == 14)
  11061. {
  11062. int j2 = ai[l++];
  11063. VarBit varBit = VarBit.cache[j2];
  11064. int l3 = varBit.anInt648;
  11065. int i4 = varBit.anInt649;
  11066. int j4 = varBit.anInt650;
  11067. int k4 = anIntArray1232[j4 - i4];
  11068. k1 = variousSettings[l3] >> i4 & k4;
  11069. }
  11070. if(j1 == 15)
  11071. byte0 = 1;
  11072. if(j1 == 16)
  11073. byte0 = 2;
  11074. if(j1 == 17)
  11075. byte0 = 3;
  11076. if(j1 == 18)
  11077. k1 = (myPlayer.x >> 7) + baseX;
  11078. if(j1 == 19)
  11079. k1 = (myPlayer.y >> 7) + baseY;
  11080. if(j1 == 20)
  11081. k1 = ai[l++];
  11082. if(byte0 == 0)
  11083. {
  11084. if(i1 == 0)
  11085. k += k1;
  11086. if(i1 == 1)
  11087. k -= k1;
  11088. if(i1 == 2 && k1 != 0)
  11089. k /= k1;
  11090. if(i1 == 3)
  11091. k *= k1;
  11092. i1 = 0;
  11093. } else
  11094. {
  11095. i1 = byte0;
  11096. }
  11097. } while(true);
  11098. }
  11099. catch(Exception _ex)
  11100. {
  11101. return -1;
  11102. }
  11103. }
  11104.  
  11105. private void drawTooltip() {
  11106. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11107. return;
  11108. String s;
  11109. if(itemSelected == 1 && menuActionRow < 2)
  11110. s = "Use " + selectedItemName + " with...";
  11111. else if(spellSelected == 1 && menuActionRow < 2)
  11112. s = spellTooltip + "...";
  11113. else
  11114. s = menuActionName[menuActionRow - 1];
  11115. if(menuActionRow > 2)
  11116. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11117. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11118. }
  11119.  
  11120. private void drawMinimap() {
  11121. int compassX, compassY, MapY, MapX;
  11122. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11123. compassX = 11;
  11124. compassY = 8;
  11125. MapY = 9;
  11126. MapX = 38;
  11127. } else if(is474) {
  11128. compassX = 30;
  11129. compassY = 4;
  11130. MapY = 9;
  11131. MapX = 50;
  11132. } else {
  11133. compassX = 30+5;
  11134. compassY = 4;
  11135. MapY = 9;
  11136. MapX = 50+6;
  11137. }
  11138. mapBackImage.initDrawingArea();
  11139. if (anInt1021 == 2) {
  11140. Black[getSpriteID()].drawSprite(0, 0);
  11141. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11142. loadOrbs();
  11143. }
  11144. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, compassY, compassX-1, 33, 25);
  11145. if(menuOpen){
  11146. drawMenu(516, 0);
  11147. }
  11148. inGameScreen.initDrawingArea();
  11149. return;
  11150. }
  11151. int i = minimapInt1 + minimapInt2 & 0x7ff;
  11152. int j = 48 + myPlayer.x / 32;
  11153. int l2 = 464 - myPlayer.y / 32;
  11154.  
  11155. for(int j1 = 0; j1 < anIntArray1229.length; j1++){
  11156. anIntArray1229[j1] = 172;
  11157. anIntArray1052[j1] = -22;
  11158. }
  11159. aSprite_1263.method352(152, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, MapY, MapX, 146, j);
  11160. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, compassY, compassX-1, 33, 25);
  11161.  
  11162. for(int j5 = 0; j5 < anInt1071; j5++) {
  11163. try {
  11164. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11165. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11166. markMinimap(aSpriteArray1140[j5], k, i3, false);
  11167. } catch(Exception exception) {
  11168. }
  11169. }
  11170.  
  11171. for(int k5 = 0; k5 < 104; k5++) {
  11172. for(int l5 = 0; l5 < 104; l5++) {
  11173. NodeList class19 = groundArray[plane][k5][l5];
  11174. if(class19 != null) {
  11175. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11176. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11177. markMinimap(mapDotItem, l, j3, false);
  11178. }
  11179. }
  11180. }
  11181.  
  11182. for(int i6 = 0; i6 < npcCount; i6++) {
  11183. NPC npc = npcArray[npcIndices[i6]];
  11184. if(npc != null && npc.isVisible()) {
  11185. EntityDef entityDef = npc.desc;
  11186. if(entityDef.childrenIDs != null)
  11187. entityDef = entityDef.method161();
  11188. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  11189. int i1 = npc.x / 32 - myPlayer.x / 32;
  11190. int k3 = npc.y / 32 - myPlayer.y / 32;
  11191. markMinimap(mapDotNPC, i1, k3, false);
  11192. }
  11193. }
  11194. }
  11195. for(int j6 = 0; j6 < playerCount; j6++) {
  11196. Player player = playerArray[playerIndices[j6]];
  11197. if(player != null && player.isVisible()) {
  11198. int j1 = player.x / 32 - myPlayer.x / 32;
  11199. int l3 = player.y / 32 - myPlayer.y / 32;
  11200. boolean flag1 = false;
  11201. boolean flag3 = false;
  11202. for (int j3 = 0; j3 < clanList.length; j3++) {
  11203. if (clanList[j3] == null)
  11204. continue;
  11205. if (!clanList[j3].equalsIgnoreCase(player.name))
  11206. continue;
  11207. flag3 = true;
  11208. break;
  11209. }
  11210. long l6 = TextClass.longForName(player.name);
  11211. for(int k6 = 0; k6 < friendsCount; k6++) {
  11212. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  11213. continue;
  11214. flag1 = true;
  11215. break;
  11216. }
  11217. boolean flag2 = false;
  11218. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  11219. flag2 = true;
  11220. if(flag1)
  11221. markMinimap(mapDotFriend, j1, l3, false);
  11222. else if(flag3)
  11223. markMinimap(mapDotClan, j1, l3, false);
  11224. else if(flag2)
  11225. markMinimap(mapDotTeam, j1, l3, false);
  11226. else
  11227. markMinimap(mapDotPlayer, j1, l3, false);
  11228. }
  11229. }
  11230. if(anInt855 != 0 && loopCycle % 20 < 10) {
  11231. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  11232. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11233. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  11234. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  11235. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  11236. method81(mapMarker, i4, k1);
  11237. }
  11238. }
  11239. if(anInt855 == 2) {
  11240. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11241. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11242. method81(mapMarker, j4, l1);
  11243. }
  11244. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  11245. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11246. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  11247. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  11248. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  11249. method81(mapMarker, k4, i2);
  11250. }
  11251. }
  11252. }
  11253. if(destX != 0) {
  11254. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11255. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11256. markMinimap(mapFlag, j2, l4, false);
  11257. }
  11258. CustomMapback[getSpriteID()].drawSprite(0, 0);
  11259. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11260. loadOrbs();
  11261. DrawingArea.drawPixels(3, 84, 108, 0xffffff, 3);
  11262. } else {
  11263. DrawingArea.drawPixels(3, 84, 124, 0xffffff, 3);
  11264. }
  11265. if(menuOpen)
  11266. drawMenu(516, 0);
  11267. inGameScreen.initDrawingArea();
  11268. }
  11269.  
  11270. private void npcScreenPos(Entity entity, int i) {
  11271. calcEntityScreenPos(entity.x, i, entity.y);
  11272. }
  11273.  
  11274. private void calcEntityScreenPos(int i, int j, int l) {
  11275. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  11276. spriteDrawX = -1;
  11277. spriteDrawY = -1;
  11278. return;
  11279. }
  11280. int i1 = method42(plane, l, i) - j;
  11281. i -= xCameraPos;
  11282. i1 -= zCameraPos;
  11283. l -= yCameraPos;
  11284. int j1 = Model.modelIntArray1[yCameraCurve];
  11285. int k1 = Model.modelIntArray2[yCameraCurve];
  11286. int l1 = Model.modelIntArray1[xCameraCurve];
  11287. int i2 = Model.modelIntArray2[xCameraCurve];
  11288. int j2 = l * l1 + i * i2 >> 16;
  11289. l = l * i2 - i * l1 >> 16;
  11290. i = j2;
  11291. j2 = i1 * k1 - l * j1 >> 16;
  11292. l = i1 * j1 + l * k1 >> 16;
  11293. i1 = j2;
  11294. if(l >= 50) {
  11295. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  11296. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  11297. } else {
  11298. spriteDrawX = -1;
  11299. spriteDrawY = -1;
  11300. }
  11301. }
  11302.  
  11303. private void buildSplitPrivateChatMenu()
  11304. {
  11305. if(splitPrivateChat == 0)
  11306. return;
  11307. int i = 0;
  11308. if(anInt1104 != 0)
  11309. i = 1;
  11310. for(int j = 0; j < 100; j++)
  11311. if(chatMessages[j] != null)
  11312. {
  11313. int k = chatTypes[j];
  11314. String s = chatNames[j];
  11315. boolean flag1 = false;
  11316. if(s != null && s.startsWith("@cr0@")) {
  11317. s = s.substring(5);
  11318. byte byte0 = 1;
  11319. }
  11320. if(s != null && s.startsWith("@cr1@")) {
  11321. s = s.substring(5);
  11322. boolean flag2 = true;
  11323. byte byte0 = 2;
  11324. }
  11325. if(s != null && s.startsWith("@cr2@")) {
  11326. s = s.substring(5);
  11327. byte byte0 = 3;
  11328. }
  11329. if(s != null && s.startsWith("@cr3@")) {
  11330. s = s.substring(5);
  11331. byte byte0 = 4;
  11332. }
  11333. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  11334. {
  11335. int l = 329 - i * 13;
  11336. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11337. {
  11338. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11339. if(i1 > 450)
  11340. i1 = 450;
  11341. if(super.mouseX < 4 + i1)
  11342. {
  11343. if(myPrivilege >= 1)
  11344. {
  11345. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11346. menuActionID[menuActionRow] = 2606;
  11347. menuActionRow++;
  11348. }
  11349. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  11350. menuActionID[menuActionRow] = 2042;
  11351. menuActionRow++;
  11352. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  11353. menuActionID[menuActionRow] = 2337;
  11354. menuActionRow++;
  11355. }
  11356. }
  11357. if(++i >= 5)
  11358. return;
  11359. }
  11360. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11361. return;
  11362. }
  11363.  
  11364. }
  11365.  
  11366. private void method130(int j, int k, int l, int i1, int j1, int k1,
  11367. int l1, int i2, int j2)
  11368. {
  11369. Class30_Sub1 class30_sub1 = null;
  11370. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11371. {
  11372. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  11373. continue;
  11374. class30_sub1 = class30_sub1_1;
  11375. break;
  11376. }
  11377.  
  11378. if(class30_sub1 == null)
  11379. {
  11380. class30_sub1 = new Class30_Sub1();
  11381. class30_sub1.anInt1295 = l1;
  11382. class30_sub1.anInt1296 = i1;
  11383. class30_sub1.anInt1297 = i2;
  11384. class30_sub1.anInt1298 = j1;
  11385. method89(class30_sub1);
  11386. aClass19_1179.insertHead(class30_sub1);
  11387. }
  11388. class30_sub1.anInt1291 = k;
  11389. class30_sub1.anInt1293 = k1;
  11390. class30_sub1.anInt1292 = l;
  11391. class30_sub1.anInt1302 = j2;
  11392. class30_sub1.anInt1294 = j;
  11393. }
  11394.  
  11395. private boolean interfaceIsSelected(RSInterface class9)
  11396. {
  11397. if(class9.valueCompareType == null)
  11398. return false;
  11399. for(int i = 0; i < class9.valueCompareType.length; i++)
  11400. {
  11401. int j = extractInterfaceValues(class9, i);
  11402. int k = class9.requiredValues[i];
  11403. if(class9.valueCompareType[i] == 2)
  11404. {
  11405. if(j >= k)
  11406. return false;
  11407. } else
  11408. if(class9.valueCompareType[i] == 3)
  11409. {
  11410. if(j <= k)
  11411. return false;
  11412. } else
  11413. if(class9.valueCompareType[i] == 4)
  11414. {
  11415. if(j == k)
  11416. return false;
  11417. } else
  11418. if(j != k)
  11419. return false;
  11420. }
  11421.  
  11422. return true;
  11423. }
  11424.  
  11425. private DataInputStream openJagGrabInputStream(String s)
  11426. throws IOException
  11427. {
  11428. // if(!aBoolean872)
  11429. // if(signlink.mainapp != null)
  11430. // return signlink.openurl(s);
  11431. // else
  11432. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11433. if(aSocket832 != null)
  11434. {
  11435. try
  11436. {
  11437. aSocket832.close();
  11438. System.out.println("Here5");
  11439. }
  11440. catch(Exception _ex) { }
  11441. aSocket832 = null;
  11442. }
  11443. aSocket832 = openSocket(43594);//43594
  11444. aSocket832.setSoTimeout(10000);
  11445. java.io.InputStream inputstream = aSocket832.getInputStream();
  11446. OutputStream outputstream = aSocket832.getOutputStream();
  11447. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11448. return new DataInputStream(inputstream);
  11449. }
  11450.  
  11451. private void doFlamesDrawing()
  11452. {
  11453. char c = '\u0100';
  11454. if(anInt1040 > 0)
  11455. {
  11456. for(int i = 0; i < 256; i++)
  11457. if(anInt1040 > 768)
  11458. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  11459. else
  11460. if(anInt1040 > 256)
  11461. anIntArray850[i] = anIntArray852[i];
  11462. else
  11463. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  11464.  
  11465. } else
  11466. if(anInt1041 > 0)
  11467. {
  11468. for(int j = 0; j < 256; j++)
  11469. if(anInt1041 > 768)
  11470. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  11471. else
  11472. if(anInt1041 > 256)
  11473. anIntArray850[j] = anIntArray853[j];
  11474. else
  11475. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  11476.  
  11477. } else
  11478. {
  11479. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11480.  
  11481. }
  11482. System.arraycopy(aSprite_1201.myPixels, 0, leftSideFlame.anIntArray315, 0, 33920);
  11483.  
  11484. int i1 = 0;
  11485. int j1 = 1152;
  11486. for(int k1 = 1; k1 < c - 1; k1++)
  11487. {
  11488. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11489. int j2 = 22 + l1;
  11490. if(j2 < 0)
  11491. j2 = 0;
  11492. i1 += j2;
  11493. for(int l2 = j2; l2 < 128; l2++)
  11494. {
  11495. int j3 = anIntArray828[i1++];
  11496. if(j3 != 0)
  11497. {
  11498. int l3 = j3;
  11499. int j4 = 256 - j3;
  11500. j3 = anIntArray850[j3];
  11501. int l4 = leftSideFlame.anIntArray315[j1];
  11502. leftSideFlame.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11503. } else
  11504. {
  11505. j1++;
  11506. }
  11507. }
  11508.  
  11509. j1 += j2;
  11510. }
  11511.  
  11512. leftSideFlame.drawGraphics(0, super.graphics, 0);
  11513. System.arraycopy(aSprite_1202.myPixels, 0, rightSideFlame.anIntArray315, 0, 33920);
  11514.  
  11515. i1 = 0;
  11516. j1 = 1176;
  11517. for(int k2 = 1; k2 < c - 1; k2++)
  11518. {
  11519. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11520. int k3 = 103 - i3;
  11521. j1 += i3;
  11522. for(int i4 = 0; i4 < k3; i4++)
  11523. {
  11524. int k4 = anIntArray828[i1++];
  11525. if(k4 != 0)
  11526. {
  11527. int i5 = k4;
  11528. int j5 = 256 - k4;
  11529. k4 = anIntArray850[k4];
  11530. int k5 = rightSideFlame.anIntArray315[j1];
  11531. rightSideFlame.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11532. } else
  11533. {
  11534. j1++;
  11535. }
  11536. }
  11537.  
  11538. i1 += 128 - k3;
  11539. j1 += 128 - k3 - i3;
  11540. }
  11541.  
  11542. rightSideFlame.drawGraphics(0, super.graphics, 637);
  11543. }
  11544.  
  11545. private void method134(Stream stream)
  11546. {
  11547. int j = stream.readBits(8);
  11548. if(j < playerCount)
  11549. {
  11550. for(int k = j; k < playerCount; k++)
  11551. anIntArray840[anInt839++] = playerIndices[k];
  11552.  
  11553. }
  11554. if(j > playerCount)
  11555. {
  11556. signlink.reporterror(myUsername + " Too many players");
  11557. throw new RuntimeException("eek");
  11558. }
  11559. playerCount = 0;
  11560. for(int l = 0; l < j; l++)
  11561. {
  11562. int i1 = playerIndices[l];
  11563. Player player = playerArray[i1];
  11564. int j1 = stream.readBits(1);
  11565. if(j1 == 0)
  11566. {
  11567. playerIndices[playerCount++] = i1;
  11568. player.anInt1537 = loopCycle;
  11569. } else
  11570. {
  11571. int k1 = stream.readBits(2);
  11572. if(k1 == 0)
  11573. {
  11574. playerIndices[playerCount++] = i1;
  11575. player.anInt1537 = loopCycle;
  11576. anIntArray894[anInt893++] = i1;
  11577. } else
  11578. if(k1 == 1)
  11579. {
  11580. playerIndices[playerCount++] = i1;
  11581. player.anInt1537 = loopCycle;
  11582. int l1 = stream.readBits(3);
  11583. player.moveInDir(false, l1);
  11584. int j2 = stream.readBits(1);
  11585. if(j2 == 1)
  11586. anIntArray894[anInt893++] = i1;
  11587. } else
  11588. if(k1 == 2)
  11589. {
  11590. playerIndices[playerCount++] = i1;
  11591. player.anInt1537 = loopCycle;
  11592. int i2 = stream.readBits(3);
  11593. player.moveInDir(true, i2);
  11594. int k2 = stream.readBits(3);
  11595. player.moveInDir(true, k2);
  11596. int l2 = stream.readBits(1);
  11597. if(l2 == 1)
  11598. anIntArray894[anInt893++] = i1;
  11599. } else
  11600. if(k1 == 3)
  11601. anIntArray840[anInt839++] = i1;
  11602. }
  11603. }
  11604. }
  11605.  
  11606. private void drawLoginScreen(boolean flag) {
  11607. if (normalLogin == true) {
  11608. resetImageProducers();
  11609. loginScreenArea.initDrawingArea();
  11610. titleBox.drawBackground(0, 0);
  11611. char c = '\u0168';
  11612. char c1 = '\310';
  11613. if(loginScreenState == 0) {
  11614. int i = c1 / 2 + 80;
  11615. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  11616. i = c1 / 2 - 20;
  11617. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to Teamtorva", i, true);
  11618. i += 30;
  11619. int l = c / 2 - 80;
  11620. int k1 = c1 / 2 + 20;
  11621. titleButton.drawBackground(l - 73, k1 - 20);
  11622. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  11623. l = c / 2 + 80;
  11624. titleButton.drawBackground(l - 73, k1 - 20);
  11625. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  11626. }
  11627. if(loginScreenState == 2) {
  11628. int j = c1 / 2 - 40;
  11629. if(loginMessage1.length() > 0) {
  11630. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  11631. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  11632. j += 30;
  11633. } else {
  11634. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  11635. j += 30;
  11636. }
  11637. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + capitalize(myUsername) + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11638. j += 15;
  11639. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11640. j += 15;
  11641. if(!flag) {
  11642. int i1 = c / 2 - 80;
  11643. int l1 = c1 / 2 + 50;
  11644. titleButton.drawBackground(i1 - 73, l1 - 20);
  11645. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  11646. i1 = c / 2 + 80;
  11647. titleButton.drawBackground(i1 - 73, l1 - 20);
  11648. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  11649. }
  11650. }
  11651. if(loginScreenState == 3) {
  11652. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  11653. int k = c1 / 2 - 35;
  11654. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  11655. k += 15;
  11656. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the previous screen", k, true);
  11657. k += 15;
  11658. chatTextDrawingArea.method382(0xffffff, c / 2, "and click 'Existing User'.", k, true);
  11659. k += 15;
  11660. chatTextDrawingArea.method382(0xffffff, c / 2, "Loging in from there will register you.", k, true);
  11661. k += 15;
  11662. int j1 = c / 2;
  11663. int i2 = c1 / 2 + 50;
  11664. titleButton.drawBackground(j1 - 73, i2 - 20);
  11665. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  11666. }
  11667. loginScreenArea.drawGraphics(171, super.graphics, 202);
  11668. if(welcomeScreenRaised) {
  11669. welcomeScreenRaised = false;
  11670. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  11671. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  11672. gameLogo.drawGraphics(265, super.graphics, 0);
  11673. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  11674. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  11675. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  11676. }
  11677. } else if(normalLogin == false) {
  11678. resetImageProducers();
  11679. loginScreenArea.initDrawingArea();
  11680. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  11681. Sprite loginArea = new Sprite(abyte0, this);
  11682. loginArea.drawSprite(0, 0);
  11683.  
  11684. if(loginScreenState == 0) {
  11685. titleBox1.drawSprite(237-204, 138+25);
  11686. addLoginScreenHover(LOGIN, 8, 287-204, 182+25, 9);
  11687. if (super.saveClickX >= 361-204 && super.saveClickX <= 361-204+34 && super.saveClickY >= 360+15 && super.saveClickY <= 360+15+15) {
  11688. }
  11689. Sprite scrollLine = new Sprite("Login/Random/LINE");
  11690. scrollLine.drawSprite(297-204, 277+25);
  11691. scrollLine.drawSprite(297-204, 356+25);
  11692. smallText.method382(0xffffff, 332-204, "Standard Detail", 351+25, false);
  11693. smallText.method382(0xffffff, 428-204, "High Detail", 351+25, false);
  11694. if (super.saveClickX >= 306-204 && super.saveClickX <= 362-204 && super.saveClickY >= 303+25 && super.saveClickY <= 336+25) {
  11695. isClicked = 0;
  11696. }
  11697. if(super.saveClickX >= 402-204 && super.saveClickX <= 458-204 && super.saveClickY >= 302+25 && super.saveClickY <= 336+25) {
  11698. isClicked = 1;
  11699. }
  11700. if(isClicked != 0){
  11701. LOGIN[26].drawSprite(401-204, 303+25);
  11702. addLoginScreenHover(LOGIN, 25, 305-204, 303+25, 20);
  11703. LOGIN[22].drawSprite(446-204, 326+25);
  11704. } else if(isClicked == 0) {
  11705. LOGIN[20].drawSprite(305-204, 303+25);
  11706. addLoginScreenHover(LOGIN, 21, 401-204, 303+25, 27);
  11707. LOGIN[22].drawSprite(350-204, 326+25);
  11708. }
  11709. loginScreenArea.drawGraphics(0, super.graphics, 0);
  11710. }
  11711. if(loginScreenState == 1) {
  11712. titleBox1.drawSprite(237-204, 138+25);
  11713. LOGIN[0].drawSprite(333-204, 182+25);
  11714. LOGIN[1].drawSprite(344-204, 253+32);
  11715. LOGIN[2].drawSprite(346-204, 308+40);
  11716. LOGIN[5].drawSprite(290-204, 267+25);
  11717. LOGIN[5].drawSprite(290-204, 329+25);
  11718. addLoginScreenHover(LOGIN, 3, 358-204, 380+25, 4);
  11719. addLoginScreenHover(LOGIN, 6, 338-204, 415+25, 7);
  11720. smallText.method382(0xffffff, 380-204, "World 1", 212+25, false);
  11721. smallText.method382(0xffe1be, 380-204, myUsername, 238+25, false);
  11722. smallText.method382(0xffe1bef, 380-204, myPassword, 237+25, false);
  11723. chatTextDrawingArea.method389(true, 311-204, 0x461e00, capitalize(myUsername) + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "|" : ""), 288+25);
  11724. chatTextDrawingArea.method389(true, 311-204, 0x461e00, TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "|" : ""), 349+25);
  11725. loginScreenArea.drawGraphics(0, super.graphics, 0);
  11726. }
  11727. }
  11728. }
  11729.  
  11730. private void drawFlames()
  11731. {
  11732. if(normalLogin == true) {
  11733. try
  11734. {
  11735. long l = System.currentTimeMillis();
  11736. int i = 0;
  11737. int j = 20;
  11738. while(aBoolean831)
  11739. {
  11740. anInt1208++;
  11741. if(normalLogin == true) {
  11742. //calcFlamesPosition();
  11743. //calcFlamesPosition();
  11744. }
  11745. doFlamesDrawing();
  11746. if(++i > 10)
  11747. {
  11748. long l1 = System.currentTimeMillis();
  11749. int k = (int)(l1 - l) / 10 - j;
  11750. j = 40 - k;
  11751. if(j < 5)
  11752. j = 5;
  11753. i = 0;
  11754. l = l1;
  11755. }
  11756. try
  11757. {
  11758. Thread.sleep(j);
  11759. }
  11760. catch(Exception _ex) { }
  11761. }
  11762. } catch(Exception _ex) { }
  11763. drawingFlames = false;
  11764. } else if(normalLogin == false) {
  11765.  
  11766. }
  11767. }
  11768.  
  11769. public void raiseWelcomeScreen()
  11770. {
  11771. welcomeScreenRaised = true;
  11772. }
  11773.  
  11774. private void method137(Stream stream, int j)
  11775. {
  11776. if(j == 84)
  11777. {
  11778. int k = stream.readUnsignedByte();
  11779. int j3 = anInt1268 + (k >> 4 & 7);
  11780. int i6 = anInt1269 + (k & 7);
  11781. int l8 = stream.readUnsignedWord();
  11782. int k11 = stream.readUnsignedWord();
  11783. int l13 = stream.readUnsignedWord();
  11784. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  11785. {
  11786. NodeList class19_1 = groundArray[plane][j3][i6];
  11787. if(class19_1 != null)
  11788. {
  11789. 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())
  11790. {
  11791. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11792. continue;
  11793. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11794. break;
  11795. }
  11796.  
  11797. spawnGroundItem(j3, i6);
  11798. }
  11799. }
  11800. return;
  11801. }
  11802. if(j == 105)
  11803. {
  11804. int l = stream.readUnsignedByte();
  11805. int k3 = anInt1268 + (l >> 4 & 7);
  11806. int j6 = anInt1269 + (l & 7);
  11807. int i9 = stream.readUnsignedWord();
  11808. int l11 = stream.readUnsignedByte();
  11809. int i14 = l11 >> 4 & 0xf;
  11810. int i16 = l11 & 7;
  11811. 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)
  11812. {
  11813. anIntArray1207[anInt1062] = i9;
  11814. anIntArray1241[anInt1062] = i16;
  11815. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11816. anInt1062++;
  11817. }
  11818. }
  11819. if(j == 215)
  11820. {
  11821. int i1 = stream.method435();
  11822. int l3 = stream.method428();
  11823. int k6 = anInt1268 + (l3 >> 4 & 7);
  11824. int j9 = anInt1269 + (l3 & 7);
  11825. int i12 = stream.method435();
  11826. int j14 = stream.readUnsignedWord();
  11827. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  11828. {
  11829. Item class30_sub2_sub4_sub2_2 = new Item();
  11830. class30_sub2_sub4_sub2_2.ID = i1;
  11831. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11832. if(groundArray[plane][k6][j9] == null)
  11833. groundArray[plane][k6][j9] = new NodeList();
  11834. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11835. spawnGroundItem(k6, j9);
  11836. }
  11837. return;
  11838. }
  11839. if(j == 156)
  11840. {
  11841. int j1 = stream.method426();
  11842. int i4 = anInt1268 + (j1 >> 4 & 7);
  11843. int l6 = anInt1269 + (j1 & 7);
  11844. int k9 = stream.readUnsignedWord();
  11845. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  11846. {
  11847. NodeList class19 = groundArray[plane][i4][l6];
  11848. if(class19 != null)
  11849. {
  11850. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  11851. {
  11852. if(item.ID != (k9 & 0x7fff))
  11853. continue;
  11854. item.unlink();
  11855. break;
  11856. }
  11857.  
  11858. if(class19.reverseGetFirst() == null)
  11859. groundArray[plane][i4][l6] = null;
  11860. spawnGroundItem(i4, l6);
  11861. }
  11862. }
  11863. return;
  11864. }
  11865. if(j == 160)
  11866. {
  11867. int k1 = stream.method428();
  11868. int j4 = anInt1268 + (k1 >> 4 & 7);
  11869. int i7 = anInt1269 + (k1 & 7);
  11870. int l9 = stream.method428();
  11871. int j12 = l9 >> 2;
  11872. int k14 = l9 & 3;
  11873. int j16 = anIntArray1177[j12];
  11874. int j17 = stream.method435();
  11875. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  11876. {
  11877. int j18 = intGroundArray[plane][j4][i7];
  11878. int i19 = intGroundArray[plane][j4 + 1][i7];
  11879. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11880. int k20 = intGroundArray[plane][j4][i7 + 1];
  11881. if(j16 == 0)
  11882. {
  11883. Object1 class10 = worldController.method296(plane, j4, i7);
  11884. if(class10 != null)
  11885. {
  11886. int k21 = class10.uid >> 14 & 0x7fff;
  11887. if(j12 == 2)
  11888. {
  11889. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11890. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11891. } else
  11892. {
  11893. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11894. }
  11895. }
  11896. }
  11897. if(j16 == 1)
  11898. {
  11899. Object2 class26 = worldController.method297(j4, i7, plane);
  11900. if(class26 != null)
  11901. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11902. }
  11903. if(j16 == 2)
  11904. {
  11905. Object5 class28 = worldController.method298(j4, i7, plane);
  11906. if(j12 == 11)
  11907. j12 = 10;
  11908. if(class28 != null)
  11909. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11910. }
  11911. if(j16 == 3)
  11912. {
  11913. Object3 class49 = worldController.method299(i7, j4, plane);
  11914. if(class49 != null)
  11915. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11916. }
  11917. }
  11918. return;
  11919. }
  11920. if(j == 147)
  11921. {
  11922. int l1 = stream.method428();
  11923. int k4 = anInt1268 + (l1 >> 4 & 7);
  11924. int j7 = anInt1269 + (l1 & 7);
  11925. int i10 = stream.readUnsignedWord();
  11926. byte byte0 = stream.method430();
  11927. int l14 = stream.method434();
  11928. byte byte1 = stream.method429();
  11929. int k17 = stream.readUnsignedWord();
  11930. int k18 = stream.method428();
  11931. int j19 = k18 >> 2;
  11932. int i20 = k18 & 3;
  11933. int l20 = anIntArray1177[j19];
  11934. byte byte2 = stream.readSignedByte();
  11935. int l21 = stream.readUnsignedWord();
  11936. byte byte3 = stream.method429();
  11937. Player player;
  11938. if(i10 == unknownInt10)
  11939. player = myPlayer;
  11940. else
  11941. player = playerArray[i10];
  11942. if(player != null)
  11943. {
  11944. ObjectDef class46 = ObjectDef.forID(l21);
  11945. int i22 = intGroundArray[plane][k4][j7];
  11946. int j22 = intGroundArray[plane][k4 + 1][j7];
  11947. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11948. int l22 = intGroundArray[plane][k4][j7 + 1];
  11949. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11950. if(model != null)
  11951. {
  11952. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11953. player.anInt1707 = l14 + loopCycle;
  11954. player.anInt1708 = k17 + loopCycle;
  11955. player.aModel_1714 = model;
  11956. int i23 = class46.anInt744;
  11957. int j23 = class46.anInt761;
  11958. if(i20 == 1 || i20 == 3)
  11959. {
  11960. i23 = class46.anInt761;
  11961. j23 = class46.anInt744;
  11962. }
  11963. player.anInt1711 = k4 * 128 + i23 * 64;
  11964. player.anInt1713 = j7 * 128 + j23 * 64;
  11965. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11966. if(byte2 > byte0)
  11967. {
  11968. byte byte4 = byte2;
  11969. byte2 = byte0;
  11970. byte0 = byte4;
  11971. }
  11972. if(byte3 > byte1)
  11973. {
  11974. byte byte5 = byte3;
  11975. byte3 = byte1;
  11976. byte1 = byte5;
  11977. }
  11978. player.anInt1719 = k4 + byte2;
  11979. player.anInt1721 = k4 + byte0;
  11980. player.anInt1720 = j7 + byte3;
  11981. player.anInt1722 = j7 + byte1;
  11982. }
  11983. }
  11984. }
  11985. if(j == 151)
  11986. {
  11987. int i2 = stream.method426();
  11988. int l4 = anInt1268 + (i2 >> 4 & 7);
  11989. int k7 = anInt1269 + (i2 & 7);
  11990. int j10 = stream.method434();
  11991. int k12 = stream.method428();
  11992. int i15 = k12 >> 2;
  11993. int k16 = k12 & 3;
  11994. int l17 = anIntArray1177[i15];
  11995. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11996. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11997. return;
  11998. }
  11999. if(j == 4)
  12000. {
  12001. int j2 = stream.readUnsignedByte();
  12002. int i5 = anInt1268 + (j2 >> 4 & 7);
  12003. int l7 = anInt1269 + (j2 & 7);
  12004. int k10 = stream.readUnsignedWord();
  12005. int l12 = stream.readUnsignedByte();
  12006. int j15 = stream.readUnsignedWord();
  12007. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  12008. {
  12009. i5 = i5 * 128 + 64;
  12010. l7 = l7 * 128 + 64;
  12011. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  12012. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  12013. }
  12014. return;
  12015. }
  12016. if(j == 44)
  12017. {
  12018. int k2 = stream.method436();
  12019. int j5 = stream.readUnsignedWord();
  12020. int i8 = stream.readUnsignedByte();
  12021. int l10 = anInt1268 + (i8 >> 4 & 7);
  12022. int i13 = anInt1269 + (i8 & 7);
  12023. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  12024. {
  12025. Item class30_sub2_sub4_sub2_1 = new Item();
  12026. class30_sub2_sub4_sub2_1.ID = k2;
  12027. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  12028. if(groundArray[plane][l10][i13] == null)
  12029. groundArray[plane][l10][i13] = new NodeList();
  12030. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  12031. spawnGroundItem(l10, i13);
  12032. }
  12033. return;
  12034. }
  12035. if(j == 101)
  12036. {
  12037. int l2 = stream.method427();
  12038. int k5 = l2 >> 2;
  12039. int j8 = l2 & 3;
  12040. int i11 = anIntArray1177[k5];
  12041. int j13 = stream.readUnsignedByte();
  12042. int k15 = anInt1268 + (j13 >> 4 & 7);
  12043. int l16 = anInt1269 + (j13 & 7);
  12044. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  12045. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  12046. return;
  12047. }
  12048. if(j == 117)
  12049. {
  12050. int i3 = stream.readUnsignedByte();
  12051. int l5 = anInt1268 + (i3 >> 4 & 7);
  12052. int k8 = anInt1269 + (i3 & 7);
  12053. int j11 = l5 + stream.readSignedByte();
  12054. int k13 = k8 + stream.readSignedByte();
  12055. int l15 = stream.readSignedWord();
  12056. int i17 = stream.readUnsignedWord();
  12057. int i18 = stream.readUnsignedByte() * 4;
  12058. int l18 = stream.readUnsignedByte() * 4;
  12059. int k19 = stream.readUnsignedWord();
  12060. int j20 = stream.readUnsignedWord();
  12061. int i21 = stream.readUnsignedByte();
  12062. int j21 = stream.readUnsignedByte();
  12063. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  12064. {
  12065. l5 = l5 * 128 + 64;
  12066. k8 = k8 * 128 + 64;
  12067. j11 = j11 * 128 + 64;
  12068. k13 = k13 * 128 + 64;
  12069. 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);
  12070. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  12071. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  12072. }
  12073. }
  12074. }
  12075.  
  12076. private static void setLowMem()
  12077. {
  12078. WorldController.lowMem = true;
  12079. Texture.lowMem = true;
  12080. lowMem = true;
  12081. ObjectManager.lowMem = true;
  12082. ObjectDef.lowMem = true;
  12083. }
  12084.  
  12085. private void method139(Stream stream)
  12086. {
  12087. stream.initBitAccess();
  12088. int k = stream.readBits(8);
  12089. if(k < npcCount)
  12090. {
  12091. for(int l = k; l < npcCount; l++)
  12092. anIntArray840[anInt839++] = npcIndices[l];
  12093.  
  12094. }
  12095. if(k > npcCount)
  12096. {
  12097. signlink.reporterror(myUsername + " Too many npcs");
  12098. throw new RuntimeException("eek");
  12099. }
  12100. npcCount = 0;
  12101. for(int i1 = 0; i1 < k; i1++)
  12102. {
  12103. int j1 = npcIndices[i1];
  12104. NPC npc = npcArray[j1];
  12105. int k1 = stream.readBits(1);
  12106. if(k1 == 0)
  12107. {
  12108. npcIndices[npcCount++] = j1;
  12109. npc.anInt1537 = loopCycle;
  12110. } else
  12111. {
  12112. int l1 = stream.readBits(2);
  12113. if(l1 == 0)
  12114. {
  12115. npcIndices[npcCount++] = j1;
  12116. npc.anInt1537 = loopCycle;
  12117. anIntArray894[anInt893++] = j1;
  12118. } else
  12119. if(l1 == 1)
  12120. {
  12121. npcIndices[npcCount++] = j1;
  12122. npc.anInt1537 = loopCycle;
  12123. int i2 = stream.readBits(3);
  12124. npc.moveInDir(false, i2);
  12125. int k2 = stream.readBits(1);
  12126. if(k2 == 1)
  12127. anIntArray894[anInt893++] = j1;
  12128. } else
  12129. if(l1 == 2)
  12130. {
  12131. npcIndices[npcCount++] = j1;
  12132. npc.anInt1537 = loopCycle;
  12133. int j2 = stream.readBits(3);
  12134. npc.moveInDir(true, j2);
  12135. int l2 = stream.readBits(3);
  12136. npc.moveInDir(true, l2);
  12137. int i3 = stream.readBits(1);
  12138. if(i3 == 1)
  12139. anIntArray894[anInt893++] = j1;
  12140. } else
  12141. if(l1 == 3)
  12142. anIntArray840[anInt839++] = j1;
  12143. }
  12144. }
  12145.  
  12146. }
  12147.  
  12148. private void processLoginScreenInput() {
  12149. //if(normalLogin == true) {
  12150. if(loginScreenState == 0) {
  12151. int i = super.myWidth / 2 - 80;
  12152. int l = super.myHeight / 2 + 20;
  12153. l += 20;
  12154. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  12155. loginScreenState = 3;
  12156. loginScreenCursorPos = 0;
  12157. }
  12158. i = super.myWidth / 2 + 80;
  12159. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  12160. loginMessage1 = "";
  12161. loginMessage2 = "Enter your username & password.";
  12162. loginScreenState = 2;
  12163. loginScreenCursorPos = 0;
  12164. }
  12165. } else {
  12166. if(loginScreenState == 2) {
  12167. int j = super.myHeight / 2 - 40;
  12168. j += 30;
  12169. j += 25;
  12170. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  12171. loginScreenCursorPos = 0;
  12172. j += 15;
  12173. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  12174. loginScreenCursorPos = 1;
  12175. j += 15;
  12176. int i1 = super.myWidth / 2 - 80;
  12177. int k1 = super.myHeight / 2 + 50;
  12178. k1 += 20;
  12179. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  12180. loginFailures = 0;
  12181. login(capitalize(myUsername), myPassword, false);
  12182. if(loggedIn)
  12183. return;
  12184. }
  12185. i1 = super.myWidth / 2 + 80;
  12186. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  12187. loginScreenState = 0;
  12188. myUsername = "";
  12189. myPassword = "";
  12190. }
  12191. do {
  12192. int l1 = readChar(-796);
  12193. if(l1 == -1)
  12194. break;
  12195. boolean flag1 = false;
  12196. for(int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  12197. if(l1 != validUserPassChars.charAt(i2))
  12198. continue;
  12199. flag1 = true;
  12200. break;
  12201. } if(loginScreenCursorPos == 0) {
  12202. if(l1 == 8 && myUsername.length() > 0)
  12203. myUsername = myUsername.substring(0, myUsername.length() - 1);
  12204. if(l1 == 9 || l1 == 10 || l1 == 13)
  12205. loginScreenCursorPos = 1;
  12206. if(flag1)
  12207. myUsername += (char)l1;
  12208. if(myUsername.length() > 12)
  12209. myUsername = capitalize(myUsername.substring(0, 12));
  12210. } else if(loginScreenCursorPos == 1) {
  12211. if(l1 == 8 && myPassword.length() > 0)
  12212. myPassword = myPassword.substring(0, myPassword.length() - 1);
  12213. if(l1 == 9 || l1 == 10 || l1 == 13)
  12214. loginScreenCursorPos = 0;
  12215. if(flag1)
  12216. myPassword += (char)l1;
  12217. if(myPassword.length() > 20)
  12218. myPassword = myPassword.substring(0, 20);
  12219. }
  12220. } while(true);
  12221. return;
  12222. }
  12223. if(loginScreenState == 3) {
  12224. int k = super.myWidth / 2;
  12225. int j1 = super.myHeight / 2 + 50;
  12226. j1 += 20;
  12227. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  12228. loginScreenState = 0;
  12229. }
  12230. }
  12231. //} else if(normalLogin == false) {
  12232.  
  12233. /** Custom Login Screen areas and crap */
  12234. //}
  12235. }
  12236.  
  12237. private void markMinimap(Sprite sprite, int i, int j, boolean flag) {
  12238. int k = minimapInt1 + minimapInt2 & 0x7ff;
  12239. int l = i * i + j * j;
  12240. if(flag)
  12241. return;
  12242. if(l > 6400)
  12243. return;
  12244. int i1 = Model.modelIntArray1[k];
  12245. int j1 = Model.modelIntArray2[k];
  12246. i1 = (i1 * 256) / (minimapInt3 + 256);
  12247. j1 = (j1 * 256) / (minimapInt3 + 256);
  12248. int k1 = j * i1 + i * j1 >> 16;
  12249. int l1 = j * j1 - i * i1 >> 16;
  12250. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  12251. sprite.drawSprite(((106 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  12252. } else {
  12253. sprite.drawSprite(((122 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  12254. }
  12255. CustomMapback[getSpriteID()].drawSprite(0, 0);
  12256. }
  12257.  
  12258. public int flagPos = 72;
  12259. public int runState = 1;
  12260. public boolean logHover = false;
  12261. public boolean xpHover = false;
  12262. public boolean xpClicked = false;
  12263. public boolean drawXpBar = false;
  12264. public boolean drawFlag = false;
  12265. public int xpToDraw = 0;
  12266. public int testXp = 0;
  12267. public Sprite[] globe = new Sprite[3];
  12268. public Sprite[] ORBS = new Sprite[18];
  12269. public Sprite[] LOGOUT = new Sprite[5];
  12270. public Sprite xpOrb;
  12271. public Sprite sprite1;
  12272. public Sprite xpFlag;
  12273.  
  12274. public static boolean globeState[] = {
  12275. false, false
  12276. };
  12277. public void drawXpOrb() {
  12278. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY <= 80){
  12279. xpHover = true;
  12280. } else {
  12281. xpHover = false;
  12282. }
  12283. if(super.clickMode3 == 1 && super.saveClickX >= 516 && super.saveClickX <= 550 && super.saveClickY >= 46 && super.saveClickY <= 80) {
  12284. if(!xpClicked) {
  12285. xpClicked = true;
  12286. drawXpBar = true;
  12287. } else {
  12288. xpClicked = false;
  12289. drawXpBar = false;
  12290. }
  12291. }
  12292. if(!xpClicked) {
  12293. if(!xpHover) {
  12294. ORBS[17].drawSprite(0, 46);
  12295. } else {
  12296. ORBS[16].drawSprite(0, 46);
  12297. }
  12298. } else {
  12299. if(!xpHover) {
  12300. ORBS[17].drawSprite(0, 46);
  12301. } else {
  12302. ORBS[16].drawSprite(0, 46);
  12303. }
  12304. }
  12305. }
  12306. public void drawGlobe(){
  12307. if(is508 == true || is525 == true || is562 == true) {
  12308. if(super.clickMode3 == 1){
  12309. if(super.saveClickX >= 522 && super.saveClickX <= 558 && super.saveClickY >= 124 && super.saveClickY < 161){
  12310. if(globeState[0]){
  12311. globeState[0] = false;
  12312. } else {
  12313. globeState[0] = true;
  12314. }
  12315. }
  12316. }
  12317. if(super.mouseX >= 522 && super.mouseX <= 558 && super.mouseY >= 124 && super.mouseY < 161){
  12318. globeState[1] = true;
  12319. } else {
  12320. globeState[1] = false;
  12321. }
  12322. } else {
  12323. }
  12324. }
  12325.  
  12326. public void drawLogout(){
  12327. if(is508 || is525 || is562) {
  12328. if(!logHover){
  12329. LOGOUT[0].drawSprite(226, 1);
  12330. } else {
  12331. LOGOUT[1].drawSprite(226, 1);
  12332. }
  12333. if(super.clickMode2 == 1 && super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 1 && super.mouseY <= 25){
  12334. LOGOUT[2].drawSprite(226, 1);
  12335. }
  12336. } else if(is480) {
  12337. if(tabID == 14) {
  12338. LOGOUT[4].drawSprite(226, 1);
  12339. } if(tabID != 14) {
  12340. LOGOUT[3].drawSprite(226, 1);
  12341. }
  12342. }
  12343. }
  12344.  
  12345. public void loadOrbs() {
  12346. drawLogout();
  12347. drawHP();
  12348. if(is562){
  12349. drawXpOrb();
  12350. }
  12351. drawPrayer();
  12352. drawRunOrb();
  12353. if(is508 == true) {
  12354. globe[0].drawSprite(10, 123);
  12355. } else if(is525 == true || is562 == true) {
  12356. drawGlobe();
  12357. if (globeState[0] && globeState[1]) {
  12358. globe[2].drawSprite(10, 123);
  12359. } else if (globeState[1]) {
  12360. globe[2].drawSprite(10, 123);
  12361. } else if (globeState[0]) {
  12362. globe[1].drawSprite(10, 123);
  12363. } else {
  12364. globe[1].drawSprite(10, 123);
  12365. }
  12366. }
  12367. }
  12368. public Sprite[] Black = new Sprite[5];
  12369.  
  12370. public void loadExtraSprites(){
  12371. magicAuto = new Sprite("Misc/magicAuto");
  12372. sprite1 = new Sprite("Gameframe/sprite1");
  12373. xpFlag = new Sprite("Gameframe/xpFlag");
  12374. for(int i = 1; i <= 17; i++) {
  12375. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  12376. }
  12377. for(int i = 0; i <= 4;i++) {
  12378. LOGOUT[i] = new Sprite("Gameframe/Orbs/X "+i+"");
  12379. }
  12380. for (int j3 = 0; j3 <= 26; j3++) {
  12381. LOGIN[j3] = new Sprite("Login/Buttons/BUTTON "+j3+"");
  12382. }
  12383. for (int i = 0; i <= 2; i++) {
  12384. globe[i] = new Sprite("Gameframe/Globe "+i+"");
  12385. }
  12386. for(int i = 0; i <= 4; i++){
  12387. chatArea[i] = new Sprite("Gameframe/Gameframes/chatArea "+i+"");
  12388. }
  12389. for(int i = 0; i <= 4; i++){
  12390. tabArea[i] = new Sprite("Gameframe/Gameframes/tabArea "+i+"");
  12391. }
  12392. for(int i = 0; i <= 4; i++){
  12393. CustomMapback[i] = new Sprite("Gameframe/Gameframes/Mapback "+i+"");
  12394. }
  12395. for(int i = 0; i <= 6; i++){
  12396. modIcons[i] = new Sprite("Player/MODICONS "+i+"");
  12397. }
  12398. for(int i = 0; i <= 6; i++){
  12399. chatImages[i] = new Sprite("Player/MODICONS "+i+"");
  12400. }
  12401. for(int i = 0; i <= 4; i++){
  12402. Black[i] = new Sprite("Gameframe/Gameframes/Black "+i+"");
  12403. }
  12404. for(int i4 = 0; i4 < 3; i4++) {
  12405. hitMark[i4] = new Sprite("Player/Hits "+i4+"");
  12406. }
  12407. qc = new Sprite("Gameframe/Quickchat");
  12408. }
  12409.  
  12410. public boolean restOrb = false;
  12411. public boolean musicOrb = false;
  12412. public boolean prayClicked = false;
  12413. public boolean prayHover = false;
  12414. public boolean runClicked = true;
  12415. public boolean runHover = false;
  12416.  
  12417. private void rightClickChatButtons() {
  12418. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  12419. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12420. menuActionName[1] = "View All";
  12421. menuActionID[1] = 999;
  12422. menuActionRow = 2;
  12423. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  12424. menuActionName[1] = "View Game";
  12425. menuActionID[1] = 998;
  12426. menuActionRow = 2;
  12427. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  12428. menuActionName[1] = "Hide public";
  12429. menuActionID[1] = 997;
  12430. menuActionName[2] = "Off public";
  12431. menuActionID[2] = 996;
  12432. menuActionName[3] = "Friends public";
  12433. menuActionID[3] = 995;
  12434. menuActionName[4] = "On public";
  12435. menuActionID[4] = 994;
  12436. menuActionName[5] = "View public";
  12437. menuActionID[5] = 993;
  12438. menuActionRow = 6;
  12439. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  12440. menuActionName[1] = "Off private";
  12441. menuActionID[1] = 992;
  12442. menuActionName[2] = "Friends private";
  12443. menuActionID[2] = 991;
  12444. menuActionName[3] = "On private";
  12445. menuActionID[3] = 990;
  12446. menuActionName[4] = "View private";
  12447. menuActionID[4] = 989;
  12448. menuActionRow = 5;
  12449. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  12450. menuActionName[1] = "Off clan chat";
  12451. menuActionID[1] = 1003;
  12452. menuActionName[2] = "Friends clan chat";
  12453. menuActionID[2] = 1002;
  12454. menuActionName[3] = "On clan chat";
  12455. menuActionID[3] = 1001;
  12456. menuActionName[4] = "View clan chat";
  12457. menuActionID[4] = 1000;
  12458. menuActionRow = 5;
  12459. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  12460. menuActionName[1] = "Off trade";
  12461. menuActionID[1] = 987;
  12462. menuActionName[2] = "Friends trade";
  12463. menuActionID[2] = 986;
  12464. menuActionName[3] = "On trade";
  12465. menuActionID[3] = 985;
  12466. menuActionName[4] = "View trade";
  12467. menuActionID[4] = 984;
  12468. menuActionRow = 5;
  12469. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  12470. menuActionName[1] = "Off assist";
  12471. menuActionID[1] = -1;
  12472. menuActionName[2] = "Friends assist";
  12473. menuActionID[2] = -1;
  12474. menuActionName[3] = "On assist";
  12475. menuActionID[3] = -1;
  12476. menuActionName[4] = "View assist";
  12477. menuActionID[4] = -1;
  12478. menuActionRow = 5;
  12479. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  12480. menuActionName[1] = "Report Abuse";
  12481. menuActionID[1] = 606;
  12482. menuActionRow = 2;
  12483. }
  12484. } else if(is474) {
  12485. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12486. menuActionName[1] = "View All";
  12487. menuActionID[1] = 999;
  12488. menuActionRow = 2;
  12489. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  12490. menuActionName[1] = "View Game";
  12491. menuActionID[1] = 998;
  12492. menuActionRow = 2;
  12493. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  12494. menuActionName[1] = "Hide public";
  12495. menuActionID[1] = 997;
  12496. menuActionName[2] = "Off public";
  12497. menuActionID[2] = 996;
  12498. menuActionName[3] = "Friends public";
  12499. menuActionID[3] = 995;
  12500. menuActionName[4] = "On public";
  12501. menuActionID[4] = 994;
  12502. menuActionName[5] = "View public";
  12503. menuActionID[5] = 993;
  12504. menuActionRow = 6;
  12505. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  12506. menuActionName[1] = "Off private";
  12507. menuActionID[1] = 992;
  12508. menuActionName[2] = "Friends private";
  12509. menuActionID[2] = 991;
  12510. menuActionName[3] = "On private";
  12511. menuActionID[3] = 990;
  12512. menuActionName[4] = "View private";
  12513. menuActionID[4] = 989;
  12514. menuActionRow = 5;
  12515. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  12516. menuActionName[1] = "Off clan chat";
  12517. menuActionID[1] = 1003;
  12518. menuActionName[2] = "Friends clan chat";
  12519. menuActionID[2] = 1002;
  12520. menuActionName[3] = "On clan chat";
  12521. menuActionID[3] = 1001;
  12522. menuActionName[4] = "View clan chat";
  12523. menuActionID[4] = 1000;
  12524. menuActionRow = 5;
  12525. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  12526. menuActionName[1] = "Off trade";
  12527. menuActionID[1] = 987;
  12528. menuActionName[2] = "Friends trade";
  12529. menuActionID[2] = 986;
  12530. menuActionName[3] = "On trade";
  12531. menuActionID[3] = 985;
  12532. menuActionName[4] = "View trade";
  12533. menuActionID[4] = 984;
  12534. menuActionRow = 5;
  12535. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  12536. menuActionName[1] = "Report Abuse";
  12537. menuActionID[1] = 606;
  12538. menuActionRow = 2;
  12539. }
  12540. } else {
  12541.  
  12542. }
  12543.  
  12544. }
  12545.  
  12546. public void determineTopTabs(){
  12547. if(is474 || is480 || is508 || is525) {
  12548. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 168 && super.mouseY < 203) {
  12549. menuActionName[1] = "Combat Options";
  12550. menuActionID[1] = 1021;
  12551. menuActionRow = 2;
  12552. } else if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 168 && super.mouseY < 203) {
  12553. menuActionName[1] = "Stats";
  12554. menuActionID[1] = 1022;
  12555. menuActionRow = 2;
  12556. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 168 && super.mouseY < 203) {
  12557. menuActionName[1] = "Quest List";
  12558. menuActionID[1] = 1023;
  12559. menuActionRow = 2;
  12560. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 168 && super.mouseY < 203) {
  12561. menuActionName[1] = "Inventory";
  12562. menuActionID[1] = 1024;
  12563. menuActionRow = 2;
  12564. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 168 && super.mouseY < 203) {
  12565. menuActionName[1] = "Worn Equipment";
  12566. menuActionID[1] = 1030;
  12567. menuActionRow = 2;
  12568. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 168 && super.mouseY < 203) {
  12569. menuActionName[1] = "Prayer";
  12570. menuActionID[1] = 1026;
  12571. menuActionRow = 2;
  12572. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 168 && super.mouseY < 203) {
  12573. menuActionName[1] = "Magic";
  12574. menuActionID[1] = 1027;
  12575. menuActionRow = 2;
  12576. }
  12577. } else if(is562) {
  12578.  
  12579. }
  12580. }
  12581.  
  12582. public void determineBottomTabs(){
  12583. if(is480 || is508 || is525) {
  12584. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  12585. menuActionName[1] = "Logout";
  12586. menuActionID[1] = 1502;
  12587. menuActionRow = 2;
  12588. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  12589. menuActionName[1] = "Clan Chat";
  12590. menuActionID[1] = 1008;
  12591. menuActionRow = 2;
  12592. } else if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
  12593. menuActionName[1] = "Logout";
  12594. menuActionID[1] = 1011;
  12595. menuActionRow = 2;
  12596. }
  12597. } else if(is474 && !is562) {
  12598. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  12599. menuActionName[1] = "Clan Chat";
  12600. menuActionID[1] = 1008;
  12601. menuActionRow = 2;
  12602. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  12603. menuActionName[1] = "Logout";
  12604. menuActionID[1] = 1011;
  12605. menuActionRow = 2;
  12606. }
  12607. } else if(is562){
  12608. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  12609. tabHPos = 0;
  12610. needDrawTabArea = true;
  12611. tabAreaAltered = true;
  12612. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  12613. tabHPos = 1;
  12614. needDrawTabArea = true;
  12615. tabAreaAltered = true;
  12616. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  12617. tabHPos = 2;
  12618. needDrawTabArea = true;
  12619. tabAreaAltered = true;
  12620. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  12621. tabHPos = 3;
  12622. needDrawTabArea = true;
  12623. tabAreaAltered = true;
  12624. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  12625. tabHPos = 4;
  12626. needDrawTabArea = true;
  12627. tabAreaAltered = true;
  12628. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  12629. tabHPos = 5;
  12630. needDrawTabArea = true;
  12631. tabAreaAltered = true;
  12632. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  12633. tabHPos = 6;
  12634. needDrawTabArea = true;
  12635. tabAreaAltered = true;
  12636. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  12637. tabHPos = 7;
  12638. needDrawTabArea = true;
  12639. tabAreaAltered = true;
  12640. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  12641. tabHPos = 15;
  12642. needDrawTabArea = true;
  12643. tabAreaAltered = true;
  12644. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  12645. tabHPos = 8;
  12646. needDrawTabArea = true;
  12647. tabAreaAltered = true;
  12648. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  12649. tabHPos = 9;
  12650. needDrawTabArea = true;
  12651. tabAreaAltered = true;
  12652. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  12653. tabHPos = 10;
  12654. needDrawTabArea = true;
  12655. tabAreaAltered = true;
  12656. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  12657. tabHPos = 11;
  12658. needDrawTabArea = true;
  12659. tabAreaAltered = true;
  12660. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  12661. tabHPos = 12;
  12662. needDrawTabArea = true;
  12663. tabAreaAltered = true;
  12664. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  12665. tabHPos = 13;
  12666. needDrawTabArea = true;
  12667. tabAreaAltered = true;
  12668. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  12669. tabHPos = 14;
  12670. needDrawTabArea = true;
  12671. tabAreaAltered = true;
  12672. } else {
  12673. tabHPos = -1;
  12674. needDrawTabArea = true;
  12675. tabAreaAltered = true;
  12676. }
  12677. if(super.clickMode3 == 1) {
  12678. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  12679. needDrawTabArea = true;
  12680. tabID = 0;
  12681. tabAreaAltered = true;
  12682. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  12683. needDrawTabArea = true;
  12684. tabID = 1;
  12685. tabAreaAltered = true;
  12686. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  12687. needDrawTabArea = true;
  12688. tabID = 2;
  12689. tabAreaAltered = true;
  12690. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  12691. needDrawTabArea = true;
  12692. tabID = 14;
  12693. tabAreaAltered = true;
  12694. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  12695. needDrawTabArea = true;
  12696. tabID = 3;
  12697. tabAreaAltered = true;
  12698. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  12699. needDrawTabArea = true;
  12700. tabID = 4;
  12701. tabAreaAltered = true;
  12702. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  12703. needDrawTabArea = true;
  12704. tabID = 5;
  12705. tabAreaAltered = true;
  12706. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  12707. needDrawTabArea = true;
  12708. tabID = 6;
  12709. tabAreaAltered = true;
  12710. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  12711. needDrawTabArea = true;
  12712. tabID = 16;
  12713. tabAreaAltered = true;
  12714. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  12715. needDrawTabArea = true;
  12716. tabID = 8;
  12717. tabAreaAltered = true;
  12718. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  12719. needDrawTabArea = true;
  12720. tabID = 9;
  12721. tabAreaAltered = true;
  12722. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  12723. needDrawTabArea = true;
  12724. tabID = 7;
  12725. tabAreaAltered = true;
  12726. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  12727. needDrawTabArea = true;
  12728. tabID = 11;
  12729. tabAreaAltered = true;
  12730. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  12731. needDrawTabArea = true;
  12732. tabID = 12;
  12733. tabAreaAltered = true;
  12734. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  12735. needDrawTabArea = true;
  12736. tabID = 13;
  12737. tabAreaAltered = true;
  12738. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  12739. needDrawTabArea = true;
  12740. tabID = 15;
  12741. tabAreaAltered = true;
  12742. }
  12743. }
  12744.  
  12745. }
  12746. if(is474 || is480 || is508 || is525) {
  12747. if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 466 && super.mouseY < 503) {
  12748. menuActionName[1] = "Friend List";
  12749. menuActionID[1] = 1009;
  12750. menuActionRow = 2;
  12751. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 466 && super.mouseY < 503) {
  12752. menuActionName[1] = "Ignore List";
  12753. menuActionID[1] = 1010;
  12754. menuActionRow = 2;
  12755. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 466 && super.mouseY < 503) {
  12756. menuActionName[1] = "Options";
  12757. menuActionID[1] = 1012;
  12758. menuActionRow = 2;
  12759. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 466 && super.mouseY < 503) {
  12760. menuActionName[1] = "Emotes";
  12761. menuActionID[1] = 1013;
  12762. menuActionRow = 2;
  12763. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 466 && super.mouseY < 503) {
  12764. menuActionName[1] = "Music Player";
  12765. menuActionID[1] = 1014;
  12766. menuActionRow = 2;
  12767. }
  12768. }
  12769. }
  12770.  
  12771. private void processMinimapActions() {
  12772.  
  12773.  
  12774.  
  12775. if(is508 == true || is525 == true || is562 == true) {
  12776. if(super.mouseX >= 527 && super.mouseX <= 560 && super.mouseY >= 126 && super.mouseY <= 159) {
  12777. menuActionName[1] = "World Map";
  12778. menuActionID[1] = 1005;
  12779. menuActionRow = 2;
  12780. }
  12781. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  12782. if(!runClicked){
  12783. menuActionName[2] = "Toggle Run-Mode On";
  12784. } else if(runClicked){
  12785. menuActionName[2] = "Toggle Run-Mode Off";
  12786. }
  12787. menuActionID[2] = 1050;
  12788. menuActionRow = 2;
  12789. menuActionName[1] = "Rest";
  12790. menuActionID[1] = 1501;
  12791. menuActionRow = 3;
  12792. }
  12793. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY < 80){
  12794. menuActionName[2] = "Toggle XP Total";
  12795. menuActionID[2] = 1503;
  12796. menuActionRow = 2;
  12797. menuActionName[1] = "Reset XP Total";
  12798. menuActionID[1] = 1504;
  12799. menuActionRow = 3;
  12800. }
  12801. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  12802. if(!prayClicked){
  12803. menuActionName[1] = "Toggle Quick-Prayers On";
  12804. } else if(prayClicked){
  12805. menuActionName[1] = "Toggle Quick-Prayers Off";
  12806. }
  12807. menuActionID[1] = 1500;
  12808. menuActionRow = 2;
  12809. }
  12810. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  12811. if(!prayClicked){
  12812. menuActionName[1] = "Toggle Quick-Prayers On";
  12813. } else if(prayClicked){
  12814. menuActionName[1] = "Toggle Quick-Prayers Off";
  12815. }
  12816. menuActionID[1] = 1500;
  12817. menuActionRow = 2;
  12818. }
  12819. }
  12820. }
  12821.  
  12822. public int getOrbTextColor(int statusInt){
  12823. if(statusInt >= 75 && statusInt <= 100){
  12824. return 0x00FF00;
  12825. } else if(statusInt >= 50 && statusInt <= 74){
  12826. return 0xFFFF00;
  12827. } else if(statusInt >= 25 && statusInt <= 49){
  12828. return 0xFF981F;
  12829. } else {
  12830. return 0xFF0000;
  12831. }
  12832. }
  12833.  
  12834. public int getOrbFill(int statusInt){
  12835. if(statusInt <= 100 && statusInt >= 97) {
  12836. return 0;
  12837. } else if(statusInt <= 96 && statusInt >= 93) {
  12838. return 1;
  12839. } else if(statusInt <= 92 && statusInt >= 89) {
  12840. return 2;
  12841. } else if(statusInt <= 88 && statusInt >= 85) {
  12842. return 3;
  12843. } else if(statusInt <= 84 && statusInt >= 81) {
  12844. return 4;
  12845. } else if(statusInt <= 80 && statusInt >= 77) {
  12846. return 5;
  12847. } else if(statusInt <= 76 && statusInt >= 73) {
  12848. return 6;
  12849. } else if(statusInt <= 72 && statusInt >= 69) {
  12850. return 7;
  12851. } else if(statusInt <= 68 && statusInt >= 65) {
  12852. return 8;
  12853. } else if(statusInt <= 64 && statusInt >= 61) {
  12854. return 9;
  12855. } else if(statusInt <= 60 && statusInt >= 57) {
  12856. return 10;
  12857. } else if(statusInt <= 56 && statusInt >= 53) {
  12858. return 11;
  12859. } else if(statusInt <= 52 && statusInt >= 49) {
  12860. return 12;
  12861. } else if(statusInt <= 48 && statusInt >= 45) {
  12862. return 13;
  12863. } else if(statusInt <= 44 && statusInt >= 41) {
  12864. return 14;
  12865. } else if(statusInt <= 40 && statusInt >= 37) {
  12866. return 15;
  12867. } else if(statusInt <= 36 && statusInt >= 33) {
  12868. return 16;
  12869. } else if(statusInt <= 32 && statusInt >= 29) {
  12870. return 17;
  12871. } else if(statusInt <= 28 && statusInt >= 25) {
  12872. return 18;
  12873. } else if(statusInt <= 24 && statusInt >= 21) {
  12874. return 19;
  12875. } else if(statusInt <= 20 && statusInt >= 17) {
  12876. return 20;
  12877. } else if(statusInt <= 16 && statusInt >= 13) {
  12878. return 21;
  12879. } else if(statusInt <= 12 && statusInt >= 9) {
  12880. return 22;
  12881. } else if(statusInt <= 8 && statusInt >= 7) {
  12882. return 23;
  12883. } else if(statusInt <= 6 && statusInt >= 5) {
  12884. return 24;
  12885. } else if(statusInt <= 4 && statusInt >= 3) {
  12886. return 25;
  12887. } else if(statusInt <= 2 && statusInt >= 1) {
  12888. return 26;
  12889. } else if(statusInt <= 0) {
  12890. return 27;
  12891. }
  12892. return 0;
  12893. }
  12894.  
  12895. public void drawHP() {
  12896. int health;
  12897. String OrbDirectory = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12898. String cHP = RSInterface.interfaceCache[4016].disabledMessage; cHP = cHP.replaceAll("%","");
  12899. int currentHP = Integer.parseInt(cHP);
  12900. String mHP = RSInterface.interfaceCache[4017].disabledMessage; mHP = mHP.replaceAll("%","");
  12901. int maxHP2 = Integer.parseInt(mHP);
  12902. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  12903. ORBS[0] = new Sprite(OrbDirectory+"ORBS 0.PNG", 27, getOrbFill(health));
  12904. if(is480){
  12905. ORBS[14].drawSprite(174, 14);
  12906. } else {
  12907. ORBS[1].drawSprite(174, 14);
  12908. }
  12909. ORBS[2].drawSprite(177, 17);
  12910. ORBS[0].drawSprite(177, 17);
  12911. if(health <= 20){
  12912. if(loopCycle % 20 < 10){
  12913. ORBS[3].drawSprite(183, 25);
  12914. }
  12915. } else {
  12916. ORBS[3].drawSprite(183, 25);
  12917. }
  12918. int Y = 40;
  12919. if(is480){
  12920. Y = 43;
  12921. }
  12922. smallText.method382(getOrbTextColor(health), 218, RSInterface.interfaceCache[4016].disabledMessage, Y, true);
  12923. }
  12924.  
  12925. public void drawPrayer() {
  12926. int prayer;
  12927. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12928. String cPR = RSInterface.interfaceCache[4012].disabledMessage;
  12929. int currentPR = Integer.parseInt(cPR);
  12930. String mPR = RSInterface.interfaceCache[4013].disabledMessage;
  12931. int maxPR2 = Integer.parseInt(mPR);
  12932. prayer = (int)(((double)currentPR / (double)maxPR2) * 100D);
  12933. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(prayer));
  12934. if(!prayClicked){
  12935. if(!is480){
  12936. if(prayHover){
  12937. ORBS[7].drawSprite(190, 53);
  12938. }else if(!prayHover){
  12939. ORBS[1].drawSprite(190, 53);
  12940. }
  12941. } else {
  12942. if(prayHover){
  12943. ORBS[15].drawSprite(190, 53);
  12944. } else {
  12945. ORBS[14].drawSprite(190, 53);
  12946. }
  12947. }
  12948. ORBS[4].drawSprite(193, 56);
  12949. } else if(prayClicked){
  12950. if(!is480){
  12951. if(prayHover){
  12952. ORBS[7].drawSprite(190, 53);
  12953. } else if(!prayHover){
  12954. ORBS[1].drawSprite(190, 53);
  12955. }
  12956. } else {
  12957. if(prayHover){
  12958. ORBS[15].drawSprite(190, 53);
  12959. } else {
  12960. ORBS[14].drawSprite(190, 53);
  12961. }
  12962. }
  12963. ORBS[5].drawSprite(193, 56);
  12964. }
  12965. ORBS[0].drawSprite(194, 56);
  12966. if(prayer <= 25) {
  12967. if(loopCycle % 20 < 10) {
  12968. ORBS[6].drawSprite(197, 60);
  12969. }
  12970. } else {
  12971. ORBS[6].drawSprite(197, 60);
  12972. }
  12973. int Y = 79;
  12974. if(is480){
  12975. Y = 82;
  12976. }
  12977. smallText.method382(getOrbTextColor(prayer), 234, RSInterface.interfaceCache[4012].disabledMessage, Y, true);
  12978. }
  12979.  
  12980. public void drawRunOrb(){
  12981. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12982. String cEn = RSInterface.interfaceCache[149].disabledMessage; cEn = cEn.replaceAll("%","");
  12983. int currentEner = Integer.parseInt(cEn);
  12984. energy = (int)(((double)currentEner / 100) * 100D);
  12985. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(energy));
  12986. if(!runClicked){
  12987. if(!is480){
  12988. if(runHover){
  12989. ORBS[7].drawSprite(190, 92);
  12990. } else{
  12991. ORBS[1].drawSprite(190, 92);
  12992. }
  12993. } else {
  12994. ORBS[14].drawSprite(190, 92);
  12995. }
  12996. ORBS[10].drawSprite(193, 95);
  12997. if(energy != 100){
  12998. ORBS[0].drawSprite(193, 95);
  12999. }
  13000. ORBS[8].drawSprite(199, 100);
  13001. } else {
  13002. if(!is480){
  13003. if(runHover){
  13004. ORBS[7].drawSprite(190, 92);
  13005. } else {
  13006. ORBS[1].drawSprite(190, 92);
  13007. }
  13008. } else {
  13009. ORBS[14].drawSprite(190, 92);
  13010. }
  13011. ORBS[11].drawSprite(193, 95);
  13012. if(energy != 100){
  13013. ORBS[0].drawSprite(193, 95);
  13014. }
  13015. ORBS[9].drawSprite(199, 100);
  13016. }
  13017. int Y = 117;
  13018. if(is480){
  13019. Y = 120;
  13020. }
  13021. smallText.method382(getOrbTextColor(energy), 234, ""+energy, Y, true);
  13022. }
  13023.  
  13024. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  13025. )
  13026. {
  13027. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  13028. {
  13029. if(lowMem && j != plane)
  13030. return;
  13031. int i2 = 0;
  13032. if(j1 == 0)
  13033. i2 = worldController.method300(j, i1, i);
  13034. if(j1 == 1)
  13035. i2 = worldController.method301(j, i1, i);
  13036. if(j1 == 2)
  13037. i2 = worldController.method302(j, i1, i);
  13038. if(j1 == 3)
  13039. i2 = worldController.method303(j, i1, i);
  13040. if(i2 != 0)
  13041. {
  13042. int i3 = worldController.method304(j, i1, i, i2);
  13043. int j2 = i2 >> 14 & 0x7fff;
  13044. int k2 = i3 & 0x1f;
  13045. int l2 = i3 >> 6;
  13046. if(j1 == 0)
  13047. {
  13048. worldController.method291(i1, j, i, (byte)-119);
  13049. ObjectDef class46 = ObjectDef.forID(j2);
  13050. if(class46.aBoolean767)
  13051. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  13052. }
  13053. if(j1 == 1)
  13054. worldController.method292(i, j, i1);
  13055. if(j1 == 2)
  13056. {
  13057. worldController.method293(j, i1, i);
  13058. ObjectDef class46_1 = ObjectDef.forID(j2);
  13059. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  13060. return;
  13061. if(class46_1.aBoolean767)
  13062. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  13063. }
  13064. if(j1 == 3)
  13065. {
  13066. worldController.method294(j, i, i1);
  13067. ObjectDef class46_2 = ObjectDef.forID(j2);
  13068. if(class46_2.aBoolean767 && class46_2.hasActions)
  13069. aClass11Array1230[j].method218(i, i1);
  13070. }
  13071. }
  13072. if(k1 >= 0)
  13073. {
  13074. int j3 = j;
  13075. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  13076. j3++;
  13077. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  13078. }
  13079. }
  13080. }
  13081.  
  13082. private void updatePlayers(int i, Stream stream)
  13083. {
  13084. anInt839 = 0;
  13085. anInt893 = 0;
  13086. method117(stream);
  13087. method134(stream);
  13088. method91(stream, i);
  13089. method49(stream);
  13090. for(int k = 0; k < anInt839; k++)
  13091. {
  13092. int l = anIntArray840[k];
  13093. if(playerArray[l].anInt1537 != loopCycle)
  13094. playerArray[l] = null;
  13095. }
  13096.  
  13097. if(stream.currentOffset != i)
  13098. {
  13099. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  13100. throw new RuntimeException("eek");
  13101. }
  13102. for(int i1 = 0; i1 < playerCount; i1++)
  13103. if(playerArray[playerIndices[i1]] == null)
  13104. {
  13105. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  13106. throw new RuntimeException("eek");
  13107. }
  13108.  
  13109. }
  13110.  
  13111. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  13112. {
  13113. int l1 = 2048 - k & 0x7ff;
  13114. int i2 = 2048 - j1 & 0x7ff;
  13115. int j2 = 0;
  13116. int k2 = 0;
  13117. int l2 = j;
  13118. if(l1 != 0)
  13119. {
  13120. int i3 = Model.modelIntArray1[l1];
  13121. int k3 = Model.modelIntArray2[l1];
  13122. int i4 = k2 * k3 - l2 * i3 >> 16;
  13123. l2 = k2 * i3 + l2 * k3 >> 16;
  13124. k2 = i4;
  13125. }
  13126. if(i2 != 0)
  13127. {
  13128. /* xxx if(cameratoggle){
  13129. if(zoom == 0)
  13130. zoom = k2;
  13131. if(lftrit == 0)
  13132. lftrit = j2;
  13133. if(fwdbwd == 0)
  13134. fwdbwd = l2;
  13135. k2 = zoom;
  13136. j2 = lftrit;
  13137. l2 = fwdbwd;
  13138. }
  13139. */
  13140. int j3 = Model.modelIntArray1[i2];
  13141. int l3 = Model.modelIntArray2[i2];
  13142. int j4 = l2 * j3 + j2 * l3 >> 16;
  13143. l2 = l2 * l3 - j2 * j3 >> 16;
  13144. j2 = j4;
  13145. }
  13146. xCameraPos = l - j2;
  13147. zCameraPos = i1 - k2;
  13148. yCameraPos = k1 - l2;
  13149. yCameraCurve = k;
  13150. xCameraCurve = j1;
  13151. }
  13152.  
  13153. public void updateStrings(String str, int i) {
  13154. switch(i) {
  13155. case 1675: sendFrame126(str, 17508); break;//Stab
  13156. case 1676: sendFrame126(str, 17509); break;//Slash
  13157. case 1677: sendFrame126(str, 17510); break;//Cursh
  13158. case 1678: sendFrame126(str, 17511); break;//Magic
  13159. case 1679: sendFrame126(str, 17512); break;//Range
  13160. case 1680: sendFrame126(str, 17513); break;//Stab
  13161. case 1681: sendFrame126(str, 17514); break;//Slash
  13162. case 1682: sendFrame126(str, 17515); break;//Crush
  13163. case 1683: sendFrame126(str, 17516); break;//Magic
  13164. case 1684: sendFrame126(str, 17517); break;//Range
  13165. case 1686: sendFrame126(str, 17518); break;//Strength
  13166. case 1687: sendFrame126(str, 17519); break;//Prayer
  13167. }
  13168. }
  13169.  
  13170. public void sendFrame126(String str,int i) {
  13171. RSInterface.interfaceCache[i].disabledMessage = str;
  13172. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  13173. needDrawTabArea = true;
  13174. }
  13175.  
  13176. public void sendPacket185(int button,int toggle,int interfaceType) {
  13177. switch(interfaceType) {
  13178. case 135:
  13179. RSInterface class9 = RSInterface.interfaceCache[button];
  13180. boolean flag8 = true;
  13181. if(class9.contentType > 0)
  13182. flag8 = promptUserForInput(class9);
  13183. if(flag8) {
  13184. stream.createFrame(185);
  13185. stream.writeWord(button);
  13186. }
  13187. break;
  13188. case 646:
  13189. stream.createFrame(185);
  13190. stream.writeWord(button);
  13191. RSInterface class9_2 = RSInterface.interfaceCache[button];
  13192. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  13193. if(variousSettings[toggle] != class9_2.requiredValues[0]) {
  13194. variousSettings[toggle] = class9_2.requiredValues[0];
  13195. method33(toggle);
  13196. needDrawTabArea = true;
  13197. }
  13198. }
  13199. break;
  13200. case 169:
  13201. stream.createFrame(185);
  13202. stream.writeWord(button);
  13203. RSInterface class9_3 = RSInterface.interfaceCache[button];
  13204. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  13205. variousSettings[toggle] = 1 - variousSettings[toggle];
  13206. method33(toggle);
  13207. needDrawTabArea = true;
  13208. }
  13209. switch(button) {
  13210. case 19136:
  13211. System.out.println("toggle = "+toggle);
  13212. if(toggle == 0)
  13213. sendFrame36(173,toggle);
  13214. if(toggle == 1)
  13215. sendPacket185(153,173,646);
  13216. break;
  13217. }
  13218. break;
  13219. }
  13220. }
  13221.  
  13222. public void sendFrame36(int id,int state) {
  13223. anIntArray1045[id] = state;
  13224. if(variousSettings[id] != state) {
  13225. variousSettings[id] = state;
  13226. method33(id);
  13227. needDrawTabArea = true;
  13228. if(dialogID != -1)
  13229. inputTaken = true;
  13230. }
  13231. }
  13232.  
  13233. public void sendFrame219() {
  13234.  
  13235.  
  13236. if(invOverlayInterfaceID != -1) {
  13237. invOverlayInterfaceID = -1;
  13238. needDrawTabArea = true;
  13239. tabAreaAltered = true;
  13240. }
  13241. if(backDialogID != -1) {
  13242. backDialogID = -1;
  13243. inputTaken = true;
  13244. }
  13245. if(inputDialogState != 0) {
  13246. inputDialogState = 0;
  13247. inputTaken = true;
  13248. }
  13249. openInterfaceID = -1;
  13250. aBoolean1149 = false;
  13251. }
  13252.  
  13253. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  13254. if(backDialogID != -1) {
  13255. backDialogID = -1;
  13256. inputTaken = true;
  13257. }
  13258. if(inputDialogState != 0) {
  13259. inputDialogState = 0;
  13260. inputTaken = true;
  13261. }
  13262. openInterfaceID = interfaceID;
  13263. invOverlayInterfaceID = sideInterfaceID;
  13264. needDrawTabArea = true;
  13265. tabAreaAltered = true;
  13266. aBoolean1149 = false;
  13267. }
  13268.  
  13269. private boolean parsePacket() {
  13270.  
  13271.  
  13272. if(socketStream == null)
  13273. return false;
  13274. try {
  13275. int i = socketStream.available();
  13276. if(i == 0)
  13277. return false;
  13278. if(pktType == -1) {
  13279. socketStream.flushInputStream(inStream.buffer, 1);
  13280. pktType = inStream.buffer[0] & 0xff;
  13281. if(encryption != null)
  13282. pktType = pktType - encryption.getNextKey() & 0xff;
  13283. pktSize = SizeConstants.packetSizes[pktType];
  13284. i--;
  13285. }
  13286. if(pktSize == -1)
  13287. if(i > 0) {
  13288. socketStream.flushInputStream(inStream.buffer, 1);
  13289. pktSize = inStream.buffer[0] & 0xff;
  13290. i--;
  13291. } else {
  13292. return false;
  13293. }
  13294. if(pktSize == -2)
  13295. if(i > 1) {
  13296. socketStream.flushInputStream(inStream.buffer, 2);
  13297. inStream.currentOffset = 0;
  13298. pktSize = inStream.readUnsignedWord();
  13299. i -= 2;
  13300. } else {
  13301. return false;
  13302. }
  13303. if(i < pktSize)
  13304. return false;
  13305. inStream.currentOffset = 0;
  13306. socketStream.flushInputStream(inStream.buffer, pktSize);
  13307. anInt1009 = 0;
  13308. anInt843 = anInt842;
  13309. anInt842 = anInt841;
  13310. anInt841 = pktType;
  13311. switch(pktType) {
  13312. case 81:
  13313. updatePlayers(pktSize, inStream);
  13314. aBoolean1080 = false;
  13315. pktType = -1;
  13316. return true;
  13317.  
  13318. case 176:
  13319. daysSinceRecovChange = inStream.method427();
  13320. unreadMessages = inStream.method435();
  13321. membersInt = inStream.readUnsignedByte();
  13322. anInt1193 = inStream.method440();
  13323. daysSinceLastLogin = inStream.readUnsignedWord();
  13324. if(anInt1193 != 0 && openInterfaceID == -1) {
  13325. signlink.dnslookup(TextClass.method586(anInt1193));
  13326. clearTopInterfaces();
  13327. char c = '\u028A';
  13328. if(daysSinceRecovChange != 201 || membersInt == 1)
  13329. c = '\u028F';
  13330. reportAbuseInput = "";
  13331. canMute = false;
  13332. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13333. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  13334. continue;
  13335. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13336.  
  13337. }
  13338. }
  13339. pktType = -1;
  13340. return true;
  13341.  
  13342. case 64:
  13343. anInt1268 = inStream.method427();
  13344. anInt1269 = inStream.method428();
  13345. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  13346. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  13347. if(groundArray[plane][j][l9] != null) {
  13348. groundArray[plane][j][l9] = null;
  13349. spawnGroundItem(j, l9);
  13350. }
  13351. }
  13352. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  13353. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  13354. class30_sub1.anInt1294 = 0;
  13355. pktType = -1;
  13356. return true;
  13357.  
  13358. case 185:
  13359. int k = inStream.method436();
  13360. RSInterface.interfaceCache[k].disabledMediaType = 3;
  13361. if(myPlayer.desc == null)
  13362. 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];
  13363. else
  13364. RSInterface.interfaceCache[k].disabledMediaID = (int)(0x12345678L + myPlayer.desc.interfaceType);
  13365. pktType = -1;
  13366. return true;
  13367.  
  13368. /* Clan chat packet */
  13369. case 217:
  13370. try {
  13371. name = inStream.readString();
  13372. disabledMessage = inStream.readString();
  13373. clanname = inStream.readString();
  13374. rights = inStream.readUnsignedWord();
  13375. //disabledMessage = TextInput.processText(disabledMessage);
  13376. //disabledMessage = Censor.doCensor(disabledMessage);
  13377. System.out.println(clanname);
  13378. pushMessage(disabledMessage, 16, name);
  13379. } catch(Exception e) {
  13380. e.printStackTrace();
  13381. }
  13382. pktType = -1;
  13383. return true;
  13384.  
  13385. case 107:
  13386. aBoolean1160 = false;
  13387. for(int l = 0; l < 5; l++)
  13388. aBooleanArray876[l] = false;
  13389. pktType = -1;
  13390. return true;
  13391.  
  13392. case 72:
  13393. int i1 = inStream.method434();
  13394. RSInterface class9 = RSInterface.interfaceCache[i1];
  13395. for(int k15 = 0; k15 < class9.inventory.length; k15++) {
  13396. class9.inventory[k15] = -1;
  13397. class9.inventory[k15] = 0;
  13398. }
  13399. pktType = -1;
  13400. return true;
  13401.  
  13402. case 214:
  13403. ignoreCount = pktSize / 8;
  13404. for(int j1 = 0; j1 < ignoreCount; j1++)
  13405. ignoreListAsLongs[j1] = inStream.readQWord();
  13406. pktType = -1;
  13407. return true;
  13408.  
  13409. case 166:
  13410. aBoolean1160 = true;
  13411. anInt1098 = inStream.readUnsignedByte();
  13412. anInt1099 = inStream.readUnsignedByte();
  13413. anInt1100 = inStream.readUnsignedWord();
  13414. anInt1101 = inStream.readUnsignedByte();
  13415. anInt1102 = inStream.readUnsignedByte();
  13416. if(anInt1102 >= 100) {
  13417. xCameraPos = anInt1098 * 128 + 64;
  13418. yCameraPos = anInt1099 * 128 + 64;
  13419. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  13420. }
  13421. pktType = -1;
  13422. return true;
  13423.  
  13424. case 134:
  13425. needDrawTabArea = true;
  13426. int k1 = inStream.readUnsignedByte();
  13427. int i10 = inStream.method439();
  13428. int l15 = inStream.readUnsignedByte();
  13429. int oldXp = currentExp[k1];
  13430. if(drawXpBar) {
  13431. drawFlag = true;
  13432. }
  13433. currentExp[k1] = i10;
  13434. currentStats[k1] = l15;
  13435. maxStats[k1] = 1;
  13436. testXp += i10-oldXp;
  13437. xpToDraw += i10-oldXp;
  13438. if(testXp == currentExp[k1]) {
  13439. testXp = 0;
  13440. xpToDraw = 0;
  13441. }
  13442. for(int k20 = 0; k20 < 98; k20++)
  13443. if(i10 >= anIntArray1019[k20])
  13444. maxStats[k1] = k20 + 2;
  13445. pktType = -1;
  13446. return true;
  13447.  
  13448. case 71:
  13449. int l1 = inStream.readUnsignedWord();
  13450. int j10 = inStream.method426();
  13451. if(l1 == 65535)
  13452. l1 = -1;
  13453. tabInterfaceIDs[j10] = l1;
  13454. needDrawTabArea = true;
  13455. tabAreaAltered = true;
  13456. pktType = -1;
  13457. return true;
  13458.  
  13459. case 74:
  13460. int i2 = inStream.method434();
  13461. if(i2 == 65535)
  13462. i2 = -1;
  13463. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  13464. nextSong = i2;
  13465. songChanging = true;
  13466. onDemandFetcher.method558(2, nextSong);
  13467. }
  13468. currentSong = i2;
  13469. pktType = -1;
  13470. return true;
  13471.  
  13472. case 121:
  13473. int j2 = inStream.method436();
  13474. int k10 = inStream.method435();
  13475. if(musicEnabled && !lowMem) {
  13476. nextSong = j2;
  13477. songChanging = false;
  13478. onDemandFetcher.method558(2, nextSong);
  13479. prevSong = k10;
  13480. }
  13481. pktType = -1;
  13482. return true;
  13483.  
  13484. case 109:
  13485. resetLogout();
  13486. pktType = -1;
  13487. return false;
  13488.  
  13489. case 70:
  13490. int k2 = inStream.readSignedWord();
  13491. int l10 = inStream.method437();
  13492. int i16 = inStream.method434();
  13493. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  13494. class9_5.xOffset = k2;
  13495. class9_5.yOffset = l10;
  13496. pktType = -1;
  13497. return true;
  13498.  
  13499. case 73:
  13500. case 241:
  13501. int l2 = anInt1069;
  13502. int i11 = anInt1070;
  13503. if(pktType == 73) {
  13504. l2 = inStream.method435();
  13505. i11 = inStream.readUnsignedWord();
  13506. aBoolean1159 = false;
  13507. }
  13508. if(pktType == 241) {
  13509. i11 = inStream.method435();
  13510. inStream.initBitAccess();
  13511. for(int j16 = 0; j16 < 4; j16++) {
  13512. for(int l20 = 0; l20 < 13; l20++) {
  13513. for(int j23 = 0; j23 < 13; j23++) {
  13514. int i26 = inStream.readBits(1);
  13515. if(i26 == 1)
  13516. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  13517. else
  13518. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  13519. }
  13520. }
  13521. }
  13522. inStream.finishBitAccess();
  13523. l2 = inStream.readUnsignedWord();
  13524. aBoolean1159 = true;
  13525. }
  13526. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2)
  13527. {
  13528. pktType = -1;
  13529. return true;
  13530. }
  13531. anInt1069 = l2;
  13532. anInt1070 = i11;
  13533. baseX = (anInt1069 - 6) * 8;
  13534. baseY = (anInt1070 - 6) * 8;
  13535. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  13536. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  13537. aBoolean1141 = true;
  13538. loadingStage = 1;
  13539. aLong824 = System.currentTimeMillis();
  13540. inGameScreen.initDrawingArea();
  13541. loadingPleaseWait.drawSprite(8,9);;
  13542. inGameScreen.drawGraphics(4, super.graphics, 4);
  13543. if(pktType == 73) {
  13544. int k16 = 0;
  13545. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  13546. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  13547. k16++;
  13548. }
  13549. aByteArrayArray1183 = new byte[k16][];
  13550. aByteArrayArray1247 = new byte[k16][];
  13551. anIntArray1234 = new int[k16];
  13552. anIntArray1235 = new int[k16];
  13553. anIntArray1236 = new int[k16];
  13554. k16 = 0;
  13555. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  13556. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  13557. anIntArray1234[k16] = (l23 << 8) + j26;
  13558. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  13559. anIntArray1235[k16] = -1;
  13560. anIntArray1236[k16] = -1;
  13561. k16++;
  13562. } else {
  13563. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  13564. if(k28 != -1)
  13565. onDemandFetcher.method558(3, k28);
  13566. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  13567. if(j30 != -1)
  13568. onDemandFetcher.method558(3, j30);
  13569. k16++;
  13570. }
  13571. }
  13572. }
  13573. }
  13574. if(pktType == 241) {
  13575. int l16 = 0;
  13576. int ai[] = new int[676];
  13577. for(int i24 = 0; i24 < 4; i24++) {
  13578. for(int k26 = 0; k26 < 13; k26++) {
  13579. for(int l28 = 0; l28 < 13; l28++) {
  13580. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  13581. if(k30 != -1) {
  13582. int k31 = k30 >> 14 & 0x3ff;
  13583. int i32 = k30 >> 3 & 0x7ff;
  13584. int k32 = (k31 / 8 << 8) + i32 / 8;
  13585. for(int j33 = 0; j33 < l16; j33++) {
  13586. if(ai[j33] != k32)
  13587. continue;
  13588. k32 = -1;
  13589.  
  13590. }
  13591. if(k32 != -1)
  13592. ai[l16++] = k32;
  13593. }
  13594. }
  13595. }
  13596. }
  13597. aByteArrayArray1183 = new byte[l16][];
  13598. aByteArrayArray1247 = new byte[l16][];
  13599. anIntArray1234 = new int[l16];
  13600. anIntArray1235 = new int[l16];
  13601. anIntArray1236 = new int[l16];
  13602. for(int l26 = 0; l26 < l16; l26++) {
  13603. int i29 = anIntArray1234[l26] = ai[l26];
  13604. int l30 = i29 >> 8 & 0xff;
  13605. int l31 = i29 & 0xff;
  13606. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  13607. if(j32 != -1)
  13608. onDemandFetcher.method558(3, j32);
  13609. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  13610. if(i33 != -1)
  13611. onDemandFetcher.method558(3, i33);
  13612. }
  13613. }
  13614. int i17 = baseX - anInt1036;
  13615. int j21 = baseY - anInt1037;
  13616. anInt1036 = baseX;
  13617. anInt1037 = baseY;
  13618. for(int j24 = 0; j24 < 16384; j24++) {
  13619. NPC npc = npcArray[j24];
  13620. if(npc != null) {
  13621. for(int j29 = 0; j29 < 10; j29++) {
  13622. npc.smallX[j29] -= i17;
  13623. npc.smallY[j29] -= j21;
  13624. }
  13625. npc.x -= i17 * 128;
  13626. npc.y -= j21 * 128;
  13627. }
  13628. }
  13629. for(int i27 = 0; i27 < maxPlayers; i27++) {
  13630. Player player = playerArray[i27];
  13631. if(player != null) {
  13632. for(int i31 = 0; i31 < 10; i31++) {
  13633. player.smallX[i31] -= i17;
  13634. player.smallY[i31] -= j21;
  13635. }
  13636. player.x -= i17 * 128;
  13637. player.y -= j21 * 128;
  13638. }
  13639. }
  13640. aBoolean1080 = true;
  13641. byte byte1 = 0;
  13642. byte byte2 = 104;
  13643. byte byte3 = 1;
  13644. if(i17 < 0) {
  13645. byte1 = 103;
  13646. byte2 = -1;
  13647. byte3 = -1;
  13648. }
  13649. byte byte4 = 0;
  13650. byte byte5 = 104;
  13651. byte byte6 = 1;
  13652. if(j21 < 0) {
  13653. byte4 = 103;
  13654. byte5 = -1;
  13655. byte6 = -1;
  13656. }
  13657. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  13658. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  13659. int i34 = k33 + i17;
  13660. int j34 = l33 + j21;
  13661. for(int k34 = 0; k34 < 4; k34++)
  13662. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  13663. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  13664. else
  13665. groundArray[k34][k33][l33] = null;
  13666. }
  13667. }
  13668. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  13669. class30_sub1_1.anInt1297 -= i17;
  13670. class30_sub1_1.anInt1298 -= j21;
  13671. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  13672. class30_sub1_1.unlink();
  13673. }
  13674. if(destX != 0) {
  13675. destX -= i17;
  13676. destY -= j21;
  13677. }
  13678. aBoolean1160 = false;
  13679. pktType = -1;
  13680. return true;
  13681.  
  13682. case 208:
  13683. int i3 = inStream.method437();
  13684. if(i3 >= 0)
  13685. method60(i3);
  13686. anInt1018 = i3;
  13687. pktType = -1;
  13688. return true;
  13689.  
  13690. case 99:
  13691. /*
  13692. * Black map, mape state 2, causes blackness
  13693. */
  13694. anInt1021 = inStream.readUnsignedByte();
  13695. pktType = -1;
  13696. return true;
  13697.  
  13698. case 75:
  13699. int j3 = inStream.method436();
  13700. int j11 = inStream.method436();
  13701. RSInterface.interfaceCache[j11].disabledMediaType = 2;
  13702. RSInterface.interfaceCache[j11].disabledMediaID = j3;
  13703. pktType = -1;
  13704. return true;
  13705.  
  13706. case 114:
  13707. anInt1104 = inStream.method434() * 30;
  13708. pktType = -1;
  13709. return true;
  13710.  
  13711. case 60:
  13712. anInt1269 = inStream.readUnsignedByte();
  13713. anInt1268 = inStream.method427();
  13714. while(inStream.currentOffset < pktSize) {
  13715. int k3 = inStream.readUnsignedByte();
  13716. method137(inStream, k3);
  13717. }
  13718. pktType = -1;
  13719. return true;
  13720.  
  13721. case 35:
  13722. int l3 = inStream.readUnsignedByte();
  13723. int k11 = inStream.readUnsignedByte();
  13724. int j17 = inStream.readUnsignedByte();
  13725. int k21 = inStream.readUnsignedByte();
  13726. aBooleanArray876[l3] = true;
  13727. anIntArray873[l3] = k11;
  13728. anIntArray1203[l3] = j17;
  13729. anIntArray928[l3] = k21;
  13730. anIntArray1030[l3] = 0;
  13731. pktType = -1;
  13732. return true;
  13733.  
  13734. case 174:
  13735.  
  13736. /*Empty Following Packet*/
  13737. followPlayer = 0;
  13738. followNPC = 0;
  13739. int l11z = inStream.readUnsignedWord();
  13740. int iq = inStream.readUnsignedByte();
  13741. followDistance = inStream.readUnsignedWord();
  13742. if (iq == 0)
  13743. {
  13744. followNPC = l11z;
  13745. }
  13746. else if (iq == 1)
  13747. {
  13748. followPlayer = l11z;
  13749. }
  13750. pktType = -1;
  13751. return true;
  13752.  
  13753. case 104:
  13754. int j4 = inStream.method427();
  13755. int i12 = inStream.method426();
  13756. String s6 = inStream.readString();
  13757. if(j4 >= 1 && j4 <= 5) {
  13758. if(s6.equalsIgnoreCase("null"))
  13759. s6 = null;
  13760. atPlayerActions[j4 - 1] = s6;
  13761. atPlayerArray[j4 - 1] = i12 == 0;
  13762. }
  13763. pktType = -1;
  13764. return true;
  13765.  
  13766. case 78:
  13767. destX = 0;
  13768. pktType = -1;
  13769. return true;
  13770.  
  13771. case 253:
  13772. String s = inStream.readString();
  13773. if(s.startsWith("Alert##")) {
  13774. String[] args = s.split("##");
  13775. if (args.length == 3) {
  13776. alertHandler.alert = new Alert("Notification", args[1], args[2]);
  13777. } else if (args.length == 4) {
  13778. alertHandler.alert = new Alert(args[1], args[2], args[3]);
  13779. }
  13780. pktType = -1;
  13781. return true;
  13782. }
  13783. if(s.endsWith(":tradereq:")) {
  13784. String s3 = s.substring(0, s.indexOf(":"));
  13785. long l17 = TextClass.longForName(s3);
  13786. boolean flag2 = false;
  13787. for(int j27 = 0; j27 < ignoreCount; j27++) {
  13788. if(ignoreListAsLongs[j27] != l17)
  13789. continue;
  13790. flag2 = true;
  13791. }
  13792. if(!flag2 && anInt1251 == 0)
  13793. pushMessage("wishes to trade with you.", 4, s3);
  13794. } else if (s.endsWith(":clan:")) {
  13795. String s4 = s.substring(0, s.indexOf(":"));
  13796. long l18 = TextClass.longForName(s4);
  13797. pushMessage("Clan: ", 8, s4);
  13798. } else if(s.endsWith("#url#")) {
  13799. String text = s.substring(0, s.indexOf("-"));
  13800. s = s.substring(text.length()+1).trim();
  13801. String link = s.substring(0, s.indexOf("#"));
  13802. pushMessage(text, 9, link);
  13803. } else if(s.endsWith(":resetautocast:")) {
  13804. Autocast = false;
  13805. autocastId = 0;
  13806. magicAuto.drawSprite(1000, 1000);
  13807. } else if(s.endsWith(":duelreq:")) {
  13808. String s4 = s.substring(0, s.indexOf(":"));
  13809. long l18 = TextClass.longForName(s4);
  13810. boolean flag3 = false;
  13811. for(int k27 = 0; k27 < ignoreCount; k27++) {
  13812. if(ignoreListAsLongs[k27] != l18)
  13813. continue;
  13814. flag3 = true;
  13815.  
  13816. }
  13817. if(!flag3 && anInt1251 == 0)
  13818. pushMessage("wishes to duel with you.", 8, s4);
  13819. } else if(s.endsWith(":chalreq:")) {
  13820. String s5 = s.substring(0, s.indexOf(":"));
  13821. long l19 = TextClass.longForName(s5);
  13822. boolean flag4 = false;
  13823. for(int l27 = 0; l27 < ignoreCount; l27++) {
  13824. if(ignoreListAsLongs[l27] != l19)
  13825. continue;
  13826. flag4 = true;
  13827.  
  13828. }
  13829. if(!flag4 && anInt1251 == 0) {
  13830. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  13831. pushMessage(s8, 8, s5);
  13832. }
  13833. } else {
  13834. pushMessage(s, 0, "");
  13835. }
  13836. pktType = -1;
  13837. return true;
  13838.  
  13839. case 1:
  13840. for(int k4 = 0; k4 < playerArray.length; k4++)
  13841. if(playerArray[k4] != null)
  13842. playerArray[k4].anim = -1;
  13843. for(int j12 = 0; j12 < npcArray.length; j12++)
  13844. if(npcArray[j12] != null)
  13845. npcArray[j12].anim = -1;
  13846. pktType = -1;
  13847. return true;
  13848.  
  13849. case 50:
  13850. long l4 = inStream.readQWord();
  13851. int i18 = inStream.readUnsignedByte();
  13852. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  13853. for(int k24 = 0; k24 < friendsCount; k24++) {
  13854. if(l4 != friendsListAsLongs[k24])
  13855. continue;
  13856. if(friendsNodeIDs[k24] != i18) {
  13857. friendsNodeIDs[k24] = i18;
  13858. needDrawTabArea = true;
  13859. if(i18 >= 2) {
  13860. pushMessage(s7 + " has logged in.", 5, "");
  13861. }
  13862. if(i18 <= 1) {
  13863. pushMessage(s7 + " has logged out.", 5, "");
  13864. }
  13865. }
  13866. s7 = null;
  13867.  
  13868. }
  13869. if(s7 != null && friendsCount < 200) {
  13870. friendsListAsLongs[friendsCount] = l4;
  13871. friendsList[friendsCount] = s7;
  13872. friendsNodeIDs[friendsCount] = i18;
  13873. friendsCount++;
  13874. needDrawTabArea = true;
  13875. }
  13876. for(boolean flag6 = false; !flag6;) {
  13877. flag6 = true;
  13878. for(int index = 0; index < friendsCount - 1; index++)
  13879. if(friendsNodeIDs[index] != nodeID && friendsNodeIDs[index + 1] == nodeID || friendsNodeIDs[index] == 0 && friendsNodeIDs[index + 1] != 0) {
  13880. int j31 = friendsNodeIDs[index];
  13881. friendsNodeIDs[index] = friendsNodeIDs[index + 1];
  13882. friendsNodeIDs[index + 1] = j31;
  13883. String s10 = friendsList[index];
  13884. friendsList[index] = friendsList[index + 1];
  13885. friendsList[index + 1] = s10;
  13886. long l32 = friendsListAsLongs[index];
  13887. friendsListAsLongs[index] = friendsListAsLongs[index + 1];
  13888. friendsListAsLongs[index + 1] = l32;
  13889. needDrawTabArea = true;
  13890. flag6 = false;
  13891. }
  13892. }//friends list sorting
  13893. pktType = -1;
  13894. return true;
  13895.  
  13896. case 110:
  13897. if(tabID == 12)
  13898. needDrawTabArea = true;
  13899. energy = inStream.readUnsignedByte();
  13900. pktType = -1;
  13901. return true;
  13902.  
  13903. case 254:
  13904. anInt855 = inStream.readUnsignedByte();
  13905. if(anInt855 == 1)
  13906. anInt1222 = inStream.readUnsignedWord();
  13907. if(anInt855 >= 2 && anInt855 <= 6) {
  13908. if(anInt855 == 2) {
  13909. anInt937 = 64;
  13910. anInt938 = 64;
  13911. }
  13912. if(anInt855 == 3) {
  13913. anInt937 = 0;
  13914. anInt938 = 64;
  13915. }
  13916. if(anInt855 == 4) {
  13917. anInt937 = 128;
  13918. anInt938 = 64;
  13919. }
  13920. if(anInt855 == 5) {
  13921. anInt937 = 64;
  13922. anInt938 = 0;
  13923. }
  13924. if(anInt855 == 6) {
  13925. anInt937 = 64;
  13926. anInt938 = 128;
  13927. }
  13928. anInt855 = 2;
  13929. anInt934 = inStream.readUnsignedWord();
  13930. anInt935 = inStream.readUnsignedWord();
  13931. anInt936 = inStream.readUnsignedByte();
  13932. }
  13933. if(anInt855 == 10)
  13934. anInt933 = inStream.readUnsignedWord();
  13935. pktType = -1;
  13936. return true;
  13937.  
  13938. case 248:
  13939. int i5 = inStream.method435();
  13940. int k12 = inStream.readUnsignedWord();
  13941. if(backDialogID != -1) {
  13942. backDialogID = -1;
  13943. inputTaken = true;
  13944. }
  13945. if(inputDialogState != 0) {
  13946. inputDialogState = 0;
  13947. inputTaken = true;
  13948. }
  13949. openInterfaceID = i5;
  13950. invOverlayInterfaceID = k12;
  13951. needDrawTabArea = true;
  13952. tabAreaAltered = true;
  13953. aBoolean1149 = false;
  13954. pktType = -1;
  13955. return true;
  13956.  
  13957. case 79:
  13958. int j5 = inStream.method434();
  13959. int l12 = inStream.method435();
  13960. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  13961. if(class9_3 != null && class9_3.interfaceType == 0) {
  13962. if(l12 < 0)
  13963. l12 = 0;
  13964. if(l12 > class9_3.scrollMax - class9_3.height)
  13965. l12 = class9_3.scrollMax - class9_3.height;
  13966. class9_3.scrollPosition = l12;
  13967. }
  13968. pktType = -1;
  13969. return true;
  13970.  
  13971. case 68:
  13972. for(int k5 = 0; k5 < variousSettings.length; k5++)
  13973. if(variousSettings[k5] != anIntArray1045[k5]) {
  13974. variousSettings[k5] = anIntArray1045[k5];
  13975. method33(k5);
  13976. needDrawTabArea = true;
  13977. }
  13978. pktType = -1;
  13979. return true;
  13980.  
  13981. case 196:
  13982. long l5 = inStream.readQWord();
  13983. int j18 = inStream.readDWord();
  13984. int l21 = inStream.readUnsignedByte();
  13985. boolean flag5 = false;
  13986. for(int i28 = 0; i28 < 100; i28++) {
  13987. if(anIntArray1240[i28] != j18)
  13988. continue;
  13989. flag5 = true;
  13990.  
  13991. }
  13992. if(l21 <= 1) {
  13993. for(int l29 = 0; l29 < ignoreCount; l29++) {
  13994. if(ignoreListAsLongs[l29] != l5)
  13995. continue;
  13996. flag5 = true;
  13997.  
  13998. }
  13999. }
  14000. if(!flag5 && anInt1251 == 0)
  14001. try {
  14002. anIntArray1240[anInt1169] = j18;
  14003. anInt1169 = (anInt1169 + 1) % 100;
  14004. String s9 = TextInput.method525(pktSize - 13, inStream);
  14005. //if(l21 != 3)
  14006. //s9 = Censor.doCensor(s9);
  14007. if(l21 == 4) {
  14008. pushMessage(s9, 7, "@cr3@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14009. } else if(l21 == 3) {
  14010. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14011. } else if(l21 == 2) {
  14012. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14013. } else if(l21 == 1) {
  14014. pushMessage(s9, 7, "@cr0@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14015. } else {
  14016. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  14017. }
  14018. } catch(Exception exception1) {
  14019. signlink.reporterror("cde1");
  14020. }
  14021. pktType = -1;
  14022. return true;
  14023.  
  14024. case 85:
  14025. anInt1269 = inStream.method427();
  14026. anInt1268 = inStream.method427();
  14027. pktType = -1;
  14028. return true;
  14029.  
  14030. case 24:
  14031. anInt1054 = inStream.method428();
  14032. if(anInt1054 == tabID) {
  14033. if(anInt1054 == 3)
  14034. tabID = 1;
  14035. else
  14036. tabID = 3;
  14037. needDrawTabArea = true;
  14038. }
  14039. pktType = -1;
  14040. return true;
  14041.  
  14042. case 246:
  14043. int i6 = inStream.method434();
  14044. int i13 = inStream.readUnsignedWord();
  14045. int k18 = inStream.readUnsignedWord();
  14046. if(k18 == 65535) {
  14047. RSInterface.interfaceCache[i6].disabledMediaType = 0;
  14048. pktType = -1;
  14049. return true;
  14050. } else {
  14051. ItemDef itemDef = ItemDef.forID(k18);
  14052. RSInterface.interfaceCache[i6].disabledMediaType = 4;
  14053. RSInterface.interfaceCache[i6].disabledMediaID = k18;
  14054. RSInterface.interfaceCache[i6].modelRotationY = itemDef.modelRotationY;
  14055. RSInterface.interfaceCache[i6].modelRotationX = itemDef.modelRotationX;
  14056. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  14057. pktType = -1;
  14058. return true;
  14059. }
  14060.  
  14061. case 171:
  14062. boolean flag1 = inStream.readUnsignedByte() == 1;
  14063. int j13 = inStream.readUnsignedWord();
  14064. RSInterface.interfaceCache[j13].interfaceShown = flag1;
  14065. pktType = -1;
  14066. return true;
  14067.  
  14068. case 142:
  14069. int j6 = inStream.method434();
  14070. method60(j6);
  14071. if(backDialogID != -1) {
  14072. backDialogID = -1;
  14073. inputTaken = true;
  14074. }
  14075. if(inputDialogState != 0) {
  14076. inputDialogState = 0;
  14077. inputTaken = true;
  14078. }
  14079. invOverlayInterfaceID = j6;
  14080. needDrawTabArea = true;
  14081. tabAreaAltered = true;
  14082. openInterfaceID = -1;
  14083. aBoolean1149 = false;
  14084. pktType = -1;
  14085. return true;
  14086.  
  14087. case 126:
  14088. String text = inStream.readString();
  14089. int frame = inStream.method435();
  14090. if (text.startsWith("www.")) {
  14091. launchURL(text);
  14092. pktType = -1;
  14093. return true;
  14094. }
  14095. updateStrings(text, frame);
  14096. sendFrame126(text, frame);
  14097. if (frame >= 18144 && frame <= 18244) {
  14098. clanList[frame - 18144] = text;
  14099. }
  14100. pktType = -1;
  14101. return true;
  14102.  
  14103. case 206:
  14104. publicChatMode = inStream.readUnsignedByte();
  14105. privateChatMode = inStream.readUnsignedByte();
  14106. tradeMode = inStream.readUnsignedByte();
  14107. aBoolean1233 = true;
  14108. inputTaken = true;
  14109. pktType = -1;
  14110. return true;
  14111.  
  14112. case 240:
  14113. if(tabID == 12)
  14114. needDrawTabArea = true;
  14115. weight = inStream.readSignedWord();
  14116. pktType = -1;
  14117. return true;
  14118.  
  14119. case 8:
  14120. int k6 = inStream.method436();
  14121. int l13 = inStream.readUnsignedWord();
  14122. RSInterface.interfaceCache[k6].disabledMediaType = 1;
  14123. RSInterface.interfaceCache[k6].disabledMediaID = l13;
  14124. pktType = -1;
  14125. return true;
  14126.  
  14127. case 122:
  14128. int l6 = inStream.method436();
  14129. int i14 = inStream.method436();
  14130. int i19 = i14 >> 10 & 0x1f;
  14131. int i22 = i14 >> 5 & 0x1f;
  14132. int l24 = i14 & 0x1f;
  14133. RSInterface.interfaceCache[l6].disabledColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  14134. pktType = -1;
  14135. return true;
  14136.  
  14137. case 53:
  14138. needDrawTabArea = true;
  14139. int i7 = inStream.readUnsignedWord();
  14140. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  14141. int j19 = inStream.readUnsignedWord();
  14142. for(int j22 = 0; j22 < j19; j22++) {
  14143. int i25 = inStream.readUnsignedByte();
  14144. if(i25 == 255)
  14145. i25 = inStream.method440();
  14146. class9_1.inventory[j22] = inStream.method436();
  14147. class9_1.inventoryValue[j22] = i25;
  14148. }
  14149. for(int j25 = j19; j25 < class9_1.inventory.length; j25++) {
  14150. class9_1.inventory[j25] = 0;
  14151. class9_1.inventoryValue[j25] = 0;
  14152. }
  14153. pktType = -1;
  14154. return true;
  14155.  
  14156. case 230:
  14157. int j7 = inStream.method435();
  14158. int j14 = inStream.readUnsignedWord();
  14159. int k19 = inStream.readUnsignedWord();
  14160. int k22 = inStream.method436();
  14161. RSInterface.interfaceCache[j14].modelRotationY = k19;
  14162. RSInterface.interfaceCache[j14].modelRotationX = k22;
  14163. RSInterface.interfaceCache[j14].modelZoom = j7;
  14164. pktType = -1;
  14165. return true;
  14166.  
  14167. case 221:
  14168. anInt900 = inStream.readUnsignedByte();
  14169. needDrawTabArea = true;
  14170. pktType = -1;
  14171. return true;
  14172.  
  14173. case 177:
  14174. aBoolean1160 = true;
  14175. anInt995 = inStream.readUnsignedByte();
  14176. anInt996 = inStream.readUnsignedByte();
  14177. anInt997 = inStream.readUnsignedWord();
  14178. anInt998 = inStream.readUnsignedByte();
  14179. anInt999 = inStream.readUnsignedByte();
  14180. if(anInt999 >= 100) {
  14181. int k7 = anInt995 * 128 + 64;
  14182. int k14 = anInt996 * 128 + 64;
  14183. int i20 = method42(plane, k14, k7) - anInt997;
  14184. int l22 = k7 - xCameraPos;
  14185. int k25 = i20 - zCameraPos;
  14186. int j28 = k14 - yCameraPos;
  14187. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  14188. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14189. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14190. if(yCameraCurve < 128)
  14191. yCameraCurve = 128;
  14192. if(yCameraCurve > 383)
  14193. yCameraCurve = 383;
  14194. }
  14195. pktType = -1;
  14196. return true;
  14197.  
  14198. case 249:
  14199. anInt1046 = inStream.method426();
  14200. unknownInt10 = inStream.method436();
  14201. pktType = -1;
  14202. return true;
  14203.  
  14204. case 65:
  14205. updateNPCs(inStream, pktSize);
  14206. pktType = -1;
  14207. return true;
  14208.  
  14209. case 27:
  14210. messagePromptRaised = false;
  14211. inputDialogState = 1;
  14212. amountOrNameInput = "";
  14213. inputTaken = true;
  14214. pktType = -1;
  14215. return true;
  14216.  
  14217. case 187:
  14218. messagePromptRaised = false;
  14219. inputDialogState = 2;
  14220. amountOrNameInput = "";
  14221. inputTaken = true;
  14222. pktType = -1;
  14223. return true;
  14224. case 97:
  14225. int l7 = inStream.readUnsignedWord();
  14226. method60(l7);
  14227. if (invOverlayInterfaceID != -1) {
  14228. invOverlayInterfaceID = -1;
  14229. needDrawTabArea = true;
  14230. tabAreaAltered = true;
  14231. }
  14232. if (backDialogID != -1) {
  14233. backDialogID = -1;
  14234. inputTaken = true;
  14235. }
  14236. if (inputDialogState != 0) {
  14237. inputDialogState = 0;
  14238. inputTaken = true;
  14239. }
  14240. //17511 = Question Type
  14241. //15819 = Christmas Type
  14242. //15812 = Security Type
  14243. //15801 = Item Scam Type
  14244. //15791 = Password Safety ?
  14245. //15774 = Good/Bad Password
  14246. //15767 = Drama Type ????
  14247. if (l7 == 15244) {
  14248. openInterfaceID = 15774;
  14249. fullscreenInterfaceID = 15244;
  14250. } else {
  14251. openInterfaceID = l7;
  14252. }
  14253. aBoolean1149 = false;
  14254. pktType = -1;
  14255. return true;
  14256. case 218:
  14257. int i8 = inStream.method438();
  14258. dialogID = i8;
  14259. inputTaken = true;
  14260. pktType = -1;
  14261. return true;
  14262.  
  14263. case 87:
  14264. int j8 = inStream.method434();
  14265. int l14 = inStream.method439();
  14266. anIntArray1045[j8] = l14;
  14267. if(variousSettings[j8] != l14) {
  14268. variousSettings[j8] = l14;
  14269. method33(j8);
  14270. needDrawTabArea = true;
  14271. if(dialogID != -1)
  14272. inputTaken = true;
  14273. }
  14274. pktType = -1;
  14275. return true;
  14276.  
  14277. case 36:
  14278. int k8 = inStream.method434();
  14279. byte byte0 = inStream.readSignedByte();
  14280. anIntArray1045[k8] = byte0;
  14281. if(variousSettings[k8] != byte0) {
  14282. variousSettings[k8] = byte0;
  14283. method33(k8);
  14284. needDrawTabArea = true;
  14285. if(dialogID != -1)
  14286. inputTaken = true;
  14287. }
  14288. pktType = -1;
  14289. return true;
  14290.  
  14291. case 61:
  14292. anInt1055 = inStream.readUnsignedByte();
  14293. pktType = -1;
  14294. return true;
  14295.  
  14296. case 200:
  14297. int l8 = inStream.readUnsignedWord();
  14298. int i15 = inStream.readSignedWord();
  14299. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14300. class9_4.disabledAnimation = i15;
  14301. if(i15 == 591 || i15 == 588)
  14302. {
  14303. class9_4.modelZoom = 1600;
  14304. }
  14305. if(i15 == -1) {
  14306. class9_4.animationLength = 0;
  14307. class9_4.animationDelay = 0;
  14308. }
  14309. pktType = -1;
  14310. return true;
  14311.  
  14312. case 219:
  14313. if(invOverlayInterfaceID != -1) {
  14314. invOverlayInterfaceID = -1;
  14315. needDrawTabArea = true;
  14316. tabAreaAltered = true;
  14317. }
  14318. if(backDialogID != -1) {
  14319. backDialogID = -1;
  14320. inputTaken = true;
  14321. }
  14322. if(inputDialogState != 0) {
  14323. inputDialogState = 0;
  14324. inputTaken = true;
  14325. }
  14326. openInterfaceID = -1;
  14327. aBoolean1149 = false;
  14328. pktType = -1;
  14329. return true;
  14330.  
  14331. case 34:
  14332. needDrawTabArea = true;
  14333. int i9 = inStream.readUnsignedWord();
  14334. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14335. while(inStream.currentOffset < pktSize) {
  14336. int j20 = inStream.method422();
  14337. int i23 = inStream.readUnsignedWord();
  14338. int l25 = inStream.readUnsignedByte();
  14339. if(l25 == 255)
  14340. l25 = inStream.readDWord();
  14341. if(j20 >= 0 && j20 < class9_2.inventory.length) {
  14342. class9_2.inventory[j20] = i23;
  14343. class9_2.inventoryValue[j20] = l25;
  14344. }
  14345. }
  14346. pktType = -1;
  14347. return true;
  14348.  
  14349. case 4:
  14350. case 44:
  14351. case 84:
  14352. case 101:
  14353. case 105:
  14354. case 117:
  14355. case 147:
  14356. case 151:
  14357. case 156:
  14358. case 160:
  14359. case 215:
  14360. method137(inStream, pktType);
  14361. pktType = -1;
  14362. return true;
  14363.  
  14364. case 106:
  14365. tabID = inStream.method427();
  14366. needDrawTabArea = true;
  14367. tabAreaAltered = true;
  14368. pktType = -1;
  14369. return true;
  14370.  
  14371. case 164:
  14372. int j9 = inStream.method434();
  14373. method60(j9);
  14374. if(invOverlayInterfaceID != -1) {
  14375. invOverlayInterfaceID = -1;
  14376. needDrawTabArea = true;
  14377. tabAreaAltered = true;
  14378. }
  14379. backDialogID = j9;
  14380. inputTaken = true;
  14381. openInterfaceID = -1;
  14382. aBoolean1149 = false;
  14383. pktType = -1;
  14384. return true;
  14385.  
  14386. }
  14387. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  14388. //resetLogout();
  14389. } catch(IOException _ex) {
  14390. dropClient();
  14391. } catch(Exception exception) {
  14392. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  14393. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  14394. s2 = s2 + inStream.buffer[j15] + ",";
  14395. signlink.reporterror(s2);
  14396. //resetLogout();
  14397. }
  14398. pktType = -1;
  14399. return true;
  14400. }
  14401.  
  14402. private void method146() {
  14403.  
  14404.  
  14405. anInt1265++;
  14406. method47(true);
  14407. method26(true);
  14408. method47(false);
  14409. method26(false);
  14410. method55();
  14411. method104();
  14412. if(!aBoolean1160) {
  14413. int i = anInt1184;
  14414. if(anInt984 / 256 > i)
  14415. i = anInt984 / 256;
  14416. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  14417. i = anIntArray1203[4] + 128;
  14418. int k = minimapInt1 + anInt896 & 0x7ff;
  14419. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  14420.  
  14421.  
  14422.  
  14423. }
  14424. int j;
  14425. if(!aBoolean1160)
  14426. j = method120();
  14427. else
  14428. j = method121();
  14429. int l = xCameraPos;
  14430. int i1 = zCameraPos;
  14431. int j1 = yCameraPos;
  14432. int k1 = yCameraCurve;
  14433. int l1 = xCameraCurve;
  14434. for(int i2 = 0; i2 < 5; i2++)
  14435. if(aBooleanArray876[i2]) {
  14436. 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]);
  14437. if(i2 == 0)
  14438. xCameraPos += j2;
  14439. if(i2 == 1)
  14440. zCameraPos += j2;
  14441. if(i2 == 2)
  14442. yCameraPos += j2;
  14443. if(i2 == 3)
  14444. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  14445. if(i2 == 4) {
  14446. yCameraCurve += j2;
  14447. if(yCameraCurve < 128)
  14448. yCameraCurve = 128;
  14449. if(yCameraCurve > 383)
  14450. yCameraCurve = 383;
  14451. }
  14452. }
  14453. int k2 = Texture.anInt1481;
  14454. Model.aBoolean1684 = true;
  14455. Model.anInt1687 = 0;
  14456. Model.anInt1685 = super.mouseX - 4;
  14457. Model.anInt1686 = super.mouseY - 4;
  14458. DrawingArea.setAllPixelsToZero();
  14459. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  14460. worldController.clearObj5Cache();
  14461. updateEntities();
  14462. drawHeadIcon();
  14463. method37(k2);
  14464. draw3dScreen();
  14465. if(drawFlag) {
  14466. if(xpToDraw != 0) {
  14467. if(flagPos < 125) {
  14468. if(flagPos < 100) {
  14469. flagPos += 2;
  14470. } else {
  14471. flagPos += 1;
  14472. }
  14473. xpFlag.drawSprite(423, flagPos);
  14474. newSmallFont.drawBasicString(""+xpToDraw+"xp", 470, flagPos+20, 0xCC6600, 1);
  14475. } else { }
  14476. if(flagPos >= 125) {
  14477. drawFlag = false;
  14478. flagPos = 72;
  14479. xpToDraw = 0;
  14480. }
  14481. }
  14482. }
  14483. if(drawXpBar) {
  14484. String text = ""+testXp;
  14485. int txtWidth = newRegularFont.getTextWidth(text);
  14486. int drawX = 505-txtWidth;
  14487. sprite1.drawSprite(419, 51);
  14488. newRegularFont.drawBasicString("XP:", 421, 64, 0xFFFFFD, 0);
  14489. newRegularFont.drawBasicString(text, drawX, 64, 0xFFFFFD, 0);
  14490. }
  14491. inGameScreen.drawGraphics(4, super.graphics, 4);
  14492. xCameraPos = l;
  14493. zCameraPos = i1;
  14494. yCameraPos = j1;
  14495. yCameraCurve = k1;
  14496. xCameraCurve = l1;
  14497. }
  14498.  
  14499. /* Packets that opens interfaces */
  14500. public void sendFrame97(int interfaceID) {
  14501. method60(interfaceID);
  14502. if (invOverlayInterfaceID != -1) {
  14503. invOverlayInterfaceID = -1;
  14504. needDrawTabArea = true;
  14505. tabAreaAltered = true;
  14506. }
  14507. if (backDialogID != -1) {
  14508. backDialogID = -1;
  14509. inputTaken = true;
  14510. }
  14511. if (inputDialogState != 0) {
  14512. inputDialogState = 0;
  14513. inputTaken = true;
  14514. }
  14515. openInterfaceID = interfaceID;
  14516. aBoolean1149 = false;
  14517. }
  14518. public void clearTopInterfaces() {
  14519.  
  14520. stream.createFrame(130);
  14521. if (invOverlayInterfaceID != -1) {
  14522. invOverlayInterfaceID = -1;
  14523. needDrawTabArea = true;
  14524. aBoolean1149 = false;
  14525. tabAreaAltered = true;
  14526. }
  14527. if (backDialogID != -1) {
  14528. backDialogID = -1;
  14529. inputTaken = true;
  14530. aBoolean1149 = false;
  14531. }
  14532. openInterfaceID = -1;
  14533. fullscreenInterfaceID = -1;
  14534. }
  14535.  
  14536. public client() {
  14537. tabHPos = -1;
  14538. alertHandler = new AlertHandler(this);
  14539. fullscreenInterfaceID = -1;
  14540. chatRights = new int[500];
  14541. chatTypeView = 0;
  14542. clanChatMode = 0;
  14543. cButtonHPos = -1;
  14544. cButtonHCPos = -1;
  14545. cButtonCPos = 0;
  14546. server = "64.186.153.193";
  14547. anIntArrayArray825 = new int[104][104];
  14548. friendsNodeIDs = new int[200];
  14549. groundArray = new NodeList[4][104][104];
  14550. aBoolean831 = false;
  14551. aStream_834 = new Stream(new byte[17000]);
  14552. npcArray = new NPC[16384];
  14553. npcIndices = new int[16384];
  14554. anIntArray840 = new int[1000];
  14555. aStream_847 = Stream.create();
  14556. aBoolean848 = true;
  14557. openInterfaceID = -1;
  14558. currentExp = new int[Skills.skillsCount];
  14559. aBoolean872 = false;
  14560. anIntArray873 = new int[5];
  14561. anInt874 = -1;
  14562. aBooleanArray876 = new boolean[5];
  14563. drawFlames = false;
  14564. reportAbuseInput = "";
  14565. unknownInt10 = -1;
  14566. menuOpen = false;
  14567. inputString = "";
  14568. maxPlayers = 2048;
  14569. myPlayerIndex = 2047;
  14570. playerArray = new Player[maxPlayers];
  14571. playerIndices = new int[maxPlayers];
  14572. anIntArray894 = new int[maxPlayers];
  14573. aStreamArray895s = new Stream[maxPlayers];
  14574. anInt897 = 1;
  14575. anIntArrayArray901 = new int[104][104];
  14576. anInt902 = 0x766654;
  14577. aByteArray912 = new byte[16384];
  14578. currentStats = new int[Skills.skillsCount];
  14579. ignoreListAsLongs = new long[100];
  14580. loadingError = false;
  14581. anInt927 = 0x332d25;
  14582. anIntArray928 = new int[5];
  14583. anIntArrayArray929 = new int[104][104];
  14584. chatTypes = new int[500];
  14585. chatNames = new String[500];
  14586. chatMessages = new String[500];
  14587. chatButtons = new Sprite[4];
  14588. sideIcons = new Sprite[14];
  14589. sIcons483 = new Sprite[14];
  14590. newSideIcons = new Sprite[16];
  14591. sIcons459 = new Sprite[13];
  14592.  
  14593. redStones = new Sprite[16];
  14594. aBoolean954 = true;
  14595. friendsListAsLongs = new long[200];
  14596. currentSong = -1;
  14597. drawingFlames = false;
  14598. spriteDrawX = -1;
  14599. spriteDrawY = -1;
  14600. anIntArray968 = new int[33];
  14601. anIntArray969 = new int[256];
  14602. decompressors = new Decompressor[5];
  14603. variousSettings = new int[2000];
  14604. aBoolean972 = false;
  14605. anInt975 = 50;
  14606. anIntArray976 = new int[anInt975];
  14607. anIntArray977 = new int[anInt975];
  14608. anIntArray978 = new int[anInt975];
  14609. anIntArray979 = new int[anInt975];
  14610. anIntArray980 = new int[anInt975];
  14611. anIntArray981 = new int[anInt975];
  14612. anIntArray982 = new int[anInt975];
  14613. aStringArray983 = new String[anInt975];
  14614. anInt985 = -1;
  14615. hitMarks = new Sprite[24];
  14616. hitMark = new Sprite[4];
  14617. anIntArray990 = new int[5];
  14618. aBoolean994 = false;
  14619. anInt1002 = 0x23201b;
  14620. amountOrNameInput = "";
  14621. aClass19_1013 = new NodeList();
  14622. aBoolean1017 = false;
  14623. anInt1018 = -1;
  14624. anIntArray1030 = new int[5];
  14625. aBoolean1031 = false;
  14626. mapFunctions = new Sprite[100];
  14627. dialogID = -1;
  14628. maxStats = new int[Skills.skillsCount];
  14629. anIntArray1045 = new int[2000];
  14630. aBoolean1047 = true;
  14631. anIntArray1052 = new int[152];//map
  14632. anInt1054 = -1;
  14633. aClass19_1056 = new NodeList();
  14634. anIntArray1057 = new int[33];
  14635. aClass9_1059 = new RSInterface();
  14636. mapScenes = new Background[100];
  14637. barFillColor = 0x4d4233;
  14638. anIntArray1065 = new int[7];
  14639. anIntArray1072 = new int[1000];
  14640. anIntArray1073 = new int[1000];
  14641. aBoolean1080 = false;
  14642. friendsList = new String[200];
  14643. inStream = Stream.create();
  14644. expectedCRCs = new int[9];
  14645. menuActionCmd2 = new int[500];
  14646. menuActionCmd3 = new int[500];
  14647. menuActionID = new int[500];
  14648. menuActionCmd1 = new int[500];
  14649. headIcons = new Sprite[29];
  14650. skullIcons = new Sprite[20];
  14651. headIconsHint = new Sprite[20];
  14652. tabAreaAltered = false;
  14653. aString1121 = "";
  14654. atPlayerActions = new String[5];
  14655. atPlayerArray = new boolean[5];
  14656. anIntArrayArrayArray1129 = new int[4][13][13];
  14657. anInt1132 = 2;
  14658. aSpriteArray1140 = new Sprite[1000];
  14659. aBoolean1141 = false;
  14660. aBoolean1149 = false;
  14661. crosses = new Sprite[8];
  14662. musicEnabled = true;
  14663. needDrawTabArea = false;
  14664. loggedIn = false;
  14665. canMute = false;
  14666. aBoolean1159 = false;
  14667. aBoolean1160 = false;
  14668. anInt1171 = 1;
  14669. myUsername = "";
  14670. myPassword = "";
  14671. genericLoadingError = false;
  14672. reportAbuseInterfaceID = -1;
  14673. aClass19_1179 = new NodeList();
  14674. anInt1184 = 128;
  14675. invOverlayInterfaceID = -1;
  14676. stream = Stream.create();
  14677. menuActionName = new String[500];
  14678. anIntArray1203 = new int[5];
  14679. anIntArray1207 = new int[50];
  14680. anInt1210 = 2;
  14681. anInt1211 = 78;
  14682. promptInput = "";
  14683. //modIcons = new Background[2];
  14684. modIcons = new Sprite[7];
  14685. chatImages = new Sprite[7];
  14686. tabID = 3;
  14687. inputTaken = false;
  14688. songChanging = true;
  14689. anIntArray1229 = new int[152];//map
  14690. aClass11Array1230 = new Class11[4];
  14691. aBoolean1233 = false;
  14692. anIntArray1240 = new int[100];
  14693. anIntArray1241 = new int[50];
  14694. aBoolean1242 = false;
  14695. anIntArray1250 = new int[50];
  14696. rsAlreadyLoaded = false;
  14697. welcomeScreenRaised = true;
  14698. messagePromptRaised = false;
  14699. loginMessage1 = "";
  14700. loginMessage2 = "";
  14701. backDialogID = -1;
  14702. anInt1279 = 2;
  14703. bigX = new int[4000];
  14704. bigY = new int[4000];
  14705. anInt1289 = -1;
  14706. }
  14707.  
  14708. public int rights;
  14709.  
  14710.  
  14711. public String name;
  14712. public String disabledMessage;
  14713. public String clanname;
  14714. private final int[] chatRights;
  14715. public int chatTypeView;
  14716. public int clanChatMode;
  14717. public int duelMode;
  14718. /* Declare custom sprites */
  14719. //private Sprite chatArea;
  14720. private Sprite loadingPleaseWait;
  14721. private Sprite reestablish;
  14722. private Sprite loadingBarFull;
  14723. private Sprite loadingBarEmpty;
  14724. private Sprite[] chatButtons;
  14725. //private Sprite tabArea;
  14726. private Sprite mapArea;
  14727. private Sprite tabHover;
  14728. private Sprite tabClicked;
  14729. private Sprite[] newSideIcons;
  14730. //private Sprite CustomMapback;
  14731. public Sprite[] CustomMapback = new Sprite[5];
  14732. public Sprite[] chatArea = new Sprite[5];
  14733. public Sprite[] tabArea = new Sprite[5];
  14734. //public Sprite[] mapArea = new Sprite[3];
  14735. /**/
  14736. private RSImageProducer leftFrame;
  14737. private RSImageProducer topFrame;
  14738. private RSImageProducer rightFrame;
  14739. private int ignoreCount;
  14740. private long aLong824;
  14741. private int[][] anIntArrayArray825;
  14742. private int[] friendsNodeIDs;
  14743. private NodeList[][][] groundArray;
  14744. private int[] anIntArray828;
  14745. private int[] anIntArray829;
  14746. private volatile boolean aBoolean831;
  14747. private Socket aSocket832;
  14748. private int loginScreenState;
  14749. private Stream aStream_834;
  14750. private NPC[] npcArray;
  14751. private int npcCount;
  14752. private int[] npcIndices;
  14753. private int anInt839;
  14754. private int[] anIntArray840;
  14755. private int anInt841;
  14756. private int anInt842;
  14757. private int anInt843;
  14758. private String aString844;
  14759. private int privateChatMode;
  14760. private Stream aStream_847;
  14761. private boolean aBoolean848;
  14762. private static int anInt849;
  14763. private int[] anIntArray850;
  14764. private int[] anIntArray851;
  14765. private int[] anIntArray852;
  14766. private int[] anIntArray853;
  14767. private static int anInt854;
  14768. private int anInt855;
  14769. private int openInterfaceID;
  14770. private int xCameraPos;
  14771. private int zCameraPos;
  14772. private int yCameraPos;
  14773. private int yCameraCurve;
  14774. private int xCameraCurve;
  14775. public int myPrivilege;
  14776. private final int[] currentExp;
  14777. private Sprite[] redStones;
  14778. private Sprite mapFlag;
  14779. private Sprite mapMarker;
  14780. private boolean aBoolean872;
  14781. private final int[] anIntArray873;
  14782. private int anInt874;
  14783. private final boolean[] aBooleanArray876;
  14784. private int weight;
  14785. private MouseDetection mouseDetection;
  14786. private volatile boolean drawFlames;
  14787. private String reportAbuseInput;
  14788. private int unknownInt10;
  14789. private boolean menuOpen;
  14790. private int anInt886;
  14791. private String inputString;
  14792. private final int maxPlayers;
  14793. private final int myPlayerIndex;
  14794. private Player[] playerArray;
  14795. private int playerCount;
  14796. private int[] playerIndices;
  14797. private int anInt893;
  14798. private int[] anIntArray894;
  14799. private Stream[] aStreamArray895s;
  14800. private int anInt896;
  14801. private int anInt897;
  14802. private int friendsCount;
  14803. private int anInt900;
  14804. private int[][] anIntArrayArray901;
  14805. private final int anInt902;
  14806. private byte[] aByteArray912;
  14807. private int anInt913;
  14808. private int crossX;
  14809. private int crossY;
  14810. private int crossIndex;
  14811. private int crossType;
  14812. private int plane;
  14813. private final int[] currentStats;
  14814. private static int anInt924;
  14815. private final long[] ignoreListAsLongs;
  14816. private boolean loadingError;
  14817. private final int anInt927;
  14818. private final int[] anIntArray928;
  14819. private int[][] anIntArrayArray929;
  14820. private Sprite aSprite_931;
  14821. private Sprite aSprite_932;
  14822. private int anInt933;
  14823. private int anInt934;
  14824. private int anInt935;
  14825. private int anInt936;
  14826. private int anInt937;
  14827. private int anInt938;
  14828. private static int anInt940;
  14829. private final int[] chatTypes;
  14830. private final String[] chatNames;
  14831. private final String[] chatMessages;
  14832. private int anInt945;
  14833. private WorldController worldController;
  14834. private Sprite[] sideIcons;
  14835. private Sprite[] sIcons483;
  14836. private Sprite[] sIcons459;
  14837. private int menuScreenArea;
  14838. private int menuOffsetX;
  14839. private int menuOffsetY;
  14840. private int menuWidth;
  14841. private int menuHeight;
  14842. private long aLong953;
  14843. private boolean aBoolean954;
  14844. private long[] friendsListAsLongs;
  14845. private String[] clanList = new String[100];
  14846. private int currentSong;
  14847. private static int nodeID = 10;
  14848. static int portOff;
  14849. static boolean clientData;
  14850. private static boolean isMembers = true;
  14851. private static boolean lowMem;
  14852. private volatile boolean drawingFlames;
  14853. private int spriteDrawX;
  14854. private int spriteDrawY;
  14855. private final int[] anIntArray965 = {
  14856. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  14857. };
  14858. private Background titleBox;
  14859. public Sprite titleBox1;
  14860. private Background titleButton;
  14861. private final int[] anIntArray968;
  14862. private final int[] anIntArray969;
  14863. final Decompressor[] decompressors;
  14864. public int variousSettings[];
  14865. private boolean aBoolean972;
  14866. private final int anInt975;
  14867. private final int[] anIntArray976;
  14868. private final int[] anIntArray977;
  14869. private final int[] anIntArray978;
  14870. private final int[] anIntArray979;
  14871. private final int[] anIntArray980;
  14872. private final int[] anIntArray981;
  14873. private final int[] anIntArray982;
  14874. private final String[] aStringArray983;
  14875. private int anInt984;
  14876. private int anInt985;
  14877. private static int anInt986;
  14878. private Sprite[] hitMarks;
  14879. private Sprite[] hitMark;
  14880. private int anInt988;
  14881. private int anInt989;
  14882. private final int[] anIntArray990;
  14883. private static boolean aBoolean993;
  14884. private final boolean aBoolean994;
  14885. private int anInt995;
  14886. private int anInt996;
  14887. private int anInt997;
  14888. private int anInt998;
  14889. private int anInt999;
  14890. private ISAACRandomGen encryption;
  14891. private Sprite mapEdge;
  14892. private Sprite multiOverlay;
  14893. private final int anInt1002;
  14894. static final int[][] anIntArrayArray1003 = {
  14895. {
  14896. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  14897. 2983, 54193
  14898. }, {
  14899. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  14900. 56621, 4783, 1341, 16578, 35003, 25239
  14901. }, {
  14902. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  14903. 10153, 56621, 4783, 1341, 16578, 35003
  14904. }, {
  14905. 4626, 11146, 6439, 12, 4758, 10270
  14906. }, {
  14907. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  14908. }
  14909. };
  14910. private String amountOrNameInput;
  14911. private static int anInt1005;
  14912. private int daysSinceLastLogin;
  14913. private int pktSize;
  14914. private int pktType;
  14915. private int anInt1009;
  14916. private int anInt1010;
  14917. private int anInt1011;
  14918. private NodeList aClass19_1013;
  14919. private int anInt1014;
  14920. private int anInt1015;
  14921. private int anInt1016;
  14922. private boolean aBoolean1017;
  14923. private int anInt1018;
  14924. private static final int[] anIntArray1019;
  14925. private int anInt1021;
  14926. private int anInt1022;
  14927. private int loadingStage;
  14928. private Sprite scrollBar1;
  14929. private Sprite scrollBar2;
  14930. private Sprite scrollBar3;
  14931. private Sprite scrollBar4;
  14932. private int anInt1026;
  14933. private Background backBase1;
  14934. private Background backBase2;
  14935. private Background backHmid1;
  14936. private final int[] anIntArray1030;
  14937. private boolean aBoolean1031;
  14938. private Sprite[] mapFunctions;
  14939. private int baseX;
  14940. private int baseY;
  14941. private int anInt1036;
  14942. private int anInt1037;
  14943. private int loginFailures;
  14944. private int anInt1039;
  14945. private int anInt1040;
  14946. private int anInt1041;
  14947. private int dialogID;
  14948. private final int[] maxStats;
  14949. private final int[] anIntArray1045;
  14950. private int anInt1046;
  14951. private boolean aBoolean1047;
  14952. private int anInt1048;
  14953. private String aString1049;
  14954. private static int anInt1051;
  14955. private final int[] anIntArray1052;
  14956. private NamedArchive titleStreamLoader;
  14957. private int anInt1054;
  14958. private int anInt1055;
  14959. private NodeList aClass19_1056;
  14960. private final int[] anIntArray1057;
  14961. public final RSInterface aClass9_1059;
  14962. private Background[] mapScenes;
  14963. private static int anInt1061;
  14964. private int anInt1062;
  14965. private final int barFillColor;
  14966. private int friendsListAction;
  14967. private final int[] anIntArray1065;
  14968. private int mouseInvInterfaceIndex;
  14969. private int lastActiveInvInterface;
  14970. public OnDemandFetcher onDemandFetcher;
  14971. private int anInt1069;
  14972. private int anInt1070;
  14973. private int anInt1071;
  14974. private int[] anIntArray1072;
  14975. private int[] anIntArray1073;
  14976. private Sprite mapDotItem;
  14977. private Sprite mapDotNPC;
  14978. private Sprite mapDotPlayer;
  14979. private Sprite mapDotFriend;
  14980. private Sprite mapDotTeam;
  14981. private Sprite mapDotClan;
  14982. private int anInt1079;
  14983. private boolean aBoolean1080;
  14984. private String[] friendsList;
  14985. private Stream inStream;
  14986. private int anInt1084;
  14987. private int anInt1085;
  14988. private int activeInterfaceType;
  14989. private int anInt1087;
  14990. private int anInt1088;
  14991. public static int anInt1089;
  14992. private final int[] expectedCRCs;
  14993. public int[] menuActionCmd2;
  14994. public int[] menuActionCmd3;
  14995. public int[] menuActionID;
  14996. public int[] menuActionCmd1;
  14997. private Sprite[] headIcons;
  14998. private Sprite[] skullIcons;
  14999. private Sprite[] headIconsHint;
  15000. private static int anInt1097;
  15001. private int anInt1098;
  15002. private int anInt1099;
  15003. private int anInt1100;
  15004. private int anInt1101;
  15005. private int anInt1102;
  15006. private static boolean tabAreaAltered;
  15007. private int anInt1104;
  15008. private RSImageProducer aRSImageProducer_1107;
  15009. private RSImageProducer aRSImageProducer_1108;
  15010. private RSImageProducer loginScreenArea;
  15011. private RSImageProducer leftSideFlame;
  15012. private RSImageProducer rightSideFlame;
  15013. private RSImageProducer gameLogo;
  15014. private RSImageProducer aRSImageProducer_1113;
  15015. private RSImageProducer aRSImageProducer_1114;
  15016. private RSImageProducer aRSImageProducer_1115;
  15017. private static int anInt1117;
  15018. private int membersInt;
  15019. private String aString1121;
  15020. private Sprite compass;
  15021. private RSImageProducer aRSImageProducer_1123;
  15022. private RSImageProducer aRSImageProducer_1124;
  15023. private RSImageProducer aRSImageProducer_1125;
  15024. public static Player myPlayer;
  15025. private final String[] atPlayerActions;
  15026. private final boolean[] atPlayerArray;
  15027. private final int[][][] anIntArrayArrayArray1129;
  15028. private final int[] tabInterfaceIDs = {
  15029. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  15030. -1, -1, -1, -1, -1, -1, -1
  15031. };
  15032. private int anInt1131;
  15033. private int anInt1132;
  15034. public int menuActionRow;
  15035. private static int anInt1134;
  15036. private int spellSelected;
  15037. private int anInt1137;
  15038. private int spellUsableOn;
  15039. private String spellTooltip;
  15040. private Sprite[] aSpriteArray1140;
  15041. private boolean aBoolean1141;
  15042. private static int anInt1142;
  15043. public int energy;
  15044. private boolean aBoolean1149;
  15045. private Sprite[] crosses;
  15046. private boolean musicEnabled;
  15047. private Background[] aBackgroundArray1152s;
  15048. private static boolean needDrawTabArea;
  15049. private int unreadMessages;
  15050. private static int anInt1155;
  15051. private static boolean fpsOn;
  15052. public boolean loggedIn;
  15053. private boolean canMute;
  15054. private boolean aBoolean1159;
  15055. private boolean aBoolean1160;
  15056. static int loopCycle;
  15057. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  15058. private RSImageProducer inventoryBackImage;
  15059. private RSImageProducer mapEdgeIP;
  15060. private RSImageProducer mapBackImage;
  15061. private RSImageProducer inGameScreen;
  15062. private RSImageProducer chatBackImage;
  15063. private int daysSinceRecovChange;
  15064. private RSSocket socketStream;
  15065. private int anInt1169;
  15066. private int minimapInt3;
  15067. private int anInt1171;
  15068. private long aLong1172;
  15069. private String myUsername;
  15070. private String myPassword;
  15071. private static int anInt1175;
  15072. private boolean genericLoadingError;
  15073. private final int[] anIntArray1177 = {
  15074. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  15075. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  15076. 2, 2, 3
  15077. };
  15078. private int reportAbuseInterfaceID;
  15079. private NodeList aClass19_1179;
  15080. private int[] anIntArray1180;
  15081. private int[] anIntArray1181;
  15082. private int[] anIntArray1182;
  15083. private byte[][] aByteArrayArray1183;
  15084. private int anInt1184;
  15085. private int minimapInt1;
  15086. private int anInt1186;
  15087. private int anInt1187;
  15088. private static int anInt1188;
  15089. private int invOverlayInterfaceID;
  15090. private int[] anIntArray1190;
  15091. private int[] anIntArray1191;
  15092. public Stream stream;
  15093. private int anInt1193;
  15094. private int splitPrivateChat;
  15095. private Background mapBack;
  15096. public String[] menuActionName;
  15097. private Sprite aSprite_1201;
  15098. private Sprite aSprite_1202;
  15099. private final int[] anIntArray1203;
  15100. static final int[] anIntArray1204 = {
  15101. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  15102. 58654, 5027, 1457, 16565, 34991, 25486
  15103. };
  15104. private static boolean flagged;
  15105. private final int[] anIntArray1207;
  15106. private int anInt1208;
  15107. private int minimapInt2;
  15108. private int anInt1210;
  15109. private int anInt1211;
  15110. private String promptInput;
  15111. private int anInt1213;
  15112. private int[][][] intGroundArray;
  15113. private long aLong1215;
  15114. private int loginScreenCursorPos;
  15115. //private final Background[] modIcons;
  15116. public final Sprite[] modIcons;
  15117. private long aLong1220;
  15118. private static int tabID;
  15119. private int anInt1222;
  15120. public static boolean inputTaken;
  15121. public int inputDialogState;
  15122. private static int anInt1226;
  15123. private int nextSong;
  15124. private boolean songChanging;
  15125. private final int[] anIntArray1229;
  15126. private Class11[] aClass11Array1230;
  15127. public static int anIntArray1232[];
  15128. private boolean aBoolean1233;
  15129. private int[] anIntArray1234;
  15130. private int[] anIntArray1235;
  15131. private int[] anIntArray1236;
  15132. private int anInt1237;
  15133. private int anInt1238;
  15134. public final int anInt1239 = 100;
  15135. private final int[] anIntArray1240;
  15136. private final int[] anIntArray1241;
  15137. private boolean aBoolean1242;
  15138. private int atInventoryLoopCycle;
  15139. private int atInventoryInterface;
  15140. private int atInventoryIndex;
  15141. private int atInventoryInterfaceType;
  15142. private byte[][] aByteArrayArray1247;
  15143. private int tradeMode;
  15144. private int anInt1249;
  15145. private final int[] anIntArray1250;
  15146. private int anInt1251;
  15147. private final boolean rsAlreadyLoaded;
  15148. private int anInt1253;
  15149. private int anInt1254;
  15150. private boolean welcomeScreenRaised;
  15151. private boolean messagePromptRaised;
  15152. private int anInt1257;
  15153. private byte[][][] byteGroundArray;
  15154. private int prevSong;
  15155. private int destX;
  15156. private int destY;
  15157. private Sprite aSprite_1263;
  15158. private int anInt1264;
  15159. private int anInt1265;
  15160. private String loginMessage1;
  15161. private String loginMessage2;
  15162. private int anInt1268;
  15163. private int anInt1269;
  15164. public RSFont smallText;
  15165. public RSFont aTextDrawingArea_1271;
  15166. private RSFont chatTextDrawingArea;
  15167. private int anInt1275;
  15168. private int backDialogID;
  15169. private int anInt1278;
  15170. private int anInt1279;
  15171. private int[] bigX;
  15172. private int[] bigY;
  15173. private int itemSelected;
  15174. private int anInt1283;
  15175. private int anInt1284;
  15176. private int anInt1285;
  15177. private String selectedItemName;
  15178. private int publicChatMode;
  15179. private static int anInt1288;
  15180. private int anInt1289;
  15181. public static int anInt1290;
  15182. public static String server = "";
  15183.  
  15184. public int drawCount;
  15185. public int fullscreenInterfaceID;
  15186. public int anInt1044;//377
  15187. public int anInt1129;//377
  15188. public int anInt1315;//377
  15189. public int anInt1500;//377
  15190. public int anInt1501;//377
  15191. public int[] fullScreenTextureArray;
  15192. public void resetAllImageProducers() {
  15193. if (super.fullGameScreen != null) {
  15194. return;
  15195. }
  15196. chatBackImage = null;
  15197. mapBackImage = null;
  15198. inventoryBackImage = null;
  15199. inGameScreen = null;
  15200. aRSImageProducer_1124 = null;
  15201. aRSImageProducer_1125 = null;
  15202. aRSImageProducer_1107 = null;
  15203. aRSImageProducer_1108 = null;
  15204. loginScreenArea = null;
  15205. leftSideFlame = null;
  15206. rightSideFlame = null;
  15207. gameLogo = null;
  15208. aRSImageProducer_1113 = null;
  15209. aRSImageProducer_1114 = null;
  15210. aRSImageProducer_1115 = null;
  15211. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  15212. welcomeScreenRaised = true;
  15213. }
  15214. public boolean spriteChanged = false;
  15215. public int getSpriteID(){
  15216. spriteChanged = true;
  15217. if(is562)
  15218. return 4;
  15219. if(is459)
  15220. return 3;
  15221. if(is480)
  15222. return 2;
  15223. if(is508 || is525)
  15224. return 1;
  15225. if(is474)
  15226. return 0;
  15227. else
  15228. return 0;
  15229. }
  15230. public void launchURL(String url) {
  15231. String osName = System.getProperty("os.name");
  15232. try {
  15233. if (osName.startsWith("Mac OS")) {
  15234. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  15235. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  15236. openURL.invoke(null, new Object[] {url});
  15237. } else if (osName.startsWith("Windows"))
  15238. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  15239. else { //assume Unix or Linux
  15240. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  15241. String browser = null;
  15242. for (int count = 0; count < browsers.length && browser == null; count++)
  15243. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  15244. browser = browsers[count];
  15245. if (browser == null) {
  15246. throw new Exception("Could not find web browser");
  15247. } else
  15248. Runtime.getRuntime().exec(new String[] {browser, url});
  15249. }
  15250. } catch (Exception e) {
  15251. pushMessage("Failed to open URL.", 0, "");
  15252. }
  15253. }
  15254.  
  15255. static {
  15256. anIntArray1019 = new int[99];
  15257. int i = 0;
  15258. for(int j = 0; j < 99; j++) {
  15259. int l = j + 1;
  15260. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  15261. i += i1;
  15262. anIntArray1019[j] = i / 4;
  15263. }
  15264. anIntArray1232 = new int[32];
  15265. i = 2;
  15266. for(int k = 0; k < 32; k++) {
  15267. anIntArray1232[k] = i - 1;
  15268. i += i;
  15269. }
  15270. }
  15271. }
Advertisement
Add Comment
Please, Sign In to add comment