Guest User

Untitled

a guest
Jan 2nd, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 474.95 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.  
  14. import sign.signlink;
  15. import javax.swing.*;
  16.  
  17. public class client extends RSApplet {
  18. public int applyTrans;
  19. public static boolean newHits = true;
  20. private Sprite oldHit;
  21. public Sprite bigHit;
  22. public Sprite critHit;
  23. public Sprite bigCritHit;
  24. //public Sprite critHit;
  25. private Sprite oldBlue;
  26. private Sprite oldGreen;
  27. public Sprite[] combatIcons = new Sprite[4];
  28. public Sprite magicAuto;
  29. public boolean Autocast = false;
  30. public int autocastId = 0;
  31. public String getRank(int i){
  32. switch(i){
  33. case 1:
  34. return "Lord ";
  35. case 2:
  36. return "Sir ";
  37. case 3:
  38. return "Lionheart ";
  39. case 4:
  40. return "Desperado ";
  41. case 5:
  42. return "Bandito ";
  43. case 6:
  44. return "King ";
  45. case 7:
  46. return "Big Cheese ";
  47. case 8:
  48. return "Wunderkind ";
  49. case 9:
  50. return "Crusader ";
  51. case 10:
  52. return "Overlord ";
  53. case 11:
  54. return "Bigwig ";
  55. case 12:
  56. return "Count ";
  57. case 13:
  58. return "Duderino ";
  59. case 14:
  60. return "Hell Raiser ";
  61. case 15:
  62. return "Baron ";
  63. case 16:
  64. return "Duke ";
  65. case 17:
  66. return "Lady ";
  67. case 18:
  68. return "Dame ";
  69. case 19:
  70. return "Dudette ";
  71. case 20:
  72. return "Baroness ";
  73. case 21:
  74. return "Countess ";
  75. case 22:
  76. return "Overlordess ";
  77. case 23:
  78. return "Duchess ";
  79. case 24:
  80. return "Queen ";
  81. case 25:
  82. return "Respect ";
  83. }
  84. return "";
  85. }
  86. public boolean
  87.  
  88. is459 = false,
  89. is474 = false,
  90. is480 = false,
  91. is508 = false,
  92. is525 = false,
  93. is562 = true,
  94. idToggle = false,
  95. hitbarToggle = true,
  96. menuToggle = true,
  97. namesToggle = false,
  98. hitmarks = true;
  99. public static boolean
  100. newDamage = false,
  101. normalLogin = true;//KEEP TRUE!
  102.  
  103. public TextDrawingArea newSmallFont;
  104. public TextDrawingArea newRegularFont;
  105. public TextDrawingArea newBoldFont;
  106. public TextDrawingArea newFancyFont;
  107. public Sprite[] chatImages = new Sprite[7];
  108. public AlertHandler alertHandler;
  109. public Sprite alertBack;
  110. public Sprite alertBorder;
  111. public Sprite alertBorderH;
  112.  
  113. private Sprite LFull;
  114. private Sprite LEmpty;
  115. public boolean selectAction;
  116. public int isClicked;
  117. public Sprite[] LOGIN = new Sprite[27];
  118. public Sprite qc;
  119.  
  120. public void welcome() {
  121. }
  122.  
  123. public void addLoginScreenHover(Sprite[] spriteName,int spriteId, int Xpos, int Ypos, int hoverId){
  124. spriteName[spriteId].drawSprite(Xpos, Ypos);
  125. if(super.mouseX >= Xpos && super.mouseX <= Xpos + spriteName[spriteId].myWidth && super.mouseY >= Ypos+3 && super.mouseY <= Ypos+spriteName[spriteId].myHeight+2){
  126. spriteName[hoverId].drawSprite(Xpos, Ypos);
  127. }
  128. }
  129.  
  130. public void setSidebarInterface(int sidebarID, int interfaceID) {
  131. tabInterfaceIDs[sidebarID] = interfaceID;
  132. tabID = sidebarID;
  133. needDrawTabArea = true;
  134. tabAreaAltered = true;
  135. }
  136.  
  137. public int positions[] = new int[2000];
  138. public int landScapes[] = new int[2000];
  139. public int objects[] = new int[2000];
  140.  
  141. public void setNewMaps() {
  142. try {
  143. BufferedReader in = new BufferedReader(new FileReader(signlink.findcachedir()+"Maps/mapConfig.txt"));
  144. String s;
  145. int D = 0;
  146. while ((s = in.readLine()) != null) {
  147. positions[D] = Integer.parseInt(s.substring(s.indexOf("=")+1,s.indexOf("(")));
  148. landScapes[D] = Integer.parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")));
  149. objects[D] = Integer.parseInt(s.substring(s.indexOf("[")+1,s.indexOf("]")));
  150. D++;
  151. }
  152. } catch (IOException e) {
  153. e.printStackTrace();
  154. }
  155. }
  156.  
  157. public static String capitalize(String s) {
  158. for (int i = 0; i < s.length(); i++) {
  159. if (i == 0) {
  160. s = String.format( "%s%s",
  161. Character.toUpperCase(s.charAt(0)),
  162. s.substring(1) );
  163. }
  164. if (!Character.isLetterOrDigit(s.charAt(i))) {
  165. if (i + 1 < s.length()) {
  166. s = String.format( "%s%s%s",
  167. s.subSequence(0, i+1),
  168. Character.toUpperCase(s.charAt(i + 1)),
  169. s.substring(i+2) );
  170. }
  171. }
  172. }
  173. return s;
  174. }
  175.  
  176. public int MapX, MapY;
  177. public static int spellID = 0;
  178. private static String intToKOrMilLongName(int i) {
  179. String s = String.valueOf(i);
  180. for(int k = s.length() - 3; k > 0; k -= 3)
  181. s = s.substring(0, k) + "," + s.substring(k);
  182. //if(j != 0)
  183. // aBoolean1224 = !aBoolean1224;
  184. if(s.length() > 8)
  185. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  186. else
  187. if(s.length() > 4)
  188. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  189. return " " + s;
  190. }
  191. public final String methodR(/*int i,*/ int j) {
  192. //if(i <= 0)
  193. // pktType = inStream.readUnsignedByte();
  194. if(j >= 0 && j < 10000)
  195. return String.valueOf(j);
  196. if(j >= 10000 && j < 10000000)
  197. return j / 1000 + "K";
  198. if(j >= 10000000 && j < 999999999)
  199. return j / 1000000 + "M";
  200. if(j >= 999999999)
  201. return "*";
  202. else
  203. return "?";
  204. }
  205.  
  206. public void models() {
  207. for(int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  208. byte[] abyte0 = getModel(ModelIndex);
  209. if(abyte0 != null && abyte0.length > 0) {
  210.  
  211. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  212. pushMessage("Model added successfully!", 0, "");
  213. }
  214. }
  215. }
  216. public byte[] getModel(int Index) {
  217. try {
  218. File Model = new File(signlink.findcachedir() + "/Raw/"+Index+".dat");//there we go.
  219. byte[] aByte = new byte[(int)Model.length()];
  220. FileInputStream fis = new FileInputStream(Model);
  221. fis.read(aByte);
  222. pushMessage("aByte = ["+aByte+"]!", 0, "");
  223. fis.close();
  224.  
  225. return aByte;
  226. }
  227. catch(Exception e)
  228. {return null;}
  229. }
  230.  
  231. private void stopMidi() {
  232. signlink.midifade = 0;
  233. signlink.midi = "stop";
  234. }
  235.  
  236. private boolean menuHasAddFriend(int j) {
  237. if(j < 0)
  238. return false;
  239. int k = menuActionID[j];
  240. if(k >= 2000)
  241. k -= 2000;
  242. return k == 337;
  243. }
  244.  
  245. public void drawChannelButtons() {
  246. if(is459) {
  247. aTextDrawingArea_1271.method389(true, 25, 0xffffff, "Public chat", 142);
  248. aTextDrawingArea_1271.method389(true, 150, 0xffffff, "Private chat", 142);
  249. aTextDrawingArea_1271.method389(true, 285, 0xffffff, "Trade/compete", 142);
  250. aTextDrawingArea_1271.method389(true, 422, 0xffffff, "Report Abuse", 147);
  251. if(publicChatMode == 0)
  252. aTextDrawingArea_1271.method382(65280, 55, "On", 153, true);
  253. if(publicChatMode == 1)
  254. aTextDrawingArea_1271.method382(0xffff00, 55, "Friends", 153, true);
  255. if(publicChatMode == 2)
  256. aTextDrawingArea_1271.method382(0xff0000, 55, "Off", 153, true);
  257. if(publicChatMode == 3)
  258. aTextDrawingArea_1271.method382(65535, 55, "Hide", 153, true);
  259. if(privateChatMode == 0)
  260. aTextDrawingArea_1271.method382(65280, 180, "On", 153, true);
  261. if(privateChatMode == 1)
  262. aTextDrawingArea_1271.method382(0xffff00, 180, "Friends", 153, true);
  263. if(privateChatMode == 2)
  264. aTextDrawingArea_1271.method382(0xff0000, 180, "Off", 153, true);
  265. if(tradeMode == 0)
  266. aTextDrawingArea_1271.method382(65280, 324, "On", 153, true);
  267. if(tradeMode == 1)
  268. aTextDrawingArea_1271.method382(0xffff00, 324, "Friends", 153, true);
  269. if(tradeMode == 2)
  270. aTextDrawingArea_1271.method382(0xff0000, 324, "Off", 153, true);
  271. } else if(is480 || is508 || is525 || is562) {
  272. String text[] = { "On", "Friends", "Off", "Hide" };
  273. int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  274. switch(cButtonCPos) {
  275. case 0: chatButtons[1].drawSprite(5, 142); break;
  276. case 1: chatButtons[1].drawSprite(62, 142); break;
  277. case 2: chatButtons[1].drawSprite(119, 142); break;
  278. case 3: chatButtons[1].drawSprite(176, 142); break;
  279. case 4: chatButtons[1].drawSprite(233, 142); break;
  280. case 5: chatButtons[1].drawSprite(290, 142); break;
  281. case 6: chatButtons[1].drawSprite(347, 142); break;
  282. } if(cButtonHPos == cButtonCPos) {
  283. switch(cButtonHPos) {
  284. case 0: chatButtons[2].drawSprite(5, 142); break;
  285. case 1: chatButtons[2].drawSprite(62, 142); break;
  286. case 2: chatButtons[2].drawSprite(119, 142); break;
  287. case 3: chatButtons[2].drawSprite(176, 142); break;
  288. case 4: chatButtons[2].drawSprite(233, 142); break;
  289. case 5: chatButtons[2].drawSprite(290, 142); break;
  290. case 7: chatButtons[2].drawSprite(347, 142); break;
  291. case 6: chatButtons[3].drawSprite(404, 142); break;
  292. }
  293. } else {
  294. switch(cButtonHPos) {
  295. case 0: chatButtons[2].drawSprite(5, 142); break;
  296. case 1: chatButtons[2].drawSprite(62, 142); break;
  297. case 2: chatButtons[2].drawSprite(119, 142); break;
  298. case 3: chatButtons[2].drawSprite(176, 142); break;
  299. case 4: chatButtons[2].drawSprite(233, 142); break;
  300. case 5: chatButtons[2].drawSprite(290, 142); break;
  301. case 7: chatButtons[2].drawSprite(347, 142); break;
  302. case 6: chatButtons[3].drawSprite(404, 142); break;
  303. }
  304. }
  305. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  306. smallText.method389(true, 26, 0xffffff, "All", 157);
  307. smallText.method389(true, 76, 0xffffff, "Game", 157);
  308. smallText.method389(true, 131, 0xffffff, "Public", 153);
  309. smallText.method389(true, 184, 0xffffff, "Private", 153);
  310. smallText.method389(true, 249, 0xffffff, "Clan", 153);
  311. smallText.method389(true, 304, 0xffffff, "Trade", 153);
  312. smallText.method389(true, 359, 0xffffff, "Assist", 153);
  313.  
  314. smallText.method382(disabledColor[publicChatMode], 147, text[publicChatMode], 164, true);
  315. smallText.method382(disabledColor[privateChatMode], 203, text[privateChatMode], 164, true);
  316. smallText.method382(disabledColor[clanChatMode], 261, text[clanChatMode], 164, true);
  317. smallText.method382(disabledColor[tradeMode], 318, text[tradeMode], 164, true);
  318. smallText.method382(0xff0000, 374, "Off", 164, true);
  319. } else if(is474) {
  320. String text[] = { "On", "Friends", "Off", "Hide" };
  321. int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  322. switch(cButtonCPos) {
  323. case 0: chatButtons[1].drawSprite(5, 142); break;
  324. case 1: chatButtons[1].drawSprite(71, 142); break;
  325. case 2: chatButtons[1].drawSprite(137, 142); break;
  326. case 3: chatButtons[1].drawSprite(203, 142); break;
  327. case 4: chatButtons[1].drawSprite(269, 142); break;
  328. case 5: chatButtons[1].drawSprite(335, 142); break;
  329. } if(cButtonHPos == cButtonCPos) {
  330. switch(cButtonHPos) {
  331. case 0: chatButtons[2].drawSprite(5, 142); break;
  332. case 1: chatButtons[2].drawSprite(71, 142); break;
  333. case 2: chatButtons[2].drawSprite(137, 142); break;
  334. case 3: chatButtons[2].drawSprite(203, 142); break;
  335. case 4: chatButtons[2].drawSprite(269, 142); break;
  336. case 5: chatButtons[2].drawSprite(335, 142); break;
  337. case 6: chatButtons[3].drawSprite(404, 142); break;
  338. }
  339. } else {
  340. switch(cButtonHPos) {
  341. case 0: chatButtons[0].drawSprite(5, 142); break;
  342. case 1: chatButtons[0].drawSprite(71, 142); break;
  343. case 2: chatButtons[0].drawSprite(137, 142); break;
  344. case 3: chatButtons[0].drawSprite(203, 142); break;
  345. case 4: chatButtons[0].drawSprite(269, 142); break;
  346. case 5: chatButtons[0].drawSprite(335, 142); break;
  347. case 6: chatButtons[3].drawSprite(404, 142); break;
  348. }
  349. }
  350. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  351. smallText.method389(true, 26, 0xffffff, "All", 157);
  352. smallText.method389(true, 86, 0xffffff, "Game", 157);
  353. smallText.method389(true, 150, 0xffffff, "Public", 152);
  354. smallText.method389(true, 212, 0xffffff, "Private", 152);
  355. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  356. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  357. smallText.method382(disabledColor[publicChatMode], 164, text[publicChatMode], 163, true);
  358. smallText.method382(disabledColor[privateChatMode], 230, text[privateChatMode], 163, true);
  359. smallText.method382(disabledColor[clanChatMode], 296, text[clanChatMode], 163, true);
  360. smallText.method382(disabledColor[tradeMode], 362, text[tradeMode], 163, true);
  361. }
  362. if(menuOpen){
  363. drawMenu(0, 338);
  364. }
  365. }
  366.  
  367. private void drawChatArea() {
  368. chatBackImage.initDrawingArea();
  369. Texture.anIntArray1472 = anIntArray1180;
  370. chatArea[getSpriteID()].drawSprite(0, 0);
  371. if(spriteChanged){
  372. aBoolean1233 = true;
  373. inputTaken = true;
  374. }
  375. if(is459) {
  376. TextDrawingArea textDrawingArea = newRegularFont;
  377. if(messagePromptRaised) {
  378. newBoldFont.drawCenteredString(aString1121, 239, 60, 0, -1);
  379. newBoldFont.drawCenteredString( promptInput + "*", 239, 80, 128, -1);
  380. } else if(inputDialogState == 1) {
  381. newBoldFont.drawCenteredString("Enter amount:", 239, 60, 0, -1);
  382. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  383. } else if(inputDialogState == 2) {
  384. newBoldFont.drawCenteredString("Enter name:", 239, 60, 0, -1);
  385. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  386. } else if(aString844 != null) {
  387. newBoldFont.drawCenteredString(aString844, 239, 60, 0, -1);
  388. newBoldFont.drawCenteredString("Click to continue", 239, 80, 128, -1);
  389. } else if(backDialogID != -1) {
  390. drawInterface(0, 16, RSInterface.interfaceCache[backDialogID], 20);
  391. } else if(dialogID != -1) {
  392. drawInterface(0, 16, RSInterface.interfaceCache[dialogID], 20);
  393. } else {
  394. int j77 = 0;
  395. int j = 0;
  396. DrawingArea.setDrawingArea(93+5, 0, 463, 22);
  397. for(int k = 0; k < 100; k++)
  398. if(chatMessages[k] != null) {
  399. int chatType = chatTypes[k];
  400. int yPos = (88 - j77 * 14) + anInt1089 + 5;
  401. String s1 = chatNames[k];
  402. byte byte0 = 0;
  403. if (s1 != null && s1.startsWith("@cr0@")) {
  404. s1 = s1.substring(5);
  405. byte0 = 1;
  406. } else if(s1 != null && s1.startsWith("@cr1@")) {
  407. s1 = s1.substring(5);
  408. byte0 = 2;
  409. } else if(s1 != null && s1.startsWith("@cr2@")) {
  410. s1 = s1.substring(5);
  411. byte0 = 3;
  412. } else if(s1 != null && s1.startsWith("@cr3@")) {
  413. s1 = s1.substring(5);
  414. byte0 = 4;
  415. }
  416. /* Draws Chat Colored Messages */
  417. if(chatType == 0) {
  418. if (chatTypeView == 5 || chatTypeView == 0) {
  419. if(yPos > 0 && yPos < 110)
  420. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0, -1);
  421. j++;
  422. j77++;
  423. }
  424. }
  425. /* Draws clickable URL text into chatarea */
  426. if(chatType == 9) {
  427. if (chatTypeView == 5 || chatTypeView == 0) {
  428. if(yPos > 0 && yPos < 110)
  429. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 19, yPos, 0x7e3200, -1);
  430. j++;
  431. j77++;
  432. }
  433. }
  434. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  435. if (chatTypeView == 1 || chatTypeView == 0) {
  436. if(yPos > 0 && yPos < 110) {
  437. int xPos = 19;
  438. switch(byte0) {
  439. case 1:
  440. modIcons[0].drawSprite(xPos, yPos - 12);
  441. xPos += 14;
  442. break;
  443. case 2:
  444. modIcons[1].drawSprite(xPos, yPos - 12);
  445. xPos += 14;
  446. break;
  447. case 3:
  448. modIcons[2].drawSprite(xPos, yPos - 12);
  449. xPos += 14;
  450. break;
  451. case 4:
  452. modIcons[3].drawSprite(xPos, yPos - 12);
  453. xPos += 14;
  454. break;
  455. }
  456. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  457. xPos += newRegularFont.getTextWidth(s1) + 8;
  458. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  459. }
  460. j++;
  461. j77++;
  462. }
  463. }
  464. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  465. if (chatTypeView == 2 || chatTypeView == 0) {
  466. if(yPos > 0 && yPos < 110) {
  467. int k1 = 4;
  468. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  469. k1 += newRegularFont.getTextWidth("From ");
  470. switch(byte0) {
  471. case 1:
  472. modIcons[0].drawSprite(k1, yPos - 12);
  473. k1 += 14;
  474. break;
  475. case 2:
  476. modIcons[1].drawSprite(k1, yPos - 12);
  477. k1 += 14;
  478. break;
  479. case 3:
  480. modIcons[2].drawSprite(k1, yPos - 12);
  481. k1 += 14;
  482. break;
  483. case 4:
  484. modIcons[3].drawSprite(k1, yPos - 12);
  485. k1 += 14;
  486. break;
  487. }
  488. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  489. k1 += newRegularFont.getTextWidth(s1) + 8;
  490. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  491. }
  492. j++;
  493. j77++;
  494. }
  495. }
  496. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  497. if (chatTypeView == 3 || chatTypeView == 0) {
  498. if(yPos > 0 && yPos < 110)
  499. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 19, yPos, 0x800080, -1);
  500. j++;
  501. j77++;
  502. }
  503. }
  504. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  505. if (chatTypeView == 2 || chatTypeView == 0) {
  506. if(yPos > 0 && yPos < 110)
  507. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0x800000, -1);
  508. j++;
  509. j77++;
  510. }
  511. }
  512. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  513. if (chatTypeView == 2 || chatTypeView == 0) {
  514. if(yPos > 0 && yPos < 110) {
  515. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  516. newRegularFont.drawBasicString(chatMessages[k], 12 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  517. }
  518. j++;
  519. j77++;
  520. }
  521. }
  522. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  523. if (chatTypeView == 3 || chatTypeView == 0) {
  524. if(yPos > 0 && yPos < 110)
  525. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  526. j++;
  527. j77++;
  528. }
  529. if(chatType == 11 && (clanChatMode == 0)) {
  530. if (chatTypeView == 11) {
  531. if(yPos > 0 && yPos < 110)
  532. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  533. j++;
  534. j77++;
  535. }
  536. }
  537. }
  538. if(chatType == 16) {
  539. int j2 = 40+11;
  540. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  541. if(chatTypeView == 11 || chatTypeView == 0) {
  542. if(yPos > 0 && yPos < 110)
  543. switch(chatRights[k]) {
  544. case 1:
  545. j2 += clanNameWidth;
  546. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  547. j2 += 15;
  548. break;
  549. case 2:
  550. j2 += clanNameWidth;
  551. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  552. j2 += 15;
  553. break;
  554. case 3:
  555. j2 += clanNameWidth;
  556. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  557. j2 += 15;
  558. break;
  559. case 4:
  560. j2 += clanNameWidth;
  561. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  562. j2 += 15;
  563. break;
  564. default:
  565. j2 += clanNameWidth;
  566. break;
  567. }
  568. newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
  569. newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
  570. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
  571. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  572. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  573. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  574.  
  575. j++;
  576. j77++;
  577. }
  578. }
  579. }
  580. DrawingArea.defaultDrawingAreaSize();
  581. anInt1211 = j * 14 + 7;
  582. if(anInt1211 < 78)
  583. anInt1211 = 78;
  584. drawScrollbar(77, anInt1211 - anInt1089 - 77, 20, 480, anInt1211);
  585. String s;
  586. if(myPlayer != null && myPlayer.name != null)
  587. s = "<col=13132800>"+getRank(myPlayer.skill)+"</col>" + myPlayer.name;
  588. else
  589. s = TextClass.fixName(capitalize(myUsername));
  590. newRegularFont.drawBasicString(s + ":", 19, 110, 0, -1);
  591. newRegularFont.drawBasicString(inputString + "*", 20 + textDrawingArea.getTextWidth(s + ": "), 110, 255, -1);
  592. DrawingArea.method339(97, 0x000000, 479, 17);
  593. }
  594. } else if(is474 || is480 || is508 || is525 || is562) {
  595. TextDrawingArea textDrawingArea = newRegularFont;
  596. if(messagePromptRaised) {
  597. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  598. newBoldFont.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
  599. } else if(inputDialogState == 1) {
  600. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  601. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  602. } else if(inputDialogState == 2) {
  603. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  604. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  605. } else if(aString844 != null) {
  606. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  607. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128, -1);
  608. } else if(backDialogID != -1) {
  609. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  610. } else if(dialogID != -1) {
  611. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  612. } else {
  613. int j77 = -3;
  614. int j = 0;
  615. DrawingArea.setDrawingArea(122, 8, 497, 7);
  616. for(int k = 0; k < 500; k++)
  617. if(chatMessages[k] != null) {
  618. int chatType = chatTypes[k];
  619. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  620. String s1 = chatNames[k];
  621. byte byte0 = 0;
  622. if (s1 != null && s1.startsWith("@cr0@")) {
  623. s1 = s1.substring(5);
  624. byte0 = 1;
  625. } else if(s1 != null && s1.startsWith("@cr1@")) {
  626. s1 = s1.substring(5);
  627. byte0 = 2;
  628. } else if(s1 != null && s1.startsWith("@cr2@")) {
  629. s1 = s1.substring(5);
  630. byte0 = 3;
  631. } else if(s1 != null && s1.startsWith("@cr3@")) {
  632. s1 = s1.substring(5);
  633. byte0 = 4;
  634. }
  635. /* Draws Chat Colored Messages */
  636. if(chatType == 0) {
  637. if (chatTypeView == 5 || chatTypeView == 0) {
  638. if(yPos > 0 && yPos < 210)
  639. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
  640. j++;
  641. j77++;
  642. }
  643. }
  644. /* Draws clickable URL text into chatarea */
  645. if(chatType == 9) {
  646. if (chatTypeView == 5 || chatTypeView == 0) {
  647. if(yPos > 0 && yPos < 210)
  648. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11, yPos, 0x7e3200, -1);
  649. j++;
  650. j77++;
  651. }
  652. }
  653. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  654. if (chatTypeView == 1 || chatTypeView == 0) {
  655. if(yPos > 0 && yPos < 210) {
  656. int xPos = 11;
  657. switch(byte0) {
  658. case 1:
  659. modIcons[0].drawSprite(xPos, yPos - 12);
  660. xPos += 14;
  661. break;
  662. case 2:
  663. modIcons[1].drawSprite(xPos, yPos - 12);
  664. xPos += 14;
  665. break;
  666. case 3:
  667. modIcons[2].drawSprite(xPos, yPos - 12);
  668. xPos += 14;
  669. break;
  670. case 4:
  671. modIcons[3].drawSprite(xPos, yPos - 12);
  672. xPos += 14;
  673. break;
  674. }
  675. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  676. xPos += newRegularFont.getTextWidth(s1) + 8;
  677. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  678. }
  679. j++;
  680. j77++;
  681. }
  682. }
  683. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  684. if (chatTypeView == 2 || chatTypeView == 0) {
  685. if(yPos > 0 && yPos < 210) {
  686. int k1 = 11;
  687. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  688. k1 += newRegularFont.getTextWidth("From ");
  689. switch(byte0) {
  690. case 1:
  691. modIcons[0].drawSprite(k1, yPos - 12);
  692. k1 += 14;
  693. break;
  694. case 2:
  695. modIcons[1].drawSprite(k1, yPos - 12);
  696. k1 += 14;
  697. break;
  698. case 3:
  699. modIcons[2].drawSprite(k1, yPos - 12);
  700. k1 += 14;
  701. break;
  702. case 4:
  703. modIcons[3].drawSprite(k1, yPos - 12);
  704. k1 += 14;
  705. break;
  706. }
  707. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  708. k1 += newRegularFont.getTextWidth(s1) + 8;
  709. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  710. }
  711. j++;
  712. j77++;
  713. }
  714. }
  715. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  716. if (chatTypeView == 3 || chatTypeView == 0) {
  717. if(yPos > 0 && yPos < 210)
  718. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
  719. j++;
  720. j77++;
  721. }
  722. }
  723. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  724. if (chatTypeView == 2 || chatTypeView == 0) {
  725. if(yPos > 0 && yPos < 210)
  726. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  727. j++;
  728. j77++;
  729. }
  730. }
  731. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  732. if (chatTypeView == 2 || chatTypeView == 0) {
  733. if(yPos > 0 && yPos < 210) {
  734. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  735. newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  736. }
  737. j++;
  738. j77++;
  739. }
  740. }
  741. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  742. if (chatTypeView == 3 || chatTypeView == 0) {
  743. if(yPos > 0 && yPos < 210)
  744. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  745. j++;
  746. j77++;
  747. }
  748. if(chatType == 11 && (clanChatMode == 0)) {
  749. if (chatTypeView == 11) {
  750. if(yPos > 0 && yPos < 210)
  751. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  752. j++;
  753. j77++;
  754. }
  755. }
  756. }
  757. if(chatType == 16) {
  758. int j2 = 40;
  759. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  760. if(chatTypeView == 11 || chatTypeView == 0) {
  761. if(yPos > 3 && yPos < 130)
  762. switch(chatRights[k]) {
  763. case 1:
  764. j2 += clanNameWidth;
  765. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  766. j2 += 14;
  767. break;
  768. case 2:
  769. j2 += clanNameWidth;
  770. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  771. j2 += 14;
  772. break;
  773. case 3:
  774. j2 += clanNameWidth;
  775. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  776. j2 += 14;
  777. break;
  778. case 4:
  779. j2 += clanNameWidth;
  780. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  781. j2 += 14;
  782. break;
  783. default:
  784. j2 += clanNameWidth;
  785. break;
  786. }
  787. newRegularFont.drawBasicString("[", 8, yPos, 0, -1);
  788. newRegularFont.drawBasicString("]", clanNameWidth + 16, yPos, 0, -1);
  789. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 14, yPos, 255, -1);
  790. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  791. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  792. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  793.  
  794. j++;
  795. j77++;
  796. }
  797. }
  798. }
  799. DrawingArea.defaultDrawingAreaSize();
  800. anInt1211 = j * 14 + 7 + 5;
  801. if(anInt1211 < 111)
  802. anInt1211 = 111;
  803. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  804. String s;
  805. if(myPlayer != null && myPlayer.name != null)
  806. s = "<col=13132800>"+getRank(myPlayer.skill)+"</col>" + myPlayer.name;
  807. else
  808. s = TextClass.fixName(capitalize(myUsername));
  809. if(is508) {
  810. qc.drawSprite(textDrawingArea.getTextWidth(s) + 11, 123);
  811. newRegularFont.drawBasicString(s, 11, 133, 0, -1);
  812. newRegularFont.drawBasicString(":", (25 + textDrawingArea.getTextWidth(s)), 133, 0, -1);
  813. newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "<col=0>|" : ""), 23 + textDrawingArea.getTextWidth(s + ": "), 133 ,255 , -1);
  814. DrawingArea.method339(121, 0x807660, 506, 7);
  815. } else {
  816. newRegularFont.drawBasicString(s + ":", 11, 133, 0, -1);
  817. newRegularFont.drawBasicString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
  818. DrawingArea.method339(121, 0x807660, 506, 7);
  819. }
  820. }
  821. }
  822. drawChannelButtons();
  823. chatBackImage.drawGraphics(338, super.graphics, 0);
  824. inGameScreen.initDrawingArea();
  825. Texture.anIntArray1472 = anIntArray1182;
  826. }
  827.  
  828. public void init() {
  829. try {
  830. System.out.println("Universalscape is loading..");
  831. nodeID = 10;//friends list order
  832. portOff = 0;
  833. setHighMem();
  834. isMembers = true;
  835. signlink.startpriv(InetAddress.getLocalHost());
  836. instance = this;
  837. initClientFrame(503, 765);//this it? 510 770
  838. } catch (Exception e) {
  839. e.printStackTrace();
  840. }
  841. }
  842.  
  843. public void drawTabHover() {
  844. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  845. tabHover.drawSprite(3+3, 0);
  846. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  847. tabHover.drawSprite(33+3, 0);
  848. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  849. tabHover.drawSprite(63+3, 0);
  850. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  851. tabHover.drawSprite(93+3, 0);
  852. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  853. tabHover.drawSprite(123+3, 0);
  854. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  855. tabHover.drawSprite(153+3, 0);
  856. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  857. tabHover.drawSprite(183+3, 0);
  858. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  859. tabHover.drawSprite(213+3, 0);
  860. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  861. tabHover.drawSprite(3+3, 298);
  862. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  863. tabHover.drawSprite(33+3, 298);
  864. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  865. tabHover.drawSprite(63+3, 298);
  866. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  867. tabHover.drawSprite(93+3, 298);
  868. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  869. tabHover.drawSprite(123+3, 298);
  870. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  871. tabHover.drawSprite(153+3, 298);
  872. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  873. tabHover.drawSprite(183+3,298);
  874. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  875. tabHover.drawSprite(213+3, 298);
  876. }
  877.  
  878. public void startRunnable(Runnable runnable, int i) {
  879. if(i > 10)
  880. i = 10;
  881. if(signlink.mainapp != null) {
  882. signlink.startthread(runnable, i);
  883. } else {
  884. super.startRunnable(runnable, i);
  885.  
  886. }
  887. }
  888.  
  889. public Socket openSocket(int port) throws IOException {
  890. return new Socket(InetAddress.getByName(server), port);
  891. }
  892.  
  893. private void processMenuClick() {
  894. if(activeInterfaceType != 0)
  895. return;
  896. int j = super.clickMode3;
  897. if(spellSelected == 1 && super.saveClickX >= 503 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  898. j = 0;
  899. if(menuOpen) {
  900. if(j != 1) {
  901. int k = super.mouseX;
  902. int j1 = super.mouseY;
  903. if(menuScreenArea == 0) {
  904. k -= 4;
  905. j1 -= 4;
  906. }
  907. if(menuScreenArea == 1) {
  908. k -= 516;//519
  909. j1 -= 168;
  910. }
  911. if(menuScreenArea == 2) {
  912. k -= 5;
  913. j1 -= 338;
  914. }
  915. if(menuScreenArea == 3) {
  916. k -= 516;//519
  917. j1 -= 0;
  918. }
  919. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  920. menuOpen = false;
  921. if(menuScreenArea == 1)
  922. needDrawTabArea = true;
  923. if(menuScreenArea == 2)
  924. inputTaken = true;
  925. }
  926. }
  927. if(j == 1) {
  928. int l = menuOffsetX;
  929. int k1 = menuOffsetY;
  930. int i2 = menuWidth;
  931. int k2 = super.saveClickX;
  932. int l2 = super.saveClickY;
  933. if(menuScreenArea == 0) {
  934. k2 -= 4;
  935. l2 -= 4;
  936. }
  937. if(menuScreenArea == 1) {
  938. k2 -= 516;//519
  939. l2 -= 168;
  940. }
  941. if(menuScreenArea == 2) {
  942. k2 -= 5;//17
  943. l2 -= 338;
  944. }
  945. if(menuScreenArea == 3) {
  946. k2 -= 516;//519
  947. l2 -= 0;
  948. }
  949. int i3 = -1;
  950. for(int j3 = 0; j3 < menuActionRow; j3++) {
  951. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  952. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  953. i3 = j3;
  954. }
  955. System.out.println(i3);
  956. if(i3 != -1)
  957. doAction(i3);
  958. menuOpen = false;
  959. if(menuScreenArea == 1)
  960. needDrawTabArea = true;
  961. if(menuScreenArea == 2) {
  962. inputTaken = true;
  963. }
  964. }
  965. } else {
  966. if(j == 1 && menuActionRow > 0) {
  967. int i1 = menuActionID[menuActionRow - 1];
  968. 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) {
  969. int l1 = menuActionCmd2[menuActionRow - 1];
  970. int j2 = menuActionCmd3[menuActionRow - 1];
  971. RSInterface class9 = RSInterface.interfaceCache[j2];
  972. if(class9.allowSwapItems || class9.deletesTargetSlot) {
  973. aBoolean1242 = false;
  974. anInt989 = 0;
  975. anInt1084 = j2;
  976. anInt1085 = l1;
  977. activeInterfaceType = 2;
  978. anInt1087 = super.saveClickX;
  979. anInt1088 = super.saveClickY;
  980. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  981. activeInterfaceType = 1;
  982. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  983. activeInterfaceType = 3;
  984. return;
  985. }
  986. }
  987. }
  988. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  989. j = 2;
  990. if(j == 1 && menuActionRow > 0)
  991. doAction(menuActionRow - 1);
  992. if(j == 2 && menuActionRow > 0)
  993. determineMenuSize();
  994.  
  995. }
  996. }
  997.  
  998.  
  999. public static int totalRead = 0;
  1000.  
  1001. public static String getFileNameWithoutExtension(String fileName) {
  1002. File tmpFile = new File(fileName);
  1003. tmpFile.getName();
  1004. int whereDot = tmpFile.getName().lastIndexOf('.');
  1005. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  1006. return tmpFile.getName().substring(0, whereDot);
  1007. }
  1008. return "";
  1009. }
  1010.  
  1011. public void preloadModels() {
  1012. File file = new File(signlink.findcachedir()+"Raw/");
  1013. File[] fileArray = file.listFiles();
  1014. for(int y = 0; y < fileArray.length; y++) {
  1015. String s = fileArray[y].getName();
  1016. byte[] buffer = ReadFile(signlink.findcachedir()+"Raw/"+s);
  1017. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  1018. }
  1019. }
  1020.  
  1021. public static final byte[] ReadFile(String s) {
  1022. try {
  1023. byte abyte0[];
  1024. File file = new File(s);
  1025. int i = (int)file.length();
  1026. abyte0 = new byte[i];
  1027. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  1028. datainputstream.readFully(abyte0, 0, i);
  1029. datainputstream.close();
  1030. return abyte0;
  1031. } catch(Exception e) {
  1032. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  1033. return null;
  1034. }
  1035. }
  1036.  
  1037. private void saveMidi(boolean flag, byte abyte0[]) {
  1038. signlink.midifade = flag ? 1 : 0;
  1039. signlink.midisave(abyte0, abyte0.length);
  1040. }
  1041.  
  1042. public static void writeFile(byte[] data, String fileName) throws IOException{
  1043. OutputStream out = new FileOutputStream(fileName);
  1044. out.write(data);
  1045. out.close();
  1046. }
  1047.  
  1048. public final void method22() {
  1049. try {
  1050. anInt985 = -1;
  1051. aClass19_1056.removeAll();
  1052. aClass19_1013.removeAll();
  1053. Texture.method366();
  1054. unlinkMRUNodes();
  1055. worldController.initToNull();
  1056. System.gc();
  1057. for(int i = 0; i < 4; i++)
  1058. aClass11Array1230[i].method210();
  1059. for(int l = 0; l < 4; l++) {
  1060. for(int k1 = 0; k1 < 104; k1++) {
  1061. for(int j2 = 0; j2 < 104; j2++)
  1062. byteGroundArray[l][k1][j2] = 0;
  1063. }
  1064. }
  1065. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  1066. int k2 = aByteArrayArray1183.length;
  1067. int k18 = 64;
  1068. for(int A = 0; A < k2; A++)
  1069. for(int B = 0; B < 2000; B++)
  1070. if(anIntArray1234[A] == positions[B]){
  1071. anIntArray1235[A] = landScapes[B];
  1072. anIntArray1236[A] = objects[B];
  1073. }
  1074. stream.createFrame(0);
  1075. if(!aBoolean1159) {
  1076. for(int i3 = 0; i3 < k2; i3++) {
  1077. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1078. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1079. byte abyte0[] = aByteArrayArray1183[i3];
  1080. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat"))
  1081. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat");
  1082. if(abyte0 != null)
  1083. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  1084. }
  1085. for(int j4 = 0; j4 < k2; j4++) {
  1086. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1087. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1088. byte abyte2[] = aByteArrayArray1183[j4];
  1089. if(abyte2 == null && anInt1070 < 800)
  1090. objectManager.method174(k7, 64, 64, l5);
  1091. }
  1092. anInt1097++;
  1093. if(anInt1097 > 160) {
  1094. anInt1097 = 0;
  1095. stream.createFrame(238);
  1096. stream.writeWordBigEndian(96);
  1097. }
  1098. stream.createFrame(0);
  1099. for(int i6 = 0; i6 < k2; i6++) {
  1100. byte abyte1[] = aByteArrayArray1247[i6];
  1101. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat"))
  1102. abyte1 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat");
  1103. if(abyte1 != null) {
  1104. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1105. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1106. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  1107. }
  1108. }
  1109. }
  1110. if(aBoolean1159) {
  1111. for(int j3 = 0; j3 < 4; j3++) {
  1112. for(int k4 = 0; k4 < 13; k4++) {
  1113. for(int j6 = 0; j6 < 13; j6++) {
  1114. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1115. if(l7 != -1) {
  1116. int i9 = l7 >> 24 & 3;
  1117. int l9 = l7 >> 1 & 3;
  1118. int j10 = l7 >> 14 & 0x3ff;
  1119. int l10 = l7 >> 3 & 0x7ff;
  1120. int j11 = (j10 / 8 << 8) + l10 / 8;
  1121. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  1122. {
  1123. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  1124. continue;
  1125. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  1126. break;
  1127. }
  1128.  
  1129. }
  1130. }
  1131.  
  1132. }
  1133.  
  1134. }
  1135. for(int l4 = 0; l4 < 13; l4++) {
  1136. for(int k6 = 0; k6 < 13; k6++){
  1137. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1138. if(i8 == -1)
  1139. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1140. }
  1141. }
  1142. stream.createFrame(0);
  1143. for(int l6 = 0; l6 < 4; l6++) {
  1144. for(int j8 = 0; j8 < 13; j8++) {
  1145. for(int j9 = 0; j9 < 13; j9++) {
  1146. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1147. if(i10 != -1) {
  1148. int k10 = i10 >> 24 & 3;
  1149. int i11 = i10 >> 1 & 3;
  1150. int k11 = i10 >> 14 & 0x3ff;
  1151. int i12 = i10 >> 3 & 0x7ff;
  1152. int j12 = (k11 / 8 << 8) + i12 / 8;
  1153. for(int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1154. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  1155. continue;
  1156. byte abyte0[] = aByteArrayArray1247[k12];
  1157. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1158. break;
  1159. }
  1160. }
  1161. }
  1162. }
  1163. }
  1164. }
  1165. stream.createFrame(0);
  1166. objectManager.method171(aClass11Array1230, worldController);
  1167. inGameScreen.initDrawingArea();
  1168. stream.createFrame(0);
  1169. int k3 = ObjectManager.anInt145;
  1170. if(k3 > plane)
  1171. k3 = plane;
  1172. if(k3 < plane - 1)
  1173. k3 = plane - 1;
  1174. if(lowMem)
  1175. worldController.method275(ObjectManager.anInt145);
  1176. else
  1177. worldController.method275(0);
  1178. for(int i5 = 0; i5 < 104; i5++) {
  1179. for(int i7 = 0; i7 < 104; i7++)
  1180. spawnGroundItem(i5, i7);
  1181. }
  1182. anInt1051++;
  1183. if(anInt1051 > 98) {
  1184. anInt1051 = 0;
  1185. stream.createFrame(150);
  1186. }
  1187. method63();
  1188. } catch(Exception exception) { }
  1189. ObjectDef.mruNodes1.unlinkAll();
  1190. if(super.gameFrame != null) {
  1191. stream.createFrame(210);
  1192. stream.writeDWord(0x3f008edd);
  1193. }
  1194. System.gc();
  1195. Texture.method367();
  1196. onDemandFetcher.method566();
  1197. int k = (anInt1069 - 6) / 8 - 1;
  1198. int j1 = (anInt1069 + 6) / 8 + 1;
  1199. int i2 = (anInt1070 - 6) / 8 - 1;
  1200. int l2 = (anInt1070 + 6) / 8 + 1;
  1201. if(aBoolean1141) {
  1202. k = 49;
  1203. j1 = 50;
  1204. i2 = 49;
  1205. l2 = 50;
  1206. }
  1207. for(int l3 = k; l3 <= j1; l3++) {
  1208. for(int j5 = i2; j5 <= l2; j5++)
  1209. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1210. int j7 = onDemandFetcher.method562(0, j5, l3);
  1211. if(j7 != -1)
  1212. onDemandFetcher.method560(j7, 3);
  1213. int k8 = onDemandFetcher.method562(1, j5, l3);
  1214. if(k8 != -1)
  1215. onDemandFetcher.method560(k8, 3);
  1216. }
  1217. }
  1218. }
  1219.  
  1220.  
  1221. private void unlinkMRUNodes()
  1222. {
  1223. ObjectDef.mruNodes1.unlinkAll();
  1224. ObjectDef.mruNodes2.unlinkAll();
  1225. EntityDef.mruNodes.unlinkAll();
  1226. ItemDef.mruNodes2.unlinkAll();
  1227. ItemDef.mruNodes1.unlinkAll();
  1228. Player.mruNodes.unlinkAll();
  1229. SpotAnim.aMRUNodes_415.unlinkAll();
  1230. }
  1231.  
  1232. private void method24(int i)
  1233. {
  1234. int ai[] = aSprite_1263.myPixels;
  1235. int j = ai.length;
  1236. for(int k = 0; k < j; k++)
  1237. ai[k] = 0;
  1238.  
  1239. for(int l = 1; l < 103; l++)
  1240. {
  1241. int i1 = 24628 + (103 - l) * 512 * 4;
  1242. for(int k1 = 1; k1 < 103; k1++)
  1243. {
  1244.  
  1245. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1246. worldController.method309(ai, i1, i, k1, l);
  1247. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1248. worldController.method309(ai, i1, i + 1, k1, l);
  1249. i1 += 4;
  1250. }
  1251.  
  1252. }
  1253.  
  1254. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1255. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1256. aSprite_1263.method343();
  1257. for(int i2 = 1; i2 < 103; i2++)
  1258. {
  1259. for(int j2 = 1; j2 < 103; j2++)
  1260. {
  1261. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1262. method50(i2, j1, j2, l1, i);
  1263. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1264. method50(i2, j1, j2, l1, i + 1);
  1265. }
  1266.  
  1267. }
  1268.  
  1269. inGameScreen.initDrawingArea();
  1270. anInt1071 = 0;
  1271. for(int k2 = 0; k2 < 104; k2++)
  1272. {
  1273. for(int l2 = 0; l2 < 104; l2++)
  1274. {
  1275. int i3 = worldController.method303(plane, k2, l2);
  1276. if(i3 != 0)
  1277. {
  1278. i3 = i3 >> 14 & 0x7fff;
  1279. int j3 = ObjectDef.forID(i3).anInt746;
  1280. if(j3 >= 0)
  1281. {
  1282. int k3 = k2;
  1283. int l3 = l2;
  1284. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1285. {
  1286. byte byte0 = 104;
  1287. byte byte1 = 104;
  1288. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1289. for(int i4 = 0; i4 < 10; i4++)
  1290. {
  1291. int j4 = (int)(Math.random() * 4D);
  1292. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1293. k3--;
  1294. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1295. k3++;
  1296. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1297. l3--;
  1298. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1299. l3++;
  1300. }
  1301.  
  1302. }
  1303. aSpriteArray1140[anInt1071] = mapFunctions[j3];
  1304. anIntArray1072[anInt1071] = k3;
  1305. anIntArray1073[anInt1071] = l3;
  1306. anInt1071++;
  1307. }
  1308. }
  1309. }
  1310.  
  1311. }
  1312.  
  1313. }
  1314.  
  1315. private void spawnGroundItem(int i, int j)
  1316. {
  1317. NodeList class19 = groundArray[plane][i][j];
  1318. if(class19 == null)
  1319. {
  1320. worldController.method295(plane, i, j);
  1321. return;
  1322. }
  1323. int k = 0xfa0a1f01;
  1324. Object obj = null;
  1325. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1326. {
  1327. ItemDef itemDef = ItemDef.forID(item.ID);
  1328. int l = itemDef.value;
  1329. if(itemDef.stackable)
  1330. l *= item.anInt1559 + 1;
  1331. // notifyItemSpawn(item, i + baseX, j + baseY);
  1332. if(l > k)
  1333. {
  1334. k = l;
  1335. obj = item;
  1336. }
  1337. }
  1338. class19.insertTail(((Node) (obj)));
  1339. Object obj1 = null;
  1340. Object obj2 = null;
  1341. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1342. {
  1343. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1344. obj1 = class30_sub2_sub4_sub2_1;
  1345. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1346. obj2 = class30_sub2_sub4_sub2_1;
  1347. }
  1348. int i1 = i + (j << 7) + 0x60000000;
  1349. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1350. }
  1351.  
  1352. private void method26(boolean flag)
  1353. {
  1354. for(int j = 0; j < npcCount; j++)
  1355. {
  1356. NPC npc = npcArray[npcIndices[j]];
  1357. int k = 0x20000000 + (npcIndices[j] << 14);
  1358. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1359. continue;
  1360. int l = npc.x >> 7;
  1361. int i1 = npc.y >> 7;
  1362. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1363. continue;
  1364. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1365. {
  1366. if(anIntArrayArray929[l][i1] == anInt1265)
  1367. continue;
  1368. anIntArrayArray929[l][i1] = anInt1265;
  1369. }
  1370. if(!npc.desc.aBoolean84)
  1371. k += 0x80000000;
  1372. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1373. }
  1374. }
  1375.  
  1376. private boolean replayWave()
  1377. {
  1378. return signlink.wavereplay();
  1379. }
  1380.  
  1381. private void loadError()
  1382. {
  1383. String s = "ondemand";//was a constant parameter
  1384. System.out.println(s);
  1385. try
  1386. {
  1387. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1388. }
  1389. catch(Exception exception)
  1390. {
  1391. exception.printStackTrace();
  1392. }
  1393. do
  1394. try
  1395. {
  1396. Thread.sleep(1000L);
  1397. }
  1398. catch(Exception _ex) { }
  1399. while(true);
  1400. }
  1401.  
  1402. public void drawHoverBox(int xPos, int yPos, String text) {
  1403. String[] results = text.split("\n");
  1404. int height = (results.length * 16) + 6;
  1405. int width;
  1406. width = chatTextDrawingArea.getTextWidth(results[0]) + 6;
  1407. for(int i = 1; i < results.length; i++)
  1408. if(width <= chatTextDrawingArea.getTextWidth(results[i]) + 6)
  1409. width = chatTextDrawingArea.getTextWidth(results[i]) + 6;
  1410. DrawingArea.drawPixels(height, yPos, xPos, 0x0E0E0E, width);
  1411. DrawingArea.fillPixels(xPos, width, height, 0xEBECE6, yPos);
  1412. yPos += 14;
  1413. for(int i = 0; i < results.length; i++) {
  1414. aTextDrawingArea_1271.method389(false, xPos + 3, 0xF5B241, results[i], yPos);
  1415. yPos += 16;
  1416. }
  1417. }
  1418.  
  1419. public void drawBlackBox(int xPos, int yPos) {
  1420. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  1421. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  1422. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  1423. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  1424. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  1425. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  1426. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  1427. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  1428. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  1429. }
  1430.  
  1431. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1432. {
  1433. if(class9.interfaceType != 0 || class9.children == null || class9.interfaceShown)
  1434. return;
  1435. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1436. return;
  1437. int k1 = class9.children.length;
  1438. for(int l1 = 0; l1 < k1; l1++)
  1439. {
  1440. int i2 = class9.childX[l1] + i;
  1441. int j2 = (class9.childY[l1] + l) - j1;
  1442. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1443. i2 += class9_1.xOffset;
  1444. j2 += class9_1.yOffset;
  1445. if((class9_1.hoverType >= 0 || class9_1.disabledHoverColor != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1446. if(class9_1.hoverType >= 0)
  1447. anInt886 = class9_1.hoverType;
  1448. else
  1449. anInt886 = class9_1.id;
  1450. if (class9_1.interfaceType == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1451. anInt1315 = class9_1.id;
  1452. }
  1453. if(class9_1.interfaceType == 0)
  1454. {
  1455. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1456. if(class9_1.scrollMax > class9_1.height)
  1457. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1458. } else
  1459. {
  1460. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1461. {
  1462. boolean flag = false;
  1463. if(class9_1.contentType != 0)
  1464. flag = buildFriendsListMenu(class9_1);
  1465. if(!flag)
  1466. {
  1467. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1468. if(idToggle == true) {
  1469. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1470. menuActionID[menuActionRow] = 315;
  1471. menuActionCmd3[menuActionRow] = class9_1.id;
  1472. menuActionRow++;
  1473. } else {
  1474. menuActionName[menuActionRow] = class9_1.tooltip;
  1475. menuActionID[menuActionRow] = 315;
  1476. menuActionCmd3[menuActionRow] = class9_1.id;
  1477. menuActionRow++;
  1478. }
  1479. }
  1480. }
  1481. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1482. {
  1483. String s = class9_1.selectedActionName;
  1484. if(s.indexOf(" ") != -1)
  1485. s = s.substring(0, s.indexOf(" "));
  1486. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1487. menuActionID[menuActionRow] = 626;
  1488. menuActionCmd3[menuActionRow] = class9_1.id;
  1489. menuActionRow++;
  1490. }
  1491. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1492. {
  1493. menuActionName[menuActionRow] = "Close";
  1494. menuActionID[menuActionRow] = 200;
  1495. menuActionCmd3[menuActionRow] = class9_1.id;
  1496. menuActionRow++;
  1497. }
  1498. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1499. {
  1500. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1501. if(idToggle == true) {
  1502. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1503. menuActionID[menuActionRow] = 169;
  1504. menuActionCmd3[menuActionRow] = class9_1.id;
  1505. menuActionRow++;
  1506. } else {
  1507. menuActionName[menuActionRow] = class9_1.tooltip;
  1508. menuActionID[menuActionRow] = 169;
  1509. menuActionCmd3[menuActionRow] = class9_1.id;
  1510. menuActionRow++;
  1511. }
  1512. if (class9_1.hoverText != null) {
  1513. //drawHoverBox(k, l, class9_1.hoverText);
  1514. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1515. }
  1516. }
  1517. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1518. {
  1519. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1520. if(idToggle == true) {
  1521. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1522. menuActionID[menuActionRow] = 646;
  1523. menuActionCmd3[menuActionRow] = class9_1.id;
  1524. menuActionRow++;
  1525. } else {
  1526. menuActionName[menuActionRow] = class9_1.tooltip;
  1527. menuActionID[menuActionRow] = 646;
  1528. menuActionCmd3[menuActionRow] = class9_1.id;
  1529. menuActionRow++;
  1530. }
  1531. }
  1532. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1533. {
  1534. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1535. if(idToggle == true) {
  1536. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1537. menuActionID[menuActionRow] = 679;
  1538. menuActionCmd3[menuActionRow] = class9_1.id;
  1539. menuActionRow++;
  1540. } else {
  1541. menuActionName[menuActionRow] = class9_1.tooltip;
  1542. menuActionID[menuActionRow] = 679;
  1543. menuActionCmd3[menuActionRow] = class9_1.id;
  1544. menuActionRow++;
  1545. }
  1546. }
  1547. if(class9_1.interfaceType == 2)
  1548. {
  1549. int k2 = 0;
  1550. for(int l2 = 0; l2 < class9_1.height; l2++)
  1551. {
  1552. for(int i3 = 0; i3 < class9_1.width; i3++)
  1553. {
  1554. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1555. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1556. if(k2 < 20)
  1557. {
  1558. j3 += class9_1.spritesX[k2];
  1559. k3 += class9_1.spritesY[k2];
  1560. }
  1561. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1562. {
  1563. mouseInvInterfaceIndex = k2;
  1564. lastActiveInvInterface = class9_1.id;
  1565. if(class9_1.inventory[k2] > 0)
  1566. {
  1567. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k2] - 1);
  1568. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1569. {
  1570. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1571. {
  1572. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  1573. menuActionID[menuActionRow] = 870;
  1574. menuActionCmd1[menuActionRow] = itemDef.id;
  1575. menuActionCmd2[menuActionRow] = k2;
  1576. menuActionCmd3[menuActionRow] = class9_1.id;
  1577. menuActionRow++;
  1578. }
  1579. } else
  1580. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1581. {
  1582. if((spellUsableOn & 0x10) == 16)
  1583. {
  1584. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1585. menuActionID[menuActionRow] = 543;
  1586. menuActionCmd1[menuActionRow] = itemDef.id;
  1587. menuActionCmd2[menuActionRow] = k2;
  1588. menuActionCmd3[menuActionRow] = class9_1.id;
  1589. menuActionRow++;
  1590. }
  1591. } else
  1592. {
  1593. if(class9_1.isInventoryInterface)
  1594. {
  1595. for(int l3 = 4; l3 >= 3; l3--)
  1596. if(itemDef.itemActions != null && itemDef.itemActions[l3] != null)
  1597. {
  1598. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1599. if(l3 == 3)
  1600. menuActionID[menuActionRow] = 493;
  1601. if(l3 == 4)
  1602. menuActionID[menuActionRow] = 847;
  1603. menuActionCmd1[menuActionRow] = itemDef.id;
  1604. menuActionCmd2[menuActionRow] = k2;
  1605. menuActionCmd3[menuActionRow] = class9_1.id;
  1606. menuActionRow++;
  1607. } else
  1608. if(l3 == 4)
  1609. {
  1610. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1611. menuActionID[menuActionRow] = 847;
  1612. menuActionCmd1[menuActionRow] = itemDef.id;
  1613. menuActionCmd2[menuActionRow] = k2;
  1614. menuActionCmd3[menuActionRow] = class9_1.id;
  1615. menuActionRow++;
  1616. }
  1617.  
  1618. }
  1619. if(class9_1.usableItemInterface)
  1620. {
  1621. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1622. menuActionID[menuActionRow] = 447;
  1623. menuActionCmd1[menuActionRow] = itemDef.id;
  1624. //k2 = inventory spot
  1625. //System.out.println(k2);
  1626. menuActionCmd2[menuActionRow] = k2;
  1627. menuActionCmd3[menuActionRow] = class9_1.id;
  1628. menuActionRow++;
  1629. }
  1630. if(class9_1.isInventoryInterface && itemDef.itemActions != null)
  1631. {
  1632. for(int i4 = 2; i4 >= 0; i4--)
  1633. if(itemDef.itemActions[i4] != null)
  1634. {
  1635. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1636. if(i4 == 0)
  1637. menuActionID[menuActionRow] = 74;
  1638. if(i4 == 1)
  1639. menuActionID[menuActionRow] = 454;
  1640. if(i4 == 2)
  1641. menuActionID[menuActionRow] = 539;
  1642. menuActionCmd1[menuActionRow] = itemDef.id;
  1643. menuActionCmd2[menuActionRow] = k2;
  1644. menuActionCmd3[menuActionRow] = class9_1.id;
  1645. menuActionRow++;
  1646. }
  1647.  
  1648. }
  1649. if(class9_1.itemActions != null)
  1650. {
  1651. for(int j4 = 4; j4 >= 0; j4--)
  1652. if(class9_1.itemActions[j4] != null)
  1653. {
  1654. menuActionName[menuActionRow] = class9_1.itemActions[j4] + " @lre@" + itemDef.name;
  1655. if(j4 == 0)
  1656. menuActionID[menuActionRow] = 632;
  1657. if(j4 == 1)
  1658. menuActionID[menuActionRow] = 78;
  1659. if(j4 == 2)
  1660. menuActionID[menuActionRow] = 867;
  1661. if(j4 == 3)
  1662. menuActionID[menuActionRow] = 431;
  1663. if(j4 == 4)
  1664. menuActionID[menuActionRow] = 53;
  1665. menuActionCmd1[menuActionRow] = itemDef.id;
  1666. menuActionCmd2[menuActionRow] = k2;
  1667. menuActionCmd3[menuActionRow] = class9_1.id;
  1668. menuActionRow++;
  1669. }
  1670.  
  1671. }
  1672. if(idToggle == true) {
  1673. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inventory[k2] - 1) + "@gre@)";
  1674. } else {
  1675. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1676. }
  1677. menuActionID[menuActionRow] = 1125;
  1678. menuActionCmd1[menuActionRow] = itemDef.id;
  1679. menuActionCmd2[menuActionRow] = k2;
  1680. menuActionCmd3[menuActionRow] = class9_1.id;
  1681. menuActionRow++;
  1682. }
  1683. }
  1684. }
  1685. k2++;
  1686. }
  1687.  
  1688. }
  1689.  
  1690. }
  1691. }
  1692. }
  1693.  
  1694. }
  1695.  
  1696. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1697. if(is474 || is480 || is508 || is525 || is562) {
  1698. scrollBar1.drawSprite(i1, l);
  1699. scrollBar2.drawSprite(i1, (l + j) - 16);
  1700. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1701. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1702. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1703. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1704. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1705. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1706. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1707. int k1 = ((j - 32) * j) / j1;
  1708. if(k1 < 8)
  1709. k1 = 8;
  1710. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1711. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1712. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1713. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1714. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1715. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1716. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1717. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1718. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1719. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1720. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1721. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1722. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1723. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1724. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1725. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1726. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1727. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1728. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1729. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1730. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1731. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1732. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1733. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1734. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1735. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1736. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1737. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1738. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1739. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1740. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1741. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1742. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1743. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1744. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1745. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1746. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1747. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1748. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1749. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1750. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1751. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1752. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1753. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1754. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1755. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1756. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1757. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1758. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1759. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1760. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1761. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1762. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1763. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1764. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1765. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1766. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1767. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1768. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1769. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1770. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1771. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1772. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1773. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1774. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1775. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1776. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1777. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1778. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1779. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1780. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1781. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1782. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1783. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1784. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1785. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1786. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1787. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1788. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1789. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1790. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1791. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1792. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1793. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1794. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1795. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1796. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1797. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1798. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1799. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1800. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1801. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1802. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1803. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1804. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1805. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1806. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1807. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1808. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1809. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1810. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1811. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1812. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1813. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1814. } else {
  1815. scrollBar3.drawSprite(i1, l);
  1816. scrollBar4.drawSprite(i1, (l + j) - 16);
  1817. DrawingArea.method336(j - 32, l + 16, i1, anInt1002, 16);
  1818. int k1 = ((j - 32) * j) / j1;
  1819. if(k1 < 8)
  1820. k1 = 8;
  1821. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1822. DrawingArea.method336(k1, l + 16 + l1, i1, barFillColor, 16);
  1823. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1);
  1824. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1 + 1);
  1825. DrawingArea.method339(l + 16 + l1, anInt902, 16, i1);
  1826. DrawingArea.method339(l + 17 + l1, anInt902, 16, i1);
  1827. DrawingArea.method341(l + 16 + l1, anInt927, k1, i1 + 15);
  1828. DrawingArea.method341(l + 17 + l1, anInt927, k1 - 1, i1 + 14);
  1829. DrawingArea.method339(l + 15 + l1 + k1, anInt927, 16, i1);
  1830. DrawingArea.method339(l + 14 + l1 + k1, anInt927, 15, i1 + 1);
  1831. }
  1832. }
  1833.  
  1834.  
  1835.  
  1836. private void updateNPCs(Stream stream, int i)
  1837. {
  1838. anInt839 = 0;
  1839. anInt893 = 0;
  1840. method139(stream);
  1841. method46(i, stream);
  1842. method86(stream);
  1843. for(int k = 0; k < anInt839; k++)
  1844. {
  1845. int l = anIntArray840[k];
  1846. if(npcArray[l].anInt1537 != loopCycle)
  1847. {
  1848. npcArray[l].desc = null;
  1849. npcArray[l] = null;
  1850. }
  1851. }
  1852. if(stream.currentOffset != i)
  1853. {
  1854. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1855. throw new RuntimeException("eek");
  1856. }
  1857. for(int i1 = 0; i1 < npcCount; i1++)
  1858. if(npcArray[npcIndices[i1]] == null)
  1859. {
  1860. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1861. throw new RuntimeException("eek");
  1862. }
  1863. }
  1864.  
  1865. private int cButtonHPos;
  1866. private int cButtonHCPos;
  1867. private int cButtonCPos;
  1868.  
  1869. private void processChatModeClick() {
  1870. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  1871. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1872. cButtonHPos = 0;
  1873. aBoolean1233 = true;
  1874. inputTaken = true;
  1875. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  1876. cButtonHPos = 1;
  1877. aBoolean1233 = true;
  1878. inputTaken = true;
  1879. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  1880. cButtonHPos = 2;
  1881. aBoolean1233 = true;
  1882. inputTaken = true;
  1883. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  1884. cButtonHPos = 3;
  1885. aBoolean1233 = true;
  1886. inputTaken = true;
  1887. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  1888. cButtonHPos = 4;
  1889. aBoolean1233 = true;
  1890. inputTaken = true;
  1891. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  1892. cButtonHPos = 5;
  1893. aBoolean1233 = true;
  1894. inputTaken = true;
  1895. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  1896. cButtonHPos = 7;
  1897. aBoolean1233 = true;
  1898. inputTaken = true;
  1899. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  1900. cButtonHPos = 6;
  1901. aBoolean1233 = true;
  1902. inputTaken = true;
  1903. } else {
  1904. cButtonHPos = -1;
  1905. aBoolean1233 = true;
  1906. inputTaken = true;
  1907. }
  1908. if(super.clickMode3 == 1) {
  1909. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1910. cButtonCPos = 0;
  1911. chatTypeView = 0;
  1912. aBoolean1233 = true;
  1913. inputTaken = true;
  1914. } else if(super.saveClickX >= 62 && super.saveClickX <= 117 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1915. cButtonCPos = 1;
  1916. chatTypeView = 5;
  1917. aBoolean1233 = true;
  1918. inputTaken = true;
  1919. } else if(super.saveClickX >= 119 && super.saveClickX <= 174 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1920. cButtonCPos = 2;
  1921. chatTypeView = 1;
  1922. aBoolean1233 = true;
  1923. inputTaken = true;
  1924. } else if(super.saveClickX >= 176 && super.saveClickX <= 231 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1925. cButtonCPos = 3;
  1926. chatTypeView = 2;
  1927. aBoolean1233 = true;
  1928. inputTaken = true;
  1929. } else if(super.saveClickX >= 233 && super.saveClickX <= 288 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1930. cButtonCPos = 4;
  1931. chatTypeView = 11;
  1932. aBoolean1233 = true;
  1933. inputTaken = true;
  1934. } else if(super.saveClickX >= 290 && super.saveClickX <= 345 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1935. cButtonCPos = 5;
  1936. chatTypeView = 3;
  1937. aBoolean1233 = true;
  1938. inputTaken = true;
  1939. } else if(super.saveClickX >= 347 && super.saveClickX <= 402 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1940. cButtonCPos = 6;
  1941. //chatTypeView = 3;
  1942. aBoolean1233 = true;
  1943. inputTaken = true;
  1944. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1945. if(openInterfaceID == -1) {
  1946. clearTopInterfaces();
  1947. reportAbuseInput = "";
  1948. canMute = false;
  1949. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1950. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1951. continue;
  1952. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1953. break;
  1954. }
  1955. } else {
  1956. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1957. }
  1958. }
  1959. }
  1960. } else if(is474) {
  1961. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1962. cButtonHPos = 0;
  1963. aBoolean1233 = true;
  1964. inputTaken = true;
  1965. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1966. cButtonHPos = 1;
  1967. aBoolean1233 = true;
  1968. inputTaken = true;
  1969. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1970. cButtonHPos = 2;
  1971. aBoolean1233 = true;
  1972. inputTaken = true;
  1973. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1974. cButtonHPos = 3;
  1975. aBoolean1233 = true;
  1976. inputTaken = true;
  1977. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1978. cButtonHPos = 4;
  1979. aBoolean1233 = true;
  1980. inputTaken = true;
  1981. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1982. cButtonHPos = 5;
  1983. aBoolean1233 = true;
  1984. inputTaken = true;
  1985. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1986. cButtonHPos = 6;
  1987. aBoolean1233 = true;
  1988. inputTaken = true;
  1989. } else {
  1990. cButtonHPos = -1;
  1991. aBoolean1233 = true;
  1992. inputTaken = true;
  1993. }
  1994. if(super.clickMode3 == 1) {
  1995. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1996. cButtonCPos = 0;
  1997. chatTypeView = 0;
  1998. aBoolean1233 = true;
  1999. inputTaken = true;
  2000. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2001. cButtonCPos = 1;
  2002. chatTypeView = 5;
  2003. aBoolean1233 = true;
  2004. inputTaken = true;
  2005. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2006. cButtonCPos = 2;
  2007. chatTypeView = 1;
  2008. aBoolean1233 = true;
  2009. inputTaken = true;
  2010. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2011. cButtonCPos = 3;
  2012. chatTypeView = 2;
  2013. aBoolean1233 = true;
  2014. inputTaken = true;
  2015. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2016. cButtonCPos = 4;
  2017. chatTypeView = 11;
  2018. aBoolean1233 = true;
  2019. inputTaken = true;
  2020. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2021. cButtonCPos = 5;
  2022. chatTypeView = 3;
  2023. aBoolean1233 = true;
  2024. inputTaken = true;
  2025. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2026. if(openInterfaceID == -1) {
  2027. clearTopInterfaces();
  2028. reportAbuseInput = "";
  2029. canMute = false;
  2030. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2031. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  2032. continue;
  2033. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2034. break;
  2035. }
  2036. } else {
  2037. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2038. }
  2039. }
  2040. }
  2041. } else {
  2042. if(super.clickMode3 == 1) {
  2043. if(super.saveClickX >= 6 && super.saveClickX <= 106 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2044. {
  2045. publicChatMode = (publicChatMode + 1) % 4;
  2046. aBoolean1233 = true;
  2047. inputTaken = true;
  2048. stream.createFrame(95);
  2049. stream.writeWordBigEndian(publicChatMode);
  2050. stream.writeWordBigEndian(privateChatMode);
  2051. stream.writeWordBigEndian(tradeMode);
  2052. }
  2053. if(super.saveClickX >= 135 && super.saveClickX <= 235 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2054. {
  2055. privateChatMode = (privateChatMode + 1) % 3;
  2056. aBoolean1233 = true;
  2057. inputTaken = true;
  2058. stream.createFrame(95);
  2059. stream.writeWordBigEndian(publicChatMode);
  2060. stream.writeWordBigEndian(privateChatMode);
  2061. stream.writeWordBigEndian(tradeMode);
  2062. }
  2063. if(super.saveClickX >= 273 && super.saveClickX <= 373 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2064. {
  2065. tradeMode = (tradeMode + 1) % 3;
  2066. aBoolean1233 = true;
  2067. inputTaken = true;
  2068. stream.createFrame(95);
  2069. stream.writeWordBigEndian(publicChatMode);
  2070. stream.writeWordBigEndian(privateChatMode);
  2071. stream.writeWordBigEndian(tradeMode);
  2072. }
  2073. if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2074. if(openInterfaceID == -1) {
  2075. clearTopInterfaces();
  2076. reportAbuseInput = "";
  2077. canMute = false;
  2078. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2079. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  2080. continue;
  2081. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2082. break;
  2083. }
  2084. } else {
  2085. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2086. }
  2087. }
  2088. }
  2089. }
  2090. }
  2091.  
  2092. private void method33(int i)
  2093. {
  2094. int j = Varp.cache[i].anInt709;
  2095. if(j == 0)
  2096. return;
  2097. int k = variousSettings[i];
  2098. if(j == 1)
  2099. {
  2100. if(k == 1)
  2101. Texture.method372(0.90000000000000002D);
  2102. if(k == 2)
  2103. Texture.method372(0.80000000000000004D);
  2104. if(k == 3)
  2105. Texture.method372(0.69999999999999996D);
  2106. if(k == 4)
  2107. Texture.method372(0.59999999999999998D);
  2108. ItemDef.mruNodes1.unlinkAll();
  2109. welcomeScreenRaised = true;
  2110. }
  2111. if(j == 3)
  2112. {
  2113. boolean flag1 = musicEnabled;
  2114. if(k == 0)
  2115. {
  2116. adjustVolume(musicEnabled, 0);
  2117. musicEnabled = true;
  2118. }
  2119. if(k == 1)
  2120. {
  2121. adjustVolume(musicEnabled, -400);
  2122. musicEnabled = true;
  2123. }
  2124. if(k == 2)
  2125. {
  2126. adjustVolume(musicEnabled, -800);
  2127. musicEnabled = true;
  2128. }
  2129. if(k == 3)
  2130. {
  2131. adjustVolume(musicEnabled, -1200);
  2132. musicEnabled = true;
  2133. }
  2134. if(k == 4)
  2135. musicEnabled = false;
  2136. if(musicEnabled != flag1 && !lowMem)
  2137. {
  2138. if(musicEnabled)
  2139. {
  2140. nextSong = currentSong;
  2141. songChanging = true;
  2142. onDemandFetcher.method558(2, nextSong);
  2143. } else
  2144. {
  2145. stopMidi();
  2146. }
  2147. prevSong = 0;
  2148. }
  2149. }
  2150. if(j == 4)
  2151. {
  2152. if(k == 0)
  2153. {
  2154. aBoolean848 = true;
  2155. setWaveVolume(0);
  2156. }
  2157. if(k == 1)
  2158. {
  2159. aBoolean848 = true;
  2160. setWaveVolume(-400);
  2161. }
  2162. if(k == 2)
  2163. {
  2164. aBoolean848 = true;
  2165. setWaveVolume(-800);
  2166. }
  2167. if(k == 3)
  2168. {
  2169. aBoolean848 = true;
  2170. setWaveVolume(-1200);
  2171. }
  2172. if(k == 4)
  2173. aBoolean848 = false;
  2174. }
  2175. if(j == 5)
  2176. anInt1253 = k;
  2177. if(j == 6)
  2178. anInt1249 = k;
  2179. if(j == 8)
  2180. {
  2181. splitPrivateChat = k;
  2182. inputTaken = true;
  2183. }
  2184. if(j == 9)
  2185. anInt913 = k;
  2186. }
  2187. void block(int cycle, int x, int y) {
  2188. if (cycle > loopCycle) {
  2189. y -= 30;
  2190. int difference = (cycle - loopCycle);
  2191. int trans = (int) Math.round((double) difference * 3.5);
  2192. int height = (int) Math.round(difference / 6);
  2193. combatIcons[3].drawTransparentSprite((x - 12), (y - 12 + height), trans);
  2194. //combatIcons[3].drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + height), trans);
  2195. }
  2196. }
  2197.  
  2198.  
  2199.  
  2200. void hit10(int cycle, int x, int y, int type, int type2, String damage) {
  2201. if (cycle > loopCycle) {
  2202. y -= 30;
  2203. int difference = (cycle - loopCycle);
  2204. int trans = (int) Math.round((double) difference * 3.5);
  2205. int height = (int) Math.round(difference / 6);
  2206. combatIcons[type2].drawTransparent((x - 37), (y - 14 + height), trans);
  2207. hitMark[type].drawTransparentSprite((x - 12), (y - 12 + height), trans);
  2208. smallText.drawText(0, damage, (y + 4 + height), x);
  2209. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2210. }
  2211. }
  2212. /*void hit10(int cycle, int x, int y, int type, int type2, String damage) {
  2213. if (cycle > loopCycle) {
  2214. y -= 30;
  2215. int difference = (cycle - loopCycle);
  2216. int trans = (int) Math.round((double) difference * 3.5);
  2217. int height = (int) Math.round(difference / 70);
  2218. combatIcons[type2].drawTransparent((x - 30), (y - 12 + height), trans);
  2219. hitMark[type].drawTransparent((x - 12), (y - 12 + height), trans);
  2220. smallText.drawText(0, damage, (y + 4 + height), x);
  2221. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2222. }
  2223. }*/
  2224.  
  2225. void hit100(int cycle, int x, int y, int type, int type2, String damage) {
  2226. if (cycle > loopCycle) {
  2227. y -= 30;
  2228. int difference = (cycle - loopCycle);
  2229. int trans = (int) Math.round((double) difference * 3.5);
  2230. int height = (int) Math.round(difference / 6);
  2231. combatIcons[type2].drawTransparent((x - 39), (y - 16 + height), trans);
  2232. hitMark[0].drawTransparent((x - 20), (y - 13 + height), trans);
  2233. smallText.drawText(0, damage, (y + 4 + height), x);
  2234. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2235. }
  2236. }
  2237. /*void hit100(int cycle, int x, int y, int type, int type2, String damage) {
  2238. if (cycle > loopCycle) {
  2239. y -= 30;
  2240. int difference = (cycle - loopCycle);
  2241. int trans = (int) Math.round((double) difference * 3.5);
  2242. int height = (int) Math.round(difference / 45);
  2243. combatIcons[type2].drawTransparent((x - 35), (y - 11 + height), trans);
  2244. hitMark[0].drawTransparent((x - 20), (y - 13 + height), trans);
  2245. smallText.drawText(0, damage, (y + 4 + height), x);
  2246. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2247. }
  2248. }*/
  2249. void hitred(int cycle, int x, int y, int type, int type2, String damage) {
  2250. if (cycle > loopCycle) {
  2251. y -= 30;
  2252. int difference = (cycle - loopCycle);
  2253. int trans = (int) Math.round((double) difference * 3.5);
  2254. int height = (int) Math.round(difference / 6);
  2255. combatIcons[type2].drawTransparent((x - 35), (y - 11 + height), trans);
  2256. hitMark[3].drawTransparent((x - 20), (y - 13 + height), trans);
  2257. smallText.drawText(0, damage, (y + 4 + height), x);
  2258. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2259. }
  2260. }
  2261. void hit400(int cycle, int x, int y, int type, int type2, String damage) {
  2262. if (cycle > loopCycle) {
  2263. y -= 30;
  2264. int difference = (cycle - loopCycle);
  2265. int trans = (int) Math.round((double) difference * 3.5);
  2266. int height = (int) Math.round(difference / 6);
  2267. combatIcons[type2].drawTransparent((x - 39), (y - 16 + height), trans);
  2268. hitMark[2].drawTransparent((x - 20), (y - 13 + height), trans);
  2269. smallText.drawText(0, damage, (y + 4 + height), x);
  2270. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2271. }
  2272. } void hit150(int cycle, int x, int y, int type, int type2, String damage) {
  2273. if (cycle > loopCycle) {
  2274. y -= 30;
  2275. int difference = (cycle - loopCycle);
  2276. int trans = (int) Math.round((double) difference * 3.5);
  2277. int height = (int) Math.round(difference / 6);
  2278. combatIcons[type2].drawTransparent((x - 39), (y - 16 + height), trans);
  2279. hitMark[3].drawTransparent((x - 20), (y - 13 + height), trans);
  2280. smallText.drawText(0, damage, (y + 4 + height), x);
  2281. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2282. }
  2283. }
  2284. private Sprite HPBarFull;
  2285. private Sprite HPBarEmpty;
  2286.  
  2287. private void updateEntities() {
  2288.  
  2289. try{
  2290. int anInt974 = 0;
  2291. for(int j = -1; j < playerCount + npcCount; j++) {
  2292. Object obj;
  2293. if(j == -1)
  2294. obj = myPlayer;
  2295. else
  2296. if(j < playerCount)
  2297. obj = playerArray[playerIndices[j]];
  2298. else
  2299. obj = npcArray[npcIndices[j - playerCount]];
  2300. if(obj == null || !((Entity) (obj)).isVisible())
  2301. continue;
  2302. if(obj instanceof NPC) {
  2303. EntityDef entityDef = ((NPC)obj).desc;
  2304.  
  2305. if(namesToggle == true) {
  2306. String s = entityDef.name;
  2307. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  2308. if(entityDef.combatLevel != 0) {
  2309. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height+15);
  2310. smallText.method382(0xFFFF33, spriteDrawX, s, spriteDrawY-8, true);
  2311. } else if(entityDef.combatLevel == 0) {
  2312. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height+15);
  2313. smallText.method382(0xFFFF33, spriteDrawX, entityDef.name, spriteDrawY-8, true);
  2314. }
  2315. } else if(namesToggle == false) {
  2316.  
  2317. }
  2318.  
  2319. if(entityDef.childrenIDs != null)
  2320. entityDef = entityDef.method161();
  2321. if(entityDef == null)
  2322. continue;
  2323. }
  2324. if(namesToggle == true) {
  2325. if(j < playerCount) {
  2326. int l = 45;
  2327. Player player = (Player)obj;
  2328. if(player.headIcon >= 0) {
  2329. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2330. if(spriteDrawX > -1) {
  2331. if (player.skullIcon < 2) {
  2332. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2333. l += 25;//25
  2334. }
  2335. /*if (player.headIcon < 7) {
  2336. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2337. l += 20;//20
  2338. }*/
  2339. if(player.headIcon < 18) {
  2340. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2341. l += 26;
  2342. }
  2343. }
  2344. }
  2345. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2346. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2347. if(spriteDrawX > -1)
  2348. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2349. l += 30;
  2350. }
  2351. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2352. int col = 0x3399ff;
  2353. newSmallFont.drawCenteredString(player.name, spriteDrawX, spriteDrawY-8, col, 100);
  2354.  
  2355. } else {
  2356. EntityDef entityDef_1 = ((NPC)obj).desc;
  2357. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2358. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2359. if(spriteDrawX > -1)
  2360. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 50);
  2361. }
  2362. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2363. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2364. if(spriteDrawX > -1)
  2365. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 50);
  2366. }
  2367. }
  2368. } else if(namesToggle == false) {
  2369. if(j < playerCount) {
  2370. int l = 30;
  2371. Player player = (Player)obj;
  2372. if(player.headIcon >= 0) {
  2373. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2374. if(spriteDrawX > -1) {
  2375. if (player.skullIcon < 2) {
  2376. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2377. l += 25;
  2378. }
  2379. /*if (player.headIcon < 7) {
  2380. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2381. l += 18;
  2382. }*/
  2383. if(player.headIcon < 18) {
  2384. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2385. l += 26;
  2386. }
  2387. }
  2388. }
  2389. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2390. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2391. if(spriteDrawX > -1)
  2392. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2393. }
  2394. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2395.  
  2396. } else {
  2397. EntityDef entityDef_1 = ((NPC)obj).desc;
  2398. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2399. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2400. if(spriteDrawX > -1)
  2401. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2402. }
  2403. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2404. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2405. if(spriteDrawX > -1)
  2406. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2407. }
  2408. }
  2409. }
  2410. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  2411. {
  2412. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2413. if(spriteDrawX > -1 && anInt974 < anInt975)
  2414. {
  2415. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  2416. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2417. anIntArray976[anInt974] = spriteDrawX;
  2418. anIntArray977[anInt974] = spriteDrawY;
  2419. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2420. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2421. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2422. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2423. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  2424. {
  2425. anIntArray978[anInt974] += 10;
  2426. anIntArray977[anInt974] += 5;
  2427. }
  2428. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2429. anIntArray979[anInt974] = 60;
  2430. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2431. anIntArray978[anInt974] += 5;
  2432. }
  2433. }
  2434. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  2435. {
  2436. try{
  2437. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2438. if(spriteDrawX > -1)
  2439. {
  2440. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2441. if(i1 > 30) {
  2442. i1 = 30;
  2443. }
  2444. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  2445. if (HpPercent > 56) {
  2446. HpPercent = 56;
  2447. }
  2448. //if(namesToggle) {
  2449. // newSmallFont.drawCenteredString((new StringBuilder()).append(((Entity) (Entity) obj).currentHealth).append("/").append(((Entity) (Entity) obj).maxHealth).toString(), spriteDrawX, spriteDrawY - 19, 0x3399ff, 100);
  2450. //}//draws HP above head
  2451. //HPBar crap
  2452. if(!hitbarToggle){
  2453. DrawingArea.method336(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  2454. DrawingArea.method336(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2455. } else {
  2456. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);//3
  2457. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", HpPercent, 7);
  2458. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  2459. }
  2460. }
  2461. }catch(Exception e){ }
  2462. }
  2463. critHit = new Sprite("critHit");
  2464. bigHit = new Sprite("bigHit");
  2465.  
  2466. critHit = new Sprite("critHit");
  2467. bigHit = new Sprite("bigHit");
  2468.  
  2469.  
  2470.  
  2471. applyTrans = 0;
  2472. for (int j1 = 0; j1 < 4; j1++) {
  2473. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2474. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2475. applyTrans = -200;
  2476. int hitCycle = ((Entity)(Entity)obj).hitsLoopCycle[j1] - loopCycle;
  2477. int move1 = (int)Math.round((double)hitCycle * 3.5D);
  2478. int move2 = Math.round(hitCycle / 6);
  2479. int fade = (int)Math.round((double)hitCycle * 3.7101449275362319D);
  2480. if (spriteDrawX > -1) {
  2481.  
  2482. if (j1 > 0) {
  2483. spriteDrawY += (-19 * j1);
  2484. }
  2485. if (((Entity) (obj)).hitArray[j1] == 0 || ((Entity) (obj)).hitType[j1] == 3) {
  2486. block(((Entity) (obj)).hitsLoopCycle[j1], spriteDrawX, spriteDrawY);
  2487. } else {
  2488. if (newHits) {
  2489. //if (((Entity) (obj)).hitArray[j1] > 150) {
  2490. //hitred(((Entity) (obj)).hitsLoopCycle[j1], spriteDrawX, //spriteDrawY, ((Entity) (obj)).hitMarkTypes[j1], ((Entity) (obj)).hitType[j1], String.valueOf(((Entity) (obj)).hitArray[j1]));
  2491.  
  2492. if (((Entity)(Entity)obj).hitArray[j1] >= 399 && ((Entity)(Entity)obj).hitArray[j1] <= 999 && ((Entity) (obj)).hitMarkTypes[j1] == 1) {
  2493. critHit.drawSpriteWithOpacity(spriteDrawX - 17,(spriteDrawY - 12) + move2, move1);
  2494. combatIcons[((Entity) (obj)).hitType[j1]].drawSpriteWithOpacity(spriteDrawX - 40, (spriteDrawY - 11) + move2, move1);
  2495. newFancyFont.setTrans(0, 0xffffff, fade);
  2496. newFancyFont.drawCenteredString((new StringBuilder()).append(String.valueOf(((Entity)obj).hitArray[j1])).append("").toString(), spriteDrawX, spriteDrawY + 4 + move2);
  2497. //}
  2498. } else if (((Entity) (obj)).hitArray[j1] > 150) {
  2499. hit150(((Entity) (obj)).hitsLoopCycle[j1], spriteDrawX, spriteDrawY, ((Entity) (obj)).hitMarkTypes[j1], ((Entity) (obj)).hitType[j1], String.valueOf(((Entity) (obj)).hitArray[j1]));
  2500. //}
  2501.  
  2502. } else if (((Entity) (obj)).hitArray[j1] < 100) {
  2503. hit10(((Entity) (obj)).hitsLoopCycle[j1], spriteDrawX, spriteDrawY, ((Entity) (obj)).hitMarkTypes[j1], ((Entity) (obj)).hitType[j1], String.valueOf(((Entity) (obj)).hitArray[j1]));
  2504. } else {
  2505. hit100(((Entity) (obj)).hitsLoopCycle[j1], spriteDrawX, spriteDrawY, ((Entity) (obj)).hitMarkTypes[j1], ((Entity) (obj)).hitType[j1], String.valueOf(((Entity) (obj)).hitArray[j1]));
  2506.  
  2507. }
  2508. } else {
  2509. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawTranSprite(spriteDrawX - 12, spriteDrawY - 12, 0);
  2510. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2511. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2512. }
  2513. }
  2514. }
  2515. }
  2516. }
  2517. }
  2518. for(int k = 0; k < anInt974; k++) {
  2519. int k1 = anIntArray976[k];
  2520. int l1 = anIntArray977[k];
  2521. int j2 = anIntArray979[k];
  2522. int k2 = anIntArray978[k];
  2523. boolean flag = true;
  2524. while(flag)
  2525. {
  2526. flag = false;
  2527. for(int l2 = 0; l2 < k; l2++)
  2528. 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)
  2529. {
  2530. l1 = anIntArray977[l2] - anIntArray978[l2];
  2531. flag = true;
  2532. }
  2533.  
  2534. }
  2535. spriteDrawX = anIntArray976[k];
  2536. spriteDrawY = anIntArray977[k] = l1;
  2537. String s = aStringArray983[k];
  2538. if(anInt1249 == 0)
  2539. {
  2540. int i3 = 0xffff00;
  2541. if(anIntArray980[k] < 6)
  2542. i3 = anIntArray965[anIntArray980[k]];
  2543. if(anIntArray980[k] == 6)
  2544. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2545. if(anIntArray980[k] == 7)
  2546. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2547. if(anIntArray980[k] == 8)
  2548. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2549. if(anIntArray980[k] == 9) {
  2550. int j3 = 150 - anIntArray982[k];
  2551. if(j3 < 50)
  2552. i3 = 0xff0000 + 1280 * j3;
  2553. else
  2554. if(j3 < 100)
  2555. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2556. else
  2557. if(j3 < 150)
  2558. i3 = 65280 + 5 * (j3 - 100);
  2559. }
  2560. if(anIntArray980[k] == 10) {
  2561. int k3 = 150 - anIntArray982[k];
  2562. if(k3 < 50)
  2563. i3 = 0xff0000 + 5 * k3;
  2564. else
  2565. if(k3 < 100)
  2566. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2567. else
  2568. if(k3 < 150)
  2569. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2570. }
  2571. if(anIntArray980[k] == 11) {
  2572. int l3 = 150 - anIntArray982[k];
  2573. if(l3 < 50)
  2574. i3 = 0xffffff - 0x50005 * l3;
  2575. else
  2576. if(l3 < 100)
  2577. i3 = 65280 + 0x50005 * (l3 - 50);
  2578. else
  2579. if(l3 < 150)
  2580. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2581. }
  2582. if(anIntArray981[k] == 0) {
  2583. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2584. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  2585. }
  2586. if(anIntArray981[k] == 1) {
  2587. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2588. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2589. }
  2590. if(anIntArray981[k] == 2) {
  2591. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2592. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2593. }
  2594. if(anIntArray981[k] == 3) {
  2595. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2596. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2597. }
  2598. if(anIntArray981[k] == 4) {
  2599. int i4 = chatTextDrawingArea.method384(s);
  2600. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2601. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2602. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2603. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2604. DrawingArea.defaultDrawingAreaSize();
  2605. }
  2606. if(anIntArray981[k] == 5) {
  2607. int j4 = 150 - anIntArray982[k];
  2608. int l4 = 0;
  2609. if(j4 < 25)
  2610. l4 = j4 - 25;
  2611. else
  2612. if(j4 > 125)
  2613. l4 = j4 - 125;
  2614. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  2615. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2616. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2617. DrawingArea.defaultDrawingAreaSize();
  2618. }
  2619. } else {
  2620. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2621. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2622. }
  2623. }
  2624. } catch(Exception e){ }
  2625. }
  2626.  
  2627. private void delFriend(long l)
  2628. {
  2629. try
  2630. {
  2631. if(l == 0L)
  2632. return;
  2633. for(int i = 0; i < friendsCount; i++)
  2634. {
  2635. if(friendsListAsLongs[i] != l)
  2636. continue;
  2637. friendsCount--;
  2638. needDrawTabArea = true;
  2639. for(int j = i; j < friendsCount; j++)
  2640. {
  2641. friendsList[j] = friendsList[j + 1];
  2642. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2643. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2644. }
  2645.  
  2646. stream.createFrame(215);
  2647. stream.writeQWord(l);
  2648. break;
  2649. }
  2650. }
  2651. catch(RuntimeException runtimeexception)
  2652. {
  2653. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2654. throw new RuntimeException();
  2655. }
  2656. }
  2657.  
  2658. public void drawSideIcons(){
  2659. if(is480 || is508 || is525) {
  2660. /* Top sideIcons */
  2661. if(tabInterfaceIDs[0] != -1)//attack
  2662. sideIcons[0].drawSprite(10+3, 4);
  2663. if(tabInterfaceIDs[1] != -1)//stat
  2664. sideIcons[1].drawSprite(43+3, 4);
  2665. if(tabInterfaceIDs[2] != -1)//quest
  2666. sideIcons[2].drawSprite(76+3, 3);
  2667. if(tabInterfaceIDs[3] != -1)//inventory
  2668. sideIcons[3].drawSprite(111+3, 5);
  2669. if(tabInterfaceIDs[4] != -1)//equipment
  2670. sideIcons[4].drawSprite(140+3, 1);
  2671. if(tabInterfaceIDs[5] != -1)//prayer
  2672. sideIcons[5].drawSprite(174+3, 1);
  2673. if(tabInterfaceIDs[6] != -1)//magic
  2674. sideIcons[6].drawSprite(208+3, 4);
  2675. /* Bottom sideIcons */
  2676. if(tabInterfaceIDs[7] != -1)//summoning
  2677. sIcons483[7].drawSprite(11+3, 303);
  2678. if(tabInterfaceIDs[8] != -1)//friends
  2679. sideIcons[8].drawSprite(46+3, 306);
  2680. if(tabInterfaceIDs[9] != -1)//ignore
  2681. sideIcons[9].drawSprite(79+3, 306);
  2682. if(tabInterfaceIDs[10] != -1)//logout
  2683. sideIcons[7].drawSprite(113+3, 302);
  2684. if(tabInterfaceIDs[11] != -1)//options
  2685. sideIcons[11].drawSprite(145+3, 304);
  2686. if(tabInterfaceIDs[12] != -1)//emotes
  2687. sideIcons[12].drawSprite(181+3, 302);
  2688. if(tabInterfaceIDs[13] != -1)//music
  2689. sideIcons[13].drawSprite(213+3, 303);
  2690. } else if(is474){
  2691. /** Top sideIcons */
  2692. if(tabInterfaceIDs[0] != -1)///attack
  2693. sideIcons[0].drawSprite(10+3, 4);
  2694. if(tabInterfaceIDs[1] != -1)///stat
  2695. sideIcons[1].drawSprite(43+3, 4);
  2696. if(tabInterfaceIDs[2] != -1)///quest
  2697. sideIcons[2].drawSprite(76+3, 3);
  2698. if(tabInterfaceIDs[3] != -1)///inventory
  2699. sideIcons[3].drawSprite(111+3, 5);
  2700. if(tabInterfaceIDs[4] != -1)///equipment
  2701. sideIcons[4].drawSprite(140+3, 1);
  2702. if(tabInterfaceIDs[5] != -1)///prayer
  2703. sideIcons[5].drawSprite(174+3, 1);
  2704. if(tabInterfaceIDs[6] != -1)///magic
  2705. sideIcons[6].drawSprite(208+3, 4);
  2706. /** Bottom sideIcons */
  2707. if(tabInterfaceIDs[7] != -1)///clan
  2708. sideIcons[7].drawSprite(11+3, 303);
  2709. if(tabInterfaceIDs[8] != -1)///friends
  2710. sideIcons[8].drawSprite(46+3, 306);
  2711. if(tabInterfaceIDs[9] != -1)///ignore
  2712. sideIcons[9].drawSprite(79+3, 306);
  2713. if(tabInterfaceIDs[10] != -1)///logout
  2714. sideIcons[10].drawSprite(113+3, 302);
  2715. if(tabInterfaceIDs[11] != -1)///options
  2716. sideIcons[11].drawSprite(145+3, 304);
  2717. if(tabInterfaceIDs[12] != -1)///emotes
  2718. sideIcons[12].drawSprite(181+3, 302);
  2719. if(tabInterfaceIDs[13] != -1)///music
  2720. sideIcons[13].drawSprite(213+3, 303);
  2721. } else if(is562){
  2722. /* Top sideIcons */
  2723. if(tabInterfaceIDs[0] != -1)
  2724. newSideIcons[0].drawSprite(8+3, 8);
  2725. if(tabInterfaceIDs[1] != -1)
  2726. newSideIcons[1].drawSprite(37+3, 8);
  2727. if(tabInterfaceIDs[2] != -1)
  2728. newSideIcons[2].drawSprite(67+3, 8);
  2729. if(tabInterfaceIDs[14] != -1)
  2730. newSideIcons[3].drawSprite(97+3, 8);
  2731. if(tabInterfaceIDs[3] != -1)
  2732. newSideIcons[4].drawSprite(127+3, 8);
  2733. if(tabInterfaceIDs[4] != -1)
  2734. newSideIcons[5].drawSprite(159+3, 8);
  2735. if(tabInterfaceIDs[5] != -1)
  2736. newSideIcons[6].drawSprite(187+3, 8);
  2737. if(tabInterfaceIDs[6] != -1)
  2738. newSideIcons[7].drawSprite(217+3, 8);
  2739. /* Bottom sideIcons */
  2740. if(tabInterfaceIDs[10] != -1)
  2741. newSideIcons[15].drawSprite(8+3, 306);
  2742. if(tabInterfaceIDs[9] != -1)
  2743. newSideIcons[8].drawSprite(38+3, 306);
  2744. if(tabInterfaceIDs[8] != -1)
  2745. newSideIcons[9].drawSprite(70+3, 306);
  2746. if(tabInterfaceIDs[7] != -1)
  2747. newSideIcons[13].drawSprite(97+3, 306);
  2748. if(tabInterfaceIDs[11] != -1)
  2749. newSideIcons[10].drawSprite(127+3, 306);
  2750. if(tabInterfaceIDs[12] != -1)
  2751. newSideIcons[11].drawSprite(157+3, 306);
  2752. if(tabInterfaceIDs[13] != -1)
  2753. newSideIcons[12].drawSprite(187+3, 306);
  2754. if(tabInterfaceIDs[15] != -1)
  2755. newSideIcons[14].drawSprite(216+3, 307);
  2756. } else {
  2757. /** Top sideIcons */
  2758. if(tabInterfaceIDs[0] != -1)///attack
  2759. sIcons459[0].drawSprite(32, 11);
  2760. if(tabInterfaceIDs[1] != -1)///stat
  2761. sIcons459[1].drawSprite(57, 9);
  2762. if(tabInterfaceIDs[2] != -1)///quest
  2763. sIcons459[2].drawSprite(86, 9);
  2764. if(tabInterfaceIDs[3] != -1)///inventory
  2765. sIcons459[3].drawSprite(116, 4);
  2766. if(tabInterfaceIDs[4] != -1)///equipment
  2767. sIcons459[4].drawSprite(155, 5);
  2768. if(tabInterfaceIDs[5] != -1)///prayer
  2769. sIcons459[5].drawSprite(183, 5);
  2770. if(tabInterfaceIDs[6] != -1)///magic
  2771. sIcons459[6].drawSprite(212, 10);
  2772. /** Bottom sideIcons */
  2773. if(tabInterfaceIDs[7] != -1)///clan
  2774. sideIcons[7].drawSprite(31, 300);
  2775. if(tabInterfaceIDs[8] != -1)///friends
  2776. sIcons459[7].drawSprite(57, 306);
  2777. if(tabInterfaceIDs[9] != -1)///ignore
  2778. sIcons459[8].drawSprite(85, 308);
  2779. if(tabInterfaceIDs[10] != -1)///logout
  2780. sIcons459[9].drawSprite(121, 302);
  2781. if(tabInterfaceIDs[11] != -1)///options
  2782. sIcons459[10].drawSprite(157, 305);
  2783. if(tabInterfaceIDs[12] != -1)///emotes
  2784. sIcons459[11].drawSprite(187, 302);
  2785. if(tabInterfaceIDs[13] != -1)///music
  2786. sIcons459[12].drawSprite(211, 302);
  2787. }
  2788. }
  2789. public void drawRedStones() {
  2790. if(is474 || is480 || is508 || is525) {
  2791. if(tabInterfaceIDs[tabID] != -1) {
  2792. switch(tabID) {
  2793. case 0:
  2794. redStones[0].drawSprite(3+3, 0);
  2795. break;
  2796. case 1:
  2797. redStones[4].drawSprite(41+3, 0);
  2798. break;
  2799. case 2:
  2800. redStones[4].drawSprite(74+3, 0);
  2801. break;
  2802. case 3:
  2803. redStones[4].drawSprite(107+3, 0);
  2804. break;
  2805. case 4:
  2806. redStones[4].drawSprite(140+3, 0);
  2807. break;
  2808. case 5:
  2809. redStones[4].drawSprite(173+3, 0);
  2810. break;
  2811. case 6:
  2812. redStones[1].drawSprite(206+3, 0);
  2813. break;
  2814. case 7:
  2815. redStones[2].drawSprite(3+3, 298);
  2816. break;
  2817. case 8:
  2818. redStones[4].drawSprite(41+3, 298);
  2819. break;
  2820. case 9:
  2821. redStones[4].drawSprite(74+3, 298);
  2822. break;
  2823. case 10:
  2824. redStones[4].drawSprite(107+3, 298);
  2825. break;
  2826. case 11:
  2827. redStones[4].drawSprite(140+3, 298);
  2828. break;
  2829. case 12:
  2830. redStones[4].drawSprite(173+3, 298);
  2831. break;
  2832. case 13:
  2833. redStones[3].drawSprite(206+3, 298);
  2834. break;
  2835. }
  2836. }
  2837. } else if(is562){
  2838. drawTabHover();
  2839. if(tabInterfaceIDs[tabID] != -1)
  2840. {
  2841. if(tabID == 0)
  2842. tabClicked.drawSprite(2+3, 0);
  2843. if(tabID == 1)
  2844. tabClicked.drawSprite(32+3, 0);
  2845. if(tabID == 2)
  2846. tabClicked.drawSprite(62+3, 0);
  2847. if(tabID == 14)
  2848. tabClicked.drawSprite(92+3, 0);
  2849. if(tabID == 3)
  2850. tabClicked.drawSprite(122+3, 0);
  2851. if(tabID == 4)
  2852. tabClicked.drawSprite(152+3, 0);
  2853. if(tabID == 5)
  2854. tabClicked.drawSprite(182+3, 0);
  2855. if(tabID == 6)
  2856. tabClicked.drawSprite(212+3, 0);
  2857. if(tabID == 16)
  2858. tabClicked.drawSprite(2+3, 298);
  2859. if(tabID == 8)
  2860. tabClicked.drawSprite(32+3, 298);
  2861. if(tabID == 9)
  2862. tabClicked.drawSprite(62+3, 298);
  2863. if(tabID == 7)
  2864. tabClicked.drawSprite(92+3, 298);
  2865. if(tabID == 11)
  2866. tabClicked.drawSprite(122+3, 298);
  2867. if(tabID == 12)
  2868. tabClicked.drawSprite(152+3, 298);
  2869. if(tabID == 13)
  2870. tabClicked.drawSprite(182+3, 298);
  2871. if(tabID == 15)
  2872. tabClicked.drawSprite(212+3, 298);
  2873. }
  2874. } else {
  2875. if(tabInterfaceIDs[tabID] != -1) {
  2876. switch(tabID) {
  2877. case 0:
  2878. redStones[5].drawSprite(16+7, 1);
  2879. break;
  2880. case 1:
  2881. redStones[13].drawSprite(48+7, 1);
  2882. break;
  2883. case 2:
  2884. redStones[13].drawSprite(75+7, 1);
  2885. break;
  2886. case 3:
  2887. redStones[7].drawSprite(103+7, 0);
  2888. break;
  2889. case 4:
  2890. redStones[14].drawSprite(146+7, 1);
  2891. break;
  2892. case 5:
  2893. redStones[14].drawSprite(174+7, 1);
  2894. break;
  2895. case 6:
  2896. redStones[6].drawSprite(202+7, 2);
  2897. break;
  2898.  
  2899. case 7:
  2900. redStones[12].drawSprite(22, 296);
  2901. break;
  2902. case 8:
  2903. redStones[9].drawSprite(54, 297);
  2904. break;
  2905. case 9:
  2906. redStones[9].drawSprite(82, 297);
  2907. break;
  2908. case 10:
  2909. redStones[10].drawSprite(110, 299);
  2910. break;
  2911. case 11:
  2912. redStones[8].drawSprite(153, 297);
  2913. break;
  2914. case 12:
  2915. redStones[8].drawSprite(181, 297);
  2916. break;
  2917. case 13:
  2918. redStones[11].drawSprite(209, 297);
  2919. break;
  2920. }
  2921. }
  2922. }
  2923. }
  2924.  
  2925. private void drawTabArea() {
  2926. inventoryBackImage.initDrawingArea();
  2927. Texture.anIntArray1472 = anIntArray1181;
  2928. tabArea[getSpriteID()].drawSprite(0, 0);
  2929. if(spriteChanged)
  2930. needDrawTabArea = true;
  2931. tabAreaAltered = true;
  2932. if(invOverlayInterfaceID == -1) {
  2933. drawRedStones();
  2934. drawSideIcons();
  2935. }
  2936. if(is474 || is480 || is508 || is525 || is562) {
  2937. if(invOverlayInterfaceID != -1)
  2938. drawInterface(0, 32, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2939. else if(tabInterfaceIDs[tabID] != -1)
  2940. drawInterface(0, 32, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2941. } else if(is562){
  2942. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  2943. tabHover.drawSprite(3, 0);
  2944. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  2945. tabHover.drawSprite(33, 0);
  2946. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  2947. tabHover.drawSprite(63, 0);
  2948. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  2949. tabHover.drawSprite(93, 0);
  2950. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  2951. tabHover.drawSprite(123, 0);
  2952. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  2953. tabHover.drawSprite(153, 0);
  2954. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  2955. tabHover.drawSprite(183, 0);
  2956. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  2957. tabHover.drawSprite(213, 0);
  2958. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  2959. tabHover.drawSprite(3, 298);
  2960. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  2961. tabHover.drawSprite(33, 298);
  2962. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  2963. tabHover.drawSprite(63, 298);
  2964. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  2965. tabHover.drawSprite(93, 298);
  2966. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  2967. tabHover.drawSprite(123, 298);
  2968. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  2969. tabHover.drawSprite(153, 298);
  2970. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  2971. tabHover.drawSprite(183,298);
  2972. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  2973. tabHover.drawSprite(213, 298);
  2974. } else {
  2975. if(invOverlayInterfaceID != -1)
  2976. drawInterface(0, 38, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2977. else if(tabInterfaceIDs[tabID] != -1)
  2978. drawInterface(0, 38, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2979. }
  2980. if(menuOpen)
  2981. drawMenu(516, 168);
  2982. inventoryBackImage.drawGraphics(168, super.graphics, 516);//519
  2983. inGameScreen.initDrawingArea();
  2984. Texture.anIntArray1472 = anIntArray1182;
  2985. }
  2986.  
  2987. private void method37(int j) {
  2988. if(!lowMem) {
  2989. if(Texture.anIntArray1480[17] >= j) {
  2990.  
  2991. Background background = Texture.aBackgroundArray1474s[17];
  2992. int k = background.anInt1452 * background.anInt1453 - 1;
  2993. //fire cape apparently?
  2994. int j1 = background.anInt1452 * anInt945 * 2;
  2995. byte abyte0[] = background.aByteArray1450;
  2996. byte abyte3[] = aByteArray912;
  2997. for(int i2 = 0; i2 <= k; i2++)
  2998. abyte3[i2] = abyte0[i2 - j1 & k];
  2999.  
  3000. background.aByteArray1450 = abyte3;
  3001. aByteArray912 = abyte0;
  3002. Texture.method370(17);
  3003. anInt854++;
  3004. if(anInt854 > 1235) {
  3005. anInt854 = 0;
  3006. stream.createFrame(226);
  3007. stream.writeWordBigEndian(0);
  3008. int l2 = stream.currentOffset;
  3009. stream.writeWord(58722);
  3010. stream.writeWordBigEndian(240);
  3011. stream.writeWord((int)(Math.random() * 65536D));
  3012. stream.writeWordBigEndian((int)(Math.random() * 256D));
  3013. if((int)(Math.random() * 2D) == 0)
  3014. stream.writeWord(51825);
  3015. stream.writeWordBigEndian((int)(Math.random() * 256D));
  3016. stream.writeWord((int)(Math.random() * 65536D));
  3017. stream.writeWord(7130);
  3018. stream.writeWord((int)(Math.random() * 65536D));
  3019. stream.writeWord(61657);
  3020. stream.writeBytes(stream.currentOffset - l2);
  3021. }
  3022. }
  3023. if(Texture.anIntArray1480[24] >= j) {
  3024. Background background_1 = Texture.aBackgroundArray1474s[24];
  3025. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  3026. int k1 = background_1.anInt1452 * anInt945 * 2;
  3027. byte abyte1[] = background_1.aByteArray1450;
  3028. byte abyte4[] = aByteArray912;
  3029. for(int j2 = 0; j2 <= l; j2++)
  3030. abyte4[j2] = abyte1[j2 - k1 & l];
  3031.  
  3032. background_1.aByteArray1450 = abyte4;
  3033. aByteArray912 = abyte1;
  3034. Texture.method370(24);
  3035. }
  3036. if(Texture.anIntArray1480[34] >= j) {
  3037. Background background_2 = Texture.aBackgroundArray1474s[34];
  3038. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3039. int l1 = background_2.anInt1452 * anInt945 * 2;
  3040. byte abyte2[] = background_2.aByteArray1450;
  3041. byte abyte5[] = aByteArray912;
  3042. for(int k2 = 0; k2 <= i1; k2++)
  3043. abyte5[k2] = abyte2[k2 - l1 & i1];
  3044.  
  3045. background_2.aByteArray1450 = abyte5;
  3046. aByteArray912 = abyte2;
  3047. Texture.method370(34);
  3048. }
  3049. if(Texture.anIntArray1480[40] >= j)
  3050. {
  3051. Background background_2 = Texture.aBackgroundArray1474s[40];
  3052. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3053. int l1 = background_2.anInt1452 * anInt945 * 2;
  3054. byte abyte2[] = background_2.aByteArray1450;
  3055. byte abyte5[] = aByteArray912;
  3056. for(int k2 = 0; k2 <= i1; k2++)
  3057. abyte5[k2] = abyte2[k2 - l1 & i1];
  3058.  
  3059. background_2.aByteArray1450 = abyte5;
  3060. aByteArray912 = abyte2;
  3061. Texture.method370(40);
  3062.  
  3063. }
  3064. }
  3065. }
  3066.  
  3067. private void method38() {
  3068. for(int i = -1; i < playerCount; i++) {
  3069. int j;
  3070. if(i == -1)
  3071. j = myPlayerIndex;
  3072. else
  3073. j = playerIndices[i];
  3074. Player player = playerArray[j];
  3075. if(player != null && player.textCycle > 0) {
  3076. player.textCycle--;
  3077. if(player.textCycle == 0)
  3078. player.textSpoken = null;
  3079. }
  3080. }
  3081. for(int k = 0; k < npcCount; k++) {
  3082. int l = npcIndices[k];
  3083. NPC npc = npcArray[l];
  3084. if(npc != null && npc.textCycle > 0) {
  3085. npc.textCycle--;
  3086. if(npc.textCycle == 0)
  3087. npc.textSpoken = null;
  3088. }
  3089. }
  3090. }
  3091.  
  3092. private void calcCameraPos() {
  3093.  
  3094. int i = anInt1098 * 128 + 64;
  3095. int j = anInt1099 * 128 + 64;
  3096. int k = method42(plane, j, i) - anInt1100;
  3097. if(xCameraPos < i) {
  3098. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  3099. if(xCameraPos > i)
  3100. xCameraPos = i;
  3101. }
  3102. if(xCameraPos > i) {
  3103. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  3104. if(xCameraPos < i)
  3105. xCameraPos = i;
  3106. }
  3107. if(zCameraPos < k) {
  3108. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  3109. if(zCameraPos > k)
  3110. zCameraPos = k;
  3111. }
  3112. if(zCameraPos > k) {
  3113. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  3114. if(zCameraPos < k)
  3115. zCameraPos = k;
  3116. }
  3117. if(yCameraPos < j) {
  3118. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  3119. if(yCameraPos > j)
  3120. yCameraPos = j;
  3121. }
  3122. if(yCameraPos > j) {
  3123. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  3124. if(yCameraPos < j)
  3125. yCameraPos = j;
  3126. }
  3127. i = anInt995 * 128 + 64;
  3128. j = anInt996 * 128 + 64;
  3129. k = method42(plane, j, i) - anInt997;
  3130. int l = i - xCameraPos;
  3131. int i1 = k - zCameraPos;
  3132. int j1 = j - yCameraPos;
  3133. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  3134. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  3135. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  3136. if(l1 < 128)
  3137. l1 = 128;
  3138. if(l1 > 383)
  3139. l1 = 383;
  3140. if(yCameraCurve < l1) {
  3141. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  3142. if(yCameraCurve > l1)
  3143. yCameraCurve = l1;
  3144. }
  3145. if(yCameraCurve > l1) {
  3146. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  3147. if(yCameraCurve < l1)
  3148. yCameraCurve = l1;
  3149. }
  3150. int j2 = i2 - xCameraCurve;
  3151. if(j2 > 1024)
  3152. j2 -= 2048;
  3153. if(j2 < -1024)
  3154. j2 += 2048;
  3155. if(j2 > 0) {
  3156. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  3157. xCameraCurve &= 0x7ff;
  3158. }
  3159. if(j2 < 0) {
  3160. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  3161. xCameraCurve &= 0x7ff;
  3162. }
  3163. int k2 = i2 - xCameraCurve;
  3164. if(k2 > 1024)
  3165. k2 -= 2048;
  3166. if(k2 < -1024)
  3167. k2 += 2048;
  3168. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  3169. xCameraCurve = i2;
  3170. }
  3171.  
  3172. private void drawMenu(int xOffSet, int yOffSet) {
  3173. if(menuToggle == false) {
  3174. int xPos = menuOffsetX - (xOffSet - 4);
  3175. int yPos = (-yOffSet + 4) + menuOffsetY;
  3176. int menuW = menuWidth;
  3177. int menuH = menuHeight + 1;
  3178. int color = 0x5d5447;
  3179. needDrawTabArea = true;
  3180. inputTaken = true;
  3181. tabAreaAltered = true;
  3182. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  3183. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  3184. DrawingArea.drawPixels(menuH, yPos, xPos, color, menuW);
  3185. DrawingArea.drawPixels(16, yPos + 1, xPos + 1, 0, menuW - 2);
  3186. DrawingArea.fillPixels(xPos + 1, menuW - 2, menuH - 19, 0, yPos + 18);
  3187. chatTextDrawingArea.method385(color, "Choose Option", yPos + 14, xPos + 3);
  3188. int mouseX = super.mouseX - (xOffSet);
  3189. int mouseY = (-yOffSet) + super.mouseY;
  3190. for(int l1 = 0; l1 < menuActionRow; l1++) {
  3191. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  3192. int disColor = 0xffffff;
  3193. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3)
  3194. disColor = 0xffff00;
  3195. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  3196. }
  3197. } else if(menuToggle == true) {
  3198. int xPos = menuOffsetX - (xOffSet - 4);
  3199. int yPos = (-yOffSet + 4) + menuOffsetY;
  3200. int menuW = menuWidth;
  3201. int menuH = menuHeight + 1;
  3202. needDrawTabArea = true;
  3203. inputTaken = true;
  3204. tabAreaAltered = true;
  3205. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  3206. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  3207. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  3208. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e, menuW - 2);
  3209. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  3210. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822, menuW - 6);
  3211. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822, menuW - 4);
  3212. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822, menuW - 2);
  3213. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d, menuW - 4);
  3214. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d, menuW - 6);
  3215. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x112329, menuW - 6);
  3216. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  3217. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  3218. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  3219. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  3220. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  3221. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  3222. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  3223. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  3224. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  3225. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  3226. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  3227. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  3228. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  3229. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  3230. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  3231. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  3232. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  3233. aTextDrawingArea_1271.method385(0xc6b895, "Choose Option", yPos + 14, xPos + 3);
  3234. int j1 = super.mouseX;
  3235. int k1 = super.mouseY;
  3236. int mouseX = super.mouseX - (xOffSet);
  3237. int mouseY = (-yOffSet) + super.mouseY;
  3238. for(int l1 = 0; l1 < menuActionRow; l1++) {
  3239. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  3240. int disColor = 0xc6b895;
  3241. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  3242. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x26566C, menuWidth - 6);
  3243. disColor = 0xeee5c6;
  3244. }
  3245. aTextDrawingArea_1271.method389(true, xPos + 3, 0xAAA184, menuActionName[l1], textY + 1);
  3246. }
  3247. }
  3248. }
  3249.  
  3250. private void addFriend(long l) {
  3251. try {
  3252. if(l == 0L)
  3253. return;
  3254. if(friendsCount >= 100 && anInt1046 != 1) {
  3255. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3256. return;
  3257. }
  3258. if(friendsCount >= 200) {
  3259. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3260. return;
  3261. }
  3262. String s = TextClass.fixName(TextClass.nameForLong(l));
  3263. for(int i = 0; i < friendsCount; i++)
  3264. if(friendsListAsLongs[i] == l) {
  3265. pushMessage(s + " is already on your friend list", 0, "");
  3266. return;
  3267. }
  3268. for(int j = 0; j < ignoreCount; j++)
  3269. if(ignoreListAsLongs[j] == l) {
  3270. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  3271. return;
  3272. }
  3273.  
  3274. if(s.equals(myPlayer.name)) {
  3275. return;
  3276. } else {
  3277. friendsList[friendsCount] = s;
  3278. friendsListAsLongs[friendsCount] = l;
  3279. friendsNodeIDs[friendsCount] = 0;
  3280. friendsCount++;
  3281. needDrawTabArea = true;
  3282. stream.createFrame(188);
  3283. stream.writeQWord(l);
  3284. return;
  3285. }
  3286. } catch(RuntimeException runtimeexception) {
  3287. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  3288. }
  3289. throw new RuntimeException();
  3290. }
  3291.  
  3292. private int method42(int i, int j, int k) {
  3293. int l = k >> 7;
  3294. int i1 = j >> 7;
  3295. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  3296. return 0;
  3297. int j1 = i;
  3298. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  3299. j1++;
  3300. int k1 = k & 0x7f;
  3301. int l1 = j & 0x7f;
  3302. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  3303. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  3304. return i2 * (128 - l1) + j2 * l1 >> 7;
  3305. }
  3306.  
  3307. private static String intToKOrMil(int j) {
  3308. if(j < 0x186a0)
  3309. return String.valueOf(j);
  3310. if(j < 0x989680)
  3311. return j / 1000 + "K";
  3312. else
  3313. return j / 0xf4240 + "M";
  3314. }
  3315.  
  3316. private void resetLogout() {
  3317. try {
  3318. if(socketStream != null)
  3319. socketStream.close();
  3320. }
  3321. catch(Exception _ex) { }
  3322. socketStream = null;
  3323. alertHandler.alert = null;
  3324. loggedIn = false;
  3325. runClicked = true;
  3326. musicOrb = false;
  3327. restOrb = false;
  3328. prayClicked = false;
  3329. xpClicked = false;
  3330. drawXpBar = false;
  3331. loginScreenState = 0;
  3332. //myUsername = "";
  3333. //myPassword = "";
  3334. unlinkMRUNodes();
  3335. worldController.initToNull();
  3336. for(int i = 0; i < 4; i++)
  3337. aClass11Array1230[i].method210();
  3338. System.gc();
  3339. stopMidi();
  3340. currentSong = -1;
  3341. nextSong = -1;
  3342. prevSong = 0;
  3343. }
  3344.  
  3345. private void method45() {
  3346.  
  3347.  
  3348. aBoolean1031 = true;
  3349. for(int j = 0; j < 7; j++) {
  3350. anIntArray1065[j] = -1;
  3351. for(int k = 0; k < IdentityKit.length; k++) {
  3352. if(IdentityKit.cache[k].aBoolean662 || IdentityKit.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  3353. continue;
  3354. anIntArray1065[j] = k;
  3355. break;
  3356. }
  3357. }
  3358. }
  3359.  
  3360. private void method46(int i, Stream stream) {
  3361. while(stream.bitPosition + 21 < i * 8) {
  3362. int k = stream.readBits(14);
  3363. if(k == 16383)
  3364. break;
  3365. if(npcArray[k] == null)
  3366. npcArray[k] = new NPC();
  3367. NPC npc = npcArray[k];
  3368. npcIndices[npcCount++] = k;
  3369. npc.anInt1537 = loopCycle;
  3370. int l = stream.readBits(5);
  3371. if(l > 15)
  3372. l -= 32;
  3373. int i1 = stream.readBits(5);
  3374. if(i1 > 15)
  3375. i1 -= 32;
  3376. int j1 = stream.readBits(1);
  3377. npc.desc = EntityDef.forID(stream.readBits(14));//NPC FIX
  3378. int k1 = stream.readBits(1);
  3379. if(k1 == 1)
  3380. anIntArray894[anInt893++] = k;
  3381. npc.anInt1540 = npc.desc.aByte68;
  3382. npc.anInt1504 = npc.desc.anInt79;
  3383. npc.anInt1554 = npc.desc.anInt67;
  3384. npc.anInt1555 = npc.desc.anInt58;
  3385. npc.anInt1556 = npc.desc.anInt83;
  3386. npc.anInt1557 = npc.desc.anInt55;
  3387. npc.anInt1511 = npc.desc.anInt77;
  3388. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  3389. }
  3390. stream.finishBitAccess();
  3391. }
  3392.  
  3393. public void processGameLoop() {
  3394.  
  3395.  
  3396. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  3397. return;
  3398. loopCycle++;
  3399. if(!loggedIn)
  3400. processLoginScreenInput();
  3401. else
  3402. mainGameProcessor();
  3403. processOnDemandQueue();
  3404. }
  3405.  
  3406. private void method47(boolean flag) {
  3407. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  3408. destX = 0;
  3409. int j = playerCount;
  3410. if(flag)
  3411. j = 1;
  3412. for(int l = 0; l < j; l++) {
  3413. Player player;
  3414. int i1;
  3415. if(flag) {
  3416. player = myPlayer;
  3417. i1 = myPlayerIndex << 14;
  3418. } else {
  3419. player = playerArray[playerIndices[l]];
  3420. i1 = playerIndices[l] << 14;
  3421. }
  3422. if(player == null || !player.isVisible())
  3423. continue;
  3424. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  3425. int j1 = player.x >> 7;
  3426. int k1 = player.y >> 7;
  3427. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3428. continue;
  3429. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  3430. player.aBoolean1699 = false;
  3431. player.anInt1709 = method42(plane, player.y, player.x);
  3432. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  3433. continue;
  3434. }
  3435. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3436. if(anIntArrayArray929[j1][k1] == anInt1265)
  3437. continue;
  3438. anIntArrayArray929[j1][k1] = anInt1265;
  3439. }
  3440. player.anInt1709 = method42(plane, player.y, player.x);
  3441. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  3442. }
  3443. }
  3444.  
  3445. private boolean promptUserForInput(RSInterface class9) {
  3446. int j = class9.contentType;
  3447. if(anInt900 == 2) {
  3448. if(j == 201) {
  3449. inputTaken = true;
  3450. inputDialogState = 0;
  3451. messagePromptRaised = true;
  3452. promptInput = "";
  3453. friendsListAction = 1;
  3454. aString1121 = "Enter name of friend to add to list";
  3455. }
  3456. if(j == 202) {
  3457. inputTaken = true;
  3458. inputDialogState = 0;
  3459. messagePromptRaised = true;
  3460. promptInput = "";
  3461. friendsListAction = 2;
  3462. aString1121 = "Enter name of friend to delete from list";
  3463. }
  3464. }
  3465. if(j == 205) {
  3466. anInt1011 = 250;
  3467. return true;
  3468. }
  3469. if(j == 501) {
  3470. inputTaken = true;
  3471. inputDialogState = 0;
  3472. messagePromptRaised = true;
  3473. promptInput = "";
  3474. friendsListAction = 4;
  3475. aString1121 = "Enter name of player to add to list";
  3476. }
  3477. if(j == 502) {
  3478. inputTaken = true;
  3479. inputDialogState = 0;
  3480. messagePromptRaised = true;
  3481. promptInput = "";
  3482. friendsListAction = 5;
  3483. aString1121 = "Enter name of player to delete from list";
  3484. }
  3485. if(j == 550) {
  3486. inputTaken = true;
  3487. inputDialogState = 0;
  3488. messagePromptRaised = true;
  3489. promptInput = "";
  3490. friendsListAction = 6;
  3491. aString1121 = "Enter the name of the chat you wish to join";
  3492. }
  3493. if(j >= 300 && j <= 313) {
  3494. int k = (j - 300) / 2;
  3495. int j1 = j & 1;
  3496. int i2 = anIntArray1065[k];
  3497. if(i2 != -1) {
  3498. do {
  3499. if(j1 == 0 && --i2 < 0)
  3500. i2 = IdentityKit.length - 1;
  3501. if(j1 == 1 && ++i2 >= IdentityKit.length)
  3502. i2 = 0;
  3503. } while(IdentityKit.cache[i2].aBoolean662 || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3504. anIntArray1065[k] = i2;
  3505. aBoolean1031 = true;
  3506. }
  3507. }
  3508. if(j >= 314 && j <= 323) {
  3509. int l = (j - 314) / 2;
  3510. int k1 = j & 1;
  3511. int j2 = anIntArray990[l];
  3512. if(k1 == 0 && --j2 < 0)
  3513. j2 = anIntArrayArray1003[l].length - 1;
  3514. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3515. j2 = 0;
  3516. anIntArray990[l] = j2;
  3517. aBoolean1031 = true;
  3518. }
  3519. if(j == 324 && !aBoolean1047) {
  3520. aBoolean1047 = true;
  3521. method45();
  3522. }
  3523. if(j == 325 && aBoolean1047) {
  3524. aBoolean1047 = false;
  3525. method45();
  3526. }
  3527. if(j == 326) {
  3528. stream.createFrame(101);
  3529. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3530. for(int i1 = 0; i1 < 7; i1++)
  3531. stream.writeWordBigEndian(anIntArray1065[i1]);
  3532.  
  3533. for(int l1 = 0; l1 < 5; l1++)
  3534. stream.writeWordBigEndian(anIntArray990[l1]);
  3535.  
  3536. return true;
  3537. }
  3538. if(j == 613)
  3539. canMute = !canMute;
  3540. if(j >= 601 && j <= 612) {
  3541. clearTopInterfaces();
  3542. if(reportAbuseInput.length() > 0) {
  3543. stream.createFrame(218);
  3544. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3545. stream.writeWordBigEndian(j - 601);
  3546. stream.writeWordBigEndian(canMute ? 1 : 0);
  3547. }
  3548. }
  3549. return false;
  3550. }
  3551.  
  3552. private void method49(Stream stream) {
  3553. for(int j = 0; j < anInt893; j++) {
  3554. int k = anIntArray894[j];
  3555. Player player = playerArray[k];
  3556. int l = stream.readUnsignedByte();
  3557. if((l & 0x40) != 0)
  3558. l += stream.readUnsignedByte() << 8;
  3559. method107(l, k, stream, player);
  3560. }
  3561. }
  3562.  
  3563. private void method50(int i, int k, int l, int i1, int j1) {
  3564. int k1 = worldController.method300(j1, l, i);
  3565. if(k1 != 0) {
  3566. int l1 = worldController.method304(j1, l, i, k1);
  3567. int k2 = l1 >> 6 & 3;
  3568. int i3 = l1 & 0x1f;
  3569. int k3 = k;
  3570. if(k1 > 0)
  3571. k3 = i1;
  3572. int ai[] = aSprite_1263.myPixels;
  3573. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3574. int i5 = k1 >> 14 & 0x7fff;
  3575. ObjectDef class46_2 = ObjectDef.forID(i5);
  3576. if(class46_2.anInt758 != -1) {
  3577. Background background_2 = mapScenes[class46_2.anInt758];
  3578. if(background_2 != null) {
  3579. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3580. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3581. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  3582. }
  3583. } else {
  3584. if(i3 == 0 || i3 == 2)
  3585. if(k2 == 0) {
  3586. ai[k4] = k3;
  3587. ai[k4 + 512] = k3;
  3588. ai[k4 + 1024] = k3;
  3589. ai[k4 + 1536] = k3;
  3590. } else if(k2 == 1) {
  3591. ai[k4] = k3;
  3592. ai[k4 + 1] = k3;
  3593. ai[k4 + 2] = k3;
  3594. ai[k4 + 3] = k3;
  3595. } else if(k2 == 2) {
  3596. ai[k4 + 3] = k3;
  3597. ai[k4 + 3 + 512] = k3;
  3598. ai[k4 + 3 + 1024] = k3;
  3599. ai[k4 + 3 + 1536] = k3;
  3600. } else if(k2 == 3) {
  3601. ai[k4 + 1536] = k3;
  3602. ai[k4 + 1536 + 1] = k3;
  3603. ai[k4 + 1536 + 2] = k3;
  3604. ai[k4 + 1536 + 3] = k3;
  3605. }
  3606. if(i3 == 3)
  3607. if(k2 == 0)
  3608. ai[k4] = k3;
  3609. else if(k2 == 1)
  3610. ai[k4 + 3] = k3;
  3611. else if(k2 == 2)
  3612. ai[k4 + 3 + 1536] = k3;
  3613. else if(k2 == 3)
  3614. ai[k4 + 1536] = k3;
  3615. if(i3 == 2)
  3616. if(k2 == 3) {
  3617. ai[k4] = k3;
  3618. ai[k4 + 512] = k3;
  3619. ai[k4 + 1024] = k3;
  3620. ai[k4 + 1536] = k3;
  3621. } else if(k2 == 0) {
  3622. ai[k4] = k3;
  3623. ai[k4 + 1] = k3;
  3624. ai[k4 + 2] = k3;
  3625. ai[k4 + 3] = k3;
  3626. } else if(k2 == 1) {
  3627. ai[k4 + 3] = k3;
  3628. ai[k4 + 3 + 512] = k3;
  3629. ai[k4 + 3 + 1024] = k3;
  3630. ai[k4 + 3 + 1536] = k3;
  3631. } else if(k2 == 2) {
  3632. ai[k4 + 1536] = k3;
  3633. ai[k4 + 1536 + 1] = k3;
  3634. ai[k4 + 1536 + 2] = k3;
  3635. ai[k4 + 1536 + 3] = k3;
  3636. }
  3637. }
  3638. }
  3639. k1 = worldController.method302(j1, l, i);
  3640. if(k1 != 0) {
  3641. int i2 = worldController.method304(j1, l, i, k1);
  3642. int l2 = i2 >> 6 & 3;
  3643. int j3 = i2 & 0x1f;
  3644. int l3 = k1 >> 14 & 0x7fff;
  3645. ObjectDef class46_1 = ObjectDef.forID(l3);
  3646. if(class46_1.anInt758 != -1) {
  3647. Background background_1 = mapScenes[class46_1.anInt758];
  3648. if(background_1 != null) {
  3649. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3650. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3651. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  3652. }
  3653. } else if(j3 == 9) {
  3654. int l4 = 0xeeeeee;
  3655. if(k1 > 0)
  3656. l4 = 0xee0000;
  3657. int ai1[] = aSprite_1263.myPixels;
  3658. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3659. if(l2 == 0 || l2 == 2) {
  3660. ai1[l5 + 1536] = l4;
  3661. ai1[l5 + 1024 + 1] = l4;
  3662. ai1[l5 + 512 + 2] = l4;
  3663. ai1[l5 + 3] = l4;
  3664. } else {
  3665. ai1[l5] = l4;
  3666. ai1[l5 + 512 + 1] = l4;
  3667. ai1[l5 + 1024 + 2] = l4;
  3668. ai1[l5 + 1536 + 3] = l4;
  3669. }
  3670. }
  3671. }
  3672. k1 = worldController.method303(j1, l, i);
  3673. if(k1 != 0) {
  3674. int j2 = k1 >> 14 & 0x7fff;
  3675. ObjectDef class46 = ObjectDef.forID(j2);
  3676. if(class46.anInt758 != -1) {
  3677. Background background = mapScenes[class46.anInt758];
  3678. if(background != null) {
  3679. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3680. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3681. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3682. }
  3683. }
  3684. }
  3685. }
  3686.  
  3687. private void loadTitleScreen() {
  3688. if(normalLogin == true)
  3689. titleBox = new Background(titleStreamLoader, "titlebox", 0);
  3690. else
  3691. titleBox = new Background(titleStreamLoader, "titlebox", 0);
  3692. boxHover = new Sprite(titleStreamLoader, "titlebox", 1);
  3693. titleButton = new Background(titleStreamLoader, "titlebutton", 0);
  3694. loginHover = new Sprite(titleStreamLoader, "titlebutton", 1);
  3695. aBackgroundArray1152s = new Background[12];
  3696. int j = 0;
  3697. try {
  3698. j = Integer.parseInt(getParameter("fl_icon"));
  3699. } catch(Exception _ex) {
  3700. }
  3701. if(j == 0) {
  3702. for(int k = 0; k < 12; k++)
  3703. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3704.  
  3705. } else {
  3706. for(int l = 0; l < 12; l++)
  3707. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3708.  
  3709. }
  3710. aSprite_1201 = new Sprite(128, 265);
  3711. aSprite_1202 = new Sprite(128, 265);
  3712. System.arraycopy(leftSideFlame.anIntArray315, 0, aSprite_1201.myPixels, 0, 33920);
  3713.  
  3714. System.arraycopy(rightSideFlame.anIntArray315, 0, aSprite_1202.myPixels, 0, 33920);
  3715.  
  3716. anIntArray851 = new int[256];
  3717. for(int k1 = 0; k1 < 64; k1++)
  3718. anIntArray851[k1] = k1 * 0x40000;
  3719.  
  3720. for(int l1 = 0; l1 < 64; l1++)
  3721. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3722.  
  3723. for(int i2 = 0; i2 < 64; i2++)
  3724. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3725.  
  3726. for(int j2 = 0; j2 < 64; j2++)
  3727. anIntArray851[j2 + 192] = 0xffffff;
  3728.  
  3729. anIntArray852 = new int[256];
  3730. for(int k2 = 0; k2 < 64; k2++)
  3731. anIntArray852[k2] = k2 * 1024;
  3732.  
  3733. for(int l2 = 0; l2 < 64; l2++)
  3734. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3735.  
  3736. for(int i3 = 0; i3 < 64; i3++)
  3737. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3738.  
  3739. for(int j3 = 0; j3 < 64; j3++)
  3740. anIntArray852[j3 + 192] = 0xffffff;
  3741.  
  3742. anIntArray853 = new int[256];
  3743. for(int k3 = 0; k3 < 64; k3++)
  3744. anIntArray853[k3] = k3 * 4;
  3745.  
  3746. for(int l3 = 0; l3 < 64; l3++)
  3747. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3748.  
  3749. for(int i4 = 0; i4 < 64; i4++)
  3750. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3751.  
  3752. for(int j4 = 0; j4 < 64; j4++)
  3753. anIntArray853[j4 + 192] = 0xffffff;
  3754.  
  3755. anIntArray850 = new int[256];
  3756. anIntArray1190 = new int[32768];
  3757. anIntArray1191 = new int[32768];
  3758. randomizeBackground(null);
  3759. anIntArray828 = new int[32768];
  3760. anIntArray829 = new int[32768];
  3761. if(!aBoolean831) {
  3762. drawFlames = true;
  3763. aBoolean831 = true;
  3764. startRunnable(this, 2);
  3765. }
  3766. }
  3767.  
  3768. private static void setHighMem() {
  3769. WorldController.lowMem = true;
  3770. Texture.lowMem = false;
  3771. lowMem = false;
  3772. ObjectManager.lowMem = false;
  3773. ObjectDef.lowMem = false;
  3774. }
  3775.  
  3776. public static void main(String args[]) {
  3777. try {
  3778. nodeID = 10;
  3779. portOff = 0;
  3780. setHighMem(); //sets high or low detail
  3781. isMembers = true;
  3782. signlink.storeid = 32;
  3783. signlink.startpriv(InetAddress.getLocalHost());
  3784. instance = new client();
  3785. instance.createClientFrame(503, 765);//client frame size
  3786. } catch(Exception e) {
  3787. e.printStackTrace();
  3788. }
  3789. }
  3790.  
  3791. public static client instance;
  3792.  
  3793. private void loadingStages()
  3794. {
  3795. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane)
  3796. {
  3797. inGameScreen.initDrawingArea();
  3798. loadingPleaseWait.drawSprite(8,9);;
  3799. inGameScreen.drawGraphics(4, super.graphics, 4);
  3800. loadingStage = 1;
  3801. aLong824 = System.currentTimeMillis();
  3802. }
  3803. if(loadingStage == 1)
  3804. {
  3805. int j = method54();
  3806. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L)
  3807. {
  3808. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3809. aLong824 = System.currentTimeMillis();
  3810. }
  3811. }
  3812. if(loadingStage == 2 && plane != anInt985)
  3813. {
  3814. anInt985 = plane;
  3815. method24(plane);
  3816. }
  3817. }
  3818.  
  3819. private int method54() {
  3820. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  3821. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3822. return -1;
  3823. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3824. return -2;
  3825. }
  3826. boolean flag = true;
  3827. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  3828. byte abyte0[] = aByteArrayArray1247[j];
  3829. if(abyte0 != null) {
  3830. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3831. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3832. if(aBoolean1159) {
  3833. k = 10;
  3834. l = 10;
  3835. }
  3836. flag &= ObjectManager.method189(k, abyte0, l);
  3837. }
  3838. }
  3839. if(!flag)
  3840. return -3;
  3841. if(aBoolean1080) {
  3842. return -4;
  3843. } else {
  3844. loadingStage = 2;
  3845. ObjectManager.anInt131 = plane;
  3846. method22();
  3847. stream.createFrame(121);
  3848. return 0;
  3849. }
  3850. }
  3851.  
  3852. private void method55()
  3853. {
  3854. 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())
  3855. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3856. class30_sub2_sub4_sub4.unlink();
  3857. else
  3858. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  3859. {
  3860. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  3861. {
  3862. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3863. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3864. 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);
  3865. }
  3866. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  3867. {
  3868. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3869. Player player;
  3870. if(j == unknownInt10)
  3871. player = myPlayer;
  3872. else
  3873. player = playerArray[j];
  3874. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3875. 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);
  3876. }
  3877. class30_sub2_sub4_sub4.method456(anInt945);
  3878. 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);
  3879. }
  3880.  
  3881. }
  3882.  
  3883. public AppletContext getAppletContext()
  3884. {
  3885. if(signlink.mainapp != null)
  3886. return signlink.mainapp.getAppletContext();
  3887. else
  3888. return super.getAppletContext();
  3889. }
  3890.  
  3891. private void drawLogo() {
  3892. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3893. Sprite sprite = new Sprite(abyte0, this);
  3894.  
  3895. leftSideFlame.initDrawingArea();
  3896. sprite.method346(0, 0);
  3897. rightSideFlame.initDrawingArea();
  3898. sprite.method346(-637, 0);
  3899. aRSImageProducer_1107.initDrawingArea();
  3900. sprite.method346(-128, 0);
  3901. aRSImageProducer_1108.initDrawingArea();
  3902. sprite.method346(-202, -371);
  3903. loginScreenArea.initDrawingArea();
  3904. sprite.method346(0, 0);
  3905. gameLogo.initDrawingArea();
  3906. sprite.method346(0, -265);
  3907. aRSImageProducer_1113.initDrawingArea();
  3908. sprite.method346(-562, -265);
  3909. aRSImageProducer_1114.initDrawingArea();
  3910. sprite.method346(-128, -171);
  3911. aRSImageProducer_1115.initDrawingArea();
  3912. sprite.method346(-562, -171);
  3913.  
  3914. int backgroundPixels[] = new int[sprite.myWidth];
  3915. for (int j = 0; j < sprite.myHeight; j++) {
  3916. for (int k = 0; k < sprite.myWidth; k++)
  3917. backgroundPixels[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3918.  
  3919. System.arraycopy(backgroundPixels, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3920.  
  3921. }
  3922. sprite = null;
  3923. Object obj = null;
  3924. Object obj1 = null;
  3925. System.gc();
  3926. }
  3927.  
  3928. private void resetImage() {
  3929. DrawingArea.setAllPixelsToZero();
  3930. }
  3931.  
  3932. private void processOnDemandQueue()
  3933. {
  3934. do
  3935. {
  3936. OnDemandData onDemandData;
  3937. do
  3938. {
  3939. onDemandData = onDemandFetcher.getNextNode();
  3940. if(onDemandData == null)
  3941. return;
  3942. if(onDemandData.dataType == 0)
  3943. {
  3944. Model.method460(onDemandData.buffer, onDemandData.ID);
  3945. needDrawTabArea = true;
  3946. if(backDialogID != -1)
  3947. inputTaken = true;
  3948. }
  3949. //if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  3950. // Class36.method529(onDemandData.buffer, onDemandData.ID);
  3951. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3952. saveMidi(songChanging, onDemandData.buffer);
  3953. if(onDemandData.dataType == 3 && loadingStage == 1)
  3954. {
  3955. //System.out.println(onDemandData.ID);
  3956. try {
  3957. writeFile(onDemandData.buffer, "./maps/" + onDemandData.ID + ".dat");
  3958. } catch (Exception e) {}
  3959. for(int i = 0; i < aByteArrayArray1183.length; i++)
  3960. {
  3961. if(anIntArray1235[i] == onDemandData.ID)
  3962. {
  3963. aByteArrayArray1183[i] = onDemandData.buffer;
  3964. if(onDemandData.buffer == null) {
  3965. anIntArray1235[i] = -1;
  3966. }
  3967. break;
  3968. }
  3969. if(anIntArray1236[i] != onDemandData.ID)
  3970. continue;
  3971. aByteArrayArray1247[i] = onDemandData.buffer;
  3972. if(onDemandData.buffer == null) {
  3973. anIntArray1236[i] = -1;
  3974. }
  3975. break;
  3976. }
  3977.  
  3978. }
  3979. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3980. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3981. } while(true);
  3982. }
  3983.  
  3984. private void calcFlamesPosition()
  3985. {
  3986. char c = '\u0100';
  3987. for(int j = 10; j < 117; j++)
  3988. {
  3989. int k = (int)(Math.random() * 100D);
  3990. if(k < 50)
  3991. anIntArray828[j + (c - 2 << 7)] = 255;
  3992. }
  3993. for(int l = 0; l < 100; l++)
  3994. {
  3995. int i1 = (int)(Math.random() * 124D) + 2;
  3996. int k1 = (int)(Math.random() * 128D) + 128;
  3997. int k2 = i1 + (k1 << 7);
  3998. anIntArray828[k2] = 192;
  3999. }
  4000.  
  4001. for(int j1 = 1; j1 < c - 1; j1++)
  4002. {
  4003. for(int l1 = 1; l1 < 127; l1++)
  4004. {
  4005. int l2 = l1 + (j1 << 7);
  4006. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  4007. }
  4008.  
  4009. }
  4010.  
  4011. anInt1275 += 128;
  4012. if(anInt1275 > anIntArray1190.length)
  4013. {
  4014. anInt1275 -= anIntArray1190.length;
  4015. int i2 = (int)(Math.random() * 12D);
  4016. randomizeBackground(aBackgroundArray1152s[i2]);
  4017. }
  4018. for(int j2 = 1; j2 < c - 1; j2++)
  4019. {
  4020. for(int i3 = 1; i3 < 127; i3++)
  4021. {
  4022. int k3 = i3 + (j2 << 7);
  4023. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  4024. if(i4 < 0)
  4025. i4 = 0;
  4026. anIntArray828[k3] = i4;
  4027. }
  4028.  
  4029. }
  4030.  
  4031. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  4032.  
  4033. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  4034. if(anInt1040 > 0)
  4035. anInt1040 -= 4;
  4036. if(anInt1041 > 0)
  4037. anInt1041 -= 4;
  4038. if(anInt1040 == 0 && anInt1041 == 0)
  4039. {
  4040. int l3 = (int)(Math.random() * 2000D);
  4041. if(l3 == 0)
  4042. anInt1040 = 1024;
  4043. if(l3 == 1)
  4044. anInt1041 = 1024;
  4045. }
  4046. }
  4047.  
  4048. private boolean saveWave(byte abyte0[], int i)
  4049. {
  4050. return abyte0 == null || signlink.wavesave(abyte0, i);
  4051. }
  4052.  
  4053. private void method60(int i)
  4054. {
  4055. RSInterface class9 = RSInterface.interfaceCache[i];
  4056. for(int j = 0; j < class9.children.length; j++)
  4057. {
  4058. if(class9.children[j] == -1)
  4059. break;
  4060. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  4061. if(class9_1.interfaceType == 1)
  4062. method60(class9_1.id);
  4063. class9_1.animationLength = 0;
  4064. class9_1.animationDelay = 0;
  4065. }
  4066. }
  4067.  
  4068. private void drawHeadIcon()
  4069. {
  4070. if(anInt855 != 2)
  4071. return;
  4072. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  4073. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  4074. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  4075. }
  4076.  
  4077. private void mainGameProcessor()
  4078. {
  4079. if(anInt1104 > 1)
  4080. anInt1104--;
  4081. if(anInt1011 > 0)
  4082. anInt1011--;
  4083. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4084. if (anInt1501 < 100) {
  4085. anInt1501++;
  4086. if (anInt1501 == 100) {
  4087. if (anInt1500 != 0) {
  4088. inputTaken = true;
  4089. }
  4090. if (anInt1044 != 0) {
  4091. needDrawTabArea = true;
  4092. }
  4093. }
  4094. }
  4095. } else if (anInt1501 > 0) {
  4096. anInt1501--;
  4097. }
  4098. for(int j = 0; j < 5; j++)
  4099. if(!parsePacket())
  4100. break;
  4101. if(!loggedIn)
  4102. return;
  4103. synchronized(mouseDetection.syncObject)
  4104. {
  4105. if(flagged)
  4106. {
  4107. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  4108. {
  4109. stream.createFrame(45);
  4110. stream.writeWordBigEndian(0);
  4111. int j2 = stream.currentOffset;
  4112. int j3 = 0;
  4113. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  4114. {
  4115. if(j2 - stream.currentOffset >= 240)
  4116. break;
  4117. j3++;
  4118. int l4 = mouseDetection.coordsY[j4];
  4119. if(l4 < 0)
  4120. l4 = 0;
  4121. else
  4122. if(l4 > 502)
  4123. l4 = 502;
  4124. int k5 = mouseDetection.coordsX[j4];
  4125. if(k5 < 0)
  4126. k5 = 0;
  4127. else
  4128. if(k5 > 764)
  4129. k5 = 764;
  4130. int i6 = l4 * 765 + k5;
  4131. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  4132. {
  4133. k5 = -1;
  4134. l4 = -1;
  4135. i6 = 0x7ffff;
  4136. }
  4137. if(k5 == anInt1237 && l4 == anInt1238)
  4138. {
  4139. if(anInt1022 < 2047)
  4140. anInt1022++;
  4141. } else
  4142. {
  4143. int j6 = k5 - anInt1237;
  4144. anInt1237 = k5;
  4145. int k6 = l4 - anInt1238;
  4146. anInt1238 = l4;
  4147. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  4148. {
  4149. j6 += 32;
  4150. k6 += 32;
  4151. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  4152. anInt1022 = 0;
  4153. } else
  4154. if(anInt1022 < 8)
  4155. {
  4156. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  4157. anInt1022 = 0;
  4158. } else
  4159. {
  4160. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  4161. anInt1022 = 0;
  4162. }
  4163. }
  4164. }
  4165.  
  4166. stream.writeBytes(stream.currentOffset - j2);
  4167. if(j3 >= mouseDetection.coordsIndex)
  4168. {
  4169. mouseDetection.coordsIndex = 0;
  4170. } else
  4171. {
  4172. mouseDetection.coordsIndex -= j3;
  4173. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  4174. {
  4175. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  4176. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  4177. }
  4178.  
  4179. }
  4180. }
  4181. } else
  4182. {
  4183. mouseDetection.coordsIndex = 0;
  4184. }
  4185. }
  4186. if(super.clickMode3 != 0)
  4187. {
  4188. long l = (super.aLong29 - aLong1220) / 50L;
  4189. if(l > 4095L)
  4190. l = 4095L;
  4191. aLong1220 = super.aLong29;
  4192. int k2 = super.saveClickY;
  4193. if(k2 < 0)
  4194. k2 = 0;
  4195. else
  4196. if(k2 > 502)
  4197. k2 = 502;
  4198. int k3 = super.saveClickX;
  4199. if(k3 < 0)
  4200. k3 = 0;
  4201. else
  4202. if(k3 > 764)
  4203. k3 = 764;
  4204. int k4 = k2 * 765 + k3;
  4205. int j5 = 0;
  4206. if(super.clickMode3 == 2)
  4207. j5 = 1;
  4208. int l5 = (int)l;
  4209. stream.createFrame(241);
  4210. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  4211. }
  4212. if(anInt1016 > 0)
  4213. anInt1016--;
  4214. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  4215. aBoolean1017 = true;
  4216. if(aBoolean1017 && anInt1016 <= 0)
  4217. {
  4218. anInt1016 = 20;
  4219. aBoolean1017 = false;
  4220. stream.createFrame(86);
  4221. stream.writeWord(anInt1184);
  4222. stream.method432(minimapInt1);
  4223. }
  4224. if(super.awtFocus && !aBoolean954)
  4225. {
  4226. aBoolean954 = true;
  4227. stream.createFrame(3);
  4228. stream.writeWordBigEndian(1);
  4229. }
  4230. if(!super.awtFocus && aBoolean954)
  4231. {
  4232. aBoolean954 = false;
  4233. stream.createFrame(3);
  4234. stream.writeWordBigEndian(0);
  4235. }
  4236. loadingStages();
  4237. method115();
  4238. method90();
  4239. anInt1009++;
  4240. if(anInt1009 > 750)
  4241. dropClient();
  4242. method114();
  4243. method95();
  4244. method38();
  4245.  
  4246. anInt945++;
  4247. if(crossType != 0)
  4248. {
  4249. crossIndex += 20;
  4250. if(crossIndex >= 400)
  4251. crossType = 0;
  4252. }
  4253. if(atInventoryInterfaceType != 0)
  4254. {
  4255. atInventoryLoopCycle++;
  4256. if(atInventoryLoopCycle >= 15)
  4257. {
  4258. if(atInventoryInterfaceType == 2)
  4259. needDrawTabArea = true;
  4260. if(atInventoryInterfaceType == 3)
  4261. inputTaken = true;
  4262. atInventoryInterfaceType = 0;
  4263. }
  4264. }
  4265. if(activeInterfaceType != 0)
  4266. {
  4267. anInt989++;
  4268. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  4269. aBoolean1242 = true;
  4270. if(super.clickMode2 == 0)
  4271. {
  4272. if(activeInterfaceType == 2)
  4273. needDrawTabArea = true;
  4274. if(activeInterfaceType == 3)
  4275. inputTaken = true;
  4276. activeInterfaceType = 0;
  4277. if(aBoolean1242 && anInt989 >= 5)
  4278. {
  4279. lastActiveInvInterface = -1;
  4280. processRightClick();
  4281. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  4282. {
  4283. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4284. int j1 = 0;
  4285. if(anInt913 == 1 && class9.contentType == 206)
  4286. j1 = 1;
  4287. if(class9.inventory[mouseInvInterfaceIndex] <= 0)
  4288. j1 = 0;
  4289. if(class9.deletesTargetSlot)
  4290. {
  4291. int l2 = anInt1085;
  4292. int l3 = mouseInvInterfaceIndex;
  4293. class9.inventory[l3] = class9.inventory[l2];
  4294. class9.inventoryValue[l3] = class9.inventoryValue[l2];
  4295. class9.inventory[l2] = -1;
  4296. class9.inventoryValue[l2] = 0;
  4297. } else
  4298. if(j1 == 1)
  4299. {
  4300. int i3 = anInt1085;
  4301. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  4302. if(i3 > i4)
  4303. {
  4304. class9.swapInventoryItems(i3, i3 - 1);
  4305. i3--;
  4306. } else
  4307. if(i3 < i4)
  4308. {
  4309. class9.swapInventoryItems(i3, i3 + 1);
  4310. i3++;
  4311. }
  4312.  
  4313. } else
  4314. {
  4315. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  4316. }
  4317. stream.createFrame(214);
  4318. stream.method433(anInt1084);
  4319. stream.method424(j1);
  4320. stream.method433(anInt1085);
  4321. stream.method431(mouseInvInterfaceIndex);
  4322. }
  4323. } else
  4324. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  4325. determineMenuSize();
  4326. else
  4327. if(menuActionRow > 0)
  4328. doAction(menuActionRow - 1);
  4329. atInventoryLoopCycle = 10;
  4330. super.clickMode3 = 0;
  4331. }
  4332. }
  4333. if(WorldController.anInt470 != -1)
  4334. {
  4335. int k = WorldController.anInt470;
  4336. int k1 = WorldController.anInt471;
  4337. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  4338. WorldController.anInt470 = -1;
  4339. if(flag)
  4340. {
  4341. crossX = super.saveClickX;
  4342. crossY = super.saveClickY;
  4343. crossType = 1;
  4344. crossIndex = 0;
  4345. }
  4346. }
  4347. if(super.clickMode3 == 1 && aString844 != null)
  4348. {
  4349. aString844 = null;
  4350. inputTaken = true;
  4351. super.clickMode3 = 0;
  4352. }
  4353. processMenuClick();
  4354. processMainScreenClick();
  4355. processTabClick();
  4356. processChatModeClick();
  4357. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  4358. anInt1213++;
  4359. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4360. if (anInt1501 < 100) {
  4361. anInt1501++;
  4362. if (anInt1501 == 100) {
  4363. if (anInt1500 != 0) {
  4364. inputTaken = true;
  4365. }
  4366. if (anInt1044 != 0) {
  4367. needDrawTabArea = true;
  4368. }
  4369. }
  4370. }
  4371. } else if (anInt1501 > 0) {
  4372. anInt1501--;
  4373. }
  4374. if(loadingStage == 2)
  4375. method108();
  4376. if(loadingStage == 2 && aBoolean1160)
  4377. calcCameraPos();
  4378. for(int i1 = 0; i1 < 5; i1++)
  4379. anIntArray1030[i1]++;
  4380.  
  4381. method73();
  4382. super.idleTime++;
  4383. if(super.idleTime > 4500)
  4384. {
  4385. anInt1011 = 250;
  4386. super.idleTime -= 500;
  4387. stream.createFrame(202);
  4388. }
  4389. anInt988++;
  4390. if(anInt988 > 500)
  4391. {
  4392. anInt988 = 0;
  4393. int l1 = (int)(Math.random() * 8D);
  4394. if((l1 & 1) == 1)
  4395. anInt1278 += anInt1279;
  4396. if((l1 & 2) == 2)
  4397. anInt1131 += anInt1132;
  4398. if((l1 & 4) == 4)
  4399. anInt896 += anInt897;
  4400. }
  4401. if(anInt1278 < -50)
  4402. anInt1279 = 2;
  4403. if(anInt1278 > 50)
  4404. anInt1279 = -2;
  4405. if(anInt1131 < -55)
  4406. anInt1132 = 2;
  4407. if(anInt1131 > 55)
  4408. anInt1132 = -2;
  4409. if(anInt896 < -40)
  4410. anInt897 = 1;
  4411. if(anInt896 > 40)
  4412. anInt897 = -1;
  4413. anInt1254++;
  4414. if(anInt1254 > 500)
  4415. {
  4416. anInt1254 = 0;
  4417. int i2 = (int)(Math.random() * 8D);
  4418. if((i2 & 1) == 1)
  4419. minimapInt2 += anInt1210;
  4420. if((i2 & 2) == 2)
  4421. minimapInt3 += anInt1171;
  4422. }
  4423. if(minimapInt2 < -60)
  4424. anInt1210 = 2;
  4425. if(minimapInt2 > 60)
  4426. anInt1210 = -2;
  4427. if(minimapInt3 < -20)
  4428. anInt1171 = 1;
  4429. if(minimapInt3 > 10)
  4430. anInt1171 = -1;
  4431. anInt1010++;
  4432. if(anInt1010 > 50)
  4433. stream.createFrame(0);
  4434. try
  4435. {
  4436. if(socketStream != null && stream.currentOffset > 0)
  4437. {
  4438. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  4439. stream.currentOffset = 0;
  4440. anInt1010 = 0;
  4441. }
  4442. } catch(IOException _ex) {
  4443. dropClient();
  4444. } catch(Exception exception) {
  4445. resetLogout();
  4446. }
  4447. }
  4448.  
  4449. private void method63()
  4450. {
  4451. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  4452. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  4453. if(class30_sub1.anInt1294 == -1) {
  4454. class30_sub1.anInt1302 = 0;
  4455. method89(class30_sub1);
  4456. } else {
  4457. class30_sub1.unlink();
  4458. }
  4459.  
  4460. }
  4461.  
  4462. private void resetImageProducers()
  4463. {
  4464. if(aRSImageProducer_1107 != null)
  4465. return;
  4466. super.fullGameScreen = null;
  4467. chatBackImage = null;
  4468. mapBackImage = null;
  4469. inventoryBackImage = null;
  4470. inGameScreen = null;
  4471. //aRSImageProducer_1123 = null;
  4472. aRSImageProducer_1124 = null;
  4473. aRSImageProducer_1125 = null;
  4474.  
  4475. leftSideFlame = new RSImageProducer(128, 265, getGameComponent());
  4476. DrawingArea.setAllPixelsToZero();
  4477. rightSideFlame = new RSImageProducer(128, 265, getGameComponent());
  4478. DrawingArea.setAllPixelsToZero();
  4479. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  4480. DrawingArea.setAllPixelsToZero();
  4481. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  4482. DrawingArea.setAllPixelsToZero();
  4483. loginScreenArea = new RSImageProducer(765, 503, getGameComponent());
  4484. DrawingArea.setAllPixelsToZero();
  4485. gameLogo = new RSImageProducer(202, 238, getGameComponent());
  4486. DrawingArea.setAllPixelsToZero();
  4487. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  4488. DrawingArea.setAllPixelsToZero();
  4489. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4490. DrawingArea.setAllPixelsToZero();
  4491. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4492. DrawingArea.setAllPixelsToZero();
  4493. if(titleStreamLoader != null) {
  4494. drawLogo();
  4495. loadTitleScreen();
  4496. }
  4497. welcomeScreenRaised = true;
  4498. }
  4499.  
  4500. public void drawSmoothLoading(int i, String s)
  4501. {
  4502. for(float f = LP; f < (float)i; f = (float)((double)f + 0.29999999999999999D))
  4503. drawLoadingText((int)f, s);
  4504.  
  4505. LP = i;
  4506. }
  4507.  
  4508. void drawLoadingText(int i, String s)
  4509. {
  4510. anInt1079 = i;
  4511. super.drawLoadingText(i, s);
  4512. aString1049 = s;
  4513. resetImageProducers();
  4514. if(titleStreamLoader == null) {
  4515. return;
  4516. }
  4517. loginScreenArea.initDrawingArea();
  4518. if (this.count == 0) {
  4519. localSprite1 = new Sprite(new StringBuilder().append("Background/BG ").append(this.backgroundCount).toString());
  4520. localSprite1.drawSprite(0, 0);
  4521. if (this.backgroundCount == 2)
  4522. this.backgroundCount = 0;
  4523. else
  4524. this.backgroundCount += 1;
  4525. }
  4526. if (this.count >= 150) {
  4527. this.opacityCount += 1;
  4528. localSprite1 = new Sprite(new StringBuilder().append("Background/BG ").append(this.backgroundCount).toString());
  4529. localSprite1.drawSpriteOpacity(0, 0, this.opacityCount);
  4530. }
  4531. if (this.count == 250) {
  4532. this.count = 0;
  4533. this.opacityCount = 0;
  4534. }
  4535. else {
  4536. this.count += 1;
  4537. }
  4538.  
  4539. loadingBarEmpty = new Sprite("Configuration/empty");
  4540. loadingBarFull = new Sprite("Configuration/full");
  4541. char c = '\u0168';
  4542. char c1 = '\310';
  4543. byte byte1 = 20;
  4544. int j = c1 / 2 - 18 - byte1;
  4545. loadingBarEmpty.drawSprite(220, 9);
  4546. loadingBarFull.drawSprite(286, 31);
  4547. DrawingArea.drawPixels(13, 31, (286 + i), 0x302e2c, (194 - i));
  4548. if (i == 194) {
  4549. smallText.drawText(0xffffff, s + " - 100%", 28, 385);
  4550. } else {
  4551. smallText.drawText(0xffffff, s + " - " + (i/2) + "%", 28, 385);
  4552. }
  4553. loginScreenArea.drawGraphics(0, super.graphics, 0);
  4554. if(welcomeScreenRaised) {
  4555. welcomeScreenRaised = false;
  4556. }
  4557. }
  4558.  
  4559.  
  4560. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  4561. int j1)
  4562. {
  4563. int anInt992;
  4564. if(aBoolean972)
  4565. anInt992 = 32;
  4566. else
  4567. anInt992 = 0;
  4568. aBoolean972 = false;
  4569. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  4570. {
  4571. class9.scrollPosition -= anInt1213 * 4;
  4572. if(flag)
  4573. {
  4574. needDrawTabArea = true;
  4575. }
  4576. } else
  4577. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  4578. {
  4579. class9.scrollPosition += anInt1213 * 4;
  4580. if(flag)
  4581. {
  4582. needDrawTabArea = true;
  4583. }
  4584. } else
  4585. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  4586. {
  4587. int l1 = ((j - 32) * j) / j1;
  4588. if(l1 < 8)
  4589. l1 = 8;
  4590. int i2 = l - i1 - 16 - l1 / 2;
  4591. int j2 = j - 32 - l1;
  4592. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4593. if(flag)
  4594. needDrawTabArea = true;
  4595. aBoolean972 = true;
  4596. }
  4597. }
  4598.  
  4599. private boolean method66(int i, int j, int k)
  4600. {
  4601. int i1 = i >> 14 & 0x7fff;
  4602. int j1 = worldController.method304(plane, k, j, i);
  4603. if(j1 == -1)
  4604. return false;
  4605. int k1 = j1 & 0x1f;
  4606. int l1 = j1 >> 6 & 3;
  4607. if(k1 == 10 || k1 == 11 || k1 == 22)
  4608. {
  4609. ObjectDef class46 = ObjectDef.forID(i1);
  4610. int i2;
  4611. int j2;
  4612. if(l1 == 0 || l1 == 2)
  4613. {
  4614. i2 = class46.anInt744;
  4615. j2 = class46.anInt761;
  4616. } else
  4617. {
  4618. i2 = class46.anInt761;
  4619. j2 = class46.anInt744;
  4620. }
  4621. int k2 = class46.anInt768;
  4622. if(l1 != 0)
  4623. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4624. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  4625. } else
  4626. {
  4627. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  4628. }
  4629. crossX = super.saveClickX;
  4630. crossY = super.saveClickY;
  4631. crossType = 2;
  4632. crossIndex = 0;
  4633. return true;
  4634. }
  4635.  
  4636. private NamedArchive streamLoaderForName(int i, String s, String s1, int j, int k)
  4637. {
  4638. byte abyte0[] = null;
  4639. int l = 5;
  4640. try
  4641. {
  4642. if(decompressors[0] != null) {
  4643. abyte0 = decompressors[0].decompress(i);
  4644. }
  4645. if(abyte0 == null)
  4646. {
  4647. drawSmoothLoading(16, "Connecting to fileserver");
  4648. new Update("http://dl.dropbox.com/u/55068279/CorruptionPVP.zip", "cache.zip", signlink.findcachedir());
  4649. abyte0 = decompressors[0].decompress(i);
  4650. }
  4651. } catch (Exception e) {
  4652. e.printStackTrace();
  4653. }
  4654. if(abyte0 != null)
  4655. {
  4656. NamedArchive archive = new NamedArchive(abyte0, s);
  4657. return archive;
  4658. }
  4659. while (true) {
  4660. drawLoadingText(0, "Error loading... Please report!");
  4661. try {
  4662. Thread.sleep(1000);
  4663. } catch (Exception e) {
  4664. e.printStackTrace();
  4665. }
  4666. }
  4667. }
  4668.  
  4669. private void dropClient()
  4670. {
  4671. if(anInt1011 > 0)
  4672. {
  4673. resetLogout();
  4674. return;
  4675. }
  4676. inGameScreen.initDrawingArea();
  4677. reestablish.drawSprite(8,9);
  4678. inGameScreen.drawGraphics(4, super.graphics, 4);
  4679. anInt1021 = 0;
  4680. destX = 0;
  4681. RSSocket rsSocket = socketStream;
  4682. loggedIn = false;
  4683. loginFailures = 0;
  4684. login(myUsername, myPassword, true);
  4685. if(!loggedIn)
  4686. resetLogout();
  4687. try
  4688. {
  4689. rsSocket.close();
  4690. }
  4691. catch(Exception _ex)
  4692. {
  4693. }
  4694. }
  4695.  
  4696. private void doAction(int i)
  4697. {
  4698. if(i < 0)
  4699. return;
  4700. if(inputDialogState != 0)
  4701. {
  4702. inputDialogState = 0;
  4703. inputTaken = true;
  4704. }
  4705. int j = menuActionCmd2[i];
  4706. int k = menuActionCmd3[i];
  4707. int l = menuActionID[i];
  4708. int i1 = menuActionCmd1[i];
  4709. if(l >= 2000)
  4710. l -= 2000;
  4711. if (l == 476) {
  4712. alertHandler.close();
  4713. }
  4714. if (l == 712) {
  4715. //Toggle
  4716. coinToggle = !coinToggle;
  4717. }
  4718. if (l == 713) {
  4719. //withdraw action
  4720. inputTaken = true;
  4721. messagePromptRaised = true;
  4722. amountOrNameInput = "";
  4723. inputDialogState = 0;
  4724. interfaceButtonAction = 557;
  4725. aString1121 = "Enter amount";
  4726. }
  4727. if (l == 714) {
  4728. //add examine option here
  4729. pushMessage("Your money pouch currently contains "+RSInterface.interfaceCache[8135].disabledMessage+" coins.", 0, "");
  4730. }
  4731. if (l == 715) {
  4732. //add price check action here
  4733. pushMessage("Coming Soon.", 0, "");
  4734. }
  4735. if(l == 582)
  4736. {
  4737. NPC npc = npcArray[i1];
  4738. if(npc != null)
  4739. {
  4740. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4741. crossX = super.saveClickX;
  4742. crossY = super.saveClickY;
  4743. crossType = 2;
  4744. crossIndex = 0;
  4745. stream.createFrame(57);
  4746. stream.method432(anInt1285);
  4747. stream.method432(i1);
  4748. stream.method431(anInt1283);
  4749. stream.method432(anInt1284);
  4750. }
  4751. }
  4752. if(l == 234)
  4753. {
  4754. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4755. if(!flag1)
  4756. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4757. crossX = super.saveClickX;
  4758. crossY = super.saveClickY;
  4759. crossType = 2;
  4760. crossIndex = 0;
  4761. stream.createFrame(236);
  4762. stream.method431(k + baseY);
  4763. stream.writeWord(i1);
  4764. stream.method431(j + baseX);
  4765. }
  4766. if(l == 62 && method66(i1, k, j))
  4767. {
  4768. stream.createFrame(192);
  4769. stream.writeWord(anInt1284);
  4770. stream.method431(i1 >> 14 & 0x7fff);
  4771. stream.method433(k + baseY);
  4772. stream.method431(anInt1283);
  4773. stream.method433(j + baseX);
  4774. stream.writeWord(anInt1285);
  4775. }
  4776. if (l == 477) {
  4777. minimapInt2 = (int)(Math.random() * 120D) - 60;
  4778. minimapInt3 = (int)(Math.random() * 30D) - 20;
  4779. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  4780. }
  4781. if(l == 511)
  4782. {
  4783. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4784. if(!flag2)
  4785. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4786. crossX = super.saveClickX;
  4787. crossY = super.saveClickY;
  4788. crossType = 2;
  4789. crossIndex = 0;
  4790. stream.createFrame(25);
  4791. stream.method431(anInt1284);
  4792. stream.method432(anInt1285);
  4793. stream.writeWord(i1);
  4794. stream.method432(k + baseY);
  4795. stream.method433(anInt1283);
  4796. stream.writeWord(j + baseX);
  4797. }
  4798. if(l == 74)
  4799. {
  4800. stream.createFrame(122);
  4801. stream.method433(k);
  4802. stream.method432(j);
  4803. stream.method431(i1);
  4804. atInventoryLoopCycle = 0;
  4805. atInventoryInterface = k;
  4806. atInventoryIndex = j;
  4807. atInventoryInterfaceType = 2;
  4808. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4809. atInventoryInterfaceType = 1;
  4810. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4811. atInventoryInterfaceType = 3;
  4812. }
  4813. /*if(is480 || is508 || is525) {
  4814. switch(l){
  4815. case 1014: setTab(13); setSidebarInterface(13, 29500); break;//harp
  4816. case 1013: setTab(12); setSidebarInterface(12, 147); break;//emotes
  4817. case 1012: setTab(11); setSidebarInterface(11, 904); break;//options
  4818. case 1010: setTab(9); setSidebarInterface(9, 5715); break;//ignore
  4819. case 1009: setTab(8); setSidebarInterface(8, 5065); break;//friend
  4820. case 1027: setTab(6); break;//spellbook
  4821. case 1026: setTab(5); break;//prayer
  4822. case 1030: setTab(4); setSidebarInterface(4, 1644); break;//worn
  4823. case 1024: setTab(3); setSidebarInterface(3, 3213); break;//inventory
  4824. case 1023: setTab(2); setSidebarInterface(2, 638); break;//quests
  4825. case 1022: setTab(1); setSidebarInterface(1, 3917); break;//stats
  4826. case 1021: setTab(0); break;//style
  4827. case 1008: setTab(10); setSidebarInterface(10, 18128); break;//logout new clan
  4828. case 1011: setTab(14); setSidebarInterface(14, 2449); break;//logout
  4829. case 1502: setTab(7); setSidebarInterface(7, 2449); break;//clan
  4830. }
  4831. } else {
  4832. switch(l){
  4833. case 1014: setTab(13); setSidebarInterface(13, 29500); break;//harp
  4834. case 1013: setTab(12); setSidebarInterface(12, 147); break;//emotes
  4835. case 1012: setTab(11); setSidebarInterface(11, 904); break;//options
  4836. case 1010: setTab(9); setSidebarInterface(9, 5715); break;//ignore
  4837. case 1009: setTab(8); setSidebarInterface(8, 5065); break;//friend
  4838. case 1027: setTab(6); break;//spellbook
  4839. case 1026: setTab(5); break;//prayer
  4840. case 1030: setTab(4); setSidebarInterface(4, 1644); break;//worn
  4841. case 1024: setTab(3); setSidebarInterface(3, 3213); break;//inventory
  4842. case 1023: setTab(2); setSidebarInterface(2, 638); break;//quests
  4843. case 1022: setTab(1); setSidebarInterface(1, 3917); break;//stats
  4844. case 1021: setTab(0); break;//style
  4845. case 1008: setTab(7); setSidebarInterface(7, 18128); break;
  4846. case 1011: setTab(10); setSidebarInterface(10, 2449); break;
  4847. }
  4848. }*/
  4849. switch(l){
  4850. case 1050:
  4851. runState = 1;
  4852. if(!runClicked) {
  4853. runClicked = true;
  4854. musicOrb = false;
  4855. restOrb = false;
  4856. stream.createFrame(185);
  4857. stream.writeWord(153);
  4858. } else {
  4859. runClicked = false;
  4860. stream.createFrame(185);
  4861. stream.writeWord(152);
  4862. }
  4863. break;
  4864. case 1500:
  4865. if(!prayClicked){
  4866. prayClicked = true;
  4867. } else {
  4868. prayClicked = false;
  4869. }
  4870. break;
  4871. case 1501:
  4872. runState = 2;
  4873. if(!musicOrb && restOrb){
  4874. musicOrb = true;
  4875. restOrb = false;
  4876. } else if(musicOrb && !restOrb){
  4877. musicOrb = false;
  4878. restOrb = true;
  4879. } else if(!musicOrb && !restOrb){
  4880. musicOrb =false;
  4881. restOrb = true;
  4882. }
  4883. break;
  4884. case 1503:
  4885. if(!drawXpBar) {
  4886. drawXpBar = true;
  4887. } else {
  4888. drawXpBar = false;
  4889. }
  4890. break;
  4891. case 1504:
  4892. testXp = 0;
  4893. break;
  4894. }
  4895. if (l == 315) {
  4896. System.out.println("sendPacket185("+k+")");
  4897. RSInterface class9 = RSInterface.interfaceCache[k];
  4898. boolean flag8 = true;
  4899. if (class9.contentType > 0)
  4900. flag8 = promptUserForInput(class9);
  4901. if (flag8) {
  4902.  
  4903. switch(k){
  4904. case 19144:
  4905. sendFrame248(15106,3213);
  4906. method60(15106);
  4907. inputTaken = true;
  4908. break;
  4909. case 27615:
  4910. setSidebarInterface(4, 1644);
  4911. break;
  4912. case 25843://arrow
  4913. setSidebarInterface(11, 24500);
  4914. break;
  4915. case 27610://return
  4916. setSidebarInterface(11, 904);
  4917. break;
  4918. case 27508://hp
  4919. sendFrame126("OFF", 27528);
  4920. if (hitbarToggle) {
  4921. hitbarToggle = false;
  4922. sendFrame126("OFF", 27528); sendFrame126("", 27524);
  4923. } else {
  4924. hitbarToggle = true;
  4925. sendFrame126("ON", 27524); sendFrame126("", 27528);
  4926. }
  4927. break;
  4928. case 27509://menu
  4929. sendFrame126("OFF", 27529);
  4930. if (menuToggle) {
  4931. menuToggle = false;
  4932. sendFrame126("OFF", 27529); sendFrame126("", 27525);
  4933. } else {
  4934. menuToggle = true;
  4935. sendFrame126("ON", 27525); sendFrame126("", 27529);
  4936. }
  4937. break;
  4938. case 27510://names
  4939. sendFrame126("OFF", 27530);
  4940. if (namesToggle) {
  4941. namesToggle = false;
  4942. sendFrame126("OFF", 27530); sendFrame126("", 27526);
  4943. } else {
  4944. namesToggle = true;
  4945. sendFrame126("ON", 27526); sendFrame126("", 27530);
  4946. }
  4947. break;
  4948. case 27532://gameframe
  4949. if(anInt1021 == 2) {
  4950. pushMessage("Switching gameframes is disabled while in barrows.", 0, "");
  4951. } else {
  4952. sendFrame126("459", 27531);
  4953. if(is459) {
  4954. is459 = false; is474 = true;
  4955. sendFrame126("474", 27536);
  4956. sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  4957. } else if(is474) {
  4958. is474 = false; is480 = true;
  4959. sendFrame126("483", 27536);
  4960. sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  4961. } else if (is480) {
  4962. is480 = false; is508 = true;
  4963. sendFrame126("508", 27537);
  4964. sendFrame126("", 27533); sendFrame126("", 27536); sendFrame126("", 27538); sendFrame126("", 27531);
  4965. } else if(is508) {
  4966. is508 = false; is525 = true;
  4967. sendFrame126("525", 27538);
  4968. sendFrame126("", 27536); sendFrame126("", 27537); sendFrame126("", 27533); sendFrame126("", 27531);
  4969. } else if(is525) {
  4970. is525 = false; is562 = true;
  4971. sendFrame126("562", 27536);
  4972. sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  4973. } else if(is562) {
  4974. is562 = false; is508 = false; is525 = false; is480 = false; is474 = false; is459 = true;
  4975. sendFrame126("", 27533); sendFrame126("", 27536); sendFrame126("", 27537); sendFrame126("", 27538);
  4976. sendFrame126("377", 27531);
  4977. }
  4978. }
  4979. break;
  4980. case 27606://x10
  4981. sendFrame126("OFF", 27605);
  4982. if (newDamage) {
  4983. newDamage = false;
  4984. sendFrame126("OFF", 27605);
  4985. sendFrame126("", 27604);
  4986. } else {
  4987. newDamage = true;
  4988. sendFrame126("ON", 27604);
  4989. sendFrame126("", 27605);
  4990. }
  4991. break;
  4992. case 27521://hitmarks
  4993. sendFrame126("OFF", 27603);
  4994. if (hitmarks) {
  4995. hitmarks = false;
  4996. sendFrame126("OFF", 27603);
  4997. sendFrame126("", 27602);
  4998. } else {
  4999. hitmarks = true;
  5000. sendFrame126("ON", 27602);
  5001. sendFrame126("", 27603);
  5002. }
  5003. break;
  5004. case 29156://achievement
  5005. setSidebarInterface(2, 29265);
  5006. break;
  5007. case 29267://Quest
  5008. setSidebarInterface(2, 638);
  5009. break;
  5010.  
  5011. default:
  5012. stream.createFrame(185);
  5013. stream.writeWord(k);
  5014. break;
  5015.  
  5016. }
  5017. }
  5018. }
  5019. if(l == 561)
  5020. {
  5021. Player player = playerArray[i1];
  5022. if(player != null)
  5023. {
  5024. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  5025. crossX = super.saveClickX;
  5026. crossY = super.saveClickY;
  5027. crossType = 2;
  5028. crossIndex = 0;
  5029. anInt1188 += i1;
  5030. if(anInt1188 >= 90)
  5031. {
  5032. stream.createFrame(136);
  5033. anInt1188 = 0;
  5034. }
  5035. stream.createFrame(128);
  5036. stream.writeWord(i1);
  5037. }
  5038. }
  5039. if(l == 20)
  5040. {
  5041. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  5042. if(class30_sub2_sub4_sub1_sub1_1 != null)
  5043. {
  5044. 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]);
  5045. crossX = super.saveClickX;
  5046. crossY = super.saveClickY;
  5047. crossType = 2;
  5048. crossIndex = 0;
  5049. stream.createFrame(155);
  5050. stream.method431(i1);
  5051. }
  5052. }
  5053. if(l == 779)
  5054. {
  5055. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  5056. if(class30_sub2_sub4_sub1_sub2_1 != null)
  5057. {
  5058. 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]);
  5059. crossX = super.saveClickX;
  5060. crossY = super.saveClickY;
  5061. crossType = 2;
  5062. crossIndex = 0;
  5063. stream.createFrame(153);
  5064. stream.method431(i1);
  5065. }
  5066. }
  5067. if(l == 516)
  5068. if(!menuOpen)
  5069. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  5070. else
  5071. worldController.method312(k - 4, j - 4);
  5072. if(l == 1062)
  5073. {
  5074. anInt924 += baseX;
  5075. if(anInt924 >= 113)
  5076. {
  5077. stream.createFrame(183);
  5078. stream.writeDWordBigEndian(0xe63271);
  5079. anInt924 = 0;
  5080. }
  5081. method66(i1, k, j);
  5082. stream.createFrame(228);
  5083. stream.method432(i1 >> 14 & 0x7fff);
  5084. stream.method432(k + baseY);
  5085. stream.writeWord(j + baseX);
  5086. }
  5087. if(l == 679 && !aBoolean1149)
  5088. {
  5089. stream.createFrame(40);
  5090. stream.writeWord(k);
  5091. aBoolean1149 = true;
  5092. }
  5093. if(l == 431)
  5094. {
  5095. stream.createFrame(129);
  5096. stream.method432(j);
  5097. stream.writeWord(k);
  5098. stream.method432(i1);
  5099. atInventoryLoopCycle = 0;
  5100. atInventoryInterface = k;
  5101. atInventoryIndex = j;
  5102. atInventoryInterfaceType = 2;
  5103. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5104. atInventoryInterfaceType = 1;
  5105. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5106. atInventoryInterfaceType = 3;
  5107. }
  5108. if(l == 337 || l == 42 || l == 792 || l == 322)
  5109. {
  5110. String s = menuActionName[i];
  5111. int k1 = s.indexOf("@whi@");
  5112. if(k1 != -1)
  5113. {
  5114. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  5115. if(l == 337)
  5116. addFriend(l3);
  5117. if(l == 42)
  5118. addIgnore(l3);
  5119. if(l == 792)
  5120. delFriend(l3);
  5121. if(l == 322)
  5122. delIgnore(l3);
  5123. }
  5124. }
  5125. if(l == 53)
  5126. {
  5127. stream.createFrame(135);
  5128. stream.method431(j);
  5129. stream.method432(k);
  5130. stream.method431(i1);
  5131. atInventoryLoopCycle = 0;
  5132. atInventoryInterface = k;
  5133. atInventoryIndex = j;
  5134. atInventoryInterfaceType = 2;
  5135. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5136. atInventoryInterfaceType = 1;
  5137. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5138. atInventoryInterfaceType = 3;
  5139. }
  5140. if(l == 539)
  5141. {
  5142. stream.createFrame(16);
  5143. stream.method432(i1);
  5144. stream.method433(j);
  5145. stream.method433(k);
  5146. atInventoryLoopCycle = 0;
  5147. atInventoryInterface = k;
  5148. atInventoryIndex = j;
  5149. atInventoryInterfaceType = 2;
  5150. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5151. atInventoryInterfaceType = 1;
  5152. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5153. atInventoryInterfaceType = 3;
  5154. }
  5155. if(l == 927) {
  5156. String s1 = menuActionName[i];
  5157. int l1 = s1.indexOf("@lre@");
  5158. s1 = s1.substring(l1 + 5).trim();
  5159. launchURL(s1);//Launches the URL in a web browser when clicked
  5160. }
  5161. if(l == 484 || l == 6)
  5162. {
  5163. String s1 = menuActionName[i];
  5164. int l1 = s1.indexOf("@whi@");
  5165. if(l1 != -1)
  5166. {
  5167. s1 = s1.substring(l1 + 5).trim();
  5168. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  5169. boolean flag9 = false;
  5170. for(int j3 = 0; j3 < playerCount; j3++)
  5171. {
  5172. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  5173. 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))
  5174. continue;
  5175. 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]);
  5176. if(l == 484)
  5177. {
  5178. stream.createFrame(139);
  5179. stream.method431(playerIndices[j3]);
  5180. }
  5181. if(l == 6)
  5182. {
  5183. anInt1188 += i1;
  5184. if(anInt1188 >= 90)
  5185. {
  5186. stream.createFrame(136);
  5187. anInt1188 = 0;
  5188. }
  5189. stream.createFrame(128);
  5190. stream.writeWord(playerIndices[j3]);
  5191. }
  5192. flag9 = true;
  5193. break;
  5194. }
  5195.  
  5196. if(!flag9)
  5197. pushMessage("Unable to find " + s7, 0, "");
  5198. }
  5199. }
  5200. if(l == 870)
  5201. {
  5202. stream.createFrame(53);
  5203. stream.writeWord(j);
  5204. stream.method432(anInt1283);
  5205. stream.method433(i1);
  5206. stream.writeWord(anInt1284);
  5207. stream.method431(anInt1285);
  5208. stream.writeWord(k);
  5209. atInventoryLoopCycle = 0;
  5210. atInventoryInterface = k;
  5211. atInventoryIndex = j;
  5212. atInventoryInterfaceType = 2;
  5213. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5214. atInventoryInterfaceType = 1;
  5215. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5216. atInventoryInterfaceType = 3;
  5217. }
  5218. if(l == 847)
  5219. {
  5220. stream.createFrame(87);
  5221. stream.method432(i1);
  5222. stream.writeWord(k);
  5223. stream.method432(j);
  5224. atInventoryLoopCycle = 0;
  5225. atInventoryInterface = k;
  5226. atInventoryIndex = j;
  5227. atInventoryInterfaceType = 2;
  5228. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5229. atInventoryInterfaceType = 1;
  5230. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5231. atInventoryInterfaceType = 3;
  5232. }
  5233. if(l == 626)
  5234. {
  5235. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5236. spellSelected = 1;
  5237. spellID = class9_1.id;
  5238. anInt1137 = k;
  5239. spellUsableOn = class9_1.spellUsableOn;
  5240. itemSelected = 0;
  5241. needDrawTabArea = true;
  5242. spellID = class9_1.id;
  5243. String s4 = class9_1.selectedActionName;
  5244. if(s4.indexOf(" ") != -1)
  5245. s4 = s4.substring(0, s4.indexOf(" "));
  5246. String s8 = class9_1.selectedActionName;
  5247. if(s8.indexOf(" ") != -1)
  5248. s8 = s8.substring(s8.indexOf(" ") + 1);
  5249. if(s8.equals("on")) s8 = "@whi@->";
  5250. spellTooltip = s4 + " " + "@gre@" + class9_1.spellName + " " + s8;
  5251.  
  5252. //spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  5253. //class9_1.disabledSprite.drawSprite(class9_1.xOffset, class9_1.yOffset, 0xffffff);
  5254. //class9_1.disabledSprite.drawSprite(200,200);
  5255. //System.out.println("Sprite: " + class9_1.disabledSprite.toString());
  5256. if(spellUsableOn == 16)
  5257. {
  5258. needDrawTabArea = true;
  5259. tabID = 3;
  5260. tabAreaAltered = true;
  5261. }
  5262. return;
  5263. }
  5264. if(l == 78)
  5265. {
  5266. stream.createFrame(117);
  5267. stream.method433(k);
  5268. stream.method433(i1);
  5269. stream.method431(j);
  5270. atInventoryLoopCycle = 0;
  5271. atInventoryInterface = k;
  5272. atInventoryIndex = j;
  5273. atInventoryInterfaceType = 2;
  5274. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5275. atInventoryInterfaceType = 1;
  5276. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5277. atInventoryInterfaceType = 3;
  5278. }
  5279. if(l == 27)
  5280. {
  5281. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  5282. if(class30_sub2_sub4_sub1_sub2_2 != null)
  5283. {
  5284. 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]);
  5285. crossX = super.saveClickX;
  5286. crossY = super.saveClickY;
  5287. crossType = 2;
  5288. crossIndex = 0;
  5289. anInt986 += i1;
  5290. if(anInt986 >= 54)
  5291. {
  5292. stream.createFrame(189);
  5293. stream.writeWordBigEndian(234);
  5294. anInt986 = 0;
  5295. }
  5296. stream.createFrame(73);
  5297. stream.method431(i1);
  5298. }
  5299. }
  5300.  
  5301.  
  5302.  
  5303. if(l == 213)
  5304. {
  5305. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5306. if(!flag3)
  5307. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5308. crossX = super.saveClickX;
  5309. crossY = super.saveClickY;
  5310. crossType = 2;
  5311. crossIndex = 0;
  5312. stream.createFrame(79);
  5313. stream.method431(k + baseY);
  5314. stream.writeWord(i1);
  5315. stream.method432(j + baseX);
  5316. }
  5317. if(l == 632)
  5318. {
  5319. stream.createFrame(145);
  5320. stream.method432(k);
  5321. stream.method432(j);
  5322. stream.method432(i1);
  5323. atInventoryLoopCycle = 0;
  5324. atInventoryInterface = k;
  5325. atInventoryIndex = j;
  5326. atInventoryInterfaceType = 2;
  5327. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5328. atInventoryInterfaceType = 1;
  5329. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5330. atInventoryInterfaceType = 3;
  5331. }
  5332. if(l == 1005) {
  5333. launchURL("WM.bat");
  5334. pushMessage("Loading worldmap.", 0, "");
  5335. }
  5336. if(l == 1004) {
  5337. if(tabInterfaceIDs[10] != -1) {
  5338. needDrawTabArea = true;
  5339. tabID = 10;
  5340. tabAreaAltered = true;
  5341. }
  5342. }
  5343. if(l == 1003) {
  5344. clanChatMode = 2;
  5345. aBoolean1233 = true;
  5346. inputTaken = true;
  5347. }
  5348. if(l == 1002) {
  5349. clanChatMode = 1;
  5350. aBoolean1233 = true;
  5351. inputTaken = true;
  5352. }
  5353. if(l == 1001) {
  5354. clanChatMode = 0;
  5355. aBoolean1233 = true;
  5356. inputTaken = true;
  5357. }
  5358. if(l == 1000) {
  5359. cButtonCPos = 4;
  5360. chatTypeView = 11;
  5361. aBoolean1233 = true;
  5362. inputTaken = true;
  5363. }
  5364. if(l == 999) {
  5365. cButtonCPos = 0;
  5366. chatTypeView = 0;
  5367. aBoolean1233 = true;
  5368. inputTaken = true;
  5369. }
  5370. if(l == 998) {
  5371. cButtonCPos = 1;
  5372. chatTypeView = 5;
  5373. aBoolean1233 = true;
  5374. inputTaken = true;
  5375. }
  5376. if(l == 997) {
  5377. publicChatMode = 3;
  5378. aBoolean1233 = true;
  5379. inputTaken = true;
  5380. }
  5381. if(l == 996) {
  5382. publicChatMode = 2;
  5383. aBoolean1233 = true;
  5384. inputTaken = true;
  5385. }
  5386. if(l == 995) {
  5387. publicChatMode = 1;
  5388. aBoolean1233 = true;
  5389. inputTaken = true;
  5390. }
  5391. if(l == 994) {
  5392. publicChatMode = 0;
  5393. aBoolean1233 = true;
  5394. inputTaken = true;
  5395. }
  5396. if(l == 993) {
  5397. cButtonCPos = 2;
  5398. chatTypeView = 1;
  5399. aBoolean1233 = true;
  5400. inputTaken = true;
  5401. }
  5402. if(l == 992) {
  5403. privateChatMode = 2;
  5404. aBoolean1233 = true;
  5405. inputTaken = true;
  5406. }
  5407. if(l == 991) {
  5408. privateChatMode = 1;
  5409. aBoolean1233 = true;
  5410. inputTaken = true;
  5411. }
  5412. if(l == 990) {
  5413. privateChatMode = 0;
  5414. aBoolean1233 = true;
  5415. inputTaken = true;
  5416. }
  5417. if(l == 989) {
  5418. cButtonCPos = 3;
  5419. chatTypeView = 2;
  5420. aBoolean1233 = true;
  5421. inputTaken = true;
  5422. }
  5423. if(l == 987) {
  5424. tradeMode = 2;
  5425. aBoolean1233 = true;
  5426. inputTaken = true;
  5427. }
  5428. if(l == 986) {
  5429. tradeMode = 1;
  5430. aBoolean1233 = true;
  5431. inputTaken = true;
  5432. }
  5433. if(l == 985) {
  5434. tradeMode = 0;
  5435. aBoolean1233 = true;
  5436. inputTaken = true;
  5437. }
  5438. if(l == 984) {
  5439. cButtonCPos = 5;
  5440. chatTypeView = 3;
  5441. aBoolean1233 = true;
  5442. inputTaken = true;
  5443. }
  5444. if(l == 983) {
  5445. duelMode = 2;
  5446. aBoolean1233 = true;
  5447. inputTaken = true;
  5448. }
  5449. if(l == 982) {
  5450. duelMode = 1;
  5451. aBoolean1233 = true;
  5452. inputTaken = true;
  5453. }
  5454. if(l == 981) {
  5455. duelMode = 0;
  5456. aBoolean1233 = true;
  5457. inputTaken = true;
  5458. }
  5459. if(l == 980) {
  5460. cButtonCPos = 6;
  5461. chatTypeView = 4;
  5462. aBoolean1233 = true;
  5463. inputTaken = true;
  5464. }
  5465. if(l == 493)
  5466. {
  5467. stream.createFrame(75);
  5468. stream.method433(k);
  5469. stream.method431(j);
  5470. stream.method432(i1);
  5471. atInventoryLoopCycle = 0;
  5472. atInventoryInterface = k;
  5473. atInventoryIndex = j;
  5474. atInventoryInterfaceType = 2;
  5475. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5476. atInventoryInterfaceType = 1;
  5477. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5478. atInventoryInterfaceType = 3;
  5479. }
  5480. if(l == 652)
  5481. {
  5482. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5483. if(!flag4)
  5484. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5485. crossX = super.saveClickX;
  5486. crossY = super.saveClickY;
  5487. crossType = 2;
  5488. crossIndex = 0;
  5489. stream.createFrame(156);
  5490. stream.method432(j + baseX);
  5491. stream.method431(k + baseY);
  5492. stream.method433(i1);
  5493. }
  5494. if(l == 94)
  5495. {
  5496. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5497. if(!flag5)
  5498. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5499. crossX = super.saveClickX;
  5500. crossY = super.saveClickY;
  5501. crossType = 2;
  5502. crossIndex = 0;
  5503. stream.createFrame(181);
  5504. stream.method431(k + baseY);
  5505. stream.writeWord(i1);
  5506. stream.method431(j + baseX);
  5507. stream.method432(anInt1137);
  5508. }
  5509. if(l == 646)
  5510. {
  5511. stream.createFrame(185);
  5512. stream.writeWord(k);
  5513. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5514. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  5515. {
  5516. int i2 = class9_2.valueIndexArray[0][1];
  5517. if(variousSettings[i2] != class9_2.requiredValues[0])
  5518. {
  5519. variousSettings[i2] = class9_2.requiredValues[0];
  5520. method33(i2);
  5521. needDrawTabArea = true;
  5522. }
  5523. }
  5524. }
  5525. if(l == 225)
  5526. {
  5527. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5528. if(class30_sub2_sub4_sub1_sub1_2 != null)
  5529. {
  5530. 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]);
  5531. crossX = super.saveClickX;
  5532. crossY = super.saveClickY;
  5533. crossType = 2;
  5534. crossIndex = 0;
  5535. anInt1226 += i1;
  5536. if(anInt1226 >= 85)
  5537. {
  5538. stream.createFrame(230);
  5539. stream.writeWordBigEndian(239);
  5540. anInt1226 = 0;
  5541. }
  5542. stream.createFrame(17);
  5543. stream.method433(i1);
  5544. }
  5545. }
  5546. if(l == 965)
  5547. {
  5548. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5549. if(class30_sub2_sub4_sub1_sub1_3 != null)
  5550. {
  5551. 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]);
  5552. crossX = super.saveClickX;
  5553. crossY = super.saveClickY;
  5554. crossType = 2;
  5555. crossIndex = 0;
  5556. anInt1134++;
  5557. if(anInt1134 >= 96)
  5558. {
  5559. stream.createFrame(152);
  5560. stream.writeWordBigEndian(88);
  5561. anInt1134 = 0;
  5562. }
  5563. stream.createFrame(21);
  5564. stream.writeWord(i1);
  5565. }
  5566. }
  5567. if(l == 413)
  5568. {
  5569. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5570. if(class30_sub2_sub4_sub1_sub1_4 != null)
  5571. {
  5572. 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]);
  5573. crossX = super.saveClickX;
  5574. crossY = super.saveClickY;
  5575. crossType = 2;
  5576. crossIndex = 0;
  5577. stream.createFrame(131);
  5578. stream.method433(i1);
  5579. stream.method432(anInt1137);
  5580. }
  5581. }
  5582. if(l == 200)
  5583. clearTopInterfaces();
  5584. if(l == 1025)
  5585. {
  5586. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5587. if(class30_sub2_sub4_sub1_sub1_5 != null)
  5588. {
  5589. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5590. if(entityDef.childrenIDs != null)
  5591. entityDef = entityDef.method161();
  5592. if(entityDef != null)
  5593. {
  5594. String s9;
  5595. if(entityDef.description != null)
  5596. s9 = new String(entityDef.description);
  5597. else
  5598. s9 = "It's a " + entityDef.name + ".";
  5599. pushMessage(s9, 0, "");
  5600. }
  5601. }
  5602. }
  5603. if(l == 900)
  5604. {
  5605. method66(i1, k, j);
  5606. stream.createFrame(252);
  5607. stream.method433(i1 >> 14 & 0x7fff);
  5608. stream.method431(k + baseY);
  5609. stream.method432(j + baseX);
  5610. }
  5611. if(l == 412)
  5612. {
  5613. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5614. if(class30_sub2_sub4_sub1_sub1_6 != null)
  5615. {
  5616. 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]);
  5617. crossX = super.saveClickX;
  5618. crossY = super.saveClickY;
  5619. crossType = 2;
  5620. crossIndex = 0;
  5621. stream.createFrame(72);
  5622. stream.method432(i1);
  5623. }
  5624. }
  5625. if(l == 365)
  5626. {
  5627. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5628. if(class30_sub2_sub4_sub1_sub2_3 != null)
  5629. {
  5630. 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]);
  5631. crossX = super.saveClickX;
  5632. crossY = super.saveClickY;
  5633. crossType = 2;
  5634. crossIndex = 0;
  5635. stream.createFrame(249);
  5636. stream.method432(i1);
  5637. stream.method431(anInt1137);
  5638. }
  5639. }
  5640. if(l == 729)
  5641. {
  5642. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5643. if(class30_sub2_sub4_sub1_sub2_4 != null)
  5644. {
  5645. 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]);
  5646. crossX = super.saveClickX;
  5647. crossY = super.saveClickY;
  5648. crossType = 2;
  5649. crossIndex = 0;
  5650. stream.createFrame(39);
  5651. stream.method431(i1);
  5652. }
  5653. }
  5654. if(l == 577)
  5655. {
  5656. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5657. if(class30_sub2_sub4_sub1_sub2_5 != null)
  5658. {
  5659. 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]);
  5660. crossX = super.saveClickX;
  5661. crossY = super.saveClickY;
  5662. crossType = 2;
  5663. crossIndex = 0;
  5664. stream.createFrame(139);
  5665. stream.method431(i1);
  5666. }
  5667. }
  5668. if(l == 956 && method66(i1, k, j))
  5669. {
  5670. stream.createFrame(35);
  5671. stream.method431(j + baseX);
  5672. stream.method432(anInt1137);
  5673. stream.method432(k + baseY);
  5674. stream.method431(i1 >> 14 & 0x7fff);
  5675. }
  5676. if(l == 567)
  5677. {
  5678. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5679. if(!flag6)
  5680. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5681. crossX = super.saveClickX;
  5682. crossY = super.saveClickY;
  5683. crossType = 2;
  5684. crossIndex = 0;
  5685. stream.createFrame(23);
  5686. stream.method431(k + baseY);
  5687. stream.method431(i1);
  5688. stream.method431(j + baseX);
  5689. }
  5690. if(l == 867)
  5691. {
  5692. if((i1 & 3) == 0)
  5693. anInt1175++;
  5694. if(anInt1175 >= 59)
  5695. {
  5696. stream.createFrame(200);
  5697. stream.writeWord(25501);
  5698. anInt1175 = 0;
  5699. }
  5700. stream.createFrame(43);
  5701. stream.method431(k);
  5702. stream.method432(i1);
  5703. stream.method432(j);
  5704. atInventoryLoopCycle = 0;
  5705. atInventoryInterface = k;
  5706. atInventoryIndex = j;
  5707. atInventoryInterfaceType = 2;
  5708. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5709. atInventoryInterfaceType = 1;
  5710. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5711. atInventoryInterfaceType = 3;
  5712. }
  5713. if(l == 543)
  5714. {
  5715. stream.createFrame(237);
  5716. stream.writeWord(j);
  5717. stream.method432(i1);
  5718. stream.writeWord(k);
  5719. stream.method432(anInt1137);
  5720. atInventoryLoopCycle = 0;
  5721. atInventoryInterface = k;
  5722. atInventoryIndex = j;
  5723. atInventoryInterfaceType = 2;
  5724. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5725. atInventoryInterfaceType = 1;
  5726. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5727. atInventoryInterfaceType = 3;
  5728. }
  5729. if(l == 606)
  5730. {
  5731. String s2 = menuActionName[i];
  5732. int j2 = s2.indexOf("@whi@");
  5733. if(j2 != -1)
  5734. if(openInterfaceID == -1)
  5735. {
  5736. clearTopInterfaces();
  5737. reportAbuseInput = s2.substring(j2 + 5).trim();
  5738. canMute = false;
  5739. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  5740. {
  5741. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  5742. continue;
  5743. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5744. break;
  5745. }
  5746.  
  5747. } else
  5748. {
  5749. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  5750. }
  5751. }
  5752. if(l == 491)
  5753. {
  5754. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5755. if(class30_sub2_sub4_sub1_sub2_6 != null)
  5756. {
  5757. 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]);
  5758. crossX = super.saveClickX;
  5759. crossY = super.saveClickY;
  5760. crossType = 2;
  5761. crossIndex = 0;
  5762. stream.createFrame(14);
  5763. stream.method432(anInt1284);
  5764. stream.writeWord(i1);
  5765. stream.writeWord(anInt1285);
  5766. stream.method431(anInt1283);
  5767. }
  5768. }
  5769. if(l == 639)
  5770. {
  5771. String s3 = menuActionName[i];
  5772. int k2 = s3.indexOf("@whi@");
  5773. if(k2 != -1)
  5774. {
  5775. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5776. int k3 = -1;
  5777. for(int i4 = 0; i4 < friendsCount; i4++)
  5778. {
  5779. if(friendsListAsLongs[i4] != l4)
  5780. continue;
  5781. k3 = i4;
  5782. break;
  5783. }
  5784.  
  5785. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  5786. {
  5787. inputTaken = true;
  5788. inputDialogState = 0;
  5789. messagePromptRaised = true;
  5790. promptInput = "";
  5791. friendsListAction = 3;
  5792. aLong953 = friendsListAsLongs[k3];
  5793. aString1121 = "Enter message to send to " + friendsList[k3];
  5794. }
  5795. }
  5796. }
  5797. if(l == 454)
  5798. {
  5799. stream.createFrame(41);
  5800. stream.writeWord(i1);
  5801. stream.method432(j);
  5802. stream.method432(k);
  5803. atInventoryLoopCycle = 0;
  5804. atInventoryInterface = k;
  5805. atInventoryIndex = j;
  5806. atInventoryInterfaceType = 2;
  5807. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5808. atInventoryInterfaceType = 1;
  5809. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5810. atInventoryInterfaceType = 3;
  5811. }
  5812. if(l == 478)
  5813. {
  5814. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5815. if(class30_sub2_sub4_sub1_sub1_7 != null)
  5816. {
  5817. 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]);
  5818. crossX = super.saveClickX;
  5819. crossY = super.saveClickY;
  5820. crossType = 2;
  5821. crossIndex = 0;
  5822. if((i1 & 3) == 0)
  5823. anInt1155++;
  5824. if(anInt1155 >= 53)
  5825. {
  5826. stream.createFrame(85);
  5827. stream.writeWordBigEndian(66);
  5828. anInt1155 = 0;
  5829. }
  5830. stream.createFrame(18);
  5831. stream.method431(i1);
  5832. }
  5833. }
  5834. if(l == 113)
  5835. {
  5836. method66(i1, k, j);
  5837. stream.createFrame(70);
  5838. stream.method431(j + baseX);
  5839. stream.writeWord(k + baseY);
  5840. stream.method433(i1 >> 14 & 0x7fff);
  5841. }
  5842. if(l == 872)
  5843. {
  5844. method66(i1, k, j);
  5845. stream.createFrame(234);
  5846. stream.method433(j + baseX);
  5847. stream.method432(i1 >> 14 & 0x7fff);
  5848. stream.method433(k + baseY);
  5849. }
  5850. if(l == 502)
  5851. {
  5852. method66(i1, k, j);
  5853. stream.createFrame(132);
  5854. stream.method433(j + baseX);
  5855. stream.writeWord(i1 >> 14 & 0x7fff);
  5856. stream.method432(k + baseY);
  5857. }
  5858. if(l == 1125)
  5859. {
  5860. atInventoryLoopCycle = 0;
  5861. atInventoryInterface = k;
  5862. atInventoryIndex = j;
  5863. atInventoryInterfaceType = 2;
  5864. ItemDef itemDef = ItemDef.forID(i1);
  5865. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5866. String s5;
  5867. if(class9_4 != null && class9_4.inventoryValue[j] >= 0x186a0)
  5868. s5 = class9_4.inventoryValue[j] + " x " + itemDef.name;
  5869. else
  5870. if(itemDef.description != null)
  5871. s5 = new String(itemDef.description);
  5872. else
  5873. s5 = "It's a " + itemDef.name + ".";
  5874. pushMessage(s5, 0, "");
  5875. }
  5876. if(l == 169)
  5877. {
  5878. stream.createFrame(185);
  5879. stream.writeWord(k);
  5880. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5881. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  5882. {
  5883. int l2 = class9_3.valueIndexArray[0][1];
  5884. variousSettings[l2] = 1 - variousSettings[l2];
  5885. method33(l2);
  5886. needDrawTabArea = true;
  5887. }
  5888. }
  5889. if(l == 447)
  5890. {
  5891. itemSelected = 1;
  5892. anInt1283 = j;
  5893. anInt1284 = k;
  5894. anInt1285 = i1;
  5895. selectedItemName = ItemDef.forID(i1).name;
  5896. spellSelected = 0;
  5897. needDrawTabArea = true;
  5898. return;
  5899. }
  5900. if(l == 1226)
  5901. {
  5902. int j1 = i1 >> 14 & 0x7fff;
  5903. ObjectDef class46 = ObjectDef.forID(j1);
  5904. String s10;
  5905. if(class46.description != null)
  5906. s10 = new String(class46.description);
  5907. else
  5908. s10 = "It's a " + class46.name + ".";
  5909. pushMessage(s10, 0, "");
  5910. }
  5911. if(l == 244)
  5912. {
  5913. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5914. if(!flag7)
  5915. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5916. crossX = super.saveClickX;
  5917. crossY = super.saveClickY;
  5918. crossType = 2;
  5919. crossIndex = 0;
  5920. stream.createFrame(253);
  5921. stream.method431(j + baseX);
  5922. stream.method433(k + baseY);
  5923. stream.method432(i1);
  5924. }
  5925. if(l == 1448)
  5926. {
  5927. ItemDef itemDef_1 = ItemDef.forID(i1);
  5928. String s6;
  5929. if(itemDef_1.description != null)
  5930. s6 = new String(itemDef_1.description);
  5931. else
  5932. s6 = "It's a " + itemDef_1.name + ".";
  5933. pushMessage(s6, 0, "");
  5934. }
  5935. itemSelected = 0;
  5936. spellSelected = 0;
  5937. needDrawTabArea = true;
  5938.  
  5939. }
  5940.  
  5941. private void method70()
  5942. {
  5943. anInt1251 = 0;
  5944. int j = (myPlayer.x >> 7) + baseX;
  5945. int k = (myPlayer.y >> 7) + baseY;
  5946. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5947. anInt1251 = 1;
  5948. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5949. anInt1251 = 1;
  5950. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5951. anInt1251 = 0;
  5952. }
  5953.  
  5954. public void run() {
  5955.  
  5956. if(drawFlames) {
  5957. drawFlames();
  5958. } else {
  5959. super.run();
  5960. }
  5961. }
  5962.  
  5963. private void build3dScreenMenu()
  5964. {
  5965. if(itemSelected == 0 && spellSelected == 0)
  5966. {
  5967. menuActionName[menuActionRow] = "Walk here";
  5968. menuActionID[menuActionRow] = 516;
  5969. menuActionCmd2[menuActionRow] = super.mouseX;
  5970. menuActionCmd3[menuActionRow] = super.mouseY;
  5971. menuActionRow++;
  5972. }
  5973. int j = -1;
  5974. for(int k = 0; k < Model.anInt1687; k++)
  5975. {
  5976. int l = Model.anIntArray1688[k];
  5977. int i1 = l & 0x7f;
  5978. int j1 = l >> 7 & 0x7f;
  5979. int k1 = l >> 29 & 3;
  5980. int l1 = l >> 14 & 0x7fff;
  5981. if(l == j)
  5982. continue;
  5983. j = l;
  5984. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  5985. {
  5986. ObjectDef class46 = ObjectDef.forID(l1);
  5987. if(class46.childrenIDs != null)
  5988. class46 = class46.method580();
  5989. if(class46 == null)
  5990. continue;
  5991. if(itemSelected == 1)
  5992. {
  5993. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  5994. menuActionID[menuActionRow] = 62;
  5995. menuActionCmd1[menuActionRow] = l;
  5996. menuActionCmd2[menuActionRow] = i1;
  5997. menuActionCmd3[menuActionRow] = j1;
  5998. menuActionRow++;
  5999. } else
  6000. if(spellSelected == 1)
  6001. {
  6002. if((spellUsableOn & 4) == 4)
  6003. {
  6004. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  6005. menuActionID[menuActionRow] = 956;
  6006. menuActionCmd1[menuActionRow] = l;
  6007. menuActionCmd2[menuActionRow] = i1;
  6008. menuActionCmd3[menuActionRow] = j1;
  6009. menuActionRow++;
  6010. }
  6011. } else
  6012. {
  6013. if(class46.itemActions != null)
  6014. {
  6015. for(int i2 = 4; i2 >= 0; i2--)
  6016. if(class46.itemActions[i2] != null)
  6017. {
  6018. menuActionName[menuActionRow] = class46.itemActions[i2] + " @cya@" + class46.name;
  6019. if(i2 == 0)
  6020. menuActionID[menuActionRow] = 502;
  6021. if(i2 == 1)
  6022. menuActionID[menuActionRow] = 900;
  6023. if(i2 == 2)
  6024. menuActionID[menuActionRow] = 113;
  6025. if(i2 == 3)
  6026. menuActionID[menuActionRow] = 872;
  6027. if(i2 == 4)
  6028. menuActionID[menuActionRow] = 1062;
  6029. menuActionCmd1[menuActionRow] = l;
  6030. menuActionCmd2[menuActionRow] = i1;
  6031. menuActionCmd3[menuActionRow] = j1;
  6032. menuActionRow++;
  6033. }
  6034.  
  6035. }
  6036. if(idToggle == true) {
  6037. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  6038. } else {
  6039. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  6040. }
  6041. menuActionID[menuActionRow] = 1226;
  6042. menuActionCmd1[menuActionRow] = class46.type << 14;
  6043. menuActionCmd2[menuActionRow] = i1;
  6044. menuActionCmd3[menuActionRow] = j1;
  6045. menuActionRow++;
  6046. }
  6047. }
  6048. if(k1 == 1)
  6049. {
  6050. NPC npc = npcArray[l1];
  6051. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  6052. {
  6053. for(int j2 = 0; j2 < npcCount; j2++)
  6054. {
  6055. NPC npc2 = npcArray[npcIndices[j2]];
  6056. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  6057. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  6058. }
  6059.  
  6060. for(int l2 = 0; l2 < playerCount; l2++)
  6061. {
  6062. Player player = playerArray[playerIndices[l2]];
  6063. if(player != null && player.x == npc.x && player.y == npc.y)
  6064. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  6065. }
  6066.  
  6067. }
  6068. buildAtNPCMenu(npc.desc, l1, j1, i1);
  6069. }
  6070. if(k1 == 0)
  6071. {
  6072. Player player = playerArray[l1];
  6073. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  6074. {
  6075. for(int k2 = 0; k2 < npcCount; k2++)
  6076. {
  6077. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  6078. 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)
  6079. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  6080. }
  6081.  
  6082. for(int i3 = 0; i3 < playerCount; i3++)
  6083. {
  6084. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  6085. 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)
  6086. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  6087. }
  6088.  
  6089. }
  6090. buildAtPlayerMenu(i1, l1, player, j1);
  6091. }
  6092. if(k1 == 3)
  6093. {
  6094. NodeList class19 = groundArray[plane][i1][j1];
  6095. if(class19 != null)
  6096. {
  6097. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  6098. {
  6099. ItemDef itemDef = ItemDef.forID(item.ID);
  6100. if(itemSelected == 1)
  6101. {
  6102. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  6103. menuActionID[menuActionRow] = 511;
  6104. menuActionCmd1[menuActionRow] = item.ID;
  6105. menuActionCmd2[menuActionRow] = i1;
  6106. menuActionCmd3[menuActionRow] = j1;
  6107. menuActionRow++;
  6108. } else
  6109. if(spellSelected == 1)
  6110. {
  6111. if((spellUsableOn & 1) == 1)
  6112. {
  6113. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  6114. menuActionID[menuActionRow] = 94;
  6115. menuActionCmd1[menuActionRow] = item.ID;
  6116. menuActionCmd2[menuActionRow] = i1;
  6117. menuActionCmd3[menuActionRow] = j1;
  6118. menuActionRow++;
  6119. }
  6120. } else
  6121. {
  6122. for(int j3 = 4; j3 >= 0; j3--)
  6123. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  6124. {
  6125. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  6126. if(j3 == 0)
  6127. menuActionID[menuActionRow] = 652;
  6128. if(j3 == 1)
  6129. menuActionID[menuActionRow] = 567;
  6130. if(j3 == 2)
  6131. menuActionID[menuActionRow] = 234;
  6132. if(j3 == 3)
  6133. menuActionID[menuActionRow] = 244;
  6134. if(j3 == 4)
  6135. menuActionID[menuActionRow] = 213;
  6136. menuActionCmd1[menuActionRow] = item.ID;
  6137. menuActionCmd2[menuActionRow] = i1;
  6138. menuActionCmd3[menuActionRow] = j1;
  6139. menuActionRow++;
  6140. } else
  6141. if(j3 == 2)
  6142. {
  6143. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  6144. menuActionID[menuActionRow] = 234;
  6145. menuActionCmd1[menuActionRow] = item.ID;
  6146. menuActionCmd2[menuActionRow] = i1;
  6147. menuActionCmd3[menuActionRow] = j1;
  6148. menuActionRow++;
  6149. }
  6150. if(idToggle == true) {
  6151. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  6152. } else {
  6153. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  6154. }
  6155. menuActionID[menuActionRow] = 1448;
  6156. menuActionCmd1[menuActionRow] = item.ID;
  6157. menuActionCmd2[menuActionRow] = i1;
  6158. menuActionCmd3[menuActionRow] = j1;
  6159. menuActionRow++;
  6160. }
  6161. }
  6162.  
  6163. }
  6164. }
  6165. }
  6166. }
  6167.  
  6168. public void cleanUpForQuit()
  6169. {
  6170. signlink.reporterror = false;
  6171. try
  6172. {
  6173. if(socketStream != null)
  6174. socketStream.close();
  6175. System.out.println("Here6");
  6176. }
  6177. catch(Exception _ex) { }
  6178. socketStream = null;
  6179. stopMidi();
  6180. if(mouseDetection != null)
  6181. mouseDetection.running = false;
  6182. mouseDetection = null;
  6183. onDemandFetcher.disable();
  6184. onDemandFetcher = null;
  6185. aStream_834 = null;
  6186. stream = null;
  6187. aStream_847 = null;
  6188. inStream = null;
  6189. anIntArray1234 = null;
  6190. aByteArrayArray1183 = null;
  6191. aByteArrayArray1247 = null;
  6192. anIntArray1235 = null;
  6193. anIntArray1236 = null;
  6194. intGroundArray = null;
  6195. byteGroundArray = null;
  6196. worldController = null;
  6197. aClass11Array1230 = null;
  6198. anIntArrayArray901 = null;
  6199. anIntArrayArray825 = null;
  6200. bigX = null;
  6201. bigY = null;
  6202. aByteArray912 = null;
  6203. inventoryBackImage = null;
  6204. mapEdgeIP = null;
  6205. leftFrame = null;
  6206. topFrame = null;
  6207. rightFrame = null;
  6208. mapBackImage = null;
  6209. inGameScreen = null;
  6210. chatBackImage = null;
  6211. //aRSImageProducer_1123 = null;
  6212. aRSImageProducer_1124 = null;
  6213. aRSImageProducer_1125 = null;
  6214. /* Null pointers for custom sprites */
  6215.  
  6216. alertBack = null;
  6217. alertBorder = null;
  6218. alertBorderH = null;
  6219. chatArea = null;
  6220. loadingPleaseWait = null;
  6221. reestablish = null;
  6222. backgroundFix = null;
  6223. loadingBarFull = null;
  6224. loadingBarEmpty = null;
  6225. chatButtons = null;
  6226. tabArea = null;
  6227. mapArea = null;
  6228. HPBarFull = null;
  6229. HPBarEmpty = null;
  6230. magicAuto = null;
  6231. tabHover = null;
  6232. tabClicked = null;
  6233. newSideIcons = null;
  6234. /**/
  6235. mapBack = null;
  6236. CustomMapback = null;
  6237.  
  6238. sideIcons = null;
  6239. sIcons483 = null;
  6240. sIcons459 = null;
  6241.  
  6242. redStones = null;
  6243. compass = null;
  6244. hitMarks = null;
  6245. hitMark = null;
  6246. headIcons = null;
  6247. skullIcons = null;
  6248. headIconsHint = null;
  6249. crosses = null;
  6250. mapDotItem = null;
  6251. mapDotNPC = null;
  6252. mapDotPlayer = null;
  6253. mapDotFriend = null;
  6254. mapDotTeam = null;
  6255. mapScenes = null;
  6256. mapFunctions = null;
  6257. anIntArrayArray929 = null;
  6258. playerArray = null;
  6259. playerIndices = null;
  6260. anIntArray894 = null;
  6261. aStreamArray895s = null;
  6262. anIntArray840 = null;
  6263. npcArray = null;
  6264. npcIndices = null;
  6265. groundArray = null;
  6266. aClass19_1179 = null;
  6267. aClass19_1013 = null;
  6268. aClass19_1056 = null;
  6269. menuActionCmd2 = null;
  6270. menuActionCmd3 = null;
  6271. menuActionID = null;
  6272. menuActionCmd1 = null;
  6273. menuActionName = null;
  6274. variousSettings = null;
  6275. anIntArray1072 = null;
  6276. anIntArray1073 = null;
  6277. aSpriteArray1140 = null;
  6278. aSprite_1263 = null;
  6279. friendsList = null;
  6280. friendsListAsLongs = null;
  6281. friendsNodeIDs = null;
  6282. leftSideFlame = null;
  6283. rightSideFlame = null;
  6284. aRSImageProducer_1107 = null;
  6285. aRSImageProducer_1108 = null;
  6286. loginScreenArea = null;
  6287. gameLogo = null;
  6288. aRSImageProducer_1113 = null;
  6289. aRSImageProducer_1114 = null;
  6290. aRSImageProducer_1115 = null;
  6291. multiOverlay = null;
  6292. nullLoader();
  6293. ObjectDef.nullLoader();
  6294. EntityDef.nullLoader();
  6295. ItemDef.nullLoader();
  6296. Flo.cache = null;
  6297. IdentityKit.cache = null;
  6298. RSInterface.interfaceCache = null;
  6299. DummyClass.cache = null;
  6300. Animation.anims = null;
  6301. SpotAnim.cache = null;
  6302. SpotAnim.aMRUNodes_415 = null;
  6303. Varp.cache = null;
  6304. super.fullGameScreen = null;
  6305. Player.mruNodes = null;
  6306. Texture.nullLoader();
  6307. WorldController.nullLoader();
  6308. Model.nullLoader();
  6309. Class36.nullLoader();
  6310. System.gc();
  6311. }
  6312.  
  6313. private void printDebug()
  6314. {
  6315. System.out.println("============");
  6316. System.out.println("flame-cycle:" + anInt1208);
  6317. if(onDemandFetcher != null)
  6318. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  6319. System.out.println("loop-cycle:" + loopCycle);
  6320. System.out.println("draw-cycle:" + anInt1061);
  6321. System.out.println("ptype:" + pktType);
  6322. System.out.println("psize:" + pktSize);
  6323. if(socketStream != null)
  6324. socketStream.printDebug();
  6325. super.shouldDebug = true;
  6326. }
  6327.  
  6328. Component getGameComponent() {
  6329.  
  6330.  
  6331. if(signlink.mainapp != null)
  6332. return signlink.mainapp;
  6333. if(super.gameFrame != null)
  6334. return super.gameFrame;
  6335. else
  6336. return this;
  6337. }
  6338.  
  6339. private void method73() {
  6340. do {
  6341. int j = readChar(-796);
  6342. if(j == -1)
  6343. break;
  6344. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  6345. if(j == 8 && reportAbuseInput.length() > 0)
  6346. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  6347. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  6348. reportAbuseInput += (char)j;
  6349. } else if(messagePromptRaised) {
  6350. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  6351. promptInput += (char)j;
  6352. inputTaken = true;
  6353. }
  6354. if(j == 8 && promptInput.length() > 0) {
  6355. promptInput = promptInput.substring(0, promptInput.length() - 1);
  6356. inputTaken = true;
  6357. }
  6358. if(j == 13 || j == 10) {
  6359. messagePromptRaised = false;
  6360. inputTaken = true;
  6361. if(friendsListAction == 1) {
  6362. long l = TextClass.longForName(promptInput);
  6363. addFriend(l);
  6364. }
  6365. if(friendsListAction == 2 && friendsCount > 0) {
  6366. long l1 = TextClass.longForName(promptInput);
  6367. delFriend(l1);
  6368. }
  6369. if(interfaceButtonAction == 557 && promptInput.length() > 0) {
  6370. inputString = "::withdraw "+promptInput;
  6371. sendPacket(103);
  6372. }
  6373. if(friendsListAction == 3 && promptInput.length() > 0) {
  6374. stream.createFrame(126);
  6375. stream.writeWordBigEndian(0);
  6376. int k = stream.currentOffset;
  6377. stream.writeQWord(aLong953);
  6378. TextInput.method526(promptInput, stream);
  6379. stream.writeBytes(stream.currentOffset - k);
  6380. promptInput = TextInput.processText(promptInput);
  6381. //promptInput = Censor.doCensor(promptInput);
  6382. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  6383. if(privateChatMode == 2) {
  6384. privateChatMode = 1;
  6385. aBoolean1233 = true;
  6386. stream.createFrame(95);
  6387. stream.writeWordBigEndian(publicChatMode);
  6388. stream.writeWordBigEndian(privateChatMode);
  6389. stream.writeWordBigEndian(tradeMode);
  6390. }
  6391. }
  6392. if(friendsListAction == 4 && ignoreCount < 100) {
  6393. long l2 = TextClass.longForName(promptInput);
  6394. addIgnore(l2);
  6395. }
  6396. if(friendsListAction == 5 && ignoreCount > 0) {
  6397. long l3 = TextClass.longForName(promptInput);
  6398. delIgnore(l3);
  6399. }
  6400. if(friendsListAction == 6) {
  6401. long l3 = TextClass.longForName(promptInput);
  6402. chatJoin(l3);
  6403. }
  6404. }
  6405. } else if(inputDialogState == 1) {
  6406. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6407. amountOrNameInput += (char)j;
  6408. inputTaken = true;
  6409. }
  6410. if(j == 8 && amountOrNameInput.length() > 0) {
  6411. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6412. inputTaken = true;
  6413. }
  6414. if(j == 13 || j == 10) {
  6415. if(amountOrNameInput.length() > 0) {
  6416. int i1 = 0;
  6417. try {
  6418. i1 = Integer.parseInt(amountOrNameInput);
  6419. }
  6420. catch(Exception _ex) { }
  6421. stream.createFrame(208);
  6422. stream.writeDWord(i1);
  6423. }
  6424. inputDialogState = 0;
  6425. inputTaken = true;
  6426. }
  6427. } else if(inputDialogState == 2) {
  6428. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6429. amountOrNameInput += (char)j;
  6430. inputTaken = true;
  6431. }
  6432. if(j == 8 && amountOrNameInput.length() > 0) {
  6433. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6434. inputTaken = true;
  6435. }
  6436. if(j == 13 || j == 10) {
  6437. if(amountOrNameInput.length() > 0) {
  6438. stream.createFrame(60);
  6439. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  6440. }
  6441. inputDialogState = 0;
  6442. inputTaken = true;
  6443. }
  6444. } else if(backDialogID == -1) {
  6445. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  6446. inputString += (char)j;
  6447. inputTaken = true;
  6448. }
  6449. if(j == 8 && inputString.length() > 0) {
  6450. inputString = inputString.substring(0, inputString.length() - 1);
  6451. inputTaken = true;
  6452. }
  6453. if((j == 13 || j == 10) && inputString.length() > 0) {
  6454.  
  6455. if(myPrivilege >= 2 || server.equals("Corruptionpvp.no-ip.org") || 1 == 1) {
  6456. if(inputString.equals("region")) {
  6457. System.out.println("Current region: " + anInt1069 + ", " + anInt1070);
  6458. }
  6459. //17511 = Question Type
  6460. //15819 = Christmas Type
  6461. //15812 = Security Type
  6462. //15801 = Item Scam Type
  6463. //15791 = Password Safety ?
  6464. //15774 = Good/Bad Password
  6465. //15767 = Drama Type ????
  6466. }
  6467.  
  6468. if(inputString.equals("::fpson"))
  6469. fpsOn = true;
  6470. if(inputString.equals("::fpsoff"))
  6471. fpsOn = false;
  6472. if(inputString.equals("::dataon"))
  6473. clientData = true;
  6474. if(inputString.equals("::dataoff"))
  6475. clientData = false;
  6476. if(inputString.equals("::vote") || inputString.equals("::Vote") || inputString.equals("::VOTE"))
  6477. launchURL("www");
  6478. if(inputString.equals("::register") || inputString.equals("::Register") || inputString.equals("::REGISTER"))
  6479. launchURL("www");
  6480. if(inputString.startsWith("/"))
  6481. inputString = "::" + inputString;
  6482. if(inputString.startsWith("::")) {
  6483. stream.createFrame(103);
  6484. stream.writeWordBigEndian(inputString.length() - 1);
  6485. stream.writeString(inputString.substring(2));
  6486. } else {
  6487. String s = inputString.toLowerCase();
  6488. int j2 = 0;
  6489. if(s.startsWith("yellow:"))
  6490. {
  6491. j2 = 0;
  6492. inputString = inputString.substring(7);
  6493. } else if(s.startsWith("red:"))
  6494. {
  6495. j2 = 1;
  6496. inputString = inputString.substring(4);
  6497. } else if(s.startsWith("green:"))
  6498. {
  6499. j2 = 2;
  6500. inputString = inputString.substring(6);
  6501. } else if(s.startsWith("cyan:"))
  6502. {
  6503. j2 = 3;
  6504. inputString = inputString.substring(5);
  6505. } else if(s.startsWith("purple:"))
  6506. {
  6507. j2 = 4;
  6508. inputString = inputString.substring(7);
  6509. } else if(s.startsWith("white:"))
  6510. {
  6511. j2 = 5;
  6512. inputString = inputString.substring(6);
  6513. } else if(s.startsWith("flash1:"))
  6514. {
  6515. j2 = 6;
  6516. inputString = inputString.substring(7);
  6517. } else if(s.startsWith("flash2:"))
  6518. {
  6519. j2 = 7;
  6520. inputString = inputString.substring(7);
  6521. } else if(s.startsWith("flash3:"))
  6522. {
  6523. j2 = 8;
  6524. inputString = inputString.substring(7);
  6525. } else if(s.startsWith("glow1:"))
  6526. {
  6527. j2 = 9;
  6528. inputString = inputString.substring(6);
  6529. } else if(s.startsWith("glow2:"))
  6530. {
  6531. j2 = 10;
  6532. inputString = inputString.substring(6);
  6533. } else if(s.startsWith("glow3:"))
  6534. {
  6535. j2 = 11;
  6536. inputString = inputString.substring(6);
  6537. }
  6538. s = inputString.toLowerCase();
  6539. int i3 = 0;
  6540. if(s.startsWith("wave:"))
  6541. {
  6542. i3 = 1;
  6543. inputString = inputString.substring(5);
  6544. } else if(s.startsWith("wave2:"))
  6545. {
  6546. i3 = 2;
  6547. inputString = inputString.substring(6);
  6548. } else if(s.startsWith("shake:"))
  6549. {
  6550. i3 = 3;
  6551. inputString = inputString.substring(6);
  6552. } else if(s.startsWith("scroll:"))
  6553. {
  6554. i3 = 4;
  6555. inputString = inputString.substring(7);
  6556. } else if(s.startsWith("slide:"))
  6557. {
  6558. i3 = 5;
  6559. inputString = inputString.substring(6);
  6560. }
  6561. stream.createFrame(4);
  6562. stream.writeWordBigEndian(0);
  6563. int j3 = stream.currentOffset;
  6564. stream.method425(i3);
  6565. stream.method425(j2);
  6566. aStream_834.currentOffset = 0;
  6567. TextInput.method526(inputString, aStream_834);
  6568. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  6569. stream.writeBytes(stream.currentOffset - j3);
  6570. inputString = TextInput.processText(inputString);
  6571. //inputString = Censor.doCensor(inputString);
  6572. myPlayer.textSpoken = inputString;
  6573. myPlayer.anInt1513 = j2;
  6574. myPlayer.anInt1531 = i3;
  6575. myPlayer.textCycle = 150;
  6576. //My players icons showing up when I speak
  6577. if(myPrivilege == 4) {
  6578. pushMessage(myPlayer.textSpoken, 2, "@cr0@" + "<col=13132800>"+getRank(myPlayer.skill)+"</col>" + myPlayer.name);
  6579. } else if(myPrivilege == 3) {
  6580. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + "<col=13132800>"+getRank(myPlayer.skill)+"</col>" + myPlayer.name);
  6581. } else if(myPrivilege == 2) {
  6582. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + "<col=13132800>"+getRank(myPlayer.skill)+"</col>" + myPlayer.name);
  6583. } else if(myPrivilege == 1) {
  6584. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + "<col=13132800>"+getRank(myPlayer.skill)+"</col>" + myPlayer.name);
  6585. } else {
  6586. pushMessage(myPlayer.textSpoken, 2, "<col=13132800>"+getRank(myPlayer.skill)+"</col>" + myPlayer.name);
  6587. }
  6588. if(publicChatMode == 2)
  6589. {
  6590. publicChatMode = 3;
  6591. aBoolean1233 = true;
  6592. stream.createFrame(95);
  6593. stream.writeWordBigEndian(publicChatMode);
  6594. stream.writeWordBigEndian(privateChatMode);
  6595. stream.writeWordBigEndian(tradeMode);
  6596. }
  6597. }
  6598. inputString = "";
  6599. inputTaken = true;
  6600. }
  6601. }
  6602. } while(true);
  6603. }
  6604.  
  6605. private void buildPublicChat(int j)
  6606. {
  6607. int l = 0;
  6608. for(int i1 = 0; i1 < 500; i1++)
  6609. {
  6610. if(chatMessages[i1] == null)
  6611. continue;
  6612. if(chatTypeView != 1)
  6613. continue;
  6614. int j1 = chatTypes[i1];
  6615. String s = chatNames[i1];
  6616. String ct = chatMessages[i1];
  6617. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6618. if(k1 < -23)
  6619. break;
  6620. if(s != null && s.startsWith("@cr0@"))
  6621. s = s.substring(5);
  6622. if(s != null && s.startsWith("@cr1@"))
  6623. s = s.substring(5);
  6624. if(s != null && s.startsWith("@cr2@"))
  6625. s = s.substring(5);
  6626. if(s != null && s.startsWith("@cr3@"))
  6627. s = s.substring(5);
  6628. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6629. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6630. if(myPrivilege >= 1) {
  6631. menuActionName[menuActionRow] = "Report abuse @whi@";
  6632. menuActionID[menuActionRow] = 606;
  6633. menuActionRow++;
  6634. }
  6635. menuActionName[menuActionRow] = "Add ignore";
  6636. menuActionID[menuActionRow] = 42;
  6637. menuActionRow++;
  6638. menuActionName[menuActionRow] = "Add friend";
  6639. menuActionID[menuActionRow] = 337;
  6640. menuActionRow++;
  6641. }
  6642. l++;
  6643. }
  6644. }
  6645. }
  6646.  
  6647. private void buildFriendChat(int j)
  6648. {
  6649. int l = 0;
  6650. for(int i1 = 0; i1 < 500; i1++) {
  6651. if(chatMessages[i1] == null)
  6652. continue;
  6653. if(chatTypeView != 2)
  6654. continue;
  6655. int j1 = chatTypes[i1];
  6656. String s = chatNames[i1];
  6657. String ct = chatMessages[i1];
  6658. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6659. if(k1 < -23)
  6660. break;
  6661. if(s != null && s.startsWith("@cr0@"))
  6662. s = s.substring(5);
  6663. if(s != null && s.startsWith("@cr1@"))
  6664. s = s.substring(5);
  6665. if(s != null && s.startsWith("@cr2@"))
  6666. s = s.substring(5);
  6667. if(s != null && s.startsWith("@cr3@"))
  6668. s = s.substring(5);
  6669. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6670. l++;
  6671. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6672. {
  6673. if(j > k1 - 14 && j <= k1) {
  6674. if(myPrivilege >= 1) {
  6675. menuActionName[menuActionRow] = "Report abuse @whi@";
  6676. menuActionID[menuActionRow] = 606;
  6677. menuActionRow++;
  6678. }
  6679. menuActionName[menuActionRow] = "Add ignore";
  6680. menuActionID[menuActionRow] = 42;
  6681. menuActionRow++;
  6682. menuActionName[menuActionRow] = "Add friend";
  6683. menuActionID[menuActionRow] = 337;
  6684. menuActionRow++;
  6685. }
  6686. l++;
  6687. }
  6688. }
  6689. }
  6690.  
  6691. private void buildDuelorTrade(int j) {
  6692. int l = 0;
  6693. for(int i1 = 0; i1 < 500; i1++) {
  6694. if(chatMessages[i1] == null)
  6695. continue;
  6696. if(chatTypeView != 3 && chatTypeView != 4)
  6697. continue;
  6698. int j1 = chatTypes[i1];
  6699. String s = chatNames[i1];
  6700. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6701. if(k1 < -23)
  6702. break;
  6703. if(s != null && s.startsWith("@cr0@"))
  6704. s = s.substring(5);
  6705. if(s != null && s.startsWith("@cr1@"))
  6706. s = s.substring(5);
  6707. if(s != null && s.startsWith("@cr2@"))
  6708. s = s.substring(5);
  6709. if(s != null && s.startsWith("@cr3@"))
  6710. s = s.substring(5);
  6711. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6712. if(j > k1 - 14 && j <= k1) {
  6713. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6714. menuActionID[menuActionRow] = 484;
  6715. menuActionRow++;
  6716. }
  6717. l++;
  6718. }
  6719. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6720. if(j > k1 - 14 && j <= k1) {
  6721. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6722. menuActionID[menuActionRow] = 6;
  6723. menuActionRow++;
  6724. }
  6725. l++;
  6726. }
  6727. if(j1 == 12) {
  6728. if(j > k1 - 14 && j <= k1) {
  6729. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  6730. menuActionID[menuActionRow] = 915;
  6731. menuActionRow++;
  6732. }
  6733. l++;
  6734. }
  6735. }
  6736. }
  6737.  
  6738. private void buildChatAreaMenu(int j) {
  6739. int l = 0;
  6740. int test = 0;
  6741. for(int i1 = 0; i1 < 500; i1++) {
  6742. if(chatMessages[i1] == null)
  6743. continue;
  6744. int j1 = chatTypes[i1];
  6745. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6746. if(k1 < -23)
  6747. break;
  6748. String s = chatNames[i1];
  6749. String ct = chatMessages[i1];
  6750. boolean flag = false;
  6751. if(chatTypeView == 1) {
  6752. buildPublicChat(j);
  6753. break;
  6754. }
  6755. if(chatTypeView == 2) {
  6756. buildFriendChat(j);
  6757. break;
  6758. }
  6759. if(chatTypeView == 3 || chatTypeView == 4) {
  6760. buildDuelorTrade(j);
  6761. break;
  6762. }
  6763. if(chatTypeView == 5) {
  6764. break;
  6765. }
  6766. if (s != null && s.startsWith("@cr0@")) {
  6767. s = s.substring(5);
  6768. byte byte0 = 1;
  6769. }
  6770. if(s != null && s.startsWith("@cr1@")) {
  6771. s = s.substring(5);
  6772. boolean flag1 = true;
  6773. byte byte0 = 2;
  6774. }
  6775. if(s != null && s.startsWith("@cr2@")) {
  6776. s = s.substring(5);
  6777. byte byte0 = 3;
  6778. }
  6779. if(s != null && s.startsWith("@cr3@")) {
  6780. s = s.substring(5);
  6781. byte byte0 = 4;
  6782. }
  6783. if(j1 == 0)
  6784. l++;
  6785. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6786. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6787. if(myPrivilege >= 1) {
  6788. menuActionName[menuActionRow] = "Report abuse @whi@";
  6789. menuActionID[menuActionRow] = 606;
  6790. menuActionRow++;
  6791. }
  6792. menuActionName[menuActionRow] = "Add ignore";
  6793. menuActionID[menuActionRow] = 42;
  6794. menuActionRow++;
  6795. menuActionName[menuActionRow] = "Add friend";
  6796. menuActionID[menuActionRow] = 337;
  6797. menuActionRow++;
  6798. }
  6799. l++;
  6800. }
  6801. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6802. if(j > k1 - 14 && j <= k1) {
  6803. if(myPrivilege >= 1) {
  6804. menuActionName[menuActionRow] = "Report abuse @whi@";
  6805. menuActionID[menuActionRow] = 606;
  6806. menuActionRow++;
  6807. }
  6808. menuActionName[menuActionRow] = "Add ignore";
  6809. menuActionID[menuActionRow] = 42;
  6810. menuActionRow++;
  6811. menuActionName[menuActionRow] = "Add friend";
  6812. menuActionID[menuActionRow] = 337;
  6813. menuActionRow++;
  6814. }
  6815. l++;
  6816. }
  6817. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6818. if(j > k1 - 14 && j <= k1) {
  6819. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6820. menuActionID[menuActionRow] = 484;
  6821. menuActionRow++;
  6822. }
  6823. l++;
  6824. }
  6825. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6826. l++;
  6827. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6828. if(j > k1 - 14 && j <= k1) {
  6829. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6830. menuActionID[menuActionRow] = 6;
  6831. menuActionRow++;
  6832. }
  6833. l++;
  6834. }
  6835. if(j1 == 9) {
  6836. if(j > k1 - 14 && j <= k1) {
  6837. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  6838. menuActionID[menuActionRow] = 927;
  6839. menuActionRow++;
  6840. }
  6841. l++;
  6842. }
  6843. if(j1 == 10) {
  6844. if(j > k1 - 14 && j <= k1) {
  6845. menuActionName[menuActionRow] = s;
  6846. menuActionID[menuActionRow] = 1090;
  6847. menuActionRow++;
  6848. }
  6849. l++;
  6850. }
  6851. }
  6852.  
  6853. }
  6854.  
  6855.  
  6856.  
  6857. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  6858. {
  6859. int j = class9.contentType;
  6860. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  6861. {
  6862. if(j == 1 && anInt900 == 0)
  6863. {
  6864. class9.disabledMessage = "Loading friend list";
  6865. class9.atActionType = 0;
  6866. return;
  6867. }
  6868. if(j == 1 && anInt900 == 1)
  6869. {
  6870. class9.disabledMessage = "Connecting to friendserver";
  6871. class9.atActionType = 0;
  6872. return;
  6873. }
  6874. if(j == 2 && anInt900 != 2)
  6875. {
  6876. class9.disabledMessage = "Please wait...";
  6877. class9.atActionType = 0;
  6878. return;
  6879. }
  6880. int k = friendsCount;
  6881. if(anInt900 != 2)
  6882. k = 0;
  6883. if(j > 700)
  6884. j -= 601;
  6885. else
  6886. j--;
  6887. if(j >= k)
  6888. {
  6889. class9.disabledMessage = "";
  6890. class9.atActionType = 0;
  6891. return;
  6892. } else
  6893. {
  6894. class9.disabledMessage = friendsList[j];
  6895. class9.atActionType = 1;
  6896. return;
  6897. }
  6898. }
  6899. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  6900. {
  6901. int l = friendsCount;
  6902. if(anInt900 != 2)
  6903. l = 0;
  6904. if(j > 800)
  6905. j -= 701;
  6906. else
  6907. j -= 101;
  6908. if(j >= l)
  6909. {
  6910. class9.disabledMessage = "";
  6911. class9.atActionType = 0;
  6912. return;
  6913. }
  6914. if(friendsNodeIDs[j] == 10)
  6915. class9.disabledMessage = "@gre@Online";
  6916. else
  6917. if(friendsNodeIDs[j] == nodeID)
  6918. class9.disabledMessage = "@red@Offline";
  6919. else
  6920. class9.disabledMessage = "@red@Offline";
  6921. class9.atActionType = 1;
  6922. return;
  6923. }
  6924. if(j == 203)
  6925. {
  6926. int i1 = friendsCount;
  6927. if(anInt900 != 2)
  6928. i1 = 0;
  6929. class9.scrollMax = i1 * 15 + 20;
  6930. if(class9.scrollMax <= class9.height)
  6931. class9.scrollMax = class9.height + 1;
  6932. return;
  6933. }
  6934. if(j >= 401 && j <= 500)
  6935. {
  6936. if((j -= 401) == 0 && anInt900 == 0)
  6937. {
  6938. class9.disabledMessage = "Loading ignore list";
  6939. class9.atActionType = 0;
  6940. return;
  6941. }
  6942. if(j == 1 && anInt900 == 0)
  6943. {
  6944. class9.disabledMessage = "Please wait...";
  6945. class9.atActionType = 0;
  6946. return;
  6947. }
  6948. int j1 = ignoreCount;
  6949. if(anInt900 == 0)
  6950. j1 = 0;
  6951. if(j >= j1)
  6952. {
  6953. class9.disabledMessage = "";
  6954. class9.atActionType = 0;
  6955. return;
  6956. } else
  6957. {
  6958. class9.disabledMessage = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  6959. class9.atActionType = 1;
  6960. return;
  6961. }
  6962. }
  6963. if(j == 503)
  6964. {
  6965. class9.scrollMax = ignoreCount * 15 + 20;
  6966. if(class9.scrollMax <= class9.height)
  6967. class9.scrollMax = class9.height + 1;
  6968. return;
  6969. }
  6970. if(j == 327)
  6971. {
  6972. class9.modelRotationY = 150;
  6973. class9.modelRotationX = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6974. if(aBoolean1031)
  6975. {
  6976. for(int k1 = 0; k1 < 7; k1++)
  6977. {
  6978. int l1 = anIntArray1065[k1];
  6979. if(l1 >= 0 && !IdentityKit.cache[l1].method537())
  6980. return;
  6981. }
  6982.  
  6983. aBoolean1031 = false;
  6984. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6985. int i2 = 0;
  6986. for(int j2 = 0; j2 < 7; j2++)
  6987. {
  6988. int k2 = anIntArray1065[j2];
  6989. if(k2 >= 0)
  6990. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2].method538();
  6991. }
  6992.  
  6993. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6994. for(int l2 = 0; l2 < 5; l2++)
  6995. if(anIntArray990[l2] != 0)
  6996. {
  6997. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6998. if(l2 == 1)
  6999. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7000. }
  7001.  
  7002. model.method469();
  7003. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  7004. model.method479(64, 850, -30, -50, -30, true);
  7005. class9.disabledMediaType = 5;
  7006. class9.disabledMediaID = 0;
  7007. RSInterface.method208(aBoolean994, model);
  7008. }
  7009. return;
  7010. }
  7011. if(j == 328) {
  7012. RSInterface rsInterface = class9;
  7013. int verticleTilt = 150;
  7014. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  7015. rsInterface.modelRotationY = verticleTilt;
  7016. rsInterface.modelRotationX = animationSpeed;
  7017. if(aBoolean1031) {
  7018. Model characterDisplay = myPlayer.method452();
  7019. for(int l2 = 0; l2 < 5; l2++)
  7020. if(anIntArray990[l2] != 0) {
  7021. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  7022. if(l2 == 1)
  7023. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7024. }
  7025. int staticFrame = myPlayer.anInt1511;
  7026. characterDisplay.method469();
  7027. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  7028. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  7029. rsInterface.disabledMediaType = 5;
  7030. rsInterface.disabledMediaID = 0;
  7031. RSInterface.method208(aBoolean994, characterDisplay);
  7032. }
  7033. return;
  7034. }
  7035. if(j == 324)
  7036. {
  7037. if(aSprite_931 == null)
  7038. {
  7039. aSprite_931 = class9.disabledSprite;
  7040. aSprite_932 = class9.enabledSprite;
  7041. }
  7042. if(aBoolean1047)
  7043. {
  7044. class9.disabledSprite = aSprite_932;
  7045. return;
  7046. } else
  7047. {
  7048. class9.disabledSprite = aSprite_931;
  7049. return;
  7050. }
  7051. }
  7052. if(j == 325)
  7053. {
  7054. if(aSprite_931 == null)
  7055. {
  7056. aSprite_931 = class9.disabledSprite;
  7057. aSprite_932 = class9.enabledSprite;
  7058. }
  7059. if(aBoolean1047)
  7060. {
  7061. class9.disabledSprite = aSprite_931;
  7062. return;
  7063. } else
  7064. {
  7065. class9.disabledSprite = aSprite_932;
  7066. return;
  7067. }
  7068. }
  7069. if(j == 600)
  7070. {
  7071. class9.disabledMessage = reportAbuseInput;
  7072. if(loopCycle % 20 < 10)
  7073. {
  7074. class9.disabledMessage += "|";
  7075. return;
  7076. } else
  7077. {
  7078. class9.disabledMessage += " ";
  7079. return;
  7080. }
  7081. }
  7082. if(j == 613)
  7083. if(myPrivilege >= 1)
  7084. {
  7085. if(canMute) {
  7086. class9.disabledColor = 0xff0000;
  7087. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <ON>";
  7088. } else {
  7089. class9.disabledColor = 0xffffff;
  7090. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <OFF>";
  7091. }
  7092. } else {
  7093. class9.disabledMessage = "";
  7094. }
  7095. if(j == 650 || j == 655)
  7096. if(anInt1193 != 0)
  7097. {
  7098. String s;
  7099. if(daysSinceLastLogin == 0)
  7100. s = "earlier today";
  7101. else
  7102. if(daysSinceLastLogin == 1)
  7103. s = "yesterday";
  7104. else
  7105. s = daysSinceLastLogin + " days ago";
  7106. class9.disabledMessage = "You last logged in " + s + " from: " + signlink.dns;
  7107. } else
  7108. {
  7109. class9.disabledMessage = "";
  7110. }
  7111. if(j == 651)
  7112. {
  7113. if(unreadMessages == 0)
  7114. {
  7115. class9.disabledMessage = "0 unread messages";
  7116. class9.disabledColor = 0xffff00;
  7117. }
  7118. if(unreadMessages == 1)
  7119. {
  7120. class9.disabledMessage = "1 unread disabledMessage";
  7121. class9.disabledColor = 65280;
  7122. }
  7123. if(unreadMessages > 1)
  7124. {
  7125. class9.disabledMessage = unreadMessages + " unread messages";
  7126. class9.disabledColor = 65280;
  7127. }
  7128. }
  7129. if(j == 652)
  7130. if(daysSinceRecovChange == 201)
  7131. {
  7132. if(membersInt == 1)
  7133. class9.disabledMessage = "@yel@This is a non-members world: @whi@Since you are a member we";
  7134. else
  7135. class9.disabledMessage = "";
  7136. } else
  7137. if(daysSinceRecovChange == 200)
  7138. {
  7139. class9.disabledMessage = "You have not yet set any password recovery questions.";
  7140. } else
  7141. {
  7142. String s1;
  7143. if(daysSinceRecovChange == 0)
  7144. s1 = "Earlier today";
  7145. else
  7146. if(daysSinceRecovChange == 1)
  7147. s1 = "Yesterday";
  7148. else
  7149. s1 = daysSinceRecovChange + " days ago";
  7150. class9.disabledMessage = s1 + " you changed your recovery questions";
  7151. }
  7152. if(j == 653)
  7153. if(daysSinceRecovChange == 201)
  7154. {
  7155. if(membersInt == 1)
  7156. class9.disabledMessage = "@whi@recommend you use a members world instead. You may use";
  7157. else
  7158. class9.disabledMessage = "";
  7159. } else
  7160. if(daysSinceRecovChange == 200)
  7161. class9.disabledMessage = "We strongly recommend you do so now to secure your account.";
  7162. else
  7163. class9.disabledMessage = "If you do not remember making this change then cancel it immediately";
  7164. if(j == 654)
  7165. {
  7166. if(daysSinceRecovChange == 201)
  7167. if(membersInt == 1)
  7168. {
  7169. class9.disabledMessage = "@whi@this world but member benefits are unavailable whilst here.";
  7170. return;
  7171. } else
  7172. {
  7173. class9.disabledMessage = "";
  7174. return;
  7175. }
  7176. if(daysSinceRecovChange == 200)
  7177. {
  7178. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7179. return;
  7180. }
  7181. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7182. }
  7183. }
  7184.  
  7185. private void drawSplitPrivateChat()
  7186. {
  7187. if(splitPrivateChat == 0)
  7188. return;
  7189. RSFont textDrawingArea = aTextDrawingArea_1271;
  7190. int i = 0;
  7191. if(anInt1104 != 0)
  7192. i = 1;
  7193. for(int j = 0; j < 100; j++)
  7194. if(chatMessages[j] != null)
  7195. {
  7196. int k = chatTypes[j];
  7197. String s = chatNames[j];
  7198. byte byte1 = 0;
  7199. if(s != null && s.startsWith("@cr0@")) {
  7200. s = s.substring(5);
  7201. byte1 = 1;
  7202. }
  7203. if(s != null && s.startsWith("@cr1@")) {
  7204. s = s.substring(5);
  7205. byte1 = 2;
  7206. }
  7207. if(s != null && s.startsWith("@cr2@")) {
  7208. s = s.substring(5);
  7209. byte1 = 3;
  7210. }
  7211. if(s != null && s.startsWith("@cr3@")) {
  7212. s = s.substring(5);
  7213. byte1 = 4;
  7214. }
  7215. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  7216. {
  7217. int l = 329 - i * 13;
  7218. int k1 = 4;
  7219. textDrawingArea.method385(0, "From", l, k1);
  7220. textDrawingArea.method385(65535, "From", l - 1, k1);
  7221. k1 += textDrawingArea.getTextWidth("From ");
  7222. if(byte1 == 1) {
  7223. modIcons[0].drawSprite(k1, l - 12);
  7224. k1 += 12;
  7225. }
  7226. if(byte1 == 2) {
  7227. modIcons[1].drawSprite(k1, l - 12);
  7228. k1 += 12;
  7229. }
  7230. if(byte1 == 3) {
  7231. modIcons[2].drawSprite(k1, l - 12);
  7232. k1 += 12;
  7233. }
  7234. if(byte1 == 4) {
  7235. modIcons[3].drawSprite(k1, l - 12);
  7236. k1 += 12;
  7237. }
  7238. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  7239. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  7240. if(++i >= 5)
  7241. return;
  7242. }
  7243. if(k == 5 && privateChatMode < 2)
  7244. {
  7245. int i1 = 329 - i * 13;
  7246. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  7247. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  7248. if(++i >= 5)
  7249. return;
  7250. }
  7251. if(k == 6 && privateChatMode < 2)
  7252. {
  7253. int j1 = 329 - i * 13;
  7254. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  7255. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  7256. if(++i >= 5)
  7257. return;
  7258. }
  7259. }
  7260.  
  7261. }
  7262.  
  7263. public void pushMessage(String s, int i, String s1) {
  7264. if(i == 0 && dialogID != -1) {
  7265. aString844 = s;
  7266. super.clickMode3 = 0;
  7267. }
  7268. if(backDialogID == -1)
  7269. inputTaken = true;
  7270. for(int j = 499; j > 0; j--) {
  7271. chatTypes[j] = chatTypes[j - 1];
  7272. chatNames[j] = chatNames[j - 1];
  7273. chatMessages[j] = chatMessages[j - 1];
  7274. chatRights[j] = chatRights[j - 1];
  7275. }
  7276. chatTypes[0] = i;
  7277. chatNames[0] = s1;
  7278. chatMessages[0] = s;
  7279. chatRights[0] = rights;
  7280. }
  7281.  
  7282. public static void setTab(int id) {
  7283. needDrawTabArea = true;
  7284. tabID = id;
  7285. tabAreaAltered = true;
  7286. }
  7287. public int tabHPos;
  7288. private void processTabClick() {
  7289. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  7290. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  7291. runHover = true;
  7292. } else {
  7293. runHover = false;
  7294. }
  7295. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  7296. prayHover = true;
  7297. } else {
  7298. prayHover = false;
  7299. }
  7300. if(super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 3 && super.mouseY <= 25){
  7301. logHover = true;
  7302. } else {
  7303. logHover = false;
  7304. }
  7305. }
  7306. if(is562 == false){
  7307. if(super.clickMode3 == 1) {
  7308. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  7309. {
  7310. needDrawTabArea = true;
  7311. tabID = 0;
  7312. tabAreaAltered = true;
  7313. }
  7314. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  7315. {
  7316. needDrawTabArea = true;
  7317. tabID = 1;
  7318. tabAreaAltered = true;
  7319. }
  7320. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  7321. {
  7322. needDrawTabArea = true;
  7323. tabID = 2;
  7324. tabAreaAltered = true;
  7325. }
  7326. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  7327. {
  7328. needDrawTabArea = true;
  7329. tabID = 3;
  7330. tabAreaAltered = true;
  7331. }
  7332. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  7333. {
  7334. needDrawTabArea = true;
  7335. tabID = 4;
  7336. tabAreaAltered = true;
  7337. }
  7338. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  7339. {
  7340. needDrawTabArea = true;
  7341. tabID = 5;
  7342. tabAreaAltered = true;
  7343. }
  7344. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  7345. {
  7346. needDrawTabArea = true;
  7347. tabID = 6;
  7348. tabAreaAltered = true;
  7349. }
  7350. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  7351. {
  7352. needDrawTabArea = true;
  7353. tabID = 7;
  7354. tabAreaAltered = true;
  7355. }
  7356. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  7357. {
  7358. needDrawTabArea = true;
  7359. tabID = 8;
  7360. tabAreaAltered = true;
  7361. }
  7362. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  7363. {
  7364. needDrawTabArea = true;
  7365. tabID = 9;
  7366. tabAreaAltered = true;
  7367. }
  7368. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  7369. {
  7370. needDrawTabArea = true;
  7371. tabID = 10;
  7372. tabAreaAltered = true;
  7373. }
  7374. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  7375. {
  7376. needDrawTabArea = true;
  7377. tabID = 11;
  7378. tabAreaAltered = true;
  7379. }
  7380. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  7381. {
  7382. needDrawTabArea = true;
  7383. tabID = 12;
  7384. tabAreaAltered = true;
  7385. }
  7386. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  7387. {
  7388. needDrawTabArea = true;
  7389. tabID = 13;
  7390. tabAreaAltered = true;
  7391. }
  7392. }
  7393. } else {
  7394. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  7395. tabHPos = 0;
  7396. needDrawTabArea = true;
  7397. tabAreaAltered = true;
  7398. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  7399. tabHPos = 1;
  7400. needDrawTabArea = true;
  7401. tabAreaAltered = true;
  7402. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  7403. tabHPos = 2;
  7404. needDrawTabArea = true;
  7405. tabAreaAltered = true;
  7406. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  7407. tabHPos = 3;
  7408. needDrawTabArea = true;
  7409. tabAreaAltered = true;
  7410. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  7411. tabHPos = 4;
  7412. needDrawTabArea = true;
  7413. tabAreaAltered = true;
  7414. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  7415. tabHPos = 5;
  7416. needDrawTabArea = true;
  7417. tabAreaAltered = true;
  7418. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  7419. tabHPos = 6;
  7420. needDrawTabArea = true;
  7421. tabAreaAltered = true;
  7422. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  7423. tabHPos = 7;
  7424. needDrawTabArea = true;
  7425. tabAreaAltered = true;
  7426. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  7427. tabHPos = 15;
  7428. needDrawTabArea = true;
  7429. tabAreaAltered = true;
  7430. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  7431. tabHPos = 8;
  7432. needDrawTabArea = true;
  7433. tabAreaAltered = true;
  7434. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  7435. tabHPos = 9;
  7436. needDrawTabArea = true;
  7437. tabAreaAltered = true;
  7438. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  7439. tabHPos = 10;
  7440. needDrawTabArea = true;
  7441. tabAreaAltered = true;
  7442. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  7443. tabHPos = 11;
  7444. needDrawTabArea = true;
  7445. tabAreaAltered = true;
  7446. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  7447. tabHPos = 12;
  7448. needDrawTabArea = true;
  7449. tabAreaAltered = true;
  7450. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  7451. tabHPos = 13;
  7452. needDrawTabArea = true;
  7453. tabAreaAltered = true;
  7454. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  7455. tabHPos = 14;
  7456. needDrawTabArea = true;
  7457. tabAreaAltered = true;
  7458. } else {
  7459. tabHPos = -1;
  7460. needDrawTabArea = true;
  7461. tabAreaAltered = true;
  7462. }
  7463. if(super.clickMode3 == 1) {
  7464. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  7465. needDrawTabArea = true;
  7466. tabID = 0;
  7467. tabAreaAltered = true;
  7468. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  7469. needDrawTabArea = true;
  7470. tabID = 1;
  7471. tabAreaAltered = true;
  7472. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  7473. needDrawTabArea = true;
  7474. tabID = 2;
  7475. tabAreaAltered = true;
  7476. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  7477. needDrawTabArea = true;
  7478. tabID = 14;
  7479. tabAreaAltered = true;
  7480. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  7481. needDrawTabArea = true;
  7482. tabID = 3;
  7483. tabAreaAltered = true;
  7484. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  7485. needDrawTabArea = true;
  7486. tabID = 4;
  7487. tabAreaAltered = true;
  7488. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  7489. needDrawTabArea = true;
  7490. tabID = 5;
  7491. tabAreaAltered = true;
  7492. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  7493. needDrawTabArea = true;
  7494. tabID = 6;
  7495. tabAreaAltered = true;
  7496. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  7497. needDrawTabArea = true;
  7498. tabID = 16;
  7499. tabAreaAltered = true;
  7500. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  7501. needDrawTabArea = true;
  7502. tabID = 8;
  7503. tabAreaAltered = true;
  7504. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  7505. needDrawTabArea = true;
  7506. tabID = 9;
  7507. tabAreaAltered = true;
  7508. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  7509. needDrawTabArea = true;
  7510. tabID = 7;
  7511. tabAreaAltered = true;
  7512. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  7513. needDrawTabArea = true;
  7514. tabID = 11;
  7515. tabAreaAltered = true;
  7516. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  7517. needDrawTabArea = true;
  7518. tabID = 12;
  7519. tabAreaAltered = true;
  7520. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  7521. needDrawTabArea = true;
  7522. tabID = 13;
  7523. tabAreaAltered = true;
  7524. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  7525. needDrawTabArea = true;
  7526. tabID = 15;
  7527. tabAreaAltered = true;
  7528. }
  7529. /* Logout X */
  7530. else if(super.saveClickX >= 742 && super.saveClickX <= 764 && super.saveClickY >= 1 && super.saveClickY < 24 && tabInterfaceIDs[10] != -1) {
  7531. needDrawTabArea = true;
  7532. tabID = 10;
  7533. tabAreaAltered = true;
  7534. }
  7535.  
  7536. }
  7537. }
  7538.  
  7539. }
  7540.  
  7541. private void resetImageProducers2() {
  7542. if(chatBackImage != null)
  7543. return;
  7544. nullLoader();
  7545. super.fullGameScreen = null;
  7546. aRSImageProducer_1107 = null;
  7547. aRSImageProducer_1108 = null;
  7548. loginScreenArea = null;
  7549. leftSideFlame = null;
  7550. rightSideFlame = null;
  7551. gameLogo = null;
  7552. aRSImageProducer_1113 = null;
  7553. aRSImageProducer_1114 = null;
  7554. aRSImageProducer_1115 = null;
  7555. chatBackImage = new RSImageProducer(516, 165, getGameComponent());//519
  7556. mapBackImage = new RSImageProducer(249, 168, getGameComponent());//
  7557. DrawingArea.setAllPixelsToZero();
  7558. //mapBack.drawBackground(0, 0);
  7559. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7560. inventoryBackImage = new RSImageProducer(250, 335, getGameComponent());
  7561. inGameScreen = new RSImageProducer(512, 334, getGameComponent());
  7562. DrawingArea.setAllPixelsToZero();
  7563. //aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  7564. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  7565. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7566. welcomeScreenRaised = true;
  7567. }
  7568.  
  7569. public String getDocumentBaseHost() {
  7570. if (signlink.mainapp != null) {
  7571. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7572. }
  7573. return null;
  7574. }
  7575.  
  7576. private void method81(Sprite sprite, int j, int k) {
  7577. int l = k * k + j * j;
  7578. if(l > 4225 && l < 0x15f90) {
  7579. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  7580. int j1 = Model.modelIntArray1[i1];
  7581. int k1 = Model.modelIntArray2[i1];
  7582. j1 = (j1 * 256) / (minimapInt3 + 256);
  7583. k1 = (k1 * 256) / (minimapInt3 + 256);
  7584. int l1 = j * j1 + k * k1 >> 16;
  7585. int i2 = j * k1 - k * j1 >> 16;
  7586. double d = Math.atan2(l1, i2);
  7587. int j2 = (int)(Math.sin(d) * 63D);
  7588. int k2 = (int)(Math.cos(d) * 57D);
  7589. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7590. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7591. return;
  7592. } else {
  7593. markMinimap(sprite, k, j, false);
  7594. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7595. }
  7596. }
  7597.  
  7598. public void processRightClick() {
  7599. if (activeInterfaceType != 0) {
  7600. return;
  7601. }
  7602. menuActionName[0] = "Cancel";
  7603. menuActionID[0] = 1107;
  7604. menuActionRow = 1;
  7605. if (fullscreenInterfaceID != -1) {
  7606. anInt886 = 0;
  7607. anInt1315 = 0;
  7608. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  7609. if (anInt886 != anInt1026) {
  7610. anInt1026 = anInt886;
  7611. }
  7612. if (anInt1315 != anInt1129) {
  7613. anInt1129 = anInt1315;
  7614. }
  7615. return;
  7616. }
  7617. buildSplitPrivateChatMenu();
  7618. anInt886 = 0;
  7619. anInt1315 = 0;
  7620. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  7621. if (openInterfaceID != -1) {
  7622. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7623. } else {
  7624. build3dScreenMenu();
  7625. }
  7626. }
  7627. if (anInt886 != anInt1026) {
  7628. anInt1026 = anInt886;
  7629. }
  7630. if (anInt1315 != anInt1129) {
  7631. anInt1129 = anInt1315;
  7632. }
  7633. anInt886 = 0;
  7634. anInt1315 = 0;
  7635. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  7636. if(invOverlayInterfaceID != -1) {
  7637. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  7638. } else if(tabInterfaceIDs[tabID] != -1) {
  7639. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  7640. }
  7641. }
  7642. if (anInt886 != anInt1048) {
  7643. needDrawTabArea = true;
  7644. tabAreaAltered = true;
  7645. anInt1048 = anInt886;
  7646. }
  7647. if (anInt1315 != anInt1044) {
  7648. needDrawTabArea = true;
  7649. tabAreaAltered = true;
  7650. anInt1044 = anInt1315;
  7651. }
  7652. anInt886 = 0;
  7653. anInt1315 = 0;
  7654. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  7655. if(backDialogID != -1) {
  7656. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  7657. } else if(super.mouseY < 463 && super.mouseX < 490) {
  7658. buildChatAreaMenu(super.mouseY - 338);
  7659. }
  7660. }
  7661. if (backDialogID != -1 && anInt886 != anInt1039) {
  7662. inputTaken = true;
  7663. anInt1039 = anInt886;
  7664. }
  7665. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7666. inputTaken = true;
  7667. anInt1500 = anInt1315;
  7668. }
  7669. /** Custom menu drawing */
  7670. rightClickChatButtons();
  7671. alertHandler.processMouse(super.mouseX, super.mouseY); determineTopTabs();
  7672. determineBottomTabs();
  7673.  
  7674. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  7675. processMinimapActions();
  7676. }
  7677.  
  7678. boolean flag = false;
  7679. while (!flag) {
  7680. flag = true;
  7681. for (int j = 0; j < menuActionRow - 1; j++) {
  7682. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7683. String s = menuActionName[j];
  7684. menuActionName[j] = menuActionName[j + 1];
  7685. menuActionName[j + 1] = s;
  7686. int k = menuActionID[j];
  7687. menuActionID[j] = menuActionID[j + 1];
  7688. menuActionID[j + 1] = k;
  7689. k = menuActionCmd2[j];
  7690. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7691. menuActionCmd2[j + 1] = k;
  7692. k = menuActionCmd3[j];
  7693. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7694. menuActionCmd3[j + 1] = k;
  7695. k = menuActionCmd1[j];
  7696. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7697. menuActionCmd1[j + 1] = k;
  7698. flag = false;
  7699. }
  7700. }
  7701. }
  7702. }
  7703.  
  7704. private int method83(int i, int j, int k)
  7705. {
  7706. int l = 256 - k;
  7707. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7708. }
  7709.  
  7710. private void login(String s, String s1, boolean flag)
  7711. {
  7712. signlink.errorname = s;
  7713. try
  7714. {
  7715. if(!flag)
  7716. {
  7717. loginMessage1 = "";
  7718. loginMessage2 = "Connecting to server...";
  7719. drawLoginScreen(true);
  7720. }
  7721. socketStream = new RSSocket(this, openSocket(43594));
  7722. long l = TextClass.longForName(s);
  7723. int i = (int)(l >> 16 & 31L);
  7724. stream.currentOffset = 0;
  7725. stream.writeWordBigEndian(14);
  7726. stream.writeWordBigEndian(i);
  7727. socketStream.queueBytes(2, stream.buffer);
  7728. for(int j = 0; j < 8; j++)
  7729. socketStream.read();
  7730.  
  7731. int k = socketStream.read();
  7732. int i1 = k;
  7733. if(k == 0)
  7734. {
  7735. socketStream.flushInputStream(inStream.buffer, 8);
  7736. inStream.currentOffset = 0;
  7737. aLong1215 = inStream.readQWord();
  7738. int ai[] = new int[4];
  7739. ai[0] = (int)(Math.random() * 99999999D);
  7740. ai[1] = (int)(Math.random() * 99999999D);
  7741. ai[2] = (int)(aLong1215 >> 32);
  7742. ai[3] = (int)aLong1215;
  7743. stream.currentOffset = 0;
  7744. stream.writeWordBigEndian(10);
  7745. stream.writeDWord(ai[0]);
  7746. stream.writeDWord(ai[1]);
  7747. stream.writeDWord(ai[2]);
  7748. stream.writeDWord(ai[3]);
  7749. stream.writeDWord(123456);
  7750. stream.writeString(s);
  7751. stream.writeString(s1);
  7752. stream.doKeys();
  7753. aStream_847.currentOffset = 0;
  7754. if(flag)
  7755. aStream_847.writeWordBigEndian(18);
  7756. else
  7757. aStream_847.writeWordBigEndian(16);
  7758. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7759. aStream_847.writeWordBigEndian(255);
  7760. aStream_847.writeWord(317);
  7761. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7762. for(int l1 = 0; l1 < 9; l1++)
  7763. aStream_847.writeDWord(expectedCRCs[l1]);
  7764.  
  7765. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7766. stream.encryption = new ISAACRandomGen(ai);
  7767. for(int j2 = 0; j2 < 4; j2++)
  7768. ai[j2] += 50;
  7769.  
  7770. encryption = new ISAACRandomGen(ai);
  7771. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7772. k = socketStream.read();
  7773. }
  7774. if(k == 1)
  7775. {
  7776. try
  7777. {
  7778. Thread.sleep(2000L);
  7779. }
  7780. catch(Exception _ex) { }
  7781. login(s, s1, flag);
  7782. return;
  7783. }
  7784. if(k == 2)
  7785. {
  7786. myPrivilege = socketStream.read();
  7787. flagged = socketStream.read() == 1;
  7788. aLong1220 = 0L;
  7789. anInt1022 = 0;
  7790. mouseDetection.coordsIndex = 0;
  7791. super.awtFocus = true;
  7792. aBoolean954 = true;
  7793. loggedIn = true;
  7794. stream.currentOffset = 0;
  7795. inStream.currentOffset = 0;
  7796. pktType = -1;
  7797. anInt841 = -1;
  7798. anInt842 = -1;
  7799. anInt843 = -1;
  7800. pktSize = 0;
  7801. anInt1009 = 0;
  7802. anInt1104 = 0;
  7803. anInt1011 = 0;
  7804. anInt855 = 0;
  7805. menuActionRow = 0;
  7806. menuOpen = false;
  7807. super.idleTime = 0;
  7808. for(int j1 = 0; j1 < 100; j1++)
  7809. chatMessages[j1] = null;
  7810.  
  7811. itemSelected = 0;
  7812. spellSelected = 0;
  7813. loadingStage = 0;
  7814. anInt1062 = 0;
  7815. anInt1278 = (int)(Math.random() * 100D) - 50;
  7816. anInt1131 = (int)(Math.random() * 110D) - 55;
  7817. anInt896 = (int)(Math.random() * 80D) - 40;
  7818. minimapInt2 = (int)(Math.random() * 120D) - 60;
  7819. minimapInt3 = (int)(Math.random() * 30D) - 20;
  7820. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  7821. anInt1021 = 0;
  7822. anInt985 = -1;
  7823. destX = 0;
  7824. destY = 0;
  7825. playerCount = 0;
  7826. npcCount = 0;
  7827. for(int i2 = 0; i2 < maxPlayers; i2++)
  7828. {
  7829. playerArray[i2] = null;
  7830. aStreamArray895s[i2] = null;
  7831. }
  7832.  
  7833. for(int k2 = 0; k2 < 16384; k2++)
  7834. npcArray[k2] = null;
  7835.  
  7836. myPlayer = playerArray[myPlayerIndex] = new Player();
  7837. aClass19_1013.removeAll();
  7838. aClass19_1056.removeAll();
  7839. for(int l2 = 0; l2 < 4; l2++)
  7840. {
  7841. for(int i3 = 0; i3 < 104; i3++)
  7842. {
  7843. for(int k3 = 0; k3 < 104; k3++)
  7844. groundArray[l2][i3][k3] = null;
  7845.  
  7846. }
  7847.  
  7848. }
  7849. aClass19_1179 = new NodeList();
  7850. fullscreenInterfaceID = -1;
  7851. anInt900 = 0;
  7852. friendsCount = 0;
  7853. dialogID = -1;
  7854. backDialogID = -1;
  7855. openInterfaceID = -1;
  7856. invOverlayInterfaceID = -1;
  7857. anInt1018 = -1;
  7858. aBoolean1149 = false;
  7859. tabID = 3;
  7860. inputDialogState = 0;
  7861. menuOpen = false;
  7862. messagePromptRaised = false;
  7863. aString844 = null;
  7864. anInt1055 = 0;
  7865. anInt1054 = -1;
  7866. aBoolean1047 = true;
  7867. method45();
  7868. welcome();
  7869. for(int j3 = 0; j3 < 5; j3++)
  7870. anIntArray990[j3] = 0;
  7871.  
  7872. for(int l3 = 0; l3 < 5; l3++)
  7873. {
  7874. atPlayerActions[l3] = null;
  7875. atPlayerArray[l3] = false;
  7876. }
  7877.  
  7878. anInt1175 = 0;
  7879. anInt1134 = 0;
  7880. anInt986 = 0;
  7881. anInt1288 = 0;
  7882. anInt924 = 0;
  7883. anInt1188 = 0;
  7884. anInt1155 = 0;
  7885. anInt1226 = 0;
  7886. int anInt941 = 0;
  7887. int anInt1260 = 0;
  7888. resetImageProducers2();
  7889. return;
  7890. }
  7891. if(k == 3)
  7892. {
  7893. loginMessage1 = "";
  7894. loginMessage2 = "Invalid username or password.";
  7895. return;
  7896. }
  7897. if(k == 4)
  7898. {
  7899. loginMessage1 = "Your account has been disabled.";
  7900. loginMessage2 = "Please check your disabledMessage-center for details.";
  7901. return;
  7902. }
  7903. if(k == 5)
  7904. {
  7905. loginMessage1 = "Your account is already logged in.";
  7906. loginMessage2 = "Try again in 60 secs...";
  7907. return;
  7908. }
  7909. if(k == 6)
  7910. {
  7911. loginMessage1 = "Universalscape has been updated!";
  7912. loginMessage2 = "Please reload this page.";
  7913. return;
  7914. }
  7915. if(k == 7)
  7916. {
  7917. loginMessage1 = "This world is full.";
  7918. loginMessage2 = "Please use a different world.";
  7919. return;
  7920. }
  7921. if(k == 8)
  7922. {
  7923. loginMessage1 = "Unable to connect.";
  7924. loginMessage2 = "Login server offline.";
  7925. return;
  7926. }
  7927. if(k == 9)
  7928. {
  7929. loginMessage1 = "Login limit exceeded.";
  7930. loginMessage2 = "Too many connections from your address.";
  7931. return;
  7932. }
  7933. if(k == 10)
  7934. {
  7935. loginMessage1 = "Unable to connect.";
  7936. loginMessage2 = "Bad session id.";
  7937. return;
  7938. }
  7939. if(k == 11)
  7940. {
  7941. loginMessage2 = "Login server rejected session.";
  7942. loginMessage2 = "Please try again.";
  7943. return;
  7944. }
  7945. if(k == 12)
  7946. {
  7947. loginMessage1 = "You need a members account to login to this world.";
  7948. loginMessage2 = "Please subscribe, or use a different world.";
  7949. return;
  7950. }
  7951. if(k == 13)
  7952. {
  7953. loginMessage1 = "Could not complete login.";
  7954. loginMessage2 = "Please try using a different world.";
  7955. return;
  7956. }
  7957. if(k == 14)
  7958. {
  7959. loginMessage1 = "The server is being updated.";
  7960. loginMessage2 = "Please wait 1 minute and try again.";
  7961. return;
  7962. }
  7963. if(k == 15)
  7964. {
  7965. loggedIn = true;
  7966. stream.currentOffset = 0;
  7967. inStream.currentOffset = 0;
  7968. pktType = -1;
  7969. anInt841 = -1;
  7970. anInt842 = -1;
  7971. anInt843 = -1;
  7972. pktSize = 0;
  7973. anInt1009 = 0;
  7974. anInt1104 = 0;
  7975. menuActionRow = 0;
  7976. menuOpen = false;
  7977. aLong824 = System.currentTimeMillis();
  7978. return;
  7979. }
  7980. if(k == 16)
  7981. {
  7982. loginMessage1 = "Login attempts exceeded.";
  7983. loginMessage2 = "Please wait 1 minute and try again.";
  7984. return;
  7985. }
  7986. if(k == 17)
  7987. {
  7988. loginMessage1 = "You are standing in a members-only area.";
  7989. loginMessage2 = "To play on this world move to a free area first";
  7990. return;
  7991. }
  7992. if(k == 20)
  7993. {
  7994. loginMessage1 = "Invalid loginserver requested";
  7995. loginMessage2 = "Please try using a different world.";
  7996. return;
  7997. }
  7998. if(k == 21)
  7999. {
  8000. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  8001. {
  8002. loginMessage1 = "You have only just left another world";
  8003. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  8004. drawLoginScreen(true);
  8005. try
  8006. {
  8007. Thread.sleep(1000L);
  8008. }
  8009. catch(Exception _ex) { }
  8010. }
  8011.  
  8012. login(s, s1, flag);
  8013. return;
  8014. }
  8015. if(k == -1)
  8016. {
  8017. if(i1 == 0)
  8018. {
  8019. if(loginFailures < 2)
  8020. {
  8021. try
  8022. {
  8023. Thread.sleep(2000L);
  8024. }
  8025. catch(Exception _ex) { }
  8026. loginFailures++;
  8027. login(s, s1, flag);
  8028. return;
  8029. } else
  8030. {
  8031. loginMessage1 = "You must download The latest";
  8032. loginMessage2 = "client at www.universalscape.comyr.com";
  8033. return;
  8034. }
  8035. } else
  8036. {
  8037. loginMessage1 = "No response from server";
  8038. loginMessage2 = "Please try using a different world.";
  8039. return;
  8040. }
  8041. } else
  8042. {
  8043. System.out.println("response:" + k);
  8044. loginMessage1 = "Unexpected server response";
  8045. loginMessage2 = "Please try using a different world.";
  8046. return;
  8047. }
  8048. }
  8049. catch(IOException _ex)
  8050. {
  8051. loginMessage1 = "";
  8052. }
  8053. loginMessage2 = "Error connecting to server.";
  8054. }
  8055.  
  8056. 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) {
  8057. byte byte0 = 104;
  8058. byte byte1 = 104;
  8059. for(int l2 = 0; l2 < byte0; l2++) {
  8060. for(int i3 = 0; i3 < byte1; i3++) {
  8061. anIntArrayArray901[l2][i3] = 0;
  8062. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  8063. }
  8064. }
  8065. int j3 = j2;
  8066. int k3 = j1;
  8067. anIntArrayArray901[j2][j1] = 99;
  8068. anIntArrayArray825[j2][j1] = 0;
  8069. int l3 = 0;
  8070. int i4 = 0;
  8071. bigX[l3] = j2;
  8072. bigY[l3++] = j1;
  8073. boolean flag1 = false;
  8074. int j4 = bigX.length;
  8075. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  8076. while(i4 != l3)
  8077. {
  8078. j3 = bigX[i4];
  8079. k3 = bigY[i4];
  8080. i4 = (i4 + 1) % j4;
  8081. if(j3 == k2 && k3 == i2)
  8082. {
  8083. flag1 = true;
  8084. break;
  8085. }
  8086. if(i1 != 0)
  8087. {
  8088. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  8089. {
  8090. flag1 = true;
  8091. break;
  8092. }
  8093. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  8094. {
  8095. flag1 = true;
  8096. break;
  8097. }
  8098. }
  8099. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  8100. {
  8101. flag1 = true;
  8102. break;
  8103. }
  8104. int l4 = anIntArrayArray825[j3][k3] + 1;
  8105. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  8106. {
  8107. bigX[l3] = j3 - 1;
  8108. bigY[l3] = k3;
  8109. l3 = (l3 + 1) % j4;
  8110. anIntArrayArray901[j3 - 1][k3] = 2;
  8111. anIntArrayArray825[j3 - 1][k3] = l4;
  8112. }
  8113. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  8114. {
  8115. bigX[l3] = j3 + 1;
  8116. bigY[l3] = k3;
  8117. l3 = (l3 + 1) % j4;
  8118. anIntArrayArray901[j3 + 1][k3] = 8;
  8119. anIntArrayArray825[j3 + 1][k3] = l4;
  8120. }
  8121. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  8122. {
  8123. bigX[l3] = j3;
  8124. bigY[l3] = k3 - 1;
  8125. l3 = (l3 + 1) % j4;
  8126. anIntArrayArray901[j3][k3 - 1] = 1;
  8127. anIntArrayArray825[j3][k3 - 1] = l4;
  8128. }
  8129. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  8130. {
  8131. bigX[l3] = j3;
  8132. bigY[l3] = k3 + 1;
  8133. l3 = (l3 + 1) % j4;
  8134. anIntArrayArray901[j3][k3 + 1] = 4;
  8135. anIntArrayArray825[j3][k3 + 1] = l4;
  8136. }
  8137. 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)
  8138. {
  8139. bigX[l3] = j3 - 1;
  8140. bigY[l3] = k3 - 1;
  8141. l3 = (l3 + 1) % j4;
  8142. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  8143. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  8144. }
  8145. 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)
  8146. {
  8147. bigX[l3] = j3 + 1;
  8148. bigY[l3] = k3 - 1;
  8149. l3 = (l3 + 1) % j4;
  8150. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  8151. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  8152. }
  8153. 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)
  8154. {
  8155. bigX[l3] = j3 - 1;
  8156. bigY[l3] = k3 + 1;
  8157. l3 = (l3 + 1) % j4;
  8158. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  8159. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  8160. }
  8161. 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)
  8162. {
  8163. bigX[l3] = j3 + 1;
  8164. bigY[l3] = k3 + 1;
  8165. l3 = (l3 + 1) % j4;
  8166. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  8167. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  8168. }
  8169. }
  8170. anInt1264 = 0;
  8171. if(!flag1)
  8172. {
  8173. if(flag)
  8174. {
  8175. int i5 = 100;
  8176. for(int k5 = 1; k5 < 2; k5++)
  8177. {
  8178. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  8179. {
  8180. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  8181. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  8182. {
  8183. i5 = anIntArrayArray825[i6][l6];
  8184. j3 = i6;
  8185. k3 = l6;
  8186. anInt1264 = 1;
  8187. flag1 = true;
  8188. }
  8189.  
  8190. }
  8191.  
  8192. if(flag1)
  8193. break;
  8194. }
  8195.  
  8196. }
  8197. if(!flag1)
  8198. return false;
  8199. }
  8200. i4 = 0;
  8201. bigX[i4] = j3;
  8202. bigY[i4++] = k3;
  8203. int l5;
  8204. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  8205. {
  8206. if(j5 != l5)
  8207. {
  8208. l5 = j5;
  8209. bigX[i4] = j3;
  8210. bigY[i4++] = k3;
  8211. }
  8212. if((j5 & 2) != 0)
  8213. j3++;
  8214. else
  8215. if((j5 & 8) != 0)
  8216. j3--;
  8217. if((j5 & 1) != 0)
  8218. k3++;
  8219. else
  8220. if((j5 & 4) != 0)
  8221. k3--;
  8222. }
  8223. // if(cancelWalk) { return i4 > 0; }
  8224.  
  8225.  
  8226. if(i4 > 0)
  8227. {
  8228. int k4 = i4;
  8229. if(k4 > 25)
  8230. k4 = 25;
  8231. i4--;
  8232. int k6 = bigX[i4];
  8233. int i7 = bigY[i4];
  8234. anInt1288 += k4;
  8235. if(anInt1288 >= 92)
  8236. {
  8237. stream.createFrame(36);
  8238. stream.writeDWord(0);
  8239. anInt1288 = 0;
  8240. }
  8241. if(i == 0)
  8242. {
  8243. stream.createFrame(164);
  8244. stream.writeWordBigEndian(k4 + k4 + 3);
  8245. }
  8246. if(i == 1)
  8247. {
  8248. stream.createFrame(248);
  8249. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8250. }
  8251. if(i == 2)
  8252. {
  8253. stream.createFrame(98);
  8254. stream.writeWordBigEndian(k4 + k4 + 3);
  8255. }
  8256. stream.method433(k6 + baseX);
  8257. destX = bigX[0];
  8258. destY = bigY[0];
  8259. for(int j7 = 1; j7 < k4; j7++)
  8260. {
  8261. i4--;
  8262. stream.writeWordBigEndian(bigX[i4] - k6);
  8263. stream.writeWordBigEndian(bigY[i4] - i7);
  8264. }
  8265.  
  8266. stream.method431(i7 + baseY);
  8267. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8268. return true;
  8269. }
  8270. return i != 1;
  8271. }
  8272.  
  8273. private void method86(Stream stream)
  8274. {
  8275. for(int j = 0; j < anInt893; j++)
  8276. {
  8277. int k = anIntArray894[j];
  8278. NPC npc = npcArray[k];
  8279. int l = stream.readUnsignedByte();
  8280. if((l & 0x10) != 0)
  8281. {
  8282. int i1 = stream.method434();
  8283. if(i1 == 65535)
  8284. i1 = -1;
  8285. int i2 = stream.readUnsignedByte();
  8286. if(i1 == npc.anim && i1 != -1)
  8287. {
  8288. int l2 = Animation.anims[i1].anInt365;
  8289. if(l2 == 1)
  8290. {
  8291. npc.anInt1527 = 0;
  8292. npc.anInt1528 = 0;
  8293. npc.anInt1529 = i2;
  8294. npc.anInt1530 = 0;
  8295. }
  8296. if(l2 == 2)
  8297. npc.anInt1530 = 0;
  8298. } else
  8299. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  8300. {
  8301. npc.anim = i1;
  8302. npc.anInt1527 = 0;
  8303. npc.anInt1528 = 0;
  8304. npc.anInt1529 = i2;
  8305. npc.anInt1530 = 0;
  8306. npc.anInt1542 = npc.smallXYIndex;
  8307. }
  8308. }
  8309. if ((l & 8) != 0) {
  8310. int j1 = stream.method426();
  8311. int j2 = stream.method427();
  8312. int type1 = stream.readUnsignedByte();
  8313. npc.updateHitData(j2, j1, type1, loopCycle);
  8314. npc.loopCycleStatus = loopCycle + 300;
  8315. npc.currentHealth = stream.method426();
  8316. npc.maxHealth = stream.readUnsignedByte();
  8317. }
  8318. if((l & 0x80) != 0)
  8319. {
  8320. npc.anInt1520 = stream.readUnsignedWord();
  8321. int k1 = stream.readDWord();
  8322. npc.anInt1524 = k1 >> 16;
  8323. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8324. npc.anInt1521 = 0;
  8325. npc.anInt1522 = 0;
  8326. if(npc.anInt1523 > loopCycle)
  8327. npc.anInt1521 = -1;
  8328. if(npc.anInt1520 == 65535)
  8329. npc.anInt1520 = -1;
  8330. }
  8331. if((l & 0x20) != 0)
  8332. {
  8333. npc.interactingEntity = stream.readUnsignedWord();
  8334. if(npc.interactingEntity == 65535)
  8335. npc.interactingEntity = -1;
  8336. }
  8337. if((l & 1) != 0)
  8338. {
  8339. npc.textSpoken = stream.readString();
  8340. npc.textCycle = 100;
  8341. // entityMessage(npc);
  8342.  
  8343. }
  8344. if ((l & 0x40) != 0) {
  8345. int l1 = stream.method427();
  8346. int k2 = stream.method428();
  8347. int type2 = stream.readUnsignedByte();
  8348. npc.updateHitData(k2, l1, type2, loopCycle);
  8349. npc.loopCycleStatus = loopCycle + 300;
  8350. npc.currentHealth = stream.method428();
  8351. npc.maxHealth = stream.method427();
  8352. }
  8353. if((l & 2) != 0)
  8354. {
  8355. npc.desc = EntityDef.forID(stream.method436());
  8356. npc.anInt1540 = npc.desc.aByte68;
  8357. npc.anInt1504 = npc.desc.anInt79;
  8358. npc.anInt1554 = npc.desc.anInt67;
  8359. npc.anInt1555 = npc.desc.anInt58;
  8360. npc.anInt1556 = npc.desc.anInt83;
  8361. npc.anInt1557 = npc.desc.anInt55;
  8362. npc.anInt1511 = npc.desc.anInt77;
  8363. }
  8364. if((l & 4) != 0)
  8365. {
  8366. npc.anInt1538 = stream.method434();
  8367. npc.anInt1539 = stream.method434();
  8368. }
  8369. }
  8370. }
  8371.  
  8372. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  8373. {
  8374. if(menuActionRow >= 400)
  8375. return;
  8376. if(entityDef.childrenIDs != null)
  8377. entityDef = entityDef.method161();
  8378. if(entityDef == null)
  8379. return;
  8380. if(!entityDef.aBoolean84)
  8381. return;
  8382. String s = entityDef.name;
  8383. if(entityDef.combatLevel != 0)
  8384. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  8385. if(itemSelected == 1)
  8386. {
  8387. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  8388. menuActionID[menuActionRow] = 582;
  8389. menuActionCmd1[menuActionRow] = i;
  8390. menuActionCmd2[menuActionRow] = k;
  8391. menuActionCmd3[menuActionRow] = j;
  8392. menuActionRow++;
  8393. return;
  8394. }
  8395. if(spellSelected == 1)
  8396. {
  8397. if((spellUsableOn & 2) == 2)
  8398. {
  8399. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8400. menuActionID[menuActionRow] = 413;
  8401. menuActionCmd1[menuActionRow] = i;
  8402. menuActionCmd2[menuActionRow] = k;
  8403. menuActionCmd3[menuActionRow] = j;
  8404. menuActionRow++;
  8405. }
  8406. } else
  8407. {
  8408. if(entityDef.itemActions != null)
  8409. {
  8410. for(int l = 4; l >= 0; l--)
  8411. if(entityDef.itemActions[l] != null && !entityDef.itemActions[l].equalsIgnoreCase("attack"))
  8412. {
  8413. menuActionName[menuActionRow] = entityDef.itemActions[l] + " @yel@" + s;
  8414. if(l == 0)
  8415. menuActionID[menuActionRow] = 20;
  8416. if(l == 1)
  8417. menuActionID[menuActionRow] = 412;
  8418. if(l == 2)
  8419. menuActionID[menuActionRow] = 225;
  8420. if(l == 3)
  8421. menuActionID[menuActionRow] = 965;
  8422. if(l == 4)
  8423. menuActionID[menuActionRow] = 478;
  8424. menuActionCmd1[menuActionRow] = i;
  8425. menuActionCmd2[menuActionRow] = k;
  8426. menuActionCmd3[menuActionRow] = j;
  8427. menuActionRow++;
  8428. }
  8429.  
  8430. }
  8431. if(entityDef.itemActions != null)
  8432. {
  8433. for(int i1 = 4; i1 >= 0; i1--)
  8434. if(entityDef.itemActions[i1] != null && entityDef.itemActions[i1].equalsIgnoreCase("attack"))
  8435. {
  8436. char c = '\0';
  8437. if(entityDef.combatLevel > myPlayer.combatLevel)
  8438. c = '\u07D0';
  8439. menuActionName[menuActionRow] = entityDef.itemActions[i1] + " @yel@" + s;
  8440. if(i1 == 0)
  8441. menuActionID[menuActionRow] = 20 + c;
  8442. if(i1 == 1)
  8443. menuActionID[menuActionRow] = 412 + c;
  8444. if(i1 == 2)
  8445. menuActionID[menuActionRow] = 225 + c;
  8446. if(i1 == 3)
  8447. menuActionID[menuActionRow] = 965 + c;
  8448. if(i1 == 4)
  8449. menuActionID[menuActionRow] = 478 + c;
  8450. menuActionCmd1[menuActionRow] = i;
  8451. menuActionCmd2[menuActionRow] = k;
  8452. menuActionCmd3[menuActionRow] = j;
  8453. menuActionRow++;
  8454. }
  8455.  
  8456. }
  8457. if(idToggle == true) {
  8458. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.interfaceType + "@gre@)";
  8459. } else {
  8460. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8461. }
  8462. menuActionID[menuActionRow] = 1025;
  8463. menuActionCmd1[menuActionRow] = i;
  8464. menuActionCmd2[menuActionRow] = k;
  8465. menuActionCmd3[menuActionRow] = j;
  8466. menuActionRow++;
  8467. }
  8468. }
  8469.  
  8470. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  8471. {
  8472. if(player == myPlayer)
  8473. return;
  8474. if(menuActionRow >= 400)
  8475. return;
  8476. String s;
  8477. if(player.skill == 0)
  8478. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  8479. else
  8480. s = "@or2@" + getRank(player.skill) + "@whi@ " + player.name
  8481. + " (level-" + player.combatLevel + ")";
  8482. if(itemSelected == 1)
  8483. {
  8484. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @whi@" + s;
  8485. menuActionID[menuActionRow] = 491;
  8486. menuActionCmd1[menuActionRow] = j;
  8487. menuActionCmd2[menuActionRow] = i;
  8488. menuActionCmd3[menuActionRow] = k;
  8489. menuActionRow++;
  8490. } else
  8491. if(spellSelected == 1)
  8492. {
  8493. if((spellUsableOn & 8) == 8)
  8494. {
  8495. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8496. menuActionID[menuActionRow] = 365;
  8497. menuActionCmd1[menuActionRow] = j;
  8498. menuActionCmd2[menuActionRow] = i;
  8499. menuActionCmd3[menuActionRow] = k;
  8500. menuActionRow++;
  8501. }
  8502. } else
  8503. {
  8504. for(int l = 4; l >= 0; l--)
  8505. if(atPlayerActions[l] != null)
  8506. {
  8507. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  8508. char c = '\0';
  8509. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  8510. {
  8511. if(player.combatLevel > myPlayer.combatLevel)
  8512. c = '\u07D0';
  8513. if(myPlayer.team != 0 && player.team != 0)
  8514. if(myPlayer.team == player.team)
  8515. c = '\u07D0';
  8516. else
  8517. c = '\0';
  8518. } else
  8519. if(atPlayerArray[l])
  8520. c = '\u07D0';
  8521. if(l == 0)
  8522. menuActionID[menuActionRow] = 561 + c;
  8523. if(l == 1)
  8524. menuActionID[menuActionRow] = 779 + c;
  8525. if(l == 2)
  8526. menuActionID[menuActionRow] = 27 + c;
  8527. if(l == 3)
  8528. menuActionID[menuActionRow] = 577 + c;
  8529. if(l == 4)
  8530. menuActionID[menuActionRow] = 729 + c;
  8531. menuActionCmd1[menuActionRow] = j;
  8532. menuActionCmd2[menuActionRow] = i;
  8533. menuActionCmd3[menuActionRow] = k;
  8534. menuActionRow++;
  8535. }
  8536.  
  8537. }
  8538. for(int i1 = 0; i1 < menuActionRow; i1++)
  8539. if(menuActionID[i1] == 516)
  8540. {
  8541. menuActionName[i1] = "Walk here @whi@" + s;
  8542. return;
  8543. }
  8544.  
  8545. }
  8546.  
  8547. private void method89(Class30_Sub1 class30_sub1)
  8548. {
  8549. int i = 0;
  8550. int j = -1;
  8551. int k = 0;
  8552. int l = 0;
  8553. if(class30_sub1.anInt1296 == 0)
  8554. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8555. if(class30_sub1.anInt1296 == 1)
  8556. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8557. if(class30_sub1.anInt1296 == 2)
  8558. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8559. if(class30_sub1.anInt1296 == 3)
  8560. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8561. if(i != 0)
  8562. {
  8563. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8564. j = i >> 14 & 0x7fff;
  8565. k = i1 & 0x1f;
  8566. l = i1 >> 6;
  8567. }
  8568. class30_sub1.anInt1299 = j;
  8569. class30_sub1.anInt1301 = k;
  8570. class30_sub1.anInt1300 = l;
  8571. }
  8572.  
  8573. private void method90()
  8574. {
  8575. for(int i = 0; i < anInt1062; i++)
  8576. if(anIntArray1250[i] <= 0)
  8577. {
  8578. boolean flag1 = false;
  8579. try
  8580. {
  8581. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  8582. {
  8583. if(!replayWave())
  8584. flag1 = true;
  8585. } else
  8586. {
  8587. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  8588. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  8589. {
  8590. anInt1257 = stream.currentOffset;
  8591. aLong1172 = System.currentTimeMillis();
  8592. if(saveWave(stream.buffer, stream.currentOffset))
  8593. {
  8594. anInt874 = anIntArray1207[i];
  8595. anInt1289 = anIntArray1241[i];
  8596. } else
  8597. {
  8598. flag1 = true;
  8599. }
  8600. }
  8601. }
  8602. }
  8603. catch(Exception exception) { }
  8604. if(!flag1 || anIntArray1250[i] == -5)
  8605. {
  8606. anInt1062--;
  8607. for(int j = i; j < anInt1062; j++)
  8608. {
  8609. anIntArray1207[j] = anIntArray1207[j + 1];
  8610. anIntArray1241[j] = anIntArray1241[j + 1];
  8611. anIntArray1250[j] = anIntArray1250[j + 1];
  8612. }
  8613.  
  8614. i--;
  8615. } else
  8616. {
  8617. anIntArray1250[i] = -5;
  8618. }
  8619. } else
  8620. {
  8621. anIntArray1250[i]--;
  8622. }
  8623.  
  8624. if(prevSong > 0)
  8625. {
  8626. prevSong -= 20;
  8627. if(prevSong < 0)
  8628. prevSong = 0;
  8629. if(prevSong == 0 && musicEnabled && !lowMem)
  8630. {
  8631. nextSong = currentSong;
  8632. songChanging = true;
  8633. onDemandFetcher.method558(2, nextSong);
  8634. }
  8635. }
  8636. }
  8637.  
  8638. /* public static void compress(int ID) {
  8639. try {
  8640. String inF = "C:/DSPK/gzip/"+ ID +".dat";
  8641. String outF = "C:/DSPK/gzip/"+ ID;
  8642. File inF2 = new File(inF);
  8643. File outF2 = new File(outF);
  8644. System.out.println("GZipping: " + inF2 + " file");
  8645. FileOutputStream FOS = new FileOutputStream(outF2 + ".gz");
  8646. GZIPOutputStream GZOS = new GZIPOutputStream(FOS);
  8647. FileInputStream FIN = new FileInputStream(inF2);
  8648. BufferedInputStream IN = new BufferedInputStream(FIN);
  8649. byte[] buffer = new byte[1024];
  8650. int i;
  8651. while ((i = IN.read(buffer)) >= 0) {
  8652. GZOS.write(buffer, 0, i);
  8653. }
  8654. System.out.println("File has been GZipped succesfully");
  8655. IN.close();
  8656. GZOS.close();
  8657. }
  8658. catch(IOException e) {
  8659. System.out.println("Error: " + e);
  8660. }
  8661. compress(ID + 1);
  8662. }
  8663. void main() {
  8664. compress(29);
  8665. }*/
  8666.  
  8667.  
  8668. void startUp()
  8669. {
  8670. //main();
  8671. //models();
  8672. drawSmoothLoading(32, "Starting up");
  8673. new CacheDownloader(this).downloadCache();
  8674. setNewMaps();
  8675. if(signlink.sunjava)
  8676. super.minDelay = 5;
  8677. aBoolean993 = true;
  8678. String s = getDocumentBaseHost();
  8679. if(signlink.cache_dat != null) {
  8680. for(int i = 0; i < 5; i++)
  8681. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  8682. }
  8683. try {
  8684. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  8685. smallText = new RSFont(false, "p11_full", titleStreamLoader);
  8686. aTextDrawingArea_1271 = new RSFont(false, "p12_full", titleStreamLoader);
  8687. chatTextDrawingArea = new RSFont(false, "b12_full", titleStreamLoader);
  8688. RSFont aTextDrawingArea_1273 = new RSFont(true, "q8_full", titleStreamLoader);
  8689.  
  8690. newSmallFont = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8691. newRegularFont = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8692. newBoldFont = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8693. newFancyFont = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8694. //UserInterface.fonts = newFonts;
  8695. newSmallFont.unpackChatImages(chatImages);
  8696. newRegularFont.unpackChatImages(chatImages);
  8697. newBoldFont.unpackChatImages(chatImages);
  8698. newFancyFont.unpackChatImages(chatImages);
  8699.  
  8700. drawLogo();
  8701. loadTitleScreen();
  8702. NamedArchive archive = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8703. NamedArchive streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8704. NamedArchive mediaArchive = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8705. NamedArchive streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8706. NamedArchive streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8707. NamedArchive streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8708. byteGroundArray = new byte[4][104][104];
  8709. intGroundArray = new int[4][105][105];
  8710. worldController = new WorldController(intGroundArray);
  8711. for(int j = 0; j < 4; j++)
  8712. aClass11Array1230[j] = new Class11();
  8713. aSprite_1263 = new Sprite(512, 512);
  8714. NamedArchive streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  8715. drawSmoothLoading(48, "Connecting to update server");
  8716. onDemandFetcher = new OnDemandFetcher();
  8717. onDemandFetcher.start(streamLoader_6, this);
  8718. Class36.method528(onDemandFetcher.getAnimCount());
  8719. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8720. preloadModels();
  8721. /* All 525 Models */
  8722. ModelDecompressor.hdgfx();
  8723. ModelDecompressor.models();
  8724. System.out.println("Loaded 525 graphics...");
  8725. /* 525 End */
  8726. ModelDecompressor.loadModelDataFile();
  8727. drawSmoothLoading(112, "Unpacking media");
  8728. DataBase.loadAnimations();
  8729.  
  8730. /* Custom sprite unpacking */
  8731. for(int i = 0; i <= 3; i++) {
  8732. combatIcons[i] = new Sprite("Player/combatIcon "+i+"");
  8733. }
  8734. loadExtraSprites();
  8735. loadingPleaseWait = new Sprite("loadingPleaseWait");
  8736. reestablish = new Sprite("reestablish");
  8737. hitMarks[20] = new Sprite("hitMark");
  8738. //hitMarks[21] = new Sprite("hitMark2");
  8739. compass = new Sprite(mediaArchive, "compass", 0);
  8740. mapArea = new Sprite("maparea");
  8741. backgroundFix = new Sprite("background");
  8742. oldHit = new Sprite("GameFrame/hit");
  8743. oldBlue = new Sprite("GameFrame/def");
  8744. oldGreen = new Sprite("GameFrame/poison");
  8745. multiOverlay = new Sprite(mediaArchive, "overlay_multiway", 0);
  8746. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", 1);
  8747. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 1.PNG", 1);
  8748. /**/
  8749.  
  8750. mapBack = new Background(mediaArchive, "mapback", 0);
  8751. for(int c1 = 0; c1 <= 3; c1++)
  8752. chatButtons[c1] = new Sprite(mediaArchive, "chatbuttons", c1);
  8753.  
  8754. for(int j3 = 0; j3 <= 13; j3++)
  8755. sideIcons[j3] = new Sprite(mediaArchive, "sideicons", j3);
  8756.  
  8757. for(int j3 = 0; j3 <= 13; j3++)
  8758. sIcons483[j3] = new Sprite("Gameframe/SIcons/483/"+j3+"");
  8759.  
  8760. for(int j3 = 0; j3 <= 12; j3++)
  8761. sIcons459[j3] = new Sprite("Gameframe/SIcons/459/SIDEICONS "+j3+"");
  8762.  
  8763. for(int nSI = 0; nSI <= 15; nSI++)
  8764. newSideIcons[nSI] = new Sprite("Gameframe/SIcons/562/icon "+nSI);
  8765.  
  8766. tabHover = new Sprite("Gameframe/SIcons/562/tabhover");
  8767. tabClicked = new Sprite("Gameframe/SIcons/562/tabclicked1");
  8768.  
  8769. for(int r1 = 0; r1 < 15; r1++)
  8770. redStones[r1] = new Sprite("redstones " + r1);
  8771. mapEdge = new Sprite(mediaArchive, "mapedge", 0);
  8772. mapEdge.method345();
  8773. try
  8774. {
  8775. for(int k3 = 0; k3 < 100; k3++)
  8776. mapScenes[k3] = new Background(mediaArchive, "mapscene", k3);
  8777. }
  8778. catch(Exception _ex) { }
  8779. try
  8780. {
  8781. for(int l3 = 0; l3 < 100; l3++)
  8782. mapFunctions[l3] = new Sprite(mediaArchive, "mapfunction", l3);
  8783. }
  8784. catch(Exception _ex) { }
  8785. try
  8786. {
  8787. for(int i4 = 0; i4 < 20; i4++)
  8788. hitMarks[i4] = new Sprite(mediaArchive, "hitmarks", i4);
  8789. }
  8790. catch(Exception _ex) { }
  8791. try
  8792. {
  8793. for(int h1 = 0; h1 < 6; h1++)
  8794. headIconsHint[h1] = new Sprite(mediaArchive, "headicons_hint", h1);
  8795. } catch(Exception _ex) { }
  8796. try {
  8797. for(int j4 = 0; j4 < 8; j4++)
  8798. headIcons[j4] = new Sprite(mediaArchive, "headicons_prayer", j4);
  8799. for(int idx = 0; idx < 18; idx++)
  8800. headIcons[idx] = new Sprite("Player/Prayer/Prayer "+idx);
  8801. for(int j45 = 0; j45 < 3; j45++)
  8802. skullIcons[j45] = new Sprite(mediaArchive, "headicons_pk", j45 );
  8803. }
  8804. catch(Exception _ex) { }
  8805. mapFlag = new Sprite(mediaArchive, "mapmarker", 0);
  8806. mapMarker = new Sprite(mediaArchive, "mapmarker", 1);
  8807. for(int k4 = 0; k4 < 8; k4++)
  8808. crosses[k4] = new Sprite(mediaArchive, "cross", k4);
  8809.  
  8810. mapDotItem = new Sprite(mediaArchive, "mapdots", 0);
  8811. mapDotNPC = new Sprite(mediaArchive, "mapdots", 1);
  8812. mapDotPlayer = new Sprite(mediaArchive, "mapdots", 2);
  8813. mapDotFriend = new Sprite(mediaArchive, "mapdots", 3);
  8814. mapDotTeam = new Sprite(mediaArchive, "mapdots", 4);
  8815. mapDotClan = new Sprite(mediaArchive, "mapdots", 5);
  8816.  
  8817. scrollBar1 = new Sprite(mediaArchive, "scrollbar", 0);
  8818. scrollBar2 = new Sprite(mediaArchive, "scrollbar", 1);
  8819. alertBack = new Sprite("alertback");
  8820. alertBorder = new Sprite("alertborder");
  8821. alertBorderH = new Sprite("alertborderh");
  8822. scrollBar3 = new Sprite("Gameframe/SCROLLBAR 0");
  8823. scrollBar4 = new Sprite("Gameframe/SCROLLBAR 1");
  8824.  
  8825. Sprite sprite = new Sprite(mediaArchive, "screenframe", 0);
  8826. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8827. sprite.method346(0, 0);
  8828. sprite = new Sprite(mediaArchive, "screenframe", 1);
  8829. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8830. sprite.method346(0, 0);
  8831. sprite = new Sprite(mediaArchive, "screenframe", 2);
  8832. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8833. sprite.method346(0, 0);
  8834. sprite = new Sprite(mediaArchive, "mapedge", 0);
  8835. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8836. sprite.method346(0, 0);
  8837.  
  8838. int i5 = (int)(Math.random() * 21D) - 10;
  8839. int j5 = (int)(Math.random() * 21D) - 10;
  8840. int k5 = (int)(Math.random() * 21D) - 10;
  8841. int l5 = (int)(Math.random() * 41D) - 20;
  8842. for(int i6 = 0; i6 < 100; i6++)
  8843. {
  8844. if(mapFunctions[i6] != null)
  8845. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8846. if(mapScenes[i6] != null)
  8847. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8848. }
  8849. drawSmoothLoading(128, "Unpacking textures");
  8850. Texture.method368(streamLoader_3);
  8851. Texture.method372(0.80000000000000004D);
  8852. Texture.method367();
  8853. drawSmoothLoading(144, "Unpacking config");
  8854. try {
  8855. Animation.unpackConfig(archive);
  8856. ObjectDef.unpackConfig(archive);
  8857. Flo.unpackConfig(archive);
  8858. ItemDef.unpackConfig(archive);
  8859. EntityDef.unpackConfig(archive);
  8860. IdentityKit.unpackConfig(archive);
  8861. SpotAnim.unpackConfig(archive);
  8862. Varp.unpackConfig(archive);
  8863. VarBit.unpackConfig(archive);
  8864. ItemDef.isMembers = true;
  8865. } catch(Exception e) {
  8866. e.printStackTrace();
  8867. }
  8868. drawSmoothLoading(176, "Unpacking interfaces");
  8869. RSFont aclass30_sub2_sub1_sub4s[] = {
  8870. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  8871. };
  8872. RSInterface.fonts = aclass30_sub2_sub1_sub4s;
  8873. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, mediaArchive);
  8874. drawSmoothLoading(194, "Preparing game engine");
  8875. for(int j6 = 0; j6 < 33; j6++)
  8876. {
  8877. int k6 = 999;
  8878. int i7 = 0;
  8879. for(int k7 = 0; k7 < 34; k7++)
  8880. {
  8881. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  8882. {
  8883. if(k6 == 999)
  8884. k6 = k7;
  8885. continue;
  8886. }
  8887. if(k6 == 999)
  8888. continue;
  8889. i7 = k7;
  8890. break;
  8891. }
  8892.  
  8893. anIntArray968[j6] = k6;
  8894. anIntArray1057[j6] = i7 - k6;
  8895. }
  8896. for (int l6 = 1; l6 < 153; l6++) {
  8897. int j7 = 999;
  8898. int l7 = 0;
  8899. for (int j8 = 24; j8 < 177; j8++) {
  8900. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  8901. if (j7 == 999) {
  8902. j7 = j8;
  8903. }
  8904. continue;
  8905. }
  8906. if (j7 == 999) {
  8907. continue;
  8908. }
  8909. l7 = j8;
  8910. break;
  8911. }
  8912.  
  8913. anIntArray1052[l6 - 1] = j7 - 24;
  8914. anIntArray1229[l6 - 1] = l7 - j7;
  8915. }
  8916. Texture.method365(765, 503);
  8917. fullScreenTextureArray = Texture.anIntArray1472;
  8918. Texture.method365(516, 165);//519
  8919. anIntArray1180 = Texture.anIntArray1472;
  8920. Texture.method365(250, 335);
  8921. anIntArray1181 = Texture.anIntArray1472;
  8922. Texture.method365(512, 334);//512 334
  8923. anIntArray1182 = Texture.anIntArray1472;
  8924.  
  8925. int ai[] = new int[9];
  8926. for(int i8 = 0; i8 < 9; i8++)
  8927. {
  8928. int k8 = 128 + i8 * 32 + 15;
  8929. int l8 = 600 + k8 * 3;
  8930. int i9 = Texture.anIntArray1470[k8];
  8931. ai[i8] = l8 * i9 >> 16;
  8932. }
  8933.  
  8934. WorldController.method310(500, 800, 512, 334, ai);
  8935.  
  8936. Censor.loadConfig(streamLoader_4);
  8937. mouseDetection = new MouseDetection(this);
  8938. startRunnable(mouseDetection, 10);
  8939. Animable_Sub5.clientInstance = this;
  8940. ObjectDef.clientInstance = this;
  8941. EntityDef.clientInstance = this;
  8942. return;
  8943. }
  8944. catch(Exception exception)
  8945. {
  8946. exception.printStackTrace();
  8947. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8948. }
  8949. loadingError = true;
  8950. }
  8951.  
  8952. private void method91(Stream stream, int i)
  8953. {
  8954. while(stream.bitPosition + 10 < i * 8)
  8955. {
  8956. int j = stream.readBits(11);
  8957. if(j == 2047)
  8958. break;
  8959. if(playerArray[j] == null)
  8960. {
  8961. playerArray[j] = new Player();
  8962. if(aStreamArray895s[j] != null)
  8963. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8964. }
  8965. playerIndices[playerCount++] = j;
  8966. Player player = playerArray[j];
  8967. player.anInt1537 = loopCycle;
  8968. int k = stream.readBits(1);
  8969. if(k == 1)
  8970. anIntArray894[anInt893++] = j;
  8971. int l = stream.readBits(1);
  8972. int i1 = stream.readBits(5);
  8973. if(i1 > 15)
  8974. i1 -= 32;
  8975. int j1 = stream.readBits(5);
  8976. if(j1 > 15)
  8977. j1 -= 32;
  8978. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  8979. }
  8980. stream.finishBitAccess();
  8981. }
  8982.  
  8983. private void processMainScreenClick() {
  8984. if(anInt1021 != 0)
  8985. return;
  8986. if(super.clickMode3 == 1) {
  8987. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  8988. int i = super.saveClickX - 25 - 530;//
  8989. int j = super.saveClickY - 8;
  8990. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  8991. i -= 73;
  8992. j -= 75;
  8993. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8994. int i1 = Texture.anIntArray1470[k];
  8995. int j1 = Texture.anIntArray1471[k];
  8996. i1 = i1 * (minimapInt3 + 256) >> 8;
  8997. j1 = j1 * (minimapInt3 + 256) >> 8;
  8998. int k1 = j * i1 + i * j1 >> 11;
  8999. int l1 = j * j1 - i * i1 >> 11;
  9000. int i2 = myPlayer.x + k1 >> 7;
  9001. int j2 = myPlayer.y - l1 >> 7;
  9002. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9003. if(flag1) {
  9004. stream.writeWordBigEndian(i);
  9005. stream.writeWordBigEndian(j);
  9006. stream.writeWord(minimapInt1);
  9007. stream.writeWordBigEndian(57);
  9008. stream.writeWordBigEndian(minimapInt2);
  9009. stream.writeWordBigEndian(minimapInt3);
  9010. stream.writeWordBigEndian(89);
  9011. stream.writeWord(myPlayer.x);
  9012. stream.writeWord(myPlayer.y);
  9013. stream.writeWordBigEndian(anInt1264);
  9014. stream.writeWordBigEndian(63);
  9015. }
  9016. }
  9017. } else {
  9018. int i = super.saveClickX - 25 - 545;//545
  9019. int j = super.saveClickY - 5 - 4;
  9020. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  9021. i -= 73;
  9022. j -= 75;
  9023. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9024. int i1 = Texture.anIntArray1470[k];
  9025. int j1 = Texture.anIntArray1471[k];
  9026. i1 = i1 * (minimapInt3 + 256) >> 8;
  9027. j1 = j1 * (minimapInt3 + 256) >> 8;
  9028. int k1 = j * i1 + i * j1 >> 11;
  9029. int l1 = j * j1 - i * i1 >> 11;
  9030. int i2 = myPlayer.x + k1 >> 7;
  9031. int j2 = myPlayer.y - l1 >> 7;
  9032. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9033. if(flag1) {
  9034. stream.writeWordBigEndian(i);
  9035. stream.writeWordBigEndian(j);
  9036. stream.writeWord(minimapInt1);
  9037. stream.writeWordBigEndian(57);
  9038. stream.writeWordBigEndian(minimapInt2);
  9039. stream.writeWordBigEndian(minimapInt3);
  9040. stream.writeWordBigEndian(89);
  9041. stream.writeWord(myPlayer.x);
  9042. stream.writeWord(myPlayer.y);
  9043. stream.writeWordBigEndian(anInt1264);
  9044. stream.writeWordBigEndian(63);
  9045. }
  9046. }
  9047. }
  9048. anInt1117++;
  9049. if(anInt1117 > 1151) {
  9050. anInt1117 = 0;
  9051. stream.createFrame(246);
  9052. stream.writeWordBigEndian(0);
  9053. int l = stream.currentOffset;
  9054. if((int)(Math.random() * 2D) == 0)
  9055. stream.writeWordBigEndian(101);
  9056. stream.writeWordBigEndian(197);
  9057. stream.writeWord((int)(Math.random() * 65536D));
  9058. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9059. stream.writeWordBigEndian(67);
  9060. stream.writeWord(14214);
  9061. if((int)(Math.random() * 2D) == 0)
  9062. stream.writeWord(29487);
  9063. stream.writeWord((int)(Math.random() * 65536D));
  9064. if((int)(Math.random() * 2D) == 0)
  9065. stream.writeWordBigEndian(220);
  9066. stream.writeWordBigEndian(180);
  9067. stream.writeBytes(stream.currentOffset - l);
  9068. }
  9069. }
  9070. }
  9071.  
  9072. private String interfaceIntToString(int j) {
  9073. if(j < 0x3b9ac9ff)
  9074. return String.valueOf(j);
  9075. else
  9076. return "*";
  9077. }
  9078.  
  9079. private void showErrorScreen()
  9080. {
  9081. Graphics g = getGameComponent().getGraphics();
  9082. g.setColor(Color.black);
  9083. g.fillRect(0, 0, 765, 503);
  9084. method4(1);
  9085. if(loadingError)
  9086. {
  9087. aBoolean831 = false;
  9088. g.setFont(new Font("Helvetica", 1, 16));
  9089. g.setColor(Color.yellow);
  9090. int k = 35;
  9091. g.drawString("Sorry, an error has occured whilst loading Universalscape.", 30, k);
  9092. k += 50;
  9093. g.setColor(Color.white);
  9094. g.drawString("To fix this try the following (in order):", 30, k);
  9095. k += 50;
  9096. g.setColor(Color.white);
  9097. g.setFont(new Font("Helvetica", 1, 12));
  9098. g.drawString("1: Try closing and reopening the client and/or web browser", 30, k);
  9099. k += 30;
  9100. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  9101. k += 30;
  9102. g.drawString("3: Try rebooting your computer", 30, k);
  9103. k += 30;
  9104. g.drawString(" ", 30, k);
  9105. k += 30;
  9106. g.drawString("If problems still occur, visit the forums at Http://www.universalscape.comyr.com/ and request help", 30, k);
  9107. }
  9108. if(genericLoadingError)
  9109. {
  9110. aBoolean831 = false;
  9111. g.setFont(new Font("Helvetica", 1, 20));
  9112. g.setColor(Color.white);
  9113. g.drawString("Error - unable to load game!", 50, 50);
  9114. g.drawString("To play Universalscape make sure you play from", 50, 100);
  9115. g.drawString("http://www.universalscape.comyr.com/", 50, 150);
  9116. }
  9117. if(rsAlreadyLoaded)
  9118. {
  9119. aBoolean831 = false;
  9120. g.setColor(Color.yellow);
  9121. int l = 35;
  9122. g.drawString("Error a copy of Universalscape already appears to be loaded", 30, l);
  9123. l += 50;
  9124. g.setColor(Color.white);
  9125. g.drawString("To fix this try the following (in order):", 30, l);
  9126. l += 50;
  9127. g.setColor(Color.white);
  9128. g.setFont(new Font("Helvetica", 1, 12));
  9129. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  9130. l += 30;
  9131. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  9132. l += 30;
  9133. }
  9134. }
  9135.  
  9136. public URL getCodeBase() {
  9137.  
  9138.  
  9139. try {
  9140. return new URL(server +":" + (80 + portOff));
  9141. } catch(Exception _ex) {
  9142. }
  9143. return null;
  9144. }
  9145.  
  9146. private void method95() {
  9147. for(int j = 0; j < npcCount; j++) {
  9148. int k = npcIndices[j];
  9149. NPC npc = npcArray[k];
  9150. if(npc != null)
  9151. method96(npc);
  9152. }
  9153. }
  9154.  
  9155. private void method96(Entity entity)
  9156. {
  9157. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  9158. {
  9159. entity.anim = -1;
  9160. entity.anInt1520 = -1;
  9161. entity.anInt1547 = 0;
  9162. entity.anInt1548 = 0;
  9163. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9164. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9165. entity.method446();
  9166. }
  9167. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  9168. {
  9169. entity.anim = -1;
  9170. entity.anInt1520 = -1;
  9171. entity.anInt1547 = 0;
  9172. entity.anInt1548 = 0;
  9173. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9174. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9175. entity.method446();
  9176. }
  9177. if(entity.anInt1547 > loopCycle)
  9178. method97(entity);
  9179. else
  9180. if(entity.anInt1548 >= loopCycle)
  9181. method98(entity);
  9182. else
  9183. method99(entity);
  9184. method100(entity);
  9185. method101(entity);
  9186. }
  9187.  
  9188. private void method97(Entity entity)
  9189. {
  9190. int i = entity.anInt1547 - loopCycle;
  9191. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9192. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9193. entity.x += (j - entity.x) / i;
  9194. entity.y += (k - entity.y) / i;
  9195. entity.anInt1503 = 0;
  9196. if(entity.anInt1549 == 0)
  9197. entity.turnDirection = 1024;
  9198. if(entity.anInt1549 == 1)
  9199. entity.turnDirection = 1536;
  9200. if(entity.anInt1549 == 2)
  9201. entity.turnDirection = 0;
  9202. if(entity.anInt1549 == 3)
  9203. entity.turnDirection = 512;
  9204. }
  9205.  
  9206. private void method98(Entity entity)
  9207. {
  9208. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  9209. {
  9210. int i = entity.anInt1548 - entity.anInt1547;
  9211. int j = loopCycle - entity.anInt1547;
  9212. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9213. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9214. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9215. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9216. entity.x = (k * (i - j) + i1 * j) / i;
  9217. entity.y = (l * (i - j) + j1 * j) / i;
  9218. }
  9219. entity.anInt1503 = 0;
  9220. if(entity.anInt1549 == 0)
  9221. entity.turnDirection = 1024;
  9222. if(entity.anInt1549 == 1)
  9223. entity.turnDirection = 1536;
  9224. if(entity.anInt1549 == 2)
  9225. entity.turnDirection = 0;
  9226. if(entity.anInt1549 == 3)
  9227. entity.turnDirection = 512;
  9228. entity.anInt1552 = entity.turnDirection;
  9229. }
  9230.  
  9231. private void method99(Entity entity)
  9232. {
  9233. entity.anInt1517 = entity.anInt1511;
  9234. if(entity.smallXYIndex == 0)
  9235. {
  9236. entity.anInt1503 = 0;
  9237. return;
  9238. }
  9239. if(entity.anim != -1 && entity.anInt1529 == 0)
  9240. {
  9241. Animation animation = Animation.anims[entity.anim];
  9242. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  9243. {
  9244. entity.anInt1503++;
  9245. return;
  9246. }
  9247. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  9248. {
  9249. entity.anInt1503++;
  9250. return;
  9251. }
  9252. }
  9253. int i = entity.x;
  9254. int j = entity.y;
  9255. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9256. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9257. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  9258. {
  9259. entity.x = k;
  9260. entity.y = l;
  9261. return;
  9262. }
  9263. if(i < k)
  9264. {
  9265. if(j < l)
  9266. entity.turnDirection = 1280;
  9267. else
  9268. if(j > l)
  9269. entity.turnDirection = 1792;
  9270. else
  9271. entity.turnDirection = 1536;
  9272. } else
  9273. if(i > k)
  9274. {
  9275. if(j < l)
  9276. entity.turnDirection = 768;
  9277. else
  9278. if(j > l)
  9279. entity.turnDirection = 256;
  9280. else
  9281. entity.turnDirection = 512;
  9282. } else
  9283. if(j < l)
  9284. entity.turnDirection = 1024;
  9285. else
  9286. entity.turnDirection = 0;
  9287. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9288. if(i1 > 1024)
  9289. i1 -= 2048;
  9290. int j1 = entity.anInt1555;
  9291. if(i1 >= -256 && i1 <= 256)
  9292. j1 = entity.anInt1554;
  9293. else
  9294. if(i1 >= 256 && i1 < 768)
  9295. j1 = entity.anInt1557;
  9296. else
  9297. if(i1 >= -768 && i1 <= -256)
  9298. j1 = entity.anInt1556;
  9299. if(j1 == -1)
  9300. j1 = entity.anInt1554;
  9301. entity.anInt1517 = j1;
  9302. int k1 = 4;
  9303. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9304. k1 = 2;
  9305. if(entity.smallXYIndex > 2)
  9306. k1 = 6;
  9307. if(entity.smallXYIndex > 3)
  9308. k1 = 8;
  9309. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  9310. {
  9311. k1 = 8;
  9312. entity.anInt1503--;
  9313. }
  9314. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9315. k1 <<= 1;
  9316. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  9317. entity.anInt1517 = entity.anInt1505;
  9318. if(i < k)
  9319. {
  9320. entity.x += k1;
  9321. if(entity.x > k)
  9322. entity.x = k;
  9323. } else
  9324. if(i > k)
  9325. {
  9326. entity.x -= k1;
  9327. if(entity.x < k)
  9328. entity.x = k;
  9329. }
  9330. if(j < l)
  9331. {
  9332. entity.y += k1;
  9333. if(entity.y > l)
  9334. entity.y = l;
  9335. } else
  9336. if(j > l)
  9337. {
  9338. entity.y -= k1;
  9339. if(entity.y < l)
  9340. entity.y = l;
  9341. }
  9342. if(entity.x == k && entity.y == l)
  9343. {
  9344. entity.smallXYIndex--;
  9345. if(entity.anInt1542 > 0)
  9346. entity.anInt1542--;
  9347. }
  9348. }
  9349.  
  9350. private void method100(Entity entity)
  9351. {
  9352. if(entity.anInt1504 == 0)
  9353. return;
  9354. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  9355. {
  9356. NPC npc = npcArray[entity.interactingEntity];
  9357. if(npc != null)
  9358. {
  9359. int i1 = entity.x - npc.x;
  9360. int k1 = entity.y - npc.y;
  9361. if(i1 != 0 || k1 != 0)
  9362. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9363. }
  9364. }
  9365. if(entity.interactingEntity >= 32768)
  9366. {
  9367. int j = entity.interactingEntity - 32768;
  9368. if(j == unknownInt10)
  9369. j = myPlayerIndex;
  9370. Player player = playerArray[j];
  9371. if(player != null)
  9372. {
  9373. int l1 = entity.x - player.x;
  9374. int i2 = entity.y - player.y;
  9375. if(l1 != 0 || i2 != 0)
  9376. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9377. }
  9378. }
  9379. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  9380. {
  9381. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9382. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9383. if(k != 0 || j1 != 0)
  9384. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9385. entity.anInt1538 = 0;
  9386. entity.anInt1539 = 0;
  9387. }
  9388. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9389. if(l != 0)
  9390. {
  9391. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9392. entity.anInt1552 = entity.turnDirection;
  9393. else
  9394. if(l > 1024)
  9395. entity.anInt1552 -= entity.anInt1504;
  9396. else
  9397. entity.anInt1552 += entity.anInt1504;
  9398. entity.anInt1552 &= 0x7ff;
  9399. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  9400. {
  9401. if(entity.anInt1512 != -1)
  9402. {
  9403. entity.anInt1517 = entity.anInt1512;
  9404. return;
  9405. }
  9406. entity.anInt1517 = entity.anInt1554;
  9407. }
  9408. }
  9409. }
  9410.  
  9411. private void method101(Entity entity)
  9412. {
  9413. entity.aBoolean1541 = false;
  9414. if(entity.anInt1517 != -1)
  9415. {
  9416. Animation animation = Animation.anims[entity.anInt1517];
  9417. entity.anInt1519++;
  9418. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  9419. {
  9420. entity.anInt1519 = 0;
  9421. entity.anInt1518++;
  9422. }
  9423. if(entity.anInt1518 >= animation.anInt352)
  9424. {
  9425. entity.anInt1519 = 0;
  9426. entity.anInt1518 = 0;
  9427. }
  9428. }
  9429. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  9430. {
  9431. if(entity.anInt1521 < 0)
  9432. entity.anInt1521 = 0;
  9433. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9434. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)//huhhhhh
  9435. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9436.  
  9437. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9438. entity.anInt1520 = -1;
  9439. }
  9440. if(entity.anim != -1 && entity.anInt1529 <= 1)
  9441. {
  9442. Animation animation_2 = Animation.anims[entity.anim];
  9443. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  9444. {
  9445. entity.anInt1529 = 1;
  9446. return;
  9447. }
  9448. }
  9449. if(entity.anim != -1 && entity.anInt1529 == 0)
  9450. {
  9451. Animation animation_3 = Animation.anims[entity.anim];
  9452. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  9453. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9454.  
  9455. if(entity.anInt1527 >= animation_3.anInt352)
  9456. {
  9457. entity.anInt1527 -= animation_3.anInt356;
  9458. entity.anInt1530++;
  9459. if(entity.anInt1530 >= animation_3.anInt362)
  9460. entity.anim = -1;
  9461. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  9462. entity.anim = -1;
  9463. }
  9464. entity.aBoolean1541 = animation_3.aBoolean358;
  9465. }
  9466. if(entity.anInt1529 > 0)
  9467. entity.anInt1529--;
  9468. }
  9469.  
  9470. private void drawGameScreen()
  9471. {
  9472. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  9473. if (loadingStage == 2) {
  9474. method119(anInt945, fullscreenInterfaceID);
  9475. if (openInterfaceID != -1) {
  9476. method119(anInt945, openInterfaceID);
  9477. }
  9478. anInt945 = 0;
  9479. resetAllImageProducers();
  9480. super.fullGameScreen.initDrawingArea();
  9481. Texture.anIntArray1472 = fullScreenTextureArray;
  9482. DrawingArea.setAllPixelsToZero();
  9483. welcomeScreenRaised = true;
  9484. if (openInterfaceID != -1) {
  9485. RSInterface class9_1 = RSInterface.interfaceCache[openInterfaceID];
  9486. if (class9_1.width == 512 && class9_1.height == 334 && class9_1.interfaceType == 0) {
  9487. class9_1.width = 765;
  9488. class9_1.height = 503;
  9489. }
  9490. drawInterface(0, 0, class9_1, 8);
  9491. }
  9492. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9493. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.interfaceType == 0) {
  9494. rsInterface.width = 765;
  9495. rsInterface.height = 503;
  9496. }
  9497. drawInterface(0, 0, rsInterface, 8);
  9498.  
  9499. if (!menuOpen) {
  9500. processRightClick();
  9501. drawTooltip();
  9502. } else {
  9503. drawMenu(0, 0);
  9504. }
  9505. }
  9506. drawCount++;
  9507. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9508. return;
  9509. } else {
  9510. if (drawCount != 0) {
  9511. resetImageProducers2();
  9512. }
  9513. }
  9514. if(welcomeScreenRaised) {
  9515. welcomeScreenRaised = false;
  9516. topFrame.drawGraphics(0, super.graphics, 0);
  9517. leftFrame.drawGraphics(4, super.graphics, 0);
  9518. //rightFrame.drawGraphics(4, super.graphics, 516);
  9519. //mapEdgeIP.drawGraphics(4, super.graphics, 516);//519
  9520. needDrawTabArea = true;
  9521. inputTaken = true;
  9522. tabAreaAltered = true;
  9523. aBoolean1233 = true;
  9524.  
  9525. if(loadingStage != 2) {
  9526. inGameScreen.drawGraphics(4, super.graphics, 4);
  9527. mapBackImage.drawGraphics(0, super.graphics, 516);//545
  9528.  
  9529. }
  9530. }
  9531. if(menuOpen)
  9532. needDrawTabArea = true;
  9533. if(menuOpen)
  9534. drawMenu(4,4);
  9535.  
  9536. if(invOverlayInterfaceID != -1)
  9537. {
  9538. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9539. if(flag1)
  9540. needDrawTabArea = true;
  9541. }
  9542. if(atInventoryInterfaceType == 2)
  9543. needDrawTabArea = true;
  9544. if(activeInterfaceType == 2)
  9545. needDrawTabArea = true;
  9546. drawTabArea();
  9547. if(loadingStage == 2) {
  9548. method146();
  9549. }
  9550. if(backDialogID == -1)
  9551. {
  9552. if(is474 || is480 || is508 || is525 || is562) {
  9553. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  9554. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  9555. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  9556. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  9557. if(i < 0)
  9558. i = 0;
  9559. if(i > anInt1211 - 110)
  9560. i = anInt1211 - 110;
  9561. if(anInt1089 != i) {
  9562. anInt1089 = i;
  9563. inputTaken = true;
  9564. }
  9565. } else {
  9566. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 77;
  9567. if(super.mouseX > 448 && super.mouseX < 560 && super.mouseY > 332)
  9568. method65(463, 77, super.mouseX - 17, super.mouseY - 357, aClass9_1059, 0, false, anInt1211);
  9569. int i = anInt1211 - 77 - aClass9_1059.scrollPosition;
  9570. if(i < 0)
  9571. i = 0;
  9572. if(i > anInt1211 - 77)
  9573. i = anInt1211 - 77;
  9574. if(anInt1089 != i) {
  9575. anInt1089 = i;
  9576. inputTaken = true;
  9577. }
  9578. }
  9579. }
  9580. if(backDialogID != -1) {
  9581. boolean flag2 = method119(anInt945, backDialogID);
  9582. if(flag2)
  9583. inputTaken = true;
  9584. }
  9585. if(atInventoryInterfaceType == 3)
  9586. inputTaken = true;
  9587. if(activeInterfaceType == 3)
  9588. inputTaken = true;
  9589. if(aString844 != null)
  9590. inputTaken = true;
  9591. if(menuOpen && menuScreenArea == 2)
  9592. inputTaken = true;
  9593. if(inputTaken) {
  9594. drawChatArea();
  9595. inputTaken = false;
  9596. }
  9597. if(loadingStage == 2) {
  9598. drawMinimap();
  9599. mapBackImage.drawGraphics(0, super.graphics, 516);//545
  9600. }
  9601. if(anInt1054 != -1)
  9602. tabAreaAltered = true;
  9603. if(tabAreaAltered)
  9604. {
  9605. if(anInt1054 != -1 && anInt1054 == tabID)
  9606. {
  9607. anInt1054 = -1;
  9608. stream.createFrame(120);
  9609. stream.writeWordBigEndian(tabID);
  9610. }
  9611. tabAreaAltered = false;
  9612. aRSImageProducer_1125.initDrawingArea();
  9613. inGameScreen.initDrawingArea();
  9614. }
  9615. if(menuOpen){
  9616. drawMenu(516, 466);
  9617. }
  9618. anInt945 = 0;
  9619. }
  9620.  
  9621. private boolean buildFriendsListMenu(RSInterface class9)
  9622. {
  9623. int i = class9.contentType;
  9624. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  9625. {
  9626. if(i >= 801)
  9627. i -= 701;
  9628. else
  9629. if(i >= 701)
  9630. i -= 601;
  9631. else
  9632. if(i >= 101)
  9633. i -= 101;
  9634. else
  9635. i--;
  9636. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9637. menuActionID[menuActionRow] = 792;
  9638. menuActionRow++;
  9639. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9640. menuActionID[menuActionRow] = 639;
  9641. menuActionRow++;
  9642. return true;
  9643. }
  9644. if(i >= 401 && i <= 500)
  9645. {
  9646. menuActionName[menuActionRow] = "Remove @whi@" + class9.disabledMessage;
  9647. menuActionID[menuActionRow] = 322;
  9648. menuActionRow++;
  9649. return true;
  9650. } else
  9651. {
  9652. return false;
  9653. }
  9654. }
  9655.  
  9656. private void method104()
  9657. {
  9658. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  9659. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  9660. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  9661. class30_sub2_sub4_sub3.unlink();
  9662. else
  9663. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  9664. {
  9665. class30_sub2_sub4_sub3.method454(anInt945);
  9666. if(class30_sub2_sub4_sub3.aBoolean1567)
  9667. class30_sub2_sub4_sub3.unlink();
  9668. else
  9669. 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);
  9670. }
  9671.  
  9672. }
  9673.  
  9674. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9675. if(class9.interfaceType != 0 || class9.children == null)
  9676. return;
  9677. if(class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  9678. return;
  9679. int i1 = DrawingArea.topX;
  9680. int j1 = DrawingArea.topY;
  9681. int k1 = DrawingArea.bottomX;
  9682. int l1 = DrawingArea.bottomY;
  9683. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9684. int i2 = class9.children.length;
  9685. for(int j2 = 0; j2 < i2; j2++) {
  9686. int k2 = class9.childX[j2] + k;
  9687. int l2 = (class9.childY[j2] + l) - j;
  9688. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9689. k2 += class9_1.xOffset;
  9690. l2 += class9_1.yOffset;
  9691. if(class9_1.contentType > 0)
  9692. drawFriendsListOrWelcomeScreen(class9_1);
  9693. //here
  9694. int[] IDs = {
  9695. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  9696. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  9697. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  9698. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  9699. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  9700. /* Ancients */
  9701. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  9702. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9703. };
  9704. for(int m5 = 0; m5 < IDs.length; m5++) {
  9705. if(class9_1.id == IDs[m5] + 1) {
  9706. if(m5 > 61)
  9707. drawBlackBox(k2 + 1, l2);
  9708. else
  9709. drawBlackBox(k2, l2 + 1);
  9710. }
  9711. }
  9712. int[] runeChildren = {
  9713. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  9714. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  9715. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  9716. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  9717. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  9718. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  9719. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  9720. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  9721. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  9722. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  9723. 15885, 18474, 18475, 18478
  9724. };
  9725. for(int r = 0; r < runeChildren.length; r++)
  9726. if(class9_1.id == runeChildren[r])
  9727. class9_1.modelZoom = 775;
  9728.  
  9729.  
  9730. if(class9_1.interfaceType == 0) {
  9731. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  9732. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  9733. if(class9_1.scrollPosition < 0)
  9734. class9_1.scrollPosition = 0;
  9735. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9736. if(class9_1.scrollMax > class9_1.height)
  9737. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  9738. } else if(class9_1.interfaceType != 1)
  9739. if(class9_1.interfaceType == 2) {
  9740. int i3 = 0;
  9741. for(int l3 = 0; l3 < class9_1.height; l3++) {
  9742. for(int l4 = 0; l4 < class9_1.width; l4++) {
  9743. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9744. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9745. if(i3 < 20) {
  9746. k5 += class9_1.spritesX[i3];
  9747. j6 += class9_1.spritesY[i3];
  9748. }
  9749. if(class9_1.inventory[i3] > 0) {
  9750. int k6 = 0;
  9751. int j7 = 0;
  9752. int j9 = class9_1.inventory[i3] - 1;
  9753. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  9754. int l9 = 0;
  9755. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  9756. l9 = 0xffffff;
  9757. Sprite Sprite_2 = ItemDef.getSprite(j9, class9_1.inventoryValue[i3], l9);
  9758. if(Sprite_2 != null) {
  9759. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  9760. k6 = super.mouseX - anInt1087;
  9761. j7 = super.mouseY - anInt1088;
  9762. if(k6 < 5 && k6 > -5)
  9763. k6 = 0;
  9764. if(j7 < 5 && j7 > -5)
  9765. j7 = 0;
  9766. if(anInt989 < 5) {
  9767. k6 = 0;
  9768. j7 = 0;
  9769. }
  9770. Sprite_2.drawSprite1(k5 + k6, j6 + j7);
  9771. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  9772. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9773. if(i10 > anInt945 * 10)
  9774. i10 = anInt945 * 10;
  9775. if(i10 > class9.scrollPosition)
  9776. i10 = class9.scrollPosition;
  9777. class9.scrollPosition -= i10;
  9778. anInt1088 += i10;
  9779. }
  9780. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9781. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9782. if(j10 > anInt945 * 10)
  9783. j10 = anInt945 * 10;
  9784. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9785. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9786. class9.scrollPosition += j10;
  9787. anInt1088 -= j10;
  9788. }
  9789. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9790. Sprite_2.drawSprite1(k5, j6);
  9791. else
  9792. Sprite_2.drawSprite(k5, j6);
  9793. if(Sprite_2.maxWidth == 33 || class9_1.inventoryValue[i3] != 1)
  9794. {
  9795. int k10 = class9_1.inventoryValue[i3];
  9796. smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  9797. if(k10 >= 1)
  9798. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9799. if(k10 >= 100000)
  9800. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9801. if(k10 >= 10000000)
  9802. smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9803. }
  9804. }
  9805. }
  9806. } else if(class9_1.sprites != null && i3 < 20) {
  9807. Sprite Sprite_1 = class9_1.sprites[i3];
  9808. if(Sprite_1 != null)
  9809. Sprite_1.drawSprite(k5, j6);
  9810. }
  9811. i3++;
  9812. }
  9813. }
  9814. } else if(class9_1.interfaceType == 3) {
  9815. boolean flag = false;
  9816. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9817. flag = true;
  9818. int j3;
  9819. if(interfaceIsSelected(class9_1)) {
  9820. j3 = class9_1.enabledColor;
  9821. if(flag && class9_1.enabledHoverColor != 0)
  9822. j3 = class9_1.enabledHoverColor;
  9823. } else {
  9824. j3 = class9_1.disabledColor;
  9825. if(flag && class9_1.disabledHoverColor != 0)
  9826. j3 = class9_1.disabledHoverColor;
  9827. }
  9828. if(class9_1.opacity == 0) {
  9829. if(class9_1.boxFilled)
  9830. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  9831. else
  9832. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  9833. } else if(class9_1.boxFilled)
  9834. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.opacity & 0xff), k2);
  9835. else
  9836. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.opacity & 0xff), j3, class9_1.width, k2);
  9837. } else if(class9_1.interfaceType == 4) {
  9838. RSFont textDrawingArea = class9_1.rsFonts;
  9839. String s = class9_1.disabledMessage;
  9840. boolean flag1 = false;
  9841. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9842. flag1 = true;
  9843. int i4;
  9844. if(interfaceIsSelected(class9_1)) {
  9845. i4 = class9_1.enabledColor;
  9846. if(flag1 && class9_1.enabledHoverColor != 0)
  9847. i4 = class9_1.enabledHoverColor;
  9848. if(class9_1.enabledMessage.length() > 0)
  9849. s = class9_1.enabledMessage;
  9850. } else {
  9851. i4 = class9_1.disabledColor;
  9852. if(flag1 && class9_1.disabledHoverColor != 0)
  9853. i4 = class9_1.disabledHoverColor;
  9854. }
  9855. if(class9_1.atActionType == 6 && aBoolean1149) {
  9856. s = "Please wait...";
  9857. i4 = class9_1.disabledColor;
  9858. }
  9859. if(DrawingArea.width == 516) {//519
  9860. if(i4 == 0xffff00)
  9861. i4 = 255;
  9862. if(i4 == 49152)
  9863. i4 = 0xffffff;
  9864. }
  9865. //Magic interface
  9866. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9867. switch (i4) {
  9868. case 16773120: i4 = 0xFE981F; break;
  9869. case 7040819: i4 = 0xAF6A1A; break;
  9870. }
  9871. }
  9872. //Skill interface
  9873. int id = 4004; int id2 = 4005;
  9874. if(class9_1.parentID == 3917 && class9_1.id != id && class9_1.id != id+2 && class9_1.id != id+4 && class9_1.id != id+6
  9875. && 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
  9876. && 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
  9877. && class9_1.id != id+28 && class9_1.id != id+30 && class9_1.id != id+32 && class9_1.id != id+34 && class9_1.id != 13926
  9878. && 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
  9879. && 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
  9880. && 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
  9881. && class9_1.id != id2+28 && class9_1.id != id2+30 && class9_1.id != id2+32 && class9_1.id != id2+34 && class9_1.id != 13927
  9882. && class9_1.id != 4153 && class9_1.id != 12167 && class9_1.id != 4026) {
  9883. if(i4 == 16776960)
  9884. i4 = 0x0000;
  9885. class9_1.textShadowed = false;
  9886. }
  9887. /*if(class9_1.parentID == 3917) {
  9888. for(int i = 4004; i < 4040; i++) {
  9889. int[] moreData = {
  9890. 13926, 4152, 12166, 13927,
  9891. 4153, 12167, 4026
  9892. };
  9893. if(class9_1.id == i || class9_1.id == moreData[i]) {
  9894. return;
  9895. }
  9896. if(i4 == 16776960) {
  9897. i4 = 0x0000;
  9898. class9_1.textShadowed = false;
  9899. }
  9900. }
  9901. }*/
  9902. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  9903. {
  9904. if(s.indexOf("%") != -1)
  9905. {
  9906. do
  9907. {
  9908. int k7 = s.indexOf("%1");
  9909. if(k7 == -1)
  9910. break;
  9911. 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)
  9912. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9913. else
  9914. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9915. } while(true);
  9916. do
  9917. {
  9918. int l7 = s.indexOf("%2");
  9919. if(l7 == -1)
  9920. break;
  9921. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  9922. } while(true);
  9923. do
  9924. {
  9925. int i8 = s.indexOf("%3");
  9926. if(i8 == -1)
  9927. break;
  9928. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  9929. } while(true);
  9930. do
  9931. {
  9932. int j8 = s.indexOf("%4");
  9933. if(j8 == -1)
  9934. break;
  9935. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  9936. } while(true);
  9937. do
  9938. {
  9939. int k8 = s.indexOf("%5");
  9940. if(k8 == -1)
  9941. break;
  9942. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  9943. } while(true);
  9944. }
  9945. int l8 = s.indexOf("\\n");
  9946. String s1;
  9947. if(l8 != -1)
  9948. {
  9949. s1 = s.substring(0, l8);
  9950. s = s.substring(l8 + 2);
  9951. } else
  9952. {
  9953. s1 = s;
  9954. s = "";
  9955. }
  9956. if(class9_1.textCentered)
  9957. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadowed);
  9958. else
  9959. textDrawingArea.method389(class9_1.textShadowed, k2, i4, s1, l6);
  9960. }
  9961. } else if(class9_1.interfaceType == 5) {
  9962. //whats this?
  9963.  
  9964. Sprite sprite;
  9965. if(interfaceIsSelected(class9_1))
  9966. sprite = class9_1.enabledSprite;
  9967. else
  9968. sprite = class9_1.disabledSprite;
  9969. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  9970. sprite.drawSprite2(k2, l2, 0xffffff);
  9971. } else {
  9972. if(Autocast && class9_1.id == autocastId)
  9973. magicAuto.drawSprite(k2-3, l2-3);
  9974. if (sprite != null)
  9975. sprite.drawSprite(k2, l2);
  9976. }
  9977. if(sprite != null)
  9978. sprite.drawSprite(k2, l2);
  9979. } else if(class9_1.interfaceType == 6) {
  9980. int k3 = Texture.textureInt1;
  9981. int j4 = Texture.textureInt2;
  9982. Texture.textureInt1 = k2 + class9_1.width / 2;
  9983. Texture.textureInt2 = l2 + class9_1.height / 2;
  9984. int i5 = Texture.anIntArray1470[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  9985. int l5 = Texture.anIntArray1471[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  9986. boolean flag2 = interfaceIsSelected(class9_1);
  9987. int i7;
  9988. if(flag2)
  9989. i7 = class9_1.enabledAnimation;
  9990. else
  9991. i7 = class9_1.disabledAnimation;
  9992. Model model;
  9993. if(i7 == -1) {
  9994. model = class9_1.method209(-1, -1, flag2);
  9995. } else {
  9996. Animation animation = Animation.anims[i7];
  9997. model = class9_1.method209(animation.anIntArray354[class9_1.animationLength], animation.anIntArray353[class9_1.animationLength], flag2);
  9998. }
  9999. if(model != null)
  10000. model.method482(class9_1.modelRotationX, 0, class9_1.modelRotationY, 0, i5, l5);
  10001. Texture.textureInt1 = k3;
  10002. Texture.textureInt2 = j4;
  10003. } else if(class9_1.interfaceType == 7) {
  10004. RSFont textDrawingArea_1 = class9_1.rsFonts;
  10005. int k4 = 0;
  10006. for(int j5 = 0; j5 < class9_1.height; j5++) {
  10007. for(int i6 = 0; i6 < class9_1.width; i6++) {
  10008. if(class9_1.inventory[k4] > 0) {
  10009. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k4] - 1);
  10010. String s2 = itemDef.name;
  10011. if(itemDef.stackable || class9_1.inventoryValue[k4] != 1)
  10012. s2 = s2 + " x" + intToKOrMilLongName(class9_1.inventoryValue[k4]);
  10013. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  10014. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  10015. if(class9_1.textCentered)
  10016. textDrawingArea_1.method382(class9_1.disabledColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadowed);
  10017. else
  10018. textDrawingArea_1.method389(class9_1.textShadowed, i9, class9_1.disabledColor, s2, k9);
  10019. }
  10020. k4++;
  10021. }
  10022. }
  10023. }
  10024. else if (class9_1.interfaceType == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 100) {
  10025. int boxWidth = 0;
  10026. int boxHeight = 0;
  10027. RSFont textDrawingArea_2 = aTextDrawingArea_1271;
  10028. for (String s1 = class9_1.disabledMessage; s1.length() > 0;) {
  10029. int l7 = s1.indexOf("\\n");
  10030. String s4;
  10031. if (l7 != -1) {
  10032. s4 = s1.substring(0, l7);
  10033. s1 = s1.substring(l7 + 2);
  10034. } else {
  10035. s4 = s1;
  10036. s1 = "";
  10037. }
  10038. int j10 = textDrawingArea_2.getTextWidth(s4);
  10039. if (j10 > boxWidth) {
  10040. boxWidth = j10;
  10041. }
  10042. boxHeight += textDrawingArea_2.anInt1497 + 1;
  10043. }
  10044. boxWidth += 6;
  10045. boxHeight += 7;
  10046. int xPos = (l2 + class9_1.width) - 5 - boxWidth;
  10047. int yPos = k2 + class9_1.height + 5;
  10048. if (xPos < l2 + 5) {
  10049. xPos = l2 + 5;
  10050. }
  10051. if (xPos + boxWidth > j + class9.width) {
  10052. xPos = (j + class9.width) - boxWidth;
  10053. }
  10054. if (yPos + boxHeight > k + class9.height) {
  10055. yPos = (k + class9.height) - boxHeight;
  10056. }
  10057. DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  10058. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  10059. String s2 = class9_1.disabledMessage;
  10060. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
  10061. int l11 = s2.indexOf("\\n");
  10062. String s5;
  10063. if (l11 != -1) {
  10064. s5 = s2.substring(0, l11);
  10065. s2 = s2.substring(l11 + 2);
  10066. } else {
  10067. s5 = s2;
  10068. s2 = "";
  10069. }
  10070. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  10071. }
  10072. } else if (class9_1.interfaceType == 9) {
  10073. drawHoverBox(k2, l2, class9_1.disabledMessage);
  10074. }
  10075. }
  10076. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10077. }
  10078.  
  10079. private void randomizeBackground(Background background) {
  10080. int j = 256;
  10081. for(int k = 0; k < anIntArray1190.length; k++)
  10082. anIntArray1190[k] = 0;
  10083.  
  10084. for(int l = 0; l < 5000; l++) {
  10085. int i1 = (int)(Math.random() * 128D * (double)j);
  10086. anIntArray1190[i1] = (int)(Math.random() * 256D);
  10087. }
  10088. for(int j1 = 0; j1 < 20; j1++) {
  10089. for(int k1 = 1; k1 < j - 1; k1++) {
  10090. for(int i2 = 1; i2 < 127; i2++) {
  10091. int k2 = i2 + (k1 << 7);
  10092. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10093. }
  10094.  
  10095. }
  10096. int ai[] = anIntArray1190;
  10097. anIntArray1190 = anIntArray1191;
  10098. anIntArray1191 = ai;
  10099. }
  10100. if(background != null) {
  10101. int l1 = 0;
  10102. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  10103. for(int l2 = 0; l2 < background.anInt1452; l2++)
  10104. if(background.aByteArray1450[l1++] != 0) {
  10105. int i3 = l2 + 16 + background.anInt1454;
  10106. int j3 = j2 + 16 + background.anInt1455;
  10107. int k3 = i3 + (j3 << 7);
  10108. anIntArray1190[k3] = 0;
  10109. }
  10110. }
  10111. }
  10112. }
  10113.  
  10114. private void method107(int i, int j, Stream stream, Player player)
  10115. {
  10116. if((i & 0x400) != 0)
  10117. {
  10118. player.anInt1543 = stream.method428();
  10119. player.anInt1545 = stream.method428();
  10120. player.anInt1544 = stream.method428();
  10121. player.anInt1546 = stream.method428();
  10122. player.anInt1547 = stream.method436() + loopCycle;
  10123. player.anInt1548 = stream.method435() + loopCycle;
  10124. player.anInt1549 = stream.method428();
  10125. player.method446();
  10126. }
  10127. if((i & 0x100) != 0)
  10128. {
  10129. player.anInt1520 = stream.method434();
  10130. int k = stream.readDWord();
  10131. player.anInt1524 = k >> 16;
  10132. player.anInt1523 = loopCycle + (k & 0xffff);
  10133. player.anInt1521 = 0;
  10134. player.anInt1522 = 0;
  10135. if(player.anInt1523 > loopCycle)
  10136. player.anInt1521 = -1;
  10137. if(player.anInt1520 == 65535)
  10138. player.anInt1520 = -1;
  10139. }
  10140. if((i & 8) != 0)
  10141. {
  10142. int l = stream.method434();
  10143. if(l == 65535)
  10144. l = -1;
  10145. int i2 = stream.method427();
  10146. if(l == player.anim && l != -1)
  10147. {
  10148. int i3 = Animation.anims[l].anInt365;
  10149. if(i3 == 1)
  10150. {
  10151. player.anInt1527 = 0;
  10152. player.anInt1528 = 0;
  10153. player.anInt1529 = i2;
  10154. player.anInt1530 = 0;
  10155. }
  10156. if(i3 == 2)
  10157. player.anInt1530 = 0;
  10158. } else
  10159. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  10160. {
  10161. player.anim = l;
  10162. player.anInt1527 = 0;
  10163. player.anInt1528 = 0;
  10164. player.anInt1529 = i2;
  10165. player.anInt1530 = 0;
  10166. player.anInt1542 = player.smallXYIndex;
  10167. }
  10168. }
  10169. if((i & 4) != 0)
  10170. {
  10171. player.textSpoken = stream.readString();
  10172. if(player.textSpoken.charAt(0) == '~')
  10173. {
  10174. player.textSpoken = player.textSpoken.substring(1);
  10175. pushMessage(player.textSpoken, 2, player.name);
  10176. } else
  10177. if(player == myPlayer)
  10178. pushMessage(player.textSpoken, 2, player.name);
  10179. player.anInt1513 = 0;
  10180. player.anInt1531 = 0;
  10181. player.textCycle = 150;
  10182. }
  10183. if((i & 0x80) != 0)
  10184. {
  10185. //right fucking here
  10186. int i1 = stream.method434();
  10187. int j2 = stream.readUnsignedByte();
  10188. int j3 = stream.method427();
  10189. int k3 = stream.currentOffset;
  10190. if(player.name != null && player.visible)
  10191. {
  10192. long l3 = TextClass.longForName(player.name);
  10193. boolean flag = false;
  10194. if(j2 <= 1)
  10195. {
  10196. for(int i4 = 0; i4 < ignoreCount; i4++)
  10197. {
  10198. if(ignoreListAsLongs[i4] != l3)
  10199. continue;
  10200. flag = true;
  10201. break;
  10202. }
  10203.  
  10204. }
  10205. if(!flag && anInt1251 == 0)
  10206. try
  10207. {
  10208. aStream_834.currentOffset = 0;
  10209. stream.method442(j3, 0, aStream_834.buffer);
  10210. aStream_834.currentOffset = 0;
  10211. String s = TextInput.method525(j3, aStream_834);
  10212. //s = Censor.doCensor(s);
  10213. player.textSpoken = s;
  10214. player.anInt1513 = i1 >> 8;
  10215. player.privelage = j2;
  10216. player.anInt1531 = i1 & 0xff;
  10217. player.textCycle = 150;
  10218. //Other players see your icon
  10219. if(j2 == 4)
  10220. pushMessage(s, 1, "@cr0@<col=13132800>"+getRank(player.skill)+"</col>" + player.name);
  10221. else if(j2 == 3)
  10222. pushMessage(s, 1, "@cr2@<col=13132800>"+getRank(player.skill)+"</col>" + player.name);
  10223. else if(j2 == 2)
  10224. pushMessage(s, 1, "@cr2@<col=13132800>"+getRank(player.skill)+"</col>" + player.name);
  10225. else if (j2 == 1)
  10226. pushMessage(s, 1, "@cr1@<col=13132800>"+getRank(player.skill)+"</col>" + player.name);
  10227. else
  10228. pushMessage(s, 2, "<col=13132800>"+getRank(player.skill)+"</col>" + player.name);
  10229. }
  10230. catch(Exception exception)
  10231. {
  10232. signlink.reporterror("cde2");
  10233. }
  10234. }
  10235. stream.currentOffset = k3 + j3;
  10236. }
  10237. if((i & 1) != 0)
  10238. {
  10239. player.interactingEntity = stream.method434();
  10240. if(player.interactingEntity == 65535)
  10241. player.interactingEntity = -1;
  10242. }
  10243. if((i & 0x10) != 0)
  10244. {
  10245. int j1 = stream.method427();
  10246. byte abyte0[] = new byte[j1];
  10247. Stream stream_1 = new Stream(abyte0);
  10248. stream.readBytes(j1, 0, abyte0);
  10249. aStreamArray895s[j] = stream_1;
  10250. player.updatePlayer(stream_1);
  10251. }
  10252. if((i & 2) != 0)
  10253. {
  10254. player.anInt1538 = stream.method436();
  10255. player.anInt1539 = stream.method434();
  10256. }
  10257. if ((i & 0x20) != 0) {
  10258. int k1 = stream.readUnsignedByte();
  10259. int k2 = stream.method426();
  10260. int type1 = stream.readUnsignedByte();
  10261. player.updateHitData(k2, k1, type1, loopCycle);
  10262. player.loopCycleStatus = loopCycle + 300;
  10263. player.currentHealth = stream.method427();
  10264. player.maxHealth = stream.readUnsignedByte();
  10265. }
  10266. if ((i & 0x200) != 0) {
  10267. int l1 = stream.readUnsignedByte();
  10268. int l2 = stream.method428();
  10269. int type2 = stream.readUnsignedByte();
  10270. player.updateHitData(l2, l1, type2, loopCycle);
  10271. player.loopCycleStatus = loopCycle + 300;
  10272. player.currentHealth = stream.readUnsignedByte();
  10273. player.maxHealth = stream.method427();
  10274. }
  10275. }
  10276.  
  10277. private void method108()
  10278. {
  10279. try
  10280. {
  10281. int j = myPlayer.x + anInt1278;
  10282. int k = myPlayer.y + anInt1131;
  10283. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  10284. {
  10285. anInt1014 = j;
  10286. anInt1015 = k;
  10287. }
  10288. if(anInt1014 != j)
  10289. anInt1014 += (j - anInt1014) / 16;
  10290. if(anInt1015 != k)
  10291. anInt1015 += (k - anInt1015) / 16;
  10292. if(super.keyArray[1] == 1)
  10293. anInt1186 += (-24 - anInt1186) / 2;
  10294. else
  10295. if(super.keyArray[2] == 1)
  10296. anInt1186 += (24 - anInt1186) / 2;
  10297. else
  10298. anInt1186 /= 2;
  10299. if(super.keyArray[3] == 1)
  10300. anInt1187 += (12 - anInt1187) / 2;
  10301. else
  10302. if(super.keyArray[4] == 1)
  10303. anInt1187 += (-12 - anInt1187) / 2;
  10304. else
  10305. anInt1187 /= 2;
  10306. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  10307. anInt1184 += anInt1187 / 2;
  10308. if(anInt1184 < 128)
  10309. anInt1184 = 128;
  10310. if(anInt1184 > 383)
  10311. anInt1184 = 383;
  10312. int l = anInt1014 >> 7;
  10313. int i1 = anInt1015 >> 7;
  10314. int j1 = method42(plane, anInt1015, anInt1014);
  10315. int k1 = 0;
  10316. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  10317. {
  10318. for(int l1 = l - 4; l1 <= l + 4; l1++)
  10319. {
  10320. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  10321. {
  10322. int l2 = plane;
  10323. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10324. l2++;
  10325. int i3 = j1 - intGroundArray[l2][l1][k2];
  10326. if(i3 > k1)
  10327. k1 = i3;
  10328. }
  10329.  
  10330. }
  10331.  
  10332. }
  10333. anInt1005++;
  10334. if(anInt1005 > 1512)
  10335. {
  10336. anInt1005 = 0;
  10337. stream.createFrame(77);
  10338. stream.writeWordBigEndian(0);
  10339. int i2 = stream.currentOffset;
  10340. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10341. stream.writeWordBigEndian(101);
  10342. stream.writeWordBigEndian(233);
  10343. stream.writeWord(45092);
  10344. if((int)(Math.random() * 2D) == 0)
  10345. stream.writeWord(35784);
  10346. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10347. stream.writeWordBigEndian(64);
  10348. stream.writeWordBigEndian(38);
  10349. stream.writeWord((int)(Math.random() * 65536D));
  10350. stream.writeWord((int)(Math.random() * 65536D));
  10351. stream.writeBytes(stream.currentOffset - i2);
  10352. }
  10353. int j2 = k1 * 192;
  10354. if(j2 > 0x17f00)
  10355. j2 = 0x17f00;
  10356. if(j2 < 32768)
  10357. j2 = 32768;
  10358. if(j2 > anInt984)
  10359. {
  10360. anInt984 += (j2 - anInt984) / 24;
  10361. return;
  10362. }
  10363. if(j2 < anInt984)
  10364. {
  10365. anInt984 += (j2 - anInt984) / 80;
  10366. }
  10367. }
  10368. catch(Exception _ex)
  10369. {
  10370. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  10371. throw new RuntimeException("eek");
  10372. }
  10373. }
  10374.  
  10375. public void processDrawing()
  10376. {
  10377. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  10378. {
  10379. showErrorScreen();
  10380. return;
  10381. }
  10382. anInt1061++;
  10383. if(!loggedIn) {
  10384. drawLoginScreen(false);
  10385. }else{
  10386. drawGameScreen();
  10387. }
  10388. anInt1213 = 0;
  10389. }
  10390.  
  10391. private boolean isFriendOrSelf(String s)
  10392. {
  10393. if(s == null)
  10394. return false;
  10395. for(int i = 0; i < friendsCount; i++)
  10396. if(s.equalsIgnoreCase(friendsList[i]))
  10397. return true;
  10398. return s.equalsIgnoreCase(myPlayer.name);
  10399. }
  10400.  
  10401. private static String combatDiffColor(int i, int j)
  10402. {
  10403. int k = i - j;
  10404. if(k < -9)
  10405. return "@red@";
  10406. if(k < -6)
  10407. return "@or3@";
  10408. if(k < -3)
  10409. return "@or2@";
  10410. if(k < 0)
  10411. return "@or1@";
  10412. if(k > 9)
  10413. return "@gre@";
  10414. if(k > 6)
  10415. return "@gr3@";
  10416. if(k > 3)
  10417. return "@gr2@";
  10418. if(k > 0)
  10419. return "@gr1@";
  10420. else
  10421. return "@yel@";
  10422. }
  10423.  
  10424. private void setWaveVolume(int i)
  10425. {
  10426. signlink.wavevol = i;
  10427. }
  10428.  
  10429. private void draw3dScreen()
  10430. {
  10431. alertHandler.processAlerts();
  10432. drawSplitPrivateChat();
  10433. if(crossType == 1)
  10434. {
  10435. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10436. anInt1142++;
  10437. if(anInt1142 > 67)
  10438. {
  10439. anInt1142 = 0;
  10440. stream.createFrame(78);
  10441. }
  10442. }
  10443. if(crossType == 2)
  10444. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10445. if(anInt1018 != -1)
  10446. {
  10447. method119(anInt945, anInt1018);
  10448. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  10449. }
  10450. if(openInterfaceID != -1)
  10451. {
  10452. method119(anInt945, openInterfaceID);
  10453. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  10454. }
  10455. method70();
  10456. if(!menuOpen)
  10457. {
  10458. processRightClick();
  10459. drawTooltip();
  10460. } else
  10461. drawMenu(4, 4);
  10462. if(anInt1055 == 1)
  10463. multiOverlay.drawSprite(472, 296);
  10464. if(fpsOn)
  10465. {
  10466. char c = '\u01FB';
  10467. int k = 20;
  10468. int i1 = 0xffff00;
  10469. if(super.fps < 15)
  10470. i1 = 0xff0000;
  10471. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  10472. k += 15;
  10473. Runtime runtime = Runtime.getRuntime();
  10474. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10475. i1 = 0xffff00;
  10476. if(j1 > 0x2000000 && lowMem)
  10477. i1 = 0xff0000;
  10478. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10479. k += 15;
  10480. }
  10481. int i1 = 0xffff00;
  10482. int x = baseX + (myPlayer.x - 6 >> 7);
  10483. int y = baseY + (myPlayer.y - 6 >> 7);
  10484. if (clientData)
  10485. {
  10486. char c = '\u01FB';
  10487. int k = 20;
  10488. if(super.fps < 15)
  10489. i1 = 0xff0000;
  10490. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  10491. Runtime runtime = Runtime.getRuntime();
  10492. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10493. i1 = 0xffff00;
  10494. if(j1 > 0x2000000 && lowMem)
  10495. i1 = 0xff0000;
  10496. k += 15;
  10497. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  10498. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  10499. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  10500. }
  10501. if(anInt1104 != 0)
  10502. {
  10503. int j = anInt1104 / 50;
  10504. int l = j / 60;
  10505. j %= 60;
  10506. if(j < 10)
  10507. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  10508. else
  10509. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  10510. anInt849++;
  10511. if(anInt849 > 75)
  10512. {
  10513. anInt849 = 0;
  10514. stream.createFrame(148);
  10515. }
  10516. }
  10517. }
  10518.  
  10519. private void addIgnore(long l)
  10520. {
  10521. try
  10522. {
  10523. if(l == 0L)
  10524. return;
  10525. if(ignoreCount >= 100)
  10526. {
  10527. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10528. return;
  10529. }
  10530. String s = TextClass.fixName(TextClass.nameForLong(l));
  10531. for(int j = 0; j < ignoreCount; j++)
  10532. if(ignoreListAsLongs[j] == l)
  10533. {
  10534. pushMessage(s + " is already on your ignore list", 0, "");
  10535. return;
  10536. }
  10537. for(int k = 0; k < friendsCount; k++)
  10538. if(friendsListAsLongs[k] == l)
  10539. {
  10540. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  10541. return;
  10542. }
  10543.  
  10544. ignoreListAsLongs[ignoreCount++] = l;
  10545. needDrawTabArea = true;
  10546. stream.createFrame(133);
  10547. stream.writeQWord(l);
  10548. return;
  10549. }
  10550. catch(RuntimeException runtimeexception)
  10551. {
  10552. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  10553. }
  10554. throw new RuntimeException();
  10555. }
  10556.  
  10557. private void method114()
  10558. {
  10559. for(int i = -1; i < playerCount; i++)
  10560. {
  10561. int j;
  10562. if(i == -1)
  10563. j = myPlayerIndex;
  10564. else
  10565. j = playerIndices[i];
  10566. Player player = playerArray[j];
  10567. if(player != null)
  10568. method96(player);
  10569. }
  10570.  
  10571. }
  10572.  
  10573. private void method115()
  10574. {
  10575. if(loadingStage == 2)
  10576. {
  10577. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10578. {
  10579. if(class30_sub1.anInt1294 > 0)
  10580. class30_sub1.anInt1294--;
  10581. if(class30_sub1.anInt1294 == 0)
  10582. {
  10583. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  10584. {
  10585. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  10586. class30_sub1.unlink();
  10587. }
  10588. } else
  10589. {
  10590. if(class30_sub1.anInt1302 > 0)
  10591. class30_sub1.anInt1302--;
  10592. 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)))
  10593. {
  10594. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  10595. class30_sub1.anInt1302 = -1;
  10596. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  10597. class30_sub1.unlink();
  10598. else
  10599. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10600. class30_sub1.unlink();
  10601. }
  10602. }
  10603. }
  10604.  
  10605. }
  10606. }
  10607.  
  10608.  
  10609. private void determineMenuSize() {
  10610. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10611. for(int j = 0; j < menuActionRow; j++)
  10612. {
  10613. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10614. if(k > i)
  10615. i = k;
  10616. }
  10617. i += 8;
  10618. int l = 15 * menuActionRow + 21;
  10619. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < 765 && super.saveClickY < 503) {
  10620. int i1 = super.saveClickX - i / 2;
  10621. if(i1 + i > 765){
  10622. i1 = 765 - i;
  10623. }
  10624. if(i1 < 0){
  10625. i1 = 0;
  10626. }
  10627. int l1 = super.saveClickY - 0;
  10628. if(l1 + l > 503){
  10629. l1 = 503 - l;
  10630. }
  10631. if(l1 < 0){
  10632. l1 = 0;
  10633. }
  10634. menuOpen = true;
  10635. menuOffsetX = i1;
  10636. menuOffsetY = l1;
  10637. menuWidth = i;
  10638. menuHeight = 15 * menuActionRow + 22;
  10639. }
  10640. }
  10641.  
  10642. private void method117(Stream stream)
  10643. {
  10644. stream.initBitAccess();
  10645. int j = stream.readBits(1);
  10646. if(j == 0)
  10647. return;
  10648. int k = stream.readBits(2);
  10649. if(k == 0)
  10650. {
  10651. anIntArray894[anInt893++] = myPlayerIndex;
  10652. return;
  10653. }
  10654. if(k == 1)
  10655. {
  10656. int l = stream.readBits(3);
  10657. myPlayer.moveInDir(false, l);
  10658. int k1 = stream.readBits(1);
  10659. if(k1 == 1)
  10660. anIntArray894[anInt893++] = myPlayerIndex;
  10661. return;
  10662. }
  10663. if(k == 2)
  10664. {
  10665. int i1 = stream.readBits(3);
  10666. myPlayer.moveInDir(true, i1);
  10667. int l1 = stream.readBits(3);
  10668. myPlayer.moveInDir(true, l1);
  10669. int j2 = stream.readBits(1);
  10670. if(j2 == 1)
  10671. anIntArray894[anInt893++] = myPlayerIndex;
  10672. return;
  10673. }
  10674. if(k == 3)
  10675. {
  10676. plane = stream.readBits(2);
  10677. int j1 = stream.readBits(1);
  10678. int i2 = stream.readBits(1);
  10679. if(i2 == 1)
  10680. anIntArray894[anInt893++] = myPlayerIndex;
  10681. int k2 = stream.readBits(7);
  10682. int l2 = stream.readBits(7);
  10683. myPlayer.setPos(l2, k2, j1 == 1);
  10684. }
  10685. }
  10686.  
  10687. private void nullLoader()
  10688. {
  10689. aBoolean831 = false;
  10690. while(drawingFlames)
  10691. {
  10692. aBoolean831 = false;
  10693. try
  10694. {
  10695. Thread.sleep(50L);
  10696. }
  10697. catch(Exception _ex) { }
  10698. }
  10699. titleBox = null;
  10700. titleBox1 = null;
  10701. titleButton = null;
  10702. aBackgroundArray1152s = null;
  10703. anIntArray850 = null;
  10704. anIntArray851 = null;
  10705. anIntArray852 = null;
  10706. anIntArray853 = null;
  10707. anIntArray1190 = null;
  10708. anIntArray1191 = null;
  10709. anIntArray828 = null;
  10710. anIntArray829 = null;
  10711. aSprite_1201 = null;
  10712. aSprite_1202 = null;
  10713. }
  10714.  
  10715. private boolean method119(int i, int j)
  10716. {
  10717. boolean flag1 = false;
  10718. RSInterface class9 = RSInterface.interfaceCache[j];
  10719. for(int k = 0; k < class9.children.length; k++)
  10720. {
  10721. if(class9.children[k] == -1)
  10722. break;
  10723. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10724. if(class9_1.interfaceType == 1)
  10725. flag1 |= method119(i, class9_1.id);
  10726. if(class9_1.interfaceType == 6 && (class9_1.disabledAnimation != -1 || class9_1.enabledAnimation != -1))
  10727. {
  10728. boolean flag2 = interfaceIsSelected(class9_1);
  10729. int l;
  10730. if(flag2)
  10731. l = class9_1.enabledAnimation;
  10732. else
  10733. l = class9_1.disabledAnimation;
  10734. if(l != -1)
  10735. {
  10736. Animation animation = Animation.anims[l];
  10737. for(class9_1.animationDelay += i; class9_1.animationDelay > animation.method258(class9_1.animationLength);)
  10738. {
  10739. class9_1.animationDelay -= animation.method258(class9_1.animationLength) + 1;
  10740. class9_1.animationLength++;
  10741. if(class9_1.animationLength >= animation.anInt352)
  10742. {
  10743. class9_1.animationLength -= animation.anInt356;
  10744. if(class9_1.animationLength < 0 || class9_1.animationLength >= animation.anInt352)
  10745. class9_1.animationLength = 0;
  10746. }
  10747. flag1 = true;
  10748. }
  10749.  
  10750. }
  10751. }
  10752. }
  10753.  
  10754. return flag1;
  10755. }
  10756.  
  10757. private int method120()
  10758. {
  10759. int j = 3;
  10760. if(yCameraCurve < 310)
  10761. {
  10762. int k = xCameraPos >> 7;
  10763. int l = yCameraPos >> 7;
  10764. int i1 = myPlayer.x >> 7;
  10765. int j1 = myPlayer.y >> 7;
  10766. if((byteGroundArray[plane][k][l] & 4) != 0)
  10767. j = plane;
  10768. int k1;
  10769. if(i1 > k)
  10770. k1 = i1 - k;
  10771. else
  10772. k1 = k - i1;
  10773. int l1;
  10774. if(j1 > l)
  10775. l1 = j1 - l;
  10776. else
  10777. l1 = l - j1;
  10778. if(k1 > l1)
  10779. {
  10780. int i2 = (l1 * 0x10000) / k1;
  10781. int k2 = 32768;
  10782. while(k != i1)
  10783. {
  10784. if(k < i1)
  10785. k++;
  10786. else
  10787. if(k > i1)
  10788. k--;
  10789. if((byteGroundArray[plane][k][l] & 4) != 0)
  10790. j = plane;
  10791. k2 += i2;
  10792. if(k2 >= 0x10000)
  10793. {
  10794. k2 -= 0x10000;
  10795. if(l < j1)
  10796. l++;
  10797. else
  10798. if(l > j1)
  10799. l--;
  10800. if((byteGroundArray[plane][k][l] & 4) != 0)
  10801. j = plane;
  10802. }
  10803. }
  10804. } else
  10805. {
  10806. int j2 = (k1 * 0x10000) / l1;
  10807. int l2 = 32768;
  10808. while(l != j1)
  10809. {
  10810. if(l < j1)
  10811. l++;
  10812. else
  10813. if(l > j1)
  10814. l--;
  10815. if((byteGroundArray[plane][k][l] & 4) != 0)
  10816. j = plane;
  10817. l2 += j2;
  10818. if(l2 >= 0x10000)
  10819. {
  10820. l2 -= 0x10000;
  10821. if(k < i1)
  10822. k++;
  10823. else
  10824. if(k > i1)
  10825. k--;
  10826. if((byteGroundArray[plane][k][l] & 4) != 0)
  10827. j = plane;
  10828. }
  10829. }
  10830. }
  10831. }
  10832. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10833. j = plane;
  10834. return j;
  10835. }
  10836.  
  10837. private int method121()
  10838. {
  10839. int j = method42(plane, yCameraPos, xCameraPos);
  10840. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10841. return plane;
  10842. else
  10843. return 3;
  10844. }
  10845.  
  10846. private void delIgnore(long l)
  10847. {
  10848. try
  10849. {
  10850. if(l == 0L)
  10851. return;
  10852. for(int j = 0; j < ignoreCount; j++)
  10853. if(ignoreListAsLongs[j] == l)
  10854. {
  10855. ignoreCount--;
  10856. needDrawTabArea = true;
  10857. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10858.  
  10859. stream.createFrame(74);
  10860. stream.writeQWord(l);
  10861. return;
  10862. }
  10863.  
  10864. return;
  10865. }
  10866. catch(RuntimeException runtimeexception)
  10867. {
  10868. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10869. }
  10870. throw new RuntimeException();
  10871. }
  10872.  
  10873.  
  10874. private void chatJoin(long l) {
  10875. try {
  10876. if(l == 0L)
  10877. return;
  10878. stream.createFrame(60);
  10879. stream.writeQWord(l);
  10880. return;
  10881. }
  10882. catch(RuntimeException runtimeexception)
  10883. {
  10884. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10885. }
  10886. throw new RuntimeException();
  10887.  
  10888. }
  10889.  
  10890. public String getParameter(String s)
  10891. {
  10892. if(signlink.mainapp != null)
  10893. return signlink.mainapp.getParameter(s);
  10894. else
  10895. return super.getParameter(s);
  10896. }
  10897.  
  10898. private void adjustVolume(boolean flag, int i)
  10899. {
  10900. signlink.midivol = i;
  10901. if(flag)
  10902. signlink.midi = "voladjust";
  10903. }
  10904.  
  10905. private int extractInterfaceValues(RSInterface class9, int j)
  10906. {
  10907. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10908. return -2;
  10909. try
  10910. {
  10911. int ai[] = class9.valueIndexArray[j];
  10912. int k = 0;
  10913. int l = 0;
  10914. int i1 = 0;
  10915. do
  10916. {
  10917. int j1 = ai[l++];
  10918. int k1 = 0;
  10919. byte byte0 = 0;
  10920. if(j1 == 0)
  10921. return k;
  10922. if(j1 == 1)
  10923. k1 = currentStats[ai[l++]];
  10924. if(j1 == 2)
  10925. k1 = maxStats[ai[l++]];
  10926. if(j1 == 3)
  10927. k1 = currentExp[ai[l++]];
  10928. if(j1 == 4)
  10929. {
  10930. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10931. int k2 = ai[l++];
  10932. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  10933. {
  10934. for(int j3 = 0; j3 < class9_1.inventory.length; j3++)
  10935. if(class9_1.inventory[j3] == k2 + 1)
  10936. k1 += class9_1.inventoryValue[j3];
  10937.  
  10938. }
  10939. }
  10940. if(j1 == 5)
  10941. k1 = variousSettings[ai[l++]];
  10942. if(j1 == 6)
  10943. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10944. if(j1 == 7)
  10945. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10946. if(j1 == 8)
  10947. k1 = myPlayer.combatLevel;
  10948. if(j1 == 9)
  10949. {
  10950. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  10951. if(Skills.skillEnabled[l1])
  10952. k1 += maxStats[l1];
  10953.  
  10954. }
  10955. if(j1 == 10)
  10956. {
  10957. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10958. int l2 = ai[l++] + 1;
  10959. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  10960. {
  10961. for(int k3 = 0; k3 < class9_2.inventory.length; k3++)
  10962. {
  10963. if(class9_2.inventory[k3] != l2)
  10964. continue;
  10965. k1 = 0x3b9ac9ff;
  10966. break;
  10967. }
  10968.  
  10969. }
  10970. }
  10971. if(j1 == 11)
  10972. k1 = energy;
  10973. if(j1 == 12)
  10974. k1 = weight;
  10975. if(j1 == 13)
  10976. {
  10977. int i2 = variousSettings[ai[l++]];
  10978. int i3 = ai[l++];
  10979. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10980. }
  10981. if(j1 == 14)
  10982. {
  10983. int j2 = ai[l++];
  10984. VarBit varBit = VarBit.cache[j2];
  10985. int l3 = varBit.anInt648;
  10986. int i4 = varBit.anInt649;
  10987. int j4 = varBit.anInt650;
  10988. int k4 = anIntArray1232[j4 - i4];
  10989. k1 = variousSettings[l3] >> i4 & k4;
  10990. }
  10991. if(j1 == 15)
  10992. byte0 = 1;
  10993. if(j1 == 16)
  10994. byte0 = 2;
  10995. if(j1 == 17)
  10996. byte0 = 3;
  10997. if(j1 == 18)
  10998. k1 = (myPlayer.x >> 7) + baseX;
  10999. if(j1 == 19)
  11000. k1 = (myPlayer.y >> 7) + baseY;
  11001. if(j1 == 20)
  11002. k1 = ai[l++];
  11003. if(byte0 == 0)
  11004. {
  11005. if(i1 == 0)
  11006. k += k1;
  11007. if(i1 == 1)
  11008. k -= k1;
  11009. if(i1 == 2 && k1 != 0)
  11010. k /= k1;
  11011. if(i1 == 3)
  11012. k *= k1;
  11013. i1 = 0;
  11014. } else
  11015. {
  11016. i1 = byte0;
  11017. }
  11018. } while(true);
  11019. }
  11020. catch(Exception _ex)
  11021. {
  11022. return -1;
  11023. }
  11024. }
  11025.  
  11026. private void drawTooltip() {
  11027. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11028. return;
  11029. String s;
  11030. if(itemSelected == 1 && menuActionRow < 2)
  11031. s = "Use " + selectedItemName + " with...";
  11032. else if(spellSelected == 1 && menuActionRow < 2)
  11033. s = spellTooltip + "...";
  11034. else
  11035. s = menuActionName[menuActionRow - 1];
  11036. if(menuActionRow > 2)
  11037. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11038. aTextDrawingArea_1271.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11039. }
  11040.  
  11041. private void drawMinimap() {
  11042. int compassX, compassY, MapY, MapX;
  11043. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11044. compassX = 11;
  11045. compassY = 8;
  11046. MapY = 9;
  11047. MapX = 38;
  11048. } else if(is474) {
  11049. compassX = 30;
  11050. compassY = 4;
  11051. MapY = 9;
  11052. MapX = 50;
  11053. } else {
  11054. compassX = 30+5;
  11055. compassY = 4;
  11056. MapY = 9;
  11057. MapX = 50+6;
  11058. }
  11059. mapBackImage.initDrawingArea();
  11060. if (anInt1021 == 2) {
  11061. Black[getSpriteID()].drawSprite(0, 0);
  11062. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11063. loadOrbs();
  11064. }
  11065. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, compassY, compassX-1, 33, 25);
  11066. if(menuOpen){
  11067. drawMenu(516, 0);
  11068. }
  11069. inGameScreen.initDrawingArea();
  11070. return;
  11071. }
  11072. int i = minimapInt1 + minimapInt2 & 0x7ff;
  11073. int j = 48 + myPlayer.x / 32;
  11074. int l2 = 464 - myPlayer.y / 32;
  11075.  
  11076. for(int j1 = 0; j1 < anIntArray1229.length; j1++){
  11077. anIntArray1229[j1] = 172;
  11078. anIntArray1052[j1] = -22;
  11079. }
  11080. aSprite_1263.method352(152, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, MapY, MapX, 146, j);
  11081. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, compassY, compassX-1, 33, 25);
  11082.  
  11083. for(int j5 = 0; j5 < anInt1071; j5++) {
  11084. try {
  11085. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11086. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11087. markMinimap(aSpriteArray1140[j5], k, i3, false);
  11088. } catch(Exception exception) {
  11089. }
  11090. }
  11091.  
  11092. for(int k5 = 0; k5 < 104; k5++) {
  11093. for(int l5 = 0; l5 < 104; l5++) {
  11094. NodeList class19 = groundArray[plane][k5][l5];
  11095. if(class19 != null) {
  11096. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11097. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11098. markMinimap(mapDotItem, l, j3, false);
  11099. }
  11100. }
  11101. }
  11102.  
  11103. for(int i6 = 0; i6 < npcCount; i6++) {
  11104. NPC npc = npcArray[npcIndices[i6]];
  11105. if(npc != null && npc.isVisible()) {
  11106. EntityDef entityDef = npc.desc;
  11107. if(entityDef.childrenIDs != null)
  11108. entityDef = entityDef.method161();
  11109. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  11110. int i1 = npc.x / 32 - myPlayer.x / 32;
  11111. int k3 = npc.y / 32 - myPlayer.y / 32;
  11112. markMinimap(mapDotNPC, i1, k3, false);
  11113. }
  11114. }
  11115. }
  11116. for(int j6 = 0; j6 < playerCount; j6++) {
  11117. Player player = playerArray[playerIndices[j6]];
  11118. if(player != null && player.isVisible()) {
  11119. int j1 = player.x / 32 - myPlayer.x / 32;
  11120. int l3 = player.y / 32 - myPlayer.y / 32;
  11121. boolean flag1 = false;
  11122. boolean flag3 = false;
  11123. for (int j3 = 0; j3 < clanList.length; j3++) {
  11124. if (clanList[j3] == null)
  11125. continue;
  11126. if (!clanList[j3].equalsIgnoreCase(player.name))
  11127. continue;
  11128. flag3 = true;
  11129. break;
  11130. }
  11131. long l6 = TextClass.longForName(player.name);
  11132. for(int k6 = 0; k6 < friendsCount; k6++) {
  11133. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  11134. continue;
  11135. flag1 = true;
  11136. break;
  11137. }
  11138. boolean flag2 = false;
  11139. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  11140. flag2 = true;
  11141. if(flag1)
  11142. markMinimap(mapDotFriend, j1, l3, false);
  11143. else if(flag3)
  11144. markMinimap(mapDotClan, j1, l3, false);
  11145. else if(flag2)
  11146. markMinimap(mapDotTeam, j1, l3, false);
  11147. else
  11148. markMinimap(mapDotPlayer, j1, l3, false);
  11149. }
  11150. }
  11151. if(anInt855 != 0 && loopCycle % 20 < 10) {
  11152. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  11153. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11154. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  11155. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  11156. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  11157. method81(mapMarker, i4, k1);
  11158. }
  11159. }
  11160. if(anInt855 == 2) {
  11161. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11162. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11163. method81(mapMarker, j4, l1);
  11164. }
  11165. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  11166. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11167. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  11168. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  11169. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  11170. method81(mapMarker, k4, i2);
  11171. }
  11172. }
  11173. }
  11174. if(destX != 0) {
  11175. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11176. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11177. markMinimap(mapFlag, j2, l4, false);
  11178. }
  11179. CustomMapback[getSpriteID()].drawSprite(0, 0);
  11180. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11181. loadOrbs();
  11182. DrawingArea.drawPixels(3, 84, 108, 0xffffff, 3);
  11183. } else {
  11184. DrawingArea.drawPixels(3, 84, 124, 0xffffff, 3);
  11185. }
  11186. if(menuOpen)
  11187. drawMenu(516, 0);
  11188. inGameScreen.initDrawingArea();
  11189. }
  11190.  
  11191. private void npcScreenPos(Entity entity, int i) {
  11192. calcEntityScreenPos(entity.x, i, entity.y);
  11193. }
  11194.  
  11195. private void calcEntityScreenPos(int i, int j, int l) {
  11196. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  11197. spriteDrawX = -1;
  11198. spriteDrawY = -1;
  11199. return;
  11200. }
  11201. int i1 = method42(plane, l, i) - j;
  11202. i -= xCameraPos;
  11203. i1 -= zCameraPos;
  11204. l -= yCameraPos;
  11205. int j1 = Model.modelIntArray1[yCameraCurve];
  11206. int k1 = Model.modelIntArray2[yCameraCurve];
  11207. int l1 = Model.modelIntArray1[xCameraCurve];
  11208. int i2 = Model.modelIntArray2[xCameraCurve];
  11209. int j2 = l * l1 + i * i2 >> 16;
  11210. l = l * i2 - i * l1 >> 16;
  11211. i = j2;
  11212. j2 = i1 * k1 - l * j1 >> 16;
  11213. l = i1 * j1 + l * k1 >> 16;
  11214. i1 = j2;
  11215. if(l >= 50) {
  11216. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  11217. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  11218. } else {
  11219. spriteDrawX = -1;
  11220. spriteDrawY = -1;
  11221. }
  11222. }
  11223.  
  11224. private void buildSplitPrivateChatMenu()
  11225. {
  11226. if(splitPrivateChat == 0)
  11227. return;
  11228. int i = 0;
  11229. if(anInt1104 != 0)
  11230. i = 1;
  11231. for(int j = 0; j < 100; j++)
  11232. if(chatMessages[j] != null)
  11233. {
  11234. int k = chatTypes[j];
  11235. String s = chatNames[j];
  11236. boolean flag1 = false;
  11237. if(s != null && s.startsWith("@cr0@")) {
  11238. s = s.substring(5);
  11239. byte byte0 = 1;
  11240. }
  11241. if(s != null && s.startsWith("@cr1@")) {
  11242. s = s.substring(5);
  11243. boolean flag2 = true;
  11244. byte byte0 = 2;
  11245. }
  11246. if(s != null && s.startsWith("@cr2@")) {
  11247. s = s.substring(5);
  11248. byte byte0 = 3;
  11249. }
  11250. if(s != null && s.startsWith("@cr3@")) {
  11251. s = s.substring(5);
  11252. byte byte0 = 4;
  11253. }
  11254. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  11255. {
  11256. int l = 329 - i * 13;
  11257. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11258. {
  11259. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11260. if(i1 > 450)
  11261. i1 = 450;
  11262. if(super.mouseX < 4 + i1)
  11263. {
  11264. if(myPrivilege >= 1)
  11265. {
  11266. menuActionName[menuActionRow] = "Report abuse @whi@";
  11267. menuActionID[menuActionRow] = 2606;
  11268. menuActionRow++;
  11269. }
  11270. menuActionName[menuActionRow] = "Add ignore";
  11271. menuActionID[menuActionRow] = 42;
  11272. menuActionRow++;
  11273. menuActionName[menuActionRow] = "Add friend";
  11274. menuActionID[menuActionRow] = 337;
  11275. menuActionRow++;
  11276. }
  11277. }
  11278. if(++i >= 5)
  11279. return;
  11280. }
  11281. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11282. return;
  11283. }
  11284.  
  11285. }
  11286.  
  11287. private void method130(int j, int k, int l, int i1, int j1, int k1,
  11288. int l1, int i2, int j2)
  11289. {
  11290. Class30_Sub1 class30_sub1 = null;
  11291. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11292. {
  11293. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  11294. continue;
  11295. class30_sub1 = class30_sub1_1;
  11296. break;
  11297. }
  11298.  
  11299. if(class30_sub1 == null)
  11300. {
  11301. class30_sub1 = new Class30_Sub1();
  11302. class30_sub1.anInt1295 = l1;
  11303. class30_sub1.anInt1296 = i1;
  11304. class30_sub1.anInt1297 = i2;
  11305. class30_sub1.anInt1298 = j1;
  11306. method89(class30_sub1);
  11307. aClass19_1179.insertHead(class30_sub1);
  11308. }
  11309. class30_sub1.anInt1291 = k;
  11310. class30_sub1.anInt1293 = k1;
  11311. class30_sub1.anInt1292 = l;
  11312. class30_sub1.anInt1302 = j2;
  11313. class30_sub1.anInt1294 = j;
  11314. }
  11315.  
  11316. private boolean interfaceIsSelected(RSInterface class9)
  11317. {
  11318. if(class9.valueCompareType == null)
  11319. return false;
  11320. for(int i = 0; i < class9.valueCompareType.length; i++)
  11321. {
  11322. int j = extractInterfaceValues(class9, i);
  11323. int k = class9.requiredValues[i];
  11324. if(class9.valueCompareType[i] == 2)
  11325. {
  11326. if(j >= k)
  11327. return false;
  11328. } else
  11329. if(class9.valueCompareType[i] == 3)
  11330. {
  11331. if(j <= k)
  11332. return false;
  11333. } else
  11334. if(class9.valueCompareType[i] == 4)
  11335. {
  11336. if(j == k)
  11337. return false;
  11338. } else
  11339. if(j != k)
  11340. return false;
  11341. }
  11342.  
  11343. return true;
  11344. }
  11345.  
  11346. private DataInputStream openJagGrabInputStream(String s)
  11347. throws IOException
  11348. {
  11349. // if(!aBoolean872)
  11350. // if(signlink.mainapp != null)
  11351. // return signlink.openurl(s);
  11352. // else
  11353. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11354. if(aSocket832 != null)
  11355. {
  11356. try
  11357. {
  11358. aSocket832.close();
  11359. System.out.println("Here5");
  11360. }
  11361. catch(Exception _ex) { }
  11362. aSocket832 = null;
  11363. }
  11364. aSocket832 = openSocket(43594);//43594
  11365. aSocket832.setSoTimeout(10000);
  11366. java.io.InputStream inputstream = aSocket832.getInputStream();
  11367. OutputStream outputstream = aSocket832.getOutputStream();
  11368. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11369. return new DataInputStream(inputstream);
  11370. }
  11371.  
  11372. private void doFlamesDrawing()
  11373. {
  11374. char c = '\u0100';
  11375. if(anInt1040 > 0)
  11376. {
  11377. for(int i = 0; i < 256; i++)
  11378. if(anInt1040 > 768)
  11379. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  11380. else
  11381. if(anInt1040 > 256)
  11382. anIntArray850[i] = anIntArray852[i];
  11383. else
  11384. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  11385.  
  11386. } else
  11387. if(anInt1041 > 0)
  11388. {
  11389. for(int j = 0; j < 256; j++)
  11390. if(anInt1041 > 768)
  11391. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  11392. else
  11393. if(anInt1041 > 256)
  11394. anIntArray850[j] = anIntArray853[j];
  11395. else
  11396. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  11397.  
  11398. } else
  11399. {
  11400. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11401.  
  11402. }
  11403. System.arraycopy(aSprite_1201.myPixels, 0, leftSideFlame.anIntArray315, 0, 33920);
  11404.  
  11405. int i1 = 0;
  11406. int j1 = 1152;
  11407. for(int k1 = 1; k1 < c - 1; k1++)
  11408. {
  11409. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11410. int j2 = 22 + l1;
  11411. if(j2 < 0)
  11412. j2 = 0;
  11413. i1 += j2;
  11414. for(int l2 = j2; l2 < 128; l2++)
  11415. {
  11416. int j3 = anIntArray828[i1++];
  11417. if(j3 != 0)
  11418. {
  11419. int l3 = j3;
  11420. int j4 = 256 - j3;
  11421. j3 = anIntArray850[j3];
  11422. int l4 = leftSideFlame.anIntArray315[j1];
  11423. leftSideFlame.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11424. } else
  11425. {
  11426. j1++;
  11427. }
  11428. }
  11429.  
  11430. j1 += j2;
  11431. }
  11432.  
  11433. leftSideFlame.drawGraphics(0, super.graphics, 0);
  11434. System.arraycopy(aSprite_1202.myPixels, 0, rightSideFlame.anIntArray315, 0, 33920);
  11435.  
  11436. i1 = 0;
  11437. j1 = 1176;
  11438. for(int k2 = 1; k2 < c - 1; k2++)
  11439. {
  11440. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11441. int k3 = 103 - i3;
  11442. j1 += i3;
  11443. for(int i4 = 0; i4 < k3; i4++)
  11444. {
  11445. int k4 = anIntArray828[i1++];
  11446. if(k4 != 0)
  11447. {
  11448. int i5 = k4;
  11449. int j5 = 256 - k4;
  11450. k4 = anIntArray850[k4];
  11451. int k5 = rightSideFlame.anIntArray315[j1];
  11452. rightSideFlame.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11453. } else
  11454. {
  11455. j1++;
  11456. }
  11457. }
  11458.  
  11459. i1 += 128 - k3;
  11460. j1 += 128 - k3 - i3;
  11461. }
  11462.  
  11463. rightSideFlame.drawGraphics(0, super.graphics, 637);
  11464. }
  11465.  
  11466. private void method134(Stream stream)
  11467. {
  11468. int j = stream.readBits(8);
  11469. if(j < playerCount)
  11470. {
  11471. for(int k = j; k < playerCount; k++)
  11472. anIntArray840[anInt839++] = playerIndices[k];
  11473.  
  11474. }
  11475. if(j > playerCount)
  11476. {
  11477. signlink.reporterror(myUsername + " Too many players");
  11478. throw new RuntimeException("eek");
  11479. }
  11480. playerCount = 0;
  11481. for(int l = 0; l < j; l++)
  11482. {
  11483. int i1 = playerIndices[l];
  11484. Player player = playerArray[i1];
  11485. int j1 = stream.readBits(1);
  11486. if(j1 == 0)
  11487. {
  11488. playerIndices[playerCount++] = i1;
  11489. player.anInt1537 = loopCycle;
  11490. } else
  11491. {
  11492. int k1 = stream.readBits(2);
  11493. if(k1 == 0)
  11494. {
  11495. playerIndices[playerCount++] = i1;
  11496. player.anInt1537 = loopCycle;
  11497. anIntArray894[anInt893++] = i1;
  11498. } else
  11499. if(k1 == 1)
  11500. {
  11501. playerIndices[playerCount++] = i1;
  11502. player.anInt1537 = loopCycle;
  11503. int l1 = stream.readBits(3);
  11504. player.moveInDir(false, l1);
  11505. int j2 = stream.readBits(1);
  11506. if(j2 == 1)
  11507. anIntArray894[anInt893++] = i1;
  11508. } else
  11509. if(k1 == 2)
  11510. {
  11511. playerIndices[playerCount++] = i1;
  11512. player.anInt1537 = loopCycle;
  11513. int i2 = stream.readBits(3);
  11514. player.moveInDir(true, i2);
  11515. int k2 = stream.readBits(3);
  11516. player.moveInDir(true, k2);
  11517. int l2 = stream.readBits(1);
  11518. if(l2 == 1)
  11519. anIntArray894[anInt893++] = i1;
  11520. } else
  11521. if(k1 == 3)
  11522. anIntArray840[anInt839++] = i1;
  11523. }
  11524. }
  11525. }
  11526. public void drawLoginScreen(boolean flag) {
  11527. resetImageProducers();
  11528. backgroundFix.drawSprite(0, 0);
  11529. loginScreenArea.initDrawingArea();
  11530. titleBox.drawBackground(254, 140);
  11531. char c = '\u0168';
  11532. char c1 = '\310';
  11533. if (loginScreenState == 0) {
  11534. int i = 100;
  11535. aTextDrawingArea_1271.method382(0x75a9a9, c / 190,
  11536. onDemandFetcher.statusString, i, true);
  11537. int l = 275;
  11538. int k1 = 300;
  11539. if ((this.mouseX >= 276) && (this.mouseX <= 493) && (this.mouseY >= 199) && (this.mouseY <= 224)) {
  11540. this.boxHover.drawSprite(276, 198);
  11541. }
  11542. else if ((this.mouseX >= 276) && (this.mouseX <= 492) && (this.mouseY >= 245) && (this.mouseY <= 272)) {
  11543. this.boxHover.drawSprite(276, 244);
  11544. }
  11545. this.smallText.method382(16777215, 385, this.loginMessage1, 283, true);
  11546. this.smallText.method382(16777215, 385, this.loginMessage2, 297, true);
  11547. this.aTextDrawingArea_1271.method389(false, 281, 16777215, new StringBuilder().append("").append(capitalize(myUsername)).append(((this.loginScreenCursorPos == 0 ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), 217);
  11548. this.aTextDrawingArea_1271.method389(true, 281, 16777215, new StringBuilder().append("").append(TextClass.passwordAsterisks(myPassword)).append(((this.loginScreenCursorPos == 1 ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), 263);
  11549. if ((this.mouseX >= 293) && (this.mouseX <= 474) && (this.mouseY >= 302) && (this.mouseY <= 327))
  11550. this.loginHover.drawSprite(296, 301);
  11551. int j = 277;
  11552. }
  11553. loginScreenArea.drawGraphics(0, super.graphics, 0);
  11554. if (welcomeScreenRaised) {
  11555. }
  11556. }
  11557.  
  11558. private void drawFlames()
  11559. {
  11560.  
  11561. }
  11562.  
  11563. public void raiseWelcomeScreen()
  11564. {
  11565. welcomeScreenRaised = true;
  11566. }
  11567.  
  11568. private void method137(Stream stream, int j)
  11569. {
  11570. if(j == 84)
  11571. {
  11572. int k = stream.readUnsignedByte();
  11573. int j3 = anInt1268 + (k >> 4 & 7);
  11574. int i6 = anInt1269 + (k & 7);
  11575. int l8 = stream.readUnsignedWord();
  11576. int k11 = stream.readUnsignedWord();
  11577. int l13 = stream.readUnsignedWord();
  11578. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  11579. {
  11580. NodeList class19_1 = groundArray[plane][j3][i6];
  11581. if(class19_1 != null)
  11582. {
  11583. 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())
  11584. {
  11585. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11586. continue;
  11587. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11588. break;
  11589. }
  11590.  
  11591. spawnGroundItem(j3, i6);
  11592. }
  11593. }
  11594. return;
  11595. }
  11596. if(j == 105)
  11597. {
  11598. int l = stream.readUnsignedByte();
  11599. int k3 = anInt1268 + (l >> 4 & 7);
  11600. int j6 = anInt1269 + (l & 7);
  11601. int i9 = stream.readUnsignedWord();
  11602. int l11 = stream.readUnsignedByte();
  11603. int i14 = l11 >> 4 & 0xf;
  11604. int i16 = l11 & 7;
  11605. 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)
  11606. {
  11607. anIntArray1207[anInt1062] = i9;
  11608. anIntArray1241[anInt1062] = i16;
  11609. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11610. anInt1062++;
  11611. }
  11612. }
  11613. if(j == 215)
  11614. {
  11615. int i1 = stream.method435();
  11616. int l3 = stream.method428();
  11617. int k6 = anInt1268 + (l3 >> 4 & 7);
  11618. int j9 = anInt1269 + (l3 & 7);
  11619. int i12 = stream.method435();
  11620. int j14 = stream.readUnsignedWord();
  11621. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  11622. {
  11623. Item class30_sub2_sub4_sub2_2 = new Item();
  11624. class30_sub2_sub4_sub2_2.ID = i1;
  11625. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11626. if(groundArray[plane][k6][j9] == null)
  11627. groundArray[plane][k6][j9] = new NodeList();
  11628. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11629. spawnGroundItem(k6, j9);
  11630. }
  11631. return;
  11632. }
  11633. if(j == 156)
  11634. {
  11635. int j1 = stream.method426();
  11636. int i4 = anInt1268 + (j1 >> 4 & 7);
  11637. int l6 = anInt1269 + (j1 & 7);
  11638. int k9 = stream.readUnsignedWord();
  11639. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  11640. {
  11641. NodeList class19 = groundArray[plane][i4][l6];
  11642. if(class19 != null)
  11643. {
  11644. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  11645. {
  11646. if(item.ID != (k9 & 0x7fff))
  11647. continue;
  11648. item.unlink();
  11649. break;
  11650. }
  11651.  
  11652. if(class19.reverseGetFirst() == null)
  11653. groundArray[plane][i4][l6] = null;
  11654. spawnGroundItem(i4, l6);
  11655. }
  11656. }
  11657. return;
  11658. }
  11659. if(j == 160)
  11660. {
  11661. int k1 = stream.method428();
  11662. int j4 = anInt1268 + (k1 >> 4 & 7);
  11663. int i7 = anInt1269 + (k1 & 7);
  11664. int l9 = stream.method428();
  11665. int j12 = l9 >> 2;
  11666. int k14 = l9 & 3;
  11667. int j16 = anIntArray1177[j12];
  11668. int j17 = stream.method435();
  11669. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  11670. {
  11671. int j18 = intGroundArray[plane][j4][i7];
  11672. int i19 = intGroundArray[plane][j4 + 1][i7];
  11673. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11674. int k20 = intGroundArray[plane][j4][i7 + 1];
  11675. if(j16 == 0)
  11676. {
  11677. Object1 class10 = worldController.method296(plane, j4, i7);
  11678. if(class10 != null)
  11679. {
  11680. int k21 = class10.uid >> 14 & 0x7fff;
  11681. if(j12 == 2)
  11682. {
  11683. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11684. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11685. } else
  11686. {
  11687. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11688. }
  11689. }
  11690. }
  11691. if(j16 == 1)
  11692. {
  11693. Object2 class26 = worldController.method297(j4, i7, plane);
  11694. if(class26 != null)
  11695. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11696. }
  11697. if(j16 == 2)
  11698. {
  11699. Object5 class28 = worldController.method298(j4, i7, plane);
  11700. if(j12 == 11)
  11701. j12 = 10;
  11702. if(class28 != null)
  11703. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11704. }
  11705. if(j16 == 3)
  11706. {
  11707. Object3 class49 = worldController.method299(i7, j4, plane);
  11708. if(class49 != null)
  11709. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11710. }
  11711. }
  11712. return;
  11713. }
  11714. if(j == 147)
  11715. {
  11716. int l1 = stream.method428();
  11717. int k4 = anInt1268 + (l1 >> 4 & 7);
  11718. int j7 = anInt1269 + (l1 & 7);
  11719. int i10 = stream.readUnsignedWord();
  11720. byte byte0 = stream.method430();
  11721. int l14 = stream.method434();
  11722. byte byte1 = stream.method429();
  11723. int k17 = stream.readUnsignedWord();
  11724. int k18 = stream.method428();
  11725. int j19 = k18 >> 2;
  11726. int i20 = k18 & 3;
  11727. int l20 = anIntArray1177[j19];
  11728. byte byte2 = stream.readSignedByte();
  11729. int l21 = stream.readUnsignedWord();
  11730. byte byte3 = stream.method429();
  11731. Player player;
  11732. if(i10 == unknownInt10)
  11733. player = myPlayer;
  11734. else
  11735. player = playerArray[i10];
  11736. if(player != null)
  11737. {
  11738. ObjectDef class46 = ObjectDef.forID(l21);
  11739. int i22 = intGroundArray[plane][k4][j7];
  11740. int j22 = intGroundArray[plane][k4 + 1][j7];
  11741. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11742. int l22 = intGroundArray[plane][k4][j7 + 1];
  11743. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11744. if(model != null)
  11745. {
  11746. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11747. player.anInt1707 = l14 + loopCycle;
  11748. player.anInt1708 = k17 + loopCycle;
  11749. player.aModel_1714 = model;
  11750. int i23 = class46.anInt744;
  11751. int j23 = class46.anInt761;
  11752. if(i20 == 1 || i20 == 3)
  11753. {
  11754. i23 = class46.anInt761;
  11755. j23 = class46.anInt744;
  11756. }
  11757. player.anInt1711 = k4 * 128 + i23 * 64;
  11758. player.anInt1713 = j7 * 128 + j23 * 64;
  11759. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11760. if(byte2 > byte0)
  11761. {
  11762. byte byte4 = byte2;
  11763. byte2 = byte0;
  11764. byte0 = byte4;
  11765. }
  11766. if(byte3 > byte1)
  11767. {
  11768. byte byte5 = byte3;
  11769. byte3 = byte1;
  11770. byte1 = byte5;
  11771. }
  11772. player.anInt1719 = k4 + byte2;
  11773. player.anInt1721 = k4 + byte0;
  11774. player.anInt1720 = j7 + byte3;
  11775. player.anInt1722 = j7 + byte1;
  11776. }
  11777. }
  11778. }
  11779. if(j == 151)
  11780. {
  11781. int i2 = stream.method426();
  11782. int l4 = anInt1268 + (i2 >> 4 & 7);
  11783. int k7 = anInt1269 + (i2 & 7);
  11784. int j10 = stream.method434();
  11785. int k12 = stream.method428();
  11786. int i15 = k12 >> 2;
  11787. int k16 = k12 & 3;
  11788. int l17 = anIntArray1177[i15];
  11789. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11790. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11791. return;
  11792. }
  11793. if(j == 4)
  11794. {
  11795. int j2 = stream.readUnsignedByte();
  11796. int i5 = anInt1268 + (j2 >> 4 & 7);
  11797. int l7 = anInt1269 + (j2 & 7);
  11798. int k10 = stream.readUnsignedWord();
  11799. int l12 = stream.readUnsignedByte();
  11800. int j15 = stream.readUnsignedWord();
  11801. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  11802. {
  11803. i5 = i5 * 128 + 64;
  11804. l7 = l7 * 128 + 64;
  11805. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11806. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11807. }
  11808. return;
  11809. }
  11810. if(j == 44)
  11811. {
  11812. int k2 = stream.method436();
  11813. int j5 = stream.readUnsignedWord();
  11814. int i8 = stream.readUnsignedByte();
  11815. int l10 = anInt1268 + (i8 >> 4 & 7);
  11816. int i13 = anInt1269 + (i8 & 7);
  11817. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  11818. {
  11819. Item class30_sub2_sub4_sub2_1 = new Item();
  11820. class30_sub2_sub4_sub2_1.ID = k2;
  11821. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11822. if(groundArray[plane][l10][i13] == null)
  11823. groundArray[plane][l10][i13] = new NodeList();
  11824. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11825. spawnGroundItem(l10, i13);
  11826. }
  11827. return;
  11828. }
  11829. if(j == 101)
  11830. {
  11831. int l2 = stream.method427();
  11832. int k5 = l2 >> 2;
  11833. int j8 = l2 & 3;
  11834. int i11 = anIntArray1177[k5];
  11835. int j13 = stream.readUnsignedByte();
  11836. int k15 = anInt1268 + (j13 >> 4 & 7);
  11837. int l16 = anInt1269 + (j13 & 7);
  11838. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11839. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11840. return;
  11841. }
  11842. if(j == 117)
  11843. {
  11844. int i3 = stream.readUnsignedByte();
  11845. int l5 = anInt1268 + (i3 >> 4 & 7);
  11846. int k8 = anInt1269 + (i3 & 7);
  11847. int j11 = l5 + stream.readSignedByte();
  11848. int k13 = k8 + stream.readSignedByte();
  11849. int l15 = stream.readSignedWord();
  11850. int i17 = stream.readUnsignedWord();
  11851. int i18 = stream.readUnsignedByte() * 4;
  11852. int l18 = stream.readUnsignedByte() * 4;
  11853. int k19 = stream.readUnsignedWord();
  11854. int j20 = stream.readUnsignedWord();
  11855. int i21 = stream.readUnsignedByte();
  11856. int j21 = stream.readUnsignedByte();
  11857. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  11858. {
  11859. l5 = l5 * 128 + 64;
  11860. k8 = k8 * 128 + 64;
  11861. j11 = j11 * 128 + 64;
  11862. k13 = k13 * 128 + 64;
  11863. 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);
  11864. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  11865. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11866. }
  11867. }
  11868. }
  11869.  
  11870. private static void setLowMem()
  11871. {
  11872. WorldController.lowMem = true;
  11873. Texture.lowMem = true;
  11874. lowMem = true;
  11875. ObjectManager.lowMem = true;
  11876. ObjectDef.lowMem = true;
  11877. }
  11878.  
  11879. private void method139(Stream stream)
  11880. {
  11881. stream.initBitAccess();
  11882. int k = stream.readBits(8);
  11883. if(k < npcCount)
  11884. {
  11885. for(int l = k; l < npcCount; l++)
  11886. anIntArray840[anInt839++] = npcIndices[l];
  11887.  
  11888. }
  11889. if(k > npcCount)
  11890. {
  11891. signlink.reporterror(myUsername + " Too many npcs");
  11892. throw new RuntimeException("eek");
  11893. }
  11894. npcCount = 0;
  11895. for(int i1 = 0; i1 < k; i1++)
  11896. {
  11897. int j1 = npcIndices[i1];
  11898. NPC npc = npcArray[j1];
  11899. int k1 = stream.readBits(1);
  11900. if(k1 == 0)
  11901. {
  11902. npcIndices[npcCount++] = j1;
  11903. npc.anInt1537 = loopCycle;
  11904. } else
  11905. {
  11906. int l1 = stream.readBits(2);
  11907. if(l1 == 0)
  11908. {
  11909. npcIndices[npcCount++] = j1;
  11910. npc.anInt1537 = loopCycle;
  11911. anIntArray894[anInt893++] = j1;
  11912. } else
  11913. if(l1 == 1)
  11914. {
  11915. npcIndices[npcCount++] = j1;
  11916. npc.anInt1537 = loopCycle;
  11917. int i2 = stream.readBits(3);
  11918. npc.moveInDir(false, i2);
  11919. int k2 = stream.readBits(1);
  11920. if(k2 == 1)
  11921. anIntArray894[anInt893++] = j1;
  11922. } else
  11923. if(l1 == 2)
  11924. {
  11925. npcIndices[npcCount++] = j1;
  11926. npc.anInt1537 = loopCycle;
  11927. int j2 = stream.readBits(3);
  11928. npc.moveInDir(true, j2);
  11929. int l2 = stream.readBits(3);
  11930. npc.moveInDir(true, l2);
  11931. int i3 = stream.readBits(1);
  11932. if(i3 == 1)
  11933. anIntArray894[anInt893++] = j1;
  11934. } else
  11935. if(l1 == 3)
  11936. anIntArray840[anInt839++] = j1;
  11937. }
  11938. }
  11939.  
  11940. }
  11941.  
  11942. private void processLoginScreenInput() {
  11943. if (this.loginScreenState == 0) {
  11944. int l = super.myHeight / 2 + 20;
  11945. l += 20;
  11946. int i = this.myHeight / 2 - 40;
  11947. i += 30;
  11948. i += 25;
  11949. resetImage();
  11950. if (super.clickMode3 == 1 && super.saveClickX >= 276
  11951. && super.saveClickX <= 490 && super.saveClickY >= 194
  11952. && super.saveClickY <= 223)
  11953. loginScreenCursorPos = 0;
  11954. if (super.clickMode3 == 1 && super.mouseX >= 276
  11955. && super.mouseX <= 490 && super.mouseY >= 240
  11956. && super.mouseY <= 270)
  11957. loginScreenCursorPos = 1;
  11958. if (super.clickMode3 == 1 && super.saveClickX >= 295
  11959. && super.saveClickX <= 474 && super.saveClickY >= 301
  11960. && super.saveClickY <= 325) {
  11961. loginFailures = 0;
  11962. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  11963. login(myUsername, myPassword, false);
  11964. } else {
  11965. this.loginScreenCursorPos = 0;
  11966. this.loginMessage1 = "Username & Password";
  11967. this.loginMessage2 = "Must be more than 1 character";
  11968. }
  11969. if (this.loggedIn)
  11970. return;
  11971. }
  11972. do {
  11973. int l1 = readChar(-796);
  11974. if (l1 == -1)
  11975. break;
  11976. boolean flag1 = false;
  11977. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  11978. if (l1 != validUserPassChars.charAt(i2))
  11979. continue;
  11980. flag1 = true;
  11981. break;
  11982. }
  11983.  
  11984. if (loginScreenCursorPos == 0) {
  11985. if (l1 == 8 && myUsername.length() > 0)
  11986. myUsername = myUsername.substring(0,
  11987. myUsername.length() - 1);
  11988. if (l1 == 9 || l1 == 10 || l1 == 13)
  11989. loginScreenCursorPos = 1;
  11990. if (flag1)
  11991. myUsername += (char) l1;
  11992. if (myUsername.length() > 12)
  11993. myUsername = myUsername.substring(0, 12);
  11994. } else if (loginScreenCursorPos == 1) {
  11995. if (l1 == 8 && myPassword.length() > 0)
  11996. myPassword = myPassword.substring(0,
  11997. myPassword.length() - 1);
  11998. if (l1 == 9 || l1 == 10 || l1 == 13)
  11999. loginScreenCursorPos = 0;
  12000. if (flag1)
  12001. myPassword += (char) l1;
  12002. if (myPassword.length() > 20)
  12003. myPassword = myPassword.substring(0, 20);
  12004. }
  12005. } while (true);
  12006. return;
  12007. }
  12008. if (loginScreenState == 3) {
  12009. int k = super.myWidth / 2;
  12010. int j1 = super.myHeight / 2 + 50;
  12011. j1 += 20;
  12012. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  12013. && super.saveClickX <= k + 75
  12014. && super.saveClickY >= j1 - 20
  12015. && super.saveClickY <= j1 + 20)
  12016. loginScreenState = 0;
  12017. }
  12018. }
  12019.  
  12020. private void markMinimap(Sprite sprite, int i, int j, boolean flag) {
  12021. int k = minimapInt1 + minimapInt2 & 0x7ff;
  12022. int l = i * i + j * j;
  12023. if(flag)
  12024. return;
  12025. if(l > 6400)
  12026. return;
  12027. int i1 = Model.modelIntArray1[k];
  12028. int j1 = Model.modelIntArray2[k];
  12029. i1 = (i1 * 256) / (minimapInt3 + 256);
  12030. j1 = (j1 * 256) / (minimapInt3 + 256);
  12031. int k1 = j * i1 + i * j1 >> 16;
  12032. int l1 = j * j1 - i * i1 >> 16;
  12033. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  12034. sprite.drawSprite(((106 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  12035. } else {
  12036. sprite.drawSprite(((122 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  12037. }
  12038. CustomMapback[getSpriteID()].drawSprite(0, 0);
  12039. }
  12040.  
  12041. public int flagPos = 72;
  12042. public int runState = 1;
  12043. public boolean logHover = false;
  12044. public boolean xpHover = false;
  12045. public boolean xpClicked = false;
  12046. public boolean drawXpBar = false;
  12047. public boolean drawFlag = false;
  12048. public int xpToDraw = 0;
  12049. public int interfaceButtonAction = 0;
  12050. public int testXp = 0;
  12051. public Sprite[] globe = new Sprite[3];
  12052. public Sprite[] ORBS = new Sprite[18];
  12053. public Sprite[] LOGOUT = new Sprite[5];
  12054. public Sprite xpOrb;
  12055. public Sprite sprite1;
  12056. public Sprite xpFlag;
  12057.  
  12058. public static boolean globeState[] = {
  12059. false, false
  12060. };
  12061. public void drawXpOrb() {
  12062. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY <= 80){
  12063. xpHover = true;
  12064. } else {
  12065. xpHover = false;
  12066. }
  12067. if(super.clickMode3 == 1 && super.saveClickX >= 516 && super.saveClickX <= 550 && super.saveClickY >= 46 && super.saveClickY <= 80) {
  12068. if(!xpClicked) {
  12069. xpClicked = true;
  12070. drawXpBar = true;
  12071. } else {
  12072. xpClicked = false;
  12073. drawXpBar = false;
  12074. }
  12075. }
  12076. if(!xpClicked) {
  12077. if(!xpHover) {
  12078. ORBS[17].drawSprite(0, 46);
  12079. } else {
  12080. ORBS[16].drawSprite(0, 46);
  12081. }
  12082. } else {
  12083. if(!xpHover) {
  12084. ORBS[17].drawSprite(0, 46);
  12085. } else {
  12086. ORBS[16].drawSprite(0, 46);
  12087. }
  12088. }
  12089. }
  12090. public void drawGlobe(){
  12091. if(is508 == true || is525 == true || is562 == true) {
  12092. if(super.clickMode3 == 1){
  12093. if(super.saveClickX >= 522 && super.saveClickX <= 558 && super.saveClickY >= 124 && super.saveClickY < 161){
  12094. if(globeState[0]){
  12095. globeState[0] = false;
  12096. } else {
  12097. globeState[0] = true;
  12098. }
  12099. }
  12100. }
  12101. if(super.mouseX >= 522 && super.mouseX <= 558 && super.mouseY >= 124 && super.mouseY < 161){
  12102. globeState[1] = true;
  12103. } else {
  12104. globeState[1] = false;
  12105. }
  12106. } else {
  12107. }
  12108. }
  12109.  
  12110. public void drawLogout(){
  12111. if(is508 || is525 || is562) {
  12112. if(!logHover){
  12113. LOGOUT[0].drawSprite(226, 1);
  12114. } else {
  12115. LOGOUT[1].drawSprite(226, 1);
  12116. }
  12117. if(super.clickMode2 == 1 && super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 1 && super.mouseY <= 25){
  12118. LOGOUT[2].drawSprite(226, 1);
  12119. }
  12120. } else if(is480) {
  12121. if(tabID == 14) {
  12122. LOGOUT[4].drawSprite(226, 1);
  12123. } if(tabID != 14) {
  12124. LOGOUT[3].drawSprite(226, 1);
  12125. }
  12126. }
  12127. }
  12128.  
  12129. public void loadOrbs() {
  12130. drawLogout();
  12131. drawHP();
  12132. if(is562){
  12133. drawXpOrb();
  12134. }
  12135. drawPrayer();
  12136. drawCoinOrb();
  12137. drawRunOrb();
  12138. if(is508 == true) {
  12139. globe[0].drawSprite(10, 123);
  12140. } else if(is525 == true || is562 == true) {
  12141. drawGlobe();
  12142. if (globeState[0] && globeState[1]) {
  12143. globe[2].drawSprite(10, 123);
  12144. } else if (globeState[1]) {
  12145. globe[2].drawSprite(10, 123);
  12146. } else if (globeState[0]) {
  12147. globe[1].drawSprite(10, 123);
  12148. } else {
  12149. globe[1].drawSprite(10, 123);
  12150. }
  12151. }
  12152. }
  12153. public Sprite[] Black = new Sprite[5];
  12154.  
  12155. public void loadExtraSprites(){
  12156. magicAuto = new Sprite("Misc/magicAuto");
  12157. sprite1 = new Sprite("Gameframe/sprite1");
  12158. xpFlag = new Sprite("Gameframe/xpFlag");
  12159. for(int i = 1; i <= 17; i++) {
  12160. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  12161. }
  12162. for(int i = 0; i <= 4;i++) {
  12163. LOGOUT[i] = new Sprite("Gameframe/Orbs/X "+i+"");
  12164. }
  12165. for (int j3 = 0; j3 <= 26; j3++) {
  12166. LOGIN[j3] = new Sprite("Login/Buttons/BUTTON "+j3+"");
  12167. }
  12168. for (int i = 0; i <= 2; i++) {
  12169. globe[i] = new Sprite("Gameframe/Globe "+i+"");
  12170. }
  12171. for(int i = 0; i <= 4; i++){
  12172. chatArea[i] = new Sprite("Gameframe/Gameframes/chatArea "+i+"");
  12173. }
  12174. for(int i = 0; i <= 4; i++){
  12175. tabArea[i] = new Sprite("Gameframe/Gameframes/tabArea "+i+"");
  12176. }
  12177. for(int i = 0; i <= 4; i++){
  12178. CustomMapback[i] = new Sprite("Gameframe/Gameframes/Mapback "+i+"");
  12179. }
  12180. for(int i = 0; i <= 6; i++){
  12181. modIcons[i] = new Sprite("Player/MODICONS "+i+"");
  12182. }
  12183. for(int i = 0; i <= 6; i++){
  12184. chatImages[i] = new Sprite("Player/MODICONS "+i+"");
  12185. }
  12186. for(int i = 0; i <= 4; i++){
  12187. Black[i] = new Sprite("Gameframe/Gameframes/Black "+i+"");
  12188. }
  12189. for(int i4 = 0; i4 < 3; i4++) {
  12190. hitMark[i4] = new Sprite("Player/Hits "+i4+"");
  12191. }
  12192. qc = new Sprite("Gameframe/Quickchat");
  12193. }
  12194.  
  12195. public Sprite coinOrb;
  12196. public Sprite coinPart;
  12197. public boolean coinToggle = false;
  12198. public Sprite coinOrbPart;
  12199.  
  12200. public void drawCoinParts(){
  12201. if(!coinToggle){
  12202. if(super.mouseX >= 512 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118){
  12203. coinOrbPart = new Sprite("coinpart hover");
  12204. } else {
  12205. coinOrbPart = new Sprite("coinpart normal");
  12206. }
  12207. }
  12208. coinOrbPart.drawSprite(505+4, 93-11);
  12209. }
  12210.  
  12211. public void drawCoinOrb(){//512 nontoggle
  12212. if(!coinToggle) {//436,87 534 x 118 y
  12213. if(super.mouseX >= 512 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118){
  12214. coinOrb = new Sprite("coin simple hover");
  12215. } else {
  12216. coinOrb = new Sprite("coin simple normal");
  12217. }
  12218. } else if(coinToggle) {
  12219. if(super.mouseX >= 436 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118){
  12220. coinOrb = new Sprite("coin simple hover toggle");
  12221. coinPart = new Sprite("coin complex hover toggle");
  12222. } else {
  12223. coinOrb = new Sprite("coin simple normal toggle");
  12224. coinPart = new Sprite("coin complex normal toggle");
  12225. }
  12226. }
  12227. coinOrb.drawSprite(520-300-200-20-4, 47+37);//+37
  12228.  
  12229. if(super.mouseX >= 436 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118) {
  12230. coinPart = new Sprite("coin complex hover toggle");
  12231. coinOrb = new Sprite("coin simple hover");
  12232. }
  12233. }
  12234.  
  12235. public boolean restOrb = false;
  12236. public boolean musicOrb = false;
  12237. public boolean prayClicked = false;
  12238. public boolean prayHover = false;
  12239. public boolean runClicked = true;
  12240. public boolean runHover = false;
  12241.  
  12242. private void rightClickChatButtons() {
  12243. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  12244. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12245. menuActionName[1] = "View All";
  12246. menuActionID[1] = 999;
  12247. menuActionRow = 2;
  12248. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  12249. menuActionName[1] = "View Game";
  12250. menuActionID[1] = 998;
  12251. menuActionRow = 2;
  12252. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  12253. menuActionName[1] = "Hide public";
  12254. menuActionID[1] = 997;
  12255. menuActionName[2] = "Off public";
  12256. menuActionID[2] = 996;
  12257. menuActionName[3] = "Friends public";
  12258. menuActionID[3] = 995;
  12259. menuActionName[4] = "On public";
  12260. menuActionID[4] = 994;
  12261. menuActionName[5] = "View public";
  12262. menuActionID[5] = 993;
  12263. menuActionRow = 6;
  12264. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  12265. menuActionName[1] = "Off private";
  12266. menuActionID[1] = 992;
  12267. menuActionName[2] = "Friends private";
  12268. menuActionID[2] = 991;
  12269. menuActionName[3] = "On private";
  12270. menuActionID[3] = 990;
  12271. menuActionName[4] = "View private";
  12272. menuActionID[4] = 989;
  12273. menuActionRow = 5;
  12274. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  12275. menuActionName[1] = "Off clan chat";
  12276. menuActionID[1] = 1003;
  12277. menuActionName[2] = "Friends clan chat";
  12278. menuActionID[2] = 1002;
  12279. menuActionName[3] = "On clan chat";
  12280. menuActionID[3] = 1001;
  12281. menuActionName[4] = "View clan chat";
  12282. menuActionID[4] = 1000;
  12283. menuActionRow = 5;
  12284. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  12285. menuActionName[1] = "Off trade";
  12286. menuActionID[1] = 987;
  12287. menuActionName[2] = "Friends trade";
  12288. menuActionID[2] = 986;
  12289. menuActionName[3] = "On trade";
  12290. menuActionID[3] = 985;
  12291. menuActionName[4] = "View trade";
  12292. menuActionID[4] = 984;
  12293. menuActionRow = 5;
  12294. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  12295. menuActionName[1] = "Off assist";
  12296. menuActionID[1] = -1;
  12297. menuActionName[2] = "Friends assist";
  12298. menuActionID[2] = -1;
  12299. menuActionName[3] = "On assist";
  12300. menuActionID[3] = -1;
  12301. menuActionName[4] = "View assist";
  12302. menuActionID[4] = -1;
  12303. menuActionRow = 5;
  12304. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  12305. menuActionName[1] = "Report Abuse";
  12306. menuActionID[1] = 606;
  12307. menuActionRow = 2;
  12308. }
  12309. } else if(is474) {
  12310. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12311. menuActionName[1] = "View All";
  12312. menuActionID[1] = 999;
  12313. menuActionRow = 2;
  12314. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  12315. menuActionName[1] = "View Game";
  12316. menuActionID[1] = 998;
  12317. menuActionRow = 2;
  12318. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  12319. menuActionName[1] = "Hide public";
  12320. menuActionID[1] = 997;
  12321. menuActionName[2] = "Off public";
  12322. menuActionID[2] = 996;
  12323. menuActionName[3] = "Friends public";
  12324. menuActionID[3] = 995;
  12325. menuActionName[4] = "On public";
  12326. menuActionID[4] = 994;
  12327. menuActionName[5] = "View public";
  12328. menuActionID[5] = 993;
  12329. menuActionRow = 6;
  12330. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  12331. menuActionName[1] = "Off private";
  12332. menuActionID[1] = 992;
  12333. menuActionName[2] = "Friends private";
  12334. menuActionID[2] = 991;
  12335. menuActionName[3] = "On private";
  12336. menuActionID[3] = 990;
  12337. menuActionName[4] = "View private";
  12338. menuActionID[4] = 989;
  12339. menuActionRow = 5;
  12340. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  12341. menuActionName[1] = "Off clan chat";
  12342. menuActionID[1] = 1003;
  12343. menuActionName[2] = "Friends clan chat";
  12344. menuActionID[2] = 1002;
  12345. menuActionName[3] = "On clan chat";
  12346. menuActionID[3] = 1001;
  12347. menuActionName[4] = "View clan chat";
  12348. menuActionID[4] = 1000;
  12349. menuActionRow = 5;
  12350. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  12351. menuActionName[1] = "Off trade";
  12352. menuActionID[1] = 987;
  12353. menuActionName[2] = "Friends trade";
  12354. menuActionID[2] = 986;
  12355. menuActionName[3] = "On trade";
  12356. menuActionID[3] = 985;
  12357. menuActionName[4] = "View trade";
  12358. menuActionID[4] = 984;
  12359. menuActionRow = 5;
  12360. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  12361. menuActionName[1] = "Report Abuse";
  12362. menuActionID[1] = 606;
  12363. menuActionRow = 2;
  12364. }
  12365. } else {
  12366.  
  12367. }
  12368.  
  12369. }
  12370.  
  12371. public void determineTopTabs(){
  12372. if(is474 || is480 || is508 || is525) {
  12373. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 168 && super.mouseY < 203) {
  12374. menuActionName[1] = "Combat Options";
  12375. menuActionID[1] = 1021;
  12376. menuActionRow = 2;
  12377. } else if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 168 && super.mouseY < 203) {
  12378. menuActionName[1] = "Stats";
  12379. menuActionID[1] = 1022;
  12380. menuActionRow = 2;
  12381. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 168 && super.mouseY < 203) {
  12382. menuActionName[1] = "Quest List";
  12383. menuActionID[1] = 1023;
  12384. menuActionRow = 2;
  12385. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 168 && super.mouseY < 203) {
  12386. menuActionName[1] = "Inventory";
  12387. menuActionID[1] = 1024;
  12388. menuActionRow = 2;
  12389. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 168 && super.mouseY < 203) {
  12390. menuActionName[1] = "Worn Equipment";
  12391. menuActionID[1] = 1030;
  12392. menuActionRow = 2;
  12393. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 168 && super.mouseY < 203) {
  12394. menuActionName[1] = "Prayer";
  12395. menuActionID[1] = 1026;
  12396. menuActionRow = 2;
  12397. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 168 && super.mouseY < 203) {
  12398. menuActionName[1] = "Magic";
  12399. menuActionID[1] = 1027;
  12400. menuActionRow = 2;
  12401. }
  12402. } else if(is562) {
  12403.  
  12404. }
  12405. }
  12406.  
  12407. public void determineBottomTabs(){
  12408. if(is480 || is508 || is525) {
  12409. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  12410. menuActionName[1] = "Logout";
  12411. menuActionID[1] = 1502;
  12412. menuActionRow = 2;
  12413. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  12414. menuActionName[1] = "Clan Chat";
  12415. menuActionID[1] = 1008;
  12416. menuActionRow = 2;
  12417. } else if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
  12418. menuActionName[1] = "Logout";
  12419. menuActionID[1] = 1011;
  12420. menuActionRow = 2;
  12421. }
  12422. } else if(is474 && !is562) {
  12423. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  12424. menuActionName[1] = "Clan Chat";
  12425. menuActionID[1] = 1008;
  12426. menuActionRow = 2;
  12427. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  12428. menuActionName[1] = "Logout";
  12429. menuActionID[1] = 1011;
  12430. menuActionRow = 2;
  12431. }
  12432. } else if(is562){
  12433. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  12434. tabHPos = 0;
  12435. needDrawTabArea = true;
  12436. tabAreaAltered = true;
  12437. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  12438. tabHPos = 1;
  12439. needDrawTabArea = true;
  12440. tabAreaAltered = true;
  12441. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  12442. tabHPos = 2;
  12443. needDrawTabArea = true;
  12444. tabAreaAltered = true;
  12445. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  12446. tabHPos = 3;
  12447. needDrawTabArea = true;
  12448. tabAreaAltered = true;
  12449. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  12450. tabHPos = 4;
  12451. needDrawTabArea = true;
  12452. tabAreaAltered = true;
  12453. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  12454. tabHPos = 5;
  12455. needDrawTabArea = true;
  12456. tabAreaAltered = true;
  12457. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  12458. tabHPos = 6;
  12459. needDrawTabArea = true;
  12460. tabAreaAltered = true;
  12461. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  12462. tabHPos = 7;
  12463. needDrawTabArea = true;
  12464. tabAreaAltered = true;
  12465. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  12466. tabHPos = 15;
  12467. needDrawTabArea = true;
  12468. tabAreaAltered = true;
  12469. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  12470. tabHPos = 8;
  12471. needDrawTabArea = true;
  12472. tabAreaAltered = true;
  12473. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  12474. tabHPos = 9;
  12475. needDrawTabArea = true;
  12476. tabAreaAltered = true;
  12477. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  12478. tabHPos = 10;
  12479. needDrawTabArea = true;
  12480. tabAreaAltered = true;
  12481. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  12482. tabHPos = 11;
  12483. needDrawTabArea = true;
  12484. tabAreaAltered = true;
  12485. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  12486. tabHPos = 12;
  12487. needDrawTabArea = true;
  12488. tabAreaAltered = true;
  12489. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  12490. tabHPos = 13;
  12491. needDrawTabArea = true;
  12492. tabAreaAltered = true;
  12493. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  12494. tabHPos = 14;
  12495. needDrawTabArea = true;
  12496. tabAreaAltered = true;
  12497. } else {
  12498. tabHPos = -1;
  12499. needDrawTabArea = true;
  12500. tabAreaAltered = true;
  12501. }
  12502. if(super.clickMode3 == 1) {
  12503. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  12504. needDrawTabArea = true;
  12505. tabID = 0;
  12506. tabAreaAltered = true;
  12507. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  12508. needDrawTabArea = true;
  12509. tabID = 1;
  12510. tabAreaAltered = true;
  12511. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  12512. needDrawTabArea = true;
  12513. tabID = 2;
  12514. tabAreaAltered = true;
  12515. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  12516. needDrawTabArea = true;
  12517. tabID = 14;
  12518. tabAreaAltered = true;
  12519. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  12520. needDrawTabArea = true;
  12521. tabID = 3;
  12522. tabAreaAltered = true;
  12523. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  12524. needDrawTabArea = true;
  12525. tabID = 4;
  12526. tabAreaAltered = true;
  12527. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  12528. needDrawTabArea = true;
  12529. tabID = 5;
  12530. tabAreaAltered = true;
  12531. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  12532. needDrawTabArea = true;
  12533. tabID = 6;
  12534. tabAreaAltered = true;
  12535. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  12536. needDrawTabArea = true;
  12537. tabID = 16;
  12538. tabAreaAltered = true;
  12539. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  12540. needDrawTabArea = true;
  12541. tabID = 8;
  12542. tabAreaAltered = true;
  12543. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  12544. needDrawTabArea = true;
  12545. tabID = 9;
  12546. tabAreaAltered = true;
  12547. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  12548. needDrawTabArea = true;
  12549. tabID = 7;
  12550. tabAreaAltered = true;
  12551. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  12552. needDrawTabArea = true;
  12553. tabID = 11;
  12554. tabAreaAltered = true;
  12555. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  12556. needDrawTabArea = true;
  12557. tabID = 12;
  12558. tabAreaAltered = true;
  12559. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  12560. needDrawTabArea = true;
  12561. tabID = 13;
  12562. tabAreaAltered = true;
  12563. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  12564. needDrawTabArea = true;
  12565. tabID = 15;
  12566. tabAreaAltered = true;
  12567. }
  12568. }
  12569.  
  12570. }
  12571. if(is474 || is480 || is508 || is525) {
  12572. if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 466 && super.mouseY < 503) {
  12573. menuActionName[1] = "Friend List";
  12574. menuActionID[1] = 1009;
  12575. menuActionRow = 2;
  12576. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 466 && super.mouseY < 503) {
  12577. menuActionName[1] = "Ignore List";
  12578. menuActionID[1] = 1010;
  12579. menuActionRow = 2;
  12580. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 466 && super.mouseY < 503) {
  12581. menuActionName[1] = "Options";
  12582. menuActionID[1] = 1012;
  12583. menuActionRow = 2;
  12584. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 466 && super.mouseY < 503) {
  12585. menuActionName[1] = "Emotes";
  12586. menuActionID[1] = 1013;
  12587. menuActionRow = 2;
  12588. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 466 && super.mouseY < 503) {
  12589. menuActionName[1] = "Music Player";
  12590. menuActionID[1] = 1014;
  12591. menuActionRow = 2;
  12592. }
  12593. }
  12594. }
  12595.  
  12596. private void processMinimapActions() {
  12597.  
  12598.  
  12599.  
  12600. if(is508 == true || is525 == true || is562 == true) {
  12601. if(super.mouseX >= 527 && super.mouseX <= 560 && super.mouseY >= 126 && super.mouseY <= 159) {
  12602. menuActionName[1] = "World Map";
  12603. menuActionID[1] = 1005;
  12604. menuActionRow = 2;
  12605. }
  12606. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  12607. if(!runClicked){
  12608. menuActionName[2] = "Toggle Run-Mode On";
  12609. } else if(runClicked){
  12610. menuActionName[2] = "Toggle Run-Mode Off";
  12611. }
  12612. menuActionID[2] = 1050;
  12613. menuActionRow = 2;
  12614. menuActionName[1] = "Rest";
  12615. menuActionID[1] = 1501;
  12616. menuActionRow = 3;
  12617. }
  12618. int x = super.mouseX;
  12619. int y = super.mouseY;
  12620. if (x >= 531 && x <= 557 && y >= 7 && y <= 40) {
  12621. menuActionName[1] = "Face North";
  12622. menuActionID[1] = 477;
  12623. menuActionRow = 2;
  12624. }
  12625. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY < 80){
  12626. menuActionName[2] = "Toggle XP Total";
  12627. menuActionID[2] = 1503;
  12628. menuActionRow = 2;
  12629. menuActionName[1] = "Reset XP Total";
  12630. menuActionID[1] = 1504;
  12631. menuActionRow = 3;
  12632. }
  12633. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  12634. if(!prayClicked){
  12635. menuActionName[1] = "Toggle Quick-Prayers On";
  12636. } else if(prayClicked){
  12637. menuActionName[1] = "Toggle Quick-Prayers Off";
  12638. }
  12639. menuActionID[1] = 1500;
  12640. menuActionRow = 2;
  12641. }
  12642. if(!coinToggle){
  12643. if (super.mouseX >= 512 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118) {
  12644. menuActionName[4] = coinToggle ? "Toggle money pouch" : "Toggle money pouch";
  12645. menuActionID[4] = 712;
  12646. menuActionName[3] = "Withdraw money pouch";
  12647. menuActionID[3] = 713;
  12648. menuActionName[2] = "Examine money pouch";
  12649. menuActionID[2] = 714;
  12650. menuActionName[1] = "Price checker";
  12651. menuActionID[1] = 715;
  12652. menuActionRow = 5;
  12653. }
  12654. } else if(coinToggle){
  12655. if (super.mouseX >= 436 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118) {
  12656. menuActionName[4] = coinToggle ? "Toggle money pouch" : "Toggle money pouch";
  12657. menuActionID[4] = 712;
  12658. menuActionName[3] = "Withdraw money pouch";
  12659. menuActionID[3] = 713;
  12660. menuActionName[2] = "Examine money pouch";
  12661. menuActionID[2] = 714;
  12662. menuActionName[1] = "Price checker";
  12663. menuActionID[1] = 715;
  12664. menuActionRow = 5;
  12665. }
  12666. }
  12667. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  12668. if(!prayClicked){
  12669. menuActionName[1] = "Toggle Quick-Prayers On";
  12670. } else if(prayClicked){
  12671. menuActionName[1] = "Toggle Quick-Prayers Off";
  12672. }
  12673. menuActionID[1] = 1500;
  12674. menuActionRow = 2;
  12675. }
  12676. }
  12677. }
  12678.  
  12679. public int getOrbTextColor(int statusInt){
  12680. if(statusInt >= 75 && statusInt <= 100){
  12681. return 0x00FF00;
  12682. } else if(statusInt >= 50 && statusInt <= 74){
  12683. return 0xFFFF00;
  12684. } else if(statusInt >= 25 && statusInt <= 49){
  12685. return 0xFF981F;
  12686. } else {
  12687. return 0xFF0000;
  12688. }
  12689. }
  12690.  
  12691. public int getOrbFill(int statusInt){
  12692. if(statusInt <= 100 && statusInt >= 97) {
  12693. return 0;
  12694. } else if(statusInt <= 96 && statusInt >= 93) {
  12695. return 1;
  12696. } else if(statusInt <= 92 && statusInt >= 89) {
  12697. return 2;
  12698. } else if(statusInt <= 88 && statusInt >= 85) {
  12699. return 3;
  12700. } else if(statusInt <= 84 && statusInt >= 81) {
  12701. return 4;
  12702. } else if(statusInt <= 80 && statusInt >= 77) {
  12703. return 5;
  12704. } else if(statusInt <= 76 && statusInt >= 73) {
  12705. return 6;
  12706. } else if(statusInt <= 72 && statusInt >= 69) {
  12707. return 7;
  12708. } else if(statusInt <= 68 && statusInt >= 65) {
  12709. return 8;
  12710. } else if(statusInt <= 64 && statusInt >= 61) {
  12711. return 9;
  12712. } else if(statusInt <= 60 && statusInt >= 57) {
  12713. return 10;
  12714. } else if(statusInt <= 56 && statusInt >= 53) {
  12715. return 11;
  12716. } else if(statusInt <= 52 && statusInt >= 49) {
  12717. return 12;
  12718. } else if(statusInt <= 48 && statusInt >= 45) {
  12719. return 13;
  12720. } else if(statusInt <= 44 && statusInt >= 41) {
  12721. return 14;
  12722. } else if(statusInt <= 40 && statusInt >= 37) {
  12723. return 15;
  12724. } else if(statusInt <= 36 && statusInt >= 33) {
  12725. return 16;
  12726. } else if(statusInt <= 32 && statusInt >= 29) {
  12727. return 17;
  12728. } else if(statusInt <= 28 && statusInt >= 25) {
  12729. return 18;
  12730. } else if(statusInt <= 24 && statusInt >= 21) {
  12731. return 19;
  12732. } else if(statusInt <= 20 && statusInt >= 17) {
  12733. return 20;
  12734. } else if(statusInt <= 16 && statusInt >= 13) {
  12735. return 21;
  12736. } else if(statusInt <= 12 && statusInt >= 9) {
  12737. return 22;
  12738. } else if(statusInt <= 8 && statusInt >= 7) {
  12739. return 23;
  12740. } else if(statusInt <= 6 && statusInt >= 5) {
  12741. return 24;
  12742. } else if(statusInt <= 4 && statusInt >= 3) {
  12743. return 25;
  12744. } else if(statusInt <= 2 && statusInt >= 1) {
  12745. return 26;
  12746. } else if(statusInt <= 0) {
  12747. return 27;
  12748. }
  12749. return 0;
  12750. }
  12751.  
  12752. public void drawHP() {
  12753. int health;
  12754. String OrbDirectory = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12755. String cHP = RSInterface.interfaceCache[4016].disabledMessage; cHP = cHP.replaceAll("%","");
  12756. int currentHP = Integer.parseInt(cHP);
  12757. String mHP = RSInterface.interfaceCache[4017].disabledMessage; mHP = mHP.replaceAll("%","");
  12758. int maxHP2 = Integer.parseInt(mHP);
  12759. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  12760. ORBS[0] = new Sprite(OrbDirectory+"ORBS 0.PNG", 27, getOrbFill(health));
  12761. if(is480){
  12762. ORBS[14].drawSprite(174, 14);
  12763. } else {
  12764. ORBS[1].drawSprite(174, 14);
  12765. }
  12766. ORBS[2].drawSprite(177, 17);
  12767. ORBS[0].drawSprite(177, 17);
  12768. if(health <= 20){
  12769. if(loopCycle % 20 < 10){
  12770. ORBS[3].drawSprite(183, 25);
  12771. }
  12772. } else {
  12773. ORBS[3].drawSprite(183, 25);
  12774. }
  12775. int Y = 40;
  12776. if(is480){
  12777. Y = 43;
  12778. }
  12779. smallText.method382(getOrbTextColor(health), 218, RSInterface.interfaceCache[4016].disabledMessage, Y, true);
  12780. }
  12781.  
  12782. public void drawPrayer() {
  12783. int prayer;
  12784. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12785. String cPR = RSInterface.interfaceCache[4012].disabledMessage;
  12786. int currentPR = Integer.parseInt(cPR);
  12787. String mPR = RSInterface.interfaceCache[4013].disabledMessage;
  12788. int maxPR2 = Integer.parseInt(mPR);
  12789. prayer = (int)(((double)currentPR / (double)maxPR2) * 100D);
  12790. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(prayer));
  12791. if(!prayClicked){
  12792. if(!is480){
  12793. if(prayHover){
  12794. ORBS[7].drawSprite(190, 53);
  12795. }else if(!prayHover){
  12796. ORBS[1].drawSprite(190, 53);
  12797. }
  12798. } else {
  12799. if(prayHover){
  12800. ORBS[15].drawSprite(190, 53);
  12801. } else {
  12802. ORBS[14].drawSprite(190, 53);
  12803. }
  12804. }
  12805. ORBS[4].drawSprite(193, 56);
  12806. } else if(prayClicked){
  12807. if(!is480){
  12808. if(prayHover){
  12809. ORBS[7].drawSprite(190, 53);
  12810. } else if(!prayHover){
  12811. ORBS[1].drawSprite(190, 53);
  12812. }
  12813. } else {
  12814. if(prayHover){
  12815. ORBS[15].drawSprite(190, 53);
  12816. } else {
  12817. ORBS[14].drawSprite(190, 53);
  12818. }
  12819. }
  12820. ORBS[5].drawSprite(193, 56);
  12821. }
  12822. ORBS[0].drawSprite(194, 56);
  12823. if(prayer <= 25) {
  12824. if(loopCycle % 20 < 10) {
  12825. ORBS[6].drawSprite(197, 60);
  12826. }
  12827. } else {
  12828. ORBS[6].drawSprite(197, 60);
  12829. }
  12830. int Y = 79;
  12831. if(is480){
  12832. Y = 82;
  12833. }
  12834. smallText.method382(getOrbTextColor(prayer), 234, RSInterface.interfaceCache[4012].disabledMessage, Y, true);
  12835. }
  12836.  
  12837. public void drawRunOrb(){
  12838. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12839. String cEn = RSInterface.interfaceCache[149].disabledMessage; cEn = cEn.replaceAll("%","");
  12840. int currentEner = Integer.parseInt(cEn);
  12841. energy = (int)(((double)currentEner / 100) * 100D);
  12842. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(energy));
  12843. if(!runClicked){
  12844. if(!is480){
  12845. if(runHover){
  12846. ORBS[7].drawSprite(190, 92);
  12847. } else{
  12848. ORBS[1].drawSprite(190, 92);
  12849. }
  12850. } else {
  12851. ORBS[14].drawSprite(190, 92);
  12852. }
  12853. ORBS[10].drawSprite(193, 95);
  12854. if(energy != 100){
  12855. ORBS[0].drawSprite(193, 95);
  12856. }
  12857. ORBS[8].drawSprite(199, 100);
  12858. } else {
  12859. if(!is480){
  12860. if(runHover){
  12861. ORBS[7].drawSprite(190, 92);
  12862. } else {
  12863. ORBS[1].drawSprite(190, 92);
  12864. }
  12865. } else {
  12866. ORBS[14].drawSprite(190, 92);
  12867. }
  12868. ORBS[11].drawSprite(193, 95);
  12869. if(energy != 100){
  12870. ORBS[0].drawSprite(193, 95);
  12871. }
  12872. ORBS[9].drawSprite(199, 100);
  12873. }
  12874. int Y = 117;
  12875. if(is480){
  12876. Y = 120;
  12877. }
  12878. smallText.method382(getOrbTextColor(energy), 234, ""+energy, Y, true);
  12879. }
  12880.  
  12881. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  12882. )
  12883. {
  12884. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  12885. {
  12886. if(lowMem && j != plane)
  12887. return;
  12888. int i2 = 0;
  12889. if(j1 == 0)
  12890. i2 = worldController.method300(j, i1, i);
  12891. if(j1 == 1)
  12892. i2 = worldController.method301(j, i1, i);
  12893. if(j1 == 2)
  12894. i2 = worldController.method302(j, i1, i);
  12895. if(j1 == 3)
  12896. i2 = worldController.method303(j, i1, i);
  12897. if(i2 != 0)
  12898. {
  12899. int i3 = worldController.method304(j, i1, i, i2);
  12900. int j2 = i2 >> 14 & 0x7fff;
  12901. int k2 = i3 & 0x1f;
  12902. int l2 = i3 >> 6;
  12903. if(j1 == 0)
  12904. {
  12905. worldController.method291(i1, j, i, (byte)-119);
  12906. ObjectDef class46 = ObjectDef.forID(j2);
  12907. if(class46.aBoolean767)
  12908. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  12909. }
  12910. if(j1 == 1)
  12911. worldController.method292(i, j, i1);
  12912. if(j1 == 2)
  12913. {
  12914. worldController.method293(j, i1, i);
  12915. ObjectDef class46_1 = ObjectDef.forID(j2);
  12916. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  12917. return;
  12918. if(class46_1.aBoolean767)
  12919. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  12920. }
  12921. if(j1 == 3)
  12922. {
  12923. worldController.method294(j, i, i1);
  12924. ObjectDef class46_2 = ObjectDef.forID(j2);
  12925. if(class46_2.aBoolean767 && class46_2.hasActions)
  12926. aClass11Array1230[j].method218(i, i1);
  12927. }
  12928. }
  12929. if(k1 >= 0)
  12930. {
  12931. int j3 = j;
  12932. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  12933. j3++;
  12934. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  12935. }
  12936. }
  12937. }
  12938.  
  12939. private void updatePlayers(int i, Stream stream)
  12940. {
  12941. anInt839 = 0;
  12942. anInt893 = 0;
  12943. method117(stream);
  12944. method134(stream);
  12945. method91(stream, i);
  12946. method49(stream);
  12947. for(int k = 0; k < anInt839; k++)
  12948. {
  12949. int l = anIntArray840[k];
  12950. if(playerArray[l].anInt1537 != loopCycle)
  12951. playerArray[l] = null;
  12952. }
  12953.  
  12954. if(stream.currentOffset != i)
  12955. {
  12956. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  12957. throw new RuntimeException("eek");
  12958. }
  12959. for(int i1 = 0; i1 < playerCount; i1++)
  12960. if(playerArray[playerIndices[i1]] == null)
  12961. {
  12962. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  12963. throw new RuntimeException("eek");
  12964. }
  12965.  
  12966. }
  12967.  
  12968. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  12969. {
  12970. int l1 = 2048 - k & 0x7ff;
  12971. int i2 = 2048 - j1 & 0x7ff;
  12972. int j2 = 0;
  12973. int k2 = 0;
  12974. int l2 = j;
  12975. if(l1 != 0)
  12976. {
  12977. int i3 = Model.modelIntArray1[l1];
  12978. int k3 = Model.modelIntArray2[l1];
  12979. int i4 = k2 * k3 - l2 * i3 >> 16;
  12980. l2 = k2 * i3 + l2 * k3 >> 16;
  12981. k2 = i4;
  12982. }
  12983. if(i2 != 0)
  12984. {
  12985. /* xxx if(cameratoggle){
  12986. if(zoom == 0)
  12987. zoom = k2;
  12988. if(lftrit == 0)
  12989. lftrit = j2;
  12990. if(fwdbwd == 0)
  12991. fwdbwd = l2;
  12992. k2 = zoom;
  12993. j2 = lftrit;
  12994. l2 = fwdbwd;
  12995. }
  12996. */
  12997. int j3 = Model.modelIntArray1[i2];
  12998. int l3 = Model.modelIntArray2[i2];
  12999. int j4 = l2 * j3 + j2 * l3 >> 16;
  13000. l2 = l2 * l3 - j2 * j3 >> 16;
  13001. j2 = j4;
  13002. }
  13003. xCameraPos = l - j2;
  13004. zCameraPos = i1 - k2;
  13005. yCameraPos = k1 - l2;
  13006. yCameraCurve = k;
  13007. xCameraCurve = j1;
  13008. }
  13009.  
  13010. public void updateStrings(String str, int i) {
  13011. switch(i) {
  13012. case 1675: sendFrame126(str, 17508); break;//Stab
  13013. case 1676: sendFrame126(str, 17509); break;//Slash
  13014. case 1677: sendFrame126(str, 17510); break;//Cursh
  13015. case 1678: sendFrame126(str, 17511); break;//Magic
  13016. case 1679: sendFrame126(str, 17512); break;//Range
  13017. case 1680: sendFrame126(str, 17513); break;//Stab
  13018. case 1681: sendFrame126(str, 17514); break;//Slash
  13019. case 1682: sendFrame126(str, 17515); break;//Crush
  13020. case 1683: sendFrame126(str, 17516); break;//Magic
  13021. case 1684: sendFrame126(str, 17517); break;//Range
  13022. case 1686: sendFrame126(str, 17518); break;//Strength
  13023. case 1687: sendFrame126(str, 17519); break;//Prayer
  13024. }
  13025. }
  13026.  
  13027. public void sendFrame126(String str,int i) {
  13028. RSInterface.interfaceCache[i].disabledMessage = str;
  13029. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  13030. needDrawTabArea = true;
  13031. }
  13032.  
  13033. public void sendPacket185(int button,int toggle,int interfaceType) {
  13034. switch(interfaceType) {
  13035. case 135:
  13036. RSInterface class9 = RSInterface.interfaceCache[button];
  13037. boolean flag8 = true;
  13038. if(class9.contentType > 0)
  13039. flag8 = promptUserForInput(class9);
  13040. if(flag8) {
  13041. stream.createFrame(185);
  13042. stream.writeWord(button);
  13043. }
  13044. break;
  13045. case 646:
  13046. stream.createFrame(185);
  13047. stream.writeWord(button);
  13048. RSInterface class9_2 = RSInterface.interfaceCache[button];
  13049. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  13050. if(variousSettings[toggle] != class9_2.requiredValues[0]) {
  13051. variousSettings[toggle] = class9_2.requiredValues[0];
  13052. method33(toggle);
  13053. needDrawTabArea = true;
  13054. }
  13055. }
  13056. break;
  13057. case 169:
  13058. stream.createFrame(185);
  13059. stream.writeWord(button);
  13060. RSInterface class9_3 = RSInterface.interfaceCache[button];
  13061. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  13062. variousSettings[toggle] = 1 - variousSettings[toggle];
  13063. method33(toggle);
  13064. needDrawTabArea = true;
  13065. }
  13066. switch(button) {
  13067. case 19136:
  13068. System.out.println("toggle = "+toggle);
  13069. if(toggle == 0)
  13070. sendFrame36(173,toggle);
  13071. if(toggle == 1)
  13072. sendPacket185(153,173,646);
  13073. break;
  13074. }
  13075. break;
  13076. }
  13077. }
  13078.  
  13079. public void sendFrame36(int id,int state) {
  13080. anIntArray1045[id] = state;
  13081. if(variousSettings[id] != state) {
  13082. variousSettings[id] = state;
  13083. method33(id);
  13084. needDrawTabArea = true;
  13085. if(dialogID != -1)
  13086. inputTaken = true;
  13087. }
  13088. }
  13089.  
  13090. void sendPacket(int packet) {
  13091. if (packet == 103) {
  13092. stream.createFrame(103);
  13093. stream.writeWordBigEndian(inputString.length() - 1);
  13094. stream.writeString(inputString.substring(2));
  13095. inputString = "";
  13096. promptInput = "";
  13097. interfaceButtonAction = 0;
  13098. }
  13099. }
  13100.  
  13101. public void sendFrame219() {
  13102.  
  13103.  
  13104. if(invOverlayInterfaceID != -1) {
  13105. invOverlayInterfaceID = -1;
  13106. needDrawTabArea = true;
  13107. tabAreaAltered = true;
  13108. }
  13109. if(backDialogID != -1) {
  13110. backDialogID = -1;
  13111. inputTaken = true;
  13112. }
  13113. if(inputDialogState != 0) {
  13114. inputDialogState = 0;
  13115. inputTaken = true;
  13116. }
  13117. openInterfaceID = -1;
  13118. aBoolean1149 = false;
  13119. }
  13120.  
  13121. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  13122. if(backDialogID != -1) {
  13123. backDialogID = -1;
  13124. inputTaken = true;
  13125. }
  13126. if(inputDialogState != 0) {
  13127. inputDialogState = 0;
  13128. inputTaken = true;
  13129. }
  13130. openInterfaceID = interfaceID;
  13131. invOverlayInterfaceID = sideInterfaceID;
  13132. needDrawTabArea = true;
  13133. tabAreaAltered = true;
  13134. aBoolean1149 = false;
  13135. }
  13136.  
  13137. private boolean parsePacket() {
  13138.  
  13139.  
  13140. if(socketStream == null)
  13141. return false;
  13142. try {
  13143. int i = socketStream.available();
  13144. if(i == 0)
  13145. return false;
  13146. if(pktType == -1) {
  13147. socketStream.flushInputStream(inStream.buffer, 1);
  13148. pktType = inStream.buffer[0] & 0xff;
  13149. if(encryption != null)
  13150. pktType = pktType - encryption.getNextKey() & 0xff;
  13151. pktSize = SizeConstants.packetSizes[pktType];
  13152. i--;
  13153. }
  13154. if(pktSize == -1)
  13155. if(i > 0) {
  13156. socketStream.flushInputStream(inStream.buffer, 1);
  13157. pktSize = inStream.buffer[0] & 0xff;
  13158. i--;
  13159. } else {
  13160. return false;
  13161. }
  13162. if(pktSize == -2)
  13163. if(i > 1) {
  13164. socketStream.flushInputStream(inStream.buffer, 2);
  13165. inStream.currentOffset = 0;
  13166. pktSize = inStream.readUnsignedWord();
  13167. i -= 2;
  13168. } else {
  13169. return false;
  13170. }
  13171. if(i < pktSize)
  13172. return false;
  13173. inStream.currentOffset = 0;
  13174. socketStream.flushInputStream(inStream.buffer, pktSize);
  13175. anInt1009 = 0;
  13176. anInt843 = anInt842;
  13177. anInt842 = anInt841;
  13178. anInt841 = pktType;
  13179. switch(pktType) {
  13180. case 81:
  13181. updatePlayers(pktSize, inStream);
  13182. aBoolean1080 = false;
  13183. pktType = -1;
  13184. return true;
  13185.  
  13186. case 176:
  13187. daysSinceRecovChange = inStream.method427();
  13188. unreadMessages = inStream.method435();
  13189. membersInt = inStream.readUnsignedByte();
  13190. anInt1193 = inStream.method440();
  13191. daysSinceLastLogin = inStream.readUnsignedWord();
  13192. if(anInt1193 != 0 && openInterfaceID == -1) {
  13193. signlink.dnslookup(TextClass.method586(anInt1193));
  13194. clearTopInterfaces();
  13195. char c = '\u028A';
  13196. if(daysSinceRecovChange != 201 || membersInt == 1)
  13197. c = '\u028F';
  13198. reportAbuseInput = "";
  13199. canMute = false;
  13200. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13201. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  13202. continue;
  13203. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13204.  
  13205. }
  13206. }
  13207. pktType = -1;
  13208. return true;
  13209.  
  13210. case 64:
  13211. anInt1268 = inStream.method427();
  13212. anInt1269 = inStream.method428();
  13213. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  13214. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  13215. if(groundArray[plane][j][l9] != null) {
  13216. groundArray[plane][j][l9] = null;
  13217. spawnGroundItem(j, l9);
  13218. }
  13219. }
  13220. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  13221. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  13222. class30_sub1.anInt1294 = 0;
  13223. pktType = -1;
  13224. return true;
  13225.  
  13226. case 185:
  13227. int k = inStream.method436();
  13228. RSInterface.interfaceCache[k].disabledMediaType = 3;
  13229. if(myPlayer.desc == null)
  13230. 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];
  13231. else
  13232. RSInterface.interfaceCache[k].disabledMediaID = (int)(0x12345678L + myPlayer.desc.interfaceType);
  13233. pktType = -1;
  13234. return true;
  13235.  
  13236. /* Clan chat packet */
  13237. case 217:
  13238. try {
  13239. name = inStream.readString();
  13240. disabledMessage = inStream.readString();
  13241. clanname = inStream.readString();
  13242. rights = inStream.readUnsignedWord();
  13243. //disabledMessage = TextInput.processText(disabledMessage);
  13244. //disabledMessage = Censor.doCensor(disabledMessage);
  13245. System.out.println(clanname);
  13246. pushMessage(disabledMessage, 16, name);
  13247. } catch(Exception e) {
  13248. e.printStackTrace();
  13249. }
  13250. pktType = -1;
  13251. return true;
  13252.  
  13253. case 107:
  13254. aBoolean1160 = false;
  13255. for(int l = 0; l < 5; l++)
  13256. aBooleanArray876[l] = false;
  13257. pktType = -1;
  13258. return true;
  13259.  
  13260. case 72:
  13261. int i1 = inStream.method434();
  13262. RSInterface class9 = RSInterface.interfaceCache[i1];
  13263. for(int k15 = 0; k15 < class9.inventory.length; k15++) {
  13264. class9.inventory[k15] = -1;
  13265. class9.inventory[k15] = 0;
  13266. }
  13267. pktType = -1;
  13268. return true;
  13269.  
  13270. case 214:
  13271. ignoreCount = pktSize / 8;
  13272. for(int j1 = 0; j1 < ignoreCount; j1++)
  13273. ignoreListAsLongs[j1] = inStream.readQWord();
  13274. pktType = -1;
  13275. return true;
  13276.  
  13277. case 166:
  13278. aBoolean1160 = true;
  13279. anInt1098 = inStream.readUnsignedByte();
  13280. anInt1099 = inStream.readUnsignedByte();
  13281. anInt1100 = inStream.readUnsignedWord();
  13282. anInt1101 = inStream.readUnsignedByte();
  13283. anInt1102 = inStream.readUnsignedByte();
  13284. if(anInt1102 >= 100) {
  13285. xCameraPos = anInt1098 * 128 + 64;
  13286. yCameraPos = anInt1099 * 128 + 64;
  13287. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  13288. }
  13289. pktType = -1;
  13290. return true;
  13291.  
  13292. case 134:
  13293. needDrawTabArea = true;
  13294. int k1 = inStream.readUnsignedByte();
  13295. int i10 = inStream.method439();
  13296. int l15 = inStream.readUnsignedByte();
  13297. int oldXp = currentExp[k1];
  13298. if(drawXpBar) {
  13299. drawFlag = true;
  13300. }
  13301. currentExp[k1] = i10;
  13302. currentStats[k1] = l15;
  13303. maxStats[k1] = 1;
  13304. testXp += i10-oldXp;
  13305. xpToDraw += i10-oldXp;
  13306. if(testXp == currentExp[k1]) {
  13307. testXp = 0;
  13308. xpToDraw = 0;
  13309. }
  13310. for(int k20 = 0; k20 < 98; k20++)
  13311. if(i10 >= anIntArray1019[k20])
  13312. maxStats[k1] = k20 + 2;
  13313. pktType = -1;
  13314. return true;
  13315.  
  13316. case 71:
  13317. int l1 = inStream.readUnsignedWord();
  13318. int j10 = inStream.method426();
  13319. if(l1 == 65535)
  13320. l1 = -1;
  13321. tabInterfaceIDs[j10] = l1;
  13322. needDrawTabArea = true;
  13323. tabAreaAltered = true;
  13324. pktType = -1;
  13325. return true;
  13326.  
  13327. case 74:
  13328. int i2 = inStream.method434();
  13329. if(i2 == 65535)
  13330. i2 = -1;
  13331. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  13332. nextSong = i2;
  13333. songChanging = true;
  13334. onDemandFetcher.method558(2, nextSong);
  13335. }
  13336. currentSong = i2;
  13337. pktType = -1;
  13338. return true;
  13339.  
  13340. case 121:
  13341. int j2 = inStream.method436();
  13342. int k10 = inStream.method435();
  13343. if(musicEnabled && !lowMem) {
  13344. nextSong = j2;
  13345. songChanging = false;
  13346. onDemandFetcher.method558(2, nextSong);
  13347. prevSong = k10;
  13348. }
  13349. pktType = -1;
  13350. return true;
  13351.  
  13352. case 109:
  13353. resetLogout();
  13354. pktType = -1;
  13355. return false;
  13356.  
  13357. case 70:
  13358. int k2 = inStream.readSignedWord();
  13359. int l10 = inStream.method437();
  13360. int i16 = inStream.method434();
  13361. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  13362. class9_5.xOffset = k2;
  13363. class9_5.yOffset = l10;
  13364. pktType = -1;
  13365. return true;
  13366.  
  13367. case 73:
  13368. case 241:
  13369. int l2 = anInt1069;
  13370. int i11 = anInt1070;
  13371. if(pktType == 73) {
  13372. l2 = inStream.method435();
  13373. i11 = inStream.readUnsignedWord();
  13374. aBoolean1159 = false;
  13375. }
  13376. if(pktType == 241) {
  13377. i11 = inStream.method435();
  13378. inStream.initBitAccess();
  13379. for(int j16 = 0; j16 < 4; j16++) {
  13380. for(int l20 = 0; l20 < 13; l20++) {
  13381. for(int j23 = 0; j23 < 13; j23++) {
  13382. int i26 = inStream.readBits(1);
  13383. if(i26 == 1)
  13384. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  13385. else
  13386. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  13387. }
  13388. }
  13389. }
  13390. inStream.finishBitAccess();
  13391. l2 = inStream.readUnsignedWord();
  13392. aBoolean1159 = true;
  13393. }
  13394. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2)
  13395. {
  13396. pktType = -1;
  13397. return true;
  13398. }
  13399. anInt1069 = l2;
  13400. anInt1070 = i11;
  13401. baseX = (anInt1069 - 6) * 8;
  13402. baseY = (anInt1070 - 6) * 8;
  13403. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  13404. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  13405. aBoolean1141 = true;
  13406. loadingStage = 1;
  13407. aLong824 = System.currentTimeMillis();
  13408. inGameScreen.initDrawingArea();
  13409. loadingPleaseWait.drawSprite(8,9);;
  13410. inGameScreen.drawGraphics(4, super.graphics, 4);
  13411. if(pktType == 73) {
  13412. int k16 = 0;
  13413. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  13414. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  13415. k16++;
  13416. }
  13417. aByteArrayArray1183 = new byte[k16][];
  13418. aByteArrayArray1247 = new byte[k16][];
  13419. anIntArray1234 = new int[k16];
  13420. anIntArray1235 = new int[k16];
  13421. anIntArray1236 = new int[k16];
  13422. k16 = 0;
  13423. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  13424. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  13425. anIntArray1234[k16] = (l23 << 8) + j26;
  13426. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  13427. anIntArray1235[k16] = -1;
  13428. anIntArray1236[k16] = -1;
  13429. k16++;
  13430. } else {
  13431. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  13432. if(k28 != -1)
  13433. onDemandFetcher.method558(3, k28);
  13434. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  13435. if(j30 != -1)
  13436. onDemandFetcher.method558(3, j30);
  13437. k16++;
  13438. }
  13439. }
  13440. }
  13441. }
  13442. if(pktType == 241) {
  13443. int l16 = 0;
  13444. int ai[] = new int[676];
  13445. for(int i24 = 0; i24 < 4; i24++) {
  13446. for(int k26 = 0; k26 < 13; k26++) {
  13447. for(int l28 = 0; l28 < 13; l28++) {
  13448. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  13449. if(k30 != -1) {
  13450. int k31 = k30 >> 14 & 0x3ff;
  13451. int i32 = k30 >> 3 & 0x7ff;
  13452. int k32 = (k31 / 8 << 8) + i32 / 8;
  13453. for(int j33 = 0; j33 < l16; j33++) {
  13454. if(ai[j33] != k32)
  13455. continue;
  13456. k32 = -1;
  13457.  
  13458. }
  13459. if(k32 != -1)
  13460. ai[l16++] = k32;
  13461. }
  13462. }
  13463. }
  13464. }
  13465. aByteArrayArray1183 = new byte[l16][];
  13466. aByteArrayArray1247 = new byte[l16][];
  13467. anIntArray1234 = new int[l16];
  13468. anIntArray1235 = new int[l16];
  13469. anIntArray1236 = new int[l16];
  13470. for(int l26 = 0; l26 < l16; l26++) {
  13471. int i29 = anIntArray1234[l26] = ai[l26];
  13472. int l30 = i29 >> 8 & 0xff;
  13473. int l31 = i29 & 0xff;
  13474. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  13475. if(j32 != -1)
  13476. onDemandFetcher.method558(3, j32);
  13477. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  13478. if(i33 != -1)
  13479. onDemandFetcher.method558(3, i33);
  13480. }
  13481. }
  13482. int i17 = baseX - anInt1036;
  13483. int j21 = baseY - anInt1037;
  13484. anInt1036 = baseX;
  13485. anInt1037 = baseY;
  13486. for(int j24 = 0; j24 < 16384; j24++) {
  13487. NPC npc = npcArray[j24];
  13488. if(npc != null) {
  13489. for(int j29 = 0; j29 < 10; j29++) {
  13490. npc.smallX[j29] -= i17;
  13491. npc.smallY[j29] -= j21;
  13492. }
  13493. npc.x -= i17 * 128;
  13494. npc.y -= j21 * 128;
  13495. }
  13496. }
  13497. for(int i27 = 0; i27 < maxPlayers; i27++) {
  13498. Player player = playerArray[i27];
  13499. if(player != null) {
  13500. for(int i31 = 0; i31 < 10; i31++) {
  13501. player.smallX[i31] -= i17;
  13502. player.smallY[i31] -= j21;
  13503. }
  13504. player.x -= i17 * 128;
  13505. player.y -= j21 * 128;
  13506. }
  13507. }
  13508. aBoolean1080 = true;
  13509. byte byte1 = 0;
  13510. byte byte2 = 104;
  13511. byte byte3 = 1;
  13512. if(i17 < 0) {
  13513. byte1 = 103;
  13514. byte2 = -1;
  13515. byte3 = -1;
  13516. }
  13517. byte byte4 = 0;
  13518. byte byte5 = 104;
  13519. byte byte6 = 1;
  13520. if(j21 < 0) {
  13521. byte4 = 103;
  13522. byte5 = -1;
  13523. byte6 = -1;
  13524. }
  13525. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  13526. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  13527. int i34 = k33 + i17;
  13528. int j34 = l33 + j21;
  13529. for(int k34 = 0; k34 < 4; k34++)
  13530. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  13531. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  13532. else
  13533. groundArray[k34][k33][l33] = null;
  13534. }
  13535. }
  13536. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  13537. class30_sub1_1.anInt1297 -= i17;
  13538. class30_sub1_1.anInt1298 -= j21;
  13539. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  13540. class30_sub1_1.unlink();
  13541. }
  13542. if(destX != 0) {
  13543. destX -= i17;
  13544. destY -= j21;
  13545. }
  13546. aBoolean1160 = false;
  13547. pktType = -1;
  13548. return true;
  13549.  
  13550. case 208:
  13551. int i3 = inStream.method437();
  13552. if(i3 >= 0)
  13553. method60(i3);
  13554. anInt1018 = i3;
  13555. pktType = -1;
  13556. return true;
  13557.  
  13558. case 99:
  13559. /*
  13560. * Black map, mape state 2, causes blackness
  13561. */
  13562. anInt1021 = inStream.readUnsignedByte();
  13563. pktType = -1;
  13564. return true;
  13565.  
  13566. case 75:
  13567. int j3 = inStream.method436();
  13568. int j11 = inStream.method436();
  13569. RSInterface.interfaceCache[j11].disabledMediaType = 2;
  13570. RSInterface.interfaceCache[j11].disabledMediaID = j3;
  13571. pktType = -1;
  13572. return true;
  13573.  
  13574. case 114:
  13575. anInt1104 = inStream.method434() * 30;
  13576. pktType = -1;
  13577. return true;
  13578.  
  13579. case 60:
  13580. anInt1269 = inStream.readUnsignedByte();
  13581. anInt1268 = inStream.method427();
  13582. while(inStream.currentOffset < pktSize) {
  13583. int k3 = inStream.readUnsignedByte();
  13584. method137(inStream, k3);
  13585. }
  13586. pktType = -1;
  13587. return true;
  13588.  
  13589. case 35:
  13590. int l3 = inStream.readUnsignedByte();
  13591. int k11 = inStream.readUnsignedByte();
  13592. int j17 = inStream.readUnsignedByte();
  13593. int k21 = inStream.readUnsignedByte();
  13594. aBooleanArray876[l3] = true;
  13595. anIntArray873[l3] = k11;
  13596. anIntArray1203[l3] = j17;
  13597. anIntArray928[l3] = k21;
  13598. anIntArray1030[l3] = 0;
  13599. pktType = -1;
  13600. return true;
  13601.  
  13602. case 174:
  13603. int i4 = inStream.readUnsignedWord();
  13604. int l11 = inStream.readUnsignedByte();
  13605. int k17 = inStream.readUnsignedWord();
  13606. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  13607. anIntArray1207[anInt1062] = i4;
  13608. anIntArray1241[anInt1062] = l11;
  13609. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  13610. anInt1062++;
  13611. }
  13612. pktType = -1;
  13613. return true;
  13614.  
  13615. case 104:
  13616. int j4 = inStream.method427();
  13617. int i12 = inStream.method426();
  13618. String s6 = inStream.readString();
  13619. if(j4 >= 1 && j4 <= 5) {
  13620. if(s6.equalsIgnoreCase("null"))
  13621. s6 = null;
  13622. atPlayerActions[j4 - 1] = s6;
  13623. atPlayerArray[j4 - 1] = i12 == 0;
  13624. }
  13625. pktType = -1;
  13626. return true;
  13627.  
  13628. case 78:
  13629. destX = 0;
  13630. pktType = -1;
  13631. return true;
  13632.  
  13633. case 253:
  13634. String s = inStream.readString();
  13635. if(s.startsWith("Alert##")) {
  13636. String[] args = s.split("##");
  13637. if (args.length == 3) {
  13638. alertHandler.alert = new Alert("Notification", args[1], args[2]);
  13639. } else if (args.length == 4) {
  13640. alertHandler.alert = new Alert(args[1], args[2], args[3]);
  13641. }
  13642. pktType = -1;
  13643. return true;
  13644. }
  13645. if(s.endsWith(":tradereq:")) {
  13646. String s3 = s.substring(0, s.indexOf(":"));
  13647. long l17 = TextClass.longForName(s3);
  13648. boolean flag2 = false;
  13649. for(int j27 = 0; j27 < ignoreCount; j27++) {
  13650. if(ignoreListAsLongs[j27] != l17)
  13651. continue;
  13652. flag2 = true;
  13653. }
  13654. if(!flag2 && anInt1251 == 0)
  13655. pushMessage("wishes to trade with you.", 4, s3);
  13656. } else if (s.endsWith(":clan:")) {
  13657. String s4 = s.substring(0, s.indexOf(":"));
  13658. long l18 = TextClass.longForName(s4);
  13659. pushMessage("Clan: ", 8, s4);
  13660. } else if(s.endsWith("#url#")) {
  13661. String text = s.substring(0, s.indexOf("-"));
  13662. s = s.substring(text.length()+1).trim();
  13663. String link = s.substring(0, s.indexOf("#"));
  13664. pushMessage(text, 9, link);
  13665. } else if(s.endsWith(":resetautocast:")) {
  13666. Autocast = false;
  13667. autocastId = 0;
  13668. magicAuto.drawSprite(1000, 1000);
  13669. } else if(s.endsWith(":duelreq:")) {
  13670. String s4 = s.substring(0, s.indexOf(":"));
  13671. long l18 = TextClass.longForName(s4);
  13672. boolean flag3 = false;
  13673. for(int k27 = 0; k27 < ignoreCount; k27++) {
  13674. if(ignoreListAsLongs[k27] != l18)
  13675. continue;
  13676. flag3 = true;
  13677.  
  13678. }
  13679. if(!flag3 && anInt1251 == 0)
  13680. pushMessage("wishes to duel with you.", 8, s4);
  13681. } else if(s.endsWith(":chalreq:")) {
  13682. String s5 = s.substring(0, s.indexOf(":"));
  13683. long l19 = TextClass.longForName(s5);
  13684. boolean flag4 = false;
  13685. for(int l27 = 0; l27 < ignoreCount; l27++) {
  13686. if(ignoreListAsLongs[l27] != l19)
  13687. continue;
  13688. flag4 = true;
  13689.  
  13690. }
  13691. if(!flag4 && anInt1251 == 0) {
  13692. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  13693. pushMessage(s8, 8, s5);
  13694. }
  13695. } else {
  13696. pushMessage(s, 0, "");
  13697. }
  13698. pktType = -1;
  13699. return true;
  13700.  
  13701. case 1:
  13702. for(int k4 = 0; k4 < playerArray.length; k4++)
  13703. if(playerArray[k4] != null)
  13704. playerArray[k4].anim = -1;
  13705. for(int j12 = 0; j12 < npcArray.length; j12++)
  13706. if(npcArray[j12] != null)
  13707. npcArray[j12].anim = -1;
  13708. pktType = -1;
  13709. return true;
  13710.  
  13711. case 50:
  13712. long l4 = inStream.readQWord();
  13713. int i18 = inStream.readUnsignedByte();
  13714. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  13715. for(int k24 = 0; k24 < friendsCount; k24++) {
  13716. if(l4 != friendsListAsLongs[k24])
  13717. continue;
  13718. if(friendsNodeIDs[k24] != i18) {
  13719. friendsNodeIDs[k24] = i18;
  13720. needDrawTabArea = true;
  13721. if(i18 >= 2) {
  13722. pushMessage(s7 + " has logged in.", 5, "");
  13723. }
  13724. if(i18 <= 1) {
  13725. pushMessage(s7 + " has logged out.", 5, "");
  13726. }
  13727. }
  13728. s7 = null;
  13729.  
  13730. }
  13731. if(s7 != null && friendsCount < 200) {
  13732. friendsListAsLongs[friendsCount] = l4;
  13733. friendsList[friendsCount] = s7;
  13734. friendsNodeIDs[friendsCount] = i18;
  13735. friendsCount++;
  13736. needDrawTabArea = true;
  13737. }
  13738. for(boolean flag6 = false; !flag6;) {
  13739. flag6 = true;
  13740. for(int index = 0; index < friendsCount - 1; index++)
  13741. if(friendsNodeIDs[index] != nodeID && friendsNodeIDs[index + 1] == nodeID || friendsNodeIDs[index] == 0 && friendsNodeIDs[index + 1] != 0) {
  13742. int j31 = friendsNodeIDs[index];
  13743. friendsNodeIDs[index] = friendsNodeIDs[index + 1];
  13744. friendsNodeIDs[index + 1] = j31;
  13745. String s10 = friendsList[index];
  13746. friendsList[index] = friendsList[index + 1];
  13747. friendsList[index + 1] = s10;
  13748. long l32 = friendsListAsLongs[index];
  13749. friendsListAsLongs[index] = friendsListAsLongs[index + 1];
  13750. friendsListAsLongs[index + 1] = l32;
  13751. needDrawTabArea = true;
  13752. flag6 = false;
  13753. }
  13754. }//friends list sorting
  13755. pktType = -1;
  13756. return true;
  13757.  
  13758. case 110:
  13759. if(tabID == 12)
  13760. needDrawTabArea = true;
  13761. energy = inStream.readUnsignedByte();
  13762. pktType = -1;
  13763. return true;
  13764.  
  13765. case 254:
  13766. anInt855 = inStream.readUnsignedByte();
  13767. if(anInt855 == 1)
  13768. anInt1222 = inStream.readUnsignedWord();
  13769. if(anInt855 >= 2 && anInt855 <= 6) {
  13770. if(anInt855 == 2) {
  13771. anInt937 = 64;
  13772. anInt938 = 64;
  13773. }
  13774. if(anInt855 == 3) {
  13775. anInt937 = 0;
  13776. anInt938 = 64;
  13777. }
  13778. if(anInt855 == 4) {
  13779. anInt937 = 128;
  13780. anInt938 = 64;
  13781. }
  13782. if(anInt855 == 5) {
  13783. anInt937 = 64;
  13784. anInt938 = 0;
  13785. }
  13786. if(anInt855 == 6) {
  13787. anInt937 = 64;
  13788. anInt938 = 128;
  13789. }
  13790. anInt855 = 2;
  13791. anInt934 = inStream.readUnsignedWord();
  13792. anInt935 = inStream.readUnsignedWord();
  13793. anInt936 = inStream.readUnsignedByte();
  13794. }
  13795. if(anInt855 == 10)
  13796. anInt933 = inStream.readUnsignedWord();
  13797. pktType = -1;
  13798. return true;
  13799.  
  13800. case 248:
  13801. int i5 = inStream.method435();
  13802. int k12 = inStream.readUnsignedWord();
  13803. if(backDialogID != -1) {
  13804. backDialogID = -1;
  13805. inputTaken = true;
  13806. }
  13807. if(inputDialogState != 0) {
  13808. inputDialogState = 0;
  13809. inputTaken = true;
  13810. }
  13811. openInterfaceID = i5;
  13812. invOverlayInterfaceID = k12;
  13813. needDrawTabArea = true;
  13814. tabAreaAltered = true;
  13815. aBoolean1149 = false;
  13816. pktType = -1;
  13817. return true;
  13818.  
  13819. case 79:
  13820. int j5 = inStream.method434();
  13821. int l12 = inStream.method435();
  13822. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  13823. if(class9_3 != null && class9_3.interfaceType == 0) {
  13824. if(l12 < 0)
  13825. l12 = 0;
  13826. if(l12 > class9_3.scrollMax - class9_3.height)
  13827. l12 = class9_3.scrollMax - class9_3.height;
  13828. class9_3.scrollPosition = l12;
  13829. }
  13830. pktType = -1;
  13831. return true;
  13832.  
  13833. case 68:
  13834. for(int k5 = 0; k5 < variousSettings.length; k5++)
  13835. if(variousSettings[k5] != anIntArray1045[k5]) {
  13836. variousSettings[k5] = anIntArray1045[k5];
  13837. method33(k5);
  13838. needDrawTabArea = true;
  13839. }
  13840. pktType = -1;
  13841. return true;
  13842.  
  13843. case 196:
  13844. long l5 = inStream.readQWord();
  13845. int j18 = inStream.readDWord();
  13846. int l21 = inStream.readUnsignedByte();
  13847. boolean flag5 = false;
  13848. for(int i28 = 0; i28 < 100; i28++) {
  13849. if(anIntArray1240[i28] != j18)
  13850. continue;
  13851. flag5 = true;
  13852.  
  13853. }
  13854. if(l21 <= 1) {
  13855. for(int l29 = 0; l29 < ignoreCount; l29++) {
  13856. if(ignoreListAsLongs[l29] != l5)
  13857. continue;
  13858. flag5 = true;
  13859.  
  13860. }
  13861. }
  13862. if(!flag5 && anInt1251 == 0)
  13863. try {
  13864. anIntArray1240[anInt1169] = j18;
  13865. anInt1169 = (anInt1169 + 1) % 100;
  13866. String s9 = TextInput.method525(pktSize - 13, inStream);
  13867. //if(l21 != 3)
  13868. //s9 = Censor.doCensor(s9);
  13869. if(l21 == 4) {
  13870. pushMessage(s9, 7, "@cr3@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13871. } else if(l21 == 3) {
  13872. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13873. } else if(l21 == 2) {
  13874. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13875. } else if(l21 == 1) {
  13876. pushMessage(s9, 7, "@cr0@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13877. } else {
  13878. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  13879. }
  13880. } catch(Exception exception1) {
  13881. signlink.reporterror("cde1");
  13882. }
  13883. pktType = -1;
  13884. return true;
  13885.  
  13886. case 85:
  13887. anInt1269 = inStream.method427();
  13888. anInt1268 = inStream.method427();
  13889. pktType = -1;
  13890. return true;
  13891.  
  13892. case 24:
  13893. anInt1054 = inStream.method428();
  13894. if(anInt1054 == tabID) {
  13895. if(anInt1054 == 3)
  13896. tabID = 1;
  13897. else
  13898. tabID = 3;
  13899. needDrawTabArea = true;
  13900. }
  13901. pktType = -1;
  13902. return true;
  13903.  
  13904. case 246:
  13905. int i6 = inStream.method434();
  13906. int i13 = inStream.readUnsignedWord();
  13907. int k18 = inStream.readUnsignedWord();
  13908. if(k18 == 65535) {
  13909. RSInterface.interfaceCache[i6].disabledMediaType = 0;
  13910. pktType = -1;
  13911. return true;
  13912. } else {
  13913. ItemDef itemDef = ItemDef.forID(k18);
  13914. RSInterface.interfaceCache[i6].disabledMediaType = 4;
  13915. RSInterface.interfaceCache[i6].disabledMediaID = k18;
  13916. RSInterface.interfaceCache[i6].modelRotationY = itemDef.modelRotationY;
  13917. RSInterface.interfaceCache[i6].modelRotationX = itemDef.modelRotationX;
  13918. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  13919. pktType = -1;
  13920. return true;
  13921. }
  13922.  
  13923. case 171:
  13924. boolean flag1 = inStream.readUnsignedByte() == 1;
  13925. int j13 = inStream.readUnsignedWord();
  13926. RSInterface.interfaceCache[j13].interfaceShown = flag1;
  13927. pktType = -1;
  13928. return true;
  13929.  
  13930. case 142:
  13931. int j6 = inStream.method434();
  13932. method60(j6);
  13933. if(backDialogID != -1) {
  13934. backDialogID = -1;
  13935. inputTaken = true;
  13936. }
  13937. if(inputDialogState != 0) {
  13938. inputDialogState = 0;
  13939. inputTaken = true;
  13940. }
  13941. invOverlayInterfaceID = j6;
  13942. needDrawTabArea = true;
  13943. tabAreaAltered = true;
  13944. openInterfaceID = -1;
  13945. aBoolean1149 = false;
  13946. pktType = -1;
  13947. return true;
  13948.  
  13949. case 126:
  13950. String text = inStream.readString();
  13951. int frame = inStream.method435();
  13952. if (text.startsWith("www.")) {
  13953. launchURL(text);
  13954. pktType = -1;
  13955. return true;
  13956. }
  13957. updateStrings(text, frame);
  13958. sendFrame126(text, frame);
  13959. if (frame >= 18144 && frame <= 18244) {
  13960. clanList[frame - 18144] = text;
  13961. }
  13962. pktType = -1;
  13963. return true;
  13964.  
  13965. case 206:
  13966. publicChatMode = inStream.readUnsignedByte();
  13967. privateChatMode = inStream.readUnsignedByte();
  13968. tradeMode = inStream.readUnsignedByte();
  13969. aBoolean1233 = true;
  13970. inputTaken = true;
  13971. pktType = -1;
  13972. return true;
  13973.  
  13974. case 240:
  13975. if(tabID == 12)
  13976. needDrawTabArea = true;
  13977. weight = inStream.readSignedWord();
  13978. pktType = -1;
  13979. return true;
  13980.  
  13981. case 8:
  13982. int k6 = inStream.method436();
  13983. int l13 = inStream.readUnsignedWord();
  13984. RSInterface.interfaceCache[k6].disabledMediaType = 1;
  13985. RSInterface.interfaceCache[k6].disabledMediaID = l13;
  13986. pktType = -1;
  13987. return true;
  13988.  
  13989. case 122:
  13990. int l6 = inStream.method436();
  13991. int i14 = inStream.method436();
  13992. int i19 = i14 >> 10 & 0x1f;
  13993. int i22 = i14 >> 5 & 0x1f;
  13994. int l24 = i14 & 0x1f;
  13995. RSInterface.interfaceCache[l6].disabledColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  13996. pktType = -1;
  13997. return true;
  13998.  
  13999. case 53:
  14000. needDrawTabArea = true;
  14001. int i7 = inStream.readUnsignedWord();
  14002. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  14003. int j19 = inStream.readUnsignedWord();
  14004. for(int j22 = 0; j22 < j19; j22++) {
  14005. int i25 = inStream.readUnsignedByte();
  14006. if(i25 == 255)
  14007. i25 = inStream.method440();
  14008. class9_1.inventory[j22] = inStream.method436();
  14009. class9_1.inventoryValue[j22] = i25;
  14010. }
  14011. for(int j25 = j19; j25 < class9_1.inventory.length; j25++) {
  14012. class9_1.inventory[j25] = 0;
  14013. class9_1.inventoryValue[j25] = 0;
  14014. }
  14015. pktType = -1;
  14016. return true;
  14017.  
  14018. case 230:
  14019. int j7 = inStream.method435();
  14020. int j14 = inStream.readUnsignedWord();
  14021. int k19 = inStream.readUnsignedWord();
  14022. int k22 = inStream.method436();
  14023. RSInterface.interfaceCache[j14].modelRotationY = k19;
  14024. RSInterface.interfaceCache[j14].modelRotationX = k22;
  14025. RSInterface.interfaceCache[j14].modelZoom = j7;
  14026. pktType = -1;
  14027. return true;
  14028.  
  14029. case 221:
  14030. anInt900 = inStream.readUnsignedByte();
  14031. needDrawTabArea = true;
  14032. pktType = -1;
  14033. return true;
  14034.  
  14035. case 177:
  14036. aBoolean1160 = true;
  14037. anInt995 = inStream.readUnsignedByte();
  14038. anInt996 = inStream.readUnsignedByte();
  14039. anInt997 = inStream.readUnsignedWord();
  14040. anInt998 = inStream.readUnsignedByte();
  14041. anInt999 = inStream.readUnsignedByte();
  14042. if(anInt999 >= 100) {
  14043. int k7 = anInt995 * 128 + 64;
  14044. int k14 = anInt996 * 128 + 64;
  14045. int i20 = method42(plane, k14, k7) - anInt997;
  14046. int l22 = k7 - xCameraPos;
  14047. int k25 = i20 - zCameraPos;
  14048. int j28 = k14 - yCameraPos;
  14049. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  14050. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14051. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14052. if(yCameraCurve < 128)
  14053. yCameraCurve = 128;
  14054. if(yCameraCurve > 383)
  14055. yCameraCurve = 383;
  14056. }
  14057. pktType = -1;
  14058. return true;
  14059.  
  14060. case 249:
  14061. anInt1046 = inStream.method426();
  14062. unknownInt10 = inStream.method436();
  14063. pktType = -1;
  14064. return true;
  14065.  
  14066. case 65:
  14067. updateNPCs(inStream, pktSize);
  14068. pktType = -1;
  14069. return true;
  14070.  
  14071. case 27:
  14072. messagePromptRaised = false;
  14073. inputDialogState = 1;
  14074. amountOrNameInput = "";
  14075. inputTaken = true;
  14076. pktType = -1;
  14077. return true;
  14078.  
  14079. case 187:
  14080. messagePromptRaised = false;
  14081. inputDialogState = 2;
  14082. amountOrNameInput = "";
  14083. inputTaken = true;
  14084. pktType = -1;
  14085. return true;
  14086. case 97:
  14087. int l7 = inStream.readUnsignedWord();
  14088. method60(l7);
  14089. if (invOverlayInterfaceID != -1) {
  14090. invOverlayInterfaceID = -1;
  14091. needDrawTabArea = true;
  14092. tabAreaAltered = true;
  14093. }
  14094. if (backDialogID != -1) {
  14095. backDialogID = -1;
  14096. inputTaken = true;
  14097. }
  14098. if (inputDialogState != 0) {
  14099. inputDialogState = 0;
  14100. inputTaken = true;
  14101. }
  14102. //17511 = Question Type
  14103. //15819 = Christmas Type
  14104. //15812 = Security Type
  14105. //15801 = Item Scam Type
  14106. //15791 = Password Safety ?
  14107. //15774 = Good/Bad Password
  14108. //15767 = Drama Type ????
  14109. if (l7 == 15244) {
  14110. openInterfaceID = 15774;
  14111. fullscreenInterfaceID = 15244;
  14112. } else {
  14113. openInterfaceID = l7;
  14114. }
  14115. aBoolean1149 = false;
  14116. pktType = -1;
  14117. return true;
  14118. case 218:
  14119. int i8 = inStream.method438();
  14120. dialogID = i8;
  14121. inputTaken = true;
  14122. pktType = -1;
  14123. return true;
  14124.  
  14125. case 87:
  14126. int j8 = inStream.method434();
  14127. int l14 = inStream.method439();
  14128. anIntArray1045[j8] = l14;
  14129. if(variousSettings[j8] != l14) {
  14130. variousSettings[j8] = l14;
  14131. method33(j8);
  14132. needDrawTabArea = true;
  14133. if(dialogID != -1)
  14134. inputTaken = true;
  14135. }
  14136. pktType = -1;
  14137. return true;
  14138.  
  14139. case 36:
  14140. int k8 = inStream.method434();
  14141. byte byte0 = inStream.readSignedByte();
  14142. anIntArray1045[k8] = byte0;
  14143. if(variousSettings[k8] != byte0) {
  14144. variousSettings[k8] = byte0;
  14145. method33(k8);
  14146. needDrawTabArea = true;
  14147. if(dialogID != -1)
  14148. inputTaken = true;
  14149. }
  14150. pktType = -1;
  14151. return true;
  14152.  
  14153. case 61:
  14154. anInt1055 = inStream.readUnsignedByte();
  14155. pktType = -1;
  14156. return true;
  14157.  
  14158. case 200:
  14159. int l8 = inStream.readUnsignedWord();
  14160. int i15 = inStream.readSignedWord();
  14161. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14162. class9_4.disabledAnimation = i15;
  14163. if(i15 == 591 || i15 == 588)
  14164. {
  14165. class9_4.modelZoom = 1600;
  14166. }
  14167. if(i15 == -1) {
  14168. class9_4.animationLength = 0;
  14169. class9_4.animationDelay = 0;
  14170. }
  14171. pktType = -1;
  14172. return true;
  14173.  
  14174. case 219:
  14175. if(invOverlayInterfaceID != -1) {
  14176. invOverlayInterfaceID = -1;
  14177. needDrawTabArea = true;
  14178. tabAreaAltered = true;
  14179. }
  14180. if(backDialogID != -1) {
  14181. backDialogID = -1;
  14182. inputTaken = true;
  14183. }
  14184. if(inputDialogState != 0) {
  14185. inputDialogState = 0;
  14186. inputTaken = true;
  14187. }
  14188. openInterfaceID = -1;
  14189. aBoolean1149 = false;
  14190. pktType = -1;
  14191. return true;
  14192.  
  14193. case 34:
  14194. needDrawTabArea = true;
  14195. int i9 = inStream.readUnsignedWord();
  14196. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14197. while(inStream.currentOffset < pktSize) {
  14198. int j20 = inStream.method422();
  14199. int i23 = inStream.readUnsignedWord();
  14200. int l25 = inStream.readUnsignedByte();
  14201. if(l25 == 255)
  14202. l25 = inStream.readDWord();
  14203. if(j20 >= 0 && j20 < class9_2.inventory.length) {
  14204. class9_2.inventory[j20] = i23;
  14205. class9_2.inventoryValue[j20] = l25;
  14206. }
  14207. }
  14208. pktType = -1;
  14209. return true;
  14210.  
  14211. case 4:
  14212. case 44:
  14213. case 84:
  14214. case 101:
  14215. case 105:
  14216. case 117:
  14217. case 147:
  14218. case 151:
  14219. case 156:
  14220. case 160:
  14221. case 215:
  14222. method137(inStream, pktType);
  14223. pktType = -1;
  14224. return true;
  14225.  
  14226. case 106:
  14227. tabID = inStream.method427();
  14228. needDrawTabArea = true;
  14229. tabAreaAltered = true;
  14230. pktType = -1;
  14231. return true;
  14232.  
  14233. case 164:
  14234. int j9 = inStream.method434();
  14235. method60(j9);
  14236. if(invOverlayInterfaceID != -1) {
  14237. invOverlayInterfaceID = -1;
  14238. needDrawTabArea = true;
  14239. tabAreaAltered = true;
  14240. }
  14241. backDialogID = j9;
  14242. inputTaken = true;
  14243. openInterfaceID = -1;
  14244. aBoolean1149 = false;
  14245. pktType = -1;
  14246. return true;
  14247.  
  14248. }
  14249. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  14250. //resetLogout();
  14251. } catch(IOException _ex) {
  14252. dropClient();
  14253. } catch(Exception exception) {
  14254. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  14255. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  14256. s2 = s2 + inStream.buffer[j15] + ",";
  14257. signlink.reporterror(s2);
  14258. //resetLogout();
  14259. }
  14260. pktType = -1;
  14261. return true;
  14262. }
  14263.  
  14264. private void method146() {
  14265.  
  14266.  
  14267. anInt1265++;
  14268. method47(true);
  14269. method26(true);
  14270. method47(false);
  14271. method26(false);
  14272. method55();
  14273. method104();
  14274. if(!aBoolean1160) {
  14275. int i = anInt1184;
  14276. if(anInt984 / 256 > i)
  14277. i = anInt984 / 256;
  14278. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  14279. i = anIntArray1203[4] + 128;
  14280. int k = minimapInt1 + anInt896 & 0x7ff;
  14281. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  14282.  
  14283.  
  14284.  
  14285. }
  14286. int j;
  14287. if(!aBoolean1160)
  14288. j = method120();
  14289. else
  14290. j = method121();
  14291. int l = xCameraPos;
  14292. int i1 = zCameraPos;
  14293. int j1 = yCameraPos;
  14294. int k1 = yCameraCurve;
  14295. int l1 = xCameraCurve;
  14296. for(int i2 = 0; i2 < 5; i2++)
  14297. if(aBooleanArray876[i2]) {
  14298. 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]);
  14299. if(i2 == 0)
  14300. xCameraPos += j2;
  14301. if(i2 == 1)
  14302. zCameraPos += j2;
  14303. if(i2 == 2)
  14304. yCameraPos += j2;
  14305. if(i2 == 3)
  14306. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  14307. if(i2 == 4) {
  14308. yCameraCurve += j2;
  14309. if(yCameraCurve < 128)
  14310. yCameraCurve = 128;
  14311. if(yCameraCurve > 383)
  14312. yCameraCurve = 383;
  14313. }
  14314. }
  14315. int k2 = Texture.anInt1481;
  14316. Model.aBoolean1684 = true;
  14317. Model.anInt1687 = 0;
  14318. Model.anInt1685 = super.mouseX - 4;
  14319. Model.anInt1686 = super.mouseY - 4;
  14320. DrawingArea.setAllPixelsToZero();
  14321. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  14322. worldController.clearObj5Cache();
  14323. updateEntities();
  14324. drawHeadIcon();
  14325. method37(k2);
  14326. draw3dScreen();
  14327. drawCoinParts();
  14328. if(coinToggle){
  14329. int cash;
  14330. String Cash = RSInterface.interfaceCache[8135].disabledMessage;
  14331. cash = Integer.parseInt(Cash);
  14332. coinPart.drawSprite(400+11+32, 87);
  14333. smallText.method382(getMoneyOrbColor(cash), 485, RSInterface.interfaceCache[8134].disabledMessage+"", 102, true);
  14334. }
  14335. if(drawFlag) {
  14336. if(xpToDraw != 0) {
  14337. if(flagPos < 125) {
  14338. if(flagPos < 100) {
  14339. flagPos += 2;
  14340. } else {
  14341. flagPos += 1;
  14342. }
  14343. xpFlag.drawSprite(423, flagPos);
  14344. newSmallFont.drawBasicString(""+xpToDraw+"xp", 470, flagPos+20, 0xCC6600, 1);
  14345. } else { }
  14346. if(flagPos >= 125) {
  14347. drawFlag = false;
  14348. flagPos = 72;
  14349. xpToDraw = 0;
  14350. }
  14351. }
  14352. }
  14353. if(drawXpBar) {
  14354. String text = ""+testXp;
  14355. int txtWidth = newRegularFont.getTextWidth(text);
  14356. int drawX = 505-txtWidth;
  14357. sprite1.drawSprite(419, 51);
  14358. newRegularFont.drawBasicString("XP:", 421, 64, 0xFFFFFD, 0);
  14359. newRegularFont.drawBasicString(text, drawX, 64, 0xFFFFFD, 0);
  14360. }
  14361. inGameScreen.drawGraphics(4, super.graphics, 4);
  14362. xCameraPos = l;
  14363. zCameraPos = i1;
  14364. yCameraPos = j1;
  14365. yCameraCurve = k1;
  14366. xCameraCurve = l1;
  14367. }
  14368.  
  14369. /* Packets that opens interfaces */
  14370. public void sendFrame97(int interfaceID) {
  14371. method60(interfaceID);
  14372. if (invOverlayInterfaceID != -1) {
  14373. invOverlayInterfaceID = -1;
  14374. needDrawTabArea = true;
  14375. tabAreaAltered = true;
  14376. }
  14377. if (backDialogID != -1) {
  14378. backDialogID = -1;
  14379. inputTaken = true;
  14380. }
  14381. if (inputDialogState != 0) {
  14382. inputDialogState = 0;
  14383. inputTaken = true;
  14384. }
  14385. openInterfaceID = interfaceID;
  14386. aBoolean1149 = false;
  14387. }
  14388. public void clearTopInterfaces() {
  14389.  
  14390. stream.createFrame(130);
  14391. if (invOverlayInterfaceID != -1) {
  14392. invOverlayInterfaceID = -1;
  14393. needDrawTabArea = true;
  14394. aBoolean1149 = false;
  14395. tabAreaAltered = true;
  14396. }
  14397. if (backDialogID != -1) {
  14398. backDialogID = -1;
  14399. inputTaken = true;
  14400. aBoolean1149 = false;
  14401. }
  14402. openInterfaceID = -1;
  14403. fullscreenInterfaceID = -1;
  14404. }
  14405.  
  14406. public client() {
  14407. tabHPos = -1;
  14408. alertHandler = new AlertHandler(this);
  14409. fullscreenInterfaceID = -1;
  14410. chatRights = new int[500];
  14411. chatTypeView = 0;
  14412. LP = 0.0F;
  14413. clanChatMode = 0;
  14414. cButtonHPos = -1;
  14415. applyTrans = 0;
  14416. cButtonHCPos = -1;
  14417. cButtonCPos = 0;
  14418. server = "Corruptionpvp.no-ip.org";
  14419. anIntArrayArray825 = new int[104][104];
  14420. friendsNodeIDs = new int[200];
  14421. groundArray = new NodeList[4][104][104];
  14422. aBoolean831 = false;
  14423. aStream_834 = new Stream(new byte[17000]);
  14424. npcArray = new NPC[16384];
  14425. npcIndices = new int[16384];
  14426. anIntArray840 = new int[1000];
  14427. aStream_847 = Stream.create();
  14428. aBoolean848 = true;
  14429. openInterfaceID = -1;
  14430. currentExp = new int[Skills.skillsCount];
  14431. aBoolean872 = false;
  14432. anIntArray873 = new int[5];
  14433. anInt874 = -1;
  14434. aBooleanArray876 = new boolean[5];
  14435. drawFlames = false;
  14436. reportAbuseInput = "";
  14437. unknownInt10 = -1;
  14438. menuOpen = false;
  14439. inputString = "";
  14440. maxPlayers = 2048;
  14441. myPlayerIndex = 2047;
  14442. playerArray = new Player[maxPlayers];
  14443. playerIndices = new int[maxPlayers];
  14444. anIntArray894 = new int[maxPlayers];
  14445. aStreamArray895s = new Stream[maxPlayers];
  14446. anInt897 = 1;
  14447. anIntArrayArray901 = new int[104][104];
  14448. anInt902 = 0x766654;
  14449. aByteArray912 = new byte[16384];
  14450. currentStats = new int[Skills.skillsCount];
  14451. ignoreListAsLongs = new long[100];
  14452. loadingError = false;
  14453. anInt927 = 0x332d25;
  14454. anIntArray928 = new int[5];
  14455. anIntArrayArray929 = new int[104][104];
  14456. chatTypes = new int[500];
  14457. chatNames = new String[500];
  14458. chatMessages = new String[500];
  14459. chatButtons = new Sprite[4];
  14460. sideIcons = new Sprite[14];
  14461. sIcons483 = new Sprite[14];
  14462. newSideIcons = new Sprite[16];
  14463. sIcons459 = new Sprite[13];
  14464.  
  14465. redStones = new Sprite[16];
  14466. aBoolean954 = true;
  14467. friendsListAsLongs = new long[200];
  14468. currentSong = -1;
  14469. drawingFlames = false;
  14470. spriteDrawX = -1;
  14471. spriteDrawY = -1;
  14472. anIntArray968 = new int[33];
  14473. anIntArray969 = new int[256];
  14474. decompressors = new Decompressor[5];
  14475. variousSettings = new int[2000];
  14476. aBoolean972 = false;
  14477. anInt975 = 50;
  14478. anIntArray976 = new int[anInt975];
  14479. anIntArray977 = new int[anInt975];
  14480. anIntArray978 = new int[anInt975];
  14481. anIntArray979 = new int[anInt975];
  14482. anIntArray980 = new int[anInt975];
  14483. anIntArray981 = new int[anInt975];
  14484. anIntArray982 = new int[anInt975];
  14485. aStringArray983 = new String[anInt975];
  14486. anInt985 = -1;
  14487. hitMarks = new Sprite[22];
  14488. hitMark = new Sprite[4];
  14489. anIntArray990 = new int[5];
  14490. aBoolean994 = false;
  14491. anInt1002 = 0x23201b;
  14492. amountOrNameInput = "";
  14493. aClass19_1013 = new NodeList();
  14494. aBoolean1017 = false;
  14495. anInt1018 = -1;
  14496. anIntArray1030 = new int[5];
  14497. aBoolean1031 = false;
  14498. mapFunctions = new Sprite[100];
  14499. dialogID = -1;
  14500. maxStats = new int[Skills.skillsCount];
  14501. anIntArray1045 = new int[2000];
  14502. aBoolean1047 = true;
  14503. anIntArray1052 = new int[152];//map
  14504. anInt1054 = -1;
  14505. aClass19_1056 = new NodeList();
  14506. anIntArray1057 = new int[33];
  14507. aClass9_1059 = new RSInterface();
  14508. mapScenes = new Background[100];
  14509. barFillColor = 0x4d4233;
  14510. anIntArray1065 = new int[7];
  14511. anIntArray1072 = new int[1000];
  14512. anIntArray1073 = new int[1000];
  14513. aBoolean1080 = false;
  14514. friendsList = new String[200];
  14515. inStream = Stream.create();
  14516. expectedCRCs = new int[9];
  14517. menuActionCmd2 = new int[500];
  14518. menuActionCmd3 = new int[500];
  14519. menuActionID = new int[500];
  14520. menuActionCmd1 = new int[500];
  14521. headIcons = new Sprite[29];
  14522. skullIcons = new Sprite[20];
  14523. headIconsHint = new Sprite[20];
  14524. tabAreaAltered = false;
  14525. aString1121 = "";
  14526. atPlayerActions = new String[5];
  14527. atPlayerArray = new boolean[5];
  14528. anIntArrayArrayArray1129 = new int[4][13][13];
  14529. anInt1132 = 2;
  14530. aSpriteArray1140 = new Sprite[1000];
  14531. aBoolean1141 = false;
  14532. aBoolean1149 = false;
  14533. crosses = new Sprite[8];
  14534. musicEnabled = true;
  14535. needDrawTabArea = false;
  14536. loggedIn = false;
  14537. canMute = false;
  14538. aBoolean1159 = false;
  14539. aBoolean1160 = false;
  14540. anInt1171 = 1;
  14541. myUsername = "";
  14542. myPassword = "";
  14543. genericLoadingError = false;
  14544. reportAbuseInterfaceID = -1;
  14545. aClass19_1179 = new NodeList();
  14546. anInt1184 = 128;
  14547. invOverlayInterfaceID = -1;
  14548. stream = Stream.create();
  14549. menuActionName = new String[500];
  14550. anIntArray1203 = new int[5];
  14551. anIntArray1207 = new int[50];
  14552. anInt1210 = 2;
  14553. anInt1211 = 78;
  14554. promptInput = "";
  14555. //modIcons = new Background[2];
  14556. modIcons = new Sprite[7];
  14557. chatImages = new Sprite[7];
  14558. tabID = 3;
  14559. inputTaken = false;
  14560. songChanging = true;
  14561. anIntArray1229 = new int[152];//map
  14562. aClass11Array1230 = new Class11[4];
  14563. aBoolean1233 = false;
  14564. anIntArray1240 = new int[100];
  14565. anIntArray1241 = new int[50];
  14566. aBoolean1242 = false;
  14567. anIntArray1250 = new int[50];
  14568. rsAlreadyLoaded = false;
  14569. welcomeScreenRaised = true;
  14570. messagePromptRaised = false;
  14571. loginMessage1 = "";
  14572. loginMessage2 = "";
  14573. backDialogID = -1;
  14574. anInt1279 = 2;
  14575. bigX = new int[4000];
  14576. bigY = new int[4000];
  14577. anInt1289 = -1;
  14578. }
  14579.  
  14580. public int rights;
  14581. private Sprite loginHover;
  14582. private Sprite boxHover;
  14583. public int count;
  14584. public int backgroundCount;
  14585. public int opacityCount;
  14586. public String name;
  14587. public String disabledMessage;
  14588. public String clanname;
  14589. private final int[] chatRights;
  14590. public int chatTypeView;
  14591. public int clanChatMode;
  14592. public float LP;
  14593. public int duelMode;
  14594. /* Declare custom sprites */
  14595. //private Sprite chatArea;
  14596. public Sprite localSprite1;
  14597. private Sprite loadingPleaseWait;
  14598. private Sprite reestablish;
  14599. public Sprite backgroundFix;
  14600. private Sprite loadingBarFull;
  14601. private Sprite loadingBarEmpty;
  14602. private Sprite[] chatButtons;
  14603. //private Sprite tabArea;
  14604. private Sprite mapArea;
  14605. private Sprite tabHover;
  14606. private Sprite tabClicked;
  14607. private Sprite[] newSideIcons;
  14608. //private Sprite CustomMapback;
  14609. public Sprite[] CustomMapback = new Sprite[5];
  14610. public Sprite[] chatArea = new Sprite[5];
  14611. public Sprite[] tabArea = new Sprite[5];
  14612. //public Sprite[] mapArea = new Sprite[3];
  14613. /**/
  14614. private RSImageProducer leftFrame;
  14615. private RSImageProducer topFrame;
  14616. private RSImageProducer rightFrame;
  14617. private int ignoreCount;
  14618. private long aLong824;
  14619. private int[][] anIntArrayArray825;
  14620. private int[] friendsNodeIDs;
  14621. private NodeList[][][] groundArray;
  14622. private int[] anIntArray828;
  14623. private int[] anIntArray829;
  14624. private volatile boolean aBoolean831;
  14625. private Socket aSocket832;
  14626. private int loginScreenState;
  14627. private Stream aStream_834;
  14628. private NPC[] npcArray;
  14629. private int npcCount;
  14630. private int[] npcIndices;
  14631. private int anInt839;
  14632. private int[] anIntArray840;
  14633. private int anInt841;
  14634. private int anInt842;
  14635. private int anInt843;
  14636. private String aString844;
  14637. private int privateChatMode;
  14638. private Stream aStream_847;
  14639. private boolean aBoolean848;
  14640. private static int anInt849;
  14641. private int[] anIntArray850;
  14642. private int[] anIntArray851;
  14643. private int[] anIntArray852;
  14644. private int[] anIntArray853;
  14645. private static int anInt854;
  14646. private int anInt855;
  14647. private int openInterfaceID;
  14648. private int xCameraPos;
  14649. private int zCameraPos;
  14650. private int yCameraPos;
  14651. private int yCameraCurve;
  14652. private int xCameraCurve;
  14653. public int myPrivilege;
  14654. private final int[] currentExp;
  14655. private Sprite[] redStones;
  14656. private Sprite mapFlag;
  14657. private Sprite mapMarker;
  14658. private boolean aBoolean872;
  14659. private final int[] anIntArray873;
  14660. private int anInt874;
  14661. private final boolean[] aBooleanArray876;
  14662. private int weight;
  14663. private MouseDetection mouseDetection;
  14664. private volatile boolean drawFlames;
  14665. private String reportAbuseInput;
  14666. private int unknownInt10;
  14667. private boolean menuOpen;
  14668. private int anInt886;
  14669. private String inputString;
  14670. private final int maxPlayers;
  14671. private final int myPlayerIndex;
  14672. private Player[] playerArray;
  14673. private int playerCount;
  14674. private int[] playerIndices;
  14675. private int anInt893;
  14676. private int[] anIntArray894;
  14677. private Stream[] aStreamArray895s;
  14678. private int anInt896;
  14679. private int anInt897;
  14680. private int friendsCount;
  14681. private int anInt900;
  14682. private int[][] anIntArrayArray901;
  14683. private final int anInt902;
  14684. private byte[] aByteArray912;
  14685. private int anInt913;
  14686. private int crossX;
  14687. private int crossY;
  14688. private int crossIndex;
  14689. private int crossType;
  14690. private int plane;
  14691. private final int[] currentStats;
  14692. private static int anInt924;
  14693. private final long[] ignoreListAsLongs;
  14694. private boolean loadingError;
  14695. private final int anInt927;
  14696. private final int[] anIntArray928;
  14697. private int[][] anIntArrayArray929;
  14698. private Sprite aSprite_931;
  14699. private Sprite aSprite_932;
  14700. private int anInt933;
  14701. private int anInt934;
  14702. private int anInt935;
  14703. private int anInt936;
  14704. private int anInt937;
  14705. private int anInt938;
  14706. private static int anInt940;
  14707. private final int[] chatTypes;
  14708. private final String[] chatNames;
  14709. private final String[] chatMessages;
  14710. private int anInt945;
  14711. private WorldController worldController;
  14712. private Sprite[] sideIcons;
  14713. private Sprite[] sIcons483;
  14714. private Sprite[] sIcons459;
  14715. private int menuScreenArea;
  14716. private int menuOffsetX;
  14717. private int menuOffsetY;
  14718. private int menuWidth;
  14719. private int menuHeight;
  14720. private long aLong953;
  14721. private boolean aBoolean954;
  14722. private long[] friendsListAsLongs;
  14723. private String[] clanList = new String[100];
  14724. private int currentSong;
  14725. private static int nodeID = 10;
  14726. static int portOff;
  14727. static boolean clientData;
  14728. private static boolean isMembers = true;
  14729. private static boolean lowMem;
  14730. private volatile boolean drawingFlames;
  14731. private int spriteDrawX;
  14732. private int spriteDrawY;
  14733. private final int[] anIntArray965 = {
  14734. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  14735. };
  14736. private Background titleBox;
  14737. public Sprite titleBox1;
  14738. private Background titleButton;
  14739. private final int[] anIntArray968;
  14740. private final int[] anIntArray969;
  14741. final Decompressor[] decompressors;
  14742. public int variousSettings[];
  14743. private boolean aBoolean972;
  14744. private final int anInt975;
  14745. private final int[] anIntArray976;
  14746. private final int[] anIntArray977;
  14747. private final int[] anIntArray978;
  14748. private final int[] anIntArray979;
  14749. private final int[] anIntArray980;
  14750. private final int[] anIntArray981;
  14751. private final int[] anIntArray982;
  14752. private final String[] aStringArray983;
  14753. private int anInt984;
  14754. private int anInt985;
  14755. private static int anInt986;
  14756. private Sprite[] hitMarks;
  14757. private Sprite[] hitMark;
  14758. private int anInt988;
  14759. private int anInt989;
  14760. private final int[] anIntArray990;
  14761. private static boolean aBoolean993;
  14762. private final boolean aBoolean994;
  14763. private int anInt995;
  14764. private int anInt996;
  14765. private int anInt997;
  14766. private int anInt998;
  14767. private int anInt999;
  14768. private ISAACRandomGen encryption;
  14769. private Sprite mapEdge;
  14770. private Sprite multiOverlay;
  14771. private final int anInt1002;
  14772. static final int[][] anIntArrayArray1003 = {
  14773. {
  14774. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  14775. 2983, 54193
  14776. }, {
  14777. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  14778. 56621, 4783, 1341, 16578, 35003, 25239
  14779. }, {
  14780. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  14781. 10153, 56621, 4783, 1341, 16578, 35003
  14782. }, {
  14783. 4626, 11146, 6439, 12, 4758, 10270
  14784. }, {
  14785. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  14786. }
  14787. };
  14788. private String amountOrNameInput;
  14789. private static int anInt1005;
  14790. private int daysSinceLastLogin;
  14791. private int pktSize;
  14792. private int pktType;
  14793. private int anInt1009;
  14794. private int anInt1010;
  14795. private int anInt1011;
  14796. private NodeList aClass19_1013;
  14797. private int anInt1014;
  14798. private int anInt1015;
  14799. private int anInt1016;
  14800. private boolean aBoolean1017;
  14801. private int anInt1018;
  14802. private static final int[] anIntArray1019;
  14803. private int anInt1021;
  14804. private int anInt1022;
  14805. private int loadingStage;
  14806. private Sprite scrollBar1;
  14807. private Sprite scrollBar2;
  14808. private Sprite scrollBar3;
  14809. private Sprite scrollBar4;
  14810. private int anInt1026;
  14811. private Background backBase1;
  14812. private Background backBase2;
  14813. private Background backHmid1;
  14814. private final int[] anIntArray1030;
  14815. private boolean aBoolean1031;
  14816. private Sprite[] mapFunctions;
  14817. private int baseX;
  14818. private int baseY;
  14819. private int anInt1036;
  14820. private int anInt1037;
  14821. private int loginFailures;
  14822. private int anInt1039;
  14823. private int anInt1040;
  14824. private int anInt1041;
  14825. private int dialogID;
  14826. private final int[] maxStats;
  14827. private final int[] anIntArray1045;
  14828. private int anInt1046;
  14829. private boolean aBoolean1047;
  14830. private int anInt1048;
  14831. private String aString1049;
  14832. private static int anInt1051;
  14833. private final int[] anIntArray1052;
  14834. private NamedArchive titleStreamLoader;
  14835. private int anInt1054;
  14836. private int anInt1055;
  14837. private NodeList aClass19_1056;
  14838. private final int[] anIntArray1057;
  14839. public final RSInterface aClass9_1059;
  14840. private Background[] mapScenes;
  14841. private static int anInt1061;
  14842. private int anInt1062;
  14843. private final int barFillColor;
  14844. private int friendsListAction;
  14845. private final int[] anIntArray1065;
  14846. private int mouseInvInterfaceIndex;
  14847. private int lastActiveInvInterface;
  14848. public OnDemandFetcher onDemandFetcher;
  14849. private int anInt1069;
  14850. private int anInt1070;
  14851. private int anInt1071;
  14852. private int[] anIntArray1072;
  14853. private int[] anIntArray1073;
  14854. private Sprite mapDotItem;
  14855. private Sprite mapDotNPC;
  14856. private Sprite mapDotPlayer;
  14857. private Sprite mapDotFriend;
  14858. private Sprite mapDotTeam;
  14859. private Sprite mapDotClan;
  14860. private int anInt1079;
  14861. private boolean aBoolean1080;
  14862. private String[] friendsList;
  14863. private Stream inStream;
  14864. private int anInt1084;
  14865. private int anInt1085;
  14866. private int activeInterfaceType;
  14867. private int anInt1087;
  14868. private int anInt1088;
  14869. public static int anInt1089;
  14870. private final int[] expectedCRCs;
  14871. public int[] menuActionCmd2;
  14872. public int[] menuActionCmd3;
  14873. public int[] menuActionID;
  14874. public int[] menuActionCmd1;
  14875. private Sprite[] headIcons;
  14876. private Sprite[] skullIcons;
  14877. private Sprite[] headIconsHint;
  14878. private static int anInt1097;
  14879. private int anInt1098;
  14880. private int anInt1099;
  14881. private int anInt1100;
  14882. private int anInt1101;
  14883. private int anInt1102;
  14884. private static boolean tabAreaAltered;
  14885. private int anInt1104;
  14886. private RSImageProducer aRSImageProducer_1107;
  14887. private RSImageProducer aRSImageProducer_1108;
  14888. private RSImageProducer loginScreenArea;
  14889. private RSImageProducer leftSideFlame;
  14890. private RSImageProducer rightSideFlame;
  14891. private RSImageProducer gameLogo;
  14892. private RSImageProducer aRSImageProducer_1113;
  14893. private RSImageProducer aRSImageProducer_1114;
  14894. private RSImageProducer aRSImageProducer_1115;
  14895. private static int anInt1117;
  14896. private int membersInt;
  14897. private String aString1121;
  14898. private Sprite compass;
  14899. private RSImageProducer aRSImageProducer_1123;
  14900. private RSImageProducer aRSImageProducer_1124;
  14901. private RSImageProducer aRSImageProducer_1125;
  14902. public static Player myPlayer;
  14903. private final String[] atPlayerActions;
  14904. private final boolean[] atPlayerArray;
  14905. private final int[][][] anIntArrayArrayArray1129;
  14906. private final int[] tabInterfaceIDs = {
  14907. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  14908. -1, -1, -1, -1, -1, -1, -1
  14909. };
  14910. private int anInt1131;
  14911. private int anInt1132;
  14912. public int menuActionRow;
  14913. private static int anInt1134;
  14914. private int spellSelected;
  14915. private int anInt1137;
  14916. private int spellUsableOn;
  14917. private String spellTooltip;
  14918. private Sprite[] aSpriteArray1140;
  14919. private boolean aBoolean1141;
  14920. private static int anInt1142;
  14921. public int energy;
  14922. private boolean aBoolean1149;
  14923. private Sprite[] crosses;
  14924. private boolean musicEnabled;
  14925. private Background[] aBackgroundArray1152s;
  14926. private static boolean needDrawTabArea;
  14927. private int unreadMessages;
  14928. private static int anInt1155;
  14929. private static boolean fpsOn;
  14930. public boolean loggedIn;
  14931. private boolean canMute;
  14932. private boolean aBoolean1159;
  14933. private boolean aBoolean1160;
  14934. static int loopCycle;
  14935. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  14936. private RSImageProducer inventoryBackImage;
  14937. private RSImageProducer mapEdgeIP;
  14938. private RSImageProducer mapBackImage;
  14939. private RSImageProducer inGameScreen;
  14940. private RSImageProducer chatBackImage;
  14941. private int daysSinceRecovChange;
  14942. private RSSocket socketStream;
  14943. private int anInt1169;
  14944. private int minimapInt3;
  14945. private int anInt1171;
  14946. private long aLong1172;
  14947. private String myUsername;
  14948. private String myPassword;
  14949. private static int anInt1175;
  14950. private boolean genericLoadingError;
  14951. private final int[] anIntArray1177 = {
  14952. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  14953. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  14954. 2, 2, 3
  14955. };
  14956. private int reportAbuseInterfaceID;
  14957. private NodeList aClass19_1179;
  14958. private int[] anIntArray1180;
  14959. private int[] anIntArray1181;
  14960. private int[] anIntArray1182;
  14961. private byte[][] aByteArrayArray1183;
  14962. private int anInt1184;
  14963. private int minimapInt1;
  14964. private int anInt1186;
  14965. private int anInt1187;
  14966. private static int anInt1188;
  14967. private int invOverlayInterfaceID;
  14968. private int[] anIntArray1190;
  14969. private int[] anIntArray1191;
  14970. public Stream stream;
  14971. private int anInt1193;
  14972. private int splitPrivateChat;
  14973. private Background mapBack;
  14974. public String[] menuActionName;
  14975. private Sprite aSprite_1201;
  14976. private Sprite aSprite_1202;
  14977. private final int[] anIntArray1203;
  14978. static final int[] anIntArray1204 = {
  14979. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  14980. 58654, 5027, 1457, 16565, 34991, 25486
  14981. };
  14982. private static boolean flagged;
  14983. private final int[] anIntArray1207;
  14984. private int anInt1208;
  14985. private int minimapInt2;
  14986. private int anInt1210;
  14987. private int anInt1211;
  14988. private String promptInput;
  14989. private int anInt1213;
  14990. private int[][][] intGroundArray;
  14991. private long aLong1215;
  14992. private int loginScreenCursorPos;
  14993. //private final Background[] modIcons;
  14994. public final Sprite[] modIcons;
  14995. private long aLong1220;
  14996. private static int tabID;
  14997. private int anInt1222;
  14998. public static boolean inputTaken;
  14999. public int inputDialogState;
  15000. private static int anInt1226;
  15001. private int nextSong;
  15002. private boolean songChanging;
  15003. private final int[] anIntArray1229;
  15004. private Class11[] aClass11Array1230;
  15005. public static int anIntArray1232[];
  15006. private boolean aBoolean1233;
  15007. private int[] anIntArray1234;
  15008. private int[] anIntArray1235;
  15009. private int[] anIntArray1236;
  15010. private int anInt1237;
  15011. private int anInt1238;
  15012. public final int anInt1239 = 100;
  15013. private final int[] anIntArray1240;
  15014. private final int[] anIntArray1241;
  15015. private boolean aBoolean1242;
  15016. private int atInventoryLoopCycle;
  15017. private int atInventoryInterface;
  15018. private int atInventoryIndex;
  15019. private int atInventoryInterfaceType;
  15020. private byte[][] aByteArrayArray1247;
  15021. private int tradeMode;
  15022. private int anInt1249;
  15023. private final int[] anIntArray1250;
  15024. private int anInt1251;
  15025. private final boolean rsAlreadyLoaded;
  15026. private int anInt1253;
  15027. private int anInt1254;
  15028. private boolean welcomeScreenRaised;
  15029. private boolean messagePromptRaised;
  15030. private int anInt1257;
  15031. private byte[][][] byteGroundArray;
  15032. private int prevSong;
  15033. private int destX;
  15034. private int destY;
  15035. private Sprite aSprite_1263;
  15036. private int anInt1264;
  15037. private int anInt1265;
  15038. private String loginMessage1;
  15039. private String loginMessage2;
  15040. private int anInt1268;
  15041. private int anInt1269;
  15042. public RSFont smallText;
  15043. public RSFont aTextDrawingArea_1271;
  15044. private RSFont chatTextDrawingArea;
  15045. private int anInt1275;
  15046. private int backDialogID;
  15047. private int anInt1278;
  15048. private int anInt1279;
  15049. private int[] bigX;
  15050. private int[] bigY;
  15051. private int itemSelected;
  15052. private int anInt1283;
  15053. private int anInt1284;
  15054. private int anInt1285;
  15055. private String selectedItemName;
  15056. private int publicChatMode;
  15057. private static int anInt1288;
  15058. private int anInt1289;
  15059. public static int anInt1290;
  15060. public static String server = "";
  15061.  
  15062. public int drawCount;
  15063. public int fullscreenInterfaceID;
  15064. public int anInt1044;//377
  15065. public int anInt1129;//377
  15066. public int anInt1315;//377
  15067. public int anInt1500;//377
  15068. public int anInt1501;//377
  15069. public int[] fullScreenTextureArray;
  15070. public void resetAllImageProducers() {
  15071. if (super.fullGameScreen != null) {
  15072. return;
  15073. }
  15074. chatBackImage = null;
  15075. mapBackImage = null;
  15076. inventoryBackImage = null;
  15077. inGameScreen = null;
  15078. aRSImageProducer_1124 = null;
  15079. aRSImageProducer_1125 = null;
  15080. aRSImageProducer_1107 = null;
  15081. aRSImageProducer_1108 = null;
  15082. loginScreenArea = null;
  15083. leftSideFlame = null;
  15084. rightSideFlame = null;
  15085. gameLogo = null;
  15086. aRSImageProducer_1113 = null;
  15087. aRSImageProducer_1114 = null;
  15088. aRSImageProducer_1115 = null;
  15089. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  15090. welcomeScreenRaised = true;
  15091. }
  15092. public boolean spriteChanged = false;
  15093. public int getSpriteID(){
  15094. spriteChanged = true;
  15095. if(is562)
  15096. return 4;
  15097. if(is459)
  15098. return 3;
  15099. if(is480)
  15100. return 2;
  15101. if(is508 || is525)
  15102. return 1;
  15103. if(is474)
  15104. return 0;
  15105. else
  15106. return 0;
  15107. }
  15108. public int getMoneyOrbColor(int cashAmount){
  15109. if(cashAmount >= 100000 && cashAmount <= 999999){
  15110. return 0xffffff;
  15111. } else {
  15112. return 65280;
  15113. }
  15114. }
  15115. public void launchURL(String url) {
  15116. String osName = System.getProperty("os.name");
  15117. try {
  15118. if (osName.startsWith("Mac OS")) {
  15119. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  15120. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  15121. openURL.invoke(null, new Object[] {url});
  15122. } else if (osName.startsWith("Windows"))
  15123. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  15124. else { //assume Unix or Linux
  15125. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  15126. String browser = null;
  15127. for (int count = 0; count < browsers.length && browser == null; count++)
  15128. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  15129. browser = browsers[count];
  15130. if (browser == null) {
  15131. throw new Exception("Could not find web browser");
  15132. } else
  15133. Runtime.getRuntime().exec(new String[] {browser, url});
  15134. }
  15135. } catch (Exception e) {
  15136. pushMessage("Failed to open URL.", 0, "");
  15137. }
  15138. }
  15139.  
  15140. static {
  15141. anIntArray1019 = new int[99];
  15142. int i = 0;
  15143. for(int j = 0; j < 99; j++) {
  15144. int l = j + 1;
  15145. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  15146. i += i1;
  15147. anIntArray1019[j] = i / 4;
  15148. }
  15149. anIntArray1232 = new int[32];
  15150. i = 2;
  15151. for(int k = 0; k < 32; k++) {
  15152. anIntArray1232[k] = i - 1;
  15153. i += i;
  15154. }
  15155. }
  15156. }
Advertisement
Add Comment
Please, Sign In to add comment